Bring hpux section inline with HPUX.mk NSPRPUB_CLIENT_BRANCH
authorcls%seawood.org
Sat, 27 Jan 2001 06:24:27 +0000
branchNSPRPUB_CLIENT_BRANCH
changeset 1697 a245acf7e16f5588eb6c59aee24bc438e31de3c5
parent 1695 b50ba03eb6e122d09b1426b5088fa94e5c95a2e1
child 1698 11dd41e3f927c189bb13863ec436d202d14674e7
push idunknown
push userunknown
push dateunknown
bugs58804
Bring hpux section inline with HPUX.mk Bug 58804
configure
configure.in
--- a/configure
+++ b/configure
@@ -2864,24 +2864,31 @@ EOF
     DSO_CFLAGS=-fPIC
     DSO_LDOPTS=-Bshareable
     MDCPUCFG_H=_freebsd.cfg
     PR_MD_CSRCS=freebsd.c
     ;;
 
 *-hpux*)
     cat >> confdefs.h <<\EOF
+#define XP_UNIX 1
+EOF
+
+    cat >> confdefs.h <<\EOF
 #define HPUX 1
 EOF
 
     cat >> confdefs.h <<\EOF
 #define _HPUX_SOURCE 1
 EOF
 
-    DEFINES="$DEFINES -D${target_cpu}"
+    cat >> confdefs.h <<\EOF
+#define hppa 1
+EOF
+
     DLL_SUFFIX=sl
     DSO_LDOPTS='-b +h $(notdir $@)'
     PR_MD_CSRCS=hpux.c
     if test -n "$USE_64"; then
         MDCPUCFG_H=_hpux64.cfg
     else
         MDCPUCFG_H=_hpux32.cfg
     fi
@@ -2890,88 +2897,107 @@ EOF
         CXX="$CXX -ext"
         CFLAGS="$CFLAGS +ESlit"
         CXXFLAGS="$CXXFLAGS +ESlit"
         DSO_CFLAGS=+Z
     else
         DSO_CFLAGS=-fPIC
     fi
     if test -n "$MOZILLA_CLIENT"; then
-        USE_NSPR_THREADS=1
+        DEFAULT_IMPL_STRATEGY=_EMU
     fi
-    case "${target_os}" in
-    hpuxA.09*)
-        cat >> confdefs.h <<\EOF
-#define HPUX9 1
-EOF
-
+
+    if echo "$OS_RELEASE" | grep ^A.09 >/dev/null; then
         cat >> confdefs.h <<\EOF
 #define _PR_NEED_H_ERRNO 1
 EOF
 
         cat >> confdefs.h <<\EOF
-#define _PR_NO_LARGE_FILES 1
+#define HPUX9 1
+EOF
+
+        DEFAULT_IMPL_STRATEGY=_EMU
+	USE_NSPR_THREADS=1
+    fi
+
+    if echo "$OS_RELEASE" | egrep '^(B.10.10|B.10.20)' >/dev/null; then
+        cat >> confdefs.h <<\EOF
+#define _PR_NEED_H_ERRNO 1
 EOF
 
-        ;;
-    hpuxB.10.01*)
+    fi
+
+    if echo "$OS_RELEASE" | egrep '^(B.10.10|B.10.20)' >/dev/null; then
+        cat >> confdefs.h <<\EOF
+#define HAVE_INT_LOCALTIME_R 1
+EOF
+
+    fi
+
+    if echo "$OS_RELEASE" | egrep '^(B.10.30|B.11.00)' >/dev/null; then
+        cat >> confdefs.h <<\EOF
+#define HAVE_POINTER_LOCALTIME_R 1
+EOF
+
+    fi
+
+    if test "$OS_RELEASE" = "B.10.01"; then
         cat >> confdefs.h <<\EOF
 #define HPUX10 1
 EOF
 
-        ;;
-    hpuxB.10.10*)
+        DEFAULT_IMPL_STRATEGY=_EMU
+    fi
+
+    if test "$OS_RELEASE" = "B.10.10"; then
         cat >> confdefs.h <<\EOF
 #define HPUX10 1
 EOF
 
         cat >> confdefs.h <<\EOF
 #define HPUX10_10 1
 EOF
 
