passenger 4.0.5 → 4.0.6

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of passenger might be problematic. Click here for more details.

Files changed (162) hide show
  1. data.tar.gz.asc +7 -7
  2. data/.travis.yml +1 -2
  3. data/CONTRIBUTING.md +20 -5
  4. data/CONTRIBUTORS +67 -0
  5. data/LICENSE +1 -1
  6. data/NEWS +48 -0
  7. data/Rakefile +2 -2
  8. data/bin/passenger-config +18 -0
  9. data/bin/passenger-install-apache2-module +2 -0
  10. data/bin/passenger-install-nginx-module +11 -12
  11. data/bin/passenger-memory-stats +2 -0
  12. data/bin/passenger-status +152 -69
  13. data/build/agents.rb +1 -5
  14. data/build/basics.rb +26 -13
  15. data/build/cplusplus_support.rb +9 -0
  16. data/build/debian.rb +129 -0
  17. data/build/documentation.rb +6 -2
  18. data/build/integration_tests.rb +13 -2
  19. data/build/misc.rb +16 -0
  20. data/build/packaging.rb +67 -51
  21. data/build/preprocessor.rb +314 -0
  22. data/build/test_basics.rb +1 -0
  23. data/{debian → debian.template}/README.Debian +0 -0
  24. data/{debian → debian.template}/changelog +131 -0
  25. data/debian.template/compat +1 -0
  26. data/debian.template/control +71 -0
  27. data/debian.template/copyright +385 -0
  28. data/debian.template/libapache2-mod-passenger.install +3 -0
  29. data/{debian → debian.template}/libapache2-mod-passenger.postinst +0 -0
  30. data/{debian → debian.template}/libapache2-mod-passenger.prerm +0 -0
  31. data/debian.template/locations.ini +12 -0
  32. data/debian.template/passenger.conf +4 -0
  33. data/{debian → debian.template}/passenger.load +0 -0
  34. data/debian.template/patches/series +0 -0
  35. data/debian.template/repack.sh +42 -0
  36. data/debian.template/ruby-passenger-dev.install +3 -0
  37. data/debian.template/ruby-passenger-doc.install +2 -0
  38. data/debian.template/ruby-passenger.docs +4 -0
  39. data/debian.template/ruby-passenger.install +11 -0
  40. data/debian.template/ruby-passenger.manpages +4 -0
  41. data/debian.template/rules.template +35 -0
  42. data/debian.template/source/format +1 -0
  43. data/debian.template/watch +3 -0
  44. data/dev/run_travis.sh +46 -46
  45. data/doc/Architectural overview.html +2 -2
  46. data/doc/Packaging.html +27 -18
  47. data/doc/Packaging.txt.md +27 -18
  48. data/doc/Security of user switching support.html +2 -2
  49. data/doc/Users guide Apache.html +881 -95
  50. data/doc/Users guide Apache.idmap.txt +48 -6
  51. data/doc/Users guide Apache.txt +13 -1
  52. data/doc/Users guide Nginx.html +1063 -190
  53. data/doc/Users guide Nginx.idmap.txt +89 -45
  54. data/doc/Users guide Nginx.txt +45 -0
  55. data/doc/Users guide Standalone.html +7 -7
  56. data/doc/users_guide_snippets/alternative_for_flying_passenger.txt +1 -0
  57. data/doc/users_guide_snippets/environment_variables.txt +221 -0
  58. data/doc/users_guide_snippets/installation.txt +66 -17
  59. data/doc/users_guide_snippets/support_information.txt +3 -3
  60. data/doc/users_guide_snippets/tips.txt +352 -40
  61. data/ext/common/Account.h +4 -3
  62. data/ext/common/AccountsDatabase.h +6 -6
  63. data/ext/common/AgentsStarter.h +1 -13
  64. data/ext/common/ApplicationPool2/DirectSpawner.h +4 -4
  65. data/ext/common/ApplicationPool2/DummySpawner.h +1 -1
  66. data/ext/common/ApplicationPool2/Group.h +9 -4
  67. data/ext/common/ApplicationPool2/Implementation.cpp +6 -1
  68. data/ext/common/ApplicationPool2/Options.h +65 -37
  69. data/ext/common/ApplicationPool2/Pool.h +91 -41
  70. data/ext/common/ApplicationPool2/Process.h +6 -6
  71. data/ext/common/ApplicationPool2/SmartSpawner.h +14 -14
  72. data/ext/common/ApplicationPool2/Socket.h +1 -1
  73. data/ext/common/ApplicationPool2/Spawner.h +24 -16
  74. data/ext/common/ApplicationPool2/SpawnerFactory.h +9 -1
  75. data/ext/common/ApplicationPool2/SuperGroup.h +1 -1
  76. data/ext/common/Constants.h +1 -1
  77. data/ext/common/Logging.cpp +12 -7
  78. data/ext/common/MessageServer.h +7 -12
  79. data/ext/common/MultiLibeio.cpp +5 -5
  80. data/ext/common/ResourceLocator.h +2 -6
  81. data/ext/common/ServerInstanceDir.h +37 -10
  82. data/ext/common/UnionStation.h +10 -10
  83. data/ext/common/Utils.cpp +30 -4
  84. data/ext/common/Utils.h +7 -0
  85. data/ext/common/Utils/BlockingQueue.h +2 -2
  86. data/ext/common/Utils/Lock.h +2 -2
  87. data/ext/common/Utils/MessagePassing.h +2 -2
  88. data/ext/common/Utils/Timer.h +4 -4
  89. data/ext/common/agents/HelperAgent/AgentOptions.h +2 -0
  90. data/ext/common/agents/HelperAgent/Main.cpp +57 -16
  91. data/ext/common/agents/HelperAgent/RequestHandler.h +4 -1
  92. data/ext/common/agents/LoggingAgent/AdminController.h +91 -0
  93. data/ext/common/agents/LoggingAgent/LoggingServer.h +46 -29
  94. data/ext/common/agents/LoggingAgent/Main.cpp +43 -16
  95. data/ext/common/agents/LoggingAgent/RemoteSender.h +7 -7
  96. data/ext/common/agents/Watchdog/AgentWatcher.cpp +11 -11
  97. data/ext/common/agents/Watchdog/LoggingAgentWatcher.cpp +3 -1
  98. data/ext/common/agents/Watchdog/Main.cpp +62 -0
  99. data/ext/libeio/config.guess +206 -167
  100. data/ext/libeio/config.sub +142 -68
  101. data/ext/libev/config.guess +304 -290
  102. data/ext/libev/config.sub +198 -77
  103. data/ext/nginx/config +4 -0
  104. data/ext/nginx/ngx_http_passenger_module.c +1 -0
  105. data/ext/oxt/implementation.cpp +4 -4
  106. data/lib/phusion_passenger.rb +14 -5
  107. data/lib/phusion_passenger/abstract_installer.rb +41 -0
  108. data/lib/phusion_passenger/admin_tools/server_instance.rb +48 -39
  109. data/lib/phusion_passenger/message_client.rb +31 -7
  110. data/lib/phusion_passenger/native_support.rb +35 -12
  111. data/lib/phusion_passenger/packaging.rb +16 -2
  112. data/lib/phusion_passenger/platform_info/binary_compatibility.rb +6 -31
  113. data/lib/phusion_passenger/platform_info/operating_system.rb +1 -1
  114. data/lib/phusion_passenger/preloader_shared_helpers.rb +3 -1
  115. data/lib/phusion_passenger/request_handler.rb +1 -1
  116. data/lib/phusion_passenger/standalone/command.rb +6 -6
  117. data/lib/phusion_passenger/standalone/main.rb +23 -8
  118. data/lib/phusion_passenger/standalone/package_runtime_command.rb +9 -5
  119. data/lib/phusion_passenger/standalone/runtime_installer.rb +9 -10
  120. data/lib/phusion_passenger/standalone/start_command.rb +20 -4
  121. data/resources/templates/installer_common/freebsd9_broken_cxx_runtime.txt.erb +19 -0
  122. data/resources/templates/installer_common/low_amount_of_memory_warning.txt.erb +22 -0
  123. data/resources/templates/standalone/config.erb +3 -2
  124. data/test/cxx/ApplicationPool2/DirectSpawnerTest.cpp +4 -4
  125. data/test/cxx/ApplicationPool2/PoolTest.cpp +1 -1
  126. data/test/cxx/ApplicationPool2/SmartSpawnerTest.cpp +7 -7
  127. data/test/cxx/ApplicationPool2/SpawnerTestCases.cpp +9 -9
  128. data/test/cxx/EventedBufferedInputTest.cpp +17 -17
  129. data/test/cxx/RequestHandlerTest.cpp +5 -5
  130. data/test/cxx/ServerInstanceDirTest.cpp +3 -1
  131. data/test/cxx/TestSupport.h +4 -4
  132. data/test/cxx/UnionStationTest.cpp +3 -1
  133. data/test/cxx/UtilsTest.cpp +2 -0
  134. data/test/integration_tests/apache2_tests.rb +2 -2
  135. data/test/integration_tests/native_packaging_spec.rb +170 -0
  136. data/test/ruby/spec_helper.rb +0 -1
  137. data/test/stub/apache2/httpd.conf.erb +1 -1
  138. data/test/stub/nginx/nginx.conf.erb +1 -0
  139. data/test/support/apache2_controller.rb +1 -1
  140. data/test/support/placebo-preloader.rb +1 -1
  141. data/test/support/test_helper.rb +5 -2
  142. metadata +32 -26
  143. metadata.gz.asc +7 -7
  144. data/debian/compat +0 -1
  145. data/debian/control +0 -49
  146. data/debian/copyright +0 -20
  147. data/debian/libapache2-mod-passenger.install +0 -1
  148. data/debian/passenger-common.install +0 -4
  149. data/debian/passenger.conf +0 -4
  150. data/debian/prerm +0 -2
  151. data/debian/rules +0 -37
  152. data/debian/watch +0 -3
  153. data/dev/googlecode_upload.py +0 -265
  154. data/ext/common/agents/HelperAgent/BacktracesServer.h +0 -60
  155. data/resources/templates/nginx/not_available_when_natively_packaged.txt.erb +0 -8
  156. data/test/stub/rails3.1/app/assets/javascripts/application.js +0 -9
  157. data/test/stub/rails3.2/app/assets/javascripts/application.js +0 -15
  158. data/test/stub/rails_apps/2.3/mycook/public/javascripts/application.js +0 -2
  159. data/test/stub/rails_apps/2.3/mycook/public/javascripts/controls.js +0 -963
  160. data/test/stub/rails_apps/2.3/mycook/public/javascripts/dragdrop.js +0 -973
  161. data/test/stub/rails_apps/2.3/mycook/public/javascripts/effects.js +0 -1128
  162. data/test/stub/rails_apps/2.3/mycook/public/javascripts/prototype.js +0 -4320
