summaryrefslogtreecommitdiffstats
path: root/meta/classes/toolchain-scripts.bbclass
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2013-11-06 10:55:55 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-11-06 11:02:27 +0000
commitd6cc7c8ed76c8b1117cf03c7bd4b0742f98f79b3 (patch)
tree53fe0392176f5709a34ba8f0d603a1b96a13ac40 /meta/classes/toolchain-scripts.bbclass
parent0331fc280525bf96707927379accfba7b5e8651b (diff)
downloadpoky-d6cc7c8ed76c8b1117cf03c7bd4b0742f98f79b3.tar.gz
toolchain-scripts/meta-environment: Further cleanup code duplication
There was still duplicated code in toolchain-scripts, this further cleans up the functions to remove it. The now unused includedir parameter is also dropped. The final scripts do end up reordered slightly and the sysroot is parametrised for the IDE scripts which is an improvement but should have no functional difference. (From OE-Core rev: 1dbd65b4d14319e784a66776c1e9943d0179d3ee) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/toolchain-scripts.bbclass')
-rw-r--r--meta/classes/toolchain-scripts.bbclass49
1 files changed, 16 insertions, 33 deletions
diff --git a/meta/classes/toolchain-scripts.bbclass b/meta/classes/toolchain-scripts.bbclass
index 07e6fbf8ce..b9f2aea930 100644
--- a/meta/classes/toolchain-scripts.bbclass
+++ b/meta/classes/toolchain-scripts.bbclass
@@ -7,7 +7,6 @@ REAL_MULTIMACH_TARGET_SYS ?= "${MULTIMACH_TARGET_SYS}"
7# This function creates an environment-setup-script for use in a deployable SDK 7# This function creates an environment-setup-script for use in a deployable SDK
8toolchain_create_sdk_env_script () { 8toolchain_create_sdk_env_script () {
9 # Create environment setup script 9 # Create environment setup script
10 includedir=${5:-${includedir}}
11 libdir=${4:-${libdir}} 10 libdir=${4:-${libdir}}
12 sysroot=${3:-${SDKTARGETSYSROOT}} 11 sysroot=${3:-${SDKTARGETSYSROOT}}
13 multimach_target_sys=${2:-${REAL_MULTIMACH_TARGET_SYS}} 12 multimach_target_sys=${2:-${REAL_MULTIMACH_TARGET_SYS}}
@@ -19,33 +18,12 @@ toolchain_create_sdk_env_script () {
19 echo 'export PKG_CONFIG_SYSROOT_DIR=$SDKTARGETSYSROOT' >> $script 18 echo 'export PKG_CONFIG_SYSROOT_DIR=$SDKTARGETSYSROOT' >> $script
20 echo 'export PKG_CONFIG_PATH=$SDKTARGETSYSROOT'"$libdir"'/pkgconfig' >> $script 19 echo 'export PKG_CONFIG_PATH=$SDKTARGETSYSROOT'"$libdir"'/pkgconfig' >> $script
21 echo 'export CONFIG_SITE=${SDKPATH}/site-config-'"${multimach_target_sys}" >> $script 20 echo 'export CONFIG_SITE=${SDKPATH}/site-config-'"${multimach_target_sys}" >> $script
22 echo 'export CC="${TARGET_PREFIX}gcc ${TARGET_CC_ARCH} --sysroot=$SDKTARGETSYSROOT"' >> $script
23 echo 'export CXX="${TARGET_PREFIX}g++ ${TARGET_CC_ARCH} --sysroot=$SDKTARGETSYSROOT"' >> $script
24 echo 'export CPP="${TARGET_PREFIX}gcc -E ${TARGET_CC_ARCH} --sysroot=$SDKTARGETSYSROOT"' >> $script
25 echo 'export AS="${TARGET_PREFIX}as ${TARGET_AS_ARCH}"' >> $script
26 echo 'export LD="${TARGET_PREFIX}ld ${TARGET_LD_ARCH} --sysroot=$SDKTARGETSYSROOT"' >> $script
27 echo 'export GDB=${TARGET_PREFIX}gdb' >> $script
28 echo 'export STRIP=${TARGET_PREFIX}strip' >> $script
29 echo 'export RANLIB=${TARGET_PREFIX}ranlib' >> $script
30 echo 'export OBJCOPY=${TARGET_PREFIX}objcopy' >> $script
31 echo 'export OBJDUMP=${TARGET_PREFIX}objdump' >> $script
32 echo 'export AR=${TARGET_PREFIX}ar' >> $script
33 echo 'export NM=${TARGET_PREFIX}nm' >> $script
34 echo 'export M4=m4' >> $script
35 echo 'export TARGET_PREFIX=${TARGET_PREFIX}' >> $script
36 echo 'export CONFIGURE_FLAGS="--target=${TARGET_SYS} --host=${TARGET_SYS} --build=${SDK_ARCH}-linux --with-libtool-sysroot=$SDKTARGETSYSROOT"' >> $script
37 echo 'export CFLAGS="${TARGET_CFLAGS}"' >> $script
38 echo 'export CXXFLAGS="${TARGET_CXXFLAGS}"' >> $script
39 echo 'export LDFLAGS="${TARGET_LDFLAGS}"' >> $script
40 echo 'export CPPFLAGS="${TARGET_CPPFLAGS}"' >> $script
41 echo 'export OECORE_NATIVE_SYSROOT="${SDKPATHNATIVE}"' >> $script 21 echo 'export OECORE_NATIVE_SYSROOT="${SDKPATHNATIVE}"' >> $script
42 echo 'export OECORE_TARGET_SYSROOT="$SDKTARGETSYSROOT"' >> $script 22 echo 'export OECORE_TARGET_SYSROOT="$SDKTARGETSYSROOT"' >> $script
43 echo 'export OECORE_ACLOCAL_OPTS="-I ${SDKPATHNATIVE}/usr/share/aclocal"' >> $script 23 echo 'export OECORE_ACLOCAL_OPTS="-I ${SDKPATHNATIVE}/usr/share/aclocal"' >> $script
44 echo 'export OECORE_DISTRO_VERSION="${DISTRO_VERSION}"' >> $script
45 echo 'export OECORE_SDK_VERSION="${SDK_VERSION}"' >> $script
46 echo 'export PYTHONHOME=${SDKPATHNATIVE}${prefix_nativesdk}' >> $script 24 echo 'export PYTHONHOME=${SDKPATHNATIVE}${prefix_nativesdk}' >> $script
47 echo 'export ARCH=${ARCH}' >> $script 25
48 echo 'export CROSS_COMPILE=${TARGET_PREFIX}' >> $script 26 toolchain_shared_env_script
49} 27}
50 28
51# This function creates an environment-setup-script in the TMPDIR which enables 29# This function creates an environment-setup-script in the TMPDIR which enables
@@ -57,14 +35,21 @@ toolchain_create_tree_env_script () {
57 echo 'export PATH=${STAGING_DIR_NATIVE}/usr/bin:${PATH}' >> $script 35 echo 'export PATH=${STAGING_DIR_NATIVE}/usr/bin:${PATH}' >> $script
58 echo 'export PKG_CONFIG_SYSROOT_DIR=${PKG_CONFIG_SYSROOT_DIR}' >> $script 36 echo 'export PKG_CONFIG_SYSROOT_DIR=${PKG_CONFIG_SYSROOT_DIR}' >> $script
59 echo 'export PKG_CONFIG_PATH=${PKG_CONFIG_PATH}' >> $script 37 echo 'export PKG_CONFIG_PATH=${PKG_CONFIG_PATH}' >> $script
60
61 echo 'export CONFIG_SITE="${@siteinfo_get_files(d)}"' >> $script 38 echo 'export CONFIG_SITE="${@siteinfo_get_files(d)}"' >> $script
39 echo 'export SDKTARGETSYSROOT=${STAGING_DIR_TARGET}' >> $script
40 echo 'export OECORE_NATIVE_SYSROOT="${STAGING_DIR_NATIVE}"' >> $script
41 echo 'export OECORE_TARGET_SYSROOT="${STAGING_DIR_TARGET}"' >> $script
42 echo 'export OECORE_ACLOCAL_OPTS="-I ${STAGING_DIR_NATIVE}/usr/share/aclocal"' >> $script
43
44 toolchain_shared_env_script
45}
62 46
63 echo 'export CC="${TARGET_PREFIX}gcc ${TARGET_CC_ARCH} --sysroot=${STAGING_DIR_TARGET}"' >> $script 47toolchain_shared_env_script () {
64 echo 'export CXX="${TARGET_PREFIX}g++ ${TARGET_CC_ARCH} --sysroot=${STAGING_DIR_TARGET}"' >> $script 48 echo 'export CC="${TARGET_PREFIX}gcc ${TARGET_CC_ARCH} --sysroot=$SDKTARGETSYSROOT"' >> $script
65 echo 'export CPP="${TARGET_PREFIX}gcc -E ${TARGET_CC_ARCH} --sysroot=${STAGING_DIR_TARGET}"' >> $script 49 echo 'export CXX="${TARGET_PREFIX}g++ ${TARGET_CC_ARCH} --sysroot=$SDKTARGETSYSROOT"' >> $script
50 echo 'export CPP="${TARGET_PREFIX}gcc -E ${TARGET_CC_ARCH} --sysroot=$SDKTARGETSYSROOT"' >> $script
66 echo 'export AS="${TARGET_PREFIX}as ${TARGET_AS_ARCH}"' >> $script 51 echo 'export AS="${TARGET_PREFIX}as ${TARGET_AS_ARCH}"' >> $script
67 echo 'export LD="${TARGET_PREFIX}ld ${TARGET_LD_ARCH} --sysroot=${STAGING_DIR_TARGET}"' >> $script 52 echo 'export LD="${TARGET_PREFIX}ld ${TARGET_LD_ARCH} --sysroot=$SDKTARGETSYSROOT"' >> $script
68 echo 'export GDB=${TARGET_PREFIX}gdb' >> $script 53 echo 'export GDB=${TARGET_PREFIX}gdb' >> $script
69 echo 'export STRIP=${TARGET_PREFIX}strip' >> $script 54 echo 'export STRIP=${TARGET_PREFIX}strip' >> $script
70 echo 'export RANLIB=${TARGET_PREFIX}ranlib' >> $script 55 echo 'export RANLIB=${TARGET_PREFIX}ranlib' >> $script
@@ -72,15 +57,13 @@ toolchain_create_tree_env_script () {
72 echo 'export OBJDUMP=${TARGET_PREFIX}objdump' >> $script 57 echo 'export OBJDUMP=${TARGET_PREFIX}objdump' >> $script
73 echo 'export AR=${TARGET_PREFIX}ar' >> $script 58 echo 'export AR=${TARGET_PREFIX}ar' >> $script
74 echo 'export NM=${TARGET_PREFIX}nm' >> $script 59 echo 'export NM=${TARGET_PREFIX}nm' >> $script
60 echo 'export M4=m4' >> $script
75 echo 'export TARGET_PREFIX=${TARGET_PREFIX}' >> $script 61 echo 'export TARGET_PREFIX=${TARGET_PREFIX}' >> $script
76 echo 'export CONFIGURE_FLAGS="--target=${TARGET_SYS} --host=${TARGET_SYS} --build=${BUILD_SYS} --with-libtool-sysroot=${STAGING_DIR_TARGET}"' >> $script 62 echo 'export CONFIGURE_FLAGS="--target=${TARGET_SYS} --host=${TARGET_SYS} --build=${SDK_ARCH}-linux --with-libtool-sysroot=$SDKTARGETSYSROOT"' >> $script
77 echo 'export CFLAGS="${TARGET_CFLAGS}"' >> $script 63 echo 'export CFLAGS="${TARGET_CFLAGS}"' >> $script
78 echo 'export CXXFLAGS="${TARGET_CXXFLAGS}"' >> $script 64 echo 'export CXXFLAGS="${TARGET_CXXFLAGS}"' >> $script
79 echo 'export LDFLAGS="${TARGET_LDFLAGS}"' >> $script 65 echo 'export LDFLAGS="${TARGET_LDFLAGS}"' >> $script
80 echo 'export CPPFLAGS="${TARGET_CPPFLAGS}"' >> $script 66 echo 'export CPPFLAGS="${TARGET_CPPFLAGS}"' >> $script
81 echo 'export OECORE_NATIVE_SYSROOT="${STAGING_DIR_NATIVE}"' >> $script
82 echo 'export OECORE_TARGET_SYSROOT="${STAGING_DIR_TARGET}"' >> $script
83 echo 'export OECORE_ACLOCAL_OPTS="-I ${STAGING_DIR_NATIVE}/usr/share/aclocal"' >> $script
84 echo 'export OECORE_DISTRO_VERSION="${DISTRO_VERSION}"' >> $script 67 echo 'export OECORE_DISTRO_VERSION="${DISTRO_VERSION}"' >> $script
85 echo 'export OECORE_SDK_VERSION="${SDK_VERSION}"' >> $script 68 echo 'export OECORE_SDK_VERSION="${SDK_VERSION}"' >> $script
86 echo 'export ARCH=${ARCH}' >> $script 69 echo 'export ARCH=${ARCH}' >> $script