* add documentation
[citadel.git] / webcit / configure.in
index 6991c919bccf31445706965bb95aca8bfdc346aa..b937a0c913b1a7e1f6458bc880ac723a171375e8 100644 (file)
@@ -2,9 +2,13 @@ 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_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
@@ -34,7 +38,6 @@ AC_PREFIX_DEFAULT(/usr/local/webcit)
 #      ]
 #)
 #AC_DEFINE([HAVE_ICAL], [  --with-libical          use libical calendaring library])
-AC_DEFINE([HAVE_ZLIB],    [  --with-zlib             use zlib compression if present],ok_zlib=no, ok_zlib=yes)
 AC_DEFINE([HAVE_OPENSSL],
        [  --with-ssl=PATH         Specify path to OpenSSL installation ],
        ssl_ok=no,
@@ -46,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:
@@ -156,37 +158,30 @@ 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
+AC_DEFINE([with_zlib],
+                 [  --with-zlib             use zlib compression if present],
+                 [ok_zlib=no], 
+                 [AC_CHECK_HEADERS(zlib.h,
+                                                       [AC_CHECK_LIB(z, zlibVersion,
+                                                       [ok_zlib=yes],,
+                                                       )])
+               ])
 
 if test "x$ok_zlib" = xyes ; then
         LIBS="-lz $LIBS"
-        AC_DEFINE(HAVE_ZLIB)
 fi
 
 dnl Checks for the newt window library.
-dnl#if test "x$with_newt" != xno ; then
-
-dnl AC_DEFINE([HAVE_NEWT],
-dnl              [  --with-newt             use newt window library],ok_newt=no, 
-dnl          [AC_CHECK_HEADERS(newt.h,
-dnl                                [AC_CHECK_LIB(newt, newtInit,
-dnl                                                  [ok_newt=yes],[ok_newt=no],
-dnl                                          )
-dnl                                                    ])
-dnl              ] 
-dnl )
-
-dnl    ok_newt=yes
-
-dnl if test "x$ok_newt" = xyes ; then
-dnl    SETUP_LIBS="-lnewt $SETUP_LIBS"
-dnl    AC_DEFINE(HAVE_NEWT)
-dnl fi
+AC_ARG_WITH([ok_newt],    [  --with-newt             use newt window library],ok_newt=no, [ AC_CHECK_HEADERS(newt.h,
+                                   [AC_CHECK_LIB(newt, newtInit,
+                                                     [ok_newt=yes],[ok_newt=no],
+                                             )
+                                                       ])
+                                 ]
+)
+if test "x$ok_newt" = xyes ; then
+       SETUP_LIBS="-lnewt $SETUP_LIBS"
+fi
 
 # The big search for OpenSSL
 if test "$with_ssl" != "no"; then
@@ -327,7 +322,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 
@@ -385,7 +381,7 @@ 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.5])
+AM_GNU_GETTEXT_VERSION([0.14])
 
 #AM_GNU_GETTEXT
 # if we have intl/... 
@@ -395,14 +391,31 @@ IT_PROG_INTLTOOL
 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??)
 
-STATIC_DIR=
 
-AC_ARG_WITH(with_staticdir, [  --with-staticdir          where to put datafiles])
+AC_ARG_WITH(staticdir, [  --with-staticdir=DIR          where to put datafiles],
+                                          [ staticdir=$withval ],[ staticdir=$prefix ] )
+AC_SUBST(staticdir)
+
+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(editor, [  --with-editor=DIR          where to search the editor at runtime],
+                                                 [ editordir=$withval ],[ editordir=$staticrundir ] )
+AC_DEFINE_UNQUOTED([EDITORDIR],["$editordir"],where find the editor (tiny_mce)?)
+
+AC_SUBST(editor)
+
 
-AC_SUBST(STATIC_DIR)
 AC_OUTPUT(Makefile src/Makefile po/Makefile.in   )
 
+
 echo ------------------------------------------------------------------------
 echo 'zlib compression:                ' $ok_zlib
 echo 'Calendar support:                ' $ok_libical