dnl Process this file with autoconf to produce a configure script.
dnl $Id$
-AC_INIT([WebCit], [7.24], [http://www.citadel.org/])
+AC_INIT([WebCit], [7.37], [http://www.citadel.org/])
+
AC_SUBST(PROG_SUBDIRS)
AC_DEFINE(PROG_SUBDIRS, [], [Program dirs])
ssl_dir="$prefix/keys"
fi
-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 ],
[
*-*-solaris*)
PTHREAD_DEFS='-D_REENTRANT -D_PTHREADS'
;;
+ *-*-darwin*)
+ LIBS=-lintl
esac
AC_SUBST(PTHREAD_DEFS)
if test "$GCC" = yes; then
case "$host" in
*-*-solaris*)
- CFLAGS="$CFLAGS -Wall -Wno-char-subscripts"
+ CFLAGS="$CFLAGS -Wall -Wno-char-subscripts --pedantic"
;;
*)
- CFLAGS="$CFLAGS -Wall"
+ CFLAGS="$CFLAGS -Wall --pedantic"
;;
esac
fi
dnl Checks for header files.
AC_HEADER_STDC
dnl AC_HEADER_SYS_WAIT
-AC_CHECK_HEADERS(fcntl.h limits.h sys/time.h unistd.h)
AC_TYPE_SIGNAL
dnl AC_FUNC_VPRINTF
AC_REPLACE_FUNCS(snprintf)
+AC_CHECK_HEADERS(fcntl.h limits.h sys/time.h unistd.h iconv.h xlocale.h)
+
+
+dnl Here is the check for a libc integrated iconv
+AC_ARG_ENABLE(iconv,
+ [ --disable-iconv do not use iconv charset conversion],
+ ok_iconv=no, ok_iconv=yes)
+
+AC_MSG_CHECKING(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
+ AC_MSG_RESULT([yes])
+ ],
+ [
+ ok_iconv=no
+ AC_MSG_RESULT([no])
+ ]
+)
+
+dnl Check for iconv in external libiconv
+if test "$ok_iconv" = no; then
+ AC_MSG_CHECKING(Checking for an external libiconv)
+ OLD_LDFLAGS="$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);
+ }
+ ],
+ [
+ ok_iconv=yes
+ AC_MSG_RESULT([yes])
+ ],
+ [
+ ok_iconv=no
+ LDFLAGS="$OLD_LDFLAGS"
+ AC_MSG_RESULT([no])
+ ]
+ )
+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])
+else
+ AC_MSG_RESULT(WebCit will be built without character set conversion.)
+fi
+
+AC_CHECK_LIB(intl, libintl_bindtextdomain, [LDFLAGS="$LDFLAGS -lintl"])
+
+
+dnl Checks for the libical iCalendar library.
+AC_CHECK_HEADER(libical/ical.h,
+ [AC_CHECK_LIB(ical, icaltimezone_set_tzid_prefix,
+ [
+ LIBS="-lical $LIBS"
+ ],
+ [
+ AC_MSG_ERROR(libical was not found and is required. More info: http://www.citadel.org/doku.php/installation:start)
+ ]
+ ,
+ )],
+ [
+ AC_MSG_ERROR(libical/ical.h was not found and is required. More info: http://www.citadel.org/doku.php/installation:start)
+ ]
+)
dnl Check for libcitadel
AC_CHECK_HEADER(libcitadel.h,
[AC_CHECK_LIB(citadel, libcitadel_version_string,
[
- AC_MSG_RESULT(OK)
LIBS="-lcitadel $LIBS"
],
[
)
-webcit_with_calendar_service=no
-dnl Checks for the libical calendaring library.
-if test "x$with_libical" != xno ; then
- AC_CHECK_HEADERS(ical.h,
- [AC_CHECK_LIB(ical, icalcomponent_new,
- [ok_libical=yes],,
- )])
-fi
-
-if test "x$ok_libical" = xyes ; then
-
- AC_TRY_RUN(
- [
-#include <ical.h>
-main() {
- int major, minor, v;
- sscanf(ICAL_VERSION, "%d.%d", &major, &minor);
- v = 100*major + minor;
- printf("libical version: %i\n", v);
- if (v >= 30) {
- printf("This version is ok.\n");
- return(0);
- }
- printf("libical 0.30 or newer required.\n");
- printf("Citadel will be built without calendar support.\n");
- return(1);
-}
- ],
- [
- 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
- 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,[],[whether we have zlib])
-fi
-
+found_ssl=no
# The big search for OpenSSL
if test "$with_ssl" != "no"; then
saved_LIBS="$LIBS"
if test "x$ac_cv_openssldir" != "xno" ; then
AC_DEFINE(HAVE_OPENSSL,[],[whethe we have openssl])
+ found_ssl=yes
LIBS="-lssl -lcrypto $LIBS"
dnl Need to recover ssldir - test above runs in subshell
ssldir=$ac_cv_openssldir
[ if test "x$withval" != "xno" ; then
ssl_dir="$withval"
+ if test "$found_ssl" = "no"; then
+ echo "Your setup was incomplete; ssldir doesn't make sense without openssl"
+ exit
+ fi
fi
AC_SUBST(MAKE_SSL_DIR)
]
)
AC_DEFINE_UNQUOTED(SSL_DIR, "$ssl_dir", [were should we put our keys?])
-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
- 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
- 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])
-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
+AC_CHECK_FUNCS(strftime_l uselocale gettext)
if test "$ok_nls" != "no"; then
AC_CHECK_PROG(ok_xgettext, xgettext, yes, no)
)
AC_DEFINE_UNQUOTED(EDITORDIR, "$editordir", [where to find our mail editor])
+./mk_module_init.sh
AC_CONFIG_HEADER(sysdep.h)
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