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
24 AC_CHECK_HEADERS([sys/mman.h])
32 AC_ARG_ENABLE(ansi, [ --enable-ansi enable -ansi -pedantic gcc flags],enable_ansi=$enableval,enable_ansi=no)
33 AC_ARG_ENABLE(verbose-mode, [ --enable-verbose-mode support verbose debug mode],enable_verbose_mode=$enableval,enable_verbose_mode=$USE_MAINTAINER_MODE)
35 if test "${enable_verbose_mode}" != no; then
36 # To get -rdynamic you pass -export-dynamic to libtool.
37 AC_DEFINE(BUILT_R_DYNAMIC,1,[whether -export-dynamic was passed to libtool])
38 R_DYNAMIC_LDFLAG=-export-dynamic
42 AC_SUBST(R_DYNAMIC_LDFLAG)
44 #### gcc warning flags
46 if test "x$GCC" = "xyes"; then
49 *[\ \ ]-Wall[\ \ ]*) ;;
50 *) CFLAGS="$CFLAGS -Wall" ;;
54 *[\ \ ]-Wchar-subscripts[\ \ ]*) ;;
55 *) CFLAGS="$CFLAGS -Wchar-subscripts" ;;
59 *[\ \ ]-Wmissing-declarations[\ \ ]*) ;;
60 *) CFLAGS="$CFLAGS -Wmissing-declarations" ;;
64 *[\ \ ]-Wnested-externs[\ \ ]*) ;;
65 *) CFLAGS="$CFLAGS -Wnested-externs" ;;
69 *[\ \ ]-Wcast-align[\ \ ]*) ;;
70 *) CFLAGS="$CFLAGS -Wcast-align" ;;
74 *[\ \ ]-Wformat[\ \ ]*) ;;
75 *) CFLAGS="$CFLAGS -Wformat" ;;
79 *[\ \ ]-Wformat-security[\ \ ]*) ;;
80 *) CFLAGS="$CFLAGS -Wformat-security" ;;
83 if test "x$enable_ansi" = "xyes"; then
85 *[\ \ ]-ansi[\ \ ]*) ;;
86 *) CFLAGS="$CFLAGS -ansi" ;;
90 *[\ \ ]-D_POSIX_C_SOURCE*) ;;
91 *) CFLAGS="$CFLAGS -D_POSIX_C_SOURCE=199309L" ;;
95 *[\ \ ]-D_BSD_SOURCE[\ \ ]*) ;;
96 *) CFLAGS="$CFLAGS -D_BSD_SOURCE" ;;
100 *[\ \ ]-pedantic[\ \ ]*) ;;
101 *) CFLAGS="$CFLAGS -pedantic" ;;
108 # gcc default visibility stuff
111 AC_MSG_CHECKING(for -fvisibility)
113 #if defined(__GNUC__) && (__GNUC__ >= 4)
115 #error Need GCC 4.0 for visibility
117 int main () { return 0; }
120 if test "x$have_gcc4" = "xyes"; then
121 CFLAGS="$CFLAGS -fvisibility=hidden"
123 AC_MSG_RESULT($have_gcc4)
127 [AS_HELP_STRING([--without-curl], [disable support for curl])],
133 AS_IF([test "x$with_curl" != xno],
134 [PKG_CHECK_MODULES(CURL, [libcurl])
135 AC_DEFINE([HAVE_CURL], [1], [Define if you have curl])])
136 AC_SUBST(CURL_CFLAGS)
140 AC_ARG_WITH(zlib, [ --with-zlib=<dir> Use zlib from here],
143 CPPFLAGS="$CPPFLAGS -I$withval/include"
144 LDFLAGS="$LDFLAGS -L$withval/lib"
147 AC_CHECK_HEADERS(zlib.h, [AC_DEFINE(HAVE_ZLIB_H)],
148 [AC_MSG_ERROR([Can't find zlib.h. Please install zlib.])])
149 AC_CHECK_LIB(z, inflate, [ZLIB_LIBS="-lz"],
150 [AC_MSG_ERROR([Can't find zlib library. Please install zlib.])])
154 AC_ARG_WITH(expat, [ --with-expat=<dir> Use expat from here],
157 CPPFLAGS="$CPPFLAGS -I$withval/include"
158 LDFLAGS="$LDFLAGS -L$withval/lib"
161 AC_CHECK_HEADERS(expat.h, [AC_DEFINE(HAVE_EXPAT_H)],
162 [AC_MSG_ERROR([Can't find expat.h. Please install expat.])])
163 AC_CHECK_LIB(expat, XML_ParserCreate, [EXPAT_LIBS="-lexpat"],
164 [AC_MSG_ERROR([Can't find expat library. Please install expat.])])
168 AC_ARG_WITH(rpm, [ --with-rpm=<dir> Use rpm from here])
170 AS_IF([test "$with_rpm" != no],
171 [if test "$with_rpm" != yes; then
172 CPPFLAGS="$CPPFLAGS -I$with_rpm/include"
173 LDFLAGS="$LDFLAGS -L$with_rpm/lib"
175 AC_CHECK_HEADERS(rpm/rpmlib.h, [],
176 [AC_MSG_ERROR([Can't find rpm/rpmlib.h. Please install rpm-devel or use --without-rpm.])])
177 AC_CHECK_LIB(rpm,rpmdbOpen,[RPM_LIBS="-lrpm"],
178 [AC_MSG_ERROR([Can't find rpm library. Please install rpm-devel or use --without-rpm.])])
179 AC_DEFINE([HAVE_RPMLIB], [1], [Define if you have librpm])])
181 AM_CONDITIONAL([HAVE_RPMLIB], [test -n "$RPM_LIBS"])
183 if test "x$GCC" = "xyes"; then
184 LDFLAGS="-Wl,--as-needed $LDFLAGS"
187 # *****************************
188 # Make available to Makefile.am
189 # *****************************
190 AC_SUBST(SYSCONFDIR, $sysconfdir)
192 # ********************
193 # Internationalisation
194 # ********************
196 IT_PROG_INTLTOOL([0.35.0])
197 GETTEXT_PACKAGE=razor
198 AC_SUBST([GETTEXT_PACKAGE])
200 AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE],["$GETTEXT_PACKAGE"],[gettext domain])
215 dnl ==========================================================================
222 libexecdir: ${libexecdir}
226 sysconfdir: ${sysconfdir}
227 localstatedir: ${localstatedir}
232 Maintainer mode: ${USE_MAINTAINER_MODE}
233 Building verbose mode: ${enable_verbose_mode}
234 Building gtk-doc: ${enable_gtk_doc}