Add an error object.
This is intended to dis-entangle the two roles that the atomic
object has evolved into so that atomic need only be used where
atomic actions are actually being undertaken.
1 dnl Process this file with autoconf to produce a configure script.
4 AC_INIT([razor], [0.5.4], [ali@juiblex.co.uk])
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_ARG_ENABLE([atomic],
37 [AS_HELP_STRING([--disable-atomic],
38 [disable atomic transactions])],
41 if test "$enable_atomic" = "yes"; then
42 AC_DEFINE([ENABLE_ATOMIC],[1],[Define if atomic transactions are wanted.])
45 AC_MSG_CHECKING([for Microsoft Windows native API])
47 *mingw*) AC_DEFINE([MSWIN_API], 1,
48 [Define to 1 to use Microsoft Windows native API.])
49 EXTRA_LIBS='-lshell32 -lws2_32'
53 AC_MSG_RESULT([$mswin_api])
54 AM_CONDITIONAL(MSWIN_API, test "$mswin_api" = "yes")
57 if test "$enable_atomic" = "yes" -a "$mswin_api" = "yes"; then
58 AC_MSG_CHECKING([for Microsoft Windows Kernel Transaction Manager])
61 AC_LINK_IFELSE([AC_LANG_PROGRAM([dnl
64 ], [(void)CreateTransaction(NULL,0,0,0,0,0,NULL);])],
65 [have_windows_ktm="yes"; EXTRA_LIBS="-lktmw32 $EXTRA_LIBS"],
66 [have_windows_ktm="no"])
68 AC_MSG_RESULT([$have_windows_ktm])
72 if test "$have_windows_ktm" = "yes"; then
73 AC_DEFINE([HAVE_WINDOWS_KTM],[1],[Define if Windows KTM is available.])
77 AC_ARG_ENABLE(ansi, [ --enable-ansi enable -ansi -pedantic gcc flags],enable_ansi=$enableval,enable_ansi=no)
78 AC_ARG_ENABLE(verbose-mode, [ --enable-verbose-mode support verbose debug mode],enable_verbose_mode=$enableval,enable_verbose_mode=$USE_MAINTAINER_MODE)
80 if test "${enable_verbose_mode}" != no; then
81 # To get -rdynamic you pass -export-dynamic to libtool.
82 AC_DEFINE(BUILT_R_DYNAMIC,1,[whether -export-dynamic was passed to libtool])
83 R_DYNAMIC_LDFLAG=-export-dynamic
87 AC_SUBST(R_DYNAMIC_LDFLAG)
89 #### gcc warning flags
91 if test "x$GCC" = "xyes"; then
94 *[\ \ ]-Wall[\ \ ]*) ;;
95 *) CFLAGS="$CFLAGS -Wall" ;;
99 *[\ \ ]-Wchar-subscripts[\ \ ]*) ;;
100 *) CFLAGS="$CFLAGS -Wchar-subscripts" ;;
104 *[\ \ ]-Wmissing-declarations[\ \ ]*) ;;
105 *) CFLAGS="$CFLAGS -Wmissing-declarations" ;;
109 *[\ \ ]-Wnested-externs[\ \ ]*) ;;
110 *) CFLAGS="$CFLAGS -Wnested-externs" ;;
114 *[\ \ ]-Wcast-align[\ \ ]*) ;;
115 *) CFLAGS="$CFLAGS -Wcast-align" ;;
119 *[\ \ ]-Wformat[\ \ ]*) ;;
120 *) CFLAGS="$CFLAGS -Wformat" ;;
124 *[\ \ ]-Wformat-security[\ \ ]*) ;;
125 *) CFLAGS="$CFLAGS -Wformat-security" ;;
128 if test "x$enable_ansi" = "xyes"; then
130 *[\ \ ]-ansi[\ \ ]*) ;;
131 *) CFLAGS="$CFLAGS -ansi" ;;
135 *[\ \ ]-D_POSIX_C_SOURCE*) ;;
136 *) CFLAGS="$CFLAGS -D_POSIX_C_SOURCE=199309L" ;;
140 *[\ \ ]-D_BSD_SOURCE[\ \ ]*) ;;
141 *) CFLAGS="$CFLAGS -D_BSD_SOURCE" ;;
145 *[\ \ ]-pedantic[\ \ ]*) ;;
146 *) CFLAGS="$CFLAGS -pedantic" ;;
153 # gcc default visibility stuff
156 AC_MSG_CHECKING(for -fvisibility)
158 #if defined(__GNUC__) && (__GNUC__ >= 4)
160 #error Need GCC 4.0 for visibility
162 int main () { return 0; }
165 if test "x$have_gcc4" = "xyes"; then
166 CFLAGS="$CFLAGS -fvisibility=hidden"
168 AC_MSG_RESULT($have_gcc4)
172 [AS_HELP_STRING([--without-curl], [disable support for curl])],
178 AS_IF([test "x$with_curl" != xno],
179 [PKG_CHECK_MODULES(CURL, [libcurl])
180 AC_DEFINE([HAVE_CURL], [1], [Define if you have curl])])
181 AC_SUBST(CURL_CFLAGS)
185 AC_ARG_WITH(zlib, [ --with-zlib=<dir> Use zlib from here],
188 CPPFLAGS="$CPPFLAGS -I$withval/include"
191 AC_CHECK_HEADERS(zlib.h, [AC_DEFINE(HAVE_ZLIB_H)],
192 [AC_MSG_ERROR([Can't find zlib.h. Please install zlib.])])
193 save_ldflags="$LDFLAGS"
194 LDFLAGS="$LDFLAGS -L$zlib/lib"
195 AC_CHECK_LIB(z, inflate, [ZLIB_LIBS="-L$zlib/lib -lz"],
196 [AC_MSG_ERROR([Can't find zlib library. Please install zlib.])])
197 LDFLAGS="$save_ldflags"
201 AC_ARG_WITH(expat, [ --with-expat=<dir> Use expat from here],
204 CPPFLAGS="$CPPFLAGS -I$withval/include"
207 AC_CHECK_HEADERS(expat.h, [AC_DEFINE(HAVE_EXPAT_H)],
208 [AC_MSG_ERROR([Can't find expat.h. Please install expat.])])
209 save_ldflags="$LDFLAGS"
210 LDFLAGS="$LDFLAGS -L$expat/lib"
211 AC_CHECK_LIB(expat, XML_ParserCreate, [EXPAT_LIBS="-L$expat/lib -lexpat"],
212 [AC_MSG_ERROR([Can't find expat library. Please install expat.])])
213 LDFLAGS="$save_ldflags"
217 AC_ARG_WITH(rpm, [ --with-rpm=<dir> Use rpm from here])
219 AS_IF([test "$with_rpm" != no],
220 [if test "$with_rpm" != yes; then
221 CPPFLAGS="$CPPFLAGS -I$with_rpm/include"
223 AC_CHECK_HEADERS(rpm/rpmlib.h, [],
224 [AC_MSG_ERROR([Can't find rpm/rpmlib.h. Please install rpm-devel or use --without-rpm.])])
225 save_ldflags="$LDFLAGS"
226 LDFLAGS="$LDFLAGS -L$with_rpm/lib"
227 AC_CHECK_LIB(rpm,rpmdbOpen,[RPM_LIBS="-L$with_rpm/lib -lrpm"],
228 [AC_MSG_ERROR([Can't find rpm library. Please install rpm-devel or use --without-rpm.])])
229 LDFLAGS="$save_ldflags"
230 AC_DEFINE([HAVE_RPMLIB], [1], [Define if you have librpm])])
232 AM_CONDITIONAL([HAVE_RPMLIB], [test -n "$RPM_LIBS"])
235 [AS_HELP_STRING([--without-lua], [disable support for lua])],
241 AS_IF([test "x$with_lua" != xno],
242 [PKG_CHECK_MODULES(LUA, [lua])
243 REQUIREMENTS="$REQUIREMENTS lua"
244 AC_DEFINE([HAVE_LUA], [1], [Define if you have lua])
245 AC_PATH_PROG(LUA, [lua], [no])
246 AS_IF([test "x$LUA" = xno],
247 [AC_MSG_ERROR([Can't find lua program. Please install lua-devel or use --without-lua.])])
248 AC_DEFINE_UNQUOTED([LUA_BINARY], ["$LUA"],
249 [Define to the location of the lua binary])])
252 AM_CONDITIONAL([HAVE_LUA], [test "x$with_lua" != xno])
254 AC_SUBST(REQUIREMENTS)
256 if test "x$GCC" = "xyes"; then
257 LDFLAGS="-Wl,--as-needed $LDFLAGS"
260 # *****************************
261 # Make available to Makefile.am
262 # *****************************
263 AC_SUBST(SYSCONFDIR, $sysconfdir)
265 # ********************
266 # Internationalisation
267 # ********************
269 IT_PROG_INTLTOOL([0.35.0])
270 GETTEXT_PACKAGE=razor
271 AC_SUBST([GETTEXT_PACKAGE])
273 AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE],["$GETTEXT_PACKAGE"],[gettext domain])
282 librazor/types/Makefile
291 dnl ==========================================================================
298 libexecdir: ${libexecdir}
302 sysconfdir: ${sysconfdir}
303 localstatedir: ${localstatedir}
308 Maintainer mode: ${USE_MAINTAINER_MODE}
309 Building verbose mode: ${enable_verbose_mode}
310 Building gtk-doc: ${enable_gtk_doc}