How to set CFLAGS for the build step?

Max Laier max at love2party.net
Fri Apr 4 13:10:06 UTC 2008


On Friday 04 April 2008 14:21:23 Dirk Meyer wrote:
> Max Laier schrieb:,
>
> > Okay, this doesn't help one bit - sorry.  Or are you suggesting that
> > I simply disregard user-set CFLAGS in make.conf by using /dev/null as
> > make.conf?  This seems to contradict
> > http://www.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/dad
> >s-cflags.html
>
> Only on first glance.
>
> the modified CFLAGS should conatin the definition in /etc/make.conf
> from the run of the port Makefile.
> Then it is passed down in enviroment to bsdmake and the makefile
> of the distribution.
>
> Example: mail/spamilter
>
> $ make -V CFLAGS -f /dev/null
> -O -pipe -march=pentiumpro
> $ make -V MAKE_ENV
> [...] __MAKE_CONF=/dev/null [...] CFLAGS="-O -pipe -march=pentiumpro "
> [...] $ make -V MAKE_ENV WITH_SENDMAIL_PORT=1
> [...] __MAKE_CONF=/dev/null [...] CFLAGS="-O -pipe -march=pentiumpro 
> -I/usr/local/include" [...]
>
> The makefile of the distribution don't have to include make.conf.
> To honor CC/CFLAGS/LDFLAGS ...., they have to be passed in the
> enviroment.

Okay ... so the attached should fix my problem, right?  But it seems that 
I'd have to anticipate what kind of settings a user wants in their 
make.conf, wouldn't I?  While CFLAGS seems to be passed magically, CC or 
LDFLAGS are not.  I don't care all that much as long as it works for me, 
but it seems broken.

> Either unmodified or modified.

-- 
/"\  Best regards,                      | mlaier at freebsd.org
\ /  Max Laier                          | ICQ #67774661
 X   http://pf4freebsd.love2party.net/  | mlaier at EFnet
/ \  ASCII Ribbon Campaign              | Against HTML Mail and News
-------------- next part --------------
Index: Makefile
===================================================================
RCS file: /home/mlaier/fcvs/ports/sysutils/pftop/Makefile,v
retrieving revision 1.10
diff -u -r1.10 Makefile
--- Makefile	1 Apr 2008 15:10:34 -0000	1.10
+++ Makefile	4 Apr 2008 13:02:17 -0000
@@ -40,6 +40,8 @@
 CFLAGS+=	-DHAVE_ALTQ=1
 .endif
 
+MAKE_ENV+=	__MAKE_CONF=/dev/null
+
 PLIST_FILES=	sbin/pftop
 
 post-patch:


More information about the freebsd-ports mailing list