From owner-freebsd-ports@freebsd.org Fri Apr 22 03:54:33 2016 Return-Path: Delivered-To: freebsd-ports@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C9789B174BB for ; Fri, 22 Apr 2016 03:54:33 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id B736F12B4 for ; Fri, 22 Apr 2016 03:54:33 +0000 (UTC) (envelope-from julian@freebsd.org) Received: by mailman.ysv.freebsd.org (Postfix) id B692DB174B9; Fri, 22 Apr 2016 03:54:33 +0000 (UTC) Delivered-To: ports@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B6368B174B8 for ; Fri, 22 Apr 2016 03:54:33 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "vps1.elischer.org", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 95FF212B3 for ; Fri, 22 Apr 2016 03:54:33 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from Julian-MBP3.local (50-196-156-133-static.hfc.comcastbusiness.net [50.196.156.133]) (authenticated bits=0) by vps1.elischer.org (8.15.2/8.15.2) with ESMTPSA id u3M3sRaj031891 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Thu, 21 Apr 2016 20:54:31 -0700 (PDT) (envelope-from julian@freebsd.org) Subject: Re: compiling ports with --sysroot= and -isystem To: olli hauer , ports@freebsd.org References: <571986C4.5050303@freebsd.org> <571997EB.9090901@gmx.de> From: Julian Elischer Message-ID: <5719A06D.4050805@freebsd.org> Date: Fri, 22 Apr 2016 11:54:21 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.7.2 MIME-Version: 1.0 In-Reply-To: <571997EB.9090901@gmx.de> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Apr 2016 03:54:33 -0000 On 22/04/2016 11:18 AM, olli hauer wrote: > On 2016-04-22 04:04, Julian Elischer wrote: >> How can I add entries (like the above) to a port compile? >> I want to ADD things to CFLAGS. >> If I add 'CFLAGS=...' to the build (for example, of lsof) it actually replaces all the CFLAGS already there. >> lsof (as the example) uses configure, so I would need to feed the added stuff into configure. Is there a standard way to do this? >> In the environment I'm using, I'm building for a machine that is not the build machine, but an appliance. >> It has a small number of differences in the include file contents, so I want it to compile using a different set of includes than those in /usr/include. >> >> On the other hand I'm building a bunch of tools that do have t orun on the build machine and they need to use the regular /usr/include so I don't really want to replace them.. >> >> >> Julian >> >> p.s. usual "please reply directly" comment applies.. I'm on this list but get it in digest form.. >> > Use the '+=' notation, e.g. > > # Makefile > ... > CFLAGS+= "--sysroot=...." > ... sorry I wasn't clear.. I want to add something to the make command, not edit Makefiles. I could add something to bsd.autotools.mk or some similar Makefile include. but really I want to do it on a case by case basis. there is an averall Makefile (using gmake) that effectively does: cd /usr/ports/$(PORT_DIR); $(BMAKE) $(ARGS) install clean (except it does a lot of them) I want to know what to add to $(ARGS) to make it use the correct include files. my current "work-around" is to do: mv /usr/include /usr/include.hold; ln -s $(STAGING_DIR)/usr/include /usr/include cd /usr/ports/$(PORT_DIR); $(BMAKE) $(ARGS) install clean rm /usr/include; mv /usr/include.hold /usr/include this is *NOT* a clean solution :-) > >