[PATCH] build-aux: use GNU sed for syntax-check on FreeBSD

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



BSD sed(1) and GNU sed(1) syntax are not compatible, and as
syntax-check.mk uses the GNU flavor, set SED variable to
'gsed' by default.

Signed-off-by: Roman Bogorodskiy <bogorodskiy@xxxxxxxxx>
---
 build-aux/syntax-check.mk | 8 ++++++++
 1 file changed, 8 insertions(+)

I'm not sure if this requires a more comprehensive solution.
I have mixed feeling about this. If we try to just use gsed like in this
patch, it'll fail because we don't require gsed to be installed.

OTOH, an alternative solution like checking for gsed in meson.build,
and probably even generation of some files with variables to be sourced
by .mk files feels like too much of a hassle, esp. in this context.

diff --git a/build-aux/syntax-check.mk b/build-aux/syntax-check.mk
index 6eb59cf90e..bbfcb63152 100644
--- a/build-aux/syntax-check.mk
+++ b/build-aux/syntax-check.mk
@@ -28,7 +28,15 @@ ME := build-aux/syntax-check.mk
 # ignoring the module description.
 AWK ?= awk
 GREP ?= grep
+# FreeBSD (and probably some other OSes too) ships own version of sed(1), not
+# compatible with the GNU sed. GNU sed is available as gsed(1), so use this
+# instead
+UNAME := $(shell uname)
+ifeq ($(UNAME),FreeBSD)
+SED ?= gsed
+else
 SED ?= sed
+endif
 
 # Helper variables.
 _empty =
-- 
2.27.0




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux