public inbox for cygwin-cvs@sourceware.org
help / color / mirror / Atom feed
* [newlib-cygwin] Use just-built gcc for windres
@ 2016-03-30 15:07 Corinna Vinschen
0 siblings, 0 replies; only message in thread
From: Corinna Vinschen @ 2016-03-30 15:07 UTC (permalink / raw)
To: cygwin-cvs
https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=4eca5e6a3f4a79bfed985065007cb8fc83476343
commit 4eca5e6a3f4a79bfed985065007cb8fc83476343
Author: Peter Foley <pefoley2@pefoley.com>
Date: Wed Mar 23 09:34:12 2016 -0400
Use just-built gcc for windres
When building cygwin in a combined tree with binutils,
the just-built windres cannot find the just-buit gcc automatically.
Parse the CC env variable to use the correct compiler, rather then
falling back to the build-system's gcc which does not define the proper
preprocessor macros.
winsup/cygwin/ChangeLog
mkvers.sh: Manually specify preprocessor based on $CC
Signed-off-by: Peter Foley <pefoley2@pefoley.com>
Diff:
---
winsup/cygwin/mkvers.sh | 21 ++++++++++++++++++++-
1 file changed, 20 insertions(+), 1 deletion(-)
diff --git a/winsup/cygwin/mkvers.sh b/winsup/cygwin/mkvers.sh
index db39087..9136948 100755
--- a/winsup/cygwin/mkvers.sh
+++ b/winsup/cygwin/mkvers.sh
@@ -37,6 +37,25 @@ done
echo "**** Couldn't open file '$incfile'. Aborting."
}
+function parse_preproc_flags() {
+ # Since we're manually specifying the preprocessor, pass the default flags normally defined.
+ ccflags="--preprocessor=$1 --preprocessor-arg=-E --preprocessor-arg=-xc-header --define=RC_INVOKED "
+ shift
+ while [ -n "$*" ]; do
+ case "$1" in
+ # We need to be able to find the just-built cc1 binary.
+ -B*)
+ ccflags="$ccflags --preprocessor-arg=$1"
+ ;;
+ esac
+ shift
+ done
+}
+
+parse_preproc_flags $CC
+
+
+
#
# Load the current date so we can work on individual fields
#
@@ -166,4 +185,4 @@ fi
echo "Version $cygwin_ver"
set -$- $builddate
-$windres $iflags --define CYGWIN_BUILD_DATE="$1" --define CYGWIN_BUILD_TIME="$2" --define CYGWIN_BUILD_YEAR=$y --define CYGWIN_VERSION='"'"$cygwin_ver"'"' $rcfile winver.o
+$windres $iflags $ccflags --define CYGWIN_BUILD_DATE="$1" --define CYGWIN_BUILD_TIME="$2" --define CYGWIN_BUILD_YEAR=$y --define CYGWIN_VERSION='"'"$cygwin_ver"'"' $rcfile winver.o
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2016-03-30 15:07 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-30 15:07 [newlib-cygwin] Use just-built gcc for windres Corinna Vinschen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).