ffi 0.5.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (212) hide show
  1. data/LICENSE +1 -27
  2. data/Rakefile +9 -12
  3. data/ext/ffi_c/AbstractMemory.c +11 -8
  4. data/ext/ffi_c/AbstractMemory.h +23 -21
  5. data/ext/ffi_c/AutoPointer.c +0 -1
  6. data/ext/ffi_c/Buffer.c +24 -8
  7. data/ext/ffi_c/Call.c +28 -0
  8. data/ext/ffi_c/Call.h +8 -4
  9. data/ext/ffi_c/ClosurePool.c +7 -5
  10. data/ext/ffi_c/DynamicLibrary.c +0 -1
  11. data/ext/ffi_c/Function.c +19 -2
  12. data/ext/ffi_c/MemoryPointer.c +3 -3
  13. data/ext/ffi_c/MethodHandle.c +1 -1
  14. data/ext/ffi_c/Pointer.c +23 -9
  15. data/ext/ffi_c/Struct.c +142 -69
  16. data/ext/ffi_c/Struct.h +16 -7
  17. data/ext/ffi_c/StructLayout.c +92 -55
  18. data/ext/ffi_c/Type.c +5 -22
  19. data/ext/ffi_c/Type.h +1 -1
  20. data/ext/ffi_c/Types.c +8 -2
  21. data/ext/ffi_c/Types.h +2 -0
  22. data/ext/ffi_c/Variadic.c +7 -19
  23. data/ext/ffi_c/endian.h +1 -1
  24. data/ext/ffi_c/extconf.rb +20 -11
  25. data/ext/ffi_c/libffi/ChangeLog +900 -84
  26. data/ext/ffi_c/libffi/ChangeLog.libffi +311 -0
  27. data/ext/ffi_c/libffi/LICENSE +1 -1
  28. data/ext/ffi_c/libffi/Makefile.am +14 -4
  29. data/ext/ffi_c/libffi/Makefile.in +362 -211
  30. data/ext/ffi_c/libffi/README +70 -92
  31. data/ext/ffi_c/libffi/aclocal.m4 +6068 -4586
  32. data/ext/ffi_c/libffi/config.guess +125 -143
  33. data/ext/ffi_c/libffi/config.sub +103 -27
  34. data/ext/ffi_c/libffi/configure +11364 -18497
  35. data/ext/ffi_c/libffi/configure.ac +43 -4
  36. data/ext/ffi_c/libffi/doc/libffi.info +15 -15
  37. data/ext/ffi_c/libffi/doc/libffi.texi +1 -1
  38. data/ext/ffi_c/libffi/doc/stamp-vti +4 -4
  39. data/ext/ffi_c/libffi/doc/version.texi +4 -4
  40. data/ext/ffi_c/libffi/fficonfig.h.in +24 -3
  41. data/ext/ffi_c/libffi/include/Makefile.am +1 -1
  42. data/ext/ffi_c/libffi/include/Makefile.in +97 -50
  43. data/ext/ffi_c/libffi/include/ffi.h.in +8 -2
  44. data/ext/ffi_c/libffi/include/ffi_common.h +24 -0
  45. data/ext/ffi_c/libffi/libtool-version +1 -1
  46. data/ext/ffi_c/libffi/ltmain.sh +7346 -5870
  47. data/ext/ffi_c/libffi/m4/libtool.m4 +7360 -0
  48. data/ext/ffi_c/libffi/m4/ltoptions.m4 +368 -0
  49. data/ext/ffi_c/libffi/m4/ltsugar.m4 +123 -0
  50. data/ext/ffi_c/libffi/m4/ltversion.m4 +23 -0
  51. data/ext/ffi_c/libffi/m4/lt~obsolete.m4 +92 -0
  52. data/ext/ffi_c/libffi/man/Makefile.in +115 -62
  53. data/ext/ffi_c/libffi/man/ffi_call.3 +3 -3
  54. data/ext/ffi_c/libffi/missing +15 -8
  55. data/ext/ffi_c/libffi/src/arm/sysv.S +15 -8
  56. data/ext/ffi_c/libffi/src/avr32/ffi.c +421 -0
  57. data/ext/ffi_c/libffi/src/avr32/ffitarget.h +50 -0
  58. data/ext/ffi_c/libffi/src/avr32/sysv.S +208 -0
  59. data/ext/ffi_c/libffi/src/closures.c +47 -10
  60. data/ext/ffi_c/libffi/src/frv/ffi.c +1 -1
  61. data/ext/ffi_c/libffi/src/java_raw_api.c +0 -3
  62. data/ext/ffi_c/libffi/src/mips/ffi.c +135 -32
  63. data/ext/ffi_c/libffi/src/mips/ffitarget.h +37 -4
  64. data/ext/ffi_c/libffi/src/mips/n32.S +67 -10
  65. data/ext/ffi_c/libffi/src/mips/o32.S +8 -8
  66. data/ext/ffi_c/libffi/src/pa/ffi.c +7 -0
  67. data/ext/ffi_c/libffi/src/powerpc/aix.S +163 -64
  68. data/ext/ffi_c/libffi/src/powerpc/aix_closure.S +308 -112
  69. data/ext/ffi_c/libffi/src/powerpc/ffi.c +20 -7
  70. data/ext/ffi_c/libffi/src/powerpc/ffi_darwin.c +208 -80
  71. data/ext/ffi_c/libffi/src/powerpc/ffitarget.h +11 -3
  72. data/ext/ffi_c/libffi/src/powerpc/sysv.S +12 -23
  73. data/ext/ffi_c/libffi/src/s390/sysv.S +1 -1
  74. data/ext/ffi_c/libffi/src/sh/sysv.S +9 -9
  75. data/ext/ffi_c/libffi/src/sh64/ffi.c +37 -22
  76. data/ext/ffi_c/libffi/src/sh64/sysv.S +23 -14
  77. data/ext/ffi_c/libffi/src/sparc/ffi.c +21 -6
  78. data/ext/ffi_c/libffi/src/sparc/v8.S +55 -14
  79. data/ext/ffi_c/libffi/src/x86/darwin.S +10 -9
  80. data/ext/ffi_c/libffi/src/x86/ffi.c +293 -86
  81. data/ext/ffi_c/libffi/src/x86/ffi64.c +73 -19
  82. data/ext/ffi_c/libffi/src/x86/ffitarget.h +30 -0
  83. data/ext/ffi_c/libffi/src/x86/sysv.S +21 -4
  84. data/ext/ffi_c/libffi/src/x86/unix64.S +8 -4
  85. data/ext/ffi_c/libffi/src/x86/win32.S +633 -147
  86. data/ext/ffi_c/libffi/src/x86/win64.S +460 -0
  87. data/ext/ffi_c/libffi/testsuite/Makefile.am +63 -54
  88. data/ext/ffi_c/libffi/testsuite/Makefile.in +112 -77
  89. data/ext/ffi_c/libffi/testsuite/lib/libffi-dg.exp +12 -1
  90. data/ext/ffi_c/libffi/testsuite/libffi.call/call.exp +4 -4
  91. data/ext/ffi_c/libffi/testsuite/libffi.call/closure_fn0.c +7 -15
  92. data/ext/ffi_c/libffi/testsuite/libffi.call/closure_fn1.c +7 -15
  93. data/ext/ffi_c/libffi/testsuite/libffi.call/closure_fn2.c +7 -15
  94. data/ext/ffi_c/libffi/testsuite/libffi.call/closure_fn3.c +7 -15
  95. data/ext/ffi_c/libffi/testsuite/libffi.call/closure_fn4.c +7 -15
  96. data/ext/ffi_c/libffi/testsuite/libffi.call/closure_fn5.c +7 -14
  97. data/ext/ffi_c/libffi/testsuite/libffi.call/closure_fn6.c +7 -15
  98. data/ext/ffi_c/libffi/testsuite/libffi.call/closure_loc_fn0.c +95 -0
  99. data/ext/ffi_c/libffi/testsuite/libffi.call/closure_stdcall.c +6 -14
  100. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_12byte.c +4 -12
  101. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_16byte.c +4 -12
  102. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_18byte.c +4 -12
  103. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_19byte.c +4 -12
  104. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_1_1byte.c +4 -12
  105. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_20byte.c +4 -12
  106. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_20byte1.c +4 -12
  107. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_24byte.c +4 -12
  108. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_2byte.c +4 -12
  109. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_3_1byte.c +4 -12
  110. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_3byte1.c +4 -12
  111. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_3byte2.c +4 -12
  112. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_4_1byte.c +4 -12
  113. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_4byte.c +4 -12
  114. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_5_1_byte.c +4 -12
  115. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_5byte.c +4 -12
  116. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_64byte.c +4 -12
  117. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_6_1_byte.c +4 -12
  118. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_6byte.c +4 -12
  119. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_7_1_byte.c +4 -12
  120. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_7byte.c +4 -12
  121. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_8byte.c +4 -12
  122. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_9byte1.c +4 -12
  123. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_9byte2.c +4 -12
  124. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_double.c +4 -12
  125. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_float.c +4 -12
  126. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_longdouble.c +4 -12
  127. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_longdouble_split.c +134 -0
  128. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_longdouble_split2.c +117 -0
  129. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_pointer.c +11 -17
  130. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_sint16.c +4 -12
  131. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_sint32.c +4 -12
  132. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_sint64.c +7 -15
  133. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_uint16.c +4 -12
  134. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_uint32.c +4 -12
  135. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_uint64.c +7 -15
  136. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_dbls_struct.c +66 -0
  137. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_double.c +4 -12
  138. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_double_va.c +57 -0
  139. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_float.c +4 -13
  140. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_longdouble.c +105 -0
  141. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_longdouble_va.c +57 -0
  142. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_multi_schar.c +4 -12
  143. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_multi_sshort.c +4 -12
  144. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_multi_sshortchar.c +4 -12
  145. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_multi_uchar.c +4 -12
  146. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_multi_ushort.c +4 -12
  147. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_multi_ushortchar.c +4 -12
  148. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_pointer.c +74 -0
  149. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_pointer_stack.c +140 -0
  150. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_schar.c +4 -12
  151. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_sint.c +4 -12
  152. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_sshort.c +4 -12
  153. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_uchar.c +4 -12
  154. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_uint.c +4 -12
  155. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_ulonglong.c +8 -16
  156. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_ushort.c +4 -12
  157. data/ext/ffi_c/libffi/testsuite/libffi.call/err_bad_abi.c +37 -0
  158. data/ext/ffi_c/libffi/testsuite/libffi.call/err_bad_typedef.c +25 -0
  159. data/ext/ffi_c/libffi/testsuite/libffi.call/ffitest.h +31 -0
  160. data/ext/ffi_c/libffi/testsuite/libffi.call/float2.c +2 -1
  161. data/ext/ffi_c/libffi/testsuite/libffi.call/huge_struct.c +342 -0
  162. data/ext/ffi_c/libffi/testsuite/libffi.call/nested_struct.c +4 -12
  163. data/ext/ffi_c/libffi/testsuite/libffi.call/nested_struct1.c +4 -12
  164. data/ext/ffi_c/libffi/testsuite/libffi.call/nested_struct10.c +4 -12
  165. data/ext/ffi_c/libffi/testsuite/libffi.call/nested_struct2.c +4 -12
  166. data/ext/ffi_c/libffi/testsuite/libffi.call/nested_struct3.c +4 -12
  167. data/ext/ffi_c/libffi/testsuite/libffi.call/nested_struct4.c +4 -12
  168. data/ext/ffi_c/libffi/testsuite/libffi.call/nested_struct5.c +4 -12
  169. data/ext/ffi_c/libffi/testsuite/libffi.call/nested_struct6.c +4 -12
  170. data/ext/ffi_c/libffi/testsuite/libffi.call/nested_struct7.c +4 -12
  171. data/ext/ffi_c/libffi/testsuite/libffi.call/nested_struct8.c +4 -12
  172. data/ext/ffi_c/libffi/testsuite/libffi.call/nested_struct9.c +4 -12
  173. data/ext/ffi_c/libffi/testsuite/libffi.call/problem1.c +4 -12
  174. data/ext/ffi_c/libffi/testsuite/libffi.call/return_ldl.c +1 -1
  175. data/ext/ffi_c/libffi/testsuite/libffi.call/return_ll1.c +1 -1
  176. data/ext/ffi_c/libffi/testsuite/libffi.call/stret_large.c +145 -0
  177. data/ext/ffi_c/libffi/testsuite/libffi.call/stret_large2.c +148 -0
  178. data/ext/ffi_c/libffi/testsuite/libffi.call/stret_medium.c +124 -0
  179. data/ext/ffi_c/libffi/testsuite/libffi.call/stret_medium2.c +124 -0
  180. data/ext/ffi_c/libffi/testsuite/libffi.call/testclosure.c +70 -0
  181. data/ext/ffi_c/libffi/testsuite/libffi.special/ffitestcxx.h +10 -0
  182. data/ext/ffi_c/libffi/testsuite/libffi.special/special.exp +4 -5
  183. data/ext/ffi_c/libffi/testsuite/libffi.special/unwindtest.cc +17 -16
  184. data/ext/ffi_c/libffi/texinfo.tex +155 -427
  185. data/ext/ffi_c/libffi.bsd.mk +1 -1
  186. data/lib/ffi/autopointer.rb +79 -20
  187. data/lib/ffi/buffer.rb +4 -0
  188. data/lib/ffi/callback.rb +4 -10
  189. data/lib/ffi/enum.rb +28 -0
  190. data/lib/ffi/ffi.rb +0 -1
  191. data/lib/ffi/io.rb +28 -0
  192. data/lib/ffi/library.rb +237 -182
  193. data/lib/ffi/memorypointer.rb +28 -62
  194. data/lib/ffi/platform.rb +27 -0
  195. data/lib/ffi/pointer.rb +28 -0
  196. data/lib/ffi/struct.rb +55 -1
  197. data/lib/ffi/types.rb +29 -0
  198. data/lib/ffi/variadic.rb +29 -0
  199. data/spec/ffi/library_spec.rb +31 -5
  200. data/spec/ffi/managed_struct_spec.rb +1 -1
  201. data/spec/ffi/pointer_spec.rb +1 -1
  202. data/spec/ffi/rbx/attach_function_spec.rb +2 -1
  203. data/spec/ffi/rbx/memory_pointer_spec.rb +2 -1
  204. data/spec/ffi/spec_helper.rb +5 -1
  205. data/spec/ffi/struct_spec.rb +77 -0
  206. metadata +28 -18
  207. data/ext/ffi_c/libffi/TODO +0 -1
  208. data/ext/ffi_c/libffi/ltcf-c.sh +0 -861
  209. data/ext/ffi_c/libffi/ltcf-cxx.sh +0 -1069
  210. data/ext/ffi_c/libffi/ltcf-gcj.sh +0 -700
  211. data/ext/ffi_c/libffi/ltconfig +0 -2862
  212. data/ext/ffi_c/libffi/mkinstalldirs +0 -158
