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])
160 AS_IF([test "$with_rpm" != no],
161 [if test "$with_rpm" != yes; then
162 CPPFLAGS="$CPPFLAGS -I$with_rpm/include"
163 LDFLAGS="$LDFLAGS -L$with_rpm/lib"
165 AC_CHECK_HEADERS(rpm/rpmlib.h, [],
166 [AC_MSG_ERROR([Can't find rpm/rpmlib.h. Please install rpm-devel or use --without-rpm.])])
167 AC_CHECK_LIB(rpm,rpmdbOpen,[RPM_LIBS="-lrpm"],
168 [AC_MSG_ERROR([Can't find rpm library. Please install rpm-devel or use --without-rpm.])])
169 AC_DEFINE([HAVE_RPMLIB], [1], [Define if you have librpm])])
171 AM_CONDITIONAL([HAVE_RPMLIB], [test -n "$RPM_LIBS"])
173 if test "x$GCC" = "xyes"; then
174 LDFLAGS="-Wl,--as-needed $LDFLAGS"
177 # *****************************
178 # Make available to Makefile.am
179 # *****************************
180 AC_SUBST(SYSCONFDIR, $sysconfdir)
182 # ********************
183 # Internationalisation
184 # ********************
186 IT_PROG_INTLTOOL([0.35.0])
187 GETTEXT_PACKAGE=razor
188 AC_SUBST([GETTEXT_PACKAGE])
190 AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE],["$GETTEXT_PACKAGE"],[gettext domain])
205 dnl ==========================================================================
212 libexecdir: ${libexecdir}
216 sysconfdir: ${sysconfdir}
217 localstatedir: ${localstatedir}
222 Maintainer mode: ${USE_MAINTAINER_MODE}
223 Building verbose mode: ${enable_verbose_mode}
224 Building gtk-doc: ${enable_gtk_doc}