summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--meta/classes/cross-canadian.bbclass8
-rw-r--r--meta/classes/nativesdk.bbclass6
-rw-r--r--meta/conf/bitbake.conf4
-rw-r--r--meta/conf/distro/poky.conf4
-rw-r--r--meta/packages/gcc/gcc-crosssdk-initial.inc4
-rw-r--r--meta/packages/gcc/gcc-crosssdk-intermediate.inc4
-rw-r--r--meta/packages/gcc/gcc-crosssdk.inc4
-rw-r--r--meta/packages/meta/meta-toolchain.bb92
8 files changed, 51 insertions, 75 deletions
diff --git a/meta/classes/cross-canadian.bbclass b/meta/classes/cross-canadian.bbclass
index e5453848a..29ee99042 100644
--- a/meta/classes/cross-canadian.bbclass
+++ b/meta/classes/cross-canadian.bbclass
@@ -44,9 +44,9 @@ target_prefix := "${prefix}"
target_exec_prefix := "${exec_prefix}"
# Change to place files in SDKPATH
-prefix = "${SDKPATH}"
-exec_prefix = "${SDKPATH}"
-base_prefix = "${SDKPATH}"
+base_prefix = "${SDKPATHNATIVE}"
+prefix = "${SDKPATHNATIVE}${prefix_nativesdk}"
+exec_prefix = "${SDKPATHNATIVE}${prefix_nativesdk}"
FILES_${PN} = "${prefix}"
FILES_${PN}-dbg += "${prefix}/.debug \
@@ -56,5 +56,5 @@ FILES_${PN}-dbg += "${prefix}/.debug \
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 so's, sorry for ugliness
+# Cross-canadian packages need to pull in nativesdk dynamic libs
SHLIBSDIR = "${STAGING_DIR}/${SDK_ARCH}-nativesdk-pokysdk-${BUILD_OS}/shlibs"
diff --git a/meta/classes/nativesdk.bbclass b/meta/classes/nativesdk.bbclass
index 2c897c607..892bae5ec 100644
--- a/meta/classes/nativesdk.bbclass
+++ b/meta/classes/nativesdk.bbclass
@@ -37,9 +37,9 @@ CXXFLAGS = "${BUILDSDK_CFLAGS}"
LDFLAGS = "${BUILDSDK_LDFLAGS}"
# Change to place files in SDKPATH
-prefix = "${SDKPATH}"
-exec_prefix = "${SDKPATH}"
-base_prefix = "${SDKPATH}"
+base_prefix = "${SDKPATHNATIVE}"
+prefix = "${SDKPATHNATIVE}${prefix_nativesdk}"
+exec_prefix = "${SDKPATHNATIVE}${prefix_nativesdk}"
FILES_${PN} += "${prefix}"
FILES_${PN}-dbg += "${prefix}/.debug \
diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
index 9d8e59457..492ed9678 100644
--- a/meta/conf/bitbake.conf
+++ b/meta/conf/bitbake.conf
@@ -43,6 +43,9 @@ includedir_native = "${prefix_native}/include"
libdir_native = "${prefix_native}/lib"
datadir_native = "${prefix_native}/share"
bindir_cross = "/bin"
+prefix_nativesdk = "/usr"
+bindir_nativesdk = "${prefix_nativesdk}/bin"
+libdir_nativesdk = "${prefix_nativesdk}/lib"
#
# Cross recipes need to know about the target layout
@@ -290,6 +293,7 @@ PKGDATA_DIR = "${TMPDIR}/pkgdata/${MULTIMACH_TARGET_SYS}"
SDK_NAME = "${DISTRO}/${TARGET_ARCH}"
SDKPATH = "/usr/local/${SDK_NAME}"
+SDKPATHNATIVE = "${SDKPATH}/sysroots/${SDK_SYS}"
##################################################################
# Kernel info.
diff --git a/meta/conf/distro/poky.conf b/meta/conf/distro/poky.conf
index 57231fd6e..951e156c2 100644
--- a/meta/conf/distro/poky.conf
+++ b/meta/conf/distro/poky.conf
@@ -58,8 +58,8 @@ require conf/distro/include/poky-${POKYMODE}.inc
POKYLIBC ?= "glibc"
require conf/distro/include/poky-${POKYLIBC}.inc
-SDK_NAME = "${DISTRO}-${POKYMODE}-${POKYLIBC}-${SDK_ARCH}-${TARGET_ARCH}"
-SDKPATH = "/usr/local/${DISTRO}/${POKYMODE}-${POKYLIBC}"
+SDK_NAME = "${DISTRO}-${POKYLIBC}-${SDK_ARCH}-${TARGET_ARCH}"
+SDKPATH = "/opt/${DISTRO}"
CACHE = "${TMPDIR}/cache/${POKYMODE}-${POKYLIBC}${@['', '/' + str(bb.data.getVar('MACHINE', d, 1))][bool(bb.data.getVar('MACHINE', d, 1))]}${@['', '/' + str(bb.data.getVar('SDKMACHINE', d, 1))][bool(bb.data.getVar('SDKMACHINE', d, 1))]}"
diff --git a/meta/packages/gcc/gcc-crosssdk-initial.inc b/meta/packages/gcc/gcc-crosssdk-initial.inc
index 4b8346b00..794a95347 100644
--- a/meta/packages/gcc/gcc-crosssdk-initial.inc
+++ b/meta/packages/gcc/gcc-crosssdk-initial.inc
@@ -1,7 +1,7 @@
inherit crosssdk
-SYSTEMHEADERS = "${SDKPATH}/include"
-SYSTEMLIBS1 = "${SDKPATH}/lib/"
+SYSTEMHEADERS = "${SDKPATHNATIVE}${prefix_nativesdk}/include"
+SYSTEMLIBS1 = "${SDKPATHNATIVE}${libdir_nativesdk}/"
DEPENDS = "virtual/${TARGET_PREFIX}binutils-crosssdk gettext-native"
PROVIDES = "virtual/${TARGET_PREFIX}gcc-initial-crosssdk"
diff --git a/meta/packages/gcc/gcc-crosssdk-intermediate.inc b/meta/packages/gcc/gcc-crosssdk-intermediate.inc
index 603436005..5b88d3313 100644
--- a/meta/packages/gcc/gcc-crosssdk-intermediate.inc
+++ b/meta/packages/gcc/gcc-crosssdk-intermediate.inc
@@ -1,7 +1,7 @@
inherit crosssdk
-SYSTEMHEADERS = "${SDKPATH}/include"
-SYSTEMLIBS1 = "${SDKPATH}/lib/"
+SYSTEMHEADERS = "${SDKPATHNATIVE}${prefix_nativesdk}/include"
+SYSTEMLIBS1 = "${SDKPATHNATIVE}${libdir_nativesdk}/"
DEPENDS = "virtual/${TARGET_PREFIX}binutils-crosssdk gettext-native"
DEPENDS += "virtual/${TARGET_PREFIX}libc-initial-nativesdk"
diff --git a/meta/packages/gcc/gcc-crosssdk.inc b/meta/packages/gcc/gcc-crosssdk.inc
index e2252bbfc..be2d0b0a2 100644
--- a/meta/packages/gcc/gcc-crosssdk.inc
+++ b/meta/packages/gcc/gcc-crosssdk.inc
@@ -1,7 +1,7 @@
inherit crosssdk
-SYSTEMHEADERS = "${SDKPATH}/include"
-SYSTEMLIBS1 = "${SDKPATH}/lib/"
+SYSTEMHEADERS = "${SDKPATHNATIVE}${prefix_nativesdk}/include"
+SYSTEMLIBS1 = "${SDKPATHNATIVE}${libdir_nativesdk}/"
GCCMULTILIB = "--disable-multilib"
diff --git a/meta/packages/meta/meta-toolchain.bb b/meta/packages/meta/meta-toolchain.bb
index 9ae5554ea..43b4f027c 100644
--- a/meta/packages/meta/meta-toolchain.bb
+++ b/meta/packages/meta/meta-toolchain.bb
@@ -6,11 +6,12 @@ inherit meta
SDK_DIR = "${WORKDIR}/sdk"
SDK_OUTPUT = "${SDK_DIR}/image"
-SDK_OUTPUT2 = "${SDK_DIR}/image-extras"
SDK_DEPLOY = "${TMPDIR}/deploy/sdk"
+SDKTARGETSYSROOT = "${SDKPATH}/sysroots/${TARGET_SYS}"
+
IPKG_HOST = "opkg-cl -f ${IPKGCONF_SDK} -o ${SDK_OUTPUT}"
-IPKG_TARGET = "opkg-cl -f ${IPKGCONF_TARGET} -o ${SDK_OUTPUT}/${SDKPATH}/${TARGET_SYS}"
+IPKG_TARGET = "opkg-cl -f ${IPKGCONF_TARGET} -o ${SDK_OUTPUT}/${SDKTARGETSYSROOT}"
TOOLCHAIN_HOST_TASK ?= "task-sdk-host"
TOOLCHAIN_TARGET_TASK ?= "task-poky-standalone-sdk-target task-poky-standalone-sdk-target-dbg"
@@ -22,10 +23,9 @@ EXCLUDE_FROM_WORLD = "1"
do_populate_sdk() {
rm -rf ${SDK_OUTPUT}
- rm -rf ${SDK_OUTPUT2}
mkdir -p ${SDK_OUTPUT}
mkdir -p ${SDK_OUTPUT}${libdir}/opkg/
- mkdir -p ${SDK_OUTPUT}/${SDKPATH}/${TARGET_SYS}${libdir}/opkg/
+ mkdir -p ${SDK_OUTPUT}/${SDKTARGETSYSROOT}${libdir}/opkg/
rm -f ${IPKGCONF_TARGET}
touch ${IPKGCONF_TARGET}
@@ -45,58 +45,32 @@ do_populate_sdk() {
${IPKG_TARGET} update
${IPKG_TARGET} install ${TOOLCHAIN_TARGET_TASK}
- install -d ${SDK_OUTPUT}/${SDKPATH}/usr/lib/opkg
- mv ${SDK_OUTPUT}/usr/lib/opkg/* ${SDK_OUTPUT}/${SDKPATH}/usr/lib/opkg/
- rm -Rf ${SDK_OUTPUT}/usr/lib
+ install -d ${SDK_OUTPUT}/${SDKPATHNATIVE}${libdir_nativesdk}/opkg
+ mv ${SDK_OUTPUT}/usr/lib/opkg/* ${SDK_OUTPUT}/${SDKPATHNATIVE}${libdir_nativesdk}/opkg/
+ rm -Rf ${SDK_OUTPUT}/usr
# Don't ship any libGL in the SDK
- rm -rf ${SDK_OUTPUT}/${SDKPATH}/usr/lib/libGL*
-
- install -d ${SDK_OUTPUT}/${SDKPATH}/${TARGET_SYS}/${sysconfdir}
- install -m 0644 ${IPKGCONF_TARGET} ${IPKGCONF_SDK} ${SDK_OUTPUT}/${SDKPATH}/${TARGET_SYS}/${sysconfdir}/
-
- install -d ${SDK_OUTPUT}/${SDKPATH}/${sysconfdir}
- install -m 0644 ${IPKGCONF_SDK} ${SDK_OUTPUT}/${SDKPATH}/${sysconfdir}/
-
- # extract and store ipks, pkgdata and shlibs data
- target_pkgs=`cat ${SDK_OUTPUT}/${SDKPATH}/${TARGET_SYS}/usr/lib/opkg/status | grep Package: | cut -f 2 -d ' '`
- mkdir -p ${SDK_OUTPUT2}/${SDKPATH}/ipk/
- mkdir -p ${SDK_OUTPUT2}/${SDKPATH}/pkgdata/runtime/
- mkdir -p ${SDK_OUTPUT2}/${SDKPATH}/${TARGET_SYS}/shlibs/
- for pkg in $target_pkgs ; do
- for arch in $revipkgarchs; do
- pkgnames=${DEPLOY_DIR_IPK}/$arch/${pkg}_*_$arch.ipk
- if [ -e $pkgnames ]; then
- echo "Found $pkgnames"
- cp $pkgnames ${SDK_OUTPUT2}/${SDKPATH}/ipk/
- orig_pkg=`opkg-list-fields $pkgnames | grep OE: | cut -d ' ' -f2`
- pkg_subdir=$arch${TARGET_VENDOR}${@['-' + bb.data.getVar('TARGET_OS', d, 1), ''][bb.data.getVar('TARGET_OS', d, 1) == ('' or 'custom')]}
- mkdir -p ${SDK_OUTPUT2}/${SDKPATH}/pkgdata/$pkg_subdir/runtime
- cp ${TMPDIR}/pkgdata/$pkg_subdir/$orig_pkg ${SDK_OUTPUT2}/${SDKPATH}/pkgdata/$pkg_subdir/
- subpkgs=`cat ${TMPDIR}/pkgdata/$pkg_subdir/$orig_pkg | grep PACKAGES: | cut -b 10-`
- for subpkg in $subpkgs; do
- cp ${TMPDIR}/pkgdata/$pkg_subdir/runtime/$subpkg ${SDK_OUTPUT2}/${SDKPATH}/pkgdata/$pkg_subdir/runtime/
- if [ -e ${TMPDIR}/pkgdata/$pkg_subdir/runtime/$subpkg.packaged ];then
- cp ${TMPDIR}/pkgdata/$pkg_subdir/runtime/$subpkg.packaged ${SDK_OUTPUT2}/${SDKPATH}/pkgdata/$pkg_subdir/runtime/
- fi
- if [ -e ${STAGING_DIR_TARGET}/shlibs/$subpkg.list ]; then
- cp ${STAGING_DIR_TARGET}/shlibs/$subpkg.* ${SDK_OUTPUT2}/${SDKPATH}/${TARGET_SYS}/shlibs/
- fi
- done
- break
- fi
- done
- done
+ rm -rf ${SDK_OUTPUT}/${SDKPATHNATIVE}${libdir_nativesdk}/libGL*
+
+ install -d ${SDK_OUTPUT}/${SDKTARGETSYSROOT}/${sysconfdir}
+ install -m 0644 ${IPKGCONF_TARGET} ${IPKGCONF_SDK} ${SDK_OUTPUT}/${SDKTARGETSYSROOT}/${sysconfdir}/
+
+ install -d ${SDK_OUTPUT}/${SDKPATHNATIVE}/${sysconfdir}
+ install -m 0644 ${IPKGCONF_SDK} ${SDK_OUTPUT}/${SDKPATHNATIVE}/${sysconfdir}/
+
+ # Can copy pstage files here
+ # target_pkgs=`cat ${SDK_OUTPUT}/${SDKTARGETSYSROOT}/usr/lib/opkg/status | grep Package: | cut -f 2 -d ' '`
# Fix or remove broken .la files
- for i in `find ${SDK_OUTPUT}/${SDKPATH}/${TARGET_SYS} -name \*.la`; do
- sed -i -e "/^dependency_libs=/s,\([[:space:]']\)${base_libdir},\1${SDKPATH}/${TARGET_SYS}${base_libdir},g" \
- -e "/^dependency_libs=/s,\([[:space:]']\)${libdir},\1${SDKPATH}/${TARGET_SYS}${libdir},g" \
- -e "/^dependency_libs=/s,\-\([LR]\)${base_libdir},-\1${SDKPATH}/${TARGET_SYS}${base_libdir},g" \
- -e "/^dependency_libs=/s,\-\([LR]\)${libdir},-\1${SDKPATH}/${TARGET_SYS}${libdir},g" \
+ for i in `find ${SDK_OUTPUT}/${SDKTARGETSYSROOT} -name \*.la`; do
+ sed -i -e "/^dependency_libs=/s,\([[:space:]']\)${base_libdir},\1${SDKTARGETSYSROOT}${base_libdir},g" \
+ -e "/^dependency_libs=/s,\([[:space:]']\)${libdir},\1${SDKTARGETSYSROOT}${libdir},g" \
+ -e "/^dependency_libs=/s,\-\([LR]\)${base_libdir},-\1${SDKTARGETSYSROOT}${base_libdir},g" \
+ -e "/^dependency_libs=/s,\-\([LR]\)${libdir},-\1${SDKTARGETSYSROOT}${libdir},g" \
-e 's/^installed=yes$/installed=no/' $i
done
- rm -f ${SDK_OUTPUT}/${SDKPATH}/lib/*.la
+ #rm -f ${SDK_OUTPUT}/${SDKPATHNATIVE}/lib/*.la
+ rm -f ${SDK_OUTPUT}/${SDKPATHNATIVE}${libdir_nativesdk}/*.la
# Setup site file for external use
siteconfig=${SDK_OUTPUT}/${SDKPATH}/site-config-${TARGET_SYS}
@@ -108,21 +82,21 @@ do_populate_sdk() {
# Create environment setup script
script=${SDK_OUTPUT}/${SDKPATH}/environment-setup-${TARGET_SYS}
touch $script
- echo 'export PATH=${SDKPATH}/bin:$PATH' >> $script
- echo 'export PKG_CONFIG_SYSROOT_DIR=${SDKPATH}/${TARGET_SYS}' >> $script
- echo 'export PKG_CONFIG_PATH=${SDKPATH}/${TARGET_SYS}${libdir}/pkgconfig' >> $script
+ echo 'export PATH=${SDKPATHNATIVE}${bindir_nativesdk}:$PATH' >> $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-${TARGET_SYS}' >> $script
echo 'export CC=${TARGET_PREFIX}gcc' >> $script
echo 'export CONFIGURE_FLAGS="--target=${TARGET_SYS} --host=${TARGET_SYS} --build=${SDK_ARCH}-linux"' >> $script
if [ "${TARGET_OS}" = "darwin8" ]; then
- echo 'export TARGET_CFLAGS="-I${SDKPATH}/${TARGET_SYS}${includedir}"' >> $script
- echo 'export TARGET_LDFLAGS="-L${SDKPATH}/${TARGET_SYS}${libdir}"' >> $script
+ echo 'export TARGET_CFLAGS="-I${SDKTARGETSYSROOT}${includedir}"' >> $script
+ echo 'export TARGET_LDFLAGS="-L${SDKTARGETSYSROOT}${libdir}"' >> $script
# Workaround darwin toolchain sysroot path problems
- cd ${SDK_OUTPUT}${SDKPATH}/${TARGET_SYS}/usr
+ cd ${SDK_OUTPUT}${SDKTARGETSYSROOT}/usr
ln -s /usr/local local
fi
- echo "alias opkg='LD_LIBRARY_PATH=${SDKPATH}/lib ${SDKPATH}/bin/opkg-cl -f ${SDKPATH}/${sysconfdir}/opkg-sdk.conf -o ${SDKPATH}'" >> $script
- echo "alias opkg-target='LD_LIBRARY_PATH=${SDKPATH}/lib ${SDKPATH}/bin/opkg-cl -f ${SDKPATH}/${TARGET_SYS}${sysconfdir}/opkg.conf -o ${SDKPATH}/${TARGET_SYS}'" >> $script
+ echo "alias opkg='LD_LIBRARY_PATH=${SDKPATHNATIVE}${libdir_nativesdk} ${SDKPATHNATIVE}${bindir_nativesdk}/opkg-cl -f ${SDKPATHNATIVE}/${sysconfdir}/opkg-sdk.conf -o ${SDKPATHNATIVE}'" >> $script
+ echo "alias opkg-target='LD_LIBRARY_PATH=${SDKPATHNATIVE}${libdir_nativesdk} ${SDKPATHNATIVE}${bindir_nativesdk}/opkg-cl -f ${SDKTARGETSYSROOT}${sysconfdir}/opkg.conf -o ${SDKTARGETSYSROOT}'" >> $script
# Add version information
versionfile=${SDK_OUTPUT}/${SDKPATH}/version-${TARGET_SYS}
@@ -136,8 +110,6 @@ do_populate_sdk() {
mkdir -p ${SDK_DEPLOY}
cd ${SDK_OUTPUT}
fakeroot tar cfj ${SDK_DEPLOY}/${TOOLCHAIN_OUTPUTNAME}.tar.bz2 .
- cd ${SDK_OUTPUT2}
- fakeroot tar cfj ${SDK_DEPLOY}/${TOOLCHAIN_OUTPUTNAME}-extras.tar.bz2 .
}
do_populate_sdk[nostamp] = "1"