aboutsummaryrefslogblamecommitdiffstats
path: root/main/libtirpc/soname-suffix.patch
blob: 1e07ed442c03ef0a9be8cf8c656884675501a4ba (plain) (tree)
1
2
                                            
 














                                                     

                  
                                        







                                                                         
                                                            







                                                                            






                                            
 










                                               

                     
                                                      















                                                                                       
                                                                                   

































                                                                                                                                 
Allow appending a suffix with SONAME_SUFFIX=

diff --git a/Makefile.am b/Makefile.am
index 3f60637..252568b 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -46,7 +46,7 @@ nobase_include_HEADERS += \
 endif
 
 pkgconfigdir=$(libdir)/pkgconfig
-pkgconfig_DATA = libtirpc.pc
+pkgconfig_DATA = libtirpc@SONAME_SUFFIX@.pc
 
 CLEANFILES	       = cscope.* *~
 DISTCLEANFILES	       = Makefile.in libtirpc*.tar.gz
diff --git a/configure.ac b/configure.ac
index 8065881..c1a2a97 100644
--- a/configure.ac
+++ b/configure.ac
@@ -74,6 +74,8 @@ AC_ARG_ENABLE(symvers,
       [],[enable_symvers=yes])
 AM_CONDITIONAL(SYMVERS, test "x$enable_symvers" = xyes)
 
+AC_ARG_VAR([SONAME_SUFFIX], [Suffix to be appended to the library name])
+
 AC_CANONICAL_BUILD
 # Check for which host we are on and setup a few things
 # specifically based on the host
@@ -98,6 +100,7 @@ AC_CHECK_LIB([pthread], [pthread_create])
 AC_CHECK_FUNCS([getrpcbyname getrpcbynumber setrpcent endrpcent getrpcent])
 
 AC_CONFIG_FILES([Makefile src/Makefile man/Makefile doc/Makefile])
-AC_OUTPUT(libtirpc.pc)
+AC_CONFIG_FILES([libtirpc$SONAME_SUFFIX.pc:libtirpc.pc.in])
+AC_OUTPUT
 
 
diff --git a/libtirpc.pc.in b/libtirpc.pc.in
index d2c7878..090b3fa 100644
--- a/libtirpc.pc.in
+++ b/libtirpc.pc.in
@@ -3,10 +3,10 @@ exec_prefix=@exec_prefix@
 libdir=@libdir@
 includedir=@includedir@
 
-Name: libtirpc
+Name: libtirpc@SONAME_SUFFIX@
 Description: Transport Independent RPC Library
 Requires:
 Version: @PACKAGE_VERSION@
-Libs: -L${libdir} -ltirpc
+Libs: -L${libdir} -ltirpc@SONAME_SUFFIX@
 Libs.private: -lpthread
 Cflags: -I${includedir}/tirpc
diff --git a/src/Makefile.am b/src/Makefile.am
index b2d5436..7280403 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -10,12 +10,12 @@ noinst_HEADERS = rpc_com.h debug.h
 AM_CPPFLAGS = -I$(top_srcdir)/tirpc -include config.h -DPORTMAP -DINET6 \
 		-D_GNU_SOURCE -Wall -pipe
 
-lib_LTLIBRARIES = libtirpc.la
+lib_LTLIBRARIES = libtirpc@SONAME_SUFFIX@.la
 
-libtirpc_la_LDFLAGS = @LDFLAG_NOUNDEFINED@ -no-undefined -lpthread
-libtirpc_la_LDFLAGS += -version-info @LT_VERSION_INFO@
+libtirpc@SONAME_SUFFIX@_la_LDFLAGS = @LDFLAG_NOUNDEFINED@ -no-undefined -lpthread
+libtirpc@SONAME_SUFFIX@_la_LDFLAGS += -version-info @LT_VERSION_INFO@
 
-libtirpc_la_SOURCES = auth_none.c auth_unix.c authunix_prot.c \
+libtirpc@SONAME_SUFFIX@_la_SOURCES = auth_none.c auth_unix.c authunix_prot.c \
         binddynport.c bindresvport.c \
         clnt_bcast.c clnt_dg.c clnt_generic.c clnt_perror.c clnt_raw.c clnt_simple.c \
         clnt_vc.c rpc_dtablesize.c getnetconfig.c getnetpath.c getrpcent.c \
@@ -27,26 +27,26 @@ libtirpc_la_SOURCES = auth_none.c auth_unix.c authunix_prot.c \
         auth_time.c debug.c 
 
 if AUTHDES
-libtirpc_la_SOURCES += auth_des.c  authdes_prot.c  des_crypt.c  des_impl.c  des_soft.c  svc_auth_des.c
+libtirpc@SONAME_SUFFIX@_la_SOURCES += auth_des.c  authdes_prot.c  des_crypt.c  des_impl.c  des_soft.c  svc_auth_des.c
 endif
 
 ## XDR
-libtirpc_la_SOURCES += xdr.c xdr_rec.c xdr_array.c xdr_float.c xdr_mem.c xdr_reference.c xdr_stdio.c xdr_sizeof.c
+libtirpc@SONAME_SUFFIX@_la_SOURCES += xdr.c xdr_rec.c xdr_array.c xdr_float.c xdr_mem.c xdr_reference.c xdr_stdio.c xdr_sizeof.c
 
 if SYMVERS
-    libtirpc_la_LDFLAGS += -Wl,--version-script=$(srcdir)/libtirpc.map
+    libtirpc@SONAME_SUFFIX@_la_LDFLAGS += -Wl,--version-script=$(srcdir)/libtirpc.map
 endif
 
 ## Secure-RPC
 if GSS
-    libtirpc_la_SOURCES += auth_gss.c authgss_prot.c svc_auth_gss.c \
+    libtirpc@SONAME_SUFFIX@_la_SOURCES += auth_gss.c authgss_prot.c svc_auth_gss.c \
 			   rpc_gss_utils.c
-    libtirpc_la_LIBADD = $(GSSAPI_LIBS)
-    libtirpc_la_CFLAGS = -DHAVE_RPCSEC_GSS $(GSSAPI_CFLAGS)
+    libtirpc@SONAME_SUFFIX@_la_LIBADD = $(GSSAPI_LIBS)
+    libtirpc@SONAME_SUFFIX@_la_CFLAGS = -DHAVE_RPCSEC_GSS $(GSSAPI_CFLAGS)
 endif
 
-libtirpc_la_SOURCES += key_call.c key_prot_xdr.c getpublickey.c
-libtirpc_la_SOURCES += netname.c netnamer.c rpcdname.c rtime.c
+libtirpc@SONAME_SUFFIX@_la_SOURCES += key_call.c key_prot_xdr.c getpublickey.c
+libtirpc@SONAME_SUFFIX@_la_SOURCES += netname.c netnamer.c rpcdname.c rtime.c
 
 CLEANFILES	       = cscope.* *~
 DISTCLEANFILES	       = Makefile.in