]> git.sur5r.net Git - openldap/blobdiff - configure.in
minimal copyright year update
[openldap] / configure.in
index 37d5a292af6fd39123280b78821b60653a5d1003..c19d09c24d3c2bf20eeb4dbdada891b96032ce88 100644 (file)
@@ -1,6 +1,6 @@
 dnl $OpenLDAP$
 dnl
-dnl Copyright 1998-2002 The OpenLDAP Foundation.  All Rights Reserved.
+dnl Copyright 1998-2003 The OpenLDAP Foundation.  All Rights Reserved.
 dnl 
 dnl Redistribution and use in source and binary forms, with or without
 dnl modification, are permitted only as authorized by the OpenLDAP
@@ -16,7 +16,7 @@ define([AC_INIT_BINSH],
 # $]OpenLDAP[$
 # from] translit([$OpenLDAP$], $")] [
 
-# Copyright 1998-2002 The OpenLDAP Foundation.  All Rights Reserved.
+# Copyright 1998-2003 The OpenLDAP Foundation.  All Rights Reserved.
 # 
 # Redistribution and use in source and binary forms, with or without
 # modification, are permitted only as authorized by the OpenLDAP
@@ -24,7 +24,7 @@ define([AC_INIT_BINSH],
 # http://www.OpenLDAP.org/license.html or in file LICENSE in the
 # top-level directory of the distribution.
 
-echo "Copyright 1998-2002 The OpenLDAP Foundation,  All Rights Reserved."
+echo "Copyright 1998-2003 The OpenLDAP Foundation,  All Rights Reserved."
 echo " Restrictions apply, see COPYRIGHT and LICENSE files."
 ])dnl
 dnl ----------------------------------------------------------------
@@ -60,10 +60,10 @@ fi
 SHTOOL="$ac_cv_shtool"
 dnl AC_SUBST(SHTOOL)dnl
 
-TB=`$SHTOOL echo -e %B`
-TN=`$SHTOOL echo -e %b`
+TB="`$SHTOOL echo -e '%B' 2>/dev/null`"
+TN="`$SHTOOL echo -e '%b' 2>/dev/null`"
 
-echo "Configuring $TB$OL_STRING$TN ..."
+echo "Configuring ${TB}${OL_STRING}${TN} ..."
 
 dnl Determine host platform
 dnl            we try not to use this for much
@@ -217,8 +217,7 @@ OL_ARG_ENABLE(shell,[    --enable-shell       enable shell backend], no)dnl
 OL_ARG_WITH(shell_module,[    --with-shell-module        module type static|dynamic], static,
        [static dynamic])
 OL_ARG_ENABLE(sql,[    --enable-sql      enable sql backend], no)dnl
-OL_ARG_WITH(sql_module,[    --with-sql-module    module type static|dynamic], static,
-       [static dynamic])
+OL_ARG_WITH(sql_module,[    --with-sql-module    module type static|dynamic], static, [static dynamic])
 
 dnl ----------------------------------------------------------------
 dnl SLURPD OPTIONS
@@ -492,7 +491,6 @@ dnl ----------------------------------------------------------------
 dnl Initialize vars
 LDAP_LIBS=
 LDIF_LIBS=
-LDBM_LIB=
 LDBM_LIBS=
 LTHREAD_LIBS=
 LUTIL_LIBS=
@@ -608,18 +606,18 @@ if test $ol_aix_threads = yes ; then
 fi
 
 if test -z "${CC}"; then
-       AC_CHECK_PROGS(CC,cc)
-fi
+       AC_CHECK_PROGS(CC,cc gcc,missing)
 
-dnl The default CFLAGS is empty NOT whatever AC_PROG_CC sets.
-dnl (for now, let autoconf sort this out)
-dnl CFLAGS=${CFLAGS-""}
+       if test "${CC}" = "missing" ; then
+               AC_MSG_ERROR([Unable to locate cc(1) or suitable replacement.  Check PATH or set CC.])
+       fi
+fi
 
 if test -z "${AR}"; then
        AC_CHECK_PROGS(AR,ar gar,missing)
 
        if test "${AR}" = "missing" ; then
-               AC_MSG_ERROR([Unable to locate ar(1).  Check PATH or set AR.])
+               AC_MSG_ERROR([Unable to locate ar(1) or suitable replacement.  Check PATH or set AR.])
        fi
 fi
 
