]> arthur.barton.de Git - ngircd.git/commitdiff
autogen.sh: Prefere automake 1.11 over other releases
authorAlexander Barton <alex@barton.de>
Tue, 16 Jan 2024 16:33:54 +0000 (17:33 +0100)
committerAlexander Barton <alex@barton.de>
Tue, 16 Jan 2024 21:32:33 +0000 (22:32 +0100)
GNU automake 1.11 is the last release supporting "de-ANSI-fication"
using the included ansi2knr tool. And becuase we _want_ to support old
K&R platforms, we try hard to use this release of automake when
available to generate our build system.

ChangeLog
autogen.sh

index 3d4ddcf2baaacd231858564c71b6cc246516692e..9256ff41d7302c876a47aec0546d84750dea549f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
 
 ngIRCd 27
 
+  - autogen.sh: Prefere automake 1.11 over other releases because this is the
+    last release supporting "de-ANSI-fication" using the included ansi2knr tool.
+    And becuase we _want_ to support old K&R platforms, we try hard to use this
+    release of automake when available to generate our build system.
+    Note: This is only relevant for you if you are building from Git sources.
   - Autodetect support for IPv6 by default: Until now, IPv6 support was disabled
     by default, which seems a bit outdated in 2024. Note: You still can pass
     "--enable-ipv6"/"--disable-ipv6" to the ./configure script to forcefully
index bb5482278ea9d0c52f9582fbda19810e76d997cd..0cf9a0e391b5ac8425c2ba54e03a690b5ea6ca80 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/sh
 #
 # ngIRCd -- The Next Generation IRC Daemon
-# Copyright (c)2001-2015 Alexander Barton (alex@barton.de) and Contributors
+# Copyright (c)2001-2024 Alexander Barton (alex@barton.de) and Contributors
 #
 # 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
 #   and runs it with these arguments: "./configure --prefix=$HOME".
 #
 
+Check_Tool()
+{
+       searchlist="$1"
+       major="$2"
+       minor="$3"
+
+       for name in $searchlist; do
+               $EXIST "${name}${major}${minor}" >/dev/null 2>&1
+               if [ $? -eq 0 ]; then
+                       echo "${name}${major}${minor}"
+                       return 0
+               fi
+               $EXIST "${name}-${major}.${minor}" >/dev/null 2>&1
+               if [ $? -eq 0 ]; then
+                       echo "${name}-${major}.${minor}"
+                       return 0
+               fi
+       done
+       return 1
+}
+
 Search()
 {
-       [ $# -eq 2 ] || exit 1
+       [ $# -lt 2 ] && return 1
+       [ $# -gt 3 ] && return 1
 
        searchlist="$1"
        major="$2"
+       minor_pref="$3"
        minor=99
 
        [ -n "$PREFIX" ] && searchlist="${PREFIX}/$1 ${PREFIX}/bin/$1 $searchlist"
 
+       if [ -n "$minor_pref" ]; then
+               Check_Tool "$searchlist" "$major" "$minor_pref" && return 0
+       fi
+
        for name in $searchlist; do
                $EXIST "${name}" >/dev/null 2>&1
                if [ $? -eq 0 ]; then
@@ -83,18 +110,7 @@ Search()
        done
 
        while [ $minor -ge 0 ]; do
-               for name in $searchlist; do
-                       $EXIST "${name}${major}${minor}" >/dev/null 2>&1
-                       if [ $? -eq 0 ]; then
-                               echo "${name}${major}${minor}"
-                               return 0
-                       fi
-                       $EXIST "${name}-${major}.${minor}" >/dev/null 2>&1
-                       if [ $? -eq 0 ]; then
-                               echo "${name}-${major}.${minor}"
-                               return 0
-                       fi
-               done
+               Check_Tool "$searchlist" "$major" "$minor" && return 0
                minor=$(expr $minor - 1)
        done
        return 1
@@ -140,11 +156,11 @@ fi
 # Try to detect the needed tools when no environment variable already
 # specifies one:
 echo "Searching for required tools ..."
-[ -z "$ACLOCAL" ] && ACLOCAL=$(Search aclocal 1)
+[ -z "$ACLOCAL" ] && ACLOCAL=$(Search aclocal 1 11)
 [ "$VERBOSE" = "1" ] && echo " - ACLOCAL=$ACLOCAL"
 [ -z "$AUTOHEADER" ] && AUTOHEADER=$(Search autoheader 2)
 [ "$VERBOSE" = "1" ] && echo " - AUTOHEADER=$AUTOHEADER"
-[ -z "$AUTOMAKE" ] && AUTOMAKE=$(Search automake 1)
+[ -z "$AUTOMAKE" ] && AUTOMAKE=$(Search automake 1 11)
 [ "$VERBOSE" = "1" ] && echo " - AUTOMAKE=$AUTOMAKE"
 [ -z "$AUTOCONF" ] && AUTOCONF=$(Search autoconf 2)
 [ "$VERBOSE" = "1" ] && echo " - AUTOCONF=$AUTOCONF"