Add support for preloading lua modules. This is useful both when
providing lua bindings to applications based on librazor and when
producing static binaries using librazor (where otherwise the lua
POSIX library would need to be included as an additional dynamic
object).
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])
36 AC_MSG_CHECKING([for Microsoft Windows native API])
38 *mingw*) AC_DEFINE([MSWIN_API], 1,
39 [Define to 1 to use Microsoft Windows native API.])
40 EXTRA_LIBS='-lshell32 -lws2_32'
44 AC_MSG_RESULT([$mswin_api])
45 AM_CONDITIONAL(MSWIN_API, test "$mswin_api" = "yes")
49 AC_ARG_ENABLE(ansi, [ --enable-ansi enable -ansi -pedantic gcc flags],enable_ansi=$enableval,enable_ansi=no)
50 AC_ARG_ENABLE(verbose-mode, [ --enable-verbose-mode support verbose debug mode],enable_verbose_mode=$enableval,enable_verbose_mode=$USE_MAINTAINER_MODE)
52 if test "${enable_verbose_mode}" != no; then
53 # To get -rdynamic you pass -export-dynamic to libtool.
54 AC_DEFINE(BUILT_R_DYNAMIC,1,[whether -export-dynamic was passed to libtool])
55 R_DYNAMIC_LDFLAG=-export-dynamic
59 AC_SUBST(R_DYNAMIC_LDFLAG)
61 #### gcc warning flags
63 if test "x$GCC" = "xyes"; then
66 *[\ \ ]-Wall[\ \ ]*) ;;
67 *) CFLAGS="$CFLAGS -Wall" ;;
71 *[\ \ ]-Wchar-subscripts[\ \ ]*) ;;
72 *) CFLAGS="$CFLAGS -Wchar-subscripts" ;;
76 *[\ \ ]-Wmissing-declarations[\ \ ]*) ;;
77 *) CFLAGS="$CFLAGS -Wmissing-declarations" ;;
81 *[\ \ ]-Wnested-externs[\ \ ]*) ;;
82 *) CFLAGS="$CFLAGS -Wnested-externs" ;;
86 *[\ \ ]-Wcast-align[\ \ ]*) ;;
87 *) CFLAGS="$CFLAGS -Wcast-align" ;;
91 *[\ \ ]-Wformat[\ \ ]*) ;;
92 *) CFLAGS="$CFLAGS -Wformat" ;;
96 *[\ \ ]-Wformat-security[\ \ ]*) ;;
97 *) CFLAGS="$CFLAGS -Wformat-security" ;;
100 if test "x$enable_ansi" = "xyes"; then
102 *[\ \ ]-ansi[\ \ ]*) ;;
103 *) CFLAGS="$CFLAGS -ansi" ;;
107 *[\ \ ]-D_POSIX_C_SOURCE*) ;;
108 *) CFLAGS="$CFLAGS -D_POSIX_C_SOURCE=199309L" ;;
112 *[\ \ ]-D_BSD_SOURCE[\ \ ]*) ;;
113 *) CFLAGS="$CFLAGS -D_BSD_SOURCE" ;;
117 *[\ \ ]-pedantic[\ \ ]*) ;;
118 *) CFLAGS="$CFLAGS -pedantic" ;;
125 # gcc default visibility stuff
128 AC_MSG_CHECKING(for -fvisibility)
130 #if defined(__GNUC__) && (__GNUC__ >= 4)
132 #error Need GCC 4.0 for visibility
134 int main () { return 0; }
137 if test "x$have_gcc4" = "xyes"; then
138 CFLAGS="$CFLAGS -fvisibility=hidden"
140 AC_MSG_RESULT($have_gcc4)
144 [AS_HELP_STRING([--without-curl], [disable support for curl])],
150 AS_IF([test "x$with_curl" != xno],
151 [PKG_CHECK_MODULES(CURL, [libcurl])
152 AC_DEFINE([HAVE_CURL], [1], [Define if you have curl])])
153 AC_SUBST(CURL_CFLAGS)
157 AC_ARG_WITH(zlib, [ --with-zlib=<dir> Use zlib from here],
160 CPPFLAGS="$CPPFLAGS -I$withval/include"
163 AC_CHECK_HEADERS(zlib.h, [AC_DEFINE(HAVE_ZLIB_H)],
164 [AC_MSG_ERROR([Can't find zlib.h. Please install zlib.])])
165 save_ldflags="$LDFLAGS"
166 LDFLAGS="$LDFLAGS -L$zlib/lib"
167 AC_CHECK_LIB(z, inflate, [ZLIB_LIBS="-L$zlib/lib -lz"],
168 [AC_MSG_ERROR([Can't find zlib library. Please install zlib.])])
169 LDFLAGS="$save_ldflags"
173 AC_ARG_WITH(expat, [ --with-expat=<dir> Use expat from here],
176 CPPFLAGS="$CPPFLAGS -I$withval/include"
179 AC_CHECK_HEADERS(expat.h, [AC_DEFINE(HAVE_EXPAT_H)],
180 [AC_MSG_ERROR([Can't find expat.h. Please install expat.])])
181 save_ldflags="$LDFLAGS"
182 LDFLAGS="$LDFLAGS -L$expat/lib"
183 AC_CHECK_LIB(expat, XML_ParserCreate, [EXPAT_LIBS="-L$expat/lib -lexpat"],
184 [AC_MSG_ERROR([Can't find expat library. Please install expat.])])
185 LDFLAGS="$save_ldflags"
189 AC_ARG_WITH(rpm, [ --with-rpm=<dir> Use rpm from here])
191 AS_IF([test "$with_rpm" != no],
192 [if test "$with_rpm" != yes; then
193 CPPFLAGS="$CPPFLAGS -I$with_rpm/include"
195 AC_CHECK_HEADERS(rpm/rpmlib.h, [],
196 [AC_MSG_ERROR([Can't find rpm/rpmlib.h. Please install rpm-devel or use --without-rpm.])])
197 save_ldflags="$LDFLAGS"
198 LDFLAGS="$LDFLAGS -L$with_rpm/lib"
199 AC_CHECK_LIB(rpm,rpmdbOpen,[RPM_LIBS="-L$with_rpm/lib -lrpm"],
200 [AC_MSG_ERROR([Can't find rpm library. Please install rpm-devel or use --without-rpm.])])
201 LDFLAGS="$save_ldflags"
202 AC_DEFINE([HAVE_RPMLIB], [1], [Define if you have librpm])])
204 AM_CONDITIONAL([HAVE_RPMLIB], [test -n "$RPM_LIBS"])
207 [AS_HELP_STRING([--without-lua], [disable support for lua])],
213 AS_IF([test "x$with_lua" != xno],
214 [PKG_CHECK_MODULES(LUA, [lua])
215 REQUIREMENTS="$REQUIREMENTS lua"
216 AC_DEFINE([HAVE_LUA], [1], [Define if you have lua])
217 AC_PATH_PROG(LUA, [lua], [no])
218 AS_IF([test "x$LUA" = xno],
219 [AC_MSG_ERROR([Can't find lua program. Please install lua-devel or use --without-lua.])])
220 AC_DEFINE_UNQUOTED([LUA_BINARY], ["$LUA"],
221 [Define to the location of the lua binary])])
224 AM_CONDITIONAL([HAVE_LUA], [test "x$with_lua" != xno])
226 AC_SUBST(REQUIREMENTS)
228 if test "x$GCC" = "xyes"; then
229 LDFLAGS="-Wl,--as-needed $LDFLAGS"
232 # *****************************
233 # Make available to Makefile.am
234 # *****************************
235 AC_SUBST(SYSCONFDIR, $sysconfdir)
237 # ********************
238 # Internationalisation
239 # ********************
241 IT_PROG_INTLTOOL([0.35.0])
242 GETTEXT_PACKAGE=razor
243 AC_SUBST([GETTEXT_PACKAGE])
245 AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE],["$GETTEXT_PACKAGE"],[gettext domain])
262 dnl ==========================================================================
269 libexecdir: ${libexecdir}
273 sysconfdir: ${sysconfdir}
274 localstatedir: ${localstatedir}
279 Maintainer mode: ${USE_MAINTAINER_MODE}
280 Building verbose mode: ${enable_verbose_mode}
281 Building gtk-doc: ${enable_gtk_doc}