diff options
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/addToolVersion.sh | 9 | ||||
-rw-r--r-- | scripts/build/cc/gcc.sh | 61 | ||||
-rw-r--r-- | scripts/build/companion_libs/cloog.sh | 63 | ||||
-rw-r--r-- | scripts/build/companion_libs/gmp.sh | 19 | ||||
-rw-r--r-- | scripts/build/companion_libs/mpc.sh | 57 | ||||
-rw-r--r-- | scripts/build/companion_libs/mpfr.sh | 20 | ||||
-rw-r--r-- | scripts/build/companion_libs/ppl.sh | 17 | ||||
-rw-r--r-- | scripts/build/internals.sh | 33 | ||||
-rw-r--r-- | scripts/build/libc/glibc.sh | 25 | ||||
-rwxr-xr-x | scripts/config.guess | 61 | ||||
-rwxr-xr-x | scripts/config.sub | 15 | ||||
-rw-r--r-- | scripts/crosstool-NG.sh.in | 118 | ||||
-rw-r--r-- | scripts/functions | 32 | ||||
-rw-r--r-- | scripts/populate.in | 76 | ||||
-rw-r--r-- | scripts/saveSample.sh.in | 28 | ||||
-rwxr-xr-x | scripts/showSamples.sh | 24 | ||||
-rw-r--r-- | scripts/wrapper.in | 15 |
17 files changed, 476 insertions, 197 deletions
diff --git a/scripts/addToolVersion.sh b/scripts/addToolVersion.sh index 8e0446e..255b8fe 100755 --- a/scripts/addToolVersion.sh +++ b/scripts/addToolVersion.sh @@ -13,7 +13,7 @@ Usage: ${myname} <tool> <[options] version [...]> ... 'tool' in one of: --gcc, --binutils, --glibc, --eglibc, --uClibc, --linux, --gdb, --dmalloc, --duma, --strace, --ltrace, --libelf - --gmp, --mpfr, --ppl + --gmp, --mpfr, --ppl, --cloog Valid options for all tools: --stable, -s, +x (default) @@ -96,7 +96,11 @@ addToolVersion() { ver_m=$(echo "${version}...." |cut -d . -f 2) if [ ${ver_M} -gt 4 \ -o \( ${ver_M} -eq 4 -a ${ver_m} -ge 3 \) ]; then - SedExpr1=" select CC_GCC_4_3_or_later\n" + SedExpr1="${SedExpr1} select CC_GCC_4_3_or_later\n" + fi + if [ ${ver_M} -gt 4 \ + -o \( ${ver_M} -eq 4 -a ${ver_m} -ge 4 \) ]; then + SedExpr1="${SedExpr1} select CC_GCC_4_4_or_later\n" fi fi SedExpr2=" default \"${version}\" if ${cat}_V_${v}" @@ -134,6 +138,7 @@ while [ $# -gt 0 ]; do --gmp) EXP=; OBS=; cat=GMP; tool=gmp; tool_prefix=companion_libs;; --mpfr) EXP=; OBS=; cat=MPFR; tool=mpfr; tool_prefix=companion_libs;; --ppl) EXP=; OBS=; cat=PPL; tool=ppl; tool_prefix=companion_libs;; + --cloog) EXP=; OBS=; cat=CLOOG; tool=cloog; tool_prefix=companion_libs;; # Tools options: -x|--experimental|+s) EXP=1;; diff --git a/scripts/build/cc/gcc.sh b/scripts/build/cc/gcc.sh index c7e1712..e1f5d25 100644 --- a/scripts/build/cc/gcc.sh +++ b/scripts/build/cc/gcc.sh @@ -4,18 +4,16 @@ # Download gcc do_cc_get() { - local version="${CT_CC_VERSION}${CT_CC_GCC_4_4_snapshot_date}" - # Ah! gcc folks are kind of 'different': they store the tarballs in # subdirectories of the same name! That's because gcc is such /crap/ that # it is such /big/ that it needs being splitted for distribution! Sad. :-( # Arrgghh! Some of those versions does not follow this convention: # gcc-3.3.3 lives in releases/gcc-3.3.3, while gcc-2.95.* isn't in a # subdirectory! You bastard! - CT_GetFile "gcc-${version}" \ - {ftp,http}://ftp.gnu.org/gnu/gcc{,{,/releases}/gcc-${version}} \ - ftp://ftp.irisa.fr/pub/mirrors/gcc.gnu.org/gcc/releases/gcc-${version} \ - ftp://ftp.uvsq.fr/pub/gcc/snapshots/${version} + CT_GetFile "gcc-${CT_CC_VERSION}" \ + {ftp,http}://ftp.gnu.org/gnu/gcc{,{,/releases}/gcc-${CT_CC_VERSION}} \ + ftp://ftp.irisa.fr/pub/mirrors/gcc.gnu.org/gcc/releases/gcc-${CT_CC_VERSION} \ + ftp://ftp.uvsq.fr/pub/gcc/snapshots/${CT_CC_VERSION} # Starting with GCC 4.3, ecj is used for Java, and will only be # built if the configure script finds ecj.jar at the top of the @@ -29,22 +27,24 @@ do_cc_get() { # Extract gcc do_cc_extract() { - local version="${CT_CC_VERSION}${CT_CC_GCC_4_4_snapshot_date}" - - CT_Extract "gcc-${version}" - CT_Patch "gcc-${version}" + CT_Extract "gcc-${CT_CC_VERSION}" + CT_Patch "gcc-${CT_CC_VERSION}" # Copy ecj-latest.jar to ecj.jar at the top of the GCC source tree - if [ "${CT_CC_LANG_JAVA_USE_ECJ}" = "y" \ - -a ! -f "${CT_SRC_DIR}/gcc-${version}/ecj.jar" \ + if [ "${CT_CC_LANG_JAVA_USE_ECJ}" = "y" \ + -a ! -f "${CT_SRC_DIR}/gcc-${CT_CC_VERSION}/ecj.jar" \ ]; then - CT_DoExecLog ALL cp -v "${CT_TARBALLS_DIR}/ecj-latest.jar" "${CT_SRC_DIR}/gcc-${version}/ecj.jar" + CT_DoExecLog ALL cp -v "${CT_TARBALLS_DIR}/ecj-latest.jar" "${CT_SRC_DIR}/gcc-${CT_CC_VERSION}/ecj.jar" fi } #------------------------------------------------------------------------------ # Core gcc pass 1 do_cc_core_pass_1() { + # If we're building a canadian compiler no use to build the CC + # core compiler, we're not using it + [ -n "${CT_CANADIAN}" ] && return 0 + # If we're building for bare metal, build the static core gcc, # with libgcc. # In case we're not bare metal, and we're NPTL, build the static core gcc. @@ -58,6 +58,10 @@ do_cc_core_pass_1() { # Core gcc pass 2 do_cc_core_pass_2() { + # If we're building a canadian compiler no use to build the CC + # core compiler, we're not using it + [ -n "${CT_CANADIAN}" ] && return 0 + # In case we're building for bare metal, do nothing, we already have # our compiler. # In case we're NPTL, build the shared core gcc and the target libgcc. @@ -90,7 +94,6 @@ do_cc_core() { local core_prefix_dir local extra_config local lang_opt - local version="${CT_CC_VERSION}${CT_CC_GCC_4_4_snapshot_date}" eval $1 eval $2 @@ -137,12 +140,20 @@ do_cc_core() { extra_config="${extra_config} ${CT_ARCH_WITH_TUNE}" extra_config="${extra_config} ${CT_ARCH_WITH_FPU}" extra_config="${extra_config} ${CT_ARCH_WITH_FLOAT}" - [ "${CT_GMP_MPFR}" = "y" ] && extra_config="${extra_config} --with-gmp=${CT_PREFIX_DIR} --with-mpfr=${CT_PREFIX_DIR}" if [ "${CT_CC_CXA_ATEXIT}" = "y" ]; then extra_config="${extra_config} --enable-__cxa_atexit" else extra_config="${extra_config} --disable-__cxa_atexit" fi + if [ "${CT_GMP_MPFR}" = "y" ]; then + extra_config="${extra_config} --with-gmp=${CT_PREFIX_DIR}" + extra_config="${extra_config} --with-mpfr=${CT_PREFIX_DIR}" + fi + if [ "${CT_PPL_CLOOG_MPC}" = "y" ]; then + extra_config="${extra_config} --with-ppl=${CT_PREFIX_DIR}" + extra_config="${extra_config} --with-cloog=${CT_PREFIX_DIR}" + extra_config="${extra_config} --with-mpc=${CT_PREFIX_DIR}" + fi CT_DoLog DEBUG "Extra config passed: '${extra_config}'" @@ -150,7 +161,7 @@ do_cc_core() { CC_FOR_BUILD="${CT_BUILD}-gcc" \ CFLAGS="${CT_CFLAGS_FOR_HOST}" \ CT_DoExecLog ALL \ - "${CT_SRC_DIR}/gcc-${version}/configure" \ + "${CT_SRC_DIR}/gcc-${CT_CC_VERSION}/configure" \ --build=${CT_BUILD} \ --host=${CT_HOST} \ --target=${CT_TARGET} \ @@ -182,7 +193,7 @@ do_cc_core() { # so we configure then build it. # Next we have to configure gcc, create libgcc.mk then edit it... # So much easier if we just edit the source tree, but hey... - if [ ! -f "${CT_SRC_DIR}/gcc-${version}/gcc/BASE-VER" ]; then + if [ ! -f "${CT_SRC_DIR}/gcc-${CT_CC_VERSION}/gcc/BASE-VER" ]; then CT_DoExecLog ALL make configure-libiberty CT_DoExecLog ALL make ${PARALLELMFLAGS} -C libiberty libiberty.a CT_DoExecLog ALL make configure-gcc configure-libcpp @@ -192,7 +203,7 @@ do_cc_core() { CT_DoExecLog ALL make ${PARALLELMFLAGS} all-libcpp all-build-libiberty fi # HACK: gcc-4.2 uses libdecnumber to build libgcc.mk, so build it here. - if [ -d "${CT_SRC_DIR}/gcc-${version}/libdecnumber" ]; then + if [ -d "${CT_SRC_DIR}/gcc-${CT_CC_VERSION}/libdecnumber" ]; then CT_DoExecLog ALL make configure-libdecnumber CT_DoExecLog ALL make ${PARALLELMFLAGS} -C libdecnumber libdecnumber.a fi @@ -238,8 +249,6 @@ do_cc_core() { #------------------------------------------------------------------------------ # Build final gcc do_cc() { - local version="${CT_CC_VERSION}${CT_CC_GCC_4_4_snapshot_date}" - # If building for bare metal, nothing to be done here, the static core conpiler is enough! [ "${CT_BARE_METAL}" = "y" ] && return 0 @@ -273,7 +282,6 @@ do_cc() { extra_config="${extra_config} ${CT_ARCH_WITH_FPU}" extra_config="${extra_config} ${CT_ARCH_WITH_FLOAT}" [ "${CT_SHARED_LIBS}" = "y" ] || extra_config="${extra_config} --disable-shared" - [ "${CT_GMP_MPFR}" = "y" ] && extra_config="${extra_config} --with-gmp=${CT_PREFIX_DIR} --with-mpfr=${CT_PREFIX_DIR}" [ -n "${CT_CC_PKGVERSION}" ] && extra_config="${extra_config} --with-pkgversion=${CT_CC_PKGVERSION}" [ -n "${CT_CC_BUGURL}" ] && extra_config="${extra_config} --with-bugurl=${CT_CC_BUGURL}" [ "${CT_CC_SJLJ_EXCEPTIONS_USE}" = "y" ] && extra_config="${extra_config} --enable-sjlj-exceptions" @@ -283,6 +291,15 @@ do_cc() { else extra_config="${extra_config} --disable-__cxa_atexit" fi + if [ "${CT_GMP_MPFR}" = "y" ]; then + extra_config="${extra_config} --with-gmp=${CT_PREFIX_DIR}" + extra_config="${extra_config} --with-mpfr=${CT_PREFIX_DIR}" + fi + if [ "${CT_PPL_CLOOG_MPC}" = "y" ]; then + extra_config="${extra_config} --with-ppl=${CT_PREFIX_DIR}" + extra_config="${extra_config} --with-cloog=${CT_PREFIX_DIR}" + extra_config="${extra_config} --with-mpc=${CT_PREFIX_DIR}" + fi CT_DoLog DEBUG "Extra config passed: '${extra_config}'" @@ -296,7 +313,7 @@ do_cc() { CXXFLAGS_FOR_TARGET="${CT_TARGET_CFLAGS}" \ LDFLAGS_FOR_TARGET="${CT_TARGET_LDFLAGS}" \ CT_DoExecLog ALL \ - "${CT_SRC_DIR}/gcc-${version}/configure" \ + "${CT_SRC_DIR}/gcc-${CT_CC_VERSION}/configure" \ --build=${CT_BUILD} \ --host=${CT_HOST} \ --target=${CT_TARGET} \ diff --git a/scripts/build/companion_libs/cloog.sh b/scripts/build/companion_libs/cloog.sh new file mode 100644 index 0000000..0e6d74f --- /dev/null +++ b/scripts/build/companion_libs/cloog.sh @@ -0,0 +1,63 @@ +# This file adds the functions to build the CLooG library +# Copyright 2009 Yann E. MORIN +# Licensed under the GPL v2. See COPYING in the root of this package + +do_cloog_get() { :; } +do_cloog_extract() { :; } +do_cloog() { :; } +do_cloog_target() { :; } + +# Overide functions depending on configuration +if [ "${CT_PPL_CLOOG_MPC}" = "y" ]; then + +# Download CLooG +do_cloog_get() { + CT_GetFile "cloog-ppl-${CT_CLOOG_VERSION}" \ + ftp://gcc.gnu.org/pub/gcc/infrastructure +} + +# Extract CLooG +do_cloog_extract() { + CT_Extract "cloog-ppl-${CT_CLOOG_VERSION}" + CT_Pushd "${CT_SRC_DIR}/cloog-ppl" + CT_Patch "cloog-ppl-${CT_CLOOG_VERSION}" nochdir + CT_Popd +} + +do_cloog() { + mkdir -p "${CT_BUILD_DIR}/build-cloog-ppl" + cd "${CT_BUILD_DIR}/build-cloog-ppl" + + CT_DoStep INFO "Installing CLooG/ppl" + + CT_DoLog EXTRA "Configuring CLooG/ppl" + CFLAGS="${CT_CFLAGS_FOR_HOST}" \ + CT_DoExecLog ALL \ + "${CT_SRC_DIR}/cloog-ppl/configure" \ + --build=${CT_BUILD} \ + --host=${CT_HOST} \ + --prefix="${CT_PREFIX_DIR}" \ + --with-gmp="${CT_PREFIX_DIR}" \ + --with-ppl="${CT_PREFIX_DIR}" \ + --enable-shared \ + --disable-static \ + --with-bits=gmp + + CT_DoLog EXTRA "Building CLooG/ppl" + CT_DoExecLog ALL make ${PARALLELMFLAGS} + + if [ "${CT_COMP_LIBS_CHECK}" = "y" ]; then + CT_DoLog EXTRA "Checking CLooG/ppl" + CT_DoExecLog ALL make ${PARALLELMFLAGS} -s check + fi + + CT_DoLog EXTRA "Installing CLooG/ppl" + CT_DoExecLog ALL make install + + # Remove spuriously installed file + CT_DoExecLog ALL rm -f "${CT_PREFIX_DIR}/bin/cloog" + + CT_EndStep +} + +fi # CT_PPL_CLOOG_MPC diff --git a/scripts/build/companion_libs/gmp.sh b/scripts/build/companion_libs/gmp.sh index a3dd4a0..6371b45 100644 --- a/scripts/build/companion_libs/gmp.sh +++ b/scripts/build/companion_libs/gmp.sh @@ -22,8 +22,6 @@ do_gmp_extract() { } do_gmp() { - local opts - local cflags mkdir -p "${CT_BUILD_DIR}/build-gmp" cd "${CT_BUILD_DIR}/build-gmp" @@ -32,27 +30,22 @@ do_gmp() { CT_DoLog EXTRA "Configuring GMP" - if [ "${CT_PPL_CLOOG}" = "y" ]; then - opts="--enable-cxx" - cflags="-fexceptions" - fi - - CFLAGS="${CT_CFLAGS_FOR_HOST} ${cflags}" \ + CFLAGS="${CT_CFLAGS_FOR_HOST} -fexceptions" \ CT_DoExecLog ALL \ "${CT_SRC_DIR}/gmp-${CT_GMP_VERSION}/configure" \ --build=${CT_BUILD} \ --host=${CT_HOST} \ --prefix="${CT_PREFIX_DIR}" \ - --disable-shared \ - --enable-static \ + --enable-shared \ + --disable-static \ --enable-fft \ --enable-mpbsd \ - ${opts} + --enable-cxx CT_DoLog EXTRA "Building GMP" CT_DoExecLog ALL make ${PARALLELMFLAGS} - if [ "${CT_GMP_CHECK}" = "y" ]; then + if [ "${CT_COMP_LIBS_CHECK}" = "y" ]; then CT_DoLog EXTRA "Checking GMP" CT_DoExecLog ALL make ${PARALLELMFLAGS} -s check fi @@ -63,7 +56,7 @@ do_gmp() { CT_EndStep } -if [ "${CT_GMP_MPFR_TARGET}" = "y" ]; then +if [ "${CT_COMP_LIBS_TARGET}" = "y" ]; then do_gmp_target() { mkdir -p "${CT_BUILD_DIR}/build-gmp-target" diff --git a/scripts/build/companion_libs/mpc.sh b/scripts/build/companion_libs/mpc.sh new file mode 100644 index 0000000..18144a0 --- /dev/null +++ b/scripts/build/companion_libs/mpc.sh @@ -0,0 +1,57 @@ +# This file adds the functions to build the MPC library +# Copyright 2009 Yann E. MORIN +# Licensed under the GPL v2. See COPYING in the root of this package + +do_mpc_get() { :; } +do_mpc_extract() { :; } +do_mpc() { :; } +do_mpc_target() { :; } + +# Overide functions depending on configuration +if [ "${CT_PPL_CLOOG_MPC}" = "y" ]; then + +# Download MPC +do_mpc_get() { + CT_GetFile "mpc-${CT_MPC_VERSION}" .tar.gz \ + http://www.multiprecision.org/mpc/download +} + +# Extract MPC +do_mpc_extract() { + CT_Extract "mpc-${CT_MPC_VERSION}" + CT_Patch "mpc-${CT_MPC_VERSION}" +} + +do_mpc() { + mkdir -p "${CT_BUILD_DIR}/build-mpc" + cd "${CT_BUILD_DIR}/build-mpc" + + CT_DoStep INFO "Installing MPC" + + CT_DoLog EXTRA "Configuring MPC" + CFLAGS="${CT_CFLAGS_FOR_HOST}" \ + CT_DoExecLog ALL \ + "${CT_SRC_DIR}/mpc-${CT_MPC_VERSION}/configure" \ + --build=${CT_BUILD} \ + --host=${CT_HOST} \ + --prefix="${CT_PREFIX_DIR}" \ + --with-gmp="${CT_PREFIX_DIR}" \ + --with-mpfr="${CT_PREFIX_DIR}" \ + --enable-shared \ + --disable-static \ + + CT_DoLog EXTRA "Building MPC" + CT_DoExecLog ALL make ${PARALLELMFLAGS} + + if [ "${CT_COMP_LIBS_CHECK}" = "y" ]; then + CT_DoLog EXTRA "Checking MPC" + CT_DoExecLog ALL make ${PARALLELMFLAGS} -s check + fi + + CT_DoLog EXTRA "Installing MPC" + CT_DoExecLog ALL make install + + CT_EndStep +} + +fi # CT_PPL_CLOOG_MPC diff --git a/scripts/build/companion_libs/mpfr.sh b/scripts/build/companion_libs/mpfr.sh index e302ff7..3c3480d 100644 --- a/scripts/build/companion_libs/mpfr.sh +++ b/scripts/build/companion_libs/mpfr.sh @@ -30,6 +30,15 @@ do_mpfr_extract() { # do that in the future... # It seems that MPFR >= 2.4.0 do not need this... case "${CT_MPFR_VERSION}" in + 2.4.1) + CT_Pushd "${CT_SRC_DIR}/mpfr-${CT_MPFR_VERSION}" + if [ ! -f .autoreconf.ct-ng ]; then + CT_DoLog DEBUG "Running autoreconf" + CT_DoExecLog ALL autoreconf + touch .autoreconf.ct-ng + fi + CT_Popd + ;; 1.*|2.0.*|2.1.*|2.2.*|2.3.*) CT_Pushd "${CT_SRC_DIR}/mpfr-${CT_MPFR_VERSION}" if [ ! -f .autotools.ct-ng ]; then @@ -64,7 +73,8 @@ do_mpfr() { mpfr_opt= # Under Cygwin, we can't build a thread-safe library case "${CT_HOST}" in - *-cygwin) mpfr_opt="--disable-thread-safe";; + *cygwin*) mpfr_opt="--disable-thread-safe";; + *mingw*) mpfr_opt="--disable-thread-safe";; *) mpfr_opt="--enable-thread-safe";; esac @@ -77,14 +87,14 @@ do_mpfr() { --host=${CT_HOST} \ --prefix="${CT_PREFIX_DIR}" \ ${mpfr_opt} \ - --disable-shared \ - --enable-static \ + --enable-shared \ + --disable-static \ --with-gmp="${CT_PREFIX_DIR}" CT_DoLog EXTRA "Building MPFR" CT_DoExecLog ALL make ${PARALLELMFLAGS} - if [ "${CT_MPFR_CHECK}" = "y" ]; then + if [ "${CT_COMP_LIBS_CHECK}" = "y" ]; then CT_DoLog EXTRA "Checking MPFR" CT_DoExecLog ALL make ${PARALLELMFLAGS} -s check fi @@ -95,7 +105,7 @@ do_mpfr() { CT_EndStep } -if [ "${CT_GMP_MPFR_TARGET}" = "y" ]; then +if [ "${CT_COMP_LIBS_TARGET}" = "y" ]; then do_mpfr_target() { mkdir -p "${CT_BUILD_DIR}/build-mpfr-target" diff --git a/scripts/build/companion_libs/ppl.sh b/scripts/build/companion_libs/ppl.sh index d3246f9..4af080b 100644 --- a/scripts/build/companion_libs/ppl.sh +++ b/scripts/build/companion_libs/ppl.sh @@ -8,13 +8,14 @@ do_ppl() { :; } do_ppl_target() { :; } # Overide functions depending on configuration -if [ "${CT_PPL_CLOOG}" = "y" ]; then +if [ "${CT_PPL_CLOOG_MPC}" = "y" ]; then # Download PPL do_ppl_get() { CT_GetFile "ppl-${CT_PPL_VERSION}" \ http://www.cs.unipr.it/ppl/Download/ftp/releases/${CT_PPL_VERSION} \ - ftp://ftp.cs.unipr.it/pub/ppl/releases/${CT_PPL_VERSION} + ftp://ftp.cs.unipr.it/pub/ppl/releases/${CT_PPL_VERSION} \ + ftp://gcc.gnu.org/pub/gcc/infrastructure } # Extract PPL @@ -31,6 +32,7 @@ do_ppl() { CT_DoLog EXTRA "Configuring PPL" CFLAGS="${CT_CFLAGS_FOR_HOST}" \ + CXXFLAGS="${CT_CFLAGS_FOR_HOST}" \ CT_DoExecLog ALL \ "${CT_SRC_DIR}/ppl-${CT_PPL_VERSION}/configure" \ --build=${CT_BUILD} \ @@ -38,8 +40,8 @@ do_ppl() { --prefix="${CT_PREFIX_DIR}" \ --with-libgmp-prefix="${CT_PREFIX_DIR}" \ --with-libgmpxx-prefix="${CT_PREFIX_DIR}" \ - --disable-shared \ - --enable-static \ + --enable-shared \ + --disable-static \ --disable-debugging \ --disable-assertions \ --disable-ppl_lcdd \ @@ -52,7 +54,7 @@ do_ppl() { CT_DoLog EXTRA "Building PPL" CT_DoExecLog ALL make ${PARALLELMFLAGS} - if [ "${CT_PPL_CHECK}" = "y" ]; then + if [ "${CT_COMP_LIBS_CHECK}" = "y" ]; then CT_DoLog EXTRA "Checking PPL" CT_DoExecLog ALL make ${PARALLELMFLAGS} -s check fi @@ -60,7 +62,10 @@ do_ppl() { CT_DoLog EXTRA "Installing PPL" CT_DoExecLog ALL make install + # Remove spuriously installed file + CT_DoExecLog ALL rm -f "${CT_PREFIX_DIR}/bin/ppl-config" + CT_EndStep } -fi # CT_PPL_CLOOG +fi # CT_PPL_CLOOG_MPC diff --git a/scripts/build/internals.sh b/scripts/build/internals.sh index acaf864..a920c50 100644 --- a/scripts/build/internals.sh +++ b/scripts/build/internals.sh @@ -4,12 +4,12 @@ # un-wanted files, to add tuple aliases, and to add the final # crosstool-NG-provided files. do_finish() { + local _t + CT_DoStep INFO "Cleaning-up the toolchain's directory" CT_DoLog EXTRA "Removing access to the build system tools" - find "${CT_PREFIX_DIR}/bin" -name "${CT_BUILD}-"'*' -exec rm -fv {} \; |CT_DoLog DEBUG - find "${CT_PREFIX_DIR}/bin" -name "${CT_HOST}-"'*' -exec rm -fv {} \; |CT_DoLog DEBUG - CT_DoExecLog DEBUG rm -fv "${CT_PREFIX_DIR}/bin/makeinfo" + CT_DoExecLog DEBUG rm -rf "${CT_PREFIX_DIR}/buildtools" if [ "${CT_BARE_METAL}" != "y" ]; then CT_DoLog EXTRA "Installing the populate helper" @@ -39,6 +39,33 @@ do_finish() { done CT_Popd + # If using the companion libraries, we need a wrapper + # that will set LD_LIBRARY_PATH approriately + if [ "${CT_GMP_MPFR}" = "y" \ + -o "${CT_PPL_CLOOG_MPC}" = "y" ]; then + CT_DoLog EXTRA "Installing toolchain wrappers" + CT_Pushd "${CT_PREFIX_DIR}/bin" + + # Copy the wrapper + CT_DoExecLog DEBUG install -m 0755 "${CT_LIB_DIR}/scripts/wrapper.in" \ + ".${CT_TARGET}-wrapper" + + # Replace every tools with the wrapper + # Do it unconditionally, even for those tools that happen to be shell + # scripts, we don't know if they would in the end spawn a binary... + # Just skip symlinks + for _t in "${CT_TARGET}-"*; do + if [ "$( LANG=C stat -c '%F' "${_t}" )" != "symbolic link" ]; then + CT_DoExecLog ALL mv "${_t}" ".${_t}" + CT_DoExecLog ALL ln ".${CT_TARGET}-wrapper" "${_t}" + fi + done + + # Get rid of the wrapper, we're using hardlinks + CT_DoExecLog DEBUG rm -f ".${CT_TARGET}-wrapper" + CT_Popd + fi + # Remove the generated documentation files if [ "${CT_REMOVE_DOCS}" = "y" ]; then CT_DoLog EXTRA "Removing installed documentation" diff --git a/scripts/build/libc/glibc.sh b/scripts/build/libc/glibc.sh index 3fcda91..9af0135 100644 --- a/scripts/build/libc/glibc.sh +++ b/scripts/build/libc/glibc.sh @@ -172,6 +172,7 @@ do_libc_headers() { CT_DoExecLog ALL \ make CFLAGS="-O -DBOOTSTRAP_GCC" \ OBJDUMP_FOR_HOST="${CT_TARGET}-objdump" \ + PARALLELMFLAGS="${PARALLELMFLAGS}" \ sysdeps/gnu/errlist.c mkdir -p stdio-common @@ -189,6 +190,7 @@ do_libc_headers() { CFLAGS="-O -DBOOTSTRAP_GCC" \ ${LIBC_SYSROOT_ARG} \ OBJDUMP_FOR_HOST="${CT_TARGET}-objdump" \ + PARALLELMFLAGS="${PARALLELMFLAGS}" \ install-headers # Two headers -- stubs.h and features.h -- aren't installed by install-headers, @@ -331,11 +333,12 @@ do_libc_start_files() { ${extra_config} \ ${CT_LIBC_GLIBC_EXTRA_CONFIG} - #TODO: should check whether slibdir has been set in configparms to */lib64 # and copy the startfiles into the appropriate libdir. CT_DoLog EXTRA "Building C library start files" - CT_DoExecLog ALL make OBJDUMP_FOR_HOST="${CT_TARGET}-objdump" csu/subdir_lib + CT_DoExecLog ALL make OBJDUMP_FOR_HOST="${CT_TARGET}-objdump" \ + PARALLELMFLAGS="${PARALLELMFLAGS}" \ + csu/subdir_lib CT_DoLog EXTRA "Installing C library start files" if [ "${CT_USE_SYSROOT}" = "y" ]; then @@ -499,18 +502,19 @@ do_libc() { # then you need to set the KERNELCONFIG variable to point to a .config file for this arch. # The following architectures are known to need kernel .config: alpha, arm, ia64, s390, sh, sparc # Note: LD and RANLIB needed by glibc-2.1.3's c_stub directory, at least on macosx - # No need for PARALLELMFLAGS here, Makefile already reads this environment variable CT_DoLog EXTRA "Building C library" CT_DoExecLog ALL make LD=${CT_TARGET}-ld \ - RANLIB=${CT_TARGET}-ranlib \ - OBJDUMP_FOR_HOST="${CT_TARGET}-objdump" \ - ASFLAGS="${GLIBC_INITIAL_BUILD_ASFLAGS}" \ - ${GLIBC_INITIAL_BUILD_RULE} + RANLIB=${CT_TARGET}-ranlib \ + OBJDUMP_FOR_HOST="${CT_TARGET}-objdump" \ + ASFLAGS="${GLIBC_INITIAL_BUILD_ASFLAGS}" \ + PARALLELMFLAGS="${PARALLELMFLAGS}" \ + ${GLIBC_INITIAL_BUILD_RULE} CT_DoLog EXTRA "Installing C library" CT_DoExecLog ALL make install_root="${CT_SYSROOT_DIR}" \ ${LIBC_SYSROOT_ARG} \ OBJDUMP_FOR_HOST="${CT_TARGET}-objdump" \ + PARALLELMFLAGS="${PARALLELMFLAGS}" \ ${GLIBC_INITIAL_INSTALL_RULE} # This doesn't seem to work when building a crosscompiler, @@ -553,7 +557,11 @@ do_libc_finish() { cd "${CT_BUILD_DIR}/build-libc" CT_DoLog EXTRA "Re-building C library" - CT_DoExecLog ALL make LD=${CT_TARGET}-ld RANLIB=${CT_TARGET}-ranlib + CT_DoExecLog ALL make LD=${CT_TARGET}-ld \ + RANLIB=${CT_TARGET}-ranlib \ + OBJDUMP_FOR_HOST="${CT_TARGET}-objdump" \ + ASFLAGS="${GLIBC_INITIAL_BUILD_ASFLAGS}" \ + PARALLELMFLAGS="${PARALLELMFLAGS}" CT_DoLog EXTRA "Installing missing C library components" # note: should do full install and then fix linker scripts, but this is faster @@ -561,6 +569,7 @@ do_libc_finish() { CT_DoExecLog ALL make install_root="${CT_SYSROOT_DIR}" \ ${LIBC_SYSROOT_ARG} \ OBJDUMP_FOR_HOST="${CT_TARGET}-objdump" \ + PARALLELMFLAGS="${PARALLELMFLAGS}" \ install-${t} done diff --git a/scripts/config.guess b/scripts/config.guess index 3eda297..e3a2116 100755 --- a/scripts/config.guess +++ b/scripts/config.guess @@ -1,10 +1,10 @@ #! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 # Free Software Foundation, Inc. -timestamp='2009-02-03' +timestamp='2009-06-10' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -170,7 +170,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ - | grep __ELF__ >/dev/null + | grep -q __ELF__ then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? @@ -324,6 +324,9 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; + s390x:SunOS:*:*) + echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; @@ -653,7 +656,7 @@ EOF # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | - grep __LP64__ >/dev/null + grep -q __LP64__ then HP_ARCH="hppa2.0w" else @@ -819,6 +822,9 @@ EOF [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; + 8664:Windows_NT:*) + echo x86_64-pc-mks + exit ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we @@ -879,40 +885,17 @@ EOF m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; - mips:Linux:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #undef CPU - #undef mips - #undef mipsel - #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) - CPU=mipsel - #else - #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) - CPU=mips - #else - CPU= - #endif - #endif -EOF - eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' - /^CPU/{ - s: ::g - p - }'`" - test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } - ;; - mips64:Linux:*:*) + mips:Linux:*:* | mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU - #undef mips64 - #undef mips64el + #undef ${UNAME_MACHINE} + #undef ${UNAME_MACHINE}el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) - CPU=mips64el + CPU=${UNAME_MACHINE}el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) - CPU=mips64 + CPU=${UNAME_MACHINE} #else CPU= #endif @@ -944,7 +927,7 @@ EOF EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac - objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null + objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} exit ;; @@ -998,14 +981,6 @@ EOF elf32-i386) TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" ;; - a.out-i386-linux) - echo "${UNAME_MACHINE}-pc-linux-gnuaout" - exit ;; - "") - # Either a pre-BFD a.out linker (linux-gnuoldld) or - # one that does not give us useful --help. - echo "${UNAME_MACHINE}-pc-linux-gnuoldld" - exit ;; esac # Determine whether the default compiler is a.out or elf eval $set_cc_for_build @@ -1071,7 +1046,7 @@ EOF i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit ;; - i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) + i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit ;; i*86:*DOS:*:*) @@ -1179,7 +1154,7 @@ EOF rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit ;; - PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) + PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit ;; SM[BE]S:UNIX_SV:*:*) diff --git a/scripts/config.sub b/scripts/config.sub index a39437d..eb0389a 100755 --- a/scripts/config.sub +++ b/scripts/config.sub @@ -1,10 +1,10 @@ #! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 # Free Software Foundation, Inc. -timestamp='2009-04-17' +timestamp='2009-06-11' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software @@ -153,6 +153,9 @@ case $os in os= basic_machine=$1 ;; + -bluegene*) + os=-cnk + ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 @@ -467,6 +470,10 @@ case $basic_machine in basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; + bluegene*) + basic_machine=powerpc-ibm + os=-cnk + ;; c90) basic_machine=c90-cray os=-unicos @@ -1260,7 +1267,7 @@ case $os in # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ - | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ + | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ | -kopensolaris* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ @@ -1613,7 +1620,7 @@ case $basic_machine in -sunos*) vendor=sun ;; - -aix*) + -cnk*|-aix*) vendor=ibm ;; -beos*) diff --git a/scripts/crosstool-NG.sh.in b/scripts/crosstool-NG.sh.in index a2032bc..ba30c4f 100644 --- a/scripts/crosstool-NG.sh.in +++ b/scripts/crosstool-NG.sh.in @@ -28,6 +28,29 @@ # Overide the locale early, in case we ever translate crosstool-NG messages [ -z "${CT_NO_OVERIDE_LC_MESSAGES}" ] && export LC_ALL=C +# Some sanity checks in the environment and needed tools +CT_DoLog INFO "Performing some trivial sanity checks" +CT_TestAndAbort "Don't set LD_LIBRARY_PATH. It screws up the build." -n "${LD_LIBRARY_PATH}" +CT_TestAndAbort "Don't set CFLAGS. It screws up the build." -n "${CFLAGS}" +CT_TestAndAbort "Don't set CXXFLAGS. It screws up the build." -n "${CXXFLAGS}" +CT_Test "GREP_OPTIONS screws up the build. Resetting." -n "${GREP_OPTIONS}" +export GREP_OPTIONS= + +# Some sanity checks on paths content +for d in \ + LOCAL_TARBALLS \ + WORK \ + PREFIX \ + INSTALL \ + ; do + eval dir="\${CT_${d}_DIR}" + case "${dir}" in + *" "*) + CT_Abort "'CT_${d}_DIR'='${dir}' contains a space in it.\nDon't use spaces in paths, it breaks things." + ;; + esac +done + # Where will we work? CT_WORK_DIR="${CT_WORK_DIR:-${CT_TOP_DIR}/targets}" CT_DoExecLog ALL mkdir -p "${CT_WORK_DIR}" @@ -37,6 +60,19 @@ CT_DoExecLog DEBUG touch "${CT_WORK_DIR}/foo" CT_TestAndAbort "Your file system in '${CT_WORK_DIR}' is *not* case-sensitive!" -f "${CT_WORK_DIR}/FOO" CT_DoExecLog DEBUG rm -f "${CT_WORK_DIR}/foo" +# What's our shell? +# Will be plain /bin/sh on most systems, except if we have /bin/ash and we +# _explictly_ required using it +case "${CT_CONFIG_SHELL}" in + sh) CT_SHELL="/bin/sh";; + ash) CT_SHELL="/bin/ash";; + bash) CT_SHELL="${BASH}";; + custom) CT_SHELL="${CT_CONFIG_SHELL_CUSTOM_PATH}";; +esac + +# Check the user is using an existing SHELL to be used by ./configure and Makefiles +CT_TestOrAbort "The CONFIG_SHELL '${CT_CONFIG_SHELL}' (${CT_SHELL}) is not valid" -f "${CT_SHELL}" -a -x "${CT_SHELL}" + # Create the bin-overide early # Contains symlinks to the tools found by ./configure # Note: CT_DoLog and CT_DoExecLog do not use any of those tool, so @@ -48,12 +84,13 @@ cat "${CT_LIB_DIR}/paths.mk" |while read trash line; do tool="${line%%=*}" path="${line#*=}" CT_DoLog DEBUG " '${tool}' -> '${path}'" - printf "#${BANG}/bin/sh\nexec '${path}' \"\${@}\"\n" >"${CT_BIN_OVERIDE_DIR}/${tool}" + printf "#${BANG}${CT_SHELL}\nexec '${path}' \"\${@}\"\n" >"${CT_BIN_OVERIDE_DIR}/${tool}" CT_DoExecLog ALL chmod 700 "${CT_BIN_OVERIDE_DIR}/${tool}" done export PATH="${CT_BIN_OVERIDE_DIR}:${PATH}" # Start date. Can't be done until we know the locale +# Also requires the bin-override tools CT_STAR_DATE=$(CT_DoDate +%s%N) CT_STAR_DATE_HUMAN=$(CT_DoDate +%Y%m%d.%H%M%S) @@ -67,20 +104,10 @@ CT_DoStep DEBUG "Dumping user-supplied crosstool-NG configuration" CT_DoExecLog DEBUG grep -E '^(# |)CT_' .config CT_EndStep -# Some sanity checks in the environment and needed tools -CT_DoLog INFO "Checking environment sanity" - CT_DoLog DEBUG "Unsetting and unexporting MAKEFLAGS" unset MAKEFLAGS export MAKEFLAGS -# Other environment sanity checks -CT_TestAndAbort "Don't set LD_LIBRARY_PATH. It screws up the build." -n "${LD_LIBRARY_PATH}" -CT_TestAndAbort "Don't set CFLAGS. It screws up the build." -n "${CFLAGS}" -CT_TestAndAbort "Don't set CXXFLAGS. It screws up the build." -n "${CXXFLAGS}" -CT_Test "GREP_OPTIONS screws up the build. Resetting." -n "${GREP_OPTIONS}" -export GREP_OPTIONS= - CT_DoLog INFO "Building environment variables" # Include sub-scripts instead of calling them: that way, we do not have to @@ -91,6 +118,8 @@ CT_DoLog INFO "Building environment variables" . "${CT_LIB_DIR}/scripts/build/companion_libs/gmp.sh" . "${CT_LIB_DIR}/scripts/build/companion_libs/mpfr.sh" . "${CT_LIB_DIR}/scripts/build/companion_libs/ppl.sh" +. "${CT_LIB_DIR}/scripts/build/companion_libs/cloog.sh" +. "${CT_LIB_DIR}/scripts/build/companion_libs/mpc.sh" . "${CT_LIB_DIR}/scripts/build/binutils/binutils.sh" . "${CT_LIB_DIR}/scripts/build/binutils/elf2flt.sh" . "${CT_LIB_DIR}/scripts/build/libc/${CT_LIBC}.sh" @@ -113,7 +142,7 @@ CT_TARGET_LDFLAGS="${CT_ARCH_TARGET_LDFLAGS} ${CT_TARGET_LDFLAGS}" CT_CC_CORE_EXTRA_CONFIG="${CT_ARCH_CC_CORE_EXTRA_CONFIG} ${CT_CC_CORE_EXTRA_CONFIG}" CT_CC_EXTRA_CONFIG="${CT_ARCH_CC_EXTRA_CONFIG} ${CT_CC_EXTRA_CONFIG}" -# Create the working directories +# Compute the working directories names CT_TARBALLS_DIR="${CT_WORK_DIR}/tarballs" CT_SRC_DIR="${CT_WORK_DIR}/src" CT_BUILD_DIR="${CT_WORK_DIR}/${CT_TARGET}/build" @@ -125,6 +154,10 @@ CT_CONFIG_DIR="${CT_BUILD_DIR}/configs" CT_CC_CORE_STATIC_PREFIX_DIR="${CT_BUILD_DIR}/${CT_CC}-core-static" CT_CC_CORE_SHARED_PREFIX_DIR="${CT_BUILD_DIR}/${CT_CC}-core-shared" +# Set LD_LIBRARY_PATH to point to prefix/lib so we can find our own +# libraries; add as first path, so we get hit first by the dynamic linker +CT_SetLibPath "${CT_PREFIX_DIR}/lib" first + # We must ensure that we can restart if asked for! if [ -n "${CT_RESTART}" -a ! -d "${CT_STATE_DIR}" ]; then CT_DoLog ERROR "You asked to restart a non-restartable build" @@ -140,11 +173,6 @@ if [ ! -d "${CT_LOCAL_TARBALLS_DIR}" ]; then CT_SAVE_TARBALLS= fi -# Some more sanity checks now that we have all paths set up -case "${CT_LOCAL_TARBALLS_DIR},${CT_TARBALLS_DIR},${CT_SRC_DIR},${CT_BUILD_DIR},${CT_PREFIX_DIR},${CT_INSTALL_DIR}" in - *" "*) CT_Abort "Don't use spaces in paths, it breaks things.";; -esac - # Check now if we can write to the destination directory: if [ -d "${CT_INSTALL_DIR}" ]; then CT_TestAndAbort "Destination directory '${CT_INSTALL_DIR}' is not removable" ! -w $(dirname "${CT_INSTALL_DIR}") @@ -202,8 +230,10 @@ CT_DoExecLog ALL mkdir -p "${CT_BUILD_DIR}" CT_DoExecLog ALL mkdir -p "${CT_CONFIG_DIR}" CT_DoExecLog ALL mkdir -p "${CT_INSTALL_DIR}" CT_DoExecLog ALL mkdir -p "${CT_PREFIX_DIR}" -CT_DoExecLog ALL mkdir -p "${CT_CC_CORE_STATIC_PREFIX_DIR}" -CT_DoExecLog ALL mkdir -p "${CT_CC_CORE_SHARED_PREFIX_DIR}" +if [ -z "${CT_CANADIAN}" ]; then + CT_DoExecLog ALL mkdir -p "${CT_CC_CORE_STATIC_PREFIX_DIR}" + CT_DoExecLog ALL mkdir -p "${CT_CC_CORE_SHARED_PREFIX_DIR}" +fi # Only create the state dir if asked for a restartable build [ -n "${CT_DEBUG_CT_SAVE_STEPS}" ] && CT_DoExecLog ALL mkdir -p "${CT_STATE_DIR}" @@ -235,12 +265,6 @@ esac # Setting up the rest of the environment only if not restarting if [ -z "${CT_RESTART}" ]; then - # What's our shell? - # Will be plain /bin/sh on most systems, except if we have /bin/ash and we - # _explictly_ required using it - CT_SHELL="/bin/sh" - [ "${CT_CONFIG_SHELL_ASH}" = "y" -a -x "/bin/ash" ] && CT_SHELL="/bin/ash" - # Arrange paths depending on wether we use sys-root or not. if [ "${CT_USE_SYSROOT}" = "y" ]; then CT_SYSROOT_DIR="${CT_PREFIX_DIR}/${CT_TARGET}/${CT_SYSROOT_DIR_PREFIX}/sys-root" @@ -257,6 +281,7 @@ if [ -z "${CT_RESTART}" ]; then else # plain old way. All libraries in prefix/target/lib CT_SYSROOT_DIR="${CT_PREFIX_DIR}/${CT_TARGET}" + CT_DEBUGROOT_DIR="${CT_SYSROOT_DIR}" CT_HEADERS_DIR="${CT_SYSROOT_DIR}/include" # hack! Always use --with-sysroot for binutils. # binutils 2.14 and later obey it, older binutils ignore it. @@ -280,8 +305,10 @@ if [ -z "${CT_RESTART}" ]; then CT_DoExecLog ALL mkdir -p "${CT_SYSROOT_DIR}/lib" CT_DoExecLog ALL mkdir -p "${CT_SYSROOT_DIR}/usr/lib" - # Prevent gcc from installing its libraries outside of the sys-root - CT_DoExecLog ALL ln -sf "./${CT_SYSROOT_DIR_PREFIX}/sys-root/lib" "${CT_PREFIX_DIR}/${CT_TARGET}/lib" + if [ "${CT_USE_SYSROOT}" = "y" ]; then + # Prevent gcc from installing its libraries outside of the sys-root + CT_DoExecLog ALL ln -sf "./${CT_SYSROOT_DIR_PREFIX}/sys-root/lib" "${CT_PREFIX_DIR}/${CT_TARGET}/lib" + fi # Now, in case we're 64 bits, just have lib64/ be a symlink to lib/ # so as to have all libraries in the same directory (we can do that @@ -302,9 +329,18 @@ if [ -z "${CT_RESTART}" ]; then # Prepare mangling patterns to later modify BUILD and HOST (see below) case "${CT_TOOLCHAIN_TYPE}" in cross) + # A cross-compiler runs on the same machine it is built on CT_HOST="${CT_BUILD}" build_mangle="build_" host_mangle="build_" + target_mangle="" + install_build_tools_for="BUILD HOST" + ;; + canadian) + build_mangle="build_" + host_mangle="host_" + target_mangle="" + install_build_tools_for="BUILD HOST TARGET" ;; *) CT_Abort "No code for '${CT_TOOLCHAIN_TYPE}' toolchain type!" ;; @@ -313,11 +349,13 @@ if [ -z "${CT_RESTART}" ]; then # Save the real tuples to generate shell-wrappers to the real tools CT_REAL_BUILD="${CT_BUILD}" CT_REAL_HOST="${CT_HOST}" + CT_REAL_TARGET="${CT_TARGET}" # Canonicalise CT_BUILD and CT_HOST # Not only will it give us full-qualified tuples, but it will also ensure # that they are valid tuples (in case of typo with user-provided tuples) # That's way better than trying to rewrite config.sub ourselves... + # CT_TARGET is already made canonical in CT_DoBuildTargetTuple CT_BUILD=$(CT_DoConfigSub "${CT_BUILD}") CT_HOST=$(CT_DoConfigSub "${CT_HOST}") @@ -327,12 +365,13 @@ if [ -z "${CT_RESTART}" ]; then # support canadain build, later... CT_BUILD="${CT_BUILD/-/-${build_mangle}}" CT_HOST="${CT_HOST/-/-${host_mangle}}" + CT_TARGET="${CT_TARGET/-/-${target_mangle}}" # Now we have mangled our BUILD and HOST tuples, we must fake the new # cross-tools for those mangled tuples. CT_DoLog DEBUG "Making build system tools available" - CT_DoExecLog ALL mkdir -p "${CT_PREFIX_DIR}/bin" - for m in BUILD HOST; do + CT_DoExecLog ALL mkdir -p "${CT_PREFIX_DIR}/buildtools" + for m in ${install_build_tools_for}; do r="CT_REAL_${m}" v="CT_${m}" p="CT_${m}_PREFIX" @@ -368,12 +407,12 @@ if [ -z "${CT_RESTART}" ]; then # bally needed if [ -n "${where}" ]; then CT_DoLog DEBUG " '${!v}-${tool}' -> '${where}'" - printf "#${BANG}${CT_SHELL}\nexec '${where}' \"\${@}\"\n" >"${CT_PREFIX_DIR}/bin/${!v}-${tool}" - CT_DoExecLog ALL chmod 700 "${CT_PREFIX_DIR}/bin/${!v}-${tool}" + printf "#${BANG}${CT_SHELL}\nexec '${where}' \"\${@}\"\n" >"${CT_PREFIX_DIR}/buildtools/${!v}-${tool}" + CT_DoExecLog ALL chmod 700 "${CT_PREFIX_DIR}/buildtools/${!v}-${tool}" else case "${tool}" in # We'll at least need some of them... - ar|as|gcc|ld|nm|objcopy|objdump|ranlib) + ar|as|gcc|g++|ld|nm|objcopy|objdump|ranlib) CT_Abort "Missing: '${t}${tool}${!s}' or '${t}${tool}' or '${tool}' : either needed!" ;; # Some are conditionnally required @@ -399,7 +438,8 @@ if [ -z "${CT_RESTART}" ]; then # Of course, neither cross-native nor canadian can run on BUILD, # so don't add those PATHs in this case... case "${CT_TOOLCHAIN_TYPE}" in - cross) export PATH="${CT_PREFIX_DIR}/bin:${CT_CC_CORE_SHARED_PREFIX_DIR}/bin:${CT_CC_CORE_STATIC_PREFIX_DIR}/bin:${PATH}";; + cross) export PATH="${CT_PREFIX_DIR}/buildtools:${CT_PREFIX_DIR}/bin:${CT_CC_CORE_SHARED_PREFIX_DIR}/bin:${CT_CC_CORE_STATIC_PREFIX_DIR}/bin:${PATH}";; + canadian) export PATH="${CT_PREFIX_DIR}/buildtools:${PATH}";; *) ;; esac @@ -407,8 +447,8 @@ if [ -z "${CT_RESTART}" ]; then # Go ahead with those, by creating a wrapper that keeps partial files, and that # never fails: CT_DoLog DEBUG " 'makeinfo' -> '$(CT_Which makeinfo)'" - printf "#${BANG}/bin/sh\n$(CT_Which makeinfo) --force \"\${@}\"\ntrue\n" >"${CT_PREFIX_DIR}/bin/makeinfo" - CT_DoExecLog ALL chmod 700 "${CT_PREFIX_DIR}/bin/makeinfo" + printf "#${BANG}${CT_SHELL}\n$(CT_Which makeinfo) --force \"\${@}\"\ntrue\n" >"${CT_PREFIX_DIR}/buildtools/makeinfo" + CT_DoExecLog ALL chmod 700 "${CT_PREFIX_DIR}/buildtools/makeinfo" # Help gcc CT_CFLAGS_FOR_HOST= @@ -419,7 +459,8 @@ if [ -z "${CT_RESTART}" ]; then # Set the shell to be used by ./configure scripts and by Makefiles (those # that support it!). - export CONFIG_SHELL="${CT_SHELL}" + export CONFIG_SHELL="${CT_SHELL}" # for ./configure + export SHELL="${CT_SHELL}" # for Makefiles # And help make go faster PARALLELMFLAGS= @@ -428,6 +469,7 @@ if [ -z "${CT_RESTART}" ]; then export PARALLELMFLAGS CT_DoLog EXTRA "Installing user-supplied crosstool-NG configuration" + CT_DoExecLog ALL mkdir -p "${CT_PREFIX_DIR}/bin" CT_DoExecLog DEBUG install -m 0755 "${CT_LIB_DIR}/scripts/toolchain-config.in" "${CT_PREFIX_DIR}/bin/${CT_TARGET}-ct-ng.config" CT_DoExecLog DEBUG sed -r -i -e 's,@@grep@@,"'"${grep}"'",;' "${CT_PREFIX_DIR}/bin/${CT_TARGET}-ct-ng.config" bzip2 -c -9 .config >>"${CT_PREFIX_DIR}/bin/${CT_TARGET}-ct-ng.config" @@ -447,6 +489,8 @@ if [ -z "${CT_RESTART}" ]; then do_gmp_get do_mpfr_get do_ppl_get + do_cloog_get + do_mpc_get do_binutils_get do_cc_get do_libc_get @@ -464,6 +508,8 @@ if [ -z "${CT_RESTART}" ]; then do_gmp_extract do_mpfr_extract do_ppl_extract + do_cloog_extract + do_mpc_extract do_binutils_extract do_cc_extract do_libc_extract diff --git a/scripts/functions b/scripts/functions index 82bccab..546f22d 100644 --- a/scripts/functions +++ b/scripts/functions @@ -79,7 +79,7 @@ CT_DoLog() { if [ $# -eq 0 ]; then cat - else - echo "${@}" + printf "${@}\n" fi |( IFS="${CR}" # We want the full lines, even leading spaces _prog_bar_cpt=0 _prog_bar[0]='/' @@ -265,6 +265,36 @@ CT_DoYes() { yes "$1" || true } +# Add the specified directory to LD_LIBRARY_PATH, and export it +# If the specified patch is already present, just export +# $1: path to add +# $2: add as 'first' or 'last' path, 'first' is assumed if $2 is empty +# Usage CT_SetLibPath /some/where/lib [first|last] +CT_SetLibPath() { + local path="$1" + local pos="$2" + + case ":${LD_LIBRARY_PATH}:" in + *:"${path}":*) ;; + *) case "${pos}" in + last) + CT_DoLog DEBUG "Adding '${path}' at end of LD_LIBRARY_PATH" + LD_LIBRARY_PATH="${LD_LIBRARY_PATH:+${LD_LIBRARY_PATH}:}${path}" + ;; + first|"") + CT_DoLog DEBUG "Adding '${path}' at start of LD_LIBRARY_PATH" + LD_LIBRARY_PATH="${path}${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}" + ;; + *) + CT_Abort "Incorrect position '${pos}' to add '${path}' to LD_LIBRARY_PATH" + ;; + esac + ;; + esac + CT_DoLog DEBUG "==> LD_LIBRARY_PATH='${LD_LIBRARY_PATH}'" + export LD_LIBRARY_PATH +} + # Get the file name extension of a component # Usage: CT_GetFileExtension <component_name-component_version> [extension] # If found, echoes the extension to stdout diff --git a/scripts/populate.in b/scripts/populate.in index e8a3718..9bb5afb 100644 --- a/scripts/populate.in +++ b/scripts/populate.in @@ -13,7 +13,7 @@ CT_SYSROOT_DIR="$(cd "${CT_BIN_DIR}/../@@CT_TARGET@@/sys-root"; pwd)" myname=$(basename "$0") -# Use the tols discovered by crosstool-NG's ./configure: +# Use the tools discovered by crosstool-NG's ./configure: install="@@CT_install@@" grep="@@CT_grep@@" sed="@@CT_sed@@" @@ -59,7 +59,7 @@ OPTIONS -f force execution: if destination directory already exists, it will be removed first; if a specified library (above) was not found, continue. - -v Be verbose + -v Be verbose. By default, populate is absolutely silent. _EOF_ } @@ -69,7 +69,7 @@ CT_ROOT_DST_DIR= CT_LIB_LIST= CT_LIB_FILE= CT_FORCE=no -CT_ECHO=true +CT_PRINTF=: OPTIND=1 while getopts ":s:d:l:L:fvh" CT_OPT; do case "${CT_OPT}" in @@ -78,7 +78,7 @@ while getopts ":s:d:l:L:fvh" CT_OPT; do l) CT_LIB_LIST="${CT_LIB_LIST}:${OPTARG}";; L) CT_LIB_FILE="${OPTARG}";; f) CT_FORCE=y;; - v) CT_ECHO=echo;; + v) CT_PRINTF=printf;; h) doHelp exit 0 ;; @@ -104,9 +104,9 @@ if [ -d "${CT_ROOT_DST_DIR}" -a "${CT_FORCE}" != "y" ]; then echo "$myname: '${CT_ROOT_DST_DIR}': already exists" exit 1 fi -src_inode=$(ls -di "${CT_ROOT_SRC_DIR}") -dst_inode=$(ls -di "${CT_ROOT_DST_DIR}" 2>/dev/null) -if [ "${src_inode}" = "${dst_inode}" ]; then +src_inode=$(stat -c '%i' "${CT_ROOT_SRC_DIR}/.") +dst_inode=$(stat -c '%i' "${CT_ROOT_DST_DIR}/." 2>/dev/null || true) +if [ "${src_inode}" -eq "$((dst_inode+0))" ]; then echo "$myname: source and destination are the same!" exit 1 fi @@ -129,7 +129,7 @@ CT_ROOT_DST_DIR=$(cd "${CT_ROOT_DST_DIR}"; pwd) # Populate the destination directory with files form the source directory pushd "${CT_ROOT_SRC_DIR}" >/dev/null -tar cf - . |(cd "${CT_ROOT_DST_DIR}"; tar xf -) +tar cf - . |tar xf - -C "${CT_ROOT_DST_DIR}" popd >/dev/null # A function do search for a library @@ -139,18 +139,24 @@ do_add_lib() { local libname="$1" local true_libname local dir + local mode + for dir in lib usr/lib; do - ${CT_ECHO} -n " trying in '${dir}'" + ${CT_PRINTF} " trying in '%s'" "${dir}" libfile="${CT_SYSROOT_DIR}/${dir}/${libname}" - ${CT_ECHO} ": '${libfile}'" + ${CT_PRINTF} ": '%s'\n" "${libfile}" if [ -e "${libfile}" ]; then mkdir -p "${dir}" true_libname=$("${CT_READELF}" -d "${libfile}" \ |"${grep}" "Library soname:" \ |"${sed}" -r -e 's,.+\[(.+)\] *$,\1,;' \ ) - ${CT_ECHO} " installing as '${dir}/${true_libname}'" - "${install}" -m 0644 "${libfile}" "${dir}/${true_libname}" + case "${libfile}" in + */ld*) mode=0755;; + *) mode=0644;; + esac + ${CT_PRINTF} " installing as '%s/%s', mode='%s'\n" "${dir}" "${true_libname}" "${mode}" + "${install}" -m "${mode}" "${libfile}" "${dir}/${true_libname}" return 0 break fi @@ -158,6 +164,9 @@ do_add_lib() { return 1 } +# We'll work in the copied rootfs +pushd "${CT_ROOT_DST_DIR}" >/dev/null + # First of, copy the forced libraries into the working copy if [ -n "${CT_LIB_FILE}" ]; then lib_list=$("${sed}" -r -e ':loop; s/#.*//;' \ @@ -173,44 +182,43 @@ fi CT_LIB_LIST=$(echo "${CT_LIB_LIST}:${lib_list}" \ |"${sed}" -r -e 's/^:+//; s/:+$//; s/:+/ /g;' \ ) -${CT_ECHO} "Installing forced libraries..." -pushd "${CT_ROOT_DST_DIR}" >/dev/null -for name in ${CT_LIB_LIST}; do - [ -z "${name}" ] && continue - found=0 - for libname in "lib${name}.so" "${name}.so" "${name}"; do - ${CT_ECHO} " searching for '${libname}'" - if do_add_lib "${libname}"; then - found=1 - break +if [ -n "${CT_LIB_LIST}" ]; then + ${CT_PRINTF} "Installing forced libraries...\n" + for name in ${CT_LIB_LIST}; do + [ -z "${name}" ] && continue + found=0 + for libname in "lib${name}.so" "${name}.so" "${name}"; do + ${CT_PRINTF} " searching for '%s'\n" "${libname}" + if do_add_lib "${libname}"; then + found=1 + break + fi + done + if [ ${found} -eq 0 ]; then + echo "$myname: library '${libname}' not found!" + [ "${CT_FORCE}" = y ] || exit 1 fi done - if [ ${found} -eq 0 ]; then - echo "$myname: library '${libname}' not found!" - [ "${CT_FORCE}" = y ] || exit 1 - fi -done -popd >/dev/null +fi # Parse the working copy for executables and libraries -pushd "${CT_ROOT_DST_DIR}" >/dev/null still_needed=1 while [ ${still_needed} -eq 1 ]; do - ${CT_ECHO} "Looping..." + ${CT_PRINTF} "Looping...\n" still_needed=0 for f in $(find . -type f -exec file {} \; \ |"${grep}" -E ': ELF [[:digit:]]+-bit (L|M)SB (executable|shared object),' \ |cut -d ":" -f 1 \ ); do - ${CT_ECHO} "Scanning '${f}'" + ${CT_PRINTF} "Scanning '%s'\n" "${f}" for libname in $("${CT_READELF}" -d "${f}" \ |"${grep}" -E '\(NEEDED\)[[:space:]]+Shared library:' \ |"${sed}" -r -e 's,.+\[(.+)\] *$,\1,;' \ ); do - ${CT_ECHO} " searching for '${libname}'" + ${CT_PRINTF} " searching for '%s'\n" "${libname}" if [ -e "lib/${libname}" \ -o -e "usr/lib/${libname}" ]; then - ${CT_ECHO} " already present" + ${CT_PRINTF} " already present\n" continue fi if do_add_lib "${libname}"; then @@ -221,4 +229,6 @@ while [ ${still_needed} -eq 1 ]; do done done done + +# OK, we're done. Back off. popd >/dev/null diff --git a/scripts/saveSample.sh.in b/scripts/saveSample.sh.in index 6b3f205..4ef71ce 100644 --- a/scripts/saveSample.sh.in +++ b/scripts/saveSample.sh.in @@ -59,18 +59,22 @@ unset CT_LOG_PROGRESS_BAR CT_LOG_ERROR CT_LOG_INFO CT_LOG_EXTRA CT_LOG_DEBUG LOG CT_LOG_WARN=y CT_LOG_LEVEL_MAX="WARN" -# Create the sample directory -if [ ! -d "samples/${CT_TARGET}" ]; then - mkdir -p "samples/${CT_TARGET}" -fi +# Compute the name of the sample directory +case "${CT_TOOLCHAIN_TYPE}" in + cross) samp_name="${CT_TARGET}";; + canadian) samp_name="${CT_HOST},${CT_TARGET}";; + *) CT_Abort "Unsupported toolchain type '${CT_TOOLCHAIN_TYPE}'";; +esac +samp_dir="samples/${samp_name}" +mkdir -p "${samp_dir}" # Save the crosstool-NG config file -"${sed}" -r -e 's|^(CT_PREFIX_DIR)=.*|\1="${HOME}/x-tools/${CT_TARGET}"|;' \ +"${sed}" -r -e 's|^(CT_PREFIX_DIR)=.*|\1="${HOME}/x-tools/${samp_name}"|;' \ -e 's|^# CT_LOG_TO_FILE is not set$|CT_LOG_TO_FILE=y|;' \ -e 's|^# CT_LOG_FILE_COMPRESS is not set$|CT_LOG_FILE_COMPRESS=y|;' \ -e 's|^(CT_LOCAL_TARBALLS_DIR)=.*|\1="${HOME}/src"|;' \ <.config \ - >"samples/${CT_TARGET}/crosstool.config" + >"${samp_dir}/crosstool.config" # Function to copy a file to the sample directory # Needed in case the file is already there (think of a previously available sample) @@ -94,12 +98,12 @@ fi # Save the uClibc .config file if [ -n "${CT_LIBC_UCLIBC_CONFIG_FILE}" ]; then # We save the file, and then point the saved sample to this file - CT_DoAddFileToSample "${CT_LIBC_UCLIBC_CONFIG_FILE}" "samples/${CT_TARGET}/${CT_LIBC}-${CT_LIBC_VERSION}.config" - "${sed}" -r -i -e 's|^(CT_LIBC_UCLIBC_CONFIG_FILE)=.+$|\1="'"${samp_top_dir}"'/samples/${CT_TARGET}/${CT_LIBC}-${CT_LIBC_VERSION}.config"|;' \ - "samples/${CT_TARGET}/crosstool.config" + CT_DoAddFileToSample "${CT_LIBC_UCLIBC_CONFIG_FILE}" "${samp_dir}/${CT_LIBC}-${CT_LIBC_VERSION}.config" + "${sed}" -r -i -e 's|^(CT_LIBC_UCLIBC_CONFIG_FILE)=.+$|\1="'"${samp_top_dir}"'/${samp_dir}/${CT_LIBC}-${CT_LIBC_VERSION}.config"|;' \ + "${samp_dir}/crosstool.config" else # remove any dangling files - for f in "samples/${CT_TARGET}/${CT_LIBC}-"*.config; do + for f in "${samp_dir}/${CT_LIBC}-"*.config; do if [ -f "${f}" ]; then rm -f "${f}"; fi done fi @@ -108,7 +112,7 @@ fi exec >&7 # Fill-in the reported-by info -[ -f "samples/${CT_TARGET}/reported.by" ] && . "samples/${CT_TARGET}/reported.by" +[ -f "${samp_dir}/reported.by" ] && . "${samp_dir}/reported.by" old_name="${reporter_name}" old_url="${reporter_url}" read -p "Reporter name [${reporter_name}]: " reporter_name @@ -123,4 +127,4 @@ reporter_comment=$(cat) ( echo "reporter_name=\"${reporter_name:=${old_name}}\"" echo "reporter_url=\"${reporter_url:=${old_url}}\"" printf "reporter_comment=\"${reporter_comment}\"\n" -) >"samples/${CT_TARGET}/reported.by" +) >"${samp_dir}/reported.by" diff --git a/scripts/showSamples.sh b/scripts/showSamples.sh index f06a183..e952d64 100755 --- a/scripts/showSamples.sh +++ b/scripts/showSamples.sh @@ -34,6 +34,12 @@ dump_single_sample() { [ "${CT_EXPERIMENTAL}" = "y" ] && printf "X" || printf " " echo "]" if [ ${verbose} -ne 0 ]; then + case "${CT_TOOLCHAIN_TYPE}" in + cross) ;; + canadian) + printf " Host : ${CT_HOST}\n" + ;; + esac echo " OS : ${CT_KERNEL}${CT_KERNEL_VERSION:+-}${CT_KERNEL_VERSION}" if [ "${CT_GMP_MPFR}" = "y" ]; then echo " GMP/MPFR : gmp-${CT_GMP_VERSION} / mpfr-${CT_MPFR_VERSION}" @@ -64,8 +70,13 @@ dump_single_sample() { printf "| " [ "${CT_EXPERIMENTAL}" = "y" ] && printf "X" [ -f "${sample_top}/samples/${sample}/broken" ] && printf "B" - printf ' ' - printf "| ''${CT_KERNEL}'' |" + printf ' | ' + case "${CT_TOOLCHAIN_TYPE}" in + cross) ;; + canadian) printf "${CT_HOST}";; + *) ;; + esac + printf " | ''${CT_KERNEL}'' |" if [ "${CT_KERNEL}" != "bare-metal" ];then if [ "${CT_KERNEL_LINUX_HEADERS_USE_CUSTOM_DIR}" = "y" ]; then printf " //custom// " @@ -102,13 +113,7 @@ dump_single_sample() { printf "| [[http://ymorin.is-a-geek.org/|YEM]] " fi ) - sample_updated=$(date -u "+%Y%m%d" \ - -d "$(LC_ALL=C svn info ${sample_top}/samples/${sample} \ - |GREP_OPTIONS= "${grep}" -E '^Last Changed Date:' \ - |"${sed}" -r -e 's/^[^:]+: //;' \ - -e 's/^(.+:.. [+-][[:digit:]]{4}) \(.+\)$/\1/;' \ - )" \ - ) + sample_updated="$( hg log -l 1 --template '{date|shortdate}' "${sample_top}/samples/${sample}" )" printf "| ${sample_updated} " echo "|" fi @@ -124,6 +129,7 @@ if [ "${opt}" = -w ]; then echo "^ @@DATE@@ ^ |||||||||||||" printf "^ Target " printf "^ Status " + printf "^ Host " printf "^ Kernel headers\\\\\\\\ version ^" printf "^ binutils\\\\\\\\ version " printf "^ C compiler\\\\\\\\ version ^" diff --git a/scripts/wrapper.in b/scripts/wrapper.in new file mode 100644 index 0000000..1c501eb --- /dev/null +++ b/scripts/wrapper.in @@ -0,0 +1,15 @@ +#!/bin/sh + +canonicalizedname=$(readlink -nm "${0}") +dirname="$(dirname "${canonicalizedname}")" +basename="$(basename "${canonicalizedname}")" + +ld_lib_path="$(dirname "${dirname}")/lib" + +case ":${LD_LIBRARY_PATH}:" in + *":${ld_lib_path}:"*) ;; + *) LD_LIBRARY_PATH="${ld_lib_path}${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}";; +esac + +export LD_LIBRARY_PATH +exec "${dirname}/.${basename}" "$@" |