[PATCH v2] Makefile.am: use dirname as a fallback for realpath

Eugene Syromyatnikov evgsyr at gmail.com
Mon Sep 5 17:35:20 UTC 2016


Since realpath utility is fairly new in GNU coreutils, there could be
possibility that it is not present in the system. Instead of checking
its presence in configure script it probably makes sense to fall back to
dirname call since it is more widespread.

Initial implementation utilized readlink instead of dirname; changed as
per Dmitry Levin's suggestion.
---
Changes from v1:
 * dirname has been utilized instead of readlink.

 Makefile.am |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/Makefile.am b/Makefile.am
index 65f5c64..91733bf 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -256,7 +256,8 @@ endif
 @CODE_COVERAGE_RULES@
 CODE_COVERAGE_BRANCH_COVERAGE = 1
 CODE_COVERAGE_GENHTML_OPTIONS = $(CODE_COVERAGE_GENHTML_OPTIONS_DEFAULT) \
-	--prefix $(shell realpath -Ls $(abs_top_srcdir)/..)
+	--prefix $(shell realpath -Ls $(abs_top_srcdir)/.. || \
+		dirname $(abs_top_srcdir))
 CODE_COVERAGE_IGNORE_PATTERN = '/usr/include/*'
 strace_CPPFLAGS += $(CODE_COVERAGE_CPPFLAGS)
 strace_CFLAGS += $(CODE_COVERAGE_CFLAGS)
-- 
1.7.10.4





More information about the Strace-devel mailing list