Date: Wed, 20 Feb 2013 12:51:14 -0700 From: "Justin T. Gibbs" <gibbs@scsiguy.com> To: freebsd-arch@freebsd.org Cc: Brooks Davis <brooks@freebsd.org>, James Rogers <jamesr@spectralogic.com>, Simon Gerraty <sjg@juniper.net> Subject: Re: bsd.own.mk - just let WITHOUT_* take precedence Message-ID: <033D35FE-A51C-46B0-9A20-A8E0DAC76B24@scsiguy.com> In-Reply-To: <20121025192715.GA31501@dragon.NUXI.org> References: <20121007001423.9878F58094@chaos.jnpr.net> <20121008154853.GC23400@lor.one-eyed-alien.net> <20121022193903.GA88336@dragon.NUXI.org> <20121024154508.GA93546@lor.one-eyed-alien.net> <20121025192715.GA31501@dragon.NUXI.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Oct 25, 2012, at 1:27 PM, David O'Brien <obrien@FreeBSD.org> wrote: > On Wed, Oct 24, 2012 at 10:45:08AM -0500, Brooks Davis wrote: >>> Note that our Handbook () still has: >>> <!-- XXXTR: WITH_CTF has been reported to leave a user with a >>> broken system when used with buildworld. Until this is > ... >>> We really need to make this as easy as possible for users and get = the >>> docs matching reality. >>=20 >> I believe this is largely wrong and outdated. >=20 > Yes I also feel that way. But didn't want to take that out until = there > is consensus on this build issue. >=20 > --=20 > -- David (obrien@FreeBSD.org) Issues still remain regarding the interaction of WITH_*/WITHOUT_*, NO_*, and MK_*. On -stable, which appears to mostly match the state of -head in this regard, we're running with the following changes in order to allow WITH_CTF to be specified on the command line of a build. Is this the correct approach for solving this issue? Thanks, Justin Change 657233 by justing@justing_ns1_spectrabsd on 2013/02/15 15:58:19 Ensure debug (-g) symbols are included in CTF'ed binaries if requested by the user (e.g. CFLAGS+=3D-g in make.conf). =09 share/mk/sys.mk: sys.mk is included before the parsing of any user specified Makefile. For this reason, the user's specification of CFLAGS, if any, is not visible when it is processed. Even for files like make.conf that are included by sys.mk, CFLAGS is set after it is consulted in the setup of CTFFLAGS. Instead of using a parse time test for the presence of "-g" in CFLAGS to control debug symbol inclusion during CTF processing, add "${CFLAGS:M-g}" unconditionally to CTFFLAGS since this will be evaluated on demand as make builds targets. share/mk/bsd.lib.mk: share/mk/bsd.prog.mk: Remove per-build-type manipulation of CTFFLAGS to = include -g. sys.mk's definition does this already. Affected files ... ... //SpectraBSD/stable/share/mk/sys.mk#4 edit Differences ... =3D=3D=3D=3D //SpectraBSD/stable/share/mk/sys.mk#4 (text) =3D=3D=3D=3D @@ -67,18 +67,11 @@ .endif =20 # C Type Format data is required for DTrace -CTFFLAGS ?=3D -L VERSION +CTFFLAGS ?=3D -L VERSION ${CFLAGS:M-g} =20 CTFCONVERT ?=3D ctfconvert CTFMERGE ?=3D ctfmerge DTRACE ?=3D dtrace -.if defined(CFLAGS) && (${CFLAGS:M-g} !=3D "") -CTFFLAGS +=3D -g -.else -# XXX: What to do here? Is removing the CFLAGS part completely ok here? -# For now comment it out to not compile with -g unconditionally. -#CFLAGS +=3D -g -.endif =20 CXX ?=3D c++ CXXFLAGS ?=3D = ${CFLAGS:N-std=3D*:N-Wnested-externs:N-W*-prototypes:N-Wno-pointer-sign:N-= Wold-style-definition} =3D=3D=3D=3D //SpectraBSD/stable/share/mk/bsd.lib.mk#6 (text) =3D=3D=3D=3D= @@ -35,10 +35,6 @@ =20 .if defined(DEBUG_FLAGS) CFLAGS+=3D ${DEBUG_FLAGS} - -.if ${MK_CTF} !=3D "no" && ${DEBUG_FLAGS:M-g} !=3D "" -CTFFLAGS+=3D -g -.endif .endif =20 .if !defined(DEBUG_FLAGS) =3D=3D=3D=3D //SpectraBSD/stable/share/mk/bsd.prog.mk#4 (text) =3D=3D=3D=3D= @@ -18,10 +18,6 @@ .if defined(DEBUG_FLAGS) CFLAGS+=3D${DEBUG_FLAGS} CXXFLAGS+=3D${DEBUG_FLAGS} - -.if ${MK_CTF} !=3D "no" && ${DEBUG_FLAGS:M-g} !=3D "" -CTFFLAGS+=3D -g -.endif .endif =20 .if defined(CRUNCH_CFLAGS) Change 657888 by justing@justing_ns1_spectrabsd on 2013/02/20 08:32:32 Allow WITH_CTF to be defined from src.conf, make.conf, or via the command line with equal efficacy. =09 share/mk/bsd.own.mk: Make maintains three classes of global variables: variables from the environment, variables specified on the command line, and variables defined in a sourced Makefile. Only variables in the last category can be undefined (via .undef) from within a Makefile. =09 Re-implement NO_* (e.g. NO_CTF) option handling to not rely on the ability to undefine a variable. A new variable __OVERRIDABLE_OPTIONS now contains the options for which the build system honors NO_{option} (typically for boot strapping phases). Embed directly in the logic converting from WITH_*/WITHOUT_* to MK_* the test for NO_*. =09 Remove warnings emitted when a user specified option is overridden. Necessary overrides occur hundreds of times during bootstrap phases of the build, making these messages just noise that users will quickly learn to ignore. Affected files ... ... //SpectraBSD/stable/share/mk/bsd.own.mk#7 edit Differences ... =3D=3D=3D=3D //SpectraBSD/stable/share/mk/bsd.own.mk#7 (text) =3D=3D=3D=3D= @@ -200,25 +200,16 @@ =20 # # Supported NO_* options (if defined, MK_* will be forced to "no", -# regardless of user's setting). +# regardless of user's setting). NO_* options are used to temporarily +# disable user requested behavior during portions of the build that +# cannot support certain options (e.g. during bootstrap phases). # -.for var in \ +__OVERRIDABLE_OPTIONS =3D \ CTF \ COVERAGE \ INSTALLLIB \ MAN \ PROFILE -.if defined(NO_${var}) -.if defined(WITH_${var}) -.warning unsetting WITH_${var} -.undef WITH_${var} -.if defined(WITH_${var}) -.error wtf -.endif -.endif -WITHOUT_${var}=3D -.endif -.endfor =20 # # Compat NO_* options (same as above, except their use is deprecated). @@ -474,11 +465,16 @@ .if defined(MK_${var}) .error MK_${var} can't be set by a user. .endif +.if defined(NO_${var}) && !empty(__OVERRIDABLE_OPTIONS:M${var}) +MK_${var}:=3D no +.else .if defined(WITHOUT_${var}) MK_${var}:=3D no .else MK_${var}:=3D yes .endif +.endif + .endfor .undef __DEFAULT_YES_OPTIONS =20 @@ -492,13 +488,18 @@ .if defined(MK_${var}) .error MK_${var} can't be set by a user. .endif +.if defined(NO_${var}) && !empty(__OVERRIDABLE_OPTIONS:M${var}) +MK_${var}:=3D no +.else .if defined(WITH_${var}) MK_${var}:=3D yes .else MK_${var}:=3D no .endif +.endif .endfor .undef __DEFAULT_NO_OPTIONS +.undef __OVERRIDABLE_OPTIONS =20 # # Force some options off if their dependencies are off.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?033D35FE-A51C-46B0-9A20-A8E0DAC76B24>