From c51d1cfe9a58a0427af2a9a0f78e4806934600f3 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 16 Aug 2022 13:44:19 +0100 Subject: [PATCH] m4: Check for GNU realpath program It is a dependency of the ocaml-dep.sh script, required for all builds. --- docs/guestfs-building.pod | 4 ++++ m4/guestfs-progs.m4 | 5 +++++ ocaml-dep.sh.in | 8 ++++---- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/docs/guestfs-building.pod b/docs/guestfs-building.pod index f64352dc4..7874033f2 100644 --- a/docs/guestfs-building.pod +++ b/docs/guestfs-building.pod @@ -142,6 +142,10 @@ I. I. +=item realpath + +I. + =item flex =item bison diff --git a/m4/guestfs-progs.m4 b/m4/guestfs-progs.m4 index 22fc61367..10ed96a7e 100644 --- a/m4/guestfs-progs.m4 +++ b/m4/guestfs-progs.m4 @@ -49,6 +49,11 @@ AC_CHECK_PROG([GPERF],[gperf],[gperf],[no]) test "x$GPERF" = "xno" && AC_MSG_ERROR([gperf must be installed]) +dnl Check for realpath (used by ocaml-dep.sh for basic builds). +AC_CHECK_PROGS([REALPATH],[grealpath realpath],[no]) +test "x$REALPATH" = "xno" && + AC_MSG_ERROR([GNU realpath program must be installed]) + dnl Check for xorriso/genisoimage/mkisofs. AC_PATH_PROGS([MKISOFS],[xorrisofs genisoimage mkisofs],[no], [$PATH$PATH_SEPARATOR/usr/sbin$PATH_SEPARATOR/sbin]) diff --git a/ocaml-dep.sh.in b/ocaml-dep.sh.in index 21bf3812a..866f48db8 100755 --- a/ocaml-dep.sh.in +++ b/ocaml-dep.sh.in @@ -44,10 +44,10 @@ ocaml # Output file is always created in the current directory. output=.depend -subdir=$(realpath --relative-to=@abs_top_builddir@ .) -srcdir=$(realpath --relative-to=. @abs_top_srcdir@/${subdir}) -srcdir_re=$(realpath --relative-to=. @abs_top_srcdir@/${subdir} | sed 's/\./[.]/g') -top_builddir=$(realpath --relative-to=. @abs_top_builddir@) +subdir=$(@REALPATH@ --relative-to=@abs_top_builddir@ .) +srcdir=$(@REALPATH@ --relative-to=. @abs_top_srcdir@/${subdir}) +srcdir_re=$(@REALPATH@ --relative-to=. @abs_top_srcdir@/${subdir} | sed 's/\./[.]/g') +top_builddir=$(@REALPATH@ --relative-to=. @abs_top_builddir@) includes="-I @abs_top_srcdir@/$subdir -I @abs_top_builddir@/$subdir" for i in $include_dirs; do