Bug 463172 - add a --disable-jit option, r=ted
authorBenjamin Smedberg <benjamin@smedbergs.us>
Tue, 13 Jan 2009 11:34:51 -0500
changeset 23602 87bf34282f13bf5a759d6bcfa1d4d538ae783f54
parent 23601 8f542d107471f978c7746d18e902300b46a35253
child 23603 ea1497b987568a5da42cb413d757e6c1ce243125
push id4631
push userbsmedberg@mozilla.com
push dateTue, 13 Jan 2009 16:35:17 +0000
treeherdermozilla-central@87bf34282f13 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersted
bugs463172
milestone1.9.2a1pre
Bug 463172 - add a --disable-jit option, r=ted
js/src/Makefile.in
js/src/config/autoconf.mk.in
js/src/configure.in
--- a/js/src/Makefile.in
+++ b/js/src/Makefile.in
@@ -97,43 +97,16 @@ endif
 # other modules which are always built shared. Failure to do so results in
 # the js code getting copied into xpinstall and jsd as well as mozilla-bin,
 # and then the static data cells used for locking no longer work.
 
 ifndef JS_STATIC_BUILD
 FORCE_SHARED_LIB = 1
 endif
 
-ifeq (86,$(findstring 86,$(OS_TEST)))
-ifeq (64,$(findstring 64,$(OS_TEST)))
-else
-DEFINES += -DAVMPLUS_IA32
-NANOJIT_ARCH = i386
-ENABLE_JIT = 1
-endif
-endif
-
-ifeq (arm,$(findstring arm,$(OS_TEST)))
-DEFINES += -DAVMPLUS_ARM
-NANOJIT_ARCH = ARM
-ENABLE_JIT = 1
-endif
-
-ifneq (,$(filter Linux Darwin SunOS FreeBSD,$(OS_ARCH)))
-DEFINES += -DAVMPLUS_UNIX
-endif
-
-ifeq ($(OS_ARCH),Linux)
-DEFINES += -DAVMPLUS_LINUX
-endif
-
-ifeq ($(OS_ARCH),WINNT)
-DEFINES += -DAVMPLUS_WIN32
-endif
-
 VPATH		= $(srcdir)
 
 CPPSRCS		= \
 		jsapi.cpp \
 		jsarena.cpp \
 		jsarray.cpp \
 		jsatom.cpp \
 		jsbool.cpp \
--- a/js/src/config/autoconf.mk.in
+++ b/js/src/config/autoconf.mk.in
@@ -346,9 +346,11 @@ GCC_VERSION	= @GCC_VERSION@
 XCODEBUILD_VERSION= @XCODEBUILD_VERSION@
 HAS_XCODE_2_1	= @HAS_XCODE_2_1@
 UNIVERSAL_BINARY= @UNIVERSAL_BINARY@
 HAVE_DTRACE= @HAVE_DTRACE@
 
 VISIBILITY_FLAGS = @VISIBILITY_FLAGS@
 WRAP_SYSTEM_INCLUDES = @WRAP_SYSTEM_INCLUDES@
 
+ENABLE_JIT = @ENABLE_JIT@
+NANOJIT_ARCH = @NANOJIT_ARCH@
 HAVE_ARM_SIMD= @HAVE_ARM_SIMD@
--- a/js/src/configure.in
+++ b/js/src/configure.in
@@ -2867,16 +2867,71 @@ if test ! "$GNU_CXX"; then
 	;;
      *)
 	AC_CHECK_LIB(C, demangle)
 	;;
      esac
 fi
 AC_CHECK_LIB(socket, socket)
 
+dnl Configure JIT support
+
+case "$target" in
+i?86-*)
+    ENABLE_JIT=1
+    NANOJIT_ARCH=i386
+    ;;
+arm*-*)
+    ENABLE_JIT=1
+    NANOJIT_ARCH=ARM
+    ;;
+esac
+
+MOZ_ARG_DISABLE_BOOL(jit,
+[  --disable-jit           Disable JIT support],
+  ENABLE_JIT=)
+
+if test "$ENABLE_JIT"; then
+
+case "$target" in
+i?86-*)
+    AC_DEFINE(AVMPLUS_IA32)
+    ;;
+
+arm*-*)
+    AC_DEFINE(AVMPLUS_ARM)
+    ;;
+esac
+
+case "$target_os" in
+linux*)
+    AC_DEFINE(AVMPLUS_UNIX)
+    AC_DEFINE(AVMPLUS_LINUX)
+    ;;
+darwin*)
+    AC_DEFINE(AVMPLUS_UNIX)
+    ;;
+solaris*)
+    AC_DEFINE(AVMPLUS_UNIX)
+    ;;
+freebsd*|kfreebsd*)
+    AC_DEFINE(AVMPLUS_UNIX)
+    ;;
+*cygwin*|*mingw*|*mks*|*msvc*|*wince)
+    AC_DEFINE(AVMPLUS_WIN32)
+    ;;
+*)
+    AC_MSG_ERROR([Unrecognized nanojit platform])
+esac
+
+fi # ENABLE_JIT
+
+AC_SUBST(ENABLE_JIT)
+AC_SUBST(NANOJIT_ARCH)
+
 dnl Enable VFP support on ARM
 MOZ_ARG_DISABLE_BOOL(arm-vfp,
 [  --disable-arm-vfp       Disable ARM VFP instructions in JavaScript JIT],
    MOZ_ARM_VFP=, MOZ_ARM_VFP=1, MOZ_ARM_VFP=1)
 if test "$MOZ_ARM_VFP"; then
    AC_DEFINE(NJ_ARM_VFP)
 fi