Added multi-ABI support to ChangeAppSettings.sh, fixed libMAD compilation
This commit is contained in:
@@ -5,5 +5,5 @@ AppDataDownloadUrl="http://sites.google.com/site/xpelyax/Home/alienblaster110_da
|
||||
DownloadToSdcard=n
|
||||
SdlVideoResize=a
|
||||
NeedDepthBuffer=n
|
||||
CompiledLibraries="sdl sdl_mixer tremor mad sdl_image png jpeg sdl_ttf freetype"
|
||||
CompiledLibraries="mad sdl_mixer sdl_image sdl_ttf"
|
||||
ReadmeText='^Use accelerometer to navigate menus and control ship^Press "Menu" to select menu and for secondary fire^Press "Call" or touch screen for primary fire^Press "Volume Up/Down" to cycle through weapons'
|
||||
|
||||
@@ -45,10 +45,16 @@ if [ -n "$var" ] ; then
|
||||
NeedDepthBuffer="$var"
|
||||
fi
|
||||
|
||||
echo -n "\nLibraries to compile (removing some of them will save space, MP3 support by libMAD is encumbered by patents and libMAD is GPL-ed)"
|
||||
echo -n "\nEnable multi-ABI binary, with hardware FPU support (it will also work on old devices, but .apk size is 2x bigger) (y) or (n) ($MultiABI): "
|
||||
read var
|
||||
if [ -n "$var" ] ; then
|
||||
MultiABI="$var"
|
||||
fi
|
||||
|
||||
echo -n "\nOptional shared libraries to compile - removing some of them will save space\nMP3 support by libMAD is encumbered by patents and libMAD is GPL-ed\n"
|
||||
grep 'Available libraries:' project/Application.mk
|
||||
grep 'depends on' project/Application.mk
|
||||
echo "Current: $CompiledLibraries\n\n: "
|
||||
grep 'depends on' project/Application.mk
|
||||
echo -n "Current: $CompiledLibraries\n\n: "
|
||||
read var
|
||||
if [ -n "$var" ] ; then
|
||||
CompiledLibraries="$var"
|
||||
@@ -58,6 +64,7 @@ echo -n "\nHere you may type some short readme text that will be shown when app
|
||||
echo -n "\nCurrent text:\n"
|
||||
echo -n "`echo $ReadmeText | tr '^' '\\n'`"
|
||||
echo -n "\n\nNew text (empty line to finish):\n\n"
|
||||
|
||||
ReadmeText1=""
|
||||
while true; do
|
||||
read var
|
||||
@@ -81,6 +88,7 @@ echo AppDataDownloadUrl=\"$AppDataDownloadUrl\" >> AppSettings.cfg
|
||||
echo DownloadToSdcard=$DownloadToSdcard >> AppSettings.cfg
|
||||
echo SdlVideoResize=$SdlVideoResize >> AppSettings.cfg
|
||||
echo NeedDepthBuffer=$NeedDepthBuffer >> AppSettings.cfg
|
||||
echo MultiABI=$MultiABI >> AppSettings.cfg
|
||||
echo CompiledLibraries=\"$CompiledLibraries\" >> AppSettings.cfg
|
||||
echo ReadmeText=\'$ReadmeText\' >> AppSettings.cfg
|
||||
|
||||
@@ -110,13 +118,23 @@ if [ "$NeedDepthBuffer" = "y" ] ; then
|
||||
else
|
||||
NeedDepthBuffer=false
|
||||
fi
|
||||
if [ "$MultiABI" = "y" ] ; then
|
||||
MultiABI="armeabi armeabi-v7a"
|
||||
else
|
||||
MultiABI="armeabi"
|
||||
fi
|
||||
SdlMixerUseLibMad=0
|
||||
if echo $CompiledLibraries | grep '\bmad\b' > /dev/null ; then
|
||||
SdlMixerUseLibMad=1
|
||||
fi
|
||||
echo ReadmeText1 "$ReadmeText"
|
||||
LibrariesToLoad="System.loadLibrary(\\\"sdl\\\");"
|
||||
for lib in $CompiledLibraries; do
|
||||
LibrariesToLoad="$LibrariesToLoad System.loadLibrary(\\\"$lib\\\");"
|
||||
done
|
||||
echo CompiledLibraries $CompiledLibraries
|
||||
echo LibrariesToLoad $LibrariesToLoad
|
||||
|
||||
ReadmeText="`echo $ReadmeText | sed 's/\"/\\\\\\\\\"/g' | sed 's/[&%]//g'`"
|
||||
echo ReadmeText2 "$ReadmeText"
|
||||
|
||||
echo Patching project/AndroidManifest.xml
|
||||
cat project/AndroidManifest.xml | \
|
||||
@@ -139,7 +157,8 @@ cat project/src/Globals.java | \
|
||||
sed "s^public static String DataDownloadUrl = \".*\";^public static String DataDownloadUrl = \"$AppDataDownloadUrl1\";^" | \
|
||||
sed "s/public static boolean DownloadToSdcard = .*;/public static boolean DownloadToSdcard = $DownloadToSdcard1;/" | \
|
||||
sed "s/public static boolean NeedDepthBuffer = .*;/public static boolean NeedDepthBuffer = $NeedDepthBuffer;/" | \
|
||||
sed "s%public static String ReadmeText = .*%public static String ReadmeText = \"$ReadmeText\".replace(\"^\",\"\\\n\");%" > \
|
||||
sed "s%public static String ReadmeText = .*%public static String ReadmeText = \"$ReadmeText\".replace(\"^\",\"\\\n\");%" | \
|
||||
sed "s/public LoadLibrary() .*/public LoadLibrary() { $LibrariesToLoad };/" > \
|
||||
project/src/Globals.java.1
|
||||
mv -f project/src/Globals.java.1 project/src/Globals.java
|
||||
|
||||
@@ -156,7 +175,8 @@ cat project/jni/Android.mk | \
|
||||
mv -f project/jni/Android.mk.1 project/jni/Android.mk
|
||||
|
||||
cat project/Application.mk | \
|
||||
sed "s/APP_MODULES := .*/APP_MODULES := application sdl_main $CompiledLibraries/" > \
|
||||
sed "s/APP_MODULES := .*/APP_MODULES := application sdl_main stlport tremor png jpeg freetype $CompiledLibraries/" | \
|
||||
sed "s/APP_ABI := .*/APP_ABI := $MultiABI/" > \
|
||||
project/Application.mk.1
|
||||
mv -f project/Application.mk.1 project/Application.mk
|
||||
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
APP_PROJECT_PATH := $(call my-dir)
|
||||
|
||||
# Available libraries: stlport sdl sdl_mixer tremor mad sdl_image png jpeg sdl_ttf freetype
|
||||
# Available libraries: mad sdl_mixer sdl_image sdl_ttf
|
||||
# sdl_mixer depends on tremor and optionally mad
|
||||
# sdl_image depends on png and jpeg
|
||||
# sdl_ttf depends on freetype
|
||||
|
||||
APP_MODULES := application sdl_main sdl sdl_mixer tremor mad sdl_image png jpeg sdl_ttf freetype
|
||||
APP_MODULES := application sdl_main stlport tremor png jpeg freetype mad sdl_mixer sdl_image sdl_ttf
|
||||
|
||||
APP_ABI := armeabi armeabi-v7a
|
||||
|
||||
@@ -5,7 +5,8 @@ include $(CLEAR_VARS)
|
||||
LOCAL_MODULE := mad
|
||||
|
||||
LOCAL_CFLAGS := -I$(LOCAL_PATH) \
|
||||
-DOPT_SPEED -DSTDC_HEADERS -DHAVE_UNISTD_H \
|
||||
-DFPM_64BIT -DOPT_SPEED \
|
||||
-DSTDC_HEADERS -DHAVE_UNISTD_H \
|
||||
-DSIZEOF_INT=4 -DSIZEOF_LONG=4 -DSIZEOF_LONG_LONG=8 \
|
||||
-DHAVE_ASSERT_H -DHAVE_ERRNO_H -DHAVE_FCNTL_H -DHAVE_INTTYPES_H \
|
||||
-DHAVE_LIMITS_H -DHAVE_MEMORY_H -DHAVE_STDINT_H -DHAVE_STDLIB_H \
|
||||
|
||||
@@ -4,17 +4,18 @@ include $(CLEAR_VARS)
|
||||
|
||||
LOCAL_MODULE := sdl_mixer
|
||||
|
||||
LOCAL_CFLAGS := -I$(LOCAL_PATH) -I$(LOCAL_PATH)/.. -I$(LOCAL_PATH)/../sdl/include \
|
||||
LOCAL_CFLAGS := -I$(LOCAL_PATH) -I$(LOCAL_PATH)/.. -I$(LOCAL_PATH)/../sdl/include -I$(LOCAL_PATH)/../mad \
|
||||
-DWAV_MUSIC -DOGG_USE_TREMOR -DOGG_MUSIC
|
||||
|
||||
LOCAL_CPP_EXTENSION := .cpp
|
||||
|
||||
LOCAL_SRC_FILES := $(notdir $(wildcard $(LOCAL_PATH)/*.c))
|
||||
|
||||
LOCAL_SHARED_LIBRARIES := sdl tremor
|
||||
LOCAL_SHARED_LIBRARIES := sdl
|
||||
LOCAL_STATIC_LIBRARIES := tremor
|
||||
|
||||
ifneq ($(SDL_MIXER_USE_LIBMAD),)
|
||||
LOCAL_CFLAGS := -DMP3_MAD_MUSIC
|
||||
LOCAL_CFLAGS += -DMP3_MAD_MUSIC
|
||||
LOCAL_SHARED_LIBRARIES += mad
|
||||
endif
|
||||
|
||||
|
||||
@@ -10,5 +10,5 @@ LOCAL_CPP_EXTENSION := .cpp
|
||||
|
||||
LOCAL_SRC_FILES := $(notdir $(wildcard $(LOCAL_PATH)/*.c))
|
||||
|
||||
include $(BUILD_SHARED_LIBRARY)
|
||||
include $(BUILD_STATIC_LIBRARY)
|
||||
|
||||
|
||||
@@ -1,22 +1,19 @@
|
||||
// This string is autogenerated by ChangeAppSettings.sh, do not change spaces amount
|
||||
// This string is autogenerated by ChangeAppSettings.sh, do not change spaces amount anywhere
|
||||
package de.schwardtnet.alienblaster;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
|
||||
class Globals {
|
||||
// This string is autogenerated by ChangeAppSettings.sh, do not change spaces amount
|
||||
public static String ApplicationName = "AlienBlaster";
|
||||
|
||||
// Should be zip file
|
||||
// This string is autogenerated by ChangeAppSettings.sh, do not change spaces amount
|
||||
public static String DataDownloadUrl = "http://sites.google.com/site/xpelyax/Home/alienblaster110_data.zip?attredirects=0%26d=1"; // This string is autogenerated by ChangeAppSettings.sh, do not change spaces amount
|
||||
|
||||
// Set DownloadToSdcard to true if your app data is bigger than 5 megabytes.
|
||||
// It will download app data to /sdcard/alienblaster then,
|
||||
// otherwise it will download it to /data/data/de.schwardtnet.alienblaster/files -
|
||||
// set this dir in jni/Android.mk in SDL_CURDIR_PATH
|
||||
// This string is autogenerated by ChangeAppSettings.sh, do not change spaces amount
|
||||
public static boolean DownloadToSdcard = false;
|
||||
|
||||
// Set this value to true if you're planning to render 3D using OpenGL - it eats some GFX resources, so disabled for 2D
|
||||
@@ -27,12 +24,5 @@ class Globals {
|
||||
}
|
||||
|
||||
class LoadLibrary {
|
||||
public LoadLibrary()
|
||||
{
|
||||
System.loadLibrary("tremor");
|
||||
System.loadLibrary("sdl");
|
||||
System.loadLibrary("sdl_mixer");
|
||||
System.loadLibrary("sdl_image");
|
||||
System.loadLibrary("sdl_ttf");
|
||||
}
|
||||
public LoadLibrary() { System.loadLibrary("sdl"); System.loadLibrary("mad"); System.loadLibrary("sdl_mixer"); System.loadLibrary("sdl_image"); System.loadLibrary("sdl_ttf"); };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user