Bugzilla bug #70834: made configure work on NetBSD. Thanks to
authorwtc%netscape.com
Wed, 06 Jun 2001 16:05:57 +0000
changeset 1924 9b1bf03958dd3d516cebec23bcdeda2d7da6fd50
parent 1923 bc688f29a7f849e0b285735b0850f195afba9729
child 1925 683ec1bde7bc86c649573a26072b7cbd6fec8fce
push idunknown
push userunknown
push dateunknown
bugs70834
Bugzilla bug #70834: made configure work on NetBSD. Thanks to taya@sm.sony.co.jp (Shin'ichiro TAYA) for the patch. Also fixed some typos. Modified files: configure.in, configure.
configure
configure.in
--- a/configure
+++ b/configure
@@ -3790,37 +3790,40 @@ EOF
     cat >> confdefs.h <<\EOF
 #define NETBSD 1
 EOF
 
     cat >> confdefs.h <<\EOF
 #define HAVE_BSD_FLOCK 1
 EOF
 
+    USE_NSPR_THREADS=1
+    MDCPUCFG_H=_netbsd.cfg
+    PR_MD_CSRCS=netbsd.c
+
+    DSO_CFLAGS='-fPIC -DPIC'
+    CFLAGS="$CFLAGS -ansi -Wall -pipe"
+    CXXFLAGS="$CXXFLAGS -ansi -Wall -pipe"
+    MKSHLIB='$(CC) -o $@ $(DSO_LDOPTS)'
+
     if test -z "$OBJECT_FMT"; then
         if echo __ELF__ | ${CC-cc} -E - | grep -q __ELF__ 2>/dev/null; then
-            OBJECT_FMT=a.out;
+            OBJECT_FMT=a.out
+            DLL_SUFFIX=so.1.0
+            DSO_LDOPTS='-shared'
         else
             OBJECT_FMT=ELF
+            DLL_SUFFIX=so
+            DSO_LDOPTS='-shared -Wl,-soname,$(notdir $@)'
         fi
     fi
-    if test "$OBJECT_FMT" = "ELF"; then
-        DLL_SUFFIX=so
-    else
-        DLL_SUFFIX=so.1.0
+
+    if test "$LIBRUNPATH"; then
+        DSO_LDOPTS="$DSO_LDOPTS -Wl,-R$LIBRUNPATH"
     fi
-    CFLAGS="$CFLAGS -ansi -Wall -pipe"
-    CXXFLAGS="$CXXFLAGS -ansi -Wall -pipe"
-    DSO_CFLAGS='-fPIC -DPIC'
-    DSO_LDOPTS='-x -shared'
-    if test "$LIBRUNPATH"; then
-        DSO_LDOPTS="$DSO_LDOPTS -R$(LIBRUNPATH)"
-    fi
-    MDCPUCFG_H=_netbsd.cfg
-    PR_MD_CSRCS=netbsd.c
     ;;
 
 mips-sony-newsos*)
     cat >> confdefs.h <<\EOF
 #define XP_UNIX 1
 EOF
 
     cat >> confdefs.h <<\EOF
