Re: [fbsd] Re: src.conf(5) seems to affect ports build
Ruslan, could you commit this patch, please ? Thank you. Regards, On Fri, Oct 20, 2006 at 11:13:32PM +0400, Ruslan Ermilov wrote: On Fri, Oct 20, 2006 at 05:08:48PM +0200, Jeremie Le Hen wrote: Hi, src.conf(5) manual page states: % The src.conf file contains settings that will apply to every build % involving the FreeBSD source tree; see build(7). % ... % The only purpose of src.conf is to control the compilation of the FreeBSD % sources, which are usually found in /usr/src. However, share/mk/bsd.port.mk includes bsd.own.mk which in turn includes /etc/src.conf. Therefore if I have some WITH_/WITHOUT_ knob in it which affects CFLAGS, they will be taken into account even for port builds. Is it the expected behaviour ? Maybe WITH(OUT)_ should simply avoid modifying CFLAGS (though I think this might become useful in the near future). See if the attached patch helps. If it does, I'll commit. I've never heard back on this patch after I sent it to [EMAIL PROTECTED] Cheers, -- Ruslan Ermilov [EMAIL PROTECTED] FreeBSD committer Index: bsd.own.mk === RCS file: /home/ncvs/src/share/mk/bsd.own.mk,v retrieving revision 1.57 diff -u -p -r1.57 bsd.own.mk --- bsd.own.mk30 Sep 2006 11:32:46 - 1.57 +++ bsd.own.mk30 Sep 2006 20:31:16 - @@ -104,10 +104,12 @@ .if !target(__bsd.own.mk__) __bsd.own.mk__: +.if !defined(_WITHOUT_SRCCONF) SRCCONF?=/etc/src.conf .if exists(${SRCCONF}) .include ${SRCCONF} .endif +.endif # Binaries BINOWN?= root @@ -170,6 +172,7 @@ STRIP?= -s COMPRESS_CMD?= gzip -cn COMPRESS_EXT?= .gz +.if !defined(_WITHOUT_SRCCONF) # # Define MK_* variables (which are either yes or no) for users # to set via WITH_*/WITHOUT_* in /etc/src.conf and override in the @@ -447,5 +450,6 @@ MK_${var}_SUPPORT:= no MK_${var}_SUPPORT:= yes .endif .endfor +.endif # !_WITHOUT_SRCCONF .endif # !target(__bsd.own.mk__) Index: bsd.port.mk === RCS file: /home/ncvs/src/share/mk/bsd.port.mk,v retrieving revision 1.308 diff -u -p -r1.308 bsd.port.mk --- bsd.port.mk 24 Aug 2006 18:04:49 - 1.308 +++ bsd.port.mk 26 Aug 2006 13:55:59 - @@ -3,8 +3,9 @@ PORTSDIR?= /usr/ports BSDPORTMK?= ${PORTSDIR}/Mk/bsd.port.mk -# Needed to keep bsd.own.mk from reading in /etc/src.conf when building ports. -SRCCONF= /dev/null +# Needed to keep bsd.own.mk from reading in /etc/src.conf +# and setting MK_* variables when building ports. +_WITHOUT_SRCCONF= .include bsd.own.mk .include ${BSDPORTMK} -- Jeremie Le Hen jeremie at le-hen dot org ttz at chchile dot org ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: src.conf(5) seems to affect ports build
On Sun, 2006-10-22 at 17:34 +0200, Jeremie Le Hen wrote: Ruslan, On Sat, Oct 21, 2006 at 09:25:33PM +0400, Ruslan Ermilov wrote: Also, your patch avoids performing the WITH(OUT)_* stuff for ports in order to prevent from polluting the namespace. If there is to be some WITH(OUT)_* knobs which leads to CFLAGS modification in the future (I'm thinking about ProPolice with the upcoming GCC 4.1), wouldn't it be worth benefiting this framework for ports ? It avoids only /etc/src.conf stuff when running bsd.port.mk; if you put WITH(OUT)_* in /etc/make.conf it will still be picked up. Yes indeed, but MK_FOO won't be set and this would require to either duplicate the code that modifies CFLAGS, or at least test for MK_FOO or WITH_FOO at the same time. Let me show you an example. I have an additional bsd.ssp.mk that is included from both bsd.sys.mk and bsd.port.mk: % .if ${MK_SSP} != no % SSP_CFLAGS ?= -fstack-protector % CFLAGS += ${SSP_CFLAGS} % . if defined(WARNS) ${WARNS} = 7 !empty(SSP_CFLAGS) % CWARNFLAGS += -Wstack-protector % . endif % .endif Currently it is thus quite useful to use MK_SSP when this file is included from bsd.ports.mk. With your whole patch I would have to either duplicate these bits in bsd.ports.mk or turn the condition to something like: % .if (defined(MK_SSP) ${MK_SSP} != no) || defined(WITH_SSP) What do you advice me to do ? Duplicate it in make.conf at the moment. When prime time comes, send a patch against bsd.port.mk to set CFLAGS accordingly when WITH_SSP is set. I don't know if this will be accepted, but it certainly is better than having src.conf influence bsd.port.mk. -- Florent Thoumie [EMAIL PROTECTED] FreeBSD Committer signature.asc Description: This is a digitally signed message part
Re: src.conf(5) seems to affect ports build
On Sun, Oct 22, 2006 at 05:34:36PM +0200, Jeremie Le Hen wrote: Ruslan, On Sat, Oct 21, 2006 at 09:25:33PM +0400, Ruslan Ermilov wrote: Also, your patch avoids performing the WITH(OUT)_* stuff for ports in order to prevent from polluting the namespace. If there is to be some WITH(OUT)_* knobs which leads to CFLAGS modification in the future (I'm thinking about ProPolice with the upcoming GCC 4.1), wouldn't it be worth benefiting this framework for ports ? It avoids only /etc/src.conf stuff when running bsd.port.mk; if you put WITH(OUT)_* in /etc/make.conf it will still be picked up. Yes indeed, but MK_FOO won't be set and this would require to either duplicate the code that modifies CFLAGS, or at least test for MK_FOO or WITH_FOO at the same time. Let me show you an example. I have an additional bsd.ssp.mk that is included from both bsd.sys.mk and bsd.port.mk: % .if ${MK_SSP} != no % SSP_CFLAGS ?= -fstack-protector % CFLAGS += ${SSP_CFLAGS} % . if defined(WARNS) ${WARNS} = 7 !empty(SSP_CFLAGS) % CWARNFLAGS += -Wstack-protector % . endif % .endif Currently it is thus quite useful to use MK_SSP when this file is included from bsd.ports.mk. With your whole patch I would have to either duplicate these bits in bsd.ports.mk or turn the condition to something like: % .if (defined(MK_SSP) ${MK_SSP} != no) || defined(WITH_SSP) What do you advice me to do ? I still don't understand why my patch created a problem for you. This option is not in bsd.own.mk, so it's not covered by my patch. All my patch does is don't process /etc/src.conf which is entirely for src/. So, you can continue to use your bsd.ssp.mk as before, and my patch shouldn't influence it. If you want to really mimic the standard behavior, then bsd.ssp.mk should check the (WITH|WITHOUT)_SSP set by a user, and set MK_SSP to yes/no, accordingly; setting MK_SSP by a user shouldn't be allowed or supported. You then set WITH_SSP= in /etc/make.conf (or in /etc/src.conf if you want it only for src/), or pass -DWITH_SSP on the make command line, and you're done. P.S. There has been a patch floating around that adds support for /etc/ports.conf. That would allow for clear separation: src.confsrc/ only settings; ports.conf ports/ only settings; make.conf all-time settings, including when building src/ and ports/. Cheers, -- Ruslan Ermilov [EMAIL PROTECTED] FreeBSD committer pgpABFizcnWOK.pgp Description: PGP signature
Re: src.conf(5) seems to affect ports build
On Tue, 2006-10-24 at 17:48 +0400, Ruslan Ermilov wrote: On Sun, Oct 22, 2006 at 05:34:36PM +0200, Jeremie Le Hen wrote: Ruslan, On Sat, Oct 21, 2006 at 09:25:33PM +0400, Ruslan Ermilov wrote: Also, your patch avoids performing the WITH(OUT)_* stuff for ports in order to prevent from polluting the namespace. If there is to be some WITH(OUT)_* knobs which leads to CFLAGS modification in the future (I'm thinking about ProPolice with the upcoming GCC 4.1), wouldn't it be worth benefiting this framework for ports ? It avoids only /etc/src.conf stuff when running bsd.port.mk; if you put WITH(OUT)_* in /etc/make.conf it will still be picked up. Yes indeed, but MK_FOO won't be set and this would require to either duplicate the code that modifies CFLAGS, or at least test for MK_FOO or WITH_FOO at the same time. Let me show you an example. I have an additional bsd.ssp.mk that is included from both bsd.sys.mk and bsd.port.mk: % .if ${MK_SSP} != no % SSP_CFLAGS ?= -fstack-protector % CFLAGS += ${SSP_CFLAGS} % . if defined(WARNS) ${WARNS} = 7 !empty(SSP_CFLAGS) % CWARNFLAGS += -Wstack-protector % . endif % .endif Currently it is thus quite useful to use MK_SSP when this file is included from bsd.ports.mk. With your whole patch I would have to either duplicate these bits in bsd.ports.mk or turn the condition to something like: % .if (defined(MK_SSP) ${MK_SSP} != no) || defined(WITH_SSP) What do you advice me to do ? I still don't understand why my patch created a problem for you. This option is not in bsd.own.mk, so it's not covered by my patch. All my patch does is don't process /etc/src.conf which is entirely for src/. So, you can continue to use your bsd.ssp.mk as before, and my patch shouldn't influence it. If you want to really mimic the standard behavior, then bsd.ssp.mk should check the (WITH|WITHOUT)_SSP set by a user, and set MK_SSP to yes/no, accordingly; setting MK_SSP by a user shouldn't be allowed or supported. You then set WITH_SSP= in /etc/make.conf (or in /etc/src.conf if you want it only for src/), or pass -DWITH_SSP on the make command line, and you're done. P.S. There has been a patch floating around that adds support for /etc/ports.conf. [...] that you sent :-) Could try to revive the thread with a new patch. -- Florent Thoumie [EMAIL PROTECTED] FreeBSD Committer signature.asc Description: This is a digitally signed message part
Re: src.conf(5) seems to affect ports build
On Tue, Oct 24, 2006 at 04:23:40PM +0100, Florent Thoumie wrote: On Tue, 2006-10-24 at 17:48 +0400, Ruslan Ermilov wrote: On Sun, Oct 22, 2006 at 05:34:36PM +0200, Jeremie Le Hen wrote: Ruslan, On Sat, Oct 21, 2006 at 09:25:33PM +0400, Ruslan Ermilov wrote: Also, your patch avoids performing the WITH(OUT)_* stuff for ports in order to prevent from polluting the namespace. If there is to be some WITH(OUT)_* knobs which leads to CFLAGS modification in the future (I'm thinking about ProPolice with the upcoming GCC 4.1), wouldn't it be worth benefiting this framework for ports ? It avoids only /etc/src.conf stuff when running bsd.port.mk; if you put WITH(OUT)_* in /etc/make.conf it will still be picked up. Yes indeed, but MK_FOO won't be set and this would require to either duplicate the code that modifies CFLAGS, or at least test for MK_FOO or WITH_FOO at the same time. Let me show you an example. I have an additional bsd.ssp.mk that is included from both bsd.sys.mk and bsd.port.mk: % .if ${MK_SSP} != no % SSP_CFLAGS ?= -fstack-protector % CFLAGS += ${SSP_CFLAGS} % . if defined(WARNS) ${WARNS} = 7 !empty(SSP_CFLAGS) % CWARNFLAGS += -Wstack-protector % . endif % .endif Currently it is thus quite useful to use MK_SSP when this file is included from bsd.ports.mk. With your whole patch I would have to either duplicate these bits in bsd.ports.mk or turn the condition to something like: % .if (defined(MK_SSP) ${MK_SSP} != no) || defined(WITH_SSP) What do you advice me to do ? I still don't understand why my patch created a problem for you. This option is not in bsd.own.mk, so it's not covered by my patch. All my patch does is don't process /etc/src.conf which is entirely for src/. So, you can continue to use your bsd.ssp.mk as before, and my patch shouldn't influence it. If you want to really mimic the standard behavior, then bsd.ssp.mk should check the (WITH|WITHOUT)_SSP set by a user, and set MK_SSP to yes/no, accordingly; setting MK_SSP by a user shouldn't be allowed or supported. You then set WITH_SSP= in /etc/make.conf (or in /etc/src.conf if you want it only for src/), or pass -DWITH_SSP on the make command line, and you're done. P.S. There has been a patch floating around that adds support for /etc/ports.conf. [...] that you sent :-) Could try to revive the thread with a new patch. Better just commit something. :-) Cheers, -- Ruslan Ermilov [EMAIL PROTECTED] FreeBSD committer pgpX7PM4nLBD5.pgp Description: PGP signature
Re: src.conf(5) seems to affect ports build
Ruslan, On Sat, Oct 21, 2006 at 09:25:33PM +0400, Ruslan Ermilov wrote: Also, your patch avoids performing the WITH(OUT)_* stuff for ports in order to prevent from polluting the namespace. If there is to be some WITH(OUT)_* knobs which leads to CFLAGS modification in the future (I'm thinking about ProPolice with the upcoming GCC 4.1), wouldn't it be worth benefiting this framework for ports ? It avoids only /etc/src.conf stuff when running bsd.port.mk; if you put WITH(OUT)_* in /etc/make.conf it will still be picked up. Yes indeed, but MK_FOO won't be set and this would require to either duplicate the code that modifies CFLAGS, or at least test for MK_FOO or WITH_FOO at the same time. Let me show you an example. I have an additional bsd.ssp.mk that is included from both bsd.sys.mk and bsd.port.mk: % .if ${MK_SSP} != no % SSP_CFLAGS ?= -fstack-protector % CFLAGS += ${SSP_CFLAGS} % . if defined(WARNS) ${WARNS} = 7 !empty(SSP_CFLAGS) % CWARNFLAGS += -Wstack-protector % . endif % .endif Currently it is thus quite useful to use MK_SSP when this file is included from bsd.ports.mk. With your whole patch I would have to either duplicate these bits in bsd.ports.mk or turn the condition to something like: % .if (defined(MK_SSP) ${MK_SSP} != no) || defined(WITH_SSP) What do you advice me to do ? Thank you for your help. Best regards, -- Jeremie Le Hen jeremie at le-hen dot org ttz at chchile dot org ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: src.conf(5) seems to affect ports build
On Sat, Oct 21, 2006 at 06:26:35PM +0200, Jeremie Le Hen wrote: Hi Ruslan, On Fri, Oct 20, 2006 at 11:13:32PM +0400, Ruslan Ermilov wrote: On Fri, Oct 20, 2006 at 05:08:48PM +0200, Jeremie Le Hen wrote: Hi, src.conf(5) manual page states: % The src.conf file contains settings that will apply to every build % involving the FreeBSD source tree; see build(7). % ... % The only purpose of src.conf is to control the compilation of the FreeBSD % sources, which are usually found in /usr/src. However, share/mk/bsd.port.mk includes bsd.own.mk which in turn includes /etc/src.conf. Therefore if I have some WITH_/WITHOUT_ knob in it which affects CFLAGS, they will be taken into account even for port builds. Is it the expected behaviour ? Maybe WITH(OUT)_ should simply avoid modifying CFLAGS (though I think this might become useful in the near future). See if the attached patch helps. If it does, I'll commit. I've never heard back on this patch after I sent it to [EMAIL PROTECTED] This patch works correctly. Would you explain me why assigning /dev/null to _SRCCONF don't work in the current version of bsd.port.mk ? 1) It's spelled SRCCONF. 2) Even if spelled correctly, setting it to /dev/null doesn't prevent MK_* variables to be set to their default values: cd /usr/src make showconfig SRCCONF=/dev/null Also, your patch avoids performing the WITH(OUT)_* stuff for ports in order to prevent from polluting the namespace. If there is to be some WITH(OUT)_* knobs which leads to CFLAGS modification in the future (I'm thinking about ProPolice with the upcoming GCC 4.1), wouldn't it be worth benefiting this framework for ports ? It avoids only /etc/src.conf stuff when running bsd.port.mk; if you put WITH(OUT)_* in /etc/make.conf it will still be picked up. Cheers, -- Ruslan Ermilov [EMAIL PROTECTED] FreeBSD committer pgpDKhRANkkH4.pgp Description: PGP signature
Re: src.conf(5) seems to affect ports build
Hi Ruslan, On Fri, Oct 20, 2006 at 11:13:32PM +0400, Ruslan Ermilov wrote: On Fri, Oct 20, 2006 at 05:08:48PM +0200, Jeremie Le Hen wrote: Hi, src.conf(5) manual page states: % The src.conf file contains settings that will apply to every build % involving the FreeBSD source tree; see build(7). % ... % The only purpose of src.conf is to control the compilation of the FreeBSD % sources, which are usually found in /usr/src. However, share/mk/bsd.port.mk includes bsd.own.mk which in turn includes /etc/src.conf. Therefore if I have some WITH_/WITHOUT_ knob in it which affects CFLAGS, they will be taken into account even for port builds. Is it the expected behaviour ? Maybe WITH(OUT)_ should simply avoid modifying CFLAGS (though I think this might become useful in the near future). See if the attached patch helps. If it does, I'll commit. I've never heard back on this patch after I sent it to [EMAIL PROTECTED] This patch works correctly. Would you explain me why assigning /dev/null to _SRCCONF don't work in the current version of bsd.port.mk ? Also, your patch avoids performing the WITH(OUT)_* stuff for ports in order to prevent from polluting the namespace. If there is to be some WITH(OUT)_* knobs which leads to CFLAGS modification in the future (I'm thinking about ProPolice with the upcoming GCC 4.1), wouldn't it be worth benefiting this framework for ports ? Thank you. Regards, -- Jeremie Le Hen jeremie at le-hen dot org ttz at chchile dot org ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to [EMAIL PROTECTED]
src.conf(5) seems to affect ports build
Hi, src.conf(5) manual page states: % The src.conf file contains settings that will apply to every build % involving the FreeBSD source tree; see build(7). % ... % The only purpose of src.conf is to control the compilation of the FreeBSD % sources, which are usually found in /usr/src. However, share/mk/bsd.port.mk includes bsd.own.mk which in turn includes /etc/src.conf. Therefore if I have some WITH_/WITHOUT_ knob in it which affects CFLAGS, they will be taken into account even for port builds. Is it the expected behaviour ? Maybe WITH(OUT)_ should simply avoid modifying CFLAGS (though I think this might become useful in the near future). Thank you. Best regards, -- Jeremie Le Hen jeremie at le-hen dot org ttz at chchile dot org ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: src.conf(5) seems to affect ports build
On Fri, Oct 20, 2006 at 05:08:48PM +0200, Jeremie Le Hen wrote: Hi, src.conf(5) manual page states: % The src.conf file contains settings that will apply to every build % involving the FreeBSD source tree; see build(7). % ... % The only purpose of src.conf is to control the compilation of the FreeBSD % sources, which are usually found in /usr/src. However, share/mk/bsd.port.mk includes bsd.own.mk which in turn includes /etc/src.conf. Therefore if I have some WITH_/WITHOUT_ knob in it which affects CFLAGS, they will be taken into account even for port builds. Is it the expected behaviour ? Maybe WITH(OUT)_ should simply avoid modifying CFLAGS (though I think this might become useful in the near future). See if the attached patch helps. If it does, I'll commit. I've never heard back on this patch after I sent it to [EMAIL PROTECTED] Cheers, -- Ruslan Ermilov [EMAIL PROTECTED] FreeBSD committer Index: bsd.own.mk === RCS file: /home/ncvs/src/share/mk/bsd.own.mk,v retrieving revision 1.57 diff -u -p -r1.57 bsd.own.mk --- bsd.own.mk 30 Sep 2006 11:32:46 - 1.57 +++ bsd.own.mk 30 Sep 2006 20:31:16 - @@ -104,10 +104,12 @@ .if !target(__bsd.own.mk__) __bsd.own.mk__: +.if !defined(_WITHOUT_SRCCONF) SRCCONF?= /etc/src.conf .if exists(${SRCCONF}) .include ${SRCCONF} .endif +.endif # Binaries BINOWN?= root @@ -170,6 +172,7 @@ STRIP?= -s COMPRESS_CMD?= gzip -cn COMPRESS_EXT?= .gz +.if !defined(_WITHOUT_SRCCONF) # # Define MK_* variables (which are either yes or no) for users # to set via WITH_*/WITHOUT_* in /etc/src.conf and override in the @@ -447,5 +450,6 @@ MK_${var}_SUPPORT:= no MK_${var}_SUPPORT:= yes .endif .endfor +.endif # !_WITHOUT_SRCCONF .endif # !target(__bsd.own.mk__) Index: bsd.port.mk === RCS file: /home/ncvs/src/share/mk/bsd.port.mk,v retrieving revision 1.308 diff -u -p -r1.308 bsd.port.mk --- bsd.port.mk 24 Aug 2006 18:04:49 - 1.308 +++ bsd.port.mk 26 Aug 2006 13:55:59 - @@ -3,8 +3,9 @@ PORTSDIR?= /usr/ports BSDPORTMK?=${PORTSDIR}/Mk/bsd.port.mk -# Needed to keep bsd.own.mk from reading in /etc/src.conf when building ports. -SRCCONF= /dev/null +# Needed to keep bsd.own.mk from reading in /etc/src.conf +# and setting MK_* variables when building ports. +_WITHOUT_SRCCONF= .include bsd.own.mk .include ${BSDPORTMK} pgpHcA50rvwUG.pgp Description: PGP signature