profiles/prefix/cygwin/profile.bashrc: xz-utils need -I, not -isystem
authorMichael Haubenwallner <haubi@gentoo.org>
Thu, 21 Dec 2017 14:13:57 +0000 (15:13 +0100)
committerMichael Haubenwallner <haubi@gentoo.org>
Thu, 21 Dec 2017 14:13:57 +0000 (15:13 +0100)
During bootstrap-prefix.sh we set CPPFLAGS="-isystem .../usr/include",
but on Cygwin xz-utils eventually use the windres compiler, which fails
to understand the -isystem flag.

profiles/prefix/windows/cygwin/profile.bashrc [new file with mode: 0644]

diff --git a/profiles/prefix/windows/cygwin/profile.bashrc b/profiles/prefix/windows/cygwin/profile.bashrc
new file mode 100644 (file)
index 0000000..f016c87
--- /dev/null
@@ -0,0 +1,13 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+if [[ ${CATEGORY}/${PN} == app-arch/xz-utils
+   && ${EBUILD_PHASE} == setup
+   && ${CPPFLAGS} == *-isystem*
+]]; then
+       # During bootstrap-prefix.sh we set CPPFLAGS="-isystem $EPREFIX/usr/include",
+       # but on Cygwin xz-utils eventually does use the windres compiler,
+       # which fails to understand -isystem.
+       # As xz-utils has no need for -isystem here, we can use -I instead.
+       CPPFLAGS=${CPPFLAGS//-isystem /-I}
+fi