Skip to content

Commit

Permalink
Bug 1036894 part 8 - Move most in-tree library linkage information to…
Browse files Browse the repository at this point in the history
… moz.build, as USE_LIBS. r=gps
  • Loading branch information
glandium committed Jul 23, 2014
1 parent 8e03764 commit 5fab42f
Show file tree
Hide file tree
Showing 169 changed files with 710 additions and 624 deletions.
8 changes: 0 additions & 8 deletions b2g/app/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ LIBS += \
-lhardware_legacy \
-lhardware \
-lcutils \
$(DEPTH)/media/libpng/$(LIB_PREFIX)mozpng.$(LIB_SUFFIX) \
$(DEPTH)/widget/gonk/libdisplay/$(LIB_PREFIX)display.$(LIB_SUFFIX) \
$(MOZ_ZLIB_LIBS) \
$(NULL)
ifeq ($(ANDROID_VERSION),$(findstring $(ANDROID_VERSION),17 18 19))
Expand All @@ -28,12 +26,6 @@ LIBS += \
endif
endif

LIBS += $(JEMALLOC_LIBS)

LIBS += \
$(XPCOM_STANDALONE_GLUE_LDOPTS) \
$(NULL)

ifeq (gonk,$(MOZ_WIDGET_TOOLKIT))
LIBS += \
-lbinder \
Expand Down
18 changes: 18 additions & 0 deletions b2g/app/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ if not CONFIG['LIBXUL_SDK']:
# a console application.
WIN32_EXE_LDFLAGS += ['-ENTRY:wmainCRTStartup']

if not CONFIG['MOZ_NATIVE_ZLIB'] and not CONFIG['ZLIB_IN_MOZCONFIG']:
USE_LIBS += [
'mozz',
]

DEFINES['XPCOM_GLUE'] = True

for var in ('MOZ_APP_NAME', 'MOZ_APP_VERSION', 'MOZ_UPDATER'):
Expand All @@ -39,4 +44,17 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk':

LDFLAGS += ['-Wl,--export-dynamic']

USE_LIBS += [
'display',
'mozpng',
]
if not CONFIG['MOZ_NATIVE_ZLIB']:
USE_LIBS += [
'mozz',
]

USE_LIBS += [
'xpcomglue',
]

DISABLE_STL_WRAPPING = True
4 changes: 0 additions & 4 deletions browser/app/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@ endif #} LIBXUL_SDK

# Build a binary bootstrapping with XRE_main

LIBS += \
$(XPCOM_STANDALONE_GLUE_LDOPTS) \
$(NULL)

ifdef MOZ_LINKER
LIBS += $(MOZ_ZLIB_LIBS)
endif
Expand Down
4 changes: 4 additions & 0 deletions browser/app/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,8 @@ if CONFIG['OS_ARCH'] == 'WINNT':
if CONFIG['OS_ARCH'] == 'WINNT' and not CONFIG['GNU_CC']:
LDFLAGS += ['/HEAP:0x40000']

USE_LIBS += [
'xpcomglue',
]

DISABLE_STL_WRAPPING = True
3 changes: 1 addition & 2 deletions browser/components/build/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ OS_LIBS += $(call EXPAND_LIBNAME,version)
endif

EXTRA_DSO_LDOPTS += \
$(XPCOM_GLUE_LDOPTS) \
$(MOZ_COMPONENT_LIBS) \
$(NSPR_LIBS) \
$(NULL)

# Mac: Need to link with CoreFoundation for Mac Migrators (PList reading code)
Expand Down
6 changes: 6 additions & 0 deletions browser/components/build/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,9 @@ LOCAL_INCLUDES += [
'../migration/src',
'../shell/src',
]

USE_LIBS += [
'mozalloc',
'xpcomglue_s',
'xul-shared',
]
4 changes: 0 additions & 4 deletions config/config.mk
Original file line number Diff line number Diff line change
Expand Up @@ -264,8 +264,6 @@ ifneq (,$(MOZ_DEBUG)$(MOZ_DEBUG_SYMBOLS))
_DEBUG_LDFLAGS += $(MOZ_DEBUG_LDFLAGS)
endif

