Add support for platforms without fnmatch.
This uses gnulib so you will need to have a copy in order
to run autogen.sh (but not to build from a tarball). Either
arrange for gnulib-tool to be in your path or set the
environment variable GNULIB_TOOL to point to its location.
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
25 AC_CHECK_HEADERS([sys/mman.h])
34 AC_ARG_ENABLE(ansi, [ --enable-ansi enable -ansi -pedantic gcc flags],enable_ansi=$enableval,enable_ansi=no)
35 AC_ARG_ENABLE(verbose-mode, [ --enable-verbose-mode support verbose debug mode],enable_verbose_mode=$enableval,enable_verbose_mode=$USE_MAINTAINER_MODE)
37 if test "${enable_verbose_mode}" != no; then
38 # To get -rdynamic you pass -export-dynamic to libtool.
39 AC_DEFINE(BUILT_R_DYNAMIC,1,[whether -export-dynamic was passed to libtool])
40 R_DYNAMIC_LDFLAG=-export-dynamic
44 AC_SUBST(R_DYNAMIC_LDFLAG)
46 #### gcc warning flags
48 if test "x$GCC" = "xyes"; then
51 *[\ \ ]-Wall[\ \ ]*) ;;
52 *) CFLAGS="$CFLAGS -Wall" ;;
56 *[\ \ ]-Wchar-subscripts[\ \ ]*) ;;
57 *) CFLAGS="$CFLAGS -Wchar-subscripts" ;;
61 *[\ \ ]-Wmissing-declarations[\ \ ]*) ;;
62 *) CFLAGS="$CFLAGS -Wmissing-declarations" ;;
66 *[\ \ ]-Wnested-externs[\ \ ]*) ;;
67 *) CFLAGS="$CFLAGS -Wnested-externs" ;;
71 *[\ \ ]-Wcast-align[\ \ ]*) ;;
72 *) CFLAGS="$CFLAGS -Wcast-align" ;;
76 *[\ \ ]-Wformat[\ \ ]*) ;;
77 *) CFLAGS="$CFLAGS -Wformat" ;;
81 *[\ \ ]-Wformat-security[\ \ ]*) ;;
82 *) CFLAGS="$CFLAGS -Wformat-security" ;;
85 if test "x$enable_ansi" = "xyes"; then
87 *[\ \ ]-ansi[\ \ ]*) ;;
88 *) CFLAGS="$CFLAGS -ansi" ;;
92 *[\ \ ]-D_POSIX_C_SOURCE*) ;;
93 *) CFLAGS="$CFLAGS -D_POSIX_C_SOURCE=199309L" ;;
97 *[\ \ ]-D_BSD_SOURCE[\ \ ]*) ;;
98 *) CFLAGS="$CFLAGS -D_BSD_SOURCE" ;;
102 *[\ \ ]-pedantic[\ \ ]*) ;;
103 *) CFLAGS="$CFLAGS -pedantic" ;;
110 # gcc default visibility stuff
113 AC_MSG_CHECKING(for -fvisibility)
115 #if defined(__GNUC__) && (__GNUC__ >= 4)
117 #error Need GCC 4.0 for visibility
119 int main () { return 0; }
122 if test "x$have_gcc4" = "xyes"; then
123 CFLAGS="$CFLAGS -fvisibility=hidden"
125 AC_MSG_RESULT($have_gcc4)
129 [AS_HELP_STRING([--without-curl], [disable support for curl])],
135 AS_IF([test "x$with_curl" != xno],
136 [PKG_CHECK_MODULES(CURL, [libcurl])
137 AC_DEFINE([HAVE_CURL], [1], [Define if you have curl])])
138 AC_SUBST(CURL_CFLAGS)
142 AC_ARG_WITH(zlib, [ --with-zlib=<dir> Use zlib from here],
145 CPPFLAGS="$CPPFLAGS -I$withval/include"
146 LDFLAGS="$LDFLAGS -L$withval/lib"
149 AC_CHECK_HEADERS(zlib.h, [AC_DEFINE(HAVE_ZLIB_H)],
150 [AC_MSG_ERROR([Can't find zlib.h. Please install zlib.])])
151 AC_CHECK_LIB(z, inflate, [ZLIB_LIBS="-lz"],
152 [AC_MSG_ERROR([Can't find zlib library. Please install zlib.])])
156 AC_ARG_WITH(expat, [ --with-expat=<dir> Use expat from here],
159 CPPFLAGS="$CPPFLAGS -I$withval/include"
160 LDFLAGS="$LDFLAGS -L$withval/lib"
163 AC_CHECK_HEADERS(expat.h, [AC_DEFINE(HAVE_EXPAT_H)],
164 [AC_MSG_ERROR([Can't find expat.h. Please install expat.])])
165 AC_CHECK_LIB(expat, XML_ParserCreate, [EXPAT_LIBS="-lexpat"],
166 [AC_MSG_ERROR([Can't find expat library. Please install expat.])])
170 AC_ARG_WITH(rpm, [ --with-rpm=<dir> Use rpm from here])
172 AS_IF([test "$with_rpm" != no],
173 [if test "$with_rpm" != yes; then
174 CPPFLAGS="$CPPFLAGS -I$with_rpm/include"
175 LDFLAGS="$LDFLAGS -L$with_rpm/lib"
177 AC_CHECK_HEADERS(rpm/rpmlib.h, [],
178 [AC_MSG_ERROR([Can't find rpm/rpmlib.h. Please install rpm-devel or use --without-rpm.])])
179 AC_CHECK_LIB(rpm,rpmdbOpen,[RPM_LIBS="-lrpm"],
180 [AC_MSG_ERROR([Can't find rpm library. Please install rpm-devel or use --without-rpm.])])
181 AC_DEFINE([HAVE_RPMLIB], [1], [Define if you have librpm])])
183 AM_CONDITIONAL([HAVE_RPMLIB], [test -n "$RPM_LIBS"])
185 if test "x$GCC" = "xyes"; then
186 LDFLAGS="-Wl,--as-needed $LDFLAGS"
189 # *****************************
190 # Make available to Makefile.am
191 # *****************************
192 AC_SUBST(SYSCONFDIR, $sysconfdir)
194 # ********************
195 # Internationalisation
196 # ********************
198 IT_PROG_INTLTOOL([0.35.0])
199 GETTEXT_PACKAGE=razor
200 AC_SUBST([GETTEXT_PACKAGE])
202 AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE],["$GETTEXT_PACKAGE"],[gettext domain])
218 dnl ==========================================================================
225 libexecdir: ${libexecdir}
229 sysconfdir: ${sysconfdir}
230 localstatedir: ${localstatedir}
235 Maintainer mode: ${USE_MAINTAINER_MODE}
236 Building verbose mode: ${enable_verbose_mode}
237 Building gtk-doc: ${enable_gtk_doc}