@@ -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 Free Software Foundation,
5
- # Inc.
4
+ # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
5
+ # Free Software Foundation, Inc.
6
6
 
7
- timestamp='2007-05-17'
7
+ timestamp='2009-11-19'
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
@@ -27,16 +27,16 @@ timestamp='2007-05-17'
27
27
  # the same distribution terms that you use for the rest of that program.
28
28
 
29
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.
30
+ # Originally written by Per Bothner. Please send patches (context
31
+ # diff format) to <config-patches@gnu.org> and include a ChangeLog
32
+ # entry.
33
33
  #
34
34
  # This script attempts to guess a canonical system name similar to
35
35
  # config.sub. If it succeeds, it prints the system name on stdout, and
36
36
  # exits with 0. Otherwise, it exits with 1.
37
37
  #
38
- # The plan is that this can be called by configure scripts if you
39
- # don't specify an explicit build system type.
38
+ # You can get the latest version of this script from:
39
+ # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
40
40
 
41
41
  me=`echo "$0" | sed -e 's,.*/,,'`
42
42
 
@@ -56,8 +56,8 @@ version="\
56
56
  GNU config.guess ($timestamp)
57
57
 
58
58
  Originally written by Per Bothner.
59
- Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
60
- Free Software Foundation, Inc.
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.
61
61
 
