Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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 <vapier@gentoo.org>
  • Loading branch information...
commit 6a14f02fb2e18e66bbfd48ff3c5a7a5b677b51ed 1 parent 357f65c
@vapier vapier authored committed
Showing with 11 additions and 3 deletions.
  1. +10 −3 configure.ac
  2. +1 −0  libnfs.pc.in
View
13 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 <sys/socket.h>
])
-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]
View
1  libnfs.pc.in
@@ -12,3 +12,4 @@ Requires:
Conflicts:
Libs: -L${libdir} -lnfs
Cflags: -I${includedir}
+Requires.private: @LIBNFS_PC_REQ_PRIVATE@
Please sign in to comment.
Something went wrong with that request. Please try again.