Making the definition of the cross compiling target an attribute set.

svn path=/nixpkgs/branches/stdenv-updates/; revision=18378
This commit is contained in:
Lluís Batlle i Rossell
2009-11-16 23:21:13 +00:00
parent d82c7e0a69
commit 2c7fa189fb
11 changed files with 51 additions and 42 deletions

View File

@@ -40,7 +40,7 @@ if test "$noSysDirs" = "1"; then
export NIX_EXTRA_LDFLAGS="$NIX_EXTRA_LDFLAGS -Wl,$i"
done
if test -n "$cross"; then
if test -n "$crossConfig"; then
if test -z "$crossStageStatic"; then
extraXCFlags="-B${glibcCross}/lib -idirafter ${glibcCross}/include"
extraXLDFlags="-L${glibcCross}/lib"
@@ -71,7 +71,7 @@ if test "$noSysDirs" = "1"; then
)
fi
if test -n "$cross" -a "$crossStageStatic" == 1; then
if test -n "$crossConfig" -a "$crossStageStatic" == 1; then
# We don't want the gcc build to assume there will be a libc providing
# limits.h in this stagae
makeFlagsArray=( \
@@ -86,8 +86,8 @@ if test "$noSysDirs" = "1"; then
fi
fi
if test -n "$cross"; then
# The host stripp will destroy everything in the target binaries otherwise
if test -n "$crossConfig"; then
# The host strip will destroy everything in the target binaries otherwise
dontStrip=1
fi
@@ -126,13 +126,13 @@ postInstall() {
done
# gcc will look for the binutils there, called through collect2
if test -n "$cross"; then
ln -s $binutilsCross/$cross/bin $out/$cross/bin
if test -n "$crossConfig"; then
ln -s $binutilsCross/$crossConfig/bin $out/$crossConfig/bin
fi
}
if test -z "$cross"; then
if test -z "$crossConfig"; then
if test -z "$profiledCompiler"; then
buildFlags="bootstrap $buildFlags"
else

View File

@@ -27,7 +27,7 @@ with stdenv.lib;
let
version = "4.3.4";
crossConfigureFlags =
"--target=${cross}" +
"--target=${cross.config}" +
(if crossStageStatic then
" --disable-libssp --disable-nls" +
" --without-headers" +
@@ -43,7 +43,7 @@ let
);
stageNameAddon = if (crossStageStatic) then "-stage-static" else
"-stage-final";
crossNameAddon = if (cross != null) then "-${cross}" + stageNameAddon else "";
crossNameAddon = if (cross != null) then "-${cross.config}" + stageNameAddon else "";
in
@@ -76,8 +76,9 @@ stdenv.mkDerivation ({
++ optional (noSysDirs && langFortran) ./no-sys-dirs-fortran.patch
++ optional langJava ./java-jvgenmain-link.patch;
inherit noSysDirs profiledCompiler staticCompiler cross crossStageStatic
inherit noSysDirs profiledCompiler staticCompiler crossStageStatic
binutilsCross glibcCross;
crossConfig = if (cross != null) then cross.config else null;
buildInputs = [texinfo gmp mpfr]
++ (optionals langTreelang [bison flex])