62
62
  This is free software; see the source for copying conditions. There is NO
63
63
  warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -170,7 +170,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
170
170
  arm*|i386|m68k|ns32k|sh3*|sparc|vax)
171
171
  eval $set_cc_for_build
172
172
  if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
173
- | grep __ELF__ >/dev/null
173
+ | grep -q __ELF__
174
174
  then
175
175
  # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
176
176
  # Return netbsd for either. FIX?
@@ -324,14 +324,30 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
324
324
  case `/usr/bin/uname -p` in
325
325
  sparc) echo sparc-icl-nx7; exit ;;
326
326
  esac ;;
327
+ s390x:SunOS:*:*)
328
+ echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
329
+ exit ;;
327
330
  sun4H:SunOS:5.*:*)
328
331
  echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
329
332
  exit ;;
330
333
  sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
331
334
  echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
332
335
  exit ;;
333
- i86pc:SunOS:5.*:* | ix86xen:SunOS:5.*:*)
334
- echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
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/[^.]*//'`
335
351
  exit ;;
336
352
  sun4*:SunOS:6*:*)
337
353
  # According to config.sub, this is the proper way to canonicalize
@@ -532,7 +548,7 @@ EOF
532
548
  echo rs6000-ibm-aix3.2
533
549
  fi
