Linux: correctly set plugin library soname
authorFerry Huberts <f.huberts@mindef.nl>
Thu, 18 Aug 2011 11:52:28 +0000 (13:52 +0200)
committerFerry Huberts <f.huberts@mindef.nl>
Thu, 18 Aug 2011 11:52:28 +0000 (13:52 +0200)
By convention, non-core libraries should start with the 'lib'
prefix on Linux systems. Currently this is not the case for the
olsrd plugin libraries.

Since renaming the libraries would break all configurations,
the soname of an olsrd plugin library is now correctly set
with the 'lib' prefix so that an 'ldconfig -l <library>' will
create the correct link.

This patch fixes the issue for Linux only, other platforms
are not touched since I don't have those platforms available.

To completely fix the issue, PLUGIN_FULLNAME must be set as:
  PLUGIN_FULLNAME ?= lib$(PLUGIN_NAME).so.$(PLUGIN_VER)
Doing this will rename all olsrd plugin libraries.

Signed-off-by: Ferry Huberts <f.huberts@mindef.nl>
Makefile.inc
make/Makefile.android
make/Makefile.fbsd
make/Makefile.kfbsd
make/Makefile.linux
make/Makefile.nbsd
make/Makefile.obsd
make/Makefile.osx
make/Makefile.win32

index 1f254d9..34af527 100644 (file)
@@ -137,7 +137,7 @@ ifeq ($(OS),win32)
   LDFLAGS +=   -Wl,-export-all-symbols,--enable-auto-import
 endif
 LDFLAGS +=     -shared
-LDFLAGS +=     -Wl,-soname,$(PLUGIN_NAME)
+LDFLAGS +=     -Wl,-soname,$(PLUGIN_SONAME)
 LDFLAGS +=     -Wl,--version-script=version-script.txt 
 else
 # c and ld flags for main
index e323ec8..0b57a84 100644 (file)
@@ -70,6 +70,7 @@ CPPFLAGS += \
        -fno-strict-aliasing
 endif
 
+PLUGIN_SONAME ?= $(PLUGIN_NAME)
 PLUGIN_FULLNAME ?= $(PLUGIN_NAME).so.$(PLUGIN_VER)
 INSTALL_LIB =  install -D -m 755 $(PLUGIN_FULLNAME) $(LIBDIR)/$(PLUGIN_FULLNAME); \
                /sbin/ldconfig -n $(LIBDIR)
index 67074c8..283e3ff 100644 (file)
@@ -32,6 +32,7 @@ CFLAGS +=     -fPIC
 LDFLAGS +=     -fPIC
 endif
 
+PLUGIN_SONAME ?= $(PLUGIN_NAME)
 PLUGIN_FULLNAME ?= $(PLUGIN_NAME).so.$(PLUGIN_VER)
 INSTALL_LIB =  install -m 755 $(PLUGIN_FULLNAME) $(LIBDIR)/$(PLUGIN_FULLNAME); \
                /sbin/ldconfig
index b2841ae..933a1e2 100644 (file)
@@ -34,6 +34,7 @@ CFLAGS +=     -fPIC
 LDFLAGS +=     -fPIC
 endif
 
+PLUGIN_SONAME ?= $(PLUGIN_NAME)
 PLUGIN_FULLNAME ?= $(PLUGIN_NAME).so.$(PLUGIN_VER)
 INSTALL_LIB =  install -m 755 $(PLUGIN_FULLNAME) $(LIBDIR)/$(PLUGIN_FULLNAME);
 UNINSTALL_LIB =        rm -f $(LIBDIR)/$(PLUGIN_FULLNAME);
index 3292258..3fb19b9 100644 (file)
@@ -12,6 +12,7 @@ HDRS +=               $(wildcard src/linux/*.h src/unix/*.h)
 CPPFLAGS +=    -Dlinux -DLINUX_NETLINK_ROUTING
 LIBS +=                
 
+PLUGIN_SONAME ?= lib$(PLUGIN_NAME).so
 PLUGIN_FULLNAME ?= $(PLUGIN_NAME).so.$(PLUGIN_VER)
 INSTALL_LIB =  install -D -m 755 $(PLUGIN_FULLNAME) $(LIBDIR)/$(PLUGIN_FULLNAME); \
                /sbin/ldconfig -n $(LIBDIR)
index 4d655f3..392b1c0 100644 (file)
@@ -11,6 +11,7 @@ HDRS +=               $(wildcard src/bsd/*.h src/unix/*.h)
 CPPFLAGS +=    -D__NetBSD__
 LIBS +=                
 
+PLUGIN_SONAME ?= $(PLUGIN_NAME)
 PLUGIN_FULLNAME ?= $(PLUGIN_NAME).so.$(PLUGIN_VER)
 INSTALL_LIB =  install -m 755 $(PLUGIN_FULLNAME) $(LIBDIR)/$(PLUGIN_FULLNAME); \
                /sbin/ldconfig
index ea2c1e0..1cac7df 100644 (file)
@@ -11,6 +11,7 @@ HDRS +=               $(wildcard src/bsd/*.h src/unix/*.h)
 CPPFLAGS +=    -D__OpenBSD__
 LIBS +=                
 
+PLUGIN_SONAME ?= $(PLUGIN_NAME)
 PLUGIN_FULLNAME ?= $(PLUGIN_NAME).so.$(PLUGIN_VER)
 INSTALL_LIB =  install -m 755 $(PLUGIN_FULLNAME) $(LIBDIR)/$(PLUGIN_FULLNAME); \
                /sbin/ldconfig
index a74dc16..614a28c 100644 (file)
@@ -15,6 +15,7 @@ HDRS +=               $(wildcard src/bsd/*.h src/unix/*.h)
 CPPFLAGS +=    -D__MacOSX__
 LIBS +=                
 
+PLUGIN_SONAME ?= $(PLUGIN_NAME)
 PLUGIN_FULLNAME ?= $(PLUGIN_NAME).so.$(PLUGIN_VER)
 INSTALL_LIB =  install -m 755 $(PLUGIN_FULLNAME) $(LIBDIR)/$(PLUGIN_FULLNAME)
 UNINSTALL_LIB =        rm -f $(LIBDIR)/$(PLUGIN_FULLNAME)
index ae0bfd1..703873c 100644 (file)
@@ -13,6 +13,7 @@ LIBS +=               -mno-cygwin -lws2_32 -liphlpapi
 CPPFLAGS +=    -I$(TOPDIR)/src/win32
 CFLAGS +=      -mno-cygwin
 
+PLUGIN_SONAME ?= $(PLUGIN_NAME)
 PLUGIN_FULLNAME ?= $(PLUGIN_NAME).dll
 INSTALL_LIB =  cp $(PLUGIN_FULLNAME) ../..
 UNINSTALL_LIB =        del /F ../../$(PLUGIN_FULLNAME)