[libpri-commits] russell: trunk r546 - /trunk/Makefile

SVN commits to the libpri project libpri-commits at lists.digium.com
Tue Apr 22 10:30:37 CDT 2008


Author: russell
Date: Tue Apr 22 10:30:37 2008
New Revision: 546

URL: http://svn.digium.com/view/libpri?view=rev&rev=546
Log:
All versions of libpri have been installed as libpri.so.1.0, even though
the API and ABI have changed over time.  This patch changes the Makefile
to install the library as libpri.so.1.6 to indicate that this is not
compatible with previous versions.  In the future, this should be changed
as we make ABI changes.

(closes issue #10376)
Reported by: tzafrir
Patches:
      libpri-soname.diff uploaded by tzafrir (license 46)
	  -- with very minor changes by me

Modified:
    trunk/Makefile

Modified: trunk/Makefile
URL: http://svn.digium.com/view/libpri/trunk/Makefile?view=diff&rev=546&r1=545&r2=546
==============================================================================
--- trunk/Makefile (original)
+++ trunk/Makefile Tue Apr 22 10:30:37 2008
@@ -32,14 +32,19 @@
 OSARCH=$(shell uname -s)
 PROC?=$(shell uname -m)
 
+# SONAME version; should be changed on every ABI change
+# please don't change it needlessly; it's perfectly fine to have a SONAME
+# of 1.2 and a version of 1.4.x
+SONAME:=1.6
+
 STATIC_LIBRARY=libpri.a
-DYNAMIC_LIBRARY=libpri.so.1.0
+DYNAMIC_LIBRARY:=libpri.so.$(SONAME)
 STATIC_OBJS=copy_string.o pri.o q921.o prisched.o q931.o pri_facility.o
 DYNAMIC_OBJS=copy_string.lo pri.lo q921.lo prisched.lo q931.lo pri_facility.lo
 CFLAGS=-Wall -Werror -Wstrict-prototypes -Wmissing-prototypes -g -fPIC $(ALERTING) $(LIBPRI_COUNTERS)
 INSTALL_PREFIX=$(DESTDIR)
 INSTALL_BASE=/usr
-SOFLAGS = -Wl,-hlibpri.so.1.0
+SOFLAGS:=-Wl,-h$(DYNAMIC_LIBRARY)
 LDCONFIG = /sbin/ldconfig
 ifneq (,$(findstring X$(OSARCH)X, XLinuxX XGNU/kFreeBSDX))
 LDCONFIG_FLAGS=-n
@@ -54,7 +59,6 @@
 CFLAGS += -DSOLARIS -I../zaptel-solaris
 LDCONFIG = 
 LDCONFIG_FLAGS = \# # Trick to comment out the period in the command below
-SOSLINK = ln -sf libpri.so.1.0 libpri.so.1
 #INSTALL_PREFIX = /opt/asterisk  # Uncomment out to install in standard Solaris location for 3rd party code
 endif
 
@@ -92,20 +96,19 @@
 	install -m 644 libpri.h $(INSTALL_PREFIX)$(INSTALL_BASE)/include
 	install -m 755 $(DYNAMIC_LIBRARY) $(INSTALL_PREFIX)$(INSTALL_BASE)/lib
 	if [ -x /usr/sbin/sestatus ] && ( /usr/sbin/sestatus | grep "SELinux status:" | grep -q "enabled"); then /sbin/restorecon -v $(INSTALL_PREFIX)$(INSTALL_BASE)/lib/$(DYNAMIC_LIBRARY); fi
-	( cd $(INSTALL_PREFIX)$(INSTALL_BASE)/lib ; ln -sf libpri.so.1.0 libpri.so ; ln -sf libpri.so.1.0 libpri.so.1 )
+	( cd $(INSTALL_PREFIX)$(INSTALL_BASE)/lib ; ln -sf libpri.so.$(SONAME) libpri.so)
 	install -m 644 $(STATIC_LIBRARY) $(INSTALL_PREFIX)$(INSTALL_BASE)/lib
 	if test $$(id -u) = 0; then $(LDCONFIG) $(LDCONFIG_FLAGS) $(INSTALL_PREFIX)$(INSTALL_BASE)/lib; fi
 else
 	install -f $(INSTALL_PREFIX)$(INSTALL_BASE)/include -m 644 libpri.h
 	install -f $(INSTALL_PREFIX)$(INSTALL_BASE)/lib -m 755 $(DYNAMIC_LIBRARY)
-	( cd $(INSTALL_PREFIX)$(INSTALL_BASE)/lib ; ln -sf libpri.so.1.0 libpri.so ; $(SOSLINK) )
+	( cd $(INSTALL_PREFIX)$(INSTALL_BASE)/lib ; ln -sf libpri.so.$(SONAME) libpri.so)
 	install -f $(INSTALL_PREFIX)$(INSTALL_BASE)/lib -m 644 $(STATIC_LIBRARY)
 endif
 
 uninstall:
 	@echo "Removing Libpri"
-	rm -f $(INSTALL_PREFIX)$(INSTALL_BASE)/lib/libpri.so.1.0
-	rm -f $(INSTALL_PREFIX)$(INSTALL_BASE)/lib/libpri.so.1
+	rm -f $(INSTALL_PREFIX)$(INSTALL_BASE)/lib/libpri.so.$(SONAME)
 	rm -f $(INSTALL_PREFIX)$(INSTALL_BASE)/lib/libpri.so
 	rm -f $(INSTALL_PREFIX)$(INSTALL_BASE)/lib/libpri.a
 	rm -f $(INSTALL_PREFIX)$(INSTALL_BASE)/include/libpri.h
@@ -136,12 +139,10 @@
 $(DYNAMIC_LIBRARY): $(DYNAMIC_OBJS)
 	$(CC) -shared $(SOFLAGS) -o $@ $(DYNAMIC_OBJS)
 	$(LDCONFIG) $(LDCONFIG_FLAGS) .
-	ln -sf libpri.so.1.0 libpri.so
-	ln -sf libpri.so.1.0 libpri.so.1
-	$(SOSLINK)
+	ln -sf libpri.so.$(SONAME) libpri.so
 
 clean:
-	rm -f *.o *.so *.lo *.so.1 *.so.1.0
+	rm -f *.o *.so *.lo *.so.$(SONAME)
 	rm -f testprilib $(STATIC_LIBRARY) $(DYNAMIC_LIBRARY)
 	rm -f pritest pridump
 	rm -f .depend




More information about the libpri-commits mailing list