MOZALLOC_LIB = $(call EXPAND_LIBNAME_PATH,mozalloc,$(DIST)/lib)

ASFLAGS += $(_DEBUG_ASFLAGS)
OS_CFLAGS += $(_DEBUG_CFLAGS)
OS_CXXFLAGS += $(_DEBUG_CFLAGS)
Expand Down Expand Up @@ -586,8 +584,6 @@ SDK_BIN_DIR = $(DIST)/sdk/bin

DEPENDENCIES = .md

MOZ_COMPONENT_LIBS=$(XPCOM_LIBS) $(MOZ_COMPONENT_NSPR_LIBS)

ifdef MACOSX_DEPLOYMENT_TARGET
export MACOSX_DEPLOYMENT_TARGET
endif # MACOSX_DEPLOYMENT_TARGET
Expand Down
2 changes: 1 addition & 1 deletion config/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ ifdef COMPILE_ENVIRONMENT
# which stuff links.
SIMPLE_PROGRAMS += $(CPP_UNIT_TESTS)
INCLUDES += -I$(DIST)/include/testing
LIBS += $(XPCOM_GLUE_LDOPTS) $(NSPR_LIBS)
LIBS += $(NSPR_LIBS)

ifndef MOZ_PROFILE_GENERATE
libs:: $(CPP_UNIT_TESTS) $(call mkdir_deps,$(DIST)/cppunittests)
Expand Down
87 changes: 16 additions & 71 deletions configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -959,37 +959,10 @@ TARGET_MD_ARCH=unix
DIRENT_INO=d_ino
MOZ_USER_DIR=".mozilla"

MOZ_JPEG_CFLAGS=
MOZ_JPEG_LIBS='$(call EXPAND_LIBNAME_PATH,mozjpeg,$(DEPTH)/media/libjpeg)'
MOZ_BZ2_CFLAGS=
MOZ_BZ2_LIBS='$(call EXPAND_LIBNAME_PATH,bz2,$(DEPTH)/modules/libbz2/src)'
MOZ_PNG_CFLAGS="-I$_objdir/dist/include" # needed for freetype compilation
MOZ_PNG_LIBS='$(call EXPAND_LIBNAME_PATH,mozpng,$(DEPTH)/media/libpng)'

MOZ_JS_STATIC_LIBS='$(call EXPAND_LIBNAME_PATH,js_static,$(LIBXUL_DIST)/lib)'
MOZ_JS_SHARED_LIBS='$(call EXPAND_LIBNAME_PATH,mozjs,$(LIBXUL_DIST)/lib)'
MOZ_FIX_LINK_PATHS='-Wl,-rpath-link,$(LIBXUL_DIST)/bin -Wl,-rpath-link,$(prefix)/lib'
XPCOM_FROZEN_LDOPTS='$(call EXPAND_LIBNAME_PATH,xul mozalloc,$(LIBXUL_DIST)/bin)'
LIBXUL_LIBS='$(XPCOM_FROZEN_LDOPTS)'
XPCOM_GLUE_LDOPTS='$(LIBXUL_DIST)/lib/$(LIB_PREFIX)xpcomglue_s.$(LIB_SUFFIX) $(XPCOM_FROZEN_LDOPTS)'
XPCOM_STANDALONE_GLUE_LDOPTS='$(LIBXUL_DIST)/lib/$(LIB_PREFIX)xpcomglue.$(LIB_SUFFIX)'

# These are specially defined on Windows only
case "$target" in
*-mingw*)
XPCOM_STATICRUNTIME_GLUE_LDOPTS='$(LIBXUL_DIST)/lib/$(LIB_PREFIX)xpcomglue_staticruntime_s.$(LIB_SUFFIX) $(XPCOM_FROZEN_LDOPTS)'
XPCOM_STANDALONE_STATICRUNTIME_GLUE_LDOPTS='$(LIBXUL_DIST)/lib/$(LIB_PREFIX)xpcomglue_staticruntime.$(LIB_SUFFIX)'
;;
*)
XPCOM_STATICRUNTIME_GLUE_LDOPTS=$XPCOM_GLUE_LDOPTS
XPCOM_STANDALONE_STATICRUNTIME_GLUE_LDOPTS=$XPCOM_STANDALONE_GLUE_LDOPTS
;;
esac

