Re: /bin/sh flag NO_HISTORY

Bruce Evans <[email protected]> Tue, 18 Mar 2003 23:07:25 +1100 (EST)
Newsgroups gmane.os.freebsd.devel.audit
Message-ID <[email protected]>
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.

Bruce

To Unsubscribe: send mail to [email protected]
with "unsubscribe freebsd-audit" in the body of the message