From c73b242284eebb70674db94277a7e303e78efefb Mon Sep 17 00:00:00 2001 From: "cls%seawood.org" Date: Fri, 2 Sep 2005 02:44:37 +0000 Subject: [PATCH] Skip libpthread check in Darwin builds Bug #212708 r=wtc --- nsprpub/configure | 29 ++++++++++++++++++----------- nsprpub/configure.in | 27 +++++++++++++++++---------- 2 files changed, 35 insertions(+), 21 deletions(-) diff --git a/nsprpub/configure b/nsprpub/configure index 8d87a24d9307..c15d109d1830 100755 --- a/nsprpub/configure +++ b/nsprpub/configure @@ -5136,9 +5136,14 @@ esac - +case "$target_os" in +darwin*) + _HAVE_PTHREADS=1 + ;; +*) + echo $ac_n "checking for pthread_create in -lpthreads""... $ac_c" 1>&6 -echo "configure:5142: checking for pthread_create in -lpthreads" >&5 +echo "configure:5147: checking for pthread_create in -lpthreads" >&5 echo " #include void *foo(void *v) { return v; } @@ -5160,7 +5165,7 @@ echo " echo "$ac_t""no" 1>&6 echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6 -echo "configure:5164: checking for pthread_create in -lpthread" >&5 +echo "configure:5169: checking for pthread_create in -lpthread" >&5 echo " #include void *foo(void *v) { return v; } @@ -5182,7 +5187,7 @@ echo " echo "$ac_t""no" 1>&6 echo $ac_n "checking for pthread_create in -lc_r""... $ac_c" 1>&6 -echo "configure:5186: checking for pthread_create in -lc_r" >&5 +echo "configure:5191: checking for pthread_create in -lc_r" >&5 echo " #include void *foo(void *v) { return v; } @@ -5204,7 +5209,7 @@ echo " echo "$ac_t""no" 1>&6 echo $ac_n "checking for pthread_create in -lc""... $ac_c" 1>&6 -echo "configure:5208: checking for pthread_create in -lc" >&5 +echo "configure:5213: checking for pthread_create in -lc" >&5 echo " #include void *foo(void *v) { return v; } @@ -5222,22 +5227,24 @@ echo " if test "$_res" = "0"; then echo "$ac_t""yes" 1>&6 _HAVE_PTHREADS=1 - + else echo "$ac_t""no" 1>&6 fi + + fi + fi fi + ;; +esac - fi - - # Check whether --with-pthreads or --without-pthreads was given. if test "${with_pthreads+set}" = set; then withval="$with_pthreads" @@ -5356,7 +5363,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:5360: checking whether ${CC-cc} accepts -pthread" >&5 +echo "configure:5367: 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 @@ -5379,7 +5386,7 @@ echo "configure:5360: checking whether ${CC-cc} accepts -pthread" >&5 ac_cv_have_dash_pthreads=no if test "$ac_cv_have_dash_pthread" = "no"; then echo $ac_n "checking whether ${CC-cc} accepts -pthreads""... $ac_c" 1>&6 -echo "configure:5383: checking whether ${CC-cc} accepts -pthreads" >&5 +echo "configure:5390: checking whether ${CC-cc} accepts -pthreads" >&5 echo 'int main() { return 0; }' | cat > conftest.c ${CC-cc} -pthreads -o conftest conftest.c > conftest.out 2>&1 if test $? -eq 0; then diff --git a/nsprpub/configure.in b/nsprpub/configure.in index 1bbf2ef40deb..3b2d97808084 100644 --- a/nsprpub/configure.in +++ b/nsprpub/configure.in @@ -2188,19 +2188,26 @@ echo " fi ]) -MOZ_CHECK_PTHREADS(pthreads, - _HAVE_PTHREADS=1 _PTHREAD_LDFLAGS="-lpthreads", - MOZ_CHECK_PTHREADS(pthread, - _HAVE_PTHREADS=1 _PTHREAD_LDFLAGS="-lpthread", - MOZ_CHECK_PTHREADS(c_r, - _HAVE_PTHREADS=1 _PTHREAD_LDFLAGS="-lc_r", - MOZ_CHECK_PTHREADS(c, - _HAVE_PTHREADS=1 +case "$target_os" in +darwin*) + _HAVE_PTHREADS=1 + ;; +*) + MOZ_CHECK_PTHREADS(pthreads, + _HAVE_PTHREADS=1 _PTHREAD_LDFLAGS="-lpthreads", + MOZ_CHECK_PTHREADS(pthread, + _HAVE_PTHREADS=1 _PTHREAD_LDFLAGS="-lpthread", + MOZ_CHECK_PTHREADS(c_r, + _HAVE_PTHREADS=1 _PTHREAD_LDFLAGS="-lc_r", + MOZ_CHECK_PTHREADS(c, + _HAVE_PTHREADS=1 + ) ) ) ) -) - + ;; +esac + AC_ARG_WITH(pthreads, [ --with-pthreads Use system pthreads library as thread subsystem], [ if test "$withval" = "yes"; then