configure-with-threadsafe-mmgc
author benjamin@smedbergs.us
Wed, 12 Dec 2007 11:54:22 -0500
changeset 22 0ca31a2285356f7802d7a2ecda77ba7591f833cc
parent 11 553e043f72afe2b76d49737b9c0b960bc0fb2e0e
permissions -rw-r--r--
Merge changes from jorendorff

diff --git a/configure b/configure
--- a/configure
+++ b/configure
@@ -35,5 +35,12 @@
 #
 # ***** END LICENSE BLOCK *****
 
-echo "running $PYTHON $0.py --ignore-unknown-flags $@"
-exec $PYTHON $0.py --ignore-unknown-flags $@
+args=''
+while [ $# -ge 1 ]; do
+    args="$args '$1'"
+    shift
+done
+
+echo "running $PYTHON $0.py --ignore-unknown-flags $args"
+
+eval "'$PYTHON' '$0.py' --ignore-unknown-flags $args"
diff --git a/configure.py b/configure.py
--- a/configure.py
+++ b/configure.py
@@ -75,10 +75,13 @@ DEBUG_CXXFLAGS = ""
 DEBUG_CXXFLAGS = ""
 DEBUG_LDFLAGS = ""
 OS_LIBS = []
+OS_LDFLAGS = ""
 MMGC_CPPFLAGS = ""
 AVMSHELL_CPPFLAGS = ""
 AVMSHELL_LDFLAGS = ""
 MMGC_DEFINES = {'SOFT_ASSERTS': None}
+NSPR_INCLUDES = ""
+NSPR_LDOPTS = ""
 
 MMGC_INTERIOR_PTRS = o.getBoolArg('mmgc-interior-pointers', True)
 if MMGC_INTERIOR_PTRS:
@@ -88,6 +91,16 @@ if MMGC_DYNAMIC:
 if MMGC_DYNAMIC:
     MMGC_DEFINES['MMGC_DLL'] = None
     MMGC_CPPFLAGS += "-DMMGC_IMPL "
+
+MMGC_THREADSAFE = o.getBoolArg('threadsafe-mmgc', False)
+if MMGC_THREADSAFE:
+    MMGC_DEFINES['MMGC_THREADSAFE'] = None
+    NSPR_INCLUDES = o.getStringArg('nspr-includes')
+    MMGC_CPPFLAGS += NSPR_INCLUDES + " "
+    APP_CPPFLAGS += NSPR_INCLUDES + " "
+
+    NSPR_LDOPTS = o.getStringArg('nspr-ldopts')
+    OS_LDFLAGS += " " + NSPR_LDOPTS
 
 if config.COMPILER_IS_GCC:
     APP_CXXFLAGS = "-fno-exceptions -Werror -Wall -Wno-reorder -Wno-switch -Wno-invalid-offsetof -Wno-uninitialized -Wno-strict-aliasing -fmessage-length=0 -finline-functions -finline-limit=65536 "
@@ -188,6 +201,7 @@ config.subst("DEBUG_CXXFLAGS", DEBUG_CXX
 config.subst("DEBUG_CXXFLAGS", DEBUG_CXXFLAGS)
 config.subst("DEBUG_LDFLAGS", DEBUG_LDFLAGS)
 config.subst("OS_LIBS", " ".join(OS_LIBS))
+config.subst("OS_LDFLAGS", OS_LDFLAGS)
 config.subst("MMGC_CPPFLAGS", MMGC_CPPFLAGS)
 config.subst("AVMSHELL_CPPFLAGS", AVMSHELL_CPPFLAGS)
 config.subst("AVMSHELL_LDFLAGS", AVMSHELL_LDFLAGS)
diff --git a/pcre/config.h b/pcre/config.h
--- a/pcre/config.h
+++ b/pcre/config.h
@@ -40,7 +40,9 @@ them both to 0; an emulation function wi
 #define HAVE_LIMITS_H 1
 
 /* Define to 1 if the system has the type `long long'. */
+#ifndef HAVE_LONG_LONG
 #define HAVE_LONG_LONG 1
+#endif
 
 /* Define to 1 if you have the `memmove' function. */
 #define HAVE_MEMMOVE 1
diff --git a/shell/avmshell.h b/shell/avmshell.h
--- a/shell/avmshell.h
+++ b/shell/avmshell.h
@@ -48,6 +48,12 @@
 // #define AVMPLUS_INTERACTIVE
 
 using namespace avmplus;
+
+// avmplus and NSPR both typedef some basic types: we must disambiguate
+using avmplus::uint64;
+using avmplus::uint32;
+using avmplus::uint16;
+using avmplus::uint8;
 
 namespace avmshell
 {