GMP 5.0.3: Fix FreeBSD builds.

svn path=/nixpkgs/trunk/; revision=33748
This commit is contained in:
Ludovic Courtès 2012-04-11 16:38:21 +00:00
parent 8b0bc7a745
commit 52f4dd95d4

View file

@ -1,6 +1,6 @@
{ stdenv, fetchurl, m4, cxx ? true }:
stdenv.mkDerivation rec {
stdenv.mkDerivation (rec {
name = "gmp-5.0.3";
src = fetchurl {
@ -51,3 +51,21 @@ stdenv.mkDerivation rec {
platforms = stdenv.lib.platforms.all;
};
}
//
(if stdenv.isFreeBSD
then {
# On FreeBSD, GMP's `config.guess' detects the sub-architecture (e.g.,
# "k8") and generates code specific to that sub-architecture, in spite of
# `--enable-fat', leading to illegal instructions and similar errors on
# machines with a different sub-architecture.
# See <http://hydra.nixos.org/build/2269915/nixlog/1/raw>, for an example.
# Thus, use GNU's standard `config.guess' so that it assumes the generic
# architecture (e.g., "x86_64").
preConfigure =
'' rm config.guess && ln -s configfsf.guess config.guess
chmod +x configfsf.guess.
'';
}
else { }))