[DEV] update the android compilation

This commit is contained in:
Edouard DUPIN 2013-11-20 21:26:31 +01:00
parent 99c6c86d9e
commit 01f7593077
3 changed files with 69 additions and 16 deletions

View File

@ -267,8 +267,21 @@ class module:
"-o", file_dst,
target.global_sysroot,
"-shared",
#"-lstdc++",
#
#"-L/home/edupin/dev/perso/android/ndk/sources/cxx-stl/gnu-libstdc++/4.8/libs/armeabi/thumb/",
#"-lgnustl_static",
#
#"-static-libstdc++",
#"-static-libgcc",
#"-L/home/edupin/dev/perso/android/ndk/platforms/android-14/arch-arm/usr/lib/",
#"/home/edupin/dev/perso/android/ndk/platforms/android-18/arch-mips/usr/lib/libstdc++.a",
#"-lgnustl_static*",
#"-lgnustl_shared",
file_src,
depancy.src,
#"/home/edupin/dev/perso/android/ndk/sources/cxx-stl/gnu-libstdc++/4.8/libs/armeabi/libgnustl_static.a",
#"/home/edupin/dev/perso/android/ndk/sources/cxx-stl/gnu-libstdc++/4.8/libs/armeabi/libsupc++.a",
self.flags_ld,
depancy.flags_ld,
target.global_flags_ld])

View File

@ -11,26 +11,33 @@ class Target:
self.name=name
self.endGeneratePackage = generatePackage
debug.info("=================================");
debug.info("== Target='"+self.name +"'");
debug.info("== Target='" + self.name + "'");
debug.info("=================================");
self.ar=self.cross + "ar"
self.ranlib=self.cross + "ranlib"
if typeCompilator == "clang":
self.cc=self.cross + "clang"
self.xx=self.cross + "clang++"
#self.ar=self.cross + "llvm-ar"
#self.ranlib="ls"
else:
self.cc=self.cross + "gcc"
self.xx=self.cross + "g++"
self.ar=self.cross + "ar"
#self.ar=self.cross + "ar"
#self.ranlib=self.cross + "ranlib"
self.ld=self.cross + "ld"
self.nm=self.cross + "nm"
self.strip=self.cross + "strip"
self.ranlib=self.cross + "ranlib"
self.dlltool=self.cross + "dlltool"
###############################################################################
# Target global variables.
###############################################################################
self.global_include_cc=[]
self.global_flags_cc=['-D__TARGET_OS__'+self.name]
self.global_flags_xx=['-std=c++11']
if self.name != "Windows":
self.global_flags_xx=['-std=c++11']
else:
self.global_flags_xx=['-std=c++0X']
self.global_flags_mm=[]
self.global_flags_m=[]
self.global_flags_ar=['rcs']

View File

