mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-11-14 15:36:47 +03:00
getopt: fix build on clang 16
Normally, when getopt builds on a non-glibc platform, it uses C library headers without including them. That’s fine unless your compiler is clang 16, which is strict about using functions without prototypes. Fortunately, Darwin’s headers are compatible enough as are Musl’s, so defining `__GNU_LIBRARY__` can be done unconditionally.
This commit is contained in:
parent
323e9a44c2
commit
b7d4d9f519
@ -8,6 +8,10 @@ stdenv.mkDerivation rec {
|
||||
sha256 = "1zn5kp8ar853rin0ay2j3p17blxy16agpp8wi8wfg4x98b31vgyh";
|
||||
};
|
||||
|
||||
# This should be fine on Linux and Darwin. Clang 16 requires it because otherwise getopt will
|
||||
# attempt to use C library functions without declaring them, which is raised as an error.
|
||||
env.NIX_CFLAGS_COMPILE = "-D__GNU_LIBRARY__";
|
||||
|
||||
makeFlags = [
|
||||
"WITHOUT_GETTEXT=1"
|
||||
"LIBCGETOPT=0"
|
||||
|
Loading…
Reference in New Issue
Block a user