Blame SOURCES/libdap-3.19.1-use-libtirpc.patch

a81ca7
diff --git a/Makefile.am b/Makefile.am
a81ca7
index f5dab89..8c90f30 100644
a81ca7
--- a/Makefile.am
a81ca7
+++ b/Makefile.am
a81ca7
@@ -6,7 +6,7 @@ ACLOCAL_AMFLAGS = -I conf -I gl/m4
a81ca7
 aclocaldir=$(datadir)/aclocal
a81ca7
 pkgconfigdir=$(libdir)/pkgconfig
a81ca7
 
a81ca7
-AM_CPPFLAGS = -I$(top_builddir)/gl -I$(top_srcdir)/gl -I$(top_srcdir)/GNU $(XML2_CFLAGS)
a81ca7
+AM_CPPFLAGS = -I$(top_builddir)/gl -I$(top_srcdir)/gl -I$(top_srcdir)/GNU $(XML2_CFLAGS) $(TIRPC_CFLAGS)
a81ca7
 AM_CXXFLAGS = 
a81ca7
 
a81ca7
 if COMPILER_IS_GCC
a81ca7
@@ -47,7 +47,7 @@ man_MANS = getdap.1 dap-config.1 getdap4.1
a81ca7
 	groff -t -e -mandoc -Tascii $< | col -bx > $@
a81ca7
 
a81ca7
 libparsers_la_SOURCES = $(FLEX_SRC) $(BISON_SRC)  
a81ca7
-libparsers_la_CPPFLAGS = $(XML2_CFLAGS)
a81ca7
+libparsers_la_CPPFLAGS = $(XML2_CFLAGS) $(TIRPC_CFLAGS)
a81ca7
 libparsers_la_LIBADD = $(XML2_LIBS)
a81ca7
 
a81ca7
 libdap_la_SOURCES = $(DAP_SRC) $(GNU_SRC)
a81ca7
diff --git a/conf/acinclude.m4 b/conf/acinclude.m4
a81ca7
index 63a17e7..df3d7c9 100644
a81ca7
--- a/conf/acinclude.m4
a81ca7
+++ b/conf/acinclude.m4
a81ca7
@@ -558,12 +558,23 @@ AC_DEFUN([DODS_CHECK_SIZES], [dnl
a81ca7
     #
a81ca7
     # Unfortunately, there is little commonality about xdr
a81ca7
 
a81ca7
-    # First, we need to see if the xdr routines are in libc, librpc,
a81ca7
+    # First, we need to see if the xdr routines are in libtirpc, libc, librpc,
a81ca7
     # or librpcsvc or libnsl
a81ca7
     dap_xdrlib=
a81ca7
-    AC_SEARCH_LIBS([xdr_void],[c rpc nsl rpcsvc],[
a81ca7
-      dap_xdrlib=`echo $ac_res|sed -e 's/^-l//'`],[
a81ca7
-      AC_MSG_WARN(Cannot locate library containing xdr functions.)])
a81ca7
+	PKG_PROG_PKG_CONFIG([0.9.0])
a81ca7
+	PKG_CHECK_MODULES([TIRPC], [libtirpc >= 0.2.4],
a81ca7
+		[dap_xdrlib=`echo "${TIRPC_LIBS}" | sed -e 's/^-l//'`
a81ca7
+		AC_SUBST([TIRPC_CFLAGS])
a81ca7
+		AC_SUBST([TIRPC_LIBS])
a81ca7
+		AC_DEFINE([HAVE_LIBTIRPC], [1], [Define to 1 to use libtirpc.])],
a81ca7
+		[dap_xdrlib=""]
a81ca7
+	)
a81ca7
+	AS_IF(
a81ca7
+	[test "$dap_xdrlib" = ""],
a81ca7
+    	[AC_SEARCH_LIBS([xdr_void],[c rpc nsl rpcsvc],[
a81ca7
+    	  dap_xdrlib=`echo $ac_res|sed -e 's/^-l//'`],[
a81ca7
+    	  AC_MSG_WARN(Cannot locate library containing xdr functions.)])])
a81ca7
+
a81ca7
     # Added for autoconf 2.59 which appears to not use/set $ac_res. jhrg
a81ca7
     if test -z "$dap_xdrlib" ; then dap_xdrlib=c; fi
a81ca7
     if test "$dap_xdrlib" = "none required" ; then dap_xdrlib=c; fi
a81ca7
diff --git a/d4_ce/Makefile.am b/d4_ce/Makefile.am
a81ca7
index aa1a070..fcae7a4 100644
a81ca7
--- a/d4_ce/Makefile.am
a81ca7
+++ b/d4_ce/Makefile.am
a81ca7
@@ -7,7 +7,7 @@ AUTOMAKE_OPTIONS = foreign
a81ca7
 .NOTPARALLEL:
a81ca7
 
a81ca7
 # Arrange to build with the backward compatibility mode enabled.
a81ca7
-AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/d4_ce -I$(srcdir) $(XML2_CFLAGS)
a81ca7
+AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/d4_ce -I$(srcdir) $(XML2_CFLAGS) $(TIRPC_CFLAGS)
a81ca7
 AM_CXXFLAGS =  
a81ca7
 
a81ca7
 if COMPILER_IS_GCC
a81ca7
diff --git a/tests/Makefile.am b/tests/Makefile.am
a81ca7
index f32e7d0..d51d255 100644
a81ca7
--- a/tests/Makefile.am
a81ca7
+++ b/tests/Makefile.am
a81ca7
@@ -4,7 +4,7 @@ AUTOMAKE_OPTIONS = foreign
a81ca7
 
a81ca7
 # Arrange to build with the backward compatibility mode enabled.
a81ca7
 AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/GNU -I$(top_srcdir)/d4_ce \
a81ca7
--I$(top_srcdir)/d4_function $(XML2_CFLAGS) $(CURL_CFLAGS)
a81ca7
+-I$(top_srcdir)/d4_function $(XML2_CFLAGS) $(CURL_CFLAGS) $(TIRPC_CFLAGS)
a81ca7
 AM_CXXFLAGS =  
a81ca7
 
a81ca7
 if COMPILER_IS_GCC
a81ca7
diff --git a/unit-tests/Makefile.am b/unit-tests/Makefile.am
a81ca7
index be70132..c5ae5e7 100644
a81ca7
--- a/unit-tests/Makefile.am
a81ca7
+++ b/unit-tests/Makefile.am
a81ca7
@@ -7,7 +7,8 @@ AUTOMAKE_OPTIONS = foreign
a81ca7
 
a81ca7
 # Headers in 'tests' are used by the arrayT unit tests.
a81ca7
 
a81ca7
-AM_CPPFLAGS = -I$(top_srcdir)/GNU -I$(top_srcdir) -I$(top_srcdir)/tests $(CURL_CFLAGS) $(XML2_CFLAGS)
a81ca7
+AM_CPPFLAGS = -I$(top_srcdir)/GNU -I$(top_srcdir) -I$(top_srcdir)/tests \
a81ca7
+$(CURL_CFLAGS) $(XML2_CFLAGS) $(TIRPC_CFLAGS)
a81ca7
 AM_LDADD = $(XML2_LIBS)
a81ca7
 AM_CXXFLAGS = 
a81ca7
 # CXXFLAGS =