534
550
  exit ;;
535
- *:AIX:*:[45])
551
+ *:AIX:*:[456])
536
552
  IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
537
553
  if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
538
554
  IBM_ARCH=rs6000
@@ -640,7 +656,7 @@ EOF
640
656
  # => hppa64-hp-hpux11.23
641
657
 
642
658
  if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
643
- grep __LP64__ >/dev/null
659
+ grep -q __LP64__
644
660
  then
645
661
  HP_ARCH="hppa2.0w"
646
662
  else
@@ -791,18 +807,24 @@ EOF
791
807
  i*:PW*:*)
792
808
  echo ${UNAME_MACHINE}-pc-pw32
793
809
  exit ;;
794
- *:Interix*:[3456]*)
810
+ *:Interix*:*)
795
811
  case ${UNAME_MACHINE} in
796
- x86)
812
+ x86)
797
813
  echo i586-pc-interix${UNAME_RELEASE}
798
814
  exit ;;
799
- EM64T | authenticamd)
815
+ authenticamd | genuineintel | EM64T)
800
816
  echo x86_64-unknown-interix${UNAME_RELEASE}
801
817
  exit ;;
818
+ IA64)
819
+ echo ia64-unknown-interix${UNAME_RELEASE}
820
+ exit ;;
802
821
  esac ;;
