summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcls%seawood.org <devnull@localhost>1999-08-14 02:56:45 +0000
committercls%seawood.org <devnull@localhost>1999-08-14 02:56:45 +0000
commitede20f79ea9bc0056bfaf69796e66bf329b081f9 (patch)
tree610eb60c529b96219aaef18e4da30e7f3780caec
parenta105b16c49c9c814b5e80d6ddcb43e881fd3bc6c (diff)
downloadnspr-hg-ede20f79ea9bc0056bfaf69796e66bf329b081f9.tar.gz
Fixed autodetection support of pthreads. Added classic nspr threads to the mix. Added autodetection of MOZILLA_CLIENT setting.
-rw-r--r--configure.in89
1 files changed, 57 insertions, 32 deletions
diff --git a/configure.in b/configure.in
index 5f0b19c7..7dd5062a 100644
--- a/configure.in
+++ b/configure.in
@@ -15,9 +15,6 @@ AC_VALIDATE_CACHED_SYSTEM_TUPLE
dnl Set this define to make fixes w/o breaking anything else.
AC_DEFINE(USE_AUTOCONF)
-dnl Always set this for mozilla.
-AC_DEFINE(MOZILLA_CLIENT)
-
dnl ========================================================
dnl = Version defaults
dnl ========================================================
@@ -25,7 +22,8 @@ NSPR_VERSION=3
NSPR_MODNAME=nspr20
_HAVE_PTHREADS=
USE_PTHREADS=
-USE_USER_PTHREADS=1
+USE_USER_PTHREADS=
+USE_NSPR_THREADS=
dnl ========================================================
dnl =
@@ -47,13 +45,13 @@ dnl =
dnl ========================================================
MOZ_DEBUG=1
AC_ARG_ENABLE(debug,
- [ --disable-debug Do not compile in debugging symbols],
+ [ --disable-debug Do not compile in debugging symbols],
[ if test "$enableval" = "no"; then
MOZ_DEBUG=
fi])
AC_ARG_ENABLE(target,
- [ --enable-target=\$t Turn on features for target \$t when build has multiple targets],
+ [ --enable-target=\$t Turn on features for target \$t when build has multiple targets],
MOZ_TARGET=`echo $enableval | tr a-z A-Z`,
MOZ_TARGET=)
@@ -133,6 +131,7 @@ else
AC_PATH_PROGS(AS, as, $CC)
AC_PATH_PROGS(AR, ar, :)
AC_PATH_PROGS(DLLTOOL, dlltool, :)
+ AC_PATH_PROGS(WINDRES, windres, :)
if test -z "$HOST_CC"; then
HOST_CC="$CC"
fi
@@ -308,6 +307,21 @@ dnl AC_CHECK_FUNCS(ftime getcwd gethostname gettimeofday getwd mkdir mktime pute
dnl ========================================================
dnl Check options
dnl ========================================================
+dnl
+dnl Check if NSPR is being compiled for Mozilla
+dnl Let --with-arg override environment setting
+dnl
+AC_ARG_WITH(mozilla,
+ [ --with-mozilla Compile NSPR with Mozilla support],
+ [ if test "$withval" = "yes"; then
+ AC_DEFINE(MOZILLA_CLIENT)
+ else
+ MOZILLA_CLIENT=
+ fi],
+ [ if test -n "$MOZILLA_CLIENT"; then
+ AC_DEFINE(MOZILLA_CLIENT)
+ fi])
+
AC_CHECK_LIB(pthread, pthread_attr_init,
_HAVE_PTHREADS=1 _PTHREAD_LDFLAGS="-lpthread")
@@ -322,35 +336,49 @@ then
fi
AC_ARG_WITH(pthreads,
- [ --with-pthreads Use system pthreads library as thread subsystem],
+ [ --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
AC_MSG_ERROR([ --with-pthreads specified for a system without pthread support ]);
fi
else
USE_PTHREADS=
_PTHREAD_LDFLAGS=
- USE_USER_PTHREADS=1
fi],
[ if test -n "$_HAVE_PTHREADS"; then
USE_PTHREADS=1
USE_USER_PTHREADS=
+ USE_NSPR_THREADS=
fi])
AC_ARG_ENABLE(user-pthreads,
- [ --enable-user-pthreads Build using userland pthreads],
+ [ --enable-user-pthreads Build using userland pthreads],
+ [ if test "$enableval" = "yes"; then
+ if test -n "$_HAVE_PTHREADS"; then
+ USE_PTHREADS=
+ USE_USER_PTHREADS=1
+ USE_NSPR_THREADS=
+ else
+ AC_MSG_ERROR([ --enable-user-pthreads specified for a system without pthread support ]);
+ fi
+ fi])
+
+AC_ARG_ENABLE(nspr-threads,
+ [ --enable-nspr-threads Build using classic nspr threads],
[ if test "$enableval" = "yes"; then
- USE_USER_PTHREADS=1
USE_PTHREADS=
+ USE_USER_PTHREADS=
+ USE_NSPR_THREADS=1
fi])
case "$target" in
*-beos*)
AC_ARG_WITH(bthreads,
- [ --with-bthreads Use system bthreads library as thread subsystem],
+ [ --with-bthreads Use system bthreads library as thread subsystem (BeOS only)],
[ if test "$withval" = "yes"; then
USE_BTHREADS=1
USE_USER_PTHREADS=
@@ -360,7 +388,7 @@ case "$target" in
*-solaris*)
AC_ARG_WITH(native-threads,
- [ --with-native-threads Use native system threads as thread subsystem],
+ [ --with-native-threads Use native system threads as thread subsystem (Solaris only)],
[ if test "$withval" = "yes"; then
USE_NATIVE_THREADS=1
USE_USER_PTHREADS=
@@ -371,14 +399,14 @@ esac
USE_CPLUS=
AC_ARG_ENABLE(cplus,
- [ --enable-cplus Use cplus for whatever reason],
+ [ --enable-cplus Use cplus for whatever reason],
[ if test "$enableval" = "yes"; then
USE_CPLUS=1
fi])
USE_IPV6=
AC_ARG_ENABLE(ipv6,
- [ --enable-ipv6 Compile ipv6 support],
+ [ --enable-ipv6 Compile ipv6 support],
[ if test "$enableval" = "yes"; then
USE_IPV6=1
fi])
@@ -402,13 +430,6 @@ if test -n "$USE_PTHREADS"; then
case "$target" in
*-mingw*|*-cygwin*|*-uwin*)
- # win32 does not use pthreads
- USE_PTHREADS=
- PTHREAD_LDFLAGS=
- USE_USER_PTHREADS=
- ;;
- *-linux*)
- AC_DEFINE(_REENTRANT)
;;
*-solaris*)
AC_DEFINE(_REENTRANT)
@@ -417,9 +438,6 @@ if test -n "$USE_PTHREADS"; then
CXXFLAGS="$CXXFLAGS -mt"
fi
;;
- alpha*-osf*)
- AC_DEFINE(_REENTRANT)
- ;;
*-freebsd*)
AC_DEFINE(_REENTRANT)
AC_DEFINE(_THREAD_SAFE)
@@ -433,8 +451,18 @@ if test -n "$USE_PTHREADS"; then
;;
esac
-else
- case "$target" in
+else
+ if test -n "$USE_USER_PTHREADS"; then
+ USE_PTHREADS=
+ USE_NSPR_THREADS=
+ else
+ USE_NSPR_THREADS=1
+ AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
+ fi
+fi
+dnl Special thread exceptions
+
+case "$target" in
*-mingw*|*-cygwin*|*-uwin*)
# win32 does not use pthreads
USE_PTHREADS=
@@ -448,16 +476,12 @@ else
AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
fi
;;
- *)
- AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
- ;;
- esac
-
-fi
+esac
dnl ========================================================
dnl Substitution of found variables.
dnl ========================================================
+AC_SUBST(MOZILLA_CLIENT)
AC_SUBST(CC)
AC_SUBST(CXX)
AC_SUBST(CFLAGS)
@@ -472,6 +496,7 @@ AC_SUBST(USE_CPLUS)
AC_SUBST(USE_IPV6)
AC_SUBST(USE_USER_PTHREADS)
AC_SUBST(USE_NATIVE_THREADS)
+AC_SUBST(USE_NSPR_THREADS)
AC_SUBST(NSPR_VERSION)
AC_SUBST(NSPR_MODNAME)