ANDROID: Use the official NDK toolchain
- use NDK r5b - cleanup
This commit is contained in:
parent
ae25d185d5
commit
51a966e9e6
1 changed files with 48 additions and 18 deletions
66
configure
vendored
66
configure
vendored
|
@ -979,7 +979,7 @@ case $_host in
|
||||||
android)
|
android)
|
||||||
_host_os=android
|
_host_os=android
|
||||||
_host_cpu=arm
|
_host_cpu=arm
|
||||||
_host_alias=arm-oe-linux-androideabi
|
_host_alias=arm-linux-androideabi
|
||||||
;;
|
;;
|
||||||
arm-riscos)
|
arm-riscos)
|
||||||
_host_os=riscos
|
_host_os=riscos
|
||||||
|
@ -1208,6 +1208,10 @@ android)
|
||||||
echo "Please set ANDROID_SDK in your environment. export ANDROID_SDK=<path to Android SDK>"
|
echo "Please set ANDROID_SDK in your environment. export ANDROID_SDK=<path to Android SDK>"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
if test -z "$ANDROID_NDK"; then
|
||||||
|
echo "Please set ANDROID_NDK in your environment. export ANDROID_NDK=<path to Android NDK>"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
;;
|
;;
|
||||||
ds | gamecube | wii)
|
ds | gamecube | wii)
|
||||||
if test -z "$DEVKITPRO"; then
|
if test -z "$DEVKITPRO"; then
|
||||||
|
@ -1500,7 +1504,13 @@ case $_host_os in
|
||||||
add_line_to_config_mk 'AMIGAOS = 1'
|
add_line_to_config_mk 'AMIGAOS = 1'
|
||||||
;;
|
;;
|
||||||
android)
|
android)
|
||||||
CXXFLAGS="$CXXFLAGS -Os -msoft-float -mtune=xscale -march=armv5te -D__ARM_ARCH_5__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5TE__"
|
CXXFLAGS="$CXXFLAGS --sysroot=$ANDROID_NDK/platforms/android-4/arch-arm"
|
||||||
|
CXXFLAGS="$CXXFLAGS -Os -mandroid -msoft-float -mthumb-interwork"
|
||||||
|
CXXFLAGS="$CXXFLAGS -march=armv5te -mtune=xscale"
|
||||||
|
# supress 'mangling of 'va_list' has changed in GCC 4.4'
|
||||||
|
CXXFLAGS="$CXXFLAGS -Wno-psabi"
|
||||||
|
LDFLAGS="$LDFLAGS --sysroot=$ANDROID_NDK/platforms/android-4/arch-arm"
|
||||||
|
LDFLAGS="$LDFLAGS -mandroid -mthumb-interwork"
|
||||||
add_line_to_config_mk "ANDROID_SDK = $ANDROID_SDK"
|
add_line_to_config_mk "ANDROID_SDK = $ANDROID_SDK"
|
||||||
_unix=yes
|
_unix=yes
|
||||||
_seq_midi=no
|
_seq_midi=no
|
||||||
|
@ -1649,9 +1659,13 @@ if test -n "$_host"; then
|
||||||
echo "Cross-compiling to $_host"
|
echo "Cross-compiling to $_host"
|
||||||
case "$_host" in
|
case "$_host" in
|
||||||
android)
|
android)
|
||||||
DEFINES="$DEFINES -DANDROID -DUSE_ARM_SMUSH_ASM"
|
DEFINES="$DEFINES -DANDROID -DANDROID_BACKEND"
|
||||||
_unix=yes
|
_unix=yes
|
||||||
_need_memalign=yes
|
_need_memalign=yes
|
||||||
|
# we link a .so as default
|
||||||
|
LDFLAGS="$LDFLAGS -shared -Wl,-Bsymbolic,--no-undefined"
|
||||||
|
HOSTEXEPRE=lib
|
||||||
|
HOSTEXEEXT=.so
|
||||||
add_line_to_config_mk 'USE_ARM_SOUND_ASM = 1'
|
add_line_to_config_mk 'USE_ARM_SOUND_ASM = 1'
|
||||||
add_line_to_config_mk 'USE_ARM_SMUSH_ASM = 1'
|
add_line_to_config_mk 'USE_ARM_SMUSH_ASM = 1'
|
||||||
add_line_to_config_mk 'USE_ARM_GFX_ASM = 1'
|
add_line_to_config_mk 'USE_ARM_GFX_ASM = 1'
|
||||||
|
@ -1659,6 +1673,7 @@ if test -n "$_host"; then
|
||||||
add_line_to_config_mk 'USE_ARM_COSTUME_ASM = 1'
|
add_line_to_config_mk 'USE_ARM_COSTUME_ASM = 1'
|
||||||
_backend="android"
|
_backend="android"
|
||||||
_port_mk="backends/platform/android/android.mk"
|
_port_mk="backends/platform/android/android.mk"
|
||||||
|
_build_scalers=no
|
||||||
_seq_midi=no
|
_seq_midi=no
|
||||||
;;
|
;;
|
||||||
arm-linux|arm*-linux-gnueabi|arm-*-linux)
|
arm-linux|arm*-linux-gnueabi|arm-*-linux)
|
||||||
|
@ -2135,6 +2150,32 @@ _def_plugin="/* -> plugins disabled */"
|
||||||
if test "$_dynamic_modules" = yes ; then
|
if test "$_dynamic_modules" = yes ; then
|
||||||
echo_n "Checking whether building plugins is supported... "
|
echo_n "Checking whether building plugins is supported... "
|
||||||
case $_host_os in
|
case $_host_os in
|
||||||
|
android)
|
||||||
|
_def_plugin='
|
||||||
|
#define PLUGIN_PREFIX "lib"
|
||||||
|
#define PLUGIN_SUFFIX ".so"
|
||||||
|
'
|
||||||
|
# Work around an Android 2.0+ run-time linker bug:
|
||||||
|
# The linker doesn't actually look in previously
|
||||||
|
# loaded libraries when trying to resolve symbols -
|
||||||
|
# effectively turning all dlopen(RTLD_GLOBAL) calls
|
||||||
|
# into dlopen(RTLD_LOCAL). It *does* look in
|
||||||
|
# DT_NEEDED libraries, so the workaround is to add an
|
||||||
|
# (otherwise unnecessary) dependency from plugins back
|
||||||
|
# to the main libscummvm.so.
|
||||||
|
_mak_plugins='
|
||||||
|
DYNAMIC_MODULES := 1
|
||||||
|
PLUGIN_PREFIX := lib
|
||||||
|
PLUGIN_SUFFIX := .so
|
||||||
|
PLUGIN_EXTRA_DEPS = libscummvm.so
|
||||||
|
CXXFLAGS += -DDYNAMIC_MODULES
|
||||||
|
CXXFLAGS += -fpic
|
||||||
|
PLUGIN_LDFLAGS += $(LDFLAGS) -L. -lscummvm
|
||||||
|
PRE_OBJS_FLAGS := -Wl,-export-dynamic -Wl,-whole-archive
|
||||||
|
POST_OBJS_FLAGS := -Wl,-no-whole-archive
|
||||||
|
LIBS += -ldl
|
||||||
|
'
|
||||||
|
;;
|
||||||
darwin*)
|
darwin*)
|
||||||
_def_plugin='
|
_def_plugin='
|
||||||
#define PLUGIN_PREFIX ""
|
#define PLUGIN_PREFIX ""
|
||||||
|
@ -2217,7 +2258,7 @@ POST_OBJS_FLAGS := -Wl,-no-whole-archive
|
||||||
LIBS += -ldl
|
LIBS += -ldl
|
||||||
'
|
'
|
||||||
;;
|
;;
|
||||||
linux*|android)
|
linux*)
|
||||||
_def_plugin='
|
_def_plugin='
|
||||||
#define PLUGIN_PREFIX "lib"
|
#define PLUGIN_PREFIX "lib"
|
||||||
#define PLUGIN_SUFFIX ".so"
|
#define PLUGIN_SUFFIX ".so"
|
||||||
|
@ -2928,20 +2969,9 @@ case $_backend in
|
||||||
# -lgcc is carefully placed here - we want to catch
|
# -lgcc is carefully placed here - we want to catch
|
||||||
# all toolchain symbols in *our* libraries rather
|
# all toolchain symbols in *our* libraries rather
|
||||||
# than pick up anything unhygenic from the Android libs.
|
# than pick up anything unhygenic from the Android libs.
|
||||||
LIBS="-Wl,-Bstatic $static_libs -Wl,-Bdynamic -lgcc $system_libs -lstdc++ -llog -lGLESv1_CM"
|
LIBS="-Wl,-Bstatic $static_libs"
|
||||||
DEFINES="$DEFINES -D__ANDROID__ -DANDROID_BACKEND -DREDUCE_MEMORY_USAGE"
|
LIBS="$LIBS -Wl,-Bdynamic -lgcc $system_libs -llog -lGLESv1_CM"
|
||||||
add_line_to_config_mk 'PLUGIN_LDFLAGS += $(LDFLAGS) -Wl,-shared,-Bsymbolic'
|
DEFINES="$DEFINES -D__ANDROID__ -DREDUCE_MEMORY_USAGE"
|
||||||
|
|
||||||
# Work around an Android 2.0+ run-time linker bug:
|
|
||||||
# The linker doesn't actually look in previously
|
|
||||||
# loaded libraries when trying to resolve symbols -
|
|
||||||
# effectively turning all dlopen(RTLD_GLOBAL) calls
|
|
||||||
# into dlopen(RTLD_LOCAL). It *does* look in
|
|
||||||
# DT_NEEDED libraries, so the workaround is to add an
|
|
||||||
# (otherwise unnecessary) dependency from plugins back
|
|
||||||
# to the main libscummvm.so.
|
|
||||||
add_line_to_config_mk 'PLUGIN_LDFLAGS += -Lbuild.tmp -lscummvm'
|
|
||||||
add_line_to_config_mk 'PLUGIN_EXTRA_DEPS += build.tmp/libscummvm.so'
|
|
||||||
;;
|
;;
|
||||||
dc)
|
dc)
|
||||||
INCLUDES="$INCLUDES "'-I$(srcdir)/backends/platform/dc -isystem $(ronindir)/include'
|
INCLUDES="$INCLUDES "'-I$(srcdir)/backends/platform/dc -isystem $(ronindir)/include'
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue