[GRASS5] Building LIBGIS (GRASS60beta1) under MINGW

Hi list,

I'm trying to compile the GIS library of GRASS60beta1 under MINGW. After
struggling a few days with the configure, I've managed to run MAKE in the
lib/gis folder.
The first problem appears while building make_loc.c:

****************************************************************************
*************************************
~/grass600beta1/lib/gis
$ make
gcc -I/home/javier/grass600beta1/include
-I/home/javier/grass600beta1/dist.i686-pc-mingw32/include/grass -g -O2
-D__W98__ -Wall -Wconversion -Wno-implicit-int
-DPACKAGE=\""grasslibs"\" -DPACKAGE=\""grasslibs"\"
-I/home/javier/grass600beta1/include
-I/home/javier/grass600beta1/dist.i686-pc-mingw32/include/grass \
        -o OBJ.i686-pc-mingw32/make_loc.o -c make_loc.c
make_loc.c: In function `G__make_location':
make_loc.c:59: error: too many arguments to function `mkdir'
make_loc.c:64: error: too many arguments to function `mkdir'
[...]
****************************************************************************
*************************************

With the aid of Markus we patched this error with the following ifdef:

#ifdef __MINGW32__
#define mkdir(name, mode) ((mkdir) (name))
#endif

Is this patch correct?

Afterwards, an error occurs while building spawn.c:

****************************************************************************
*************************************
~/grass600beta1/lib/gis
$ make
gcc -I/home/javier/grass600beta1/include
-I/home/javier/grass600beta1/dist.i686-pc-mingw32/include/grass -g -O2
-D__W98__ -Wall -Wconversion -Wno-implicit-int
-DPACKAGE=\""grasslibs"\" -DPACKAGE=\""grasslibs"\"
-I/home/javier/grass600beta1/include
-I/home/javier/grass600beta1/dist.i686-pc-mingw32/include/grass \
        -o OBJ.i686-pc-mingw32/spawn.o -c spawn.c
spawn.c:16:22: sys/wait.h: No such file or directory
spawn.c: In function `G_spawn':
[...]
****************************************************************************
****************************************

As you can see, the problem is with the wait.h header, which is not present
in MINGW. One of the declarations that spawn.c needs is "sigaction", for
example.
I wonder if there is a replacement for this using only the headers shiped
with MINGW?
Any idea will be greatly appreciated.

Thanks in advance..
Javier

Javier A. Yebrin wrote:

I'm trying to compile the GIS library of GRASS60beta1 under MINGW.

GRASS can't be built under MinGW. It requires a Unix-like environment,
e.g. Cygwin.

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

Hi Glynn,
I'm sorry but my post was not clear. When I refer to MINGW it should be
noted that it comprises also MSYS, which is a POSIX and Bourne shell
environment. Of course it is not a complete environment such as CYGWIN,
nevertheless I was able to run the configure script. The latter statement
does'nt mean that then GRASS could be built... But I'll try to.

What really confuses me is the fact that there are a lot of "ifdef MINGW32"
within the GRASS code. Does this mean Grass is expected to be built under
MINGW?

Cheers,

Javier

-----Original Message-----
From: Glynn Clements [mailto:glynn@gclements.plus.com]
Sent: Monday, January 24, 2005 9:50 PM
To: Javier A. Yebrin
Cc: grass5@grass.itc.it
Subject: Re: [GRASS5] Building LIBGIS (GRASS60beta1) under MINGW

Javier A. Yebrin wrote:

> I'm trying to compile the GIS library of GRASS60beta1 under MINGW.

GRASS can't be built under MinGW. It requires a Unix-like
environment, e.g. Cygwin.

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