[GRASS5] mingW: how to exclude win32_pipes.c & user_config.c from compilation?

Markus Neteler neteler at itc.it
Mon Feb 13 11:38:15 EST 2006


On Mon, Feb 13, 2006 at 05:31:01PM +0100, Radim Blazek wrote:
> On 2/13/06, Glynn Clements <glynn at gclements.plus.com> wrote:
> >
> > Radim Blazek wrote:
> >
> > > > > > we have to exclude compilation of
> > > > > > lib/gis/win32_pipes.c
> > > > > > lib/gis/user_config.c
> > > > > >
> > > > > > when compiling with mingW.
> > > > >
> > > > > Huh? The whole of win32_pipes.c is conditionalised upon
> > > > > "#ifdef __MINGW32__", so if that file isn't wanted for MinGW, it
> > > > > should just be removed.
> > > > >
> > > > > > How to modify the Makefile?
> > > > > > Is there a way to define an EXCLUDE variable in this
> > > > > > Makefile and make include/Make/Lib.make aware of it?
> > > > > >
> > > > > > I know too little about Makefile programming to implement
> > > > > > it correctly. Throwing files away may not be the solution.
> > > > >
> > > > > The usual approach is to just conditionalise the entire source file
> > > > > upon a macro, so that you effectively get an empty file if the test is
> > > > > false.
> > > >
> > > > I don't know - this was a request by Radim, I suggested
> > > > to him to remove the files. Let's listen to him.
> > >
> > > Those two files do not compile with MinGW but they are not
> > > used in fact. The files were not in the list of files for compilation
> > > in Makefile but with the recent change which is using *.c
> > > appeared in the list. I only want that it compiles. Do whatever
> > > you prefer. I just worry that if we delete the files the code will be
> > > forgoten for ever.
> >
> > ISTR that win32_pipes.c is supposed to be replacements for
> > unix_socks.c, as Windows doesn't support PF_LOCAL (aka PF_UNIX)
> > sockets.
> >
> > Personally, I would have thought it would be simpler to just use a
> > PF_INET socket instead (e.g. use an ephemeral port and write the port
> > number to a file with the same pathname as would have been used for
> > the PF_LOCAL socket).
> >
> > Do you have any idea why they don't compile under MinGW? Both appear
> > to have been explicitly written with MinGW in mind. Maybe we need some
> > additional compilation options?
> 
> user_config.c:34:17: pwd.h: No such file or directory
> user_config.c: In function `_make_toplevel':
> user_config.c:87: warning: implicit declaration of function `lstat'
> user_config.c:94: error: too many arguments to function `mkdir'
> user_config.c: In function `_make_sublevels':
> user_config.c:246: error: too many arguments to function `mkdir'

see make_loc.c:

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

Markus
 
> OBJ.i586-pc-mingw32msvc/win32_pipes.o(.text+0x62): In function
> `G_pipe_get_fname':
> /ssi0/ssi/blazek/win/source/grass6/lib/gis/win32_pipes.c:66: undefined
> reference to `_lstat'
> OBJ.i586-pc-mingw32msvc/win32_pipes.o(.text+0x166): In function `G_pipe_exists':
> /ssi0/ssi/blazek/win/source/grass6/lib/gis/win32_pipes.c:142:
> undefined reference to `_CloseFile'
> 
> Radim
> 
> > --
> > Glynn Clements <glynn at gclements.plus.com>
> >
> 
> _______________________________________________
> grass5 mailing list
> grass5 at grass.itc.it
> http://grass.itc.it/mailman/listinfo/grass5

-- 
Markus Neteler     <neteler itc it>       http://mpa.itc.it
ITC-irst -  Centro per la Ricerca Scientifica e Tecnologica
MPBA - Predictive Models for Biol. & Environ. Data Analysis
Via Sommarive, 18        -       38050 Povo (Trento), Italy




More information about the grass-dev mailing list