-        cat >> confdefs.h <<\EOF
-#define HAVE_INT_LOCALTIME_R 1
-EOF
-
-        USE_PTHREADS=1
-        USE_NSPR_THREADS=
-        ;;
-    hpuxB.10.20*)
+        DEFAULT_IMPL_STRATEGY=_PTH
+    fi
+
+    if test "$OS_RELEASE" = "B.10.20"; then
         cat >> confdefs.h <<\EOF
 #define HPUX10 1
 EOF
 
         cat >> confdefs.h <<\EOF
 #define HPUX10_20 1
 EOF
 
-        cat >> confdefs.h <<\EOF
-#define HAVE_INT_LOCALTIME_R 1
-EOF
-
         if test -z "$GNU_CC"; then
             CFLAGS="$CFLAGS +DAportable +DS1.1"
             CXXFLAGS="$CXXFLAGS +DAportable +DS1.1"
         fi
-        USE_PTHREADS=1
-        USE_NSPR_THREADS=
-        ;;
-    hpuxB.10.30*)
+        DEFAULT_IMPL_STRATEGY=_EMU
+    fi
+
+    if test "$OS_RELEASE" = "B.10.30"; then
         cat >> confdefs.h <<\EOF
-#define HAVE_POINTER_LOCALTIME_R 1
+#define HPUX10 1
 EOF
 
+        cat >> confdefs.h <<\EOF
+#define HPUX10_30 1
+EOF
+
+        #CXX="/opt/aCC/bin/aCC -ext"
         if test -z "$GNU_CC"; then
             CFLAGS="$CFLAGS +DAportable +DS1.1"
             CXXFLAGS="$CXXFLAGS +DAportable +DS1.1"
         fi
-        USE_PTHREADS=1
-        USE_NSPR_THREADS=
-        ;;
-    hpuxB.11.00*)
+        DEFAULT_IMPL_STRATEGY=_PTH
+    fi
+
+    if test "$OS_RELEASE" = "B.11.00"; then
         cat >> confdefs.h <<\EOF
 #define HPUX10 1
 EOF
 
         cat >> confdefs.h <<\EOF
 #define HPUX11 1
 EOF
 
@@ -2991,33 +3017,31 @@ EOF
             if test -z "$USE_64"; then
                 CFLAGS="$CFLAGS +DAportable +DS2.0"
                 CXXFLAGS="$CXXFLAGS +DAportable +DS2.0"
             else
                 CFLAGS="$CFLAGS +DA2.0W +DS2.0"
                 CXXFLAGS="$CXXFLAGS +DA2.0W +DS2.0"
             fi
         fi
+        DEFAULT_IMPL_STRATEGY=_PTH
+    fi
+
+    if test "$DEFAULT_IMPL_STRATEGY" = "_EMU"; then
+        USE_NSPR_THREADS=1
+        USE_PTHREADS=
+        USE_USER_THREADS=
+    elif test "$DEFAULT_IMPL_STRATEGY" = "_PTH"; then
         USE_PTHREADS=1
-        USE_NSPR_THREADS=
-        ;;
-    esac
-    case "${target_os}" in
-    hpuxB.10*)
-        cat >> confdefs.h <<\EOF
-#define _PR_NO_LARGE_FILES 1
-EOF
-
-        ;;
-    esac
-    if test -n "$USE_NSPR_THREADS"; then
-        cat >> confdefs.h <<\EOF
-#define _PR_LOCAL_THREADS_ONLY 1
-EOF
-
+        if test "$MOZILLA_CLIENT"; then
+            USE_PTHREADS=
+        fi
+        if test "$USE_USER_PTHREADS"; then
+            USE_PTHREADS=
+        fi
     fi
     ;;
 
 *-irix*)
     cat >> confdefs.h <<\EOF
 #define XP_UNIX 1
 EOF
 
@@ -3498,72 +3522,72 @@ if test "$enable_shared" = no; then
     MKSHLIB=
 fi
 
 if test -z "$SKIP_LIBRARY_CHECKS"; then
 
 
 
 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:3507: checking how to run the C preprocessor" >&5