@@ -687,7 +685,7 @@ AC_MINGW32
 AC_EXEEXT
 AC_OBJEXT
 
-AC_DEFINE_UNQUOTED( EXEEXT, "${EXEEXT}", [defined to be the EXE extension])
+AC_DEFINE_UNQUOTED(EXEEXT, "${EXEEXT}", [defined to be the EXE extension])
 
 dnl ----------------------------------------------------------------
 dnl BeOS requires -lbe -lroot -lnet
@@ -715,6 +713,14 @@ AC_CHECK_LIB(s, afopen, [
        AC_DEFINE(HAVE_AIX_SECURITY,1,[define if you have AIX security lib])
 ])
 
+dnl ----------------------------------------------------------------
+dnl Check for IBM OS/390
+case "$target" in
+*-ibm-openedition)
+       ac_cv_func_getopt=no
+       AC_DEFINE(BOTH_STRINGS_H,1,[define to use both <string.h> and <strings.h>])
+       ;;
+esac
 
 dnl ----------------------------------------------------------------
 dnl Check for module support
@@ -1005,10 +1011,25 @@ elif test $ol_enable_ipv6 != no ; then
 #                      endif
                ], [ol_cv_inet6_addrstrlen=yes], [ol_cv_inet6_addrstrlen=no])])
 
-       if test $ol_cv_inet6_addrstrlen = yes ; then
+
+       AC_CACHE_CHECK([struct sockaddr_storage],ol_cv_struct_sockaddr_storage,[
+               AC_TRY_COMPILE([
+#include <sys/types.h>
+#include <sys/socket.h>
+],[
+                       struct sockaddr_storage ss;
+],                     [ol_cv_struct_sockaddr_storage=yes],
+                       [ol_cv_struct_sockaddr_storage=no])])
+
+       if test $ol_cv_inet6_addrstrlen = yes \
+               -a $ol_cv_struct_sockaddr_storage = yes ; then
                ol_link_ipv6=yes
-       elif test $ol_enable_ipv6 = yes ; then
+       elif test $ol_enable_ipv6 = yes \
+                       -a $ol_cv_inet6_addrstrlen = no ; then
                AC_MSG_ERROR([IPv6 support requires INET6_ADDRSTRLEN])
+       elif test $ol_enable_ipv6 = yes \
+                       -a $ol_cv_struct_sockaddr_storage = no ; then
+               AC_MSG_ERROR([IPv6 support requires struct sockaddr_storage])
        fi
 fi
 
@@ -1340,12 +1361,9 @@ if test $ol_with_threads = auto -o $ol_with_threads = yes \
        if test $ac_cv_header_pthread_h = yes ; then
                OL_POSIX_THREAD_VERSION
 
-               if test $ol_cv_pthread_version = final ; then
-                       AC_DEFINE(HAVE_PTHREADS_FINAL,1,
-                               [define if pthreads API compatible with final spec])
-               elif test $ol_cv_pthread_version = draft4 ; then
-                       AC_DEFINE(HAVE_PTHREADS_D4,1,
-                               [define if pthreads API compatible with draft4 spec])
+               if test $ol_cv_pthread_version != 0 ; then
+                       AC_DEFINE_UNQUOTED(HAVE_PTHREADS,$ol_cv_pthread_version,
+                               [define to pthreads API spec revision])
                else
                        AC_MSG_ERROR([unknown pthread version])
                fi
@@ -1440,9 +1458,6 @@ dnl                       [ol_cv_pthread_lpthread_lexc])
                OL_PTHREAD_TRY([-lpthreads],[ol_cv_pthread_lib_lpthreads])
 
                if test $ol_link_threads != no ; then
-                       AC_DEFINE(HAVE_PTHREADS,1,
-                               [define if you have POSIX Threads])
-
                        LTHREAD_LIBS="$LTHREAD_LIBS $ol_link_pthreads"
 
                        dnl save flags
@@ -1452,11 +1467,12 @@ dnl                     [ol_cv_pthread_lpthread_lexc])
 
                        dnl All POSIX Thread (final) implementations should have
                        dnl sched_yield instead of pthread yield.
