src/crypto.c: possible fix for memory leak related
[citadel.git] / webcit / configure.in
index 12c6f11854a08a491588200f9d79549ec13b10a3..84fe4bec9dc375a8287fbe3336f85568164f7cd5 100644 (file)
@@ -1,10 +1,14 @@
 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_INIT([webcit],[6.80],[uncensored.citadel.org])
+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
@@ -45,7 +49,6 @@ AC_DEFINE([HAVE_OPENSSL],
        ]
 )
 
-AC_DEFINE([WEBCITDIR],"/usr/local/webcit",    [  --with-webcitdir             Directory Prefix])
 
 dnl Set some system-specific variables which are OK to set before compiler
 dnl checks:
@@ -92,6 +95,7 @@ if test "$LIBS" != -pthread; then
        AC_CHECK_LIB(pthread, pthread_create)
        AC_CHECK_LIB(pthreads, pthread_create)
 fi
+AC_CHECK_LIB(iconv, libiconv, [LIBS="$LIBS -liconv"])   
 AC_SEARCH_LIBS(gethostbyname, nsl)
 AC_SEARCH_LIBS(connect, socket)
 
@@ -146,7 +150,7 @@ main() {
 }
                ], 
                [
-                       LIBS="-lical $LIBS"
+                       LIBS="$LIBS -lical"
                        AC_DEFINE(HAVE_LIBICAL)
                ]
        )
@@ -165,7 +169,7 @@ AC_DEFINE([with_zlib],
                ])
 
 if test "x$ok_zlib" = xyes ; then
-        LIBS="-lz $LIBS"
+        LIBS="$LIBS -lz "
 fi
 
 dnl Checks for the newt window library.
@@ -319,7 +323,8 @@ else
        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 
@@ -377,25 +382,76 @@ 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.0])
+AM_GNU_GETTEXT_VERSION([0.14])
 
 #AM_GNU_GETTEXT
 # if we have intl/... 
-AM_GNU_GETTEXT([external])
 IT_PROG_INTLTOOL
+AC_TRY_COMPILE([#include <locale.h>],
+                       [ extern locale_t wc_locales[]],
+                       [
+                       _nls_avail=yes
+                       AM_GNU_GETTEXT([external],[need-ngettext])
+                       ],
+                       [_nls_avail=no])
+
+
+
+
+                       
+
+dnl 
+dnl 
+dnl AC_TRY_RUN([
+dnl #include <libintl.h>
+dnl #include <locale.h>
+dnl int main(void)
+dnl {
+dnl    extern locale_t wc_locales[];
+dnl    return 1;
+dnl }
+dnl ],
+dnl                            [
+dnl                                    found_crypto=1
+dnl                                    break;
+dnl                            ], []
+dnl                    )
+dnl 
+
+
+
 
 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?])
 
 
-AC_ARG_WITH(staticdir, [  --with-staticdir=DIR          where to put datafiles],[ staticdir=$withval ],[ staticdir=$prefix/static/ ] )
+AC_ARG_WITH(staticdir, [  --with-staticdir=DIR          where to put datafiles],
+                                          [ staticdir=$withval ],[ staticdir=$prefix ] )
 AC_SUBST(staticdir)
-AC_OUTPUT(Makefile src/Makefile po/Makefile.in   )
+
+AC_ARG_WITH(staticrundir, [  --with-staticrundir=DIR          where to search datafiles at runtime],
+                                                 [ staticrundir=$withval ],[ staticrundir=$staticdir ] )
+
+AC_DEFINE_UNQUOTED([DATADIR],["$staticrundir"],[where should we make our root?])
+
+
+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)?])
+
+
+
+AC_OUTPUT(Makefile src/Makefile po/Makefile.in)
+
 
 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 'National language support:       ' $_nls_avail
 echo