@@ -3989,27 +3992,27 @@ EOF
 EOF
 
     cat >> confdefs.h <<\EOF
 #define _REENTRANT 1
 EOF
 
     ac_safe=`echo "machine/builtins.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for machine/builtins.h""... $ac_c" 1>&6
-echo "configure:3998: checking for machine/builtins.h" >&5
+echo "configure:4001: checking for machine/builtins.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 4003 "configure"
+#line 4006 "configure"
 #include "confdefs.h"
 #include <machine/builtins.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4008: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4011: \"$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*
   eval "ac_cv_header_$ac_safe=yes"
 else
   echo "$ac_err" >&5
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
@@ -4533,22 +4536,22 @@ EOF
 
     ;;
    
 esac
 
 if test -z "$SKIP_LIBRARY_CHECKS"; then
 
 echo $ac_n "checking for dlopen""... $ac_c" 1>&6
-echo "configure:4542: checking for dlopen" >&5
+echo "configure:4545: 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 4547 "configure"
+#line 4550 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char dlopen(); below.  */
 #include <assert.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 dlopen();
@@ -4561,17 +4564,17 @@ int main() {
 #if defined (__stub_dlopen) || defined (__stub___dlopen)
 choke me
 #else
 dlopen();
 #endif
 
 ; return 0; }
 EOF
-if { (eval echo configure:4570: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4573: \"$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
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
   eval "ac_cv_func_dlopen=no"
 fi
@@ -4580,36 +4583,36 @@ fi
 
 if eval "test \"`echo '$ac_cv_func_'dlopen`\" = yes"; then
   echo "$ac_t""yes" 1>&6
   :
 else
   echo "$ac_t""no" 1>&6
 
     echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
-echo "configure:4589: checking for dlopen in -ldl" >&5
+echo "configure:4592: 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
 else
   ac_save_LIBS="$LIBS"
 LIBS="-ldl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4597 "configure"
+#line 4600 "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 dlopen();
 
 int main() {
 dlopen()
 ; return 0; }
 EOF
-if { (eval echo configure:4608: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4611: \"$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
@@ -4627,23 +4630,23 @@ fi
 
 fi
 
 
 
 
 if test $ac_cv_prog_gcc = yes; then
     echo $ac_n "checking whether ${CC-cc} needs -traditional""... $ac_c" 1>&6
-echo "configure:4636: checking whether ${CC-cc} needs -traditional" >&5
+echo "configure:4639: checking whether ${CC-cc} needs -traditional" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gcc_traditional'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
     ac_pattern="Autoconf.*'x'"
   cat > conftest.$ac_ext <<EOF
-#line 4642 "configure"
+#line 4645 "configure"
 #include "confdefs.h"
 #include <sgtty.h>
 Autoconf TIOCGETP
 EOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
   egrep "$ac_pattern" >/dev/null 2>&1; then
   rm -rf conftest*
   ac_cv_prog_gcc_traditional=yes
@@ -4651,17 +4654,17 @@ else
   rm -rf conftest*
   ac_cv_prog_gcc_traditional=no
 fi
 rm -f conftest*
 
 
   if test $ac_cv_prog_gcc_traditional = no; then
     cat > conftest.$ac_ext <<EOF
-#line 4660 "configure"
+#line 4663 "configure"
 #include "confdefs.h"
 #include <termio.h>
 Autoconf TCGETA
 EOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
   egrep "$ac_pattern" >/dev/null 2>&1; then
   rm -rf conftest*
   ac_cv_prog_gcc_traditional=yes
@@ -4675,22 +4678,22 @@ echo "$ac_t""$ac_cv_prog_gcc_traditional
   if test $ac_cv_prog_gcc_traditional = yes; then
     CC="$CC -traditional"
   fi
 fi
 
 for ac_func in lchown strerror
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4684: checking for $ac_func" >&5
+echo "configure:4687: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4689 "configure"
+#line 4692 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
 #include <assert.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 $ac_func();
@@ -4703,17 +4706,17 @@ int main() {
 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
 choke me
 #else
 $ac_func();
 #endif
 
 ; return 0; }
 EOF
-if { (eval echo configure:4712: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4715: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=no"
 fi
@@ -4734,17 +4737,17 @@ done
 
 
 
 
 
 
 
 echo $ac_n "checking for pthread_create in -lpthreads""... $ac_c" 1>&6
-echo "configure:4743: checking for pthread_create in -lpthreads" >&5
+echo "configure:4746: checking for pthread_create in -lpthreads" >&5
 echo "
     #include <pthread.h> 
     void *foo(void *v) { int a = 1;  } 
     int main() { 
         pthread_t t;
         if (!pthread_create(&t, 0, &foo, 0)) {
             pthread_join(t, 0);
         }
@@ -4756,17 +4759,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:4765: checking for pthread_create in -lpthread" >&5
+echo "configure:4768: checking for pthread_create in -lpthread" >&5
 echo "
     #include <pthread.h> 
     void *foo(void *v) { int a = 1;  } 
     int main() { 
         pthread_t t;
         if (!pthread_create(&t, 0, &foo, 0)) {
             pthread_join(t, 0);
         }
@@ -4778,17 +4781,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:4787: checking for pthread_create in -lc_r" >&5
+echo "configure:4790: checking for pthread_create in -lc_r" >&5
 echo "
     #include <pthread.h> 
     void *foo(void *v) { int a = 1;  } 
     int main() { 
         pthread_t t;
         if (!pthread_create(&t, 0, &foo, 0)) {
             pthread_join(t, 0);
         }
@@ -4800,17 +4803,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:4809: checking for pthread_create in -lc" >&5
+echo "configure:4812: checking for pthread_create in -lc" >&5
 echo "
     #include <pthread.h> 
     void *foo(void *v) { int a = 1;  } 
     int main() { 
         pthread_t t;
         if (!pthread_create(&t, 0, &foo, 0)) {
             pthread_join(t, 0);
         }
@@ -4950,33 +4953,33 @@ 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:4959: checking whether ${CC-cc} accepts -pthread" >&5
+echo "configure:4962: 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
 	    CFLAGS="$CFLAGS -pthread"
 	    CXXFLAGS="$CXXFLAGS -pthread"
 	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:4975: checking whether ${CC-cc} accepts -pthreads" >&5
+echo "configure:4978: 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
@@ -5016,17 +5019,17 @@ else
         _PTHREAD_LDFLAGS=
     fi
 fi
 
 case "$target" in
 *-aix*)
     if test -n "$USE_NSPR_THREADS"; then
         cat >> confdefs.h <<\EOF
-#define -D_PR_LOCAL_THREADS_ONLY 1
+#define _PR_LOCAL_THREADS_ONLY 1
 EOF
 
     fi
     case "$target_os" in
     aix4.1*)
         if test -z "$USE_PTHREADS"; then
             cat >> confdefs.h <<\EOF
 #define AIX_RENAME_SELECT 1
@@ -5064,17 +5067,17 @@ EOF
 #define _PR_NEED_PTHREAD_INIT 1
 EOF
 
     fi
     ;;
 *-freebsd*)
     if test -n "$USE_NSPR_THREADS"; then
         cat >> confdefs.h <<\EOF
-#define -D_PR_LOCAL_THREADS_ONLY 1
+#define _PR_LOCAL_THREADS_ONLY 1
 EOF
 
     fi
     ;;
 *-hpux*)
     if test -n "$USE_NSPR_THREADS"; then
         cat >> confdefs.h <<\EOF
 #define _PR_LOCAL_THREADS_ONLY 1
@@ -5132,24 +5135,27 @@ EOF
     fi
     ;;
 *-mingw*|*-cygwin*|*-uwin*|*-msvc*)
         USE_PTHREADS=
     _PTHREAD_LDFLAGS=
     USE_USER_PTHREADS=
     ;;
 *-netbsd*)
-    if test -z "$USE_PTHREADS"; then
-        OS_LIBS="$OS_LIBS -lc"
+    if test -n "$USE_NSPR_THREADS"; then
+        cat >> confdefs.h <<\EOF
+#define _PR_LOCAL_THREADS_ONLY 1
+EOF
+
     fi
-    ;;    
+    ;;
 *-osf*)
     if test -n "$USE_NSPR_THREADS"; then
         cat >> confdefs.h <<\EOF
-#define -D_PR_LOCAL_THREADS_ONLY 1
+#define _PR_LOCAL_THREADS_ONLY 1
 EOF
 
     fi
     if test -n "$USE_PTHREADS"; then
         if echo $OS_RELEASE | egrep -c '(V2.0|V3.2)' 2>/dev/null; then
             :
         else
             cat >> confdefs.h <<\EOF
@@ -5161,24 +5167,24 @@ EOF
     ;;
 *-solaris*)
     if test -n "$USE_NATIVE_THREADS"; then
         cat >> confdefs.h <<\EOF
 #define _PR_GLOBAL_THREADS_ONLY 1
 EOF
 
     else
-        if test -n "$USE_USER_PTHREADS"; then
+        if test -n "$USE_NSPR_THREADS"; then
             cat >> confdefs.h <<\EOF
 #define _PR_LOCAL_THREADS_ONLY 1
 EOF
 
         fi
     fi
-    if test -z "$USE_USER_PTHREADS"; then
+    if test -z "$USE_NSPR_THREADS"; then
         cat >> confdefs.h <<\EOF
 #define _REENTRANT 1
 EOF
 
         cat >> confdefs.h <<\EOF
 #define HAVE_POINTER_LOCALTIME_R 1
 EOF
 
--- a/configure.in
+++ b/configure.in
@@ -1236,37 +1236,40 @@ mips-nec-sysv*)
     MDCPUCFG_H=_nec.cfg
     PR_MD_CSRCS=nec.c
     ;;
 
 *-netbsd*)
     AC_DEFINE(XP_UNIX)
     AC_DEFINE(NETBSD)
     AC_DEFINE(HAVE_BSD_FLOCK)
+    USE_NSPR_THREADS=1
+    MDCPUCFG_H=_netbsd.cfg
+    PR_MD_CSRCS=netbsd.c
+
+    DSO_CFLAGS='-fPIC -DPIC'
+    CFLAGS="$CFLAGS -ansi -Wall -pipe"
+    CXXFLAGS="$CXXFLAGS -ansi -Wall -pipe"
+    MKSHLIB='$(CC) -o $@ $(DSO_LDOPTS)'
+
     if test -z "$OBJECT_FMT"; then
         if echo __ELF__ | ${CC-cc} -E - | grep -q __ELF__ 2>/dev/null; then
-            OBJECT_FMT=a.out;
+            OBJECT_FMT=a.out
+            DLL_SUFFIX=so.1.0
+            DSO_LDOPTS='-shared'
         else
             OBJECT_FMT=ELF
+            DLL_SUFFIX=so
+            DSO_LDOPTS='-shared -Wl,-soname,$(notdir $@)'
         fi
     fi
-    if test "$OBJECT_FMT" = "ELF"; then
-        DLL_SUFFIX=so
-    else
-        DLL_SUFFIX=so.1.0
+
+    if test "$LIBRUNPATH"; then
+        DSO_LDOPTS="$DSO_LDOPTS -Wl,-R$LIBRUNPATH"
     fi
-    CFLAGS="$CFLAGS -ansi -Wall -pipe"
-    CXXFLAGS="$CXXFLAGS -ansi -Wall -pipe"
-    DSO_CFLAGS='-fPIC -DPIC'
-    DSO_LDOPTS='-x -shared'
-    if test "$LIBRUNPATH"; then
-        DSO_LDOPTS="$DSO_LDOPTS -R$(LIBRUNPATH)"
-    fi
-    MDCPUCFG_H=_netbsd.cfg
-    PR_MD_CSRCS=netbsd.c
     ;;
 
 mips-sony-newsos*)
     AC_DEFINE(XP_UNIX)
     AC_DEFINE(SONY)
     AC_DEFINE(SYSV)
     AC_DEFINE(SVR4)
     AC_DEFINE(__svr4)
@@ -1953,17 +1956,17 @@ else
         _PTHREAD_LDFLAGS=
     fi
 fi
 dnl Special thread exceptions
 
 case "$target" in
 *-aix*)
     if test -n "$USE_NSPR_THREADS"; then
-        AC_DEFINE(-D_PR_LOCAL_THREADS_ONLY)
+        AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
     fi
     case "$target_os" in
     aix4.1*)
         if test -z "$USE_PTHREADS"; then
             AC_DEFINE(AIX_RENAME_SELECT)
         fi
         ;;
     aix4.2*)
@@ -1983,17 +1986,17 @@ case "$target" in
     ;;
 *-bsdi*)
     if test -n "$USE_PTHREADS"; then
         AC_DEFINE(_PR_NEED_PTHREAD_INIT)
     fi
     ;;
 *-freebsd*)
     if test -n "$USE_NSPR_THREADS"; then
-        AC_DEFINE(-D_PR_LOCAL_THREADS_ONLY)
+        AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
     fi
     ;;
 *-hpux*)
     if test -n "$USE_NSPR_THREADS"; then
         AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
     fi 
     if test "$USE_PTHREADS"; then
         if echo "$OS_RELEASE" | egrep '^(B.10.10|B.10.20)' >/dev/null; then
@@ -2023,41 +2026,41 @@ case "$target" in
     ;;
 *-mingw*|*-cygwin*|*-uwin*|*-msvc*)
     dnl win32 does not use pthreads
     USE_PTHREADS=
     _PTHREAD_LDFLAGS=
     USE_USER_PTHREADS=
     ;;
 *-netbsd*)
-    if test -z "$USE_PTHREADS"; then
-        OS_LIBS="$OS_LIBS -lc"
+    if test -n "$USE_NSPR_THREADS"; then
+        AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
     fi
-    ;;    
+    ;;
 *-osf*)
     if test -n "$USE_NSPR_THREADS"; then
-        AC_DEFINE(-D_PR_LOCAL_THREADS_ONLY)
+        AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
     fi
     if test -n "$USE_PTHREADS"; then
         if echo $OS_RELEASE | egrep -c '(V2.0|V3.2)' 2>/dev/null; then
             :
         else
             AC_DEFINE(_PR_HAVE_THREADSAFE_GETHOST)
         fi
     fi
     ;;
 *-solaris*)
     if test -n "$USE_NATIVE_THREADS"; then
         AC_DEFINE(_PR_GLOBAL_THREADS_ONLY)
     else
-        if test -n "$USE_USER_PTHREADS"; then
+        if test -n "$USE_NSPR_THREADS"; then
             AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
         fi
     fi
-    if test -z "$USE_USER_PTHREADS"; then
+    if test -z "$USE_NSPR_THREADS"; then
         AC_DEFINE(_REENTRANT)
         AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
         if test "$OS_TEST" = "i86pc"; then
             PR_MD_ASFILES=os_SunOS_x86.s
         else
             PR_MD_ASFILES=os_SunOS.s
             if test -z "$USE_64"; then
                 PR_MD_ASFILES="$PR_MD_ASFILES os_SunOS_32.s"