From: Kurt Zeilenga Date: Thu, 10 Jun 1999 17:19:43 +0000 (+0000) Subject: Update AIX thread test. X-Git-Tag: OPENLDAP_REL_ENG_2_BP~348 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=a40f92813d8fcce33f8816d4a8eb201f4de8b190;p=openldap Update AIX thread test. --- diff --git a/configure b/configure index ab8fe08b1d..c5da2bfbed 100755 --- a/configure +++ b/configure @@ -1815,54 +1815,13 @@ TERMCAP_LIBS= TLS_LIBS= - -save_CC="$CC" -if test -z "${CC}"; then - for ac_prog in cc -do -# Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1827: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_CC="$ac_prog" - break - fi - done - IFS="$ac_save_ifs" -fi -fi -CC="$ac_cv_prog_CC" -if test -n "$CC"; then - echo "$ac_t""$CC" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - -test -n "$CC" && break -done - -fi - - - # Make sure we can run config.sub. if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then : else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } fi echo $ac_n "checking host system type""... $ac_c" 1>&6 -echo "configure:1866: checking host system type" >&5 +echo "configure:1825: checking host system type" >&5 host_alias=$host case "$host_alias" in @@ -1883,25 +1842,27 @@ host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo "$ac_t""$host" 1>&6 -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 "$host" in +*-*-aix*) + if test -z "CC" -a "$ol_host_os" = aix ; 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= - for ac_prog in cc_r xlc_r +if test -z "${CC}" -a $ol_aix_threads = yes ; then + for ac_prog in cc_r xlc_r cc do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1905: checking for $ac_word" >&5 +echo "configure:1866: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1931,19 +1892,58 @@ test -n "$CC" && break done - if test "$CC" ; then - if test $ol_with_threads != auto ; then + if test "$CC" = cc ; then + if test $ol_with_threads != auto ; then { echo "configure: error: --with-threads requires cc_r (or other suitable compiler) on AIX" 1>&2; exit 1; } else echo "configure: warning: disabling threads, no cc_r on AIX" 1>&2 fi ol_with_threads=no - else + + elif test "$CC" ; then ol_with_threads=posix ol_cv_pthread_create=yes fi fi +if test -z "${CC}"; then + for ac_prog in cc +do +# Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1916: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_CC="$ac_prog" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +test -n "$CC" && break +done + +fi + + # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 @@ -11866,12 +11866,12 @@ s%@MAKEINFO@%$MAKEINFO%g s%@SET_MAKE@%$SET_MAKE%g s%@top_builddir@%$top_builddir%g s%@ldap_subdir@%$ldap_subdir%g -s%@CC@%$CC%g s%@host@%$host%g s%@host_alias@%$host_alias%g s%@host_cpu@%$host_cpu%g s%@host_vendor@%$host_vendor%g s%@host_os@%$host_os%g +s%@CC@%$CC%g s%@RANLIB@%$RANLIB%g s%@LD@%$LD%g s%@NM@%$NM%g diff --git a/configure.in b/configure.in index eecf6d69c9..6f1477d5cc 100644 --- a/configure.in +++ b/configure.in @@ -304,61 +304,62 @@ READLINE_LIBS= TERMCAP_LIBS= TLS_LIBS= +dnl ---------------------------------------------------------------- +dnl Determine host platform +dnl we try not to use this for much +AC_CANONICAL_HOST + dnl ---------------------------------------------------------------- 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 "$host" in +*-*-aix*) dnl all AIX is not a good idea. + if test -z "CC" -a "$ol_host_os" = aix ; 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 -z "${CC}" -a $ol_aix_threads = yes ; then + AC_CHECK_PROGS(CC,cc_r xlc_r cc) - if test "$CC" ; then + 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 - else + + elif test "$CC" ; 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