Skip to content

Commit

Permalink
check for Pth *after* the standard system threading libraries. Pth sh…
Browse files Browse the repository at this point in the history
…ould

not override those.

Submitted by: [email protected]
  • Loading branch information
Greg Stein committed Jul 5, 2000
1 parent a7acf42 commit adf63d6
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 71 deletions.
134 changes: 67 additions & 67 deletions configure
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! /bin/sh

# From configure.in Revision: 1.131
# From configure.in Revision: 1.132

# Guess values for system-dependent variables and create Makefiles.
# Generated automatically using autoconf version 2.13
Expand Down Expand Up @@ -2987,66 +2987,18 @@ EOF

LIBOBJS="$LIBOBJS thread.o"
else
echo "$ac_t""no" 1>&6

echo $ac_n "checking for pth_init in -lpth""... $ac_c" 1>&6
echo "configure:2994: checking for pth_init in -lpth" >&5
ac_lib_var=`echo pth'_'pth_init | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_save_LIBS="$LIBS"
LIBS="-lpth $LIBS"
cat > conftest.$ac_ext <<EOF
#line 3002 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char pth_init();
int main() {
pth_init()
; return 0; }
EOF
if { (eval echo configure:3013: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
echo "$ac_t""yes" 1>&6
cat >> confdefs.h <<\EOF
#define WITH_THREAD 1
EOF

cat >> confdefs.h <<\EOF
#define _GNU_PTH 1
EOF

LIBS="-lpth $LIBS"
LIBOBJS="$LIBOBJS thread.o"
else
echo "$ac_t""no" 1>&6

echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6
echo "configure:3042: checking for pthread_create in -lpthread" >&5
echo "configure:2994: checking for pthread_create in -lpthread" >&5
ac_lib_var=`echo pthread'_'pthread_create | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_save_LIBS="$LIBS"
LIBS="-lpthread $LIBS"
cat > conftest.$ac_ext <<EOF
#line 3050 "configure"
#line 3002 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
Expand All @@ -3057,7 +3009,7 @@ int main() {
pthread_create()
; return 0; }
EOF
if { (eval echo configure:3061: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:3013: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
Expand Down Expand Up @@ -3086,12 +3038,12 @@ else
echo "$ac_t""no" 1>&6

echo $ac_n "checking for pthread_detach""... $ac_c" 1>&6
echo "configure:3090: checking for pthread_detach" >&5
echo "configure:3042: checking for pthread_detach" >&5
if eval "test \"`echo '$''{'ac_cv_func_pthread_detach'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 3095 "configure"
#line 3047 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char pthread_detach(); below. */
Expand All @@ -3114,7 +3066,7 @@ pthread_detach();
; return 0; }
EOF
if { (eval echo configure:3118: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:3070: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_pthread_detach=yes"
else
Expand Down Expand Up @@ -3142,17 +3094,17 @@ else

ac_safe=`echo "kernel/OS.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for kernel/OS.h""... $ac_c" 1>&6
echo "configure:3146: checking for kernel/OS.h" >&5
echo "configure:3098: checking for kernel/OS.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 3151 "configure"
#line 3103 "configure"
#include "confdefs.h"
#include <kernel/OS.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:3156: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:3108: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
Expand Down Expand Up @@ -3181,15 +3133,15 @@ else
echo "$ac_t""no" 1>&6

echo $ac_n "checking for pthread_create in -lpthreads""... $ac_c" 1>&6
echo "configure:3185: checking for pthread_create in -lpthreads" >&5
echo "configure:3137: checking for pthread_create in -lpthreads" >&5
ac_lib_var=`echo pthreads'_'pthread_create | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_save_LIBS="$LIBS"
LIBS="-lpthreads $LIBS"
cat > conftest.$ac_ext <<EOF
#line 3193 "configure"
#line 3145 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
Expand All @@ -3200,7 +3152,7 @@ int main() {
pthread_create()
; return 0; }
EOF
if { (eval echo configure:3204: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:3156: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
Expand Down Expand Up @@ -3229,15 +3181,15 @@ else
echo "$ac_t""no" 1>&6

echo $ac_n "checking for pthread_create in -lc_r""... $ac_c" 1>&6
echo "configure:3233: checking for pthread_create in -lc_r" >&5
echo "configure:3185: checking for pthread_create in -lc_r" >&5
ac_lib_var=`echo c_r'_'pthread_create | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_save_LIBS="$LIBS"
LIBS="-lc_r $LIBS"
cat > conftest.$ac_ext <<EOF
#line 3241 "configure"
#line 3193 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
Expand All @@ -3248,7 +3200,7 @@ int main() {
pthread_create()
; return 0; }
EOF
if { (eval echo configure:3252: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:3204: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
Expand Down Expand Up @@ -3277,15 +3229,15 @@ else
echo "$ac_t""no" 1>&6

echo $ac_n "checking for __d6_pthread_create in -lthread""... $ac_c" 1>&6
echo "configure:3281: checking for __d6_pthread_create in -lthread" >&5
echo "configure:3233: checking for __d6_pthread_create in -lthread" >&5
ac_lib_var=`echo thread'_'__d6_pthread_create | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_save_LIBS="$LIBS"
LIBS="-lthread $LIBS"
cat > conftest.$ac_ext <<EOF
#line 3289 "configure"
#line 3241 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
Expand All @@ -3296,7 +3248,7 @@ int main() {
__d6_pthread_create()
; return 0; }
EOF
if { (eval echo configure:3300: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:3252: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
Expand Down Expand Up @@ -3324,6 +3276,54 @@ EOF
else
echo "$ac_t""no" 1>&6

echo $ac_n "checking for pth_init in -lpth""... $ac_c" 1>&6
echo "configure:3281: checking for pth_init in -lpth" >&5
ac_lib_var=`echo pth'_'pth_init | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_save_LIBS="$LIBS"
LIBS="-lpth $LIBS"
cat > conftest.$ac_ext <<EOF
#line 3289 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char pth_init();
int main() {
pth_init()
; return 0; }
EOF
if { (eval echo configure:3300: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
echo "$ac_t""yes" 1>&6
cat >> confdefs.h <<\EOF
#define WITH_THREAD 1
EOF

cat >> confdefs.h <<\EOF
#define _GNU_PTH 1
EOF

LIBS="-lpth $LIBS"
LIBOBJS="$LIBOBJS thread.o"
else
echo "$ac_t""no" 1>&6

echo $ac_n "checking for pthread_create in -lcma""... $ac_c" 1>&6
echo "configure:3329: checking for pthread_create in -lcma" >&5
ac_lib_var=`echo cma'_'pthread_create | sed 'y%./+-%__p_%'`
Expand Down
8 changes: 4 additions & 4 deletions configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -684,10 +684,6 @@ else
AC_CHECK_HEADER(mach/cthreads.h, [AC_DEFINE(WITH_THREAD)
AC_DEFINE(C_THREADS)
LIBOBJS="$LIBOBJS thread.o"],[
AC_CHECK_LIB(pth, pth_init, [AC_DEFINE(WITH_THREAD)
AC_DEFINE(_GNU_PTH)
LIBS="-lpth $LIBS"
LIBOBJS="$LIBOBJS thread.o"],[
AC_CHECK_LIB(pthread, pthread_create, [AC_DEFINE(WITH_THREAD)
AC_DEFINE(_POSIX_THREADS)
LIBS="-lpthread $LIBS"
Expand All @@ -710,6 +706,10 @@ else
AC_DEFINE(_POSIX_THREADS)
LIBS="$LIBS -lthread"
LIBOBJS="$LIBOBJS thread.o"], [
AC_CHECK_LIB(pth, pth_init, [AC_DEFINE(WITH_THREAD)
AC_DEFINE(_GNU_PTH)
LIBS="-lpth $LIBS"
LIBOBJS="$LIBOBJS thread.o"],[
AC_CHECK_LIB(cma, pthread_create, [AC_DEFINE(WITH_THREAD)
AC_DEFINE(_POSIX_THREADS)
LIBS="$LIBS -lcma"
Expand Down

0 comments on commit adf63d6

Please sign in to comment.