From owner-freebsd-ports@FreeBSD.ORG Sat Jan 31 07:50:16 2015 Return-Path: Delivered-To: ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 21BE558C; Sat, 31 Jan 2015 07:50:16 +0000 (UTC) Received: from ipmail06.adl6.internode.on.net (ipmail06.adl6.internode.on.net [150.101.137.145]) by mx1.freebsd.org (Postfix) with ESMTP id 7515BB39; Sat, 31 Jan 2015 07:50:14 +0000 (UTC) Received: from ppp118-210-27-239.lns20.adl2.internode.on.net (HELO leader.local) ([118.210.27.239]) by ipmail06.adl6.internode.on.net with ESMTP; 31 Jan 2015 18:20:13 +1030 Message-ID: <54CC8935.5020906@ShaneWare.Biz> Date: Sat, 31 Jan 2015 18:20:13 +1030 From: Shane Ambler User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Don Lewis Subject: Re: testing the value of ${CXX} in ports Makefile References: <201501310025.t0V0PtRi017513@gw.catspoiler.org> In-Reply-To: <201501310025.t0V0PtRi017513@gw.catspoiler.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Cc: ports@FreeBSD.org X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Jan 2015 07:50:16 -0000 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