+echo "configure:3531: checking how to run the C preprocessor" >&5
 # On Suns, sometimes $CPP names a directory.
 if test -n "$CPP" && test -d "$CPP"; then
   CPP=
 fi
 if test -z "$CPP"; then
 if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
     # This must be in double quotes, not single quotes, because CPP may get
   # substituted into the Makefile and "${CC-cc}" will confuse make.
   CPP="${CC-cc} -E"
   # On the NeXT, cc -E runs the code through the compiler's parser,
   # not just through cpp.
   cat > conftest.$ac_ext <<EOF
-#line 3522 "configure"
+#line 3546 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3528: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3552: \"$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
   :
 else
   echo "$ac_err" >&5
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
   CPP="${CC-cc} -E -traditional-cpp"
   cat > conftest.$ac_ext <<EOF
-#line 3539 "configure"
+#line 3563 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3545: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3569: \"$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
   :
 else
   echo "$ac_err" >&5
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
   CPP="${CC-cc} -nologo -E"
   cat > conftest.$ac_ext <<EOF
-#line 3556 "configure"
+#line 3580 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3562: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3586: \"$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
   :
 else
   echo "$ac_err" >&5
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
@@ -3579,23 +3603,23 @@ fi
   CPP="$ac_cv_prog_CPP"
 else
   ac_cv_prog_CPP="$CPP"
 fi
 echo "$ac_t""$CPP" 1>&6
 
 if test $ac_cv_prog_gcc = yes; then
     echo $ac_n "checking whether ${CC-cc} needs -traditional""... $ac_c" 1>&6
-echo "configure:3588: checking whether ${CC-cc} needs -traditional" >&5
+echo "configure:3612: 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 3594 "configure"
+#line 3618 "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
@@ -3603,17 +3627,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 3612 "configure"
+#line 3636 "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
@@ -3627,22 +3651,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:3636: checking for $ac_func" >&5
+echo "configure:3660: 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 3641 "configure"
+#line 3665 "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();
@@ -3655,17 +3679,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:3664: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3688: \"$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
@@ -3683,36 +3707,36 @@ else
   echo "$ac_t""no" 1>&6
 fi
 done
 
 
 
 
 echo $ac_n "checking for pthread_attr_init in -lpthreads""... $ac_c" 1>&6
-echo "configure:3692: checking for pthread_attr_init in -lpthreads" >&5
+echo "configure:3716: checking for pthread_attr_init in -lpthreads" >&5
 ac_lib_var=`echo pthreads'_'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="-lpthreads  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3700 "configure"
+#line 3724 "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:3711: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3735: \"$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
@@ -3721,36 +3745,36 @@ 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 _PTHREAD_LDFLAGS="-lpthreads"
 else
   echo "$ac_t""no" 1>&6
 echo $ac_n "checking for pthread_attr_init in -lpthread""... $ac_c" 1>&6
-echo "configure:3730: checking for pthread_attr_init in -lpthread" >&5
+echo "configure:3754: checking for pthread_attr_init in -lpthread" >&5
 ac_lib_var=`echo pthread'_'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="-lpthread  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3738 "configure"
+#line 3762 "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:3749: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3773: \"$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
@@ -3759,36 +3783,36 @@ 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 _PTHREAD_LDFLAGS="-lpthread"
 else
   echo "$ac_t""no" 1>&6
 echo $ac_n "checking for pthread_attr_init in -lc_r""... $ac_c" 1>&6
-echo "configure:3768: checking for pthread_attr_init in -lc_r" >&5
+echo "configure:3792: 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
 else
   ac_save_LIBS="$LIBS"
 LIBS="-lc_r  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3776 "configure"
+#line 3800 "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:3787: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3811: \"$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
@@ -3797,36 +3821,36 @@ 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 _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:3806: checking for pthread_attr_init in -lc" >&5
+echo "configure:3830: 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 3814 "configure"
+#line 3838 "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:3825: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3849: \"$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
@@ -3963,33 +3987,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:3972: checking whether ${CC-cc} accepts -pthread" >&5
+echo "configure:3996: 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:3988: checking whether ${CC-cc} accepts -pthreads" >&5
+echo "configure:4012: 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
@@ -4018,42 +4042,16 @@ EOF
 	    cat >> confdefs.h <<\EOF
 #define _THREAD_SAFE 1
 EOF
 
 	    	    if test "$ac_cv_have_dash_pthread" = "yes"; then
 	        _PTHREAD_LDFLAGS=
 	    fi
 	    ;;
