summaryrefslogtreecommitdiff
blob: e0339af92b7e2413225b1ce6352e576e86e046da (plain)
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
From afd71b8fc0df036a884b3af14ddb875674a49a85 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Diego=20Elio=20Petten=F2?= <flameeyes@gmail.com>
Date: Mon, 29 Nov 2010 16:28:38 -0500
Subject: [PATCH] Use pkg-config to find libtirpc
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

This allows to properly cross-compile rpcbind, as /usr/include/tirpc is
no longer a valid path in that case.

Signed-off-by: Diego Elio Petten� <flameeyes@gmail.com>
Signed-off-by: Steve Dickson <steved@redhat.com>
---
 configure.in    |    4 +++-
 src/Makefile.am |   13 +++++++------
 2 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/configure.in b/configure.in
index de1c730..7d43fd4 100644
--- a/configure.in
+++ b/configure.in
@@ -51,7 +51,9 @@ AC_CHECK_HEADERS([arpa/inet.h fcntl.h netdb.h \
                   unistd.h nss.h])
 
 AC_CHECK_LIB([pthread], [pthread_create])
-AC_CHECK_LIB([tirpc], [clnt_create])
+
+PKG_CHECK_MODULES([TIRPC], [libtirpc])
+
 AC_ARG_ENABLE(libwrap,[ --enable-libwrap  Enables host name checking], 
 	[case "${enableval}" in
 		yes) libwarp=true 
diff --git a/src/Makefile.am b/src/Makefile.am
index cc0a85b..a2f3e34 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,4 +1,4 @@
-INCLUDES = -I$(srcdir)/tirpc -DPORTMAP -DINET6 -DVERSION="\"$(VERSION)\"" \
+INCLUDES = $(TIRPC_CFLAGS) -DPORTMAP -DINET6 -DVERSION="\"$(VERSION)\"" \
                                                 -D_GNU_SOURCE -Wall -pipe
 if DEBUG
 INCLUDES +=	-DRPCBIND_DEBUG -DSVC_RUN_DEBUG -DDEBUG_RMTCALL
@@ -23,12 +23,13 @@ rpcbind_SOURCES =       check_bound.c rpcbind.c \
                         rpcbind.h
 
 rpcinfo_SOURCES =       rpcinfo.c
-rpcinfo_LDFLAGS =       -lpthread -ltirpc
-rpcinfo_LDADD   =       $(LIB_TIRPC)
+rpcinfo_LDFLAGS =       -lpthread
+rpcinfo_LDADD   =       $(TIRPC_LIBS)
 
 
-rpcbind_LDFLAGS = -lpthread -ltirpc
-rpcbind_LDADD = $(LIB_TIRPC)
-AM_CPPFLAGS = -I/usr/include/tirpc -DCHECK_LOCAL -DPORTMAP \
+rpcbind_LDFLAGS = -lpthread
+rpcbind_CFLAGS = $(TIRPC_CFLAGS)
+rpcbind_LDADD = $(TIRPC_LIBS)
+AM_CPPFLAGS = -DCHECK_LOCAL -DPORTMAP \
                        -DFACILITY=LOG_MAIL -DSEVERITY=LOG_INFO
      
-- 
1.7.6