source: trunk/src/gcc/libffi/aclocal.m4@ 9

Last change on this file since 9 was 2, checked in by bird, 23 years ago

Initial revision

  • Property cvs2svn:cvs-rev set to 1.1
  • Property svn:eol-style set to native
  • Property svn:executable set to *
File size: 8.6 KB
RevLine 
[2]1dnl aclocal.m4 generated automatically by aclocal 1.4
2
3dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
4dnl This file is free software; the Free Software Foundation
5dnl gives unlimited permission to copy and/or distribute it,
6dnl with or without modifications, as long as this notice is preserved.
7
8dnl This program is distributed in the hope that it will be useful,
9dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
10dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
11dnl PARTICULAR PURPOSE.
12
13sinclude(../libtool.m4)
14dnl The lines below arrange for aclocal not to bring libtool.m4
15dnl AC_PROG_LIBTOOL into aclocal.m4, while still arranging for automake
16dnl to add a definition of LIBTOOL to Makefile.in.
17ifelse(yes,no,[
18AC_DEFUN([AC_PROG_LIBTOOL],)
19AC_SUBST(LIBTOOL)
20])
21
22AC_DEFUN([AC_COMPILE_CHECK_SIZEOF],
23[changequote(<<, >>)dnl
24dnl The name to #define.
25define(<<AC_TYPE_NAME>>, translit(sizeof_$1, [a-z *], [A-Z_P]))dnl
26dnl The cache variable name.
27define(<<AC_CV_NAME>>, translit(ac_cv_sizeof_$1, [ *], [_p]))dnl
28changequote([, ])dnl
29AC_MSG_CHECKING(size of $1)
30AC_CACHE_VAL(AC_CV_NAME,
31[for ac_size in 4 8 1 2 16 12 $2 ; do # List sizes in rough order of prevalence.
32 AC_TRY_COMPILE([#include "confdefs.h"
33#include <sys/types.h>
34$2
35], [switch (0) case 0: case (sizeof ($1) == $ac_size):;], AC_CV_NAME=$ac_size)
36 if test x$AC_CV_NAME != x ; then break; fi
37done
38])
39if test x$AC_CV_NAME = x ; then
40 AC_MSG_ERROR([cannot determine a size for $1])
41fi
42AC_MSG_RESULT($AC_CV_NAME)
43AC_DEFINE_UNQUOTED(AC_TYPE_NAME, $AC_CV_NAME, [The number of bytes in type $1])
44undefine([AC_TYPE_NAME])dnl
45undefine([AC_CV_NAME])dnl
46])
47
48AC_DEFUN([AC_C_BIGENDIAN_CROSS],
49[AC_CACHE_CHECK(whether byte ordering is bigendian, ac_cv_c_bigendian,
50[ac_cv_c_bigendian=unknown
51# See if sys/param.h defines the BYTE_ORDER macro.
52AC_TRY_COMPILE([#include <sys/types.h>
53#include <sys/param.h>], [
54#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
55 bogus endian macros
56#endif], [# It does; now see whether it defined to BIG_ENDIAN or not.
57AC_TRY_COMPILE([#include <sys/types.h>
58#include <sys/param.h>], [
59#if BYTE_ORDER != BIG_ENDIAN
60 not big endian
61#endif], ac_cv_c_bigendian=yes, ac_cv_c_bigendian=no)])
62if test $ac_cv_c_bigendian = unknown; then
63AC_TRY_RUN([main () {
64 /* Are we little or big endian? From Harbison&Steele. */
65 union
66 {
67 long l;
68 char c[sizeof (long)];
69 } u;
70 u.l = 1;
71 exit (u.c[sizeof (long) - 1] == 1);
72}], ac_cv_c_bigendian=no, ac_cv_c_bigendian=yes,
73[ echo $ac_n "cross-compiling... " 2>&AC_FD_MSG ])
74fi])
75if test $ac_cv_c_bigendian = unknown; then
76AC_MSG_CHECKING(to probe for byte ordering)
77[
78cat >conftest.c <<EOF
79short ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
80short ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
81void _ascii() { char* s = (char*) ascii_mm; s = (char*) ascii_ii; }
82short ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
83short ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
84void _ebcdic() { char* s = (char*) ebcdic_mm; s = (char*) ebcdic_ii; }
85int main() { _ascii (); _ebcdic (); return 0; }
86EOF
87] if test -f conftest.c ; then
88 if ${CC-cc} ${CFLAGS} conftest.c -o conftest.o && test -f conftest.o ; then
89 if test `grep -l BIGenDianSyS conftest.o` ; then
90 echo $ac_n ' big endian probe OK, ' 1>&AC_FD_MSG
91 ac_cv_c_bigendian=yes
92 fi
93 if test `grep -l LiTTleEnDian conftest.o` ; then
94 echo $ac_n ' little endian probe OK, ' 1>&AC_FD_MSG
95 if test $ac_cv_c_bigendian = yes ; then
96 ac_cv_c_bigendian=unknown;
97 else
98 ac_cv_c_bigendian=no
99 fi
100 fi
101 echo $ac_n 'guessing bigendian ... ' >&AC_FD_MSG
102 fi
103 fi
104AC_MSG_RESULT($ac_cv_c_bigendian)
105fi
106if test $ac_cv_c_bigendian = yes; then
107 AC_DEFINE(WORDS_BIGENDIAN, 1, [whether byteorder is bigendian])
108 BYTEORDER=4321
109else
110 BYTEORDER=1234
111fi
112AC_DEFINE_UNQUOTED(BYTEORDER, $BYTEORDER, [1234 = LIL_ENDIAN, 4321 = BIGENDIAN])
113if test $ac_cv_c_bigendian = unknown; then
114 AC_MSG_ERROR(unknown endianess - sorry, please pre-set ac_cv_c_bigendian)
115fi
116])
117
118# Like AC_CONFIG_HEADER, but automatically create stamp file.
119
120AC_DEFUN(AM_CONFIG_HEADER,
121[AC_PREREQ([2.12])
122AC_CONFIG_HEADER([$1])
123dnl When config.status generates a header, we must update the stamp-h file.
124dnl This file resides in the same directory as the config header
125dnl that is generated. We must strip everything past the first ":",
126dnl and everything past the last "/".
127AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
128ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
129<<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
130<<am_indx=1
131for am_file in <<$1>>; do
132 case " <<$>>CONFIG_HEADERS " in
133 *" <<$>>am_file "*<<)>>
134 echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
135 ;;
136 esac
137 am_indx=`expr "<<$>>am_indx" + 1`
138done<<>>dnl>>)
139changequote([,]))])
140
141# Do all the work for Automake. This macro actually does too much --
142# some checks are only needed if your package does certain things.
143# But this isn't really a big deal.
144
145# serial 1
146
147dnl Usage: