]> code.citadel.org Git - citadel.git/blobdiff - citadel/configure.ac
warning fixes and cleanups for 64-bit machines
[citadel.git] / citadel / configure.ac
index cf85cca62f676c0267123353e67455ca10039d4a..776c40d1ec483440f5f76ae8bd23b352b71183c7 100644 (file)
@@ -1,7 +1,8 @@
 dnl Process this file with autoconf to produce a configure script.
 dnl $Id$
 AC_PREREQ(2.52)
-AC_INIT([Citadel/UX], [$Revision$], [http://uncensored.citadel.org/])
+AC_INIT([Citadel/UX], [5.80], [http://uncensored.citadel.org/])
+AC_REVISION([$Revision$])
 AC_CONFIG_SRCDIR([citserver.c])
 AC_PREFIX_DEFAULT(/usr/local/citadel)
 if test "$prefix" = NONE; then
@@ -46,16 +47,13 @@ dnl figure out how to build with POSIX threads.
 TARGETS=client
 
 AC_CANONICAL_HOST
-SO=.so
 PTHREAD_DEFS=-D_REENTRANT
-LINK_SHARED='$(CC) -shared -fPIC'
 case "$host" in
        dnl BSDI 3.0 wants relocatable object modules instead of shared libs
        dnl for dlopen(), and has a wrapper script to link with shared libs.
        dnl Also has stupid non-reentrant gethostbyaddr() and friends.
        *-*-bsdi[123]*)
                test -z "$CC" -a -x /usr/bin/shlicc2 && CC=shlicc2
-               SO=.mo
                AC_DEFINE(HAVE_NONREENTRANT_NETDB)
        ;;
        *-*-bsdi*)
@@ -65,11 +63,10 @@ case "$host" in
        dnl build pthreads programs with gcc due to header problems.
        alpha*-dec-osf*)
                test -z "$CC" && CC=cc
-               PTHREAD_DEFS=-pthread
-               PTHREAD_LIBS=-pthread
+               PTHREAD_LIBS="-lpthread -lexc"
                check_pthread=no
        ;;
-       dnl FreeBSD is similar to Digital UNIX:
+       dnl FreeBSD is similar to Digital UNIX with DEC C, which has a -pthread flag:
        *-*-freebsd*)
                if test "$with_kthread" = yes; then
                        PTHREAD_LIBS=-kthread
@@ -83,7 +80,6 @@ case "$host" in
                PTHREAD_LIBS=-pthread
                check_pthread=no
                PTHREAD_DEFS=-pthread
-               LINK_SHARED="ld -x -Bshareable"
        ;;
        *-*-solaris*)
                PTHREAD_DEFS="-D_REENTRANT -D_PTHREADS"
@@ -96,36 +92,25 @@ AC_PROG_CC
 dnl Set up system-dependent compiler flags.
 if test "$GCC" = yes; then
        case "$host" in
-               *-*-bsdi[123]*)
-                       CFLAGS="$CFLAGS -Wall -Wstrict-prototypes"
-               ;;
-               mips*-sgi-irix*)
-                       CFLAGS="$CFLAGS -Wall -Wstrict-prototypes"
-                       PICFLAGS=-fPIC
-               ;;
-               *-*-solaris*)
-                       CFLAGS="$CFLAGS -Wall -Wno-char-subscripts"
-                       PICFLAGS=-fPIC
-               ;;
-               *-*-hpux*)
-                       SERVER_LDFLAGS="$SERVER_LDFLAGS -Wl,-E"
-                       PICFLAGS=-fPIC
+               *-*-solaris*|alpha*-dec-osf*)
+                       CFLAGS="$CFLAGS -Wall -Wcast-align -Wno-char-subscripts"
                ;;
                *)
-                       CFLAGS="$CFLAGS -Wall -Wstrict-prototypes"
-                       SERVER_LDFLAGS="$SERVER_LDFLAGS -rdynamic"
-                       PICFLAGS=-fPIC
+                       CFLAGS="$CFLAGS -Wall -Wcast-align -Wstrict-prototypes"
                ;;
        esac
 fi
-AC_PROG_RANLIB
+AC_LIBTOOL_DLOPEN
+AC_LIBTOOL_WIN32_DLL
+AC_DISABLE_STATIC
+AC_PROG_LIBTOOL
+AC_SUBST(LIBTOOL_DEPS)
 AC_PROG_INSTALL
 AC_PROG_YACC
 missing_dir=`cd $ac_aux_dir && pwd`
 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
 
 dnl Checks for system services.
-AC_EXEEXT
 
 dnl Checks for libraries.
 
@@ -144,12 +129,12 @@ if test "$ac_cv_func_gethostbyname" = no; then
 fi
 
 if test "$ac_cv_func_connect" = no; then
