3 if [ "$GLIBC_NOLIB64" = "y" ]; then
4 # install x86_64 linker to lib instead of lib64
5 sedit "s/lib64/lib/" sysdeps/unix/sysv/linux/x86_64/ldconfig.h &&
6 sedit "s/264/2/" sysdeps/unix/sysv/linux/x86_64/ldd-rewrite.sed
9 # install x86_64 libraries to lib instead of lib64
10 sedit "s/| x86_64//" sysdeps/unix/sysv/linux/configure &&
11 sedit "s/| x86_64//" sysdeps/unix/sysv/linux/configure.in &&
14 # bug#5570 ccache sometimes has trouble correctly recognising minor differences
15 # in configurations and doesn't force recompile when it should. This stops it from
16 # using the old cache entries.
18 export CCACHE_RECACHE=true &&
23 if [[ "$GLIBC_NPTL" = "y" ]]; then
24 OPTS="$OPTS --enable-add-ons=nptl \
27 elif [[ "$GLIBC_NPTL" = "n" ]]; then
28 OPTS="$OPTS --enable-add-ons=linuxthreads \
31 elif is_gnu_kfbsd ; then
32 OPTS="$OPTS --enable-add-ons=linuxthreads \
41 CFLAGS="-Os $CFLAGS" &&
43 export CFLAGS="${CFLAGS/-ffast-math/}" &&
47 # LD_LIBRARY_PATH includes $PWD bug
49 unset LD_LIBRARY_PATH &&
52 # Setup sanitised glibc-kernel-headers for the glibc compile
54 persistent_add GLIBC_ARCH &&
55 if [[ $(uname -m) = *86_64 ]]; then
57 elif [[ $(uname -m) = ppc ]]; then
59 elif [[ $(uname -m) = *86 ]]; then
61 elif [[ $(uname -m) = *sparc64 ]]; then
63 # If we're not compiling for 64-bit SPARC then we need to use the sparc
64 # headers, not sparc64
66 if echo "$CFLAGS" | grep -q -- "-m64"; then
74 # Fixes from Gentoo's 2.3.3.20040420-r2 ebuild
76 sedit "s:CPPFLAGS += -DHAVE_INITFINI:CPPFLAGS += -DHAVE_INITFINI -fno-pie -fno-PIE:" csu/Makefile
77 export CFLAGS="${CFLAGS/-fcall-used-g7/}"
78 export CFLAGS="$CFLAGS -fcall-used-g6"
79 export CFLAGS="${CFLAGS/-mcpu=v9/}"
80 export CFLAGS="${CFLAGS/-mtune=ultrasparc/}"
81 export CFLAGS="${CFLAGS/-mvis/}"
83 # Setup the HOST properly to insure "sparcv9"
84 # This passes -mcpu=ultrasparc -Wa,-Av9a to the compiler
85 [ "$HOST" = "sparc-unknown-linux-gnu" ] &&
86 export HOST="sparcv9-unknown-linux-gnu" &&
87 [ "$BUILD" = "sparc-unknown-linux-gnu" ] &&
88 export BUILD="sparcv9-unknown-linux-gnu"
89 elif [[ $(uname -m) = *sparc ]]; then
92 # Fixes from Gentoo's 2.3.3.20040420-r2 ebuild
94 sedit "s:CPPFLAGS += -DHAVE_INITFINI:CPPFLAGS += -DHAVE_INITFINI -fno-pie -fno-PIE:" csu/Makefile
95 export CFLAGS="${CFLAGS/-fcall-used-g7/}"
96 export CFLAGS="$CFLAGS -fcall-used-g6"
99 # set the asm headers to point to the correct architecture
101 if is_gnu_kfbsd ; then
104 cd $GLIBC_HEADERS_DIR/include &&
105 ln -sf asm-$GLIBC_ARCH asm
108 # CPPFLAGS setting is needed so the check for cpp works on boxes that don't
109 # have any kernel headers in /usr/include yet
110 export CPPFLAGS="$CPPFLAGS -I$GLIBC_HEADERS_DIR/include" &&
112 # End sanitised glibc-kernel-headers setup
116 # Change to where we're going to actually build
118 cd $SOURCE_DIRECTORY.bld &&
121 # Configure glibc to use the sanitised headers
122 # http://bugs.sourcemage.org/show_bug.cgi?id=7560
124 if is_gnu_kfbsd ; then
125 $SOURCE_DIRECTORY/configure --host=$HOST \
128 --infodir=/usr/share/info \
129 --mandir=/usr/share/man \
136 $SOURCE_DIRECTORY/configure --host=$HOST \
139 --infodir=/usr/share/info \
140 --mandir=/usr/share/man \
145 --with-headers=$GLIBC_HEADERS_DIR/include \