dnl $Id$
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_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_newt, [ --with-newt use newt window 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 ],
+ [ --with-ssl=PATH Specify path to OpenSSL installation ],
[
if test "x$withval" != "xno" ; then
tryssldir=$withval
fi
]
)
+
+
dnl Set some system-specific variables which are OK to set before compiler
dnl checks:
PTHREAD_DEFS=-D_REENTRANT
esac
fi
-missing_dir=`cd $ac_aux_dir && pwd`
-AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
+# missing_dir=`cd $ac_aux_dir && pwd`
+# AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
dnl Checks for libraries.
if test "$LIBS" != -pthread; then
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
[
#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);
}
],
)
fi
-dnl Checks for the newt window library.
-if test "x$with_newt" != xno ; then
- AC_CHECK_HEADERS(newt.h,
- [AC_CHECK_LIB(newt, newtInit,
- [ok_newt=yes],,
- )])
+
+
+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_newt" = xyes ; then
- SETUP_LIBS="-lnewt $SETUP_LIBS"
- AC_DEFINE(HAVE_NEWT)
+if test "x$ok_zlib" = xyes ; then
+ LIBS="-lz $LIBS"
+ AC_DEFINE(HAVE_ZLIB)
fi
# The big search for OpenSSL
fi
fi
+dnl Here is the check for a usable iconv
+
+AC_ARG_ENABLE(iconv,
+ [ --disable-iconv do not use iconv charset conversion],
+ ok_iconv=no, ok_iconv=yes)
+
+if test "$ok_nls" != "no"; then
+ AC_MSG_RESULT(Checking to see if your system supports iconv...)
+ 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
+ )
+fi
+
+if test "$ok_iconv" != "no"; then
+ AC_MSG_RESULT(WebCit will be built with character set conversion.)
+ AC_DEFINE(HAVE_ICONV)
+else
+ AC_MSG_RESULT(WebCit will be built without character set conversion.)
+fi
+
+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)
-AC_OUTPUT(Makefile)
+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
+echo 'Calendar support: ' $ok_libical
+echo 'Character set conversion support:' $ok_iconv
+echo 'National language support: ' $ok_nls
+echo