-    *-hpuxB.10.10*)
-        cat >> confdefs.h <<\EOF
-#define _REENTRANT 1
-EOF
-
-        cat >> confdefs.h <<\EOF
-#define _PR_DCETHREADS 1
-EOF
-
-        ;;
-    *-hpuxB.10.20*)
-        cat >> confdefs.h <<\EOF
-#define _REENTRANT 1
-EOF
-
-        cat >> confdefs.h <<\EOF
-#define _PR_DCETHREADS 1
-EOF
-
-        ;;
-    *-hpux*)
-        cat >> confdefs.h <<\EOF
-#define _POSIX_C_SOURCE=199506L 1
-EOF
-
-        ;;
     *)
 	    cat >> confdefs.h <<\EOF
 #define _REENTRANT 1
 EOF
 
 	    ;;
     esac
 
@@ -4094,17 +4092,48 @@ EOF
         cat >> confdefs.h <<\EOF
 #define _PR_LOCAL_THREADS_ONLY 1
 EOF
 
     fi
     ;;
 
 *-hpux*)
-    if test -n "$USE_USER_PTHREADS"; then
+    if test "$USE_NSPR_THREADS"; then
+        cat >> confdefs.h <<\EOF
+#define _PR_LOCAL_THREADS_ONLY 1
+EOF
+
+    fi
+
+    if echo "$OS_RELEASE" | egrep '^(A.09|B.10)' >/dev/null; then
+        cat >> confdefs.h <<\EOF
+#define _PR_NO_LARGE_FILES 1
+EOF
+
+    fi
+
+    if test "$USE_PTHREADS"; then
+        if echo "$OS_RELEASE" | egrep '^(B.10.10|B.10.20)' >/dev/null; then
+            cat >> confdefs.h <<\EOF
+#define REENTRANT 1
+EOF
+
+            cat >> confdefs.h <<\EOF
+#define _PR_DCETHREADS 1
+EOF
+
+        else
+            cat >> confdefs.h <<\EOF
+#define _POSIX_C_SOURCE=199506L 1
+EOF
+
+        fi
+    fi
+    if test "$USE_USER_PTHREADS"; then
         cat >> confdefs.h <<\EOF
 #define _POSIX_C_SOURCE=199506L 1
 EOF
 
     fi
     ;;
 *-mingw*|*-cygwin*|*-uwin*|*-msvc*)
         USE_PTHREADS=
@@ -4145,22 +4174,22 @@ EOF
     fi
     ;;
 esac
 
 OS_LIBS="$_PTHREAD_LDFLAGS $OS_LIBS"
 
 if test -z "$SKIP_LIBRARY_CHECKS"; then
 echo $ac_n "checking for dlopen""... $ac_c" 1>&6
-echo "configure:4154: checking for dlopen" >&5
+echo "configure:4183: 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 4159 "configure"
+#line 4188 "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();
@@ -4173,17 +4202,17 @@ int main() {
 #if defined (__stub_dlopen) || defined (__stub___dlopen)
 choke me
 #else
 dlopen();
 #endif
 
 ; return 0; }
 EOF
