summaryrefslogtreecommitdiff
path: root/recipes/meta
diff options
context:
space:
mode:
authorDenys Dmytriyenko <denis@denix.org>2009-10-14 15:27:07 +0200
committerKoen Kooi <koen@openembedded.org>2009-10-14 16:01:26 +0200
commit8be279f5a48418db0b4c9142c0c9bd4ae0764e37 (patch)
treeb5cd0ac438848d47520404474dae8f69c79757e0 /recipes/meta
parent2512ba21856d0ffd942ddd3a7c834d585a117ff1 (diff)
angstrom: framework to select internal/external toolchain and brand (csl/generic for now)
Diffstat (limited to 'recipes/meta')
-rw-r--r--recipes/meta/external-toolchain-csl.bb44
-rw-r--r--recipes/meta/external-toolchain-generic.bb50
2 files changed, 74 insertions, 20 deletions
diff --git a/recipes/meta/external-toolchain-csl.bb b/recipes/meta/external-toolchain-csl.bb
index 051b83281b..f17cae774f 100644
--- a/recipes/meta/external-toolchain-csl.bb
+++ b/recipes/meta/external-toolchain-csl.bb
@@ -126,34 +126,38 @@ DESCRIPTION_sln = "glibc: create symbolic links between files"
DESCRIPTION_localedef = "glibc: compile locale definition files"
def csl_get_main_version(d):
- import subprocess,bb
- return subprocess.Popen([bb.data.getVar('TOOLCHAIN_PATH', d, 1)+'/bin/'+bb.data.getVar('TARGET_PREFIX', d, 1)+'gcc', '-v'], stderr=subprocess.PIPE).communicate()[1].splitlines()[-1].split()[-1].rstrip(')')
+ import subprocess,os,bb
+ if os.path.exists(bb.data.getVar('TOOLCHAIN_PATH', d, 1)+'/bin/'+bb.data.getVar('TARGET_PREFIX', d, 1)+'gcc'):
+ return subprocess.Popen([bb.data.getVar('TOOLCHAIN_PATH', d, 1)+'/bin/'+bb.data.getVar('TARGET_PREFIX', d, 1)+'gcc', '-v'], stderr=subprocess.PIPE).communicate()[1].splitlines()[-1].split()[-1].rstrip(')')
def csl_get_gcc_version(d):
- import subprocess,bb
- return subprocess.Popen([bb.data.getVar('TOOLCHAIN_PATH', d, 1)+'/bin/'+bb.data.getVar('TARGET_PREFIX', d, 1)+'gcc', '-v'], stderr=subprocess.PIPE).communicate()[1].splitlines()[-1].split()[2]
+ import subprocess,os,bb
+ if os.path.exists(bb.data.getVar('TOOLCHAIN_PATH', d, 1)+'/bin/'+bb.data.getVar('TARGET_PREFIX', d, 1)+'gcc'):
+ return subprocess.Popen([bb.data.getVar('TOOLCHAIN_PATH', d, 1)+'/bin/'+bb.data.getVar('TARGET_PREFIX', d, 1)+'gcc', '-v'], stderr=subprocess.PIPE).communicate()[1].splitlines()[-1].split()[2]
def csl_get_libc_version(d):
import os,bb
- for file in os.listdir(bb.data.getVar('TOOLCHAIN_SYSPATH', d, 1)+'/libc/lib/'):
- if file.find('libc-') == 0:
- return file[5:-3]
- return None
+ if os.path.exists(bb.data.getVar('TOOLCHAIN_SYSPATH', d, 1)+'/libc/lib/'):
+ for file in os.listdir(bb.data.getVar('TOOLCHAIN_SYSPATH', d, 1)+'/libc/lib/'):
+ if file.find('libc-') == 0:
+ return file[5:-3]
+ return None
def csl_get_kernel_version(d):
import os,bb
- f = open(bb.data.getVar('TOOLCHAIN_SYSPATH', d, 1)+'/libc/usr/include/linux/version.h', 'r')
- 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 None
+ if os.path.exists(bb.data.getVar('TOOLCHAIN_SYSPATH', d, 1)+'/libc/'):
+ f = open(bb.data.getVar('TOOLCHAIN_SYSPATH', d, 1)+'/libc/usr/include/linux/version.h', 'r')
+ 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 None
CSL_VER_MAIN := "${@csl_get_main_version(d)}"
CSL_VER_GCC := "${@csl_get_gcc_version(d)}"
diff --git a/recipes/meta/external-toolchain-generic.bb b/recipes/meta/external-toolchain-generic.bb
new file mode 100644
index 0000000000..6e87e88954
--- /dev/null
+++ b/recipes/meta/external-toolchain-generic.bb
@@ -0,0 +1,50 @@
+DESCRIPTION = "This package allows OE to work with an external toolchain generated \
+ by meta-toolchain instead of building its own. It expects that toolchain \
+ to be located in SDK_PATH/prefix."
+
+PROVIDES = "\
+ linux-libc-headers \
+ virtual/${TARGET_PREFIX}gcc \
+ virtual/${TARGET_PREFIX}gcc-initial \
+ virtual/${TARGET_PREFIX}gcc-intermediate \
+ virtual/${TARGET_PREFIX}binutils \
+ virtual/${TARGET_PREFIX}libc-for-gcc \
+ virtual/${TARGET_PREFIX}libc-initial \
+ virtual/libc \
+ virtual/libintl \
+ virtual/libiconv \
+ "
+
+RPROVIDES = "glibc glibc-utils libsegfault glibc-thread-db libgcc-dev libgcc libstdc++-dev libstdc++ ldd"
+PACKAGES_DYNAMIC = "glibc-gconv-*"
+PR = "r2"
+
+inherit sdk
+
+do_stage() {
+ if [ ! -e ${prefix}/package-status ]; then
+ echo "The external toolchain could not be found in ${prefix}!"
+ exit 1
+ fi
+
+ install -d ${STAGING_DIR}/pkgdata/
+ install -d ${STAGING_DIR_TARGET}/shlibs/
+
+ cp -pPRr ${prefix}/pkgdata/* ${STAGING_DIR}/pkgdata/
+ cp -pPRr ${prefix}/${TARGET_SYS}/shlibs/* ${STAGING_DIR_TARGET}/shlibs/
+
+ if [ -d ${prefix}/ipk ]; then
+ install -d ${DEPLOY_DIR_IPK}/
+ cp -pPRr ${prefix}/ipk/* ${DEPLOY_DIR_IPK}/
+ fi
+
+ if [ -d ${prefix}/deb ]; then
+ install -d ${DEPLOY_DIR_DEB}/
+ cp -pPRr ${prefix}/deb/* ${DEPLOY_DIR_DEB}/
+ fi
+
+# if [ -d ${prefix}/pstage -a "x${DEPLOY_DIR_PSTAGE}" != "x" ]; then
+# install -d ${DEPLOY_DIR_PSTAGE}/
+# cp -pPRr ${prefix}/pstage/* ${DEPLOY_DIR_PSTAGE}/
+# fi
+}