gdal, proj4, Re: libgeotiff-1.2.1-2 (sqlite, libjasper, python, libtool)

Reini Urban rurban@x-ray.at
Fri Oct 8 19:37:00 GMT 2004


Reini Urban schrieb:
> Gerrit P. Haase schrieb:
>> Hello Reini,
>> Am Freitag, 8. Oktober 2004 um 05:43 schriebst du:
>>>> Norman Vine schrieb:
>>>>
>>>>> Proj4   http://proj.maptools.org/  should build OTB
>>> well, we want it shared. add this to some lib srcfile: src/geocent.c
>>> #ifdef __CYGWIN__
>>> int main(int argc, char **argv) { }
>>> #endif

wrong.

>>> ./configure --prefix=/usr --mandir=/usr/share/man
>>> make AM_LDFLAGS=-no-undefined
>>> make install
>>
>> Charles' ready to use package probably takes care of all this and of
>> course provides shared libraries.

true.

> Well, as it turned out proj4 is not yet dll ready.

wrong. Charles' -Wl,--enable-runtime-pseudo-reloc fixed it.

> This is a known issue and should be fixed upstream.

just for the records: just 2 tiny patches were needed.
or go like this:
libtoolize -f; autoreconf -f -i -s
LDFLAGS=-Wl,--enable-runtime-pseudo-reloc ./configure --prefix=/usr \
    --mandir=/usr/share/man
make AM_LDFLAGS=-no-undefined
make install

cygproj-0.dll: unstripped 595KB, stripped 188KB

> gdal expects it as static.
> no problem, it is small.

gdal:
libtoolize -f; autoreconf -f -i -s
./configure --prefix=/usr --mandir=/usr/share/man \
   --with-sqlite --with-xerces
make && make install

After adding -Wl,--enable-runtime-pseudo-reloc and -no-undefined to the
$(LIBGDAL): target it builds shared also.
There need to be some port4 structs initialized.
I also had to -lproj manually to the LIBS in the makefile. (or patch 
configure.in)
This is how I'll do gdal and postgis now, dependant on some not yet 
available shared libs:

sqlite is still not official (jaari: shared?), but I'll link against a 
shared cygsqlite3-0.dll nevertheless.

since there's no libodbc yet (gerrit? I didn't find it on 
http://anfaenger.de/cygwin/), no ODBC support. those folks should recompile.

libjasper: <ping>
libjasper.la has a strange
   dependency_libs=' -L/usr/X11R6/lib /usr/lib/libjpeg.la'
line. This will for example link against /usr/X11R6/bin/libz.dll then...

postgresql:
I found out that a libpq.dll.a import lib is needed, so I'll add that to 
my postgresql-8.0.0cvs-2 todo list. And have that added upstream also.
And I really want to add the cyg prefix to some of their /usr/bin/ dll's 
(libpq only probably) to have them seperate from the mingw versions 
which flow around. (and libtool seems to prefer that. see python)
Persuading them to use libtool or at least some dll versioning will not 
be possible, but I'll have a try.

python (or libtool) is still kind of stupid.
without some tricks it will prevent building a shared libgdal:

--mode=install
*** Warning: linker path does not have real file for library 
-lpython2.3.dll.
*** I have the capability to make that library automatically link in when
*** you link to this library.  But I can only do this if you have a
*** shared version of the library, which you do not appear to have
*** because I did check the linker path looking for a file starting
*** with libpython2.3.dll and none of the candidates passed a file 
format test
*** using a file magic. Last file checked: 
/usr/lib/python2.3/config/libpython2.3.dll.a

This looks like a libtool-1.5.10 bug. Should I really add /usr/bin/ to 
the linker path? There is a /usr/bin/libpython2.3.dll or does libtool 
only check for cyg prefixes?
even copying it to cygpython2.3.dll didn't work.
I also find the relinking on mode=install very annoying. Copying the 
libs verbatim, and fixing the la by hand will make it workable.
relink is not only unnecessary (charles will disagree), it also fails. 
(on python, jasper, pg)

Anyway, to focus on topic:
So we don't need any libgeotiff at all. Do we?
libgdal contains it and much more.

==========================================

GDAL is now configured for i686-pc-cygwin

   Installation directory:    /usr
   C compiler:                gcc -O2
   C++ compiler:              g++ -O2

   LIBTOOL support:           yes

   LIBZ support:              external
   GRASS support:             no
   CFITSIO support:           no
   NETCDF support:            no
   LIBPNG support:            external
   LIBTIFF support:           external
   LIBGEOTIFF support:        internal
   LIBJPEG support:           external
   LIBGIF support:            internal
   OGDI support:              no
   HDF4 support:              no
   KAKADU support:            no
   JASPER support:            yes (GeoJP2=no)
   ECW support:               no
   MrSID support:             no
   POSTGRESQL support:        yes
   XERCES support:            no
   ODBC support:              no
   OCI support:               no
   DODS support:              no
   SQLite support:            yes
   GEOS support:              yes

   Statically link PROJ.4:    no

   Python:                    yes

   enable OGR building:       yes

checking how to link PROJ.4 library... link dynamically.
ok? or more? KAKADU is funny nick for JPEG2000 I assume.
MrSID is non-free. everything else can be added on request.

> but geos-2.0.1 goes ok as shared. (with added -no-undefined)
> /bin/cyggeos-2.dll  8MB

<bang on my head! thanks gerrit>
stripped 1.1MB
-- 
Reini Urban
http://xarch.tu-graz.ac.at/home/rurban/



More information about the Cygwin-apps mailing list