Skip to content

Commit

Permalink
BUILD: do not test grep -o on non-Linux #396
Browse files Browse the repository at this point in the history
configure tests for working `grep` utility for building, however it
seems some systems (it seems NetBSD in particular) have problems with
the `-o` switch combined with others. As the `-o` is only used for real
at Linux hosts, let's not test `-o` if the build system is not Linux.

Reported by @Rhialto
  • Loading branch information
lgblgblgb committed May 11, 2024
1 parent d96aaeb commit 089ad07
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 10 deletions.
1 change: 1 addition & 0 deletions build/configure/Makefile
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
all:
@if [ "$(ARCH)" = "" ]; then echo "You must invoke make with ARCH set." ; exit 1 ; fi
bash ./configure --arch=$(ARCH)
29 changes: 19 additions & 10 deletions build/configure/configure
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
## This file is part of the Xemu project: https://github.com/lgblgblgb/xemu
## Collection of various emulators of some 8 bits machines using SDL2 library.
##
## Copyright (C)2016-2023 LGB (Gábor Lénárt) <[email protected]>
## Copyright (C)2016-2024 LGB (Gábor Lénárt) <[email protected]>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -30,12 +30,27 @@ export LANG LC_TIME

echo -n "Testing needed UNIX tools for the build: "

echo -n "grep "
if [ "`echo 'alma,korte,banan' | grep -oEia ',K[^,]+,'`" != ",korte," ]; then
echo -n "uname "
if [ "`uname -a`" = "" ]; then
echo
echo "FATAL: UNIX utility 'grep' does not seem to work or cannot be found" >&2
echo "FATAL: UNIX utility 'uname' does not seem to work or cannot be found" >&2
exit 1
fi
if [ "`uname`" != "Linux" ]; then
echo -n "grep[-Eia] "
if [ "`echo 'alma,korte,banan' | grep -Eia ',K[^,]+,'`" != "alma,korte,banan" ]; then
echo
echo "FATAL: UNIX utility 'grep' does not seem to work (grep -Eia) or cannot be found" >&2
exit 1
fi
else
echo -n "grep[-oEia] "
if [ "`echo 'alma,korte,banan' | grep -oEia ',K[^,]+,'`" != ",korte," ]; then
echo
echo "FATAL: UNIX utility 'grep' does not seem to work (grep -oEia) or cannot be found" >&2
exit 1
fi
fi
echo -n "sed "
if [ "`echo "testSTRSTRing" | sed -nE 's/(STR)/_\1/gp'`" != "test_STR_STRing" ]; then
echo
Expand Down Expand Up @@ -71,12 +86,6 @@ if [ "`pwd`" = "" ]; then
echo "FATAL: UNIX utility 'pwd' does not seem to work or cannot be found" >&2
exit 1
fi
echo -n "uname "
if [ "`uname -a`" = "" ]; then
echo
echo "FATAL: UNIX utility 'uname' does not seem to work or cannot be found" >&2
exit 1
fi
echo -n "date "
if [ "`date`" = "" ]; then
echo
Expand Down

0 comments on commit 089ad07

Please sign in to comment.