From fa9e0c74acf34bd8b9792e9fb953109ccfc35512 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Tue, 29 Jan 2008 05:04:05 +0000 Subject: [PATCH] Third try. :( The test for libcitadel version in the configure script had too many places where it could either break or send the build into an infinite loop of reconfiguration. Moved the test into the citadel.h and webcit.h header files, where they throw an error if the version is too old. --- citadel/citadel.h | 6 ++++++ citadel/configure.ac | 23 ----------------------- webcit/configure.ac | 18 ------------------ webcit/webcit.h | 7 +++++++ 4 files changed, 13 insertions(+), 41 deletions(-) diff --git a/citadel/citadel.h b/citadel/citadel.h index f646fae3c..ed2db509f 100644 --- a/citadel/citadel.h +++ b/citadel/citadel.h @@ -55,6 +55,12 @@ extern "C" { #define SERVER_TYPE 0 /* zero for stock Citadel; other developers please obtain SERVER_TYPE codes for your implementations */ +#ifdef LIBCITADEL_VERSION_NUMBER +#if LIBCITADEL_VERSION_NUMBER < LIBCITADEL_MIN +#error libcitadel is too old. Please upgrade it before continuing. +#endif +#endif + /* Various length constants */ #define UGLISTLEN 100 /* you get a ungoto list of this size */ diff --git a/citadel/configure.ac b/citadel/configure.ac index a0b0d08b9..31c333bb5 100644 --- a/citadel/configure.ac +++ b/citadel/configure.ac @@ -889,29 +889,6 @@ AC_CONFIG_FILES([Makefile]) AC_OUTPUT(database_cleanup.sh) -dnl Check to see if libcitadel is new enough -dnl The test is way down here because it needs sysdep.h to be generated first -AC_MSG_CHECKING(libcitadel version) -AC_TRY_RUN( - [ -#include -#include -#include -#include -#include "citadel.h" -main() { - if (LIBCITADEL_VERSION_NUMBER >= LIBCITADEL_MIN) { - return(0); - } - return(1); -} - ], - AC_MSG_RESULT(ok), - AC_MSG_ERROR(libcitadel is too old. Please upgrade it first.) -) - - - if test -z "$DATABASE"; then AC_MSG_WARN([No database driver was found. Please install Berkeley DB.]) fi diff --git a/webcit/configure.ac b/webcit/configure.ac index 39626b38b..537917bd3 100644 --- a/webcit/configure.ac +++ b/webcit/configure.ac @@ -118,24 +118,6 @@ AC_CHECK_HEADER(libcitadel.h, ) -dnl Check to see if libcitadel is new enough -AC_MSG_CHECKING(checking libcitadel version) -AC_TRY_RUN( - [ -#include "webcit.h" -main() { - if (LIBCITADEL_VERSION_NUMBER >= LIBCITADEL_MIN) { - return(0); - } - return(1); -} - ], - AC_MSG_RESULT(ok), - AC_MSG_ERROR(libcitadel is too old. Please upgrade it first.) -) - - - webcit_with_calendar_service=no dnl Checks for the libical calendaring library. if test "x$with_libical" != xno ; then diff --git a/webcit/webcit.h b/webcit/webcit.h index a324f6c98..7e9ebce19 100644 --- a/webcit/webcit.h +++ b/webcit/webcit.h @@ -140,6 +140,13 @@ extern locale_t wc_locales[]; #define DEFAULT_MAXMSGS 20 +#ifdef LIBCITADEL_VERSION_NUMBER +#if LIBCITADEL_VERSION_NUMBER < LIBCITADEL_MIN +#error libcitadel is too old. Please upgrade it before continuing. +#endif +#endif + + /* * Room flags (from Citadel) * -- 2.39.2