-       AC_CHECK_LIB(socket, connect, NETLIBS="-lsocket $NETLIBS",, $NETLIBS)
+        AC_CHECK_LIB(socket, connect, NETLIBS="-lsocket $NETLIBS",, $NETLIBS)
 fi
 
 if test "$ac_cv_func_dlopen" = no; then
         AC_CHECK_LIB(dl, dlopen, [LIBS="-ldl $LIBS"
-               test "$with_pam" = yes && chkpwd_LIBS="-ldl $chkpwd_LIBS"])
+               test "$with_pam" = yes && chkpwd_LIBS="-ldl $chkpwd_LIBS"])
 fi
 
 dnl Check for HP/UX dyanmic loader. This should only be in -ldld.
@@ -189,7 +174,7 @@ if test "$enable_autologin" != no; then
                        AC_DEFINE(ENABLE_CHKPWD)
                        CHKPWD=chkpwd
                else
-                       AUTH=auth.ro
+                       AUTH=auth.lo
                fi
        fi
 fi
@@ -199,7 +184,10 @@ if test "x$with_db" != xno -a "x$with_gdbm" != xyes; then
        AC_CHECK_LIB(db, db_env_create,
                [GDBM="$GDBM -ldb"
                DATABASE=database_sleepycat.c
-               with_gdbm=no], [], [$NETLIBS])
+               with_gdbm=no], [AC_CHECK_LIB(db3, db_env_create,
+                                       [GDBM="$GDBM -ldb3"
+                                       DATABASE=database_sleepycat.c
+                                       with_gdbm=no], [], [$NETLIBS])], [$NETLIBS])
 fi
 
 if test "x$with_gdbm" != xno -a "x$with_db" != xyes; then
@@ -232,8 +220,14 @@ dnl Checks for header files.
 AC_HEADER_DIRENT
 AC_HEADER_STDC
 AC_HEADER_SYS_WAIT
-test "$db_dir" && CPPFLAGS="$CPPFLAGS -I$db_dir/include"
-AC_CHECK_HEADERS(curses.h dl.h dlfcn.h fcntl.h limits.h termios.h sys/ioctl.h sys/select.h sys/time.h syslog.h unistd.h utmp.h utmpx.h paths.h)
+test "$db_dir" && CPPFLAGS="$CPPFLAGS -I$db_dir/include" || \
+       ( test -d /usr/include/db3 && CPPFLAGS="$CPPFLAGS -I/usr/include/db3" ) || \
+       ( test -d /usr/local/include/db3 && CPPFLAGS="$CPPFLAGS -I/usr/local/include/db3" )
+AC_CHECK_HEADERS(curses.h dl.h fcntl.h limits.h termios.h sys/ioctl.h sys/select.h sys/time.h syslog.h unistd.h utmp.h utmpx.h paths.h)
+
+AC_CHECK_HEADER(resolv.h, [SMTP=modules/libsmtp.la; DOMAIN=domain.c])
+AC_SUBST(SMTP)
+AC_SUBST(DOMAIN)
 
 dnl some systems require -pthread, -D_REENTRANT, etc to be passed to cc if we
 dnl include pthread.h:
@@ -281,8 +275,6 @@ AC_CHECK_FUNCS(getspnam getutxline mkdir mkfifo mktime rmdir select socket strer
 
 dnl Now check for pthreads -- set up variables so that the compiler will be run
 dnl with proper flags for pthread programs
-save_LDFLAGS=$LDFLAGS
-LDFLAGS="$LDFLAGS $SERVER_LDFLAGS"
 save_LIBS=$LIBS
 LIBS="$PTHREAD_LIBS $LIBS"
 
@@ -335,15 +327,13 @@ if test "x$CX" != x.ro; then
        CX=.o
 fi
 
-dnl Now restore the old ldflags so we don't pass the wrong stuff to makefile
-LDFLAGS=$save_LDFLAGS
+dnl Now restore the old libs so we don't pass the wrong stuff to makefile
 LIBS=$save_LIBS
 
 AC_REPLACE_FUNCS(snprintf getutline)
 
 dnl Done! Now write the Makefile and sysdep.h
 AC_SUBST(AUTH)
-AC_SUBST(SO)
 AC_SUBST(CHKPWD)
 AC_SUBST(CURSES)
 AC_SUBST(GDBM)
@@ -351,9 +341,6 @@ AC_SUBST(RESOLV)
 AC_SUBST(NETLIBS)
 AC_SUBST(chkpwd_LIBS)
 AC_SUBST(TARGETS)
-AC_SUBST(SERVER_LDFLAGS)
-AC_SUBST(PICFLAGS)
-AC_SUBST(LINK_SHARED)
 AC_SUBST(PTHREAD_DEFS)
 AC_SUBST(PTHREAD_LIBS)
 AC_SUBST(CLIENT_PTLIBS)