How set CFLAGS for individual port?
Polytropon
freebsd at edvax.de
Tue Jul 14 04:35:21 UTC 2015
On Tue, 14 Jul 2015 09:08:18 +0500, Василий Иванович wrote:
> Hi!
>
> I have a -CURRENT i386 machine. And my make.conf have build options:
> CFLAGS= -Os -pipe
> But some ports not builds by clang 3.6.1 with any optimizations except -O0
> (for example devel/gettext-tools), and solution for older BSD versions:
> .if ${.CURDIR} == "/usr/ports/devel/gettext-tools"
> CFLAGS= -O0 -pipe
> .endif
>
> not works now. It give that error:
> make: "/etc/make.conf" line 26: Unassociated shell command "CFLAGS =
> -O0 -pipe -march=pentium-m"
> make: Fatal errors encountered -- cannot continuemake: "/etc/make.conf"
> line 26: Unassociated shell command "CFLAGS = -O0 -pipe
> -march=pentium-m"
> make: Fatal errors encountered -- cannot continue===>>> Launching 'make
> checksum' for devel/gettext-tools in background
> make: make: ""/etc/make.conf/etc/make.conf" line 26: " line 26:
> Unassociated shell command "CFLAGS = -O0 -pipe
> -march=pentium-m"Unassociated shell command "CFLAGS = -O0 -pipe
> -march=pentium-m"
>
> make: Fatal errors encountered -- cannot continuemake: Fatal errors
> encountered -- cannot continue
> make: stopped in /usr/ports/devel/gettext-tools
> ===>>> Gathering dependency list for devel/gettext-tools from ports
> make: "/etc/make.conf" line 26: Unassociated shell command "CFLAGS =
> -O0 -pipe -march=pentium-m"
> make: Fatal errors encountered -- cannot continue
> ===>>> Cannot cd to make:
> ===>>> Aborting update
>
> How can i set various build options for individual ports?
Try this:
.if ${.CURDIR:M*/devel/gettext-tools*}
CFLAGS= -O0 -pipe
.endif
This will apply CFLAGS as intended (and therefore discard any
other CFLAGS setting) for the port at its top level as well as
any subdirectories.
--
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...
More information about the freebsd-questions
mailing list