[GRASS5] Patch to make shared libraries work correctly for RPM packages

Hi,

on behalf of my collegues Silke and Sascha I am sending you
this patch which is required for having shared libraries work
for having adequate RPM packages (we needed this and tested it
for Fedora Core 4).

I am not aware of a email-thread where this has been discussed,
so I just post it here. Silke is currently on the road (again)
and asked me to send this patch as it should not further delayed.

Let me know
whether you like
whether I should commit
whether anyone else wants to commit

Best

  Jan
--
Jan-Oliver Wagner: www.intevation.de/~jan | GISpatcher: www.gispatcher.de
Kolab Konsortium : www.kolab-konsortium.de | Thuban : thuban.intevation.org
Intevation GmbH : www.intevation.de | Kolab : www.kolab.org
FreeGIS : www.freegis.org | GAV : www.grass-verein.de

(attachments)

grass-shlib-soname.patch (1.11 KB)

Hi,

so far nobody responded. If there are no objections,
I suggest that Jan updated directly in CVS (which seems to
be currently down?).

Markus

On Fri, Nov 18, 2005 at 03:13:50PM +0100, Jan-Oliver Wagner wrote:

Hi,

on behalf of my collegues Silke and Sascha I am sending you
this patch which is required for having shared libraries work
for having adequate RPM packages (we needed this and tested it
for Fedora Core 4).

I am not aware of a email-thread where this has been discussed,
so I just post it here. Silke is currently on the road (again)
and asked me to send this patch as it should not further delayed.

Let me know
whether you like
whether I should commit
whether anyone else wants to commit

Best

  Jan
--
Jan-Oliver Wagner: www.intevation.de/~jan | GISpatcher: www.gispatcher.de
Kolab Konsortium : www.kolab-konsortium.de | Thuban : thuban.intevation.org
Intevation GmbH : www.intevation.de | Kolab : www.kolab.org
FreeGIS : www.freegis.org | GAV : www.grass-verein.de

--- include/Make/Shlib.make.orig 2005-10-17 17:55:37.000000000 +0200
+++ include/Make/Shlib.make 2005-10-17 17:54:18.000000000 +0200
@@ -1,6 +1,11 @@
# common dependencies and rules for building shared libraries

-SHLIB = $(ARCH_LIBDIR)/$(SHLIB_PREFIX)$(SHLIB_NAME).$(GRASS_VERSION_NUMBER)$(SHLIB_SUFFIX)
+SHLIB_VERSION=1
+SHLIB_MINORVERSION=0
+SHLIB_RELEASE=1
+SHLIB_FULLVERSION=$(SHLIB_VERSION).$(SHLIB_MINORVERSION).$(SHLIB_RELEASE)
+SONAME = $(SHLIB_PREFIX)$(SHLIB_NAME)$(SHLIB_SUFFIX).$(SHLIB_VERSION)
+SHLIB = $(ARCH_LIBDIR)/$(SONAME).$(SHLIB_MINORVERSION).$(SHLIB_RELEASE)

#for i18N support
PACKAGE ="grasslibs"
@@ -8,9 +13,9 @@
NLS_CFLAGS=$(GETHOSTNAME) $(ZLIBINCPATH) $(PICFLAGS) $(DEFS)

CFLAGS += $(SHLIB_CFLAGS) $(NLS_CFLAGS)
-LDFLAGS += $(SHLIB_LDFLAGS)
+LDFLAGS += $(SHLIB_LDFLAGS) -Wl,-soname,$(SONAME)

$(SHLIB): $(SHLIB_OBJS)
- $(SHLIB_LD) -o $@ $(LDFLAGS) $^ $(EXTRA_LIBS) && ln -f -s $(notdir $@) $(patsubst %.$(GRASS_VERSION_NUMBER)$(SHLIB_SUFFIX),%$(SHLIB_SUFFIX),$@)
+ $(SHLIB_LD) -o $@ $(LDFLAGS) $^ $(EXTRA_LIBS) && ln -f -s $(notdir $@) $(patsubst %.$(SHLIB_FULLVERSION),%,$@)

shlib: $(SHLIB)

Jan-Oliver Wagner wrote:

on behalf of my collegues Silke and Sascha I am sending you
this patch which is required for having shared libraries work
for having adequate RPM packages (we needed this and tested it
for Fedora Core 4).

I am not aware of a email-thread where this has been discussed,
so I just post it here. Silke is currently on the road (again)
and asked me to send this patch as it should not further delayed.

Let me know
whether you like
whether I should commit
whether anyone else wants to commit

Your patch is platform-specific; e.g. it won't work with a linker
which doesn't understand -Wl,-soname. Any such change needs to go into
the platform-specific section of SC_CONFIG_CFLAGS in aclocal.m4.

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

On Sat, Nov 26, 2005 at 12:38:49PM +0000, Glynn Clements wrote:

Jan-Oliver Wagner wrote:

> on behalf of my collegues Silke and Sascha I am sending you
> this patch which is required for having shared libraries work
> for having adequate RPM packages (we needed this and tested it
> for Fedora Core 4).
>
> I am not aware of a email-thread where this has been discussed,
> so I just post it here. Silke is currently on the road (again)
> and asked me to send this patch as it should not further delayed.
>
> Let me know
> whether you like
> whether I should commit
> whether anyone else wants to commit

Your patch is platform-specific; e.g. it won't work with a linker
which doesn't understand -Wl,-soname. Any such change needs to go into
the platform-specific section of SC_CONFIG_CFLAGS in aclocal.m4.

OK, we will fix it for GNU/Linux.

  Jan

--
Jan-Oliver Wagner: www.intevation.de/~jan | GISpatcher: www.gispatcher.de
Kolab Konsortium : www.kolab-konsortium.de | Thuban : thuban.intevation.org
Intevation GmbH : www.intevation.de | Kolab : www.kolab.org
FreeGIS : www.freegis.org | GAV : www.grass-verein.de