]> arthur.barton.de Git - netatalk.git/blobdiff - configure.in
Change all references to db3/DB3 to BDB. We now support Berkeley DB
[netatalk.git] / configure.in
index 78c25e9e687e0c35615db1878ba9e792c990b00c..860ab7574e3ce27b6dc9d5d37947982d7eaa1180 100644 (file)
@@ -1,18 +1,15 @@
-dnl $Id: configure.in,v 1.137 2001-12-03 15:46:29 jmarcus Exp $
+dnl $Id: configure.in,v 1.175 2003-01-04 21:41:48 jmarcus Exp $
 dnl configure.in for netatalk
 
 AC_INIT(bin/adv1tov2/adv1tov2.c)
 
-NETATALK_VERSION=`cat VERSION`
+NETATALK_VERSION=`cat $srcdir/VERSION`
 AC_SUBST(NETATALK_VERSION)
 
 AC_CANONICAL_SYSTEM
 AM_INIT_AUTOMAKE(netatalk, ${NETATALK_VERSION})
 AM_CONFIG_HEADER(config.h)
 
-dnl Reset locations to proper places
-AC_PREFIX_DEFAULT(/usr/local)
-
 dnl Checks for programs.
 AC_PROG_AWK
 AC_PROG_CC
@@ -21,6 +18,9 @@ AC_PROG_LN_S
 AC_PROG_MAKE_SET
 AC_LIBTOOL_DLOPEN
 AM_PROG_LIBTOOL
+AC_PROG_PERL
+AC_PROG_GREP
+AC_PROG_PS
 
 dnl *********************************************************************
 dnl FIXME! FIXME! These should be selectable properly, and should produce
@@ -72,35 +72,19 @@ AC_CHECK_LIB(ubik, main)
 # Be sure to test before adding AFS libs in LIBS path as AFS lib
 # has such a function that works only on AFS filesystems.
 AC_CHECK_FUNCS(access)
+# 
+AC_CHECK_FUNCS(pread pwrite)
 
 dnl Checks for header files.
 AC_HEADER_DIRENT
 AC_HEADER_STDC
 AC_HEADER_SYS_WAIT
-AC_CHECK_HEADERS(fcntl.h limits.h stdint.h strings.h sys/fcntl.h sys/file.h sys/ioctl.h sys/time.h sys/mnttab.h sys/statvfs.h sys/stat.h sys/vfs.h mntent.h syslog.h unistd.h termios.h sys/termios.h netdb.h sgtty.h ufs/quota.h mount.h sys/mount.h statfs.h sys/types.h dlfcn.h errno.h sys/errno.h time.h cma.h)
+AC_CHECK_HEADERS(fcntl.h limits.h stdint.h strings.h sys/fcntl.h sys/file.h sys/ioctl.h sys/time.h sys/mnttab.h sys/statvfs.h sys/stat.h sys/vfs.h mntent.h syslog.h unistd.h termios.h sys/termios.h netdb.h sgtty.h ufs/quota.h mount.h sys/mount.h statfs.h sys/types.h dlfcn.h errno.h sys/errno.h)
 AC_CHECK_HEADER(sys/cdefs.h,,
        AC_MSG_RESULT([enabling generic cdefs.h from tree])
        CFLAGS="-I\$(top_srcdir)/sys/generic $CFLAGS"
 )
 
-# Allow user to specify flags
-AC_ARG_WITH(cflags,
-       [  --with-cflags           specify additional flags to pass to compiler],
-       [
-               if test "x$withval" != "xno" ; then
-                       CFLAGS="$CFLAGS $withval"
-               fi
-       ]       
-)
-AC_ARG_WITH(libs,
-       [  --with-libs             specify additional libraries to link with],
-       [
-               if test "x$withval" != "xno" ; then
-                       LIBS="$LIBS $withval"
-               fi
-       ]
-)
-
 dnl Checks for typedefs, structures, and compiler characteristics.
 AC_C_CONST
 AC_TYPE_UID_T
@@ -122,9 +106,12 @@ AC_FUNC_MMAP
 AC_TYPE_SIGNAL
 AC_FUNC_UTIME_NULL
 AC_FUNC_WAIT3
-AC_CHECK_FUNCS(flock getcwd gethostname gettimeofday getusershell mkdir rmdir select socket strdup strstr strtoul setpgrp strchr memcpy)
+AC_CHECK_FUNCS(getcwd gethostname gettimeofday getusershell mkdir rmdir select socket strdup strcasestr strstr strtoul setpgrp strchr memcpy)
 AC_FUNC_SETPGRP
 
