[GRASS-dev] New NVIZ compile error

Glynn Clements glynn at gclements.plus.com
Thu Oct 16 13:32:13 EDT 2008


William Kyngesburye wrote:

> On Oct 16, 2008, at 10:56 AM, Glynn Clements wrote:
> 
> > The problem is the use of ":=" in r33887. Whereas "=" assigns the RHS
> > literally (with any variable references left unexpanded), ":="
> > recursively expands any variable references in the RHS prior to
> > assignment.
> ...
> > The code should have used either "=" or (preferably) "+=", e.g.:
> >
> > 	ifeq ($(OPENGL_X11),1)
> > 	EXTRA_LIBS += $(XLIBPATH) $(OPENGLLIB) $(OPENGLULIB)
> > 	else
> > 	EXTRA_LIBS += $(OPENGLLIB) $(OPENGLULIB)
> > 	endif
> 
> 
> Thanks for the clarification.  I was going from example from another  
> makefile I was currently looking at (wxpython/vdigit), though I did  
> notice that yet another used += (lib/nviz).
> 
> I just changed lib/ogsf/Makefile, and the wx nviz and vdigit makefiles  
> to use +=.

Right. In vdigit/Makefile, the lines:

SOURCES := $(wildcard *.cpp) $(LIB_NAME)_wrap.cpp
SHLIB_OBJS := $(patsubst %.cpp, $(OBJDIR)/%.o, $(SOURCES))

are examples of where ":=" makes sense, particularly the first one.

EXTRA_LIBS should use "+=", though.

In retrospect, "=" could be problematic for cases where the RHS
contains a reference to the LHS (I don't know how make handles this
case).

-- 
Glynn Clements <glynn at gclements.plus.com>


More information about the grass-dev mailing list