Artifact 931884d131635a2c6266397b1c2985801e67386a:


0000: 23 20 68 6f 73 74 2d 63 70 75 2d 63 2d 61 62 69  # host-cpu-c-abi
0010: 2e 6d 34 20 73 65 72 69 61 6c 20 31 0a 64 6e 6c  .m4 serial 1.dnl
0020: 20 43 6f 70 79 72 69 67 68 74 20 28 43 29 20 32   Copyright (C) 2
0030: 30 30 32 2d 32 30 31 30 20 46 72 65 65 20 53 6f  002-2010 Free So
0040: 66 74 77 61 72 65 20 46 6f 75 6e 64 61 74 69 6f  ftware Foundatio
0050: 6e 2c 20 49 6e 63 2e 0a 64 6e 6c 20 54 68 69 73  n, Inc..dnl This
0060: 20 66 69 6c 65 20 69 73 20 66 72 65 65 20 73 6f   file is free so
0070: 66 74 77 61 72 65 3b 20 74 68 65 20 46 72 65 65  ftware; the Free
0080: 20 53 6f 66 74 77 61 72 65 20 46 6f 75 6e 64 61   Software Founda
0090: 74 69 6f 6e 0a 64 6e 6c 20 67 69 76 65 73 20 75  tion.dnl gives u
00a0: 6e 6c 69 6d 69 74 65 64 20 70 65 72 6d 69 73 73  nlimited permiss
00b0: 69 6f 6e 20 74 6f 20 63 6f 70 79 20 61 6e 64 2f  ion to copy and/
00c0: 6f 72 20 64 69 73 74 72 69 62 75 74 65 20 69 74  or distribute it
00d0: 2c 0a 64 6e 6c 20 77 69 74 68 20 6f 72 20 77 69  ,.dnl with or wi
00e0: 74 68 6f 75 74 20 6d 6f 64 69 66 69 63 61 74 69  thout modificati
00f0: 6f 6e 73 2c 20 61 73 20 6c 6f 6e 67 20 61 73 20  ons, as long as 
0100: 74 68 69 73 20 6e 6f 74 69 63 65 20 69 73 20 70  this notice is p
0110: 72 65 73 65 72 76 65 64 2e 0a 0a 64 6e 6c 20 46  reserved...dnl F
0120: 72 6f 6d 20 42 72 75 6e 6f 20 48 61 69 62 6c 65  rom Bruno Haible
0130: 20 61 6e 64 20 53 61 6d 20 53 74 65 69 6e 67 6f   and Sam Steingo
0140: 6c 64 2e 0a 0a 64 6e 6c 20 53 65 74 73 20 74 68  ld...dnl Sets th
0150: 65 20 48 4f 53 54 5f 43 50 55 5f 43 5f 41 42 49  e HOST_CPU_C_ABI
0160: 20 76 61 72 69 61 62 6c 65 20 74 6f 20 74 68 65   variable to the
0170: 20 63 61 6e 6f 6e 69 63 61 6c 20 6e 61 6d 65 20   canonical name 
0180: 6f 66 20 74 68 65 20 43 50 55 20 77 69 74 68 20  of the CPU with 
0190: 69 74 73 0a 64 6e 6c 20 43 20 6c 61 6e 67 75 61  its.dnl C langua
01a0: 67 65 20 41 42 49 20 28 61 70 70 6c 69 63 61 74  ge ABI (applicat
01b0: 69 6f 6e 20 62 69 6e 61 72 79 20 69 6e 74 65 72  ion binary inter
01c0: 66 61 63 65 29 2e 0a 64 6e 6c 20 41 6c 73 6f 20  face)..dnl Also 
01d0: 64 65 66 69 6e 65 73 20 5f 5f 24 7b 48 4f 53 54  defines __${HOST
01e0: 5f 43 50 55 5f 43 5f 41 42 49 7d 5f 5f 20 61 73  _CPU_C_ABI}__ as
01f0: 20 61 20 43 20 6d 61 63 72 6f 20 69 6e 20 63 6f   a C macro in co
0200: 6e 66 69 67 2e 68 2e 0a 64 6e 6c 0a 64 6e 6c 20  nfig.h..dnl.dnl 
0210: 54 68 69 73 20 63 61 6e 6f 6e 69 63 61 6c 20 6e  This canonical n
0220: 61 6d 65 20 63 61 6e 20 62 65 20 75 73 65 64 20  ame can be used 
0230: 74 6f 20 73 65 6c 65 63 74 20 61 20 70 61 72 74  to select a part
0240: 69 63 75 6c 61 72 20 61 73 73 65 6d 62 6c 79 20  icular assembly 
0250: 6c 61 6e 67 75 61 67 65 0a 64 6e 6c 20 73 6f 75  language.dnl sou
0260: 72 63 65 20 66 69 6c 65 20 74 68 61 74 20 77 69  rce file that wi
0270: 6c 6c 20 69 6e 74 65 72 6f 70 65 72 61 74 65 20  ll interoperate 
0280: 77 69 74 68 20 43 20 63 6f 64 65 20 6f 6e 20 74  with C code on t
0290: 68 65 20 67 69 76 65 6e 20 68 6f 73 74 2e 0a 64  he given host..d
02a0: 6e 6c 0a 64 6e 6c 20 46 6f 72 20 65 78 61 6d 70  nl.dnl For examp
02b0: 6c 65 3a 0a 64 6e 6c 20 2a 20 27 69 33 38 36 27  le:.dnl * 'i386'
02c0: 20 61 6e 64 20 27 73 70 61 72 63 27 20 61 72 65   and 'sparc' are
02d0: 20 64 69 66 66 65 72 65 6e 74 20 63 61 6e 6f 6e   different canon
02e0: 69 63 61 6c 20 6e 61 6d 65 73 2c 20 62 65 63 61  ical names, beca
02f0: 75 73 65 20 63 6f 64 65 20 66 6f 72 20 69 33 38  use code for i38
0300: 36 0a 64 6e 6c 20 20 20 77 69 6c 6c 20 6e 6f 74  6.dnl   will not
0310: 20 72 75 6e 20 6f 6e 20 53 50 41 52 43 20 43 50   run on SPARC CP
0320: 55 73 20 61 6e 64 20 76 69 63 65 20 76 65 72 73  Us and vice vers
0330: 61 2e 20 54 68 65 79 20 68 61 76 65 20 64 69 66  a. They have dif
0340: 66 65 72 65 6e 74 0a 64 6e 6c 20 20 20 69 6e 73  ferent.dnl   ins
0350: 74 72 75 63 74 69 6f 6e 20 73 65 74 73 2e 0a 64  truction sets..d
0360: 6e 6c 20 2a 20 27 73 70 61 72 63 27 20 61 6e 64  nl * 'sparc' and
0370: 20 27 73 70 61 72 63 36 34 27 20 61 72 65 20 64   'sparc64' are d
0380: 69 66 66 65 72 65 6e 74 20 63 61 6e 6f 6e 69 63  ifferent canonic
0390: 61 6c 20 6e 61 6d 65 73 2c 20 62 65 63 61 75 73  al names, becaus
03a0: 65 20 63 6f 64 65 20 66 6f 72 0a 64 6e 6c 20 20  e code for.dnl  
03b0: 20 27 73 70 61 72 63 27 20 61 6e 64 20 63 6f 64   'sparc' and cod
03c0: 65 20 66 6f 72 20 27 73 70 61 72 63 36 34 27 20  e for 'sparc64' 
03d0: 63 61 6e 6e 6f 74 20 62 65 20 6c 69 6e 6b 65 64  cannot be linked
03e0: 20 74 6f 67 65 74 68 65 72 3a 20 27 73 70 61 72   together: 'spar
03f0: 63 27 20 63 6f 64 65 0a 64 6e 6c 20 20 20 63 6f  c' code.dnl   co
0400: 6e 74 61 69 6e 73 20 33 32 2d 62 69 74 20 69 6e  ntains 32-bit in
0410: 73 74 72 75 63 74 69 6f 6e 73 2c 20 77 68 65 72  structions, wher
0420: 65 61 73 20 27 73 70 61 72 63 36 34 27 20 63 6f  eas 'sparc64' co
0430: 64 65 20 63 6f 6e 74 61 69 6e 73 20 36 34 2d 62  de contains 64-b
0440: 69 74 0a 64 6e 6c 20 20 20 69 6e 73 74 72 75 63  it.dnl   instruc
0450: 74 69 6f 6e 73 2e 20 41 20 70 72 6f 63 65 73 73  tions. A process
0460: 20 6f 6e 20 61 20 53 50 41 52 43 20 43 50 55 20   on a SPARC CPU 
0470: 63 61 6e 20 62 65 20 69 6e 20 33 32 2d 62 69 74  can be in 32-bit
0480: 20 6d 6f 64 65 20 6f 72 20 69 6e 20 36 34 2d 62   mode or in 64-b
0490: 69 74 0a 64 6e 6c 20 20 20 6d 6f 64 65 2c 20 62  it.dnl   mode, b
04a0: 75 74 20 6e 6f 74 20 62 6f 74 68 2e 0a 64 6e 6c  ut not both..dnl
04b0: 20 2a 20 27 6d 69 70 73 27 20 61 6e 64 20 27 6d   * 'mips' and 'm
04c0: 69 70 73 6e 33 32 27 20 61 72 65 20 64 69 66 66  ipsn32' are diff
04d0: 65 72 65 6e 74 20 63 61 6e 6f 6e 69 63 61 6c 20  erent canonical 
04e0: 6e 61 6d 65 73 2c 20 62 65 63 61 75 73 65 20 74  names, because t
04f0: 68 65 79 20 75 73 65 0a 64 6e 6c 20 20 20 64 69  hey use.dnl   di
0500: 66 66 65 72 65 6e 74 20 61 72 67 75 6d 65 6e 74  fferent argument
0510: 20 70 61 73 73 69 6e 67 20 61 6e 64 20 72 65 74   passing and ret
0520: 75 72 6e 20 63 6f 6e 76 65 6e 74 69 6f 6e 73 20  urn conventions 
0530: 66 6f 72 20 43 20 66 75 6e 63 74 69 6f 6e 73 2c  for C functions,
0540: 20 61 6e 64 0a 64 6e 6c 20 20 20 61 6c 74 68 6f   and.dnl   altho
0550: 75 67 68 20 74 68 65 20 69 6e 73 74 72 75 63 74  ugh the instruct
0560: 69 6f 6e 20 73 65 74 20 6f 66 20 27 6d 69 70 73  ion set of 'mips
0570: 27 20 69 73 20 61 20 6c 61 72 67 65 20 73 75 62  ' is a large sub
0580: 73 65 74 20 6f 66 20 74 68 65 0a 64 6e 6c 20 20  set of the.dnl  
0590: 20 69 6e 73 74 72 75 63 74 69 6f 6e 20 73 65 74   instruction set
05a0: 20 6f 66 20 27 6d 69 70 73 6e 33 32 27 2e 0a 64   of 'mipsn32'..d
05b0: 6e 6c 20 2a 20 27 6d 69 70 73 6e 33 32 27 20 61  nl * 'mipsn32' a
05c0: 6e 64 20 27 6d 69 70 73 36 34 27 20 61 72 65 20  nd 'mips64' are 
05d0: 64 69 66 66 65 72 65 6e 74 20 63 61 6e 6f 6e 69  different canoni
05e0: 63 61 6c 20 6e 61 6d 65 73 2c 20 62 65 63 61 75  cal names, becau
05f0: 73 65 20 74 68 65 79 20 75 73 65 0a 64 6e 6c 20  se they use.dnl 
0600: 20 20 64 69 66 66 65 72 65 6e 74 20 73 69 7a 65    different size
0610: 73 20 66 6f 72 20 74 68 65 20 43 20 74 79 70 65  s for the C type
0620: 73 20 6c 69 6b 65 20 27 69 6e 74 27 20 61 6e 64  s like 'int' and
0630: 20 27 76 6f 69 64 20 2a 27 2c 20 61 6e 64 20 61   'void *', and a
0640: 6c 74 68 6f 75 67 68 0a 64 6e 6c 20 20 20 74 68  lthough.dnl   th
0650: 65 20 69 6e 73 74 72 75 63 74 69 6f 6e 20 73 65  e instruction se
0660: 74 73 20 6f 66 20 27 6d 69 70 73 6e 33 32 27 20  ts of 'mipsn32' 
0670: 61 6e 64 20 27 6d 69 70 73 36 34 27 20 61 72 65  and 'mips64' are
0680: 20 74 68 65 20 73 61 6d 65 2e 0a 64 6e 6c 20 2a   the same..dnl *
0690: 20 27 61 72 6d 27 20 61 6e 64 20 27 61 72 6d 65   'arm' and 'arme
06a0: 6c 27 20 61 72 65 20 64 69 66 66 65 72 65 6e 74  l' are different
06b0: 20 63 61 6e 6f 6e 69 63 61 6c 20 6e 61 6d 65 73   canonical names
06c0: 2c 20 62 65 63 61 75 73 65 20 74 68 65 79 20 75  , because they u
06d0: 73 65 0a 64 6e 6c 20 20 20 64 69 66 66 65 72 65  se.dnl   differe
06e0: 6e 74 20 6d 65 6d 6f 72 79 20 6f 72 64 65 72 69  nt memory orderi
06f0: 6e 67 20 66 6f 72 20 74 68 65 20 43 20 74 79 70  ng for the C typ
0700: 65 73 20 6c 69 6b 65 20 27 69 6e 74 27 2c 20 61  es like 'int', a
0710: 6e 64 20 61 6c 74 68 6f 75 67 68 0a 64 6e 6c 20  nd although.dnl 
0720: 20 20 74 68 65 20 69 6e 73 74 72 75 63 74 69 6f    the instructio
0730: 6e 20 73 65 74 73 20 6f 66 20 27 61 72 6d 27 20  n sets of 'arm' 
0740: 61 6e 64 20 27 61 72 6d 65 6c 27 20 61 72 65 20  and 'armel' are 
0750: 74 68 65 20 73 61 6d 65 2e 0a 64 6e 6c 20 2a 20  the same..dnl * 
0760: 54 68 65 20 73 61 6d 65 20 6e 61 6d 65 20 27 69  The same name 'i
0770: 33 38 36 27 20 69 73 20 75 73 65 64 20 66 6f 72  386' is used for
0780: 20 43 50 55 73 20 6f 66 20 74 79 70 65 20 69 33   CPUs of type i3
0790: 38 36 2c 20 69 34 38 36 2c 20 69 35 38 36 0a 64  86, i486, i586.d
07a0: 6e 6c 20 20 20 28 50 65 6e 74 69 75 6d 29 2c 20  nl   (Pentium), 
07b0: 41 4d 44 20 4b 37 2c 20 50 65 6e 74 69 75 6d 20  AMD K7, Pentium 
07c0: 49 49 2c 20 50 65 6e 74 69 75 6d 20 49 56 2c 20  II, Pentium IV, 
07d0: 65 74 63 2e 2c 20 62 65 63 61 75 73 65 0a 64 6e  etc., because.dn
07e0: 6c 20 20 20 2d 20 49 6e 73 74 72 75 63 74 69 6f  l   - Instructio
07f0: 6e 73 20 74 68 61 74 20 64 6f 20 6e 6f 74 20 65  ns that do not e
0800: 78 69 73 74 20 6f 6e 20 61 6c 6c 20 6f 66 20 74  xist on all of t
0810: 68 65 73 65 20 43 50 55 73 20 28 63 6d 70 78 63  hese CPUs (cmpxc
0820: 68 67 2c 0a 64 6e 6c 20 20 20 20 20 4d 4d 58 2c  hg,.dnl     MMX,
0830: 20 53 53 45 2c 20 53 53 45 32 2c 20 33 44 4e 6f   SSE, SSE2, 3DNo
0840: 77 21 20 65 74 63 2e 29 20 61 72 65 20 6e 6f 74  w! etc.) are not
0850: 20 66 72 65 71 75 65 6e 74 6c 79 20 75 73 65 64   frequently used
0860: 2e 20 49 66 20 79 6f 75 72 0a 64 6e 6c 20 20 20  . If your.dnl   
0870: 20 20 61 73 73 65 6d 62 6c 79 20 6c 61 6e 67 75    assembly langu
0880: 61 67 65 20 73 6f 75 72 63 65 20 66 69 6c 65 73  age source files
0890: 20 75 73 65 20 73 75 63 68 20 69 6e 73 74 72 75   use such instru
08a0: 63 74 69 6f 6e 73 2c 20 79 6f 75 20 77 69 6c 6c  ctions, you will
08b0: 0a 64 6e 6c 20 20 20 20 20 6e 65 65 64 20 74 6f  .dnl     need to
08c0: 20 6d 61 6b 65 20 74 68 65 20 64 69 73 74 69 6e   make the distin
08d0: 63 74 69 6f 6e 2e 0a 64 6e 6c 20 20 20 2d 20 53  ction..dnl   - S
08e0: 70 65 65 64 20 6f 66 20 65 78 65 63 75 74 69 6f  peed of executio
08f0: 6e 20 6f 66 20 74 68 65 20 63 6f 6d 6d 6f 6e 20  n of the common 
0900: 69 6e 73 74 72 75 63 74 69 6f 6e 20 73 65 74 20  instruction set 
0910: 69 73 20 72 65 61 73 6f 6e 61 62 6c 65 20 61 63  is reasonable ac
0920: 72 6f 73 73 0a 64 6e 6c 20 20 20 20 20 74 68 65  ross.dnl     the
0930: 20 65 6e 74 69 72 65 20 66 61 6d 69 6c 79 20 6f   entire family o
0940: 66 20 43 50 55 73 2e 20 49 66 20 79 6f 75 20 68  f CPUs. If you h
0950: 61 76 65 20 61 73 73 65 6d 62 6c 79 20 6c 61 6e  ave assembly lan
0960: 67 75 61 67 65 20 73 6f 75 72 63 65 20 66 69 6c  guage source fil
0970: 65 73 0a 64 6e 6c 20 20 20 20 20 74 68 61 74 20  es.dnl     that 
0980: 61 72 65 20 6f 70 74 69 6d 69 7a 65 64 20 66 6f  are optimized fo
0990: 72 20 70 61 72 74 69 63 75 6c 61 72 20 43 50 55  r particular CPU
09a0: 20 74 79 70 65 73 20 28 6c 69 6b 65 20 47 4e 55   types (like GNU
09b0: 20 67 6d 70 20 68 61 73 29 2c 20 79 6f 75 0a 64   gmp has), you.d
09c0: 6e 6c 20 20 20 20 20 77 69 6c 6c 20 6e 65 65 64  nl     will need
09d0: 20 74 6f 20 6d 61 6b 65 20 74 68 65 20 64 69 73   to make the dis
09e0: 74 69 6e 63 74 69 6f 6e 2e 0a 64 6e 6c 20 20 20  tinction..dnl   
09f0: 53 65 65 20 3c 68 74 74 70 3a 2f 2f 65 6e 2e 77  See <http://en.w
0a00: 69 6b 69 70 65 64 69 61 2e 6f 72 67 2f 77 69 6b  ikipedia.org/wik
0a10: 69 2f 58 38 36 5f 69 6e 73 74 72 75 63 74 69 6f  i/X86_instructio
0a20: 6e 5f 6c 69 73 74 69 6e 67 73 3e 2e 0a 41 43 5f  n_listings>..AC_
0a30: 44 45 46 55 4e 28 5b 67 6c 5f 48 4f 53 54 5f 43  DEFUN([gl_HOST_C
0a40: 50 55 5f 43 5f 41 42 49 5d 2c 0a 5b 0a 20 20 41  PU_C_ABI],.[.  A
0a50: 43 5f 52 45 51 55 49 52 45 28 5b 41 43 5f 43 41  C_REQUIRE([AC_CA
0a60: 4e 4f 4e 49 43 41 4c 5f 48 4f 53 54 5d 29 0a 20  NONICAL_HOST]). 
0a70: 20 41 43 5f 43 41 43 48 45 5f 43 48 45 43 4b 28   AC_CACHE_CHECK(
0a80: 5b 68 6f 73 74 20 43 50 55 20 61 6e 64 20 43 20  [host CPU and C 
0a90: 41 42 49 5d 2c 20 5b 67 6c 5f 63 76 5f 68 6f 73  ABI], [gl_cv_hos
0aa0: 74 5f 63 70 75 5f 63 5f 61 62 69 5d 2c 0a 20 20  t_cpu_c_abi],.  
0ab0: 20 20 5b 63 61 73 65 20 22 24 68 6f 73 74 5f 63    [case "$host_c
0ac0: 70 75 22 20 69 6e 0a 0a 63 68 61 6e 67 65 71 75  pu" in..changequ
0ad0: 6f 74 65 28 2c 29 64 6e 6c 0a 20 20 20 20 20 20  ote(,)dnl.      
0ae0: 20 69 5b 34 35 36 37 5d 38 36 20 29 0a 63 68 61   i[4567]86 ).cha
0af0: 6e 67 65 71 75 6f 74 65 28 5b 2c 5d 29 64 6e 6c  ngequote([,])dnl
0b00: 0a 20 20 20 20 20 20 20 20 20 67 6c 5f 63 76 5f  .         gl_cv_
0b10: 68 6f 73 74 5f 63 70 75 5f 63 5f 61 62 69 3d 69  host_cpu_c_abi=i
0b20: 33 38 36 0a 20 20 20 20 20 20 20 20 20 3b 3b 0a  386.         ;;.
0b30: 0a 20 20 20 20 20 20 20 78 38 36 5f 36 34 20 29  .       x86_64 )
0b40: 0a 20 20 20 20 20 20 20 20 20 23 20 4f 6e 20 78  .         # On x
0b50: 38 36 5f 36 34 20 73 79 73 74 65 6d 73 2c 20 74  86_64 systems, t
0b60: 68 65 20 43 20 63 6f 6d 70 69 6c 65 72 20 6d 61  he C compiler ma
0b70: 79 20 73 74 69 6c 6c 20 62 65 20 67 65 6e 65 72  y still be gener
0b80: 61 74 69 6e 67 0a 20 20 20 20 20 20 20 20 20 23  ating.         #
0b90: 20 33 32 2d 62 69 74 20 63 6f 64 65 2e 0a 20 20   32-bit code..  
0ba0: 20 20 20 20 20 20 20 41 43 5f 45 47 52 45 50 5f         AC_EGREP_
0bb0: 43 50 50 28 5b 79 65 73 5d 2c 0a 20 20 20 20 20  CPP([yes],.     
0bc0: 20 20 20 20 20 20 5b 23 69 66 20 64 65 66 69 6e        [#if defin
0bd0: 65 64 20 5f 5f 4c 50 36 34 5f 5f 20 7c 7c 20 64  ed __LP64__ || d
0be0: 65 66 69 6e 65 64 20 5f 5f 78 38 36 5f 36 34 5f  efined __x86_64_
0bf0: 5f 20 7c 7c 20 64 65 66 69 6e 65 64 20 5f 5f 61  _ || defined __a
0c00: 6d 64 36 34 5f 5f 0a 20 20 20 20 20 20 20 20 20  md64__.         
0c10: 20 20 20 79 65 73 0a 20 20 20 20 20 20 20 20 20     yes.         
0c20: 20 20 20 23 65 6e 64 69 66 5d 2c 0a 20 20 20 20     #endif],.    
0c30: 20 20 20 20 20 20 20 5b 67 6c 5f 63 76 5f 68 6f         [gl_cv_ho
0c40: 73 74 5f 63 70 75 5f 63 5f 61 62 69 3d 78 38 36  st_cpu_c_abi=x86
0c50: 5f 36 34 5d 2c 0a 20 20 20 20 20 20 20 20 20 20  _64],.          
0c60: 20 5b 67 6c 5f 63 76 5f 68 6f 73 74 5f 63 70 75   [gl_cv_host_cpu
0c70: 5f 63 5f 61 62 69 3d 69 33 38 36 5d 29 0a 20 20  _c_abi=i386]).  
0c80: 20 20 20 20 20 20 20 3b 3b 0a 0a 63 68 61 6e 67         ;;..chang
0c90: 65 71 75 6f 74 65 28 2c 29 64 6e 6c 0a 20 20 20  equote(,)dnl.   
0ca0: 20 20 20 20 61 6c 70 68 61 65 76 5b 34 2d 38 5d      alphaev[4-8]
0cb0: 20 7c 20 61 6c 70 68 61 65 76 35 36 20 7c 20 61   | alphaev56 | a
0cc0: 6c 70 68 61 70 63 61 35 5b 36 37 5d 20 7c 20 61  lphapca5[67] | a
0cd0: 6c 70 68 61 65 76 36 5b 37 38 5d 20 29 0a 63 68  lphaev6[78] ).ch
0ce0: 61 6e 67 65 71 75 6f 74 65 28 5b 2c 5d 29 64 6e  angequote([,])dn
0cf0: 6c 0a 20 20 20 20 20 20 20 20 20 67 6c 5f 63 76  l.         gl_cv
0d00: 5f 68 6f 73 74 5f 63 70 75 5f 63 5f 61 62 69 3d  _host_cpu_c_abi=
0d10: 61 6c 70 68 61 0a 20 20 20 20 20 20 20 20 20 3b  alpha.         ;
0d20: 3b 0a 0a 20 20 20 20 20 20 20 61 72 6d 2a 20 29  ;..       arm* )
0d30: 0a 20 20 20 20 20 20 20 20 20 41 43 5f 45 47 52  .         AC_EGR
0d40: 45 50 5f 43 50 50 28 5b 79 65 73 5d 2c 0a 20 20  EP_CPP([yes],.  
0d50: 20 20 20 20 20 20 20 20 20 5b 23 69 66 20 64 65           [#if de
0d60: 66 69 6e 65 64 20 5f 5f 41 52 4d 45 4c 5f 5f 0a  fined __ARMEL__.
0d70: 20 20 20 20 20 20 20 20 20 20 20 20 79 65 73 0a              yes.
0d80: 20 20 20 20 20 20 20 20 20 20 20 20 23 65 6e 64              #end
0d90: 69 66 5d 2c 0a 20 20 20 20 20 20 20 20 20 20 20  if],.           
0da0: 5b 67 6c 5f 63 76 5f 68 6f 73 74 5f 63 70 75 5f  [gl_cv_host_cpu_
0db0: 63 5f 61 62 69 3d 61 72 6d 65 6c 5d 2c 0a 20 20  c_abi=armel],.  
0dc0: 20 20 20 20 20 20 20 20 20 5b 67 6c 5f 63 76 5f           [gl_cv_
0dd0: 68 6f 73 74 5f 63 70 75 5f 63 5f 61 62 69 3d 61  host_cpu_c_abi=a
0de0: 72 6d 5d 29 0a 20 20 20 20 20 20 20 20 20 3b 3b  rm]).         ;;
0df0: 0a 0a 20 20 20 20 20 20 20 68 70 70 61 31 2e 30  ..       hppa1.0
0e00: 20 7c 20 68 70 70 61 31 2e 31 20 7c 20 68 70 70   | hppa1.1 | hpp
0e10: 61 32 2e 30 2a 20 7c 20 68 70 70 61 36 34 20 29  a2.0* | hppa64 )
0e20: 0a 20 20 20 20 20 20 20 20 20 23 20 54 4f 44 4f  .         # TODO
0e30: 3a 20 44 69 73 74 69 6e 67 75 69 73 68 20 68 70  : Distinguish hp
0e40: 70 61 20 61 6e 64 20 68 70 70 61 36 34 20 63 6f  pa and hppa64 co
0e50: 72 72 65 63 74 6c 79 2e 0a 20 20 20 20 20 20 20  rrectly..       
0e60: 20 20 67 6c 5f 63 76 5f 68 6f 73 74 5f 63 70 75    gl_cv_host_cpu
0e70: 5f 63 5f 61 62 69 3d 68 70 70 61 0a 20 20 20 20  _c_abi=hppa.    
0e80: 20 20 20 20 20 3b 3b 0a 0a 20 20 20 20 20 20 20       ;;..       
0e90: 6d 69 70 73 2a 20 29 0a 20 20 20 20 20 20 20 20  mips* ).        
0ea0: 20 23 20 57 65 20 73 68 6f 75 6c 64 20 61 6c 73   # We should als
0eb0: 6f 20 63 68 65 63 6b 20 66 6f 72 20 28 5f 4d 49  o check for (_MI
0ec0: 50 53 5f 53 5a 50 54 52 20 3d 3d 20 36 34 29 2c  PS_SZPTR == 64),
0ed0: 20 62 75 74 20 67 63 63 20 6b 65 65 70 73 20 74   but gcc keeps t
0ee0: 68 69 73 0a 20 20 20 20 20 20 20 20 20 23 20 61  his.         # a
0ef0: 74 20 33 32 2e 0a 20 20 20 20 20 20 20 20 20 41  t 32..         A
0f00: 43 5f 45 47 52 45 50 5f 43 50 50 28 5b 79 65 73  C_EGREP_CPP([yes
0f10: 5d 2c 0a 20 20 20 20 20 20 20 20 20 20 20 5b 23  ],.           [#
0f20: 69 66 20 64 65 66 69 6e 65 64 20 5f 4d 49 50 53  if defined _MIPS
0f30: 5f 53 5a 4c 4f 4e 47 20 26 26 20 28 5f 4d 49 50  _SZLONG && (_MIP
0f40: 53 5f 53 5a 4c 4f 4e 47 20 3d 3d 20 36 34 29 0a  S_SZLONG == 64).
0f50: 20 20 20 20 20 20 20 20 20 20 20 20 79 65 73 0a              yes.
0f60: 20 20 20 20 20 20 20 20 20 20 20 20 23 65 6e 64              #end
0f70: 69 66 5d 2c 0a 20 20 20 20 20 20 20 20 20 20 20  if],.           
0f80: 5b 67 6c 5f 63 76 5f 68 6f 73 74 5f 63 70 75 5f  [gl_cv_host_cpu_
0f90: 63 5f 61 62 69 3d 6d 69 70 73 36 34 5d 2c 0a 20  c_abi=mips64],. 
0fa0: 20 20 20 20 20 20 20 20 20 20 5b 23 20 53 74 72            [# Str
0fb0: 69 63 74 6c 79 20 73 70 65 61 6b 69 6e 67 2c 20  ictly speaking, 
0fc0: 74 68 65 20 4d 49 50 53 20 41 42 49 20 28 2d 33  the MIPS ABI (-3
0fd0: 32 20 6f 72 20 2d 6e 33 32 29 20 69 73 20 69 6e  2 or -n32) is in
0fe0: 64 65 70 65 6e 64 65 6e 74 0a 20 20 20 20 20 20  dependent.      
0ff0: 20 20 20 20 20 20 23 20 66 72 6f 6d 20 74 68 65        # from the
1000: 20 43 50 55 20 69 64 65 6e 74 69 66 69 63 61 74   CPU identificat
1010: 69 6f 6e 20 28 2d 6d 69 70 73 5b 31 32 5d 20 6f  ion (-mips[12] o
1020: 72 20 2d 6d 69 70 73 5b 33 34 5d 29 2e 20 42 75  r -mips[34]). Bu
1030: 74 20 2d 6e 33 32 0a 20 20 20 20 20 20 20 20 20  t -n32.         
1040: 20 20 20 23 20 69 73 20 63 6f 6d 6d 6f 6e 6c 79     # is commonly
1050: 20 75 73 65 64 20 74 6f 67 65 74 68 65 72 20 77   used together w
1060: 69 74 68 20 2d 6d 69 70 73 33 2c 20 61 6e 64 20  ith -mips3, and 
1070: 69 74 27 73 20 65 61 73 69 65 72 20 74 6f 20 74  it's easier to t
1080: 65 73 74 0a 20 20 20 20 20 20 20 20 20 20 20 20  est.            
1090: 23 20 74 68 65 20 43 50 55 20 69 64 65 6e 74 69  # the CPU identi
10a0: 66 69 63 61 74 69 6f 6e 2e 0a 20 20 20 20 20 20  fication..      
10b0: 20 20 20 20 20 20 41 43 5f 45 47 52 45 50 5f 43        AC_EGREP_C
10c0: 50 50 28 5b 79 65 73 5d 2c 0a 20 20 20 20 20 20  PP([yes],.      
10d0: 20 20 20 20 20 20 20 20 5b 23 69 66 20 5f 5f 6d          [#if __m
10e0: 69 70 73 20 3e 3d 20 33 0a 20 20 20 20 20 20 20  ips >= 3.       
10f0: 20 20 20 20 20 20 20 20 79 65 73 0a 20 20 20 20          yes.    
1100: 20 20 20 20 20 20 20 20 20 20 20 23 65 6e 64 69             #endi
1110: 66 5d 2c 0a 20 20 20 20 20 20 20 20 20 20 20 20  f],.            
1120: 20 20 5b 67 6c 5f 63 76 5f 68 6f 73 74 5f 63 70    [gl_cv_host_cp
1130: 75 5f 63 5f 61 62 69 3d 6d 69 70 73 6e 33 32 5d  u_c_abi=mipsn32]
1140: 2c 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20  ,.              
1150: 5b 67 6c 5f 63 76 5f 68 6f 73 74 5f 63 70 75 5f  [gl_cv_host_cpu_
1160: 63 5f 61 62 69 3d 6d 69 70 73 5d 29 5d 29 0a 20  c_abi=mips])]). 
1170: 20 20 20 20 20 20 20 20 3b 3b 0a 0a 20 20 20 20          ;;..    
1180: 20 20 20 70 6f 77 65 72 70 63 36 34 20 29 0a 20     powerpc64 ). 
1190: 20 20 20 20 20 20 20 20 23 20 4f 6e 20 70 6f 77          # On pow
11a0: 65 72 70 63 36 34 20 73 79 73 74 65 6d 73 2c 20  erpc64 systems, 
11b0: 74 68 65 20 43 20 63 6f 6d 70 69 6c 65 72 20 6d  the C compiler m
11c0: 61 79 20 73 74 69 6c 6c 20 62 65 20 67 65 6e 65  ay still be gene
11d0: 72 61 74 69 6e 67 0a 20 20 20 20 20 20 20 20 20  rating.         
11e0: 23 20 33 32 2d 62 69 74 20 63 6f 64 65 2e 0a 20  # 32-bit code.. 
11f0: 20 20 20 20 20 20 20 20 41 43 5f 45 47 52 45 50          AC_EGREP
1200: 5f 43 50 50 28 5b 79 65 73 5d 2c 0a 20 20 20 20  _CPP([yes],.    
1210: 20 20 20 20 20 20 20 5b 23 69 66 20 64 65 66 69         [#if defi
1220: 6e 65 64 20 5f 5f 70 6f 77 65 72 70 63 36 34 5f  ned __powerpc64_
1230: 5f 20 7c 7c 20 64 65 66 69 6e 65 64 20 5f 41 52  _ || defined _AR
1240: 43 48 5f 50 50 43 36 34 0a 20 20 20 20 20 20 20  CH_PPC64.       
1250: 20 20 20 20 20 79 65 73 0a 20 20 20 20 20 20 20       yes.       
1260: 20 20 20 20 20 23 65 6e 64 69 66 5d 2c 0a 20 20       #endif],.  
1270: 20 20 20 20 20 20 20 20 20 5b 67 6c 5f 63 76 5f           [gl_cv_
1280: 68 6f 73 74 5f 63 70 75 5f 63 5f 61 62 69 3d 70  host_cpu_c_abi=p
1290: 6f 77 65 72 70 63 36 34 5d 2c 0a 20 20 20 20 20  owerpc64],.     
12a0: 20 20 20 20 20 20 5b 67 6c 5f 63 76 5f 68 6f 73        [gl_cv_hos
12b0: 74 5f 63 70 75 5f 63 5f 61 62 69 3d 70 6f 77 65  t_cpu_c_abi=powe
12c0: 72 70 63 5d 29 0a 20 20 20 20 20 20 20 20 20 3b  rpc]).         ;
12d0: 3b 0a 0a 20 20 20 20 20 20 20 72 73 36 30 30 30  ;..       rs6000
12e0: 20 29 0a 20 20 20 20 20 20 20 20 20 67 6c 5f 63   ).         gl_c
12f0: 76 5f 68 6f 73 74 5f 63 70 75 5f 63 5f 61 62 69  v_host_cpu_c_abi
1300: 3d 70 6f 77 65 72 70 63 0a 20 20 20 20 20 20 20  =powerpc.       
1310: 20 20 3b 3b 0a 0a 20 20 20 20 20 20 20 23 20 54    ;;..       # T
1320: 4f 44 4f 3a 20 44 69 73 74 69 6e 67 75 69 73 68  ODO: Distinguish
1330: 20 73 33 39 30 20 61 6e 64 20 73 33 39 30 78 20   s390 and s390x 
1340: 63 6f 72 72 65 63 74 6c 79 2e 0a 0a 20 20 20 20  correctly...    
1350: 20 20 20 73 70 61 72 63 20 7c 20 73 70 61 72 63     sparc | sparc
1360: 36 34 20 29 0a 20 20 20 20 20 20 20 20 20 23 20  64 ).         # 
1370: 55 6c 74 72 61 53 50 41 52 43 73 20 72 75 6e 6e  UltraSPARCs runn
1380: 69 6e 67 20 4c 69 6e 75 78 20 68 61 76 65 20 60  ing Linux have `
1390: 75 6e 61 6d 65 20 2d 6d 60 20 3d 20 22 73 70 61  uname -m` = "spa
13a0: 72 63 36 34 22 2c 20 62 75 74 20 74 68 65 0a 20  rc64", but the. 
13b0: 20 20 20 20 20 20 20 20 23 20 43 20 63 6f 6d 70          # C comp
13c0: 69 6c 65 72 20 73 74 69 6c 6c 20 67 65 6e 65 72  iler still gener
13d0: 61 74 65 73 20 33 32 2d 62 69 74 20 63 6f 64 65  ates 32-bit code
13e0: 2e 0a 20 20 20 20 20 20 20 20 20 41 43 5f 45 47  ..         AC_EG
13f0: 52 45 50 5f 43 50 50 28 5b 79 65 73 5d 2c 0a 20  REP_CPP([yes],. 
1400: 20 20 20 20 20 20 20 20 20 20 5b 23 69 66 20 64            [#if d
1410: 65 66 69 6e 65 64 20 5f 5f 73 70 61 72 63 76 39  efined __sparcv9
1420: 20 7c 7c 20 64 65 66 69 6e 65 64 20 5f 5f 61 72   || defined __ar
1430: 63 68 36 34 5f 5f 0a 20 20 20 20 20 20 20 20 20  ch64__.         
1440: 20 20 20 79 65 73 0a 20 20 20 20 20 20 20 20 20     yes.         
1450: 20 20 20 23 65 6e 64 69 66 5d 2c 0a 20 20 20 20     #endif],.    
1460: 20 20 20 20 20 20 20 5b 67 6c 5f 63 76 5f 68 6f         [gl_cv_ho
1470: 73 74 5f 63 70 75 5f 63 5f 61 62 69 3d 73 70 61  st_cpu_c_abi=spa
1480: 72 63 36 34 5d 2c 0a 20 20 20 20 20 20 20 20 20  rc64],.         
1490: 20 20 5b 67 6c 5f 63 76 5f 68 6f 73 74 5f 63 70    [gl_cv_host_cp
14a0: 75 5f 63 5f 61 62 69 3d 73 70 61 72 63 5d 29 0a  u_c_abi=sparc]).
14b0: 20 20 20 20 20 20 20 20 20 3b 3b 0a 0a 20 20 20           ;;..   
14c0: 20 20 20 20 2a 29 0a 20 20 20 20 20 20 20 20 20      *).         
14d0: 67 6c 5f 63 76 5f 68 6f 73 74 5f 63 70 75 5f 63  gl_cv_host_cpu_c
14e0: 5f 61 62 69 3d 22 24 68 6f 73 74 5f 63 70 75 22  _abi="$host_cpu"
14f0: 0a 20 20 20 20 20 20 20 20 20 3b 3b 0a 20 20 20  .         ;;.   
1500: 20 20 65 73 61 63 0a 20 20 20 20 5d 29 0a 0a 20    esac.    ]).. 
1510: 20 48 4f 53 54 5f 43 50 55 5f 43 5f 41 42 49 3d   HOST_CPU_C_ABI=
1520: 22 24 67 6c 5f 63 76 5f 68 6f 73 74 5f 63 70 75  "$gl_cv_host_cpu
1530: 5f 63 5f 61 62 69 22 0a 20 20 41 43 5f 53 55 42  _c_abi".  AC_SUB
1540: 53 54 28 5b 48 4f 53 54 5f 43 50 55 5f 43 5f 41  ST([HOST_CPU_C_A
1550: 42 49 5d 29 0a 0a 20 20 23 20 54 68 69 73 20 77  BI])..  # This w
1560: 61 73 20 41 43 5f 44 45 46 49 4e 45 5f 55 4e 51  as AC_DEFINE_UNQ
1570: 55 4f 54 45 44 28 5b 5f 5f 24 7b 67 6c 5f 63 76  UOTED([__${gl_cv
1580: 5f 68 6f 73 74 5f 63 70 75 5f 63 5f 61 62 69 7d  _host_cpu_c_abi}
1590: 5f 5f 5d 29 20 65 61 72 6c 69 65 72 2c 0a 20 20  __]) earlier,.  
15a0: 23 20 62 75 74 20 4b 41 49 20 43 2b 2b 20 33 2e  # but KAI C++ 3.
15b0: 32 64 20 64 6f 65 73 6e 27 74 20 6c 69 6b 65 20  2d doesn't like 
15c0: 74 68 69 73 2e 0a 20 20 63 61 74 20 3e 3e 20 63  this..  cat >> c
15d0: 6f 6e 66 64 65 66 73 2e 68 20 3c 3c 45 4f 46 0a  onfdefs.h <<EOF.
15e0: 23 69 66 6e 64 65 66 20 5f 5f 24 7b 67 6c 5f 63  #ifndef __${gl_c
15f0: 76 5f 68 6f 73 74 5f 63 70 75 5f 63 5f 61 62 69  v_host_cpu_c_abi
1600: 7d 5f 5f 0a 23 64 65 66 69 6e 65 20 5f 5f 24 7b  }__.#define __${
1610: 67 6c 5f 63 76 5f 68 6f 73 74 5f 63 70 75 5f 63  gl_cv_host_cpu_c
1620: 5f 61 62 69 7d 5f 5f 20 31 0a 23 65 6e 64 69 66  _abi}__ 1.#endif
1630: 0a 45 4f 46 0a 20 20 41 48 5f 54 4f 50 28 5b 2f  .EOF.  AH_TOP([/
1640: 2a 20 43 50 55 20 61 6e 64 20 43 20 41 42 49 20  * CPU and C ABI 
1650: 69 6e 64 69 63 61 74 6f 72 20 2a 2f 0a 23 69 66  indicator */.#if
1660: 6e 64 65 66 20 5f 5f 69 33 38 36 5f 5f 0a 23 75  ndef __i386__.#u
1670: 6e 64 65 66 20 5f 5f 69 33 38 36 5f 5f 0a 23 65  ndef __i386__.#e
1680: 6e 64 69 66 0a 23 69 66 6e 64 65 66 20 5f 5f 78  ndif.#ifndef __x
1690: 38 36 5f 36 34 5f 5f 0a 23 75 6e 64 65 66 20 5f  86_64__.#undef _
16a0: 5f 78 38 36 5f 36 34 5f 5f 0a 23 65 6e 64 69 66  _x86_64__.#endif
16b0: 0a 23 69 66 6e 64 65 66 20 5f 5f 61 6c 70 68 61  .#ifndef __alpha
16c0: 5f 5f 0a 23 75 6e 64 65 66 20 5f 5f 61 6c 70 68  __.#undef __alph
16d0: 61 5f 5f 0a 23 65 6e 64 69 66 0a 23 69 66 6e 64  a__.#endif.#ifnd
16e0: 65 66 20 5f 5f 61 72 6d 5f 5f 0a 23 75 6e 64 65  ef __arm__.#unde
16f0: 66 20 5f 5f 61 72 6d 5f 5f 0a 23 65 6e 64 69 66  f __arm__.#endif
1700: 0a 23 69 66 6e 64 65 66 20 5f 5f 61 72 6d 65 6c  .#ifndef __armel
1710: 5f 5f 0a 23 75 6e 64 65 66 20 5f 5f 61 72 6d 65  __.#undef __arme
1720: 6c 5f 5f 0a 23 65 6e 64 69 66 0a 23 69 66 6e 64  l__.#endif.#ifnd
1730: 65 66 20 5f 5f 68 70 70 61 5f 5f 0a 23 75 6e 64  ef __hppa__.#und
1740: 65 66 20 5f 5f 68 70 70 61 5f 5f 0a 23 65 6e 64  ef __hppa__.#end
1750: 69 66 0a 23 69 66 6e 64 65 66 20 5f 5f 68 70 70  if.#ifndef __hpp
1760: 61 36 34 5f 5f 0a 23 75 6e 64 65 66 20 5f 5f 68  a64__.#undef __h
1770: 70 70 61 36 34 5f 5f 0a 23 65 6e 64 69 66 0a 23  ppa64__.#endif.#
1780: 69 66 6e 64 65 66 20 5f 5f 69 61 36 34 5f 5f 0a  ifndef __ia64__.
1790: 23 75 6e 64 65 66 20 5f 5f 69 61 36 34 5f 5f 0a  #undef __ia64__.
17a0: 23 65 6e 64 69 66 0a 23 69 66 6e 64 65 66 20 5f  #endif.#ifndef _
17b0: 5f 6d 36 38 6b 5f 5f 0a 23 75 6e 64 65 66 20 5f  _m68k__.#undef _
17c0: 5f 6d 36 38 6b 5f 5f 0a 23 65 6e 64 69 66 0a 23  _m68k__.#endif.#
17d0: 69 66 6e 64 65 66 20 5f 5f 6d 69 70 73 5f 5f 0a  ifndef __mips__.
17e0: 23 75 6e 64 65 66 20 5f 5f 6d 69 70 73 5f 5f 0a  #undef __mips__.
17f0: 23 65 6e 64 69 66 0a 23 69 66 6e 64 65 66 20 5f  #endif.#ifndef _
1800: 5f 6d 69 70 73 6e 33 32 5f 5f 0a 23 75 6e 64 65  _mipsn32__.#unde
1810: 66 20 5f 5f 6d 69 70 73 6e 33 32 5f 5f 0a 23 65  f __mipsn32__.#e
1820: 6e 64 69 66 0a 23 69 66 6e 64 65 66 20 5f 5f 6d  ndif.#ifndef __m
1830: 69 70 73 36 34 5f 5f 0a 23 75 6e 64 65 66 20 5f  ips64__.#undef _
1840: 5f 6d 69 70 73 36 34 5f 5f 0a 23 65 6e 64 69 66  _mips64__.#endif
1850: 0a 23 69 66 6e 64 65 66 20 5f 5f 70 6f 77 65 72  .#ifndef __power
1860: 70 63 5f 5f 0a 23 75 6e 64 65 66 20 5f 5f 70 6f  pc__.#undef __po
1870: 77 65 72 70 63 5f 5f 0a 23 65 6e 64 69 66 0a 23  werpc__.#endif.#
1880: 69 66 6e 64 65 66 20 5f 5f 70 6f 77 65 72 70 63  ifndef __powerpc
1890: 36 34 5f 5f 0a 23 75 6e 64 65 66 20 5f 5f 70 6f  64__.#undef __po
18a0: 77 65 72 70 63 36 34 5f 5f 0a 23 65 6e 64 69 66  werpc64__.#endif
18b0: 0a 23 69 66 6e 64 65 66 20 5f 5f 73 33 39 30 5f  .#ifndef __s390_
18c0: 5f 0a 23 75 6e 64 65 66 20 5f 5f 73 33 39 30 5f  _.#undef __s390_
18d0: 5f 0a 23 65 6e 64 69 66 0a 23 69 66 6e 64 65 66  _.#endif.#ifndef
18e0: 20 5f 5f 73 33 39 30 78 5f 5f 0a 23 75 6e 64 65   __s390x__.#unde
18f0: 66 20 5f 5f 73 33 39 30 78 5f 5f 0a 23 65 6e 64  f __s390x__.#end
1900: 69 66 0a 23 69 66 6e 64 65 66 20 5f 5f 73 68 5f  if.#ifndef __sh_
1910: 5f 0a 23 75 6e 64 65 66 20 5f 5f 73 68 5f 5f 0a  _.#undef __sh__.
1920: 23 65 6e 64 69 66 0a 23 69 66 6e 64 65 66 20 5f  #endif.#ifndef _
1930: 5f 73 70 61 72 63 5f 5f 0a 23 75 6e 64 65 66 20  _sparc__.#undef 
1940: 5f 5f 73 70 61 72 63 5f 5f 0a 23 65 6e 64 69 66  __sparc__.#endif
1950: 0a 23 69 66 6e 64 65 66 20 5f 5f 73 70 61 72 63  .#ifndef __sparc
1960: 36 34 5f 5f 0a 23 75 6e 64 65 66 20 5f 5f 73 70  64__.#undef __sp
1970: 61 72 63 36 34 5f 5f 0a 23 65 6e 64 69 66 0a 5d  arc64__.#endif.]
1980: 29 0a 0a 5d 29 0a                                )..]).