Avoid use of deprecated egrep/fgrep

GNU grep 3.8 emits a deprecation warning on use of egrep/fgrep.

Signed-off-by: Sam James <sam@gentoo.org>
(cherry picked from commit 3e7952ce8a)
This commit is contained in:
Sam James 2022-11-24 05:21:21 +00:00 committed by Sam Lantinga
parent 33e5de31d8
commit 4c7156c1e6
6 changed files with 15 additions and 14 deletions

View file

@ -130,7 +130,7 @@ HDRS = \
begin_code.h \ begin_code.h \
close_code.h close_code.h
SDLTEST_HDRS = $(shell ls $(srcdir)/include | fgrep SDL_test) SDLTEST_HDRS = $(shell ls $(srcdir)/include | $(FGREP) SDL_test)
LT_AGE = @LT_AGE@ LT_AGE = @LT_AGE@
LT_CURRENT = @LT_CURRENT@ LT_CURRENT = @LT_CURRENT@

View file

@ -126,8 +126,8 @@ if $cygwin ; then
# Now convert the arguments - kludge to limit ourselves to /bin/sh # Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0 i=0
for arg in "$@" ; do for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` CHECK=`echo "$arg"|grep -E -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option CHECK2=`echo "$arg"|grep -E -c "^-"` ### Determine if an option
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`

View file

@ -62,6 +62,7 @@ AC_PROG_AWK
AC_PROG_CC AC_PROG_CC
AC_PROG_CXX AC_PROG_CXX
AC_PROG_EGREP AC_PROG_EGREP
AC_PROG_FGREP
AC_PROG_INSTALL AC_PROG_INSTALL
AC_PROG_MAKE_SET AC_PROG_MAKE_SET
PKG_PROG_PKG_CONFIG PKG_PROG_PKG_CONFIG
@ -180,8 +181,8 @@ base_libdir=`echo \${libdir} | sed 's/.*\/\(.*\)/\1/; q'`
dnl Function to find a library in the compiler search path dnl Function to find a library in the compiler search path
find_lib() find_lib()
{ {
gcc_bin_path=[`$CC -print-search-dirs 2>/dev/null | fgrep programs: | sed 's/[^=]*=\(.*\)/\1/' | sed 's/:/ /g'`] gcc_bin_path=[`$CC -print-search-dirs 2>/dev/null | $(FGREP) programs: | sed 's/[^=]*=\(.*\)/\1/' | sed 's/:/ /g'`]
gcc_lib_path=[`$CC -print-search-dirs 2>/dev/null | fgrep libraries: | sed 's/[^=]*=\(.*\)/\1/' | sed 's/:/ /g'`] gcc_lib_path=[`$CC -print-search-dirs 2>/dev/null | $(FGREP) libraries: | sed 's/[^=]*=\(.*\)/\1/' | sed 's/:/ /g'`]
env_lib_path=[`echo $LIBS $LDFLAGS $* | sed 's/-L[ ]*//g'`] env_lib_path=[`echo $LIBS $LDFLAGS $* | sed 's/-L[ ]*//g'`]
if test "$cross_compiling" = yes; then if test "$cross_compiling" = yes; then
host_lib_path="" host_lib_path=""

View file

@ -316,11 +316,11 @@ function process_line
{ {
sym=$(echo "$1" | awk '{print $3}') sym=$(echo "$1" | awk '{print $3}')
code=$(echo "$1" | sed 's,.*_EVDEVK(\(0x[0-9A-Fa-f]*\)).*,\1,') code=$(echo "$1" | sed 's,.*_EVDEVK(\(0x[0-9A-Fa-f]*\)).*,\1,')
value=$(egrep "#define ${sym}\s" -R /usr/include/X11 | awk '{print $3}') value=$(grep -E "#define ${sym}\s" -R /usr/include/X11 | awk '{print $3}')
printf " { 0x%.8X, 0x%.3x }, /* $sym */\n" $value $code printf " { 0x%.8X, 0x%.3x }, /* $sym */\n" $value $code
} }
fgrep "/* Use: " /usr/include/xkbcommon/xkbcommon-keysyms.h | fgrep _EVDEVK | while read line; do grep -F "/* Use: " /usr/include/xkbcommon/xkbcommon-keysyms.h | grep -F _EVDEVK | while read line; do
process_line "$line" process_line "$line"
done done
#endif #endif

View file

@ -804,7 +804,7 @@ static SDL_Scancode const linux_scancode_table[] = {
function get_keyname function get_keyname
{ {
value=$(echo "$1" | awk '{print $3}') value=$(echo "$1" | awk '{print $3}')
fgrep KEY_ /usr/include/linux/input-event-codes.h | while read line; do grep -F KEY_ /usr/include/linux/input-event-codes.h | while read line; do
read -ra fields <<<"$line" read -ra fields <<<"$line"
if [ "${fields[2]}" = "$value" ]; then if [ "${fields[2]}" = "$value" ]; then
echo "${fields[1]}" echo "${fields[1]}"
@ -813,7 +813,7 @@ function get_keyname
done done
} }
fgrep SDL_SCANCODE scancodes_linux.h | while read line; do grep -F SDL_SCANCODE scancodes_linux.h | while read line; do
if [ $(echo "$line" | awk '{print NF}') -eq 5 ]; then if [ $(echo "$line" | awk '{print NF}') -eq 5 ]; then
name=$(get_keyname "$line") name=$(get_keyname "$line")
if [ "$name" != "" ]; then if [ "$name" != "" ]; then
@ -832,11 +832,11 @@ function get_comment
{ {
name=$(echo "$1" | awk '{print $7}') name=$(echo "$1" | awk '{print $7}')
if [ "$name" != "" ]; then if [ "$name" != "" ]; then
egrep "$name\s" /usr/include/linux/input-event-codes.h | fgrep "/*" | sed 's,[^/]*/,/,' grep -E "$name\s" /usr/include/linux/input-event-codes.h | grep -F "/*" | sed 's,[^/]*/,/,'
fi fi
} }
fgrep SDL_SCANCODE scancodes_linux.h | while read line; do grep -F SDL_SCANCODE scancodes_linux.h | while read line; do
comment=$(get_comment "$line") comment=$(get_comment "$line")
if [ "$comment" != "" ]; then if [ "$comment" != "" ]; then
echo " $line $comment" echo " $line $comment"

View file

@ -10,6 +10,6 @@ cat <<__EOF__
__EOF__ __EOF__
echo "Actual output:" echo "Actual output:"
fgrep 8BitDo SDL_gamecontrollerdb.h | fgrep -v hint ${FGREP:-grep -F} 8BitDo SDL_gamecontrollerdb.h | ${FGREP:-grep -F} -v hint
egrep "hint:SDL_GAMECONTROLLER_USE_BUTTON_LABELS:=1" SDL_gamecontrollerdb.h | fgrep -i 8bit | fgrep -v x:b2,y:b3 | fgrep -v x:b3,y:b4 ${EGREP:-grep -E} "hint:SDL_GAMECONTROLLER_USE_BUTTON_LABELS:=1" SDL_gamecontrollerdb.h | ${FGREP:-grep -F} -i 8bit | ${FGREP:-grep -F} -v x:b2,y:b3 | ${FGREP:-grep -F} -v x:b3,y:b4
egrep "hint:.SDL_GAMECONTROLLER_USE_BUTTON_LABELS:=1" SDL_gamecontrollerdb.h | fgrep -i 8bit | fgrep -v x:b3,y:b2 | fgrep -v x:b4,y:b3 ${EGREP:-grep -E} "hint:.SDL_GAMECONTROLLER_USE_BUTTON_LABELS:=1" SDL_gamecontrollerdb.h | ${FGREP:-grep -F} -i 8bit | ${FGREP:-grep -F} -v x:b3,y:b2 | ${FGREP:-grep -F} -v x:b4,y:b3