Artifact d62134b3c04c01640c6a82be7c847c37c6be591b:


0000: 64 6e 6c 20 2d 2a 2d 20 41 75 74 6f 63 6f 6e 66  dnl -*- Autoconf
0010: 20 2d 2a 2d 0a 64 6e 6c 20 43 6f 70 79 72 69 67   -*-.dnl Copyrig
0020: 68 74 20 28 43 29 20 31 39 39 33 2d 32 30 30 39  ht (C) 1993-2009
0030: 20 46 72 65 65 20 53 6f 66 74 77 61 72 65 20 46   Free Software F
0040: 6f 75 6e 64 61 74 69 6f 6e 2c 20 49 6e 63 2e 0a  oundation, Inc..
0050: 64 6e 6c 20 54 68 69 73 20 66 69 6c 65 20 69 73  dnl This file is
0060: 20 66 72 65 65 20 73 6f 66 74 77 61 72 65 2c 20   free software, 
0070: 64 69 73 74 72 69 62 75 74 65 64 20 75 6e 64 65  distributed unde
0080: 72 20 74 68 65 20 74 65 72 6d 73 20 6f 66 20 74  r the terms of t
0090: 68 65 20 47 4e 55 0a 64 6e 6c 20 47 65 6e 65 72  he GNU.dnl Gener
00a0: 61 6c 20 50 75 62 6c 69 63 20 4c 69 63 65 6e 73  al Public Licens
00b0: 65 2e 20 20 41 73 20 61 20 73 70 65 63 69 61 6c  e.  As a special
00c0: 20 65 78 63 65 70 74 69 6f 6e 20 74 6f 20 74 68   exception to th
00d0: 65 20 47 4e 55 20 47 65 6e 65 72 61 6c 0a 64 6e  e GNU General.dn
00e0: 6c 20 50 75 62 6c 69 63 20 4c 69 63 65 6e 73 65  l Public License
00f0: 2c 20 74 68 69 73 20 66 69 6c 65 20 6d 61 79 20  , this file may 
0100: 62 65 20 64 69 73 74 72 69 62 75 74 65 64 20 61  be distributed a
0110: 73 20 70 61 72 74 20 6f 66 20 61 20 70 72 6f 67  s part of a prog
0120: 72 61 6d 0a 64 6e 6c 20 74 68 61 74 20 63 6f 6e  ram.dnl that con
0130: 74 61 69 6e 73 20 61 20 63 6f 6e 66 69 67 75 72  tains a configur
0140: 61 74 69 6f 6e 20 73 63 72 69 70 74 20 67 65 6e  ation script gen
0150: 65 72 61 74 65 64 20 62 79 20 41 75 74 6f 63 6f  erated by Autoco
0160: 6e 66 2c 20 75 6e 64 65 72 0a 64 6e 6c 20 74 68  nf, under.dnl th
0170: 65 20 73 61 6d 65 20 64 69 73 74 72 69 62 75 74  e same distribut
0180: 69 6f 6e 20 74 65 72 6d 73 20 61 73 20 74 68 65  ion terms as the
0190: 20 72 65 73 74 20 6f 66 20 74 68 61 74 20 70 72   rest of that pr
01a0: 6f 67 72 61 6d 2e 0a 0a 64 6e 6c 20 46 72 6f 6d  ogram...dnl From
01b0: 20 42 72 75 6e 6f 20 48 61 69 62 6c 65 2c 20 4d   Bruno Haible, M
01c0: 61 72 63 75 73 20 44 61 6e 69 65 6c 73 2c 20 53  arcus Daniels, S
01d0: 61 6d 20 53 74 65 69 6e 67 6f 6c 64 2e 0a 0a 41  am Steingold...A
01e0: 43 5f 50 52 45 52 45 51 28 32 2e 31 33 29 0a 0a  C_PREREQ(2.13)..
01f0: 41 43 5f 44 45 46 55 4e 28 5b 53 53 52 5f 44 4f  AC_DEFUN([SSR_DO
0200: 43 5d 2c 5b 77 68 65 74 68 65 72 20 73 6d 61 6c  C],[whether smal
0210: 6c 20 73 74 72 75 63 74 73 20 61 72 65 20 72 65  l structs are re
0220: 74 75 72 6e 65 64 20 69 6e 20 72 65 67 69 73 74  turned in regist
0230: 65 72 73 5d 29 0a 41 43 5f 44 45 46 55 4e 28 5b  ers]).AC_DEFUN([
0240: 46 46 43 41 4c 4c 5f 53 4d 41 4c 4c 5f 53 54 52  FFCALL_SMALL_STR
0250: 55 43 54 5f 52 45 54 55 52 4e 5d 2c 5b 64 6e 6c  UCT_RETURN],[dnl
0260: 0a 41 43 5f 43 41 43 48 45 5f 43 48 45 43 4b 28  .AC_CACHE_CHECK(
0270: 53 53 52 5f 44 4f 43 2c 66 66 63 61 6c 6c 5f 63  SSR_DOC,ffcall_c
0280: 76 5f 63 5f 73 74 72 75 63 74 5f 72 65 74 75 72  v_c_struct_retur
0290: 6e 5f 73 6d 61 6c 6c 2c 5b 41 43 5f 54 52 59 5f  n_small,[AC_TRY_
02a0: 52 55 4e 28 47 4c 5f 4e 4f 43 52 41 53 48 5b 0a  RUN(GL_NOCRASH[.
02b0: 74 79 70 65 64 65 66 20 73 74 72 75 63 74 20 7b  typedef struct {
02c0: 20 6c 6f 6e 67 20 78 3b 20 7d 20 66 6f 6f 3b 20   long x; } foo; 
02d0: 6c 6f 6e 67 20 79 3b 0a 66 6f 6f 20 66 6f 6f 66  long y;.foo foof
02e0: 75 6e 20 28 29 20 7b 20 66 6f 6f 20 66 3b 20 66  un () { foo f; f
02f0: 2e 78 20 3d 20 79 3b 20 72 65 74 75 72 6e 20 66  .x = y; return f
0300: 3b 20 7d 0a 6c 6f 6e 67 20 28 2a 66 75 6e 29 20  ; }.long (*fun) 
0310: 28 29 20 3d 20 28 6c 6f 6e 67 20 28 2a 29 20 28  () = (long (*) (
0320: 29 29 20 66 6f 6f 66 75 6e 3b 0a 69 6e 74 20 6d  )) foofun;.int m
0330: 61 69 6e 28 29 20 7b 0a 20 20 6e 6f 63 72 61 73  ain() {.  nocras
0340: 68 5f 69 6e 69 74 28 29 3b 0a 20 20 79 20 3d 20  h_init();.  y = 
0350: 33 37 3b 20 69 66 20 28 28 2a 66 75 6e 29 28 29  37; if ((*fun)()
0360: 20 21 3d 20 33 37 29 20 72 65 74 75 72 6e 20 31   != 37) return 1
0370: 3b 0a 20 20 79 20 3d 20 35 35 3b 20 69 66 20 28  ;.  y = 55; if (
0380: 28 2a 66 75 6e 29 28 29 20 21 3d 20 35 35 29 20  (*fun)() != 55) 
0390: 72 65 74 75 72 6e 20 31 3b 0a 20 20 72 65 74 75  return 1;.  retu
03a0: 72 6e 20 30 3b 0a 7d 5d 2c 20 66 66 63 61 6c 6c  rn 0;.}], ffcall
03b0: 5f 63 76 5f 63 5f 73 74 72 75 63 74 5f 72 65 74  _cv_c_struct_ret
03c0: 75 72 6e 5f 73 6d 61 6c 6c 3d 79 65 73 2c 20 66  urn_small=yes, f
03d0: 66 63 61 6c 6c 5f 63 76 5f 63 5f 73 74 72 75 63  fcall_cv_c_struc
03e0: 74 5f 72 65 74 75 72 6e 5f 73 6d 61 6c 6c 3d 6e  t_return_small=n
03f0: 6f 2c 0a 64 6e 6c 20 57 68 65 6e 20 63 72 6f 73  o,.dnl When cros
0400: 73 2d 63 6f 6d 70 69 6c 69 6e 67 2c 20 64 6f 6e  s-compiling, don
0410: 27 74 20 61 73 73 75 6d 65 20 61 6e 79 74 68 69  't assume anythi
0420: 6e 67 2e 0a 64 6e 6c 20 54 68 65 72 65 20 61 72  ng..dnl There ar
0430: 65 20 65 76 65 6e 20 77 65 69 72 64 65 72 20 72  e even weirder r
0440: 65 74 75 72 6e 20 76 61 6c 75 65 20 70 61 73 73  eturn value pass
0450: 69 6e 67 20 63 6f 6e 76 65 6e 74 69 6f 6e 73 20  ing conventions 
0460: 74 68 61 6e 20 70 63 63 2e 0a 66 66 63 61 6c 6c  than pcc..ffcall
0470: 5f 63 76 5f 63 5f 73 74 72 75 63 74 5f 72 65 74  _cv_c_struct_ret
0480: 75 72 6e 5f 73 6d 61 6c 6c 3d 22 67 75 65 73 73  urn_small="guess
0490: 69 6e 67 20 6e 6f 22 29 0a 5d 29 0a 63 61 73 65  ing no").]).case
04a0: 20 22 24 66 66 63 61 6c 6c 5f 63 76 5f 63 5f 73   "$ffcall_cv_c_s
04b0: 74 72 75 63 74 5f 72 65 74 75 72 6e 5f 73 6d 61  truct_return_sma
04c0: 6c 6c 22 20 69 6e 0a 20 20 2a 79 65 73 29 20 41  ll" in.  *yes) A
04d0: 43 5f 44 45 46 49 4e 45 28 5b 5f 5f 53 4d 41 4c  C_DEFINE([__SMAL
04e0: 4c 5f 53 54 52 55 43 54 5f 52 45 54 55 52 4e 5f  L_STRUCT_RETURN_
04f0: 5f 5d 2c 20 5b 5d 2c 20 53 53 52 5f 44 4f 43 29  _], [], SSR_DOC)
0500: 20 3b 3b 0a 20 20 2a 6e 6f 29 20 3b 3b 0a 65 73   ;;.  *no) ;;.es
0510: 61 63 0a 5d 29 0a                                ac.]).