summaryrefslogtreecommitdiff
path: root/scripts/build
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/build')
-rw-r--r--scripts/build/libc/glibc.sh91
1 files changed, 28 insertions, 63 deletions
diff --git a/scripts/build/libc/glibc.sh b/scripts/build/libc/glibc.sh
index 264c75f..c77cfee 100644
--- a/scripts/build/libc/glibc.sh
+++ b/scripts/build/libc/glibc.sh
@@ -10,67 +10,41 @@ do_libc_get() {
addons_list=($(do_libc_add_ons_list " "))
- if [ "${CT_LIBC_GLIBC_TARBALL}" = "y" ]; then
- # Use release tarballs
- CT_GetFile "glibc-${CT_LIBC_VERSION}" \
+ # Main source
+ CT_GetFile "glibc-${CT_LIBC_VERSION}" \
+ {ftp,http}://ftp.gnu.org/gnu/glibc \
+ ftp://gcc.gnu.org/pub/glibc/releases \
+ ftp://gcc.gnu.org/pub/glibc/snapshots
+
+ # C library addons
+ for addon in "${addons_list[@]}"; do
+ # NPTL addon is not to be downloaded, in any case
+ [ "${addon}" = "nptl" ] && continue || true
+ CT_GetFile "glibc-${addon}-${CT_LIBC_VERSION}" \
{ftp,http}://ftp.gnu.org/gnu/glibc \
ftp://gcc.gnu.org/pub/glibc/releases \
ftp://gcc.gnu.org/pub/glibc/snapshots
-
- # C library addons
- for addon in "${addons_list[@]}"; do
- # NPTL addon is not to be downloaded, in any case
- [ "${addon}" = "nptl" ] && continue || true
- CT_GetFile "glibc-${addon}-${CT_LIBC_VERSION}" \
- {ftp,http}://ftp.gnu.org/gnu/glibc \
- ftp://gcc.gnu.org/pub/glibc/releases \
- ftp://gcc.gnu.org/pub/glibc/snapshots
- done
- elif [ "${CT_LIBC_GLIBC_CVS}" = "y" ]; then
- # Use CVS checkout
- version="${CT_LIBC_VERSION//./_}"
- date="${CT_LIBC_GLIBC_CVS_date}"
-
- CT_GetCVS "glibc-cvs-${CT_LIBC_VERSION}" \
- ":pserver:anoncvs@sources.redhat.com:/cvs/glibc" \
- "libc" \
- "glibc-${version}-branch${date:+:}${date}" \
- "glibc-cvs-${CT_LIBC_VERSION}"
-
- # C library addons
- for addon in "${addons_list[@]}"; do
- # NPTL addon is not to be downloaded, in any case
- [ "${addon}" = "nptl" ] && continue || true
- CT_GetCVS "glibc-${addon}-cvs-${CT_LIBC_VERSION}" \
- ":pserver:anoncvs@sources.redhat.com:/cvs/glibc" \
- "${addon}" \
- "glibc-${version}-branch${date:+:}${date}" \
- "glibc-${addon}-cvs-${CT_LIBC_VERSION}"
- done
- fi
+ done
return 0
}
# Extract glibc
do_libc_extract() {
- local cvs
local -a addons_list
addons_list=($(do_libc_add_ons_list " "))
- [ "${CT_LIBC_GLIBC_CVS}" = "y" ] && cvs="cvs-"
-
- CT_Extract "glibc-${cvs}${CT_LIBC_VERSION}"
+ CT_Extract "glibc-${CT_LIBC_VERSION}"
- CT_Pushd "${CT_SRC_DIR}/glibc-${cvs}${CT_LIBC_VERSION}"
+ CT_Pushd "${CT_SRC_DIR}/glibc-${CT_LIBC_VERSION}"
CT_Patch "glibc-${CT_LIBC_VERSION}" nochdir
# C library addons
for addon in "${addons_list[@]}"; do
# NPTL addon is not to be extracted, in any case
[ "${addon}" = "nptl" ] && continue || true
- CT_Extract "glibc-${addon}-${cvs}${CT_LIBC_VERSION}" nochdir
+ CT_Extract "glibc-${addon}-${CT_LIBC_VERSION}" nochdir
# Some addons have the 'long' name, while others have the
# 'short' name, but patches are non-uniformly built with
@@ -78,8 +52,8 @@ do_libc_extract() {
# so we have to make symlinks from the existing to the missing
# Fortunately for us, [ -d foo ], when foo is a symlink to a
# directory, returns true!
- [ -d "${addon}" ] || CT_DoExecLog ALL ln -s "glibc-${addon}-${cvs}${CT_LIBC_VERSION}" "${addon}"
- [ -d "glibc-${addon}-${cvs}${CT_LIBC_VERSION}" ] || CT_DoExecLog ALL ln -s "${addon}" "glibc-${addon}-${cvs}${CT_LIBC_VERSION}"
+ [ -d "${addon}" ] || CT_DoExecLog ALL ln -s "glibc-${addon}-${CT_LIBC_VERSION}" "${addon}"
+ [ -d "glibc-${addon}-${CT_LIBC_VERSION}" ] || CT_DoExecLog ALL ln -s "${addon}" "glibc-${addon}-${CT_LIBC_VERSION}"
CT_Patch "glibc-${addon}-${CT_LIBC_VERSION}" nochdir
done
@@ -101,14 +75,11 @@ do_libc_check_config() {
# This function installs the glibc headers needed to build the core compiler
do_libc_headers() {
- local cvs
local -a extra_config
local arch4hdrs
CT_DoStep INFO "Installing C library headers"
- [ "${CT_LIBC_GLIBC_CVS}" = "y" ] && cvs="cvs-"
-
mkdir -p "${CT_BUILD_DIR}/build-libc-headers"
cd "${CT_BUILD_DIR}/build-libc-headers"
@@ -160,7 +131,7 @@ do_libc_headers() {
libc_cv_mlong_double_128ibm=yes \
CC=${cross_cc} \
CT_DoExecLog ALL \
- "${CT_SRC_DIR}/glibc-${cvs}${CT_LIBC_VERSION}/configure" \
+ "${CT_SRC_DIR}/glibc-${CT_LIBC_VERSION}/configure" \
--build="${CT_BUILD}" \
--host="${CT_TARGET}" \
--prefix=/usr \
@@ -173,7 +144,7 @@ do_libc_headers() {
CT_DoLog EXTRA "Installing C library headers"
- if grep -q GLIBC_2.3 "${CT_SRC_DIR}/glibc-${cvs}${CT_LIBC_VERSION}/ChangeLog"; then
+ if grep -q GLIBC_2.3 "${CT_SRC_DIR}/glibc-${CT_LIBC_VERSION}/ChangeLog"; then
# glibc-2.3.x passes cross options to $(CC) when generating errlist-compat.c,
# which fails without a real cross-compiler.
# Fortunately, we don't need errlist-compat.c, since we just need .h
@@ -216,7 +187,7 @@ do_libc_headers() {
# See e.g. http://gcc.gnu.org/ml/gcc/2002-01/msg00900.html
mkdir -p "${CT_HEADERS_DIR}/gnu"
CT_DoExecLog ALL touch "${CT_HEADERS_DIR}/gnu/stubs.h"
- CT_DoExecLog ALL cp -v "${CT_SRC_DIR}/glibc-${cvs}${CT_LIBC_VERSION}/include/features.h" \
+ CT_DoExecLog ALL cp -v "${CT_SRC_DIR}/glibc-${CT_LIBC_VERSION}/include/features.h" \
"${CT_HEADERS_DIR}/features.h"
# Building the bootstrap gcc requires either setting inhibit_libc, or
@@ -231,20 +202,20 @@ do_libc_headers() {
[ "${CT_ARCH}" != "arm" ] && CT_DoExecLog ALL cp -v misc/syscall-list.h "${CT_HEADERS_DIR}/bits/syscall.h" || true
# Those headers are to be manually copied so gcc can build properly
- pthread_h="${CT_SRC_DIR}/glibc-${cvs}${CT_LIBC_VERSION}/${CT_THREADS}/sysdeps/pthread/pthread.h"
+ pthread_h="${CT_SRC_DIR}/glibc-${CT_LIBC_VERSION}/${CT_THREADS}/sysdeps/pthread/pthread.h"
pthreadtypes_h=
case "${CT_THREADS}" in
nptl)
# NOTE: for some archs, the pathes are different, but they are not
# supported by crosstool-NG right now. See original crosstool when they are.
- pthread_h="${CT_SRC_DIR}/glibc-${cvs}${CT_LIBC_VERSION}/${CT_THREADS}/sysdeps/pthread/pthread.h"
- pthreadtypes_h="${CT_SRC_DIR}/glibc-${cvs}${CT_LIBC_VERSION}/nptl/sysdeps/unix/sysv/linux/${arch4hdrs}/bits/pthreadtypes.h"
+ pthread_h="${CT_SRC_DIR}/glibc-${CT_LIBC_VERSION}/${CT_THREADS}/sysdeps/pthread/pthread.h"
+ pthreadtypes_h="${CT_SRC_DIR}/glibc-${CT_LIBC_VERSION}/nptl/sysdeps/unix/sysv/linux/${arch4hdrs}/bits/pthreadtypes.h"
if [ ! -f "${pthreadtypes_h}" ]; then
- pthreadtypes_h="${CT_SRC_DIR}/glibc-${cvs}${CT_LIBC_VERSION}/ports/sysdeps/unix/sysv/linux/${arch4hdrs}/nptl/bits/pthreadtypes.h"
+ pthreadtypes_h="${CT_SRC_DIR}/glibc-${CT_LIBC_VERSION}/ports/sysdeps/unix/sysv/linux/${arch4hdrs}/nptl/bits/pthreadtypes.h"
fi
;;
linuxthreads)
- pthreadtypes_h="${CT_SRC_DIR}/glibc-${cvs}${CT_LIBC_VERSION}/linuxthreads/sysdeps/pthread/bits/pthreadtypes.h"
+ pthreadtypes_h="${CT_SRC_DIR}/glibc-${CT_LIBC_VERSION}/linuxthreads/sysdeps/pthread/bits/pthreadtypes.h"
;;
*)
pthread_h=
@@ -263,7 +234,6 @@ do_libc_headers() {
# Build and install start files
do_libc_start_files() {
- local cvs
local -a extra_config
# Needed only in the NPTL case. Otherwise, return.
@@ -271,8 +241,6 @@ do_libc_start_files() {
CT_DoStep INFO "Installing C library start files"
- [ "${CT_LIBC_GLIBC_CVS}" = "y" ] && cvs="cvs-"
-
mkdir -p "${CT_BUILD_DIR}/build-libc-startfiles"
cd "${CT_BUILD_DIR}/build-libc-startfiles"
@@ -332,7 +300,7 @@ do_libc_start_files() {
AR=${CT_TARGET}-ar \
RANLIB=${CT_TARGET}-ranlib \
CT_DoExecLog ALL \
- "${CT_SRC_DIR}/glibc-${cvs}${CT_LIBC_VERSION}/configure" \
+ "${CT_SRC_DIR}/glibc-${CT_LIBC_VERSION}/configure" \
--prefix=/usr \
--build="${CT_BUILD}" \
--host=${CT_TARGET} \
@@ -364,13 +332,10 @@ do_libc_start_files() {
# This function builds and install the full glibc
do_libc() {
- local cvs
local -a extra_config
CT_DoStep INFO "Installing C library"
- [ "${CT_LIBC_GLIBC_CVS}" = "y" ] && cvs="cvs-"
-
mkdir -p "${CT_BUILD_DIR}/build-libc"
cd "${CT_BUILD_DIR}/build-libc"
@@ -458,7 +423,7 @@ do_libc() {
AR=${CT_TARGET}-ar \
RANLIB=${CT_TARGET}-ranlib \
CT_DoExecLog ALL \
- "${CT_SRC_DIR}/glibc-${cvs}${CT_LIBC_VERSION}/configure" \
+ "${CT_SRC_DIR}/glibc-${CT_LIBC_VERSION}/configure" \
--prefix=/usr \
--build=${CT_BUILD} \
--host=${CT_TARGET} \
@@ -472,7 +437,7 @@ do_libc() {
"${extra_config[@]}" \
${CT_LIBC_GLIBC_EXTRA_CONFIG}
- if grep -l '^install-lib-all:' "${CT_SRC_DIR}/glibc-${cvs}${CT_LIBC_VERSION}/Makerules" > /dev/null; then
+ if grep -l '^install-lib-all:' "${CT_SRC_DIR}/glibc-${CT_LIBC_VERSION}/Makerules" > /dev/null; then
# nptl-era glibc.
# If the install-lib-all target (which is added by our make-install-lib-all.patch)
# is present, it means we're building glibc-2.3.3 or later, and we can't