Have configure check for sed, so that recursion will work.
[citadel.git] / webcit / configure.in
index 42955013bb8bca8e7d537c7d7e1e5f1b1b2511e4..2bc04a94ae7154d6d3ab07c46f300991e73e3210 100644 (file)
@@ -2,12 +2,22 @@ dnl Process this file with autoconf to produce a configure script.
 dnl $Id$
 AC_INIT(webserver.c)
 
+
+PACKAGE=webcit
+VERSION=6.21
+AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
+AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
+AC_SUBST(PACKAGE)
+AC_SUBST(VERSION)
+
 AC_CANONICAL_HOST
 AC_PROG_INSTALL
+AC_CHECK_PROG(SED, sed, sed, no)
 AC_PREFIX_DEFAULT(/usr/local/webcit)
 
-AC_ARG_WITH(with_libical, [  --with-libical          use libical calendaring library])
-AC_ARG_WITH(with_newt, [  --with-newt          use newt window library])
+AC_ARG_WITH(with_libical, [  --with-libical      use libical calendaring library])
+AC_ARG_WITH(with_zlib,    [  --with-zlib         use zlib compression if present])
+AC_ARG_WITH(with_newt,    [  --with-newt         use newt window library])
 AC_ARG_WITH(ssl,
        [  --with-ssl=PATH     Specify path to OpenSSL installation ],
        [
@@ -69,6 +79,9 @@ AC_HEADER_STDC
 dnl AC_HEADER_SYS_WAIT
 AC_CHECK_HEADERS(fcntl.h limits.h sys/time.h unistd.h)
 
+
+
+
 dnl Checks for typedefs, structures, and compiler characteristics.
 AC_C_CONST
 AC_TYPE_OFF_T
@@ -95,19 +108,16 @@ if test "x$ok_libical" = xyes ; then
                [
 #include <ical.h>
 main() {
-       float v;
-       int i;
-       sscanf(ICAL_VERSION, "%f", &v);
-       printf("libical version: %0.2f\n", v);
-       v = v * 100.0;
-       i = (int) v;
-       if (i >= 24) {
-               printf("This version is ok.\n");
-               printf("WebCit will be built with calendar support.\n");
+        int major, minor, v;
+        sscanf(ICAL_VERSION, "%d.%d", &major, &minor);
+        v = 100*major + minor;
+        printf("libical version: %i\n", v);
+        if (v >= 24) {
+                printf("This version is ok.\n");
                return(0);
        }
-       printf("libical 0.24 or newer is required.\n");
-       printf("WebCit will be built without calendar support.\n");
+       printf("libical 0.24 or newer required.\n");
+       printf("Citadel will be built without calendar support.\n");
        return(1);
 }
                ], 
@@ -118,6 +128,21 @@ main() {
        )
 fi
 
+
+
+dnl Checks for the zlib compression library.
+if test "x$with_zlib" != xno ; then
+        AC_CHECK_HEADERS(zlib.h,
+                [AC_CHECK_LIB(z, zlibVersion,
+                        [ok_zlib=yes],,
+        )])
+fi
+
+if test "x$ok_zlib" = xyes ; then
+        LIBS="-lz $LIBS"
+        AC_DEFINE(HAVE_ZLIB)
+fi
+
 dnl Checks for the newt window library.
 if test "x$with_newt" != xno ; then
        AC_CHECK_HEADERS(newt.h,
@@ -241,9 +266,9 @@ if test "$with_ssl" != "no"; then
        fi
 fi
 
-
+AM_GNU_GETTEXT
 
 AC_SUBST(SETUP_LIBS)
 
-AC_OUTPUT(Makefile)
+AC_OUTPUT(Makefile intl/Makefile po/Makefile.in )