diff options
author | Peter Foley <pefoley2@pefoley.com> | 2016-03-23 09:34:12 -0400 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2016-03-30 16:52:36 +0200 |
commit | 4eca5e6a3f4a79bfed985065007cb8fc83476343 (patch) | |
tree | e586f36f3bf7fd0f4d57a8e64448bf23ed2735d6 /winsup/cygwin | |
parent | 31dfc51a361fb96ea2a20e657076f842cac8790d (diff) | |
download | cygnal-4eca5e6a3f4a79bfed985065007cb8fc83476343.tar.gz cygnal-4eca5e6a3f4a79bfed985065007cb8fc83476343.tar.bz2 cygnal-4eca5e6a3f4a79bfed985065007cb8fc83476343.zip |
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>
Diffstat (limited to 'winsup/cygwin')
-rwxr-xr-x | winsup/cygwin/mkvers.sh | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/winsup/cygwin/mkvers.sh b/winsup/cygwin/mkvers.sh index db390871d..9136948dc 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 |