Date: Tue, 18 Mar 2003 08:40:26 -0600 From: "Guy Helmer" <ghelmer@palisadesys.com> To: "Bruce Evans" <bde@zeta.org.au>, "Guido van Rooij" <guido@gvr.org> Cc: <audit@FreeBSD.ORG> Subject: RE: /bin/sh flag NO_HISTORY Message-ID: <FPEBKMIFGFHCGLLKBLMMKENKCBAA.ghelmer@palisadesys.com> In-Reply-To: <20030318225521.M4509@gamplex.bde.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 18 Mar 2003, Bruce Evans wrote:
>
> On Tue, 18 Mar 2003, Guido van Rooij wrote:
>
> > On Mon, Mar 17, 2003 at 02:11:53PM -0600, Guy Helmer wrote:
> > > --- /usr/src/bin/sh/Makefile Mon Mar 17 10:38:03 2003
> > > +++ Makefile Mon Mar 17 10:34:07 2003
> > > @@ -14,8 +14,12 @@
> > > # utilities of the same name are handled with the associated manpage,
> > > # builtin.1 in share/man/man1/.
> > >
> > > +.if !defined(NO_HISTORY)
> > > DPADD+= ${LIBL} ${LIBEDIT} ${LIBTERMCAP}
> > > LDADD+= -ll -ledit -ltermcap
> > > +.else
> > > +CFLAGS+=-DNO_HISTORY
> > > +.endif
> >
> > Could you please do this the other way around:
> > .if defined(NO_HISTORY)
> > CFLAGS+=-DNO_HISTORY
> > .else
> > DPADD+= ${LIBL} ${LIBEDIT} ${LIBTERMCAP}
> > LDADD+= -ll -ledit -ltermcap
> > .endif
> >
> > I think double negations don't add in readbility.
>
> I agree with supporting NO_HISTORY in some way and not using double
> negatives.
>
> However, it's not really necessary to provide a global knob for every
> possible -D option. I sometimes test compiling sh with -DNO_HISTORY
> (too see how much bloatier the library bloat has become). I just use
> something like "make CC='cc -DNOHISTORY'". For more global builds
> like picobsd it would be better to hack on COPTS and fix COPTS to work
> right.
>
> I think removing unused libraries from the command line has no effect,
> at least for static linkage, so a knob outside of CC/CFLAGS/COPTS is not
> needed. Removing the used library libl has the effect of breaking the
> build. libl has nothing to do with history.
Good points, and thanks for the hint on redefining CC.
I usually look at the Makefiles first for knobs like this because I assume
if there are knobs in them, they are knobs that ought to work. If I have
to look deeper into the source for knobs, I assume they may not be
operational because they aren't "published".
I haven't looked, but is NO_HISTORY used elsewhere? If so, perhaps it would
be a good candidate for a global knob to reduce bloat in a build...
Unless others think that adding the NO_HISTORY knob to the Makefile would
be good, I'll just drop this.
Thanks again,
Guy
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-audit" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?FPEBKMIFGFHCGLLKBLMMKENKCBAA.ghelmer>
