* send welcome mail on first debian package installation.
[citadel.git] / webcit / configure.in
index a1385c236ba2f14006ab375081a856f9ad2f51d9..b1d9170400c85f39d1f64ca50b0df67eb95ffdfd 100644 (file)
@@ -1,51 +1,30 @@
 dnl Process this file with autoconf to produce a configure script.
 dnl $Id$
-dnl AC_CONFIG_AUX_DIR([autoconf])
-AC_INIT(src/webserver.c)
-AC_GNU_SOURCE
-AM_INIT_AUTOMAKE(webcit,6.72)
-AM_CONFIG_HEADER(config.h)
-AC_PROG_LIBTOOL
-
-dnl Make sure we see all GNU and Solaris extensions.
-
-#AC_CONFIG_HEADERS(sysdep.h)
-#AC_VERSION(6.72)
-#PACKAGE=gettext
-#VERSION=0.14.5
-#AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
-#AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
-#AC_SUBST(PACKAGE)
-#AC_SUBST(VERSION)
-#AM_INIT_AUTOMAKE(gettext, 0.14.5)
+AC_INIT(webserver.c)
+
+
+PACKAGE=webcit
+VERSION=7.02
+AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
+AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
+AC_SUBST(PACKAGE)
+AC_SUBST(VERSION)
 
 AC_SUBST(PROG_SUBDIRS)
-#AC_CANONICAL_HOST
+AC_CANONICAL_HOST
 AC_PROG_INSTALL
 AC_CHECK_PROG(AUTOCONF, autoconf)
 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_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 ],
