]> arthur.barton.de Git - netatalk.git/blobdiff - configure.in
Removed AFILE_VERSION and ACHFILE_VERSION constants.
[netatalk.git] / configure.in
index 4889aa00c9943ad75b541c1eab74728e9961f47c..d529b0e5cff0af69ac37370d3afe0250e8c2f2a0 100644 (file)
@@ -1,4 +1,4 @@
-dnl $Id: configure.in,v 1.96 2001-08-14 14:00:08 rufustfirefly Exp $
+dnl $Id: configure.in,v 1.101 2001-09-04 13:55:00 rufustfirefly Exp $
 dnl configure.in for netatalk
 
 AC_INIT(bin/adv1tov2/adv1tov2.c)
@@ -42,8 +42,6 @@ dnl Replace `main' with a function in -lcrypt:
 AC_CHECK_LIB(crypt, main)
 dnl Replace `main' with a function in -ld:
 AC_CHECK_LIB(d, main)
-dnl Replace `main' with a function in -ldb:
-AC_CHECK_LIB(db, main)
 dnl Replace `main' with a function in -ldl:
 AC_CHECK_LIB(dl, main)
 dnl Replace `main' with a function in -lkauth:
@@ -237,14 +235,61 @@ AC_ARG_ENABLE(force-uidgid,
        fi
 )
 
+dnl Don't use DB3 unless it's needed
+db3_required=no
+
+dnl Check for CNID DB support
 AC_ARG_ENABLE(cnid-db,
        [  --enable-cnid-db   use persistent cnid database per volume (EXPERIMENTAL) ],
-       if test "$enableval" = "yes"; then
-               AC_DEFINE(CNID_DB, 1)
-               AC_MSG_RESULT([using persistent cnid database per volume])
+       if test "x$enableval" = "xyes"; then
+               dnl Now we need DB3
+               db3_required="yes"
+
+               dnl Note that we don't AC_DEFINE(CNID_DB, 1) here...
+               dnl we have to check for the library first.
+               dnl AC_MSG_RESULT([db3 check enabled])
+       fi
+)
+
+dnl Check for Berkeley DB3 library
+AC_ARG_WITH(db3,
+       [  --with-db3=PATH         specify path to Berkeley DB3 installation],
+       if test "x$withval" != "xno"; then
+               trydb3dir="$withval"
        fi
 )
 
+db3_found=no
+for db3dir in "" $trydb3dir /usr /usr /usr/local ; do
+       if test -f "$db3dir/include/db3/db.h" ; then
+               LDFLAGS="$LDFLAGS -L$db3dir/lib -ldb3"
+               CFLAGS="$CFLAGS -I$db3dir/include/db3"
+
+               dnl If we require DB3, die if we don't have it
+               if test "x$db3_required" != "xno"; then
+                       AC_CHECK_LIB(db, main,
+                               dnl AC_MSG_RESULT([enabling db3 support])
+                               db3_found=yes
+                               dnl -- also enable CNID DB when this is found
+                               AC_DEFINE(CNID_DB, 1)
+                               AC_MSG_RESULT([using persistent cnid database per volume])
+                               LIBS="$LIBS -ldb",
+                               dnl Not Found
+                               AC_MSG_ERROR([Berkeley DB3 library not found!])
+                       )
+               fi
+               break
+       fi
+done
+
+dnl Die if the library is required, but not found
+if test "x$db3_required" != "xno"; then
+       if test "x$db3_found" = "xno"; then
+               dnl Not Found
+               AC_MSG_ERROR([Berkeley DB3 library not found!])
+       fi
+fi
+
 AC_ARG_WITH(did,
        [  --with-did=[scheme]     set DID scheme (last,mtab)],
        if test "x$withval" != "xno" ; then
@@ -587,40 +632,45 @@ if test x"$this_os" = "xtru64"; then
        LDSHAREDFLAGS="-shared"
 fi
 
-dnl -- look for openssl  
+dnl -- look for openssl
+tryssl=yes
 AC_ARG_WITH(ssl-dir,
        [  --with-ssl-dir=PATH     specify path to openssl installation (must contain
                           lib and include dirs) ],
        [
                if test "x$withval" != "xno"; then
                        tryssldir=$withval
+               else
+                       tryssl=no
                fi
        ]
 )
 
-for ssldir in "" $tryssldir /usr /usr/local/openssl /usr/lib/openssl/ /usr/local/ssl /usr/lib/ssl /usr/local /usr/pkg /opt /opt/openssl /usr/local/ssl ; do
-       if test -f "$ssldir/include/openssl/cast.h" ; then
-               LDFLAGS="$LDFLAGS -L$ssldir/lib -L$ssldir"
-               CFLAGS="$CFLAGS -I$ssldir/include -I$ssldir/include/openssl"
-               if test "$need_dash_r" = "yes"; then
-                       LIBS="$LIBS -R$ssldir/lib -R$ssldir"
-               fi
+if test "$tryssl" = "yes"; then
+       for ssldir in "" $tryssldir /usr /usr/local/openssl /usr/lib/openssl/ /usr/local/ssl /usr/lib/ssl /usr/local /usr/pkg /opt /opt/openssl /usr/local/ssl ; do
+               if test -f "$ssldir/include/openssl/cast.h" ; then
+                       LDFLAGS="$LDFLAGS -L$ssldir/lib -L$ssldir"
+                       CFLAGS="$CFLAGS -I$ssldir/include -I$ssldir/include/openssl"
+                       if test "$need_dash_r" = "yes"; then
+                               LIBS="$LIBS -R$ssldir/lib -R$ssldir"
+                       fi
 
-               dnl Check for the crypto library:
-               AC_CHECK_LIB(crypto, main)
-               dnl LIBS="$LIBS -lcrypto"
-               dnl Check for "DES" library (for SSLeay, not openssl):
-               AC_CHECK_LIB(des, main)
-
-               AC_DEFINE(OPENSSL_DHX,  1)
-               AC_DEFINE(UAM_DHX,      1)
-               AC_DEFINE(UAM_RNDNUM,   1)
-               compile_dhx=yes
-               compile_ssl=yes
-               AC_MSG_RESULT([Found ssl and enabling RANDNUM and DHX support "$ssldir"])
-               break
-       fi
-done
+                       dnl Check for the crypto library:
+                       AC_CHECK_LIB(crypto, main)
+                       dnl LIBS="$LIBS -lcrypto"
+                       dnl Check for "DES" library (for SSLeay, not openssl):
+                       AC_CHECK_LIB(des, main)
+
+                       AC_DEFINE(OPENSSL_DHX,  1)
+                       AC_DEFINE(UAM_DHX,      1)
+                       AC_DEFINE(UAM_RNDNUM,   1)
+                       compile_dhx=yes
+                       compile_ssl=yes
+                       AC_MSG_RESULT([Found ssl and enabling RANDNUM and DHX support "$ssldir"])
+                       break
+               fi
+       done
+fi
 
 dnl --------------------- check for building PGP UAM module
 
@@ -645,17 +695,38 @@ AC_ARG_ENABLE(krb4-uam,
                AC_MSG_RESULT([enabling build with Kerberos v4 UAM module])
        fi
 )
+dnl --------------------- overwrite the config files . . . or not.
+
+files="AppleVolumes.default AppleVolumes.system atalkd.conf netatalk.conf netatalk.pamd papd.conf afpd.conf"
+
+AC_ARG_ENABLE(overwrite,
+       [  --enable-overwrite      Overwrite configuration files
+                                  default=PKGCONFDIR],
+       [ 
+       OVERWRITE="$files"
+       AC_MSG_RESULT([Overwrite configuration files])
+       ],
+       
+       [       
+       for f in $files ; do
+               if test -f "${PKGCONFDIR}/$f" ; 
+               then :;
+               else OVERWRITE="${OVERWRITE} $f";
+               fi
+       done
+       AC_MSG_RESULT([Don't overwrite existing configuration files])
+       ]       
+)
 
 dnl --------------------- last minute substitutions
 
 AC_SUBST(LIBS)
 AC_SUBST(AFPD_LIBS)
 AC_SUBST(PAPD_LIBS)
-
 AC_SUBST(CFLAGS)
 AC_SUBST(LDSHAREDFLAGS)
-
 AC_SUBST(PKGCONFDIR)
+AC_SUBST(OVERWRITE)
 
 AM_CONDITIONAL(SOLARIS_MODULE, test x$solaris_module = xyes)
 AM_CONDITIONAL(COMPILE_TIMELORD, test x$compile_timelord = xyes)