-                       dnl check for both
-                       AC_CHECK_FUNCS(sched_yield pthread_yield)
+                       dnl check for both, and thr_yield for Solaris
+                       AC_CHECK_FUNCS(sched_yield pthread_yield thr_yield)
 
                        if test $ac_cv_func_sched_yield = no -a \
-                               $ac_cv_func_pthread_yield = no ; then
+                               $ac_cv_func_pthread_yield = no -a \
+                               $ac_cv_func_thr_yield = no ; then
                                dnl Digital UNIX has sched_yield() in -lrt
                                AC_CHECK_LIB(rt, sched_yield,
                                        [LTHREAD_LIBS="$LTHREAD_LIBS -lrt"
@@ -1465,12 +1481,6 @@ dnl                      [ol_cv_pthread_lpthread_lexc])
                                        ac_cv_func_sched_yield=yes],
                                        [ac_cv_func_sched_yield=no])
                        fi
-                       if test $ac_cv_func_sched_yield = no -a \
-                               $ac_cv_func_pthread_yield = no ; then
-                               dnl Solaris has sched_yield() stub in -lposix4
-                               dnl but we'll use thr_yield instead.
-                               AC_CHECK_FUNCS(thr_yield)
-                       fi
                        if test $ac_cv_func_sched_yield = no -a \
                                $ac_cv_func_pthread_yield = no -a \
                                "$ac_cv_func_thr_yield" = no ; then
@@ -1591,18 +1601,19 @@ int main(argc, argv)
 #endif
 #endif
 
-#if HAVE_PTHREADS_D4
+#if HAVE_PTHREADS < 6
        pthread_create(&t, pthread_attr_default, task, NULL);
 #else
        pthread_create(&t, NULL, task, NULL);
 #endif
 
-#if HAVE_SCHED_YIELD
-       sched_yield();  /* make sure task runs first */
-#else
-#ifdef HAVE_PTHREAD_YIELD
-       pthread_yield();        /* make sure task runs first */
-#endif
+       /* make sure task runs first */
+#if HAVE_THR_YIELD
+       thr_yield();
+#elif defined( HAVE_SCHED_YIELD )
+       sched_yield();
+#elif defined( HAVE_PTHREAD_YIELD )
+       pthread_yield();
 #endif
 
        exit(2);
@@ -2066,6 +2077,10 @@ dnl ----------------------------------------------------------------
 dnl SQL
 ol_link_sql=no
 if test $ol_enable_sql != no ; then
+       AC_CHECK_HEADERS(sql.h sqlext.h,[],[
+               AC_MSG_ERROR([could not locate SQL headers])
+       ])
+
        AC_CHECK_LIB(iodbc,SQLDriverConnect,[have_iodbc=yes],[have_iodbc=no])
        if test $have_iodbc = yes ; then
                ol_link_sql="-liodbc"
@@ -2150,6 +2165,12 @@ if test $ol_with_cyrus_sasl != no ; then
                if test $ol_enable_spasswd != no ; then
                        ol_link_spasswd=yes
                fi
+
+               ac_save_LIBS="$LIBS"
+               LIBS="$LIBS $ol_link_sasl"
+               AC_CHECK_FUNC(sasl_version, [AC_DEFINE(HAVE_SASL_VERSION,1,
+                       [define if your SASL library has sasl_version()])])
+               LIBS="$ac_save_LIBS"
        fi
 
 else
@@ -2230,10 +2251,16 @@ fi
 dnl ----------------------------------------------------------------
 dnl FreeBSD (and others) have crypt(3) in -lcrypt
 if test $ol_enable_crypt != no ; then
+       save_LIBS="$LIBS"
+       LIBS="$TLS_LIBS $LIBS"
+
        AC_CHECK_FUNC(crypt, [have_crypt=yes], [
+               LIBS="$save_LIBS"
                AC_CHECK_LIB(crypt, crypt, [LUTIL_LIBS="$LUTIL_LIBS -lcrypt"
                        have_crypt=yes], [have_crypt=no])])
 
+       LIBS="$save_LIBS"
+
        if test $have_crypt = yes ; then
                AC_DEFINE(HAVE_CRYPT,1, [define if crypt(3) is available])
        else
@@ -2355,7 +2382,7 @@ AC_FUNC_VPRINTF
 
 if test $ac_cv_func_vprintf = yes ; then
        dnl check for vsnprintf
