[GRASS-windows] Compiling grass7 on msys/mingw?

Glynn Clements glynn at gclements.plus.com
Tue Jan 13 17:07:07 EST 2009


Colin Nielsen wrote:

> Any idea why I get the other error for r.mapcalc, r.univar,
> raster3d/base and v.voronoi?

Not exactly, but I'm fairly sure that it's related to the fact that
those four directories are the only ones which use Multi.make (used
when building more than one module from a single directory).

> gcc -L/usr/local/src/grass_trunk/dist.i686-pc-mingw32/lib
> -Wl,--export-dynamic,--enable-runtime-pseudo-reloc  -L/usr/local/lib
> -L/usr/local/pgsql/lib  -o
> /usr/local/src/grass_trunk/dist.i686-pc-mingw32/bin/r.mapcalc.exe
> ../../lib/gis/OBJ.i686-pc-mingw32/fmode.o -lgrass_gis -lgrass_datetime
> -lxdr -liberty -lws2_32    -lz     -lgrass_btree        -lxdr -liberty
> -lws2_32    -lz
> /mingw/lib/libmingw32.a(main.o):main.c:(.text+0x104): undefined
> reference to `WinMain at 16'
> collect2: ld returned 1 exit status
> make: *** [/usr/local/src/grass_trunk/dist.i686-pc-mingw32/bin/r.mapcalc.exe]
> Error 1

Well, there are no object files except for fmode.o (which is added to
all executables to cause open() to use binary mode rather than text
mode).

The linking rule for a module in Module.make is:

	$(BIN)/$(PGM)$(EXE): $(ARCH_OBJS) $(DEPENDENCIES)
		$(call linker)

Multi.make splits this into two parts:

	$(BIN)/%$(EXE): $(DEPENDENCIES)
		$(call linker)
and:
	$(BIN)/$(1)$(EXE): $$(patsubst %.o,$(OBJDIR)/%.o,$$($$(subst .,_,$(1)_OBJS)))

The first is a pattern rule, and the second is part of an $(eval ...) 
template which is instantiated for each module.

The prerequisites are supposed to be merged, but either this isn't
happening, or something is causing the template to come up empty.

I'm not sure if it's a flaw in the MSys version of make, or there's a
flaw in the rule related to $(EXE) (which will be empty on platforms
other than Windows).

Can you try the following:

	make -d -p -C raster/r.mapcalc &> out.log
	gzip out.log

and send me the resulting out.log.gz file?

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


More information about the grass-windows mailing list