Build failed: /usr/src/share/mk/bsd.obj.mk" line 89: Malformed conditional

Simon J. Gerraty sjg at juniper.net
Sun Nov 5 16:13:32 UTC 2017


Simon J. Gerraty <sjg at juniper.net> wrote:

> David Wolfskill <david at catwhisker.org> wrote:
> > ===>  Building for nvidia-driver-340-340.102
> > ===> src (all)
> > make[6]: "/usr/src/share/mk/bsd.obj.mk" line 89: Malformed conditional (defined(SRCTOP) &&  (${CANONICALOBJDIR} == /${RELDIR} || ${.OBJDIR} == /${RELDIR}))
> > make[6]: Fatal errors encountered -- cannot continue
> > make[6]: stopped in /common/S4/obj/usr/src/amd64.amd64/sys/CANARY/common/ports/x11/nvidia-driver-340/work/NVIDIA-FreeBSD-x86_64-340.102/src
> > *** Error code 1
> 
> I think I might have a fix for that.

Or rather I know what the issue is - RELDIR isn't defined because
.CURDIR isn't under SRCTOP,
if OBJTOP were defined at that point, the fix is trivial, but
in the current tree that may not be so.
If .CURDIR isn't under SRCTOP, RELDIR is of questionable value anyway.

For now you can avoid the error with below.

Index: share/mk/bsd.obj.mk
===================================================================
--- share/mk/bsd.obj.mk	(revision 325436)
+++ share/mk/bsd.obj.mk	(working copy)
@@ -85,7 +85,7 @@
 CANONICALOBJDIR:=/usr/obj${.CURDIR}
 .endif
 
-.if defined(SRCTOP) && \
+.if defined(RELDIR) && \
     (${CANONICALOBJDIR} == /${RELDIR} || ${.OBJDIR} == /${RELDIR})
 .error .OBJDIR incorrectly set to /${RELDIR}
 .endif


More information about the freebsd-current mailing list