]> git.sur5r.net Git - openldap/blobdiff - configure.in
Added connection initialisation and destruction notification. Now backends can regist...
[openldap] / configure.in
index 560a5b48a6bb7500de82ab48f81908653f20ee93..47d5db1c19266982867836fbc35c564d165022e0 100644 (file)
@@ -20,6 +20,11 @@ if test -z "$OL_VERSION"; then
        AC_MSG_ERROR([could not determine version])
 fi
 
+dnl ----------------------------------------------------------------
+dnl Determine host platform
+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)
@@ -30,7 +35,7 @@ dnl We use autoconf features new to 2.13.
 dnl    aclocal.m4 should be built using aclocal from automake 1.4
 AC_PREREQ(2.13)dnl Required Autoconf version
 
-AC_CONFIG_HEADER(include/portable.h include/ldap_features.h)dnl
+AC_CONFIG_HEADER(include/portable.h include/ldap_features.h include/lber_types.h)dnl
 
 dnl
 dnl Start Args
@@ -309,56 +314,55 @@ dnl Checks for programs
 
 dnl AC_PROG_INSTALL
 
-dnl The default compiler is cc (NOT gcc)
-dnl    (should check to see if 'cc' exists)
-save_CC="$CC"
-if test -z "${CC}"; then
-       AC_CHECK_PROGS(CC,cc)
-fi
-
-dnl The default CFLAGS is empty NOT whatever AC_PROG_CC sets.
-dnl CFLAGS=${CFLAGS-""}
-
-dnl
 dnl AIX Thread requires we use cc_r or xlc_r.
-dnl But only do this IF AIX and CC is zero (initially),
-dnl and cc exists and threads are auto|yes|posix.
+dnl But only do this IF AIX and CC is not set
+dnl and threads are auto|yes|posix.
 dnl
 dnl If we find cc_r|xlc_r, force pthreads and assume
 dnl            pthread_create is in $LIBS (ie: don't bring in
 dnl            any additional thread libraries)
 dnl If we do not find cc_r|xlc_r, disable threads
-dnl
-AC_CANONICAL_HOST
-
-case "$host" in
-       *-*-aix*) ol_host_os=aix ;;
-esac
 
 ol_aix_threads=no
-if test -z "$save_CC" -a "$CC" = cc -a "$ol_host_os" = aix ; then
-       case "$ol_with_threads" in
+case "$target" in
+*-*-aix*) dnl all AIX is not a good idea.
+       if test -z "CC" ; then
+               case "$ol_with_threads" in
                auto | yes |  posix) ol_aix_threads=yes ;;
-       esac
-fi
+               esac
+       fi
+;;
+esac
 
-if test ol_aix_threads = yes ; then
-       CC=
-       AC_CHECK_PROGS(CC,cc_r xlc_r)
+if test $ol_aix_threads = yes ; then
+       if test -z "${CC}" ; then
+               AC_CHECK_PROGS(CC,cc_r xlc_r cc)
 
-       if test "$CC" ; then
-               if test $ol_with_threads != auto ; then
-                       AC_MSG_ERROR([--with-threads requires cc_r (or other suitable compiler) on AIX])
-               else
-                       AC_MSG_WARN([disabling threads, no cc_r on AIX])
-               fi
-               ol_with_threads=no
-       else
+               if test "$CC" = cc ; then
+                       dnl no CC! don't allow --with-threads
+                       if test $ol_with_threads != auto ; then
+                               AC_MSG_ERROR([--with-threads requires cc_r (or other suitable compiler) on AIX])
+                       else
+                               AC_MSG_WARN([disabling threads, no cc_r on AIX])
+                       fi
+                       ol_with_threads=no
+               fi
+       fi
+
+       if test "${CC}" = "cc_r" -o "${CC}" = "xlc_r" ; then
                ol_with_threads=posix
                ol_cv_pthread_create=yes
        fi
 fi
 
+if test -z "${CC}"; then
+       AC_CHECK_PROGS(CC,cc)
+fi
+
+dnl The default CFLAGS is empty NOT whatever AC_PROG_CC sets.
+dnl (for now, let autoconf sort this out)
+dnl CFLAGS=${CFLAGS-""}
+
 AM_PROG_LIBTOOL
 dnl AC_PROG_MAKE_SET
 
@@ -445,7 +449,7 @@ AC_DEFINE_UNQUOTED( EXEEXT, "${EXEEXT}", [defined to be the EXE extension])
 dnl OpenLDAP requires STDC features
 AM_PROG_CC_STDC
 if test "X${am_cv_prog_cc_stdc}" = "Xno" ; then
-       AC_MSG_ERROR([OpenLDAP requires compiler to support STDC prototypes.])
+       AC_MSG_ERROR([OpenLDAP requires compiler to support STDC constructs.])
 fi
 
 dnl AM_C_PROTOTYPES
@@ -500,6 +504,11 @@ if test "$ac_cv_header_regex_h" != yes ; then
 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
@@ -510,7 +519,7 @@ AC_FUNC_SELECT_ARGTYPES
 # ISODE tests
 ol_link_isode=no
 if test $ol_enable_ldapd != no ; then
-       AC_MSG_WARN([ldapd support deprecated.  Manual intervention required.])
+       AC_MSG_WARN([ldapd is not supported and may suffer from bit rot.])
 
        dnl look for ISODE libraries
        AC_CHECK_LIB(xtpp, main, [
@@ -1162,6 +1171,7 @@ if test $ol_link_threads != no ; then
        AC_DEFINE(_THREAD_SAFE,1)
        AC_DEFINE(THREADSAFE,1)
        AC_DEFINE(_THREADSAFE,1)
+       AC_DEFINE(_SGI_MP_SOURCE,1)
 
        dnl The errno declaration may dependent upon _REENTRANT.
        dnl If it does, we must link with thread support.
@@ -1611,6 +1621,11 @@ OL_C_VOLATILE
 
 if test $cross_compiling = yes ; then
        AC_DEFINE(CROSS_COMPILING, 1, [define if cross compiling])
+
+       AC_DEFINE(LBER_INT_T,long)
+       AC_DEFINE(LBER_TAG_T,long)
+       AC_DEFINE(LBER_SOCKET_T,int)
+
 else
        AC_C_BIGENDIAN
        AC_CHECK_SIZEOF(short) 
@@ -1619,9 +1634,19 @@ else
 
        if test "$ac_cv_sizeof_int" -lt 4 ; then
                AC_MSG_WARN([OpenLDAP requires 'int' to be 32 bits or greater.])
+
+               AC_DEFINE(LBER_INT_T,long)
+               AC_DEFINE(LBER_TAG_T,long)
+               AC_DEFINE(LBER_SOCKET_T,int)
+       else
+               AC_DEFINE(LBER_INT_T,int)
+               AC_DEFINE(LBER_TAG_T,long)
+               AC_DEFINE(LBER_SOCKET_T,int)
        fi
 fi
 
+AC_DEFINE(LBER_LEN_T,long)
+
 dnl ----------------------------------------------------------------
 dnl Checks for library functions.
 AC_FUNC_MEMCMP