scripts/build/libc_glibc.sh
changeset 729 506e36e44e5f
parent 710 021546adce69
child 752 b037a5643e04
     1.1 --- a/scripts/build/libc_glibc.sh	Tue Jul 22 13:29:08 2008 +0000
     1.2 +++ b/scripts/build/libc_glibc.sh	Sat Jul 26 12:26:42 2008 +0000
     1.3 @@ -95,6 +95,7 @@
     1.4  
     1.5      libc_cv_ppc_machine=yes                     \
     1.6      CC=${cross_cc}                              \
     1.7 +    CT_DoExecLog ALL                            \
     1.8      "${CT_SRC_DIR}/${CT_LIBC_FILE}/configure"   \
     1.9          --build="${CT_UNIQ_BUILD}"              \
    1.10          --host="${CT_TARGET}"                   \
    1.11 @@ -104,7 +105,7 @@
    1.12          --disable-sanity-checks                 \
    1.13          --enable-hacker-mode                    \
    1.14          ${addons_config}                        \
    1.15 -        --without-nptl                          2>&1 |CT_DoLog ALL
    1.16 +        --without-nptl
    1.17  
    1.18      CT_DoLog EXTRA "Installing C library headers"
    1.19  
    1.20 @@ -121,39 +122,45 @@
    1.21          # Note: BOOTSTRAP_GCC is used by:
    1.22          # patches/glibc-2.3.5/glibc-mips-bootstrap-gcc-header-install.patch
    1.23  
    1.24 -        libc_cv_ppc_machine=yes                                 \
    1.25 -        make CFLAGS="-O -DBOOTSTRAP_GCC" sysdeps/gnu/errlist.c  2>&1 |CT_DoLog ALL
    1.26 +        libc_cv_ppc_machine=yes             \
    1.27 +        CT_DoExecLog ALL                    \
    1.28 +        make CFLAGS="-O -DBOOTSTRAP_GCC"    \
    1.29 +             sysdeps/gnu/errlist.c
    1.30          mkdir -p stdio-common
    1.31  
    1.32          # sleep for 2 seconds for benefit of filesystems with lousy time
    1.33          # resolution, like FAT, so make knows for sure errlist-compat.c doesn't
    1.34          # need generating
    1.35          sleep 2
    1.36 -        touch stdio-common/errlist-compat.c
    1.37 +        CT_DoExecLog ALL touch stdio-common/errlist-compat.c
    1.38      fi
    1.39      # Note: BOOTSTRAP_GCC (see above)
    1.40 -    libc_cv_ppc_machine=yes                                 \
    1.41 -    make cross-compiling=yes install_root=${CT_SYSROOT_DIR} \
    1.42 -         CFLAGS="-O -DBOOTSTRAP_GCC" ${LIBC_SYSROOT_ARG}    \
    1.43 -         install-headers                                    2>&1 |CT_DoLog ALL
    1.44 +    libc_cv_ppc_machine=yes             \
    1.45 +    CT_DoExecLog ALL                    \
    1.46 +    make cross-compiling=yes            \
    1.47 +         install_root=${CT_SYSROOT_DIR} \
    1.48 +         CFLAGS="-O -DBOOTSTRAP_GCC"    \
    1.49 +         ${LIBC_SYSROOT_ARG}            \
    1.50 +         install-headers
    1.51  
    1.52      # Two headers -- stubs.h and features.h -- aren't installed by install-headers,
    1.53      # so do them by hand.  We can tolerate an empty stubs.h for the moment.
    1.54      # See e.g. http://gcc.gnu.org/ml/gcc/2002-01/msg00900.html
    1.55      mkdir -p "${CT_HEADERS_DIR}/gnu"
    1.56 -    touch "${CT_HEADERS_DIR}/gnu/stubs.h"
    1.57 -    cp "${CT_SRC_DIR}/${CT_LIBC_FILE}/include/features.h" "${CT_HEADERS_DIR}/features.h"
    1.58 +    CT_DoExecLog ALL touch "${CT_HEADERS_DIR}/gnu/stubs.h"
    1.59 +    CT_DoExecLog ALL cp -v "${CT_SRC_DIR}/${CT_LIBC_FILE}/include/features.h"  \
    1.60 +                           "${CT_HEADERS_DIR}/features.h"
    1.61  
    1.62      # Building the bootstrap gcc requires either setting inhibit_libc, or
    1.63      # having a copy of stdio_lim.h... see
    1.64      # http://sources.redhat.com/ml/libc-alpha/2003-11/msg00045.html
    1.65 -    cp bits/stdio_lim.h "${CT_HEADERS_DIR}/bits/stdio_lim.h"
    1.66 +    CT_DoExecLog ALL cp -v bits/stdio_lim.h "${CT_HEADERS_DIR}/bits/stdio_lim.h"
    1.67  
    1.68      # Following error building gcc-4.0.0's gcj:
    1.69      #  error: bits/syscall.h: No such file or directory
    1.70      # solved by following copy; see http://sourceware.org/ml/crossgcc/2005-05/msg00168.html
    1.71      # but it breaks arm, see http://sourceware.org/ml/crossgcc/2006-01/msg00091.html
    1.72 -    [ "${CT_ARCH}" != "arm" ] && cp misc/syscall-list.h "${CT_HEADERS_DIR}/bits/syscall.h" || true
    1.73 +    [ "${CT_ARCH}" != "arm" ] && CT_DoExecLog ALL cp -v misc/syscall-list.h "${CT_HEADERS_DIR}/bits/syscall.h" || true
    1.74  
    1.75      # Those headers are to be manually copied so gcc can build properly
    1.76      pthread_h="${CT_SRC_DIR}/${CT_LIBC_FILE}/${CT_THREADS}/sysdeps/pthread/pthread.h"
    1.77 @@ -177,10 +184,10 @@
    1.78              ;;
    1.79      esac
    1.80      if [ -n "${pthread_h}" ]; then
    1.81 -        cp -v "${pthread_h}" "${CT_HEADERS_DIR}/pthread.h" 2>&1 |CT_DoLog ALL
    1.82 +        CT_DoExecLog ALL cp -v "${pthread_h}" "${CT_HEADERS_DIR}/pthread.h"
    1.83      fi
    1.84      if [ -n "${pthreadtypes_h}" ]; then
    1.85 -        cp -v "${pthreadtypes_h}" "${CT_HEADERS_DIR}/bits/pthreadtypes.h" 2>&1 |CT_DoLog ALL
    1.86 +        CT_DoExecLog ALL cp -v "${pthreadtypes_h}" "${CT_HEADERS_DIR}/bits/pthreadtypes.h"
    1.87      fi
    1.88  
    1.89      CT_EndStep
    1.90 @@ -262,6 +269,7 @@
    1.91      CC="${cross_cc} ${CT_LIBC_EXTRA_CC_ARGS} ${extra_cc_args}"      \
    1.92      AR=${CT_TARGET}-ar                                              \
    1.93      RANLIB=${CT_TARGET}-ranlib                                      \
    1.94 +    CT_DoExecLog ALL                                                \
    1.95      "${CT_SRC_DIR}/${CT_LIBC_FILE}/configure"                       \
    1.96          --prefix=/usr                                               \
    1.97          --build="${CT_UNIQ_BUILD}"                                  \
    1.98 @@ -273,19 +281,19 @@
    1.99          --with-headers="${CT_HEADERS_DIR}"                          \
   1.100          --cache-file=config.cache                                   \
   1.101          ${extra_config}                                             \
   1.102 -        ${CT_LIBC_GLIBC_EXTRA_CONFIG}                               2>&1 |CT_DoLog ALL
   1.103 +        ${CT_LIBC_GLIBC_EXTRA_CONFIG}
   1.104  
   1.105  
   1.106      #TODO: should check whether slibdir has been set in configparms to */lib64
   1.107      #      and copy the startfiles into the appropriate libdir.
   1.108      CT_DoLog EXTRA "Building C library start files"
   1.109 -    make csu/subdir_lib 2>&1 |CT_DoLog ALL
   1.110 +    CT_DoExecLog ALL make csu/subdir_lib
   1.111  
   1.112      CT_DoLog EXTRA "Installing C library start files"
   1.113      if [ "${CT_USE_SYSROOT}" = "y" ]; then
   1.114 -        cp -fp csu/crt[1in].o "${CT_SYSROOT_DIR}/usr/lib/"
   1.115 +        CT_DoExecLog ALL cp -fpv csu/crt[1in].o "${CT_SYSROOT_DIR}/usr/lib/"
   1.116      else
   1.117 -        cp -fp csu/crt[1in].o "${CT_SYSROOT_DIR}/lib/"
   1.118 +        CT_DoExecLog ALL cp -fpv csu/crt[1in].o "${CT_SYSROOT_DIR}/lib/"
   1.119      fi
   1.120  
   1.121      CT_EndStep
   1.122 @@ -332,7 +340,6 @@
   1.123          *)  extra_config="${extra_config} --enable-add-ons=$(do_libc_add_ons_list ,)";;
   1.124      esac
   1.125  
   1.126 -
   1.127      # Add some default CC args
   1.128      glibc_version_major=$(echo ${CT_LIBC_VERSION} |sed -r -e 's/^([^\.]+)\..*/\1/')
   1.129      glibc_version_minor=$(echo ${CT_LIBC_VERSION} |sed -r -e 's/^[^\.]+\.([^.]+).*/\1/')
   1.130 @@ -389,6 +396,7 @@
   1.131      CC="${CT_TARGET}-gcc ${CT_LIBC_EXTRA_CC_ARGS} ${extra_cc_args}" \
   1.132      AR=${CT_TARGET}-ar                                              \
   1.133      RANLIB=${CT_TARGET}-ranlib                                      \
   1.134 +    CT_DoExecLog ALL                                                \
   1.135      "${CT_SRC_DIR}/${CT_LIBC_FILE}/configure"                       \
   1.136          --prefix=/usr                                               \
   1.137          --build=${CT_UNIQ_BUILD}                                    \
   1.138 @@ -401,7 +409,7 @@
   1.139          --cache-file=config.cache                                   \
   1.140          --with-headers="${CT_HEADERS_DIR}"                          \
   1.141          ${extra_config}                                             \
   1.142 -        ${CT_LIBC_GLIBC_EXTRA_CONFIG}                               2>&1 |CT_DoLog ALL
   1.143 +        ${CT_LIBC_GLIBC_EXTRA_CONFIG}
   1.144  
   1.145      if grep -l '^install-lib-all:' "${CT_SRC_DIR}/${CT_LIBC_FILE}/Makerules" > /dev/null; then
   1.146          # nptl-era glibc.
   1.147 @@ -433,14 +441,14 @@
   1.148      # Note: LD and RANLIB needed by glibc-2.1.3's c_stub directory, at least on macosx
   1.149      # No need for PARALLELMFLAGS here, Makefile already reads this environment variable
   1.150      CT_DoLog EXTRA "Building C library"
   1.151 -    make LD=${CT_TARGET}-ld             \
   1.152 -         RANLIB=${CT_TARGET}-ranlib     \
   1.153 -         ${GLIBC_INITIAL_BUILD_RULE}    2>&1 |CT_DoLog ALL
   1.154 +    CT_DoExecLog ALL make LD=${CT_TARGET}-ld            \
   1.155 +                           RANLIB=${CT_TARGET}-ranlib   \
   1.156 +                           ${GLIBC_INITIAL_BUILD_RULE}
   1.157  
   1.158      CT_DoLog EXTRA "Installing C library"
   1.159 -    make install_root="${CT_SYSROOT_DIR}"   \
   1.160 -         ${LIBC_SYSROOT_ARG}                \
   1.161 -         ${GLIBC_INITIAL_INSTALL_RULE}      2>&1 |CT_DoLog ALL
   1.162 +    CT_DoExecLog ALL make install_root="${CT_SYSROOT_DIR}"  \
   1.163 +                          ${LIBC_SYSROOT_ARG}               \
   1.164 +                          ${GLIBC_INITIAL_INSTALL_RULE}
   1.165  
   1.166      # This doesn't seem to work when building a crosscompiler,
   1.167      # as it tries to execute localedef using the just-built ld.so!?
   1.168 @@ -463,13 +471,13 @@
   1.169      for file in libc.so libpthread.so libgcc_s.so; do
   1.170          for dir in lib lib64 usr/lib usr/lib64; do
   1.171              if [ -f "${CT_SYSROOT_DIR}/${dir}/${file}" -a ! -L ${CT_SYSROOT_DIR}/$lib/$file ]; then
   1.172 -                cp "${CT_SYSROOT_DIR}/${dir}/${file}" "${CT_SYSROOT_DIR}/${dir}/${file}_orig"
   1.173 +                CT_DoExecLog ALL cp -v "${CT_SYSROOT_DIR}/${dir}/${file}" "${CT_SYSROOT_DIR}/${dir}/${file}_orig"
   1.174                  CT_DoLog DEBUG "Fixing '${CT_SYS_ROOT_DIR}/${dir}/${file}'"
   1.175 -                sed -i -r -e 's,/usr/lib/,,g;
   1.176 -                              s,/usr/lib64/,,g;
   1.177 -                              s,/lib/,,g;
   1.178 -                              s,/lib64/,,g;
   1.179 -                              /BUG in libc.scripts.output-format.sed/d' "${CT_SYSROOT_DIR}/${dir}/${file}"
   1.180 +                CT_DoExecLog ALL sed -i -r -e 's,/usr/lib/,,g;
   1.181 +                                               s,/usr/lib64/,,g;
   1.182 +                                               s,/lib/,,g;
   1.183 +                                               s,/lib64/,,g;
   1.184 +                                               /BUG in libc.scripts.output-format.sed/d' "${CT_SYSROOT_DIR}/${dir}/${file}"
   1.185              fi
   1.186          done
   1.187      done
   1.188 @@ -490,14 +498,14 @@
   1.189      cd "${CT_BUILD_DIR}/build-libc"
   1.190  
   1.191      CT_DoLog EXTRA "Re-building C library"
   1.192 -    make LD=${CT_TARGET}-ld RANLIB=${CT_TARGET}-ranlib 2>&1 |CT_DoLog ALL
   1.193 +    CT_DoExecLog ALL make LD=${CT_TARGET}-ld RANLIB=${CT_TARGET}-ranlib
   1.194  
   1.195      CT_DoLog EXTRA "Installing missing C library components"
   1.196      # note: should do full install and then fix linker scripts, but this is faster
   1.197      for t in bin rootsbin sbin data others; do
   1.198 -        make install_root="${CT_SYSROOT_DIR}"   \
   1.199 -             ${LIBC_SYSROOT_ARG}                \
   1.200 -             install-${t}                       2>&1 |CT_DoLog ALL
   1.201 +        CT_DoExecLog ALL make install_root="${CT_SYSROOT_DIR}"  \
   1.202 +                              ${LIBC_SYSROOT_ARG}               \
   1.203 +                              install-${t}
   1.204      done
   1.205  
   1.206      CT_EndStep