summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcls%seawood.org <devnull@localhost>1999-11-22 21:59:08 +0000
committercls%seawood.org <devnull@localhost>1999-11-22 21:59:08 +0000
commit95f2ad05b43ae3322d83e88a0abfb53bc6e8749e (patch)
tree6a0353f0127b99eca673d2f3dff3f2a352b41a82
parent6c8111f74228d489dc35c0cdb8babe4919daa8ad (diff)
downloadnspr-hg-95f2ad05b43ae3322d83e88a0abfb53bc6e8749e.tar.gz
Check for pthread symbols in libc if the checks in libpthread & libc_r fail.
Fix typo in MOZ_OPTIMIZE check.
-rwxr-xr-xconfigure85
-rw-r--r--configure.in20
2 files changed, 69 insertions, 36 deletions
diff --git a/configure b/configure
index 1bf620a3..7f4eab4f 100755
--- a/configure
+++ b/configure
@@ -2711,14 +2711,8 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
_HAVE_PTHREADS=1 _PTHREAD_LDFLAGS="-lpthread"
else
echo "$ac_t""no" 1>&6
-fi
-
-
-if test "x$ac_cv_lib_pthread_pthread_attr_init" = "xno" -a \
-"x$ac_cv_lib_c_r_gethostbyname_r" = "xno"
-then
- echo $ac_n "checking for pthread_attr_init in -lc_r""... $ac_c" 1>&6
-echo "configure:2722: checking for pthread_attr_init in -lc_r" >&5
+echo $ac_n "checking for pthread_attr_init in -lc_r""... $ac_c" 1>&6
+echo "configure:2716: checking for pthread_attr_init in -lc_r" >&5
ac_lib_var=`echo c_r'_'pthread_attr_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
@@ -2726,7 +2720,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lc_r $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2730 "configure"
+#line 2724 "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
@@ -2737,7 +2731,7 @@ int main() {
pthread_attr_init()
; return 0; }
EOF
-if { (eval echo configure:2741: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2735: \"$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
@@ -2755,9 +2749,52 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
_HAVE_PTHREADS=1 _PTHREAD_LDFLAGS="-lc_r"
else
echo "$ac_t""no" 1>&6
+echo $ac_n "checking for pthread_attr_init in -lc""... $ac_c" 1>&6
+echo "configure:2754: checking for pthread_attr_init in -lc" >&5
+ac_lib_var=`echo c'_'pthread_attr_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="-lc $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 2762 "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 pthread_attr_init();
+
+int main() {
+pthread_attr_init()
+; return 0; }
+EOF
+if { (eval echo configure:2773: \"$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
+ _HAVE_PTHREADS=1
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+
+fi
+
+
+fi
+
# Check whether --with-pthreads or --without-pthreads was given.
if test "${with_pthreads+set}" = set; then
@@ -2861,7 +2898,7 @@ if test -n "$USE_PTHREADS"; then
rm -f conftest*
ac_cv_have_dash_pthread=no
echo $ac_n "checking whether ${CC-cc} accepts -pthread""... $ac_c" 1>&6
-echo "configure:2865: checking whether ${CC-cc} accepts -pthread" >&5
+echo "configure:2902: checking whether ${CC-cc} accepts -pthread" >&5
echo 'int main() { return 0; }' | cat > conftest.c
${CC-cc} -pthread -o conftest conftest.c > conftest.out 2>&1
if test $? -eq 0; then
@@ -2909,12 +2946,12 @@ EOF
esac
echo $ac_n "checking for pthread_create""... $ac_c" 1>&6
-echo "configure:2913: checking for pthread_create" >&5
+echo "configure:2950: checking for pthread_create" >&5
if eval "test \"`echo '$''{'ac_cv_func_pthread_create'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2918 "configure"
+#line 2955 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char pthread_create(); below. */
@@ -2937,7 +2974,7 @@ pthread_create();
; return 0; }
EOF
-if { (eval echo configure:2941: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2978: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_pthread_create=yes"
else
@@ -2956,7 +2993,7 @@ else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6
-echo "configure:2960: checking for pthread_create in -lpthread" >&5
+echo "configure:2997: 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
@@ -2964,7 +3001,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lpthread $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2968 "configure"
+#line 3005 "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
@@ -2975,7 +3012,7 @@ int main() {
pthread_create()
; return 0; }
EOF
-if { (eval echo configure:2979: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3016: \"$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
@@ -3031,12 +3068,12 @@ EOF
esac
echo $ac_n "checking for dlopen""... $ac_c" 1>&6
-echo "configure:3035: checking for dlopen" >&5
+echo "configure:3072: checking for dlopen" >&5
if eval "test \"`echo '$''{'ac_cv_func_dlopen'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3040 "configure"
+#line 3077 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char dlopen(); below. */
@@ -3059,7 +3096,7 @@ dlopen();
; return 0; }
EOF
-if { (eval echo configure:3063: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3100: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_dlopen=yes"
else
@@ -3078,7 +3115,7 @@ else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
-echo "configure:3082: checking for dlopen in -ldl" >&5
+echo "configure:3119: checking for dlopen in -ldl" >&5
ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -3086,7 +3123,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 3090 "configure"
+#line 3127 "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
@@ -3097,7 +3134,7 @@ int main() {
dlopen()
; return 0; }
EOF
-if { (eval echo configure:3101: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3138: \"$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
@@ -3126,7 +3163,7 @@ if test "$enable_shared" = no; then
EXTRA_LIBS="$OS_LIBS"
fi
-if test -n "$MOZ_OPTIMZE"; then
+if test -n "$MOZ_OPTIMIZE"; then
CFLAGS="$CFLAGS $_OPTIMIZE_FLAGS"
CXXFLAGS="$CXXFLAGS $_OPTIMIZE_FLAGS"
fi
diff --git a/configure.in b/configure.in
index 47b60eaf..f320a907 100644
--- a/configure.in
+++ b/configure.in
@@ -472,17 +472,13 @@ AC_ARG_WITH(mozilla,
fi])
AC_CHECK_LIB(pthread, pthread_attr_init,
- _HAVE_PTHREADS=1 _PTHREAD_LDFLAGS="-lpthread")
-
-dnl
-dnl If the above test failed, try lib c_r
-dnl
-if test "x$ac_cv_lib_pthread_pthread_attr_init" = "xno" -a \
-"x$ac_cv_lib_c_r_gethostbyname_r" = "xno"
-then
- AC_CHECK_LIB(c_r, pthread_attr_init,
- _HAVE_PTHREADS=1 _PTHREAD_LDFLAGS="-lc_r")
-fi
+ _HAVE_PTHREADS=1 _PTHREAD_LDFLAGS="-lpthread",
+ AC_CHECK_LIB(c_r, pthread_attr_init,
+ _HAVE_PTHREADS=1 _PTHREAD_LDFLAGS="-lc_r",
+ AC_CHECK_LIB(c, pthread_attr_init,
+ _HAVE_PTHREADS=1 )
+ )
+ )
AC_ARG_WITH(pthreads,
[ --with-pthreads Use system pthreads library as thread subsystem],
@@ -640,7 +636,7 @@ if test "$enable_shared" = no; then
EXTRA_LIBS="$OS_LIBS"
fi
-if test -n "$MOZ_OPTIMZE"; then
+if test -n "$MOZ_OPTIMIZE"; then
CFLAGS="$CFLAGS $_OPTIMIZE_FLAGS"
CXXFLAGS="$CXXFLAGS $_OPTIMIZE_FLAGS"
fi