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
26 AC_CHECK_HEADERS([sys/mman.h])
28 AC_CHECK_FUNCS([symlink chroot])
35 AC_MSG_CHECKING([for Microsoft Windows native API])
37 *mingw*) AC_DEFINE([MSWIN_API], 1,
38 [Define to 1 to use Microsoft Windows native API.])
42 AC_MSG_RESULT([$mswin_api])
43 AM_CONDITIONAL(MSWIN_API, test "$mswin_api" = "yes")
46 AC_ARG_ENABLE(ansi, [ --enable-ansi enable -ansi -pedantic gcc flags],enable_ansi=$enableval,enable_ansi=no)
47 AC_ARG_ENABLE(verbose-mode, [ --enable-verbose-mode support verbose debug mode],enable_verbose_mode=$enableval,enable_verbose_mode=$USE_MAINTAINER_MODE)
49 if test "${enable_verbose_mode}" != no; then
50 # To get -rdynamic you pass -export-dynamic to libtool.
51 AC_DEFINE(BUILT_R_DYNAMIC,1,[whether -export-dynamic was passed to libtool])
52 R_DYNAMIC_LDFLAG=-export-dynamic
56 AC_SUBST(R_DYNAMIC_LDFLAG)
58 #### gcc warning flags
60 if test "x$GCC" = "xyes"; then
63 *[\ \ ]-Wall[\ \ ]*) ;;
64 *) CFLAGS="$CFLAGS -Wall" ;;
68 *[\ \ ]-Wchar-subscripts[\ \ ]*) ;;
69 *) CFLAGS="$CFLAGS -Wchar-subscripts" ;;
73 *[\ \ ]-Wmissing-declarations[\ \ ]*) ;;
74 *) CFLAGS="$CFLAGS -Wmissing-declarations" ;;
78 *[\ \ ]-Wnested-externs[\ \ ]*) ;;
79 *) CFLAGS="$CFLAGS -Wnested-externs" ;;
83 *[\ \ ]-Wcast-align[\ \ ]*) ;;
84 *) CFLAGS="$CFLAGS -Wcast-align" ;;
88 *[\ \ ]-Wformat[\ \ ]*) ;;
89 *) CFLAGS="$CFLAGS -Wformat" ;;
93 *[\ \ ]-Wformat-security[\ \ ]*) ;;
94 *) CFLAGS="$CFLAGS -Wformat-security" ;;
97 if test "x$enable_ansi" = "xyes"; then
99 *[\ \ ]-ansi[\ \ ]*) ;;
100 *) CFLAGS="$CFLAGS -ansi" ;;
104 *[\ \ ]-D_POSIX_C_SOURCE*) ;;
105 *) CFLAGS="$CFLAGS -D_POSIX_C_SOURCE=199309L" ;;
109 *[\ \ ]-D_BSD_SOURCE[\ \ ]*) ;;
110 *) CFLAGS="$CFLAGS -D_BSD_SOURCE" ;;
114 *[\ \ ]-pedantic[\ \ ]*) ;;
115 *) CFLAGS="$CFLAGS -pedantic" ;;
122 # gcc default visibility stuff
125 AC_MSG_CHECKING(for -fvisibility)
127 #if defined(__GNUC__) && (__GNUC__ >= 4)
129 #error Need GCC 4.0 for visibility
131 int main () { return 0; }
134 if test "x$have_gcc4" = "xyes"; then
135 CFLAGS="$CFLAGS -fvisibility=hidden"
137 AC_MSG_RESULT($have_gcc4)
141 [AS_HELP_STRING([--without-curl], [disable support for curl])],
147 AS_IF([test "x$with_curl" != xno],
148 [PKG_CHECK_MODULES(CURL, [libcurl])
149 AC_DEFINE([HAVE_CURL], [1], [Define if you have curl])])
150 AC_SUBST(CURL_CFLAGS)
154 AC_ARG_WITH(zlib, [ --with-zlib=<dir> Use zlib from here],
157 CPPFLAGS="$CPPFLAGS -I$withval/include"
158 LDFLAGS="$LDFLAGS -L$withval/lib"
161 AC_CHECK_HEADERS(zlib.h, [AC_DEFINE(HAVE_ZLIB_H)],
162 [AC_MSG_ERROR([Can't find zlib.h. Please install zlib.])])
163 AC_CHECK_LIB(z, inflate, [ZLIB_LIBS="-lz"],
164 [AC_MSG_ERROR([Can't find zlib library. Please install zlib.])])
168 AC_ARG_WITH(expat, [ --with-expat=<dir> Use expat from here],
171 CPPFLAGS="$CPPFLAGS -I$withval/include"
172 LDFLAGS="$LDFLAGS -L$withval/lib"
175 AC_CHECK_HEADERS(expat.h, [AC_DEFINE(HAVE_EXPAT_H)],
176 [AC_MSG_ERROR([Can't find expat.h. Please install expat.])])
177 AC_CHECK_LIB(expat, XML_ParserCreate, [EXPAT_LIBS="-lexpat"],
178 [AC_MSG_ERROR([Can't find expat library. Please install expat.])])
182 AC_ARG_WITH(rpm, [ --with-rpm=<dir> Use rpm from here])
184 AS_IF([test "$with_rpm" != no],
185 [if test "$with_rpm" != yes; then
186 CPPFLAGS="$CPPFLAGS -I$with_rpm/include"
187 LDFLAGS="$LDFLAGS -L$with_rpm/lib"
189 AC_CHECK_HEADERS(rpm/rpmlib.h, [],
190 [AC_MSG_ERROR([Can't find rpm/rpmlib.h. Please install rpm-devel or use --without-rpm.])])
191 AC_CHECK_LIB(rpm,rpmdbOpen,[RPM_LIBS="-lrpm"],
192 [AC_MSG_ERROR([Can't find rpm library. Please install rpm-devel or use --without-rpm.])])
193 AC_DEFINE([HAVE_RPMLIB], [1], [Define if you have librpm])])
195 AM_CONDITIONAL([HAVE_RPMLIB], [test -n "$RPM_LIBS"])
197 if test "x$GCC" = "xyes"; then
198 LDFLAGS="-Wl,--as-needed $LDFLAGS"
201 # *****************************
202 # Make available to Makefile.am
203 # *****************************
204 AC_SUBST(SYSCONFDIR, $sysconfdir)
206 # ********************
207 # Internationalisation
208 # ********************
210 IT_PROG_INTLTOOL([0.35.0])
211 GETTEXT_PACKAGE=razor
212 AC_SUBST([GETTEXT_PACKAGE])
214 AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE],["$GETTEXT_PACKAGE"],[gettext domain])
230 dnl ==========================================================================
237 libexecdir: ${libexecdir}
241 sysconfdir: ${sysconfdir}
242 localstatedir: ${localstatedir}
247 Maintainer mode: ${USE_MAINTAINER_MODE}
248 Building verbose mode: ${enable_verbose_mode}
249 Building gtk-doc: ${enable_gtk_doc}