[postgis-devel] Building the extension on Solaris/amd64
Mark Cave-Ayland
mark.cave-ayland at ilande.co.uk
Sat May 18 23:37:14 PDT 2013
On 19/05/13 01:06, Paragon Corporation wrote:
>> Are you executing "make install" as part of the build? If so that's the
> correct behaviour from libtool since after all it's creating a system
> library.
>
> Yes -- remind me why we have this installed as a system library when 2.0 and
> 2.1 versions are incompatible with each other and this file isn't versioned
> (at least not on my system) so would seem to screw a lot of people who have
> to run both PostGIS versions?
Really? Are you running autogen.sh as part of your build? libtool embeds
the version number into liblwgeom as part of liblwgeom/Makefile like this:
...
SOVER = 2.1.0beta3dev
...
liblwgeom.la: $(LT_OBJS) $(SA_HEADERS)
$(LIBTOOL) --tag=CC --mode=link $(CC) -rpath $(libdir)
$(LT_OBJS) -release $(SOVER) $(LDFLAGS) -o $@
And I can confirm it works for me:
pg90 at kentang:~/src/postgis-git$ ls -l ~/rel/lib/ | grep liblwgeom
-rwxr-xr-x 1 pg90 pg90 1054153 Mar 26 2012 liblwgeom-2.0.0beta5SVN.so
-rwxr-xr-x 1 pg90 pg90 1058596 Jun 23 2012 liblwgeom-2.0.1SVN.so
-rwxr-xr-x 1 pg90 pg90 1478226 May 16 10:03 liblwgeom-2.0.3.so
-rwxr-xr-x 1 pg90 pg90 1478234 Apr 13 18:50 liblwgeom-2.0.4SVN.so
-rwxr-xr-x 1 pg90 pg90 1567637 May 18 13:05 liblwgeom-2.1.0beta3dev.so
-rwxr-xr-x 1 pg90 pg90 1556686 Apr 13 18:32 liblwgeom-2.1.0SVN.so
-rw-r--r-- 1 pg90 pg90 2545108 May 18 13:05 liblwgeom.a
-rwxr-xr-x 1 pg90 pg90 1101 May 18 13:05 liblwgeom.la
lrwxrwxrwx 1 pg90 pg90 26 May 18 13:05 liblwgeom.so ->
liblwgeom-2.1.0beta3dev.s
The executables agree with this too:
pg90 at kentang:~/src/postgis-git$ ldd ~/rel/bin/shp2pgsql
linux-vdso.so.1 => (0x00007fffa31b3000)
liblwgeom-2.1.0beta3dev.so =>
/home/pg90/rel/lib/liblwgeom-2.1.0beta3dev.so (0x00007f71a5dfa000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f71a5a4c000)
libgeos_c.so.1 => /home/pg90/rel/lib/libgeos_c.so.1
(0x00007f71a5825000)
libproj.so.0 => /home/pg90/rel/lib/libproj.so.0
(0x00007f71a55d9000)
/lib64/ld-linux-x86-64.so.2 (0x00007f71a605b000)
libgeos-3.3.2.so => /home/pg90/rel/lib/libgeos-3.3.2.so
(0x00007f71a523b000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6
(0x00007f71a4f33000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f71a4cb1000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1
(0x00007f71a4a9b000)
The equivalent tool for ldd on Windows is depends.exe which should show
you the DLL versions that are being dynamically linked into a .exe file.
Note that libtool also creates a copy of liblwgeom.dll (unversioned)
which points to the latest version which may be what is causing the
confusion here. I think on Windows a copy of the current version is
created because Windows can't handle symbolic links (NTFS junctions)
correctly.
>> For the build boxes, I would highly recommend passing the --prefix
> I used to do that until this happened to me and I was told by somebody that
> I shouldn't be counting on --prefix to do anything useful
>
> http://trac.osgeo.org/postgis/ticket/1628
>
>
>> , --includedir and --libdir options into your configure statement so that
> your binaries are placed in a separate, non-system directory suring "make
> install" (see my example earlier in this thread), one for each version.
> Not clear what you mean here - full example please :) I do explicit --with
> for dependency libs and my system paths I overwrite for each build to just
> include the paths I need.
Ah yes I ended up taking --prefix out of my command line in the end.
Basically includedir and libdir point to $PREFIX/local/include and
$PREFIX/local/lib by default, but they can be overridden by passing
--includedir and --libdir into configure. These are the destinations
automatically invoked by libtool on "make install". So based upon my
example you probably want something like this:
For PostGIS 2.0:
./configure --with-projdir=/home/pg90/rel
--libdir=/home/postgis-2.0/rel/lib
--includedir=/home/postgis-2.0/rel/include --with-gui
For PostGIS 2.1:
./configure --with-projdir=/home/pg90/rel
--libdir=/home/postgis-2.1/rel/lib
--includedir=/home/postgis-2.1/rel/include --with-gui
Once you verify that the unverified liblwgeom.dll isn't being used by
any of the executables, you should find the versioned DLLs in the
directories above. Make sure you don't distribute any unversioned
liblwgeom DLLs otherwise chaos will ensue...
HTH,
Mark.
More information about the postgis-devel
mailing list