Merge pull request #2474 from masoudbh3/android-armeabi-v7a

Fix android build script
This commit is contained in:
Juan Linietsky 2015-10-17 10:20:47 -03:00
commit 13d2710fed
4 changed files with 58 additions and 114 deletions

View File

@ -29,7 +29,7 @@ extern "C" {
#define WEBP_USE_SSE2
#endif
#if defined(__ANDROID__) && defined(__ARM_ARCH_7A__)
#if defined(__ANDROID__) && defined(__ARM_ARCH_7A__) && defined(__ARM_NEON__)
#define WEBP_ANDROID_NEON // Android targets that might support NEON
#endif

View File

@ -20,15 +20,14 @@ def can_build():
def get_opts():
return [
('ANDROID_NDK_ROOT', 'the path to Android NDK', os.environ.get("ANDROID_NDK_ROOT", 0)),
('NDK_TOOLCHAIN', 'toolchain to use for the NDK',"arm-eabi-4.4.0"),
#android 2.3
('ndk_platform', 'compile for platform: (2.2,2.3)',"2.2"),
('NDK_TARGET', 'toolchain to use for the NDK',"arm-linux-androideabi-4.8"),
('android_stl','enable STL support in android port (for modules)','no'),
('armv6','compile for older phones running arm v6 (instead of v7+neon+smp)','no'),
('x86','Xompile for Android-x86','no')
('ANDROID_NDK_ROOT', 'the path to Android NDK', os.environ.get("ANDROID_NDK_ROOT", 0)),
('NDK_TOOLCHAIN', 'toolchain to use for the NDK',"arm-eabi-4.4.0"),
('NDK_TARGET', 'toolchain to use for the NDK',"arm-linux-androideabi-4.8"),
('NDK_TARGET_X86', 'toolchain to use for the NDK x86',"x86-4.8"),
('ndk_platform', 'compile for platform: (android-<api> , example: android-15)',"android-15"),
('android_arch', 'select compiler architecture: (armv7/armv6/x86)',"armv7"),
('android_neon','enable neon (armv7 only)',"yes"),
('android_stl','enable STL support in android port (for modules)',"no")
]
def get_flags():
@ -92,8 +91,13 @@ def configure(env):
env['SPAWN'] = mySpawn
if env['x86']=='yes':
env['NDK_TARGET']='x86-4.8'
ndk_platform=env['ndk_platform']
if env['android_arch'] not in ['armv7','armv6','x86']:
env['android_arch']='armv7'
if env['android_arch']=='x86':
env['NDK_TARGET']=env['NDK_TARGET_X86']
if env['PLATFORM'] == 'win32':
import methods
@ -101,22 +105,28 @@ def configure(env):
#env['SPAWN'] = methods.win32_spawn
env['SHLIBSUFFIX'] = '.so'
# env.android_source_modules.append("../libs/apk_expansion")
#env.android_source_modules.append("../libs/apk_expansion")
env.android_source_modules.append("../libs/google_play_services")
env.android_source_modules.append("../libs/downloader_library")
env.android_source_modules.append("../libs/play_licensing")
ndk_platform=""
ndk_platform="android-15"
print("Godot Android!!!!!")
neon_text=""
if env["android_arch"]=="armv7" and env['android_neon']=='yes':
neon_text=" (with neon)"
print("Godot Android!!!!! ("+env['android_arch']+")"+neon_text)
env.Append(CPPPATH=['#platform/android'])
if env['x86']=='yes':
env.extra_suffix=".x86"
if env['android_arch']=='x86':
env.extra_suffix=".x86"+env.extra_suffix
elif env['android_arch']=='armv6':
env.extra_suffix=".armv6"+env.extra_suffix
elif env["android_arch"]=="armv7":
if env['android_neon']=='yes':
env.extra_suffix=".armv7.neon"+env.extra_suffix
else:
env.extra_suffix=".armv7"+env.extra_suffix
gcc_path=env["ANDROID_NDK_ROOT"]+"/toolchains/"+env["NDK_TARGET"]+"/prebuilt/";
import os
@ -134,7 +144,7 @@ def configure(env):
env['ENV']['PATH'] = gcc_path+":"+env['ENV']['PATH']
if env['x86']=='yes':
if env['android_arch']=='x86':
env['CC'] = gcc_path+'/i686-linux-android-gcc'
env['CXX'] = gcc_path+'/i686-linux-android-g++'
env['AR'] = gcc_path+"/i686-linux-android-ar"
@ -147,7 +157,7 @@ def configure(env):
env['RANLIB'] = gcc_path+"/arm-linux-androideabi-ranlib"
env['AS'] = gcc_path+"/arm-linux-androideabi-as"
if env['x86']=='yes':
if env['android_arch']=='x86':
env['ARCH'] = 'arch-x86'
else:
env['ARCH'] = 'arch-arm'
@ -161,12 +171,18 @@ def configure(env):
env.Append(CPPPATH=[gcc_include])
# env['CCFLAGS'] = string.split('-DNO_THREADS -MMD -MP -MF -fpic -ffunction-sections -funwind-tables -fstack-protector -D__ARM_ARCH_5__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5E__ -D__ARM_ARCH_5TE__ -Wno-psabi -march=armv5te -mtune=xscale -msoft-float -fno-exceptions -mthumb -fno-strict-aliasing -DANDROID -Wa,--noexecstack -DGLES2_ENABLED ')
if env['x86']=='yes':
env['neon_enabled']=False
if env['android_arch']=='x86':
env['CCFLAGS'] = string.split('-DNO_STATVFS -MMD -MP -MF -fpic -ffunction-sections -funwind-tables -fstack-protector -fvisibility=hidden -D__GLIBC__ -Wno-psabi -ftree-vectorize -funsafe-math-optimizations -fno-strict-aliasing -DANDROID -Wa,--noexecstack -DGLES2_ENABLED')
elif env["armv6"]!="no":
elif env["android_arch"]=="armv6":
env['CCFLAGS'] = string.split('-DNO_STATVFS -MMD -MP -MF -fpic -ffunction-sections -funwind-tables -fstack-protector -fvisibility=hidden -D__ARM_ARCH_6__ -D__GLIBC__ -Wno-psabi -march=armv6 -mfpu=vfp -mfloat-abi=softfp -funsafe-math-optimizations -fno-strict-aliasing -DANDROID -Wa,--noexecstack -DGLES2_ENABLED')
else:
env['CCFLAGS'] = string.split('-DNO_STATVFS -MMD -MP -MF -fpic -ffunction-sections -funwind-tables -fstack-protector -fvisibility=hidden -D__ARM_ARCH_7__ -D__GLIBC__ -Wno-psabi -march=armv6 -mfpu=neon -mfloat-abi=softfp -ftree-vectorize -funsafe-math-optimizations -fno-strict-aliasing -DANDROID -Wa,--noexecstack -DGLES2_ENABLED')
elif env["android_arch"]=="armv7":
env['CCFLAGS'] = string.split('-DNO_STATVFS -MMD -MP -MF -fpic -ffunction-sections -funwind-tables -fstack-protector -fvisibility=hidden -D__ARM_ARCH_7__ -D__ARM_ARCH_7A__ -D__GLIBC__ -Wno-psabi -march=armv7-a -mfloat-abi=softfp -ftree-vectorize -funsafe-math-optimizations -fno-strict-aliasing -DANDROID -Wa,--noexecstack -DGLES2_ENABLED')
if env['android_neon']=='yes':
env['neon_enabled']=True
env.Append(CCFLAGS=['-mfpu=neon','-D__ARM_NEON__'])
else:
env.Append(CCFLAGS=['-mfpu=vfpv3-d16'])
env.Append(LDPATH=[ld_path])
env.Append(LIBS=['OpenSLES'])
@ -190,9 +206,6 @@ def configure(env):
env.Append(CCFLAGS=['-D_DEBUG', '-g1', '-Wall', '-O0', '-DDEBUG_ENABLED'])
env.Append(CPPFLAGS=['-DDEBUG_MEMORY_ALLOC'])
if env["armv6"] == "no" and env['x86'] != 'yes':
env['neon_enabled']=True
env.Append(CPPFLAGS=['-DANDROID_ENABLED', '-DUNIX_ENABLED', '-DNO_FCNTL','-DMPC_FIXED_POINT'])
# env.Append(CPPFLAGS=['-DANDROID_ENABLED', '-DUNIX_ENABLED','-DMPC_FIXED_POINT'])
@ -202,9 +215,17 @@ def configure(env):
if (env['android_stl']=='yes'):
#env.Append(CCFLAGS=[env["ANDROID_NDK_ROOT"]+"/sources/cxx-stl/system/include"])
env.Append(CPPPATH=[env["ANDROID_NDK_ROOT"]+"/sources/cxx-stl/gnu-libstdc++/4.4.3/include"])
env.Append(CPPPATH=[env["ANDROID_NDK_ROOT"]+"/sources/cxx-stl/gnu-libstdc++/4.4.3/libs/armeabi/include"])
env.Append(LIBPATH=[env["ANDROID_NDK_ROOT"]+"/sources/cxx-stl/gnu-libstdc++/4.4.3/libs/armeabi"])
env.Append(CPPPATH=[env["ANDROID_NDK_ROOT"]+"/sources/cxx-stl/gnu-libstdc++/4.8/include"])
if env['android_arch']=='x86':
env.Append(CPPPATH=[env["ANDROID_NDK_ROOT"]+"/sources/cxx-stl/gnu-libstdc++/4.8/libs/x86/include"])
env.Append(LIBPATH=[env["ANDROID_NDK_ROOT"]+"/sources/cxx-stl/gnu-libstdc++/4.8/libs/x86"])
elif env['android_arch']=='armv6':
env.Append(CPPPATH=[env["ANDROID_NDK_ROOT"]+"/sources/cxx-stl/gnu-libstdc++/4.8/libs/armeabi/include"])
env.Append(LIBPATH=[env["ANDROID_NDK_ROOT"]+"/sources/cxx-stl/gnu-libstdc++/4.8/libs/armeabi"])
elif env["android_arch"]=="armv7":
env.Append(CPPPATH=[env["ANDROID_NDK_ROOT"]+"/sources/cxx-stl/gnu-libstdc++/4.8/libs/armeabi-v7a/include"])
env.Append(LIBPATH=[env["ANDROID_NDK_ROOT"]+"/sources/cxx-stl/gnu-libstdc++/4.8/libs/armeabi-v7a"])
env.Append(LIBS=["gnustl_static","supc++"])
env.Append(CPPPATH=[env["ANDROID_NDK_ROOT"]+"/sources/cpufeatures"])
@ -215,10 +236,12 @@ def configure(env):
env.Append(CPPPATH=[env["ANDROID_NDK_ROOT"]+"/sources/cxx-stl/gabi++/include"])
env.Append(CPPPATH=[env["ANDROID_NDK_ROOT"]+"/sources/cpufeatures"])
if env['x86']=='yes':
if env['android_arch']=='x86':
env.Append(LIBPATH=[env["ANDROID_NDK_ROOT"]+"/sources/cxx-stl/gabi++/libs/x86"])
else:
elif env["android_arch"]=="armv6":
env.Append(LIBPATH=[env["ANDROID_NDK_ROOT"]+"/sources/cxx-stl/gabi++/libs/armeabi"])
elif env["android_arch"]=="armv7":
env.Append(LIBPATH=[env["ANDROID_NDK_ROOT"]+"/sources/cxx-stl/gabi++/libs/armeabi-v7a"])
env.Append(LIBS=['gabi++_static'])
env.Append(CCFLAGS=["-fno-exceptions",'-DNO_SAFE_CAST'])

View File

@ -1,6 +0,0 @@
/** Automatically generated file. DO NOT MODIFY */
package com.android.vending.expansion.downloader;
public final class BuildConfig {
public final static boolean DEBUG = false;
}

View File

@ -1,73 +0,0 @@
/* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* aapt tool from the resource data it found. It
* should not be modified by hand.
*/
package com.android.vending.expansion.downloader;
public final class R {
public static final class attr {
}
public static final class drawable {
public static int notify_panel_notification_icon_bg=0x7f020000;
}
public static final class id {
public static int appIcon=0x7f060001;
public static int description=0x7f060007;
public static int notificationLayout=0x7f060000;
public static int progress_bar=0x7f060006;
public static int progress_bar_frame=0x7f060005;
public static int progress_text=0x7f060002;
public static int time_remaining=0x7f060004;
public static int title=0x7f060003;
}
public static final class layout {
public static int status_bar_ongoing_event_progress_bar=0x7f030000;
}
public static final class string {
public static int kilobytes_per_second=0x7f040014;
/** When a download completes, a notification is displayed, and this
string is used to indicate that the download successfully completed.
Note that such a download could have been initiated by a variety of
applications, including (but not limited to) the browser, an email
application, a content marketplace.
*/
public static int notification_download_complete=0x7f040000;
/** When a download completes, a notification is displayed, and this
string is used to indicate that the download failed.
Note that such a download could have been initiated by a variety of
applications, including (but not limited to) the browser, an email
application, a content marketplace.
*/
public static int notification_download_failed=0x7f040001;
public static int state_completed=0x7f040007;
public static int state_connecting=0x7f040005;
public static int state_downloading=0x7f040006;
public static int state_failed=0x7f040013;
public static int state_failed_cancelled=0x7f040012;
public static int state_failed_fetching_url=0x7f040010;
public static int state_failed_sdcard_full=0x7f040011;
public static int state_failed_unlicensed=0x7f04000f;
public static int state_fetching_url=0x7f040004;
public static int state_idle=0x7f040003;
public static int state_paused_by_request=0x7f04000a;
public static int state_paused_network_setup_failure=0x7f040009;
public static int state_paused_network_unavailable=0x7f040008;
public static int state_paused_roaming=0x7f04000d;
public static int state_paused_sdcard_unavailable=0x7f04000e;
public static int state_paused_wifi_disabled=0x7f04000c;
public static int state_paused_wifi_unavailable=0x7f04000b;
public static int state_unknown=0x7f040002;
public static int time_remaining=0x7f040015;
public static int time_remaining_notification=0x7f040016;
}
public static final class style {
public static int ButtonBackground=0x7f050003;
public static int NotificationText=0x7f050000;
public static int NotificationTextSecondary=0x7f050004;
public static int NotificationTextShadow=0x7f050001;
public static int NotificationTitle=0x7f050002;
}
}