author Jim Blandy <>
Wed, 29 Oct 2008 08:29:22 -0700
changeset 21062 8c52a9486c8f25a93063f5b628575837156f266b
parent 18461 c397279747fa966ebedd9806d691c7aeede5cbe3
child 24067 982a011f6b3f444b02f04720fcf342cb7ac6defe
permissions -rw-r--r--
Bug 97954: Allow SpiderMonkey to be built on its own, or as part of Mozilla. Give SpiderMonkey its own configure script and top-level Makefile. Adjust js/src/Makefile as appropriate for life as a stand-alone makefile, instead of a 'make export; make libs'-style Mozilla tier makefile. Have the configure script accept '--with-nspr-cflags' and '--with-nspr-libs' options for using an in-tree NSPR. Also accept '--with-system-nspr', '--with-nspr-prefix', and '--with-nspr-exec-prefix' flags for using an installed NSPR. Default to --disable-jemalloc, assuming we don't have that part of the tree available; have the top-level configure script pass --enable-jemalloc as needed. Since we no longer have an export phase to copy header files into dist/include/js before we build the library, we need to be able to find nanojit.h in the nanojit directory; fix references in jsbuiltins.h and jstracer.cpp. Give SpiderMonkey it its own copies of many of the files from ./config and ./build. These are all exact copies, except as follows: . js/src/config/ js/src only has a subset of js/src/config, and thus a subset of the makefile targets. . js/src/config/ js/src/ has its own make variables to set, not set by the top-level configure script, so it needs a custom template. . js/src/config/ a copy from nsprpub/config, so that we can build without having an NSPR source tree handy. Invoke js/src/configure from ./configure, passing the values computed for NSPR_CFLAGS and NSPR_LIBS by the top-level configure script. Treat js/src as a static directory of the js tier, and create a new config/js (just a Makefile) to be the js tier's non-static directory. Let js/src/configure generate SpiderMonkey's makefiles, not ./configure. Generate a 'js-config' script, which clients can call to find the CFLAGS and LIBS values necessary to compile and link against an installed SpiderMonkey library. Don't include the js-config script in Macintosh packages. Teach how to rebuild js/src/configure. Tell Mercurial to ignore files generated by autoconf in js/src. Further work: . Right now, callers must define JS_THREADSAFE when #including jsapi.h. This is fixed in a subsequent patch. . js/src/configure is a trimmed copy of ./configure. It could be trimmed more.

dnl Local autoconf macros used with mozilla
dnl The contents of this file are under the Public Domain.

builtin(include, build/autoconf/glib.m4)dnl
builtin(include, build/autoconf/gtk.m4)dnl
builtin(include, build/autoconf/libIDL.m4)dnl
builtin(include, build/autoconf/libIDL-2.m4)dnl
builtin(include, build/autoconf/nspr.m4)dnl
builtin(include, build/autoconf/nss.m4)dnl
builtin(include, build/autoconf/libart.m4)dnl
builtin(include, build/autoconf/pkg.m4)dnl
builtin(include, build/autoconf/freetype2.m4)dnl
builtin(include, build/autoconf/codeset.m4)dnl
builtin(include, build/autoconf/altoptions.m4)dnl

# Read the user's .mozconfig script.  We can't do this in
# autoconf puts the argument parsing code above anything
# expanded from, and we need to get the configure options
# from .mozconfig in place before that argument parsing code.