summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwtc%netscape.com <devnull@localhost>2001-06-08 01:26:37 +0000
committerwtc%netscape.com <devnull@localhost>2001-06-08 01:26:37 +0000
commitde0c3886ad99646ac6a9b5eaac2fbc5a467b889c (patch)
treed8397da16767bb4a88e8a8ccec98e80a40fe7e14
parentdfb00e8a0a45c45ea2588716beabd6d6fd93aae0 (diff)
downloadnspr-hg-de0c3886ad99646ac6a9b5eaac2fbc5a467b889c.tar.gz
Bugzilla bug #70834: made configure work on NetBSD. Thanks to
taya@sm.sony.co.jp (Shin'ichiro TAYA) for the patch. r=wtc. a=asa@mozilla.org. Modified files: configure.in, configure. Tag: NSPRPUB_CLIENT_BRANCH
-rwxr-xr-xconfigure84
-rw-r--r--configure.in34
2 files changed, 57 insertions, 61 deletions
diff --git a/configure b/configure
index eb586fbb..42dbd7f9 100755
--- a/configure
+++ b/configure
@@ -3577,27 +3577,30 @@ 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
- 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)"
+ DSO_LDOPTS="$DSO_LDOPTS -Wl,-R$LIBRUNPATH"
fi
- MDCPUCFG_H=_netbsd.cfg
- PR_MD_CSRCS=netbsd.c
;;
mips-sony-newsos*)
@@ -4258,12 +4261,12 @@ fi
if test -z "$SKIP_LIBRARY_CHECKS"; then
echo $ac_n "checking for dlopen""... $ac_c" 1>&6
-echo "configure:4262: checking for dlopen" >&5
+echo "configure:4265: 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 4267 "configure"
+#line 4270 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char dlopen(); below. */
@@ -4286,7 +4289,7 @@ dlopen();
; return 0; }
EOF
-if { (eval echo configure:4290: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4293: \"$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
@@ -4305,7 +4308,7 @@ else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
-echo "configure:4309: checking for dlopen in -ldl" >&5
+echo "configure:4312: 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
@@ -4313,7 +4316,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 4317 "configure"
+#line 4320 "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
@@ -4324,7 +4327,7 @@ int main() {
dlopen()
; return 0; }
EOF
-if { (eval echo configure:4328: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4331: \"$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
@@ -4351,7 +4354,7 @@ fi
echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:4355: checking how to run the C preprocessor" >&5
+echo "configure:4358: checking how to run the C preprocessor" >&5
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
CPP=
@@ -4366,13 +4369,13 @@ else
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp.
cat > conftest.$ac_ext <<EOF
-#line 4370 "configure"
+#line 4373 "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:4376: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4379: \"$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
:
@@ -4383,13 +4386,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -E -traditional-cpp"
cat > conftest.$ac_ext <<EOF
-#line 4387 "configure"
+#line 4390 "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:4393: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4396: \"$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
:
@@ -4400,13 +4403,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -nologo -E"
cat > conftest.$ac_ext <<EOF
-#line 4404 "configure"
+#line 4407 "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:4410: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4413: \"$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
:
@@ -4432,13 +4435,13 @@ 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:4436: checking whether ${CC-cc} needs -traditional" >&5
+echo "configure:4439: 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 4442 "configure"
+#line 4445 "configure"
#include "confdefs.h"
#include <sgtty.h>
Autoconf TIOCGETP
@@ -4456,7 +4459,7 @@ rm -f conftest*
if test $ac_cv_prog_gcc_traditional = no; then
cat > conftest.$ac_ext <<EOF
-#line 4460 "configure"
+#line 4463 "configure"
#include "confdefs.h"
#include <termio.h>
Autoconf TCGETA
@@ -4480,12 +4483,12 @@ fi
for ac_func in lchown strerror
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4484: checking for $ac_func" >&5
+echo "configure:4487: 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 4489 "configure"
+#line 4492 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -4508,7 +4511,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:4512: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4515: \"$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
@@ -4539,7 +4542,7 @@ done
echo $ac_n "checking for pthread_create in -lpthreads""... $ac_c" 1>&6
-echo "configure:4543: checking for pthread_create in -lpthreads" >&5
+echo "configure:4546: checking for pthread_create in -lpthreads" >&5
echo "
#include <pthread.h>
void *foo(void *v) { int a = 1; }
@@ -4561,7 +4564,7 @@ echo "
echo "$ac_t""no" 1>&6
echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6
-echo "configure:4565: checking for pthread_create in -lpthread" >&5
+echo "configure:4568: checking for pthread_create in -lpthread" >&5
echo "
#include <pthread.h>
void *foo(void *v) { int a = 1; }
@@ -4583,7 +4586,7 @@ echo "
echo "$ac_t""no" 1>&6
echo $ac_n "checking for pthread_create in -lc_r""... $ac_c" 1>&6
-echo "configure:4587: checking for pthread_create in -lc_r" >&5
+echo "configure:4590: checking for pthread_create in -lc_r" >&5
echo "
#include <pthread.h>
void *foo(void *v) { int a = 1; }
@@ -4605,7 +4608,7 @@ echo "
echo "$ac_t""no" 1>&6
echo $ac_n "checking for pthread_create in -lc""... $ac_c" 1>&6
-echo "configure:4609: checking for pthread_create in -lc" >&5
+echo "configure:4612: checking for pthread_create in -lc" >&5
echo "
#include <pthread.h>
void *foo(void *v) { int a = 1; }
@@ -4755,7 +4758,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:4759: checking whether ${CC-cc} accepts -pthread" >&5
+echo "configure:4762: 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
@@ -4771,7 +4774,7 @@ echo "configure:4759: 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:4775: checking whether ${CC-cc} accepts -pthreads" >&5
+echo "configure:4778: 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
@@ -4897,11 +4900,6 @@ EOF
_PTHREAD_LDFLAGS=
USE_USER_PTHREADS=
;;
-*-netbsd*)
- if test -z "$USE_PTHREADS"; then
- OS_LIBS="$OS_LIBS -lc"
- fi
- ;;
*-solaris*)
if test -n "$USE_NATIVE_THREADS"; then
cat >> confdefs.h <<\EOF
diff --git a/configure.in b/configure.in
index 3d3b8229..6801880f 100644
--- a/configure.in
+++ b/configure.in
@@ -1121,27 +1121,30 @@ mips-nec-sysv*)
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
- 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)"
+ DSO_LDOPTS="$DSO_LDOPTS -Wl,-R$LIBRUNPATH"
fi
- MDCPUCFG_H=_netbsd.cfg
- PR_MD_CSRCS=netbsd.c
;;
mips-sony-newsos*)
@@ -1869,11 +1872,6 @@ case "$target" in
_PTHREAD_LDFLAGS=
USE_USER_PTHREADS=
;;
-*-netbsd*)
- if test -z "$USE_PTHREADS"; then
- OS_LIBS="$OS_LIBS -lc"
- fi
- ;;
*-solaris*)
if test -n "$USE_NATIVE_THREADS"; then
AC_DEFINE(_PR_GLOBAL_THREADS_ONLY)