* The build of User Mode Linux 2.4.19 fails because the GCC people

thought that it was a good idea to remove support for multi-line
  string literals, which Linux uses.  Added an older GCC to build
  `legacy' software.

svn path=/nixpkgs/trunk/; revision=389
This commit is contained in:
Eelco Dolstra 2003-09-12 10:19:47 +00:00
parent 34dfe18660
commit 64c25128bc
2 changed files with 63 additions and 0 deletions

50
pkgs/gcc-2.95/gcc-build.sh Executable file
View File

@ -0,0 +1,50 @@
#! /bin/sh
. $stdenv/setup || exit 1
export PATH=$binutils/bin:$PATH
tar xvfz $src || exit 1
# Disable the standard include directories.
cd gcc-* || exit 1
cat >> ./gcc/cppdefault.h <<EOF
#undef LOCAL_INCLUDE_DIR
#undef SYSTEM_INCLUDE_DIR
#undef STANDARD_INCLUDE_DIR
EOF
cd .. || exit 1
# Configure.
mkdir build || exit 1
cd build || exit 1
../gcc-*/configure --prefix=$out --enable-languages=c || exit 1
# Patch some of the makefiles to force linking against our own glibc.
extraflags="-Wl,-s $NIX_CFLAGS_COMPILE $NIX_CFLAGS_LINK"
for i in $NIX_LDFLAGS; do
extraflags="$extraflags -Wl,$i"
done
mf=Makefile
sed \
-e "s^FLAGS_FOR_TARGET =\(.*\)^FLAGS_FOR_TARGET = \1 $extraflags^" \
< $mf > $mf.tmp || exit 1
mv $mf.tmp $mf
mf=gcc/Makefile
sed \
-e "s^X_CFLAGS =\(.*\)^X_CFLAGS = \1 $extraflags^" \
< $mf > $mf.tmp || exit 1
mv $mf.tmp $mf
# Patch gcc/Makefile to prevent fixinc.sh from "fixing" system header files
# from /usr/include.
mf=gcc/Makefile
sed \
-e "s^NATIVE_SYSTEM_HEADER_DIR =\(.*\)^NATIVE_SYSTEM_HEADER_DIR = /fixinc-disabled^" \
< $mf > $mf.tmp || exit 1
mv $mf.tmp $mf
# Build and install.
make bootstrap || exit 1
make install || exit 1

13
pkgs/gcc-2.95/gcc.fix Normal file
View File

@ -0,0 +1,13 @@
Package(
[ ("name", "gcc-2.95.3")
, ("build", Relative("gcc-2.95/gcc-build.sh"))
, ("src", Call(IncludeFix("fetchurl/fetchurl.fix"),
[ ("url", "ftp://ftp.nluug.nl/pub/gnu/gcc/gcc-2.95.3/gcc-2.95.3.tar.gz")
, ("md5", "f3ad4f32c2296fad758ed051b5ac8e28")
]))
, ("stdenv", IncludeFix("stdenv/stdenv.fix"))
]
)