X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=webcit%2Fconfigure.ac;h=2017d692faca681fb2b25004b3eab3ac0e83956e;hb=c178cc1fbab7dde1ee132a6fc9c84587cc3017de;hp=578be2dee11b29ce7d3d17f27b9bd892f0f722f7;hpb=3327be471d9406447524e9f4f9de86c3d111ec5d;p=citadel.git diff --git a/webcit/configure.ac b/webcit/configure.ac index 578be2dee..2017d692f 100644 --- a/webcit/configure.ac +++ b/webcit/configure.ac @@ -1,6 +1,6 @@ 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.31], [http://www.citadel.org/]) AC_SUBST(PROG_SUBDIRS) AC_DEFINE(PROG_SUBDIRS, [], [Program dirs]) @@ -84,7 +84,6 @@ AC_SEARCH_LIBS(connect, socket) 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) @@ -99,13 +98,73 @@ dnl Checks for library functions. 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) + + +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 + 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 + 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=$OLDLDFLAGS + 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 Check for libcitadel AC_CHECK_HEADER(libcitadel.h, [AC_CHECK_LIB(citadel, libcitadel_version_string, [ - AC_MSG_RESULT(OK) LIBS="-lcitadel $LIBS" ], [ @@ -154,6 +213,8 @@ main() { ] ) 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.]) @@ -296,87 +357,10 @@ AC_ARG_WITH(ssldir, ) 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 - 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 - 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 - #include - #include - 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)