@@ -1,10 +1,10 @@
1
1
  #! /bin/sh
2
2
  # Attempt to guess a canonical system name.
3
3
  # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
4
- # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
5
- # Free Software Foundation, Inc.
4
+ # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
5
+ # 2011, 2012 Free Software Foundation, Inc.
6
6
 
7
- timestamp='2008-01-23'
7
+ timestamp='2012-02-10'
8
8
 
9
9
  # This file is free software; you can redistribute it and/or modify it
10
10
  # under the terms of the GNU General Public License as published by
@@ -17,9 +17,7 @@ timestamp='2008-01-23'
17
17
  # General Public License for more details.
18
18
  #
19
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.
20
+ # along with this program; if not, see <http://www.gnu.org/licenses/>.
23
21
  #
24
22
  # As a special exception to the GNU General Public License, if you
25
23
  # distribute this file as part of a program that contains a
@@ -27,16 +25,16 @@ timestamp='2008-01-23'
27
25
  # the same distribution terms that you use for the rest of that program.
28
26
 
29
27
 
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.
28
+ # Originally written by Per Bothner. Please send patches (context
29
+ # diff format) to <config-patches@gnu.org> and include a ChangeLog
30
+ # entry.
33
31
  #
34
32
  # This script attempts to guess a canonical system name similar to
35
33
  # config.sub. If it succeeds, it prints the system name on stdout, and
36
34
  # exits with 0. Otherwise, it exits with 1.
37
35
  #
38
- # The plan is that this can be called by configure scripts if you
39
- # don't specify an explicit build system type.
36
+ # You can get the latest version of this script from:
37
+ # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
40
38
 
41
39
  me=`echo "$0" | sed -e 's,.*/,,'`
42
40
 
@@ -56,8 +54,9 @@ version="\
56
54
  GNU config.guess ($timestamp)
57
55
 
58
56
  Originally written by Per Bothner.
59
- Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
60
- 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
57
+ Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
58
+ 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
59
+ Free Software Foundation, Inc.
61
60
 
62
61
  This is free software; see the source for copying conditions. There is NO
63
62
  warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -139,12 +138,22 @@ UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
139
138
  UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
140
139
  UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
141
140
 
141
+ case "${UNAME_MACHINE}" in
142
+ i?86)
143
+ test -z "$VENDOR" && VENDOR=pc
144
+ ;;
145
+ *)
146
+ test -z "$VENDOR" && VENDOR=unknown
147
+ ;;
148
+ esac
149
+ test -f /etc/SuSE-release -o -f /.buildenv && VENDOR=suse
150
+
142
151
  # Note: order is significant - the case branches are not exclusive.
143
152
 
144
153
  case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
145
154
  *:NetBSD:*:*)
146
155
  # NetBSD (nbsd) targets should (where applicable) match one or
