SDL-1.2: minor build system update

From 3463cb84df68b505c787d9804aa93a1516fa5ada Mon Sep 17 00:00:00 2001
From: Ozkan Sezer <[EMAIL REDACTED]>
Date: Wed, 24 Nov 2021 14:10:24 +0300
Subject: [PATCH] minor build system update

---
 autogen.sh        | 22 +++++++++++++---------
 test/Makefile.in  |  2 +-
 test/Makefile.os2 |  2 --
 test/autogen.sh   | 17 ++++++++---------
 test/configure    |  4 ++--
 test/configure.ac |  2 +-
 6 files changed, 25 insertions(+), 24 deletions(-)

diff --git a/autogen.sh b/autogen.sh
index 649d7b31e..daf160de5 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -1,19 +1,23 @@
 #!/bin/sh
-#
+
 echo "Generating build information using autoconf"
 echo "This may take a while ..."
 
+srcdir=`dirname $0`
+test -z "$srcdir" && srcdir=.
+cd "$srcdir"
+
 # Regenerate configuration files
 cat acinclude/* >aclocal.m4
-found=false
-for autoconf in autoconf autoconf259 autoconf-2.59
-do if which $autoconf >/dev/null 2>&1; then $autoconf && found=true; break; fi
-done
-if test x$found = xfalse; then
-    echo "Couldn't find autoconf, aborting"
-    exit 1
+
+if test "$AUTOCONF"x = x; then
+  AUTOCONF=autoconf
 fi
+
+$AUTOCONF || exit 1
+rm aclocal.m4
+rm -rf autom4te.cache
+
 (cd test; sh autogen.sh)
 
-# Run configure for this platform
 echo "Now you are ready to run ./configure"
diff --git a/test/Makefile.in b/test/Makefile.in
index 7d5bb8b73..c4414b142 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -2,7 +2,7 @@
 
 srcdir  = @srcdir@
 
-CC      = @CC@
+CC	= @CC@
 EXE	= @EXE@
 CFLAGS  = @CFLAGS@
 LIBS	= @LIBS@
diff --git a/test/Makefile.os2 b/test/Makefile.os2
index 0f6709d69..cca894075 100644
--- a/test/Makefile.os2
+++ b/test/Makefile.os2
@@ -11,7 +11,6 @@ OBJS = $(TARGETS:.exe=.obj)
 
 all: $(TARGETS)
 
-BINPATH = .
 INCPATH = -I$(%WATCOM)/h/os2 -I$(%WATCOM)/h -I../include
 CFLAGS_DEF = $(INCPATH) -bt=os2 -d0 -q -bm -5s -fp5 -fpi87 -sg -oteanbmier
 CFLAGS_EXE = $(CFLAGS_DEF)
@@ -27,7 +26,6 @@ LIBS = SDL12.lib
   wcc386 $(CFLAGS) -fo=$^@ $<
 
 clean: .SYMBOLIC
-  @echo * Clean tests in $(BINPATH)
   @if exist *.obj rm *.obj
   @if exist *.err rm *.err
 
diff --git a/test/autogen.sh b/test/autogen.sh
index 939f34c0f..988d41760 100755
--- a/test/autogen.sh
+++ b/test/autogen.sh
@@ -1,12 +1,11 @@
 #!/bin/sh
-#
-# Regenerate configuration files
+
 cp acinclude.m4 aclocal.m4
-found=false
-for autoconf in autoconf autoconf259 autoconf-2.59
-do if which $autoconf >/dev/null 2>&1; then $autoconf && found=true; break; fi
-done
-if test x$found = xfalse; then
-    echo "Couldn't find autoconf, aborting"
-    exit 1
+
+if test "$AUTOCONF"x = x; then
+  AUTOCONF=autoconf
 fi
+
+$AUTOCONF || exit 1
+rm aclocal.m4
+rm -rf autom4te.cache
diff --git a/test/configure b/test/configure
index 205b180f6..46393b21c 100755
--- a/test/configure
+++ b/test/configure
@@ -1911,7 +1911,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
 ac_aux_dir=
-for ac_dir in $srcdir/../build-scripts; do
+for ac_dir in ../build-scripts "$srcdir"/../build-scripts; do
   if test -f "$ac_dir/install-sh"; then
     ac_aux_dir=$ac_dir
     ac_install_sh="$ac_aux_dir/install-sh -c"
@@ -1927,7 +1927,7 @@ for ac_dir in $srcdir/../build-scripts; do
   fi
 done
 if test -z "$ac_aux_dir"; then
-  as_fn_error $? "cannot find install-sh, install.sh, or shtool in $srcdir/../build-scripts" "$LINENO" 5
+  as_fn_error $? "cannot find install-sh, install.sh, or shtool in ../build-scripts \"$srcdir\"/../build-scripts" "$LINENO" 5
 fi
 
 # These three variables are undocumented and unsupported,
diff --git a/test/configure.ac b/test/configure.ac
index d1c8d8c93..a46e55464 100644
--- a/test/configure.ac
+++ b/test/configure.ac
@@ -3,7 +3,7 @@ AC_INIT
 AC_CONFIG_SRCDIR([loopwave.c])
 
 dnl Detect the canonical build and host environments
-AC_CONFIG_AUX_DIRS($srcdir/../build-scripts)
+AC_CONFIG_AUX_DIR([../build-scripts])
 AC_CANONICAL_HOST
 
 dnl Check for tools