From ff1d30c4a3c619bf6e451634c35c23ffce835001 Mon Sep 17 00:00:00 2001 From: "Yann E. MORIN\"" Date: Fri, 2 May 2008 21:59:14 +0000 Subject: For tools/ and debug/ build scripts, annd a numeric prefix, so that they always get built in the same order, in case of library dependencies. /trunk/scripts/build/debug.sh | 2 1 1 0 +- /trunk/scripts/build/tools.sh | 2 1 1 0 +- 2 files changed, 2 insertions(+), 2 deletions(-) --- scripts/build/tools/000-template.sh | 50 ++++++++++++++++++ scripts/build/tools/100-libelf.sh | 48 +++++++++++++++++ scripts/build/tools/200-sstrip.sh | 100 ++++++++++++++++++++++++++++++++++++ scripts/build/tools/libelf.sh | 48 ----------------- scripts/build/tools/sstrip.sh | 100 ------------------------------------ scripts/build/tools/template.sh | 50 ------------------ 6 files changed, 198 insertions(+), 198 deletions(-) create mode 100644 scripts/build/tools/000-template.sh create mode 100644 scripts/build/tools/100-libelf.sh create mode 100644 scripts/build/tools/200-sstrip.sh delete mode 100644 scripts/build/tools/libelf.sh delete mode 100644 scripts/build/tools/sstrip.sh delete mode 100644 scripts/build/tools/template.sh (limited to 'scripts/build/tools') diff --git a/scripts/build/tools/000-template.sh b/scripts/build/tools/000-template.sh new file mode 100644 index 00000000..7440c1a6 --- /dev/null +++ b/scripts/build/tools/000-template.sh @@ -0,0 +1,50 @@ +# Template file for a tool utility + +# Check here wether your tool is enabled or not. +# This will get redefined over and over again for each tool, so don't +# count on it in the functions below. +is_enabled="${CT_FOOBAR}" + +# Small function to print the filename +# Note that this function gets redefined over and over again for each tool. +# It's of no use when building the toolchain proper, but shows all its +# usefullness when saving the toolchain and building the tarball. +# You shall not echo anything if you're not enabled! +# Echo the name of the file, without the extension, below. +do_print_filename() { + # For example: + # [ "{CT_FOOBAR}" = "y" ] || return 0 + # echo "foobar-${CT_FOOBAR_VERSION}" + : +} + +# Put your download code here +do_tools_foobar_get() { + # For example: + # CT_GetFile "foobar-${CT_FOOBAR_VERSION}" http://foobar.com/releases/ + : +} + +# Put your extract code here +do_tools_foobar_extract() { + # For example: + # CT_ExtractAndPatch "foobar-${CT_FOOBAR_VERSION}" + : +} + +# Put your build code here +do_tools_foobar_build() { + # For example: + # mkdir -p "${CT_BUILD_DIR}/build-foobar" + # CT_Pushd "${CT_BUILD_DIR}/build-foobar" + # "${CT_SRC_DIR}/foobar-${CT_FOOBAR_VERSION}/configure" \ + # --build=${CT_BUILD} \ + # --host=${CT_TARGET} \ + # --prefix=/usr \ + # --foobar-options + # make + # make DESTDIR="${CT_SYSROOT_DIR}" install + # CT_Popd + : +} + diff --git a/scripts/build/tools/100-libelf.sh b/scripts/build/tools/100-libelf.sh new file mode 100644 index 00000000..5bb1d7ba --- /dev/null +++ b/scripts/build/tools/100-libelf.sh @@ -0,0 +1,48 @@ +# Build script for libelf + +is_enabled="${CT_LIBELF}" + +do_print_filename() { + [ "{CT_LIBELF}" = "y" ] || return 0 + echo "libelf-${CT_LIBELF_VERSION}" +} + +do_tools_libelf_get() { + # The server hosting libelf will return an "HTTP 300 : Multiple Choices" + # error code if we try to download a file that does not exists there. + # So we have to request the file with an explicit extension. + CT_GetFile "libelf-${CT_LIBELF_VERSION}" .tar.gz http://www.mr511.de/software/ +} + +do_tools_libelf_extract() { + CT_ExtractAndPatch "libelf-${CT_LIBELF_VERSION}" +} + +do_tools_libelf_build() { + CT_DoStep INFO "Installing libelf" + mkdir -p "${CT_BUILD_DIR}/build-libelf" + CT_Pushd "${CT_BUILD_DIR}/build-libelf" + + CT_DoLog EXTRA "Configuring libelf" + CC="${CT_TARGET}-gcc" \ + "${CT_SRC_DIR}/libelf-${CT_LIBELF_VERSION}/configure" \ + --build=${CT_BUILD} \ + --host=${CT_TARGET} \ + --target=${CT_TARGET} \ + --prefix=/usr \ + --enable-compat \ + --enable-elf64 \ + --enable-shared \ + --enable-extended-format \ + --enable-static 2>&1 |CT_DoLog ALL + + CT_DoLog EXTRA "Building libelf" + make 2>&1 |CT_DoLog ALL + + CT_DoLog EXTRA "Installing libelf" + make instroot="${CT_SYSROOT_DIR}" install 2>&1 |CT_DoLog ALL + + CT_Popd + CT_EndStep +} + diff --git a/scripts/build/tools/200-sstrip.sh b/scripts/build/tools/200-sstrip.sh new file mode 100644 index 00000000..5afdcb07 --- /dev/null +++ b/scripts/build/tools/200-sstrip.sh @@ -0,0 +1,100 @@ +# This will build and install sstrip to run on host and sstrip target files + +is_enabled="${CT_SSTRIP}" + +case "${CT_SSTRIP_FROM}" in + ELFkickers) + do_print_filename() { + echo "ELFkickers-${CT_SSTRIP_ELFKICKERS_VERSION}" + } + do_tools_sstrip_get() { + CT_GetFile "ELFkickers-${CT_SSTRIP_ELFKICKERS_VERSION}" \ + http://www.muppetlabs.com/~breadbox/pub/software + } + do_tools_sstrip_extract() { + CT_ExtractAndPatch "ELFkickers-${CT_SSTRIP_ELFKICKERS_VERSION}" + } + do_tools_sstrip_build() { + CT_DoStep INFO "Installing sstrip" + mkdir -p "${CT_BUILD_DIR}/build-strip" + cd "${CT_BUILD_DIR}/build-strip" + ( cd "${CT_SRC_DIR}/ELFkickers-${CT_SSTRIP_ELFKICKERS_VERSION}/sstrip"; tar cf - . ) |tar xf - + + CT_DoLog EXTRA "Building sstrip" + make CC="${CT_CC_NATIVE}" sstrip 2>&1 |CT_DoLog ALL + + CT_DoLog EXTRA "Installing sstrip" + install -m 755 sstrip "${CT_PREFIX_DIR}/bin/${CT_TARGET}-sstrip" 2>&1 |CT_DoLog ALL + + CT_EndStep + } + ;; + + buildroot) + sstrip_url='http://buildroot.uclibc.org/cgi-bin/viewcvs.cgi/trunk/buildroot/toolchain/sstrip/sstrip.c' + do_print_filename() { + echo "sstrip.c" + } + do_tools_sstrip_get() { + # With this one, we must handle the download by ourselves, + # we can't leave the job to the classic CT_GetFile. + if [ -f "${CT_TARBALLS_DIR}/sstrip.c" ]; then + return 0 + fi + if [ -f "${CT_LOCAL_TARBALLS_DIR}/sstrip.c" ]; then + CT_DoLog EXTRA "Using \"sstrip\" from local storage" + ln -sf "${CT_LOCAL_TARBALLS_DIR}/sstrip.c" \ + "${CT_TARBALLS_DIR}/sstrip.c" 2>&1 |CT_DoLog ALL + return 0 + fi + CT_Pushd "${CT_TARBALLS_DIR}" + CT_DoLog EXTRA "Retrieving \"sstrip\" from network" + http_data=`lynx -dump "${sstrip_url}"` + link=`echo -en "${http_data}" \ + |egrep '\[[[:digit:]]+\]download' \ + |sed -r -e 's/.*\[([[:digit:]]+)\]download.*/\1/;'` + rev_url=`echo -en "${http_data}" \ + |egrep '^ *8\.' \ + |sed -r -e 's/^ *'${link}'\. +(.+)$/\1/;'` + CT_DoGetFile "${rev_url}" 2>&1 |CT_DoLog ALL + mv -v sstrip.c?* sstrip.c 2>&1 |CT_DoLog DEBUG + if [ "${CT_SAVE_TARBALLS}" = "y" ]; then + CT_DoLog EXTRA "Saving \"sstrip.c\" to local storage" + cp -v sstrip.c "${CT_LOCAL_TARBALLS_DIR}" 2>&1 |CT_DoLog DEBUG + fi + CT_Popd + } + do_tools_sstrip_extract() { + # We'll let buildroot guys take care of sstrip maintenance and patching. + mkdir -p "${CT_SRC_DIR}/sstrip" + cp -v "${CT_TARBALLS_DIR}/sstrip.c" "${CT_SRC_DIR}/sstrip" |CT_DoLog ALL + } + do_tools_sstrip_build() { + CT_DoStep INFO "Installing sstrip" + mkdir -p "${CT_BUILD_DIR}/build-sstrip" + cd "${CT_BUILD_DIR}/build-sstrip" + + CT_DoLog EXTRA "Building sstrip" + ${CT_CC_NATIVE} -Wall -o sstrip "${CT_SRC_DIR}/sstrip/sstrip.c" 2>&1 |CT_DoLog ALL + + CT_DoLog EXTRA "Installing sstrip" + install -m 755 sstrip "${CT_PREFIX_DIR}/bin/${CT_TARGET}-sstrip" 2>&1 |CT_DoLog ALL + + CT_EndStep + } + ;; + + *) do_print_filename() { + : + } + do_tools_sstrip_get() { + : + } + do_tools_sstrip_extract() { + : + } + do_tools_sstrip_build() { + : + } + ;; +esac diff --git a/scripts/build/tools/libelf.sh b/scripts/build/tools/libelf.sh deleted file mode 100644 index 5bb1d7ba..00000000 --- a/scripts/build/tools/libelf.sh +++ /dev/null @@ -1,48 +0,0 @@ -# Build script for libelf - -is_enabled="${CT_LIBELF}" - -do_print_filename() { - [ "{CT_LIBELF}" = "y" ] || return 0 - echo "libelf-${CT_LIBELF_VERSION}" -} - -do_tools_libelf_get() { - # The server hosting libelf will return an "HTTP 300 : Multiple Choices" - # error code if we try to download a file that does not exists there. - # So we have to request the file with an explicit extension. - CT_GetFile "libelf-${CT_LIBELF_VERSION}" .tar.gz http://www.mr511.de/software/ -} - -do_tools_libelf_extract() { - CT_ExtractAndPatch "libelf-${CT_LIBELF_VERSION}" -} - -do_tools_libelf_build() { - CT_DoStep INFO "Installing libelf" - mkdir -p "${CT_BUILD_DIR}/build-libelf" - CT_Pushd "${CT_BUILD_DIR}/build-libelf" - - CT_DoLog EXTRA "Configuring libelf" - CC="${CT_TARGET}-gcc" \ - "${CT_SRC_DIR}/libelf-${CT_LIBELF_VERSION}/configure" \ - --build=${CT_BUILD} \ - --host=${CT_TARGET} \ - --target=${CT_TARGET} \ - --prefix=/usr \ - --enable-compat \ - --enable-elf64 \ - --enable-shared \ - --enable-extended-format \ - --enable-static 2>&1 |CT_DoLog ALL - - CT_DoLog EXTRA "Building libelf" - make 2>&1 |CT_DoLog ALL - - CT_DoLog EXTRA "Installing libelf" - make instroot="${CT_SYSROOT_DIR}" install 2>&1 |CT_DoLog ALL - - CT_Popd - CT_EndStep -} - diff --git a/scripts/build/tools/sstrip.sh b/scripts/build/tools/sstrip.sh deleted file mode 100644 index 5afdcb07..00000000 --- a/scripts/build/tools/sstrip.sh +++ /dev/null @@ -1,100 +0,0 @@ -# This will build and install sstrip to run on host and sstrip target files - -is_enabled="${CT_SSTRIP}" - -case "${CT_SSTRIP_FROM}" in - ELFkickers) - do_print_filename() { - echo "ELFkickers-${CT_SSTRIP_ELFKICKERS_VERSION}" - } - do_tools_sstrip_get() { - CT_GetFile "ELFkickers-${CT_SSTRIP_ELFKICKERS_VERSION}" \ - http://www.muppetlabs.com/~breadbox/pub/software - } - do_tools_sstrip_extract() { - CT_ExtractAndPatch "ELFkickers-${CT_SSTRIP_ELFKICKERS_VERSION}" - } - do_tools_sstrip_build() { - CT_DoStep INFO "Installing sstrip" - mkdir -p "${CT_BUILD_DIR}/build-strip" - cd "${CT_BUILD_DIR}/build-strip" - ( cd "${CT_SRC_DIR}/ELFkickers-${CT_SSTRIP_ELFKICKERS_VERSION}/sstrip"; tar cf - . ) |tar xf - - - CT_DoLog EXTRA "Building sstrip" - make CC="${CT_CC_NATIVE}" sstrip 2>&1 |CT_DoLog ALL - - CT_DoLog EXTRA "Installing sstrip" - install -m 755 sstrip "${CT_PREFIX_DIR}/bin/${CT_TARGET}-sstrip" 2>&1 |CT_DoLog ALL - - CT_EndStep - } - ;; - - buildroot) - sstrip_url='http://buildroot.uclibc.org/cgi-bin/viewcvs.cgi/trunk/buildroot/toolchain/sstrip/sstrip.c' - do_print_filename() { - echo "sstrip.c" - } - do_tools_sstrip_get() { - # With this one, we must handle the download by ourselves, - # we can't leave the job to the classic CT_GetFile. - if [ -f "${CT_TARBALLS_DIR}/sstrip.c" ]; then - return 0 - fi - if [ -f "${CT_LOCAL_TARBALLS_DIR}/sstrip.c" ]; then - CT_DoLog EXTRA "Using \"sstrip\" from local storage" - ln -sf "${CT_LOCAL_TARBALLS_DIR}/sstrip.c" \ - "${CT_TARBALLS_DIR}/sstrip.c" 2>&1 |CT_DoLog ALL - return 0 - fi - CT_Pushd "${CT_TARBALLS_DIR}" - CT_DoLog EXTRA "Retrieving \"sstrip\" from network" - http_data=`lynx -dump "${sstrip_url}"` - link=`echo -en "${http_data}" \ - |egrep '\[[[:digit:]]+\]download' \ - |sed -r -e 's/.*\[([[:digit:]]+)\]download.*/\1/;'` - rev_url=`echo -en "${http_data}" \ - |egrep '^ *8\.' \ - |sed -r -e 's/^ *'${link}'\. +(.+)$/\1/;'` - CT_DoGetFile "${rev_url}" 2>&1 |CT_DoLog ALL - mv -v sstrip.c?* sstrip.c 2>&1 |CT_DoLog DEBUG - if [ "${CT_SAVE_TARBALLS}" = "y" ]; then - CT_DoLog EXTRA "Saving \"sstrip.c\" to local storage" - cp -v sstrip.c "${CT_LOCAL_TARBALLS_DIR}" 2>&1 |CT_DoLog DEBUG - fi - CT_Popd - } - do_tools_sstrip_extract() { - # We'll let buildroot guys take care of sstrip maintenance and patching. - mkdir -p "${CT_SRC_DIR}/sstrip" - cp -v "${CT_TARBALLS_DIR}/sstrip.c" "${CT_SRC_DIR}/sstrip" |CT_DoLog ALL - } - do_tools_sstrip_build() { - CT_DoStep INFO "Installing sstrip" - mkdir -p "${CT_BUILD_DIR}/build-sstrip" - cd "${CT_BUILD_DIR}/build-sstrip" - - CT_DoLog EXTRA "Building sstrip" - ${CT_CC_NATIVE} -Wall -o sstrip "${CT_SRC_DIR}/sstrip/sstrip.c" 2>&1 |CT_DoLog ALL - - CT_DoLog EXTRA "Installing sstrip" - install -m 755 sstrip "${CT_PREFIX_DIR}/bin/${CT_TARGET}-sstrip" 2>&1 |CT_DoLog ALL - - CT_EndStep - } - ;; - - *) do_print_filename() { - : - } - do_tools_sstrip_get() { - : - } - do_tools_sstrip_extract() { - : - } - do_tools_sstrip_build() { - : - } - ;; -esac diff --git a/scripts/build/tools/template.sh b/scripts/build/tools/template.sh deleted file mode 100644 index 7440c1a6..00000000 --- a/scripts/build/tools/template.sh +++ /dev/null @@ -1,50 +0,0 @@ -# Template file for a tool utility - -# Check here wether your tool is enabled or not. -# This will get redefined over and over again for each tool, so don't -# count on it in the functions below. -is_enabled="${CT_FOOBAR}" - -# Small function to print the filename -# Note that this function gets redefined over and over again for each tool. -# It's of no use when building the toolchain proper, but shows all its -# usefullness when saving the toolchain and building the tarball. -# You shall not echo anything if you're not enabled! -# Echo the name of the file, without the extension, below. -do_print_filename() { - # For example: - # [ "{CT_FOOBAR}" = "y" ] || return 0 - # echo "foobar-${CT_FOOBAR_VERSION}" - : -} - -# Put your download code here -do_tools_foobar_get() { - # For example: - # CT_GetFile "foobar-${CT_FOOBAR_VERSION}" http://foobar.com/releases/ - : -} - -# Put your extract code here -do_tools_foobar_extract() { - # For example: - # CT_ExtractAndPatch "foobar-${CT_FOOBAR_VERSION}" - : -} - -# Put your build code here -do_tools_foobar_build() { - # For example: - # mkdir -p "${CT_BUILD_DIR}/build-foobar" - # CT_Pushd "${CT_BUILD_DIR}/build-foobar" - # "${CT_SRC_DIR}/foobar-${CT_FOOBAR_VERSION}/configure" \ - # --build=${CT_BUILD} \ - # --host=${CT_TARGET} \ - # --prefix=/usr \ - # --foobar-options - # make - # make DESTDIR="${CT_SYSROOT_DIR}" install - # CT_Popd - : -} - -- cgit v1.2.3