3
0
Fork 0
forked from mirrors/nixpkgs

* Added GCC (C and C++ variant; include libstdc++).

svn path=/nixpkgs/trunk/; revision=314
This commit is contained in:
Eelco Dolstra 2003-08-18 17:49:30 +00:00
parent 185464700d
commit d343a357f1
7 changed files with 39 additions and 6 deletions

View file

@ -9,7 +9,7 @@ sed \
-e s^@OUT\@^$out^g \
< $setup > $out/setup || exit 1
gcc=/usr/bin/gcc
gcc='$NIX_CC'
sed \
-e s^@GCC\@^$gcc^g \
@ -18,10 +18,10 @@ chmod +x $out/bin/gcc || exit 1
ln -s gcc $out/bin/cc
gplusplus=/usr/bin/g++
gcc='$NIX_CXX'
sed \
-e s^@GCC\@^$gplusplus^g \
-e s^@GCC\@^$gcc^g \
< $gccwrapper > $out/bin/g++ || exit 1
chmod +x $out/bin/g++ || exit 1

View file

@ -2,8 +2,6 @@
IFS=
realgcc=@GCC@
justcompile=0
for i in $@; do
if test "$i" == "-c"; then
@ -34,4 +32,4 @@ if test "$NIX_DEBUG" == "1"; then
fi
IFS=
exec $realgcc $@ ${extra[@]}
exec @GCC@ $@ ${extra[@]}

10
pkgs/gcc/gcc-build.sh Executable file
View file

@ -0,0 +1,10 @@
#! /bin/sh
. $stdenv/setup || exit 1
tar xvfj $src || exit 1
mkdir build || exit 1
cd build || exit 1
../gcc-*/configure --prefix=$out --enable-languages=c,c++ || exit 1
make bootstrap || exit 1
make install || exit 1

13
pkgs/gcc/gcc.fix Normal file
View file

@ -0,0 +1,13 @@
Package(
[ ("name", "gcc-3.3.1")
, ("build", Relative("gcc/gcc-build.sh"))
, ("src", Call(IncludeFix("fetchurl/fetchurl.fix"),
[ ("url", "ftp://ftp.nluug.nl/pub/gnu/gcc/gcc-3.3.1/gcc-3.3.1.tar.bz2")
, ("md5", "1135a104e9fa36fdf7c663598fab5c40")
]))
, ("stdenv", IncludeFix("stdenv-linux/stdenv-nativetools.fix"))
]
)

View file

@ -2,5 +2,7 @@
export NIX_CFLAGS="-isystem @GLIBC@/include $NIX_CFLAGS"
export NIX_LDFLAGS="-L @GLIBC@/lib -Wl,-dynamic-linker,@GLIBC@/lib/ld-linux.so.2,-rpath,@GLIBC@/lib $NIX_LDFLAGS"
export NIX_CC=@CC@
export NIX_CXX=@CXX@
export PATH=@PATH@

View file

@ -6,6 +6,9 @@ mkdir $out || exit 1
if test "$nativeTools" == 1; then
p='$PATH:/usr/local/bin:/usr/bin:/bin'
cc=/usr/bin/gcc
cxx=/usr/bin/g++
else
p=
first=1
@ -18,12 +21,17 @@ else
p=$p$i/bin
done
p=$p':$PATH'
cc=$gcc/bin/gcc
cxx=$gcc/bin/g++
fi
echo "########## $p"
sed \
-e s^@GLIBC\@^$glibc^g \
-e s^@CC\@^$cc^g \
-e s^@CXX\@^$cxx^g \
-e s^@BASEENV\@^$baseenv^g \
-e s^@PATH\@^$p^g \
< $setup > $out/setup || exit 1

View file

@ -20,6 +20,8 @@ Function(["nativeTools"],
, IncludeFix("gzip/gzip.fix")
, IncludeFix("gnumake/gnumake.fix")
]))
, ("gcc", If(Var("nativeTools"), "", IncludeFix("gcc/gcc.fix")))
]
)
)