Skip libpthread check in Darwin builds MOZILLA_1_8_BRANCH
authorwtchang%redhat.com
Thu, 15 Sep 2005 22:37:52 +0000
branchMOZILLA_1_8_BRANCH
changeset 3459 0037c65911701601b65979883f0624b1024fd2e8
parent 3445 979605f7cc240056909ea3d723d84e2a20241f50
child 3460 7bddd201b9b13b90f14e7a1a022e4a9a014971b0
push idunknown
push userunknown
push dateunknown
bugs212708
Skip libpthread check in Darwin builds Bug #212708 r=wtc a=asa for mozilla1.8b5 Tag: MOZILLA_1_8_BRANCH
configure
configure.in
--- a/configure
+++ b/configure
@@ -5131,19 +5131,24 @@ echo "$ac_t""$ac_cv_hpux_usable_olit_opt
         CXXFLAGS="$CXXFLAGS +ESlit"
     fi
 fi
 ;;
 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 <pthread.h> 
     void *foo(void *v) { return v; } 
     int main() { 
         pthread_t t;
         if (!pthread_create(&t, 0, &foo, 0)) {
             pthread_join(t, 0);
         }
@@ -5155,17 +5160,17 @@ echo "
     rm -f dummy.c dummy${ac_exeext} ;
     if test "$_res" = "0"; then
         echo "$ac_t""yes" 1>&6
         _HAVE_PTHREADS=1 _PTHREAD_LDFLAGS="-lpthreads"
     else
         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 <pthread.h> 
     void *foo(void *v) { return v; } 
     int main() { 
         pthread_t t;
         if (!pthread_create(&t, 0, &foo, 0)) {
             pthread_join(t, 0);
         }
@@ -5177,17 +5182,17 @@ echo "
     rm -f dummy.c dummy${ac_exeext} ;
     if test "$_res" = "0"; then
         echo "$ac_t""yes" 1>&6
         _HAVE_PTHREADS=1 _PTHREAD_LDFLAGS="-lpthread"
     else
         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 <pthread.h> 
     void *foo(void *v) { return v; } 
     int main() { 
         pthread_t t;
         if (!pthread_create(&t, 0, &foo, 0)) {
             pthread_join(t, 0);
         }
@@ -5199,17 +5204,17 @@ echo "
     rm -f dummy.c dummy${ac_exeext} ;
     if test "$_res" = "0"; then
         echo "$ac_t""yes" 1>&6
         _HAVE_PTHREADS=1 _PTHREAD_LDFLAGS="-lc_r"
     else
         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 <pthread.h> 
     void *foo(void *v) { return v; } 
     int main() { 
         pthread_t t;
         if (!pthread_create(&t, 0, &foo, 0)) {
             pthread_join(t, 0);
         }
@@ -5217,32 +5222,34 @@ echo "
     }" > dummy.c ;
     echo "${CC-cc} -o dummy${ac_exeext} dummy.c $CFLAGS $CPPFLAGS -lc $LDFLAGS $LIBS" 1>&5;
     ${CC-cc} -o dummy${ac_exeext} dummy.c $CFLAGS $CPPFLAGS -lc $LDFLAGS $LIBS 2>&5;
     _res=$? ;
     rm -f dummy.c dummy${ac_exeext} ;
     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
 
-
-    fi
-
-                        
+    ;;
+esac
+
 # Check whether --with-pthreads or --without-pthreads was given.
 if test "${with_pthreads+set}" = set; then
   withval="$with_pthreads"
    if test "$withval" = "yes"; then
 	    if test -n "$_HAVE_PTHREADS"; then
 		    USE_PTHREADS=1 
 		    USE_USER_PTHREADS=
 		    USE_NSPR_THREADS=
@@ -5351,17 +5358,17 @@ EOF
     fi
 fi
 
 
 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
 	if test -z "`egrep -i '(unrecognize|unknown)' conftest.out | grep pthread`" && test -z "`egrep -i '(error|incorrect)' conftest.out`" ; then
 	    ac_cv_have_dash_pthread=yes
 		case "$target_os" in
 	    freebsd*)
 # Freebsd doesn't use -pthread for compiles, it uses them for linking
@@ -5374,17 +5381,17 @@ echo "configure:5360: checking whether $
 	fi
     fi
     rm -f conftest*
     echo "$ac_t""$ac_cv_have_dash_pthread" 1>&6
 
 			    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
 	    	if test -z "`egrep -i '(unrecognize|unknown)' conftest.out | grep pthreads`" && test -z "`egrep -i '(error|incorrect)' conftest.out`" ; then
 			    ac_cv_have_dash_pthreads=yes
 			    CFLAGS="$CFLAGS -pthreads"
 			    CXXFLAGS="$CXXFLAGS -pthreads"
 		    fi
--- a/configure.in
+++ b/configure.in
@@ -2183,29 +2183,36 @@ echo "
         AC_MSG_RESULT([yes])
         [$2]
     else
         AC_MSG_RESULT([no])
         [$3]
     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
 	    if test -n "$_HAVE_PTHREADS"; then
 		    USE_PTHREADS=1 
 		    USE_USER_PTHREADS=
 		    USE_NSPR_THREADS=
 	    else