configure.ac
author James Bowes <jbowes@redhat.com>
Wed Jul 09 10:11:13 2008 -0400 (2008-07-09)
changeset 318 829d6711b316
parent 272 bff7cf1e7cb6
child 319 ed8155380e45
permissions -rw-r--r--
Use strings to identify section types in the on-disk repo format.

Previously, a given razor file type had a fixed number of sections in a
fixed order, identified by an integer type. Now, sections are identified
by a named string (stored in a string pool after the section lists).

This will allow for razor files to contain arbitrary sections.

For bonus points, also drop the 4k section alignment and change the
magic byte string to "RZDB".

committer: Kristian H?gsberg <krh@redhat.com>
rhughes@241
     1
dnl Process this file with autoconf to produce a configure script.
rhughes@241
     2
rhughes@241
     3
AC_PREREQ(2.59c)
richard@272
     4
AC_INIT(razor, 0.1, krh@redhat.com)
rhughes@241
     5
AM_INIT_AUTOMAKE(razor, 0.1)
rhughes@241
     6
AM_CONFIG_HEADER(config.h)
rhughes@241
     7
AM_MAINTAINER_MODE
rhughes@241
     8
rhughes@241
     9
# libtool versioning - this applies to all libraries in this package
rhughes@241
    10
#
rhughes@241
    11
# See http://sources.redhat.com/autobook/autobook/autobook_91.html#SEC91 for details
rhughes@241
    12
#
rhughes@241
    13
LT_CURRENT=1
rhughes@241
    14
LT_REVISION=0
rhughes@241
    15
LT_AGE=0
rhughes@241
    16
AC_SUBST(LT_CURRENT)
rhughes@241
    17
AC_SUBST(LT_REVISION)
rhughes@241
    18
AC_SUBST(LT_AGE)
rhughes@241
    19
rhughes@241
    20
AC_ISC_POSIX
rhughes@241
    21
AC_PROG_CC
rhughes@241
    22
AM_PROG_CC_STDC
rhughes@241
    23
AC_HEADER_STDC
rhughes@241
    24
AM_PROG_LIBTOOL
rhughes@241
    25
AC_PROG_MAKE_SET
rhughes@241
    26
AC_PROG_LN_S
rhughes@241
    27
AC_SYS_LARGEFILE
rhughes@241
    28
AM_PROG_CC_C_O
rhughes@241
    29
rhughes@241
    30
# Taken from dbus
rhughes@241
    31
AC_ARG_ENABLE(ansi,             [  --enable-ansi           enable -ansi -pedantic gcc flags],enable_ansi=$enableval,enable_ansi=no)
rhughes@241
    32
AC_ARG_ENABLE(verbose-mode,     [  --enable-verbose-mode   support verbose debug mode],enable_verbose_mode=$enableval,enable_verbose_mode=$USE_MAINTAINER_MODE)
rhughes@241
    33
rhughes@241
    34
if test "${enable_verbose_mode}" != no; then
rhughes@241
    35
    # To get -rdynamic you pass -export-dynamic to libtool.
rhughes@241
    36
    AC_DEFINE(BUILT_R_DYNAMIC,1,[whether -export-dynamic was passed to libtool])
rhughes@241
    37
    R_DYNAMIC_LDFLAG=-export-dynamic
rhughes@241
    38
else
rhughes@241
    39
    R_DYNAMIC_LDFLAG=
rhughes@241
    40
fi
rhughes@241
    41
AC_SUBST(R_DYNAMIC_LDFLAG)
rhughes@241
    42
rhughes@241
    43
#### gcc warning flags
rhughes@241
    44
rhughes@241
    45
if test "x$GCC" = "xyes"; then
rhughes@241
    46
  changequote(,)dnl
rhughes@241
    47
  case " $CFLAGS " in
rhughes@241
    48
  *[\ \	]-Wall[\ \	]*) ;;
rhughes@241
    49
  *) CFLAGS="$CFLAGS -Wall" ;;
rhughes@241
    50
  esac
rhughes@241
    51
rhughes@241
    52
  case " $CFLAGS " in
rhughes@241
    53
  *[\ \	]-Wchar-subscripts[\ \	]*) ;;
rhughes@241
    54
  *) CFLAGS="$CFLAGS -Wchar-subscripts" ;;
rhughes@241
    55
  esac
rhughes@241
    56
rhughes@241
    57
  case " $CFLAGS " in
rhughes@241
    58
  *[\ \	]-Wmissing-declarations[\ \	]*) ;;
rhughes@241
    59
  *) CFLAGS="$CFLAGS -Wmissing-declarations" ;;
rhughes@241
    60
  esac
rhughes@241
    61
rhughes@241
    62
  case " $CFLAGS " in
rhughes@241
    63
  *[\ \	]-Wnested-externs[\ \	]*) ;;
rhughes@241
    64
  *) CFLAGS="$CFLAGS -Wnested-externs" ;;
