* Mercilessly ripped out all of the gratuitously complex GNU libintl
[citadel.git] / webcit / configure.in
index 09df7eea8c081036a0f746726239de8730f1c79a..de39baae765c18e6d1e41f2b4d218b45df7b0d55 100644 (file)
@@ -9,17 +9,18 @@ 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(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(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 ],
+       [  --with-ssl=PATH         Specify path to OpenSSL installation ],
        [
                if test "x$withval" != "xno" ; then
                        tryssldir=$withval
@@ -63,8 +64,8 @@ if test "$GCC" = yes; then
        esac
 fi
 
-missing_dir=`cd $ac_aux_dir && pwd`
-AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
+dnl ### missing_dir=`cd $ac_aux_dir && pwd`
+dnl ### AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
 
 dnl Checks for libraries.
 if test "$LIBS" != -pthread; then
@@ -266,9 +267,82 @@ if test "$with_ssl" != "no"; then
        fi
 fi
 
-AM_GNU_GETTEXT
+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 to see if your system supports multithreaded NLS...)
+       AC_TRY_RUN([
+               #define _GNU_SOURCE
+               #include <locale.h>
+               #include <libintl.h>
+               main() {
+                       char *foo;
+                       uselocale(LC_GLOBAL_LOCALE);
+                       foo = gettext("bar");
+                       exit(0);
+               }
+       ],
+               ok_nls=yes,
+               ok_nls=no
+       )
+fi
+
+if test "$ok_nls" != "no"; then
+       AC_CHECK_PROG(ok_nls, xgettext, yes, no)
+fi
+
+if test "$ok_nls" != "no"; then
+       AC_CHECK_PROG(ok_nls, msgmerge, yes, no)
+fi
+
+if test "$ok_nls" != "no"; then
+       AC_CHECK_PROG(ok_nls, msgfmt, yes, no)
+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 intl/Makefile po/Makefile.in po/Makefile )
+AC_OUTPUT(Makefile po/Makefile )