summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac132
1 files changed, 116 insertions, 16 deletions
diff --git a/configure.ac b/configure.ac
index 563880c..651ab8d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,13 +1,14 @@
# ---------------------------------------------------------------------
# Initialisation
# ---------------------------------------------------------------------
-AC_INIT(sword, 1.5.3, sword-bugs@crosswire.org)
+
+AC_INIT(sword, 1.5.7, sword-bugs@crosswire.org)
AC_CONFIG_SRCDIR(sword.bmp)
AC_PREREQ(2.52)
-AC_REVISION($Revision: 1.9 $)
+AC_REVISION($Revision: 1.31 $)
AC_CANONICAL_TARGET
-AM_INIT_AUTOMAKE(sword,1.5.3)
+AM_INIT_AUTOMAKE(sword, 1.5.7)
AM_CONFIG_HEADER(config.h)
@@ -25,28 +26,79 @@ AC_PROG_LIBTOOL
AC_C_BIGENDIAN
# ---------------------------------------------------------------------
-# Check libraries
-# ---------------------------------------------------------------------
-AC_CHECK_LIB(z, compress)
-AC_CHECK_LIB(stdc++, cerr)
-
-# ---------------------------------------------------------------------
# With options
# ---------------------------------------------------------------------
AC_ARG_WITH(zlib,[ --with-zlib allow zlib compressed modules [default=yes]],,with_zlib=yes)
AC_ARG_WITH(icu,[ --with-icu use ICU for unicode [default=no]],,with_icu=no)
AC_ARG_WITH(conf,[ --with-conf install a new sword.conf [default=yes]],,with_conf=yes)
+AC_ARG_WITH(curl,[ --with-curl build install manager support using libcurl [default=yes]],,with_curl=yes)
+AC_ARG_WITH(lucene,[ --with-lucene include lucene support for searching [default=yes]],,with_lucene=yes)
# ---------------------------------------------------------------------
# Enable options
# ---------------------------------------------------------------------
-AC_ARG_ENABLE(vcl,[ --enable-vcl build VCL library [default=no]],,enable_vcl=no)
AC_ARG_ENABLE(debug,[ --enable-debug build debug library [default=no]],,enable_debug=no)
AC_ARG_ENABLE(profile,[ --enable-profile allow profiling [default=no]],,enable_profile=no)
AC_ARG_ENABLE(profilefn,[ --enable-profilefn allow functioncheck profiling [default=no]],,enable_profilefn=no)
+AC_ARG_ENABLE(tests,[ --enable-tests build test programs [default=no]],,enable_tests=no)
+AC_ARG_ENABLE(utilities,[ --enable-utilities build utilities [default=yes]],,enable_utilities=yes)
+AC_ARG_ENABLE(examples,[ --enable-examples build examples [default=no]],,enable_examples=no)
AM_MAINTAINER_MODE
+# ---------------------------------------------------------------------
+# Check libraries
+# ---------------------------------------------------------------------
+if test x$with_zlib = xyes; then
+ AC_CHECK_LIB(z, compress)
+fi
+
+# ---------------------------------------------------------------------
+# Find pkg-config
+# ---------------------------------------------------------------------
+use_pkgconfig=yes
+AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
+if test x$PKG_CONFIG = xno ; then
+ AC_MSG_WARN([*** pkg-config not found. See http://www.freedesktop.org/software/pkgconfig/])
+ AC_MSG_WARN([not using pkg-config])
+ use_pkgconfig=no
+fi
+
+if $PKG_CONFIG --atleast-pkgconfig-version 0.14 ; then
+ :
+else
+ AC_MSG_WARN([*** pkg-config too old; version 0.14 or better required.])
+ AC_MSG_WARN([not using pkg-config])
+ use_pkgconfig=no
+fi
+
+
+# ---------------------------------------------------------------------
+# Find ICU tools
+# ---------------------------------------------------------------------
+ICU_VER=
+ICU_LIBS=
+ICU_IOLIBS=
+if test x$with_icu = xyes; then
+ AC_PATH_PROG([PKGDATA], [pkgdata],[/usr/sbin/pkgdata],[$PATH:/usr/sbin:.])
+ AC_PATH_PROG([GENCCODE], [genccode], [/usr/sbin/genccode], [$PATH:/usr/sbin:.])
+ AC_PATH_PROG([GENCMN], [gencmn], [/usr/sbin/gencmn], [$PATH:/usr/sbin:.])
+ AC_PATH_PROG([GENRB], [genrb], [/usr/sbin/genrb], [$PATH:/usr/sbin:.])
+
+ AC_PATH_PROG(ICU_CONFIG, icu-config, no)
+# The icu-config script was new in icu 2.2
+ if test "$ICU_CONFIG" = "no" ; then
+ echo "*** The icu-config script installed by icu could not be found"
+ echo "*** continuing anyway and assuming 2.1 or earlier"
+ ICU_VER="2.1"
+ ICU_LIBS="-licui18n -licuuc -licudata"
+ ICU_IOLIBS="-lustdio"
+ else
+ ICU_VER=`$ICU_CONFIG --version`
+ ICU_LIBS=`$ICU_CONFIG --ldflags`
+ ICU_IOLIBS=`$ICU_CONFIG --ldflags-ustdio`
+ fi
+fi
# ---------------------------------------------------------------------
# Debug and profile
@@ -56,12 +108,12 @@ CXXFLAGS="$CXXFLAGS -ftemplate-depth-25"
if test x$enable_debug = xyes; then
if test x$ac_cv_prog_cc_g = xyes; then
- CFLAGS="-g -O0"
+ CFLAGS="-g3 -O0"
else
CFLAGS="-O0"
fi
if test x$ac_cv_prog_cxx_g = xyes; then
- CXXFLAGS="-g -O0"
+ CXXFLAGS="-g3 -O0"
else
CXXFLAGS="-O0"
fi
@@ -84,6 +136,41 @@ if test x$enable_profilefn = xyes; then
fi
# ---------------------------------------------------------------------
+# Check for curl for installmgr suport
+# ---------------------------------------------------------------------
+
+CURL_CFLAGS=
+CURL_LIBS=
+if test x$with_curl = xyes; then
+ AC_PATH_PROG(CURL_CONFIG, curl-config, no)
+ if test "$CURL_CONFIG" = "no" ; then
+ echo "*** The curl-config script installed by curl could not be found"
+ echo "*** compiling without libcurl support"
+ with_curl=no
+ else
+ echo "curl found - remote install options available"
+ CURL_CFLAGS=`$CURL_CONFIG --cflags`
+ CURL_LIBS=`$CURL_CONFIG --libs`
+ CXXFLAGS="$CXXFLAGS -DCURLAVAILABLE"
+ CFLAGS="$CFLAGS -DCURLAVAILABLE"
+ fi
+fi
+
+# ---------------------------------------------------------------------
+# Check for clucene for lucene searching support
+# ---------------------------------------------------------------------
+
+#FIXME: always make lucene available without checking for lib and headers
+if test x$with_lucene = xyes; then
+ echo "lucene found - lucene searching options available"
+ LUCENE_CFLAGS=""
+ LUCENE_LIBS="-lclucene"
+ CXXFLAGS="$CXXFLAGS -DUSELUCENE"
+ CFLAGS="$CFLAGS -DUSELUCENE"
+ LIBS="$LIBS $LUCENE_LIBS"
+fi
+
+# ---------------------------------------------------------------------
# Alter global conf directory only if not /etc
# ---------------------------------------------------------------------
@@ -142,7 +229,12 @@ AC_SUBST(with_icu)
AC_SUBST(with_conf)
AC_SUBST(dir_confdef)
AC_SUBST(CC)
-AC_SUBST(enable_vcl)
+AC_SUBST(CURL_CFLAGS)
+AC_SUBST(CURL_LIBS)
+AC_SUBST(LUCENE_LIBS)
+AC_SUBST(ICU_LIBS)
+AC_SUBST(ICU_IOLIBS)
+AC_SUBST(ICU_VER)
AC_SUBST(enable_debug)
AC_SUBST(enable_profile)
@@ -160,17 +252,25 @@ AC_SUBST(target_mingw32)
# ---------------------------------------------------------------------
AM_CONDITIONAL(MINGW, test x$target_mingw32 = xyes)
AM_CONDITIONAL(ICU, test x$with_icu = xyes)
+AM_CONDITIONAL(USELUCENE, test x$with_lucene = xyes)
+AM_CONDITIONAL(ICUSWORD, test x$with_icu = xsword)
AM_CONDITIONAL(ZLIB, test x$with_zlib = xyes)
AM_CONDITIONAL(INSTCONF, test x$with_conf = xyes)
+AM_CONDITIONAL(INSTALLMGR, test x$with_curl = xyes)
+AM_CONDITIONAL(USELUCENE, test x$with_lucene = xyes)
AM_CONDITIONAL(CONFDEF, test x$dir_confdef = xyes)
+AM_CONDITIONAL(USE_PKGCONF, test x$use_pkgconfig = xyes)
#AM_CONDITIONAL(DEBUG, test x$with_debug = xyes)
#AM_CONDITIONAL(PROFILE, test x$with_profile = xyes)
-
+AM_CONDITIONAL(BUILDTESTS, test x$enable_tests = xyes)
+AM_CONDITIONAL(BUILDUTILS, test x$enable_utilities = xyes)
+AM_CONDITIONAL(BUILDEXAMPLES, test x$enable_examples = xyes)
# ---------------------------------------------------------------------
# Final output
# ---------------------------------------------------------------------
AC_CONFIG_FILES(Makefile lib/Makefile tests/Makefile utilities/Makefile examples/Makefile \
- examples/cmdline/Makefile apps/Makefile apps/console/Makefile \
- apps/console/diatheke/Makefile)
+ examples/cmdline/Makefile \
+ utilities/diatheke/Makefile icu/Makefile sword.pc)
AC_OUTPUT
+