Update pthread detection.

Update to autoconf 1.3 with aclocal from automake 1.4
This commit is contained in:
Kurt Zeilenga 1999-02-02 00:00:54 +00:00
parent 3c20cffccd
commit d589836ebe
5 changed files with 820 additions and 509 deletions

View File

@ -16,6 +16,8 @@ Changes included in OpenLDAP 1.2
Fixed mkdep to handle multiple dependent files on one line
Fixed openldap.m4 to "protect" shell variable
Fixed HAVE_PHREAD_FINAL typo
Fixed pthread detection on Digital UNIX
Updated to Autoconf 1.3 with aclocal from automake 1.4
Changes included in OpenLDAP 1.2
CVS Tag: OPENLDAP_REL_ENG_1_2_BETA

26
aclocal.m4 vendored
View File

@ -1,7 +1,7 @@
dnl aclocal.m4 generated automatically by aclocal 1.3
dnl aclocal.m4 generated automatically by aclocal 1.4
dnl Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
dnl This Makefile.in is free software; the Free Software Foundation
dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@ -27,7 +27,7 @@ dnl Usage:
dnl AM_INIT_AUTOMAKE(package,version, [no-define])
AC_DEFUN(AM_INIT_AUTOMAKE,
[AC_REQUIRE([AM_PROG_INSTALL])
[AC_REQUIRE([AC_PROG_INSTALL])
PACKAGE=[$1]
AC_SUBST(PACKAGE)
VERSION=[$2]
@ -37,8 +37,8 @@ if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
fi
ifelse([$3],,
AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
AC_DEFINE_UNQUOTED(VERSION, "$VERSION"))
AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
AC_REQUIRE([AM_SANITY_CHECK])
AC_REQUIRE([AC_ARG_PROGRAM])
dnl FIXME This is truly gross.
@ -50,15 +50,6 @@ AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
AC_REQUIRE([AC_PROG_MAKE_SET])])
# serial 1
AC_DEFUN(AM_PROG_INSTALL,
[AC_REQUIRE([AC_PROG_INSTALL])
test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
AC_SUBST(INSTALL_SCRIPT)dnl
])
#
# Check to make sure that the build environment is sane.
#
@ -476,7 +467,8 @@ AC_DEFUN(AM_HEADER_TIOCGWINSZ_NEEDS_SYS_IOCTL,
fi
])
if test $am_cv_sys_tiocgwinsz_needs_sys_ioctl_h = yes; then
AC_DEFINE(GWINSZ_IN_SYS_IOCTL)
AC_DEFINE(GWINSZ_IN_SYS_IOCTL,1,
[Define if TIOCGWINSZ requires sys/ioctl.h])
fi
])
@ -504,7 +496,7 @@ AC_DEFUN(AM_TYPE_PTRDIFF_T,
[AC_TRY_COMPILE([#include <stddef.h>], [ptrdiff_t p],
am_cv_type_ptrdiff_t=yes, am_cv_type_ptrdiff_t=no)])
if test $am_cv_type_ptrdiff_t = yes; then
AC_DEFINE(HAVE_PTRDIFF_T)
AC_DEFINE(HAVE_PTRDIFF_T,1,[Define if system has ptrdiff_t type])
fi
])

