cc-wrapper: add cygwin libc to dll path

Co-authored-by: Brian McKenna <brian@brianmckenna.org>

Changed files
+13 -6
pkgs
build-support
cc-wrapper
+13 -6
pkgs/build-support/cc-wrapper/default.nix
···
libc_dev = optionalString (libc != null) (getDev libc);
libc_lib = optionalString (libc != null) (getLib libc);
cc_solib = getLib cc + optionalString (targetPlatform != hostPlatform) "/${targetPlatform.config}";
+
cc_bin = getBin cc + optionalString (targetPlatform != hostPlatform) "/${targetPlatform.config}";
# The wrapper scripts use 'cat' and 'grep', so we may need coreutils.
coreutils_bin = optionalString (!nativeTools) (getBin coreutils);
···
]
++ optional (cc.langC or true) ./setup-hook.sh
++ optional (cc.langFortran or false) ./fortran-hook.sh
-
++ optional (targetPlatform.isWindows) (
+
++ optional (targetPlatform.isWindows || targetPlatform.isCygwin) (
stdenvNoCC.mkDerivation {
name = "win-dll-hook.sh";
dontUnpack = true;
-
installPhase = ''
-
echo addToSearchPath "LINK_DLL_FOLDERS" "${cc_solib}/lib" > $out
-
echo addToSearchPath "LINK_DLL_FOLDERS" "${cc_solib}/lib64" >> $out
-
echo addToSearchPath "LINK_DLL_FOLDERS" "${cc_solib}/lib32" >> $out
-
'';
+
installPhase =
+
if targetPlatform.isCygwin then
+
''
+
echo addToSearchPath "LINK_DLL_FOLDERS" "${cc_bin}/lib" >> $out
+
''
+
else
+
''
+
echo addToSearchPath "LINK_DLL_FOLDERS" "${cc_solib}/lib" > $out
+
echo addToSearchPath "LINK_DLL_FOLDERS" "${cc_solib}/lib64" >> $out
+
echo addToSearchPath "LINK_DLL_FOLDERS" "${cc_solib}/lib32" >> $out
+
'';
}
);