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
]
)
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
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
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)
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)
-
-AC_ARG_WITH(rundir, [ --with-rundir=DIR where to find the citadel servers sockets (overridable by -h at runtime.)],
- [ rundir=$withval ],[ rundir=/usr/local/citadel ] )
-AC_DEFINE_UNQUOTED([RUNDIR],["$rundir"],[where should we make look for citadel sockets?])
+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)
-AC_ARG_WITH(staticdir, [ --with-staticdir=DIR where to put datafiles],
- [ staticdir=$withval ],[ staticdir=$prefix ] )
-AC_SUBST(staticdir)
-
-AC_ARG_WITH(staticrundir, [ --with-staticrundir=DIR where to search datafiles at runtime],
- [ staticrundir=$withval ],[ staticrundir=$staticdir ] )
+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
-AC_DEFINE_UNQUOTED([DATADIR],["$staticrundir"],[where should we make our root?])
+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
-AC_ARG_WITH(editordir, [ --with-editordir=DIR where to search the editor at runtime],
- [ editordir=$withval ],[ editordir=$staticrundir ] )
-AC_SUBST(editordir)
-AC_DEFINE_UNQUOTED([EDITORDIR],["$editordir"],[where find the editor (tiny_mce)?])
+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)
-AC_OUTPUT(Makefile src/Makefile po/Makefile.in )
+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_OUTPUT(Makefile po/Makefile )
echo ------------------------------------------------------------------------
echo 'zlib compression: ' $ok_zlib