803
822
  [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
804
823
  echo i${UNAME_MACHINE}-pc-mks
805
824
  exit ;;
825
+ 8664:Windows_NT:*)
826
+ echo x86_64-pc-mks
827
+ exit ;;
806
828
  i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
807
829
  # How do we know it's Interix rather than the generic POSIX subsystem?
808
830
  # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
@@ -832,8 +854,29 @@ EOF
832
854
  i*86:Minix:*:*)
833
855
  echo ${UNAME_MACHINE}-pc-minix
834
856
  exit ;;
857
+ alpha:Linux:*:*)
858
+ case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
859
+ EV5) UNAME_MACHINE=alphaev5 ;;
860
+ EV56) UNAME_MACHINE=alphaev56 ;;
861
+ PCA56) UNAME_MACHINE=alphapca56 ;;
862
+ PCA57) UNAME_MACHINE=alphapca56 ;;
863
+ EV6) UNAME_MACHINE=alphaev6 ;;
864
+ EV67) UNAME_MACHINE=alphaev67 ;;
865
+ EV68*) UNAME_MACHINE=alphaev68 ;;
866
+ esac
867
+ objdump --private-headers /bin/sh | grep -q ld.so.1
868
+ if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
869
+ echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
870
+ exit ;;
835
871
  arm*:Linux:*:*)
