From 7623e601612eb36cf86511b40fef3f5a20e8b834 Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Mon, 26 Apr 2021 00:04:05 +0200 Subject: [PATCH] build: Bail out early if m4 or lex don't exist. This gives a decent error message on the attempt to run make(1) on a system where one or both of these essential programs are not installed. A previous version of the patch used .SHELLSTATUS instead of the dummy variable, but this did not work with make-4.1 which ships with Ubuntu-18.04. Suggested-by: Alex Gietz --- Makefile | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Makefile b/Makefile index 200a7c0..c0057a3 100644 --- a/Makefile +++ b/Makefile @@ -21,6 +21,15 @@ INSTALL := install GZIP := gzip -fn9 ZCAT := zcat +dummy != $(M4) /dev/null || printf 'failed' +ifeq ($(dummy), failed) +$(error m4 is required to build this package) +endif +dummy != printf '%%%%\n' | $(LEX) -o /dev/null || printf 'failed' +ifeq ($(dummy), failed) +$(error (f)lex is required to build this package) +endif + DATE_FMT := +%B %Y # To get a reproducible build, we use $(SOURCE_DATE_EPOCH) instead of the # current time if this variable is set. -- 2.39.2