libtiff: ci: Restore testing with Ubuntu 20.04

From be617a9b9001a1bbf6ab1748cd71139c5a2462a7 Mon Sep 17 00:00:00 2001
From: Roger Leigh <[EMAIL REDACTED]>
Date: Sun, 19 Jun 2022 10:02:56 +0100
Subject: [PATCH] ci: Restore testing with Ubuntu 20.04

---
 .gitlab-ci.yml  | 21 ++++++++++++++++++---
 build/gitlab-ci | 18 ++++++++++++++++++
 2 files changed, 36 insertions(+), 3 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index caacb2a9..cf10b2e4 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -5,7 +5,8 @@ stages:
   - static-analysis
   - pages
 
-autoconf:
+
+autoconf-current:
   stage: build
   script:
     - sh build/gitlab-ci autoconf
@@ -16,16 +17,30 @@ autoconf:
     paths:
     - distribution
 
-cmake-makefiles:
+autoconf-old:
+  stage: build
+  image: registry.gitlab.com/libtiff/libtiff-ci-ubuntu20.04:latest
+  script:
+    - sh build/gitlab-ci autoconf-minimal
+  after_script:
+    - 'cat autoconf-build/test/test-suite.log'
+
+cmake-makefiles-current:
   stage: build
   script:
     - sh build/gitlab-ci cmake "Unix Makefiles" Release
 
-cmake-ninja:
+cmake-ninja-current:
   stage: build
   script:
     - sh build/gitlab-ci cmake "Ninja" Debug
 
+cmake-makefiles-old:
+  stage: build
+  image: registry.gitlab.com/libtiff/libtiff-ci-ubuntu20.04:latest
+  script:
+    - sh build/gitlab-ci cmake "Unix Makefiles" Release
+
 coverity:
   stage: static-analysis
   image: registry.gitlab.com/libtiff/libtiff-ci-ubuntu22.04-coverity:latest
diff --git a/build/gitlab-ci b/build/gitlab-ci
index eccdeb59..7058eeed 100644
--- a/build/gitlab-ci
+++ b/build/gitlab-ci
@@ -22,6 +22,20 @@ autoconf_build()
     cp tiff-*.tar.* tiff*.zip ../distribution
 }
 
+# Test autoconf build (minimal; no distcheck)
+autoconf_build_minimal()
+{
+    autoreconf -ivf
+
+    mkdir autoconf-build
+    cd autoconf-build
+    echo "Running ../configure --prefix=$(pwd)/../autoconf-install) ${opts}"
+    ../configure --prefix=$(pwd)/../autoconf-install ${opts}
+    make
+    make install
+    make check
+}
+
 # Test cmake build
 cmake_build()
 {
@@ -66,6 +80,10 @@ case $build in
         echo "Testing Autoconf build"
         autoconf_build "$@"
         ;;
+    autoconf-minimal)
+        echo "Testing Autoconf build (minimal)"
+        autoconf_build_minimal "$@"
+        ;;
     cmake)
         echo "Testing CMake build"
         cmake_build "$@"