Date: Sun, 1 Feb 2015 14:44:29 -0800 (PST) From: Don Lewis <truckman@FreeBSD.org> To: FreeBSD@shaneware.biz Cc: ports@FreeBSD.org Subject: Re: testing the value of ${CXX} in ports Makefile Message-ID: <201502012244.t11MiTkw032345@gw.catspoiler.org> In-Reply-To: <54CC8935.5020906@ShaneWare.Biz>
next in thread | previous in thread | raw e-mail | index | archive | help
On 31 Jan, Shane Ambler wrote: > On 31/01/2015 10:55, Don Lewis wrote: >> On 31 Jan, Shane Ambler wrote: >>> On 30/01/2015 14:13, Don Lewis wrote: > >> post-patch: >> @echo CXX=${CXX} >> @echo GCC_DEFAULT=${GCC_DEFAULT} >> .if ${CHOSEN_COMPILER_TYPE} == gcc and ${COMPILER_VERSION} == 49 >> @echo g++49 was detected >> .else >> @echo g++49 was not detected >> .endif >> >> # make patch >> make: "/usr/ports/editors/junk/Makefile" line 17: Malformed conditional (${CHOSEN_COMPILER_TYPE} == gcc and ${COMPILER_VERSION} == 49) >> make: Fatal errors encountered -- cannot continue > > yeah my bad - don't know why I typed `and` instead of `&&` > >>> You may also want to consider patching with - >>> >>> #if (__GNUC__ == 4) && (__GNUC_MINOR__ == 9) >>> // 4.9 specific changes >>> #endif >> >> That would work if I was patching C or C++ code, but I'm actually patching >> a file that is used to set the the -O value for CFLAGS. The build stuff >> in the port is pretty strange and uses different optimization levels for >> for different parts of the build and one of choices that it makes >> triggers a code generation bug in gcc 4.9. > > What is the build system used? > > Can the build files do something like > > COMPVERS=`${CXX} --version | grep -e gcc -e 4.9` > if [ ! -z $COMPVERS ] > ${CXX} -O2 > else > ${CXX} -Os > fi As near as I can figure out, it's a mixture of gmake and dmake kicked off by a perl wrapper and both flavors have to be patched. It just seems easier to use four lines of shell code to change two instances of -Os than to try to figure out how to get two different flavors of make to do what I want (and verify that it actually works). I could maybe use the time I save on creating a gcc bug report and getting the compiler fixed.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201502012244.t11MiTkw032345>