From: Mike Frysinger Date: Sun, 18 Sep 2011 01:35:40 +0000 (+1000) Subject: tirpc: use pkg-config to find details X-Git-Tag: upstream/1.9.6^2~297 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=6a14f02fb2e18e66bbfd48ff3c5a7a5b677b51ed;p=deb_libnfs.git tirpc: use pkg-config to find details Hardcoding paths breaks cross-compiling, so use the pkg-config files that libtirpc already provides. Signed-off-by: Mike Frysinger --- diff --git a/configure.ac b/configure.ac index 12b33cd..c906831 100644 --- a/configure.ac +++ b/configure.ac @@ -11,6 +11,7 @@ AC_PROG_CC AC_PROG_LIBTOOL AM_PROG_CC_C_O +PKG_PROG_PKG_CONFIG # Work around stupid autoconf default cflags. pt 2 if test "$SAVE_CFLAGS" = "x"; then @@ -71,12 +72,18 @@ AC_CHECK_MEMBER([struct sockaddr.sa_len], #include ]) -echo "Use TI-RPC: $enable_tirpc" +LIBNFS_PC_REQ_PRIVATE= + if test "$enable_tirpc" = "yes"; then - CFLAGS="${CFLAGS} -I /usr/include/tirpc" - LDFLAGS="${LDFLAGS} -ltirpc" + PKG_CHECK_MODULES(TIRPC, libtirpc, [], + AC_MSG_ERROR([unable to locate libtirpc files])) + CFLAGS="${CFLAGS} ${TIRPC_CFLAGS}" + LIBS="${LIBS} ${TIRPC_LIBS}" + LIBNFS_PC_REQ_PRIVATE="${LIBNFS_PC_REQ_PRIVATE} libtirpc" fi +AC_SUBST(LIBNFS_PC_REQ_PRIVATE) + #output AC_CONFIG_FILES([Makefile] [include/Makefile] diff --git a/libnfs.pc.in b/libnfs.pc.in index fdc012c..e7e3a91 100644 --- a/libnfs.pc.in +++ b/libnfs.pc.in @@ -12,3 +12,4 @@ Requires: Conflicts: Libs: -L${libdir} -lnfs Cflags: -I${includedir} +Requires.private: @LIBNFS_PC_REQ_PRIVATE@