Bug 580407 - Link js statically r=bsmedberg+khuey a=bsmedberg

This commit is contained in:
Taras Glek 2010-08-13 21:18:05 -07:00
Родитель b2630233ec
Коммит 76de6a283a
11 изменённых файлов: 70 добавлений и 7 удалений

Просмотреть файл

@ -38,7 +38,9 @@
[xpcom]
@BINPATH@/dependentlibs.list
#ifndef MOZ_STATIC_JS
@BINPATH@/@DLL_PREFIX@mozjs@DLL_SUFFIX@
#endif
@BINPATH@/@DLL_PREFIX@plc4@DLL_SUFFIX@
@BINPATH@/@DLL_PREFIX@plds4@DLL_SUFFIX@
@BINPATH@/@DLL_PREFIX@xpcom@DLL_SUFFIX@

Просмотреть файл

@ -678,3 +678,5 @@ ANDROID_PLATFORM = @ANDROID_PLATFORM@
ANDROID_SDK = @ANDROID_SDK@
ANDROID_TOOLS = @ANDROID_TOOLS@
ANDROID_VERSION = @ANDROID_VERSION@
JS_SHARED_LIBRARY = @JS_SHARED_LIBRARY@

Просмотреть файл

@ -391,6 +391,9 @@ DEFINES += \
-DIMPL_THEBES \
$(NULL)
ifndef JS_SHARED_LIBRARY
DEFINES += -DSTATIC_EXPORTABLE_JS_API
endif
ifndef MOZ_NATIVE_ZLIB
DEFINES += -DZLIB_INTERNAL
endif

Просмотреть файл

@ -74,6 +74,18 @@ TARGET_OS="${target_os}"
MOZ_DEB_TIMESTAMP=`date +"%a, %d %b %Y %T %z" 2>&1`
AC_SUBST(MOZ_DEB_TIMESTAMP)
MOZ_ARG_ENABLE_BOOL(shared-js,
[ --enable-shared-js
Create a shared JavaScript library.],
ENABLE_SHARED_JS=1,
ENABLE_SHARED_JS=0)
if test "$ENABLE_SHARED_JS" = "1" ; then
JS_SHARED_LIBRARY=1
else
AC_DEFINE(MOZ_STATIC_JS)
fi
AC_SUBST(JS_SHARED_LIBRARY)
dnl ========================================================
dnl =
@ -1221,7 +1233,11 @@ MOZ_BZ2_LIBS='$(call EXPAND_LIBNAME_PATH,bz2,$(DEPTH)/modules/libbz2/src)'
MOZ_PNG_CFLAGS=
MOZ_PNG_LIBS='$(call EXPAND_LIBNAME_PATH,mozpng,$(DEPTH)/modules/libimg/png)'
if test -z "$JS_SHARED_LIBRARY" ; then
MOZ_JS_LIBS='-L$(LIBXUL_DIST)/bin -ljs_static'
else
MOZ_JS_LIBS='-L$(LIBXUL_DIST)/bin -lmozjs'
fi
DYNAMIC_XPCOM_LIBS='-L$(LIBXUL_DIST)/bin -lxpcom -lxpcom_core -lmozalloc'
MOZ_FIX_LINK_PATHS='-Wl,-rpath-link,$(LIBXUL_DIST)/bin -Wl,-rpath-link,$(prefix)/lib'
XPCOM_FROZEN_LDOPTS='-L$(LIBXUL_DIST)/bin -lxpcom -lmozalloc'
@ -2268,7 +2284,11 @@ ia64*-hpux*)
MOZ_DEBUG_FLAGS='-Zi'
MOZ_DEBUG_LDFLAGS='-DEBUG -DEBUGTYPE:CV'
MOZ_FIX_LINK_PATHS=
MOZ_JS_LIBS='$(LIBXUL_DIST)/lib/mozjs.lib'
if test -z "$JS_SHARED_LIBRARY" ; then
MOZ_JS_LIBS='$(LIBXUL_DIST)/lib/js_static.lib'
else
MOZ_JS_LIBS='$(LIBXUL_DIST)/lib/mozjs.lib'
fi
OBJ_SUFFIX=obj
RANLIB='echo not_ranlib'
STRIP='echo not_strip'
@ -2328,7 +2348,11 @@ ia64*-hpux*)
RCFLAGS='-O coff --use-temp-file'
# mingw doesn't require kernel32, user32, and advapi32 explicitly
LIBS="$LIBS -luuid -lgdi32 -lwinmm -lwsock32"
MOZ_JS_LIBS='-L$(LIBXUL_DIST)/lib -lmozjs'
if test -z "$JS_SHARED_LIBRARY" ; then
MOZ_JS_LIBS='-L$(LIBXUL_DIST)/bin -ljs_static'
else
MOZ_JS_LIBS='-L$(LIBXUL_DIST)/bin -lmozjs'
fi
MOZ_FIX_LINK_PATHS=
DYNAMIC_XPCOM_LIBS='-L$(LIBXUL_DIST)/lib -lxpcom -lxpcom_core -lmozalloc'
XPCOM_FROZEN_LDOPTS='-L$(LIBXUL_DIST)/lib -lxpcom -lmozalloc'
@ -2374,7 +2398,11 @@ ia64*-hpux*)
MOZ_DEBUG_LDFLAGS='-DEBUG -DEBUGTYPE:CV'
WARNINGS_AS_ERRORS='-WX'
MOZ_OPTIMIZE_FLAGS='-O1'
MOZ_JS_LIBS='$(LIBXUL_DIST)/lib/mozjs.lib'
if test -z "$JS_SHARED_LIBRARY" ; then
MOZ_JS_LIBS='$(LIBXUL_DIST)/lib/js_static.lib'
else
MOZ_JS_LIBS='$(LIBXUL_DIST)/lib/mozjs.lib'
fi
MOZ_FIX_LINK_PATHS=
DYNAMIC_XPCOM_LIBS='$(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xpcom_core.lib $(LIBXUL_DIST)/lib/mozalloc.lib'
XPCOM_FROZEN_LDOPTS='$(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/mozalloc.lib'
@ -9222,6 +9250,9 @@ if test "$BUILD_CTYPES"; then
# Build js-ctypes on the platforms we can.
ac_configure_args="$ac_configure_args --enable-ctypes"
fi
if test -z "$JS_SHARED_LIBRARY" ; then
ac_configure_args="$ac_configure_args --disable-shared-js"
fi
if test -z "$MOZ_NATIVE_NSPR"; then
ac_configure_args="$ac_configure_args --with-nspr-cflags='$NSPR_CFLAGS'"
ac_configure_args="$ac_configure_args --with-nspr-libs='$NSPR_LIBS'"