rhughes@241
    65
  esac
rhughes@241
    66
rhughes@241
    67
  case " $CFLAGS " in
rhughes@241
    68
  *[\ \	]-Wcast-align[\ \	]*) ;;
rhughes@241
    69
  *) CFLAGS="$CFLAGS -Wcast-align" ;;
rhughes@241
    70
  esac
rhughes@241
    71
rhughes@241
    72
  case " $CFLAGS " in
rhughes@241
    73
  *[\ \	]-Wformat[\ \	]*) ;;
rhughes@241
    74
  *) CFLAGS="$CFLAGS -Wformat" ;;
rhughes@241
    75
  esac
rhughes@241
    76
rhughes@241
    77
  case " $CFLAGS " in
rhughes@241
    78
  *[\ \	]-Wformat-security[\ \	]*) ;;
rhughes@241
    79
  *) CFLAGS="$CFLAGS -Wformat-security" ;;
rhughes@241
    80
  esac
rhughes@241
    81
rhughes@241
    82
  if test "x$enable_ansi" = "xyes"; then
rhughes@241
    83
    case " $CFLAGS " in
rhughes@241
    84
    *[\ \	]-ansi[\ \	]*) ;;
rhughes@241
    85
    *) CFLAGS="$CFLAGS -ansi" ;;
rhughes@241
    86
    esac
rhughes@241
    87
rhughes@241
    88
    case " $CFLAGS " in
rhughes@241
    89
    *[\ \	]-D_POSIX_C_SOURCE*) ;;
rhughes@241
    90
    *) CFLAGS="$CFLAGS -D_POSIX_C_SOURCE=199309L" ;;
rhughes@241
    91
    esac
rhughes@241
    92
rhughes@241
    93
    case " $CFLAGS " in
rhughes@241
    94
    *[\ \	]-D_BSD_SOURCE[\ \	]*) ;;
rhughes@241
    95
    *) CFLAGS="$CFLAGS -D_BSD_SOURCE" ;;
rhughes@241
    96
    esac
rhughes@241
    97
rhughes@241
    98
    case " $CFLAGS " in
rhughes@241
    99
    *[\ \	]-pedantic[\ \	]*) ;;
rhughes@241
   100
    *) CFLAGS="$CFLAGS -pedantic" ;;
rhughes@241
   101
    esac
rhughes@241
   102
  fi
rhughes@241
   103
  changequote([,])dnl
rhughes@241
   104
fi
rhughes@241
   105
krh@269
   106
krh@269
   107
# gcc default visibility stuff
krh@269
   108
krh@269
   109
have_gcc4=no
krh@269
   110
AC_MSG_CHECKING(for -fvisibility)
krh@269
   111
AC_COMPILE_IFELSE([
krh@269
   112
#if defined(__GNUC__) && (__GNUC__ >= 4)
krh@269
   113
#else
krh@269
   114
#error Need GCC 4.0 for visibility
krh@269
   115
#endif
krh@269
   116
int main () { return 0; } 
krh@269
   117
], have_gcc4=yes)
krh@269
   118
krh@269
   119
if test "x$have_gcc4" = "xyes"; then
krh@269
   120
   CFLAGS="$CFLAGS -fvisibility=hidden"
krh@269
   121
fi
krh@269
   122
AC_MSG_RESULT($have_gcc4)
krh@269
   123
krh@269
   124
rhughes@241
   125
PKG_CHECK_MODULES(CURL, [libcurl])
rhughes@241
   126
AC_SUBST(CURL_CFLAGS)
rhughes@241
   127
AC_SUBST(CURL_LIBS)
rhughes@241
   128
rhughes@241
   129
ZLIB_LIBS=""
rhughes@241
   130
AC_ARG_WITH(zlib, [  --with-zlib=<dir>       Use zlib from here],
rhughes@241
   131
                      [
rhughes@241
   132
                      zlib=$withval
rhughes@241
   133
                      CPPFLAGS="$CPPFLAGS -I$withval/include"
rhughes@241
   134
                      LDFLAGS="$LDFLAGS -L$withval/lib"
rhughes@241
   135
                      ]
rhughes@241
   136
                      )
rhughes@241
   137
