From: Jan-Benedict G. <jb...@us...> - 2005-12-16 11:25:32
|
Update of /cvsroot/linux-vax/toolchain/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3623 Modified Files: build_toolchain.sh Log Message: - Allow to supply a base directory into which all building/installing will happen. - Really only build uClibc components if needed. Index: build_toolchain.sh =================================================================== RCS file: /cvsroot/linux-vax/toolchain/scripts/build_toolchain.sh,v retrieving revision 1.38 retrieving revision 1.39 diff -u -d -r1.38 -r1.39 --- build_toolchain.sh 14 Dec 2005 20:13:25 -0000 1.38 +++ build_toolchain.sh 16 Dec 2005 11:25:09 -0000 1.39 @@ -76,6 +76,11 @@ # while [ "$#" -gt 0 ]; do case "${1}" in + --base) + shift + ALL_BASE="${1}" + shift + ;; --timestamp) shift TIMESTAMP_BINUTILS="${1}" @@ -232,6 +237,8 @@ [ "${DO_CHECKS_GLIBC}" -eq 0 ] && echo " Check GNU libc: no" [ "${DO_CHECKS_UCLIBC}" -ne 0 ] && echo " Check uClibc: yes" [ "${DO_CHECKS_UCLIBC}" -eq 0 ] && echo " Check uClibc: no" +[ -z "${ALL_BASE}" ] && echo " Build base directory: default" +[ ! -z "${ALL_BASE}" ] && echo " Build base directory: ${ALL_BASE}" # @@ -371,7 +378,9 @@ # # Set some variables # -ALL_BASE="${BUILD_BASE_DIR}/build-${NOW}-${TARGET}" +if [ -z "${ALL_BASE}" ]; then + ALL_BASE="${BUILD_BASE_DIR}/build-${NOW}-${TARGET}" +fi SRC_BASE="${ALL_BASE}/src" BUILD_BASE="${ALL_BASE}/build" INSTALL_BASE="${ALL_BASE}/install" @@ -459,8 +468,8 @@ # [ "${DO_PATCHES_BINUTILS}" -ne 0 ] && execute try_patches.sh "binutils" "${BINUTILS_SRC}" "${VAX_PATCHES_PATH}" [ "${DO_PATCHES_GCC}" -ne 0 ] && execute try_patches.sh "gcc" "${GCC_SRC}" "${VAX_PATCHES_PATH}" -[ "${DO_PATCHES_GLIBC}" -ne 0 ] && execute try_patches.sh "glibc" "${GLIBC_SRC}" "${VAX_PATCHES_PATH}" [ "${DO_PATCHES_PORTS}" -ne 0 ] && execute try_patches.sh "ports" "${GLIBC_SRC}" "${VAX_PATCHES_PATH}" +[ "${DO_PATCHES_GLIBC}" -ne 0 ] && execute try_patches.sh "glibc" "${GLIBC_SRC}" "${VAX_PATCHES_PATH}" [ "${DO_PATCHES_UCLIBC}" -ne 0 ] && execute try_patches.sh "uclibc" "${UCLIBC_SRC}" "${VAX_PATCHES_PATH}" @@ -563,58 +572,66 @@ popd # +# Hash again +# +hash -r + +# # Configure the kernel. We need prepared kernel headers. # pushd "${LINUX_SRC}" - make ARCH="${KERNEL_ARCH}" CROSS_COMPILE="${TARGET}-" defconfig - make ARCH="${KERNEL_ARCH}" CROSS_COMPILE="${TARGET}-" prepare + execute make ARCH="${KERNEL_ARCH}" CROSS_COMPILE="${TARGET}-" defconfig + execute make ARCH="${KERNEL_ARCH}" CROSS_COMPILE="${TARGET}-" prepare popd # # Build uClibc # -pushd "${UCLIBC_SRC}" # Yes, we build within the source dir... - # Configure - # RUNTIME_PREFIX="/usr/$(TARGET_ARCH)-linux-uclibc/" - # DEVEL_PREFIX="/usr/$(TARGET_ARCH)-linux-uclibc/usr/" - echo "KERNEL_SOURCE=\"${LINUX_SRC}\"" >> .config - # echo "DEVEL_PREFIX=\"${INSTALL_BASE}/usr/\"" >> .config - echo "DEVEL_PREFIX=\"${INSTALL_BASE}/usr/${TARGET}/lib\"" >> .config - echo "RUNTIME_PREFIX=\"${INSTALL_BASE}/runtime-prefix/\"" +if build "${BUILD_UCLIBC}"; then + pushd "${UCLIBC_SRC}" # Yes, we build within the source dir... + # Configure + # RUNTIME_PREFIX="/usr/$(TARGET_ARCH)-linux-uclibc/" + # DEVEL_PREFIX="/usr/$(TARGET_ARCH)-linux-uclibc/usr/" + echo "KERNEL_SOURCE=\"${LINUX_SRC}\"" >> .config + # echo "DEVEL_PREFIX=\"${INSTALL_BASE}/usr/\"" >> .config + echo "DEVEL_PREFIX=\"${INSTALL_BASE}/usr/${TARGET}/lib\"" >> .config + echo "RUNTIME_PREFIX=\"${INSTALL_BASE}/runtime-prefix/\"" - # Prepare - build "${BUILD_UCLIBC}" && execute ./extra/scripts/create_makefiles.sh - build "${BUILD_UCLIBC}" && (yes "" | execute make oldconfig;) + # Prepare + build "${BUILD_UCLIBC}" && execute ./extra/scripts/create_makefiles.sh + build "${BUILD_UCLIBC}" && (yes "" | execute make oldconfig;) - # Build - build "${BUILD_GCC1}" && execute make ${MAKEFLAGS} + # Build + # build "${BUILD_GCC1}" && (yes "" | execute make ${MAKEFLAGS};) + build "${BUILD_GCC1}" && execute make ${MAKEFLAGS} - # Install - build "${BUILD_GCC1}" && execute make install - build "${BUILD_GCC1}" && execute make DEVEL_PREFIX="${INSTALL_NATIVE_BASE}/usr/${TARGET}/" install + # Install + build "${BUILD_GCC1}" && execute make install + build "${BUILD_GCC1}" && execute make DEVEL_PREFIX="${INSTALL_NATIVE_BASE}/usr/${TARGET}/" install - case "${TARGET}" in - vax-*) - pushd "${UCLIBC_SRC}/libm-vax" - execute make TARGET="${TARGET}-" libm.a - execute cp "${INSTALL_BASE}/usr/${TARGET}/lib/lib/libm.a" \ - "${INSTALL_BASE}/usr/${TARGET}/lib/lib/libm-uClibc.a" - execute cp libm.a "${INSTALL_BASE}/usr/${TARGET}/lib/lib/" - popd - ;; - *) - :;; - esac + case "${TARGET}" in + vax-*) + pushd "${UCLIBC_SRC}/libm-vax" + execute make TARGET="${TARGET}-" libm.a + execute cp "${INSTALL_BASE}/usr/${TARGET}/lib/lib/libm.a" \ + "${INSTALL_BASE}/usr/${TARGET}/lib/lib/libm-uClibc.a" + execute cp libm.a "${INSTALL_BASE}/usr/${TARGET}/lib/lib/" + popd + ;; + *) + :;; + esac - # Fixup. Until LINK_SPEC is correct for GCC, we need to fiddle - # with library and header file location... - pushd "${INSTALL_BASE}/usr/${TARGET}/lib" - ln -s lib/* . - popd - pushd "${INSTALL_BASE}/usr/${TARGET}" - ln -s lib/include . + # Fixup. Until LINK_SPEC is correct for GCC, we need to fiddle + # with library and header file location... + pushd "${INSTALL_BASE}/usr/${TARGET}/lib" + ln -s lib/* . + popd + pushd "${INSTALL_BASE}/usr/${TARGET}" + ln -s lib/include . + popd popd -popd +fi # |