summaryrefslogtreecommitdiffstats
path: root/cygwin-scripts.sh
diff options
context:
space:
mode:
authorYaakov Selkowitz <yselkowi@redhat.com>2015-06-10 21:34:45 -0500
committerYaakov Selkowitz <yselkowi@redhat.com>2015-06-10 22:01:33 -0500
commite979c27cc7ee25671d41b74a8f984c6193601526 (patch)
tree480d7a37c3f6c48a51001f9ecc39e1af902d6d62 /cygwin-scripts.sh
parent2f10a21419b83fd2c221e933ee4e8d7897beb053 (diff)
downloadcygwin-filesystem-e979c27cc7ee25671d41b74a8f984c6193601526.tar.gz
cygwin-filesystem-e979c27cc7ee25671d41b74a8f984c6193601526.tar.xz
cygwin-filesystem-e979c27cc7ee25671d41b74a8f984c6193601526.zip
Prevent CFLAGS and CXXFLAGS from being set when using CMake wrappers
Based on mingw-filesystem commit 7daa0102535b1ab53bc40d97bb5aa0e30489e00e.
Diffstat (limited to 'cygwin-scripts.sh')
-rwxr-xr-xcygwin-scripts.sh9
1 files changed, 9 insertions, 0 deletions
diff --git a/cygwin-scripts.sh b/cygwin-scripts.sh
index ef2345a..1a0324f 100755
--- a/cygwin-scripts.sh
+++ b/cygwin-scripts.sh
@@ -30,6 +30,15 @@ else
NAME="`basename $0|tr -- - _`"
fi
+# When using the CMake wrappers, prevent CFLAGS and CXXFLAGS from being set
+# unless they're already set in the current environment (RHBZ #1136069)
+if [[ $NAME == *cmake* ]] ; then
+ CYGWIN32_CFLAGS=${CYGWIN32_CFLAGS:-""}
+ CYGWIN32_CXXFLAGS=${CYGWIN32_CXXFLAGS:-""}
+ CYGWIN64_CFLAGS=${CYGWIN64_CFLAGS:-""}
+ CYGWIN64_CXXFLAGS=${CYGWIN64_CXXFLAGS:-""}
+fi
+
# NOTE: The use of 'eval' in combination with '$@' is a potential security risk
# We should find a more safe replacement for this command
# Suggestions are welcome at the Fedora MinGW mailing list