scripts/build/libc/glibc.sh
changeset 1759 2e4f5f564362
parent 1747 8e8b72bdcea0
child 1761 88020b2c3246
     1.1 --- a/scripts/build/libc/glibc.sh	Sat Jan 23 18:40:38 2010 +0100
     1.2 +++ b/scripts/build/libc/glibc.sh	Mon Jan 11 22:47:58 2010 +0100
     1.3 @@ -10,67 +10,41 @@
     1.4  
     1.5      addons_list=($(do_libc_add_ons_list " "))
     1.6  
     1.7 -    if [ "${CT_LIBC_GLIBC_TARBALL}" = "y" ]; then
     1.8 -        # Use release tarballs
     1.9 -        CT_GetFile "glibc-${CT_LIBC_VERSION}"               \
    1.10 +    # Main source
    1.11 +    CT_GetFile "glibc-${CT_LIBC_VERSION}"               \
    1.12 +               {ftp,http}://ftp.gnu.org/gnu/glibc       \
    1.13 +               ftp://gcc.gnu.org/pub/glibc/releases     \
    1.14 +               ftp://gcc.gnu.org/pub/glibc/snapshots
    1.15 +
    1.16 +    # C library addons
    1.17 +    for addon in "${addons_list[@]}"; do
    1.18 +        # NPTL addon is not to be downloaded, in any case
    1.19 +        [ "${addon}" = "nptl" ] && continue || true
    1.20 +        CT_GetFile "glibc-${addon}-${CT_LIBC_VERSION}"      \
    1.21                     {ftp,http}://ftp.gnu.org/gnu/glibc       \
    1.22                     ftp://gcc.gnu.org/pub/glibc/releases     \
    1.23                     ftp://gcc.gnu.org/pub/glibc/snapshots
    1.24 -
    1.25 -        # C library addons
    1.26 -        for addon in "${addons_list[@]}"; do
    1.27 -            # NPTL addon is not to be downloaded, in any case
    1.28 -            [ "${addon}" = "nptl" ] && continue || true
    1.29 -            CT_GetFile "glibc-${addon}-${CT_LIBC_VERSION}"      \
    1.30 -                       {ftp,http}://ftp.gnu.org/gnu/glibc       \
    1.31 -                       ftp://gcc.gnu.org/pub/glibc/releases     \
    1.32 -                       ftp://gcc.gnu.org/pub/glibc/snapshots
    1.33 -        done
    1.34 -    elif [ "${CT_LIBC_GLIBC_CVS}" = "y" ]; then
    1.35 -        # Use CVS checkout
    1.36 -        version="${CT_LIBC_VERSION//./_}"
    1.37 -        date="${CT_LIBC_GLIBC_CVS_date}"
    1.38 -
    1.39 -        CT_GetCVS "glibc-cvs-${CT_LIBC_VERSION}"                    \
    1.40 -                  ":pserver:anoncvs@sources.redhat.com:/cvs/glibc"  \
    1.41 -                  "libc"                                            \
    1.42 -                  "glibc-${version}-branch${date:+:}${date}"        \
    1.43 -                  "glibc-cvs-${CT_LIBC_VERSION}"
    1.44 -
    1.45 -        # C library addons
    1.46 -        for addon in "${addons_list[@]}"; do
    1.47 -            # NPTL addon is not to be downloaded, in any case
    1.48 -            [ "${addon}" = "nptl" ] && continue || true
    1.49 -            CT_GetCVS "glibc-${addon}-cvs-${CT_LIBC_VERSION}"           \
    1.50 -                      ":pserver:anoncvs@sources.redhat.com:/cvs/glibc"  \
    1.51 -                      "${addon}"                                        \
    1.52 -                      "glibc-${version}-branch${date:+:}${date}"        \
    1.53 -                      "glibc-${addon}-cvs-${CT_LIBC_VERSION}"
    1.54 -        done
    1.55 -    fi
    1.56 +    done
    1.57  
    1.58      return 0
    1.59  }
    1.60  
    1.61  # Extract glibc
    1.62  do_libc_extract() {
    1.63 -    local cvs
    1.64      local -a addons_list
    1.65  
    1.66      addons_list=($(do_libc_add_ons_list " "))
    1.67  
    1.68 -    [ "${CT_LIBC_GLIBC_CVS}" = "y" ] && cvs="cvs-"
    1.69 +    CT_Extract "glibc-${CT_LIBC_VERSION}"
    1.70  
    1.71 -    CT_Extract "glibc-${cvs}${CT_LIBC_VERSION}"
    1.72 -
    1.73 -    CT_Pushd "${CT_SRC_DIR}/glibc-${cvs}${CT_LIBC_VERSION}"
    1.74 +    CT_Pushd "${CT_SRC_DIR}/glibc-${CT_LIBC_VERSION}"
    1.75      CT_Patch "glibc-${CT_LIBC_VERSION}" nochdir
    1.76  
    1.77      # C library addons
    1.78      for addon in "${addons_list[@]}"; do
    1.79          # NPTL addon is not to be extracted, in any case
    1.80          [ "${addon}" = "nptl" ] && continue || true
    1.81 -        CT_Extract "glibc-${addon}-${cvs}${CT_LIBC_VERSION}" nochdir
    1.82 +        CT_Extract "glibc-${addon}-${CT_LIBC_VERSION}" nochdir
    1.83  
    1.84          # Some addons have the 'long' name, while others have the
    1.85          # 'short' name, but patches are non-uniformly built with
    1.86 @@ -78,8 +52,8 @@
    1.87          # so we have to make symlinks from the existing to the missing
    1.88          # Fortunately for us, [ -d foo ], when foo is a symlink to a
    1.89          # directory, returns true!
    1.90 -        [ -d "${addon}" ] || CT_DoExecLog ALL ln -s "glibc-${addon}-${cvs}${CT_LIBC_VERSION}" "${addon}"
    1.91 -        [ -d "glibc-${addon}-${cvs}${CT_LIBC_VERSION}" ] || CT_DoExecLog ALL ln -s "${addon}" "glibc-${addon}-${cvs}${CT_LIBC_VERSION}"
    1.92 +        [ -d "${addon}" ] || CT_DoExecLog ALL ln -s "glibc-${addon}-${CT_LIBC_VERSION}" "${addon}"
    1.93 +        [ -d "glibc-${addon}-${CT_LIBC_VERSION}" ] || CT_DoExecLog ALL ln -s "${addon}" "glibc-${addon}-${CT_LIBC_VERSION}"
    1.94          CT_Patch "glibc-${addon}-${CT_LIBC_VERSION}" nochdir
    1.95      done
    1.96  
    1.97 @@ -101,14 +75,11 @@
    1.98  
    1.99  # This function installs the glibc headers needed to build the core compiler
   1.100  do_libc_headers() {
   1.101 -    local cvs
   1.102      local -a extra_config
   1.103      local arch4hdrs
   1.104  
   1.105      CT_DoStep INFO "Installing C library headers"
   1.106  
   1.107 -    [ "${CT_LIBC_GLIBC_CVS}" = "y" ] && cvs="cvs-"
   1.108 -
   1.109      mkdir -p "${CT_BUILD_DIR}/build-libc-headers"
   1.110      cd "${CT_BUILD_DIR}/build-libc-headers"
   1.111  
   1.112 @@ -160,7 +131,7 @@
   1.113      libc_cv_mlong_double_128ibm=yes                             \
   1.114      CC=${cross_cc}                                              \
   1.115      CT_DoExecLog ALL                                            \
   1.116 -    "${CT_SRC_DIR}/glibc-${cvs}${CT_LIBC_VERSION}/configure"    \
   1.117 +    "${CT_SRC_DIR}/glibc-${CT_LIBC_VERSION}/configure"          \
   1.118          --build="${CT_BUILD}"                                   \
   1.119          --host="${CT_TARGET}"                                   \
   1.120          --prefix=/usr                                           \
   1.121 @@ -173,7 +144,7 @@
   1.122  
   1.123      CT_DoLog EXTRA "Installing C library headers"
   1.124  
   1.125 -    if grep -q GLIBC_2.3 "${CT_SRC_DIR}/glibc-${cvs}${CT_LIBC_VERSION}/ChangeLog"; then
   1.126 +    if grep -q GLIBC_2.3 "${CT_SRC_DIR}/glibc-${CT_LIBC_VERSION}/ChangeLog"; then
   1.127          # glibc-2.3.x passes cross options to $(CC) when generating errlist-compat.c,
   1.128          # which fails without a real cross-compiler.
   1.129          # Fortunately, we don't need errlist-compat.c, since we just need .h
   1.130 @@ -216,7 +187,7 @@
   1.131      # See e.g. http://gcc.gnu.org/ml/gcc/2002-01/msg00900.html
   1.132      mkdir -p "${CT_HEADERS_DIR}/gnu"
   1.133      CT_DoExecLog ALL touch "${CT_HEADERS_DIR}/gnu/stubs.h"
   1.134 -    CT_DoExecLog ALL cp -v "${CT_SRC_DIR}/glibc-${cvs}${CT_LIBC_VERSION}/include/features.h"  \
   1.135 +    CT_DoExecLog ALL cp -v "${CT_SRC_DIR}/glibc-${CT_LIBC_VERSION}/include/features.h"  \
   1.136                             "${CT_HEADERS_DIR}/features.h"
   1.137  
   1.138      # Building the bootstrap gcc requires either setting inhibit_libc, or
   1.139 @@ -231,20 +202,20 @@
   1.140      [ "${CT_ARCH}" != "arm" ] && CT_DoExecLog ALL cp -v misc/syscall-list.h "${CT_HEADERS_DIR}/bits/syscall.h" || true
   1.141  
   1.142      # Those headers are to be manually copied so gcc can build properly
   1.143 -    pthread_h="${CT_SRC_DIR}/glibc-${cvs}${CT_LIBC_VERSION}/${CT_THREADS}/sysdeps/pthread/pthread.h"
   1.144 +    pthread_h="${CT_SRC_DIR}/glibc-${CT_LIBC_VERSION}/${CT_THREADS}/sysdeps/pthread/pthread.h"
   1.145      pthreadtypes_h=
   1.146      case "${CT_THREADS}" in
   1.147          nptl)
   1.148              # NOTE: for some archs, the pathes are different, but they are not
   1.149              # supported by crosstool-NG right now. See original crosstool when they are.
   1.150 -            pthread_h="${CT_SRC_DIR}/glibc-${cvs}${CT_LIBC_VERSION}/${CT_THREADS}/sysdeps/pthread/pthread.h"
   1.151 -            pthreadtypes_h="${CT_SRC_DIR}/glibc-${cvs}${CT_LIBC_VERSION}/nptl/sysdeps/unix/sysv/linux/${arch4hdrs}/bits/pthreadtypes.h"
   1.152 +            pthread_h="${CT_SRC_DIR}/glibc-${CT_LIBC_VERSION}/${CT_THREADS}/sysdeps/pthread/pthread.h"
   1.153 +            pthreadtypes_h="${CT_SRC_DIR}/glibc-${CT_LIBC_VERSION}/nptl/sysdeps/unix/sysv/linux/${arch4hdrs}/bits/pthreadtypes.h"
   1.154              if [ ! -f "${pthreadtypes_h}" ]; then
   1.155 -                pthreadtypes_h="${CT_SRC_DIR}/glibc-${cvs}${CT_LIBC_VERSION}/ports/sysdeps/unix/sysv/linux/${arch4hdrs}/nptl/bits/pthreadtypes.h"
   1.156 +                pthreadtypes_h="${CT_SRC_DIR}/glibc-${CT_LIBC_VERSION}/ports/sysdeps/unix/sysv/linux/${arch4hdrs}/nptl/bits/pthreadtypes.h"
   1.157              fi
   1.158              ;;
   1.159          linuxthreads)
   1.160 -            pthreadtypes_h="${CT_SRC_DIR}/glibc-${cvs}${CT_LIBC_VERSION}/linuxthreads/sysdeps/pthread/bits/pthreadtypes.h"
   1.161 +            pthreadtypes_h="${CT_SRC_DIR}/glibc-${CT_LIBC_VERSION}/linuxthreads/sysdeps/pthread/bits/pthreadtypes.h"
   1.162              ;;
   1.163          *)
   1.164              pthread_h=
   1.165 @@ -263,7 +234,6 @@
   1.166  
   1.167  # Build and install start files
   1.168  do_libc_start_files() {
   1.169 -    local cvs
   1.170      local -a extra_config
   1.171  
   1.172      # Needed only in the NPTL case. Otherwise, return.
   1.173 @@ -271,8 +241,6 @@
   1.174  
   1.175      CT_DoStep INFO "Installing C library start files"
   1.176  
   1.177 -    [ "${CT_LIBC_GLIBC_CVS}" = "y" ] && cvs="cvs-"
   1.178 -
   1.179      mkdir -p "${CT_BUILD_DIR}/build-libc-startfiles"
   1.180      cd "${CT_BUILD_DIR}/build-libc-startfiles"
   1.181  
   1.182 @@ -332,7 +300,7 @@
   1.183      AR=${CT_TARGET}-ar                                              \
   1.184      RANLIB=${CT_TARGET}-ranlib                                      \
   1.185      CT_DoExecLog ALL                                                \
   1.186 -    "${CT_SRC_DIR}/glibc-${cvs}${CT_LIBC_VERSION}/configure"        \
   1.187 +    "${CT_SRC_DIR}/glibc-${CT_LIBC_VERSION}/configure"              \
   1.188          --prefix=/usr                                               \
   1.189          --build="${CT_BUILD}"                                       \
   1.190          --host=${CT_TARGET}                                         \
   1.191 @@ -364,13 +332,10 @@
   1.192  
   1.193  # This function builds and install the full glibc
   1.194  do_libc() {
   1.195 -    local cvs
   1.196      local -a extra_config
   1.197  
   1.198      CT_DoStep INFO "Installing C library"
   1.199  
   1.200 -    [ "${CT_LIBC_GLIBC_CVS}" = "y" ] && cvs="cvs-"
   1.201 -
   1.202      mkdir -p "${CT_BUILD_DIR}/build-libc"
   1.203      cd "${CT_BUILD_DIR}/build-libc"
   1.204  
   1.205 @@ -458,7 +423,7 @@
   1.206      AR=${CT_TARGET}-ar                                              \
   1.207      RANLIB=${CT_TARGET}-ranlib                                      \
   1.208      CT_DoExecLog ALL                                                \
   1.209 -    "${CT_SRC_DIR}/glibc-${cvs}${CT_LIBC_VERSION}/configure"        \
   1.210 +    "${CT_SRC_DIR}/glibc-${CT_LIBC_VERSION}/configure"              \
   1.211          --prefix=/usr                                               \
   1.212          --build=${CT_BUILD}                                         \
   1.213          --host=${CT_TARGET}                                         \
   1.214 @@ -472,7 +437,7 @@
   1.215          "${extra_config[@]}"                                        \
   1.216          ${CT_LIBC_GLIBC_EXTRA_CONFIG}
   1.217  
   1.218 -    if grep -l '^install-lib-all:' "${CT_SRC_DIR}/glibc-${cvs}${CT_LIBC_VERSION}/Makerules" > /dev/null; then
   1.219 +    if grep -l '^install-lib-all:' "${CT_SRC_DIR}/glibc-${CT_LIBC_VERSION}/Makerules" > /dev/null; then
   1.220          # nptl-era glibc.
   1.221          # If the install-lib-all target (which is added by our make-install-lib-all.patch)
   1.222          # is present, it means we're building glibc-2.3.3 or later, and we can't