:: commit b45dc16c36ea873509b08d32aa1884be3bbb4813

mintsuki <mintsuki@protonmail.com> — 2022-02-03 10:35

parents: f6c81e4e82

build: Minor portability fixes

diff --git a/GNUmakefile.in b/GNUmakefile.in
index 0a02ca9a..334f7c66 100644
--- a/GNUmakefile.in
+++ b/GNUmakefile.in
@@ -16,12 +16,6 @@ NASMESCAPE = $(subst ','"'$(COMMA) \"'\"$(COMMA) '"',$(1))
 override PATH := $(BUILDDIR)/toolchain/bin:/usr/local/bin:$(PATH)
 export PATH
 
-override LIMINE_VERSION := @limine_version@
-export LIMINE_VERSION
-
-override LIMINE_COPYRIGHT := $(shell grep Copyright '$(call SHESCAPE,$(SRCDIR))/LICENSE.md')
-export LIMINE_COPYRIGHT
-
 WERROR ?= @werror@
 export WERROR
 
@@ -73,6 +67,12 @@ export LIMINE_READELF
 override USING_CLANG := @using_clang@
 export USING_CLANG
 
+override LIMINE_VERSION := @limine_version@
+export LIMINE_VERSION
+
+override LIMINE_COPYRIGHT := $(shell $(GREP) Copyright '$(call SHESCAPE,$(SRCDIR))/LICENSE.md')
+export LIMINE_COPYRIGHT
+
 override STAGE1_FILES := $(shell find '$(call SHESCAPE,$(SRCDIR))/stage1' -type f -name '*.asm')
 
 .PHONY: all
diff --git a/configure.ac b/configure.ac
index 583345bd..1d1315d6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -79,9 +79,9 @@ if ! $LIMINE_CC --version >/dev/null 2>&1; then
     CC_ERROR_MSG
 fi
 
-if $LIMINE_CC --version | grep clang >/dev/null 2>&1; then
+if $LIMINE_CC --version | $GREP clang >/dev/null 2>&1; then
     AC_SUBST(using_clang, 1)
-elif $LIMINE_CC --version | grep 'Free Software Foundation' >/dev/null 2>&1; then
+elif $LIMINE_CC --version | $GREP 'Free Software Foundation' >/dev/null 2>&1; then
     AC_SUBST(using_clang, 0)
 else
     CC_ERROR_MSG
@@ -103,19 +103,19 @@ AC_DEFUN([GET_BINUTILS_PROG], [
 
     if ! test "x$LIMINE_$1" = "x"; then
         AC_CHECK_PROG([LIMINE_$1_0], [$LIMINE_$1], [yes])
-        if ! test "x$LIMINE_$1_0" = "xyes" || ! $LIMINE_$1 --version | grep 'Free Software Foundation' >/dev/null 2>&1; then
+        if ! test "x$LIMINE_$1_0" = "xyes" || ! $LIMINE_$1 --version | $GREP 'Free Software Foundation' >/dev/null 2>&1; then
             AC_MSG_ERROR([LIMINE_$1 ($LIMINE_$1) is not a suitable $3])
         fi
     else
         LIMINE_$1="$TOOLCHAIN-$2"
         AC_CHECK_PROG([LIMINE_$1_1], [$LIMINE_$1], [yes])
-        if ! test "x$LIMINE_$1_1" = "xyes" || ! $LIMINE_$1 --version | grep 'Free Software Foundation' >/dev/null 2>&1; then
+        if ! test "x$LIMINE_$1_1" = "xyes" || ! $LIMINE_$1 --version | $GREP 'Free Software Foundation' >/dev/null 2>&1; then
             LIMINE_$1='g$2'
             AC_CHECK_PROG([LIMINE_$1_2], [$LIMINE_$1], [yes])
-            if ! test "x$LIMINE_$1_2" = "xyes" || ! $LIMINE_$1 --version | grep 'Free Software Foundation' >/dev/null 2>&1; then
+            if ! test "x$LIMINE_$1_2" = "xyes" || ! $LIMINE_$1 --version | $GREP 'Free Software Foundation' >/dev/null 2>&1; then
                 LIMINE_$1='$2'
                 AC_CHECK_PROG([LIMINE_$1_3], [$LIMINE_$1], [yes])
-                if ! test "x$LIMINE_$1_3" = "xyes" || ! $LIMINE_$1 --version | grep 'Free Software Foundation' >/dev/null 2>&1; then
+                if ! test "x$LIMINE_$1_3" = "xyes" || ! $LIMINE_$1 --version | $GREP 'Free Software Foundation' >/dev/null 2>&1; then
                     AC_MSG_ERROR([no suitable LIMINE_$1 found, run $srcdir/make_toolchain.sh or install GNU binutils])
                 fi
             fi
tab: 248 wrap: offon