mas01mj@584: dnl -*- Mode: autoconf -*- mas01mj@584: dnl mas01mj@584: dnl configure.ac - top level autoconf file for Redland mas01mj@584: dnl (Process this file with autoconf to produce a configure script.) mas01mj@584: dnl mas01mj@584: dnl Copyright (C) 2000-2009 David Beckett http://www.dajobe.org/ mas01mj@584: dnl Copyright (C) 2000-2005 University of Bristol, UK http://www.bristol.ac.uk/ mas01mj@584: dnl mas01mj@584: dnl This package is Free Software and part of Redland http://librdf.org/ mas01mj@584: dnl mas01mj@584: dnl It is licensed under the following three licenses as alternatives: mas01mj@584: dnl 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version mas01mj@584: dnl 2. GNU General Public License (GPL) V2 or any newer version mas01mj@584: dnl 3. Apache License, V2.0 or any newer version mas01mj@584: dnl mas01mj@584: dnl You may not use this file except in compliance with at least one of mas01mj@584: dnl the above three licenses. mas01mj@584: dnl mas01mj@584: dnl See LICENSE.html or LICENSE.txt at the top of this package for the mas01mj@584: dnl complete terms and further detail along with the license texts for mas01mj@584: dnl the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. mas01mj@584: dnl mas01mj@584: dnl mas01mj@584: mas01mj@584: mas01mj@584: AC_INIT([Redland RDF Application Framework], 1.0.9, http://bugs.librdf.org/, redland) mas01mj@584: AC_PREREQ(2.53) mas01mj@584: dnl AC_CONFIG_SRCDIR(src/rdf_node.c) mas01mj@584: AC_REVISION($Revision$)dnl mas01mj@584: mas01mj@584: AM_INIT_AUTOMAKE([1.7 check-news std-options -Wobsolete -Wportability -Wsyntax -Wunsupported]) mas01mj@584: dnl AM_CONFIG_HEADER(src/rdf_config.h) mas01mj@584: AM_MAINTAINER_MODE mas01mj@584: mas01mj@584: AC_CANONICAL_HOST mas01mj@584: mas01mj@584: mas01mj@584: changequote(<<, >>)dnl mas01mj@584: version_major=`echo $VERSION | sed -e 's/^\([^\.]*\)\.\([^\.]*\)\.\(.*\)$/\1/'` mas01mj@584: version_minor=`echo $VERSION | sed -e 's/^\([^\.]*\)\.\([^\.]*\)\.\(.*\)$/\2/'` mas01mj@584: version_release=`echo $VERSION | sed -e 's/^\([^\.]*\)\.\([^\.]*\)\.\(.*\)$/\3/'` mas01mj@584: changequote([, ])dnl mas01mj@584: mas01mj@584: version_decimal=`expr $version_major \* 10000 + $version_minor \* 100 + $version_release` mas01mj@584: mas01mj@584: AC_DEFINE_UNQUOTED(LIBRDF_VERSION_MAJOR, $version_major, [Major version number]) mas01mj@584: AC_DEFINE_UNQUOTED(LIBRDF_VERSION_MINOR, $version_minor, [Minor version number]) mas01mj@584: AC_DEFINE_UNQUOTED(LIBRDF_VERSION_RELEASE, $version_release, [Release version number]) mas01mj@584: AC_DEFINE_UNQUOTED(LIBRDF_VERSION_DECIMAL, $version_decimal, [Release version as a decimal]) mas01mj@584: mas01mj@584: # for redland-config.in mas01mj@584: LIBRDF_VERSION_DECIMAL=$version_decimal mas01mj@584: AC_SUBST(LIBRDF_VERSION_DECIMAL) mas01mj@584: mas01mj@584: mas01mj@584: # Libtool versioning mas01mj@584: # mas01mj@584: # CURRENT mas01mj@584: # The most recent interface number that this library implements. mas01mj@584: # mas01mj@584: # REVISION mas01mj@584: # The implementation number of the CURRENT interface. mas01mj@584: # mas01mj@584: # AGE mas01mj@584: # The difference between the newest and oldest interfaces that this mas01mj@584: # library implements. In other words, the library implements all the mas01mj@584: # interface numbers in the range from number `CURRENT - AGE' to mas01mj@584: # `CURRENT'. mas01mj@584: # mas01mj@584: # Rules: mas01mj@584: # 1. Start with version information of `0:0:0' for each libtool library. mas01mj@584: # mas01mj@584: # 2. Update the version information only immediately before a public mas01mj@584: # release of your software. More frequent updates are unnecessary, mas01mj@584: # and only guarantee that the current interface number gets larger mas01mj@584: # faster. mas01mj@584: # mas01mj@584: # 3. If the library source code has changed at all since the last mas01mj@584: # update, then increment REVISION (`C:R:A' becomes `C:r+1:A'). mas01mj@584: # mas01mj@584: # 4. If any interfaces have been added, removed, or changed since the mas01mj@584: # last update, increment CURRENT, and set REVISION to 0. mas01mj@584: # mas01mj@584: # 5. If any interfaces have been added since the last public release, mas01mj@584: # then increment AGE. mas01mj@584: # mas01mj@584: # 6. If any interfaces have been removed since the last public release, mas01mj@584: # then set AGE to 0. mas01mj@584: # mas01mj@584: # syntax: CURRENT[:REVISION[:AGE]] mas01mj@584: LIBRDF_LIBTOOL_VERSION=0:0:0 mas01mj@584: AC_SUBST(LIBRDF_LIBTOOL_VERSION) mas01mj@584: mas01mj@584: dnl Checks for programs. mas01mj@584: AM_SANITY_CHECK mas01mj@584: AC_PROG_CC mas01mj@584: AM_PROG_CC_C_O mas01mj@584: AC_PROG_INSTALL mas01mj@584: AC_PROG_LN_S mas01mj@584: AC_PROG_MAKE_SET mas01mj@584: mas01mj@584: m4_undefine([AC_PROG_CXX]) mas01mj@584: m4_defun([AC_PROG_CXX],[]) mas01mj@584: m4_undefine([AC_PROG_F77]) mas01mj@584: m4_defun([AC_PROG_F77],[]) mas01mj@584: mas01mj@584: # Libtool and LTDL initialising mas01mj@584: LT_CONFIG_LTDL_DIR([libltdl]) mas01mj@584: LT_INIT([dlopen]) mas01mj@584: LTDL_INIT([convenience]) mas01mj@584: mas01mj@584: # Find a tar command for 'make dist' mas01mj@584: AC_CHECK_PROGS(TAR, gnutar gtar tar) mas01mj@584: mas01mj@584: AC_CHECK_PROGS(PERL, perl) mas01mj@584: # Gnome mas01mj@584: AC_CHECK_PROGS(PKG_CONFIG, pkg-config) mas01mj@584: mas01mj@584: mas01mj@584: AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir) mas01mj@584: AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir) mas01mj@584: AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir) mas01mj@584: AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) mas01mj@584: mas01mj@584: mas01mj@584: release_version=no mas01mj@584: AC_ARG_ENABLE(release, [ --enable-release Turn on optimizations (for maintainer). ], \ mas01mj@584: if test "$enableval" = "yes"; then \ mas01mj@584: release_version=yes mas01mj@584: fi;) mas01mj@584: mas01mj@584: modular=yes mas01mj@584: AC_ARG_ENABLE(modular, [ --disable-modular Build storage backends into librdf library. ], \ mas01mj@584: if test "$enableval" = "no"; then \ mas01mj@584: modular=no mas01mj@584: fi;) mas01mj@584: mas01mj@584: dnl compiler checks mas01mj@584: mas01mj@584: AC_DEFUN([REDLAND_CC_TRY_FLAG], [ mas01mj@584: AC_MSG_CHECKING([whether $CC supports $1]) mas01mj@584: redland_save_CFLAGS="$CFLAGS" mas01mj@584: CFLAGS="$CFLAGS $1" mas01mj@584: AC_COMPILE_IFELSE([ ], [redland_cc_flag=yes], [redland_cc_flag=no]) mas01mj@584: CFLAGS="$redland_save_CFLAGS" mas01mj@584: if test "X$redland_cc_flag" = "Xyes"; then mas01mj@584: ifelse([$2], , :, [$2]) mas01mj@584: else mas01mj@584: ifelse([$3], , :, [$3]) mas01mj@584: fi mas01mj@584: AC_MSG_RESULT($redland_cc_flag) mas01mj@584: ]) mas01mj@584: mas01mj@584: possible_warnings="-Wall -Wextra \ mas01mj@584: -Wshadow -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \ mas01mj@584: -Wmissing-declarations -Wnested-externs -Wredundant-decls -Wswitch-enum \ mas01mj@584: -Wsign-compare -Werror-implicit-function-declaration -Wwrite-strings mas01mj@584: -Wpacked -Wmissing-format-attribute -Wpointer-arith -Wcast-align -Winit-self \ mas01mj@584: -Wunsafe-loop-optimizations -Wdeclaration-after-statement \ mas01mj@584: -Wold-style-definition \ mas01mj@584: -Wno-missing-field-initializers -Wno-unused-parameter \ mas01mj@584: -Wformat-security" mas01mj@584: mas01mj@584: warning_cflags= mas01mj@584: if test "$USE_MAINTAINER_MODE" = yes; then mas01mj@584: AC_MSG_CHECKING(for supported $CC warning flags) mas01mj@584: AC_MSG_RESULT($warning_cflags) mas01mj@584: for warning in $possible_warnings; do mas01mj@584: REDLAND_CC_TRY_FLAG([$warning], [warning_cflags="$warning_cflags $warning"]) mas01mj@584: done mas01mj@584: AC_MSG_CHECKING($CC supports warning flags) mas01mj@584: AC_MSG_RESULT($warning_cflags) mas01mj@584: fi mas01mj@584: mas01mj@584: MAINTAINER_CFLAGS="$warning_cflags" mas01mj@584: mas01mj@584: mas01mj@584: # Externally linked libraries - appear in redland-config mas01mj@584: # -Dfoo -Idir mas01mj@584: LIBRDF_CPPFLAGS=$CPPFLAGS mas01mj@584: # -Ldir mas01mj@584: LIBRDF_LDFLAGS=$LDFLAGS mas01mj@584: # -llib mas01mj@584: LIBRDF_LIBS=$LIBS mas01mj@584: mas01mj@584: # Internally linked libraries - never given to users mas01mj@584: # -Dfoo -Idir mas01mj@584: LIBRDF_INTERNAL_CPPFLAGS= mas01mj@584: # -Ldir -llib mas01mj@584: LIBRDF_INTERNAL_LIBS= mas01mj@584: mas01mj@584: # Libraries linked externally also may be internal - presently just mas01mj@584: # raptor and rasqal but in future may include others mas01mj@584: # Currently only substituted into redland-src-config. mas01mj@584: # -Dfoo -Idir mas01mj@584: LIBRDF_EXTERNAL_CPPFLAGS= mas01mj@584: # -Ldir -llib mas01mj@584: LIBRDF_EXTERNAL_LIBS= mas01mj@584: mas01mj@584: # do these first because somehow they get messed up by bdb checks mas01mj@584: AC_CHECK_TYPES([byte]) mas01mj@584: AC_CHECK_TYPES([u32]) mas01mj@584: AC_CHECK_TYPES([u64]) mas01mj@584: mas01mj@584: AC_CHECK_SIZEOF(unsigned char, 1) mas01mj@584: AC_CHECK_SIZEOF(unsigned int, 4) mas01mj@584: AC_CHECK_SIZEOF(unsigned long, 4) mas01mj@584: AC_CHECK_SIZEOF(unsigned long long, 8) mas01mj@584: mas01mj@584: dnl Location of the librdf source mas01mj@584: AC_ARG_WITH(librdf, [ --with-librdf=DIR librdf (Redland) source folder], librdf_src_dir="$withval", librdf_src_dir="none") mas01mj@584: mas01mj@584: if test "$librdf_src_dir" = "none" ; then mas01mj@584: AC_MSG_ERROR(Please supply your librdf source folder (e.g. /home/bob/librdf/src)) mas01mj@584: fi mas01mj@584: mas01mj@584: LIBRDF_SRC_DIR=$librdf_src_dir mas01mj@584: AC_SUBST(LIBRDF_SRC_DIR) mas01mj@584: mas01mj@584: dnl Checks for libraries. mas01mj@584: mas01mj@584: mas01mj@584: dnl Berkeley DB mas01mj@584: AC_ARG_WITH(bdb, [ --with-bdb=DIR Berkeley DB install area (default=/usr)], bdb_prefix="$withval", bdb_prefix="none") mas01mj@584: AC_ARG_WITH(bdb_lib, [ --with-bdb-lib=DIR Berkeley DB lib directory (default=/usr/lib)], bdb_lib_dir="$withval", bdb_lib_dir="none") mas01mj@584: AC_ARG_WITH(bdb_include, [ --with-bdb-include=DIR Berkeley DB include directory (default=/usr/include)], bdb_include_dir="$withval", bdb_include_dir="none") mas01mj@584: AC_ARG_WITH(bdb_dbname, [ --with-bdb-dbname=NAME Berkeley DB library name (auto)], bdb_dbname="$withval", bdb_dbname="none") mas01mj@584: mas01mj@584: bdb_version=unknown mas01mj@584: bdb_available=Missing mas01mj@584: mas01mj@584: if test "x$bdb_prefix" != "xno" ; then mas01mj@584: mas01mj@584: if test "x$bdb_prefix" = "xyes" ; then mas01mj@584: bdb_prefix="none" mas01mj@584: fi mas01mj@584: mas01mj@584: # Only prefix given - set lib and include mas01mj@584: if test "X$bdb_prefix" != "Xnone" -a "X$bdb_lib_dir" = "Xnone" -a "X$bdb_include_dir" = "Xnone" ; then mas01mj@584: bdb_lib_dir="$bdb_prefix/lib" mas01mj@584: bdb_include_dir="$bdb_prefix/include" mas01mj@584: fi mas01mj@584: mas01mj@584: # Nothing given - search mas01mj@584: if test "X$bdb_prefix" = "Xnone" -a "X$bdb_lib_dir" = "Xnone" -a "X$bdb_include_dir" = "Xnone" -a "X$bdb_dbname" = "Xnone" ; then mas01mj@584: bdb_prefix="/usr" mas01mj@584: bdb_lib_dir="/usr/lib" mas01mj@584: bdb_include_dir="/usr/include" mas01mj@584: mas01mj@584: extraprefix= mas01mj@584: # OSX fink area added if found and /sw/bin is in the PATH mas01mj@584: if test -d /sw/include -a -d /sw/lib ; then mas01mj@584: if echo $PATH |grep /sw/bin >/dev/null; then mas01mj@584: extraprefix=/sw mas01mj@584: fi mas01mj@584: fi mas01mj@584: mas01mj@584: # Sigh! And this still might not be good enough. mas01mj@584: for bdbc_version in 4.7 4.6 4.5 4.4 4.3 4.2 4.1 4.0 4 3.3 3.2 3.1 3 2; do mas01mj@584: bdbc_major=`echo $bdbc_version | sed -e 's/^\(.\).*$/\1/'`; mas01mj@584: bdbc_version2=`echo $bdbc_version | sed -e 's/^\(.\).\(.\)$/\1\2/'` mas01mj@584: mas01mj@584: for bdbc_prefix in $extraprefix /usr/local/BerkeleyDB.$bdbc_version /usr/local /opt/local /usr; do mas01mj@584: bdbc_libdir=$bdbc_prefix/lib mas01mj@584: mas01mj@584: for bdbc_incdir in $bdbc_prefix/include/db$bdbc_version $bdbc_prefix/include/db$bdbc_version2 $bdbc_prefix/include/db$bdbc_major $bdbc_prefix/include ; do mas01mj@584: if test -r $bdbc_incdir/db.h ; then mas01mj@584: header_bdbc_version=`sed -ne 's/^.*DB_VERSION_STRING.*Berkeley DB \(...\).*/\1/p' $bdbc_incdir/db.h` mas01mj@584: if test "X$header_bdbc_version" = "X$bdbc_version" ; then mas01mj@584: for bdbc_name in db-$bdbc_version db$bdbc_version db-$bdbc_version2 db$bdbc_version2; do mas01mj@584: for bdbc_libdir2 in $bdbc_libdir $bdbc_libdir/db$bdbc_version $bdbc_libdir/db$bdbc_version2; do mas01mj@584: if test -r $bdbc_libdir2/lib$bdbc_name.a -o -r $bdbc_libdir2/lib$bdbc_name.so -o -r $bdbc_libdir2/lib$bdbc_name.dylib; then mas01mj@584: bdb_version=$bdbc_version mas01mj@584: bdb_prefix=$bdbc_prefix mas01mj@584: bdb_include_dir=$bdbc_incdir mas01mj@584: bdb_lib_dir=$bdbc_libdir2 mas01mj@584: bdb_dbname=$bdbc_name mas01mj@584: break 5 mas01mj@584: fi mas01mj@584: done mas01mj@584: done mas01mj@584: fi mas01mj@584: fi mas01mj@584: mas01mj@584: done mas01mj@584: done mas01mj@584: done mas01mj@584: mas01mj@584: fi mas01mj@584: mas01mj@584: AC_MSG_CHECKING(BDB version) mas01mj@584: AC_MSG_RESULT($bdb_version) mas01mj@584: AC_MSG_CHECKING(location of BDB libs) mas01mj@584: AC_MSG_RESULT($bdb_lib_dir) mas01mj@584: AC_MSG_CHECKING(location of BDB includes) mas01mj@584: AC_MSG_RESULT($bdb_include_dir) mas01mj@584: mas01mj@584: if test "$bdb_prefix" != no; then mas01mj@584: nLDFLAGS=$LDFLAGS mas01mj@584: nCPPFLAGS= mas01mj@584: mas01mj@584: if test "$bdb_lib_dir" != /usr/lib; then mas01mj@584: nLDFLAGS="-L$bdb_lib_dir"; mas01mj@584: fi mas01mj@584: mas01mj@584: if test "$bdb_dbname" = none; then mas01mj@584: # Yuck, yuck, yuck - can't they create a bdb-config program like GNOME? mas01mj@584: bdb_dbname=`cd $bdb_lib_dir; ls -1 libdb*.a 2>/dev/null |sed -e 's/^lib//' -e 's/\.a$//' | head -1` mas01mj@584: if test "X$bdb_dbname" = X; then mas01mj@584: AC_MSG_WARN(Cannot find the BDB library name from the files in $bdb_lib_dir) mas01mj@584: AC_MSG_WARN(Assuming it is 'db' and will link like -ldb) mas01mj@584: AC_MSG_WARN(Use --with-bdb-dbname=NAME if this is wrong) mas01mj@584: bdb_dbname=db mas01mj@584: fi mas01mj@584: fi mas01mj@584: mas01mj@584: AC_MSG_CHECKING(name of BDB library) mas01mj@584: AC_MSG_RESULT($bdb_dbname) mas01mj@584: mas01mj@584: if test "$bdb_include_dir" != /usr/include; then mas01mj@584: nCPPFLAGS="-I$bdb_include_dir"; mas01mj@584: fi mas01mj@584: mas01mj@584: LDFLAGS="$nLDFLAGS $LDFLAGS" mas01mj@584: CPPFLAGS="$nCPPFLAGS $CPPFLAGS" mas01mj@584: LIBS="-l$bdb_dbname $LIBS" mas01mj@584: mas01mj@584: AC_CHECK_HEADERS(db.h) mas01mj@584: if test "$ac_cv_header_db_h" = yes ; then mas01mj@584: have_libdb=no mas01mj@584: mas01mj@584: AC_MSG_CHECKING(for BDB V1 dbopen) mas01mj@584: AC_TRY_LINK([#include mas01mj@584: #include ], [dbopen(NULL, 0, 0, DB_BTREE, NULL);], mas01mj@584: AC_DEFINE(HAVE_DBOPEN, 1, [BDB has dbopen method]) mas01mj@584: if test $have_libdb = no; then mas01mj@584: bdb_available="Version 1.x - not supported" mas01mj@584: have_libdb=no mas01mj@584: fi mas01mj@584: AC_MSG_RESULT(yes), mas01mj@584: AC_MSG_RESULT(no)) mas01mj@584: mas01mj@584: AC_MSG_CHECKING(for BDB V2 db_open) mas01mj@584: AC_TRY_LINK([#include mas01mj@584: #include ], [db_open(NULL, DB_BTREE, 0, 0, NULL, NULL, NULL);], mas01mj@584: AC_DEFINE(HAVE_DB_OPEN, 1, [BDB has db_open method]) mas01mj@584: have_libdb=yes mas01mj@584: AC_MSG_RESULT(yes), mas01mj@584: AC_MSG_RESULT(no)) mas01mj@584: mas01mj@584: AC_MSG_CHECKING(for BDB V3/V4.x db_create) mas01mj@584: AC_TRY_LINK([#include mas01mj@584: #include ], [db_create(NULL, NULL, 0);], mas01mj@584: AC_DEFINE(HAVE_DB_CREATE, 1, [BDB has db_create method]) mas01mj@584: have_libdb=yes mas01mj@584: AC_MSG_RESULT(yes), mas01mj@584: AC_MSG_RESULT(no)) mas01mj@584: mas01mj@584: AC_MSG_CHECKING(for BDB V4.0 DB->open with 6 arguments) mas01mj@584: AC_TRY_LINK([#include mas01mj@584: #include ], [DB *bdb; bdb->open(bdb, NULL, NULL, DB_BTREE, 0, 0);], mas01mj@584: AC_DEFINE(HAVE_BDB_OPEN_6_ARGS, 1, [BDB has open method with 6 args]) mas01mj@584: have_libdb=yes mas01mj@584: AC_MSG_RESULT(yes), mas01mj@584: AC_MSG_RESULT(no)) mas01mj@584: mas01mj@584: AC_MSG_CHECKING(for BDB DB->close with 2 arguments) mas01mj@584: AC_TRY_LINK([#include mas01mj@584: #include ], [DB *bdb; bdb->close(bdb, 0);], mas01mj@584: AC_DEFINE(HAVE_BDB_CLOSE_2_ARGS, 1, [BDB has close method with 2 args]) mas01mj@584: AC_MSG_RESULT(yes), mas01mj@584: AC_MSG_RESULT(no)) mas01mj@584: mas01mj@584: AC_MSG_CHECKING(for BDB DB->fd with 2 arguments) mas01mj@584: AC_TRY_LINK([#include mas01mj@584: #include ], [DB *bdb; bdb->fd(bdb, 0);], mas01mj@584: AC_DEFINE(HAVE_BDB_FD_2_ARGS, 1, [BDB has fd method with 2 args]) mas01mj@584: AC_MSG_RESULT(yes), mas01mj@584: AC_MSG_RESULT(no)) mas01mj@584: mas01mj@584: AC_MSG_CHECKING(for BDB DB->set_flags) mas01mj@584: AC_TRY_LINK([#include mas01mj@584: #include ], [DB *bdb; bdb->set_flags(bdb, 0);], mas01mj@584: AC_DEFINE(HAVE_BDB_SET_FLAGS, 1, [BDB has set_flags method]) mas01mj@584: AC_MSG_RESULT(yes), mas01mj@584: AC_MSG_RESULT(no)) mas01mj@584: mas01mj@584: AC_MSG_CHECKING(for BDB V4.1+ DB->open with 7 arguments) mas01mj@584: AC_TRY_LINK([#include mas01mj@584: #include ], [DB *bdb; bdb->open(bdb, NULL, NULL, NULL, DB_BTREE, 0, 0);], mas01mj@584: AC_DEFINE(HAVE_BDB_OPEN_7_ARGS, 1, [BDB has open method with 7 args]) mas01mj@584: have_libdb=yes mas01mj@584: AC_MSG_RESULT(yes), mas01mj@584: AC_MSG_RESULT(no)) mas01mj@584: mas01mj@584: AC_MSG_CHECKING(whether DB_TXN defined in db.h) mas01mj@584: dnl In BDB, DB_TXN is a pointer to a structure never defined mas01mj@584: AC_TRY_LINK([#include mas01mj@584: #include ], [DB_TXN* ptr=(DB_TXN*)NULL], mas01mj@584: AC_DEFINE(HAVE_BDB_DB_TXN, 1, [BDB defines DB_TXN]) mas01mj@584: AC_MSG_RESULT(yes), mas01mj@584: AC_MSG_RESULT(no)) mas01mj@584: AC_MSG_CHECKING(whether DBC defined in db.h) mas01mj@584: AC_TRY_LINK([#include ], [size_t len=sizeof(DBC)], mas01mj@584: AC_DEFINE(HAVE_BDB_CURSOR, 1, [BDB defines DBC]) mas01mj@584: AC_MSG_RESULT(yes), mas01mj@584: AC_MSG_RESULT(no)) mas01mj@584: AC_MSG_CHECKING(number of arguments to db_cursor) mas01mj@584: AC_TRY_LINK([#include mas01mj@584: #include ], [DB* db; db->cursor(db, NULL, NULL, 0);], mas01mj@584: AC_DEFINE(HAVE_BDB_CURSOR_4_ARGS, 1, [BDB cursor method has 4 arguments]) mas01mj@584: AC_MSG_RESULT(4), mas01mj@584: AC_MSG_RESULT(3)) mas01mj@584: fi mas01mj@584: mas01mj@584: if test "$have_libdb" = yes; then mas01mj@584: bdb_available="Version $bdb_version (library $bdb_dbname in $bdb_lib_dir)" mas01mj@584: LIBRDF_LIBS="$LIBRDF_LIBS $nLDFLAGS -l$bdb_dbname" mas01mj@584: LIBRDF_CPPFLAGS="$LIBRDF_CPPFLAGS $nCPPFLAGS" mas01mj@584: fi mas01mj@584: mas01mj@584: fi mas01mj@584: mas01mj@584: fi mas01mj@584: mas01mj@584: CPPFLAGS="$LIBRDF_CPPFLAGS" mas01mj@584: LDFLAGS="$LIBRDF_LDFLAGS" mas01mj@584: LIBS="$LIBRDF_LIBS" mas01mj@584: mas01mj@584: mas01mj@584: dnl Checks for header files. mas01mj@584: AC_HEADER_STDC mas01mj@584: AC_CHECK_HEADERS(errno.h stdlib.h unistd.h string.h fcntl.h dmalloc.h time.h sys/time.h sys/stat.h getopt.h) mas01mj@584: AC_HEADER_TIME mas01mj@584: mas01mj@584: dnl Checks for typedefs, structures, and compiler characteristics. mas01mj@584: AC_C_CONST mas01mj@584: AC_C_BIGENDIAN mas01mj@584: mas01mj@584: dnl Checks for library functions. mas01mj@584: AC_CHECK_FUNCS(getopt getopt_long memcmp mkstemp mktemp tmpnam gettimeofday getenv) mas01mj@584: mas01mj@584: AM_CONDITIONAL(MEMCMP, test $ac_cv_func_memcmp = no) mas01mj@584: AM_CONDITIONAL(GETOPT, test $ac_cv_func_getopt = no -a $ac_cv_func_getopt_long = no) mas01mj@584: mas01mj@584: dnl Checks for URI resolvers mas01mj@584: mas01mj@584: CPPFLAGS="$LIBRDF_CPPFLAGS" mas01mj@584: LDFLAGS="$LIBRDF_LDFLAGS" mas01mj@584: LIBS="$LIBRDF_LIBS" mas01mj@584: mas01mj@584: mas01mj@584: dnl Checks for XML parsers mas01mj@584: mas01mj@584: # At present this is for passing on to raptor and not used here mas01mj@584: AC_ARG_WITH(xml-parser, [ --with-xml-parser=NAME Use XML parser - expat, libxml (default=libxml)], xml_parser="$withval", xml_parser="libxml") mas01mj@584: mas01mj@584: mas01mj@584: mas01mj@584: mas01mj@584: dnl Checks for RDF parsers mas01mj@584: parser_modules=raptor mas01mj@584: rdf_parsers_available= mas01mj@584: mas01mj@584: # Check for raptor mas01mj@584: AC_MSG_CHECKING(for raptor) mas01mj@584: mas01mj@584: RAPTOR_MIN_VERSION=1.4.17 mas01mj@584: AC_SUBST(RAPTOR_MIN_VERSION) mas01mj@584: if $PKG_CONFIG raptor --exists; then mas01mj@584: : mas01mj@584: else mas01mj@584: AC_MSG_ERROR(Raptor is not installed - see http://librdf.org/raptor/ to get a version newer than $RAPTOR_MIN_VERSION) mas01mj@584: fi mas01mj@584: mas01mj@584: RAPTOR_VERSION=`$PKG_CONFIG raptor --modversion 2>/dev/null` mas01mj@584: mas01mj@584: if $PKG_CONFIG raptor --atleast-version=$RAPTOR_MIN_VERSION; then mas01mj@584: : mas01mj@584: else mas01mj@584: AC_MSG_ERROR(Installed raptor $RAPTOR_VERSION is too old - need $RAPTOR_MIN_VERSION) mas01mj@584: fi mas01mj@584: mas01mj@584: LIBRDF_EXTERNAL_CPPFLAGS="`$PKG_CONFIG raptor --cflags` $LIBRDF_EXTERNAL_CPPFLAGS" mas01mj@584: LIBRDF_EXTERNAL_LIBS="`$PKG_CONFIG raptor --libs` $LIBRDF_EXTERNAL_LIBS" mas01mj@584: mas01mj@584: rdf_parsers_available="$parser_available raptor(system $RAPTOR_VERSION)" mas01mj@584: AC_MSG_RESULT(system $RAPTOR_VERSION) mas01mj@584: mas01mj@584: # Check for rasqal mas01mj@584: AC_MSG_CHECKING(for rasqal) mas01mj@584: mas01mj@584: RASQAL_MIN_VERSION=0.9.16 mas01mj@584: RASQAL_MAX_VERSION=0.9.99 mas01mj@584: AC_SUBST(RASQAL_MIN_VERSION) mas01mj@584: AC_SUBST(RASQAL_MAX_VERSION) mas01mj@584: if $PKG_CONFIG rasqal --exists; then mas01mj@584: : mas01mj@584: else mas01mj@584: AC_MSG_ERROR(Rasqal is not installed - see http://librdf.org/rasqal/ to get a version in range $RASQAL_MIN_VERSION to $RASQAL_MAX_VERSION) mas01mj@584: fi mas01mj@584: mas01mj@584: RASQAL_VERSION=`$PKG_CONFIG rasqal --modversion 2>/dev/null` mas01mj@584: mas01mj@584: if $PKG_CONFIG rasqal --atleast-version=$RASQAL_MIN_VERSION --max-version=$RASQAL_MAX_VERSION; then mas01mj@584: : mas01mj@584: else mas01mj@584: AC_MSG_ERROR(Installed rasqal $RASQAL_VERSION is not in range $RASQAL_MIN_VERSION to $RASQAL_MAX_VERSION) mas01mj@584: fi mas01mj@584: mas01mj@584: LIBRDF_EXTERNAL_CPPFLAGS="`$PKG_CONFIG rasqal --cflags` $LIBRDF_EXTERNAL_CPPFLAGS" mas01mj@584: LIBRDF_EXTERNAL_LIBS="`$PKG_CONFIG rasqal --libs` $LIBRDF_EXTERNAL_LIBS" mas01mj@584: mas01mj@584: rdf_query="rasqal(system $RASQAL_VERSION)" mas01mj@584: AC_MSG_RESULT(system $RASQAL_VERSION) mas01mj@584: mas01mj@584: mas01mj@584: dnl Checks for modules mas01mj@584: digest_modules="md5 sha1 ripemd160" mas01mj@584: mas01mj@584: AC_MSG_CHECKING(digests wanted) mas01mj@584: AC_ARG_ENABLE(digests, [ --enable-digests=LIST Use digests (default=md5 sha1 ripemd160)], digest_modules="$enableval") mas01mj@584: AC_MSG_RESULT($digest_modules) mas01mj@584: mas01mj@584: DIGEST_OBJS= mas01mj@584: DIGEST_SRCS= mas01mj@584: mas01mj@584: AC_ARG_WITH(openssl-digests, [ --with-openssl-digests Use openssl digests (default=yes)], enable_openssl_digests="no", enable_openssl_digests="no") mas01mj@584: mas01mj@584: digest_modules_available= mas01mj@584: mas01mj@584: mas01mj@584: dnl hashes mas01mj@584: HASH_OBJS= mas01mj@584: HASH_SRCS= mas01mj@584: mas01mj@584: AC_MSG_CHECKING(for bdb hash support) mas01mj@584: if test "$have_libdb" = yes; then mas01mj@584: AC_MSG_RESULT(yes) mas01mj@584: AC_DEFINE(HAVE_BDB_HASH, 1, [Have BDB hash support]) mas01mj@584: HASH_OBJS="$HASH_OBJS rdf_hash_bdb.lo" mas01mj@584: HASH_SRCS="$HASH_SRCS rdf_hash_bdb.c" mas01mj@584: else mas01mj@584: AC_MSG_RESULT(no) mas01mj@584: fi mas01mj@584: mas01mj@584: mas01mj@584: AC_SUBST(HASH_OBJS) mas01mj@584: AC_SUBST(HASH_SRCS) mas01mj@584: mas01mj@584: mas01mj@584: dnl Storages mas01mj@584: persistent_storages="/file/tstore/mysql/sqlite/" mas01mj@584: persistent_store=no mas01mj@584: all_storages="audiodb memory file hashes trees mysql sqlite tstore postgresql" mas01mj@584: always_available_storages="audiodb memory file hashes trees" mas01mj@584: mas01mj@584: dnl default availabilities and enablements mas01mj@584: for storage in $all_storages; do mas01mj@584: eval $storage'_storage_available=no' mas01mj@584: eval $storage'_storage=no' mas01mj@584: done mas01mj@584: for storage in $always_available_storages; do mas01mj@584: eval $storage'_storage_available=yes' mas01mj@584: eval $storage'_storage=yes' mas01mj@584: done mas01mj@584: mas01mj@584: mas01mj@584: storages_available="audiodb memory file hashes(memory) trees" mas01mj@584: if test "$have_libdb" = yes; then mas01mj@584: storages_available="$storages_available hashes(bdb $bdb_version)" mas01mj@584: fi mas01mj@584: mas01mj@584: AC_ARG_WITH(threestore, [ --with-threestore(=CONFIG|yes|no) Location of 3store-config (default=auto)], tstore_config="$withval", tstore_config="") mas01mj@584: if test "X$tstore_config" != "Xno"; then mas01mj@584: if test "X$tstore_config" != "Xyes" ; then mas01mj@584: TSTORE_CONFIG=$tstore_config mas01mj@584: fi mas01mj@584: tstore_config=yes mas01mj@584: fi mas01mj@584: if test $tstore_config = yes -a "X$TSTORE_CONFIG" = "X" ; then mas01mj@584: AC_CHECK_PROGS(TSTORE_CONFIG, 3store-config) mas01mj@584: fi mas01mj@584: mas01mj@584: AC_MSG_CHECKING(for 3store library) mas01mj@584: if test "X$TSTORE_CONFIG" != X -a "X$PKG_CONFIG" != X ; then mas01mj@584: tstore_version=`$TSTORE_CONFIG --version` mas01mj@584: mas01mj@584: storages_available="$storages_available 3store($tstore_version)" mas01mj@584: tstore_storage_available=yes mas01mj@584: mas01mj@584: AC_MSG_RESULT(yes - version $tstore_version) mas01mj@584: else mas01mj@584: AC_MSG_RESULT(no) mas01mj@584: fi mas01mj@584: mas01mj@584: mas01mj@584: AC_ARG_WITH(mysql, [ --with-mysql(=CONFIG|yes|no) Location of MySQL 3/4 mysql_config (default=auto)], mysql_config="$withval", mysql_config="") mas01mj@584: if test "X$mysql_config" != "Xno"; then mas01mj@584: if test "X$mysql_config" != "Xyes" ; then mas01mj@584: MYSQL_CONFIG=$mysql_config mas01mj@584: fi mas01mj@584: mysql_config=yes mas01mj@584: fi mas01mj@584: if test $mysql_config = yes -a "X$MYSQL_CONFIG" = "X" ; then mas01mj@584: AC_CHECK_PROGS(MYSQL_CONFIG, mysql_config) mas01mj@584: fi mas01mj@584: mas01mj@584: libmysql_min_version=3.23.56 mas01mj@584: # Also tested on 4.0.14 mas01mj@584: mas01mj@584: mysql_cflags= mas01mj@584: mysql_libs= mas01mj@584: if test "X$MYSQL_CONFIG" != X; then mas01mj@584: dnl need to change quotes to allow square brackets mas01mj@584: changequote(<<, >>)dnl mas01mj@584: mysql_libs=`$MYSQL_CONFIG --libs | sed -e "s/'//g"` mas01mj@584: # Stop the MySQL config program adding -Os or -O options to CFLAGS mas01mj@584: mysql_cflags=`$MYSQL_CONFIG --cflags | sed -e "s/'//g" -e "s/[ \t]-O[A-Za-z0-9]*/ /" ` mas01mj@584: changequote([, ])dnl mas01mj@584: mas01mj@584: LIBS="$LIBRDF_LIBS $mysql_libs" mas01mj@584: CPPFLAGS="$LIBRDF_CPPFLAGS $mysql_cflags" mas01mj@584: AC_MSG_CHECKING(for mysql library) mas01mj@584: LIBMYSQL_VERSION=`$MYSQL_CONFIG --version` mas01mj@584: libmysql_version_dec=`echo $LIBMYSQL_VERSION | awk -F. '{printf("%d\n", 10000*$1 + 100*$2 + $3)};'` mas01mj@584: libmysql_min_version_dec=`echo $libmysql_min_version | awk -F. '{printf("%d\n", 10000*$1 + 100*$2 + $3)};'` mas01mj@584: AC_MSG_RESULT(yes - version $LIBMYSQL_VERSION) mas01mj@584: if test $libmysql_version_dec -lt $libmysql_min_version_dec; then mas01mj@584: AC_MSG_WARN(Using libmysql $LIBMYSQL_VERSION is unsupported - $libmysql_min_version or newer recommended.) mas01mj@584: else mas01mj@584: storages_available="$storages_available mysql($LIBMYSQL_VERSION)" mas01mj@584: mysql_storage_available=yes mas01mj@584: fi mas01mj@584: mas01mj@584: AC_MSG_CHECKING(whether MYSQL_OPT_RECONNECT is declared) mas01mj@584: AC_COMPILE_IFELSE([#include mas01mj@584: int x=MYSQL_OPT_RECONNECT;], mas01mj@584: AC_DEFINE(HAVE_MYSQL_OPT_RECONNECT, 1, [have MYSQL_OPT_RECONNECT declared]) mas01mj@584: AC_MSG_RESULT(yes), mas01mj@584: AC_MSG_RESULT(no)) mas01mj@584: mas01mj@584: mas01mj@584: LIBS="$LIBRDF_LIBS" mas01mj@584: CPPFLAGS="$LIBRDF_CPPFLAGS" mas01mj@584: fi mas01mj@584: mas01mj@584: mas01mj@584: mas01mj@584: AC_ARG_WITH(sqlite, [ --with-sqlite(=yes|no|2|3) Enable SQLite store with version (default=auto)], sqlite_api_version="$withval", sqlite_api_version="auto") mas01mj@584: AC_ARG_WITH(sqlite-version, [ --with-sqlite-version(=yes|no|2|3) SQLite version to use (default=auto)], sqlite_api_version="$withval") mas01mj@584: if test "x$sqlite_api_version" = "xyes" ; then mas01mj@584: sqlite_api_version="auto" mas01mj@584: fi mas01mj@584: mas01mj@584: AC_MSG_CHECKING(for sqlite library versions available) mas01mj@584: sqlite_versions= mas01mj@584: if test "X$PKG_CONFIG" != X ; then mas01mj@584: sqlite_version=`$PKG_CONFIG sqlite3 --modversion 2>/dev/null` mas01mj@584: if test "X$sqlite_version" != X; then mas01mj@584: if test "X$sqlite_api_version" = Xauto; then mas01mj@584: sqlite_api_version=3 mas01mj@584: fi mas01mj@584: sqlite_versions=$sqlite_version mas01mj@584: fi mas01mj@584: sqlite_version=`$PKG_CONFIG sqlite --modversion 2>/dev/null` mas01mj@584: if test "X$sqlite_version" != X; then mas01mj@584: if test "X$sqlite_api_version" = Xauto; then mas01mj@584: sqlite_api_version=2 mas01mj@584: fi mas01mj@584: sqlite_versions="$sqlite_version $sqlite_versions" mas01mj@584: fi mas01mj@584: fi mas01mj@584: AC_MSG_RESULT($sqlite_versions) mas01mj@584: mas01mj@584: if test "X$sqlite_api_version" = Xauto; then mas01mj@584: sqlite_api_version=no mas01mj@584: fi mas01mj@584: mas01mj@584: AC_MSG_CHECKING(using sqlite library) mas01mj@584: if test "X$sqlite_api_version" != Xno ; then mas01mj@584: if test "$sqlite_api_version" = 3; then mas01mj@584: SQLITE_CONFIG="$PKG_CONFIG sqlite3" mas01mj@584: else mas01mj@584: SQLITE_CONFIG="$PKG_CONFIG sqlite" mas01mj@584: fi mas01mj@584: sqlite_version=`$SQLITE_CONFIG --modversion 2>/dev/null` mas01mj@584: AC_DEFINE_UNQUOTED(SQLITE_API, $sqlite_api_version, [SQLite API version]) mas01mj@584: mas01mj@584: storages_available="$storages_available sqlite($sqlite_version)" mas01mj@584: sqlite_storage_available=yes mas01mj@584: AC_MSG_RESULT(yes - version $sqlite_version) mas01mj@584: mas01mj@584: CPPFLAGS="$LIBRDF_CPPFLAGS `$SQLITE_CONFIG --cflags`" mas01mj@584: AC_CHECK_HEADERS(sqlite3.h sqlite.h) mas01mj@584: CPPFLAGS="$LIBRDF_CPPFLAGS" mas01mj@584: else mas01mj@584: AC_MSG_RESULT(no) mas01mj@584: fi mas01mj@584: mas01mj@584: AC_ARG_WITH(postgresql, [ --with-postgresql(=CONFIG|yes|no) Location of pg_config (default=auto)], pg_config="$withval", postgresql_config="") mas01mj@584: if test "X$pg_config" != "Xno"; then mas01mj@584: if test "X$pg_config" != "Xyes" ; then mas01mj@584: PG_CONFIG=$pg_config mas01mj@584: fi mas01mj@584: pg_config=yes mas01mj@584: fi mas01mj@584: if test $pg_config = yes -a "X$PG_CONFIG" = "X" ; then mas01mj@584: AC_CHECK_PROGS(PG_CONFIG, pg_config) mas01mj@584: fi mas01mj@584: mas01mj@584: AC_MSG_CHECKING(for postgresql library) mas01mj@584: if test "X$PG_CONFIG" != X ; then mas01mj@584: postgresql_version=`$PG_CONFIG --version | sed -e 's/^.* //'` mas01mj@584: storages_available="$storages_available postgresql($postgresql_version)" mas01mj@584: postgresql_storage_available=yes mas01mj@584: mas01mj@584: AC_MSG_RESULT(yes - version $postgresql_version) mas01mj@584: mas01mj@584: CPPFLAGS="$LIBRDF_CPPFLAGS -I`$PG_CONFIG --includedir`" mas01mj@584: AC_CHECK_HEADERS(libpq-fe.h) mas01mj@584: CPPFLAGS="$LIBRDF_CPPFLAGS" mas01mj@584: mas01mj@584: LIBS="$LIBRDF_LIBS -L`$PG_CONFIG --libdir` -lpq" mas01mj@584: else mas01mj@584: AC_MSG_RESULT(no) mas01mj@584: fi mas01mj@584: mas01mj@584: mas01mj@584: # This is needed because autoheader can't work out which computed mas01mj@584: # symbols must be pulled from acconfig.h into config.h.in mas01mj@584: if test "x" = "y"; then mas01mj@584: AC_DEFINE(STORAGE_FILE, 1, [Building file storage]) mas01mj@584: AC_DEFINE(STORAGE_HASHES, 1, [Building hashes storage]) mas01mj@584: AC_DEFINE(STORAGE_TREES, 1, [Building trees storage]) mas01mj@584: AC_DEFINE(STORAGE_MEMORY, 1, [Building memory storage]) mas01mj@584: AC_DEFINE(STORAGE_MYSQL, 1, [Building MySQL storage]) mas01mj@584: AC_DEFINE(STORAGE_SQLITE, 1, [Building SQLite storage]) mas01mj@584: AC_DEFINE(STORAGE_TSTORE, 1, [Building 3store storage]) mas01mj@584: AC_DEFINE(STORAGE_POSTGRESQL, 1, [Building PostgreSQL storage]) mas01mj@584: AC_DEFINE(STORAGE_AUDIODB, 1, [Building AudioDB storage]) mas01mj@584: fi mas01mj@584: mas01mj@584: mas01mj@584: AC_MSG_CHECKING(storages required) mas01mj@584: AC_ARG_ENABLE(storages, [ --enable-storages=LIST Use storages (default=all)], storages="$enableval") mas01mj@584: if test "X$storages" = Xall -o "X$storages" = X; then mas01mj@584: storages="$all_storages" mas01mj@584: AC_MSG_RESULT(all) mas01mj@584: else mas01mj@584: AC_MSG_RESULT($storages) mas01mj@584: fi mas01mj@584: mas01mj@584: dnl absolutely ensuring memory is enabled mas01mj@584: if echo $storages | grep memory >/dev/null; then mas01mj@584: : mas01mj@584: else mas01mj@584: storages="memory $storages" mas01mj@584: fi mas01mj@584: mas01mj@584: for storage in $storages; do mas01mj@584: if eval test \$$storage'_storage_available' = yes; then mas01mj@584: eval $storage'_storage=yes' mas01mj@584: NAME=`echo $storage | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` mas01mj@584: n=STORAGE_${NAME} mas01mj@584: AC_DEFINE_UNQUOTED($n) mas01mj@584: storages_enabled="$storages_enabled $storage" mas01mj@584: mas01mj@584: if echo $persistent_storages | grep "/$storage/" >/dev/null; then mas01mj@584: persistent_store=yes mas01mj@584: fi mas01mj@584: fi mas01mj@584: mas01mj@584: done mas01mj@584: mas01mj@584: AM_CONDITIONAL(STORAGE_FILE, test $file_storage = yes) mas01mj@584: AM_CONDITIONAL(STORAGE_HASHES, test $hashes_storage = yes) mas01mj@584: AM_CONDITIONAL(STORAGE_TREES, test $trees_storage = yes) mas01mj@584: AM_CONDITIONAL(STORAGE_MEMORY, test $memory_storage = yes) mas01mj@584: AM_CONDITIONAL(STORAGE_MYSQL, test $mysql_storage = yes) mas01mj@584: AM_CONDITIONAL(STORAGE_SQLITE, test $sqlite_storage = yes) mas01mj@584: AM_CONDITIONAL(STORAGE_TSTORE, test $tstore_storage = yes) mas01mj@584: AM_CONDITIONAL(STORAGE_POSTGRESQL, test $postgresql_storage = yes) mas01mj@584: AM_CONDITIONAL(STORAGE_AUDIODB, test $audiodb_storage = yes) mas01mj@584: mas01mj@584: if test $mysql_storage = yes; then mas01mj@584: MYSQL_CPPFLAGS=`$MYSQL_CONFIG --cflags | sed -e "s/'//g" -e "s/-O[A-Za-z0-9]*//" ` mas01mj@584: MYSQL_LIBS="$LIBRDF_LIBS $mysql_libs" mas01mj@584: fi mas01mj@584: if test $sqlite_storage = yes; then mas01mj@584: SQLITE_CPPFLAGS="`$SQLITE_CONFIG --cflags`" mas01mj@584: SQLITE_LIBS="`$SQLITE_CONFIG --libs`" mas01mj@584: fi mas01mj@584: AUDIODB_CPPFLAGS="`$PKG_CONFIG glib --cflags`" mas01mj@584: AUDIODB_LIBS="-laudioDB `$PKG_CONFIG glib --libs`" mas01mj@584: if test $tstore_storage = yes; then mas01mj@584: TSTORE_CPPFLAGS="`$TSTORE_CONFIG --cflags` `$PKG_CONFIG glib --cflags`" mas01mj@584: TSTORE_LIBS="`$TSTORE_CONFIG --libs` `$PKG_CONFIG glib --libs`" mas01mj@584: fi mas01mj@584: if test $postgresql_storage = yes; then mas01mj@584: POSTGRESQL_CPPFLAGS="-I`$PG_CONFIG --includedir`" mas01mj@584: POSTGRESQL_LIBS="-L`$PG_CONFIG --libdir` -lpq" mas01mj@584: fi mas01mj@584: mas01mj@584: mas01mj@584: if test "$persistent_store" = no; then mas01mj@584: AC_MSG_WARN(No persistant storage is available or enabled) mas01mj@584: fi mas01mj@584: mas01mj@584: AC_SUBST(MYSQL_CPPFLAGS) mas01mj@584: AC_SUBST(MYSQL_LIBS) mas01mj@584: AC_SUBST(SQLITE_CPPFLAGS) mas01mj@584: AC_SUBST(SQLITE_LIBS) mas01mj@584: AC_SUBST(AUDIODB_CPPFLAGS) mas01mj@584: AC_SUBST(AUDIODB_LIBS) mas01mj@584: AC_SUBST(TSTORE_CPPFLAGS) mas01mj@584: AC_SUBST(TSTORE_LIBS) mas01mj@584: AC_SUBST(POSTGRESQL_CPPFLAGS) mas01mj@584: AC_SUBST(POSTGRESQL_LIBS) mas01mj@584: mas01mj@584: mas01mj@584: if test "$modular" = yes; then mas01mj@584: LIBRDF_CPPFLAGS="$LIBRDF_CPPFLAGS $INCLTDL" mas01mj@584: LIBRDF_LIBS="$LIBRDF_LIBS $LIBLTDL" mas01mj@584: AC_DEFINE(MODULAR_LIBRDF, 1, [Build storage backends as modules]) mas01mj@584: # AC_CONFIG_SUBDIRS([libltdl]) mas01mj@584: else mas01mj@584: LIBRDF_CPPFLAGS="$LIBRDF_CPPFLAGS $MYSQL_CPPFLAGS $SQLITE_CPPFLAGS $TSTORE_CPPFLAGS $POSTGRESQL_CPPFLAGS" mas01mj@584: LIBRDF_LIBS="$LIBRDF_LIBS $MYSQL_LIBS $SQLITE_LIBS $TSTORE_LIBS $POSTGRESQL_LIBS" mas01mj@584: fi mas01mj@584: mas01mj@584: AM_CONDITIONAL(MODULAR_LIBRDF, test $modular = yes) mas01mj@584: mas01mj@584: CPPFLAGS="$LIBRDF_CPPFLAGS" mas01mj@584: LDFLAGS="$LIBRDF_LDFLAGS" mas01mj@584: LIBS="$LIBRDF_LIBS" mas01mj@584: mas01mj@584: mas01mj@584: dnl Check for use of threads mas01mj@584: mas01mj@584: AC_ARG_WITH(threads, [ --with-threads With POSIX thread support (default=no)], with_threads="$withval", with_threads="no") mas01mj@584: mas01mj@584: AC_CHECK_HEADERS(pthread.h) mas01mj@584: mas01mj@584: AC_MSG_CHECKING(if POSIX threads should be used) mas01mj@584: if test $with_threads = "yes" ; then mas01mj@584: mas01mj@584: if test "$ac_cv_header_pthread_h" = yes ; then mas01mj@584: AC_DEFINE(WITH_THREADS, 1, [Use POSIX threads]) mas01mj@584: LIBRDF_LIBS="$LIBRDF_LIBS -lpthread" mas01mj@584: AC_MSG_RESULT(yes) mas01mj@584: else mas01mj@584: AC_MSG_RESULT(no) mas01mj@584: fi mas01mj@584: else mas01mj@584: AC_MSG_RESULT(no) mas01mj@584: fi mas01mj@584: mas01mj@584: LIBS=$LIBRDF_LIBS mas01mj@584: mas01mj@584: mas01mj@584: # Maybe add some local digest modules mas01mj@584: for module in $digest_modules; do mas01mj@584: module_u=`echo $module | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` mas01mj@584: AC_MSG_CHECKING(for local $module digest module) mas01mj@584: base=rdf_digest_$module mas01mj@584: if test -r $srcdir/src/$base.c; then mas01mj@584: AC_MSG_RESULT(yes) mas01mj@584: mas01mj@584: n=HAVE_LOCAL_${module_u}_DIGEST mas01mj@584: AC_DEFINE_UNQUOTED($n) mas01mj@584: mas01mj@584: DIGEST_OBJS="$DIGEST_OBJS $base.lo" mas01mj@584: DIGEST_SRCS="$DIGEST_SRCS $base.c" mas01mj@584: digest_modules_available="$digest_modules_available $module" mas01mj@584: else mas01mj@584: AC_MSG_RESULT(no) mas01mj@584: fi mas01mj@584: done mas01mj@584: mas01mj@584: AC_SUBST(DIGEST_OBJS) mas01mj@584: AC_SUBST(DIGEST_SRCS) mas01mj@584: mas01mj@584: # This is needed because autoheader can't work out which computed mas01mj@584: # symbols must be pulled from acconfig.h into config.h.in mas01mj@584: if test "x" = "y"; then mas01mj@584: AC_DEFINE(HAVE_LOCAL_MD5_DIGEST, 1, [Have local MD5 digest]) mas01mj@584: AC_DEFINE(HAVE_LOCAL_SHA1_DIGEST, 1, [Have local SHA1 digest]) mas01mj@584: AC_DEFINE(HAVE_LOCAL_RIPEMD160_DIGEST, 1, [Have local RIPEMD160 digest]) mas01mj@584: fi mas01mj@584: mas01mj@584: mas01mj@584: mas01mj@584: #LIBRDF_EXTERNAL_CPPFLAGS="$LIBRDF_EXTERNAL_CPPFLAGS $LIBRDF_CPPFLAGS" mas01mj@584: LIBRDF_EXTERNAL_LIBS="$LIBRDF_EXTERNAL_LIBS $LIBRDF_LIBS" mas01mj@584: mas01mj@584: # Everything except things with .pc files (raptor and rasqal) mas01mj@584: # 3store uses it but is optional and thus tricky to specify this way mas01mj@584: LIBRDF_PKGCONFIG_PRIVATE_LIBS=`echo $LIBRDF_LIBS | sed -e 's, ..top_build_prefix.libltdl/libltdlc.la, ,'` mas01mj@584: mas01mj@584: # Make final changes to cflags mas01mj@584: CFLAGS="-DLIBRDF_INTERNAL=1 $CFLAGS" mas01mj@584: MEM= mas01mj@584: MEM_LIBS= mas01mj@584: AC_ARG_WITH(dmalloc, [ --with-dmalloc Use dmalloc debugging library (default=no)], use_dmalloc="$withval", use_dmalloc="no") mas01mj@584: AC_MSG_CHECKING(using dmalloc library) mas01mj@584: if test "$USE_MAINTAINER_MODE" = yes; then mas01mj@584: if test "$ac_cv_header_dmalloc_h" = yes; then mas01mj@584: if test "X$use_dmalloc" = Xauto; then mas01mj@584: use_dmalloc=yes mas01mj@584: fi mas01mj@584: else mas01mj@584: use_dmalloc=no mas01mj@584: fi mas01mj@584: else mas01mj@584: use_dmalloc=no mas01mj@584: fi mas01mj@584: AC_MSG_RESULT($use_dmalloc) mas01mj@584: if test $use_dmalloc = yes; then mas01mj@584: MEM=-DLIBRDF_MEMORY_DEBUG_DMALLOC=1 mas01mj@584: MEM_LIBS=-ldmalloc mas01mj@584: fi mas01mj@584: AC_ARG_WITH(memory-signing, [ --with-memory-signing Sign allocated memory (default=no)], use_memory_signing="$withval", use_memory_signing="no") mas01mj@584: AC_MSG_CHECKING(using memory signing) mas01mj@584: AC_MSG_RESULT($use_memory_signing) mas01mj@584: if test $use_memory_signing = yes; then mas01mj@584: MEM=-DLIBRDF_MEMORY_SIGN=1 mas01mj@584: MEM_LIBS= mas01mj@584: fi mas01mj@584: mas01mj@584: assert=yes mas01mj@584: AC_ARG_ENABLE(assertions, [ --enable-assertions Perform run time assertion checks (default yes). ], assert=$enableval) mas01mj@584: if test "$assert" = "yes"; then mas01mj@584: AC_DEFINE(LIBRDF_ASSERT, 1, [Run time assertion checks.]) mas01mj@584: fi mas01mj@584: mas01mj@584: assert_messages=yes mas01mj@584: AC_ARG_ENABLE(assert-messages, [ --enable-assert-messages Print run time assertion check failure messages (default yes). ], assert_messages=$enableval) mas01mj@584: if test "$assert_messages" = "yes"; then mas01mj@584: AC_DEFINE(LIBRDF_ASSERT_MESSAGES, 1, [Print run time assertion check failure messages.]) mas01mj@584: fi mas01mj@584: mas01mj@584: debug_messages=no mas01mj@584: if test "$USE_MAINTAINER_MODE" = yes; then mas01mj@584: debug_messages=yes; mas01mj@584: fi mas01mj@584: mas01mj@584: AC_ARG_ENABLE(debug, [ --enable-debug Enable debug messages (default no). ], debug_messages=$enableval) mas01mj@584: if test "$debug_messages" = "yes"; then mas01mj@584: LIBRDF_CPPFLAGS="-g -DLIBRDF_DEBUG=1 $LIBRDF_CPPFLAGS" mas01mj@584: fi mas01mj@584: mas01mj@584: if test "$USE_MAINTAINER_MODE" = yes; then mas01mj@584: CFLAGS="$MAINTAINER_CFLAGS $CFLAGS" mas01mj@584: fi mas01mj@584: mas01mj@584: if test "$USE_MAINTAINER_MODE" = yes -a $release_version = no; then mas01mj@584: dnl need to change quotes to allow square brackets mas01mj@584: changequote(<<, >>)dnl mas01mj@584: CFLAGS=`echo $CFLAGS | sed -e "s/-O[A-Za-z0-9]*//"` mas01mj@584: CXXFLAGS=`echo $CXXFLAGS | sed -e "s/-O[A-Za-z0-9]*//"` mas01mj@584: LIBRDF_CPPFLAGS=`echo $LIBRDF_CPPFLAGS | sed -e "s/-O[A-Za-z0-9]*//"` mas01mj@584: LIBRDF_EXTERNAL_CPPFLAGS=`echo $LIBRDF_EXTERNAL_CPPFLAGS | sed -e "s/-O[A-Za-z0-9]*//"` mas01mj@584: LIBRDF_INTERNAL_CPPFLAGS=`echo $LIBRDF_INTERNAL_CPPFLAGS | sed -e "s/-O[A-Za-z0-9]*//"` mas01mj@584: changequote([, ])dnl mas01mj@584: fi mas01mj@584: mas01mj@584: mas01mj@584: LIBS="$LIBS" mas01mj@584: CPPFLAGS="$CPPFLAGS" mas01mj@584: LDFLAGS="$LDFLAGS" mas01mj@584: mas01mj@584: LIBRDF_LIBTOOLLIBS=librdf.la mas01mj@584: mas01mj@584: AC_SUBST(LIBRDF_EXTERNAL_CPPFLAGS) mas01mj@584: AC_SUBST(LIBRDF_EXTERNAL_LIBS) mas01mj@584: mas01mj@584: AC_SUBST(LIBRDF_INTERNAL_CPPFLAGS) mas01mj@584: AC_SUBST(LIBRDF_INTERNAL_LIBS) mas01mj@584: mas01mj@584: AC_SUBST(LIBRDF_CPPFLAGS) mas01mj@584: AC_SUBST(LIBRDF_LDFLAGS) mas01mj@584: AC_SUBST(LIBRDF_LIBTOOLLIBS) mas01mj@584: AC_SUBST(LIBRDF_PKGCONFIG_PRIVATE_LIBS) mas01mj@584: mas01mj@584: AC_SUBST(MEM) mas01mj@584: AC_SUBST(MEM_LIBS) mas01mj@584: mas01mj@584: abs_top_srcdir=`cd $srcdir; pwd` mas01mj@584: AC_SUBST(abs_top_srcdir) mas01mj@584: abs_top_builddir=`pwd` mas01mj@584: AC_SUBST(abs_top_builddir) mas01mj@584: mas01mj@584: AC_CONFIG_FILES([Makefile src/Makefile]) mas01mj@584: mas01mj@584: dnl Check for gtk-doc and docbook mas01mj@584: GTK_DOC_CHECK([1.3]) mas01mj@584: mas01mj@584: AC_OUTPUT mas01mj@584: mas01mj@584: AC_MSG_RESULT([ mas01mj@584: Redland build summary: mas01mj@584: ]) mas01mj@584: mas01mj@584: if test "$modular" = yes; then mas01mj@584: AC_MSG_RESULT([ Using modular storage backends]) mas01mj@584: else mas01mj@584: AC_MSG_RESULT([ Using monolithic storage backends]) mas01mj@584: fi mas01mj@584: mas01mj@584: AC_MSG_RESULT([ mas01mj@584: Berkeley/Sleepycat DB : $bdb_available mas01mj@584: Triple stores available : $storages_available mas01mj@584: Triple stores enabled :$storages_enabled mas01mj@584: RDF parsers :$rdf_parsers_available mas01mj@584: RDF query : $rdf_query mas01mj@584: Content digests :$digest_modules_available mas01mj@584: ])