gsm: fix cross with Clang
"clang" is not the correct value for CC when cross compiling — it should be the prefixed, wrapped clang for the host platform. Let's force the use of our original CC in all cases. The default flags of -ansi -pedantic don't matter to us — it builds fine without -ansi, and -pedantic doesn't really belong in a package build. This is probably why the author put them in CC to begin with. There's also no need tot modify the Makefile to change = to ?=, as = variables can be overridden on the command line.
This commit is contained in:
@@ -18,8 +18,6 @@ stdenv.mkDerivation rec {
|
||||
};
|
||||
|
||||
patchPhase = ''
|
||||
substituteInPlace Makefile \
|
||||
--replace "= gcc " "?= gcc "
|
||||
# Fix include directory
|
||||
sed -e 's,$(GSM_INSTALL_ROOT)/inc,$(GSM_INSTALL_ROOT)/include/gsm,' -i Makefile
|
||||
'' + optionalString (!staticSupport) (
|
||||
@@ -37,10 +35,14 @@ stdenv.mkDerivation rec {
|
||||
''
|
||||
);
|
||||
|
||||
preBuild = ''
|
||||
makeFlagsArray+=(CC="$CC")
|
||||
'';
|
||||
|
||||
makeFlags = [
|
||||
"SHELL=${stdenv.shell}"
|
||||
"INSTALL_ROOT=$(out)"
|
||||
] ++ optional stdenv.cc.isClang "CC=clang";
|
||||
];
|
||||
|
||||
preInstall = "mkdir -p $out/{bin,lib,man/man1,man/man3,include/gsm}";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user