mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-24 16:03:23 +00:00
Merging the ghdl-wrapper and gcc-wrapper into one.
I will remove the ghdl-wrapper files later, if all this works. svn path=/nixpkgs/branches/stdenv-updates/; revision=19493
This commit is contained in:
parent
e72908036f
commit
08eb3243c9
@ -42,6 +42,9 @@ else
|
||||
gccLDFlags="$gccLDFlags -L$gcc/lib64"
|
||||
fi
|
||||
gccLDFlags="$gccLDFlags -L$gcc/lib"
|
||||
if [ -n "$langVhdl" ]; then
|
||||
gccLDFlags="$gccLDFlags -L$zlib/lib"
|
||||
fi
|
||||
echo "$gccLDFlags" > $out/nix-support/gcc-ldflags
|
||||
|
||||
# GCC shows $gcc/lib in `gcc -print-search-dirs', but not
|
||||
@ -154,6 +157,11 @@ mkGnatWrapper $out/bin/gnatmake $gccPath/gnatmake || true
|
||||
mkGnatWrapper $out/bin/gnatbind $gccPath/gnatbind || true
|
||||
mkGnatLinkWrapper $out/bin/gnatlink $gccPath/gnatlink || true
|
||||
|
||||
if [ -f $gccPath/ghdl ]; then
|
||||
ln -sf $gccPath/ghdl $out/bin/ghdl
|
||||
fi
|
||||
|
||||
|
||||
# Create a symlink to as (the assembler). This is useful when a
|
||||
# gcc-wrapper is installed in a user environment, as it ensures that
|
||||
# the right assembler is called.
|
||||
|
@ -6,13 +6,17 @@
|
||||
# variables so that the compiler and the linker just "work".
|
||||
|
||||
{ name ? "", stdenv, nativeTools, nativeLibc, nativePrefix ? ""
|
||||
, gcc ? null, libc ? null, binutils ? null, coreutils ? null, shell ? ""
|
||||
, gcc ? null, libc ? null, binutils ? null, coreutils ? null, shell ? "",
|
||||
zlib ? null
|
||||
}:
|
||||
|
||||
assert nativeTools -> nativePrefix != "";
|
||||
assert !nativeTools -> gcc != null && binutils != null && coreutils != null;
|
||||
assert !nativeLibc -> libc != null;
|
||||
|
||||
# For ghdl (the vhdl language provider to gcc) we need zlib in the wrapper
|
||||
assert (gcc != null && gcc ? langVhdl) -> zlib != null;
|
||||
|
||||
let
|
||||
|
||||
gccVersion = (builtins.parseDrvName gcc.name).version;
|
||||
@ -44,6 +48,8 @@ stdenv.mkDerivation {
|
||||
langCC = if nativeTools then true else gcc.langCC;
|
||||
langFortran = if nativeTools then false else gcc ? langFortran;
|
||||
langAda = if nativeTools then false else gcc ? langAda;
|
||||
langVhdl = if nativeTools then false else gcc ? langVhdl;
|
||||
zlib = if (gcc != null && gcc ? langVhdl) then zlib else null;
|
||||
shell = if shell == "" then stdenv.shell else shell;
|
||||
|
||||
meta =
|
||||
|
@ -1999,7 +1999,7 @@ let
|
||||
inherit fetchurl stdenv;
|
||||
});
|
||||
|
||||
ghdl = wrapGHDL (import ../development/compilers/gcc-4.3 {
|
||||
ghdl = wrapGCC (import ../development/compilers/gcc-4.3 {
|
||||
inherit stdenv fetchurl texinfo gmp mpfr noSysDirs gnat;
|
||||
name = "ghdl";
|
||||
langVhdl = true;
|
||||
@ -2010,7 +2010,7 @@ let
|
||||
});
|
||||
|
||||
# Not officially supported version for ghdl
|
||||
ghdl_gcc44 = lowPrio (wrapGHDL (import ../development/compilers/gcc-4.4 {
|
||||
ghdl_gcc44 = lowPrio (wrapGCC (import ../development/compilers/gcc-4.4 {
|
||||
inherit stdenv fetchurl texinfo gmp mpfr noSysDirs gnat gettext which
|
||||
ppl cloogppl;
|
||||
name = "ghdl";
|
||||
@ -2351,20 +2351,7 @@ let
|
||||
inherit fetchurl stdenv visualcpp windowssdk;
|
||||
};
|
||||
|
||||
# All these wrappers: GCC, GHDL, should be once merged into
|
||||
# only one.
|
||||
wrapGCCWith = gccWrapper: glibc: baseGCC: gccWrapper {
|
||||
nativeTools = stdenv ? gcc && stdenv.gcc.nativeTools;
|
||||
nativeLibc = stdenv ? gcc && stdenv.gcc.nativeLibc;
|
||||
nativePrefix = if stdenv ? gcc then stdenv.gcc.nativePrefix else "";
|
||||
gcc = baseGCC;
|
||||
libc = glibc;
|
||||
inherit stdenv binutils coreutils;
|
||||
};
|
||||
|
||||
wrapGCC = wrapGCCWith (import ../build-support/gcc-wrapper) glibc;
|
||||
|
||||
wrapGHDLWith = gccWrapper: glibc: baseGCC: gccWrapper {
|
||||
nativeTools = stdenv ? gcc && stdenv.gcc.nativeTools;
|
||||
nativeLibc = stdenv ? gcc && stdenv.gcc.nativeLibc;
|
||||
nativePrefix = if stdenv ? gcc then stdenv.gcc.nativePrefix else "";
|
||||
@ -2373,7 +2360,7 @@ let
|
||||
inherit stdenv binutils coreutils zlib;
|
||||
};
|
||||
|
||||
wrapGHDL = wrapGHDLWith (import ../build-support/ghdl-wrapper) glibc;
|
||||
wrapGCC = wrapGCCWith (import ../build-support/gcc-wrapper) glibc;
|
||||
|
||||
wrapGCCCross =
|
||||
{gcc, libc, binutils, cross, shell ? "", name ? "gcc-cross-wrapper"}:
|
||||
|
Loading…
Reference in New Issue
Block a user