watchdog/0010-Choose-libtirpc-or-another-RPC-library-for-XDR-heade.patch
Troy Dawson 67899e6f1c RHEL 9.0.0 Alpha bootstrap
The content of this branch was automatically imported from Fedora ELN
with the following as its source:
https://src.fedoraproject.org/rpms/watchdog#86347a9b61b87a398333d219c564254c0ab7bbe6
2020-10-15 13:38:38 -07:00

58 lines
1.8 KiB
Diff

From 93f5334052cf14ae1149aa0f0b3178137eec01dd Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Wed, 6 Feb 2019 13:25:47 +0000
Subject: [PATCH 10/10] Choose libtirpc or another RPC library for XDR headers
and library.
Signed-off-by: Richard W.M. Jones <rjones@redhat.com>
---
configure.ac | 20 ++++++++++++++++++++
src/Makefile.am | 2 ++
2 files changed, 22 insertions(+)
diff --git a/configure.ac b/configure.ac
index f100829..4220411 100644
--- a/configure.ac
+++ b/configure.ac
@@ -156,4 +156,24 @@ AC_ARG_WITH(randomseed,
AC_MSG_RESULT("/var/run/random-seed")
])
+# Check for an RPC library, starting with libtirpc.
+PKG_CHECK_MODULES([RPC], [libtirpc], [], [
+ # If we don't have libtirpc, then we must have <rpc/rpc.h> and
+ # some library to link to in libdir.
+ RPC_CFLAGS=""
+ AC_CHECK_HEADER([rpc/rpc.h],[],[
+ AC_MSG_ERROR([XDR header files are required])
+ ],
+ [#include <rpc/types.h>])
+
+ old_LIBS="$LIBS"
+ LIBS=""
+ AC_SEARCH_LIBS([xdrmem_create],[rpc xdr nsl])
+ RPC_LIBS="$LIBS"
+ LIBS="$old_LIBS"
+
+ AC_SUBST([RPC_CFLAGS])
+ AC_SUBST([RPC_LIBS])
+])
+
AC_OUTPUT([Makefile src/Makefile])
diff --git a/src/Makefile.am b/src/Makefile.am
index 4ecfd97..7f63be5 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -6,6 +6,8 @@ watchdog_SOURCES = file_stat.c file_table.c fstab.c iface.c ifdown.c keep_alive.
temp.c test_binary.c umount.c version.c watchdog.c \
logmessage.c xmalloc.c heartbeat.c lock_mem.c daemon-pid.c configfile.c \
errorcodes.c read-conf.c sigterm.c
+watchdog_CFLAGS = $(RPC_CFLAGS)
+watchdog_LDADD = $(RPC_LIBS)
wd_keepalive_SOURCES = wd_keepalive.c logmessage.c lock_mem.c daemon-pid.c xmalloc.c \
configfile.c keep_alive.c read-conf.c sigterm.c
--
2.20.1