scripts/build/libc/glibc.sh
changeset 1123 8c5881324a79
parent 1121 4b7ed9da5a21
child 1124 eec7a46a4c19
     1.1 --- a/scripts/build/libc/glibc.sh	Sun Jan 04 14:38:41 2009 +0000
     1.2 +++ b/scripts/build/libc/glibc.sh	Sun Jan 04 22:17:53 2009 +0000
     1.3 @@ -16,11 +16,11 @@
     1.4      if [ "${CT_LIBC_GLIBC_2_8_or_later}" = "y" ]; then
     1.5          # No release tarball available...
     1.6          date="${CT_LIBC_GLIBC_CVS_date}"
     1.7 -        CT_GetCVS "${CT_LIBC_FILE}"                                     \
     1.8 +        CT_GetCVS "glibc-${CT_LIBC_VERSION}"                            \
     1.9                    ":pserver:anoncvs@sources.redhat.com:/cvs/glibc"      \
    1.10                    "libc"                                                \
    1.11                    "glibc-${CT_LIBC_VERSION}-branch${date:+:}${date}"    \
    1.12 -                  "${CT_LIBC_FILE}"
    1.13 +                  "glibc-${CT_LIBC_VERSION}"
    1.14  
    1.15          # C library addons
    1.16          for addon in $(do_libc_add_ons_list " "); do
    1.17 @@ -34,7 +34,7 @@
    1.18          done
    1.19      else
    1.20          # Release tarballs are available
    1.21 -        CT_GetFile "${CT_LIBC_FILE}"                        \
    1.22 +        CT_GetFile "glibc-${CT_LIBC_VERSION}"               \
    1.23                     {ftp,http}://ftp.gnu.org/gnu/glibc       \
    1.24                     ftp://gcc.gnu.org/pub/glibc/releases     \
    1.25                     ftp://gcc.gnu.org/pub/glibc/snapshots
    1.26 @@ -43,7 +43,7 @@
    1.27          for addon in $(do_libc_add_ons_list " "); do
    1.28              # NPTL addon is not to be downloaded, in any case
    1.29              [ "${addon}" = "nptl" ] && continue || true
    1.30 -            CT_GetFile "${CT_LIBC}-${addon}-${CT_LIBC_VERSION}" \
    1.31 +            CT_GetFile "glibc-${addon}-${CT_LIBC_VERSION}"      \
    1.32                         {ftp,http}://ftp.gnu.org/gnu/glibc       \
    1.33                         ftp://gcc.gnu.org/pub/glibc/releases     \
    1.34                         ftp://gcc.gnu.org/pub/glibc/snapshots
    1.35 @@ -55,19 +55,22 @@
    1.36  
    1.37  # Extract glibc
    1.38  do_libc_extract() {
    1.39 -    CT_ExtractAndPatch "${CT_LIBC_FILE}"
    1.40 +    CT_ExtractAndPatch "glibc-${CT_LIBC_VERSION}"
    1.41  
    1.42      # C library addons
    1.43      for addon in $(do_libc_add_ons_list " "); do
    1.44          # NPTL addon is not to be extracted, in any case
    1.45          [ "${addon}" = "nptl" ] && continue || true
    1.46 -        CT_ExtractAndPatch "${CT_LIBC}-${addon}-${CT_LIBC_VERSION}"
    1.47 +        CT_Pushd "${CT_SRC_DIR}/glibc-${CT_LIBC_VERSION}"
    1.48 +        CT_ExtractAndPatch "glibc-${addon}-${CT_LIBC_VERSION}" nochdir
    1.49 +        [ ! -d "${addon}" ] && ln -s "glibc-${addon}-${CT_LIBC_VERSION}" "${addon}"
    1.50 +        CT_Popd
    1.51      done
    1.52  
    1.53      # The configure files may be older than the configure.in files
    1.54      # if using a snapshot (or even some tarballs). Fake them being
    1.55      # up to date.
    1.56 -    find "${CT_SRC_DIR}/${CT_LIBC_FILE}" -type f -name configure -exec touch {} \; 2>&1 |CT_DoLog ALL
    1.57 +    find "${CT_SRC_DIR}/glibc-${CT_LIBC_VERSION}" -type f -name configure -exec touch {} \; 2>&1 |CT_DoLog ALL
    1.58  
    1.59      return 0
    1.60  }
    1.61 @@ -115,23 +118,23 @@
    1.62      CT_DoLog DEBUG "Using gcc for target: '${cross_cc}'"
    1.63      CT_DoLog DEBUG "Extra config passed : '${extra_config}'"
    1.64  
    1.65 -    libc_cv_ppc_machine=yes                     \
    1.66 -    CC=${cross_cc}                              \
    1.67 -    CT_DoExecLog ALL                            \
    1.68 -    "${CT_SRC_DIR}/${CT_LIBC_FILE}/configure"   \
    1.69 -        --build="${CT_BUILD}"                   \
    1.70 -        --host="${CT_TARGET}"                   \
    1.71 -        --prefix=/usr                           \
    1.72 -        --with-headers="${CT_HEADERS_DIR}"      \
    1.73 -        --without-cvs                           \
    1.74 -        --disable-sanity-checks                 \
    1.75 -        --enable-hacker-mode                    \
    1.76 -        ${extra_config}                         \
    1.77 +    libc_cv_ppc_machine=yes                             \
    1.78 +    CC=${cross_cc}                                      \
    1.79 +    CT_DoExecLog ALL                                    \
    1.80 +    "${CT_SRC_DIR}/glibc-${CT_LIBC_VERSION}/configure"  \
    1.81 +        --build="${CT_BUILD}"                           \
    1.82 +        --host="${CT_TARGET}"                           \
    1.83 +        --prefix=/usr                                   \
    1.84 +        --with-headers="${CT_HEADERS_DIR}"              \
    1.85 +        --without-cvs                                   \
    1.86 +        --disable-sanity-checks                         \
    1.87 +        --enable-hacker-mode                            \
    1.88 +        ${extra_config}                                 \
    1.89          --without-nptl
    1.90  
    1.91      CT_DoLog EXTRA "Installing C library headers"
    1.92  
    1.93 -    if grep -q GLIBC_2.3 "${CT_SRC_DIR}/${CT_LIBC_FILE}/ChangeLog"; then
    1.94 +    if grep -q GLIBC_2.3 "${CT_SRC_DIR}/glibc-${CT_LIBC_VERSION}/ChangeLog"; then
    1.95          # glibc-2.3.x passes cross options to $(CC) when generating errlist-compat.c,
    1.96          # which fails without a real cross-compiler.
    1.97          # Fortunately, we don't need errlist-compat.c, since we just need .h
    1.98 @@ -172,7 +175,7 @@
    1.99      # See e.g. http://gcc.gnu.org/ml/gcc/2002-01/msg00900.html
   1.100      mkdir -p "${CT_HEADERS_DIR}/gnu"
   1.101      CT_DoExecLog ALL touch "${CT_HEADERS_DIR}/gnu/stubs.h"
   1.102 -    CT_DoExecLog ALL cp -v "${CT_SRC_DIR}/${CT_LIBC_FILE}/include/features.h"  \
   1.103 +    CT_DoExecLog ALL cp -v "${CT_SRC_DIR}/glibc-${CT_LIBC_VERSION}/include/features.h"  \
   1.104                             "${CT_HEADERS_DIR}/features.h"
   1.105  
   1.106      # Building the bootstrap gcc requires either setting inhibit_libc, or
   1.107 @@ -187,20 +190,20 @@
   1.108      [ "${CT_ARCH}" != "arm" ] && CT_DoExecLog ALL cp -v misc/syscall-list.h "${CT_HEADERS_DIR}/bits/syscall.h" || true
   1.109  
   1.110      # Those headers are to be manually copied so gcc can build properly
   1.111 -    pthread_h="${CT_SRC_DIR}/${CT_LIBC_FILE}/${CT_THREADS}/sysdeps/pthread/pthread.h"
   1.112 +    pthread_h="${CT_SRC_DIR}/glibc-${CT_LIBC_VERSION}/${CT_THREADS}/sysdeps/pthread/pthread.h"
   1.113      pthreadtypes_h=
   1.114      case "${CT_THREADS}" in
   1.115          nptl)
   1.116              # NOTE: for some archs, the pathes are different, but they are not
   1.117              # supported by crosstool-NG right now. See original crosstool when they are.
   1.118 -            pthread_h="${CT_SRC_DIR}/${CT_LIBC_FILE}/${CT_THREADS}/sysdeps/pthread/pthread.h"
   1.119 -            pthreadtypes_h="${CT_SRC_DIR}/${CT_LIBC_FILE}/nptl/sysdeps/unix/sysv/linux/${CT_KERNEL_ARCH}/bits/pthreadtypes.h"
   1.120 +            pthread_h="${CT_SRC_DIR}/glibc-${CT_LIBC_VERSION}/${CT_THREADS}/sysdeps/pthread/pthread.h"
   1.121 +            pthreadtypes_h="${CT_SRC_DIR}/glibc-${CT_LIBC_VERSION}/nptl/sysdeps/unix/sysv/linux/${CT_KERNEL_ARCH}/bits/pthreadtypes.h"
   1.122              if [ ! -f "${pthreadtypes_h}" ]; then
   1.123 -                pthreadtypes_h="${CT_SRC_DIR}/${CT_LIBC_FILE}/${CT_LIBC}-ports-${CT_LIBC_VERSION}/sysdeps/unix/sysv/linux/${CT_KERNEL_ARCH}/nptl/bits/pthreadtypes.h"
   1.124 +                pthreadtypes_h="${CT_SRC_DIR}/glibc-${CT_LIBC_VERSION}/ports/sysdeps/unix/sysv/linux/${CT_KERNEL_ARCH}/nptl/bits/pthreadtypes.h"
   1.125              fi
   1.126              ;;
   1.127          linuxthreads)
   1.128 -            pthreadtypes_h="${CT_SRC_DIR}/${CT_LIBC_FILE}/linuxthreads/sysdeps/pthread/bits/pthreadtypes.h"
   1.129 +            pthreadtypes_h="${CT_SRC_DIR}/glibc-${CT_LIBC_VERSION}/linuxthreads/sysdeps/pthread/bits/pthreadtypes.h"
   1.130              ;;
   1.131          *)
   1.132              pthread_h=
   1.133 @@ -292,7 +295,7 @@
   1.134      AR=${CT_TARGET}-ar                                              \
   1.135      RANLIB=${CT_TARGET}-ranlib                                      \
   1.136      CT_DoExecLog ALL                                                \
   1.137 -    "${CT_SRC_DIR}/${CT_LIBC_FILE}/configure"                       \
   1.138 +    "${CT_SRC_DIR}/glibc-${CT_LIBC_VERSION}/configure"              \
   1.139          --prefix=/usr                                               \
   1.140          --build="${CT_BUILD}"                                       \
   1.141          --host=${CT_TARGET}                                         \
   1.142 @@ -420,7 +423,7 @@
   1.143      AR=${CT_TARGET}-ar                                              \
   1.144      RANLIB=${CT_TARGET}-ranlib                                      \
   1.145      CT_DoExecLog ALL                                                \
   1.146 -    "${CT_SRC_DIR}/${CT_LIBC_FILE}/configure"                       \
   1.147 +    "${CT_SRC_DIR}/glibc-${CT_LIBC_VERSION}/configure"              \
   1.148          --prefix=/usr                                               \
   1.149          --build=${CT_BUILD}                                         \
   1.150          --host=${CT_TARGET}                                         \
   1.151 @@ -434,7 +437,7 @@
   1.152          ${extra_config}                                             \
   1.153          ${CT_LIBC_GLIBC_EXTRA_CONFIG}
   1.154  
   1.155 -    if grep -l '^install-lib-all:' "${CT_SRC_DIR}/${CT_LIBC_FILE}/Makerules" > /dev/null; then
   1.156 +    if grep -l '^install-lib-all:' "${CT_SRC_DIR}/glibc-${CT_LIBC_VERSION}/Makerules" > /dev/null; then
   1.157          # nptl-era glibc.
   1.158          # If the install-lib-all target (which is added by our make-install-lib-all.patch)
   1.159          # is present, it means we're building glibc-2.3.3 or later, and we can't