+dnl Checks for (v)snprintf
+NETATALK_SNPRINTF_CHECK
+
 dnl --------------------------------------------------------------------------
 dnl specific configuration comes in here:
 dnl --------------------------------------------------------------------------
@@ -137,21 +124,27 @@ AC_ARG_WITH(admin-group,
                AC_DEFINE(ADMIN_GRP, 0)
                AC_MSG_RESULT([disabling administrative group support])
         fi
- )
-
-AC_ARG_ENABLE(afs,
-       [  --enable-afs            enable AFS support],
-       if test "$enableval" = "yes"; then
-               AC_DEFINE(AFS, 1)
-               AC_MSG_RESULT([enabling AFS support])
-       fi
 )
 
-AC_ARG_WITH(pkgconfdir,
-       [  --with-pkgconfdir=DIR   package specific configuration in DIR
-                          [[SYSCONF/netatalk]]],
-               PKGCONFDIR="$withval",
-               PKGCONFDIR="${sysconfdir}/netatalk"
+NETATALK_AFS_CHECK
+
+NETATALK_CONFIG_DIRS
+
+AC_ARG_WITH(logfile,
+       [  --with-logfile=PATH     path for file used by logger [/var/log/netatalk.log]
+                          use --without-logfile to disable logger],
+        if test "$withval" = "no"; then
+               AC_DEFINE(DISABLE_LOGGER, 1)
+               AC_MSG_RESULT([logger disabled])
+       elif test "$withval" != "yes"; then
+               AC_DEFINE_UNQUOTED(LOGFILEPATH, "$withval")
+               AC_MSG_RESULT([logfile set to $withval])
+       else
+                AC_DEFINE_UNQUOTED(LOGFILEPATH, "/var/log/netatalk.log")
+                AC_MSG_RESULT([logfile set to default]) 
+       fi,
+               AC_DEFINE_UNQUOTED(LOGFILEPATH, "/var/log/netatalk.log")
+               AC_MSG_RESULT([logfile set to default])
 )
 
 AC_ARG_WITH(cracklib,
@@ -190,11 +183,23 @@ AC_ARG_ENABLE(debug,
                        AC_DEFINE_UNQUOTED(DEBUG, $enableval)
                fi 
                AC_MSG_RESULT([enabling debugging code])
-       else
-               AC_DEFINE(DEBUG, 0)
        fi
 )
 
+afp3=no
+AC_ARG_ENABLE(afp3,
+       [  --enable-afp3           enable AFP 3.x calls],
+       if test "$enableval" = "yes"; then
+               afp3=yes
+               AC_DEFINE(AFP3x, 1)
+               AC_MSG_RESULT([enabling AFP 3.x calls])
+       fi
+)
+
+if test "$afp3" = "yes"; then
+        AC_SYS_LARGEFILE
+fi
+
 
 dnl ----------- A NOTE ABOUT DROPKLUDGE
 dnl The trouble with this fix is that if you know what the file is called, it
@@ -219,77 +224,95 @@ AC_ARG_ENABLE(force-uidgid,
        fi
 )
 
-dnl Don't use DB3 unless it's needed
-db3_required=no
-
+dnl Don't use BDB unless it's needed
+bdb_required=no
 
 dnl Determine DID scheme
 AC_MSG_CHECKING([for DID scheme to use])
 AC_ARG_WITH(did,
-       [  --with-did=SCHEME       set DID scheme (last,hash,mtab,cnid)],
+       [  --with-did=SCHEME       set DID scheme (cnid,last)],
        [ did_scheme="$withval" ],
-       [ did_scheme="last" ]
+       [ did_scheme="cnid" ]
 )
 
 if test "x$did_scheme" = "xlast"; then
        AC_DEFINE(USE_LASTDID, 1)
        AC_MSG_RESULT([last])
-elif test "x$did_scheme" = "xhash"; then
-       AC_MSG_RESULT([device/inode-based hashing])
-elif test "x$did_scheme" = "xmtab"; then
-       AC_DEFINE(DID_MTAB, 1)
-       AC_MSG_RESULT([mtab-based DID creation support])
 elif test "x$did_scheme" = "xcnid"; then
-       db3_required="yes"
+       bdb_required="yes"
        AC_DEFINE(CNID_DB, 1)
        AC_MSG_RESULT([enabling build with CNID DB support])
 else
        AC_MSG_ERROR([unknown DID scheme])
 fi
+AM_CONDITIONAL(COMPILE_CNID, test "x$did_scheme" = "xcnid")
 
-dnl Check for Berkeley DB3 library
-if test "x$db3_required" = "xyes"; then
-       AC_PATH_DB3(, [AC_MSG_ERROR([Berkeley DB3 library not found!])])
-fi
-
-dnl Check for quota support
-AC_CHECK_QUOTA
-
-msg_dir=""
-AC_ARG_WITH(message-dir,
-       [  --with-message-dir=PATH path to message files [[PKGCONF/msg]]],
-               msg_dir="$withval"
-               if test x"$msg_dir" = "x"; then
-                       msg_dir="${PKGCONFDIR}/msg"
+dnl Determine whether or not to use filename mangling
+AC_MSG_CHECKING([whether or not to use filename mangling])
+AC_ARG_WITH(mangling,
+       [  --with-mangling         enable filename mangling],
+       [
+               if test "x$withval" = "xyes"; then
+                       if test "x$did_scheme" != "xcnid"; then
+                               AC_MSG_ERROR([DID scheme must be CNID to use filename mangling])
+                       else
+                               AC_DEFINE(FILE_MANGLING, 1)
+                               AC_MSG_RESULT([yes])
+                       fi
+               else
+                       AC_MSG_RESULT([no])
                fi
-               AC_DEFINE_UNQUOTED(SERVERTEXT, "$msg_dir",
-                       [path to message dir [[PKGCONF/msg]]])
-               SERVERTEXT="$msg_dir"
-               AC_SUBST(SERVERTEXT)
+       ], [
+               if test "x$did_scheme" = "xcnid"; then
+                       AC_DEFINE(FILE_MANGLING, 1)
+                       AC_MSG_RESULT([yes])
+               else
+                       AC_MSG_RESULT([no])
+               fi
+       ]
 )
 
-AC_ARG_ENABLE(srvloc,
-       [  --enable-srvloc         turn on Server Location Protocol support (EXPERIMENTAL)],
-       srvloc=$enableval,
-       srvloc=no
+if test "$did_scheme" = "cnid"; then
+    USE_CDB="yes"
+else
+    USE_CDB="no"
+fi
+
+dnl Determine whether or not to use CDB or transactional DB store
+AC_MSG_CHECKING([whether or not to use CNID with Concurrent Data Store])
+AC_ARG_WITH(cdb,
+       [  --with-cdb              enable CNID with Concurrent Data Store],
+       if test "$withval" = "no"; then
+           if test "x$did_scheme" != "xcnid"; then
+               USE_CDB="no"
+               AC_MSG_ERROR([DID scheme must be CNID to use CDB])
+           else
+               USE_CDB="no"
+               AC_MSG_RESULT([no])
+           fi
+       else
+           USE_CDB="yes"
+           AC_MSG_RESULT([yes])
+       fi
+       , AC_MSG_RESULT([yes])
 )
 
-dnl Conditional for optional server location protocol support (used by OS X)
-AM_CONDITIONAL(USE_SRVLOC, test "x$srvloc" != "xno")
-if test "x$srvloc" != "xno"; then
-    for slpdir in "" $srvloc /usr /usr/local ; do
-               if test -f "$slpdir/include/slp.h" ; then
-                       LIBS="$LIBS -L$slpdir/lib -lslp"
-                       CFLAGS="$CFLAGS -I$slpdir/include"
-               AC_CHECK_LIB(slp,SLPOpen)
-               AC_CHECK_FUNCS(SLPReg SLPDereg SLPClose)
-               AC_DEFINE(USE_SRVLOC, 1)
-                       break
-               fi
-       done
+if test "$USE_CDB" = "yes"; then
+    AC_DEFINE(CNID_DB_CDB, 1)
 fi
 
-# Check for PAM libs
+dnl Check for Berkeley DB library
+if test "x$bdb_required" = "xyes"; then
+       AC_PATH_BDB(, [AC_MSG_ERROR([Berkeley DB library not found!])])
+fi
+
+dnl Check for quota support
+AC_CHECK_QUOTA
+
+dnl Check for optional server location protocol support (used by MacOS X)
+NETATALK_SRVLOC
+
+dnl Check for PAM libs
 AC_PATH_PAM([
        PAPD_LIBS="$PAPD_LIBS $PAM_LIBS"
        AFPD_LIBS="$AFPD_LIBS $PAM_LIBS"
@@ -317,17 +340,6 @@ AC_ARG_ENABLE(shell-check,
        fi
 )
 
-AC_MSG_CHECKING([whether flock locks should be enabled])
-AC_ARG_WITH(flock-locks,
-       [  --with-flock-locks      enable flock locks support],
-       [flock_locks="$withval"],
-       [flock_locks="no"]
-)
-if test "x$flock_locks" = "xyes"; then
-       AC_DEFINE(USE_FLOCK_LOCKS)
-fi
-AC_MSG_RESULT([$flock_locks])
-
 AC_ARG_WITH(tcp-wrappers,
        [  --with-tcp-wrappers     enable TCP wrappers support],
        AC_CHECK_LIB(wrap, tcpd_warn,
@@ -361,6 +373,14 @@ AC_ARG_ENABLE(cobalt,
        AC_MSG_RESULT([enabling cobalt-style sysv support])
 )
 
+AC_ARG_ENABLE(netbsd,
+       [  --enable-netbsd         use NetBSD-style rc.d configuration ],
+       if test "x$enableval" = "xyes"; then
+               sysv_style=netbsd
+       fi
+       AC_MSG_RESULT([enabling NetBSD-style rc.d support])
+)
+
 dnl ----- timelord compilation (disabled by default)
 AC_MSG_CHECKING([whether timelord should be compiled])
 compile_timelord=no
@@ -388,7 +408,7 @@ AC_ARG_ENABLE(fhs,
                sysconfdir="/etc"
                PKGCONFDIR=${sysconfdir}/netatalk
                use_pam_so=yes
-               dnl FIXME: NEED TO HAVE --mandir=/usr/share/man AT SOME POINT...
+               mandir="/usr/share/man"
                AC_DEFINE(FHS_COMPATIBILITY)
        fi
        AC_MSG_RESULT([enabling Filesystem Hierarchy Standard (FHS) compatibility])
@@ -532,7 +552,12 @@ dnl ----- NetBSD specific -----
 if test x"$this_os" = "xnetbsd"; then 
        AC_MSG_RESULT([ * NetBSD specific configuration])
        AC_DEFINE(BSD4_4)
-       AC_DEFINE(DLSYM_PREPEND_UNDERSCORE)
+       if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+               # NetBSD ELF machines don't have to have DLSYM_PREPEND_UNDERSCORE.
+               # If this test is true, it's not an ELF box.
+               # This REALLY should be a configure test.
+               AC_DEFINE(DLSYM_PREPEND_UNDERSCORE)
+       fi
        CFLAGS="-I\$(top_srcdir)/sys/netbsd -I/usr/include/kerberosIV $CFLAGS"
        need_dash_r=yes 
 
@@ -623,7 +648,6 @@ AC_SUBST(LIBS)
 AC_SUBST(AFPD_LIBS)
 AC_SUBST(PAPD_LIBS)
 AC_SUBST(CFLAGS)
-AC_SUBST(PKGCONFDIR)
 AC_SUBST(OVERWRITE_CONFIG)
 
 AM_CONDITIONAL(SOLARIS_MODULE, test x$solaris_module = xyes)
@@ -635,6 +659,7 @@ AM_CONDITIONAL(USE_PAM, test x$compile_pam = xyes)
 AM_CONDITIONAL(BUILD_PAM, test x$compile_pam = xyes)
 AM_CONDITIONAL(USE_PGP, test x$compile_pgp = xyes)
 AM_CONDITIONAL(USE_COBALT, test x$sysv_style = xcobalt)
+AM_CONDITIONAL(USE_NETBSD, test x$sysv_style = xnetbsd)
 AM_CONDITIONAL(USE_REDHAT, test x$sysv_style = xredhat)
 AM_CONDITIONAL(USE_SUSE, test x$sysv_style = xsuse)
 AM_CONDITIONAL(USE_SHADOWPW, test x$shadowpw = xyes)
@@ -648,6 +673,8 @@ AC_OUTPUT([Makefile
        bin/aecho/Makefile
        bin/afile/Makefile
        bin/afppasswd/Makefile
+       bin/cnid/Makefile
+       bin/cnid/cnid_maint
        bin/getzones/Makefile
        bin/megatron/Makefile
        bin/nbp/Makefile
@@ -656,9 +683,17 @@ AC_OUTPUT([Makefile
        config/Makefile
        contrib/Makefile
        contrib/macusers/Makefile
+       contrib/macusers/macusers
        contrib/nu/Makefile
+       contrib/nu/nu
        contrib/printing/Makefile
        contrib/shell_utils/Makefile
+       contrib/shell_utils/afpd-mtab.pl
+       contrib/shell_utils/apple_cp
+       contrib/shell_utils/apple_mv
+       contrib/shell_utils/apple_rm
+       contrib/shell_utils/cleanappledouble.pl
+       contrib/shell_utils/netatalkshorternamelinks.pl
        contrib/timelord/Makefile
        distrib/Makefile
        distrib/config/Makefile
@@ -700,6 +735,7 @@ AC_OUTPUT([Makefile
        sys/netbsd/Makefile
        sys/netbsd/netatalk/Makefile
        sys/solaris/Makefile
+       sys/solaris/Makefile.kernel
        sys/sunos/Makefile
        sys/ultrix/Makefile
        ],