diff --git a/mozilla/configure.in b/mozilla/configure.in index ee2183cc1e1..bf1914da510 100644 --- a/mozilla/configure.in +++ b/mozilla/configure.in @@ -4086,6 +4086,7 @@ NECKO_DISK_CACHE=1 NECKO_PROTOCOLS_DEFAULT="about data file ftp gopher http keyword res viewsource" NECKO_SMALL_BUFFERS= SUNCTL= +JS_STATIC_BUILD= case "$target_os" in msvc*|mks*|cygwin*|mingw*) @@ -4177,6 +4178,7 @@ minimo) NECKO_SMALL_BUFFERS=1 NS_DISABLE_LOGGING=1 NS_PRINTING= + JS_STATIC_BUILD=1 ;; mail) @@ -5303,6 +5305,26 @@ if test `echo "$target_os" | grep -c \^solaris 2>/dev/null` = 0 -o \ fi AC_SUBST(JS_ULTRASPARC_OPTS) +dnl ======================================================== +dnl = Force JS to be a static lib +dnl ======================================================== +MOZ_ARG_ENABLE_BOOL(js-static-build, +[ --enable-js-static-build Force js to be a static lib], + JS_STATIC_BUILD=1, + JS_STATIC_BUILD= ) + +AC_SUBST(JS_STATIC_BUILD) + +if test -n "$JS_STATIC_BUILD"; then + AC_DEFINE(EXPORT_JS_API) + +if test -z "$BUILD_STATIC_LIBS"; then + AC_MSG_ERROR([--enable-js-static-build is only compatible with --enable-static]) +fi + +fi + + dnl ======================================================== dnl = dnl = Feature options that require extra sources to be pulled diff --git a/mozilla/js/src/Makefile.in b/mozilla/js/src/Makefile.in index b3b1c6227c6..79b9eca7390 100644 --- a/mozilla/js/src/Makefile.in +++ b/mozilla/js/src/Makefile.in @@ -60,7 +60,10 @@ PACKAGE_FILE = js.pkg # 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 CSRCS = \ jsapi.c \