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.])
43 AC_MSG_RESULT([$mswin_api])
44 AM_CONDITIONAL(MSWIN_API, test "$mswin_api" = "yes")
48 AC_ARG_ENABLE(ansi, [ --enable-ansi enable -ansi -pedantic gcc flags],enable_ansi=$enableval,enable_ansi=no)
49 AC_ARG_ENABLE(verbose-mode, [ --enable-verbose-mode support verbose debug mode],enable_verbose_mode=$enableval,enable_verbose_mode=$USE_MAINTAINER_MODE)
51 if test "${enable_verbose_mode}" != no; then
52 # To get -rdynamic you pass -export-dynamic to libtool.
53 AC_DEFINE(BUILT_R_DYNAMIC,1,[whether -export-dynamic was passed to libtool])
54 R_DYNAMIC_LDFLAG=-export-dynamic
58 AC_SUBST(R_DYNAMIC_LDFLAG)
60 #### gcc warning flags
62 if test "x$GCC" = "xyes"; then
65 *[\ \ ]-Wall[\ \ ]*) ;;
66 *) CFLAGS="$CFLAGS -Wall" ;;
70 *[\ \ ]-Wchar-subscripts[\ \ ]*) ;;
71 *) CFLAGS="$CFLAGS -Wchar-subscripts" ;;
75 *[\ \ ]-Wmissing-declarations[\ \ ]*) ;;
76 *) CFLAGS="$CFLAGS -Wmissing-declarations" ;;
80 *[\ \ ]-Wnested-externs[\ \ ]*) ;;
81 *) CFLAGS="$CFLAGS -Wnested-externs" ;;
85 *[\ \ ]-Wcast-align[\ \ ]*) ;;
86 *) CFLAGS="$CFLAGS -Wcast-align" ;;
90 *[\ \ ]-Wformat[\ \ ]*) ;;
91 *) CFLAGS="$CFLAGS -Wformat" ;;
95 *[\ \ ]-Wformat-security[\ \ ]*) ;;
96 *) CFLAGS="$CFLAGS -Wformat-security" ;;
99 if test "x$enable_ansi" = "xyes"; then
101 *[\ \ ]-ansi[\ \ ]*) ;;
102 *) CFLAGS="$CFLAGS -ansi" ;;
106 *[\ \ ]-D_POSIX_C_SOURCE*) ;;
107 *) CFLAGS="$CFLAGS -D_POSIX_C_SOURCE=199309L" ;;
111 *[\ \ ]-D_BSD_SOURCE[\ \ ]*) ;;
112 *) CFLAGS="$CFLAGS -D_BSD_SOURCE" ;;
116 *[\ \ ]-pedantic[\ \ ]*) ;;
117 *) CFLAGS="$CFLAGS -pedantic" ;;
124 # gcc default visibility stuff
127 AC_MSG_CHECKING(for -fvisibility)
129 #if defined(__GNUC__) && (__GNUC__ >= 4)
131 #error Need GCC 4.0 for visibility
133 int main () { return 0; }
136 if test "x$have_gcc4" = "xyes"; then
137 CFLAGS="$CFLAGS -fvisibility=hidden"
139 AC_MSG_RESULT($have_gcc4)
143 [AS_HELP_STRING([--without-curl], [disable support for curl])],
149 AS_IF([test "x$with_curl" != xno],
150 [PKG_CHECK_MODULES(CURL, [libcurl])
151 AC_DEFINE([HAVE_CURL], [1], [Define if you have curl])])
152 AC_SUBST(CURL_CFLAGS)
156 AC_ARG_WITH(zlib, [ --with-zlib=<dir> Use zlib from here],
159 CPPFLAGS="$CPPFLAGS -I$withval/include"
160 LDFLAGS="$LDFLAGS -L$withval/lib"
163 AC_CHECK_HEADERS(zlib.h, [AC_DEFINE(HAVE_ZLIB_H)],
164 [AC_MSG_ERROR([Can't find zlib.h. Please install zlib.])])
165 AC_CHECK_LIB(z, inflate, [ZLIB_LIBS="-lz"],
166 [AC_MSG_ERROR([Can't find zlib library. Please install zlib.])])
170 AC_ARG_WITH(expat, [ --with-expat=<dir> Use expat from here],
173 CPPFLAGS="$CPPFLAGS -I$withval/include"
174 LDFLAGS="$LDFLAGS -L$withval/lib"
177 AC_CHECK_HEADERS(expat.h, [AC_DEFINE(HAVE_EXPAT_H)],
178 [AC_MSG_ERROR([Can't find expat.h. Please install expat.])])
179 AC_CHECK_LIB(expat, XML_ParserCreate, [EXPAT_LIBS="-lexpat"],
180 [AC_MSG_ERROR([Can't find expat library. Please install expat.])])
184 AC_ARG_WITH(rpm, [ --with-rpm=<dir> Use rpm from here])
186 AS_IF([test "$with_rpm" != no],
187 [if test "$with_rpm" != yes; then
188 CPPFLAGS="$CPPFLAGS -I$with_rpm/include"
189 LDFLAGS="$LDFLAGS -L$with_rpm/lib"
191 AC_CHECK_HEADERS(rpm/rpmlib.h, [],
192 [AC_MSG_ERROR([Can't find rpm/rpmlib.h. Please install rpm-devel or use --without-rpm.])])
193 AC_CHECK_LIB(rpm,rpmdbOpen,[RPM_LIBS="-lrpm"],
194 [AC_MSG_ERROR([Can't find rpm library. Please install rpm-devel or use --without-rpm.])])
195 AC_DEFINE([HAVE_RPMLIB], [1], [Define if you have librpm])])
197 AM_CONDITIONAL([HAVE_RPMLIB], [test -n "$RPM_LIBS"])
199 if test "x$GCC" = "xyes"; then
200 LDFLAGS="-Wl,--as-needed $LDFLAGS"
203 # *****************************
204 # Make available to Makefile.am
205 # *****************************
206 AC_SUBST(SYSCONFDIR, $sysconfdir)
208 # ********************
209 # Internationalisation
210 # ********************
212 IT_PROG_INTLTOOL([0.35.0])
213 GETTEXT_PACKAGE=razor
214 AC_SUBST([GETTEXT_PACKAGE])
216 AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE],["$GETTEXT_PACKAGE"],[gettext domain])
232 dnl ==========================================================================
239 libexecdir: ${libexecdir}
243 sysconfdir: ${sysconfdir}
244 localstatedir: ${localstatedir}
249 Maintainer mode: ${USE_MAINTAINER_MODE}
250 Building verbose mode: ${enable_verbose_mode}
251 Building gtk-doc: ${enable_gtk_doc}