summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiego Elio Pettenò <flameeyes@gmail.com>2010-11-29 16:28:38 -0500
committerSteve Dickson <steved@redhat.com>2010-11-30 07:27:03 -0500
commitafd71b8fc0df036a884b3af14ddb875674a49a85 (patch)
treec4319fb54689149237c8dcccfd2de02f36b2e5ce
parenteb36cf198795b09c1ba796044fc99fa40c5a2b33 (diff)
downloadrpcbind-afd71b8fc0df036a884b3af14ddb875674a49a85.tar.gz
Use pkg-config to find libtirpc
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>
-rw-r--r--configure.in4
-rw-r--r--src/Makefile.am13
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