GDB: Allow cross-compilation for GNU.

svn path=/nixpkgs/trunk/; revision=30481
This commit is contained in:
Ludovic Courtès 2011-11-19 18:28:10 +00:00
parent 351ff3583d
commit a148b889f1
2 changed files with 21 additions and 5 deletions

View File

@ -4,16 +4,28 @@
# Set it to true to fetch the latest release/branchpoint from git.
, bleedingEdgeVersion ? false
# Additional dependencies for GNU/Hurd.
, mig ? null, hurd ? null
# needed for the git version
, flex, bison }:
let
basename =
if bleedingEdgeVersion
then "gdb-7.3.20110726"
else "gdb-7.3.1";
basename =
if bleedingEdgeVersion
then "gdb-7.3.20110726"
else "gdb-7.3.1";
# Whether (cross-)building for GNU/Hurd. This is an approximation since
# having `stdenv ? cross' doesn't tell us if we're building `hostDrv' and
# `buildDrv'.
isGNU =
stdenv.system == "i586-pc-gnu"
|| (stdenv ? cross && stdenv.cross.config == "i586-pc-gnu");
in
assert isGNU -> mig != null && hurd != null;
stdenv.mkDerivation rec {
name = basename + stdenv.lib.optionalString (target != null)
("-" + target.config);
@ -34,9 +46,11 @@ stdenv.mkDerivation rec {
# I think python is not a native input, but I leave it
# here while I will not need it cross building
buildNativeInputs = [ texinfo python ]
++ stdenv.lib.optionals bleedingEdgeVersion [ flex bison ];
++ stdenv.lib.optional isGNU mig
++ stdenv.lib.optionals bleedingEdgeVersion [ flex bison ];
buildInputs = [ ncurses readline gmp mpfr expat ]
++ stdenv.lib.optional isGNU hurd
++ stdenv.lib.optional doCheck dejagnu;
configureFlags = with stdenv.lib;

View File

@ -3042,6 +3042,8 @@ let
gdb = callPackage ../development/tools/misc/gdb {
readline = readline5;
hurd = gnu.hurdCross;
inherit (gnu) mig;
};
gdbCross = callPackage ../development/tools/misc/gdb {