summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-09-10 06:11:10 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-09-10 06:11:10 +0000
commit9ba35d28aeff1c2d7995a9a86f765ebbe06db016 (patch)
tree8e00eaa0acaaef50e9b3e91a430fc5deaf3250da
parent1978153edaa1e6b5884d3e8c9039dd0fbec969e4 (diff)
downloadbibletime-9ba35d28aeff1c2d7995a9a86f765ebbe06db016.tar.gz
bibletime-9ba35d28aeff1c2d7995a9a86f765ebbe06db016.zip
Auto-detect Sword module version
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/bibletime@1173694 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
-rw-r--r--bibletime/backend/cswordbiblemoduleinfo.cpp4
-rw-r--r--bibletime/backend/cswordversekey.cpp4
-rw-r--r--configure.in.in21
3 files changed, 20 insertions, 9 deletions
diff --git a/bibletime/backend/cswordbiblemoduleinfo.cpp b/bibletime/backend/cswordbiblemoduleinfo.cpp
index f05cf20..352aad0 100644
--- a/bibletime/backend/cswordbiblemoduleinfo.cpp
+++ b/bibletime/backend/cswordbiblemoduleinfo.cpp
@@ -26,10 +26,6 @@
// TODO: Detect Boost in autoconf
#include <boost/scoped_ptr.hpp>
-// Needed for new Sword libraries
-// TODO: Move this into autoconf
-#define SWORD_MULTIVERSE
-
static sword::VerseKey staticKey;
CSwordBibleModuleInfo::CSwordBibleModuleInfo( sword::SWModule* module, CSwordBackend* const usedBackend )
diff --git a/bibletime/backend/cswordversekey.cpp b/bibletime/backend/cswordversekey.cpp
index 550377b..3687241 100644
--- a/bibletime/backend/cswordversekey.cpp
+++ b/bibletime/backend/cswordversekey.cpp
@@ -25,10 +25,6 @@
// TODO: Detect Boost in autoconf
#include <boost/scoped_ptr.hpp>
-// Needed for new Sword libraries
-// TODO: Move this into autoconf
-#define SWORD_MULTIVERSE
-
CSwordVerseKey::CSwordVerseKey( CSwordModuleInfo* const module ) : CSwordKey(module) {
if ( CSwordBibleModuleInfo* bible = dynamic_cast<CSwordBibleModuleInfo*>(module) ) {
key( bible->lowerBound().key() );
diff --git a/configure.in.in b/configure.in.in
index ea108e4..35a0e94 100644
--- a/configure.in.in
+++ b/configure.in.in
@@ -56,9 +56,28 @@ if test "x$enable_howto" = xyes; then
fi
AC_SUBST(HOWTODIR)
-dnl Chek for the used distribution
+dnl Check for the used distribution
AC_CHECK_DISTRIBUTION
+dnl Check bibletime API version
+AC_LANG_SAVE
+AC_LANG_CPLUSPLUS
+cxx_flags_safe="$CXXFLAGS"
+cflags_safe="$CFLAGS"
+CXXFLAGS="$CXXFLAGS -I$ac_cv_sword_incdir"
+CFLAGS="$CFLAGS -I$ac_cv_sword_incdir"
+AC_MSG_CHECKING([if Sword provides the old API])
+AC_TRY_COMPILE([#include <versekey.h>
+static sword::VerseKey staticKey;
+sword::sbook current_book;
+],[current_book = staticKey.books[1][1];],
+AC_MSG_RESULT(yes),
+[AC_MSG_RESULT(no)
+AC_DEFINE(SWORD_MULTIVERSE,1,[no])])
+CXXFLAGS="$cxx_flags_safe"
+CFLAGS="$cflags_safe"
+AC_LANG_RESTORE
+
dnl add here all your Makefiles. They are created by configure
AC_CONFIG_FILES([ README ])