MOZ_FS_LAYOUT=unix

MOZ_COMPONENT_NSPR_LIBS='-L$(LIBXUL_DIST)/bin $(NSPR_LIBS)'

USE_DEPENDENT_LIBS=1

_PLATFORM_DEFAULT_TOOLKIT=cairo-gtk2
Expand Down Expand Up @@ -2061,7 +2034,6 @@ ia64*-hpux*)
MC=mc.exe
# certain versions of cygwin's makedepend barf on the
# #include <string> vs -I./dist/include/string issue so don't use it
XPCOM_FROZEN_LDOPTS='$(call EXPAND_LIBNAME_PATH,xul mozalloc,$(LIBXUL_DIST)/lib)'
if test -n "$GNU_CC" -o -n "$CLANG_CC"; then
CC="$CC -mwindows"
CXX="$CXX -mwindows"
Expand Down Expand Up @@ -3023,16 +2995,18 @@ fi

AC_LANG_CPLUSPLUS

ICONV_LIBS=

case $target_os in
darwin*|mingw*)
;;
*)

AC_CHECK_LIB(c, iconv, [_ICONV_LIBS="$_ICONV_LIBS"],
AC_CHECK_LIB(iconv, iconv, [_ICONV_LIBS="$_ICONV_LIBS -liconv"],
AC_CHECK_LIB(iconv, libiconv, [_ICONV_LIBS="$_ICONV_LIBS -liconv"])))
AC_CHECK_LIB(c, iconv, [ICONV_LIBS=],
AC_CHECK_LIB(iconv, iconv, [ICONV_LIBS="-liconv"],
AC_CHECK_LIB(iconv, libiconv, [ICONV_LIBS="-liconv"])))
_SAVE_LIBS=$LIBS
LIBS="$LIBS $_ICONV_LIBS"
LIBS="$LIBS $ICONV_LIBS"
AC_CACHE_CHECK(
[for iconv()],
ac_cv_func_iconv,
Expand All @@ -3051,8 +3025,7 @@ AC_CACHE_CHECK(
)
if test "$ac_cv_func_iconv" = "yes"; then
AC_DEFINE(HAVE_ICONV)
LIBXUL_LIBS="$LIBXUL_LIBS $_ICONV_LIBS"
LIBICONV="$_ICONV_LIBS"
LIBICONV="$ICONV_LIBS"
AC_CACHE_CHECK(
[for iconv() with const input],
ac_cv_func_const_iconv,
Expand All @@ -3079,6 +3052,8 @@ LIBS=$_SAVE_LIBS
;;
esac

AC_SUBST(ICONV_LIBS)

AM_LANGINFO_CODESET

AC_LANG_C
Expand Down Expand Up @@ -3625,11 +3600,6 @@ dnl system ZLIB support
dnl ========================================================
MOZ_ZLIB_CHECK([1.2.3])

if test "$MOZ_NATIVE_ZLIB" != 1; then
MOZ_ZLIB_CFLAGS="-I${_topsrcdir}/modules/zlib/src"
MOZ_ZLIB_LIBS='$(call EXPAND_LIBNAME_PATH,mozz,'"$MOZ_BUILD_ROOT"'/modules/zlib/src)'
fi

if test "$MOZ_LINKER" = 1 -a "$MOZ_NATIVE_ZLIB" != 1; then
AC_MSG_ERROR([Custom dynamic linker requires --with-system-zlib])
fi
Expand Down Expand Up @@ -3760,10 +3730,6 @@ dnl system libffi Support
dnl ========================================================
MOZ_CONFIG_FFI()

if test -n "$MOZ_NATIVE_FFI"; then
MOZ_JS_STATIC_LIBS="$MOZ_JS_STATIC_LIBS $MOZ_FFI_LIBS"
fi

# split JS out by default to avoid VS2005 PGO crash (bug 591836).
if test "$OS_ARCH" = "WINNT"; then
JS_SHARED_LIBRARY=1
Expand Down Expand Up @@ -4247,7 +4213,6 @@ cairo-cocoa)
TK_CFLAGS="-DNO_X11"
CFLAGS="$CFLAGS $TK_CFLAGS"
CXXFLAGS="$CXXFLAGS $TK_CFLAGS"
XPCOM_FROZEN_LDOPTS='$(LIBXUL_DIST)/bin/XUL $(call EXPAND_LIBNAME_PATH,mozalloc,$(LIBXUL_DIST)/bin)'
MOZ_USER_DIR="Mozilla"
MOZ_FS_LAYOUT=bundle
MOZ_WEBGL=1
Expand All @@ -4262,7 +4227,6 @@ cairo-uikit)
TK_LIBS='-framework Foundation -framework CoreFoundation -framework CoreGraphics -framework CoreText'
CFLAGS="$CFLAGS $TK_CFLAGS"
CXXFLAGS="$CXXFLAGS $TK_CFLAGS"
XPCOM_FROZEN_LDOPTS='$(LIBXUL_DIST)/bin/XUL $(call EXPAND_LIBNAME_PATH,mozalloc,$(LIBXUL_DIST)/bin)'
MOZ_USER_DIR="Mozilla"
MOZ_FS_LAYOUT=bundle
;;
Expand All @@ -4278,7 +4242,6 @@ cairo-android)
;;

