[GRASS5] New makefiles - work in progress, take 'em for a spin

Mike Thomas mthomas at gil.com.au
Fri Aug 4 19:28:49 EDT 2000


Hi Eric.

> as "DLL".  If the "normal" installation method works on
> CygWin, try the following from a clean start:
> make install |& tee grass-5.0b8-cygwin.log

I've never been able to get a working build using the normal method!   Apart
from the practical advantages of a proper makefile system, this is the
reason I'm trying your makefiles out.

Attached are a couple of altered files which show what needed to be done to
get the Cygwin Windows shared library build working for libes/vask.

Notes:

1.  I've changed shlib.make to allow construction of the dll, the def and
the corresponding .a import lib (eg libvask.dll, libvask.def and libvask.a)
under Windows.  These changes include some new variables set up in
platform.make at the bottom:

----------------------------------------------------------------------------
--------------------------
SHLIB_PREFIX = lib
SHLIB_SUFFIX = .dll
SHCFLAGS =
SHLDFLAGS =

# The Export definitions
DEFLDFLAGS = --export-all-symbols --driver-name gcc --output-def
DEF_PREFIX = lib
DEF_SUFFIX = .def

# The DLL import library definitions
IMPLDFLAGS = --output-lib
IMP_PREFIX = lib
IMP_SUFFIX = .a
----------------------------------------------------------------------------
--------------------------


2. To allow this system to work under Unix, (as yet untried) I've moved the
dot "." in the file extension out of shlib.make and into platform.make.
This allows the Unix make variables to be blank, while the Windows variables
are filled out and vice-versa.  No extraneous dots in the final command
line.

3. I've added -lncurses into the vask Makefile via the EXTRA_LIBS variable.

4. By making each libe/* lib into a DLL, we are forced to resolve all
external references.  This means that cross dependencies will need to be
taken care of by carefully ordering the libes build and copying the
resulting DLL's and import libraries into some central location.  An example
of this cross dependency problem is:

----------------------------------------------------------------------------
--------------------------
make[3]: Leaving directory `/cygdrive/f/source/cvsroot/grass/src/libes/vask'
make[3]: Entering directory
`/cygdrive/f/source/cvsroot/grass/src/libes/segment'
dllwrap -s      \
  address.o flush.o format.o get.o get_row.o init.o pagein.o pageout.o put.o
put_row.o release.o seek.o setup.o   \
 --export-all-symbols --driver-name gcc --output-def libsegment.def \
 --output-lib libsegment.a \
 -o libsegment.dll
dllwrap: no export definition file provided
dllwrap: creating one, but that may not be what you want
format.o(.text+0x131):format.c: undefined reference to `G_warning'
----------------------------------------------------------------------------
--------------------------

I'm looking into how to sort this out.

> We could always rig it up so that libraries are built
> statically on Windows for now.

This is an option.  You could finally build a big grass.dll at the end.  It
has the disadvantage of being less efficient (small modules have to load
EVERYTHING).

It has the advantages of simplicity and avoiding the crossdependency
problem.

> I've often thought that
> rewriting the Windows dynamic linker would be easier
> than hassling with when to __declspec(DLLIMPORT) and
> __declspec(DLLEXPORT).

Go ahead!!!

I'm not 100% certain that it will be necessary to do this, as it seems that
the dllwrap tool allows you to export all symbols automatically.  I'm
uncertain whether this has implications at run/link time or not  - I'll find
out once I get the  libes built.

> > To further complicate matters, I'm not certain what the relationship
between
> > Cygwin .so libraries and Windows DLL's might be - I'm diving into the
docs
> > now to find out.

I'm talking rubbish late at night - there are no Cygwin .so libraries.  I'm
on a Cygwin learning curve.  The latest version is much nicer than Beta
20.1.

> Let me know what you find. Thanks for trying it out.

A pleasure - I'm still hoping to see a working version of Grass on my
computer one day!  I'll keep hacking on with the problems I've mentioned.

Cheers

MIke Thomas

-------------- next part --------------
A non-text attachment was scrubbed...
Name: Shlib.make
Type: application/octet-stream
Size: 2473 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/grass-dev/attachments/20000805/b21f0d80/Shlib.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Platform.make
Type: application/octet-stream
Size: 1963 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/grass-dev/attachments/20000805/b21f0d80/Platform.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Makefile
Type: application/octet-stream
Size: 1159 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/grass-dev/attachments/20000805/b21f0d80/Makefile.obj


More information about the grass-dev mailing list