bitbake.conf/classes/gcc: Don't hardcode -nativesdk
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 22 Aug 2013 09:12:04 +0000 (09:12 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 23 Aug 2013 15:20:12 +0000 (16:20 +0100)
Hardcoding -nativesdk as the sdk package architecture is inflexible. We may have
multiple different target OS and we need a way to be able to separate them. Turning
this into a configurable value allows the flexibility we need to build different
SDKMACHINEs with different OS targets.

The commit should have no behaviour change, just makes things more configurable.

(From OE-Core rev: a2110e86b98d646e136de9ec6b8e668079b0d4f4)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/cross-canadian.bbclass
meta/classes/crosssdk.bbclass
meta/classes/nativesdk.bbclass
meta/conf/bitbake.conf
meta/recipes-devtools/gcc/gcc-configure-runtime.inc
meta/recipes-devtools/gcc/libgcc_4.7.bb
meta/recipes-devtools/gcc/libgcc_4.8.bb

index fa2ab70..87dd994 100644 (file)
@@ -14,25 +14,25 @@ STAGING_BINDIR_TOOLCHAIN = "${STAGING_DIR_NATIVE}${bindir_native}/${SDK_ARCH}${S
 #
 # Update BASE_PACKAGE_ARCH and PACKAGE_ARCHS
 #
-PACKAGE_ARCH = "${SDK_ARCH}-nativesdk"
+PACKAGE_ARCH = "${SDK_ARCH}-${SDKPKGSUFFIX}"
 python () {
     archs = d.getVar('PACKAGE_ARCHS', True).split()
     sdkarchs = []
     for arch in archs:
-        sdkarchs.append(arch + '-nativesdk')
+        sdkarchs.append(arch + '-${SDKPKGSUFFIX}')
     d.setVar('PACKAGE_ARCHS', " ".join(sdkarchs))
 }
 MULTIMACH_TARGET_SYS = "${PACKAGE_ARCH}${HOST_VENDOR}-${HOST_OS}"
 
 INHIBIT_DEFAULT_DEPS = "1"
 
-STAGING_DIR_HOST = "${STAGING_DIR}/${HOST_ARCH}-nativesdk${HOST_VENDOR}-${HOST_OS}"
+STAGING_DIR_HOST = "${STAGING_DIR}/${HOST_ARCH}-${SDKPKGSUFFIX}${HOST_VENDOR}-${HOST_OS}"
 
-TOOLCHAIN_OPTIONS = " --sysroot=${STAGING_DIR}/${HOST_ARCH}-nativesdk${HOST_VENDOR}-${HOST_OS}"
+TOOLCHAIN_OPTIONS = " --sysroot=${STAGING_DIR}/${HOST_ARCH}-${SDKPKGSUFFIX}${HOST_VENDOR}-${HOST_OS}"
 
 PATH_append = ":${TMPDIR}/sysroots/${HOST_ARCH}/${bindir_cross}"
-PKGDATA_DIR = "${TMPDIR}/pkgdata/${HOST_ARCH}-nativesdk${HOST_VENDOR}-${HOST_OS}"
-PKGHIST_DIR = "${TMPDIR}/pkghistory/${HOST_ARCH}-nativesdk${HOST_VENDOR}-${HOST_OS}/"
+PKGDATA_DIR = "${TMPDIR}/pkgdata/${HOST_ARCH}-${SDKPKGSUFFIX}${HOST_VENDOR}-${HOST_OS}"
+PKGHIST_DIR = "${TMPDIR}/pkghistory/${HOST_ARCH}-${SDKPKGSUFFIX}${HOST_VENDOR}-${HOST_OS}/"
 
 HOST_ARCH = "${SDK_ARCH}"
 HOST_VENDOR = "${SDK_VENDOR}"
@@ -90,8 +90,8 @@ export PKG_CONFIG_DIR = "${STAGING_DIR_HOST}${layout_libdir}/pkgconfig"
 export PKG_CONFIG_SYSROOT_DIR = "${STAGING_DIR_HOST}"
 
 # Cross-canadian packages need to pull in nativesdk dynamic libs
-SHLIBSDIRS = "${TMPDIR}/pkgdata/${HOST_ARCH}-nativesdk${HOST_VENDOR}-${HOST_OS}/shlibs/ ${TMPDIR}/pkgdata/all-${HOST_VENDOR}-${HOST_OS}/shlibs/"
-SHLIBSDIR = "${TMPDIR}/pkgdata/${HOST_ARCH}-nativesdk${HOST_VENDOR}-${HOST_OS}/shlibs/"
+SHLIBSDIRS = "${TMPDIR}/pkgdata/${HOST_ARCH}-${SDKPKGSUFFIX}${HOST_VENDOR}-${HOST_OS}/shlibs/ ${TMPDIR}/pkgdata/all-${HOST_VENDOR}-${HOST_OS}/shlibs/"
+SHLIBSDIR = "${TMPDIR}/pkgdata/${HOST_ARCH}-${SDKPKGSUFFIX}${HOST_VENDOR}-${HOST_OS}/shlibs/"
 
 do_populate_sysroot[stamp-extra-info] = ""
 
index 635c0c4..bcc285b 100644 (file)
@@ -7,7 +7,7 @@ python () {
        d.setVar('TUNE_PKGARCH', d.getVar('SDK_ARCH', True))
 }
 
-STAGING_DIR_TARGET = "${STAGING_DIR}/${SDK_ARCH}-nativesdk${SDK_VENDOR}-${SDK_OS}"
+STAGING_DIR_TARGET = "${STAGING_DIR}/${SDK_ARCH}-${SDKPKGSUFFIX}${SDK_VENDOR}-${SDK_OS}"
 STAGING_BINDIR_TOOLCHAIN = "${STAGING_DIR_NATIVE}${bindir_native}/${TARGET_ARCH}${TARGET_VENDOR}-${TARGET_OS}"
 
 TARGET_ARCH = "${SDK_ARCH}"
index 0d5cba4..26d1e4a 100644 (file)
@@ -11,7 +11,7 @@ CLASSOVERRIDE = "class-nativesdk"
 #
 # Update PACKAGE_ARCH and PACKAGE_ARCHS
 #
-PACKAGE_ARCH = "${SDK_ARCH}-nativesdk"
+PACKAGE_ARCH = "${SDK_ARCH}-${SDKPKGSUFFIX}"
 PACKAGE_ARCHS = "${SDK_PACKAGE_ARCHS}"
 
 #
index d98fde1..6f3d9bb 100644 (file)
@@ -127,7 +127,8 @@ SDK_VENDOR = "-oesdk"
 SDK_SYS = "${SDK_ARCH}${SDK_VENDOR}${@['-' + d.getVar('SDK_OS', True), ''][d.getVar('SDK_OS', True) == ('' or 'custom')]}"
 SDK_PREFIX = "${SDK_SYS}-"
 SDK_CC_ARCH = "${BUILD_CC_ARCH}"
-SDK_PACKAGE_ARCHS = "all any noarch ${SDK_ARCH}-nativesdk"
+SDKPKGSUFFIX = "nativesdk"
+SDK_PACKAGE_ARCHS = "all any noarch ${SDK_ARCH}-${SDKPKGSUFFIX}"
 SDK_LD_ARCH = "${BUILD_LD_ARCH}"
 SDK_AS_ARCH = "${BUILD_AS_ARCH}"
 
index 977a98a..f89ca6b 100644 (file)
@@ -15,8 +15,8 @@ RUNTIMETARGET = "libssp libstdc++-v3 libgomp"
 
 do_configure () {
        export CXX="${CXX} -nostdinc++ -nostdlib++"
-       mtarget=`echo ${MULTIMACH_TARGET_SYS} | sed -e s#-nativesdk##`
-       target=`echo ${TARGET_SYS} | sed -e s#-nativesdk##`
+       mtarget=`echo ${MULTIMACH_TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
+       target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
        cp -fpPR ${STAGING_INCDIR_NATIVE}/gcc-build-internal-$mtarget/* ${B}
        for d in libgcc ${RUNTIMETARGET}; do
                echo "Configuring $d"
@@ -29,7 +29,7 @@ do_configure () {
 }
 
 do_compile () {
-       target=`echo ${TARGET_SYS} | sed -e s#-nativesdk##`
+       target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
        for d in libgcc ${RUNTIMETARGET}; do
                cd ${B}/$target/$d/
                oe_runmake MULTIBUILDTOP=${B}/$target/$d/
@@ -37,7 +37,7 @@ do_compile () {
 }
 
 do_install () {
-       target=`echo ${TARGET_SYS} | sed -e s#-nativesdk##`
+       target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
        for d in ${RUNTIMETARGET}; do
                cd ${B}/$target/$d/
                oe_runmake 'DESTDIR=${D}' MULTIBUILDTOP=${B}/$target/$d/ install
index 47669a2..3b5bb43 100644 (file)
@@ -26,7 +26,7 @@ FILES_libgcov-dev = " \
 FILES_${PN}-dbg += "${base_libdir}/.debug/"
 
 do_configure () {
-       target=`echo ${MULTIMACH_TARGET_SYS} | sed -e s#-nativesdk##`
+       target=`echo ${MULTIMACH_TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
        install -d ${D}${base_libdir} ${D}${libdir}
        cp -fpPR ${STAGING_INCDIR_NATIVE}/gcc-build-internal-$target/* ${B}
        mkdir -p ${B}/${BPN}
@@ -36,13 +36,13 @@ do_configure () {
 }
 
 do_compile () {
-       target=`echo ${TARGET_SYS} | sed -e s#-nativesdk##`
+       target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
        cd ${B}/${BPN}
        oe_runmake MULTIBUILDTOP=${B}/$target/${BPN}/
 }
 
 do_install () {
-       target=`echo ${TARGET_SYS} | sed -e s#-nativesdk##`
+       target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
        cd ${B}/${BPN}
        oe_runmake 'DESTDIR=${D}' MULTIBUILDTOP=${B}/$target/${BPN}/ install
 
index 47669a2..3b5bb43 100644 (file)
@@ -26,7 +26,7 @@ FILES_libgcov-dev = " \
 FILES_${PN}-dbg += "${base_libdir}/.debug/"
 
 do_configure () {
-       target=`echo ${MULTIMACH_TARGET_SYS} | sed -e s#-nativesdk##`
+       target=`echo ${MULTIMACH_TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
        install -d ${D}${base_libdir} ${D}${libdir}
        cp -fpPR ${STAGING_INCDIR_NATIVE}/gcc-build-internal-$target/* ${B}
        mkdir -p ${B}/${BPN}
@@ -36,13 +36,13 @@ do_configure () {
 }
 
 do_compile () {
-       target=`echo ${TARGET_SYS} | sed -e s#-nativesdk##`
+       target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
        cd ${B}/${BPN}
        oe_runmake MULTIBUILDTOP=${B}/$target/${BPN}/
 }
 
 do_install () {
-       target=`echo ${TARGET_SYS} | sed -e s#-nativesdk##`
+       target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
        cd ${B}/${BPN}
        oe_runmake 'DESTDIR=${D}' MULTIBUILDTOP=${B}/$target/${BPN}/ install