Patch provided by Lee Iverson <leei@ai.sri.com> unlabeled-1.1.2.10.4
authorcls%seawood.org
Tue, 21 Sep 1999 19:54:55 +0000
branchunlabeled-1.1.2.10.4
changeset 825 d368e279931ccfd451338a50655c4a6b28c72dc1
parent 796 187a6d806183cf942d2909668869895f68511f2e
push idunknown
push userunknown
push dateunknown
Patch provided by Lee Iverson <leei@ai.sri.com> Ensure that unmodified include files & symlinks are not modified. Added --disable-shared option. Resurrect use of OS_LIBS & EXTRA_LIBS. Add check for -ldl. Added nsprincl.sh & nsprincl.mk to build.
configure.in
--- a/configure.in
+++ b/configure.in
@@ -46,16 +46,19 @@ dnl =
 dnl ========================================================
 MOZ_DEBUG=1
 AC_ARG_ENABLE(debug,
     [  --disable-debug         Do not compile in debugging symbols],
     [	if test "$enableval" = "no"; then
     	    MOZ_DEBUG=
 	fi])
 
+AC_ARG_ENABLE(shared,
+    [  --disable-shared        Do not compile into shared libraries])
+
 AC_ARG_ENABLE(target,
     [  --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=)
 
 if test -n "$MOZ_DEBUG"; then
     CFLAGS="$CFLAGS -g"
     CXXFLAGS="$CXXFLAGS -g"
@@ -252,16 +255,21 @@ case "$target" in
 	;;
     *)
 	AC_DEFINE(_CPU_ARCH_NOT_DEFINED)
 	;;
     esac
     ;;
 esac
 
+dnl Turn off shared libraries if asked to do so.
+if test "$enable_shared" = no; then
+    MKSHLIB=
+fi
+
 dnl ========================================================
 dnl Check for system libraries
 dnl ========================================================
 dnl AC_CHECK_LIB(C, main)
 dnl AC_CHECK_LIB(C_r, main)
 dnl AC_CHECK_LIB(c, main)
 dnl AC_CHECK_LIB(c_r, main)
 dnl AC_CHECK_LIB(dce, main)
@@ -320,17 +328,19 @@ dnl AC_FUNC_STRCOLL
 dnl AC_FUNC_STRFTIME
 dnl AC_FUNC_UTIME_NULL
 dnl AC_FUNC_VPRINTF
 dnl AC_CHECK_FUNCS(ftime getcwd gethostname gettimeofday getwd mkdir mktime putenv rmdir select socket strdup strerror strstr strtol strtoul uname)
 
 dnl ========================================================
 dnl Check options
 dnl ========================================================
-dnl
+
+OS_LIBS=
+
 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
@@ -464,27 +474,27 @@ if test -n "$USE_PTHREADS"; then
 	    PTHREAD_LDFLAGS=
 	fi
 	;;
     *)
 	AC_DEFINE(_REENTRANT)
 	;;
     esac
 
+    AC_CHECK_FUNC(pthread_create,,[
+       AC_CHECK_LIB(pthread, pthread_create, [OS_LIBS="-lpthread $OS_LIBS"])
+    ])
+
 else 
     if test -n "$USE_USER_PTHREADS"; then
 	USE_PTHREADS=
 	USE_NSPR_THREADS=
     else
 	USE_NSPR_THREADS=1
-	case "$target" in
-    	*-linux*)
-	    AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
-	    ;;
-	esac
+	dnl 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=
@@ -495,16 +505,25 @@ case "$target" in
 	if test -n "$USE_NATIVE_THREADS"; then
 	    AC_DEFINE(_PR_GLOBAL_THREADS_ONLY)
 	else
 	    AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
 	fi
 	;;
 esac
 
+AC_CHECK_FUNC(dlopen,,[
+    AC_CHECK_LIB(dl, dlopen, [OS_LIBS="-ldl $OS_LIBS"])
+])
+
+EXTRA_LIBS=
+if test "$enable_shared" = no; then
+  EXTRA_LIBS="$OS_LIBS"
+fi
+
 dnl ========================================================
 dnl Substitution of found variables.
 dnl ========================================================
 AC_SUBST(MOZILLA_CLIENT)
 AC_SUBST(CC)
 AC_SUBST(CXX)
 AC_SUBST(CFLAGS)
 AC_SUBST(CXXFLAGS)
@@ -536,23 +555,28 @@ AC_SUBST(MKSHLIB)
 AC_SUBST(DEFINES)
 AC_SUBST(DEFS)
 AC_SUBST(AR)
 AC_SUBST(DLLTOOL)
 AC_SUBST(WINDRES)
 AC_SUBST(RANLIB)
 AC_SUBST(PERL)
 
+AC_SUBST(OS_LIBS)
+AC_SUBST(EXTRA_LIBS)
+
 dnl ========================================================
 dnl Generate output files.
 dnl ========================================================
 AC_OUTPUT([
 Makefile 
 config/Makefile
 config/autoconf.mk
+config/nsprincl.mk
+config/nsprincl.sh
 lib/Makefile 
 lib/ds/Makefile 
 lib/libc/Makefile 
 lib/libc/include/Makefile 
 lib/libc/src/Makefile 
 lib/msgc/Makefile 
 lib/msgc/include/Makefile 
 lib/msgc/src/Makefile