From afd71b8fc0df036a884b3af14ddb875674a49a85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20Elio=20Petten=F2?= 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ò Signed-off-by: Steve Dickson --- 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