1203
configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -15,7 +15,7 @@ AM_INIT_AUTOMAKE(openldap,[1.2], [no ac_define])dnl
dnl Do not use AutoConf 2.12; it produces a configuration script
dnl that causes an "internal 2K buffer" error on HPUX when run
dnl with /bin/sh. Autoconf 2.10 seems to be okay.
AC_PREREQ(2.10)dnl Required Autoconf version
AC_PREREQ(2.13)dnl Required Autoconf version
AC_CONFIG_HEADER(include/portable.h)dnl
@ -392,9 +392,36 @@ if test $ol_with_threads = auto -o $ol_with_threads = yes \
AC_DEFINE(HAVE_LINUX_THREADS,1)
fi
dnl Now the hard part, how to link
dnl Now the hard part, how to link?
dnl
dnl currently supported checks:
dnl
dnl 0) pthread_create() in $LIBS
dnl
dnl Check special pthread (final) flags
dnl 1) pthread_create() with -kthread (FreeBSD)
dnl 2) pthread_create() with -pthread (FreeBSD)
dnl 3) pthread_create() with -pthreads (OSF/1)
dnl 4) pthread_create() with -thread (?)
dnl
dnl Check pthread (final) libraries
dnl 5) pthread_mutex_lock() in -lpthread -lexc (OSF/1)
dnl 6) pthread_mutex_unlock() in -lpthread -lmach -lexc -lc_r (OSF/1)
dnl 7) pthread_create() in -lpthread (many)
dnl 8) pthread_create() in -lc_r (FreeBSD)
dnl 9) pthread_create() in -lpthreads (many)
dnl 10) pthread_join() -Wl,-woff,85 -lpthreads (IRIX)
dnl 11) pthread_create() in HP-UX -lpthread (HP-UX 11)
dnl
dnl Check pthread (draft4) flags (to be depreciated)
dnl 12) pthread_create() with -threads (OSF/1)
dnl
dnl Check pthread (final) libraries (to be depreciated)
dnl 13) pthread_mutex_lock() in -lpthreads -lexc (OSF/1)
dnl 14) pthread_mutex_unlock() in -lpthreads -lmach -lexc -lc_r (OSF/1)
dnl
dnl Check for pthread support in current $LIBS
dnl pthread_create in $LIBS
AC_CHECK_FUNC(pthread_create,[ol_link_threads=yes])
if test $ol_link_threads = no ; then
@ -491,11 +518,11 @@ if test $ol_with_threads = auto -o $ol_with_threads = yes \
fi
if test $ol_link_threads = no ; then
dnl try DEC Threads -lpthreads -lmach -lexc -lc_r
dnl try DEC Threads -lpthread -lmach -lexc -lc_r
save_LIBS="$LIBS"
AC_CHECK_LIB(pthreads, pthread_mutex_unlock, [
AC_CHECK_LIB(pthread, pthread_mutex_unlock, [
ol_link_threads=posix
LTHREAD_LIBS="$LTHREAD_LIBS -lpthreads -lmach -lexc -lc_r"
LTHREAD_LIBS="$LTHREAD_LIBS -lpthread -lmach -lexc -lc_r"
if test $ol_with_yielding_select = auto ; then
ol_with_yielding_select=yes
fi
@ -572,6 +599,52 @@ if test $ol_with_threads = auto -o $ol_with_threads = yes \
fi
fi
if test $ol_link_threads = no ; then
dnl try -threads
AC_CACHE_CHECK([for pthread_create with -threads],
[ol_cv_thread_flag], [
dnl save the flags
save_LIBS="$LIBS"
LIBS="-threads $LIBS"
AC_TRY_LINK([char pthread();],[
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 -threads"
ol_link_threads=posix
fi
fi
if test $ol_link_threads = no ; then
dnl try DEC Threads -lpthreads -lexc
save_LIBS="$LIBS"
AC_CHECK_LIB(pthreads, pthread_mutex_lock, [
ol_link_threads=posix
LTHREAD_LIBS="$LTHREAD_LIBS -lpthreads -lexc"
if test $ol_with_yielding_select = auto ; then
ol_with_yielding_select=yes
fi
],:,[-lexc])
LIBS="$save_LIBS"
fi
if test $ol_link_threads = no ; then
dnl try DEC Threads -lpthreads -lmach -lexc -lc_r
save_LIBS="$LIBS"
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
],:,[-lmach -lexc -lc_r])
LIBS="$save_LIBS"
fi
if test $ol_link_threads != no ; then
AC_DEFINE(HAVE_PTHREADS)

View File

@ -119,9 +119,6 @@
/* define this if sys_errlist is not defined in stdio.h or errno.h */
#undef DECL_SYS_ERRLIST
/* define this if TIOCGWINSZ is defined in sys/ioctl.h */
#undef GWINSZ_IN_SYS_IOCTL
/* define if you have berkeley db */
#undef HAVE_BERKELEY_DB
@ -173,9 +170,6 @@
/* define if your POSIX Threads implementation is circa Draft 4 */
#undef HAVE_PTHREADS_D4
/* define if you have ptrdiff_t */
#undef HAVE_PTRDIFF_T
/* define if you have res_search() */
#ifdef __notdef__
/* see second res_search define */
@ -583,6 +577,13 @@
/* Define if you have the socket library (-lsocket). */
#undef HAVE_LIBSOCKET
/* Define if TIOCGWINSZ requires sys/ioctl.h */
#undef GWINSZ_IN_SYS_IOCTL
/* Define if system has ptrdiff_t type */
#undef HAVE_PTRDIFF_T
/* portable.h.bot begin */
/*
* Copyright 1998,1999 The OpenLDAP Foundation, Redwood City, California, USA