lua: use stdenv.cc.targetPrefix
This evaluates to an empty string when not cross compiling, so by using this instead of stdenv.hostPlatform.config we can eliminate a conditional.
This commit is contained in:
parent
8abdf1db65
commit
25d4f0d334
@ -54,17 +54,15 @@ self = stdenv.mkDerivation rec {
|
|||||||
"LDFLAGS=-fPIC"
|
"LDFLAGS=-fPIC"
|
||||||
"V=${luaversion}"
|
"V=${luaversion}"
|
||||||
"PLAT=${plat}"
|
"PLAT=${plat}"
|
||||||
] ++ (if stdenv.buildPlatform != stdenv.hostPlatform then [
|
"CC=${stdenv.cc.targetPrefix}cc"
|
||||||
"CC=${stdenv.hostPlatform.config}-gcc"
|
"RANLIB=${stdenv.cc.targetPrefix}ranlib"
|
||||||
"RANLIB=${stdenv.hostPlatform.config}-ranlib"
|
];
|
||||||
] else [])
|
|
||||||
;
|
|
||||||
|
|
||||||
configurePhase = ''
|
configurePhase = ''
|
||||||
runHook preConfigure
|
runHook preConfigure
|
||||||
|
|
||||||
makeFlagsArray+=(CFLAGS='-O2 -fPIC${lib.optionalString compat " -DLUA_COMPAT_ALL"} $(SYSCFLAGS)' )
|
makeFlagsArray+=(CFLAGS='-O2 -fPIC${lib.optionalString compat " -DLUA_COMPAT_ALL"} $(SYSCFLAGS)' )
|
||||||
makeFlagsArray+=(${lib.optionalString stdenv.isDarwin "CC=\"$CC\""}${lib.optionalString (stdenv.buildPlatform != stdenv.hostPlatform) " 'AR=${stdenv.hostPlatform.config}-ar rcu'"})
|
makeFlagsArray+=(${lib.optionalString stdenv.isDarwin "CC=\"$CC\""}${lib.optionalString (stdenv.buildPlatform != stdenv.hostPlatform) " 'AR=${stdenv.cc.targetPrefix}ar rcu'"})
|
||||||
|
|
||||||
installFlagsArray=( TO_BIN="lua luac" INSTALL_DATA='cp -d' \
|
installFlagsArray=( TO_BIN="lua luac" INSTALL_DATA='cp -d' \
|
||||||
TO_LIB="${if stdenv.isDarwin then "liblua.${version}.dylib" else "liblua.a liblua.so liblua.so.${luaversion} liblua.so.${version}"}" )
|
TO_LIB="${if stdenv.isDarwin then "liblua.${version}.dylib" else "liblua.a liblua.so liblua.so.${luaversion} liblua.so.${version}"}" )
|
||||||
|
Loading…
x
Reference in New Issue
Block a user