Просмотреть файл

@ -119,8 +119,11 @@ endif
# In fact, we now build both a static and a shared library, as the
# JS shell would like to link to the static library.
ifdef JS_SHARED_LIBRARY
FORCE_SHARED_LIB = 1
endif
FORCE_STATIC_LIB = 1
DIST_INSTALL = 1
VPATH = $(srcdir)

Просмотреть файл

@ -340,4 +340,6 @@ WRAP_SYSTEM_INCLUDES = @WRAP_SYSTEM_INCLUDES@
ENABLE_TRACEJIT = @ENABLE_TRACEJIT@
NANOJIT_ARCH = @NANOJIT_ARCH@
HAVE_ARM_SIMD= @HAVE_ARM_SIMD@
JS_SHARED_LIBRARY = @JS_SHARED_LIBRARY@
HAVE_LINUX_PERF_EVENT_H = @HAVE_LINUX_PERF_EVENT_H@

Просмотреть файл

@ -391,6 +391,9 @@ DEFINES += \
-DIMPL_THEBES \
$(NULL)
ifndef JS_SHARED_LIBRARY
DEFINES += -DSTATIC_EXPORTABLE_JS_API
endif
ifndef MOZ_NATIVE_ZLIB
DEFINES += -DZLIB_INTERNAL
endif

Просмотреть файл

@ -206,6 +206,19 @@ MOZ_ARG_ENABLE_BOOL(compile-environment,
COMPILE_ENVIRONMENT=1,
COMPILE_ENVIRONMENT= )
MOZ_ARG_ENABLE_BOOL(shared-js,
[ --disable-shared-js
Do not create a shared library.],
DISABLE_SHARED_JS=0,
DISABLE_SHARED_JS=1)
if test "$DISABLE_SHARED_JS" = "1" ; then
AC_DEFINE(STATIC_EXPORTABLE_JS_API)
else
JS_SHARED_LIBRARY=1
fi
AC_SUBST(JS_SHARED_LIBRARY)
dnl ========================================================
dnl = Android uses a very custom (hacky) toolchain; we need to do this
dnl = here, so that the compiler checks can succeed

Просмотреть файл

@ -5657,7 +5657,7 @@ JS_SetGCZeal(JSContext *cx, uint8 zeal)
/************************************************************************/
#if !defined(STATIC_JS_API) && defined(XP_WIN) && !defined (WINCE)
#if !defined(STATIC_EXPORTABLE_JS_API) && !defined(STATIC_JS_API) && defined(XP_WIN) && !defined (WINCE)
#include <windows.h>

Просмотреть файл

@ -169,7 +169,7 @@
# define JS_PUBLIC_API(t) t
# define JS_PUBLIC_DATA(t) t
#elif defined(EXPORT_JS_API)
#elif defined(EXPORT_JS_API) || defined(STATIC_EXPORTABLE_JS_API)
# define JS_PUBLIC_API(t) JS_EXPORT_API(t)
# define JS_PUBLIC_DATA(t) JS_EXPORT_DATA(t)

Просмотреть файл

@ -57,10 +57,14 @@ LIBS = \
$(DIST)/lib/$(LIB_PREFIX)xpcomglue_s.$(LIB_SUFFIX) \
$(LIBXUL_LIBS) \
$(XPCOM_LIBS) \
$(MOZ_JS_LIBS) \
$(NSPR_LIBS) \
$(NULL)
ifdef JS_SHARED_LIBRARY
LIBS += $(MOZ_JS_LIBS)
endif
LIBS += $(NSPR_LIBS)
NSDISTMODE = copy
ifdef _MSC_VER