Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 385201
Collapse All | Expand All

(-)ac-wrapper-11.sh (-10 / +20 lines)
Lines 29-34 Link Here
29
	    "   that would use autom4te."
29
	    "   that would use autom4te."
30
fi
30
fi
31
31
32
33
# Sanitize $0 in order to protect against stupid ways of calling this script
34
# such as `sh autoconf` which prevent $0 from being set to a valid path.
35
# Since we cannot manipulate $0, use $script instead.
36
if [ -x "$0" ]; then
37
	script="$0"
38
else
39
	script=$(which "$0")
40
fi
41
32
if ! seq 0 0 2>/dev/null 1>&2 ; then #338518
42
if ! seq 0 0 2>/dev/null 1>&2 ; then #338518
33
	seq() {
43
	seq() {
34
		local f l i
44
		local f l i
Lines 55-68 Link Here
55
binary=""
65
binary=""
56
for v in ${vers} ; do
66
for v in ${vers} ; do
57
	auto_ver=${v%:*}
67
	auto_ver=${v%:*}
58
	if [ -z "${binary}" ] && [ -x "${0}-${auto_ver}" ] ; then
68
	if [ -z "${binary}" ] && [ -x "${script}-${auto_ver}" ] ; then
59
		binary="${0}-${auto_ver}"
69
		binary="${script}-${auto_ver}"
60
	fi
70
	fi
61
done
71
done
62
if [ -z "${binary}" ] ; then
72
if [ -z "${binary}" ] ; then
63
	err "Unable to locate any usuable version of autoconf.\n" \
73
	err "Unable to locate any usuable version of autoconf.\n" \
64
	    "\tI tried these versions: ${vers}\n" \
74
	    "\tI tried these versions: ${vers}\n" \
65
	    "\tWith a base name of '${0}'."
75
	    "\tWith a base name of '${script}'."
66
fi
76
fi
67
77
68
#
78
#
Lines 80-87 Link Here
80
		auto_ver=${v%:*}
90
		auto_ver=${v%:*}
81
		want_ver=${v#*:}
91
		want_ver=${v#*:}
82
		for wx in ${WANT_AUTOCONF} ; do
92
		for wx in ${WANT_AUTOCONF} ; do
83
			if [ "${wx}" = "${want_ver}" ] && [ -x "${0}-${auto_ver}" ] ; then
93
			if [ "${wx}" = "${want_ver}" ] && [ -x "${script}-${auto_ver}" ] ; then
84
				binary="${0}-${auto_ver}"
94
				binary="${script}-${auto_ver}"
85
				v="x"
95
				v="x"
86
			fi
96
			fi
87
		done
97
		done
Lines 94-101 Link Here
94
#
104
#
95
acprereq_version() {
105
acprereq_version() {
96
	gawk \
106
	gawk \
97
	'($0 !~ /^[[:space:]]*(#|dnl)/) {
107
	'($script !~ /^[[:space:]]*(#|dnl)/) {
98
		if (match($0, "AC_PREREQ\\(\\[?([0-9]\\.[0-9])", res))
108
		if (match($script, "AC_PREREQ\\(\\[?([0-9]\\.[0-9])", res))
99
			VERSIONS[COUNT++] = res[1]
109
			VERSIONS[COUNT++] = res[1]
100
	}
110
	}
101
111
Lines 108-114 Link Here
108
generated_version() {
118
generated_version() {
109
	gawk \
119
	gawk \
110
	'{
120
	'{
111
		if (match($0,
121
		if (match($script,
112
		          "^# Generated (by (GNU )?Autoconf|automatically using autoconf version) ([0-9].[0-9])",
122
		          "^# Generated (by (GNU )?Autoconf|automatically using autoconf version) ([0-9].[0-9])",
113
		          res)) {
123
		          res)) {
114
			print res[3]
124
			print res[3]
Lines 140-146 Link Here
140
			&& confversion=$(generated_version configure)
150
			&& confversion=$(generated_version configure)
141
151
142
		if [ "${confversion}" = "2.1" ] && [ ! -f "configure.ac" ] ; then
152
		if [ "${confversion}" = "2.1" ] && [ ! -f "configure.ac" ] ; then
143
			binary="${0}-2.13"
153
			binary="${script}-2.13"
144
		fi
154
		fi
145
	esac
155
	esac
146
fi
156
fi
Lines 158-164 Link Here
158
for v in ${vers} ; do
168
for v in ${vers} ; do
159
	auto_ver=${v%:*}
169
	auto_ver=${v%:*}
160
	want_ver=${v#*:}
170
	want_ver=${v#*:}
161
	if [ "${binary}" = "${0}-${auto_ver}" ] ; then
171
	if [ "${binary}" = "${script}-${auto_ver}" ] ; then
162
		export WANT_AUTOCONF="${want_ver}"
172
		export WANT_AUTOCONF="${want_ver}"
163
	fi
173
	fi
164
done
174
done

Return to bug 385201