aboutsummaryrefslogtreecommitdiff
path: root/meta-linaro/conf
diff options
context:
space:
mode:
authorMarcin Juszkiewicz <marcin.juszkiewicz@linaro.org>2013-03-13 14:40:13 +0100
committerMarcin Juszkiewicz <marcin.juszkiewicz@linaro.org>2013-03-13 14:40:13 +0100
commita9d70669d6a9d2e80a01182c732336be0cd5513b (patch)
treed8bb8744c9e924493c9e8021358281f73b5bda84 /meta-linaro/conf
parent7517a3e34dee3586122685cb49a8d1984be1d16e (diff)
downloadmeta-linaro-a9d70669d6a9d2e80a01182c732336be0cd5513b.tar.gz
move everything to meta-linaro directory
Signed-off-by: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>
Diffstat (limited to 'meta-linaro/conf')
-rw-r--r--meta-linaro/conf/distro/include/external-linaro-toolchain-versions.inc108
-rw-r--r--meta-linaro/conf/distro/include/tcmode-external-linaro.inc68
-rw-r--r--meta-linaro/conf/layer.conf14
-rw-r--r--meta-linaro/conf/machine/genericarmv7a.conf33
-rw-r--r--meta-linaro/conf/machine/qemuarmv7a.conf10
5 files changed, 233 insertions, 0 deletions
diff --git a/meta-linaro/conf/distro/include/external-linaro-toolchain-versions.inc b/meta-linaro/conf/distro/include/external-linaro-toolchain-versions.inc
new file mode 100644
index 00000000..6b5a6fb7
--- /dev/null
+++ b/meta-linaro/conf/distro/include/external-linaro-toolchain-versions.inc
@@ -0,0 +1,108 @@
+def elt_run(d, cmd, *args):
+ import bb.process
+ import subprocess
+
+ topdir = d.getVar('TOPDIR', True)
+ toolchain_path = d.getVar('EXTERNAL_TOOLCHAIN', True)
+ if not toolchain_path:
+ return 'UNKNOWN', 'UNKNOWN'
+
+ target_prefix = d.getVar('TARGET_PREFIX', True)
+ path = os.path.join(toolchain_path, 'bin', target_prefix + cmd)
+ args = [path] + list(args)
+
+ return bb.process.run(args, cwd=topdir, stderr=subprocess.PIPE)
+
+def elt_get_version(d):
+ try:
+ stdout, stderr = elt_run(d, 'gcc', '-v')
+ except bb.process.CmdError as exc:
+ bb.error('Failed to obtain external Linaro toolchain version: %s' % exc)
+ return 'UNKNOWN'
+ else:
+ last_line = stderr.splitlines()[-1]
+ return last_line
+
+def elt_get_main_version(d):
+ version = elt_get_version(d)
+ if version != 'UNKNOWN':
+ return version.split()[-1].rstrip(')')
+ else:
+ return version
+
+def elt_get_gcc_version(d):
+ version = elt_get_version(d)
+ if version != 'UNKNOWN':
+ return version.split()[2]
+ else:
+ return version
+
+def elt_get_libc_version(d):
+ import os,bb
+ syspath = bb.data.expand('${EXTERNAL_TOOLCHAIN}/${ELT_TARGET_SYS}', d)
+ if not syspath:
+ return 'UNKNOWN'
+
+ libpath = syspath + '/libc/lib/${ELT_TARGET_SYS}/'
+
+ if os.path.exists(libpath):
+ for file in os.listdir(libpath):
+ if file.find('libc-') == 0:
+ return file[5:-3]
+
+ libpath = syspath + '/libc/lib/'
+
+ if os.path.exists(libpath):
+ for file in os.listdir(libpath):
+ if file.find('libc-') == 0:
+ return file[5:-3]
+ return 'UNKNOWN'
+
+def elt_get_kernel_version(d):
+ import os,bb
+ syspath = bb.data.expand('${EXTERNAL_TOOLCHAIN}/${ELT_TARGET_SYS}', d)
+ if not syspath:
+ return 'UNKNOWN'
+
+ vf = syspath + '/libc/usr/include/linux/version.h'
+
+ try:
+ f = open(vf, 'r')
+ except (OSError, IOError):
+ return 'UNKNOWN'
+
+ l = f.readlines();
+ f.close();
+ for s in l:
+ if s.find('LINUX_VERSION_CODE') > 0:
+ ver = int(s.split()[2])
+ maj = ver / 65536
+ ver = ver % 65536
+ min = ver / 256
+ ver = ver % 256
+ return str(maj)+'.'+str(min)+'.'+str(ver)
+ return 'UNKNOWN'
+
+def elt_get_gdb_version(d):
+ try:
+ stdout, stderr = elt_run(d, 'gdb', '-v')
+ except CmdError:
+ return 'UNKNOWN'
+ else:
+ first_line = stdout.splitlines()[0]
+ return first_line.split()[-1]
+
+python external_linaro_toolchain_version_handler () {
+ if not isinstance(e, bb.event.ConfigParsed):
+ return
+ d = e.data
+ ld = d.createCopy()
+ ld.finalize()
+
+ d.setVar('ELT_VER_MAIN', elt_get_main_version(ld))
+ d.setVar('ELT_VER_GCC', elt_get_gcc_version(ld))
+ d.setVar('ELT_VER_LIBC', elt_get_libc_version(ld))
+ d.setVar('ELT_VER_KERNEL', elt_get_kernel_version(ld))
+ d.setVar('ELT_VER_GDB', elt_get_gdb_version(ld))
+}
+addhandler external_linaro_toolchain_version_handler
diff --git a/meta-linaro/conf/distro/include/tcmode-external-linaro.inc b/meta-linaro/conf/distro/include/tcmode-external-linaro.inc
new file mode 100644
index 00000000..284fb8bc
--- /dev/null
+++ b/meta-linaro/conf/distro/include/tcmode-external-linaro.inc
@@ -0,0 +1,68 @@
+#
+# Configuration to use an external Linaro binary toolchain
+#
+
+EXTERNAL_TOOLCHAIN ?= "/usr/local/linaro-binary-toolchain/${TARGET_ARCH}"
+
+TOOLCHAIN_PATH_ADD = "${EXTERNAL_TOOLCHAIN}/bin:"
+PATH =. "${TOOLCHAIN_PATH_ADD}"
+
+ELT_TARGET_SYS ?= "arm-linux-gnueabihf"
+TARGET_PREFIX = "${ELT_TARGET_SYS}-"
+
+PREFERRED_PROVIDER_linux-libc-headers = "external-linaro-toolchain"
+PREFERRED_PROVIDER_linux-libc-headers-dev = "external-linaro-toolchain"
+PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}gcc = "external-linaro-toolchain"
+PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}gcc-initial = "external-linaro-toolchain"
+PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}g++ = "external-linaro-toolchain"
+PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}binutils = "external-linaro-toolchain"
+PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}libc-for-gcc = "external-linaro-toolchain"
+PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}compilerlibs = "external-linaro-toolchain"
+PREFERRED_PROVIDER_libgcc = "external-linaro-toolchain"
+PREFERRED_PROVIDER_virtual/libc = "external-linaro-toolchain"
+PREFERRED_PROVIDER_virtual/libintl = "external-linaro-toolchain"
+PREFERRED_PROVIDER_virtual/libiconv = "external-linaro-toolchain"
+PREFERRED_PROVIDER_glibc-thread-db = "external-linaro-toolchain"
+PREFERRED_PROVIDER_virtual/linux-libc-headers = "external-linaro-toolchain"
+
+TARGET_CPPFLAGS_prepend = " -isystem${EXTERNAL_TOOLCHAIN}/${ELT_TARGET_SYS}/include "
+TARGET_LDFLAGS_prepend = " -L${EXTERNAL_TOOLCHAIN}/${ELT_TARGET_SYS}/lib -Wl,-rpath-link,${EXTERNAL_TOOLCHAIN}/${ELT_TARGET_SYS}/lib "
+
+TOOLCHAIN_OPTIONS = " --sysroot=${STAGING_DIR_HOST}"
+
+DISTRO_FEATURES_LIBC = "ipv4 ipv6 libc-backtrace libc-big-macros libc-bsd libc-cxx-tests libc-catgets libc-crypt \
+ libc-crypt-ufc libc-db-aliases libc-envz libc-fcvt libc-fmtmsg libc-fstab libc-ftraverse \
+ libc-getlogin libc-idn libc-inet-anl libc-libm libc-libm-big \
+ libc-memusage libc-nis libc-nsswitch libc-rcmd libc-rtld-debug libc-spawn libc-streams libc-sunrpc \
+ libc-utmp libc-utmpx libc-wordexp libc-posix-clang-wchar libc-posix-regexp libc-posix-regexp-glibc \
+ libc-posix-wchar-io"
+
+ENABLE_BINARY_LOCALE_GENERATION = "0"
+GLIBC_INTERNAL_USE_BINARY_LOCALE = "precompiled"
+
+def populate_toolchain_links(d):
+ import errno
+ import os
+ from glob import glob
+
+ d = d.createCopy()
+ d.finalize()
+
+ pattern = bb.data.expand('${EXTERNAL_TOOLCHAIN}/bin/${TARGET_PREFIX}*', d)
+ files = glob(pattern)
+ if not files:
+ bb.fatal("Unable to populate toolchain binary symlinks")
+
+ bindir = d.getVar('STAGING_BINDIR_TOOLCHAIN', True)
+ bb.mkdirhier(bindir)
+ for f in files:
+ base = os.path.basename(f)
+ newpath = os.path.join(bindir, base)
+ try:
+ os.symlink(f, newpath)
+ except OSError as exc:
+ if exc.errno == errno.EEXIST:
+ break
+ bb.fatal("Unable to populate toolchain binary symlink for %s: %s" % (newpath, exc))
+
+require conf/distro/include/external-linaro-toolchain-versions.inc
diff --git a/meta-linaro/conf/layer.conf b/meta-linaro/conf/layer.conf
new file mode 100644
index 00000000..eccd96c6
--- /dev/null
+++ b/meta-linaro/conf/layer.conf
@@ -0,0 +1,14 @@
+BBPATH .= ":${LAYERDIR}"
+BBFILES += "\
+ ${LAYERDIR}/recipes-*/*/*.bb \
+ ${LAYERDIR}/recipes-*/*/*.bbappend \
+ "
+
+BBFILE_COLLECTIONS += "linaro"
+BBFILE_PATTERN_linaro := "^${LAYERDIR}/"
+BBFILE_PRIORITY_linaro = "5"
+
+# do not error out on bbappends for missing recipes (mysql5)
+BB_DANGLINGAPPENDS_WARNONLY = "true"
+
+LAYERDEPENDS_linaro = "toolchain-layer"
diff --git a/meta-linaro/conf/machine/genericarmv7a.conf b/meta-linaro/conf/machine/genericarmv7a.conf
new file mode 100644
index 00000000..d2577f69
--- /dev/null
+++ b/meta-linaro/conf/machine/genericarmv7a.conf
@@ -0,0 +1,33 @@
+#@TYPE: Machine
+#@NAME: generic armv7a machine
+#@DESCRIPTION: generic machine to be used by linaro-media-create
+
+DEFAULTTUNE ?= "armv7athf-neon"
+
+require conf/machine/include/arm/arch-armv7a.inc
+
+PREFERRED_PROVIDER_virtual/xserver ?= "xserver-xorg"
+
+XSERVER ?= "xserver-xorg \
+ mesa-dri-driver-swrast \
+ xf86-input-evdev \
+ xf86-input-mouse \
+ xf86-video-fbdev \
+ xf86-input-keyboard"
+
+MACHINE_FEATURES = "usbhost screen"
+
+# Don't include kernels in standard images
+RDEPENDS_kernel-base = ""
+
+# Use a common kernel recipe for all QEMU machines
+PREFERRED_PROVIDER_virtual/kernel ?= "linux-yocto"
+
+KERNEL_IMAGETYPE = "zImage"
+
+# Force auto-serial-console to be used by all image types
+# Ideally this would be part of core oe or as a bbclassappend,
+# but as we don't have an easy way to append a class, defining
+# it here
+EXTRA_IMAGE_FEATURES += "autoserial"
+PACKAGE_GROUP_autoserial = "auto-serial-console"
diff --git a/meta-linaro/conf/machine/qemuarmv7a.conf b/meta-linaro/conf/machine/qemuarmv7a.conf
new file mode 100644
index 00000000..ff9bd558
--- /dev/null
+++ b/meta-linaro/conf/machine/qemuarmv7a.conf
@@ -0,0 +1,10 @@
+#@TYPE: Machine
+#@NAME: arm_vexpress
+#@DESCRIPTION: arm_vexpress
+
+require conf/machine/include/qemu.inc
+require conf/machine/include/arm/arch-armv7a.inc
+
+KERNEL_IMAGETYPE = "zImage"
+
+SERIAL_CONSOLE = "38400n8 ttyAMA0"