diff options
author | Andoni Morales Alastruey <ylatuya@gmail.com> | 2012-10-04 11:16:41 +0200 |
---|---|---|
committer | Andoni Morales Alastruey <ylatuya@gmail.com> | 2012-10-04 11:18:03 +0200 |
commit | b8ffd3d71a743d002a0817a450daa44c82f70d75 (patch) | |
tree | c8e92b63cc8821ffacdfdfb19afa3345370ad031 /config | |
parent | cbe9cbf0227f7cfca713c9956859962412e46655 (diff) | |
parent | 63efb45d7d8d687b0b06c3913403799942312f39 (diff) |
Merge branch 'android'
Conflicts:
cerbero/build/filesprovider.py
cerbero/config.py
packages/base-system/base-system.package
packages/gobject-python.package
packages/gstreamer-capture.package
packages/gstreamer-clutter.package
packages/gstreamer-codecs-gpl.package
packages/gstreamer-codecs-restricted.package
packages/gstreamer-codecs.package
packages/gstreamer-core.package
packages/gstreamer-dvd.package
packages/gstreamer-editing.package
packages/gstreamer-effects.package
packages/gstreamer-ffmpeg.package
packages/gstreamer-networking-restricted.package
packages/gstreamer-networking.package
packages/gstreamer-playback.package
packages/gstreamer-python.package
packages/gstreamer-sdk/gstreamer-sdk.package
packages/gstreamer-system.package
packages/gstreamer-tests.package
packages/gstreamer-tutorials.package
packages/gstreamer-visualizers.package
packages/gstreamer-xcode-integration.package
packages/gtk-python.package
packages/gtk.package
packages/snappy.package
packages/vsintegration.package
recipes/glib.recipe
recipes/libvpx.recipe
Diffstat (limited to 'config')
-rw-r--r-- | config/android.config | 69 | ||||
-rw-r--r-- | config/cross-android.cbc | 11 |
2 files changed, 80 insertions, 0 deletions
diff --git a/config/android.config b/config/android.config new file mode 100644 index 0000000..bb45d18 --- /dev/null +++ b/config/android.config @@ -0,0 +1,69 @@ +# This file contains the default configuration to compile for linux +# platforms. It contains sensitive enviroment configurations that +# shouldn't be modified unless you now what's you are doing. +# PLEASE, DO NOT EDIT THIS FILE + +import os +from cerbero.config import Architecture, DistroVersion + +if target_arch == Architecture.ARM: + prefix=prefix or os.path.expanduser('~/cerbero/dist/android_arm') + sources=sources or os.path.expanduser('~/cerbero/sources/android_arm') + cache_file= cache_file or 'android_arm' + tools_prefix = 'arm-linux-androideabi' +else: + raise FatalError("Arch not supported") + +if not toolchain_prefix: + toolchain_prefix = os.path.expanduser('~/cerbero/android-ndk-r8b') + +if target_distro_version == DistroVersion.ANDROID_GINGERBREAD: + sysroot = "%s/platforms/android-9/arch-arm" % (toolchain_prefix) +elif target_distro_version == DistroVersion.ANDROID_ICE_CREAM_SANDWICH: + sysroot = "%s/platforms/android-14/arch-arm" % (toolchain_prefix) +elif target_distro_version == DistroVersion.ANDROID_JELLY_BEAN: + sysroot = "%s/platforms/android-14/arch-arm" % (toolchain_prefix) +else: + raise FatalError("DistroVersion not supported") + +# Default compiler flags +os.environ['CFLAGS'] = '-g -Os ' +os.environ['CXXFLAGS'] = '-g -Os ' +os.environ['OBJCFLAGS'] = '-g -Os ' + +ccache = use_ccache and 'ccache ' or '' + +# Toolchain environment +os.environ['CPPFLAGS'] = "--sysroot=%s -D__ARM_ARCH_5__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5E__ -D__ARM_ARCH_5TE__ -DANDROID -DPIC -I%s/usr/include" % (sysroot, sysroot) +os.environ['CFLAGS'] += "--sysroot=%s -fPIC -DPIC -ffunction-sections -funwind-tables -fstack-protector -D__ARM_ARCH_5__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5E__ -D__ARM_ARCH_5TE__ -march=armv5te -mtune=xscale -msoft-float -mthumb -fomit-frame-pointer -fno-strict-aliasing -finline-limit=64 -DANDROID -Wa,--noexecstack -I%s/usr/include" % (sysroot, sysroot) +os.environ['LDFLAGS'] = "--sysroot=%s -fPIC -Wl,-no-undefined -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -Wl,--gc-sections -Wl,-z,nocopyreloc -Wl,-dynamic-linker,/system/bin/linker -L%s/usr/lib %s" % (sysroot, sysroot, os.environ.get('LDFLAGS', '')) +os.environ['CXXFLAGS']=os.environ['CFLAGS'] + +def cmd(command): + return '%s-%s' % (tools_prefix, command) + +os.environ['CC']= '%s%s' % (ccache, cmd('gcc')) +os.environ['CC'] += ' -fuse-ld=gold' +os.environ['CXX']= '%s%s' % (ccache, cmd('g++')) +os.environ['CXX'] += ' -fuse-ld=gold' +os.environ['LD']= cmd('ld.gold') +os.environ['CPP']= cmd('cpp') +os.environ['RANLIB']= cmd('ranlib') +os.environ['AR']= cmd('ar') +os.environ['AS']= cmd('as') +os.environ['NM']= cmd('nm') +os.environ['STRIP']= cmd('strip') + +os.environ['PATH'] = '%s:%s/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86/bin:%s' % (toolchain_prefix, toolchain_prefix, os.environ['PATH']) + + +# For GLib +os.environ['glib_cv_stack_grows'] = 'yes' +os.environ['glib_cv_uscore'] = 'no' +os.environ['ac_cv_func_posix_getpwuid_r'] = 'no' +os.environ['ac_cv_func_nonposix_getpwuid_r'] = 'no' +os.environ['ac_cv_func_posix_getgrgid_r'] = 'no' +os.environ['ac_cv_func_nonposix_getgrgid_r'] = 'no' + +# For pixman +os.environ['ac_cv_tls'] = 'none' diff --git a/config/cross-android.cbc b/config/cross-android.cbc new file mode 100644 index 0000000..4cefdae --- /dev/null +++ b/config/cross-android.cbc @@ -0,0 +1,11 @@ +import os +from cerbero.config import Platform, Architecture, Distro, DistroVersion + +target_platform = Platform.ANDROID +target_distro = Distro.ANDROID +target_distro_version = DistroVersion.ANDROID_GINGERBREAD +target_arch = Architecture.ARM + +host = "arm-linux-androideabi" +toolchain_prefix = os.path.expanduser("~/android-ndk-r8b") +#variants = ['nodebug'] |