cairo-gonk)
XPCOM_FROZEN_LDOPTS='$(call EXPAND_LIBNAME_PATH,xul mozalloc,$(LIBXUL_DIST)/lib)'
AC_DEFINE(MOZ_WIDGET_GONK)
AC_DEFINE(MOZ_TOUCH)
MOZ_WIDGET_TOOLKIT=gonk
Expand Down Expand Up @@ -6475,11 +6438,8 @@ MOZ_ARG_ENABLE_BOOL(system-sqlite,
MOZ_NATIVE_SQLITE=1,
MOZ_NATIVE_SQLITE= )

if test -z "$MOZ_NATIVE_SQLITE"
if test -n "$MOZ_NATIVE_SQLITE"
then
SQLITE_CFLAGS=
SQLITE_LIBS='$(call EXPAND_LIBNAME_PATH,mozsqlite3,$(DIST)/lib)'
else
dnl ============================
dnl === SQLite Version check ===
dnl ============================
Expand Down Expand Up @@ -7844,9 +7804,6 @@ dnl =
dnl ========================================================
MOZ_ARG_HEADER(Static build options)

AC_SUBST(LIBXUL_LIBS)
XPCOM_LIBS="$LIBXUL_LIBS"

if test "$OS_ARCH" = "WINNT"; then
GKMEDIAS_SHARED_LIBRARY=1
AC_DEFINE(GKMEDIAS_SHARED_LIBRARY)
Expand Down Expand Up @@ -8019,8 +7976,6 @@ fi

if test "$MOZ_TREE_PIXMAN"; then
AC_DEFINE(MOZ_TREE_PIXMAN)
MOZ_PIXMAN_CFLAGS=""
MOZ_PIXMAN_LIBS='$(call EXPAND_LIBNAME_PATH,mozlibpixman,$(DEPTH)/gfx/cairo/libpixman/src)'
else
PKG_CHECK_MODULES(PIXMAN, pixman-1 >= 0.19.2)
MOZ_PIXMAN_CFLAGS="$PIXMAN_CFLAGS"
Expand Down Expand Up @@ -8397,7 +8352,6 @@ AC_SUBST(MOZ_UPDATE_XTERM)
AC_SUBST(MOZ_AUTH_EXTENSION)
AC_SUBST(MOZ_PERMISSIONS)
AC_SUBST(MOZ_PREF_EXTENSIONS)
AC_SUBST(MOZ_JS_LIBS)
AC_SUBST(MOZ_DEBUG)
AC_SUBST(MOZ_DEBUG_SYMBOLS)
AC_SUBST(MOZ_DEBUG_ENABLE_DEFS)
Expand Down Expand Up @@ -8473,12 +8427,6 @@ AC_SUBST(MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS)
AC_SUBST(MOZ_COMPONENT_NSPR_LIBS)

