about summary refs log tree commit diff
path: root/pkgs/tools/misc/getopt/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/tools/misc/getopt/default.nix')
-rw-r--r--pkgs/tools/misc/getopt/default.nix4
1 files changed, 4 insertions, 0 deletions
diff --git a/pkgs/tools/misc/getopt/default.nix b/pkgs/tools/misc/getopt/default.nix
index c3b94465aea1a..2090fcbd7aacf 100644
--- a/pkgs/tools/misc/getopt/default.nix
+++ b/pkgs/tools/misc/getopt/default.nix
@@ -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"