X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=configure.in;h=429b38bde325870df71f0c2913d8bb9cca6e69c1;hb=63498d1a2199eeca1db4ca7d27e665cbd73cb095;hp=bb7ca3d080ff27286dc9603ca20e750b59f9f4e9;hpb=e88a9dafc278b2dea489dd5d681d02a5a35181e8;p=openldap diff --git a/configure.in b/configure.in index bb7ca3d080..429b38bde3 100644 --- a/configure.in +++ b/configure.in @@ -311,13 +311,54 @@ 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_PROG(CC,cc,cc,) + 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 +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 + auto | yes | posix) ol_aix_threads=yes ;; + esac +fi + +if test ol_aix_threads = yes ; then + CC= + AC_CHECK_PROGS(CC,cc_r xlc_r) + + 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 + ol_with_threads=posix + ol_cv_pthread_create=yes + fi +fi + AM_PROG_LIBTOOL dnl AC_PROG_MAKE_SET @@ -1595,6 +1636,7 @@ fi AC_CHECK_FUNCS( \ bcopy \ + closesocket \ endgrent \ endpwent \ flock \