147
- # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
156
+ # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
148
157
  # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
149
158
  # switched to ELF, *-*-netbsd* would select the old
150
159
  # object file format. This provides both forward
@@ -170,7 +179,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
170
179
  arm*|i386|m68k|ns32k|sh3*|sparc|vax)
171
180
  eval $set_cc_for_build
172
181
  if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
173
- | grep __ELF__ >/dev/null
182
+ | grep -q __ELF__
174
183
  then
175
184
  # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
176
185
  # Return netbsd for either. FIX?
@@ -180,7 +189,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
180
189
  fi
181
190
  ;;
182
191
  *)
183
- os=netbsd
192
+ os=netbsd
184
193
  ;;
185
194
  esac
186
195
  # The OS release
@@ -203,19 +212,19 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
203
212
  exit ;;
204
213
  *:OpenBSD:*:*)
205
214
  UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
206
- echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
215
+ echo ${UNAME_MACHINE_ARCH}-${VENDOR}-openbsd${UNAME_RELEASE}
207
216
  exit ;;
208
217
  *:ekkoBSD:*:*)
209
- echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
218
+ echo ${UNAME_MACHINE}-${VENDOR}-ekkobsd${UNAME_RELEASE}
210
219
  exit ;;
211
220
  *:SolidBSD:*:*)
212
- echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
221
+ echo ${UNAME_MACHINE}-${VENDOR}-solidbsd${UNAME_RELEASE}
213
222
  exit ;;
214
223
  macppc:MirBSD:*:*)
215
- echo powerpc-unknown-mirbsd${UNAME_RELEASE}
224
+ echo powerpc-${VENDOR}-mirbsd${UNAME_RELEASE}
216
225
  exit ;;
217
226
  *:MirBSD:*:*)
218
- echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
227
+ echo ${UNAME_MACHINE}-${VENDOR}-mirbsd${UNAME_RELEASE}
219
228
  exit ;;
220
229
  alpha:OSF1:*:*)
221
230
  case $UNAME_RELEASE in
@@ -223,7 +232,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
223
232
  UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
224
233
  ;;
225
234
  *5.*)
226
- UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
235
+ UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
227
236
  ;;
228
237
  esac
229
238
  # According to Compaq, /usr/sbin/psrinfo has been available on
@@ -269,7 +278,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
269
278
  # A Xn.n version is an unreleased experimental baselevel.
270
279
  # 1.2 uses "1.2" for uname -r.
271
280
  echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
272
- exit ;;
281
+ # Reset EXIT trap before exiting to avoid spurious non-zero exit code.
282
+ exitcode=$?
283
+ trap '' 0
284
+ exit $exitcode ;;
273
285
  Alpha\ *:Windows_NT*:*)
274
286
  # How do we know it's Interix rather than the generic POSIX subsystem?
275
287
  # Should we change UNAME_MACHINE based on the output of uname instead
@@ -280,13 +292,13 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
280
292
  echo alpha-dec-winnt3.5
281
293
  exit ;;
282
294
  Amiga*:UNIX_System_V:4.0:*)
283
- echo m68k-unknown-sysv4
295
+ echo m68k-${VENDOR}-sysv4
284
296
  exit ;;
285
297
  *:[Aa]miga[Oo][Ss]:*:*)
286
- echo ${UNAME_MACHINE}-unknown-amigaos
298
+ echo ${UNAME_MACHINE}-${VENDOR}-amigaos
287
299
  exit ;;
288
300
  *:[Mm]orph[Oo][Ss]:*:*)
289
- echo ${UNAME_MACHINE}-unknown-morphos
301
+ echo ${UNAME_MACHINE}-${VENDOR}-morphos
290
302
  exit ;;
291
303
  *:OS/390:*:*)
292
304
  echo i370-ibm-openedition
@@ -295,13 +307,13 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
295
307
  echo s390-ibm-zvmoe
296
308
  exit ;;
297
309
  *:OS400:*:*)
298
- echo powerpc-ibm-os400
310
+ echo powerpc-ibm-os400
299
311
  exit ;;
300
312
  arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
301
313
  echo arm-acorn-riscix${UNAME_RELEASE}
302
314
  exit ;;
303
315
  arm:riscos:*:*|arm:RISCOS:*:*)
304
- echo arm-unknown-riscos
316
+ echo arm-${VENDOR}-riscos
305
317
  exit ;;
306
318
  SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
307
319
  echo hppa1.1-hitachi-hiuxmpp
@@ -324,14 +336,33 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
324
336
  case `/usr/bin/uname -p` in
325
337
  sparc) echo sparc-icl-nx7; exit ;;
326
338
  esac ;;
339
+ s390x:SunOS:*:*)
340
+ echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
341
+ exit ;;
327
342
  sun4H:SunOS:5.*:*)
328
343
  echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
329
344
  exit ;;
330
345
  sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
331
346
  echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
332
347
  exit ;;
348
+ i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
349
+ echo i386-pc-auroraux${UNAME_RELEASE}
350
+ exit ;;
333
351
  i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
334
- echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
352
+ eval $set_cc_for_build
353
+ SUN_ARCH="i386"
354
+ # If there is a compiler, see if it is configured for 64-bit objects.
355
+ # Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
356
+ # This test works for both compilers.
357
+ if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
358
+ if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
359
+ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
360
+ grep IS_64BIT_ARCH >/dev/null
361
+ then
362
+ SUN_ARCH="x86_64"
363
+ fi
364
+ fi
365
+ echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
335
366
  exit ;;
336
367
  sun4*:SunOS:6*:*)
337
368
  # According to config.sub, this is the proper way to canonicalize
@@ -375,23 +406,23 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
375
406
  # MiNT. But MiNT is downward compatible to TOS, so this should
376
407
  # be no problem.
377
408
  atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
378
- echo m68k-atari-mint${UNAME_RELEASE}
409
+ echo m68k-atari-mint${UNAME_RELEASE}
379
410
  exit ;;
380
411
  atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
381
412
  echo m68k-atari-mint${UNAME_RELEASE}
382
- exit ;;
413
+ exit ;;
383
414
  *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
384
- echo m68k-atari-mint${UNAME_RELEASE}
415
+ echo m68k-atari-mint${UNAME_RELEASE}
385
416
  exit ;;
386
417
  milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
387
- echo m68k-milan-mint${UNAME_RELEASE}
388
- exit ;;
418
+ echo m68k-milan-mint${UNAME_RELEASE}
419
+ exit ;;
389
420
  hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
390
- echo m68k-hades-mint${UNAME_RELEASE}
391
- exit ;;
421
+ echo m68k-hades-mint${UNAME_RELEASE}
422
+ exit ;;
392
423
  *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
393
- echo m68k-unknown-mint${UNAME_RELEASE}
394
- exit ;;
424
+ echo m68k-${VENDOR}-mint${UNAME_RELEASE}
425
+ exit ;;
395
426
  m68k:machten:*:*)
