aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Schlemmer <azarah@gentoo.org>2005-09-09 23:15:25 +0000
committerMartin Schlemmer <azarah@gentoo.org>2005-09-09 23:15:25 +0000
commit159c081093fb8d1acd9cf5c59d22151c308a1b69 (patch)
tree94b6797f9dddad56d8101f1102c00fa2920b48bb
parentUpdate explanation of when 2.1 is run. (diff)
downloadautotools-wrappers-159c081093fb8d1acd9cf5c59d22151c308a1b69.tar.gz
autotools-wrappers-159c081093fb8d1acd9cf5c59d22151c308a1b69.tar.bz2
autotools-wrappers-159c081093fb8d1acd9cf5c59d22151c308a1b69.zip
Remove awk compat crap as gawk now works on Darwin.ac-3.2
Package-Manager: portage-2.0.52-r1
-rwxr-xr-xac-wrapper.sh64
1 files changed, 11 insertions, 53 deletions
diff --git a/ac-wrapper.sh b/ac-wrapper.sh
index d01e31a..9701f84 100755
--- a/ac-wrapper.sh
+++ b/ac-wrapper.sh
@@ -1,7 +1,7 @@
#!/bin/bash
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-devel/autoconf-wrapper/files/ac-wrapper-3.1.sh,v 1.3 2005/07/16 20:42:12 azarah Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-devel/autoconf-wrapper/files/ac-wrapper-3.2.sh,v 1.1 2005/09/09 23:15:25 azarah Exp $
# Based on the ac-wrapper.pl script provided by MandrakeSoft
# Rewritten in bash by Gregorio Guidi
@@ -33,67 +33,25 @@ binary_old="${0}-2.13"
binary=${binary_new}
acprereq_version() {
- # Add --posix to below awk to make sure it will run on macosx, etc
- awk \
+ gawk \
'($0 !~ /^[[:space:]]*(#|dnl)/) {
- # The following is replaced by below, as we cannot use match()
- # with a third argument with non-gawk (posix) versions of awk:
- #
- #if (match($0, "AC_PREREQ\\(\\[?([0-9]\\.[0-9])", res))
- # VERSIONS[COUNT++] = res[1]
- #
- sindex = match($0, /AC_PREREQ\(\[?([0-9]\.[0-9])/)
- if (sindex > 0) {
- sindex += length("AC_PREREQ(")
- if (substr($0, sindex, 1) == "[")
- sindex++
- VERSIONS[COUNT++] = substr($0, sindex, 3)
- }
+ if (match($0, "AC_PREREQ\\(\\[?([0-9]\\.[0-9])", res))
+ VERSIONS[COUNT++] = res[1]
}
END {
- # The following is replaced by below, as we cannot use asort()
- # with non-gawk (posix) versions of awk:
- #
- #asort(VERSIONS)
- #
- VERSION = VERSIONS[0]
- # We need to get the biggest version and print that
- for (x = 0; x <= COUNT;x++)
- if (VERSIONS[x] > VERSION)
- VERSION=VERSIONS[x]
-
- print VERSION
+ asort(VERSIONS)
+ print VERSIONS[COUNT]
}' "$@"
}
generated_version() {
- # Add --posix to below awk to make sure it will run on macosx, etc
- awk \
+ gawk \
'{
- # The following is replaced by below, as we cannot use match()
- # with a third argument with non-gawk (posix) versions of awk:
- #
- #if (match($0,
- # "^# Generated (by (GNU )?Autoconf|automatically using autoconf version) ([0-9].[0-9])",
- # res))
- # { print res[3]; exit }
- #
- # First try for newer versions of autoconf
- sindex = match($0, /Generated by GNU Autoconf ([0-9]\.[0-9])/)
- if (sindex > 0)
- # Now chop the first part before the version
- sindex += length("Generated by GNU Autoconf ")
- # No version, so try older versions of autoconf
- if (sindex <= 0) {
- sindex = match($0, /Generated automatically using autoconf version ([0-9]\.[0-9])/)
- if (sindex > 0)
- sindex += length("Generated automatically using autoconf version ")
- }
-
- # Ok, we got a version
- if (sindex > 0) {
- print substr($0, sindex, 3)
+ if (match($0,
+ "^# Generated (by (GNU )?Autoconf|automatically using autoconf version) ([0-9].[0-9])",
+ res)) {
+ print res[3]
exit
}
}' "$@"