]> git.sur5r.net Git - openldap/blobdiff - configure.in
Initial inet_aton() detection.
[openldap] / configure.in
index fab19e306a6916ee08456a23604a9564028170e9..fedac7e78eb1304a41128362afaf0857fb1b4b6a 100644 (file)
@@ -32,12 +32,13 @@ AC_DEFINE_UNQUOTED(OPENLDAP_PACKAGE,"$PACKAGE",Package)
 AC_DEFINE_UNQUOTED(OPENLDAP_VERSION,"$VERSION",Version)
 
 dnl We use autoconf features new to 2.13.
-dnl    aclocal.m4 should be built using aclocal from automake 1.4
+dnl aclocal.m4 should be built using aclocal from automake 1.4
+dnl libtool 1.3.3 should be installed.
 AC_PREREQ(2.13)dnl Required Autoconf version
 
 AC_CONFIG_HEADER(include/portable.h include/ldap_features.h include/lber_types.h)dnl
 
-dnl
+dnl ----------------------------------------------------------------
 dnl Start Args
 AC_MSG_CHECKING(configure arguments)
 AC_PREFIX_DEFAULT(/usr/local)
@@ -45,8 +46,6 @@ AC_PREFIX_DEFAULT(/usr/local)
 top_builddir=`pwd`
 AC_SUBST(top_builddir)dnl
 
