]> git.sur5r.net Git - openldap/blobdiff - configure.in
Avoid premature free
[openldap] / configure.in
index baba326141fe068aba4839dc503c8ad230e50c62..6450b130a31074e2d8ef68310a9d00ed2159e056 100644 (file)
@@ -33,14 +33,14 @@ dnl ================================================================
 dnl Configure.in for OpenLDAP
 AC_INIT(build/version)dnl
 
-# set unset (borrowed from autoconf 2.14a)
-if (unset FOO) >/dev/null 2>&1; then
+# set unset (borrowed from autoconf 2.49c)
+if (OL_FOO=OL_FOO; unset OL_FOO) >/dev/null 2>&1; then
   ol_unset=unset
 else
   ol_unset=false
 fi
 # unset CDPATH
-$ol_unset CDPATH || test "${CDPATH+set}" != set || CDPATH=: && export CDPATH
+$ol_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
 
 AC_CONFIG_AUX_DIR(build)dnl
 
@@ -56,8 +56,8 @@ dnl           we try not to use this for much
 AC_CANONICAL_SYSTEM
 
 AM_INIT_AUTOMAKE(OpenLDAP,[$OL_VERSION], [no defines])dnl
-AC_SUBST(PACKAGE)
-AC_SUBST(VERSION)
+AC_SUBST(PACKAGE)dnl
+AC_SUBST(VERSION)dnl
 AC_DEFINE_UNQUOTED(OPENLDAP_PACKAGE,"$PACKAGE",Package)
 AC_DEFINE_UNQUOTED(OPENLDAP_VERSION,"$VERSION",Version)
 
@@ -105,7 +105,7 @@ OL_ARG_ENABLE(syslog,[  --enable-syslog       enable syslog support], auto)dnl
 OL_ARG_ENABLE(proctitle,[  --enable-proctitle    enable proctitle support], yes)dnl
 OL_ARG_ENABLE(cache,[  --enable-cache    enable caching], yes)dnl
 OL_ARG_ENABLE(referrals,[  --enable-referrals    enable V2 Referrals extension], yes)dnl