396
427
  echo m68k-apple-machten${UNAME_RELEASE}
397
428
  exit ;;
@@ -461,8 +492,8 @@ EOF
461
492
  echo m88k-motorola-sysv3
462
493
  exit ;;
463
494
  AViiON:dgux:*:*)
464
- # DG/UX returns AViiON for all architectures
465
- UNAME_PROCESSOR=`/usr/bin/uname -p`
495
+ # DG/UX returns AViiON for all architectures
496
+ UNAME_PROCESSOR=`/usr/bin/uname -p`
466
497
  if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
467
498
  then
468
499
  if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
@@ -475,7 +506,7 @@ EOF
475
506
  else
476
507
  echo i586-dg-dgux${UNAME_RELEASE}
477
508
  fi
478
- exit ;;
509
+ exit ;;
479
510
  M88*:DolphinOS:*:*) # DolphinOS (SVR3)
480
511
  echo m88k-dolphin-sysv3
481
512
  exit ;;
@@ -532,7 +563,7 @@ EOF
532
563
  echo rs6000-ibm-aix3.2
533
564
  fi
534
565
  exit ;;
535
- *:AIX:*:[456])
566
+ *:AIX:*:[4567])
536
567
  IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
537
568
  if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
538
569
  IBM_ARCH=rs6000
@@ -575,52 +606,52 @@ EOF
575
606
  9000/[678][0-9][0-9])
576
607
  if [ -x /usr/bin/getconf ]; then
577
608
  sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
578
- sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
579
- case "${sc_cpu_version}" in
580
- 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
581
- 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
582
- 532) # CPU_PA_RISC2_0
583
- case "${sc_kernel_bits}" in
584
- 32) HP_ARCH="hppa2.0n" ;;
585
- 64) HP_ARCH="hppa2.0w" ;;
609
+ sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
610
+ case "${sc_cpu_version}" in
611
+ 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
612
+ 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
613
+ 532) # CPU_PA_RISC2_0
614
+ case "${sc_kernel_bits}" in
615
+ 32) HP_ARCH="hppa2.0n" ;;
616
+ 64) HP_ARCH="hppa2.0w" ;;
586
617
  '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20
587
- esac ;;
588
- esac
618
+ esac ;;
619
+ esac
589
620
  fi
590
621
  if [ "${HP_ARCH}" = "" ]; then
591
622
  eval $set_cc_for_build
592
- sed 's/^ //' << EOF >$dummy.c
623
+ sed 's/^ //' << EOF >$dummy.c
593
624
 
594
- #define _HPUX_SOURCE
595
- #include <stdlib.h>
596
- #include <unistd.h>
625
+ #define _HPUX_SOURCE
626
+ #include <stdlib.h>
627
+ #include <unistd.h>
597
628
 
598
- int main ()
599
- {
600
- #if defined(_SC_KERNEL_BITS)
601
- long bits = sysconf(_SC_KERNEL_BITS);
602
- #endif
603
- long cpu = sysconf (_SC_CPU_VERSION);
629
+ int main ()
630
+ {
631
+ #if defined(_SC_KERNEL_BITS)
632
+ long bits = sysconf(_SC_KERNEL_BITS);
633
+ #endif
634
+ long cpu = sysconf (_SC_CPU_VERSION);
604
635
 
605
- switch (cpu)
606
- {
607
- case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
608
- case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
609
- case CPU_PA_RISC2_0:
610
- #if defined(_SC_KERNEL_BITS)
611
- switch (bits)
612
- {
613
- case 64: puts ("hppa2.0w"); break;
614
- case 32: puts ("hppa2.0n"); break;
615
- default: puts ("hppa2.0"); break;
616
- } break;
617
- #else /* !defined(_SC_KERNEL_BITS) */
618
- puts ("hppa2.0"); break;
619
- #endif
620
- default: puts ("hppa1.0"); break;
621
- }
622
- exit (0);
623
- }
636
+ switch (cpu)
637
+ {
638
+ case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
639
+ case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
640
+ case CPU_PA_RISC2_0:
641
+ #if defined(_SC_KERNEL_BITS)
642
+ switch (bits)
643
+ {
644
+ case 64: puts ("hppa2.0w"); break;
645
+ case 32: puts ("hppa2.0n"); break;
646
+ default: puts ("hppa2.0"); break;
647
+ } break;
648
+ #else /* !defined(_SC_KERNEL_BITS) */
649
+ puts ("hppa2.0"); break;
650
+ #endif
651
+ default: puts ("hppa1.0"); break;
652
+ }
653
+ exit (0);
654
+ }
624
655
  EOF
625
656
  (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
626
657
  test -z "$HP_ARCH" && HP_ARCH=hppa
@@ -640,7 +671,7 @@ EOF
640
671
  # => hppa64-hp-hpux11.23
641
672
 
642
673
  if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
643
- grep __LP64__ >/dev/null
674
+ grep -q __LP64__
644
675
  then
645
676
  HP_ARCH="hppa2.0w"
646
677
  else
@@ -701,9 +732,9 @@ EOF
701
732
  exit ;;
702
733
  i*86:OSF1:*:*)
703
734
  if [ -x /usr/sbin/sysversion ] ; then
704
- echo ${UNAME_MACHINE}-unknown-osf1mk
735
+ echo ${UNAME_MACHINE}-${VENDOR}-osf1mk
705
736
  else
706
- echo ${UNAME_MACHINE}-unknown-osf1
737
+ echo ${UNAME_MACHINE}-${VENDOR}-osf1
707
738
  fi
708
739
  exit ;;
709
740
  parisc*:Lites*:*:*)
@@ -711,22 +742,22 @@ EOF
711
742
  exit ;;
712
743
  C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
713
744
  echo c1-convex-bsd
714
- exit ;;
745
+ exit ;;
715
746
  C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
716
747
  if getsysinfo -f scalar_acc
717
748
  then echo c32-convex-bsd
718
749
  else echo c2-convex-bsd
719
750
  fi
720
- exit ;;
751
+ exit ;;
721
752
  C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
722
753
  echo c34-convex-bsd
723
- exit ;;
754
+ exit ;;
724
755
  C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
725
756
  echo c38-convex-bsd
726
- exit ;;
757
+ exit ;;
727
758
  C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
728
759
  echo c4-convex-bsd
729
- exit ;;
760
+ exit ;;
730
761
  CRAY*Y-MP:*:*:*)
731
762
  echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
732
763
  exit ;;
@@ -750,32 +781,31 @@ EOF
750
781
  exit ;;
751
782
  F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
752
783
  FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
753
- FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
754
- FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
755
- echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
756
- exit ;;
784
+ FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
785
+ FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
786
+ echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
787
+ exit ;;
757
788
  5000:UNIX_System_V:4.*:*)
