aboutsummaryrefslogtreecommitdiffstats
path: root/main/libtirpc/soname-suffix.patch
blob: 4941bab172dd86441eef599ea35880d33fe444e7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
Allow to append a suffix to the library name via configuration
variable SONAME_SUFFIX.

--- a/configure.ac
+++ b/configure.ac
@@ -74,6 +74,8 @@
       [],[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_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
 
 
--- a/Makefile.am
+++ b/Makefile.am
@@ -46,7 +46,7 @@
 endif
 
 pkgconfigdir=$(libdir)/pkgconfig
-pkgconfig_DATA = libtirpc.pc
+pkgconfig_DATA = libtirpc@SONAME_SUFFIX@.pc
 
 CLEANFILES	       = cscope.* *~
 DISTCLEANFILES	       = Makefile.in libtirpc*.tar.gz
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -10,12 +10,12 @@
 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 @@
         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
--- a/libtirpc.pc.in
+++ b/libtirpc.pc.in
@@ -3,10 +3,10 @@
 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