AC_CHECK_HEADERS(zlib.h, [AC_DEFINE(HAVE_ZLIB_H)],
rhughes@241
   138
                 [AC_MSG_ERROR([Can't find zlib.h. Please install zlib.])])
rhughes@241
   139
AC_CHECK_LIB(z, inflate, [ZLIB_LIBS="-lz"],
rhughes@241
   140
	     [AC_MSG_ERROR([Can't find zlib library. Please install zlib.])])
rhughes@241
   141
AC_SUBST(ZLIB_LIBS)
rhughes@241
   142
rhughes@241
   143
EXPAT_LIB=""
rhughes@241
   144
AC_ARG_WITH(expat, [  --with-expat=<dir>      Use expat from here],
rhughes@241
   145
                      [
rhughes@241
   146
                      expat=$withval
rhughes@241
   147
                      CPPFLAGS="$CPPFLAGS -I$withval/include"
rhughes@241
   148
                      LDFLAGS="$LDFLAGS -L$withval/lib"
rhughes@241
   149
                      ]
rhughes@241
   150
                      )
rhughes@241
   151
AC_CHECK_HEADERS(expat.h, [AC_DEFINE(HAVE_EXPAT_H)], 
rhughes@241
   152
		 [AC_MSG_ERROR([Can't find expat.h. Please install expat.])])
rhughes@241
   153
AC_CHECK_LIB(expat, XML_ParserCreate, [EXPAT_LIBS="-lexpat"],
rhughes@241
   154
	     [AC_MSG_ERROR([Can't find expat library. Please install expat.])])
rhughes@241
   155
AC_SUBST(EXPAT_LIBS)
rhughes@241
   156
rhughes@241
   157
RPM_LIB=""
rhughes@241
   158
AC_ARG_WITH(rpm, [  --with-rpm=<dir>      Use rpm from here],
rhughes@241
   159
                      [
rhughes@241
   160
                      rpm=$withval
rhughes@241
   161
                      CPPFLAGS="$CPPFLAGS -I$withval/include"
rhughes@241
   162
                      LDFLAGS="$LDFLAGS -L$withval/lib"
rhughes@241
   163
                      ]
rhughes@241
   164
                      )
rhughes@241
   165
AC_CHECK_HEADERS(rpm/rpmlib.h, [], 
rhughes@241
   166
		 [AC_MSG_ERROR([Can't find rpm/rpmlib.h. Please install rpm-devel.])])
rhughes@241
   167
AC_CHECK_LIB(rpm,rpmdbOpen,[RPM_LIBS="-lrpm"],
rhughes@241
   168
	     [AC_MSG_ERROR([Can't find rpm library. Please install rpm-devel.])])
rhughes@241
   169
AC_SUBST(RPM_LIBS)
rhughes@241
   170
rhughes@241
   171
if test "x$GCC" = "xyes"; then
rhughes@241
   172
  LDFLAGS="-Wl,--as-needed $LDFLAGS"
rhughes@241
   173
fi
rhughes@241
   174
rhughes@241
   175
# *****************************
rhughes@241
   176
# Make available to Makefile.am
rhughes@241
   177
# *****************************
rhughes@241
   178
AC_SUBST(SYSCONFDIR, $sysconfdir)
rhughes@241
   179
rhughes@241
   180
# ********************
rhughes@241
   181
# Internationalisation
rhughes@241
   182
# ********************
rhughes@241
   183
rhughes@241
   184
IT_PROG_INTLTOOL([0.36.0])
rhughes@241
   185
GETTEXT_PACKAGE=razor
rhughes@241
   186
AC_SUBST([GETTEXT_PACKAGE])
rhughes@241
   187
AM_GLIB_GNU_GETTEXT
rhughes@241
   188
AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE],["$GETTEXT_PACKAGE"],[gettext domain])
rhughes@241
   189
krh@262
   190
GTK_DOC_CHECK([1.9])
krh@262
   191
rhughes@241
   192
AC_OUTPUT([
rhughes@241
   193
Makefile
rhughes@241
   194
data/razor.pc
rhughes@241
   195
data/Makefile
rhughes@241
   196
librazor/Makefile
rhughes@241
   197
src/Makefile
rhughes@241
   198
docs/Makefile
krh@262
   199
docs/version.xml
rhughes@241
   200
po/Makefile.in
rhughes@241
   201
])
rhughes@241
   202
rhughes@241
   203
dnl ==========================================================================
rhughes@241
   204
echo "
rhughes@241
   205
                  razor $VERSION
rhughes@241
   206
                =================
rhughes@241
   207
rhughes@241
   208
        prefix:                     ${prefix}
rhughes@241
   209
        libdir:                     ${libdir}
rhughes@241
   210
        libexecdir:                 ${libexecdir}
rhughes@241
   211
        bindir:                     ${bindir}
rhughes@241
   212
        sbindir:                    ${sbindir}
rhughes@241
   213
        datadir:                    ${datadir}
rhughes@241
   214
        sysconfdir:                 ${sysconfdir}
rhughes@241
   215
        localstatedir:              ${localstatedir}
rhughes@241
   216
        docdir:                     ${docdir}
rhughes@241
   217
rhughes@241
   218
        compiler:                   ${CC}
rhughes@241
   219
        cflags:                     ${CFLAGS}
rhughes@241
   220
        Maintainer mode:            ${USE_MAINTAINER_MODE}
rhughes@241
   221
        Building verbose mode:      ${enable_verbose_mode}
krh@294
   222
        Building gtk-doc:           ${enable_gtk_doc}
rhughes@241
   223
"