836
- echo ${UNAME_MACHINE}-unknown-linux-gnu
872
+ eval $set_cc_for_build
873
+ if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
874
+ | grep -q __ARM_EABI__
875
+ then
876
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
877
+ else
878
+ echo ${UNAME_MACHINE}-unknown-linux-gnueabi
879
+ fi
837
880
  exit ;;
838
881
  avr32*:Linux:*:*)
839
882
  echo ${UNAME_MACHINE}-unknown-linux-gnu
@@ -847,6 +890,17 @@ EOF
847
890
  frv:Linux:*:*)
848
891
  echo frv-unknown-linux-gnu
849
892
  exit ;;
893
+ i*86:Linux:*:*)
894
+ LIBC=gnu
895
+ eval $set_cc_for_build
896
+ sed 's/^ //' << EOF >$dummy.c
897
+ #ifdef __dietlibc__
898
+ LIBC=dietlibc
899
+ #endif
900
+ EOF
901
+ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
902
+ echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
903
+ exit ;;
850
904
  ia64:Linux:*:*)
851
905
  echo ${UNAME_MACHINE}-unknown-linux-gnu
852
906
  exit ;;
@@ -856,74 +910,33 @@ EOF
856
910
  m68*:Linux:*:*)
857
911
  echo ${UNAME_MACHINE}-unknown-linux-gnu
858
912
  exit ;;
859
- mips:Linux:*:*)
913
+ mips:Linux:*:* | mips64:Linux:*:*)
860
914
  eval $set_cc_for_build
861
915
  sed 's/^ //' << EOF >$dummy.c
862
916
  #undef CPU
863
- #undef mips
864
- #undef mipsel
917
+ #undef ${UNAME_MACHINE}
918
+ #undef ${UNAME_MACHINE}el
865
919
  #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
866
- CPU=mipsel
920
+ CPU=${UNAME_MACHINE}el
867
921
  #else
868
922
  #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
869
- CPU=mips
923
+ CPU=${UNAME_MACHINE}
870
924
  #else
871
925
  CPU=
872
926
  #endif
873
927
  #endif
874
928
  EOF
875
- eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
876
- /^CPU/{
877
- s: ::g
878
- p
879
- }'`"
880
- test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
881
- ;;
882
- mips64:Linux:*:*)
883
- eval $set_cc_for_build
884
- sed 's/^ //' << EOF >$dummy.c
885
- #undef CPU
886
- #undef mips64
887
- #undef mips64el
888
- #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
889
- CPU=mips64el
890
- #else
891
- #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
892
- CPU=mips64
893
- #else
894
- CPU=
895
- #endif
896
- #endif
897
- EOF
898
- eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
899
- /^CPU/{
900
- s: ::g
901
- p
902
- }'`"
929
+ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
903
930
  test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
904
931
  ;;
905
932
  or32:Linux:*:*)
906
933
  echo or32-unknown-linux-gnu
907
934
  exit ;;
908
- ppc:Linux:*:*)
909
- echo powerpc-unknown-linux-gnu
935
+ padre:Linux:*:*)
936
+ echo sparc-unknown-linux-gnu
910
937
  exit ;;
911
- ppc64:Linux:*:*)
912
- echo powerpc64-unknown-linux-gnu
913
- exit ;;
914
- alpha:Linux:*:*)
915
- case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
916
- EV5) UNAME_MACHINE=alphaev5 ;;
917
- EV56) UNAME_MACHINE=alphaev56 ;;
918
- PCA56) UNAME_MACHINE=alphapca56 ;;
919
- PCA57) UNAME_MACHINE=alphapca56 ;;
920
- EV6) UNAME_MACHINE=alphaev6 ;;
921
- EV67) UNAME_MACHINE=alphaev67 ;;
922
- EV68*) UNAME_MACHINE=alphaev68 ;;
923
- esac
924
- objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
925
- if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
926
- echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
938
+ parisc64:Linux:*:* | hppa64:Linux:*:*)
939
+ echo hppa64-unknown-linux-gnu
927
940
  exit ;;
