libnfs: install rpcbind too, cleanup

Signed-off-by: Stephan Raue <stephan@openelec.tv>
This commit is contained in:
Stephan Raue 2011-11-10 04:53:17 +01:00
parent 291b256102
commit c159035441
3 changed files with 3 additions and 118 deletions

View File

@ -32,8 +32,7 @@ cd $PKG_BUILD
--libdir=/usr/lib \ --libdir=/usr/lib \
--sysconfdir=/etc \ --sysconfdir=/etc \
--disable-examples \ --disable-examples \
--enable-tirpc \ --disable-tirpc \
--with-tirpcinclude="$SYSROOT_PREFIX/usr/include/tirpc" \
make make
$MAKEINSTALL $MAKEINSTALL

View File

@ -25,8 +25,8 @@ PKG_ARCH="any"
PKG_LICENSE="GPL" PKG_LICENSE="GPL"
PKG_SITE="https://github.com/sahlberg/libnfs" PKG_SITE="https://github.com/sahlberg/libnfs"
PKG_URL="$DISTRO_SRC/$PKG_NAME-$PKG_VERSION.tar.bz2" PKG_URL="$DISTRO_SRC/$PKG_NAME-$PKG_VERSION.tar.bz2"
PKG_DEPENDS="libtirpc" PKG_DEPENDS="rpcbind"
PKG_BUILD_DEPENDS="toolchain libtirpc" PKG_BUILD_DEPENDS="toolchain"
PKG_PRIORITY="optional" PKG_PRIORITY="optional"
PKG_SECTION="network" PKG_SECTION="network"
PKG_SHORTDESC="libnfs: a client library for accessing NFS shares over a network." PKG_SHORTDESC="libnfs: a client library for accessing NFS shares over a network."

View File

@ -1,114 +0,0 @@
diff --git a/Makefile.am b/Makefile.am
index 03e4419..5172bed 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -5,3 +5,5 @@ pkgconfig_DATA = libnfs.pc
EXTRA_DIST = README COPYING libnfs.pc.in
+ACLOCAL_AMFLAGS = -I aclocal
+
diff --git a/aclocal/libtirpc.m4 b/aclocal/libtirpc.m4
new file mode 100644
index 0000000..9f0fde0
--- /dev/null
+++ b/aclocal/libtirpc.m4
@@ -0,0 +1,40 @@
+dnl Checks for TI-RPC library and headers
+dnl
+AC_DEFUN([AC_LIBTIRPC], [
+
+ AC_ARG_WITH([tirpcinclude],
+ [AC_HELP_STRING([--with-tirpcinclude=DIR],
+ [use TI-RPC headers in DIR])],
+ [tirpc_header_dir=$withval],
+ [tirpc_header_dir=/usr/include/tirpc])
+
+ dnl if --enable-tirpc was specifed, the following components
+ dnl must be present, and we set up HAVE_ macros for them.
+
+ if test "$enable_tirpc" != "no"; then
+
+ dnl look for the library; add to LIBS if found
+ AC_CHECK_LIB([tirpc], [clnt_tli_create], ,
+ [if test "$enable_tirpc" = "yes"; then
+ AC_MSG_ERROR([libtirpc not found.])
+ else
+ AC_MSG_WARN([libtirpc not found. TIRPC disabled!])
+ enable_tirpc="no"
+ fi])
+ fi
+
+ if test "$enable_tirpc" != "no"; then
+ dnl also must have the headers installed where we expect
+ dnl look for headers; add -I compiler option if found
+ AC_CHECK_HEADERS([${tirpc_header_dir}/netconfig.h],
+ AC_SUBST([AM_CPPFLAGS], ["-I${tirpc_header_dir}"]),
+ [if test "$enable_tirpc" = "yes"; then
+ AC_MSG_ERROR([libtirpc headers not found.])
+ else
+ AC_MSG_WARN([libtirpc headers not found. TIRPC disabled!])
+ enable_tirpc="no"
+ fi])
+
+ fi
+
+])dnl
diff --git a/configure.ac b/configure.ac
index 24400c3..f84e391 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,5 +1,6 @@
AC_PREREQ(2.50)
AC_INIT([libnfs], [1.0.0])
+AC_CONFIG_MACRO_DIR(aclocal)
AC_CONFIG_HEADERS([config.h])
AM_INIT_AUTOMAKE([foreign])
AC_CANONICAL_HOST
@@ -22,7 +23,14 @@ if test x$HAVE_RPCGEN != xyes; then
AC_MSG_ERROR([Can not find required program])
fi
-#option: examples
+dnl option: libtirpc
+AC_ARG_ENABLE(tirpc,
+ [AC_HELP_STRING([--enable-tirpc],
+ [enable use of TI-RPC @<:@default=no@:>@])],
+ enable_tirpc=$enableval,
+ enable_tirpc='no')
+
+dnl option: examples
AC_ARG_ENABLE([examples],
[AC_HELP_STRING([--enable-examples],
[Build example programs])],
@@ -34,12 +42,6 @@ if test x$ENABLE_EXAMPLES = xyes; then
fi
AC_SUBST(MAYBE_EXAMPLES)
-AC_ARG_ENABLE(tirpc,
- [AC_HELP_STRING([--enable-tirpc],
- [enable use of TI-RPC @<:@default=no@:>@])],
- enable_tirpc=$enableval,
- enable_tirpc='no')
-
case $host in
*darwin*)
RPCGENFLAGS=-DU_INT64_PLATTFORM_TYPE="u_int64_t"
@@ -71,11 +73,13 @@ AC_CHECK_MEMBER([struct sockaddr.sa_len],
#include <sys/socket.h>
])
+PKG_PROG_PKG_CONFIG()
+
+dnl Check for TI-RPC library and headers
+AC_LIBTIRPC
+
+dnl Check for TI-RPC library and headers
echo "Use TI-RPC: $enable_tirpc"
-if test "$enable_tirpc" = "yes"; then
- CFLAGS="${CFLAGS} -I /usr/include/tirpc"
- LDFLAGS="${LDFLAGS} -ltirpc"
-fi
#output
AC_CONFIG_FILES([Makefile]