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