@ -64,24 +64,56 @@ class Target(lutinTarget.Target):
# board id at 14 is for android 4.0 and more ...
self.boardId = 14
self.global_include_cc.append("-I" + self.folder_ndk +"/platforms/android-" + str(self.boardId) + "/arch-arm/usr/include/")
#self.global_include_cc.append("-I" + self.folder_ndk +"/platforms/android-" + str(self.boardId) + "/arch-mips/usr/include/")
#self.global_include_cc.append("-I" + self.folder_ndk +"/platforms/android-" + str(self.boardId) + "/arch-x86/usr/include/")
self.global_include_cc.append("-I" + self.folder_ndk +"/sources/cxx-stl/system/include/")
if arch == "ARMv5" or arch == "ARMv7":
self.global_include_cc.append("-I" + self.folder_ndk +"/platforms/android-" + str(self.boardId) + "/arch-arm/usr/include/")
elif arch == "mips":
self.global_include_cc.append("-I" + self.folder_ndk +"/platforms/android-" + str(self.boardId) + "/arch-mips/usr/include/")
elif arch == "x86":
self.global_include_cc.append("-I" + self.folder_ndk +"/platforms/android-" + str(self.boardId) + "/arch-x86/usr/include/")
if True:
if typeCompilator == "clang":
self.global_include_cc.append("-I" + self.folder_ndk +"/sources/cxx-stl/llvm-libc++/libcxx/include/")
if arch == "ARMv5":
stdCppBasePath = self.folder_ndk +"/sources/cxx-stl/llvm-libc++/libcxx/libs/armeabi/"
self.global_include_cc.append("-I" + stdCppBasePath + "include/")
self.global_flags_ld.append( stdCppBasePath + "libc++_static.a")
elif arch == "ARMv7":
stdCppBasePath = self.folder_ndk +"/sources/cxx-stl/llvm-libc++/libcxx/libs/armeabi-v7a/"
self.global_include_cc.append("-I" + stdCppBasePath + "include/")
self.global_flags_ld.append( stdCppBasePath + "libc++_static.a")
elif arch == "mips":
stdCppBasePath = self.folder_ndk +"/sources/cxx-stl/llvm-libc++/libcxx/libs/mips/"
self.global_include_cc.append("-I" + stdCppBasePath + "include/")
self.global_flags_ld.append( stdCppBasePath + "libc++_static.a")
elif arch == "x86":
stdCppBasePath = self.folder_ndk +"/sources/cxx-stl/llvm-libc++/libcxx/libs/x86/"
self.global_include_cc.append("-I" + stdCppBasePath + "include/")
self.global_flags_ld.append( stdCppBasePath + "libc++_static.a")
else:
self.global_include_cc.append("-I" + self.folder_ndk +"/sources/cxx-stl/gnu-libstdc++/" + gccVersion + "/include/")
#self.global_include_cc.append("-I" + self.folder_ndk +"/sources/cxx-stl/gnu-libstdc++/" + gccVersion + "/libs/x86/include/")
self.global_include_cc.append("-I" + self.folder_ndk +"/sources/cxx-stl/gnu-libstdc++/" + gccVersion + "/libs/armeabi/include/")
#self.global_include_cc.append("-I" + self.folder_ndk +"/sources/cxx-stl/gnu-libstdc++/" + gccVersion + "/libs/armeabi-v7a/include/")
#self.global_include_cc.append("-I" + self.folder_ndk +"/sources/cxx-stl/gnu-libstdc++/" + gccVersion + "/libs/mips/include/")
self.global_flags_ld.append(self.folder_ndk +"/platforms/android-" + str(self.boardId) + "/arch-arm/usr/lib/libstdc++.a")
self.global_flags_ld.append(self.folder_ndk +"/platforms/android-" + str(self.boardId) + "/arch-arm/usr/lib/libstdc++.a")
self.global_flags_ld.append(self.folder_ndk +"/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86_64/arm-linux-androideabi/lib/libatomic.a")
self.global_flags_ld.append(self.folder_ndk +"/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86_64/arm-linux-androideabi/lib/libgomp.a")
if arch == "ARMv5":
stdCppBasePath = self.folder_ndk +"/sources/cxx-stl/gnu-libstdc++/" + gccVersion + "/libs/armeabi/"
self.global_include_cc.append("-I" + stdCppBasePath + "include/")
self.global_flags_ld.append( stdCppBasePath + "thumb/libgnustl_static.a")
self.global_flags_ld.append( stdCppBasePath + "thumb/libsupc++.a")
elif arch == "ARMv7":
stdCppBasePath = self.folder_ndk +"/sources/cxx-stl/gnu-libstdc++/" + gccVersion + "/libs/armeabi-v7a/"
self.global_include_cc.append("-I" + stdCppBasePath + "include/")
self.global_flags_ld.append( stdCppBasePath + "thumb/libgnustl_static.a")
self.global_flags_ld.append( stdCppBasePath + "thumb/libsupc++.a")
elif arch == "mips":
stdCppBasePath = self.folder_ndk +"/sources/cxx-stl/gnu-libstdc++/" + gccVersion + "/libs/mips/"
self.global_include_cc.append("-I" + stdCppBasePath + "include/")
self.global_flags_ld.append( stdCppBasePath + "libgnustl_static.a")
self.global_flags_ld.append( stdCppBasePath + "libsupc++.a")
elif arch == "x86":
stdCppBasePath = self.folder_ndk +"/sources/cxx-stl/gnu-libstdc++/" + gccVersion + "/libs/x86/"
self.global_include_cc.append("-I" + stdCppBasePath + "include/")
self.global_flags_ld.append( stdCppBasePath + "libgnustl_static.a")
self.global_flags_ld.append( stdCppBasePath + "libsupc++.a")
else :
self.global_include_cc.append("-I" + self.folder_ndk +"/sources/cxx-stl/system/include/")
self.global_include_cc.append("-I" + self.folder_ndk +"/sources/cxx-stl/stlport/stlport/")
self.global_flags_ld.append(self.folder_ndk +"/platforms/android-" + str(self.boardId) + "/arch-arm/usr/lib/libstdc++.a")
@ -120,6 +152,7 @@ class Target(lutinTarget.Target):
self.global_flags_cc.append("-Wno-psabi")
self.global_flags_cc.append("-mtune=xscale")
self.global_flags_cc.append("-fexceptions")
##self.global_flags_cc.append("-fno-exceptions")
self.global_flags_cc.append("-fomit-frame-pointer")
self.global_flags_cc.append("-fno-strict-aliasing")