Date: Wed, 8 May 2002 11:38:01 +1000 (EST) From: Bruce Evans <bde@zeta.org.au> To: Ruslan Ermilov <ru@FreeBSD.org> Cc: Warner Losh <imp@harmony.village.org>, Dima Dorfman <dima@trit.org>, <cvs-committers@FreeBSD.org>, <cvs-all@FreeBSD.org> Subject: Re: cvs commit: src/sys/conf kmod.mk Message-ID: <20020508111354.P629-100000@gamplex.bde.org> In-Reply-To: <20020507120425.GH26127@sunbay.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 7 May 2002, Ruslan Ermilov wrote: > On Thu, May 02, 2002 at 04:39:16PM -0600, Warner Losh wrote: > > In message <20020503032719.G4775-100000@gamplex.bde.org> Bruce Evans writes: > > : > > +.if !exists(/usr/sbin/kldxref) > > : > > +NO_XREF=yes > > : > > +.endif > > : > > : This is broken. kldxref might be in $PATH but not in /usr/sbin, or vice > > : versa. > > > > True. However, it breaks a case I don't care about. Until make gets > > a exists_in_path(foo), this is a reasonable compromise. > > > There is a better compromise, please see below. > > > : > > .if !defined(NO_XREF) > > : > > : If a non-broken existence test ifdef exists, why not write it here directly. > > > > I didn't want to remove NO_XREF, but rather just use it. > > > What Bruce meant is why didn't put the existence test directly inside the > ".if !defined(NO_XREF)" block? > > > : I agree. Ignoring errors in Makefiles is a bug. > > > > Yes. It even seems to work. :-) > > > How about this? > > %%% > Index: kmod.mk > =================================================================== > RCS file: /home/ncvs/src/sys/conf/kmod.mk,v > retrieving revision 1.123 > diff -u -r1.123 kmod.mk > --- kmod.mk 1 May 2002 19:24:26 -0000 1.123 > +++ kmod.mk 7 May 2002 12:03:19 -0000 > @@ -170,10 +170,6 @@ > .endif > .endif > > -.if !exists(/usr/sbin/kldxref) > -NO_XREF=yes > -.endif > - > _ILINKS=@ machine > > all: objwarn ${PROG} > @@ -260,7 +256,9 @@ > done; true > .endif > .if !defined(NO_XREF) > - -kldxref ${DESTDIR}${KMODDIR} > + @if type kldxref >/dev/null 2>&1; then \ > + kldxref ${DESTDIR}${KMODDIR}; \ > + fi > .endif > .endif > > %%% Minor problem: the @ for the test hides the kldxref command. This could be fixed by echoing the kldxref command in the shell command or by using something like: .if !defined(NO_XREF) KLDXREF_TYPE!= type kldxref >/dev/null 2>&1; echo $$? .endif ... .if !defined(NO_XREF) && ${KLDXREF_TYPE} == "0" kldxref ${DESTDIR}${KMODDIR} .endif Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020508111354.P629-100000>