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)
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
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 x1c_r.
-dnl But only do this IF AIX and CC is zero (initially),
-dnl and cc exists and threads are auto|yes|posix.
+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.
dnl
-dnl If we find cc_r|x1c_r, force pthreads and assume
+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|x1c_r, disable threads
-dnl
-AC_CANONICAL_HOST
-
-case "$host" in
- *-*-aix*) $ol_host_os=aix ;;
-esac
+dnl If we do not find cc_r|xlc_r, disable threads
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
- AC_CHECK_PROGS(CC,cc_r x1c_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
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
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
# 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, [
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.
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)
AC_CHECK_SIZEOF(int)
AC_CHECK_SIZEOF(long)
+
+ 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