Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 31 Jan 2015 18:20:13 +1030
From:      Shane Ambler <FreeBSD@ShaneWare.Biz>
To:        Don Lewis <truckman@FreeBSD.org>
Cc:        ports@FreeBSD.org
Subject:   Re: testing the value of ${CXX} in ports Makefile
Message-ID:  <54CC8935.5020906@ShaneWare.Biz>
In-Reply-To: <201501310025.t0V0PtRi017513@gw.catspoiler.org>
References:  <201501310025.t0V0PtRi017513@gw.catspoiler.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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


-- 
FreeBSD - the place to B...Software Developing

Shane Ambler




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?54CC8935.5020906>