Fix configure.ac version, remove /usr/bin/rpm workaround from spec file.
committer: Kristian H?gsberg <krh@redhat.com>
1 dnl Process this file with autoconf to produce a configure script.
4 AC_INIT(razor, 0.1, krh@redhat.com)
5 AM_INIT_AUTOMAKE(razor, 0.1)
6 AM_CONFIG_HEADER(config.h)
9 # libtool versioning - this applies to all libraries in this package
11 # See http://sources.redhat.com/autobook/autobook/autobook_91.html#SEC91 for details
31 AC_ARG_ENABLE(ansi, [ --enable-ansi enable -ansi -pedantic gcc flags],enable_ansi=$enableval,enable_ansi=no)
32 AC_ARG_ENABLE(verbose-mode, [ --enable-verbose-mode support verbose debug mode],enable_verbose_mode=$enableval,enable_verbose_mode=$USE_MAINTAINER_MODE)
34 if test "${enable_verbose_mode}" != no; then
35 # To get -rdynamic you pass -export-dynamic to libtool.
36 AC_DEFINE(BUILT_R_DYNAMIC,1,[whether -export-dynamic was passed to libtool])
37 R_DYNAMIC_LDFLAG=-export-dynamic
41 AC_SUBST(R_DYNAMIC_LDFLAG)
43 #### gcc warning flags
45 if test "x$GCC" = "xyes"; then
48 *[\ \ ]-Wall[\ \ ]*) ;;
49 *) CFLAGS="$CFLAGS -Wall" ;;
53 *[\ \ ]-Wchar-subscripts[\ \ ]*) ;;
54 *) CFLAGS="$CFLAGS -Wchar-subscripts" ;;
58 *[\ \ ]-Wmissing-declarations[\ \ ]*) ;;
59 *) CFLAGS="$CFLAGS -Wmissing-declarations" ;;
63 *[\ \ ]-Wnested-externs[\ \ ]*) ;;
64 *) CFLAGS="$CFLAGS -Wnested-externs" ;;
68 *[\ \ ]-Wcast-align[\ \ ]*) ;;
69 *) CFLAGS="$CFLAGS -Wcast-align" ;;
73 *[\ \ ]-Wformat[\ \ ]*) ;;
74 *) CFLAGS="$CFLAGS -Wformat" ;;
78 *[\ \ ]-Wformat-security[\ \ ]*) ;;
79 *) CFLAGS="$CFLAGS -Wformat-security" ;;
82 if test "x$enable_ansi" = "xyes"; then
84 *[\ \ ]-ansi[\ \ ]*) ;;
85 *) CFLAGS="$CFLAGS -ansi" ;;
89 *[\ \ ]-D_POSIX_C_SOURCE*) ;;
90 *) CFLAGS="$CFLAGS -D_POSIX_C_SOURCE=199309L" ;;
94 *[\ \ ]-D_BSD_SOURCE[\ \ ]*) ;;
95 *) CFLAGS="$CFLAGS -D_BSD_SOURCE" ;;
99 *[\ \ ]-pedantic[\ \ ]*) ;;
100 *) CFLAGS="$CFLAGS -pedantic" ;;
107 # gcc default visibility stuff
110 AC_MSG_CHECKING(for -fvisibility)
112 #if defined(__GNUC__) && (__GNUC__ >= 4)
114 #error Need GCC 4.0 for visibility
116 int main () { return 0; }
119 if test "x$have_gcc4" = "xyes"; then
120 CFLAGS="$CFLAGS -fvisibility=hidden"
122 AC_MSG_RESULT($have_gcc4)
125 PKG_CHECK_MODULES(CURL, [libcurl])
126 AC_SUBST(CURL_CFLAGS)
130 AC_ARG_WITH(zlib, [ --with-zlib=<dir> Use zlib from here],
133 CPPFLAGS="$CPPFLAGS -I$withval/include"
134 LDFLAGS="$LDFLAGS -L$withval/lib"
137 AC_CHECK_HEADERS(zlib.h, [AC_DEFINE(HAVE_ZLIB_H)],
138 [AC_MSG_ERROR([Can't find zlib.h. Please install zlib.])])
139 AC_CHECK_LIB(z, inflate, [ZLIB_LIBS="-lz"],
140 [AC_MSG_ERROR([Can't find zlib library. Please install zlib.])])
144 AC_ARG_WITH(expat, [ --with-expat=<dir> Use expat from here],
147 CPPFLAGS="$CPPFLAGS -I$withval/include"
148 LDFLAGS="$LDFLAGS -L$withval/lib"
151 AC_CHECK_HEADERS(expat.h, [AC_DEFINE(HAVE_EXPAT_H)],
152 [AC_MSG_ERROR([Can't find expat.h. Please install expat.])])
153 AC_CHECK_LIB(expat, XML_ParserCreate, [EXPAT_LIBS="-lexpat"],
154 [AC_MSG_ERROR([Can't find expat library. Please install expat.])])
158 AC_ARG_WITH(rpm, [ --with-rpm=<dir> Use rpm from here],
161 CPPFLAGS="$CPPFLAGS -I$withval/include"
162 LDFLAGS="$LDFLAGS -L$withval/lib"
165 AC_CHECK_HEADERS(rpm/rpmlib.h, [],
166 [AC_MSG_ERROR([Can't find rpm/rpmlib.h. Please install rpm-devel.])])
167 AC_CHECK_LIB(rpm,rpmdbOpen,[RPM_LIBS="-lrpm"],
168 [AC_MSG_ERROR([Can't find rpm library. Please install rpm-devel.])])
171 if test "x$GCC" = "xyes"; then
172 LDFLAGS="-Wl,--as-needed $LDFLAGS"
175 # *****************************
176 # Make available to Makefile.am
177 # *****************************
178 AC_SUBST(SYSCONFDIR, $sysconfdir)
180 # ********************
181 # Internationalisation
182 # ********************
184 IT_PROG_INTLTOOL([0.36.0])
185 GETTEXT_PACKAGE=razor
186 AC_SUBST([GETTEXT_PACKAGE])
188 AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE],["$GETTEXT_PACKAGE"],[gettext domain])
203 dnl ==========================================================================
210 libexecdir: ${libexecdir}
214 sysconfdir: ${sysconfdir}
215 localstatedir: ${localstatedir}
220 Maintainer mode: ${USE_MAINTAINER_MODE}
221 Building verbose mode: ${enable_verbose_mode}