758
- FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
759
- FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
760
- echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
789
+ FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
790
+ FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
791
+ echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
761
792
  exit ;;
762
793
  i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
763
794
  echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
764
795
  exit ;;
765
796
  sparc*:BSD/OS:*:*)
766
- echo sparc-unknown-bsdi${UNAME_RELEASE}
797
+ echo sparc-${VENDOR}-bsdi${UNAME_RELEASE}
767
798
  exit ;;
768
799
  *:BSD/OS:*:*)
769
- echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
800
+ echo ${UNAME_MACHINE}-${VENDOR}-bsdi${UNAME_RELEASE}
770
801
  exit ;;
771
802
  *:FreeBSD:*:*)
772
- case ${UNAME_MACHINE} in
773
- pc98)
774
- echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
803
+ UNAME_PROCESSOR=`/usr/bin/uname -p`
804
+ case ${UNAME_PROCESSOR} in
775
805
  amd64)
776
- echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
806
+ echo x86_64-${VENDOR}-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
777
807
  *)
778
- echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
808
+ echo ${UNAME_PROCESSOR}-${VENDOR}-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
779
809
  esac
780
810
  exit ;;
781
811
  i*:CYGWIN*:*)
@@ -784,28 +814,34 @@ EOF
784
814
  *:MINGW*:*)
785
815
  echo ${UNAME_MACHINE}-pc-mingw32
786
816
  exit ;;
817
+ i*:MSYS*:*)
818
+ echo ${UNAME_MACHINE}-pc-msys
819
+ exit ;;
787
820
  i*:windows32*:*)
788
- # uname -m includes "-pc" on this system.
789
- echo ${UNAME_MACHINE}-mingw32
821
+ # uname -m includes "-pc" on this system.
822
+ echo ${UNAME_MACHINE}-mingw32
790
823
  exit ;;
791
824
  i*:PW*:*)
792
825
  echo ${UNAME_MACHINE}-pc-pw32
793
826
  exit ;;
794
- *:Interix*:[3456]*)
795
- case ${UNAME_MACHINE} in
827
+ *:Interix*:*)
828
+ case ${UNAME_MACHINE} in
796
829
  x86)
797
830
  echo i586-pc-interix${UNAME_RELEASE}
798
831
  exit ;;
799
- EM64T | authenticamd)
800
- echo x86_64-unknown-interix${UNAME_RELEASE}
832
+ authenticamd | genuineintel | EM64T)
833
+ echo x86_64-${VENDOR}-interix${UNAME_RELEASE}
801
834
  exit ;;
802
835
  IA64)
803
- echo ia64-unknown-interix${UNAME_RELEASE}
836
+ echo ia64-${VENDOR}-interix${UNAME_RELEASE}
804
837
  exit ;;
805
838
  esac ;;
806
839
  [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
807
840
  echo i${UNAME_MACHINE}-pc-mks
808
841
  exit ;;
842
+ 8664:Windows_NT:*)
843
+ echo x86_64-pc-mks
844
+ exit ;;
809
845
  i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
810
846
  # How do we know it's Interix rather than the generic POSIX subsystem?
811
847
  # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
@@ -816,220 +852,163 @@ EOF
816
852
  echo ${UNAME_MACHINE}-pc-uwin
817
853
  exit ;;
818
854
  amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
819
- echo x86_64-unknown-cygwin
855
+ echo x86_64-${VENDOR}-cygwin
820
856
  exit ;;
821
857
  p*:CYGWIN*:*)
822
- echo powerpcle-unknown-cygwin
858
+ echo powerpcle-${VENDOR}-cygwin
823
859
  exit ;;
824
860
  prep*:SunOS:5.*:*)
825
- echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
861
+ echo powerpcle-${VENDOR}-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
826
862
  exit ;;
827
863
  *:GNU:*:*)
828
864
  # the GNU system
829
- echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
865
+ echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-${VENDOR}-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
830
866
  exit ;;