-OL_ARG_ENABLE(kbind,[  --enable-kbind    enable V2 Kerberos IV bind], auto)dnl
+OL_ARG_ENABLE(kbind,[  --enable-kbind    enable V2 Kerberos IV bind], no)dnl
 OL_ARG_ENABLE(ipv6,[  --enable-ipv6      enable IPv6 support], auto)dnl
 OL_ARG_ENABLE(local,[  --enable-local    enable AF_LOCAL (AF_UNIX) socket support], auto)dnl
 OL_ARG_ENABLE(x_compile,[  --enable-x-compile    enable cross compiling],
@@ -143,9 +143,9 @@ OL_ARG_ENABLE(crypt,[    --enable-crypt       enable crypt(3) passwords], auto)dnl
 OL_ARG_ENABLE(kpasswd,[    --enable-kpasswd      enable kerberos password verification], no)dnl
 OL_ARG_ENABLE(spasswd,[    --enable-spasswd      enable (Cyrus) SASL password verification], no)dnl
 OL_ARG_ENABLE(modules,[    --enable-modules      enable dynamic module support], no)dnl
-OL_ARG_ENABLE(multimaster,[    --enable-multimaster  enable multimaster replication], no)dnl
+dnl OL_ARG_ENABLE(multimaster,[    --enable-multimaster  enable multimaster replication], no)dnl
 OL_ARG_ENABLE(phonetic,[    --enable-phonetic    enable phonetic/soundex], no)dnl
-OL_ARG_ENABLE(rlookups,[    --enable-rlookups    enable reverse lookups], auto)dnl
+OL_ARG_ENABLE(rlookups,[    --enable-rlookups    enable reverse lookups], no)dnl
 OL_ARG_ENABLE(aci,[    --enable-aci      enable per-object ACIs], no)dnl
 OL_ARG_ENABLE(wrappers,[    --enable-wrappers    enable tcp wrapper support], no)dnl
 OL_ARG_ENABLE(dynamic,[    --enable-dynamic      enable linking built binaries with dynamic libs], no)dnl
@@ -215,6 +215,9 @@ if test $ol_enable_slapd = no ; then
        if test $ol_enable_multimaster = yes ; then
                AC_MSG_WARN([slapd disabled, ignoring --enable-multimaster argument])
        fi
+dnl    if test $ol_enable_multimaster = yes ; then
+dnl            AC_MSG_WARN([slapd disabled, ignoring --enable-multimaster argument])
+dnl    fi
        if test $ol_enable_wrappers = yes ; then
                AC_MSG_WARN([slapd disabled, ignoring --enable-wrappers argument])
        fi
@@ -264,7 +267,7 @@ if test $ol_enable_slapd = no ; then
        ol_enable_sql=no
 
        ol_enable_modules=no
-       ol_enable_multimaster=no
+dnl    ol_enable_multimaster=no
        ol_enable_phonetic=no
        ol_enable_rlookups=no
        ol_enable_aci=no
@@ -338,19 +341,19 @@ if test $ol_enable_kbind = yes -o $ol_enable_kpasswd = yes ; then
        if test $ol_with_kerberos = no ; then
                AC_MSG_ERROR([options require --with-kerberos])
        fi
+       ol_with_kerberos=yes
 elif test $ol_enable_kbind = no -o $ol_enable_kpasswd = no ; then
-       if test $ol_with_kerberos != auto ; then
+       if test $ol_with_kerberos != no -a $ol_with_kerberos != auto ; then
                AC_MSG_WARN([Kerberos detection enabled unnecessarily]);
-       else
-               ol_with_kerberos=no
        fi
+       ol_with_kerberos=no
 fi
 
 if test $ol_enable_spasswd = yes ; then
        if test $ol_with_cyrus_sasl = no ; then
                AC_MSG_ERROR([options require --with-cyrus-sasl])
        fi
-       ol_link_spasswd=yes
+       ol_with_cyrus_sasl=yes
 fi
 
 AC_MSG_RESULT(done)
@@ -538,28 +541,6 @@ AC_CHECK_LIB(s, afopen, [
 ])
 
 
-dnl ----------------------------------------------------------------
-dnl PF_INET6 support requires getaddrinfo
-dnl PF_LOCAL may use getaddrinfo in available
-AC_CHECK_FUNCS( getaddrinfo )
-
-if test $ac_cv_func_getaddrinfo = no ; then
-       if test $ol_enable_ipv6 = yes ; then
-               AC_MSG_ERROR([IPv6 support requires getaddrinfo()])
-       fi
-       ol_enable_ipv6=no
-fi
-
-if test $ol_enable_local != no ; then
-       AC_CHECK_HEADERS( sys/un.h )
-
-       if test $ol_enable_local = auto ; then
-               ol_enable_local=$ac_cv_header_sys_un_h
-       elif test $ac_cv_header_sys_un_h = no ; then
-               AC_MSG_ERROR([AF_LOCAL domain support requires sys/un.h])
-       fi
-fi
-
 dnl ----------------------------------------------------------------
 dnl Check for module support
 ol_link_modules=no
@@ -749,6 +730,44 @@ if test "$ol_enable_dnssrv" = yes -a "$ol_link_dnssrv" = no ; then
        AC_MSG_ERROR([DNSSRV requires res_query()])
 fi
 
+dnl ----------------------------------------------------------------
+dnl PF_INET6 support requires getaddrinfo and INET6_ADDRSTRLEN
+dnl PF_LOCAL may use getaddrinfo in available
+AC_CHECK_FUNCS( getaddrinfo )
+
+ol_link_ipv6=no
+if test $ac_cv_func_getaddrinfo = no ; then
+       if test $ol_enable_ipv6 = yes ; then
+               AC_MSG_ERROR([IPv6 support requires getaddrinfo()])
+       fi
+else
+       AC_CHECK_FUNCS( gai_strerror )
+
+       AC_CACHE_CHECK([INET6_ADDRSTRLEN],[ol_cv_inet6_addrstrlen],[
+               AC_EGREP_CPP(__has_inet6_addrstrlen__,[
+#                      include <netinet/in.h>
+#                      ifdef INET6_ADDRSTRLEN
+                               __has_inet6_addrstrlen__;
+#                      endif
+               ], [ol_cv_inet6_addrstrlen=yes], [ol_cv_inet6_addrstrlen=no])])
+
+       if test $ol_cv_inet6_addrstrlen = yes ; then
+               ol_link_ipv6=yes
+       elif test $ol_enable_ipv6 = yes ; then
+               AC_MSG_ERROR([IPv6 support requires INET6_ADDRSTRLEN])
+       fi
+fi
+
+if test $ol_enable_local != no ; then
+       AC_CHECK_HEADERS( sys/un.h )
+
+       if test $ol_enable_local = auto ; then
+               ol_enable_local=$ac_cv_header_sys_un_h
+       elif test $ac_cv_header_sys_un_h = no ; then
+               AC_MSG_ERROR([AF_LOCAL domain support requires sys/un.h])
+       fi
+fi
+
 dnl ----------------------------------------------------------------
 dnl Kerberos
 ol_link_kbind=no
@@ -756,8 +775,9 @@ ol_link_kpasswd=no
 ol_link_krb5=no
 ol_link_krb4=no
 
-if test $ol_with_kerberos = auto -o $ol_with_kerberos = k5 \
-       -o $ol_with_kerberos = k5only -o $ol_with_kerberos = k425 ; then
+if test $ol_with_kerberos = yes -o $ol_with_kerberos = auto \
+       -o $ol_with_kerberos = k5 -o $ol_with_kerberos = k5only \
+       -o $ol_with_kerberos = k425 ; then
 
        AC_CHECK_HEADERS(krb5.h)
 
@@ -812,8 +832,8 @@ if test $ol_with_kerberos = auto -o $ol_with_kerberos = k5 \
        fi
 fi
 
-if test $ol_link_krb5 = yes -a \
-       \( $ol_with_kerberos = auto -o $ol_with_kerberos = k425 \) ; then
+if test $ol_link_krb5 = yes -a \( $ol_with_kerberos = yes -o \
+       $ol_with_kerberos = auto -o $ol_with_kerberos = k425 \) ; then
 
        AC_CHECK_HEADERS(kerberosIV/krb.h kerberosIV/des.h)
 
@@ -872,8 +892,8 @@ if test $ol_link_krb5 = yes ; then
        ol_with_kerberos=found
 fi
 
-if test $ol_with_kerberos = auto -o $ol_with_kerberos = k4 \
-       -o $ol_with_kerberos = kth ; then
+if test $ol_with_kerberos = yes -o $ol_with_kerberos = auto \
+       -o $ol_with_kerberos = k4 -o $ol_with_kerberos = kth ; then
 
        AC_CHECK_HEADERS(krb.h des.h krb-archaeology.h )
 
@@ -898,14 +918,21 @@ if test $ol_with_kerberos = auto -o $ol_with_kerberos = k4 \
 fi
 
 if test $ol_link_krb4 = yes -a $ol_enable_kpasswd != no ; then
-       ol_link_kpasswd=yes;
+       ol_link_kpasswd=yes
+fi
+
+if test $ol_link_krb4 = yes -a $ol_enable_kbind != no ; then
+       ol_link_kbind=yes
+
+elif test $ol_enable_kbind = yes ; then
+       AC_MSG_ERROR([Kerberos IV detection failed])
 fi
 
 if test $ol_link_krb4 = yes -o $ol_link_krb5 = yes ; then
        AC_DEFINE(HAVE_KERBEROS, 1, [define if you have Kerberos])
 
 elif test $ol_with_kerberos != auto -a $ol_with_kerberos != no ; then
-       AC_MSG_ERROR([Kerberos detection failed.])
+       AC_MSG_ERROR([Kerberos detection failed])
 fi
 
 dnl ----------------------------------------------------------------
@@ -1786,7 +1813,11 @@ if test $ol_with_cyrus_sasl != no ; then
                                AC_MSG_WARN([Strong authentication not supported!])
                        fi
                fi
+
+       elif test $ol_enable_spasswd != no ; then
+               ol_link_spasswd=yes
        fi
+
 else
        AC_MSG_WARN([SASL authentication not supported!])
        if test $ol_link_tls = no ; then
@@ -2075,7 +2106,7 @@ fi
 if test "$ol_enable_local" != no; then
        AC_DEFINE(LDAP_PF_LOCAL,1,[define to support PF_LOCAL])
 fi
-if test "$ol_enable_ipv6" != no; then
+if test "$ol_link_ipv6" != no; then
        AC_DEFINE(LDAP_PF_INET6,1,[define to support PF_INET6])
 fi
 if test "$ol_enable_cleartext" != no ; then
@@ -2090,9 +2121,9 @@ fi
 if test "$ol_link_spasswd" != no ; then
        AC_DEFINE(SLAPD_SPASSWD,1,[define to support SASL passwords])
 fi
-if test "$ol_enable_multimaster" != no ; then
-       AC_DEFINE(SLAPD_MULTIMASTER,1,[define to support multimaster replication])
-fi
+dnl if test "$ol_enable_multimaster" != no ; then
+dnl    AC_DEFINE(SLAPD_MULTIMASTER,1,[define to support multimaster replication])
+dnl fi
 if test "$ol_enable_phonetic" != no ; then
        AC_DEFINE(SLAPD_PHONETIC,1,[define to support phonetic])
 fi
@@ -2305,7 +2336,6 @@ tests/Makefile:build/top.mk:tests/Makefile.in:build/dir.mk \
 tests/progs/Makefile:build/top.mk:tests/progs/Makefile.in:build/rules.mk \
 contrib/Makefile:build/top.mk:contrib/Makefile.in:build/dir.mk \
 contrib/saucer/Makefile:build/top.mk:contrib/saucer/Makefile.in:build/rules.mk \
-contrib/web_ldap/Makefile:build/top.mk:contrib/web_ldap/Makefile.in:build/rules.mk \
 ,[
 date > stamp-h
 echo Please \"make depend\" to build dependencies