-#      [
-#              if test "x$withval" != "xno" ; then
-#                      tryssldir=$withval
-#              fi
-#      ]
-#)
-#AC_DEFINE([HAVE_ICAL], [  --with-libical          use libical calendaring library])
-AC_DEFINE([HAVE_OPENSSL],
+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(ssl,
        [  --with-ssl=PATH         Specify path to OpenSSL installation ],
-       ssl_ok=no,
        [
                if test "x$withval" != "xno" ; then
                        tryssldir=$withval
                fi
-               ssl_ok=yes
        ]
 )
 
@@ -115,18 +94,15 @@ dnl AC_HEADER_TIME
 dnl Checks for library functions.
 AC_TYPE_SIGNAL
 dnl AC_FUNC_VPRINTF
-AC_CHECK_FUNCS(backtrace)
+dnl AC_CHECK_FUNCS(strerror)
 AC_REPLACE_FUNCS(snprintf)
 
 dnl Checks for the libical calendaring library.
-AC_DEFINE([HAVE_LIBICAL], 
-          [--with-libical          use libical calendaring library],
-                 ok_libical=no, ok_libical=yes)
-
 if test "x$with_libical" != xno ; then
-                 AC_CHECK_HEADERS(ical.h,
-                                    [AC_CHECK_LIB(ical, icalcomponent_new,
-                                   [ok_libical=yes],,)])
+        AC_CHECK_HEADERS(ical.h,
+                [AC_CHECK_LIB(ical, icalcomponent_new,
+                        [ok_libical=yes],,
+        )])
 fi
 
 if test "x$ok_libical" = xyes ; then
@@ -158,29 +134,16 @@ fi
 
 
 dnl Checks for the zlib compression library.
-AC_DEFINE([with_zlib],
-                 [  --with-zlib             use zlib compression if present],
-                 [ok_zlib=no], 
-                 [AC_CHECK_HEADERS(zlib.h,
-                                                       [AC_CHECK_LIB(z, zlibVersion,
-                                                       [ok_zlib=yes],,
-                                                       )])
-               ])
+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"
-fi
-
-dnl Checks for the newt window library.
-AC_ARG_WITH([ok_newt],    [  --with-newt             use newt window library],ok_newt=no, [ AC_CHECK_HEADERS(newt.h,
-                                   [AC_CHECK_LIB(newt, newtInit,
-                                                     [ok_newt=yes],[ok_newt=no],
-                                             )
-                                                       ])
-                                 ]
-)
-if test "x$ok_newt" = xyes ; then
-       SETUP_LIBS="-lnewt $SETUP_LIBS"
+        AC_DEFINE(HAVE_ZLIB)
 fi
 
 # The big search for OpenSSL
@@ -295,7 +258,7 @@ fi
 
 dnl Here is the check for a usable iconv
 
-AC_DEFINE([HAVE_ICONV],
+AC_ARG_ENABLE(iconv,
        [  --disable-iconv         do not use iconv charset conversion],
        ok_iconv=no, ok_iconv=yes)
 
@@ -322,80 +285,80 @@ else
        AC_MSG_RESULT(WebCit will be built without character set conversion.)
 fi
 
-AC_DEFINE_UNQUOTED([PREFIX],["$prefix"],where should we make our root?)
-dnl AC_SUBST(PREFIX)
-
-dnl dnl Here is the check for libintl etc.
-dnl 
-dnl AC_DEFINE([ENABLE_NLS],
-dnl    [  --disable-nls           do not use Native Language Support],
-dnl    ok_nls=no, ok_nls=yes)
-dnl 
-dnl if test "$ok_nls" != "no"; then
-dnl    AC_MSG_RESULT(Checking for per-thread NLS support...)
-dnl    AC_TRY_RUN([
-dnl                 #define _GNU_SOURCE
-dnl                 #include <libintl.h>
-dnl                 #include <locale.h>
-dnl                 #include <time.h>
-dnl                 main() {
-dnl                         char *foo = NULL;
-dnl                         char baz[32];
-dnl                    struct tm *tm;
-dnl                         uselocale(LC_GLOBAL_LOCALE);
-dnl                         foo = gettext("bar");
-dnl                    if (0) {
-dnl                            strftime_l(baz, sizeof baz, "%c", tm, LC_GLOBAL_LOCALE);
-dnl                    }
-dnl                         exit(0);
-dnl            }
-dnl    ],
-dnl            ok_uselocale=yes,
-dnl            ok_uselocale=no
-dnl    )
-dnl    ok_nls=$ok_uselocale
-dnl fi
-dnl 
-dnl if test "$ok_nls" != "no"; then
-dnl    AC_CHECK_PROG(ok_xgettext, xgettext, yes, no)
-dnl    ok_nls=$ok_xgettext
-dnl fi
-dnl 
-dnl if test "$ok_nls" != "no"; then
-dnl    AC_CHECK_PROG(ok_msgmerge, msgmerge, yes, no)
-dnl    ok_nls=$ok_msgmerge
-dnl fi
-dnl 
-dnl if test "$ok_nls" != "no"; then
-dnl    AC_CHECK_PROG(ok_msgfmt, msgfmt, yes, no)
-dnl    ok_nls=$ok_msgfmt
-dnl fi
-dnl 
-dnl if test "$ok_nls" != "no"; then
-dnl    AC_MSG_RESULT(WebCit will be built with national language support.)
-dnl    AC_DEFINE(ENABLE_NLS)
-dnl     CFLAGS="$CFLAGS -I\$(top_srcdir)/po"
-dnl    PROG_SUBDIRS="$PROG_SUBDIRS po"
-dnl    AC_CHECK_LIB(intl, gettext)
-dnl else
-dnl    AC_MSG_RESULT(WebCit will be built without national language support.)
-dnl fi
-dnl Checks for programs.
-AM_GNU_GETTEXT_VERSION([0.14])
 
-#AM_GNU_GETTEXT
-# if we have intl/... 
-AM_GNU_GETTEXT([external])
-IT_PROG_INTLTOOL
 
-AC_SUBST(CFLAGS)
-AC_SUBST(SETUP_LIBS)
+dnl Here is the check for libintl etc.
+
+AC_ARG_ENABLE(nls,
+       [  --disable-nls           do not use Native Language Support],
+       ok_nls=no, ok_nls=yes)
+
+if test "$ok_nls" != "no"; then
+       AC_MSG_RESULT(Checking for per-thread NLS support...)
+       AC_TRY_RUN([
+                #define _GNU_SOURCE
+                #include <libintl.h>
+                #include <locale.h>
+                #include <time.h>
+                main() {
+                        char *foo = NULL;
+                        char baz[32];
+                       struct tm *tm;
+                        uselocale(LC_GLOBAL_LOCALE);
+                        foo = gettext("bar");
+                       if (0) {
+                               strftime_l(baz, sizeof baz, "%c", tm, LC_GLOBAL_LOCALE);
+                       }
+                        exit(0);
+               }
+       ],
+               ok_uselocale=yes,
+               ok_uselocale=no
+       )
+       ok_nls=$ok_uselocale
+fi
 
+if test "$ok_nls" != "no"; then
+       AC_CHECK_PROG(ok_xgettext, xgettext, yes, no)
+       ok_nls=$ok_xgettext
+fi
+
+if test "$ok_nls" != "no"; then
+       AC_CHECK_PROG(ok_msgmerge, msgmerge, yes, no)
+       ok_nls=$ok_msgmerge
+fi
 
+if test "$ok_nls" != "no"; then
+       AC_CHECK_PROG(ok_msgfmt, msgfmt, yes, no)
+       ok_nls=$ok_msgfmt
+fi
+
+if test "$ok_nls" != "no"; then
+       AC_MSG_RESULT(WebCit will be built with national language support.)
+       AC_DEFINE(ENABLE_NLS)
+       PROG_SUBDIRS="$PROG_SUBDIRS po"
+else
+       AC_MSG_RESULT(WebCit will be built without national language support.)
+fi
+
+AC_SUBST(SETUP_LIBS)
+
+dnl where to make webcit search its mo's?
+if test "$prefix" = "NONE"; then
+       LOCALEDIR="$ac_default_prefix/locale/"
+else
+       LOCALEDIR="$prefix/locale/"
+fi
+AC_ARG_WITH(localedir, 
+                   [  --with-locale          directory where to find our mo's],
+                       [ if test "x$withval" != "xno" ; then
+                               LOCALEDIR="$withval/"
+                         fi
+                       ]
+)
+AC_SUBST(LOCALEDIR)
 
-AC_ARG_WITH(staticdir, [  --with-staticdir=DIR          where to put datafiles],[ staticdir=$withval ],[ staticdir=$prefix/ ] )
-AC_SUBST(staticdir)
-AC_OUTPUT(Makefile src/Makefile po/Makefile.in   )
+AC_OUTPUT(Makefile po/Makefile )
 
 echo ------------------------------------------------------------------------
 echo 'zlib compression:                ' $ok_zlib