831
867
  *:GNU/*:*:*)
832
868
  # other systems with GNU libc and userland
833
- echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
869
+ echo ${UNAME_MACHINE}-${VENDOR}-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
834
870
  exit ;;
835
871
  i*86:Minix:*:*)
836
872
  echo ${UNAME_MACHINE}-pc-minix
837
873
  exit ;;
874
+ aarch64:Linux:*:*)
875
+ echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
876
+ exit ;;
877
+ aarch64_be:Linux:*:*)
878
+ UNAME_MACHINE=aarch64_be
879
+ echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
880
+ exit ;;
881
+ alpha:Linux:*:*)
882
+ case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
883
+ EV5) UNAME_MACHINE=alphaev5 ;;
884
+ EV56) UNAME_MACHINE=alphaev56 ;;
885
+ PCA56) UNAME_MACHINE=alphapca56 ;;
886
+ PCA57) UNAME_MACHINE=alphapca56 ;;
887
+ EV6) UNAME_MACHINE=alphaev6 ;;
888
+ EV67) UNAME_MACHINE=alphaev67 ;;
889
+ EV68*) UNAME_MACHINE=alphaev68 ;;
890
+ esac
891
+ objdump --private-headers /bin/sh | grep -q ld.so.1
892
+ if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
893
+ echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu${LIBC}
894
+ exit ;;
838
895
  arm*:Linux:*:*)
839
896
  eval $set_cc_for_build
840
897
  if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
841
898
  | grep -q __ARM_EABI__
842
899
  then
843
- echo ${UNAME_MACHINE}-unknown-linux-gnu
900
+ echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
844
901
  else
845
- echo ${UNAME_MACHINE}-unknown-linux-gnueabi
902
+ if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
903
+ | grep -q __ARM_PCS_VFP
904
+ then
905
+ echo ${UNAME_MACHINE}-${VENDOR}-linux-gnueabi
906
+ else
907
+ echo ${UNAME_MACHINE}-${VENDOR}-linux-gnueabihf
908
+ fi
846
909
  fi
847
910
  exit ;;
848
911
  avr32*:Linux:*:*)
849
- echo ${UNAME_MACHINE}-unknown-linux-gnu
912
+ echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
850
913
  exit ;;
851
914
  cris:Linux:*:*)
852
- echo cris-axis-linux-gnu
915
+ echo ${UNAME_MACHINE}-axis-linux-gnu
853
916
  exit ;;
854
917
  crisv32:Linux:*:*)
855
- echo crisv32-axis-linux-gnu
918
+ echo ${UNAME_MACHINE}-axis-linux-gnu
856
919
  exit ;;
857
920
  frv:Linux:*:*)
858
- echo frv-unknown-linux-gnu
921
+ echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
922
+ exit ;;
923
+ hexagon:Linux:*:*)
924
+ echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
925
+ exit ;;
926
+ i*86:Linux:*:*)
927
+ LIBC=gnu
928
+ eval $set_cc_for_build
929
+ sed 's/^ //' << EOF >$dummy.c
930
+ #ifdef __dietlibc__
931
+ LIBC=dietlibc
932
+ #endif
933
+ EOF
934
+ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
935
+ echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
859
936
  exit ;;
860
937
  ia64:Linux:*:*)
861
- echo ${UNAME_MACHINE}-unknown-linux-gnu
938
+ echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
862
939
  exit ;;
863
940
  m32r*:Linux:*:*)
864
- echo ${UNAME_MACHINE}-unknown-linux-gnu
941
+ echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
865
942
  exit ;;
866
943
  m68*:Linux:*:*)
867
- echo ${UNAME_MACHINE}-unknown-linux-gnu
944
+ echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
868
945
  exit ;;
869
- mips:Linux:*:*)
946
+ mips:Linux:*:* | mips64:Linux:*:*)
870
947
  eval $set_cc_for_build
871
948
  sed 's/^ //' << EOF >$dummy.c
872
949
  #undef CPU
873
- #undef mips
874
- #undef mipsel
950
+ #undef ${UNAME_MACHINE}
951
+ #undef ${UNAME_MACHINE}el
875
952
  #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
876
- CPU=mipsel
953
+ CPU=${UNAME_MACHINE}el
877
954
  #else
878
955
  #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
879
- CPU=mips
956
+ CPU=${UNAME_MACHINE}
880
957
  #else
881
958
  CPU=
882
959
  #endif
883
960
  #endif
884
961
  EOF
885
- eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
886
- /^CPU/{
887
- s: ::g
888
- p
889
- }'`"
890
- test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
891
- ;;
892
- mips64:Linux:*:*)
893
- eval $set_cc_for_build
894
- sed 's/^ //' << EOF >$dummy.c
895
- #undef CPU
896
- #undef mips64
897
- #undef mips64el
898
- #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
899
- CPU=mips64el
900
- #else
901
- #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
902
- CPU=mips64
903
- #else
904
- CPU=
905
- #endif
906
- #endif
907
- EOF
908
- eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
909
- /^CPU/{
910
- s: ::g
911
- p
912
- }'`"
913
- test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
962
+ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
963
+ test x"${CPU}" != x && { echo "${CPU}-${VENDOR}-linux-gnu"; exit; }
914
964
  ;;
915
965
  or32:Linux:*:*)
916
- echo or32-unknown-linux-gnu
966
+ echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
917
967
  exit ;;
918
- ppc:Linux:*:*)
919
- echo powerpc-unknown-linux-gnu
920
- exit ;;
921
- ppc64:Linux:*:*)
922
- echo powerpc64-unknown-linux-gnu
968
+ padre:Linux:*:*)
969
+ echo sparc-${VENDOR}-linux-gnu
923
970
  exit ;;
924
- alpha:Linux:*:*)
925
- case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
926
- EV5) UNAME_MACHINE=alphaev5 ;;
927
- EV56) UNAME_MACHINE=alphaev56 ;;
928
- PCA56) UNAME_MACHINE=alphapca56 ;;
929
- PCA57) UNAME_MACHINE=alphapca56 ;;
930
- EV6) UNAME_MACHINE=alphaev6 ;;
931
- EV67) UNAME_MACHINE=alphaev67 ;;
932
- EV68*) UNAME_MACHINE=alphaev68 ;;
933
- esac
934
- objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
935
- if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
936
- echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
971
+ parisc64:Linux:*:* | hppa64:Linux:*:*)
972
+ echo hppa64-${VENDOR}-linux-gnu
937
973
  exit ;;
938
974
  parisc:Linux:*:* | hppa:Linux:*:*)
939
975
  # Look for CPU level
940
976
  case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
941
- PA7*) echo hppa1.1-unknown-linux-gnu ;;
942
- PA8*) echo hppa2.0-unknown-linux-gnu ;;
943
- *) echo hppa-unknown-linux-gnu ;;
977
+ PA7*) echo hppa1.1-${VENDOR}-linux-gnu ;;
978
+ PA8*) echo hppa2.0-${VENDOR}-linux-gnu ;;
979
+ *) echo hppa-${VENDOR}-linux-gnu ;;
944
980
  esac
945
981
  exit ;;
946
- parisc64:Linux:*:* | hppa64:Linux:*:*)
947
- echo hppa64-unknown-linux-gnu
982
+ ppc64:Linux:*:*)
983
+ echo powerpc64-${VENDOR}-linux-gnu
984
+ exit ;;
985
+ ppc:Linux:*:*)
986
+ echo powerpc-${VENDOR}-linux-gnu
948
987
  exit ;;
949
988
  s390:Linux:*:* | s390x:Linux:*:*)
950
989
  echo ${UNAME_MACHINE}-ibm-linux
951
990
  exit ;;
952
991
  sh64*:Linux:*:*)
953
- echo ${UNAME_MACHINE}-unknown-linux-gnu
992
+ echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
954
993
  exit ;;
955
994
  sh*:Linux:*:*)
956
- echo ${UNAME_MACHINE}-unknown-linux-gnu
995
+ echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
957
996
  exit ;;
958
997
  sparc:Linux:*:* | sparc64:Linux:*:*)
959
- echo ${UNAME_MACHINE}-unknown-linux-gnu
998
+ echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
999
+ exit ;;
1000
+ tile*:Linux:*:*)
1001
+ echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
960
1002
  exit ;;
961
1003
  vax:Linux:*:*)
962
1004
  echo ${UNAME_MACHINE}-dec-linux-gnu
963
1005
  exit ;;
964
1006
  x86_64:Linux:*:*)
965
- echo x86_64-unknown-linux-gnu
1007
+ echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
966
1008
  exit ;;
967
1009
  xtensa*:Linux:*:*)
968
- echo ${UNAME_MACHINE}-unknown-linux-gnu
1010
+ echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
969
1011
  exit ;;
970
- i*86:Linux:*:*)
971
- # The BFD linker knows what the default object file format is, so
972
- # first see if it will tell us. cd to the root directory to prevent
973
- # problems with other programs or directories called `ld' in the path.
974
- # Set LC_ALL=C to ensure ld outputs messages in English.
975
- ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
976
- | sed -ne '/supported targets:/!d
977
- s/[ ][ ]*/ /g
978
- s/.*supported targets: *//
979
- s/ .*//
980
- p'`
981
- case "$ld_supported_targets" in
982
- elf32-i386)
983
- TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
984
- ;;
985
- a.out-i386-linux)
986
- echo "${UNAME_MACHINE}-pc-linux-gnuaout"
987
- exit ;;
988
- coff-i386)
989
- echo "${UNAME_MACHINE}-pc-linux-gnucoff"
990
- exit ;;
991
- "")
992
- # Either a pre-BFD a.out linker (linux-gnuoldld) or
993
- # one that does not give us useful --help.
994
- echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
995
- exit ;;
996
- esac
997
- # Determine whether the default compiler is a.out or elf
998
- eval $set_cc_for_build
999
- sed 's/^ //' << EOF >$dummy.c
1000
- #include <features.h>
1001
- #ifdef __ELF__
1002
- # ifdef __GLIBC__
1003
- # if __GLIBC__ >= 2
1004
- LIBC=gnu
1005
- # else
1006
- LIBC=gnulibc1
1007
- # endif
1008
- # else
1009
- LIBC=gnulibc1
1010
- # endif
1011
- #else
1012
- #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
1013
- LIBC=gnu
1014
- #else
1015
- LIBC=gnuaout
1016
- #endif
1017
- #endif
1018
- #ifdef __dietlibc__
1019
- LIBC=dietlibc
1020
- #endif
1021
- EOF
1022
- eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
1023
- /^LIBC/{
1024
- s: ::g
1025
- p
1026
- }'`"
1027
- test x"${LIBC}" != x && {
1028
- echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
1029
- exit
1030
- }
1031
- test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; }
1032
- ;;
1033
1012
  i*86:DYNIX/ptx:4*:*)
