Artifact 1130a180a706ba8d46e13bbc63f3d8a92321fc9b:


0000: 64 6e 6c 20 43 6f 70 79 72 69 67 68 74 20 28 43  dnl Copyright (C
0010: 29 20 31 39 39 33 2d 32 30 30 32 20 46 72 65 65  ) 1993-2002 Free
0020: 20 53 6f 66 74 77 61 72 65 20 46 6f 75 6e 64 61   Software Founda
0030: 74 69 6f 6e 2c 20 49 6e 63 2e 0a 64 6e 6c 20 54  tion, Inc..dnl T
0040: 68 69 73 20 66 69 6c 65 20 69 73 20 66 72 65 65  his file is free
0050: 20 73 6f 66 74 77 61 72 65 2c 20 64 69 73 74 72   software, distr
0060: 69 62 75 74 65 64 20 75 6e 64 65 72 20 74 68 65  ibuted under the
0070: 20 74 65 72 6d 73 20 6f 66 20 74 68 65 20 47 4e   terms of the GN
0080: 55 0a 64 6e 6c 20 47 65 6e 65 72 61 6c 20 50 75  U.dnl General Pu
0090: 62 6c 69 63 20 4c 69 63 65 6e 73 65 2e 20 20 41  blic License.  A
00a0: 73 20 61 20 73 70 65 63 69 61 6c 20 65 78 63 65  s a special exce
00b0: 70 74 69 6f 6e 20 74 6f 20 74 68 65 20 47 4e 55  ption to the GNU
00c0: 20 47 65 6e 65 72 61 6c 0a 64 6e 6c 20 50 75 62   General.dnl Pub
00d0: 6c 69 63 20 4c 69 63 65 6e 73 65 2c 20 74 68 69  lic License, thi
00e0: 73 20 66 69 6c 65 20 6d 61 79 20 62 65 20 64 69  s file may be di
00f0: 73 74 72 69 62 75 74 65 64 20 61 73 20 70 61 72  stributed as par
0100: 74 20 6f 66 20 61 20 70 72 6f 67 72 61 6d 0a 64  t of a program.d
0110: 6e 6c 20 74 68 61 74 20 63 6f 6e 74 61 69 6e 73  nl that contains
0120: 20 61 20 63 6f 6e 66 69 67 75 72 61 74 69 6f 6e   a configuration
0130: 20 73 63 72 69 70 74 20 67 65 6e 65 72 61 74 65   script generate
0140: 64 20 62 79 20 41 75 74 6f 63 6f 6e 66 2c 20 75  d by Autoconf, u
0150: 6e 64 65 72 0a 64 6e 6c 20 74 68 65 20 73 61 6d  nder.dnl the sam
0160: 65 20 64 69 73 74 72 69 62 75 74 69 6f 6e 20 74  e distribution t
0170: 65 72 6d 73 20 61 73 20 74 68 65 20 72 65 73 74  erms as the rest
0180: 20 6f 66 20 74 68 61 74 20 70 72 6f 67 72 61 6d   of that program
0190: 2e 0a 0a 64 6e 6c 20 46 72 6f 6d 20 42 72 75 6e  ...dnl From Brun
01a0: 6f 20 48 61 69 62 6c 65 2c 20 4d 61 72 63 75 73  o Haible, Marcus
01b0: 20 44 61 6e 69 65 6c 73 2e 0a 0a 41 43 5f 50 52   Daniels...AC_PR
01c0: 45 52 45 51 28 32 2e 31 33 29 0a 0a 41 43 5f 44  EREQ(2.13)..AC_D
01d0: 45 46 55 4e 28 5b 43 4c 5f 53 4d 41 4c 4c 5f 53  EFUN([CL_SMALL_S
01e0: 54 52 55 43 54 5f 52 45 54 55 52 4e 5d 2c 0a 5b  TRUCT_RETURN],.[
01f0: 41 43 5f 43 41 43 48 45 5f 43 48 45 43 4b 28 5b  AC_CACHE_CHECK([
0200: 77 68 65 74 68 65 72 20 73 6d 61 6c 6c 20 73 74  whether small st
0210: 72 75 63 74 73 20 61 72 65 20 72 65 74 75 72 6e  ructs are return
0220: 65 64 20 69 6e 20 72 65 67 69 73 74 65 72 73 5d  ed in registers]
0230: 2c 20 63 6c 5f 63 76 5f 63 5f 73 74 72 75 63 74  , cl_cv_c_struct
0240: 5f 72 65 74 75 72 6e 5f 73 6d 61 6c 6c 2c 20 5b  _return_small, [
0250: 0a 41 43 5f 54 52 59 5f 52 55 4e 28 5b 74 79 70  .AC_TRY_RUN([typ
0260: 65 64 65 66 20 73 74 72 75 63 74 20 7b 20 69 6e  edef struct { in
0270: 74 20 78 3b 20 7d 20 66 6f 6f 3b 20 69 6e 74 20  t x; } foo; int 
0280: 79 3b 0a 66 6f 6f 20 66 6f 6f 66 75 6e 20 28 29  y;.foo foofun ()
0290: 20 7b 20 66 6f 6f 20 66 3b 20 66 2e 78 20 3d 20   { foo f; f.x = 
02a0: 79 3b 20 72 65 74 75 72 6e 20 66 3b 20 7d 0a 69  y; return f; }.i
02b0: 6e 74 20 28 2a 66 75 6e 29 20 28 29 20 3d 20 28  nt (*fun) () = (
02c0: 69 6e 74 20 28 2a 29 20 28 29 29 20 66 6f 6f 66  int (*) ()) foof
02d0: 75 6e 3b 0a 69 6e 74 20 6d 61 69 6e 28 29 0a 7b  un;.int main().{
02e0: 20 79 20 3d 20 33 37 3b 20 69 66 20 28 28 2a 66   y = 37; if ((*f
02f0: 75 6e 29 28 29 20 21 3d 20 33 37 29 20 65 78 69  un)() != 37) exi
0300: 74 28 31 29 3b 0a 20 20 79 20 3d 20 35 35 3b 20  t(1);.  y = 55; 
0310: 69 66 20 28 28 2a 66 75 6e 29 28 29 20 21 3d 20  if ((*fun)() != 
0320: 35 35 29 20 65 78 69 74 28 31 29 3b 0a 20 20 65  55) exit(1);.  e
0330: 78 69 74 28 30 29 3b 0a 7d 5d 2c 20 63 6c 5f 63  xit(0);.}], cl_c
0340: 76 5f 63 5f 73 74 72 75 63 74 5f 72 65 74 75 72  v_c_struct_retur
0350: 6e 5f 73 6d 61 6c 6c 3d 79 65 73 2c 20 72 6d 20  n_small=yes, rm 
0360: 2d 66 20 63 6f 72 65 0a 63 6c 5f 63 76 5f 63 5f  -f core.cl_cv_c_
0370: 73 74 72 75 63 74 5f 72 65 74 75 72 6e 5f 73 6d  struct_return_sm
0380: 61 6c 6c 3d 6e 6f 2c 0a 64 6e 6c 20 57 68 65 6e  all=no,.dnl When
0390: 20 63 72 6f 73 73 2d 63 6f 6d 70 69 6c 69 6e 67   cross-compiling
03a0: 2c 20 64 6f 6e 27 74 20 61 73 73 75 6d 65 20 61  , don't assume a
03b0: 6e 79 74 68 69 6e 67 2e 0a 64 6e 6c 20 54 68 65  nything..dnl The
03c0: 72 65 20 61 72 65 20 65 76 65 6e 20 77 65 69 72  re are even weir
03d0: 64 65 72 20 72 65 74 75 72 6e 20 76 61 6c 75 65  der return value
03e0: 20 70 61 73 73 69 6e 67 20 63 6f 6e 76 65 6e 74   passing convent
03f0: 69 6f 6e 73 20 74 68 61 6e 20 70 63 63 2e 0a 63  ions than pcc..c
0400: 6c 5f 63 76 5f 63 5f 73 74 72 75 63 74 5f 72 65  l_cv_c_struct_re
0410: 74 75 72 6e 5f 73 6d 61 6c 6c 3d 22 67 75 65 73  turn_small="gues
0420: 73 69 6e 67 20 6e 6f 22 29 0a 5d 29 0a 63 61 73  sing no").]).cas
0430: 65 20 22 24 63 6c 5f 63 76 5f 63 5f 73 74 72 75  e "$cl_cv_c_stru
0440: 63 74 5f 72 65 74 75 72 6e 5f 73 6d 61 6c 6c 22  ct_return_small"
0450: 20 69 6e 0a 20 20 2a 79 65 73 29 20 41 43 5f 44   in.  *yes) AC_D
0460: 45 46 49 4e 45 28 5f 5f 53 4d 41 4c 4c 5f 53 54  EFINE(__SMALL_ST
0470: 52 55 43 54 5f 52 45 54 55 52 4e 5f 5f 29 20 3b  RUCT_RETURN__) ;
0480: 3b 0a 20 20 2a 6e 6f 29 20 3b 3b 0a 65 73 61 63  ;.  *no) ;;.esac
0490: 0a 5d 29 0a                                      .]).