aboutsummaryrefslogtreecommitdiffstats
path: root/autogen
diff options
context:
space:
mode:
authorGlenn Morris2011-03-25 00:14:31 -0700
committerGlenn Morris2011-03-25 00:14:31 -0700
commitf6ca84c095f29a92f5e651c7ec4f7abec7e5bc43 (patch)
tree0348c42a278c6327cf133ce5a70e2031b4568824 /autogen
parent577c4ec0579864e6e2e243e64cc6662c9fcc8bce (diff)
downloademacs-f6ca84c095f29a92f5e651c7ec4f7abec7e5bc43.tar.gz
emacs-f6ca84c095f29a92f5e651c7ec4f7abec7e5bc43.zip
Remove some files that autoreconf can supply.
Ref: http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00863.html * compile, config.guess, config.sub, depcomp, install-sh, missing: Remove; autoreconf can supply them. * Makefile.in (sync-from-gnulib): Don't sync config.sub, config.guess, install-sh. Pass -i to autoreconf. * autogen/update_autogen (genfiles): Add compile, config.guess, config.sub, depcomp, install-sh, missing. Pass -i to autoreconf. Discard non-error output from autoreconf in -q case. * autogen/compile, autogen/config.guess, autogen/config.sub: * autogen/depcomp, autogen/install-sh, autogen/missing: New files. * autogen/copy_autogen: Add compile, config.guess, config.sub, depcomp, install-sh, missing. * autogen/README: Add compile, config.guess, config.sub, depcomp, install-sh, missing. * INSTALL.BZR, admin/make-tarball.txt: Add -i to autoreconf args. * .bzrignore: Add compile, config.guess, config.sub, depcomp, install-sh, missing.
Diffstat (limited to 'autogen')
-rw-r--r--autogen/README6
-rwxr-xr-xautogen/compile143
-rwxr-xr-xautogen/config.guess1533
-rwxr-xr-xautogen/config.sub1693
-rwxr-xr-xautogen/copy_autogen1
-rwxr-xr-xautogen/depcomp630
-rwxr-xr-xautogen/install-sh520
-rwxr-xr-xautogen/missing376
-rwxr-xr-xautogen/update_autogen15
9 files changed, 4915 insertions, 2 deletions
diff --git a/autogen/README b/autogen/README
index a16dc93c48a..fd574c41cd6 100644
--- a/autogen/README
+++ b/autogen/README
@@ -7,6 +7,12 @@ configure ../ autoconf
7config.in ../src autoheader * also used by MSDOS bzr build 7config.in ../src autoheader * also used by MSDOS bzr build
8aclocal.m4 ../ aclocal 8aclocal.m4 ../ aclocal
9Makefile.in ../lib automake 9Makefile.in ../lib automake
10compile ../ automake
11config.guess ../ automake
12config.sub ../ automake
13depcomp ../ automake
14install-sh ../ automake
15missing ../ automake
10 16
11There are also some scripts: 17There are also some scripts:
12 18
diff --git a/autogen/compile b/autogen/compile
new file mode 100755
index 00000000000..c0096a7b563
--- /dev/null
+++ b/autogen/compile
@@ -0,0 +1,143 @@
1#! /bin/sh
2# Wrapper for compilers which do not understand `-c -o'.
3
4scriptversion=2009-10-06.20; # UTC
5
6# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2009 Free Software
7# Foundation, Inc.
8# Written by Tom Tromey <tromey@cygnus.com>.
9#
10# This program is free software; you can redistribute it and/or modify
11# it under the terms of the GNU General Public License as published by
12# the Free Software Foundation; either version 2, or (at your option)
13# any later version.
14#
15# This program is distributed in the hope that it will be useful,
16# but WITHOUT ANY WARRANTY; without even the implied warranty of
17# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18# GNU General Public License for more details.
19#
20# You should have received a copy of the GNU General Public License
21# along with this program. If not, see <http://www.gnu.org/licenses/>.
22
23# As a special exception to the GNU General Public License, if you
24# distribute this file as part of a program that contains a
25# configuration script generated by Autoconf, you may include it under
26# the same distribution terms that you use for the rest of that program.
27
28# This file is maintained in Automake, please report
29# bugs to <bug-automake@gnu.org> or send patches to
30# <automake-patches@gnu.org>.
31
32case $1 in
33 '')
34 echo "$0: No command. Try \`$0 --help' for more information." 1>&2
35 exit 1;
36 ;;
37 -h | --h*)
38 cat <<\EOF
39Usage: compile [--help] [--version] PROGRAM [ARGS]
40
41Wrapper for compilers which do not understand `-c -o'.
42Remove `-o dest.o' from ARGS, run PROGRAM with the remaining
43arguments, and rename the output as expected.
44
45If you are trying to build a whole package this is not the
46right script to run: please start by reading the file `INSTALL'.
47
48Report bugs to <bug-automake@gnu.org>.
49EOF
50 exit $?
51 ;;
52 -v | --v*)
53 echo "compile $scriptversion"
54 exit $?
55 ;;
56esac
57
58ofile=
59cfile=
60eat=
61
62for arg
63do
64 if test -n "$eat"; then
65 eat=
66 else
67 case $1 in
68 -o)
69 # configure might choose to run compile as `compile cc -o foo foo.c'.
70 # So we strip `-o arg' only if arg is an object.
71 eat=1
72 case $2 in
73 *.o | *.obj)
74 ofile=$2
75 ;;
76 *)
77 set x "$@" -o "$2"
78 shift
79 ;;
80 esac
81 ;;
82 *.c)
83 cfile=$1
84 set x "$@" "$1"
85 shift
86 ;;
87 *)
88 set x "$@" "$1"
89 shift
90 ;;
91 esac
92 fi
93 shift
94done
95
96if test -z "$ofile" || test -z "$cfile"; then
97 # If no `-o' option was seen then we might have been invoked from a
98 # pattern rule where we don't need one. That is ok -- this is a
99 # normal compilation that the losing compiler can handle. If no
100 # `.c' file was seen then we are probably linking. That is also
101 # ok.
102 exec "$@"
103fi
104
105# Name of file we expect compiler to create.
106cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'`
107
108# Create the lock directory.
109# Note: use `[/\\:.-]' here to ensure that we don't use the same name
110# that we are using for the .o file. Also, base the name on the expected
111# object file name, since that is what matters with a parallel build.
112lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d
113while true; do
114 if mkdir "$lockdir" >/dev/null 2>&1; then
115 break
116 fi
117 sleep 1
118done
119# FIXME: race condition here if user kills between mkdir and trap.
120trap "rmdir '$lockdir'; exit 1" 1 2 15
121
122# Run the compile.
123"$@"
124ret=$?
125
126if test -f "$cofile"; then
127 test "$cofile" = "$ofile" || mv "$cofile" "$ofile"
128elif test -f "${cofile}bj"; then
129 test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile"
130fi
131
132rmdir "$lockdir"
133exit $ret
134
135# Local Variables:
136# mode: shell-script
137# sh-indentation: 2
138# eval: (add-hook 'write-file-hooks 'time-stamp)
139# time-stamp-start: "scriptversion="
140# time-stamp-format: "%:y-%02m-%02d.%02H"
141# time-stamp-time-zone: "UTC"
142# time-stamp-end: "; # UTC"
143# End:
diff --git a/autogen/config.guess b/autogen/config.guess
new file mode 100755
index 00000000000..e3a2116a7dc
--- /dev/null
+++ b/autogen/config.guess
@@ -0,0 +1,1533 @@
1#! /bin/sh
2# Attempt to guess a canonical system name.
3# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
4# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
5# Free Software Foundation, Inc.
6
7timestamp='2009-06-10'
8
9# This file is free software; you can redistribute it and/or modify it
10# under the terms of the GNU General Public License as published by
11# the Free Software Foundation; either version 2 of the License, or
12# (at your option) any later version.
13#
14# This program is distributed in the hope that it will be useful, but
15# WITHOUT ANY WARRANTY; without even the implied warranty of
16# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17# General Public License for more details.
18#
19# You should have received a copy of the GNU General Public License
20# along with this program; if not, write to the Free Software
21# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
22# 02110-1301, USA.
23#
24# As a special exception to the GNU General Public License, if you
25# distribute this file as part of a program that contains a
26# configuration script generated by Autoconf, you may include it under
27# the same distribution terms that you use for the rest of that program.
28
29
30# Originally written by Per Bothner <per@bothner.com>.
31# Please send patches to <config-patches@gnu.org>. Submit a context
32# diff and a properly formatted ChangeLog entry.
33#
34# This script attempts to guess a canonical system name similar to
35# config.sub. If it succeeds, it prints the system name on stdout, and
36# exits with 0. Otherwise, it exits with 1.
37#
38# The plan is that this can be called by configure scripts if you
39# don't specify an explicit build system type.
40
41me=`echo "$0" | sed -e 's,.*/,,'`
42
43usage="\
44Usage: $0 [OPTION]
45
46Output the configuration name of the system \`$me' is run on.
47
48Operation modes:
49 -h, --help print this help, then exit
50 -t, --time-stamp print date of last modification, then exit
51 -v, --version print version number, then exit
52
53Report bugs and patches to <config-patches@gnu.org>."
54
55version="\
56GNU config.guess ($timestamp)
57
58Originally written by Per Bothner.
59Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
602002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
61
62This is free software; see the source for copying conditions. There is NO
63warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
64
65help="
66Try \`$me --help' for more information."
67
68# Parse command line
69while test $# -gt 0 ; do
70 case $1 in
71 --time-stamp | --time* | -t )
72 echo "$timestamp" ; exit ;;
73 --version | -v )
74 echo "$version" ; exit ;;
75 --help | --h* | -h )
76 echo "$usage"; exit ;;
77 -- ) # Stop option processing
78 shift; break ;;
79 - ) # Use stdin as input.
80 break ;;
81 -* )
82 echo "$me: invalid option $1$help" >&2
83 exit 1 ;;
84 * )
85 break ;;
86 esac
87done
88
89if test $# != 0; then
90 echo "$me: too many arguments$help" >&2
91 exit 1
92fi
93
94trap 'exit 1' 1 2 15
95
96# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
97# compiler to aid in system detection is discouraged as it requires
98# temporary files to be created and, as you can see below, it is a
99# headache to deal with in a portable fashion.
100
101# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
102# use `HOST_CC' if defined, but it is deprecated.
103
104# Portable tmp directory creation inspired by the Autoconf team.
105
106set_cc_for_build='
107trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
108trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
109: ${TMPDIR=/tmp} ;
110 { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
111 { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
112 { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
113 { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
114dummy=$tmp/dummy ;
115tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
116case $CC_FOR_BUILD,$HOST_CC,$CC in
117 ,,) echo "int x;" > $dummy.c ;
118 for c in cc gcc c89 c99 ; do
119 if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
120 CC_FOR_BUILD="$c"; break ;
121 fi ;
122 done ;
123 if test x"$CC_FOR_BUILD" = x ; then
124 CC_FOR_BUILD=no_compiler_found ;
125 fi
126 ;;
127 ,,*) CC_FOR_BUILD=$CC ;;
128 ,*,*) CC_FOR_BUILD=$HOST_CC ;;
129esac ; set_cc_for_build= ;'
130
131# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
132# (ghazi@noc.rutgers.edu 1994-08-24)
133if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
134 PATH=$PATH:/.attbin ; export PATH
135fi
136
137UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
138UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
139UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
140UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
141
142# Note: order is significant - the case branches are not exclusive.
143
144case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
145 *:NetBSD:*:*)
146 # NetBSD (nbsd) targets should (where applicable) match one or
147 # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
148 # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
149 # switched to ELF, *-*-netbsd* would select the old
150 # object file format. This provides both forward
151 # compatibility and a consistent mechanism for selecting the
152 # object file format.
153 #
154 # Note: NetBSD doesn't particularly care about the vendor
155 # portion of the name. We always set it to "unknown".
156 sysctl="sysctl -n hw.machine_arch"
157 UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
158 /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
159 case "${UNAME_MACHINE_ARCH}" in
160 armeb) machine=armeb-unknown ;;
161 arm*) machine=arm-unknown ;;
162 sh3el) machine=shl-unknown ;;
163 sh3eb) machine=sh-unknown ;;
164 sh5el) machine=sh5le-unknown ;;
165 *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
166 esac
167 # The Operating System including object format, if it has switched
168 # to ELF recently, or will in the future.
169 case "${UNAME_MACHINE_ARCH}" in
170 arm*|i386|m68k|ns32k|sh3*|sparc|vax)
171 eval $set_cc_for_build
172 if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
173 | grep -q __ELF__
174 then
175 # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
176 # Return netbsd for either. FIX?
177 os=netbsd
178 else
179 os=netbsdelf
180 fi
181 ;;
182 *)
183 os=netbsd
184 ;;
185 esac
186 # The OS release
187 # Debian GNU/NetBSD machines have a different userland, and
188 # thus, need a distinct triplet. However, they do not need
189 # kernel version information, so it can be replaced with a
190 # suitable tag, in the style of linux-gnu.
191 case "${UNAME_VERSION}" in
192 Debian*)
193 release='-gnu'
194 ;;
195 *)
196 release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
197 ;;
198 esac
199 # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
200 # contains redundant information, the shorter form:
201 # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
202 echo "${machine}-${os}${release}"
203 exit ;;
204 *:OpenBSD:*:*)
205 UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
206 echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
207 exit ;;
208 *:ekkoBSD:*:*)
209 echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
210 exit ;;
211 *:SolidBSD:*:*)
212 echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
213 exit ;;
214 macppc:MirBSD:*:*)
215 echo powerpc-unknown-mirbsd${UNAME_RELEASE}
216 exit ;;
217 *:MirBSD:*:*)
218 echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
219 exit ;;
220 alpha:OSF1:*:*)
221 case $UNAME_RELEASE in
222 *4.0)
223 UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
224 ;;
225 *5.*)
226 UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
227 ;;
228 esac
229 # According to Compaq, /usr/sbin/psrinfo has been available on
230 # OSF/1 and Tru64 systems produced since 1995. I hope that
231 # covers most systems running today. This code pipes the CPU
232 # types through head -n 1, so we only detect the type of CPU 0.
233 ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
234 case "$ALPHA_CPU_TYPE" in
235 "EV4 (21064)")
236 UNAME_MACHINE="alpha" ;;
237 "EV4.5 (21064)")
238 UNAME_MACHINE="alpha" ;;
239 "LCA4 (21066/21068)")
240 UNAME_MACHINE="alpha" ;;
241 "EV5 (21164)")
242 UNAME_MACHINE="alphaev5" ;;
243 "EV5.6 (21164A)")
244 UNAME_MACHINE="alphaev56" ;;
245 "EV5.6 (21164PC)")
246 UNAME_MACHINE="alphapca56" ;;
247 "EV5.7 (21164PC)")
248 UNAME_MACHINE="alphapca57" ;;
249 "EV6 (21264)")
250 UNAME_MACHINE="alphaev6" ;;
251 "EV6.7 (21264A)")
252 UNAME_MACHINE="alphaev67" ;;
253 "EV6.8CB (21264C)")
254 UNAME_MACHINE="alphaev68" ;;
255 "EV6.8AL (21264B)")
256 UNAME_MACHINE="alphaev68" ;;
257 "EV6.8CX (21264D)")
258 UNAME_MACHINE="alphaev68" ;;
259 "EV6.9A (21264/EV69A)")
260 UNAME_MACHINE="alphaev69" ;;
261 "EV7 (21364)")
262 UNAME_MACHINE="alphaev7" ;;
263 "EV7.9 (21364A)")
264 UNAME_MACHINE="alphaev79" ;;
265 esac
266 # A Pn.n version is a patched version.
267 # A Vn.n version is a released version.
268 # A Tn.n version is a released field test version.
269 # A Xn.n version is an unreleased experimental baselevel.
270 # 1.2 uses "1.2" for uname -r.
271 echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
272 exit ;;
273 Alpha\ *:Windows_NT*:*)
274 # How do we know it's Interix rather than the generic POSIX subsystem?
275 # Should we change UNAME_MACHINE based on the output of uname instead
276 # of the specific Alpha model?
277 echo alpha-pc-interix
278 exit ;;
279 21064:Windows_NT:50:3)
280 echo alpha-dec-winnt3.5
281 exit ;;
282 Amiga*:UNIX_System_V:4.0:*)
283 echo m68k-unknown-sysv4
284 exit ;;
285 *:[Aa]miga[Oo][Ss]:*:*)
286 echo ${UNAME_MACHINE}-unknown-amigaos
287 exit ;;
288 *:[Mm]orph[Oo][Ss]:*:*)
289 echo ${UNAME_MACHINE}-unknown-morphos
290 exit ;;
291 *:OS/390:*:*)
292 echo i370-ibm-openedition
293 exit ;;
294 *:z/VM:*:*)
295 echo s390-ibm-zvmoe
296 exit ;;
297 *:OS400:*:*)
298 echo powerpc-ibm-os400
299 exit ;;
300 arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
301 echo arm-acorn-riscix${UNAME_RELEASE}
302 exit ;;
303 arm:riscos:*:*|arm:RISCOS:*:*)
304 echo arm-unknown-riscos
305 exit ;;
306 SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
307 echo hppa1.1-hitachi-hiuxmpp
308 exit ;;
309 Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
310 # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
311 if test "`(/bin/universe) 2>/dev/null`" = att ; then
312 echo pyramid-pyramid-sysv3
313 else
314 echo pyramid-pyramid-bsd
315 fi
316 exit ;;
317 NILE*:*:*:dcosx)
318 echo pyramid-pyramid-svr4
319 exit ;;
320 DRS?6000:unix:4.0:6*)
321 echo sparc-icl-nx6
322 exit ;;
323 DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
324 case `/usr/bin/uname -p` in
325 sparc) echo sparc-icl-nx7; exit ;;
326 esac ;;
327 s390x:SunOS:*:*)
328 echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
329 exit ;;
330 sun4H:SunOS:5.*:*)
331 echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
332 exit ;;
333 sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
334 echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
335 exit ;;
336 i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
337 eval $set_cc_for_build
338 SUN_ARCH="i386"
339 # If there is a compiler, see if it is configured for 64-bit objects.
340 # Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
341 # This test works for both compilers.
342 if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
343 if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
344 (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
345 grep IS_64BIT_ARCH >/dev/null
346 then
347 SUN_ARCH="x86_64"
348 fi
349 fi
350 echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
351 exit ;;
352 sun4*:SunOS:6*:*)
353 # According to config.sub, this is the proper way to canonicalize
354 # SunOS6. Hard to guess exactly what SunOS6 will be like, but
355 # it's likely to be more like Solaris than SunOS4.
356 echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
357 exit ;;
358 sun4*:SunOS:*:*)
359 case "`/usr/bin/arch -k`" in
360 Series*|S4*)
361 UNAME_RELEASE=`uname -v`
362 ;;
363 esac
364 # Japanese Language versions have a version number like `4.1.3-JL'.
365 echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
366 exit ;;
367 sun3*:SunOS:*:*)
368 echo m68k-sun-sunos${UNAME_RELEASE}
369 exit ;;
370 sun*:*:4.2BSD:*)
371 UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
372 test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
373 case "`/bin/arch`" in
374 sun3)
375 echo m68k-sun-sunos${UNAME_RELEASE}
376 ;;
377 sun4)
378 echo sparc-sun-sunos${UNAME_RELEASE}
379 ;;
380 esac
381 exit ;;
382 aushp:SunOS:*:*)
383 echo sparc-auspex-sunos${UNAME_RELEASE}
384 exit ;;
385 # The situation for MiNT is a little confusing. The machine name
386 # can be virtually everything (everything which is not
387 # "atarist" or "atariste" at least should have a processor
388 # > m68000). The system name ranges from "MiNT" over "FreeMiNT"
389 # to the lowercase version "mint" (or "freemint"). Finally
390 # the system name "TOS" denotes a system which is actually not
391 # MiNT. But MiNT is downward compatible to TOS, so this should
392 # be no problem.
393 atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
394 echo m68k-atari-mint${UNAME_RELEASE}
395 exit ;;
396 atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
397 echo m68k-atari-mint${UNAME_RELEASE}
398 exit ;;
399 *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
400 echo m68k-atari-mint${UNAME_RELEASE}
401 exit ;;
402 milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
403 echo m68k-milan-mint${UNAME_RELEASE}
404 exit ;;
405 hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
406 echo m68k-hades-mint${UNAME_RELEASE}
407 exit ;;
408 *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
409 echo m68k-unknown-mint${UNAME_RELEASE}
410 exit ;;
411 m68k:machten:*:*)
412 echo m68k-apple-machten${UNAME_RELEASE}
413 exit ;;
414 powerpc:machten:*:*)
415 echo powerpc-apple-machten${UNAME_RELEASE}
416 exit ;;
417 RISC*:Mach:*:*)
418 echo mips-dec-mach_bsd4.3
419 exit ;;
420 RISC*:ULTRIX:*:*)
421 echo mips-dec-ultrix${UNAME_RELEASE}
422 exit ;;
423 VAX*:ULTRIX*:*:*)
424 echo vax-dec-ultrix${UNAME_RELEASE}
425 exit ;;
426 2020:CLIX:*:* | 2430:CLIX:*:*)
427 echo clipper-intergraph-clix${UNAME_RELEASE}
428 exit ;;
429 mips:*:*:UMIPS | mips:*:*:RISCos)
430 eval $set_cc_for_build
431 sed 's/^ //' << EOF >$dummy.c
432#ifdef __cplusplus
433#include <stdio.h> /* for printf() prototype */
434 int main (int argc, char *argv[]) {
435#else
436 int main (argc, argv) int argc; char *argv[]; {
437#endif
438 #if defined (host_mips) && defined (MIPSEB)
439 #if defined (SYSTYPE_SYSV)
440 printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
441 #endif
442 #if defined (SYSTYPE_SVR4)
443 printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
444 #endif
445 #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
446 printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
447 #endif
448 #endif
449 exit (-1);
450 }
451EOF
452 $CC_FOR_BUILD -o $dummy $dummy.c &&
453 dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
454 SYSTEM_NAME=`$dummy $dummyarg` &&
455 { echo "$SYSTEM_NAME"; exit; }
456 echo mips-mips-riscos${UNAME_RELEASE}
457 exit ;;
458 Motorola:PowerMAX_OS:*:*)
459 echo powerpc-motorola-powermax
460 exit ;;
461 Motorola:*:4.3:PL8-*)
462 echo powerpc-harris-powermax
463 exit ;;
464 Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
465 echo powerpc-harris-powermax
466 exit ;;
467 Night_Hawk:Power_UNIX:*:*)
468 echo powerpc-harris-powerunix
469 exit ;;
470 m88k:CX/UX:7*:*)
471 echo m88k-harris-cxux7
472 exit ;;
473 m88k:*:4*:R4*)
474 echo m88k-motorola-sysv4
475 exit ;;
476 m88k:*:3*:R3*)
477 echo m88k-motorola-sysv3
478 exit ;;
479 AViiON:dgux:*:*)
480 # DG/UX returns AViiON for all architectures
481 UNAME_PROCESSOR=`/usr/bin/uname -p`
482 if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
483 then
484 if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
485 [ ${TARGET_BINARY_INTERFACE}x = x ]
486 then
487 echo m88k-dg-dgux${UNAME_RELEASE}
488 else
489 echo m88k-dg-dguxbcs${UNAME_RELEASE}
490 fi
491 else
492 echo i586-dg-dgux${UNAME_RELEASE}
493 fi
494 exit ;;
495 M88*:DolphinOS:*:*) # DolphinOS (SVR3)
496 echo m88k-dolphin-sysv3
497 exit ;;
498 M88*:*:R3*:*)
499 # Delta 88k system running SVR3
500 echo m88k-motorola-sysv3
501 exit ;;
502 XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
503 echo m88k-tektronix-sysv3
504 exit ;;
505 Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
506 echo m68k-tektronix-bsd
507 exit ;;
508 *:IRIX*:*:*)
509 echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
510 exit ;;
511 ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
512 echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
513 exit ;; # Note that: echo "'`uname -s`'" gives 'AIX '
514 i*86:AIX:*:*)
515 echo i386-ibm-aix
516 exit ;;
517 ia64:AIX:*:*)
518 if [ -x /usr/bin/oslevel ] ; then
519 IBM_REV=`/usr/bin/oslevel`
520 else
521 IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
522 fi
523 echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
524 exit ;;
525 *:AIX:2:3)
526 if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
527 eval $set_cc_for_build
528 sed 's/^ //' << EOF >$dummy.c
529 #include <sys/systemcfg.h>
530
531 main()
532 {
533 if (!__power_pc())
534 exit(1);
535 puts("powerpc-ibm-aix3.2.5");
536 exit(0);
537 }
538EOF
539 if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
540 then
541 echo "$SYSTEM_NAME"
542 else
543 echo rs6000-ibm-aix3.2.5
544 fi
545 elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
546 echo rs6000-ibm-aix3.2.4
547 else
548 echo rs6000-ibm-aix3.2
549 fi
550 exit ;;
551 *:AIX:*:[456])
552 IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
553 if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
554 IBM_ARCH=rs6000
555 else
556 IBM_ARCH=powerpc
557 fi
558 if [ -x /usr/bin/oslevel ] ; then
559 IBM_REV=`/usr/bin/oslevel`
560 else
561 IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
562 fi
563 echo ${IBM_ARCH}-ibm-aix${IBM_REV}
564 exit ;;
565 *:AIX:*:*)
566 echo rs6000-ibm-aix
567 exit ;;
568 ibmrt:4.4BSD:*|romp-ibm:BSD:*)
569 echo romp-ibm-bsd4.4
570 exit ;;
571 ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
572 echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
573 exit ;; # report: romp-ibm BSD 4.3
574 *:BOSX:*:*)
575 echo rs6000-bull-bosx
576 exit ;;
577 DPX/2?00:B.O.S.:*:*)
578 echo m68k-bull-sysv3
579 exit ;;
580 9000/[34]??:4.3bsd:1.*:*)
581 echo m68k-hp-bsd
582 exit ;;
583 hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
584 echo m68k-hp-bsd4.4
585 exit ;;
586 9000/[34678]??:HP-UX:*:*)
587 HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
588 case "${UNAME_MACHINE}" in
589 9000/31? ) HP_ARCH=m68000 ;;
590 9000/[34]?? ) HP_ARCH=m68k ;;
591 9000/[678][0-9][0-9])
592 if [ -x /usr/bin/getconf ]; then
593 sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
594 sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
595 case "${sc_cpu_version}" in
596 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
597 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
598 532) # CPU_PA_RISC2_0
599 case "${sc_kernel_bits}" in
600 32) HP_ARCH="hppa2.0n" ;;
601 64) HP_ARCH="hppa2.0w" ;;
602 '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20
603 esac ;;
604 esac
605 fi
606 if [ "${HP_ARCH}" = "" ]; then
607 eval $set_cc_for_build
608 sed 's/^ //' << EOF >$dummy.c
609
610 #define _HPUX_SOURCE
611 #include <stdlib.h>
612 #include <unistd.h>
613
614 int main ()
615 {
616 #if defined(_SC_KERNEL_BITS)
617 long bits = sysconf(_SC_KERNEL_BITS);
618 #endif
619 long cpu = sysconf (_SC_CPU_VERSION);
620
621 switch (cpu)
622 {
623 case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
624 case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
625 case CPU_PA_RISC2_0:
626 #if defined(_SC_KERNEL_BITS)
627 switch (bits)
628 {
629 case 64: puts ("hppa2.0w"); break;
630 case 32: puts ("hppa2.0n"); break;
631 default: puts ("hppa2.0"); break;
632 } break;
633 #else /* !defined(_SC_KERNEL_BITS) */
634 puts ("hppa2.0"); break;
635 #endif
636 default: puts ("hppa1.0"); break;
637 }
638 exit (0);
639 }
640EOF
641 (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
642 test -z "$HP_ARCH" && HP_ARCH=hppa
643 fi ;;
644 esac
645 if [ ${HP_ARCH} = "hppa2.0w" ]
646 then
647 eval $set_cc_for_build
648
649 # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
650 # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler
651 # generating 64-bit code. GNU and HP use different nomenclature:
652 #
653 # $ CC_FOR_BUILD=cc ./config.guess
654 # => hppa2.0w-hp-hpux11.23
655 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
656 # => hppa64-hp-hpux11.23
657
658 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
659 grep -q __LP64__
660 then
661 HP_ARCH="hppa2.0w"
662 else
663 HP_ARCH="hppa64"
664 fi
665 fi
666 echo ${HP_ARCH}-hp-hpux${HPUX_REV}
667 exit ;;
668 ia64:HP-UX:*:*)
669 HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
670 echo ia64-hp-hpux${HPUX_REV}
671 exit ;;
672 3050*:HI-UX:*:*)
673 eval $set_cc_for_build
674 sed 's/^ //' << EOF >$dummy.c
675 #include <unistd.h>
676 int
677 main ()
678 {
679 long cpu = sysconf (_SC_CPU_VERSION);
680 /* The order matters, because CPU_IS_HP_MC68K erroneously returns
681 true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct
682 results, however. */
683 if (CPU_IS_PA_RISC (cpu))
684 {
685 switch (cpu)
686 {
687 case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
688 case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
689 case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
690 default: puts ("hppa-hitachi-hiuxwe2"); break;
691 }
692 }
693 else if (CPU_IS_HP_MC68K (cpu))
694 puts ("m68k-hitachi-hiuxwe2");
695 else puts ("unknown-hitachi-hiuxwe2");
696 exit (0);
697 }
698EOF
699 $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
700 { echo "$SYSTEM_NAME"; exit; }
701 echo unknown-hitachi-hiuxwe2
702 exit ;;
703 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
704 echo hppa1.1-hp-bsd
705 exit ;;
706 9000/8??:4.3bsd:*:*)
707 echo hppa1.0-hp-bsd
708 exit ;;
709 *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
710 echo hppa1.0-hp-mpeix
711 exit ;;
712 hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
713 echo hppa1.1-hp-osf
714 exit ;;
715 hp8??:OSF1:*:*)
716 echo hppa1.0-hp-osf
717 exit ;;
718 i*86:OSF1:*:*)
719 if [ -x /usr/sbin/sysversion ] ; then
720 echo ${UNAME_MACHINE}-unknown-osf1mk
721 else
722 echo ${UNAME_MACHINE}-unknown-osf1
723 fi
724 exit ;;
725 parisc*:Lites*:*:*)
726 echo hppa1.1-hp-lites
727 exit ;;
728 C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
729 echo c1-convex-bsd
730 exit ;;
731 C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
732 if getsysinfo -f scalar_acc
733 then echo c32-convex-bsd
734 else echo c2-convex-bsd
735 fi
736 exit ;;
737 C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
738 echo c34-convex-bsd
739 exit ;;
740 C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
741 echo c38-convex-bsd
742 exit ;;
743 C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
744 echo c4-convex-bsd
745 exit ;;
746 CRAY*Y-MP:*:*:*)
747 echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
748 exit ;;
749 CRAY*[A-Z]90:*:*:*)
750 echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
751 | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
752 -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
753 -e 's/\.[^.]*$/.X/'
754 exit ;;
755 CRAY*TS:*:*:*)
756 echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
757 exit ;;
758 CRAY*T3E:*:*:*)
759 echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
760 exit ;;
761 CRAY*SV1:*:*:*)
762 echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
763 exit ;;
764 *:UNICOS/mp:*:*)
765 echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
766 exit ;;
767 F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
768 FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
769 FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
770 FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
771 echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
772 exit ;;
773 5000:UNIX_System_V:4.*:*)
774 FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
775 FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
776 echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
777 exit ;;
778 i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
779 echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
780 exit ;;
781 sparc*:BSD/OS:*:*)
782 echo sparc-unknown-bsdi${UNAME_RELEASE}
783 exit ;;
784 *:BSD/OS:*:*)
785 echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
786 exit ;;
787 *:FreeBSD:*:*)
788 case ${UNAME_MACHINE} in
789 pc98)
790 echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
791 amd64)
792 echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
793 *)
794 echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
795 esac
796 exit ;;
797 i*:CYGWIN*:*)
798 echo ${UNAME_MACHINE}-pc-cygwin
799 exit ;;
800 *:MINGW*:*)
801 echo ${UNAME_MACHINE}-pc-mingw32
802 exit ;;
803 i*:windows32*:*)
804 # uname -m includes "-pc" on this system.
805 echo ${UNAME_MACHINE}-mingw32
806 exit ;;
807 i*:PW*:*)
808 echo ${UNAME_MACHINE}-pc-pw32
809 exit ;;
810 *:Interix*:[3456]*)
811 case ${UNAME_MACHINE} in
812 x86)
813 echo i586-pc-interix${UNAME_RELEASE}
814 exit ;;
815 EM64T | authenticamd | genuineintel)
816 echo x86_64-unknown-interix${UNAME_RELEASE}
817 exit ;;
818 IA64)
819 echo ia64-unknown-interix${UNAME_RELEASE}
820 exit ;;
821 esac ;;
822 [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
823 echo i${UNAME_MACHINE}-pc-mks
824 exit ;;
825 8664:Windows_NT:*)
826 echo x86_64-pc-mks
827 exit ;;
828 i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
829 # How do we know it's Interix rather than the generic POSIX subsystem?
830 # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
831 # UNAME_MACHINE based on the output of uname instead of i386?
832 echo i586-pc-interix
833 exit ;;
834 i*:UWIN*:*)
835 echo ${UNAME_MACHINE}-pc-uwin
836 exit ;;
837 amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
838 echo x86_64-unknown-cygwin
839 exit ;;
840 p*:CYGWIN*:*)
841 echo powerpcle-unknown-cygwin
842 exit ;;
843 prep*:SunOS:5.*:*)
844 echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
845 exit ;;
846 *:GNU:*:*)
847 # the GNU system
848 echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
849 exit ;;
850 *:GNU/*:*:*)
851 # other systems with GNU libc and userland
852 echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
853 exit ;;
854 i*86:Minix:*:*)
855 echo ${UNAME_MACHINE}-pc-minix
856 exit ;;
857 arm*:Linux:*:*)
858 eval $set_cc_for_build
859 if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
860 | grep -q __ARM_EABI__
861 then
862 echo ${UNAME_MACHINE}-unknown-linux-gnu
863 else
864 echo ${UNAME_MACHINE}-unknown-linux-gnueabi
865 fi
866 exit ;;
867 avr32*:Linux:*:*)
868 echo ${UNAME_MACHINE}-unknown-linux-gnu
869 exit ;;
870 cris:Linux:*:*)
871 echo cris-axis-linux-gnu
872 exit ;;
873 crisv32:Linux:*:*)
874 echo crisv32-axis-linux-gnu
875 exit ;;
876 frv:Linux:*:*)
877 echo frv-unknown-linux-gnu
878 exit ;;
879 ia64:Linux:*:*)
880 echo ${UNAME_MACHINE}-unknown-linux-gnu
881 exit ;;
882 m32r*:Linux:*:*)
883 echo ${UNAME_MACHINE}-unknown-linux-gnu
884 exit ;;
885 m68*:Linux:*:*)
886 echo ${UNAME_MACHINE}-unknown-linux-gnu
887 exit ;;
888 mips:Linux:*:* | mips64:Linux:*:*)
889 eval $set_cc_for_build
890 sed 's/^ //' << EOF >$dummy.c
891 #undef CPU
892 #undef ${UNAME_MACHINE}
893 #undef ${UNAME_MACHINE}el
894 #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
895 CPU=${UNAME_MACHINE}el
896 #else
897 #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
898 CPU=${UNAME_MACHINE}
899 #else
900 CPU=
901 #endif
902 #endif
903EOF
904 eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
905 /^CPU/{
906 s: ::g
907 p
908 }'`"
909 test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
910 ;;
911 or32:Linux:*:*)
912 echo or32-unknown-linux-gnu
913 exit ;;
914 ppc:Linux:*:*)
915 echo powerpc-unknown-linux-gnu
916 exit ;;
917 ppc64:Linux:*:*)
918 echo powerpc64-unknown-linux-gnu
919 exit ;;
920 alpha:Linux:*:*)
921 case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
922 EV5) UNAME_MACHINE=alphaev5 ;;
923 EV56) UNAME_MACHINE=alphaev56 ;;
924 PCA56) UNAME_MACHINE=alphapca56 ;;
925 PCA57) UNAME_MACHINE=alphapca56 ;;
926 EV6) UNAME_MACHINE=alphaev6 ;;
927 EV67) UNAME_MACHINE=alphaev67 ;;
928 EV68*) UNAME_MACHINE=alphaev68 ;;
929 esac
930 objdump --private-headers /bin/sh | grep -q ld.so.1
931 if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
932 echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
933 exit ;;
934 padre:Linux:*:*)
935 echo sparc-unknown-linux-gnu
936 exit ;;
937 parisc:Linux:*:* | hppa:Linux:*:*)
938 # Look for CPU level
939 case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
940 PA7*) echo hppa1.1-unknown-linux-gnu ;;
941 PA8*) echo hppa2.0-unknown-linux-gnu ;;
942 *) echo hppa-unknown-linux-gnu ;;
943 esac
944 exit ;;
945 parisc64:Linux:*:* | hppa64:Linux:*:*)
946 echo hppa64-unknown-linux-gnu
947 exit ;;
948 s390:Linux:*:* | s390x:Linux:*:*)
949 echo ${UNAME_MACHINE}-ibm-linux
950 exit ;;
951 sh64*:Linux:*:*)
952 echo ${UNAME_MACHINE}-unknown-linux-gnu
953 exit ;;
954 sh*:Linux:*:*)
955 echo ${UNAME_MACHINE}-unknown-linux-gnu
956 exit ;;
957 sparc:Linux:*:* | sparc64:Linux:*:*)
958 echo ${UNAME_MACHINE}-unknown-linux-gnu
959 exit ;;
960 vax:Linux:*:*)
961 echo ${UNAME_MACHINE}-dec-linux-gnu
962 exit ;;
963 x86_64:Linux:*:*)
964 echo x86_64-unknown-linux-gnu
965 exit ;;
966 xtensa*:Linux:*:*)
967 echo ${UNAME_MACHINE}-unknown-linux-gnu
968 exit ;;
969 i*86:Linux:*:*)
970 # The BFD linker knows what the default object file format is, so
971 # first see if it will tell us. cd to the root directory to prevent
972 # problems with other programs or directories called `ld' in the path.
973 # Set LC_ALL=C to ensure ld outputs messages in English.
974 ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
975 | sed -ne '/supported targets:/!d
976 s/[ ][ ]*/ /g
977 s/.*supported targets: *//
978 s/ .*//
979 p'`
980 case "$ld_supported_targets" in
981 elf32-i386)
982 TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
983 ;;
984 esac
985 # Determine whether the default compiler is a.out or elf
986 eval $set_cc_for_build
987 sed 's/^ //' << EOF >$dummy.c
988 #include <features.h>
989 #ifdef __ELF__
990 # ifdef __GLIBC__
991 # if __GLIBC__ >= 2
992 LIBC=gnu
993 # else
994 LIBC=gnulibc1
995 # endif
996 # else
997 LIBC=gnulibc1
998 # endif
999 #else
1000 #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
1001 LIBC=gnu
1002 #else
1003 LIBC=gnuaout
1004 #endif
1005 #endif
1006 #ifdef __dietlibc__
1007 LIBC=dietlibc
1008 #endif
1009EOF
1010 eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
1011 /^LIBC/{
1012 s: ::g
1013 p
1014 }'`"
1015 test x"${LIBC}" != x && {
1016 echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
1017 exit
1018 }
1019 test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; }
1020 ;;
1021 i*86:DYNIX/ptx:4*:*)
1022 # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
1023 # earlier versions are messed up and put the nodename in both
1024 # sysname and nodename.
1025 echo i386-sequent-sysv4
1026 exit ;;
1027 i*86:UNIX_SV:4.2MP:2.*)
1028 # Unixware is an offshoot of SVR4, but it has its own version
1029 # number series starting with 2...
1030 # I am not positive that other SVR4 systems won't match this,
1031 # I just have to hope. -- rms.
1032 # Use sysv4.2uw... so that sysv4* matches it.
1033 echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
1034 exit ;;
1035 i*86:OS/2:*:*)
1036 # If we were able to find `uname', then EMX Unix compatibility
1037 # is probably installed.
1038 echo ${UNAME_MACHINE}-pc-os2-emx
1039 exit ;;
1040 i*86:XTS-300:*:STOP)
1041 echo ${UNAME_MACHINE}-unknown-stop
1042 exit ;;
1043 i*86:atheos:*:*)
1044 echo ${UNAME_MACHINE}-unknown-atheos
1045 exit ;;
1046 i*86:syllable:*:*)
1047 echo ${UNAME_MACHINE}-pc-syllable
1048 exit ;;
1049 i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
1050 echo i386-unknown-lynxos${UNAME_RELEASE}
1051 exit ;;
1052 i*86:*DOS:*:*)
1053 echo ${UNAME_MACHINE}-pc-msdosdjgpp
1054 exit ;;
1055 i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
1056 UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
1057 if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
1058 echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
1059 else
1060 echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
1061 fi
1062 exit ;;
1063 i*86:*:5:[678]*)
1064 # UnixWare 7.x, OpenUNIX and OpenServer 6.
1065 case `/bin/uname -X | grep "^Machine"` in
1066 *486*) UNAME_MACHINE=i486 ;;
1067 *Pentium) UNAME_MACHINE=i586 ;;
1068 *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
1069 esac
1070 echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
1071 exit ;;
1072 i*86:*:3.2:*)
1073 if test -f /usr/options/cb.name; then
1074 UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
1075 echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
1076 elif /bin/uname -X 2>/dev/null >/dev/null ; then
1077 UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
1078 (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
1079 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
1080 && UNAME_MACHINE=i586
1081 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
1082 && UNAME_MACHINE=i686
1083 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
1084 && UNAME_MACHINE=i686
1085 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
1086 else
1087 echo ${UNAME_MACHINE}-pc-sysv32
1088 fi
1089 exit ;;
1090 pc:*:*:*)
1091 # Left here for compatibility:
1092 # uname -m prints for DJGPP always 'pc', but it prints nothing about
1093 # the processor, so we play safe by assuming i586.
1094 # Note: whatever this is, it MUST be the same as what config.sub
1095 # prints for the "djgpp" host, or else GDB configury will decide that
1096 # this is a cross-build.
1097 echo i586-pc-msdosdjgpp
1098 exit ;;
1099 Intel:Mach:3*:*)
1100 echo i386-pc-mach3
1101 exit ;;
1102 paragon:*:*:*)
1103 echo i860-intel-osf1
1104 exit ;;
1105 i860:*:4.*:*) # i860-SVR4
1106 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
1107 echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
1108 else # Add other i860-SVR4 vendors below as they are discovered.
1109 echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
1110 fi
1111 exit ;;
1112 mini*:CTIX:SYS*5:*)
1113 # "miniframe"
1114 echo m68010-convergent-sysv
1115 exit ;;
1116 mc68k:UNIX:SYSTEM5:3.51m)
1117 echo m68k-convergent-sysv
1118 exit ;;
1119 M680?0:D-NIX:5.3:*)
1120 echo m68k-diab-dnix
1121 exit ;;
1122 M68*:*:R3V[5678]*:*)
1123 test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
1124 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
1125 OS_REL=''
1126 test -r /etc/.relid \
1127 && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
1128 /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1129 && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
1130 /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
1131 && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
1132 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
1133 /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1134 && { echo i486-ncr-sysv4; exit; } ;;
1135 NCR*:*:4.2:* | MPRAS*:*:4.2:*)
1136 OS_REL='.3'
1137 test -r /etc/.relid \
1138 && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
1139 /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1140 && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
1141 /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
1142 && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
1143 /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
1144 && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
1145 m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
1146 echo m68k-unknown-lynxos${UNAME_RELEASE}
1147 exit ;;
1148 mc68030:UNIX_System_V:4.*:*)
1149 echo m68k-atari-sysv4
1150 exit ;;
1151 TSUNAMI:LynxOS:2.*:*)
1152 echo sparc-unknown-lynxos${UNAME_RELEASE}
1153 exit ;;
1154 rs6000:LynxOS:2.*:*)
1155 echo rs6000-unknown-lynxos${UNAME_RELEASE}
1156 exit ;;
1157 PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
1158 echo powerpc-unknown-lynxos${UNAME_RELEASE}
1159 exit ;;
1160 SM[BE]S:UNIX_SV:*:*)
1161 echo mips-dde-sysv${UNAME_RELEASE}
1162 exit ;;
1163 RM*:ReliantUNIX-*:*:*)
1164 echo mips-sni-sysv4
1165 exit ;;
1166 RM*:SINIX-*:*:*)
1167 echo mips-sni-sysv4
1168 exit ;;
1169 *:SINIX-*:*:*)
1170 if uname -p 2>/dev/null >/dev/null ; then
1171 UNAME_MACHINE=`(uname -p) 2>/dev/null`
1172 echo ${UNAME_MACHINE}-sni-sysv4
1173 else
1174 echo ns32k-sni-sysv
1175 fi
1176 exit ;;
1177 PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
1178 # says <Richard.M.Bartel@ccMail.Census.GOV>
1179 echo i586-unisys-sysv4
1180 exit ;;
1181 *:UNIX_System_V:4*:FTX*)
1182 # From Gerald Hewes <hewes@openmarket.com>.
1183 # How about differentiating between stratus architectures? -djm
1184 echo hppa1.1-stratus-sysv4
1185 exit ;;
1186 *:*:*:FTX*)
1187 # From seanf@swdc.stratus.com.
1188 echo i860-stratus-sysv4
1189 exit ;;
1190 i*86:VOS:*:*)
1191 # From Paul.Green@stratus.com.
1192 echo ${UNAME_MACHINE}-stratus-vos
1193 exit ;;
1194 *:VOS:*:*)
1195 # From Paul.Green@stratus.com.
1196 echo hppa1.1-stratus-vos
1197 exit ;;
1198 mc68*:A/UX:*:*)
1199 echo m68k-apple-aux${UNAME_RELEASE}
1200 exit ;;
1201 news*:NEWS-OS:6*:*)
1202 echo mips-sony-newsos6
1203 exit ;;
1204 R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
1205 if [ -d /usr/nec ]; then
1206 echo mips-nec-sysv${UNAME_RELEASE}
1207 else
1208 echo mips-unknown-sysv${UNAME_RELEASE}
1209 fi
1210 exit ;;
1211 BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
1212 echo powerpc-be-beos
1213 exit ;;
1214 BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
1215 echo powerpc-apple-beos
1216 exit ;;
1217 BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
1218 echo i586-pc-beos
1219 exit ;;
1220 BePC:Haiku:*:*) # Haiku running on Intel PC compatible.
1221 echo i586-pc-haiku
1222 exit ;;
1223 SX-4:SUPER-UX:*:*)
1224 echo sx4-nec-superux${UNAME_RELEASE}
1225 exit ;;
1226 SX-5:SUPER-UX:*:*)
1227 echo sx5-nec-superux${UNAME_RELEASE}
1228 exit ;;
1229 SX-6:SUPER-UX:*:*)
1230 echo sx6-nec-superux${UNAME_RELEASE}
1231 exit ;;
1232 SX-7:SUPER-UX:*:*)
1233 echo sx7-nec-superux${UNAME_RELEASE}
1234 exit ;;
1235 SX-8:SUPER-UX:*:*)
1236 echo sx8-nec-superux${UNAME_RELEASE}
1237 exit ;;
1238 SX-8R:SUPER-UX:*:*)
1239 echo sx8r-nec-superux${UNAME_RELEASE}
1240 exit ;;
1241 Power*:Rhapsody:*:*)
1242 echo powerpc-apple-rhapsody${UNAME_RELEASE}
1243 exit ;;
1244 *:Rhapsody:*:*)
1245 echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
1246 exit ;;
1247 *:Darwin:*:*)
1248 UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
1249 case $UNAME_PROCESSOR in
1250 unknown) UNAME_PROCESSOR=powerpc ;;
1251 esac
1252 echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
1253 exit ;;
1254 *:procnto*:*:* | *:QNX:[0123456789]*:*)
1255 UNAME_PROCESSOR=`uname -p`
1256 if test "$UNAME_PROCESSOR" = "x86"; then
1257 UNAME_PROCESSOR=i386
1258 UNAME_MACHINE=pc
1259 fi
1260 echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
1261 exit ;;
1262 *:QNX:*:4*)
1263 echo i386-pc-qnx
1264 exit ;;
1265 NSE-?:NONSTOP_KERNEL:*:*)
1266 echo nse-tandem-nsk${UNAME_RELEASE}
1267 exit ;;
1268 NSR-?:NONSTOP_KERNEL:*:*)
1269 echo nsr-tandem-nsk${UNAME_RELEASE}
1270 exit ;;
1271 *:NonStop-UX:*:*)
1272 echo mips-compaq-nonstopux
1273 exit ;;
1274 BS2000:POSIX*:*:*)
1275 echo bs2000-siemens-sysv
1276 exit ;;
1277 DS/*:UNIX_System_V:*:*)
1278 echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
1279 exit ;;
1280 *:Plan9:*:*)
1281 # "uname -m" is not consistent, so use $cputype instead. 386
1282 # is converted to i386 for consistency with other x86
1283 # operating systems.
1284 if test "$cputype" = "386"; then
1285 UNAME_MACHINE=i386
1286 else
1287 UNAME_MACHINE="$cputype"
1288 fi
1289 echo ${UNAME_MACHINE}-unknown-plan9
1290 exit ;;
1291 *:TOPS-10:*:*)
1292 echo pdp10-unknown-tops10
1293 exit ;;
1294 *:TENEX:*:*)
1295 echo pdp10-unknown-tenex
1296 exit ;;
1297 KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
1298 echo pdp10-dec-tops20
1299 exit ;;
1300 XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
1301 echo pdp10-xkl-tops20
1302 exit ;;
1303 *:TOPS-20:*:*)
1304 echo pdp10-unknown-tops20
1305 exit ;;
1306 *:ITS:*:*)
1307 echo pdp10-unknown-its
1308 exit ;;
1309 SEI:*:*:SEIUX)
1310 echo mips-sei-seiux${UNAME_RELEASE}
1311 exit ;;
1312 *:DragonFly:*:*)
1313 echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
1314 exit ;;
1315 *:*VMS:*:*)
1316 UNAME_MACHINE=`(uname -p) 2>/dev/null`
1317 case "${UNAME_MACHINE}" in
1318 A*) echo alpha-dec-vms ; exit ;;
1319 I*) echo ia64-dec-vms ; exit ;;
1320 V*) echo vax-dec-vms ; exit ;;
1321 esac ;;
1322 *:XENIX:*:SysV)
1323 echo i386-pc-xenix
1324 exit ;;
1325 i*86:skyos:*:*)
1326 echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
1327 exit ;;
1328 i*86:rdos:*:*)
1329 echo ${UNAME_MACHINE}-pc-rdos
1330 exit ;;
1331 i*86:AROS:*:*)
1332 echo ${UNAME_MACHINE}-pc-aros
1333 exit ;;
1334esac
1335
1336#echo '(No uname command or uname output not recognized.)' 1>&2
1337#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
1338
1339eval $set_cc_for_build
1340cat >$dummy.c <<EOF
1341#ifdef _SEQUENT_
1342# include <sys/types.h>
1343# include <sys/utsname.h>
1344#endif
1345main ()
1346{
1347#if defined (sony)
1348#if defined (MIPSEB)
1349 /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
1350 I don't know.... */
1351 printf ("mips-sony-bsd\n"); exit (0);
1352#else
1353#include <sys/param.h>
1354 printf ("m68k-sony-newsos%s\n",
1355#ifdef NEWSOS4
1356 "4"
1357#else
1358 ""
1359#endif
1360 ); exit (0);
1361#endif
1362#endif
1363
1364#if defined (__arm) && defined (__acorn) && defined (__unix)
1365 printf ("arm-acorn-riscix\n"); exit (0);
1366#endif
1367
1368#if defined (hp300) && !defined (hpux)
1369 printf ("m68k-hp-bsd\n"); exit (0);
1370#endif
1371
1372#if defined (NeXT)
1373#if !defined (__ARCHITECTURE__)
1374#define __ARCHITECTURE__ "m68k"
1375#endif
1376 int version;
1377 version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
1378 if (version < 4)
1379 printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
1380 else
1381 printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
1382 exit (0);
1383#endif
1384
1385#if defined (MULTIMAX) || defined (n16)
1386#if defined (UMAXV)
1387 printf ("ns32k-encore-sysv\n"); exit (0);
1388#else
1389#if defined (CMU)
1390 printf ("ns32k-encore-mach\n"); exit (0);
1391#else
1392 printf ("ns32k-encore-bsd\n"); exit (0);
1393#endif
1394#endif
1395#endif
1396
1397#if defined (__386BSD__)
1398 printf ("i386-pc-bsd\n"); exit (0);
1399#endif
1400
1401#if defined (sequent)
1402#if defined (i386)
1403 printf ("i386-sequent-dynix\n"); exit (0);
1404#endif
1405#if defined (ns32000)
1406 printf ("ns32k-sequent-dynix\n"); exit (0);
1407#endif
1408#endif
1409
1410#if defined (_SEQUENT_)
1411 struct utsname un;
1412
1413 uname(&un);
1414
1415 if (strncmp(un.version, "V2", 2) == 0) {
1416 printf ("i386-sequent-ptx2\n"); exit (0);
1417 }
1418 if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
1419 printf ("i386-sequent-ptx1\n"); exit (0);
1420 }
1421 printf ("i386-sequent-ptx\n"); exit (0);
1422
1423#endif
1424
1425#if defined (vax)
1426# if !defined (ultrix)
1427# include <sys/param.h>
1428# if defined (BSD)
1429# if BSD == 43
1430 printf ("vax-dec-bsd4.3\n"); exit (0);
1431# else
1432# if BSD == 199006
1433 printf ("vax-dec-bsd4.3reno\n"); exit (0);
1434# else
1435 printf ("vax-dec-bsd\n"); exit (0);
1436# endif
1437# endif
1438# else
1439 printf ("vax-dec-bsd\n"); exit (0);
1440# endif
1441# else
1442 printf ("vax-dec-ultrix\n"); exit (0);
1443# endif
1444#endif
1445
1446#if defined (alliant) && defined (i860)
1447 printf ("i860-alliant-bsd\n"); exit (0);
1448#endif
1449
1450 exit (1);
1451}
1452EOF
1453
1454$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
1455 { echo "$SYSTEM_NAME"; exit; }
1456
1457# Apollos put the system type in the environment.
1458
1459test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
1460
1461# Convex versions that predate uname can use getsysinfo(1)
1462
1463if [ -x /usr/convex/getsysinfo ]
1464then
1465 case `getsysinfo -f cpu_type` in
1466 c1*)
1467 echo c1-convex-bsd
1468 exit ;;
1469 c2*)
1470 if getsysinfo -f scalar_acc
1471 then echo c32-convex-bsd
1472 else echo c2-convex-bsd
1473 fi
1474 exit ;;
1475 c34*)
1476 echo c34-convex-bsd
1477 exit ;;
1478 c38*)
1479 echo c38-convex-bsd
1480 exit ;;
1481 c4*)
1482 echo c4-convex-bsd
1483 exit ;;
1484 esac
1485fi
1486
1487cat >&2 <<EOF
1488$0: unable to guess system type
1489
1490This script, last modified $timestamp, has failed to recognize
1491the operating system you are using. It is advised that you
1492download the most up to date version of the config scripts from
1493
1494 http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
1495and
1496 http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
1497
1498If the version you run ($0) is already up to date, please
1499send the following data and any information you think might be
1500pertinent to <config-patches@gnu.org> in order to provide the needed
1501information to handle your system.
1502
1503config.guess timestamp = $timestamp
1504
1505uname -m = `(uname -m) 2>/dev/null || echo unknown`
1506uname -r = `(uname -r) 2>/dev/null || echo unknown`
1507uname -s = `(uname -s) 2>/dev/null || echo unknown`
1508uname -v = `(uname -v) 2>/dev/null || echo unknown`
1509
1510/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
1511/bin/uname -X = `(/bin/uname -X) 2>/dev/null`
1512
1513hostinfo = `(hostinfo) 2>/dev/null`
1514/bin/universe = `(/bin/universe) 2>/dev/null`
1515/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null`
1516/bin/arch = `(/bin/arch) 2>/dev/null`
1517/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null`
1518/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
1519
1520UNAME_MACHINE = ${UNAME_MACHINE}
1521UNAME_RELEASE = ${UNAME_RELEASE}
1522UNAME_SYSTEM = ${UNAME_SYSTEM}
1523UNAME_VERSION = ${UNAME_VERSION}
1524EOF
1525
1526exit 1
1527
1528# Local variables:
1529# eval: (add-hook 'write-file-hooks 'time-stamp)
1530# time-stamp-start: "timestamp='"
1531# time-stamp-format: "%:y-%02m-%02d"
1532# time-stamp-end: "'"
1533# End:
diff --git a/autogen/config.sub b/autogen/config.sub
new file mode 100755
index 00000000000..eb0389a693f
--- /dev/null
+++ b/autogen/config.sub
@@ -0,0 +1,1693 @@
1#! /bin/sh
2# Configuration validation subroutine script.
3# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
4# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
5# Free Software Foundation, Inc.
6
7timestamp='2009-06-11'
8
9# This file is (in principle) common to ALL GNU software.
10# The presence of a machine in this file suggests that SOME GNU software
11# can handle that machine. It does not imply ALL GNU software can.
12#
13# This file is free software; you can redistribute it and/or modify
14# it under the terms of the GNU General Public License as published by
15# the Free Software Foundation; either version 2 of the License, or
16# (at your option) any later version.
17#
18# This program is distributed in the hope that it will be useful,
19# but WITHOUT ANY WARRANTY; without even the implied warranty of
20# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21# GNU General Public License for more details.
22#
23# You should have received a copy of the GNU General Public License
24# along with this program; if not, write to the Free Software
25# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
26# 02110-1301, USA.
27#
28# As a special exception to the GNU General Public License, if you
29# distribute this file as part of a program that contains a
30# configuration script generated by Autoconf, you may include it under
31# the same distribution terms that you use for the rest of that program.
32
33
34# Please send patches to <config-patches@gnu.org>. Submit a context
35# diff and a properly formatted ChangeLog entry.
36#
37# Configuration subroutine to validate and canonicalize a configuration type.
38# Supply the specified configuration type as an argument.
39# If it is invalid, we print an error message on stderr and exit with code 1.
40# Otherwise, we print the canonical config type on stdout and succeed.
41
42# This file is supposed to be the same for all GNU packages
43# and recognize all the CPU types, system types and aliases
44# that are meaningful with *any* GNU software.
45# Each package is responsible for reporting which valid configurations
46# it does not support. The user should be able to distinguish
47# a failure to support a valid configuration from a meaningless
48# configuration.
49
50# The goal of this file is to map all the various variations of a given
51# machine specification into a single specification in the form:
52# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
53# or in some cases, the newer four-part form:
54# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
55# It is wrong to echo any other type of specification.
56
57me=`echo "$0" | sed -e 's,.*/,,'`
58
59usage="\
60Usage: $0 [OPTION] CPU-MFR-OPSYS
61 $0 [OPTION] ALIAS
62
63Canonicalize a configuration name.
64
65Operation modes:
66 -h, --help print this help, then exit
67 -t, --time-stamp print date of last modification, then exit
68 -v, --version print version number, then exit
69
70Report bugs and patches to <config-patches@gnu.org>."
71
72version="\
73GNU config.sub ($timestamp)
74
75Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
762002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
77
78This is free software; see the source for copying conditions. There is NO
79warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
80
81help="
82Try \`$me --help' for more information."
83
84# Parse command line
85while test $# -gt 0 ; do
86 case $1 in
87 --time-stamp | --time* | -t )
88 echo "$timestamp" ; exit ;;
89 --version | -v )
90 echo "$version" ; exit ;;
91 --help | --h* | -h )
92 echo "$usage"; exit ;;
93 -- ) # Stop option processing
94 shift; break ;;
95 - ) # Use stdin as input.
96 break ;;
97 -* )
98 echo "$me: invalid option $1$help"
99 exit 1 ;;
100
101 *local*)
102 # First pass through any local machine types.
103 echo $1
104 exit ;;
105
106 * )
107 break ;;
108 esac
109done
110
111case $# in
112 0) echo "$me: missing argument$help" >&2
113 exit 1;;
114 1) ;;
115 *) echo "$me: too many arguments$help" >&2
116 exit 1;;
117esac
118
119# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
120# Here we must recognize all the valid KERNEL-OS combinations.
121maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
122case $maybe_os in
123 nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
124 uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
125 kopensolaris*-gnu* | \
126 storm-chaos* | os2-emx* | rtmk-nova*)
127 os=-$maybe_os
128 basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
129 ;;
130 *)
131 basic_machine=`echo $1 | sed 's/-[^-]*$//'`
132 if [ $basic_machine != $1 ]
133 then os=`echo $1 | sed 's/.*-/-/'`
134 else os=; fi
135 ;;
136esac
137
138### Let's recognize common machines as not being operating systems so
139### that things like config.sub decstation-3100 work. We also
140### recognize some manufacturers as not being operating systems, so we
141### can provide default operating systems below.
142case $os in
143 -sun*os*)
144 # Prevent following clause from handling this invalid input.
145 ;;
146 -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
147 -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
148 -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
149 -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
150 -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
151 -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
152 -apple | -axis | -knuth | -cray)
153 os=
154 basic_machine=$1
155 ;;
156 -bluegene*)
157 os=-cnk
158 ;;
159 -sim | -cisco | -oki | -wec | -winbond)
160 os=
161 basic_machine=$1
162 ;;
163 -scout)
164 ;;
165 -wrs)
166 os=-vxworks
167 basic_machine=$1
168 ;;
169 -chorusos*)
170 os=-chorusos
171 basic_machine=$1
172 ;;
173 -chorusrdb)
174 os=-chorusrdb
175 basic_machine=$1
176 ;;
177 -hiux*)
178 os=-hiuxwe2
179 ;;
180 -sco6)
181 os=-sco5v6
182 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
183 ;;
184 -sco5)
185 os=-sco3.2v5
186 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
187 ;;
188 -sco4)
189 os=-sco3.2v4
190 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
191 ;;
192 -sco3.2.[4-9]*)
193 os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
194 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
195 ;;
196 -sco3.2v[4-9]*)
197 # Don't forget version if it is 3.2v4 or newer.
198 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
199 ;;
200 -sco5v6*)
201 # Don't forget version if it is 3.2v4 or newer.
202 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
203 ;;
204 -sco*)
205 os=-sco3.2v2
206 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
207 ;;
208 -udk*)
209 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
210 ;;
211 -isc)
212 os=-isc2.2
213 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
214 ;;
215 -clix*)
216 basic_machine=clipper-intergraph
217 ;;
218 -isc*)
219 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
220 ;;
221 -lynx*)
222 os=-lynxos
223 ;;
224 -ptx*)
225 basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
226 ;;
227 -windowsnt*)
228 os=`echo $os | sed -e 's/windowsnt/winnt/'`
229 ;;
230 -psos*)
231 os=-psos
232 ;;
233 -mint | -mint[0-9]*)
234 basic_machine=m68k-atari
235 os=-mint
236 ;;
237esac
238
239# Decode aliases for certain CPU-COMPANY combinations.
240case $basic_machine in
241 # Recognize the basic CPU types without company name.
242 # Some are omitted here because they have special meanings below.
243 1750a | 580 \
244 | a29k \
245 | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
246 | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
247 | am33_2.0 \
248 | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
249 | bfin \
250 | c4x | clipper \
251 | d10v | d30v | dlx | dsp16xx \
252 | fido | fr30 | frv \
253 | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
254 | i370 | i860 | i960 | ia64 \
255 | ip2k | iq2000 \
256 | lm32 \
257 | m32c | m32r | m32rle | m68000 | m68k | m88k \
258 | maxq | mb | microblaze | mcore | mep | metag \
259 | mips | mipsbe | mipseb | mipsel | mipsle \
260 | mips16 \
261 | mips64 | mips64el \
262 | mips64octeon | mips64octeonel \
263 | mips64orion | mips64orionel \
264 | mips64r5900 | mips64r5900el \
265 | mips64vr | mips64vrel \
266 | mips64vr4100 | mips64vr4100el \
267 | mips64vr4300 | mips64vr4300el \
268 | mips64vr5000 | mips64vr5000el \
269 | mips64vr5900 | mips64vr5900el \
270 | mipsisa32 | mipsisa32el \
271 | mipsisa32r2 | mipsisa32r2el \
272 | mipsisa64 | mipsisa64el \
273 | mipsisa64r2 | mipsisa64r2el \
274 | mipsisa64sb1 | mipsisa64sb1el \
275 | mipsisa64sr71k | mipsisa64sr71kel \
276 | mipstx39 | mipstx39el \
277 | mn10200 | mn10300 \
278 | moxie \
279 | mt \
280 | msp430 \
281 | nios | nios2 \
282 | ns16k | ns32k \
283 | or32 \
284 | pdp10 | pdp11 | pj | pjl \
285 | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
286 | pyramid \
287 | score \
288 | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
289 | sh64 | sh64le \
290 | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
291 | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
292 | spu | strongarm \
293 | tahoe | thumb | tic4x | tic80 | tron \
294 | v850 | v850e \
295 | we32k \
296 | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
297 | z8k | z80)
298 basic_machine=$basic_machine-unknown
299 ;;
300 m6811 | m68hc11 | m6812 | m68hc12)
301 # Motorola 68HC11/12.
302 basic_machine=$basic_machine-unknown
303 os=-none
304 ;;
305 m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
306 ;;
307 ms1)
308 basic_machine=mt-unknown
309 ;;
310
311 # We use `pc' rather than `unknown'
312 # because (1) that's what they normally are, and
313 # (2) the word "unknown" tends to confuse beginning users.
314 i*86 | x86_64)
315 basic_machine=$basic_machine-pc
316 ;;
317 # Object if more than one company name word.
318 *-*-*)
319 echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
320 exit 1
321 ;;
322 # Recognize the basic CPU types with company name.
323 580-* \
324 | a29k-* \
325 | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
326 | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
327 | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
328 | arm-* | armbe-* | armle-* | armeb-* | armv*-* \
329 | avr-* | avr32-* \
330 | bfin-* | bs2000-* \
331 | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
332 | clipper-* | craynv-* | cydra-* \
333 | d10v-* | d30v-* | dlx-* \
334 | elxsi-* \
335 | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
336 | h8300-* | h8500-* \
337 | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
338 | i*86-* | i860-* | i960-* | ia64-* \
339 | ip2k-* | iq2000-* \
340 | lm32-* \
341 | m32c-* | m32r-* | m32rle-* \
342 | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
343 | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
344 | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
345 | mips16-* \
346 | mips64-* | mips64el-* \
347 | mips64octeon-* | mips64octeonel-* \
348 | mips64orion-* | mips64orionel-* \
349 | mips64r5900-* | mips64r5900el-* \
350 | mips64vr-* | mips64vrel-* \
351 | mips64vr4100-* | mips64vr4100el-* \
352 | mips64vr4300-* | mips64vr4300el-* \
353 | mips64vr5000-* | mips64vr5000el-* \
354 | mips64vr5900-* | mips64vr5900el-* \
355 | mipsisa32-* | mipsisa32el-* \
356 | mipsisa32r2-* | mipsisa32r2el-* \
357 | mipsisa64-* | mipsisa64el-* \
358 | mipsisa64r2-* | mipsisa64r2el-* \
359 | mipsisa64sb1-* | mipsisa64sb1el-* \
360 | mipsisa64sr71k-* | mipsisa64sr71kel-* \
361 | mipstx39-* | mipstx39el-* \
362 | mmix-* \
363 | mt-* \
364 | msp430-* \
365 | nios-* | nios2-* \
366 | none-* | np1-* | ns16k-* | ns32k-* \
367 | orion-* \
368 | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
369 | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
370 | pyramid-* \
371 | romp-* | rs6000-* \
372 | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
373 | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
374 | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
375 | sparclite-* \
376 | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
377 | tahoe-* | thumb-* \
378 | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \
379 | tron-* \
380 | v850-* | v850e-* | vax-* \
381 | we32k-* \
382 | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
383 | xstormy16-* | xtensa*-* \
384 | ymp-* \
385 | z8k-* | z80-*)
386 ;;
387 # Recognize the basic CPU types without company name, with glob match.
388 xtensa*)
389 basic_machine=$basic_machine-unknown
390 ;;
391 # Recognize the various machine names and aliases which stand
392 # for a CPU type and a company and sometimes even an OS.
393 386bsd)
394 basic_machine=i386-unknown
395 os=-bsd
396 ;;
397 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
398 basic_machine=m68000-att
399 ;;
400 3b*)
401 basic_machine=we32k-att
402 ;;
403 a29khif)
404 basic_machine=a29k-amd
405 os=-udi
406 ;;
407 abacus)
408 basic_machine=abacus-unknown
409 ;;
410 adobe68k)
411 basic_machine=m68010-adobe
412 os=-scout
413 ;;
414 alliant | fx80)
415 basic_machine=fx80-alliant
416 ;;
417 altos | altos3068)
418 basic_machine=m68k-altos
419 ;;
420 am29k)
421 basic_machine=a29k-none
422 os=-bsd
423 ;;
424 amd64)
425 basic_machine=x86_64-pc
426 ;;
427 amd64-*)
428 basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
429 ;;
430 amdahl)
431 basic_machine=580-amdahl
432 os=-sysv
433 ;;
434 amiga | amiga-*)
435 basic_machine=m68k-unknown
436 ;;
437 amigaos | amigados)
438 basic_machine=m68k-unknown
439 os=-amigaos
440 ;;
441 amigaunix | amix)
442 basic_machine=m68k-unknown
443 os=-sysv4
444 ;;
445 apollo68)
446 basic_machine=m68k-apollo
447 os=-sysv
448 ;;
449 apollo68bsd)
450 basic_machine=m68k-apollo
451 os=-bsd
452 ;;
453 aros)
454 basic_machine=i386-pc
455 os=-aros
456 ;;
457 aux)
458 basic_machine=m68k-apple
459 os=-aux
460 ;;
461 balance)
462 basic_machine=ns32k-sequent
463 os=-dynix
464 ;;
465 blackfin)
466 basic_machine=bfin-unknown
467 os=-linux
468 ;;
469 blackfin-*)
470 basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
471 os=-linux
472 ;;
473 bluegene*)
474 basic_machine=powerpc-ibm
475 os=-cnk
476 ;;
477 c90)
478 basic_machine=c90-cray
479 os=-unicos
480 ;;
481 cegcc)
482 basic_machine=arm-unknown
483 os=-cegcc
484 ;;
485 convex-c1)
486 basic_machine=c1-convex
487 os=-bsd
488 ;;
489 convex-c2)
490 basic_machine=c2-convex
491 os=-bsd
492 ;;
493 convex-c32)
494 basic_machine=c32-convex
495 os=-bsd
496 ;;
497 convex-c34)
498 basic_machine=c34-convex
499 os=-bsd
500 ;;
501 convex-c38)
502 basic_machine=c38-convex
503 os=-bsd
504 ;;
505 cray | j90)
506 basic_machine=j90-cray
507 os=-unicos
508 ;;
509 craynv)
510 basic_machine=craynv-cray
511 os=-unicosmp
512 ;;
513 cr16)
514 basic_machine=cr16-unknown
515 os=-elf
516 ;;
517 crds | unos)
518 basic_machine=m68k-crds
519 ;;
520 crisv32 | crisv32-* | etraxfs*)
521 basic_machine=crisv32-axis
522 ;;
523 cris | cris-* | etrax*)
524 basic_machine=cris-axis
525 ;;
526 crx)
527 basic_machine=crx-unknown
528 os=-elf
529 ;;
530 da30 | da30-*)
531 basic_machine=m68k-da30
532 ;;
533 decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
534 basic_machine=mips-dec
535 ;;
536 decsystem10* | dec10*)
537 basic_machine=pdp10-dec
538 os=-tops10
539 ;;
540 decsystem20* | dec20*)
541 basic_machine=pdp10-dec
542 os=-tops20
543 ;;
544 delta | 3300 | motorola-3300 | motorola-delta \
545 | 3300-motorola | delta-motorola)
546 basic_machine=m68k-motorola
547 ;;
548 delta88)
549 basic_machine=m88k-motorola
550 os=-sysv3
551 ;;
552 dicos)
553 basic_machine=i686-pc
554 os=-dicos
555 ;;
556 djgpp)
557 basic_machine=i586-pc
558 os=-msdosdjgpp
559 ;;
560 dpx20 | dpx20-*)
561 basic_machine=rs6000-bull
562 os=-bosx
563 ;;
564 dpx2* | dpx2*-bull)
565 basic_machine=m68k-bull
566 os=-sysv3
567 ;;
568 ebmon29k)
569 basic_machine=a29k-amd
570 os=-ebmon
571 ;;
572 elxsi)
573 basic_machine=elxsi-elxsi
574 os=-bsd
575 ;;
576 encore | umax | mmax)
577 basic_machine=ns32k-encore
578 ;;
579 es1800 | OSE68k | ose68k | ose | OSE)
580 basic_machine=m68k-ericsson
581 os=-ose
582 ;;
583 fx2800)
584 basic_machine=i860-alliant
585 ;;
586 genix)
587 basic_machine=ns32k-ns
588 ;;
589 gmicro)
590 basic_machine=tron-gmicro
591 os=-sysv
592 ;;
593 go32)
594 basic_machine=i386-pc
595 os=-go32
596 ;;
597 h3050r* | hiux*)
598 basic_machine=hppa1.1-hitachi
599 os=-hiuxwe2
600 ;;
601 h8300hms)
602 basic_machine=h8300-hitachi
603 os=-hms
604 ;;
605 h8300xray)
606 basic_machine=h8300-hitachi
607 os=-xray
608 ;;
609 h8500hms)
610 basic_machine=h8500-hitachi
611 os=-hms
612 ;;
613 harris)
614 basic_machine=m88k-harris
615 os=-sysv3
616 ;;
617 hp300-*)
618 basic_machine=m68k-hp
619 ;;
620 hp300bsd)
621 basic_machine=m68k-hp
622 os=-bsd
623 ;;
624 hp300hpux)
625 basic_machine=m68k-hp
626 os=-hpux
627 ;;
628 hp3k9[0-9][0-9] | hp9[0-9][0-9])
629 basic_machine=hppa1.0-hp
630 ;;
631 hp9k2[0-9][0-9] | hp9k31[0-9])
632 basic_machine=m68000-hp
633 ;;
634 hp9k3[2-9][0-9])
635 basic_machine=m68k-hp
636 ;;
637 hp9k6[0-9][0-9] | hp6[0-9][0-9])
638 basic_machine=hppa1.0-hp
639 ;;
640 hp9k7[0-79][0-9] | hp7[0-79][0-9])
641 basic_machine=hppa1.1-hp
642 ;;
643 hp9k78[0-9] | hp78[0-9])
644 # FIXME: really hppa2.0-hp
645 basic_machine=hppa1.1-hp
646 ;;
647 hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
648 # FIXME: really hppa2.0-hp
649 basic_machine=hppa1.1-hp
650 ;;
651 hp9k8[0-9][13679] | hp8[0-9][13679])
652 basic_machine=hppa1.1-hp
653 ;;
654 hp9k8[0-9][0-9] | hp8[0-9][0-9])
655 basic_machine=hppa1.0-hp
656 ;;
657 hppa-next)
658 os=-nextstep3
659 ;;
660 hppaosf)
661 basic_machine=hppa1.1-hp
662 os=-osf
663 ;;
664 hppro)
665 basic_machine=hppa1.1-hp
666 os=-proelf
667 ;;
668 i370-ibm* | ibm*)
669 basic_machine=i370-ibm
670 ;;
671# I'm not sure what "Sysv32" means. Should this be sysv3.2?
672 i*86v32)
673 basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
674 os=-sysv32
675 ;;
676 i*86v4*)
677 basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
678 os=-sysv4
679 ;;
680 i*86v)
681 basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
682 os=-sysv
683 ;;
684 i*86sol2)
685 basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
686 os=-solaris2
687 ;;
688 i386mach)
689 basic_machine=i386-mach
690 os=-mach
691 ;;
692 i386-vsta | vsta)
693 basic_machine=i386-unknown
694 os=-vsta
695 ;;
696 iris | iris4d)
697 basic_machine=mips-sgi
698 case $os in
699 -irix*)
700 ;;
701 *)
702 os=-irix4
703 ;;
704 esac
705 ;;
706 isi68 | isi)
707 basic_machine=m68k-isi
708 os=-sysv
709 ;;
710 m68knommu)
711 basic_machine=m68k-unknown
712 os=-linux
713 ;;
714 m68knommu-*)
715 basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
716 os=-linux
717 ;;
718 m88k-omron*)
719 basic_machine=m88k-omron
720 ;;
721 magnum | m3230)
722 basic_machine=mips-mips
723 os=-sysv
724 ;;
725 merlin)
726 basic_machine=ns32k-utek
727 os=-sysv
728 ;;
729 mingw32)
730 basic_machine=i386-pc
731 os=-mingw32
732 ;;
733 mingw32ce)
734 basic_machine=arm-unknown
735 os=-mingw32ce
736 ;;
737 miniframe)
738 basic_machine=m68000-convergent
739 ;;
740 *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
741 basic_machine=m68k-atari
742 os=-mint
743 ;;
744 mips3*-*)
745 basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
746 ;;
747 mips3*)
748 basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
749 ;;
750 monitor)
751 basic_machine=m68k-rom68k
752 os=-coff
753 ;;
754 morphos)
755 basic_machine=powerpc-unknown
756 os=-morphos
757 ;;
758 msdos)
759 basic_machine=i386-pc
760 os=-msdos
761 ;;
762 ms1-*)
763 basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
764 ;;
765 mvs)
766 basic_machine=i370-ibm
767 os=-mvs
768 ;;
769 ncr3000)
770 basic_machine=i486-ncr
771 os=-sysv4
772 ;;
773 netbsd386)
774 basic_machine=i386-unknown
775 os=-netbsd
776 ;;
777 netwinder)
778 basic_machine=armv4l-rebel
779 os=-linux
780 ;;
781 news | news700 | news800 | news900)
782 basic_machine=m68k-sony
783 os=-newsos
784 ;;
785 news1000)
786 basic_machine=m68030-sony
787 os=-newsos
788 ;;
789 news-3600 | risc-news)
790 basic_machine=mips-sony
791 os=-newsos
792 ;;
793 necv70)
794 basic_machine=v70-nec
795 os=-sysv
796 ;;
797 next | m*-next )
798 basic_machine=m68k-next
799 case $os in
800 -nextstep* )
801 ;;
802 -ns2*)
803 os=-nextstep2
804 ;;
805 *)
806 os=-nextstep3
807 ;;
808 esac
809 ;;
810 nh3000)
811 basic_machine=m68k-harris
812 os=-cxux
813 ;;
814 nh[45]000)
815 basic_machine=m88k-harris
816 os=-cxux
817 ;;
818 nindy960)
819 basic_machine=i960-intel
820 os=-nindy
821 ;;
822 mon960)
823 basic_machine=i960-intel
824 os=-mon960
825 ;;
826 nonstopux)
827 basic_machine=mips-compaq
828 os=-nonstopux
829 ;;
830 np1)
831 basic_machine=np1-gould
832 ;;
833 nsr-tandem)
834 basic_machine=nsr-tandem
835 ;;
836 op50n-* | op60c-*)
837 basic_machine=hppa1.1-oki
838 os=-proelf
839 ;;
840 openrisc | openrisc-*)
841 basic_machine=or32-unknown
842 ;;
843 os400)
844 basic_machine=powerpc-ibm
845 os=-os400
846 ;;
847 OSE68000 | ose68000)
848 basic_machine=m68000-ericsson
849 os=-ose
850 ;;
851 os68k)
852 basic_machine=m68k-none
853 os=-os68k
854 ;;
855 pa-hitachi)
856 basic_machine=hppa1.1-hitachi
857 os=-hiuxwe2
858 ;;
859 paragon)
860 basic_machine=i860-intel
861 os=-osf
862 ;;
863 parisc)
864 basic_machine=hppa-unknown
865 os=-linux
866 ;;
867 parisc-*)
868 basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
869 os=-linux
870 ;;
871 pbd)
872 basic_machine=sparc-tti
873 ;;
874 pbb)
875 basic_machine=m68k-tti
876 ;;
877 pc532 | pc532-*)
878 basic_machine=ns32k-pc532
879 ;;
880 pc98)
881 basic_machine=i386-pc
882 ;;
883 pc98-*)
884 basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
885 ;;
886 pentium | p5 | k5 | k6 | nexgen | viac3)
887 basic_machine=i586-pc
888 ;;
889 pentiumpro | p6 | 6x86 | athlon | athlon_*)
890 basic_machine=i686-pc
891 ;;
892 pentiumii | pentium2 | pentiumiii | pentium3)
893 basic_machine=i686-pc
894 ;;
895 pentium4)
896 basic_machine=i786-pc
897 ;;
898 pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
899 basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
900 ;;
901 pentiumpro-* | p6-* | 6x86-* | athlon-*)
902 basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
903 ;;
904 pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
905 basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
906 ;;
907 pentium4-*)
908 basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
909 ;;
910 pn)
911 basic_machine=pn-gould
912 ;;
913 power) basic_machine=power-ibm
914 ;;
915 ppc) basic_machine=powerpc-unknown
916 ;;
917 ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
918 ;;
919 ppcle | powerpclittle | ppc-le | powerpc-little)
920 basic_machine=powerpcle-unknown
921 ;;
922 ppcle-* | powerpclittle-*)
923 basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
924 ;;
925 ppc64) basic_machine=powerpc64-unknown
926 ;;
927 ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
928 ;;
929 ppc64le | powerpc64little | ppc64-le | powerpc64-little)
930 basic_machine=powerpc64le-unknown
931 ;;
932 ppc64le-* | powerpc64little-*)
933 basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
934 ;;
935 ps2)
936 basic_machine=i386-ibm
937 ;;
938 pw32)
939 basic_machine=i586-unknown
940 os=-pw32
941 ;;
942 rdos)
943 basic_machine=i386-pc
944 os=-rdos
945 ;;
946 rom68k)
947 basic_machine=m68k-rom68k
948 os=-coff
949 ;;
950 rm[46]00)
951 basic_machine=mips-siemens
952 ;;
953 rtpc | rtpc-*)
954 basic_machine=romp-ibm
955 ;;
956 s390 | s390-*)
957 basic_machine=s390-ibm
958 ;;
959 s390x | s390x-*)
960 basic_machine=s390x-ibm
961 ;;
962 sa29200)
963 basic_machine=a29k-amd
964 os=-udi
965 ;;
966 sb1)
967 basic_machine=mipsisa64sb1-unknown
968 ;;
969 sb1el)
970 basic_machine=mipsisa64sb1el-unknown
971 ;;
972 sde)
973 basic_machine=mipsisa32-sde
974 os=-elf
975 ;;
976 sei)
977 basic_machine=mips-sei
978 os=-seiux
979 ;;
980 sequent)
981 basic_machine=i386-sequent
982 ;;
983 sh)
984 basic_machine=sh-hitachi
985 os=-hms
986 ;;
987 sh5el)
988 basic_machine=sh5le-unknown
989 ;;
990 sh64)
991 basic_machine=sh64-unknown
992 ;;
993 sparclite-wrs | simso-wrs)
994 basic_machine=sparclite-wrs
995 os=-vxworks
996 ;;
997 sps7)
998 basic_machine=m68k-bull
999 os=-sysv2
1000 ;;
1001 spur)
1002 basic_machine=spur-unknown
1003 ;;
1004 st2000)
1005 basic_machine=m68k-tandem
1006 ;;
1007 stratus)
1008 basic_machine=i860-stratus
1009 os=-sysv4
1010 ;;
1011 sun2)
1012 basic_machine=m68000-sun
1013 ;;
1014 sun2os3)
1015 basic_machine=m68000-sun
1016 os=-sunos3
1017 ;;
1018 sun2os4)
1019 basic_machine=m68000-sun
1020 os=-sunos4
1021 ;;
1022 sun3os3)
1023 basic_machine=m68k-sun
1024 os=-sunos3
1025 ;;
1026 sun3os4)
1027 basic_machine=m68k-sun
1028 os=-sunos4
1029 ;;
1030 sun4os3)
1031 basic_machine=sparc-sun
1032 os=-sunos3
1033 ;;
1034 sun4os4)
1035 basic_machine=sparc-sun
1036 os=-sunos4
1037 ;;
1038 sun4sol2)
1039 basic_machine=sparc-sun
1040 os=-solaris2
1041 ;;
1042 sun3 | sun3-*)
1043 basic_machine=m68k-sun
1044 ;;
1045 sun4)
1046 basic_machine=sparc-sun
1047 ;;
1048 sun386 | sun386i | roadrunner)
1049 basic_machine=i386-sun
1050 ;;
1051 sv1)
1052 basic_machine=sv1-cray
1053 os=-unicos
1054 ;;
1055 symmetry)
1056 basic_machine=i386-sequent
1057 os=-dynix
1058 ;;
1059 t3e)
1060 basic_machine=alphaev5-cray
1061 os=-unicos
1062 ;;
1063 t90)
1064 basic_machine=t90-cray
1065 os=-unicos
1066 ;;
1067 tic54x | c54x*)
1068 basic_machine=tic54x-unknown
1069 os=-coff
1070 ;;
1071 tic55x | c55x*)
1072 basic_machine=tic55x-unknown
1073 os=-coff
1074 ;;
1075 tic6x | c6x*)
1076 basic_machine=tic6x-unknown
1077 os=-coff
1078 ;;
1079 tile*)
1080 basic_machine=tile-unknown
1081 os=-linux-gnu
1082 ;;
1083 tx39)
1084 basic_machine=mipstx39-unknown
1085 ;;
1086 tx39el)
1087 basic_machine=mipstx39el-unknown
1088 ;;
1089 toad1)
1090 basic_machine=pdp10-xkl
1091 os=-tops20
1092 ;;
1093 tower | tower-32)
1094 basic_machine=m68k-ncr
1095 ;;
1096 tpf)
1097 basic_machine=s390x-ibm
1098 os=-tpf
1099 ;;
1100 udi29k)
1101 basic_machine=a29k-amd
1102 os=-udi
1103 ;;
1104 ultra3)
1105 basic_machine=a29k-nyu
1106 os=-sym1
1107 ;;
1108 v810 | necv810)
1109 basic_machine=v810-nec
1110 os=-none
1111 ;;
1112 vaxv)
1113 basic_machine=vax-dec
1114 os=-sysv
1115 ;;
1116 vms)
1117 basic_machine=vax-dec
1118 os=-vms
1119 ;;
1120 vpp*|vx|vx-*)
1121 basic_machine=f301-fujitsu
1122 ;;
1123 vxworks960)
1124 basic_machine=i960-wrs
1125 os=-vxworks
1126 ;;
1127 vxworks68)
1128 basic_machine=m68k-wrs
1129 os=-vxworks
1130 ;;
1131 vxworks29k)
1132 basic_machine=a29k-wrs
1133 os=-vxworks
1134 ;;
1135 w65*)
1136 basic_machine=w65-wdc
1137 os=-none
1138 ;;
1139 w89k-*)
1140 basic_machine=hppa1.1-winbond
1141 os=-proelf
1142 ;;
1143 xbox)
1144 basic_machine=i686-pc
1145 os=-mingw32
1146 ;;
1147 xps | xps100)
1148 basic_machine=xps100-honeywell
1149 ;;
1150 ymp)
1151 basic_machine=ymp-cray
1152 os=-unicos
1153 ;;
1154 z8k-*-coff)
1155 basic_machine=z8k-unknown
1156 os=-sim
1157 ;;
1158 z80-*-coff)
1159 basic_machine=z80-unknown
1160 os=-sim
1161 ;;
1162 none)
1163 basic_machine=none-none
1164 os=-none
1165 ;;
1166
1167# Here we handle the default manufacturer of certain CPU types. It is in
1168# some cases the only manufacturer, in others, it is the most popular.
1169 w89k)
1170 basic_machine=hppa1.1-winbond
1171 ;;
1172 op50n)
1173 basic_machine=hppa1.1-oki
1174 ;;
1175 op60c)
1176 basic_machine=hppa1.1-oki
1177 ;;
1178 romp)
1179 basic_machine=romp-ibm
1180 ;;
1181 mmix)
1182 basic_machine=mmix-knuth
1183 ;;
1184 rs6000)
1185 basic_machine=rs6000-ibm
1186 ;;
1187 vax)
1188 basic_machine=vax-dec
1189 ;;
1190 pdp10)
1191 # there are many clones, so DEC is not a safe bet
1192 basic_machine=pdp10-unknown
1193 ;;
1194 pdp11)
1195 basic_machine=pdp11-dec
1196 ;;
1197 we32k)
1198 basic_machine=we32k-att
1199 ;;
1200 sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
1201 basic_machine=sh-unknown
1202 ;;
1203 sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
1204 basic_machine=sparc-sun
1205 ;;
1206 cydra)
1207 basic_machine=cydra-cydrome
1208 ;;
1209 orion)
1210 basic_machine=orion-highlevel
1211 ;;
1212 orion105)
1213 basic_machine=clipper-highlevel
1214 ;;
1215 mac | mpw | mac-mpw)
1216 basic_machine=m68k-apple
1217 ;;
1218 pmac | pmac-mpw)
1219 basic_machine=powerpc-apple
1220 ;;
1221 *-unknown)
1222 # Make sure to match an already-canonicalized machine name.
1223 ;;
1224 *)
1225 echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
1226 exit 1
1227 ;;
1228esac
1229
1230# Here we canonicalize certain aliases for manufacturers.
1231case $basic_machine in
1232 *-digital*)
1233 basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
1234 ;;
1235 *-commodore*)
1236 basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
1237 ;;
1238 *)
1239 ;;
1240esac
1241
1242# Decode manufacturer-specific aliases for certain operating systems.
1243
1244if [ x"$os" != x"" ]
1245then
1246case $os in
1247 # First match some system type aliases
1248 # that might get confused with valid system types.
1249 # -solaris* is a basic system type, with this one exception.
1250 -solaris1 | -solaris1.*)
1251 os=`echo $os | sed -e 's|solaris1|sunos4|'`
1252 ;;
1253 -solaris)
1254 os=-solaris2
1255 ;;
1256 -svr4*)
1257 os=-sysv4
1258 ;;
1259 -unixware*)
1260 os=-sysv4.2uw
1261 ;;
1262 -gnu/linux*)
1263 os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
1264 ;;
1265 # First accept the basic system types.
1266 # The portable systems comes first.
1267 # Each alternative MUST END IN A *, to match a version number.
1268 # -sysv* is not here because it comes later, after sysvr4.
1269 -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
1270 | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
1271 | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
1272 | -kopensolaris* \
1273 | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
1274 | -aos* | -aros* \
1275 | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
1276 | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
1277 | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
1278 | -openbsd* | -solidbsd* \
1279 | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
1280 | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
1281 | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
1282 | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
1283 | -chorusos* | -chorusrdb* | -cegcc* \
1284 | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
1285 | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
1286 | -uxpv* | -beos* | -mpeix* | -udk* \
1287 | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
1288 | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
1289 | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
1290 | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
1291 | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
1292 | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
1293 | -skyos* | -haiku* | -rdos* | -toppers* | -drops*)
1294 # Remember, each alternative MUST END IN *, to match a version number.
1295 ;;
1296 -qnx*)
1297 case $basic_machine in
1298 x86-* | i*86-*)
1299 ;;
1300 *)
1301 os=-nto$os
1302 ;;
1303 esac
1304 ;;
1305 -nto-qnx*)
1306 ;;
1307 -nto*)
1308 os=`echo $os | sed -e 's|nto|nto-qnx|'`
1309 ;;
1310 -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
1311 | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
1312 | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
1313 ;;
1314 -mac*)
1315 os=`echo $os | sed -e 's|mac|macos|'`
1316 ;;
1317 -linux-dietlibc)
1318 os=-linux-dietlibc
1319 ;;
1320 -linux*)
1321 os=`echo $os | sed -e 's|linux|linux-gnu|'`
1322 ;;
1323 -sunos5*)
1324 os=`echo $os | sed -e 's|sunos5|solaris2|'`
1325 ;;
1326 -sunos6*)
1327 os=`echo $os | sed -e 's|sunos6|solaris3|'`
1328 ;;
1329 -opened*)
1330 os=-openedition
1331 ;;
1332 -os400*)
1333 os=-os400
1334 ;;
1335 -wince*)
1336 os=-wince
1337 ;;
1338 -osfrose*)
1339 os=-osfrose
1340 ;;
1341 -osf*)
1342 os=-osf
1343 ;;
1344 -utek*)
1345 os=-bsd
1346 ;;
1347 -dynix*)
1348 os=-bsd
1349 ;;
1350 -acis*)
1351 os=-aos
1352 ;;
1353 -atheos*)
1354 os=-atheos
1355 ;;
1356 -syllable*)
1357 os=-syllable
1358 ;;
1359 -386bsd)
1360 os=-bsd
1361 ;;
1362 -ctix* | -uts*)
1363 os=-sysv
1364 ;;
1365 -nova*)
1366 os=-rtmk-nova
1367 ;;
1368 -ns2 )
1369 os=-nextstep2
1370 ;;
1371 -nsk*)
1372 os=-nsk
1373 ;;
1374 # Preserve the version number of sinix5.
1375 -sinix5.*)
1376 os=`echo $os | sed -e 's|sinix|sysv|'`
1377 ;;
1378 -sinix*)
1379 os=-sysv4
1380 ;;
1381 -tpf*)
1382 os=-tpf
1383 ;;
1384 -triton*)
1385 os=-sysv3
1386 ;;
1387 -oss*)
1388 os=-sysv3
1389 ;;
1390 -svr4)
1391 os=-sysv4
1392 ;;
1393 -svr3)
1394 os=-sysv3
1395 ;;
1396 -sysvr4)
1397 os=-sysv4
1398 ;;
1399 # This must come after -sysvr4.
1400 -sysv*)
1401 ;;
1402 -ose*)
1403 os=-ose
1404 ;;
1405 -es1800*)
1406 os=-ose
1407 ;;
1408 -xenix)
1409 os=-xenix
1410 ;;
1411 -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
1412 os=-mint
1413 ;;
1414 -aros*)
1415 os=-aros
1416 ;;
1417 -kaos*)
1418 os=-kaos
1419 ;;
1420 -zvmoe)
1421 os=-zvmoe
1422 ;;
1423 -dicos*)
1424 os=-dicos
1425 ;;
1426 -none)
1427 ;;
1428 *)
1429 # Get rid of the `-' at the beginning of $os.
1430 os=`echo $os | sed 's/[^-]*-//'`
1431 echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
1432 exit 1
1433 ;;
1434esac
1435else
1436
1437# Here we handle the default operating systems that come with various machines.
1438# The value should be what the vendor currently ships out the door with their
1439# machine or put another way, the most popular os provided with the machine.
1440
1441# Note that if you're going to try to match "-MANUFACTURER" here (say,
1442# "-sun"), then you have to tell the case statement up towards the top
1443# that MANUFACTURER isn't an operating system. Otherwise, code above
1444# will signal an error saying that MANUFACTURER isn't an operating
1445# system, and we'll never get to this point.
1446
1447case $basic_machine in
1448 score-*)
1449 os=-elf
1450 ;;
1451 spu-*)
1452 os=-elf
1453 ;;
1454 *-acorn)
1455 os=-riscix1.2
1456 ;;
1457 arm*-rebel)
1458 os=-linux
1459 ;;
1460 arm*-semi)
1461 os=-aout
1462 ;;
1463 c4x-* | tic4x-*)
1464 os=-coff
1465 ;;
1466 # This must come before the *-dec entry.
1467 pdp10-*)
1468 os=-tops20
1469 ;;
1470 pdp11-*)
1471 os=-none
1472 ;;
1473 *-dec | vax-*)
1474 os=-ultrix4.2
1475 ;;
1476 m68*-apollo)
1477 os=-domain
1478 ;;
1479 i386-sun)
1480 os=-sunos4.0.2
1481 ;;
1482 m68000-sun)
1483 os=-sunos3
1484 # This also exists in the configure program, but was not the
1485 # default.
1486 # os=-sunos4
1487 ;;
1488 m68*-cisco)
1489 os=-aout
1490 ;;
1491 mep-*)
1492 os=-elf
1493 ;;
1494 mips*-cisco)
1495 os=-elf
1496 ;;
1497 mips*-*)
1498 os=-elf
1499 ;;
1500 or32-*)
1501 os=-coff
1502 ;;
1503 *-tti) # must be before sparc entry or we get the wrong os.
1504 os=-sysv3
1505 ;;
1506 sparc-* | *-sun)
1507 os=-sunos4.1.1
1508 ;;
1509 *-be)
1510 os=-beos
1511 ;;
1512 *-haiku)
1513 os=-haiku
1514 ;;
1515 *-ibm)
1516 os=-aix
1517 ;;
1518 *-knuth)
1519 os=-mmixware
1520 ;;
1521 *-wec)
1522 os=-proelf
1523 ;;
1524 *-winbond)
1525 os=-proelf
1526 ;;
1527 *-oki)
1528 os=-proelf
1529 ;;
1530 *-hp)
1531 os=-hpux
1532 ;;
1533 *-hitachi)
1534 os=-hiux
1535 ;;
1536 i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
1537 os=-sysv
1538 ;;
1539 *-cbm)
1540 os=-amigaos
1541 ;;
1542 *-dg)
1543 os=-dgux
1544 ;;
1545 *-dolphin)
1546 os=-sysv3
1547 ;;
1548 m68k-ccur)
1549 os=-rtu
1550 ;;
1551 m88k-omron*)
1552 os=-luna
1553 ;;
1554 *-next )
1555 os=-nextstep
1556 ;;
1557 *-sequent)
1558 os=-ptx
1559 ;;
1560 *-crds)
1561 os=-unos
1562 ;;
1563 *-ns)
1564 os=-genix
1565 ;;
1566 i370-*)
1567 os=-mvs
1568 ;;
1569 *-next)
1570 os=-nextstep3
1571 ;;
1572 *-gould)
1573 os=-sysv
1574 ;;
1575 *-highlevel)
1576 os=-bsd
1577 ;;
1578 *-encore)
1579 os=-bsd
1580 ;;
1581 *-sgi)
1582 os=-irix
1583 ;;
1584 *-siemens)
1585 os=-sysv4
1586 ;;
1587 *-masscomp)
1588 os=-rtu
1589 ;;
1590 f30[01]-fujitsu | f700-fujitsu)
1591 os=-uxpv
1592 ;;
1593 *-rom68k)
1594 os=-coff
1595 ;;
1596 *-*bug)
1597 os=-coff
1598 ;;
1599 *-apple)
1600 os=-macos
1601 ;;
1602 *-atari*)
1603 os=-mint
1604 ;;
1605 *)
1606 os=-none
1607 ;;
1608esac
1609fi
1610
1611# Here we handle the case where we know the os, and the CPU type, but not the
1612# manufacturer. We pick the logical manufacturer.
1613vendor=unknown
1614case $basic_machine in
1615 *-unknown)
1616 case $os in
1617 -riscix*)
1618 vendor=acorn
1619 ;;
1620 -sunos*)
1621 vendor=sun
1622 ;;
1623 -cnk*|-aix*)
1624 vendor=ibm
1625 ;;
1626 -beos*)
1627 vendor=be
1628 ;;
1629 -hpux*)
1630 vendor=hp
1631 ;;
1632 -mpeix*)
1633 vendor=hp
1634 ;;
1635 -hiux*)
1636 vendor=hitachi
1637 ;;
1638 -unos*)
1639 vendor=crds
1640 ;;
1641 -dgux*)
1642 vendor=dg
1643 ;;
1644 -luna*)
1645 vendor=omron
1646 ;;
1647 -genix*)
1648 vendor=ns
1649 ;;
1650 -mvs* | -opened*)
1651 vendor=ibm
1652 ;;
1653 -os400*)
1654 vendor=ibm
1655 ;;
1656 -ptx*)
1657 vendor=sequent
1658 ;;
1659 -tpf*)
1660 vendor=ibm
1661 ;;
1662 -vxsim* | -vxworks* | -windiss*)
1663 vendor=wrs
1664 ;;
1665 -aux*)
1666 vendor=apple
1667 ;;
1668 -hms*)
1669 vendor=hitachi
1670 ;;
1671 -mpw* | -macos*)
1672 vendor=apple
1673 ;;
1674 -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
1675 vendor=atari
1676 ;;
1677 -vos*)
1678 vendor=stratus
1679 ;;
1680 esac
1681 basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
1682 ;;
1683esac
1684
1685echo $basic_machine$os
1686exit
1687
1688# Local variables:
1689# eval: (add-hook 'write-file-hooks 'time-stamp)
1690# time-stamp-start: "timestamp='"
1691# time-stamp-format: "%:y-%02m-%02d"
1692# time-stamp-end: "'"
1693# End:
diff --git a/autogen/copy_autogen b/autogen/copy_autogen
index 2096636c38b..a0daf9f02e5 100755
--- a/autogen/copy_autogen
+++ b/autogen/copy_autogen
@@ -16,6 +16,7 @@ if test ! -e config.in; then
16fi 16fi
17 17
18## Order implied by top-level Makefile's rules, for time-stamps. 18## Order implied by top-level Makefile's rules, for time-stamps.
19cp compile config.guess config.sub depcomp install-sh missing ../
19cp aclocal.m4 ../ 20cp aclocal.m4 ../
20cp configure ../ 21cp configure ../
21touch ../src/stamp-h.in 22touch ../src/stamp-h.in
diff --git a/autogen/depcomp b/autogen/depcomp
new file mode 100755
index 00000000000..df8eea7e4ce
--- /dev/null
+++ b/autogen/depcomp
@@ -0,0 +1,630 @@
1#! /bin/sh
2# depcomp - compile a program generating dependencies as side-effects
3
4scriptversion=2009-04-28.21; # UTC
5
6# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009 Free
7# Software Foundation, Inc.
8
9# This program is free software; you can redistribute it and/or modify
10# it under the terms of the GNU General Public License as published by
11# the Free Software Foundation; either version 2, or (at your option)
12# any later version.
13
14# This program is distributed in the hope that it will be useful,
15# but WITHOUT ANY WARRANTY; without even the implied warranty of
16# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17# GNU General Public License for more details.
18
19# You should have received a copy of the GNU General Public License
20# along with this program. If not, see <http://www.gnu.org/licenses/>.
21
22# As a special exception to the GNU General Public License, if you
23# distribute this file as part of a program that contains a
24# configuration script generated by Autoconf, you may include it under
25# the same distribution terms that you use for the rest of that program.
26
27# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
28
29case $1 in
30 '')
31 echo "$0: No command. Try \`$0 --help' for more information." 1>&2
32 exit 1;
33 ;;
34 -h | --h*)
35 cat <<\EOF
36Usage: depcomp [--help] [--version] PROGRAM [ARGS]
37
38Run PROGRAMS ARGS to compile a file, generating dependencies
39as side-effects.
40
41Environment variables:
42 depmode Dependency tracking mode.
43 source Source file read by `PROGRAMS ARGS'.
44 object Object file output by `PROGRAMS ARGS'.
45 DEPDIR directory where to store dependencies.
46 depfile Dependency file to output.
47 tmpdepfile Temporary file to use when outputing dependencies.
48 libtool Whether libtool is used (yes/no).
49
50Report bugs to <bug-automake@gnu.org>.
51EOF
52 exit $?
53 ;;
54 -v | --v*)
55 echo "depcomp $scriptversion"
56 exit $?
57 ;;
58esac
59
60if test -z "$depmode" || test -z "$source" || test -z "$object"; then
61 echo "depcomp: Variables source, object and depmode must be set" 1>&2
62 exit 1
63fi
64
65# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
66depfile=${depfile-`echo "$object" |
67 sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
68tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
69
70rm -f "$tmpdepfile"
71
72# Some modes work just like other modes, but use different flags. We
73# parameterize here, but still list the modes in the big case below,
74# to make depend.m4 easier to write. Note that we *cannot* use a case
75# here, because this file can only contain one case statement.
76if test "$depmode" = hp; then
77 # HP compiler uses -M and no extra arg.
78 gccflag=-M
79 depmode=gcc
80fi
81
82if test "$depmode" = dashXmstdout; then
83 # This is just like dashmstdout with a different argument.
84 dashmflag=-xM
85 depmode=dashmstdout
86fi
87
88cygpath_u="cygpath -u -f -"
89if test "$depmode" = msvcmsys; then
90 # This is just like msvisualcpp but w/o cygpath translation.
91 # Just convert the backslash-escaped backslashes to single forward
92 # slashes to satisfy depend.m4
93 cygpath_u="sed s,\\\\\\\\,/,g"
94 depmode=msvisualcpp
95fi
96
97case "$depmode" in
98gcc3)
99## gcc 3 implements dependency tracking that does exactly what
100## we want. Yay! Note: for some reason libtool 1.4 doesn't like
101## it if -MD -MP comes after the -MF stuff. Hmm.
102## Unfortunately, FreeBSD c89 acceptance of flags depends upon
103## the command line argument order; so add the flags where they
104## appear in depend2.am. Note that the slowdown incurred here
105## affects only configure: in makefiles, %FASTDEP% shortcuts this.
106 for arg
107 do
108 case $arg in
109 -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
110 *) set fnord "$@" "$arg" ;;
111 esac
112 shift # fnord
113 shift # $arg
114 done
115 "$@"
116 stat=$?
117 if test $stat -eq 0; then :
118 else
119 rm -f "$tmpdepfile"
120 exit $stat
121 fi
122 mv "$tmpdepfile" "$depfile"
123 ;;
124
125gcc)
126## There are various ways to get dependency output from gcc. Here's
127## why we pick this rather obscure method:
128## - Don't want to use -MD because we'd like the dependencies to end
129## up in a subdir. Having to rename by hand is ugly.
130## (We might end up doing this anyway to support other compilers.)
131## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
132## -MM, not -M (despite what the docs say).
133## - Using -M directly means running the compiler twice (even worse
134## than renaming).
135 if test -z "$gccflag"; then
136 gccflag=-MD,
137 fi
138 "$@" -Wp,"$gccflag$tmpdepfile"
139 stat=$?
140 if test $stat -eq 0; then :
141 else
142 rm -f "$tmpdepfile"
143 exit $stat
144 fi
145 rm -f "$depfile"
146 echo "$object : \\" > "$depfile"
147 alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
148## The second -e expression handles DOS-style file names with drive letters.
149 sed -e 's/^[^:]*: / /' \
150 -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
151## This next piece of magic avoids the `deleted header file' problem.
152## The problem is that when a header file which appears in a .P file
153## is deleted, the dependency causes make to die (because there is
154## typically no way to rebuild the header). We avoid this by adding
155## dummy dependencies for each header file. Too bad gcc doesn't do
156## this for us directly.
157 tr ' ' '
158' < "$tmpdepfile" |
159## Some versions of gcc put a space before the `:'. On the theory
160## that the space means something, we add a space to the output as
161## well.
162## Some versions of the HPUX 10.20 sed can't process this invocation
163## correctly. Breaking it into two sed invocations is a workaround.
164 sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
165 rm -f "$tmpdepfile"
166 ;;
167
168hp)
169 # This case exists only to let depend.m4 do its work. It works by
170 # looking at the text of this script. This case will never be run,
171 # since it is checked for above.
172 exit 1
173 ;;
174
175sgi)
176 if test "$libtool" = yes; then
177 "$@" "-Wp,-MDupdate,$tmpdepfile"
178 else
179 "$@" -MDupdate "$tmpdepfile"
180 fi
181 stat=$?
182 if test $stat -eq 0; then :
183 else
184 rm -f "$tmpdepfile"
185 exit $stat
186 fi
187 rm -f "$depfile"
188
189 if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
190 echo "$object : \\" > "$depfile"
191
192 # Clip off the initial element (the dependent). Don't try to be
193 # clever and replace this with sed code, as IRIX sed won't handle
194 # lines with more than a fixed number of characters (4096 in
195 # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
196 # the IRIX cc adds comments like `#:fec' to the end of the
197 # dependency line.
198 tr ' ' '
199' < "$tmpdepfile" \
200 | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
201 tr '
202' ' ' >> "$depfile"
203 echo >> "$depfile"
204
205 # The second pass generates a dummy entry for each header file.
206 tr ' ' '
207' < "$tmpdepfile" \
208 | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
209 >> "$depfile"
210 else
211 # The sourcefile does not contain any dependencies, so just
212 # store a dummy comment line, to avoid errors with the Makefile
213 # "include basename.Plo" scheme.
214 echo "#dummy" > "$depfile"
215 fi
216 rm -f "$tmpdepfile"
217 ;;
218
219aix)
220 # The C for AIX Compiler uses -M and outputs the dependencies
221 # in a .u file. In older versions, this file always lives in the
222 # current directory. Also, the AIX compiler puts `$object:' at the
223 # start of each line; $object doesn't have directory information.
224 # Version 6 uses the directory in both cases.
225 dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
226 test "x$dir" = "x$object" && dir=
227 base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
228 if test "$libtool" = yes; then
229 tmpdepfile1=$dir$base.u
230 tmpdepfile2=$base.u
231 tmpdepfile3=$dir.libs/$base.u
232 "$@" -Wc,-M
233 else
234 tmpdepfile1=$dir$base.u
235 tmpdepfile2=$dir$base.u
236 tmpdepfile3=$dir$base.u
237 "$@" -M
238 fi
239 stat=$?
240
241 if test $stat -eq 0; then :
242 else
243 rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
244 exit $stat
245 fi
246
247 for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
248 do
249 test -f "$tmpdepfile" && break
250 done
251 if test -f "$tmpdepfile"; then
252 # Each line is of the form `foo.o: dependent.h'.
253 # Do two passes, one to just change these to
254 # `$object: dependent.h' and one to simply `dependent.h:'.
255 sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
256 # That's a tab and a space in the [].
257 sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
258 else
259 # The sourcefile does not contain any dependencies, so just
260 # store a dummy comment line, to avoid errors with the Makefile
261 # "include basename.Plo" scheme.
262 echo "#dummy" > "$depfile"
263 fi
264 rm -f "$tmpdepfile"
265 ;;
266
267icc)
268 # Intel's C compiler understands `-MD -MF file'. However on
269 # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
270 # ICC 7.0 will fill foo.d with something like
271 # foo.o: sub/foo.c
272 # foo.o: sub/foo.h
273 # which is wrong. We want:
274 # sub/foo.o: sub/foo.c
275 # sub/foo.o: sub/foo.h
276 # sub/foo.c:
277 # sub/foo.h:
278 # ICC 7.1 will output
279 # foo.o: sub/foo.c sub/foo.h
280 # and will wrap long lines using \ :
281 # foo.o: sub/foo.c ... \
282 # sub/foo.h ... \
283 # ...
284
285 "$@" -MD -MF "$tmpdepfile"
286 stat=$?
287 if test $stat -eq 0; then :
288 else
289 rm -f "$tmpdepfile"
290 exit $stat
291 fi
292 rm -f "$depfile"
293 # Each line is of the form `foo.o: dependent.h',
294 # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
295 # Do two passes, one to just change these to
296 # `$object: dependent.h' and one to simply `dependent.h:'.
297 sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
298 # Some versions of the HPUX 10.20 sed can't process this invocation
299 # correctly. Breaking it into two sed invocations is a workaround.
300 sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" |
301 sed -e 's/$/ :/' >> "$depfile"
302 rm -f "$tmpdepfile"
303 ;;
304
305hp2)
306 # The "hp" stanza above does not work with aCC (C++) and HP's ia64
307 # compilers, which have integrated preprocessors. The correct option
308 # to use with these is +Maked; it writes dependencies to a file named
309 # 'foo.d', which lands next to the object file, wherever that
310 # happens to be.
311 # Much of this is similar to the tru64 case; see comments there.
312 dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
313 test "x$dir" = "x$object" && dir=
314 base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
315 if test "$libtool" = yes; then
316 tmpdepfile1=$dir$base.d
317 tmpdepfile2=$dir.libs/$base.d
318 "$@" -Wc,+Maked
319 else
320 tmpdepfile1=$dir$base.d
321 tmpdepfile2=$dir$base.d
322 "$@" +Maked
323 fi
324 stat=$?
325 if test $stat -eq 0; then :
326 else
327 rm -f "$tmpdepfile1" "$tmpdepfile2"
328 exit $stat
329 fi
330
331 for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
332 do
333 test -f "$tmpdepfile" && break
334 done
335 if test -f "$tmpdepfile"; then
336 sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
337 # Add `dependent.h:' lines.
338 sed -ne '2,${
339 s/^ *//
340 s/ \\*$//
341 s/$/:/
342 p
343 }' "$tmpdepfile" >> "$depfile"
344 else
345 echo "#dummy" > "$depfile"
346 fi
347 rm -f "$tmpdepfile" "$tmpdepfile2"
348 ;;
349
350tru64)
351 # The Tru64 compiler uses -MD to generate dependencies as a side
352 # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
353 # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
354 # dependencies in `foo.d' instead, so we check for that too.
355 # Subdirectories are respected.
356 dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
357 test "x$dir" = "x$object" && dir=
358 base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
359
360 if test "$libtool" = yes; then
361 # With Tru64 cc, shared objects can also be used to make a
362 # static library. This mechanism is used in libtool 1.4 series to
363 # handle both shared and static libraries in a single compilation.
364 # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
365 #
366 # With libtool 1.5 this exception was removed, and libtool now
367 # generates 2 separate objects for the 2 libraries. These two
368 # compilations output dependencies in $dir.libs/$base.o.d and
369 # in $dir$base.o.d. We have to check for both files, because
370 # one of the two compilations can be disabled. We should prefer
371 # $dir$base.o.d over $dir.libs/$base.o.d because the latter is
372 # automatically cleaned when .libs/ is deleted, while ignoring
373 # the former would cause a distcleancheck panic.
374 tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4
375 tmpdepfile2=$dir$base.o.d # libtool 1.5
376 tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5
377 tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504
378 "$@" -Wc,-MD
379 else
380 tmpdepfile1=$dir$base.o.d
381 tmpdepfile2=$dir$base.d
382 tmpdepfile3=$dir$base.d
383 tmpdepfile4=$dir$base.d
384 "$@" -MD
385 fi
386
387 stat=$?
388 if test $stat -eq 0; then :
389 else
390 rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
391 exit $stat
392 fi
393
394 for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
395 do
396 test -f "$tmpdepfile" && break
397 done
398 if test -f "$tmpdepfile"; then
399 sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
400 # That's a tab and a space in the [].
401 sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
402 else
403 echo "#dummy" > "$depfile"
404 fi
405 rm -f "$tmpdepfile"
406 ;;
407
408#nosideeffect)
409 # This comment above is used by automake to tell side-effect
410 # dependency tracking mechanisms from slower ones.
411
412dashmstdout)
413 # Important note: in order to support this mode, a compiler *must*
414 # always write the preprocessed file to stdout, regardless of -o.
415 "$@" || exit $?
416
417 # Remove the call to Libtool.
418 if test "$libtool" = yes; then
419 while test "X$1" != 'X--mode=compile'; do
420 shift
421 done
422 shift
423 fi
424
425 # Remove `-o $object'.
426 IFS=" "
427 for arg
428 do
429 case $arg in
430 -o)
431 shift
432 ;;
433 $object)
434 shift
435 ;;
436 *)
437 set fnord "$@" "$arg"
438 shift # fnord
439 shift # $arg
440 ;;
441 esac
442 done
443
444 test -z "$dashmflag" && dashmflag=-M
445 # Require at least two characters before searching for `:'
446 # in the target name. This is to cope with DOS-style filenames:
447 # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise.
448 "$@" $dashmflag |
449 sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile"
450 rm -f "$depfile"
451 cat < "$tmpdepfile" > "$depfile"
452 tr ' ' '
453' < "$tmpdepfile" | \
454## Some versions of the HPUX 10.20 sed can't process this invocation
455## correctly. Breaking it into two sed invocations is a workaround.
456 sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
457 rm -f "$tmpdepfile"
458 ;;
459
460dashXmstdout)
461 # This case only exists to satisfy depend.m4. It is never actually
462 # run, as this mode is specially recognized in the preamble.
463 exit 1
464 ;;
465
466makedepend)
467 "$@" || exit $?
468 # Remove any Libtool call
469 if test "$libtool" = yes; then
470 while test "X$1" != 'X--mode=compile'; do
471 shift
472 done
473 shift
474 fi
475 # X makedepend
476 shift
477 cleared=no eat=no
478 for arg
479 do
480 case $cleared in
481 no)
482 set ""; shift
483 cleared=yes ;;
484 esac
485 if test $eat = yes; then
486 eat=no
487 continue
488 fi
489 case "$arg" in
490 -D*|-I*)
491 set fnord "$@" "$arg"; shift ;;
492 # Strip any option that makedepend may not understand. Remove
493 # the object too, otherwise makedepend will parse it as a source file.
494 -arch)
495 eat=yes ;;
496 -*|$object)
497 ;;
498 *)
499 set fnord "$@" "$arg"; shift ;;
500 esac
501 done
502 obj_suffix=`echo "$object" | sed 's/^.*\././'`
503 touch "$tmpdepfile"
504 ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
505 rm -f "$depfile"
506 cat < "$tmpdepfile" > "$depfile"
507 sed '1,2d' "$tmpdepfile" | tr ' ' '
508' | \
509## Some versions of the HPUX 10.20 sed can't process this invocation
510## correctly. Breaking it into two sed invocations is a workaround.
511 sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
512 rm -f "$tmpdepfile" "$tmpdepfile".bak
513 ;;
514
515cpp)
516 # Important note: in order to support this mode, a compiler *must*
517 # always write the preprocessed file to stdout.
518 "$@" || exit $?
519
520 # Remove the call to Libtool.
521 if test "$libtool" = yes; then
522 while test "X$1" != 'X--mode=compile'; do
523 shift
524 done
525 shift
526 fi
527
528 # Remove `-o $object'.
529 IFS=" "
530 for arg
531 do
532 case $arg in
533 -o)
534 shift
535 ;;
536 $object)
537 shift
538 ;;
539 *)
540 set fnord "$@" "$arg"
541 shift # fnord
542 shift # $arg
543 ;;
544 esac
545 done
546
547 "$@" -E |
548 sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
549 -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
550 sed '$ s: \\$::' > "$tmpdepfile"
551 rm -f "$depfile"
552 echo "$object : \\" > "$depfile"
553 cat < "$tmpdepfile" >> "$depfile"
554 sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
555 rm -f "$tmpdepfile"
556 ;;
557
558msvisualcpp)
559 # Important note: in order to support this mode, a compiler *must*
560 # always write the preprocessed file to stdout.
561 "$@" || exit $?
562
563 # Remove the call to Libtool.
564 if test "$libtool" = yes; then
565 while test "X$1" != 'X--mode=compile'; do
566 shift
567 done
568 shift
569 fi
570
571 IFS=" "
572 for arg
573 do
574 case "$arg" in
575 -o)
576 shift
577 ;;
578 $object)
579 shift
580 ;;
581 "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
582 set fnord "$@"
583 shift
584 shift
585 ;;
586 *)
587 set fnord "$@" "$arg"
588 shift
589 shift
590 ;;
591 esac
592 done
593 "$@" -E 2>/dev/null |
594 sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile"
595 rm -f "$depfile"
596 echo "$object : \\" > "$depfile"
597 sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile"
598 echo " " >> "$depfile"
599 sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile"
600 rm -f "$tmpdepfile"
601 ;;
602
603msvcmsys)
604 # This case exists only to let depend.m4 do its work. It works by
605 # looking at the text of this script. This case will never be run,
606 # since it is checked for above.
607 exit 1
608 ;;
609
610none)
611 exec "$@"
612 ;;
613
614*)
615 echo "Unknown depmode $depmode" 1>&2
616 exit 1
617 ;;
618esac
619
620exit 0
621
622# Local Variables:
623# mode: shell-script
624# sh-indentation: 2
625# eval: (add-hook 'write-file-hooks 'time-stamp)
626# time-stamp-start: "scriptversion="
627# time-stamp-format: "%:y-%02m-%02d.%02H"
628# time-stamp-time-zone: "UTC"
629# time-stamp-end: "; # UTC"
630# End:
diff --git a/autogen/install-sh b/autogen/install-sh
new file mode 100755
index 00000000000..6781b987bdb
--- /dev/null
+++ b/autogen/install-sh
@@ -0,0 +1,520 @@
1#!/bin/sh
2# install - install a program, script, or datafile
3
4scriptversion=2009-04-28.21; # UTC
5
6# This originates from X11R5 (mit/util/scripts/install.sh), which was
7# later released in X11R6 (xc/config/util/install.sh) with the
8# following copyright and license.
9#
10# Copyright (C) 1994 X Consortium
11#
12# Permission is hereby granted, free of charge, to any person obtaining a copy
13# of this software and associated documentation files (the "Software"), to
14# deal in the Software without restriction, including without limitation the
15# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
16# sell copies of the Software, and to permit persons to whom the Software is
17# furnished to do so, subject to the following conditions:
18#
19# The above copyright notice and this permission notice shall be included in
20# all copies or substantial portions of the Software.
21#
22# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
25# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
26# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
27# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
28#
29# Except as contained in this notice, the name of the X Consortium shall not
30# be used in advertising or otherwise to promote the sale, use or other deal-
31# ings in this Software without prior written authorization from the X Consor-
32# tium.
33#
34#
35# FSF changes to this file are in the public domain.
36#
37# Calling this script install-sh is preferred over install.sh, to prevent
38# `make' implicit rules from creating a file called install from it
39# when there is no Makefile.
40#
41# This script is compatible with the BSD install script, but was written
42# from scratch.
43
44nl='
45'
46IFS=" "" $nl"
47
48# set DOITPROG to echo to test this script
49
50# Don't use :- since 4.3BSD and earlier shells don't like it.
51doit=${DOITPROG-}
52if test -z "$doit"; then
53 doit_exec=exec
54else
55 doit_exec=$doit
56fi
57
58# Put in absolute file names if you don't have them in your path;
59# or use environment vars.
60
61chgrpprog=${CHGRPPROG-chgrp}
62chmodprog=${CHMODPROG-chmod}
63chownprog=${CHOWNPROG-chown}
64cmpprog=${CMPPROG-cmp}
65cpprog=${CPPROG-cp}
66mkdirprog=${MKDIRPROG-mkdir}
67mvprog=${MVPROG-mv}
68rmprog=${RMPROG-rm}
69stripprog=${STRIPPROG-strip}
70
71posix_glob='?'
72initialize_posix_glob='
73 test "$posix_glob" != "?" || {
74 if (set -f) 2>/dev/null; then
75 posix_glob=
76 else
77 posix_glob=:
78 fi
79 }
80'
81
82posix_mkdir=
83
84# Desired mode of installed file.
85mode=0755
86
87chgrpcmd=
88chmodcmd=$chmodprog
89chowncmd=
90mvcmd=$mvprog
91rmcmd="$rmprog -f"
92stripcmd=
93
94src=
95dst=
96dir_arg=
97dst_arg=
98
99copy_on_change=false
100no_target_directory=
101
102usage="\
103Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
104 or: $0 [OPTION]... SRCFILES... DIRECTORY
105 or: $0 [OPTION]... -t DIRECTORY SRCFILES...
106 or: $0 [OPTION]... -d DIRECTORIES...
107
108In the 1st form, copy SRCFILE to DSTFILE.
109In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
110In the 4th, create DIRECTORIES.
111
112Options:
113 --help display this help and exit.
114 --version display version info and exit.
115
116 -c (ignored)
117 -C install only if different (preserve the last data modification time)
118 -d create directories instead of installing files.
119 -g GROUP $chgrpprog installed files to GROUP.
120 -m MODE $chmodprog installed files to MODE.
121 -o USER $chownprog installed files to USER.
122 -s $stripprog installed files.
123 -t DIRECTORY install into DIRECTORY.
124 -T report an error if DSTFILE is a directory.
125
126Environment variables override the default commands:
127 CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
128 RMPROG STRIPPROG
129"
130
131while test $# -ne 0; do
132 case $1 in
133 -c) ;;
134
135 -C) copy_on_change=true;;
136
137 -d) dir_arg=true;;
138
139 -g) chgrpcmd="$chgrpprog $2"
140 shift;;
141
142 --help) echo "$usage"; exit $?;;
143
144 -m) mode=$2
145 case $mode in
146 *' '* | *' '* | *'
147'* | *'*'* | *'?'* | *'['*)
148 echo "$0: invalid mode: $mode" >&2
149 exit 1;;
150 esac
151 shift;;
152
153 -o) chowncmd="$chownprog $2"
154 shift;;
155
156 -s) stripcmd=$stripprog;;
157
158 -t) dst_arg=$2
159 shift;;
160
161 -T) no_target_directory=true;;
162
163 --version) echo "$0 $scriptversion"; exit $?;;
164
165 --) shift
166 break;;
167
168 -*) echo "$0: invalid option: $1" >&2
169 exit 1;;
170
171 *) break;;
172 esac
173 shift
174done
175
176if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
177 # When -d is used, all remaining arguments are directories to create.
178 # When -t is used, the destination is already specified.
179 # Otherwise, the last argument is the destination. Remove it from $@.
180 for arg
181 do
182 if test -n "$dst_arg"; then
183 # $@ is not empty: it contains at least $arg.
184 set fnord "$@" "$dst_arg"
185 shift # fnord
186 fi
187 shift # arg
188 dst_arg=$arg
189 done
190fi
191
192if test $# -eq 0; then
193 if test -z "$dir_arg"; then
194 echo "$0: no input file specified." >&2
195 exit 1
196 fi
197 # It's OK to call `install-sh -d' without argument.
198 # This can happen when creating conditional directories.
199 exit 0
200fi
201
202if test -z "$dir_arg"; then
203 trap '(exit $?); exit' 1 2 13 15
204
205 # Set umask so as not to create temps with too-generous modes.
206 # However, 'strip' requires both read and write access to temps.
207 case $mode in
208 # Optimize common cases.
209 *644) cp_umask=133;;
210 *755) cp_umask=22;;
211
212 *[0-7])
213 if test -z "$stripcmd"; then
214 u_plus_rw=
215 else
216 u_plus_rw='% 200'
217 fi
218 cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
219 *)
220 if test -z "$stripcmd"; then
221 u_plus_rw=
222 else
223 u_plus_rw=,u+rw
224 fi
225 cp_umask=$mode$u_plus_rw;;
226 esac
227fi
228
229for src
230do
231 # Protect names starting with `-'.
232 case $src in
233 -*) src=./$src;;
234 esac
235
236 if test -n "$dir_arg"; then
237 dst=$src
238 dstdir=$dst
239 test -d "$dstdir"
240 dstdir_status=$?
241 else
242
243 # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
244 # might cause directories to be created, which would be especially bad
245 # if $src (and thus $dsttmp) contains '*'.
246 if test ! -f "$src" && test ! -d "$src"; then
247 echo "$0: $src does not exist." >&2
248 exit 1
249 fi
250
251 if test -z "$dst_arg"; then
252 echo "$0: no destination specified." >&2
253 exit 1
254 fi
255
256 dst=$dst_arg
257 # Protect names starting with `-'.
258 case $dst in
259 -*) dst=./$dst;;
260 esac
261
262 # If destination is a directory, append the input filename; won't work
263 # if double slashes aren't ignored.
264 if test -d "$dst"; then
265 if test -n "$no_target_directory"; then
266 echo "$0: $dst_arg: Is a directory" >&2
267 exit 1
268 fi
269 dstdir=$dst
270 dst=$dstdir/`basename "$src"`
271 dstdir_status=0
272 else
273 # Prefer dirname, but fall back on a substitute if dirname fails.
274 dstdir=`
275 (dirname "$dst") 2>/dev/null ||
276 expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
277 X"$dst" : 'X\(//\)[^/]' \| \
278 X"$dst" : 'X\(//\)$' \| \
279 X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
280 echo X"$dst" |
281 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
282 s//\1/
283 q
284 }
285 /^X\(\/\/\)[^/].*/{
286 s//\1/
287 q
288 }
289 /^X\(\/\/\)$/{
290 s//\1/
291 q
292 }
293 /^X\(\/\).*/{
294 s//\1/
295 q
296 }
297 s/.*/./; q'
298 `
299
300 test -d "$dstdir"
301 dstdir_status=$?
302 fi
303 fi
304
305 obsolete_mkdir_used=false
306
307 if test $dstdir_status != 0; then
308 case $posix_mkdir in
309 '')
310 # Create intermediate dirs using mode 755 as modified by the umask.
311 # This is like FreeBSD 'install' as of 1997-10-28.
312 umask=`umask`
313 case $stripcmd.$umask in
314 # Optimize common cases.
315 *[2367][2367]) mkdir_umask=$umask;;
316 .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
317
318 *[0-7])
319 mkdir_umask=`expr $umask + 22 \
320 - $umask % 100 % 40 + $umask % 20 \
321 - $umask % 10 % 4 + $umask % 2
322 `;;
323 *) mkdir_umask=$umask,go-w;;
324 esac
325
326 # With -d, create the new directory with the user-specified mode.
327 # Otherwise, rely on $mkdir_umask.
328 if test -n "$dir_arg"; then
329 mkdir_mode=-m$mode
330 else
331 mkdir_mode=
332 fi
333
334 posix_mkdir=false
335 case $umask in
336 *[123567][0-7][0-7])
337 # POSIX mkdir -p sets u+wx bits regardless of umask, which
338 # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
339 ;;
340 *)
341 tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
342 trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
343
344 if (umask $mkdir_umask &&
345 exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
346 then
347 if test -z "$dir_arg" || {
348 # Check for POSIX incompatibilities with -m.
349 # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
350 # other-writeable bit of parent directory when it shouldn't.
351 # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
352 ls_ld_tmpdir=`ls -ld "$tmpdir"`
353 case $ls_ld_tmpdir in
354 d????-?r-*) different_mode=700;;
355 d????-?--*) different_mode=755;;
356 *) false;;
357 esac &&
358 $mkdirprog -m$different_mode -p -- "$tmpdir" && {
359 ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
360 test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
361 }
362 }
363 then posix_mkdir=:
364 fi
365 rmdir "$tmpdir/d" "$tmpdir"
366 else
367 # Remove any dirs left behind by ancient mkdir implementations.
368 rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
369 fi
370 trap '' 0;;
371 esac;;
372 esac
373
374 if
375 $posix_mkdir && (
376 umask $mkdir_umask &&
377 $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
378 )
379 then :
380 else
381
382 # The umask is ridiculous, or mkdir does not conform to POSIX,
383 # or it failed possibly due to a race condition. Create the
384 # directory the slow way, step by step, checking for races as we go.
385
386 case $dstdir in
387 /*) prefix='/';;
388 -*) prefix='./';;
389 *) prefix='';;
390 esac
391
392 eval "$initialize_posix_glob"
393
394 oIFS=$IFS
395 IFS=/
396 $posix_glob set -f
397 set fnord $dstdir
398 shift
399 $posix_glob set +f
400 IFS=$oIFS
401
402 prefixes=
403
404 for d
405 do
406 test -z "$d" && continue
407
408 prefix=$prefix$d
409 if test -d "$prefix"; then
410 prefixes=
411 else
412 if $posix_mkdir; then
413 (umask=$mkdir_umask &&
414 $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
415 # Don't fail if two instances are running concurrently.
416 test -d "$prefix" || exit 1
417 else
418 case $prefix in
419 *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
420 *) qprefix=$prefix;;
421 esac
422 prefixes="$prefixes '$qprefix'"
423 fi
424 fi
425 prefix=$prefix/
426 done
427
428 if test -n "$prefixes"; then
429 # Don't fail if two instances are running concurrently.
430 (umask $mkdir_umask &&
431 eval "\$doit_exec \$mkdirprog $prefixes") ||
432 test -d "$dstdir" || exit 1
433 obsolete_mkdir_used=true
434 fi
435 fi
436 fi
437
438 if test -n "$dir_arg"; then
439 { test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
440 { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
441 { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
442 test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
443 else
444
445 # Make a couple of temp file names in the proper directory.
446 dsttmp=$dstdir/_inst.$$_
447 rmtmp=$dstdir/_rm.$$_
448
449 # Trap to clean up those temp files at exit.
450 trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
451
452 # Copy the file name to the temp name.
453 (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
454
455 # and set any options; do chmod last to preserve setuid bits.
456 #
457 # If any of these fail, we abort the whole thing. If we want to
458 # ignore errors from any of these, just make sure not to ignore
459 # errors from the above "$doit $cpprog $src $dsttmp" command.
460 #
461 { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
462 { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
463 { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
464 { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
465
466 # If -C, don't bother to copy if it wouldn't change the file.
467 if $copy_on_change &&
468 old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
469 new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
470
471 eval "$initialize_posix_glob" &&
472 $posix_glob set -f &&
473 set X $old && old=:$2:$4:$5:$6 &&
474 set X $new && new=:$2:$4:$5:$6 &&
475 $posix_glob set +f &&
476
477 test "$old" = "$new" &&
478 $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
479 then
480 rm -f "$dsttmp"
481 else
482 # Rename the file to the real destination.
483 $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
484
485 # The rename failed, perhaps because mv can't rename something else
486 # to itself, or perhaps because mv is so ancient that it does not
487 # support -f.
488 {
489 # Now remove or move aside any old file at destination location.
490 # We try this two ways since rm can't unlink itself on some
491 # systems and the destination file might be busy for other
492 # reasons. In this case, the final cleanup might fail but the new
493 # file should still install successfully.
494 {
495 test ! -f "$dst" ||
496 $doit $rmcmd -f "$dst" 2>/dev/null ||
497 { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
498 { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
499 } ||
500 { echo "$0: cannot unlink or rename $dst" >&2
501 (exit 1); exit 1
502 }
503 } &&
504
505 # Now rename the file to the real destination.
506 $doit $mvcmd "$dsttmp" "$dst"
507 }
508 fi || exit 1
509
510 trap '' 0
511 fi
512done
513
514# Local variables:
515# eval: (add-hook 'write-file-hooks 'time-stamp)
516# time-stamp-start: "scriptversion="
517# time-stamp-format: "%:y-%02m-%02d.%02H"
518# time-stamp-time-zone: "UTC"
519# time-stamp-end: "; # UTC"
520# End:
diff --git a/autogen/missing b/autogen/missing
new file mode 100755
index 00000000000..28055d2ae6f
--- /dev/null
+++ b/autogen/missing
@@ -0,0 +1,376 @@
1#! /bin/sh
2# Common stub for a few missing GNU programs while installing.
3
4scriptversion=2009-04-28.21; # UTC
5
6# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006,
7# 2008, 2009 Free Software Foundation, Inc.
8# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
9
10# This program is free software; you can redistribute it and/or modify
11# it under the terms of the GNU General Public License as published by
12# the Free Software Foundation; either version 2, or (at your option)
13# any later version.
14
15# This program is distributed in the hope that it will be useful,
16# but WITHOUT ANY WARRANTY; without even the implied warranty of
17# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18# GNU General Public License for more details.
19
20# You should have received a copy of the GNU General Public License
21# along with this program. If not, see <http://www.gnu.org/licenses/>.
22
23# As a special exception to the GNU General Public License, if you
24# distribute this file as part of a program that contains a
25# configuration script generated by Autoconf, you may include it under
26# the same distribution terms that you use for the rest of that program.
27
28if test $# -eq 0; then
29 echo 1>&2 "Try \`$0 --help' for more information"
30 exit 1
31fi
32
33run=:
34sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'
35sed_minuso='s/.* -o \([^ ]*\).*/\1/p'
36
37# In the cases where this matters, `missing' is being run in the
38# srcdir already.
39if test -f configure.ac; then
40 configure_ac=configure.ac
41else
42 configure_ac=configure.in
43fi
44
45msg="missing on your system"
46
47case $1 in
48--run)
49 # Try to run requested program, and just exit if it succeeds.
50 run=
51 shift
52 "$@" && exit 0
53 # Exit code 63 means version mismatch. This often happens
54 # when the user try to use an ancient version of a tool on
55 # a file that requires a minimum version. In this case we
56 # we should proceed has if the program had been absent, or
57 # if --run hadn't been passed.
58 if test $? = 63; then
59 run=:
60 msg="probably too old"
61 fi
62 ;;
63
64 -h|--h|--he|--hel|--help)
65 echo "\
66$0 [OPTION]... PROGRAM [ARGUMENT]...
67
68Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
69error status if there is no known handling for PROGRAM.
70
71Options:
72 -h, --help display this help and exit
73 -v, --version output version information and exit
74 --run try to run the given command, and emulate it if it fails
75
76Supported PROGRAM values:
77 aclocal touch file \`aclocal.m4'
78 autoconf touch file \`configure'
79 autoheader touch file \`config.h.in'
80 autom4te touch the output file, or create a stub one
81 automake touch all \`Makefile.in' files
82 bison create \`y.tab.[ch]', if possible, from existing .[ch]
83 flex create \`lex.yy.c', if possible, from existing .c
84 help2man touch the output file
85 lex create \`lex.yy.c', if possible, from existing .c
86 makeinfo touch the output file
87 tar try tar, gnutar, gtar, then tar without non-portable flags
88 yacc create \`y.tab.[ch]', if possible, from existing .[ch]
89
90Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and
91\`g' are ignored when checking the name.
92
93Send bug reports to <bug-automake@gnu.org>."
94 exit $?
95 ;;
96
97 -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
98 echo "missing $scriptversion (GNU Automake)"
99 exit $?
100 ;;
101
102 -*)
103 echo 1>&2 "$0: Unknown \`$1' option"
104 echo 1>&2 "Try \`$0 --help' for more information"
105 exit 1
106 ;;
107
108esac
109
110# normalize program name to check for.
111program=`echo "$1" | sed '
112 s/^gnu-//; t
113 s/^gnu//; t
114 s/^g//; t'`
115
116# Now exit if we have it, but it failed. Also exit now if we
117# don't have it and --version was passed (most likely to detect
118# the program). This is about non-GNU programs, so use $1 not
119# $program.
120case $1 in
121 lex*|yacc*)
122 # Not GNU programs, they don't have --version.
123 ;;
124
125 tar*)
126 if test -n "$run"; then
127 echo 1>&2 "ERROR: \`tar' requires --run"
128 exit 1
129 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
130 exit 1
131 fi
132 ;;
133
134 *)
135 if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
136 # We have it, but it failed.
137 exit 1
138 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
139 # Could not run --version or --help. This is probably someone
140 # running `$TOOL --version' or `$TOOL --help' to check whether
141 # $TOOL exists and not knowing $TOOL uses missing.
142 exit 1
143 fi
144 ;;
145esac
146
147# If it does not exist, or fails to run (possibly an outdated version),
148# try to emulate it.
149case $program in
150 aclocal*)
151 echo 1>&2 "\
152WARNING: \`$1' is $msg. You should only need it if
153 you modified \`acinclude.m4' or \`${configure_ac}'. You might want
154 to install the \`Automake' and \`Perl' packages. Grab them from
155 any GNU archive site."
156 touch aclocal.m4
157 ;;
158
159 autoconf*)
160 echo 1>&2 "\
161WARNING: \`$1' is $msg. You should only need it if
162 you modified \`${configure_ac}'. You might want to install the
163 \`Autoconf' and \`GNU m4' packages. Grab them from any GNU
164 archive site."
165 touch configure
166 ;;
167
168 autoheader*)
169 echo 1>&2 "\
170WARNING: \`$1' is $msg. You should only need it if
171 you modified \`acconfig.h' or \`${configure_ac}'. You might want
172 to install the \`Autoconf' and \`GNU m4' packages. Grab them
173 from any GNU archive site."
174 files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
175 test -z "$files" && files="config.h"
176 touch_files=
177 for f in $files; do
178 case $f in
179 *:*) touch_files="$touch_files "`echo "$f" |
180 sed -e 's/^[^:]*://' -e 's/:.*//'`;;
181 *) touch_files="$touch_files $f.in";;
182 esac
183 done
184 touch $touch_files
185 ;;
186
187 automake*)
188 echo 1>&2 "\
189WARNING: \`$1' is $msg. You should only need it if
190 you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
191 You might want to install the \`Automake' and \`Perl' packages.
192 Grab them from any GNU archive site."
193 find . -type f -name Makefile.am -print |
194 sed 's/\.am$/.in/' |
195 while read f; do touch "$f"; done
196 ;;
197
198 autom4te*)
199 echo 1>&2 "\
200WARNING: \`$1' is needed, but is $msg.
201 You might have modified some files without having the
202 proper tools for further handling them.
203 You can get \`$1' as part of \`Autoconf' from any GNU
204 archive site."
205
206 file=`echo "$*" | sed -n "$sed_output"`
207 test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
208 if test -f "$file"; then
209 touch $file
210 else
211 test -z "$file" || exec >$file
212 echo "#! /bin/sh"
213 echo "# Created by GNU Automake missing as a replacement of"
214 echo "# $ $@"
215 echo "exit 0"
216 chmod +x $file
217 exit 1
218 fi
219 ;;
220
221 bison*|yacc*)
222 echo 1>&2 "\
223WARNING: \`$1' $msg. You should only need it if
224 you modified a \`.y' file. You may need the \`Bison' package
225 in order for those modifications to take effect. You can get
226 \`Bison' from any GNU archive site."
227 rm -f y.tab.c y.tab.h
228 if test $# -ne 1; then
229 eval LASTARG="\${$#}"
230 case $LASTARG in
231 *.y)
232 SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
233 if test -f "$SRCFILE"; then
234 cp "$SRCFILE" y.tab.c
235 fi
236 SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
237 if test -f "$SRCFILE"; then
238 cp "$SRCFILE" y.tab.h
239 fi
240 ;;
241 esac
242 fi
243 if test ! -f y.tab.h; then
244 echo >y.tab.h
245 fi
246 if test ! -f y.tab.c; then
247 echo 'main() { return 0; }' >y.tab.c
248 fi
249 ;;
250
251 lex*|flex*)
252 echo 1>&2 "\
253WARNING: \`$1' is $msg. You should only need it if
254 you modified a \`.l' file. You may need the \`Flex' package
255 in order for those modifications to take effect. You can get
256 \`Flex' from any GNU archive site."
257 rm -f lex.yy.c
258 if test $# -ne 1; then
259 eval LASTARG="\${$#}"
260 case $LASTARG in
261 *.l)
262 SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
263 if test -f "$SRCFILE"; then
264 cp "$SRCFILE" lex.yy.c
265 fi
266 ;;
267 esac
268 fi
269 if test ! -f lex.yy.c; then
270 echo 'main() { return 0; }' >lex.yy.c
271 fi
272 ;;
273
274 help2man*)
275 echo 1>&2 "\
276WARNING: \`$1' is $msg. You should only need it if
277 you modified a dependency of a manual page. You may need the
278 \`Help2man' package in order for those modifications to take
279 effect. You can get \`Help2man' from any GNU archive site."
280
281 file=`echo "$*" | sed -n "$sed_output"`
282 test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
283 if test -f "$file"; then
284 touch $file
285 else
286 test -z "$file" || exec >$file
287 echo ".ab help2man is required to generate this page"
288 exit $?
289 fi
290 ;;
291
292 makeinfo*)
293 echo 1>&2 "\
294WARNING: \`$1' is $msg. You should only need it if
295 you modified a \`.texi' or \`.texinfo' file, or any other file
296 indirectly affecting the aspect of the manual. The spurious
297 call might also be the consequence of using a buggy \`make' (AIX,
298 DU, IRIX). You might want to install the \`Texinfo' package or
299 the \`GNU make' package. Grab either from any GNU archive site."
300 # The file to touch is that specified with -o ...
301 file=`echo "$*" | sed -n "$sed_output"`
302 test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
303 if test -z "$file"; then
304 # ... or it is the one specified with @setfilename ...
305 infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
306 file=`sed -n '
307 /^@setfilename/{
308 s/.* \([^ ]*\) *$/\1/
309 p
310 q
311 }' $infile`
312 # ... or it is derived from the source name (dir/f.texi becomes f.info)
313 test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
314 fi
315 # If the file does not exist, the user really needs makeinfo;
316 # let's fail without touching anything.
317 test -f $file || exit 1
318 touch $file
319 ;;
320
321 tar*)
322 shift
323
324 # We have already tried tar in the generic part.
325 # Look for gnutar/gtar before invocation to avoid ugly error
326 # messages.
327 if (gnutar --version > /dev/null 2>&1); then
328 gnutar "$@" && exit 0
329 fi
330 if (gtar --version > /dev/null 2>&1); then
331 gtar "$@" && exit 0
332 fi
333 firstarg="$1"
334 if shift; then
335 case $firstarg in
336 *o*)
337 firstarg=`echo "$firstarg" | sed s/o//`
338 tar "$firstarg" "$@" && exit 0
339 ;;
340 esac
341 case $firstarg in
342 *h*)
343 firstarg=`echo "$firstarg" | sed s/h//`
344 tar "$firstarg" "$@" && exit 0
345 ;;
346 esac
347 fi
348
349 echo 1>&2 "\
350WARNING: I can't seem to be able to run \`tar' with the given arguments.
351 You may want to install GNU tar or Free paxutils, or check the
352 command line arguments."
353 exit 1
354 ;;
355
356 *)
357 echo 1>&2 "\
358WARNING: \`$1' is needed, and is $msg.
359 You might have modified some files without having the
360 proper tools for further handling them. Check the \`README' file,
361 it often tells you about the needed prerequisites for installing
362 this package. You may also peek at any GNU archive site, in case
363 some other package would contain this missing \`$1' program."
364 exit 1
365 ;;
366esac
367
368exit 0
369
370# Local variables:
371# eval: (add-hook 'write-file-hooks 'time-stamp)
372# time-stamp-start: "scriptversion="
373# time-stamp-format: "%:y-%02m-%02d.%02H"
374# time-stamp-time-zone: "UTC"
375# time-stamp-end: "; # UTC"
376# End:
diff --git a/autogen/update_autogen b/autogen/update_autogen
index de525a9f4a2..795d5295939 100755
--- a/autogen/update_autogen
+++ b/autogen/update_autogen
@@ -68,7 +68,7 @@ quiet=
68 68
69## Parameters. 69## Parameters.
70sources="configure.in lib/Makefile.am" 70sources="configure.in lib/Makefile.am"
71genfiles="configure aclocal.m4 src/config.in lib/Makefile.in" 71genfiles="configure aclocal.m4 src/config.in lib/Makefile.in compile config.guess config.sub depcomp install-sh missing"
72 72
73for g in $genfiles; do 73for g in $genfiles; do
74 basegen="$basegen ${g##*/}" 74 basegen="$basegen ${g##*/}"
@@ -126,7 +126,18 @@ done < $tempfile
126 126
127echo "Running autoreconf..." 127echo "Running autoreconf..."
128 128
129autoreconf -I m4 || die "autoreconf error" 129autoreconf -i -I m4 2>| $tempfile
130
131retval=$?
132
133## Annoyingly, autoreconf puts the "installing `./foo' messages on stderr.
134if [ "$quiet" ]; then
135 grep -v 'installing `\.' $tempfile 1>&2
136else
137 cat "$tempfile" 1>&2
138fi
139
140[ $retval -ne 0 ] && die "autoreconf error"
130 141
131 142
132cp $genfiles autogen/ 143cp $genfiles autogen/