forked from mirrors/gecko-dev
Bug 1814802 - Move STLPORT_LIBS to moz.configure. r=firefox-build-system-reviewers,glandium
android.m4 has old code for old NDK that we don't support, so this fix removes it. Differential Revision: https://phabricator.services.mozilla.com/D168761
This commit is contained in:
parent
9216b12fb2
commit
8d4bc253e5
4 changed files with 36 additions and 44 deletions
|
|
@ -25,33 +25,3 @@ case "$target" in
|
|||
esac
|
||||
|
||||
])
|
||||
|
||||
AC_DEFUN([MOZ_ANDROID_STLPORT],
|
||||
[
|
||||
|
||||
if test "$OS_TARGET" = "Android"; then
|
||||
if test -z "$STLPORT_LIBS"; then
|
||||
# android-ndk-r8b and later
|
||||
cxx_libs="$android_ndk/sources/cxx-stl/llvm-libc++/libs/$ANDROID_CPU_ARCH"
|
||||
# NDK r12 removed the arm/thumb library split and just made
|
||||
# everything thumb by default. Attempt to compensate.
|
||||
if test "$MOZ_THUMB2" = 1 -a -d "$cxx_libs/thumb"; then
|
||||
cxx_libs="$cxx_libs/thumb"
|
||||
fi
|
||||
|
||||
if ! test -e "$cxx_libs/libc++_static.a"; then
|
||||
AC_MSG_ERROR([Couldn't find path to llvm-libc++ in the android ndk])
|
||||
fi
|
||||
|
||||
STLPORT_LIBS="-L$cxx_libs -lc++_static"
|
||||
# NDK r12 split the libc++ runtime libraries into pieces.
|
||||
for lib in c++abi unwind android_support; do
|
||||
if test -e "$cxx_libs/lib${lib}.a"; then
|
||||
STLPORT_LIBS="$STLPORT_LIBS -l${lib}"
|
||||
fi
|
||||
done
|
||||
fi
|
||||
fi
|
||||
AC_SUBST_LIST([STLPORT_LIBS])
|
||||
|
||||
])
|
||||
|
|
|
|||
|
|
@ -364,6 +364,42 @@ def stlport_cppflags(value, ndk):
|
|||
add_old_configure_assignment("stlport_cppflags", stlport_cppflags)
|
||||
|
||||
|
||||
option(
|
||||
env="STLPORT_LIBS",
|
||||
nargs=1,
|
||||
help="Options linker should pass for standard C++ library",
|
||||
)
|
||||
|
||||
|
||||
@depends("STLPORT_LIBS", ndk, android_cpu_arch)
|
||||
@imports(_from="os.path", _import="isfile")
|
||||
def stlport_libs(value, ndk, android_cpu_arch):
|
||||
if value and len(value):
|
||||
return value.split()
|
||||
if not ndk:
|
||||
return
|
||||
|
||||
cxx_libs = os.path.join(
|
||||
ndk, "sources", "cxx-stl", "llvm-libc++", "libs", android_cpu_arch
|
||||
)
|
||||
if not isfile(os.path.join(cxx_libs, "libc++_static.a")):
|
||||
die("Couldn't find path to llvm-libc++ in the android ndk")
|
||||
|
||||
libs = [
|
||||
"-L%s" % cxx_libs,
|
||||
"-lc++_static",
|
||||
]
|
||||
|
||||
for lib in ("c++abi", "unwind", "android_support"):
|
||||
if isfile(os.path.join(cxx_libs, "lib%s.a" % lib)):
|
||||
libs.append("-l%s" % lib)
|
||||
|
||||
return libs
|
||||
|
||||
|
||||
set_config("STLPORT_LIBS", stlport_libs)
|
||||
|
||||
|
||||
@depends(android_system, android_sysroot, android_toolchain, android_version)
|
||||
def extra_toolchain_flags(
|
||||
android_system, android_sysroot, toolchain_dir, android_version
|
||||
|
|
|
|||
|
|
@ -169,12 +169,6 @@ dnl Configure platform-specific CPU architecture compiler options.
|
|||
dnl ==============================================================
|
||||
MOZ_ARCH_OPTS
|
||||
|
||||
dnl ========================================================
|
||||
dnl Android libstdc++
|
||||
dnl ========================================================
|
||||
|
||||
MOZ_ANDROID_STLPORT
|
||||
|
||||
MOZ_CONFIG_SANITIZE
|
||||
|
||||
dnl ========================================================
|
||||
|
|
|
|||
|
|
@ -190,14 +190,6 @@ if test "$COMPILE_ENVIRONMENT"; then
|
|||
MOZ_ARCH_OPTS
|
||||
fi # COMPILE_ENVIRONMENT
|
||||
|
||||
dnl ========================================================
|
||||
dnl Android libstdc++
|
||||
dnl ========================================================
|
||||
|
||||
if test "$COMPILE_ENVIRONMENT"; then
|
||||
MOZ_ANDROID_STLPORT
|
||||
fi # COMPILE_ENVIRONMENT
|
||||
|
||||
if test -n "$COMPILE_ENVIRONMENT"; then
|
||||
MOZ_CONFIG_SANITIZE
|
||||
fi
|
||||
|
|
|
|||
Loading…
Reference in a new issue