diff options
author | Richard Purdie <rpurdie@linux.intel.com> | 2008-12-05 11:24:02 +0000 |
---|---|---|
committer | Richard Purdie <rpurdie@linux.intel.com> | 2008-12-05 11:25:55 +0000 |
commit | bcb58a0cd0783b67de316100f0d21fa8e33016a0 (patch) | |
tree | 7037032ec866598dc3a2361fbd8d306def6dc02c | |
parent | 1732e55c569fdc4ec1e56d7f110731b9d7757eea (diff) | |
download | poky-bcb58a0cd0783b67de316100f0d21fa8e33016a0.tar.gz |
meta-toolchain: Fix problems introduced by prefix variable value changes
-rw-r--r-- | meta/packages/meta/meta-toolchain.bb | 69 |
1 files changed, 35 insertions, 34 deletions
diff --git a/meta/packages/meta/meta-toolchain.bb b/meta/packages/meta/meta-toolchain.bb index b9a417d6ea..52567844f6 100644 --- a/meta/packages/meta/meta-toolchain.bb +++ b/meta/packages/meta/meta-toolchain.bb | |||
@@ -20,6 +20,7 @@ RDEPENDS = "${TOOLCHAIN_TARGET_TASK} ${TOOLCHAIN_HOST_TASK}" | |||
20 | 20 | ||
21 | do_populate_sdk() { | 21 | do_populate_sdk() { |
22 | rm -rf ${SDK_OUTPUT} | 22 | rm -rf ${SDK_OUTPUT} |
23 | rm -rf ${SDK_OUTPUT2} | ||
23 | mkdir -p ${SDK_OUTPUT} | 24 | mkdir -p ${SDK_OUTPUT} |
24 | mkdir -p ${SDK_OUTPUT}${layout_libdir}/opkg/ | 25 | mkdir -p ${SDK_OUTPUT}${layout_libdir}/opkg/ |
25 | mkdir -p ${SDK_OUTPUT}/${SDK_PREFIX}/${TARGET_SYS}${layout_libdir}/opkg/ | 26 | mkdir -p ${SDK_OUTPUT}/${SDK_PREFIX}/${TARGET_SYS}${layout_libdir}/opkg/ |
@@ -42,39 +43,39 @@ do_populate_sdk() { | |||
42 | ${IPKG_TARGET} update | 43 | ${IPKG_TARGET} update |
43 | ${IPKG_TARGET} install ${TOOLCHAIN_TARGET_TASK} | 44 | ${IPKG_TARGET} install ${TOOLCHAIN_TARGET_TASK} |
44 | 45 | ||
45 | install -d ${SDK_OUTPUT}/${prefix}/usr/lib/opkg | 46 | install -d ${SDK_OUTPUT}/${SDK_PREFIX}/usr/lib/opkg |
46 | mv ${SDK_OUTPUT}/usr/lib/opkg/* ${SDK_OUTPUT}/${prefix}/usr/lib/opkg/ | 47 | mv ${SDK_OUTPUT}/usr/lib/opkg/* ${SDK_OUTPUT}/${SDK_PREFIX}/usr/lib/opkg/ |
47 | rm -Rf ${SDK_OUTPUT}/usr/lib | 48 | rm -Rf ${SDK_OUTPUT}/usr/lib |
48 | 49 | ||
49 | install -d ${SDK_OUTPUT}/${prefix}/${TARGET_SYS}/${layout_sysconfdir} | 50 | install -d ${SDK_OUTPUT}/${SDK_PREFIX}/${TARGET_SYS}/${layout_sysconfdir} |
50 | install -m 0644 ${IPKGCONF_TARGET} ${IPKGCONF_SDK} ${SDK_OUTPUT}/${prefix}/${TARGET_SYS}/${layout_sysconfdir}/ | 51 | install -m 0644 ${IPKGCONF_TARGET} ${IPKGCONF_SDK} ${SDK_OUTPUT}/${SDK_PREFIX}/${TARGET_SYS}/${layout_sysconfdir}/ |
51 | 52 | ||
52 | install -d ${SDK_OUTPUT}/${sysconfdir} | 53 | install -d ${SDK_OUTPUT}/${SDK_PREFIX}/${sysconfdir} |
53 | install -m 0644 ${IPKGCONF_SDK} ${SDK_OUTPUT}/${sysconfdir}/ | 54 | install -m 0644 ${IPKGCONF_SDK} ${SDK_OUTPUT}/${SDK_PREFIX}/${sysconfdir}/ |
54 | 55 | ||
55 | # extract and store ipks, pkgdata and shlibs data | 56 | # extract and store ipks, pkgdata and shlibs data |
56 | target_pkgs=`cat ${SDK_OUTPUT}/${prefix}/${TARGET_SYS}/usr/lib/opkg/status | grep Package: | cut -f 2 -d ' '` | 57 | target_pkgs=`cat ${SDK_OUTPUT}/${SDK_PREFIX}/${TARGET_SYS}/usr/lib/opkg/status | grep Package: | cut -f 2 -d ' '` |
57 | mkdir -p ${SDK_OUTPUT2}/${prefix}/ipk/ | 58 | mkdir -p ${SDK_OUTPUT2}/${SDK_PREFIX}/ipk/ |
58 | mkdir -p ${SDK_OUTPUT2}/${prefix}/pkgdata/runtime/ | 59 | mkdir -p ${SDK_OUTPUT2}/${SDK_PREFIX}/pkgdata/runtime/ |
59 | mkdir -p ${SDK_OUTPUT2}/${prefix}/${TARGET_SYS}/shlibs/ | 60 | mkdir -p ${SDK_OUTPUT2}/${SDK_PREFIX}/${TARGET_SYS}/shlibs/ |
60 | for pkg in $target_pkgs ; do | 61 | for pkg in $target_pkgs ; do |
61 | for arch in $revipkgarchs; do | 62 | for arch in $revipkgarchs; do |
62 | pkgnames=${DEPLOY_DIR_IPK}/$arch/${pkg}_*_$arch.ipk | 63 | pkgnames=${DEPLOY_DIR_IPK}/$arch/${pkg}_*_$arch.ipk |
63 | if [ -e $pkgnames ]; then | 64 | if [ -e $pkgnames ]; then |
64 | echo "Found $pkgnames" | 65 | echo "Found $pkgnames" |
65 | cp $pkgnames ${SDK_OUTPUT2}/${prefix}/ipk/ | 66 | cp $pkgnames ${SDK_OUTPUT2}/${SDK_PREFIX}/ipk/ |
66 | orig_pkg=`opkg-list-fields $pkgnames | grep OE: | cut -d ' ' -f2` | 67 | orig_pkg=`opkg-list-fields $pkgnames | grep OE: | cut -d ' ' -f2` |
67 | pkg_subdir=$arch${TARGET_VENDOR}${@['-' + bb.data.getVar('TARGET_OS', d, 1), ''][bb.data.getVar('TARGET_OS', d, 1) == ('' or 'custom')]} | 68 | pkg_subdir=$arch${TARGET_VENDOR}${@['-' + bb.data.getVar('TARGET_OS', d, 1), ''][bb.data.getVar('TARGET_OS', d, 1) == ('' or 'custom')]} |
68 | mkdir -p ${SDK_OUTPUT2}/${prefix}/pkgdata/$pkg_subdir/runtime | 69 | mkdir -p ${SDK_OUTPUT2}/${SDK_PREFIX}/pkgdata/$pkg_subdir/runtime |
69 | cp ${TMPDIR}/pkgdata/$pkg_subdir/$orig_pkg ${SDK_OUTPUT2}/${prefix}/pkgdata/$pkg_subdir/ | 70 | cp ${TMPDIR}/pkgdata/$pkg_subdir/$orig_pkg ${SDK_OUTPUT2}/${SDK_PREFIX}/pkgdata/$pkg_subdir/ |
70 | subpkgs=`cat ${TMPDIR}/pkgdata/$pkg_subdir/$orig_pkg | grep PACKAGES: | cut -b 10-` | 71 | subpkgs=`cat ${TMPDIR}/pkgdata/$pkg_subdir/$orig_pkg | grep PACKAGES: | cut -b 10-` |
71 | for subpkg in $subpkgs; do | 72 | for subpkg in $subpkgs; do |
72 | cp ${TMPDIR}/pkgdata/$pkg_subdir/runtime/$subpkg ${SDK_OUTPUT2}/${prefix}/pkgdata/$pkg_subdir/runtime/ | 73 | cp ${TMPDIR}/pkgdata/$pkg_subdir/runtime/$subpkg ${SDK_OUTPUT2}/${SDK_PREFIX}/pkgdata/$pkg_subdir/runtime/ |
73 | if [ -e ${TMPDIR}/pkgdata/$pkg_subdir/runtime/$subpkg.packaged ];then | 74 | if [ -e ${TMPDIR}/pkgdata/$pkg_subdir/runtime/$subpkg.packaged ];then |
74 | cp ${TMPDIR}/pkgdata/$pkg_subdir/runtime/$subpkg.packaged ${SDK_OUTPUT2}/${prefix}/pkgdata/$pkg_subdir/runtime/ | 75 | cp ${TMPDIR}/pkgdata/$pkg_subdir/runtime/$subpkg.packaged ${SDK_OUTPUT2}/${SDK_PREFIX}/pkgdata/$pkg_subdir/runtime/ |
75 | fi | 76 | fi |
76 | if [ -e ${STAGING_DIR_TARGET}/shlibs/$subpkg.list ]; then | 77 | if [ -e ${STAGING_DIR_TARGET}/shlibs/$subpkg.list ]; then |
77 | cp ${STAGING_DIR_TARGET}/shlibs/$subpkg.* ${SDK_OUTPUT2}/${prefix}/${TARGET_SYS}/shlibs/ | 78 | cp ${STAGING_DIR_TARGET}/shlibs/$subpkg.* ${SDK_OUTPUT2}/${SDK_PREFIX}/${TARGET_SYS}/shlibs/ |
78 | fi | 79 | fi |
79 | done | 80 | done |
80 | break | 81 | break |
@@ -83,43 +84,43 @@ do_populate_sdk() { | |||
83 | done | 84 | done |
84 | 85 | ||
85 | # Fix or remove broken .la files | 86 | # Fix or remove broken .la files |
86 | for i in `find ${SDK_OUTPUT}/${prefix}/${TARGET_SYS} -name \*.la`; do | 87 | for i in `find ${SDK_OUTPUT}/${SDK_PREFIX}/${TARGET_SYS} -name \*.la`; do |
87 | sed -i -e "/^dependency_libs=/s,\([[:space:]']\)${layout_base_libdir},\1${prefix}/${TARGET_SYS}${layout_base_libdir},g" \ | 88 | sed -i -e "/^dependency_libs=/s,\([[:space:]']\)${layout_base_libdir},\1${SDK_PREFIX}/${TARGET_SYS}${layout_base_libdir},g" \ |
88 | -e "/^dependency_libs=/s,\([[:space:]']\)${layout_libdir},\1${prefix}/${TARGET_SYS}${layout_libdir},g" \ | 89 | -e "/^dependency_libs=/s,\([[:space:]']\)${layout_libdir},\1${SDK_PREFIX}/${TARGET_SYS}${layout_libdir},g" \ |
89 | -e "/^dependency_libs=/s,\-\([LR]\)${layout_base_libdir},-\1${prefix}/${TARGET_SYS}${layout_base_libdir},g" \ | 90 | -e "/^dependency_libs=/s,\-\([LR]\)${layout_base_libdir},-\1${SDK_PREFIX}/${TARGET_SYS}${layout_base_libdir},g" \ |
90 | -e "/^dependency_libs=/s,\-\([LR]\)${layout_libdir},-\1${prefix}/${TARGET_SYS}${layout_libdir},g" \ | 91 | -e "/^dependency_libs=/s,\-\([LR]\)${layout_libdir},-\1${SDK_PREFIX}/${TARGET_SYS}${layout_libdir},g" \ |
91 | -e 's/^installed=yes$/installed=no/' $i | 92 | -e 's/^installed=yes$/installed=no/' $i |
92 | done | 93 | done |
93 | rm -f ${SDK_OUTPUT}/${prefix}/lib/*.la | 94 | rm -f ${SDK_OUTPUT}/${SDK_PREFIX}/lib/*.la |
94 | 95 | ||
95 | # Setup site file for external use | 96 | # Setup site file for external use |
96 | siteconfig=${SDK_OUTPUT}/${prefix}/site-config | 97 | siteconfig=${SDK_OUTPUT}/${SDK_PREFIX}/site-config |
97 | touch $siteconfig | 98 | touch $siteconfig |
98 | for sitefile in ${CONFIG_SITE} ; do | 99 | for sitefile in ${CONFIG_SITE} ; do |
99 | cat $sitefile >> $siteconfig | 100 | cat $sitefile >> $siteconfig |
100 | done | 101 | done |
101 | 102 | ||
102 | # Create environment setup script | 103 | # Create environment setup script |
103 | script=${SDK_OUTPUT}/${prefix}/environment-setup | 104 | script=${SDK_OUTPUT}/${SDK_PREFIX}/environment-setup |
104 | touch $script | 105 | touch $script |
105 | echo 'export PATH=${prefix}/bin:$PATH' >> $script | 106 | echo 'export PATH=${SDK_PREFIX}/bin:$PATH' >> $script |
106 | echo 'export PKG_CONFIG_SYSROOT_DIR=${prefix}/${TARGET_SYS}' >> $script | 107 | echo 'export PKG_CONFIG_SYSROOT_DIR=${SDK_PREFIX}/${TARGET_SYS}' >> $script |
107 | echo 'export PKG_CONFIG_PATH=${prefix}/${TARGET_SYS}${layout_libdir}/pkgconfig' >> $script | 108 | echo 'export PKG_CONFIG_PATH=${SDK_PREFIX}/${TARGET_SYS}${layout_libdir}/pkgconfig' >> $script |
108 | echo 'export CONFIG_SITE=${prefix}/site-config' >> $script | 109 | echo 'export CONFIG_SITE=${SDK_PREFIX}/site-config' >> $script |
109 | echo 'export CC=${TARGET_PREFIX}gcc' >> $script | 110 | echo 'export CC=${TARGET_PREFIX}gcc' >> $script |
110 | echo 'export CONFIGURE_FLAGS="--target=${TARGET_SYS} --host=${TARGET_SYS}"' >> $script | 111 | echo 'export CONFIGURE_FLAGS="--target=${TARGET_SYS} --host=${TARGET_SYS}"' >> $script |
111 | if [ "${TARGET_OS}" = "darwin8" ]; then | 112 | if [ "${TARGET_OS}" = "darwin8" ]; then |
112 | echo 'export TARGET_CFLAGS="-I${prefix}/${TARGET_SYS}${layout_includedir}"' >> $script | 113 | echo 'export TARGET_CFLAGS="-I${SDK_PREFIX}/${TARGET_SYS}${layout_includedir}"' >> $script |
113 | echo 'export TARGET_LDFLAGS="-L${prefix}/${TARGET_SYS}${layout_libdir}"' >> $script | 114 | echo 'export TARGET_LDFLAGS="-L${SDK_PREFIX}/${TARGET_SYS}${layout_libdir}"' >> $script |
114 | # Workaround darwin toolchain sysroot path problems | 115 | # Workaround darwin toolchain sysroot path problems |
115 | cd ${SDK_OUTPUT}${prefix}/${TARGET_SYS}/usr | 116 | cd ${SDK_OUTPUT}${SDK_PREFIX}/${TARGET_SYS}/usr |
116 | ln -s /usr/local local | 117 | ln -s /usr/local local |
117 | fi | 118 | fi |
118 | echo "alias opkg='LD_LIBRARY_PATH=${prefix}/lib ${prefix}/bin/opkg-cl -f ${sysconfdir}/opkg-sdk.conf -o ${prefix}'" >> $script | 119 | echo "alias opkg='LD_LIBRARY_PATH=${SDK_PREFIX}/lib ${SDK_PREFIX}/bin/opkg-cl -f ${SDK_PREFIX}/${sysconfdir}/opkg-sdk.conf -o ${SDK_PREFIX}'" >> $script |
119 | echo "alias opkg-target='LD_LIBRARY_PATH=${prefix}/lib ${prefix}/bin/opkg-cl -f ${prefix}/${TARGET_SYS}${layout_sysconfdir}/opkg.conf -o ${prefix}/${TARGET_SYS}'" >> $script | 120 | echo "alias opkg-target='LD_LIBRARY_PATH=${SDK_PREFIX}/lib ${SDK_PREFIX}/bin/opkg-cl -f ${SDK_PREFIX}/${TARGET_SYS}${layout_sysconfdir}/opkg.conf -o ${SDK_PREFIX}/${TARGET_SYS}'" >> $script |
120 | 121 | ||
121 | # Add version information | 122 | # Add version information |
122 | versionfile=${SDK_OUTPUT}/${prefix}/version | 123 | versionfile=${SDK_OUTPUT}/${SDK_PREFIX}/version |
123 | touch $versionfile | 124 | touch $versionfile |
124 | echo 'Distro: ${DISTRO}' >> $versionfile | 125 | echo 'Distro: ${DISTRO}' >> $versionfile |
125 | echo 'Distro Version: ${DISTRO_VERSION}' >> $versionfile | 126 | echo 'Distro Version: ${DISTRO_VERSION}' >> $versionfile |