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