1034
1013
  # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
1035
1014
  # earlier versions are messed up and put the nodename in both
@@ -1037,11 +1016,11 @@ EOF
1037
1016
  echo i386-sequent-sysv4
1038
1017
  exit ;;
1039
1018
  i*86:UNIX_SV:4.2MP:2.*)
1040
- # Unixware is an offshoot of SVR4, but it has its own version
1041
- # number series starting with 2...
1042
- # I am not positive that other SVR4 systems won't match this,
1019
+ # Unixware is an offshoot of SVR4, but it has its own version
1020
+ # number series starting with 2...
1021
+ # I am not positive that other SVR4 systems won't match this,
1043
1022
  # I just have to hope. -- rms.
1044
- # Use sysv4.2uw... so that sysv4* matches it.
1023
+ # Use sysv4.2uw... so that sysv4* matches it.
1045
1024
  echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
1046
1025
  exit ;;
1047
1026
  i*86:OS/2:*:*)
@@ -1050,16 +1029,16 @@ EOF
1050
1029
  echo ${UNAME_MACHINE}-pc-os2-emx
1051
1030
  exit ;;
1052
1031
  i*86:XTS-300:*:STOP)
1053
- echo ${UNAME_MACHINE}-unknown-stop
1032
+ echo ${UNAME_MACHINE}-${VENDOR}-stop
1054
1033
  exit ;;
1055
1034
  i*86:atheos:*:*)
1056
- echo ${UNAME_MACHINE}-unknown-atheos
1035
+ echo ${UNAME_MACHINE}-${VENDOR}-atheos
1057
1036
  exit ;;
1058
1037
  i*86:syllable:*:*)
1059
1038
  echo ${UNAME_MACHINE}-pc-syllable
1060
1039
  exit ;;
1061
- i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
1062
- echo i386-unknown-lynxos${UNAME_RELEASE}
1040
+ i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
1041
+ echo i386-${VENODR}-lynxos${UNAME_RELEASE}
1063
1042
  exit ;;
1064
1043
  i*86:*DOS:*:*)
1065
1044
  echo ${UNAME_MACHINE}-pc-msdosdjgpp
@@ -1073,13 +1052,13 @@ EOF
1073
1052
  fi
1074
1053
  exit ;;
1075
1054
  i*86:*:5:[678]*)
1076
- # UnixWare 7.x, OpenUNIX and OpenServer 6.
1055
+ # UnixWare 7.x, OpenUNIX and OpenServer 6.
1077
1056
  case `/bin/uname -X | grep "^Machine"` in
1078
1057
  *486*) UNAME_MACHINE=i486 ;;
1079
1058
  *Pentium) UNAME_MACHINE=i586 ;;
1080
1059
  *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
1081
1060
  esac
1082
- echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
1061
+ echo ${UNAME_MACHINE}-${VENDOR}-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
1083
1062
  exit ;;
1084
1063
  i*86:*:3.2:*)
1085
1064
  if test -f /usr/options/cb.name; then
@@ -1101,10 +1080,13 @@ EOF
1101
1080
  exit ;;
1102
1081
  pc:*:*:*)
1103
1082
  # Left here for compatibility:
1104
- # uname -m prints for DJGPP always 'pc', but it prints nothing about
1105
- # the processor, so we play safe by assuming i386.
1106
- echo i386-pc-msdosdjgpp
1107
- exit ;;
1083
+ # uname -m prints for DJGPP always 'pc', but it prints nothing about
1084
+ # the processor, so we play safe by assuming i586.
1085
+ # Note: whatever this is, it MUST be the same as what config.sub
1086
+ # prints for the "djgpp" host, or else GDB configury will decide that
1087
+ # this is a cross-build.
1088
+ echo i586-pc-msdosdjgpp
1089
+ exit ;;
1108
1090
  Intel:Mach:3*:*)
1109
1091
  echo i386-pc-mach3
1110
1092
  exit ;;
@@ -1115,7 +1097,7 @@ EOF
1115
1097
  if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
1116
1098
  echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
1117
1099
  else # Add other i860-SVR4 vendors below as they are discovered.
1118
- echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
1100
+ echo i860-${VENODR}-sysv${UNAME_RELEASE} # Unknown i860-SVR4
1119
1101
  fi
1120
1102
  exit ;;
1121
1103
  mini*:CTIX:SYS*5:*)
@@ -1139,22 +1121,32 @@ EOF
1139
1121
  /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
1140
1122
  && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
1141
1123
  3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
1142
- /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1143
- && { echo i486-ncr-sysv4; exit; } ;;
1124
+ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1125
+ && { echo i486-ncr-sysv4; exit; } ;;
1126
+ NCR*:*:4.2:* | MPRAS*:*:4.2:*)
1127
+ OS_REL='.3'
1128
+ test -r /etc/.relid \
1129
+ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
1130
+ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1131
+ && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
1132
+ /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
1133
+ && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
1134
+ /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
1135
+ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
1144
1136
  m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
1145
- echo m68k-unknown-lynxos${UNAME_RELEASE}
1137
+ echo m68k-${VENDOR}-lynxos${UNAME_RELEASE}
1146
1138
  exit ;;
1147
1139
  mc68030:UNIX_System_V:4.*:*)
1148
1140
  echo m68k-atari-sysv4
1149
1141
  exit ;;
1150
1142
  TSUNAMI:LynxOS:2.*:*)
1151
- echo sparc-unknown-lynxos${UNAME_RELEASE}
1143
+ echo sparc-${VENDOR}-lynxos${UNAME_RELEASE}
1152
1144
  exit ;;
1153
1145
  rs6000:LynxOS:2.*:*)
