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

From: Simon J. Gerraty <sjg_at_juniper.net>
Date: Sun, 5 Nov 2017 08:13:27 -0800
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)
_at__at_ -85,7 +85,7 _at__at_
 CANONICALOBJDIR:=/usr/obj${.CURDIR}
 .endif
 
-.if defined(SRCTOP) && \
+.if defined(RELDIR) && \
     (${CANONICALOBJDIR} == /${RELDIR} || ${.OBJDIR} == /${RELDIR})
 .error .OBJDIR incorrectly set to /${RELDIR}
 .endif
Received on Sun Nov 05 2017 - 15:13:32 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:41:13 UTC