-AC_DEFINE(HAVE_MKVERSION, 1, [define this if you have mkversion])
-
 ldap_subdir="openldap"
 
 AC_ARG_WITH(subdir, [  --with-subdir=DIR change default subdirectory used for installs], [
@@ -73,6 +72,10 @@ OL_ARG_ENABLE(x_compile,[  --enable-x-compile        enable cross compiling],
 dnl General "with" options
 OL_ARG_ENABLE(dmalloc,[  --enable-dmalloc      enable debug malloc support], no)dnl
 
+OL_ARG_WITH(cyrus_sasl,[  --with-cyrus-sasl  with Cyrus SASL support],
+       auto, [auto yes no] )
+OL_ARG_WITH(fetch,[  --with-fetch  with fetch URL support],
+       auto, [auto yes no] )
 OL_ARG_WITH(kerberos,[  --with-kerberos        with Kerberos support],
        auto, [auto k5 k4 afs yes no])
 OL_ARG_WITH(readline,[  --with-readline  with readline support],
@@ -320,6 +323,7 @@ AC_MSG_RESULT(done)
 
 ## Initialize vars
 LDAP_LIBS=
+LDIF_LIBS=
 LDBM_LIBS=
 LTHREAD_LIBS=
 LUTIL_LIBS=
@@ -365,6 +369,13 @@ dnl Checks for programs
 
 dnl AC_PROG_INSTALL
 
+AC_DEFINE(HAVE_MKVERSION, 1, [define this if you have mkversion])
+
+
+dnl
+dnl Determine which C translator to use
+dnl
+
 dnl AIX Thread requires we use cc_r or xlc_r.
 dnl But only do this IF AIX and CC is not set
 dnl and threads are auto|yes|posix.
@@ -430,36 +441,6 @@ AC_PATH_PROG(SENDMAIL, sendmail, /usr/lib/sendmail,
 AC_PATH_PROG(EDITOR, vi, /usr/ucb/vi, $PATH:/usr/ucb)
 AC_PATH_PROG(FINGER, finger, /usr/ucb/finger, $PATH:/usr/ucb)
 
-dnl
-dnl Check for module support
-dnl
-ol_link_modules=no
-if test $ol_enable_modules != no ; then
-       AC_PATH_PROG(GLIBCONFIG, glib-config)
-
-       if test "no$GLIBCONFIG" = "no" ; then
-               if test $ol_enable_modules = yes ; then
-                       AC_MSG_ERROR([could not locate glib-config])
-               fi
-
-       else
-               SLAPD_MODULES_VERSION="`$GLIBCONFIG --version gmodule`"
-               SLAPD_MODULES_CPPFLAGS="`$GLIBCONFIG --cflags gmodule`"
-               SLAPD_MODULES_LDFLAGS="`$GLIBCONFIG --libs gmodule`"
-
-               dnl should check glib version
-               ol_link_modules=yes
-       fi
-else
-       ol_with_bdb2_module=static
-       ol_with_ldap_module=static
-       ol_with_ldbm_module=static
-       ol_with_passwd_module=static
-       ol_with_perl_module=static
-       ol_with_shell_module=static
-       ol_with_tcl_module=static
-fi
-
 ol_link_perl=no
 if test $ol_enable_perl != no ; then
        AC_PATH_PROG(PERLBIN, perl, /usr/bin/perl)
@@ -514,8 +495,6 @@ if test "X${am_cv_prog_cc_stdc}" = "Xno" ; then
        AC_MSG_ERROR([OpenLDAP requires compiler to support STDC constructs.])
 fi
 
-dnl AM_C_PROTOTYPES
-
 dnl Check cc depend flags
 OL_MKDEPEND
 if test "${ol_cv_mkdep}" = no ; then
@@ -523,6 +502,94 @@ if test "${ol_cv_mkdep}" = no ; then
        AC_MSG_WARN([do not know how to generate dependencies])
 fi
 
+dnl
+dnl Check for module support
+dnl
+ol_link_modules=no
+if test $ol_enable_modules != no ; then
+       AC_PATH_PROG(GLIBCONFIG, glib-config)
+
+       if test "no$GLIBCONFIG" = "no" ; then
+               if test $ol_enable_modules = yes ; then
+                       AC_MSG_ERROR([could not locate glib-config])
+               fi
+
+       else
+               SLAPD_MODULES_VERSION="`$GLIBCONFIG --version gmodule`"
+               SLAPD_MODULES_CPPFLAGS="`$GLIBCONFIG --cflags gmodule`"
+               SLAPD_MODULES_LDFLAGS="`$GLIBCONFIG --libs gmodule`"
+
+               dnl should check glib version
+               ol_link_modules=yes
+       fi
+else
+       ol_with_bdb2_module=static
+       ol_with_ldap_module=static
+       ol_with_ldbm_module=static
+       ol_with_passwd_module=static
+       ol_with_perl_module=static
+       ol_with_shell_module=static
+       ol_with_tcl_module=static
+fi
+
+dnl ----------------------------------------------------------------
+dnl Checks for header files.
+OL_HEADER_STDC
+
+if test $ol_cv_header_stdc != yes; then
+       AC_MSG_WARN([could not locate Standard C compliant headers])
+fi
+
+AC_HEADER_DIRENT
+AC_HEADER_SYS_WAIT
+AM_HEADER_TIOCGWINSZ_NEEDS_SYS_IOCTL
+if test $am_cv_sys_posix_termios = yes ; then
+       AC_DEFINE(HAVE_POSIX_TERMIOS,1,
+               [define if you have POSIX termios])
+fi
+
+AC_CHECK_HEADERS(      \
+       arpa/inet.h             \
+       arpa/nameser.h  \
+       assert.h                \
+       crypt.h                 \
+       errno.h                 \
+       fcntl.h                 \
+       filio.h                 \
+       getopt.h                \
+       grp.h                   \
+       libutil.h               \
+       limits.h                \
+       locale.h                \
+       netinet/tcp.h   \
+       malloc.h                \
+       memory.h                \
+       psap.h                  \
+       pwd.h                   \
+       resolv.h                \
+       sgtty.h                 \
+       shadow.h                \
+       stdarg.h                \
+       stddef.h                \
+       string.h                \
+       strings.h               \
+       sysexits.h              \
+       sys/file.h              \
+       sys/filio.h             \
+       sys/errno.h             \
+       sys/ioctl.h             \
+       sys/param.h             \
+       sys/resource.h  \
+       sys/select.h    \
+       sys/socket.h    \
+       sys/syslog.h    \
+       sys/time.h              \
+       sys/types.h             \
+       syslog.h                \
+       termios.h               \
+       unistd.h                \
+)
+
 dnl ----------------------------------------------------------------
 dnl Checks for libraries
 
@@ -544,6 +611,31 @@ dnl
        AC_CHECK_LIB(gen, main)
 ])
 
+AC_CHECK_FUNC(select, :, AC_MSG_ERROR([select() required.]))
+
+dnl Select arg types
+dnl (if this detection becomes permenent, it and the select() detection
+dnl should be done before the yielding select test) 
+AC_FUNC_SELECT_ARGTYPES
+
+
+AC_CHECK_HEADERS( regex.h )
+if test "$ac_cv_header_regex_h" != yes ; then
+       AC_MSG_ERROR([POSIX regex.h required.])
+fi
+AC_CHECK_FUNC(regfree, :, AC_MSG_ERROR([POSIX regex required.]))
+
+OL_POSIX_REGEX
+if test "$ol_cv_c_posix_regex" = no ; then
+       AC_MSG_ERROR([broken POSIX regex!])
+fi
+
+
+dnl HP-UX requires -lV3
+AC_CHECK_LIB(V3, sigset)
+
+
+# find res_search
 if test $ol_enable_dns != no ; then
        dnl Check for resolver routines
        AC_CHECK_FUNC(res_search,:)
@@ -566,26 +658,6 @@ if test $ol_enable_dns != no ; then
        fi
 fi
 
-dnl HP-UX requires -lV3
-AC_CHECK_LIB(V3, sigset)
-
-AC_CHECK_HEADERS( regex.h )
-if test "$ac_cv_header_regex_h" != yes ; then
-       AC_MSG_ERROR([POSIX regex.h required.])
-fi
-AC_CHECK_FUNC(regfree, :, AC_MSG_ERROR([POSIX regex required.]))
-
-OL_POSIX_REGEX
-if test "$ol_cv_c_posix_regex" = no ; then
-       AC_MSG_ERROR([broken POSIX regex!])
-fi
-
-AC_CHECK_FUNC(select, :, AC_MSG_ERROR([select() required.]))
-
-dnl Select arg types
-dnl (if this detection becomes permenent, it and the select() detection
-dnl should be done before the yielding select test) 
-AC_FUNC_SELECT_ARGTYPES
 
 # ISODE tests
 ol_link_isode=no
@@ -871,8 +943,6 @@ int main(argc, argv)
        status = pthread_detach( t );
 #endif
 
-       if( status ) return status;
-
        return status;
 }
 ],
@@ -1569,6 +1639,47 @@ if test $ol_link_termcap = no ; then
        TERMCAP_LIBS=
 fi
 
+dnl
+dnl Check for fetch URL support
+dnl            should be extended to support other fetch URL APIs
+dnl
+ol_link_sasl=no
+if test $ol_with_cyrus_sasl != no ; then
+       AC_CHECK_HEADER(sasl.h)
+
+       if test $ac_cv_header_sasl_h = yes ; then
+               AC_CHECK_LIB(sasl, sasl_client_init,
+                       [have_cyrus_sasl=yes], [have_cyrus_sasl=no])
+
+               if test $have_cyrus_sasl != no ; then
+                       LUTIL_LIBS="$LUTIL_LIBS -lsasl"
+                       AC_DEFINE(HAVE_CYRUS_SASL,1,[define if you have Cyrus SASL])
+                       ol_link_sasl=yes
+               fi
+       fi
+
+       if test $ol_link_sasl = no -a $ol_with_cyrus_sasl = yes ; then
+               AC_MSG_ERROR(no suitable API for --with-cyrus-sasl=$ol_with_cyrus_sasl)
+       fi
+fi
+
+dnl
+dnl Check for fetch URL support
+dnl            should be extended to support other fetch URL APIs
+dnl
+ol_link_fetch=no
+if test $ol_with_fetch != no ; then
+       OL_LIB_FETCH
+
+       if test $ol_cv_lib_fetch != no ; then
+               LDIF_LIBS="$LDIF_LIBS $ol_link_fetch"
+               ol_link_fetch=freebsd
+
+       elif test $ol_with_fetch != auto ; then
+               AC_MSG_ERROR(no suitable API for --with-fetch=$ol_with_fetch)
+       fi 
+fi
+
 dnl
 dnl Check for GNU readline
 dnl
@@ -1631,64 +1742,6 @@ if test $ol_enable_proctitle != no ; then
        fi
 fi
 
-dnl ----------------------------------------------------------------
-dnl Checks for header files.
-OL_HEADER_STDC
-
-if test $ol_cv_header_stdc != yes; then
-       AC_MSG_WARN([could not locate Standard C compliant headers])
-fi
-
-AC_HEADER_DIRENT
-AC_HEADER_SYS_WAIT
-AM_HEADER_TIOCGWINSZ_NEEDS_SYS_IOCTL
-if test $am_cv_sys_posix_termios = yes ; then
-       AC_DEFINE(HAVE_POSIX_TERMIOS,1,
-               [define if you have POSIX termios])
-fi
-
-AC_CHECK_HEADERS(      \
-       arpa/inet.h             \
-       arpa/nameser.h  \
-       assert.h                \
-       crypt.h                 \
-       errno.h                 \
-       fcntl.h                 \
-       filio.h                 \
-       getopt.h                \
-       grp.h                   \
-       libutil.h               \
-       limits.h                \
-       locale.h                \
-       netinet/tcp.h   \
-       malloc.h                \
-       memory.h                \
-       psap.h                  \
-       pwd.h                   \
-       resolv.h                \
-       sgtty.h                 \
-       shadow.h                \
-       stdarg.h                \
-       stddef.h                \
-       string.h                \
-       strings.h               \
-       sysexits.h              \
-       sys/file.h              \
-       sys/filio.h             \
-       sys/errno.h             \
-       sys/ioctl.h             \
-       sys/param.h             \
-       sys/resource.h  \
-       sys/select.h    \
-       sys/socket.h    \
-       sys/syslog.h    \
-       sys/time.h              \
-       sys/types.h             \
-       syslog.h                \
-       termios.h               \
-       unistd.h                \
-)
-
 dnl ----------------------------------------------------------------
 dnl Checks for typedefs, structures, and compiler characteristics.
 AC_TYPE_GETGROUPS dnl requires AC_TYPE_UID_T
@@ -1745,6 +1798,8 @@ dnl AM_FUNC_MKTIME dnl checks for sys/time.h and unistd.h
 AC_FUNC_STRFTIME
 dnl AM_FUNC_STRTOD
 
+OL_FUNC_INET_ATON
+
 dnl we should use vfork instead of fork in a number of places...
 dnl AC_FUNC_VFORK
 AC_FUNC_VPRINTF
@@ -1968,6 +2023,7 @@ AC_SUBST(BUILD_SLURPD)
 
 AC_SUBST(LDAP_LIBS)
 AC_SUBST(LDAPD_LIBS)
+AC_SUBST(LDIF_LIBS)
 AC_SUBST(SLAPD_LIBS)
 AC_SUBST(SLURPD_LIBS)
 AC_SUBST(LDBM_LIBS)