Making the definition of the cross compiling target an attribute set.
svn path=/nixpkgs/branches/stdenv-updates/; revision=18378
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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])
|
||||
|
||||
@@ -29,7 +29,7 @@ preConfigure() {
|
||||
|
||||
tar xvjf "$srcPorts"
|
||||
|
||||
if test -n "$cross"; then
|
||||
if test -n "$crossConfig"; then
|
||||
sed -i s/-lgcc_eh//g Makeconfig
|
||||
fi
|
||||
|
||||
@@ -37,16 +37,16 @@ preConfigure() {
|
||||
cd build
|
||||
|
||||
configureScript=../configure
|
||||
if test -n "$cross"; then
|
||||
if test -n "$crossConfig"; then
|
||||
cat > config.cache << "EOF"
|
||||
libc_cv_forced_unwind=yes
|
||||
libc_cv_c_cleanup=yes
|
||||
libc_cv_gnu89_inline=yes
|
||||
EOF
|
||||
export BUILD_CC=gcc
|
||||
export CC="${cross}-gcc"
|
||||
export AR="${cross}-ar"
|
||||
export RANLIB="${cross}-ranlib"
|
||||
export CC="${crossConfig}-gcc"
|
||||
export AR="${crossConfig}-ar"
|
||||
export RANLIB="${crossConfig}-ranlib"
|
||||
configureFlags="${configureFlags} --cache-file=config.cache"
|
||||
|
||||
# The host stripp will destroy everything in the target binaries otherwise
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
name = "glibc-2.9" +
|
||||
stdenv.lib.optionalString (cross != null) "-${cross}";
|
||||
stdenv.lib.optionalString (cross != null) "-${cross.config}";
|
||||
|
||||
builder = ./builder.sh;
|
||||
|
||||
@@ -22,7 +22,8 @@ stdenv.mkDerivation rec {
|
||||
sha256 = "0r2sn527wxqifi63di7ns9wbjh1cainxn978w178khhy7yw9fk42";
|
||||
};
|
||||
|
||||
inherit kernelHeaders installLocales cross;
|
||||
inherit kernelHeaders installLocales;
|
||||
crossConfig = if (cross != null) then cross.config else null;
|
||||
|
||||
inherit (stdenv) is64bit;
|
||||
|
||||
@@ -67,7 +68,7 @@ stdenv.mkDerivation rec {
|
||||
"--with-headers=${kernelHeaders}/include"
|
||||
(if profilingLibraries then "--enable-profile" else "--disable-profile")
|
||||
] ++ stdenv.lib.optionals (cross != null) [
|
||||
"--host=${cross}"
|
||||
"--host=${cross.config}"
|
||||
"--build=${stdenv.system}"
|
||||
"--with-tls"
|
||||
"--enable-kernel=2.6.0"
|
||||
|
||||
@@ -4,7 +4,7 @@ let
|
||||
basename = "binutils-2.20";
|
||||
in
|
||||
stdenv.mkDerivation rec {
|
||||
name = basename + stdenv.lib.optionalString (cross != null) "-${cross}";
|
||||
name = basename + stdenv.lib.optionalString (cross != null) "-${cross.config}";
|
||||
|
||||
src = fetchurl {
|
||||
url = "mirror://gnu/binutils/${basename}.tar.bz2";
|
||||
@@ -28,7 +28,7 @@ stdenv.mkDerivation rec {
|
||||
'';
|
||||
|
||||
configureFlags = "--disable-werror" # needed for dietlibc build
|
||||
+ stdenv.lib.optionalString (cross != null) " --target=${cross}";
|
||||
+ stdenv.lib.optionalString (cross != null) " --target=${cross.config}";
|
||||
|
||||
meta = {
|
||||
description = "GNU Binutils, tools for manipulating binaries (linker, assembler, etc.)";
|
||||
|
||||
Reference in New Issue
Block a user