Added CrystaX toolchain support
This commit is contained in:
@@ -358,17 +358,19 @@ mv -f project/res/values/strings.xml.1 project/res/values/strings.xml
|
||||
|
||||
echo Forcing rebuild of specific files
|
||||
rm -rf project/libs/*
|
||||
rm -rf project/bin/ndk/local/*/objs/sdl_main/* project/bin/ndk/local/*/libsdl_main.so
|
||||
rm -rf project/bin/ndk/local/*/libsdl.so
|
||||
rm -rf project/bin/ndk/local/*/objs/sdl/src/*/android
|
||||
rm -rf project/bin/ndk/local/*/objs/sdl/src/video/SDL_video.o
|
||||
rm -rf project/bin/ndk/local/*/objs/sdl/SDL_renderer_gles.o
|
||||
for OUT in bin/ndk obj; do
|
||||
rm -rf project/$OUT/local/*/objs/sdl_main/* project/$OUT/local/*/libsdl_main.so
|
||||
rm -rf project/$OUT/local/*/libsdl.so
|
||||
rm -rf project/$OUT/local/*/objs/sdl/src/*/android
|
||||
rm -rf project/$OUT/local/*/objs/sdl/src/video/SDL_video.o
|
||||
rm -rf project/$OUT/local/*/objs/sdl/SDL_renderer_gles.o
|
||||
if [ "$LibSdlVersionOld" '!=' "$LibSdlVersion" ]; then
|
||||
# Internal types are different in SDL 1.2 and 1.3, namely SDL_Rect, so all libs using it have to be recompiled
|
||||
rm -rf project/bin/ndk/local/*/objs/sdl* project/bin/ndk/local/*/libsdl*
|
||||
rm -rf project/bin/ndk/local/*/objs/application project/bin/ndk/local/*/libapplication.so
|
||||
rm -rf project/$OUT/local/*/objs/sdl* project/$OUT/local/*/libsdl*
|
||||
rm -rf project/$OUT/local/*/objs/application project/$OUT/local/*/libapplication.so
|
||||
fi
|
||||
# Do not rebuild libraries that do not need that
|
||||
find project/bin/ndk/local -name "*.[oa]" -exec touch '{}' \;
|
||||
find project/$OUT/local -name "*.[oa]" -exec touch '{}' \;
|
||||
done
|
||||
|
||||
echo Done
|
||||
|
||||
2
build.sh
2
build.sh
@@ -3,5 +3,5 @@
|
||||
# Set here your own NDK path if needed
|
||||
# export PATH=$PATH:~/src/endless_space/android-ndk-r4
|
||||
|
||||
cd project && nice -n5 ndk-build -j2 V=1 && ant debug && cd bin && adb install -r DemoActivity-debug.apk
|
||||
cd project && nice -n5 ~/src/endless_space/android-ndk-r4-crystax/ndk-build -j2 V=1 && ant debug && cd bin && adb install -r DemoActivity-debug.apk
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ COMPILED_LIBRARIES :=
|
||||
|
||||
APPLICATION_ADDITIONAL_CFLAGS := -finline-functions -O2 -DTREMOR=1 -DBUILD_TYPE=LINUX32 -DTARGET_LNX=1
|
||||
|
||||
APPLICATION_ADDITIONAL_LDFLAGS := -Lbin/ndk/local/armeabi -ltremor
|
||||
APPLICATION_ADDITIONAL_LDFLAGS := -ltremor
|
||||
|
||||
APPLICATION_SUBDIRS_BUILD := src
|
||||
|
||||
@@ -39,4 +39,9 @@ ifneq ($(strip $(filter mad, $(COMPILED_LIBRARIES))),)
|
||||
SDL_MIXER_USE_LIBMAD := 1
|
||||
endif
|
||||
|
||||
ifneq ($(findstring -crystax,$(TARGET_CC)),)
|
||||
$(info Building with CrystaX toolchain - RTTI and exceptions enabled, STLPort disabled)
|
||||
CRYSTAX_TOOLCHAIN=1
|
||||
endif
|
||||
|
||||
include $(call all-subdir-makefiles)
|
||||
|
||||
@@ -9,7 +9,13 @@ ifneq ($(APP_SUBDIRS_BUILD),)
|
||||
APP_SUBDIRS := $(APP_SUBDIRS_BUILD)
|
||||
endif
|
||||
|
||||
LOCAL_CFLAGS := $(foreach D, $(APP_SUBDIRS), -I$(LOCAL_PATH)/$(D)) \
|
||||
LOCAL_CFLAGS :=
|
||||
|
||||
ifeq ($(CRYSTAX_TOOLCHAIN),)
|
||||
LOCAL_CFLAGS += -I$(LOCAL_PATH)/../stlport/stlport
|
||||
endif
|
||||
|
||||
LOCAL_CFLAGS += $(foreach D, $(APP_SUBDIRS), -I$(LOCAL_PATH)/$(D)) \
|
||||
-I$(LOCAL_PATH)/../sdl/include \
|
||||
-I$(LOCAL_PATH)/../sdl_mixer \
|
||||
-I$(LOCAL_PATH)/../sdl_image \
|
||||
@@ -17,14 +23,12 @@ LOCAL_CFLAGS := $(foreach D, $(APP_SUBDIRS), -I$(LOCAL_PATH)/$(D)) \
|
||||
-I$(LOCAL_PATH)/../sdl_net \
|
||||
-I$(LOCAL_PATH)/../sdl_blitpool \
|
||||
-I$(LOCAL_PATH)/../sdl_gfx \
|
||||
-I$(LOCAL_PATH)/../stlport/stlport \
|
||||
-I$(LOCAL_PATH)/../png \
|
||||
-I$(LOCAL_PATH)/../jpeg \
|
||||
-I$(LOCAL_PATH)/../intl \
|
||||
-I$(LOCAL_PATH)/../freetype/include \
|
||||
-I$(LOCAL_PATH)/..
|
||||
|
||||
|
||||
LOCAL_CFLAGS += $(APPLICATION_ADDITIONAL_CFLAGS)
|
||||
|
||||
#Change C++ file extension as appropriate
|
||||
@@ -40,6 +44,12 @@ LOCAL_STATIC_LIBRARIES := stlport
|
||||
|
||||
LOCAL_LDLIBS := -lGLESv1_CM -ldl -llog -lz
|
||||
|
||||
ifeq ($(CRYSTAX_TOOLCHAIN),)
|
||||
LOCAL_LDFLAGS := -Lbin/ndk/local/armeabi
|
||||
else
|
||||
LOCAL_LDFLAGS := -Lobj/local/armeabi
|
||||
endif
|
||||
|
||||
LOCAL_LDFLAGS += $(APPLICATION_ADDITIONAL_LDFLAGS)
|
||||
|
||||
LIBS_WITH_LONG_SYMBOLS := $(strip $(shell \
|
||||
|
||||
@@ -4,11 +4,13 @@ include $(CLEAR_VARS)
|
||||
|
||||
LOCAL_MODULE := stlport
|
||||
|
||||
LOCAL_CFLAGS := -I$(LOCAL_PATH)/stlport -I$(LOCAL_PATH)/src
|
||||
|
||||
ifneq ($(CRYSTAX_TOOLCHAIN),)
|
||||
LOCAL_CPP_EXTENSION := .cpp
|
||||
LOCAL_SRC_FILES := dummy.c
|
||||
else
|
||||
LOCAL_CFLAGS := -I$(LOCAL_PATH)/stlport -I$(LOCAL_PATH)/src
|
||||
LOCAL_CPP_EXTENSION := .cpp
|
||||
|
||||
LOCAL_SRC_FILES := $(addprefix src/,$(notdir $(wildcard $(LOCAL_PATH)/src/*.cpp $(LOCAL_PATH)/src/*.c))))
|
||||
endif
|
||||
|
||||
include $(BUILD_STATIC_LIBRARY)
|
||||
|
||||
|
||||
1
project/jni/stlport/dummy.c
Normal file
1
project/jni/stlport/dummy.c
Normal file
@@ -0,0 +1 @@
|
||||
|
||||
@@ -8,7 +8,7 @@ class Globals {
|
||||
public static String ApplicationName = "CommanderGenius";
|
||||
|
||||
// Should be zip file
|
||||
public static String DataDownloadUrl = "Data files size is 1 Mb|https://sourceforge.net/projects/libsdl-android/files/CommanderGenius/commandergenius-data.zip/download";
|
||||
public static String DataDownloadUrl = "Data files size is 2 Mb|https://sourceforge.net/projects/libsdl-android/files/CommanderGenius/commandergenius-data.zip/download";
|
||||
|
||||
// Set this value to true if you're planning to render 3D using OpenGL - it eats some GFX resources, so disabled for 2D
|
||||
public static boolean NeedDepthBuffer = false;
|
||||
|
||||
@@ -85,6 +85,12 @@ The C++ files shall have .cpp extension to be compiled, rename them if necessary
|
||||
Also you can replace icon image at project/res/drawable/icon.png.
|
||||
Then you can launch build.sh.
|
||||
|
||||
The NDK has RTTI and exceptions disabled for C++ code, if you need them you may download modified NDK from
|
||||
http://www.crystax.net/android/ndk-r4.php
|
||||
Unzip it, and put in your PATH instead of original NDK - do not rename the target dir, my makefiles will
|
||||
check if there's "crystax" string in path to gcc toolchain, and will disable STLPort because CrystaX's
|
||||
NDK already contains STL library.
|
||||
|
||||
Application data is not bundled with app itself - it should be downloaded from net on first run.
|
||||
Create .ZIP file with your application data, and put it somewhere on HTTP server - ChangeAppSettings.sh
|
||||
will ask you for the URL.
|
||||
@@ -184,6 +190,7 @@ UQM gives 5 FPS without such hacks, if I'll implement that FPS will drop to 1-2
|
||||
plus VideoView will contain some buffer to ensure the playback is smooth,
|
||||
so the data on your TV will lag halfsecond behind the data on the device screen.
|
||||
|
||||
7. Make app data to come inside .apk file in assets instead of downloading it from net.
|
||||
|
||||
Games to port
|
||||
=============
|
||||
|
||||
Reference in New Issue
Block a user