Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | DEPENDS = "linux-libc-headers virtual/${TARGET_PREFIX}gcc-initial libgcc-initial" |
| 2 | PROVIDES = "virtual/${TARGET_PREFIX}libc-initial" |
| 3 | |
| 4 | PACKAGES = "" |
| 5 | PACKAGES_DYNAMIC = "" |
| 6 | |
| 7 | STAGINGCC = "gcc-cross-initial-${TARGET_ARCH}" |
| 8 | STAGINGCC_class-nativesdk = "gcc-crosssdk-initial-${TARGET_ARCH}" |
| 9 | TOOLCHAIN_OPTIONS = " --sysroot=${STAGING_DIR_TCBOOTSTRAP}" |
| 10 | |
| 11 | do_configure () { |
| 12 | (cd ${S} && gnu-configize) || die "failure in running gnu-configize" |
| 13 | find ${S} -name "configure" | xargs touch |
| 14 | ${S}/configure --host=${TARGET_SYS} --build=${BUILD_SYS} \ |
| 15 | --prefix=/usr \ |
| 16 | --without-cvs --disable-sanity-checks \ |
| 17 | --with-headers=${STAGING_DIR_TARGET}${includedir} \ |
| 18 | --with-kconfig=${STAGING_BINDIR_NATIVE} \ |
| 19 | --enable-hacker-mode --enable-addons |
| 20 | } |
| 21 | |
| 22 | do_compile () { |
| 23 | : |
| 24 | } |
| 25 | |
| 26 | do_install () { |
| 27 | oe_runmake cross-compiling=yes install_root=${D} \ |
| 28 | includedir='${includedir}' prefix='${prefix}' \ |
| 29 | install-bootstrap-headers=yes install-headers |
| 30 | |
| 31 | oe_runmake csu/subdir_lib |
| 32 | mkdir -p ${D}${libdir}/ |
| 33 | install -m 644 csu/crt[1in].o ${D}${libdir} |
| 34 | |
| 35 | # Two headers -- stubs.h and features.h -- aren't installed by install-headers, |
| 36 | # so do them by hand. We can tolerate an empty stubs.h for the moment. |
| 37 | # See e.g. http://gcc.gnu.org/ml/gcc/2002-01/msg00900.html |
| 38 | mkdir -p ${D}${includedir}/gnu/ |
| 39 | touch ${D}${includedir}/gnu/stubs.h |
| 40 | cp ${S}/include/features.h ${D}${includedir}/features.h |
| 41 | |
| 42 | if [ -e ${B}/bits/stdio_lim.h ]; then |
| 43 | cp ${B}/bits/stdio_lim.h ${D}${includedir}/bits/ |
| 44 | fi |
| 45 | # add links to linux-libc-headers: final glibc build need this. |
| 46 | for t in linux asm asm-generic; do |
| 47 | ln -s ${STAGING_DIR_TARGET}${includedir}/$t ${D}${includedir}/ |
| 48 | done |
| 49 | } |
| 50 | |
| 51 | do_install_locale() { |
| 52 | : |
| 53 | } |
| 54 | |
| 55 | do_siteconfig () { |
| 56 | : |
| 57 | } |
| 58 | |
| 59 | SSTATEPOSTINSTFUNCS += "glibcinitial_sstate_postinst" |
| 60 | glibcinitial_sstate_postinst() { |
| 61 | if [ "${BB_CURRENTTASK}" = "populate_sysroot" -o "${BB_CURRENTTASK}" = "populate_sysroot_setscene" ] |
| 62 | then |
| 63 | # Recreate the symlinks to ensure they point to the correct location |
| 64 | for t in linux asm asm-generic; do |
| 65 | rm -f ${STAGING_DIR_TCBOOTSTRAP}${includedir}/$t |
| 66 | ln -s ${STAGING_DIR_TARGET}${includedir}/$t ${STAGING_DIR_TCBOOTSTRAP}${includedir}/ |
| 67 | done |
| 68 | fi |
| 69 | } |
| 70 | |
| 71 | do_populate_sysroot[sstate-outputdirs] = "${STAGING_DIR_TCBOOTSTRAP}/" |
| 72 | |
| 73 | # We don't install any scripts so there is nothing to evacuate |
| 74 | do_evacuate_scripts () { |
| 75 | : |
| 76 | } |