rhughes@241: dnl Process this file with autoconf to produce a configure script. rhughes@241: rhughes@241: AC_PREREQ(2.59c) ali@473: AC_INIT([razor], [0.6.3], [ali@juiblex.co.uk]) ali@380: AM_INIT_AUTOMAKE([]) ali@380: AM_CONFIG_HEADER([config.h]) rhughes@241: AM_MAINTAINER_MODE rhughes@241: rhughes@241: # libtool versioning - this applies to all libraries in this package rhughes@241: # ali@473: # See https://www.sourceware.org/autobook/autobook/autobook_61.html for details rhughes@241: # ali@443: LT_CURRENT=5 ali@473: LT_REVISION=1 ali@463: LT_AGE=0 rhughes@241: AC_SUBST(LT_CURRENT) rhughes@241: AC_SUBST(LT_REVISION) rhughes@241: AC_SUBST(LT_AGE) rhughes@241: rhughes@241: AC_ISC_POSIX rhughes@241: AC_PROG_CC ali@323: gl_EARLY rhughes@241: AM_PROG_CC_STDC rhughes@241: AC_HEADER_STDC ali@330: AC_HEADER_SYS_WAIT ali@322: AC_CHECK_HEADERS([sys/mman.h]) ali@323: gl_INIT ali@328: AC_CHECK_FUNCS([symlink chroot]) ali@427: LT_INIT([win32-dll]) ali@427: # Libtool supports a --disable-shared option to tell it to avoid ali@427: # building shared versions of libraries. In addition to this,we want ali@427: # to support building static versions of our executables. Libtool ali@427: # can do this (under the right circumstances) so we overload this ali@427: # switch for this purpose. ali@427: # ali@427: # The libtool option that we use (-static-libtool-libs) means to use ali@427: # static linking with libraries that supply a .la file and which ali@427: # include a non-empty value for "old_library". If the library doesn't ali@427: # include a .la file (they are deleted by some distributions), then ali@427: # this option will have no effect and likewise if old_library is set ali@427: # to '' (eg., if the library was build with --disable-static) then ali@427: # again -static-libtool-libs will have no effect. ali@427: # ali@427: # If old_library is set to a non-empty value, then specifying ali@427: # -static-libtool-libs will cause the link to fail if the old library ali@427: # cannot be found (libtool will not fallback to a shared library ali@427: # in these circumstances). This can happen with Fedora, for example, ali@427: # if a main mingw32 library package is installed but not the ali@427: # coresponding static sub-package. The solution is to either ali@427: # install the relevant static sub-packages or don't use --disable-shared. ali@427: AS_IF([test "$enable_shared" = no],[ ali@427: LDFLAGS="$LDFLAGS -static-libtool-libs" ali@427: ]) ali@427: LT_OUTPUT ali@427: ac_compile="./libtool --mode=compile --tag=CC $ac_compile" ali@427: ac_link="./libtool --mode=link --tag=CC $ac_link" rhughes@241: AC_PROG_MAKE_SET rhughes@241: AC_PROG_LN_S rhughes@241: AC_SYS_LARGEFILE rhughes@241: AM_PROG_CC_C_O rhughes@241: ali@416: AC_ARG_ENABLE([atomic], ali@416: [AS_HELP_STRING([--disable-atomic], ali@416: [disable atomic transactions])], ali@416: [], ali@416: [enable_atomic=yes]) ali@416: if test "$enable_atomic" = "yes"; then ali@416: AC_DEFINE([ENABLE_ATOMIC],[1],[Define if atomic transactions are wanted.]) ali@452: AC_SUBST([RAZOR_HAVE_ATOMIC_ROLLBACK], ali@452: ['#define RAZOR_HAVE_ATOMIC_ROLLBACK 1']) ali@452: else ali@452: AC_SUBST([RAZOR_HAVE_ATOMIC_ROLLBACK],['#undef RAZOR_HAVE_ATOMIC_ROLLBACK']) ali@416: fi ali@416: ali@455: AC_ARG_ENABLE([tests], ali@455: [AS_HELP_STRING([--enable-tests], ali@455: [install test programs])], ali@455: [], ali@455: [enable_tests=no]) ali@455: AM_CONDITIONAL(INSTALL_TEST_PROGRAMS, test "$enable_tests" = "yes") ali@455: ali@328: AC_MSG_CHECKING([for Microsoft Windows native API]) ali@328: case $host_os in ali@328: *mingw*) AC_DEFINE([MSWIN_API], 1, ali@328: [Define to 1 to use Microsoft Windows native API.]) ali@465: EXTRA_LIBS='-lshlwapi -lshell32 -lws2_32 -lole32' ali@328: mswin_api=yes;; ali@328: *) mswin_api=no;; ali@328: esac ali@328: AC_MSG_RESULT([$mswin_api]) ali@328: AM_CONDITIONAL(MSWIN_API, test "$mswin_api" = "yes") ali@335: AC_SUBST(EXTRA_LIBS) ali@328: ali@416: if test "$enable_atomic" = "yes" -a "$mswin_api" = "yes"; then ali@403: AC_MSG_CHECKING([for Microsoft Windows Kernel Transaction Manager]) ali@403: save_LIBS="$LIBS" ali@403: LIBS="-lktmw32 $LIBS" ali@403: AC_LINK_IFELSE([AC_LANG_PROGRAM([dnl ali@403: #include ali@403: #include ali@403: ], [(void)CreateTransaction(NULL,0,0,0,0,0,NULL);])], ali@403: [have_windows_ktm="yes"; EXTRA_LIBS="-lktmw32 $EXTRA_LIBS"], ali@403: [have_windows_ktm="no"]) ali@403: LIBS="$save_LIBS" ali@403: AC_MSG_RESULT([$have_windows_ktm]) ali@403: else ali@403: have_windows_ktm="no" ali@403: fi ali@403: if test "$have_windows_ktm" = "yes"; then ali@403: AC_DEFINE([HAVE_WINDOWS_KTM],[1],[Define if Windows KTM is available.]) ali@403: fi ali@403: rhughes@241: # Taken from dbus rhughes@241: AC_ARG_ENABLE(ansi, [ --enable-ansi enable -ansi -pedantic gcc flags],enable_ansi=$enableval,enable_ansi=no) rhughes@241: AC_ARG_ENABLE(verbose-mode, [ --enable-verbose-mode support verbose debug mode],enable_verbose_mode=$enableval,enable_verbose_mode=$USE_MAINTAINER_MODE) rhughes@241: rhughes@241: if test "${enable_verbose_mode}" != no; then rhughes@241: # To get -rdynamic you pass -export-dynamic to libtool. rhughes@241: AC_DEFINE(BUILT_R_DYNAMIC,1,[whether -export-dynamic was passed to libtool]) rhughes@241: R_DYNAMIC_LDFLAG=-export-dynamic rhughes@241: else rhughes@241: R_DYNAMIC_LDFLAG= rhughes@241: fi rhughes@241: AC_SUBST(R_DYNAMIC_LDFLAG) rhughes@241: rhughes@241: #### gcc warning flags rhughes@241: rhughes@241: if test "x$GCC" = "xyes"; then rhughes@241: changequote(,)dnl rhughes@241: case " $CFLAGS " in rhughes@241: *[\ \ ]-Wall[\ \ ]*) ;; ali@442: *) CFLAGS="$CFLAGS -Wall -Wno-parentheses" ;; rhughes@241: esac rhughes@241: rhughes@241: case " $CFLAGS " in rhughes@241: *[\ \ ]-Wchar-subscripts[\ \ ]*) ;; rhughes@241: *) CFLAGS="$CFLAGS -Wchar-subscripts" ;; rhughes@241: esac rhughes@241: rhughes@241: case " $CFLAGS " in rhughes@241: *[\ \ ]-Wmissing-declarations[\ \ ]*) ;; rhughes@241: *) CFLAGS="$CFLAGS -Wmissing-declarations" ;; rhughes@241: esac rhughes@241: rhughes@241: case " $CFLAGS " in rhughes@241: *[\ \ ]-Wnested-externs[\ \ ]*) ;; rhughes@241: *) CFLAGS="$CFLAGS -Wnested-externs" ;; rhughes@241: esac rhughes@241: rhughes@241: case " $CFLAGS " in rhughes@241: *[\ \ ]-Wcast-align[\ \ ]*) ;; rhughes@241: *) CFLAGS="$CFLAGS -Wcast-align" ;; rhughes@241: esac rhughes@241: rhughes@241: case " $CFLAGS " in rhughes@241: *[\ \ ]-Wformat[\ \ ]*) ;; rhughes@241: *) CFLAGS="$CFLAGS -Wformat" ;; rhughes@241: esac rhughes@241: rhughes@241: case " $CFLAGS " in rhughes@241: *[\ \ ]-Wformat-security[\ \ ]*) ;; rhughes@241: *) CFLAGS="$CFLAGS -Wformat-security" ;; rhughes@241: esac rhughes@241: rhughes@241: if test "x$enable_ansi" = "xyes"; then rhughes@241: case " $CFLAGS " in rhughes@241: *[\ \ ]-ansi[\ \ ]*) ;; rhughes@241: *) CFLAGS="$CFLAGS -ansi" ;; rhughes@241: esac rhughes@241: rhughes@241: case " $CFLAGS " in rhughes@241: *[\ \ ]-D_POSIX_C_SOURCE*) ;; rhughes@241: *) CFLAGS="$CFLAGS -D_POSIX_C_SOURCE=199309L" ;; rhughes@241: esac rhughes@241: rhughes@241: case " $CFLAGS " in rhughes@241: *[\ \ ]-D_BSD_SOURCE[\ \ ]*) ;; rhughes@241: *) CFLAGS="$CFLAGS -D_BSD_SOURCE" ;; rhughes@241: esac rhughes@241: rhughes@241: case " $CFLAGS " in rhughes@241: *[\ \ ]-pedantic[\ \ ]*) ;; rhughes@241: *) CFLAGS="$CFLAGS -pedantic" ;; rhughes@241: esac rhughes@241: fi rhughes@241: changequote([,])dnl rhughes@241: fi rhughes@241: krh@269: krh@269: # gcc default visibility stuff krh@269: krh@269: have_gcc4=no krh@269: AC_MSG_CHECKING(for -fvisibility) krh@269: AC_COMPILE_IFELSE([ krh@269: #if defined(__GNUC__) && (__GNUC__ >= 4) krh@269: #else krh@269: #error Need GCC 4.0 for visibility krh@269: #endif krh@269: int main () { return 0; } krh@269: ], have_gcc4=yes) krh@269: krh@269: if test "x$have_gcc4" = "xyes"; then krh@269: CFLAGS="$CFLAGS -fvisibility=hidden" krh@269: fi krh@269: AC_MSG_RESULT($have_gcc4) krh@269: ali@344: REQUIREMENTS="" ali@476: AC_ARG_WITH([libarchive], ali@476: [AS_HELP_STRING([--without-libarchive], ali@476: [disable support for libarchive])], ali@476: [], ali@476: [with_libarchive=yes]) ali@476: ali@476: LIBARCHIVE_CFLAGS= ali@476: LIBARCHIVE_LIBS= ali@476: AS_IF([test "x$with_libarchive" != xno], ali@476: [PKG_CHECK_MODULES(LIBARCHIVE, [libarchive]) ali@476: REQUIREMENTS="$REQUIREMENTS libarchive" ali@476: AC_DEFINE([HAVE_LIBARCHIVE], [1], [Define if you have libarchive])]) ali@476: AC_SUBST(LIBARCHIVE_CFLAGS) ali@476: AC_SUBST(LIBARCHIVE_LIBS) ali@476: ali@476: AS_IF([test "x$with_libarchive" != xno], ali@476: [AC_PATH_PROG(ZIP, [zip], [])]) ali@476: AM_CONDITIONAL([HAVE_ZIP], [test -n "$ZIP"]) ali@476: ali@321: AC_ARG_WITH([curl], ali@321: [AS_HELP_STRING([--without-curl], [disable support for curl])], ali@321: [], ali@321: [with_curl=yes]) ali@321: ali@321: CURL_CFLAGS= ali@321: CURL_LIBS= ali@321: AS_IF([test "x$with_curl" != xno], ali@321: [PKG_CHECK_MODULES(CURL, [libcurl]) ali@321: AC_DEFINE([HAVE_CURL], [1], [Define if you have curl])]) rhughes@241: AC_SUBST(CURL_CFLAGS) rhughes@241: AC_SUBST(CURL_LIBS) ali@476: AM_CONDITIONAL([HAVE_CURL], [test "x$with_curl" != xno]) rhughes@241: rhughes@241: ZLIB_LIBS="" rhughes@241: AC_ARG_WITH(zlib, [ --with-zlib= Use zlib from here], rhughes@241: [ rhughes@241: zlib=$withval rhughes@241: CPPFLAGS="$CPPFLAGS -I$withval/include" rhughes@241: ] rhughes@241: ) rhughes@241: AC_CHECK_HEADERS(zlib.h, [AC_DEFINE(HAVE_ZLIB_H)], rhughes@241: [AC_MSG_ERROR([Can't find zlib.h. Please install zlib.])]) ali@344: save_ldflags="$LDFLAGS" ali@344: LDFLAGS="$LDFLAGS -L$zlib/lib" ali@344: AC_CHECK_LIB(z, inflate, [ZLIB_LIBS="-L$zlib/lib -lz"], rhughes@241: [AC_MSG_ERROR([Can't find zlib library. Please install zlib.])]) ali@344: LDFLAGS="$save_ldflags" rhughes@241: AC_SUBST(ZLIB_LIBS) rhughes@241: rhughes@241: EXPAT_LIB="" ali@468: PKG_CHECK_MODULES(EXPAT, [expat21], ali@468: [AC_DEFINE([HAVE_EXPAT_H]) ali@468: CPPFLAGS="$CPPFLAGS $EXPAT_CFLAGS"], ali@468: [AC_ARG_WITH(expat, [ --with-expat= If expat 2.1 isn't available, ali@468: fallback to using legacy expat from here], ali@468: [ ali@468: expat=$withval ali@468: CPPFLAGS="$CPPFLAGS -I$withval/include" ali@468: ] ali@468: ) ali@468: AC_CHECK_HEADERS(expat.h, [AC_DEFINE(HAVE_EXPAT_H)], rhughes@241: [AC_MSG_ERROR([Can't find expat.h. Please install expat.])]) ali@468: save_ldflags="$LDFLAGS" ali@468: LDFLAGS="$LDFLAGS -L$expat/lib" ali@468: AC_CHECK_LIB(expat, XML_ParserCreate, [EXPAT_LIBS="-L$expat/lib -lexpat"], rhughes@241: [AC_MSG_ERROR([Can't find expat library. Please install expat.])]) ali@468: LDFLAGS="$save_ldflags"]) rhughes@241: AC_SUBST(EXPAT_LIBS) rhughes@241: ali@320: RPM_LIBS="" ali@320: AC_ARG_WITH(rpm, [ --with-rpm= Use rpm from here]) ali@320: ali@320: AS_IF([test "$with_rpm" != no], ali@320: [if test "$with_rpm" != yes; then ali@320: CPPFLAGS="$CPPFLAGS -I$with_rpm/include" ali@320: fi ali@320: AC_CHECK_HEADERS(rpm/rpmlib.h, [], ali@320: [AC_MSG_ERROR([Can't find rpm/rpmlib.h. Please install rpm-devel or use --without-rpm.])]) ali@344: save_ldflags="$LDFLAGS" ali@344: LDFLAGS="$LDFLAGS -L$with_rpm/lib" ali@344: AC_CHECK_LIB(rpm,rpmdbOpen,[RPM_LIBS="-L$with_rpm/lib -lrpm"], ali@320: [AC_MSG_ERROR([Can't find rpm library. Please install rpm-devel or use --without-rpm.])]) ali@344: LDFLAGS="$save_ldflags" ali@320: AC_DEFINE([HAVE_RPMLIB], [1], [Define if you have librpm])]) rhughes@241: AC_SUBST(RPM_LIBS) ali@320: AM_CONDITIONAL([HAVE_RPMLIB], [test -n "$RPM_LIBS"]) ali@352: ali@352: AC_ARG_WITH([lua], ali@352: [AS_HELP_STRING([--without-lua], [disable support for lua])], ali@352: [], ali@352: [with_lua=yes]) ali@428: ali@352: AS_IF([test "x$with_lua" != xno], ali@352: [PKG_CHECK_MODULES(LUA, [lua]) ali@352: REQUIREMENTS="$REQUIREMENTS lua" ali@352: AC_DEFINE([HAVE_LUA], [1], [Define if you have lua]) ali@352: AC_PATH_PROG(LUA, [lua], [no]) ali@352: AS_IF([test "x$LUA" = xno], ali@352: [AC_MSG_ERROR([Can't find lua program. Please install lua-devel or use --without-lua.])]) ali@352: AC_DEFINE_UNQUOTED([LUA_BINARY], ["$LUA"], ali@352: [Define to the location of the lua binary])]) ali@352: AC_SUBST(LUA_CFLAGS) ali@352: AC_SUBST(LUA_LIBS) ali@352: AM_CONDITIONAL([HAVE_LUA], [test "x$with_lua" != xno]) ali@352: ali@344: AC_SUBST(REQUIREMENTS) rhughes@241: rhughes@241: if test "x$GCC" = "xyes"; then rhughes@241: LDFLAGS="-Wl,--as-needed $LDFLAGS" rhughes@241: fi rhughes@241: rhughes@241: # ***************************** rhughes@241: # Make available to Makefile.am rhughes@241: # ***************************** rhughes@241: AC_SUBST(SYSCONFDIR, $sysconfdir) rhughes@241: rhughes@241: # ******************** rhughes@241: # Internationalisation rhughes@241: # ******************** rhughes@241: ali@319: IT_PROG_INTLTOOL([0.35.0]) rhughes@241: GETTEXT_PACKAGE=razor rhughes@241: AC_SUBST([GETTEXT_PACKAGE]) rhughes@241: AM_GLIB_GNU_GETTEXT rhughes@241: AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE],["$GETTEXT_PACKAGE"],[gettext domain]) rhughes@241: krh@262: GTK_DOC_CHECK([1.9]) krh@262: rhughes@241: AC_OUTPUT([ rhughes@241: Makefile rhughes@241: data/razor.pc rhughes@241: data/Makefile rhughes@241: librazor/Makefile ali@452: librazor/razor.h ali@364: librazor/types/Makefile rhughes@241: src/Makefile rhughes@241: docs/Makefile krh@262: docs/version.xml rhughes@241: po/Makefile.in ali@323: gl/Makefile ali@351: test/Makefile rhughes@241: ]) rhughes@241: rhughes@241: dnl ========================================================================== rhughes@241: echo " rhughes@241: razor $VERSION rhughes@241: ================= rhughes@241: rhughes@241: prefix: ${prefix} rhughes@241: libdir: ${libdir} rhughes@241: libexecdir: ${libexecdir} rhughes@241: bindir: ${bindir} rhughes@241: sbindir: ${sbindir} rhughes@241: datadir: ${datadir} rhughes@241: sysconfdir: ${sysconfdir} rhughes@241: localstatedir: ${localstatedir} rhughes@241: docdir: ${docdir} rhughes@241: rhughes@241: compiler: ${CC} rhughes@241: cflags: ${CFLAGS} rhughes@241: Maintainer mode: ${USE_MAINTAINER_MODE} rhughes@241: Building verbose mode: ${enable_verbose_mode} krh@294: Building gtk-doc: ${enable_gtk_doc} rhughes@241: "