ghc: Fix env vars and configure flags to be weird
GHC currently handles this stuff in a quite non-standard way, basically taking prog var `FOO` to mean `FOO_FROM_TARGET`. It's because it (wrongly) thinks from stage 2's perspective.
This commit is contained in:
parent
e760de8108
commit
bd0de2f1cb
@ -87,7 +87,22 @@ stdenv.mkDerivation rec {
|
|||||||
./relocation.patch
|
./relocation.patch
|
||||||
];
|
];
|
||||||
|
|
||||||
|
# GHC is a bit confused on its cross terminology.
|
||||||
preConfigure = ''
|
preConfigure = ''
|
||||||
|
for env in $(env | grep '^TARGET_' | sed -E 's|\+?=.*||'); do
|
||||||
|
export "''${env#TARGET_}=''${!env}"
|
||||||
|
done
|
||||||
|
# GHC is a bit confused on its cross terminology, as these would normally be
|
||||||
|
# the *host* tools.
|
||||||
|
export CC="${targetCC}/bin/${targetCC.targetPrefix}cc"
|
||||||
|
export CXX="${targetCC}/bin/${targetCC.targetPrefix}cxx"
|
||||||
|
export LD="${targetCC.bintools}/bin/${targetCC.bintools.targetPrefix}ld"
|
||||||
|
export AS="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}as"
|
||||||
|
export AR="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}ar"
|
||||||
|
export NM="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}nm"
|
||||||
|
export RANLIB="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}ranlib"
|
||||||
|
export READELF="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}readelf"
|
||||||
|
export STRIP="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}strip"
|
||||||
echo -n "${buildMK}" > mk/build.mk
|
echo -n "${buildMK}" > mk/build.mk
|
||||||
sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure
|
sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure
|
||||||
'' + stdenv.lib.optionalString (!stdenv.isDarwin) ''
|
'' + stdenv.lib.optionalString (!stdenv.isDarwin) ''
|
||||||
|
@ -79,7 +79,22 @@ stdenv.mkDerivation rec {
|
|||||||
++ stdenv.lib.optional stdenv.isLinux ./ghc-no-madv-free.patch
|
++ stdenv.lib.optional stdenv.isLinux ./ghc-no-madv-free.patch
|
||||||
++ stdenv.lib.optional stdenv.isDarwin ./ghc-8.0.2-no-cpp-warnings.patch;
|
++ stdenv.lib.optional stdenv.isDarwin ./ghc-8.0.2-no-cpp-warnings.patch;
|
||||||
|
|
||||||
|
# GHC is a bit confused on its cross terminology.
|
||||||
preConfigure = ''
|
preConfigure = ''
|
||||||
|
for env in $(env | grep '^TARGET_' | sed -E 's|\+?=.*||'); do
|
||||||
|
export "''${env#TARGET_}=''${!env}"
|
||||||
|
done
|
||||||
|
# GHC is a bit confused on its cross terminology, as these would normally be
|
||||||
|
# the *host* tools.
|
||||||
|
export CC="${targetCC}/bin/${targetCC.targetPrefix}cc"
|
||||||
|
export CXX="${targetCC}/bin/${targetCC.targetPrefix}cxx"
|
||||||
|
export LD="${targetCC.bintools}/bin/${targetCC.bintools.targetPrefix}ld"
|
||||||
|
export AS="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}as"
|
||||||
|
export AR="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}ar"
|
||||||
|
export NM="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}nm"
|
||||||
|
export RANLIB="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}ranlib"
|
||||||
|
export READELF="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}readelf"
|
||||||
|
export STRIP="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}strip"
|
||||||
echo -n "${buildMK}" > mk/build.mk
|
echo -n "${buildMK}" > mk/build.mk
|
||||||
sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure
|
sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure
|
||||||
'' + stdenv.lib.optionalString (!stdenv.isDarwin) ''
|
'' + stdenv.lib.optionalString (!stdenv.isDarwin) ''
|
||||||
|
@ -82,7 +82,23 @@ stdenv.mkDerivation rec {
|
|||||||
|
|
||||||
postPatch = "patchShebangs .";
|
postPatch = "patchShebangs .";
|
||||||
|
|
||||||
|
# GHC is a bit confused on its cross terminology.
|
||||||
preConfigure = ''
|
preConfigure = ''
|
||||||
|
for env in $(env | grep '^TARGET_' | sed -E 's|\+?=.*||'); do
|
||||||
|
export "''${env#TARGET_}=''${!env}"
|
||||||
|
done
|
||||||
|
# GHC is a bit confused on its cross terminology, as these would normally be
|
||||||
|
# the *host* tools.
|
||||||
|
export CC="${targetCC}/bin/${targetCC.targetPrefix}cc"
|
||||||
|
export CXX="${targetCC}/bin/${targetCC.targetPrefix}cxx"
|
||||||
|
export LD="${targetCC.bintools}/bin/${targetCC.bintools.targetPrefix}ld"
|
||||||
|
export AS="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}as"
|
||||||
|
export AR="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}ar"
|
||||||
|
export NM="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}nm"
|
||||||
|
export RANLIB="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}ranlib"
|
||||||
|
export READELF="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}readelf"
|
||||||
|
export STRIP="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}strip"
|
||||||
|
|
||||||
echo -n "${buildMK}" > mk/build.mk
|
echo -n "${buildMK}" > mk/build.mk
|
||||||
sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure
|
sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure
|
||||||
'' + stdenv.lib.optionalString (!stdenv.isDarwin) ''
|
'' + stdenv.lib.optionalString (!stdenv.isDarwin) ''
|
||||||
|
@ -84,7 +84,23 @@ stdenv.mkDerivation rec {
|
|||||||
|
|
||||||
postPatch = "patchShebangs .";
|
postPatch = "patchShebangs .";
|
||||||
|
|
||||||
|
# GHC is a bit confused on its cross terminology.
|
||||||
preConfigure = ''
|
preConfigure = ''
|
||||||
|
for env in $(env | grep '^TARGET_' | sed -E 's|\+?=.*||'); do
|
||||||
|
export "''${env#TARGET_}=''${!env}"
|
||||||
|
done
|
||||||
|
# GHC is a bit confused on its cross terminology, as these would normally be
|
||||||
|
# the *host* tools.
|
||||||
|
export CC="${targetCC}/bin/${targetCC.targetPrefix}cc"
|
||||||
|
export CXX="${targetCC}/bin/${targetCC.targetPrefix}cxx"
|
||||||
|
export LD="${targetCC.bintools}/bin/${targetCC.bintools.targetPrefix}ld"
|
||||||
|
export AS="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}as"
|
||||||
|
export AR="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}ar"
|
||||||
|
export NM="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}nm"
|
||||||
|
export RANLIB="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}ranlib"
|
||||||
|
export READELF="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}readelf"
|
||||||
|
export STRIP="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}strip"
|
||||||
|
|
||||||
echo -n "${buildMK}" > mk/build.mk
|
echo -n "${buildMK}" > mk/build.mk
|
||||||
echo ${version} >VERSION
|
echo ${version} >VERSION
|
||||||
echo ${rev} >GIT_COMMIT_ID
|
echo ${rev} >GIT_COMMIT_ID
|
||||||
|
@ -84,7 +84,23 @@ stdenv.mkDerivation rec {
|
|||||||
|
|
||||||
postPatch = "patchShebangs .";
|
postPatch = "patchShebangs .";
|
||||||
|
|
||||||
|
# GHC is a bit confused on its cross terminology.
|
||||||
preConfigure = ''
|
preConfigure = ''
|
||||||
|
for env in $(env | grep '^TARGET_' | sed -E 's|\+?=.*||'); do
|
||||||
|
export "''${env#TARGET_}=''${!env}"
|
||||||
|
done
|
||||||
|
# GHC is a bit confused on its cross terminology, as these would normally be
|
||||||
|
# the *host* tools.
|
||||||
|
export CC="${targetCC}/bin/${targetCC.targetPrefix}cc"
|
||||||
|
export CXX="${targetCC}/bin/${targetCC.targetPrefix}cxx"
|
||||||
|
export LD="${targetCC.bintools}/bin/${targetCC.bintools.targetPrefix}ld"
|
||||||
|
export AS="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}as"
|
||||||
|
export AR="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}ar"
|
||||||
|
export NM="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}nm"
|
||||||
|
export RANLIB="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}ranlib"
|
||||||
|
export READELF="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}readelf"
|
||||||
|
export STRIP="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}strip"
|
||||||
|
|
||||||
echo -n "${buildMK}" > mk/build.mk
|
echo -n "${buildMK}" > mk/build.mk
|
||||||
echo ${version} >VERSION
|
echo ${version} >VERSION
|
||||||
echo ${rev} >GIT_COMMIT_ID
|
echo ${rev} >GIT_COMMIT_ID
|
||||||
|
Loading…
x
Reference in New Issue
Block a user