Blame SOURCES/patch-tirpc

07e253
diff --git a/config/amanda/amanda_configure.m4 b/config/amanda/amanda_configure.m4
07e253
index 5b427ae..f90810f 100644
07e253
--- a/config/amanda/amanda_configure.m4
07e253
+++ b/config/amanda/amanda_configure.m4
07e253
@@ -18,7 +18,6 @@ AC_PREREQ(2.64)
07e253
 # Take care of some early Amanda-specific setup
07e253
 #
07e253
 AMANDA_CONFIGURE_ARGS
07e253
-AMANDA_INIT_SUMMARY
07e253
 AMANDA_SNAPSHOT_STAMP
07e253
 AMANDA_SPLIT_VERSION
07e253
 AMANDA_CONFIG_LOCAL
07e253
diff --git a/config/amanda/components.m4 b/config/amanda/components.m4
07e253
index f2a07db..7628453 100644
07e253
--- a/config/amanda/components.m4
07e253
+++ b/config/amanda/components.m4
07e253
@@ -186,7 +186,21 @@ AC_DEFUN([AMANDA_WITHOUT_NDMP], [
07e253
 	    n | no) WANT_NDMP=false;;
07e253
 	    *) AC_MSG_ERROR([You must not supply an argument to --with-ndmp option.]) ;;
07e253
 	    esac
07e253
-	])
07e253
+    ])
07e253
+    AC_CHECK_HEADERS(rpc/rpc.h, HAVE_RPC_RPC_H=1)
07e253
+    if test x"$WANT_NDMP" = x"true"; then
07e253
+	if test x"$HAVE_RPC_RPC_H" = x"1"; then
07e253
+	    WANT_NDMP=true
07e253
+	else
07e253
+	    AMANDA_CHECK_TIRPC
07e253
+	    if test x"$HAVE_RPC_RPC_H" = x"1"; then
07e253
+		WANT_NDMP=true
07e253
+	    else
07e253
+		WANT_NDMP=false
07e253
+		AMANDA_MSG_WARN([Disabling NDMP because rpc/rpc.h is not found])
07e253
+	    fi
07e253
+	fi
07e253
+   fi
07e253
 ])
07e253
 
07e253
 # SYNOPSIS
07e253
diff --git a/config/amanda/libs.m4 b/config/amanda/libs.m4
07e253
index 0388c9b..a640557 100644
07e253
--- a/config/amanda/libs.m4
07e253
+++ b/config/amanda/libs.m4
07e253
@@ -183,6 +183,44 @@ AC_DEFUN([AMANDA_CHECK_GLIB], [
07e253
     AMANDA_ADD_LIBS($GLIB_LIBS)
07e253
 ])
07e253
 
07e253
+# SYNOPSIS
07e253
+#
07e253
+#   AMANDA_CHECK_TIRPC
07e253
+#
07e253
+# OVERVIEW
07e253
+#
07e253
+#   Search for tirpc.
07e253
+#
07e253
+AC_DEFUN([AMANDA_CHECK_TIRPC],
07e253
+[
07e253
+    AC_PATH_PROG(PKG_CONFIG, pkg-config, [], $LOCSYSPATH:/opt/csw/bin:/usr/local/bin:/opt/local/bin)
07e253
+
07e253
+    tirpc_ld_flags=`$PKG_CONFIG libtirpc --libs-only-L 2>/dev/null`
07e253
+    tirpc_lib_flags=`$PKG_CONFIG libtirpc --libs-only-l --libs-only-other 2>/dev/null`
07e253
+    tirpc_cppflags=`$PKG_CONFIG libtirpc --cflags-only-I 2>/dev/null`
07e253
+    tirpc_cflags=`$PKG_CONFIG libtirpc --cflags-only-other 2>/dev/null`
07e253
+
07e253
+    _libtirpc_save_cppflags=$CPPFLAGS
07e253
+    CPPFLAGS="$CPPFLAGS $tirpc_cppflags"
07e253
+    _libtirpc_save_libs=$LIBS
07e253
+    LIBS="$LIBS $tirpc_lib_flags"
07e253
+
07e253
+    unset HAVE_RPC_RPC_H
07e253
+    unset ac_cv_header_rpc_rpc_h
07e253
+    AC_CHECK_HEADERS(rpc/rpc.h, HAVE_RPC_RPC_H=1)
07e253
+
07e253
+    CPPFLAGS=$_libtirpc_save_cppflags
07e253
+    LIBS=$_libtirpc_save_libs
07e253
+
07e253
+    if test x"$HAVE_RPC_RPC_H" = x"1"; then
07e253
+	AMANDA_ADD_LDFLAGS($tirpc_ld_flags)
07e253
+	AMANDA_ADD_LIBS($tirpc_lib_flags)
07e253
+
07e253
+	AMANDA_ADD_CPPFLAGS($tirpc_cppflags)
07e253
+	AMANDA_ADD_CFLAGS($tirpc_cflags)
07e253
+    fi
07e253
+])
07e253
+
07e253
 # LIBCURL_CHECK_CONFIG is from the libcurl
07e253
 # distribution and licensed under the BSD license:
07e253
 # Copyright (c) 1996 - 2007, Daniel Stenberg, <daniel@haxx.se>.
07e253
diff --git a/configure.ac b/configure.ac
07e253
index 89c4890..8d325b7 100644
07e253
--- a/configure.ac
07e253
+++ b/configure.ac
07e253
@@ -13,6 +13,7 @@ AMANDA_VERSION
07e253
 gl_EARLY
07e253
 gl_INIT
07e253
 
07e253
+AMANDA_INIT_SUMMARY
07e253
 AMANDA_CONFIGURE
07e253
 
07e253
 AC_DEFINE([USE_GETTEXT], 1, [Define to 1 if files will be processed with gettextize])