mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-25 08:23:09 +00:00
perl: fix cross compiling (#348666)
This commit is contained in:
commit
59b63e5e98
@ -106,12 +106,11 @@ stdenv.mkDerivation (rec {
|
||||
"-Dman1dir=${placeholder "out"}/share/man/man1"
|
||||
"-Dman3dir=${placeholder "out"}/share/man/man3"
|
||||
] ++
|
||||
(if stdenv.hostPlatform.isStatic
|
||||
(if (stdenv.cc.targetPrefix != "")
|
||||
then [
|
||||
"-Dcc=${stdenv.cc.targetPrefix}cc"
|
||||
"-Dnm=${stdenv.cc.targetPrefix}nm"
|
||||
"-Dar=${stdenv.cc.targetPrefix}ar"
|
||||
"-Uusedl"
|
||||
]
|
||||
else [
|
||||
"-Dcc=cc"
|
||||
@ -123,6 +122,7 @@ stdenv.mkDerivation (rec {
|
||||
"-Dlocincpth=${libcInc}/include"
|
||||
"-Dloclibpth=${libcLib}/lib"
|
||||
]
|
||||
++ lib.optional stdenv.hostPlatform.isStatic "-Uusedl"
|
||||
++ lib.optionals ((builtins.match ''5\.[0-9]*[13579]\..+'' version) != null) [ "-Dusedevel" "-Uversiononly" ]
|
||||
++ lib.optional stdenv.hostPlatform.isSunOS "-Dcc=gcc"
|
||||
++ lib.optional enableThreading "-Dusethreads"
|
||||
@ -135,7 +135,8 @@ stdenv.mkDerivation (rec {
|
||||
|
||||
configureScript = lib.optionalString (!crossCompiling) "${stdenv.shell} ./Configure";
|
||||
|
||||
postConfigure = lib.optionalString stdenv.hostPlatform.isStatic ''
|
||||
# !canExecute cross uses miniperl which doesn't have this
|
||||
postConfigure = lib.optionalString (!crossCompiling && stdenv.cc.targetPrefix != "") ''
|
||||
substituteInPlace Makefile \
|
||||
--replace-fail "AR = ar" "AR = ${stdenv.cc.targetPrefix}ar"
|
||||
'';
|
||||
|
Loading…
Reference in New Issue
Block a user