forked from albertz/commandergenius
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added support for armeabi-v7a-hard architecture, it seems to be buggy…
…, because Ballfield launches but does not draw anything. To be fixed later.
- Loading branch information
Showing
11 changed files
with
149 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,16 @@ | ||
APP_PROJECT_PATH := $(call my-dir)/.. | ||
|
||
include jni/Settings.mk | ||
|
||
APP_STL := gnustl_static | ||
APP_CFLAGS := -O3 -DNDEBUG -g # arm-linux-androideabi-4.4.3 crashes in -O0 mode on SDL sources | ||
APP_PLATFORM := android-14 # Android 4.0, it should be backward compatible to previous versions | ||
APP_PIE := false # This feature makes executables incompatible to Android API 15 or lower | ||
|
||
include jni/Settings.mk | ||
|
||
# Global compiler flags | ||
ifneq ($(filter armeabi-v7a-hard, $(APP_ABI)),) | ||
# Link-time optimization enabled for optimization junkies. -O9001 etc | ||
APP_CFLAGS := -flto | ||
APP_CXXFLAGS := -flto | ||
APP_LDFLAGS := -flto | ||
endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
109 changes: 109 additions & 0 deletions
109
project/jni/application/setEnvironment-armeabi-v7a-hard.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
#!/bin/sh | ||
|
||
IFS=' | ||
' | ||
|
||
MYARCH=linux-x86 | ||
if uname -s | grep -i "linux" > /dev/null ; then | ||
MYARCH=linux-x86 | ||
fi | ||
if uname -s | grep -i "darwin" > /dev/null ; then | ||
MYARCH=darwin-x86 | ||
fi | ||
if uname -s | grep -i "windows" > /dev/null ; then | ||
MYARCH=windows-x86 | ||
fi | ||
|
||
NDK=`which ndk-build` | ||
NDK=`dirname $NDK` | ||
NDK=`readlink -f $NDK` | ||
|
||
grep "64.bit" "$NDK/RELEASE.TXT" >/dev/null 2>&1 && MYARCH="${MYARCH}_64" | ||
|
||
#echo NDK $NDK | ||
GCCPREFIX=arm-linux-androideabi | ||
[ -z "$GCCVER" ] && GCCVER=4.6 | ||
[ -z "$PLATFORMVER" ] && PLATFORMVER=android-14 | ||
LOCAL_PATH=`dirname $0` | ||
if which realpath > /dev/null ; then | ||
LOCAL_PATH=`realpath $LOCAL_PATH` | ||
else | ||
LOCAL_PATH=`cd $LOCAL_PATH && pwd` | ||
fi | ||
ARCH=armeabi-v7a-hard | ||
|
||
APP_MODULES=`grep 'APP_MODULES [:][=]' $LOCAL_PATH/../Settings.mk | sed 's@.*[=]\(.*\)@\1@'` | ||
APP_AVAILABLE_STATIC_LIBS=`grep 'APP_AVAILABLE_STATIC_LIBS [:][=]' $LOCAL_PATH/../Settings.mk | sed 's@.*[=]\(.*\)@\1@'` | ||
APP_SHARED_LIBS=$( | ||
echo $APP_MODULES | xargs -n 1 echo | while read LIB ; do | ||
STATIC=`echo $APP_AVAILABLE_STATIC_LIBS application sdl_main stlport stdout-test | grep "\\\\b$LIB\\\\b"` | ||
if [ -n "$STATIC" ] ; then true | ||
else | ||
echo $LIB | ||
fi | ||
done | ||
) | ||
|
||
|
||
MISSING_INCLUDE= | ||
MISSING_LIB= | ||
|
||
CFLAGS="\ | ||
-fpic -ffunction-sections -funwind-tables -fstack-protector \ | ||
-no-canonical-prefixes -march=armv7-a -mhard-float -D_NDK_MATH_NO_SOFTFP=1 -flto \ | ||
-mfpu=vfpv3-d16 -mthumb -O2 -g -DNDEBUG \ | ||
-fomit-frame-pointer -fno-strict-aliasing -finline-limit=300 \ | ||
-DANDROID -Wall -Wno-unused -Wa,--noexecstack -Wformat -Werror=format-security \ | ||
-isystem$NDK/platforms/$PLATFORMVER/arch-arm/usr/include \ | ||
-isystem$NDK/sources/cxx-stl/gnu-libstdc++/$GCCVER/include \ | ||
-isystem$NDK/sources/cxx-stl/gnu-libstdc++/$GCCVER/libs/$ARCH/include \ | ||
-isystem$NDK/sources/cxx-stl/gnu-libstdc++/$GCCVER/include/backward \ | ||
-isystem$LOCAL_PATH/../sdl-1.2/include \ | ||
`echo $APP_MODULES | sed \"s@\([-a-zA-Z0-9_.]\+\)@-isystem$LOCAL_PATH/../\1/include@g\"` \ | ||
$MISSING_INCLUDE $CFLAGS" | ||
|
||
if [ -z "$SHARED_LIBRARY_NAME" ]; then | ||
SHARED_LIBRARY_NAME=libapplication.so | ||
fi | ||
UNRESOLVED="-Wl,--no-undefined" | ||
SHARED="-shared -Wl,-soname,$SHARED_LIBRARY_NAME" | ||
if [ -n "$BUILD_EXECUTABLE" ]; then | ||
SHARED="-Wl,--gc-sections -Wl,-z,nocopyreloc" | ||
fi | ||
if [ -n "$NO_SHARED_LIBS" ]; then | ||
APP_SHARED_LIBS= | ||
fi | ||
if [ -n "$ALLOW_UNRESOLVED_SYMBOLS" ]; then | ||
UNRESOLVED= | ||
fi | ||
|
||
LDFLAGS="\ | ||
$SHARED \ | ||
--sysroot=$NDK/platforms/$PLATFORMVER/arch-arm \ | ||
-L$LOCAL_PATH/../../obj/local/$ARCH \ | ||
`echo $APP_SHARED_LIBS | sed \"s@\([-a-zA-Z0-9_.]\+\)@$LOCAL_PATH/../../obj/local/$ARCH/lib\1.so@g\"` \ | ||
-L$NDK/platforms/$PLATFORMVER/arch-arm/usr/lib \ | ||
-lc -lGLESv1_CM -ldl -llog -lz \ | ||
-Wl,--no-warn-mismatch -lm_hard -flto \ | ||
-L$NDK/sources/cxx-stl/gnu-libstdc++/$GCCVER/libs/$ARCH \ | ||
-lgnustl_static \ | ||
-no-canonical-prefixes -march=armv7-a -Wl,--fix-cortex-a8 $UNRESOLVED -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now \ | ||
-lsupc++ \ | ||
$MISSING_LIB $LDFLAGS" | ||
|
||
#echo env CFLAGS=\""$CFLAGS"\" LDFLAGS=\""$LDFLAGS"\" "$@" | ||
|
||
env PATH=$NDK/toolchains/$GCCPREFIX-$GCCVER/prebuilt/$MYARCH/bin:$LOCAL_PATH:$PATH \ | ||
CFLAGS="$CFLAGS" \ | ||
CXXFLAGS="$CXXFLAGS $CFLAGS -frtti -fexceptions" \ | ||
LDFLAGS="$LDFLAGS" \ | ||
CC="$NDK/toolchains/$GCCPREFIX-$GCCVER/prebuilt/$MYARCH/bin/$GCCPREFIX-gcc" \ | ||
CXX="$NDK/toolchains/$GCCPREFIX-$GCCVER/prebuilt/$MYARCH/bin/$GCCPREFIX-g++" \ | ||
RANLIB="$NDK/toolchains/$GCCPREFIX-$GCCVER/prebuilt/$MYARCH/bin/$GCCPREFIX-ranlib" \ | ||
LD="$NDK/toolchains/$GCCPREFIX-$GCCVER/prebuilt/$MYARCH/bin/$GCCPREFIX-g++" \ | ||
AR="$NDK/toolchains/$GCCPREFIX-$GCCVER/prebuilt/$MYARCH/bin/$GCCPREFIX-ar" \ | ||
CPP="$NDK/toolchains/$GCCPREFIX-$GCCVER/prebuilt/$MYARCH/bin/$GCCPREFIX-cpp $CFLAGS" \ | ||
NM="$NDK/toolchains/$GCCPREFIX-$GCCVER/prebuilt/$MYARCH/bin/$GCCPREFIX-nm" \ | ||
AS="$NDK/toolchains/$GCCPREFIX-$GCCVER/prebuilt/$MYARCH/bin/$GCCPREFIX-as" \ | ||
STRIP="$NDK/toolchains/$GCCPREFIX-$GCCVER/prebuilt/$MYARCH/bin/$GCCPREFIX-strip" \ | ||
"$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters