diff --git a/build/autoconf/android.m4 b/build/autoconf/android.m4 index 6d9ff0233f4..985263897c7 100644 --- a/build/autoconf/android.m4 +++ b/build/autoconf/android.m4 @@ -240,7 +240,6 @@ if test "$OS_TARGET" = "Android" -a -z "$gonkdir"; then fi else STLPORT_CPPFLAGS="-isystem $_topsrcdir/build/stlport/stlport -isystem $_topsrcdir/build/stlport/overrides -isystem $android_ndk/sources/cxx-stl/system/include" - STLPORT_LIBS="$_objdir/build/stlport/libstlport_static.a -static-libstdc++" fi fi CXXFLAGS="$CXXFLAGS $STLPORT_CPPFLAGS" diff --git a/build/stlport/moz.build b/build/stlport/moz.build index 649ce0b27f7..bf31b63995c 100644 --- a/build/stlport/moz.build +++ b/build/stlport/moz.build @@ -4,7 +4,13 @@ # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. -Library('stlport_static') +Library('stlport') +# Keep the same name as the NDK-provided library, while using a shorter +# name for the Library for convenience in moz.build. +STATIC_LIBRARY_NAME = 'stlport_static' + +if not CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk': + OS_LIBS += ['-static-libstdc++'] FORCE_STATIC_LIB = True diff --git a/build/templates.mozbuild b/build/templates.mozbuild index bfc67c80c42..c3082b5d4c0 100644 --- a/build/templates.mozbuild +++ b/build/templates.mozbuild @@ -5,19 +5,31 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. @template -def StdCppCompat(): - '''Template for libstdc++ compatibility for target binaries.''' +def Binary(): + '''Generic template for target binaries. Meant to be used by other + templates.''' if CONFIG['MOZ_LIBSTDCXX_TARGET_VERSION']: USE_LIBS += ['stdc++compat'] + # Ideally, we'd support not adding this to the LIB_IS_C_ONLY case, + # but that variable is actually only set in db/sqlite/src, which + # doesn't build a shared library on the relevant platforms anyways. + # Eventually, though, we should detect LIB_IS_C_ONLY based on the + # associated SOURCES (and there might actually be places where we + # haven't set it but should have). + if CONFIG['STLPORT_LIBS']: + OS_LIBS += [CONFIG['STLPORT_LIBS']] + elif CONFIG['OS_TARGET'] == 'Android': + USE_LIBS += ['stlport'] + @template def Program(name): '''Template for program executables.''' PROGRAM = name - StdCppCompat() + Binary() @template @@ -29,7 +41,7 @@ def SimplePrograms(names, ext='.cpp'): SIMPLE_PROGRAMS += names SOURCES += ['%s%s' % (name, ext) for name in names] - StdCppCompat() + Binary() @template @@ -41,7 +53,7 @@ def CppUnitTests(names, ext='.cpp'): CPP_UNIT_TESTS += names SOURCES += ['%s%s' % (name, ext) for name in names] - StdCppCompat() + Binary() @template @@ -57,7 +69,7 @@ def SharedLibrary(name): FORCE_SHARED_LIB = True - StdCppCompat() + Binary() @template diff --git a/config/rules.mk b/config/rules.mk index 3ce9c5c15f0..1dab3cc16c7 100644 --- a/config/rules.mk +++ b/config/rules.mk @@ -696,7 +696,7 @@ ifdef MOZ_PROFILE_GENERATE touch -t `date +%Y%m%d%H%M.%S -d 'now+5seconds'` pgo.relink endif else # !WINNT || GNU_CC - $(EXPAND_CCC) -o $@ $(CXXFLAGS) $(PROGOBJS) $(RESFILE) $(WIN32_EXE_LDFLAGS) $(LDFLAGS) $(WRAP_LDFLAGS) $(STATIC_LIBS) $(MOZ_PROGRAM_LDFLAGS) $(SHARED_LIBS) $(EXTRA_LIBS) $(OS_LIBS) $(BIN_FLAGS) $(EXE_DEF_FILE) $(STLPORT_LIBS) + $(EXPAND_CCC) -o $@ $(CXXFLAGS) $(PROGOBJS) $(RESFILE) $(WIN32_EXE_LDFLAGS) $(LDFLAGS) $(WRAP_LDFLAGS) $(STATIC_LIBS) $(MOZ_PROGRAM_LDFLAGS) $(SHARED_LIBS) $(EXTRA_LIBS) $(OS_LIBS) $(BIN_FLAGS) $(EXE_DEF_FILE) $(call CHECK_BINARY,$@) endif # WINNT && !GNU_CC @@ -752,7 +752,7 @@ ifdef MSMANIFEST_TOOL fi endif # MSVC with manifest tool else - $(EXPAND_CCC) $(CXXFLAGS) -o $@ $< $(WIN32_EXE_LDFLAGS) $(LDFLAGS) $(WRAP_LDFLAGS) $(STATIC_LIBS) $(MOZ_PROGRAM_LDFLAGS) $(SHARED_LIBS) $(EXTRA_LIBS) $(OS_LIBS) $(BIN_FLAGS) $(STLPORT_LIBS) + $(EXPAND_CCC) $(CXXFLAGS) -o $@ $< $(WIN32_EXE_LDFLAGS) $(LDFLAGS) $(WRAP_LDFLAGS) $(STATIC_LIBS) $(MOZ_PROGRAM_LDFLAGS) $(SHARED_LIBS) $(EXTRA_LIBS) $(OS_LIBS) $(BIN_FLAGS) $(call CHECK_BINARY,$@) endif # WINNT && !GNU_CC @@ -834,10 +834,10 @@ ifdef DTRACE_LIB_DEPENDENT ifndef XP_MACOSX dtrace -G -C -s $(MOZILLA_DTRACE_SRC) -o $(DTRACE_PROBE_OBJ) $(shell $(EXPAND_LIBS) $(MOZILLA_PROBE_LIBS)) endif - $(EXPAND_MKSHLIB) $(SHLIB_LDSTARTFILE) $(OBJS) $(SUB_SHLOBJS) $(DTRACE_PROBE_OBJ) $(MOZILLA_PROBE_LIBS) $(RESFILE) $(LDFLAGS) $(WRAP_LDFLAGS) $(STATIC_LIBS) $(SHARED_LIBS) $(EXTRA_DSO_LDOPTS) $(MOZ_GLUE_LDFLAGS) $(EXTRA_LIBS) $(OS_LIBS) $(SHLIB_LDENDFILE) $(if $(LIB_IS_C_ONLY),,$(STLPORT_LIBS)) + $(EXPAND_MKSHLIB) $(SHLIB_LDSTARTFILE) $(OBJS) $(SUB_SHLOBJS) $(DTRACE_PROBE_OBJ) $(MOZILLA_PROBE_LIBS) $(RESFILE) $(LDFLAGS) $(WRAP_LDFLAGS) $(STATIC_LIBS) $(SHARED_LIBS) $(EXTRA_DSO_LDOPTS) $(MOZ_GLUE_LDFLAGS) $(EXTRA_LIBS) $(OS_LIBS) $(SHLIB_LDENDFILE) @$(RM) $(DTRACE_PROBE_OBJ) else # ! DTRACE_LIB_DEPENDENT - $(EXPAND_MKSHLIB) $(SHLIB_LDSTARTFILE) $(OBJS) $(SUB_SHLOBJS) $(RESFILE) $(LDFLAGS) $(WRAP_LDFLAGS) $(STATIC_LIBS) $(SHARED_LIBS) $(EXTRA_DSO_LDOPTS) $(MOZ_GLUE_LDFLAGS) $(EXTRA_LIBS) $(OS_LIBS) $(SHLIB_LDENDFILE) $(if $(LIB_IS_C_ONLY),,$(STLPORT_LIBS)) + $(EXPAND_MKSHLIB) $(SHLIB_LDSTARTFILE) $(OBJS) $(SUB_SHLOBJS) $(RESFILE) $(LDFLAGS) $(WRAP_LDFLAGS) $(STATIC_LIBS) $(SHARED_LIBS) $(EXTRA_DSO_LDOPTS) $(MOZ_GLUE_LDFLAGS) $(EXTRA_LIBS) $(OS_LIBS) $(SHLIB_LDENDFILE) endif # DTRACE_LIB_DEPENDENT $(call CHECK_BINARY,$@) diff --git a/configure.in b/configure.in index 0835c671e2c..fba6d8c9102 100644 --- a/configure.in +++ b/configure.in @@ -229,7 +229,6 @@ if test -n "$gonkdir" ; then AC_MSG_ERROR([Couldn't find path to stlport sources in the gonk tree]) fi STLPORT_CPPFLAGS="-I$_topsrcdir/build/stlport/stlport -I$gonkdir/ndk/sources/cxx-stl/system/include" - STLPORT_LIBS="$_objdir/build/stlport/libstlport_static.a" case "$target_cpu" in arm) @@ -9060,8 +9059,6 @@ HAVE_SYS_VFS_H HAVE_SYS_MOUNT_H " -AC_SUBST(STLPORT_LIBS) - dnl ======================================================== dnl ICU Support dnl ======================================================== diff --git a/python/mozbuild/mozbuild/backend/recursivemake.py b/python/mozbuild/mozbuild/backend/recursivemake.py index 6bf9a7a70f6..c3d77652fd2 100644 --- a/python/mozbuild/mozbuild/backend/recursivemake.py +++ b/python/mozbuild/mozbuild/backend/recursivemake.py @@ -1166,13 +1166,6 @@ INSTALL_TARGETS += %(prefix)s if obj.config.substs.get('MOZ_MEMORY'): self._compile_graph[build_target].add('memory/build/target') - # Until STLPORT_LIBS are properly handled in moz.build world, assume - # any program or shared library we build depends on it. - if obj.KIND == 'target' and not isinstance(obj, StaticLibrary) and \ - build_target != 'build/stlport/target' and \ - 'stlport' in obj.config.substs.get('STLPORT_LIBS'): - self._compile_graph[build_target].add('build/stlport/target') - for lib in obj.linked_libraries: if not isinstance(lib, ExternalLibrary): self._compile_graph[build_target].add(