Date: Fri, 20 Aug 2004 10:19:01 -0400 From: Garance A Drosihn <drosih@rpi.edu> To: Oliver Eikemeier <eikemeier@fillmore-labs.com> Cc: current@freebsd.org Subject: Re: setting CFLAGS in /etc/make.conf Message-ID: <p06110402bd4bb6b98783@[128.113.24.47]> In-Reply-To: <A8718F96-F2A1-11D8-A951-00039312D914@fillmore-labs.com> References: <A8718F96-F2A1-11D8-A951-00039312D914@fillmore-labs.com>
next in thread | previous in thread | raw e-mail | index | archive | help
At 2:08 PM +0200 8/20/04, Oliver Eikemeier wrote:
>Garance A Drosihn wrote:
>
>>What I ended up doing was changing the net/cap/Makefile to set
>>CAP_CFLAGS instead of CFLAGS. The distributed net/cap source has
>>a bunch of Makefile.m4 files which are used to generate the real
>>makefiles, and those Makefile.m4 files were already adding a bunch
>>of values to CFLAGS. So, I changed a line (in net/cap/Makefile)
>>from:
>> ${FIND} ${WRKSRC} -name Makefile.m4 \
>> -exec ${REINPLACE_CMD} \
>> -e 's/CFLAGS=/CFLAGS+=/' \{\} \;
>>
>>to:
>> ${FIND} ${WRKSRC} -name Makefile.m4 \
>> -exec ${REINPLACE_CMD} \
>> -e "s/CFLAGS=/CFLAGS+=${CAP_CFLAGS} /" \{\} \;
>
>Jup, but this is hard to generalize.
I think it would be easy to generalize, although for most ports
you probably have to create a patch for the Makefile(s) instead
of using a convenient ${REINPLACE_CMD} command.
In general:
the port makefile should set <portname>_CFLAGS (like "CAP_CFLAGS")
and then change the makefiles distributed with the package
so they have the line "CFLAGS+=<portname>_CFLAGS"
>>I meant to follow up on this issue on the freebsd-ports mailing
>>list, but I guess I never got around to mentioning it. As near as
>>I could tell, it is just a bad idea for a ports-makefile to depend
>>on setting CFLAGS.
>
>Many do, but most just hardcode the CFLAGS value they see in the
>configuration step in the (generated) ports Makefile.
This has the perhaps-unwanted side-effect that you have to 'make clean'
a port any time you change CFLAGS in /etc/make.conf, and you want the
port to pick up that change. That will probably be fine for most users
in most occasions, but occasionally it may cause some confusion.
--
Garance Alistair Drosehn = gad@gilead.netel.rpi.edu
Senior Systems Programmer or gad@freebsd.org
Rensselaer Polytechnic Institute or drosih@rpi.edu
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?p06110402bd4bb6b98783>