1154
- echo rs6000-unknown-lynxos${UNAME_RELEASE}
1146
+ echo rs6000-${VENDOR}-lynxos${UNAME_RELEASE}
1155
1147
  exit ;;
1156
- PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
1157
- echo powerpc-unknown-lynxos${UNAME_RELEASE}
1148
+ PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
1149
+ echo powerpc-${VENDOR}-lynxos${UNAME_RELEASE}
1158
1150
  exit ;;
1159
1151
  SM[BE]S:UNIX_SV:*:*)
1160
1152
  echo mips-dde-sysv${UNAME_RELEASE}
@@ -1173,10 +1165,10 @@ EOF
1173
1165
  echo ns32k-sni-sysv
1174
1166
  fi
1175
1167
  exit ;;
1176
- PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
1177
- # says <Richard.M.Bartel@ccMail.Census.GOV>
1178
- echo i586-unisys-sysv4
1179
- exit ;;
1168
+ PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
1169
+ # says <Richard.M.Bartel@ccMail.Census.GOV>
1170
+ echo i586-unisys-sysv4
1171
+ exit ;;
1180
1172
  *:UNIX_System_V:4*:FTX*)
1181
1173
  # From Gerald Hewes <hewes@openmarket.com>.
1182
1174
  # How about differentiating between stratus architectures? -djm
@@ -1202,11 +1194,11 @@ EOF
1202
1194
  exit ;;
1203
1195
  R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
1204
1196
  if [ -d /usr/nec ]; then
1205
- echo mips-nec-sysv${UNAME_RELEASE}
1197
+ echo mips-nec-sysv${UNAME_RELEASE}
1206
1198
  else
1207
- echo mips-unknown-sysv${UNAME_RELEASE}
1199
+ echo mips-${VENDOR}-sysv${UNAME_RELEASE}
1208
1200
  fi
1209
- exit ;;
1201
+ exit ;;
1210
1202
  BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
1211
1203
  echo powerpc-be-beos
1212
1204
  exit ;;
@@ -1216,6 +1208,9 @@ EOF
1216
1208
  BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
1217
1209
  echo i586-pc-beos
1218
1210
  exit ;;
1211
+ BePC:Haiku:*:*) # Haiku running on Intel PC compatible.
1212
+ echo i586-pc-haiku
1213
+ exit ;;
1219
1214
  SX-4:SUPER-UX:*:*)
1220
1215
  echo sx4-nec-superux${UNAME_RELEASE}
1221
1216
  exit ;;
@@ -1243,6 +1238,16 @@ EOF
1243
1238
  *:Darwin:*:*)
1244
1239
  UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
1245
1240
  case $UNAME_PROCESSOR in
1241
+ i386)
1242
+ eval $set_cc_for_build
1243
+ if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
1244
+ if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
1245
+ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
1246
+ grep IS_64BIT_ARCH >/dev/null
1247
+ then
1248
+ UNAME_PROCESSOR="x86_64"
1249
+ fi
1250
+ fi ;;
1246
1251
  unknown) UNAME_PROCESSOR=powerpc ;;
1247
1252
  esac
1248
1253
  echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
@@ -1258,6 +1263,9 @@ EOF
1258
1263
  *:QNX:*:4*)
1259
1264
  echo i386-pc-qnx
1260
1265
  exit ;;
1266
+ NEO-?:NONSTOP_KERNEL:*:*)
1267
+ echo neo-tandem-nsk${UNAME_RELEASE}
1268
+ exit ;;
1261
1269
  NSE-?:NONSTOP_KERNEL:*:*)
1262
1270
  echo nse-tandem-nsk${UNAME_RELEASE}
1263
1271
  exit ;;
@@ -1282,13 +1290,13 @@ EOF
1282
1290
  else
1283
1291
  UNAME_MACHINE="$cputype"
1284
1292
  fi
1285
- echo ${UNAME_MACHINE}-unknown-plan9
1293
+ echo ${UNAME_MACHINE}-${VENDOR}-plan9
1286
1294
  exit ;;
1287
1295
  *:TOPS-10:*:*)
1288
- echo pdp10-unknown-tops10
1296
+ echo pdp10-${VENDOR}-tops10
1289
1297
  exit ;;
1290
1298
  *:TENEX:*:*)
1291
- echo pdp10-unknown-tenex
1299
+ echo pdp10-${VENDOR}-tenex
1292
1300
  exit ;;
1293
1301
  KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
1294
1302
  echo pdp10-dec-tops20
@@ -1297,19 +1305,19 @@ EOF
1297
1305
  echo pdp10-xkl-tops20
1298
1306
  exit ;;
1299
1307
  *:TOPS-20:*:*)
1300
- echo pdp10-unknown-tops20
1308
+ echo pdp10-${VENDOR}-tops20
1301
1309
  exit ;;
1302
1310
  *:ITS:*:*)
1303
- echo pdp10-unknown-its
1311
+ echo pdp10-${VENDOR}-its
1304
1312
  exit ;;
1305
1313
  SEI:*:*:SEIUX)
1306
- echo mips-sei-seiux${UNAME_RELEASE}
1314
+ echo mips-sei-seiux${UNAME_RELEASE}
1307
1315
  exit ;;
1308
1316
  *:DragonFly:*:*)
1309
- echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
1317
+ echo ${UNAME_MACHINE}-${VENDOR}-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
1310
1318
  exit ;;
1311
1319
  *:*VMS:*:*)
1312
- UNAME_MACHINE=`(uname -p) 2>/dev/null`
1320
+ UNAME_MACHINE=`(uname -p) 2>/dev/null`
1313
1321
  case "${UNAME_MACHINE}" in
1314
1322
  A*) echo alpha-dec-vms ; exit ;;
1315
1323
  I*) echo ia64-dec-vms ; exit ;;
@@ -1324,6 +1332,12 @@ EOF
1324
1332
  i*86:rdos:*:*)
1325
1333
  echo ${UNAME_MACHINE}-pc-rdos
1326
1334
  exit ;;
1335
+ i*86:AROS:*:*)
1336
+ echo ${UNAME_MACHINE}-pc-aros
1337
+ exit ;;
1338
+ x86_64:VMkernel:*:*)
1339
+ echo ${UNAME_MACHINE}-${VENDOR}-esx
1340
+ exit ;;
1327
1341
  esac
1328
1342
 
1329
1343
  #echo '(No uname command or uname output not recognized.)' 1>&2
@@ -1346,11 +1360,11 @@ main ()
1346
1360
  #include <sys/param.h>
1347
1361
  printf ("m68k-sony-newsos%s\n",
1348
1362
  #ifdef NEWSOS4
1349
- "4"
1363
+ "4"
1350
1364
  #else
1351
- ""
1365
+ ""
1352
1366
  #endif
1353
- ); exit (0);
1367
+ ); exit (0);
1354
1368
  #endif
1355
1369
  #endif
1356
1370