--- VERSION 7.30 ---
[citadel.git] / webcit / configure.ac
index f0f968738e79d9120e140a32288d5ab5748d23b8..cd036cf3766a91458838bd6cd3c9155aab4ab3f6 100644 (file)
@@ -1,14 +1,6 @@
 dnl Process this file with autoconf to produce a configure script.
 dnl $Id$
-AC_INIT(webserver.c)
-
-
-PACKAGE=webcit
-VERSION=7.13
-AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [our package name])
-AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [our package version])
-AC_SUBST(PACKAGE)
-AC_SUBST(VERSION)
+AC_INIT([WebCit], [7.30], [http://www.citadel.org/])
 
 AC_SUBST(PROG_SUBDIRS)
 AC_DEFINE(PROG_SUBDIRS, [], [Program dirs])
@@ -108,6 +100,25 @@ AC_TYPE_SIGNAL
 dnl AC_FUNC_VPRINTF
 AC_REPLACE_FUNCS(snprintf)
 
+
+dnl Check for libcitadel
+AC_CHECK_HEADER(libcitadel.h,
+       [AC_CHECK_LIB(citadel, libcitadel_version_string,
+               [
+                       LIBS="-lcitadel $LIBS"
+               ],
+               [
+                       AC_MSG_ERROR(libcitadel was not found or is not usable.  Please install libcitadel.)
+               ]
+       ,
+       )],
+       [
+               AC_MSG_ERROR(libcitadel.h was not found or is not usable.  Please install libcitadel.)
+       ]
+)
+
+
+webcit_with_calendar_service=no
 dnl Checks for the libical calendaring library.
 if test "x$with_libical" != xno ; then
         AC_CHECK_HEADERS(ical.h,
@@ -126,11 +137,11 @@ main() {
         sscanf(ICAL_VERSION, "%d.%d", &major, &minor);
         v = 100*major + minor;
         printf("libical version: %i\n", v);
-        if (v >= 24) {
+        if (v >= 30) {
                 printf("This version is ok.\n");
                return(0);
        }
-       printf("libical 0.24 or newer required.\n");
+       printf("libical 0.30 or newer required.\n");
        printf("Citadel will be built without calendar support.\n");
        return(1);
 }
@@ -138,11 +149,16 @@ main() {
                [
                        LIBS="-lical $LIBS"
                        AC_DEFINE(HAVE_LIBICAL,[],[whether we have libical available])
+                       webcit_with_calendar_service=yes
                ]
        )
 fi
+ok_libical=$webcit_with_calendar_service
 
 
+if test "$webcit_with_calendar_service" == "yes"; then
+                       AC_DEFINE(WEBCIT_WITH_CALENDAR_SERVICE,[],[whether we can do with calendar.])
+fi
 
 dnl Checks for the zlib compression library.
 if test "x$with_zlib" != xno ; then
@@ -303,6 +319,27 @@ if test "$ok_nls" != "no"; then
        )
 fi
 
+if test "$ok_iconv" = "no"; then
+       LD_FLAGS_BEFORE=$LDFLAGS
+       LDFLAGS="$LDFLAGS -liconv"
+               AC_TRY_RUN([
+                       #include <iconv.h>
+                       main() {
+                              iconv_t ic = (iconv_t)(-1) ;
+                              ic = iconv_open("UTF-8", "us-ascii");
+                              iconv_close(ic);
+                              exit(0);
+                       }
+                       ],
+                       ok_iconv=yes,
+                       ok_iconv=no
+               )
+               if test "$ok_iconv" != "no"; then
+                  LDFLAGS=$LD_FLAGS_BEFORE 
+                  LIBS="$LIBS -liconv"
+               fi
+fi
+
 if test "$ok_iconv" != "no"; then
        AC_MSG_RESULT(WebCit will be built with character set conversion.)
        AC_DEFINE(HAVE_ICONV,[],[whether we have iconv for charset conversion])