928
941
  parisc:Linux:*:* | hppa:Linux:*:*)
929
942
  # Look for CPU level
@@ -933,8 +946,11 @@ EOF
933
946
  *) echo hppa-unknown-linux-gnu ;;
934
947
  esac
935
948
  exit ;;
936
- parisc64:Linux:*:* | hppa64:Linux:*:*)
937
- echo hppa64-unknown-linux-gnu
949
+ ppc64:Linux:*:*)
950
+ echo powerpc64-unknown-linux-gnu
951
+ exit ;;
952
+ ppc:Linux:*:*)
953
+ echo powerpc-unknown-linux-gnu
938
954
  exit ;;
939
955
  s390:Linux:*:* | s390x:Linux:*:*)
940
956
  echo ${UNAME_MACHINE}-ibm-linux
@@ -954,72 +970,9 @@ EOF
954
970
  x86_64:Linux:*:*)
955
971
  echo x86_64-unknown-linux-gnu
956
972
  exit ;;
957
- xtensa:Linux:*:*)
958
- echo xtensa-unknown-linux-gnu
973
+ xtensa*:Linux:*:*)
974
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
959
975
  exit ;;
960
- i*86:Linux:*:*)
961
- # The BFD linker knows what the default object file format is, so
962
- # first see if it will tell us. cd to the root directory to prevent
963
- # problems with other programs or directories called `ld' in the path.
964
- # Set LC_ALL=C to ensure ld outputs messages in English.
965
- ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
966
- | sed -ne '/supported targets:/!d
967
- s/[ ][ ]*/ /g
968
- s/.*supported targets: *//
969
- s/ .*//
970
- p'`
971
- case "$ld_supported_targets" in
972
- elf32-i386)
973
- TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
974
- ;;
975
- a.out-i386-linux)
976
- echo "${UNAME_MACHINE}-pc-linux-gnuaout"
977
- exit ;;
978
- coff-i386)
979
- echo "${UNAME_MACHINE}-pc-linux-gnucoff"
980
- exit ;;
981
- "")
982
- # Either a pre-BFD a.out linker (linux-gnuoldld) or
983
- # one that does not give us useful --help.
984
- echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
985
- exit ;;
986
- esac
987
- # Determine whether the default compiler is a.out or elf
988
- eval $set_cc_for_build
989
- sed 's/^ //' << EOF >$dummy.c
990
- #include <features.h>
991
- #ifdef __ELF__
992
- # ifdef __GLIBC__
993
- # if __GLIBC__ >= 2
994
- LIBC=gnu
995
- # else
996
- LIBC=gnulibc1
997
- # endif
998
- # else
999
- LIBC=gnulibc1
1000
- # endif
1001
- #else
1002
- #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
1003
- LIBC=gnu
1004
- #else
1005
- LIBC=gnuaout
1006
- #endif
1007
- #endif
1008
- #ifdef __dietlibc__
1009
- LIBC=dietlibc
1010
- #endif
1011
- EOF
1012
- eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
1013
- /^LIBC/{
1014
- s: ::g
1015
- p
1016
- }'`"
1017
- test x"${LIBC}" != x && {
1018
- echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
1019
- exit
1020
- }
1021
- test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; }
1022
- ;;
1023
976
  i*86:DYNIX/ptx:4*:*)
1024
977
  # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
1025
978
  # earlier versions are messed up and put the nodename in both
@@ -1048,7 +1001,7 @@ EOF
1048
1001
  i*86:syllable:*:*)
1049
1002
  echo ${UNAME_MACHINE}-pc-syllable
1050
1003
  exit ;;
1051
- i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
1004
+ i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
1052
1005
  echo i386-unknown-lynxos${UNAME_RELEASE}