-       AC_CHECK_FUNCS(vsnprintf vsprintf)
+       AC_CHECK_FUNCS(snprintf vsnprintf)
 fi
 
 AC_CHECK_FUNCS(                \
@@ -2366,6 +2393,7 @@ AC_CHECK_FUNCS(           \
        endpwent                \
        fcntl                   \
        flock                   \
+       fstat                   \
        getdtablesize   \
        getgrgid                \
        gethostname             \
@@ -2385,7 +2413,6 @@ AC_CHECK_FUNCS(           \
        read                    \
        recv                    \
        recvfrom                \
-       recvmsg                 \
        setpwfile               \
        setgid                  \
        setegid                 \
@@ -2419,6 +2446,14 @@ AC_REPLACE_FUNCS(getopt)
 if test "$ac_cv_func_getopt" != yes; then
        LIBSRCS="$LIBSRCS getopt.c"
 fi
+if test "$ac_cv_func_snprintf" != yes -o "$ac_cv_func_vsnprintf" != yes; then
+       if test "$ac_cv_func_snprintf" != yes; then
+               AC_DEFINE(snprintf, ber_pvt_snprintf, [define to snprintf routine])
+       fi
+       if test "$ac_cv_func_vsnprintf" != yes; then
+               AC_DEFINE(vsnprintf, ber_pvt_vsnprintf, [define to snprintf routine])
+       fi
+fi
 
 dnl ----------------------------------------------------------------
 # Check Configuration
@@ -2535,7 +2570,6 @@ if test "$ol_link_ldbm" != no -a $ol_enable_ldbm != no; then
        AC_DEFINE(SLAPD_LDBM,1,[define to support LDBM backend])
        BUILD_SLAPD=yes
        BUILD_LDBM=yes
-       LDBM_LIB="-lldbm"
        if test "$ol_with_ldbm_module" != static ; then
                AC_DEFINE(SLAPD_LDBM_DYNAMIC,1,
                        [define to support dynamic LDBM backend])
@@ -2631,6 +2665,9 @@ if test "$ol_link_perl" != no ; then
 fi
 
 if test "$ol_enable_shell" != no ; then
+       if test "$ol_link_thread" != no ; then
+               AC_MSG_WARN([Use of --without-threads is recommended with back-shell])
+       fi
        AC_DEFINE(SLAPD_SHELL,1,[define to support SHELL backend])
        BUILD_SLAPD=yes
        BUILD_SHELL=yes
@@ -2684,6 +2721,12 @@ else
        PLAT=UNIX
 fi
 
+if test -z "$SLAPD_STATIC_BACKENDS"; then
+       SLAPD_NO_STATIC='#'
+else
+       SLAPD_NO_STATIC=
+fi
+
 AC_SUBST(LIBSRCS)
 AC_SUBST(PLAT)
 AC_SUBST(BUILD_LIBS_DYNAMIC)
@@ -2713,8 +2756,6 @@ AC_SUBST(BUILD_SLAPD)
   AC_SUBST(BUILD_SQL_DYNAMIC)
 AC_SUBST(BUILD_SLURPD)
 
-AC_SUBST(LDBM_LIB)
-
 AC_SUBST(LDAP_LIBS)
 AC_SUBST(LDIF_LIBS)
 AC_SUBST(SLAPD_LIBS)
@@ -2727,6 +2768,7 @@ AC_SUBST(WRAP_LIBS)
 AC_SUBST(SLAPD_MODULES_CPPFLAGS)
 AC_SUBST(SLAPD_MODULES_LDFLAGS)
 
+AC_SUBST(SLAPD_NO_STATIC)
 AC_SUBST(SLAPD_STATIC_BACKENDS)
 AC_SUBST(SLAPD_DYNAMIC_BACKENDS)
 
@@ -2767,9 +2809,6 @@ doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \
 doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \
 doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \
 clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
-clients/mail500/Makefile:build/top.mk:clients/mail500/Makefile.in:build/rules.mk \
-clients/ud/Makefile:build/top.mk:clients/ud/Makefile.in:build/rules.mk \
-clients/maildap/Makefile:build/top.mk:clients/maildap/Makefile.in:build/rules.mk \
 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
 include/Makefile:build/top.mk:include/Makefile.in \
 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk     \