Third try. :(
authorArt Cancro <ajc@citadel.org>
Tue, 29 Jan 2008 05:04:05 +0000 (05:04 +0000)
committerArt Cancro <ajc@citadel.org>
Tue, 29 Jan 2008 05:04:05 +0000 (05:04 +0000)
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
citadel/configure.ac
webcit/configure.ac
webcit/webcit.h

index f646fae3c2e652e2f0358a5880f8fffe95db65b2..ed2db509f664d530fe0e13b1df6acc1b37dc8d12 100644 (file)
@@ -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 */
index a0b0d08b9e0484ae98383c5b7524c8f0d4eb96be..31c333bb5c43d89f8b24b98b156d3d37de0eda91 100644 (file)
@@ -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 <unistd.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <libcitadel.h>
-#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
index 39626b38b8855ef77aed46341608c132d3e874e5..537917bd3f0b27fa2eb0e8948c8357395d6dc434 100644 (file)
@@ -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
index a324f6c98b3fae240c23cb47dd2227e38a7d0165..7e9ebce19ca4b64002bfd5a058026cd6115b5440 100644 (file)
@@ -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)
  *