From 2e0583f5e325a9100a08709e09352fca75748929 Mon Sep 17 00:00:00 2001
From: Martin Stjernholm <mast@lysator.liu.se>
Date: Sat, 1 May 2004 15:22:01 +0200
Subject: [PATCH] Another addition to the autoconf compatibility mess.

Rev: src/run_autoconfig:1.42
---
 src/run_autoconfig | 28 +++++++++++++++++++++++++---
 1 file changed, 25 insertions(+), 3 deletions(-)

diff --git a/src/run_autoconfig b/src/run_autoconfig
index 4229299d3c..e310242c3e 100755
--- a/src/run_autoconfig
+++ b/src/run_autoconfig
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $Id: run_autoconfig,v 1.41 2004/04/04 13:33:22 mast Exp $
+# $Id: run_autoconfig,v 1.42 2004/05/01 13:22:01 mast Exp $
 #
 # Bootstrap script
 
@@ -37,8 +37,30 @@ else
   fi
 fi
 
-autoconf=autoconf
-autoheader=autoheader
+findprog() {
+  (
+    IFS=:
+    for path in $PATH; do
+      if [ -x "$path/$1" ]; then
+	return 0
+      fi
+    done
+    return 1
+  )
+}
+
+# There are script wrappers for autoconf (e.g. in Debian) that tries
+# to autodetect which autoconf version configure.in etc is written
+# for. There are also configure.in scripts (e.g. in Pike) that tries
+# to detect which autoconf they're running in. These tend to fool each
+# other, so try to avoid the script wrappers.
+if findprog autoconf2.50 && findprog autoheader2.50; then
+  autoconf=autoconf2.50
+  autoheader=autoheader2.50
+else
+  autoconf=autoconf
+  autoheader=autoheader
+fi
 
 ac_args="--localdir=$localdir"
 ah_args=""
-- 
GitLab