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:
Alyssa Ross
2024-10-10 12:51:42 +02:00
parent 2c7cf748ec
commit e178cc0dcd
+5 -3
View File
@@ -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}";