1053
1006
  exit ;;
1054
1007
  i*86:*DOS:*:*)
@@ -1092,8 +1045,11 @@ EOF
1092
1045
  pc:*:*:*)
1093
1046
  # Left here for compatibility:
1094
1047
  # uname -m prints for DJGPP always 'pc', but it prints nothing about
1095
- # the processor, so we play safe by assuming i386.
1096
- echo i386-pc-msdosdjgpp
1048
+ # the processor, so we play safe by assuming i586.
1049
+ # Note: whatever this is, it MUST be the same as what config.sub
1050
+ # prints for the "djgpp" host, or else GDB configury will decide that
1051
+ # this is a cross-build.
1052
+ echo i586-pc-msdosdjgpp
1097
1053
  exit ;;
1098
1054
  Intel:Mach:3*:*)
1099
1055
  echo i386-pc-mach3
@@ -1131,6 +1087,16 @@ EOF
1131
1087
  3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
1132
1088
  /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1133
1089
  && { echo i486-ncr-sysv4; exit; } ;;
1090
+ NCR*:*:4.2:* | MPRAS*:*:4.2:*)
1091
+ OS_REL='.3'
1092
+ test -r /etc/.relid \
1093
+ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
1094
+ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1095
+ && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
1096
+ /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
1097
+ && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
1098
+ /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
1099
+ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
1134
1100
  m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
1135
1101
  echo m68k-unknown-lynxos${UNAME_RELEASE}
1136
1102
  exit ;;
@@ -1143,7 +1109,7 @@ EOF
1143
1109
  rs6000:LynxOS:2.*:*)
1144
1110
  echo rs6000-unknown-lynxos${UNAME_RELEASE}
1145
1111
  exit ;;
1146
- PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
1112
+ PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
1147
1113
  echo powerpc-unknown-lynxos${UNAME_RELEASE}
1148
1114
  exit ;;
1149
1115
  SM[BE]S:UNIX_SV:*:*)
@@ -1206,6 +1172,9 @@ EOF
1206
1172
  BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
1207
1173
  echo i586-pc-beos
1208
1174
  exit ;;
1175
+ BePC:Haiku:*:*) # Haiku running on Intel PC compatible.
1176
+ echo i586-pc-haiku
1177
+ exit ;;
1209
1178
  SX-4:SUPER-UX:*:*)
1210
1179
  echo sx4-nec-superux${UNAME_RELEASE}
1211
1180
  exit ;;
@@ -1233,6 +1202,16 @@ EOF
1233
1202
  *:Darwin:*:*)
1234
1203
  UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
1235
1204
  case $UNAME_PROCESSOR in
1205
+ i386)
1206
+ eval $set_cc_for_build
1207
+ if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
1208
+ if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
1209
+ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
1210
+ grep IS_64BIT_ARCH >/dev/null
1211
+ then
1212
+ UNAME_PROCESSOR="x86_64"
1213
+ fi
1214
+ fi ;;
1236
1215
  unknown) UNAME_PROCESSOR=powerpc ;;
1237
1216
  esac
1238
1217
  echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
@@ -1314,6 +1293,9 @@ EOF
1314
1293
  i*86:rdos:*:*)
1315
1294
  echo ${UNAME_MACHINE}-pc-rdos
1316
1295
  exit ;;
1296
+ i*86:AROS:*:*)
1297
+ echo ${UNAME_MACHINE}-pc-aros
1298
+ exit ;;
1317
1299
  esac
1318
1300
 
1319
1301
  #echo '(No uname command or uname output not recognized.)' 1>&2
@@ -1474,9 +1456,9 @@ This script, last modified $timestamp, has failed to recognize
1474
1456
  the operating system you are using. It is advised that you
1475
1457
  download the most up to date version of the config scripts from
1476
1458
 
1477
- http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.guess
1459
+ http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
1478
1460
  and
1479
- http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.sub
1461
+ http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
1480
1462
 
1481
1463
  If the version you run ($0) is already up to date, please
1482
1464
  send the following data and any information you think might be