-if { (eval echo configure:4182: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4211: \"$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
@@ -4192,36 +4221,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:4201: checking for dlopen in -ldl" >&5
+echo "configure:4230: 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 4209 "configure"
+#line 4238 "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:4220: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4249: \"$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
--- a/configure.in
+++ b/configure.in
@@ -630,19 +630,20 @@ case "$target" in
     fi
     DSO_CFLAGS=-fPIC
     DSO_LDOPTS=-Bshareable
     MDCPUCFG_H=_freebsd.cfg
     PR_MD_CSRCS=freebsd.c
     ;;
 
 *-hpux*)
+    AC_DEFINE(XP_UNIX)
     AC_DEFINE(HPUX)
     AC_DEFINE(_HPUX_SOURCE)
-    DEFINES="$DEFINES -D${target_cpu}"
+    AC_DEFINE(hppa)
     DLL_SUFFIX=sl
     DSO_LDOPTS='-b +h $(notdir $@)'
     PR_MD_CSRCS=hpux.c
     if test -n "$USE_64"; then
         MDCPUCFG_H=_hpux64.cfg
     else
         MDCPUCFG_H=_hpux32.cfg
     fi
@@ -651,80 +652,100 @@ case "$target" in
         CXX="$CXX -ext"
         CFLAGS="$CFLAGS +ESlit"
         CXXFLAGS="$CXXFLAGS +ESlit"
         DSO_CFLAGS=+Z
     else
         DSO_CFLAGS=-fPIC
     fi
     if test -n "$MOZILLA_CLIENT"; then
-        USE_NSPR_THREADS=1
+        DEFAULT_IMPL_STRATEGY=_EMU
     fi
-    case "${target_os}" in
-    hpuxA.09*)
+
+    if echo "$OS_RELEASE" | grep ^A.09 >/dev/null; then
+        AC_DEFINE(_PR_NEED_H_ERRNO)
         AC_DEFINE(HPUX9)
+        DEFAULT_IMPL_STRATEGY=_EMU
+	USE_NSPR_THREADS=1
+    fi
+
+    if echo "$OS_RELEASE" | egrep '^(B.10.10|B.10.20)' >/dev/null; then
         AC_DEFINE(_PR_NEED_H_ERRNO)
-        AC_DEFINE(_PR_NO_LARGE_FILES)
-        ;;
-    hpuxB.10.01*)
+    fi
+
+    if echo "$OS_RELEASE" | egrep '^(B.10.10|B.10.20)' >/dev/null; then
+        AC_DEFINE(HAVE_INT_LOCALTIME_R)
+    fi
+
+    if echo "$OS_RELEASE" | egrep '^(B.10.30|B.11.00)' >/dev/null; then
+        AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
+    fi
+
+    if test "$OS_RELEASE" = "B.10.01"; then
         AC_DEFINE(HPUX10)
-        ;;
-    hpuxB.10.10*)
+        DEFAULT_IMPL_STRATEGY=_EMU
+    fi
+
+    if test "$OS_RELEASE" = "B.10.10"; then
         AC_DEFINE(HPUX10)
         AC_DEFINE(HPUX10_10)
-        AC_DEFINE(HAVE_INT_LOCALTIME_R)
-        USE_PTHREADS=1
-        USE_NSPR_THREADS=
-        ;;
-    hpuxB.10.20*)
+        DEFAULT_IMPL_STRATEGY=_PTH
+    fi
+
+    if test "$OS_RELEASE" = "B.10.20"; then
         AC_DEFINE(HPUX10)
         AC_DEFINE(HPUX10_20)
-        AC_DEFINE(HAVE_INT_LOCALTIME_R)
         if test -z "$GNU_CC"; then
             CFLAGS="$CFLAGS +DAportable +DS1.1"
             CXXFLAGS="$CXXFLAGS +DAportable +DS1.1"
         fi
-        USE_PTHREADS=1
-        USE_NSPR_THREADS=
-        ;;
-    hpuxB.10.30*)
-        AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
+        DEFAULT_IMPL_STRATEGY=_EMU
+    fi
+
+    if test "$OS_RELEASE" = "B.10.30"; then
+        AC_DEFINE(HPUX10)
+        AC_DEFINE(HPUX10_30)
+        #CXX="/opt/aCC/bin/aCC -ext"
         if test -z "$GNU_CC"; then
             CFLAGS="$CFLAGS +DAportable +DS1.1"
             CXXFLAGS="$CXXFLAGS +DAportable +DS1.1"
         fi
