summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac131
1 files changed, 94 insertions, 37 deletions
diff --git a/configure.ac b/configure.ac
index 44628cf..bb687cb 100644
--- a/configure.ac
+++ b/configure.ac
@@ -5,7 +5,7 @@
# Version change: Change line 8 only !
# Change it immediately after a release
-AC_INIT(sword, 1.6.2, sword-bugs@crosswire.org, sword, http://crosswire.org/sword)
+AC_INIT(sword, 1.7.2, sword-bugs@crosswire.org, sword, http://crosswire.org/sword)
AC_CONFIG_SRCDIR(sword.bmp)
AC_PREREQ(2.52)
AC_REVISION($Revision: 1.45 $)
@@ -37,11 +37,12 @@ AC_PROG_INSTALL
AC_LIBTOOL_WIN32_DLL
AC_PROG_LIBTOOL
-COLORED_ECHO_INIT
-
AC_C_BIGENDIAN
+PKG_CHECK_MODULES([CLUCENE2], [libclucene-core >= 2.3],,true)
+if test "x$CLUCENE2_LIBS" = x; then
ACX_CLUCENE
+fi
# ---------------------------------------------------------------------
# With options
@@ -54,12 +55,16 @@ AC_ARG_WITH(icusword,
AC_HELP_STRING([--with-icusword],[use custom SWORD ICU (default=no)]),,with_icusword=no)
AC_ARG_WITH(conf,
AC_HELP_STRING([--with-conf],[install a new sword.conf (default=yes)]),,with_conf=yes)
+AC_ARG_WITH(cxx11regex,
+ AC_HELP_STRING([--with-cxx11regex],[build regex support using c++11 regex (default=no)]),,with_cxx11regex=no)
AC_ARG_WITH(curl,
AC_HELP_STRING([--with-curl],[build install manager support using libcurl (default=yes)]),,with_curl=yes)
+AC_ARG_WITH(curl_sftp,
+ AC_HELP_STRING([--with-curl_sftp],[build install manager support using libcurl+sftp (requires --with-curl, default=yes)]),,with_curl_sftp=yes)
#AC_ARG_WITH(lucene,
# AC_HELP_STRING([--with-lucene],[include lucene support for searching (default=no)]),,with_lucene=no)
AC_ARG_WITH([internalregex],
- AS_HELP_STRING([--with-internalregex], [Compile using SWORD's internal copy of regex]))
+ AS_HELP_STRING([--with-internalregex], [Compile using SWORDs internal copy of regex]))
# ---------------------------------------------------------------------
@@ -94,15 +99,18 @@ if test x$enable_debug = xyes; then
AM_CFLAGS="-O0 -Wall -Werror"
fi
if test x$ac_cv_prog_cxx_g = xyes; then
- AM_CXXFLAGS="-g3 -O0 -Wall -Werror"
+ AM_CXXFLAGS="-g3 -O0 -Wall -Werror -Woverloaded-virtual"
else
- AM_CXXFLAGS="-O0 -Wall -Werror"
+ AM_CXXFLAGS="-O0 -Wall -Werror -Woverloaded-virtual"
fi
else
AM_CFLAGS="-O3"
AM_CXXFLAGS="-O3"
fi
+AM_CFLAGS="$AM_CFLAGS -fPIC"
+AM_CXXFLAGS="$AM_CXXFLAGS -fPIC"
+
# ---------------------------------------------------------------------
# Check libraries
# ---------------------------------------------------------------------
@@ -168,11 +176,6 @@ ICU_VER=
ICU_LIBS=
ICU_IOLIBS=
if test x$with_icu = xyes; then
- AC_PATH_PROG([PKGDATA], [pkgdata],[/usr/bin/pkgdata],[$PATH:/usr/sbin:.])
- AC_PATH_PROG([GENCCODE], [genccode], [/usr/bin/genccode], [$PATH:/usr/sbin:.])
- AC_PATH_PROG([GENCMN], [gencmn], [/usr/bin/gencmn], [$PATH:/usr/sbin:.])
- AC_PATH_PROG([GENRB], [genrb], [/usr/bin/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
@@ -209,7 +212,7 @@ AM_CXXFLAGS="$AM_CXXFLAGS -ftemplate-depth-25"
if test x$enable_warnings = xyes; then
AM_CFLAGS="$AM_CFLAGS -Werror"
- AM_CXXFLAGS="$AM_CXXFLAGS -Werror"
+ AM_CXXFLAGS="$AM_CXXFLAGS -Werror -Woverloaded-virtual"
fi
if test x$enable_profile = xyes; then
@@ -233,6 +236,7 @@ if test x$with_curl = xyes; then
echo "*** The curl-config script installed by curl could not be found"
echo "*** compiling without libcurl support"
with_curl=no
+ with_curl_sftp=no
with_internalftplib=yes
else
echo "curl found - remote install options available"
@@ -241,25 +245,48 @@ if test x$with_curl = xyes; then
AM_CXXFLAGS="$AM_CXXFLAGS -DCURLAVAILABLE $CURL_AM_CFLAGS"
AM_CFLAGS="$AM_CFLAGS -DCURLAVAILABLE $CURL_AM_CFLAGS"
LIBS="$LIBS $CURL_LIBS"
+ if test x$with_curl_sftp = xyes; then
+ if test x`$CURL_CONFIG --protocols|grep SFTP|wc -l` = x1; then
+ AM_CXXFLAGS="$AM_CXXFLAGS -DCURLSFTPAVAILABLE"
+ AM_CFLAGS="$AM_CFLAGS -DCURLSFTPAVAILABLE"
+ else
+ with_curl_sftp=no;
+ fi
+ fi
fi
else
with_curl=no;
+ with_curl_sftp=no;
with_internalftplib=yes
fi
+if test x$with_cxx11regex = xyes; then
+ AM_CXXFLAGS="$AM_CXXFLAGS -DUSECXX11REGEX -std=c++11 -ftemplate-depth=100"
+fi
+
# ---------------------------------------------------------------------
# Check for clucene for lucene searching support
# ---------------------------------------------------------------------
+# NOTE the $libdir hack at the end of the c[xx]flags. Apparently F16 finds that clucene is not multilib-save and places some include files in /usr/lib[64]/
with_clucene=no
-if test -z "$CLUCENE_LIBS"; then
- echo "lucene searching options not available"
+if test "x$CLUCENE2_LIBS" != x; then
+ echo "clucene 2.x found - lucene searching options available"
+ AM_CXXFLAGS="$AM_CXXFLAGS $CLUCENE2_CFLAGS -DUSELUCENE -DCLUCENE2 -I$libdir"
+ AM_CFLAGS="$AM_CFLAGS $CLUCENE2_CFLAGS -DUSELUCENE -DCLUCENE2 -I$libdir"
+ LIBS="$LIBS $CLUCENE2_LIBS"
+ with_clucene="yes 2.x"
+ CLUCENE_LIBS="$CLUCENE_LIBS $CLUCENE2_LIBS"
else
- echo "lucene found - lucene searching options available"
- AM_CXXFLAGS="$AM_CXXFLAGS $CLUCENE_CXXFLAGS -DUSELUCENE"
- AM_CFLAGS="$AM_CFLAGS -DUSELUCENE"
+if test "x$CLUCENE_LIBS" != x; then
+ echo "lucene 0.x found - lucene searching options available"
+ AM_CXXFLAGS="$AM_CXXFLAGS $CLUCENE_CXXFLAGS -DUSELUCENE -I$libdir"
+ AM_CFLAGS="$AM_CFLAGS -DUSELUCENE -I$libdir"
LIBS="$LIBS $CLUCENE_LIBS"
- with_clucene="yes"
+ with_clucene="yes 0.x"
+else
+ echo "lucene searching options not available"
+fi
fi
AC_CHECK_FUNCS(vsnprintf, [have_vsnprintf="yes"])
@@ -274,6 +301,33 @@ else
dir_confdef="yes"
fi
+changequote(<<,>>)
+V1=`expr $VERSION : '\([0-9]*\)\.[0-9]*\.*[0-9]*\.*[0-9]*'`
+V2=`expr $VERSION : '[0-9]*\.\([0-9]*\)\.*[0-9]*\.*[0-9]*'`
+V3=`expr $VERSION : '[0-9]*\.[0-9]*\.*\([0-9]*\)\.*[0-9]*'`
+V4=`expr $VERSION : '[0-9]*\.[0-9]*\.*[0-9]*\.*\([0-9]*\)'`
+changequote([,])
+
+SWORD_VERSION_STR=$VERSION
+SWORD_VERSION_MAJOR=$V1
+SWORD_VERSION_MINOR=$V2
+SWORD_VERSION_MICRO=$V3
+if test "$V4" = "" ; then V4=0; fi
+SWORD_VERSION_NANO=$V4
+
+if test "$V2" -le 9 ; then V2=0$V2 ; fi
+if test "$V3" -le 9 ; then V3=00$V3 ; elif test "$V3" -le 99 ; then V3=0$V3 ; fi
+if test "$V4" -le 9 ; then V4=00$V4 ; elif test "$V4" -le 99 ; then V4=0$V4 ; fi
+SWORD_VERSION_NUM=$V1$V2$V3$V4
+
+AC_SUBST(SWORD_VERSION_NUM)
+AC_SUBST(SWORD_VERSION_STR)
+AC_SUBST(SWORD_VERSION_MAJOR)
+AC_SUBST(SWORD_VERSION_MINOR)
+AC_SUBST(SWORD_VERSION_MICRO)
+AC_SUBST(SWORD_VERSION_NANO)
+
+
# ---------------------------------------------------------------------
# Substitute variables into makefiles
@@ -288,9 +342,8 @@ AC_SUBST(ICU_VER)
AC_SUBST(enable_debug)
AC_SUBST(enable_profile)
-# TODO: WHY ARE WE SUBST CXXFLAGS BUT NOT CFLAGS? And why, when I uncomment out the cflags subst do we get compile errors?
AC_SUBST(AM_CXXFLAGS)
-#AC_SUBST(AM_CFLAGS)
+AC_SUBST(AM_CFLAGS)
AC_SUBST(target_cpu)
AC_SUBST(target_vendor)
@@ -300,25 +353,26 @@ AC_SUBST(target_system)
AC_SUBST(target_mingw32)
AC_SUBST(CURL_LIBS)
-AC_SUBST(CLUCENE_LIBS)
AC_SUBST(ICU_LIBS)
AC_SUBST(ICU_IOLIBS)
+AC_SUBST(CLUCENE_LIBS)
# ---------------------------------------------------------------------
# Conditional variables
# ---------------------------------------------------------------------
-# don't #ifdef in .cpp files HAVE_ stuff because non-ac compiles won't be able to switch them since we include config.h
AM_CONDITIONAL(HAVE_LIBZ, test x$with_zlib = xyes)
AM_CONDITIONAL(HAVE_ICU, test x$with_icu = xyes)
AM_CONDITIONAL(HAVE_ICUSWORD, test x$with_icusword = xyes)
AM_CONDITIONAL(HAVE_VSNPRINTF, test x$have_vsnprintf = xyes)
-AM_CONDITIONAL(USELUCENE, test x$with_clucene = xyes)
+AM_CONDITIONAL(USELUCENE, test "x$with_clucene" != xno)
AM_CONDITIONAL(SHAREDLIB, test x$enable_shared = xyes)
AM_CONDITIONAL(INSTCONF, test x$with_conf = xyes)
+AM_CONDITIONAL(USECXX11REGEX, test x$with_cxx11regex = xyes)
AM_CONDITIONAL(WITHCURL, test x$with_curl = xyes)
+AM_CONDITIONAL(WITHCURLSFTP, test x$with_curl_sftp = xyes)
AM_CONDITIONAL(INTERNALFTPLIB, test x$with_internalftplib = xyes)
AM_CONDITIONAL(USE_INTERNAL_REGEX, test x$with_internalregex = xyes)
AM_CONDITIONAL(CONFDEF, test x$dir_confdef = xyes)
@@ -330,24 +384,27 @@ AM_CONDITIONAL(BUILDEXAMPLES, test x$enable_examples = xyes)
# ---------------------------------------------------------------------
# Final output
# ---------------------------------------------------------------------
-AC_CONFIG_FILES(Makefile lib/Makefile tests/Makefile tests/cppunit/Makefile utilities/Makefile examples/Makefile examples/cmdline/Makefile utilities/diatheke/Makefile icu/Makefile sword.pc sword.spec)
+AC_CONFIG_FILES(Makefile lib/Makefile tests/Makefile tests/cppunit/Makefile utilities/Makefile examples/Makefile examples/cmdline/Makefile utilities/diatheke/Makefile sword.pc include/swversion.h sword.spec)
AC_OUTPUT
echo
echo
-COLORED_ECHO([Configuration:])
-COLORED_ECHO([ DEBUG: $enable_debug])
-COLORED_ECHO([ PROFILE: $enable_profile])
-COLORED_ECHO([ BUILD TESTS: $enable_tests])
-COLORED_ECHO([ BUILD EXAMPLES: $enable_examples])
-COLORED_ECHO([ BUILD UTILITIES: $enable_utilities])
-COLORED_ECHO([ LIBZ: $with_zlib])
-COLORED_ECHO([ ICU: $with_icu])
-COLORED_ECHO([ ICUSWORD: $with_icusword])
-COLORED_ECHO([ CURL: $with_curl])
-COLORED_ECHO([ INTERNAL FTPLIB: $with_internalftplib])
-COLORED_ECHO([ INTERNAL REGEX: $with_internalregex])
-COLORED_ECHO([ CLUCENE: $with_clucene])
+echo "Configuration:"
+echo " LIBDIR: $libdir"
+echo " DEBUG: $enable_debug"
+echo " PROFILE: $enable_profile"
+echo " BUILD TESTS: $enable_tests"
+echo " BUILD EXAMPLES: $enable_examples"
+echo " BUILD UTILITIES: $enable_utilities"
+echo " LIBZ: $with_zlib"
+echo " ICU: $with_icu"
+echo " ICUSWORD: $with_icusword"
+echo " CXX11REGEX: $with_cxx11regex"
+echo " CURL: $with_curl"
+echo " CURL SFTP: $with_curl_sftp"
+echo " INTERNAL FTPLIB: $with_internalftplib"
+echo " INTERNAL REGEX: $with_internalregex"
+echo " CLUCENE: $with_clucene"
echo
echo