diff options
author | Mark Hatle <mark.hatle@windriver.com> | 2012-07-10 15:54:38 -0500 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-07-17 18:02:10 +0100 |
commit | 2bd0aaf98c5d586638d82f5f22c1c24122a889a3 (patch) | |
tree | b1f6c4936170ff3ab356a2419a10874b6f10fd37 /meta/classes/toolchain-scripts.bbclass | |
parent | 292469a70282ed83a8c73b3a5c57d7327ebde793 (diff) | |
download | openembedded-core-2bd0aaf98c5d586638d82f5f22c1c24122a889a3.tar.gz openembedded-core-2bd0aaf98c5d586638d82f5f22c1c24122a889a3.tar.bz2 openembedded-core-2bd0aaf98c5d586638d82f5f22c1c24122a889a3.zip |
toolchain-scripts: Sync the SDK/ADT values to the build system
The build system passes specific TUNE (fundamental) flag values to various
tools instead of using a shell wrapper or similar. It is important that the
build system and ADT/SDK match the behaviors exactly, or we are likely to
have differences in the way build-system and external components are built
leading to configuration, compilation and/or run-time problems.
Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/toolchain-scripts.bbclass')
-rw-r--r-- | meta/classes/toolchain-scripts.bbclass | 63 |
1 files changed, 45 insertions, 18 deletions
diff --git a/meta/classes/toolchain-scripts.bbclass b/meta/classes/toolchain-scripts.bbclass index bedcd612fe..bf37ec9ac8 100644 --- a/meta/classes/toolchain-scripts.bbclass +++ b/meta/classes/toolchain-scripts.bbclass @@ -14,9 +14,18 @@ toolchain_create_sdk_env_script () { echo 'export PKG_CONFIG_SYSROOT_DIR=${SDKTARGETSYSROOT}' >> $script echo 'export PKG_CONFIG_PATH=${SDKTARGETSYSROOT}${libdir}/pkgconfig' >> $script echo 'export CONFIG_SITE=${SDKPATH}/site-config-${REAL_MULTIMACH_TARGET_SYS}' >> $script - echo 'export CC=${TARGET_PREFIX}gcc' >> $script - echo 'export CXX=${TARGET_PREFIX}g++' >> $script + echo 'export CC="${TARGET_PREFIX}gcc ${TARGET_CC_ARCH} --sysroot=${SDKTARGETSYSROOT}"' >> $script + echo 'export CXX="${TARGET_PREFIX}g++ ${TARGET_CC_ARCH} --sysroot=${SDKTARGETSYSROOT}"' >> $script + echo 'export CPP="${TARGET_PREFIX}gcc -E ${TARGET_CC_ARCH} --sysroot=${SDKTARGETSYSROOT}"' >> $script + echo 'export AS="${TARGET_PREFIX}as ${TARGET_AS_ARCH}"' >> $script + echo 'export LD="${TARGET_PREFIX}ld ${TARGET_LD_ARCH} --sysroot=${SDKTARGETSYSROOT}"' >> $script echo 'export GDB=${TARGET_PREFIX}gdb' >> $script + echo 'export STRIP=${TARGET_PREFIX}strip' >> $script + echo 'export RANLIB=${TARGET_PREFIX}ranlib' >> $script + echo 'export OBJCOPY=${TARGET_PREFIX}objcopy' >> $script + echo 'export OBJDUMP=${TARGET_PREFIX}objdump' >> $script + echo 'export AR=${TARGET_PREFIX}-ar' >> $script + echo 'export NM=${TARGET_PREFIX}-nm' >> $script echo 'export TARGET_PREFIX=${TARGET_PREFIX}' >> $script echo 'export CONFIGURE_FLAGS="--target=${TARGET_SYS} --host=${TARGET_SYS} --build=${SDK_ARCH}-linux --with-libtool-sysroot=${SDKTARGETSYSROOT}"' >> $script if [ "${TARGET_OS}" = "darwin8" ]; then @@ -26,10 +35,10 @@ toolchain_create_sdk_env_script () { cd ${SDK_OUTPUT}${SDKTARGETSYSROOT}/usr ln -s /usr/local local fi - echo 'export CFLAGS="${TARGET_CC_ARCH} --sysroot=${SDKTARGETSYSROOT}"' >> $script - echo 'export CXXFLAGS="${TARGET_CC_ARCH} --sysroot=${SDKTARGETSYSROOT}"' >> $script - echo 'export LDFLAGS="${TARGET_LD_ARCH} --sysroot=${SDKTARGETSYSROOT}"' >> $script - echo 'export CPPFLAGS="${TARGET_CC_ARCH} --sysroot=${SDKTARGETSYSROOT}"' >> $script + echo 'export CFLAGS="${TARGET_CFLAGS}"' >> $script + echo 'export CXXFLAGS="${TARGET_CXXFLAGS}"' >> $script + echo 'export LDFLAGS="${TARGET_LDFLAGS}"' >> $script + echo 'export CPPFLAGS="${TARGET_CPPFLAGS}"' >> $script echo 'export OECORE_NATIVE_SYSROOT="${SDKPATHNATIVE}"' >> $script echo 'export OECORE_TARGET_SYSROOT="${SDKTARGETSYSROOT}"' >> $script echo 'export OECORE_ACLOCAL_OPTS="-I ${SDKPATHNATIVE}/usr/share/aclocal"' >> $script @@ -49,9 +58,18 @@ toolchain_create_tree_env_script () { echo 'export CONFIG_SITE="${@siteinfo_get_files(d)}"' >> $script - echo 'export CC=${TARGET_PREFIX}gcc' >> $script - echo 'export CXX=${TARGET_PREFIX}g++' >> $script + echo 'export CC="${TARGET_PREFIX}gcc ${TARGET_CC_ARCH} --sysroot=${STAGING_DIR_TARGET}"' >> $script + echo 'export CXX="${TARGET_PREFIX}g++ ${TARGET_CC_ARCH} --sysroot=${STAGING_DIR_TARGET}"' >> $script + echo 'export CPP="${TARGET_PREFIX}gcc -E ${TARGET_CC_ARCH} --sysroot=${STAGING_DIR_TARGET}"' >> $script + echo 'export AS="${TARGET_PREFIX}as ${TARGET_AS_ARCH}"' >> $script + echo 'export LD="${TARGET_PREFIX}ld ${TARGET_LD_ARCH} --sysroot=${STAGING_DIR_TARGET}"' >> $script echo 'export GDB=${TARGET_PREFIX}gdb' >> $script + echo 'export STRIP=${TARGET_PREFIX}strip' >> $script + echo 'export RANLIB=${TARGET_PREFIX}ranlib' >> $script + echo 'export OBJCOPY=${TARGET_PREFIX}objcopy' >> $script + echo 'export OBJDUMP=${TARGET_PREFIX}objdump' >> $script + echo 'export AR=${TARGET_PREFIX}-ar' >> $script + echo 'export NM=${TARGET_PREFIX}-nm' >> $script echo 'export TARGET_PREFIX=${TARGET_PREFIX}' >> $script echo 'export CONFIGURE_FLAGS="--target=${TARGET_SYS} --host=${TARGET_SYS} --build=${BUILD_SYS} --with-libtool-sysroot=${STAGING_DIR_TARGET}"' >> $script if [ "${TARGET_OS}" = "darwin8" ]; then @@ -61,10 +79,10 @@ toolchain_create_tree_env_script () { cd ${SDK_OUTPUT}${SDKTARGETSYSROOT}/usr ln -s /usr/local local fi - echo 'export CFLAGS="${TARGET_CC_ARCH} --sysroot=${STAGING_DIR_TARGET}"' >> $script - echo 'export CXXFLAGS="${TARGET_CC_ARCH} --sysroot=${STAGING_DIR_TARGET}"' >> $script - echo 'export LDFLAGS="${TARGET_LD_ARCH} --sysroot=${STAGING_DIR_TARGET}"' >> $script - echo 'export CPPFLAGS="${TARGET_CC_ARCH} --sysroot=${STAGING_DIR_TARGET}"' >> $script + echo 'export CFLAGS="${TARGET_CFLAGS}"' >> $script + echo 'export CXXFLAGS="${TARGET_CXXFLAGS}"' >> $script + echo 'export LDFLAGS="${TARGET_LDFLAGS}"' >> $script + echo 'export CPPFLAGS="${TARGET_CPPFLAGS}"' >> $script echo 'export OECORE_NATIVE_SYSROOT="${STAGING_DIR_NATIVE}"' >> $script echo 'export OECORE_TARGET_SYSROOT="${STAGING_DIR_TARGET}"' >> $script echo 'export OECORE_ACLOCAL_OPTS="-I ${STAGING_DIR_NATIVE}/usr/share/aclocal"' >> $script @@ -83,9 +101,18 @@ toolchain_create_sdk_env_script_for_installer () { echo 'export PKG_CONFIG_SYSROOT_DIR=##SDKTARGETSYSROOT##' >> $script echo 'export PKG_CONFIG_PATH=##SDKTARGETSYSROOT##${target_libdir}/pkgconfig' >> $script echo 'export CONFIG_SITE=${SDKPATH}/site-config-'"${multimach_target_sys}" >> $script - echo 'export CC=${TARGET_PREFIX}gcc' >> $script - echo 'export CXX=${TARGET_PREFIX}g++' >> $script + echo 'export CC="${TARGET_PREFIX}gcc ${TARGET_CC_ARCH} --sysroot=##SDKTARGETSYSROOT##"' >> $script + echo 'export CXX="${TARGET_PREFIX}g++ ${TARGET_CC_ARCH} --sysroot=##SDKTARGETSYSROOT##"' >> $script + echo 'export CPP="${TARGET_PREFIX}gcc -E ${TARGET_CC_ARCH} --sysroot=##SDKTARGETSYSROOT##"' >> $script + echo 'export AS="${TARGET_PREFIX}as ${TARGET_AS_ARCH}"' >> $script + echo 'export LD="${TARGET_PREFIX}ld ${TARGET_LD_ARCH} --sysroot=##SDKTARGETSYSROOT##"' >> $script echo 'export GDB=${TARGET_PREFIX}gdb' >> $script + echo 'export STRIP=${TARGET_PREFIX}strip' >> $script + echo 'export RANLIB=${TARGET_PREFIX}ranlib' >> $script + echo 'export OBJCOPY=${TARGET_PREFIX}objcopy' >> $script + echo 'export OBJDUMP=${TARGET_PREFIX}objdump' >> $script + echo 'export AR=${TARGET_PREFIX}-ar' >> $script + echo 'export NM=${TARGET_PREFIX}-nm' >> $script echo 'export TARGET_PREFIX=${TARGET_PREFIX}' >> $script echo 'export CONFIGURE_FLAGS="--target=${TARGET_SYS} --host=${TARGET_SYS} --build=${SDK_ARCH}-linux --with-libtool-sysroot=##SDKTARGETSYSROOT##"' >> $script if [ "${TARGET_OS}" = "darwin8" ]; then @@ -95,10 +122,10 @@ toolchain_create_sdk_env_script_for_installer () { cd ${SDK_OUTPUT}${SDKTARGETSYSROOT}/usr ln -s /usr/local local fi - echo 'export CFLAGS="${TARGET_CC_ARCH} --sysroot=##SDKTARGETSYSROOT##"' >> $script - echo 'export CXXFLAGS="${TARGET_CC_ARCH} --sysroot=##SDKTARGETSYSROOT##"' >> $script - echo 'export LDFLAGS="${TARGET_LD_ARCH} --sysroot=##SDKTARGETSYSROOT##"' >> $script - echo 'export CPPFLAGS="${TARGET_CC_ARCH} --sysroot=##SDKTARGETSYSROOT##"' >> $script + echo 'export CFLAGS="${TARGET_CFLAGS}"' >> $script + echo 'export CXXFLAGS="${TARGET_CXXFLAGS}"' >> $script + echo 'export LDFLAGS="${TARGET_LDFLAGS}"' >> $script + echo 'export CPPFLAGS="${TARGET_CPPFLAGS}"' >> $script echo 'export OECORE_NATIVE_SYSROOT="${SDKPATHNATIVE}"' >> $script echo 'export OECORE_TARGET_SYSROOT="##SDKTARGETSYSROOT##"' >> $script echo 'export OECORE_ACLOCAL_OPTS="-I ${SDKPATHNATIVE}/usr/share/aclocal"' >> $script |