OL_ARG_ENABLE(bdb2,[ --enable-bdb2 enable bdb2 backend], no)dnl
OL_ARG_ENABLE(ldbm,[ --enable-ldbm enable ldbm backend], yes)dnl
OL_ARG_WITH(ldbm_api,[ --with-ldbm-api use LDBM API], auto,
- [auto db2 db gdbm ndbm manual])
+ [auto db2 db mdbm gdbm ndbm manual])
OL_ARG_WITH(ldbm_type,[ --with-ldbm-type use LDBM type], auto,
[auto btree hash])
$ol_with_ldbm_type = btree ; then
AC_MSG_ERROR([GDBM only supports LDBM type hash])
fi
+ if test $ol_with_ldbm_api = mdbm -a \
+ $ol_with_ldbm_type = btree ; then
+ AC_MSG_ERROR([MDBM only supports LDBM type hash])
+ fi
if test $ol_with_ldbm_api = ndbm -a \
$ol_with_ldbm_type = btree ; then
AC_MSG_ERROR([NDBM only supports LDBM type hash])
AC_MSG_RESULT(done)
-AC_CANONICAL_HOST
-
## Initialize vars
LDAP_LIBS=
LDBM_LIBS=
dnl The default compiler is cc (NOT gcc)
CC=${CC-"cc"}
dnl The default CFLAGS is empty NOT whatever AC_PROG_CC sets.
-CFLAGS=${CFLAGS-""}
+dnl CFLAGS=${CFLAGS-""}
AM_PROG_LIBTOOL
dnl AC_PROG_MAKE_SET
AC_PROG_AWK
+OL_PROG_LN_H
AC_PROG_LN_S
+if test "$LN_H" = "cp" -a "$LN_S" = "ln"; then
+ LN_S="$LN_H"
+fi
+
AC_PATH_PROG(SENDMAIL, sendmail, /usr/lib/sendmail,
$PATH:/usr/libexec:/usr/lib:/usr/sbin:/usr/etc:/etc)
AC_PATH_PROG(EDITOR, vi, /usr/ucb/vi, $PATH:/usr/ucb)
AC_ISC_POSIX
AC_MINIX
+dnl BeOS requires -lbe -lroot
+AC_CHECK_LIB(be, be_app, [LIBS="$LIBS -lbe -lroot"], :, [-lroot])
+
dnl Checks for system services
AC_CYGWIN
AC_MINGW32
LIBS="$save_LIBS"
])
- if test $ol_cv_var_des_debug= yes ; then
+ if test $ol_cv_var_des_debug = yes ; then
AC_DEFINE(HAVE_DES_DEBUG,1,
[define if you have Kerberos des_debug])
fi
AC_DEFINE(HAVE_KERBEROS, 1, [define if you have Kerberos])
fi
-dnl
-dnl Check for GNU readline
-dnl
-ol_link_readline=no
-if test $ol_with_readline != no ; then
- AC_CHECK_HEADERS(readline/readline.h readline/history.h)
-
- if test $ac_cv_header_readline_readline_h = yes ; then
- AC_CHECK_LIB(readline, readline,
- [have_readline=yes], [have_readline=no])
-
- if test $have_readline = yes ; then
- ol_with_readline=found
- ol_link_readline=yes
-
- READLINE_LIBS="-lreadline"
- fi
- fi
-fi
-
-if test $ol_link_readline = yes ; then
- AC_DEFINE(HAVE_READLINE, 1, [define if you have -lreadline])
-fi
-
dnl
dnl Check for SSL/TLS
dnl
dnl pthread_create() in $LIBS
dnl
dnl Check special pthread (final) flags
+ dnl pthread_create() with -mt (Solaris)
dnl pthread_create() with -kthread (FreeBSD)
dnl pthread_create() with -pthread (FreeBSD/Digital Unix)
dnl pthread_create() with -pthreads (?)
dnl pthread_create() with -thread (?)
- dnl pthread_create() with -mt (Solaris)
dnl
dnl Check pthread (final) libraries
dnl pthread_mutex_unlock() in -lpthread -lmach -lexc -lc_r (OSF/1)
dnl pthread_mutex_lock() in -lpthread -lmach -lexc (OSF/1)
dnl pthread_mutex_trylock() in -lpthread -lexc (OSF/1)
+ dnl pthread_join() -Wl,-woff,85 -lpthread (IRIX)
dnl pthread_create() in -lpthread (many)
dnl pthread_create() in -lc_r (FreeBSD)
- dnl pthread_create() in -lpthreads (many)
- dnl pthread_join() -Wl,-woff,85 -lpthreads (IRIX)
dnl
dnl Check pthread (draft4) flags (depreciated)
dnl pthread_create() with -threads (OSF/1)
dnl
- dnl Check pthread (final) libraries (depreciated)
+ dnl Check pthread (draft4) libraries (depreciated)
dnl pthread_mutex_unlock() in -lpthreads -lmach -lexc -lc_r (OSF/1)
dnl pthread_mutex_lock() in -lpthreads -lmach -lexc (OSF/1)
dnl pthread_mutex_trylock() in -lpthreads -lexc (OSF/1)
+ dnl pthread_create() in -lpthreads (many)
dnl
dnl pthread_create in $LIBS
- AC_CHECK_FUNC(pthread_create,[ol_link_threads=yes])
+ AC_MSG_CHECKING([for pthread_create in default libraries])
+ AC_CACHE_VAL(ol_cv_pthread_create,[
+ AC_TRY_RUN([
+#include <pthread.h>
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+ void *p;
+{
+ return (void *) (p == NULL);
+}
+
+int main(argc, argv)
+ int argc;
+ char **argv;
+{
+ pthread_t t;
+ int status;
+
+ /* make sure pthread_create() isn't just a stub */
+#if HAVE_PTHREADS_D4
+ status = pthread_create(&t, pthread_attr_default, task, NULL));
+#else
+ status = pthread_create(&t, NULL, task, NULL);
+#endif
+
+ if( status ) return status;
+
+ /* make sure pthread_detach() isn't just a stub */
+#if HAVE_PTHREADS_D4
+ status = pthread_detach( &t );
+#else
+ status = pthread_detach( t );
+#endif
+
+ if( status ) return status;
+
+ return status;
+}
+],
+ [ol_cv_pthread_create=yes],
+ [ol_cv_pthread_create=no],
+ [dnl assume yes
+ ol_cv_pthread_create=yes])])
+ AC_MSG_RESULT($ol_cv_pthread_create)
+
+ if test $ol_cv_pthread_create != no ; then
+ ol_link_threads=posix
+ fi
+
+ if test $ol_link_threads = no ; then
+ dnl try -mt
+ AC_CACHE_CHECK([for pthread_create with -mt],
+ [ol_cv_pthread_mt_flag], [
+ dnl save the flags
+ save_LIBS="$LIBS"
+ LIBS="-mt $LIBS"
+ AC_TRY_LINK([char pthread_create();],
+ [pthread_create();],
+ [ol_cv_pthread_mt_flag=yes], [ol_cv_pthread_mt_flag=no])
+ dnl restore the LIBS
+ LIBS="$save_LIBS"
+ ])
+
+ if test $ol_cv_pthread_mt_flag = yes ; then
+ LTHREAD_LIBS="$LTHREAD_LIBS -mt"
+ ol_link_threads=posix
+ fi
+ fi
if test $ol_link_threads = no ; then
dnl try -kthread
#if HAVE_PTHREADS_D4
pthread_create(NULL,pthread_attr_default,NULL,NULL);
#else
- pthread_create(NULL,NULL,NULL,NULL);
+ pthread_t t;
+ pthread_create(&t,NULL,NULL,NULL);
+ pthread_detach(t);
#endif
],
[ol_cv_kthread_flag=yes], [ol_cv_kthread_flag=no])
fi
fi
- if test $ol_link_threads = no ; then
- dnl try -mt
- AC_CACHE_CHECK([for pthread_create with -mt],
- [ol_cv_thread_flag], [
- dnl save the flags
- save_LIBS="$LIBS"
- LIBS="-mt $LIBS"
- AC_TRY_LINK([char pthread_create();],
- [pthread_create();],
- [ol_cv_thread_flag=yes], [ol_cv_thread_flag=no])
- dnl restore the LIBS
- LIBS="$save_LIBS"
- ])
-
- if test $ol_cv_thread_flag = yes ; then
- LTHREAD_LIBS="$LTHREAD_LIBS -mt"
- ol_link_threads=posix
- fi
- fi
-
if test $ol_link_threads = no ; then
dnl try DEC Threads -lpthread -lmach -lexc -lc_r
save_LIBS="$LIBS"
AC_CHECK_LIB(pthread, pthread_mutex_unlock, [
ol_link_threads=posix
LTHREAD_LIBS="$LTHREAD_LIBS -lpthread -lmach -lexc -lc_r"
- if test $ol_with_yielding_select = auto ; then
- ol_with_yielding_select=yes
- fi
+dnl if test $ol_with_yielding_select = auto ; then
+dnl ol_with_yielding_select=yes
+dnl fi
],:,[-lmach -lexc -lc_r])
LIBS="$save_LIBS"
fi
AC_CHECK_LIB(pthread, pthread_mutex_lock, [
ol_link_threads=posix
LTHREAD_LIBS="$LTHREAD_LIBS -lpthread -lmach -lexc"
- if test $ol_with_yielding_select = auto ; then
- ol_with_yielding_select=yes
- fi
+dnl if test $ol_with_yielding_select = auto ; then
+dnl ol_with_yielding_select=yes
+dnl fi
],:,[-lmach -lexc])
LIBS="$save_LIBS"
fi
AC_CHECK_LIB(pthread, pthread_mutex_trylock, [
ol_link_threads=posix
LTHREAD_LIBS="$LTHREAD_LIBS -lpthread -lexc"
- if test $ol_with_yielding_select = auto ; then
- ol_with_yielding_select=yes
- fi
+dnl if test $ol_with_yielding_select = auto ; then
+dnl ol_with_yielding_select=yes
+dnl fi
],:,[-lexc])
LIBS="$save_LIBS"
fi
+ dnl IRIX Pthread check
if test $ol_link_threads = no ; then
- dnl try -lpthread
- save_LIBS="$LIBS"
- AC_CHECK_LIB(pthread, pthread_create, [
- ol_link_threads=posix
- LTHREAD_LIBS="$LTHREAD_LIBS -lpthread"],:)
- LIBS="$save_LIBS"
- fi
-
- if test $ol_link_threads = no ; then
- dnl try -lc_r
+ dnl try IRIX Pthreads -Wl,-woff,85 -lpthread
save_LIBS="$LIBS"
- AC_CHECK_LIB(c_r, pthread_create, [
+ AC_CHECK_LIB(pthread, pthread_join, [
ol_link_threads=posix
- LTHREAD_LIBS="$LTHREAD_LIBS -lc_r"],:)
+ LTHREAD_LIBS="$LTHREAD_LIBS -lpthread"
+ ],:,[-Wl,-woff,85])
LIBS="$save_LIBS"
fi
if test $ol_link_threads = no ; then
- dnl try -lpthreads
+ dnl try -lpthread
save_LIBS="$LIBS"
- AC_CHECK_LIB(pthreads, pthread_create, [
+ AC_CHECK_LIB(pthread, pthread_create, [
ol_link_threads=posix
- LTHREAD_LIBS="$LTHREAD_LIBS -lpthreads"],:)
+ LTHREAD_LIBS="$LTHREAD_LIBS -lpthread"],:)
LIBS="$save_LIBS"
fi
- dnl IRIX Pthread check
if test $ol_link_threads = no ; then
- dnl try IRIX Pthreads -Wl,-woff,85 -lpthreads
+ dnl try -lc_r
save_LIBS="$LIBS"
- AC_CHECK_LIB(pthreads, pthread_join, [
+ AC_CHECK_LIB(c_r, pthread_create, [
ol_link_threads=posix
- LTHREAD_LIBS="$LTHREAD_LIBS -lpthreads"
- ],:,[-Wl,-woff,85])
+ LTHREAD_LIBS="$LTHREAD_LIBS -lc_r"],:)
LIBS="$save_LIBS"
fi
if test $ol_link_threads = no ; then
dnl try -threads
AC_CACHE_CHECK([for pthread_create with -threads],
- [ol_cv_thread_flag], [
+ [ol_cv_threads_flag], [
dnl save the flags
save_LIBS="$LIBS"
LIBS="-threads $LIBS"
AC_TRY_LINK([char pthread_create();],[
pthread_create();
- ], ol_cv_thread_flag=yes, ol_cv_thread_flag=no)
+ ], ol_cv_threads_flag=yes, ol_cv_threads_flag=no)
dnl restore the LIBS
LIBS="$save_LIBS"
])
- if test $ol_cv_thread_flag = yes ; then
+ if test $ol_cv_threads_flag = yes ; then
LTHREAD_LIBS="$LTHREAD_LIBS -threads"
ol_link_threads=posix
fi
AC_CHECK_LIB(pthreads, pthread_mutex_unlock, [
ol_link_threads=posix
LTHREAD_LIBS="$LTHREAD_LIBS -lpthreads -lmach -lexc -lc_r"
- if test $ol_with_yielding_select = auto ; then
- ol_with_yielding_select=yes
- fi
+dnl if test $ol_with_yielding_select = auto ; then
+dnl ol_with_yielding_select=yes
+dnl fi
],:,[-lmach -lexc -lc_r])
LIBS="$save_LIBS"
fi
AC_CHECK_LIB(pthreads, pthread_mutex_lock, [
ol_link_threads=posix
LTHREAD_LIBS="$LTHREAD_LIBS -lpthreads -lmach -lexc"
- if test $ol_with_yielding_select = auto ; then
- ol_with_yielding_select=yes
- fi
+dnl if test $ol_with_yielding_select = auto ; then
+dnl ol_with_yielding_select=yes
+dnl fi
],:,[-lmach -lexc])
LIBS="$save_LIBS"
fi
AC_CHECK_LIB(pthreads, pthread_mutex_trylock, [
ol_link_threads=posix
LTHREAD_LIBS="$LTHREAD_LIBS -lpthreads -lexc"
- if test $ol_with_yielding_select = auto ; then
- ol_with_yielding_select=yes
- fi
+dnl if test $ol_with_yielding_select = auto ; then
+dnl ol_with_yielding_select=yes
+dnl fi
],:,[-lexc])
LIBS="$save_LIBS"
fi
+ if test $ol_link_threads = no ; then
+ dnl try -lpthreads
+ save_LIBS="$LIBS"
+ AC_CHECK_LIB(pthreads, pthread_create, [
+ ol_link_threads=posix
+ LTHREAD_LIBS="$LTHREAD_LIBS -lpthreads"],:)
+ LIBS="$save_LIBS"
+ fi
+
if test $ol_link_threads != no ; then
AC_DEFINE(HAVE_PTHREADS,1,
[define if you have POSIX Threads])
AC_CACHE_CHECK([for pthread_detach with <pthread.h>],
[ol_cv_func_pthread_detach], [
dnl save the flags
- AC_TRY_LINK([#include <pthread.h>],
+ AC_TRY_LINK([
+#include <pthread.h>
+#ifndef NULL
+#define NULL (void*)0
+#endif
+],
[pthread_detach(NULL);],
[ol_cv_func_pthread_detach=yes],
[ol_cv_func_pthread_detach=no])
ol_with_ldbm_api=none
fi
+if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = mdbm ; then
+ OL_MDBM
+
+ if test $ol_cv_mdbm = yes ; then
+ ol_link_ldbm=mdbm
+ ol_with_ldbm_api=mdbm
+ if test $ol_cv_lib_mdbm != yes ; then
+ LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_mdbm"
+ fi
+ fi
+fi
+
if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = gdbm ; then
OL_GDBM
TERMCAP_LIBS=
fi
+dnl
+dnl Check for GNU readline
+dnl
+ol_link_readline=no
+if test $ol_with_readline != no ; then
+ AC_CHECK_HEADERS(readline/readline.h readline/history.h)
+
+ if test $ac_cv_header_readline_readline_h = yes ; then
+ save_LIBS="$LIBS"
+ LIBS="$TERMCAP_LIBS $LIBS"
+ AC_CHECK_LIB(readline, readline,
+ [have_readline=yes], [have_readline=no])
+ LIBS="$save_LIBS"
+
+ if test $have_readline = yes ; then
+ ol_with_readline=found
+ ol_link_readline=yes
+
+ READLINE_LIBS="-lreadline"
+ fi
+ fi
+fi
+
+if test $ol_link_readline = yes ; then
+ AC_DEFINE(HAVE_READLINE, 1, [define if you have -lreadline])
+fi
+
+
# FreeBSD (and others) have crypt(3) in -lcrypt
if test $ol_enable_crypt != no ; then
AC_CHECK_FUNC(crypt, [have_crypt=yes], [
dnl ----------------------------------------------------------------
dnl Checks for header files.
-AC_HEADER_STDC
+OL_HEADER_STDC
-if test $ac_cv_header_stdc != yes; then
- AC_MSG_WARN([could not Standard C compliant headers])
+if test $ol_cv_header_stdc != yes; then
+ AC_MSG_WARN([could not locate Standard C compliant headers])
fi
AC_HEADER_DIRENT
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 \
AC_STRUCT_ST_BLKSIZE
AC_HEADER_TIME
AC_STRUCT_TM
+OL_STRUCT_PASSWD_PW_GECOS
OL_C_UPPER_LOWER
AC_C_CONST
dnl AM_FUNC_MKTIME dnl checks for sys/time.h and unistd.h
AC_FUNC_STRFTIME
dnl AM_FUNC_STRTOD
+AC_FUNC_VFORK
AC_FUNC_VPRINTF
if test $ac_cv_func_vprintf = yes ; then
AC_CHECK_FUNCS( \
bcopy \
+ endgrent \
+ endpwent \
flock \
- getdtablesize \
+ getdtablesize \
+ getgrgid \
gethostname \
+ getpass \
getpwuid \
- gettimeofday \
+ gettimeofday \
lockf \
memcpy \
memmove \
mkstemp \
+ recv \
+ recvfrom \
select \
setpwfile \
setsid \
strspn \
sysconf \
waitpid \
+ wait4 \
)
+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
+
dnl We actually may need to replace more than this.
AC_REPLACE_FUNCS(getopt tempnam)
# Check Configuration
OL_SYS_ERRLIST
+dnl ----------------------------------------------------------------
+dnl Check our declaration of strdup()
+OL_DECL_STRDUP
+
dnl ----------------------------------------------------------------
dnl Sort out defines
servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
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