-        USE_PTHREADS=1
-        USE_NSPR_THREADS=
-        ;;
-    hpuxB.11.00*)
+        DEFAULT_IMPL_STRATEGY=_PTH
+    fi
+
+    if test "$OS_RELEASE" = "B.11.00"; then
         AC_DEFINE(HPUX10)
         AC_DEFINE(HPUX11)
         AC_DEFINE(_LARGEFILE64_SOURCE)
         AC_DEFINE(_PR_HAVE_OFF64_T)
         AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
         if test -z "$GNU_CC"; then
             if test -z "$USE_64"; then
                 CFLAGS="$CFLAGS +DAportable +DS2.0"
                 CXXFLAGS="$CXXFLAGS +DAportable +DS2.0"
             else
                 CFLAGS="$CFLAGS +DA2.0W +DS2.0"
                 CXXFLAGS="$CXXFLAGS +DA2.0W +DS2.0"
             fi
         fi
+        DEFAULT_IMPL_STRATEGY=_PTH
+    fi
+
+    if test "$DEFAULT_IMPL_STRATEGY" = "_EMU"; then
+        USE_NSPR_THREADS=1
+        USE_PTHREADS=
+        USE_USER_THREADS=
+    elif test "$DEFAULT_IMPL_STRATEGY" = "_PTH"; then
         USE_PTHREADS=1
-        USE_NSPR_THREADS=
-        ;;
-    esac
-    case "${target_os}" in
-    hpuxB.10*)
-        AC_DEFINE(_PR_NO_LARGE_FILES)
-        ;;
-    esac
-    if test -n "$USE_NSPR_THREADS"; then
-        AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
+        if test "$MOZILLA_CLIENT"; then
+            USE_PTHREADS=
+        fi
+        if test "$USE_USER_PTHREADS"; then
+            USE_PTHREADS=
+        fi
     fi
     ;;
 
 *-irix*)
     AC_DEFINE(XP_UNIX)
     AC_DEFINE(IRIX)
     AC_DEFINE(SVR4)
     AC_DEFINE(_SGI_MP_SOURCE)
@@ -1292,27 +1313,16 @@ if test -n "$USE_PTHREADS"; then
     *-freebsd*)
 	    AC_DEFINE(_REENTRANT)
 	    AC_DEFINE(_THREAD_SAFE)
 	    dnl -pthread links in -lc_r, so don't specify it explicitly.
 	    if test "$ac_cv_have_dash_pthread" = "yes"; then
 	        _PTHREAD_LDFLAGS=
 	    fi
 	    ;;
-    *-hpuxB.10.10*)
-        AC_DEFINE(_REENTRANT)
-        AC_DEFINE(_PR_DCETHREADS)
-        ;;
-    *-hpuxB.10.20*)
-        AC_DEFINE(_REENTRANT)
-        AC_DEFINE(_PR_DCETHREADS)
-        ;;
-    *-hpux*)
-        AC_DEFINE(_POSIX_C_SOURCE=199506L)
-        ;;
     *)
 	    AC_DEFINE(_REENTRANT)
 	    ;;
     esac
 
 else 
     if test -n "$USE_USER_PTHREADS"; then
 	    USE_PTHREADS=
@@ -1340,17 +1350,33 @@ case "$target" in
     if test -n "$USE_PTHREADS"; then
         AC_DEFINE(_PR_NEED_PTHREAD_INIT)
     else
         AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
     fi
     ;;
 
 *-hpux*)
-    if test -n "$USE_USER_PTHREADS"; then
+    if test "$USE_NSPR_THREADS"; then
+        AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
+    fi
+
+    if echo "$OS_RELEASE" | egrep '^(A.09|B.10)' >/dev/null; then
+        AC_DEFINE(_PR_NO_LARGE_FILES)
+    fi
+
+    if test "$USE_PTHREADS"; then
+        if echo "$OS_RELEASE" | egrep '^(B.10.10|B.10.20)' >/dev/null; then
+            AC_DEFINE(REENTRANT)
+            AC_DEFINE(_PR_DCETHREADS)
+        else
+            AC_DEFINE(_POSIX_C_SOURCE=199506L)
+        fi
+    fi
+    if test "$USE_USER_PTHREADS"; then
         AC_DEFINE(_POSIX_C_SOURCE=199506L)
     fi
     ;;
 *-mingw*|*-cygwin*|*-uwin*|*-msvc*)
     dnl win32 does not use pthreads
     USE_PTHREADS=
     _PTHREAD_LDFLAGS=
     USE_USER_PTHREADS=