AC_SUBST(MOZ_FIX_LINK_PATHS)
AC_SUBST(XPCOM_LIBS)
AC_SUBST(XPCOM_FROZEN_LDOPTS)
AC_SUBST(XPCOM_GLUE_LDOPTS)
AC_SUBST(XPCOM_STANDALONE_GLUE_LDOPTS)
AC_SUBST(XPCOM_STATICRUNTIME_GLUE_LDOPTS)
AC_SUBST(XPCOM_STANDALONE_STATICRUNTIME_GLUE_LDOPTS)

AC_SUBST(USE_DEPENDENT_LIBS)

Expand Down Expand Up @@ -8934,14 +8882,7 @@ fi

MOZ_CONFIG_ICU()

if test -n "$MOZ_NATIVE_ICU"; then
MOZ_JS_STATIC_LIBS="$MOZ_JS_STATIC_LIBS $MOZ_ICU_LIBS"
fi

if test -n "$JS_SHARED_LIBRARY"; then
MOZ_JS_LIBS="$MOZ_JS_SHARED_LIBS"
else
MOZ_JS_LIBS="$MOZ_JS_STATIC_LIBS"
if test -z "$JS_SHARED_LIBRARY"; then
AC_DEFINE(MOZ_STATIC_JS)
fi
AC_SUBST(JS_SHARED_LIBRARY)
Expand Down Expand Up @@ -9055,7 +8996,11 @@ if test "$MOZ_TREE_FREETYPE"; then
export LDFLAGS="$LDFLAGS $MOZ_DEBUG_LDFLAGS"
# Spaces in the *_CFLAGS and *_LIBS variables are intentionally placed
# to force freetype to use our settings rather than autodetecting
export LIBPNG_CFLAGS="$MOZ_PNG_CFLAGS "
if test -n "$MOZ_NATIVE_PNG"; then
export LIBPNG_CFLAGS="$MOZ_PNG_CFLAGS "
else
export LIBPNG_CFLAGS="-I$_objdir/dist/include"
fi
export LIBPNG_LIBS="$MOZ_PNG_LIBS "
export ZLIB_CFLAGS="$MOZ_ZLIB_CFLAGS "
export ZLIB_LIBS="$MOZ_ZLIB_LIBS "
Expand Down
5 changes: 5 additions & 0 deletions content/base/test/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,8 @@ MOCHITEST_CHROME_MANIFESTS += [

BROWSER_CHROME_MANIFESTS += ['browser.ini']

USE_LIBS += [
'mozalloc',
'xpcomglue_s',
'xul-shared',
]
5 changes: 5 additions & 0 deletions content/canvas/compiledtest/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,8 @@ LOCAL_INCLUDES += [
'../src',
]

USE_LIBS += [
'mozalloc',
'xpcomglue_s',
'xul-shared',
]
5 changes: 5 additions & 0 deletions content/media/compiledtest/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,8 @@ LOCAL_INCLUDES += [
'..',
]

USE_LIBS += [
'mozalloc',
'xpcomglue_s',
'xul-shared',
]
5 changes: 5 additions & 0 deletions content/media/webaudio/compiledtest/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,8 @@ LOCAL_INCLUDES += [
'..',
]

USE_LIBS += [
'mozalloc',
'xpcomglue_s',
'xul-shared',
]
5 changes: 5 additions & 0 deletions dom/audiochannel/tests/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,8 @@ MOCHITEST_MANIFESTS += ['mochitest.ini']

FAIL_ON_WARNINGS = True

USE_LIBS += [
'mozalloc',
'xpcomglue_s',
'xul-shared',
]
5 changes: 5 additions & 0 deletions editor/txmgr/tests/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,8 @@ SOURCES += sorted('%s.cpp' % t for t in CPP_UNIT_TESTS)

FAIL_ON_WARNINGS = True

USE_LIBS += [
'mozalloc',
'xpcomglue_s',
'xul-shared',
]
Loading

0 comments on commit 5fab42f

Please sign in to comment.