]> gcc.gnu.org Git - gcc.git/blame - libffi/aclocal.m4
sh.h (EXTRA_CONSTRAINT_Z): New macro.
[gcc.git] / libffi / aclocal.m4
CommitLineData
dc5de370 1dnl aclocal.m4 generated automatically by aclocal 1.4
63e5e3e0
AG
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
2f7bf5b7
AO
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
e2f2e70a
AG
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
63e5e3e0
AG
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:
148dnl AM_INIT_AUTOMAKE(package,version, [no-define])
149
150AC_DEFUN(AM_INIT_AUTOMAKE,
151[AC_REQUIRE([AC_PROG_INSTALL])
63e5e3e0
AG
152PACKAGE=[$1]
153AC_SUBST(PACKAGE)
154VERSION=[$2]
155AC_SUBST(VERSION)
156dnl test to see if srcdir already configured
157if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
158 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
159fi
160ifelse([$3],,
161AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
162AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
163AC_REQUIRE([AM_SANITY_CHECK])
164AC_REQUIRE([AC_ARG_PROGRAM])
165dnl FIXME This is truly gross.
166missing_dir=`cd $ac_aux_dir && pwd`
167AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
168AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
169AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
170AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
171AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
63e5e3e0
AG
172AC_REQUIRE([AC_PROG_MAKE_SET])])
173
174#
175# Check to make sure that the build environment is sane.
176#
177
178AC_DEFUN(AM_SANITY_CHECK,
179[AC_MSG_CHECKING([whether build environment is sane])
180# Just in case
181sleep 1
182echo timestamp > conftestfile
183# Do `set' in a subshell so we don't clobber the current shell's
184# arguments. Must try -L first in case configure is actually a
185# symlink; some systems play weird games with the mod time of symlinks
186# (eg FreeBSD returns the mod time of the symlink's containing
187# directory).
188if (
189 set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
190 if test "[$]*" = "X"; then
191 # -L didn't work.
192 set X `ls -t $srcdir/configure conftestfile`
193 fi
194 if test "[$]*" != "X $srcdir/configure conftestfile" \
195 && test "[$]*" != "X conftestfile $srcdir/configure"; then
196
197 # If neither matched, then we have a broken ls. This can happen
198 # if, for instance, CONFIG_SHELL is bash and it inherits a
199 # broken ls alias from the environment. This has actually
200 # happened. Such a system could not be considered "sane".
201 AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
202alias in your environment])
203 fi
204
205 test "[$]2" = conftestfile
206 )
207then
208 # Ok.
209 :
210else
211 AC_MSG_ERROR([newly created file is older than distributed files!
212Check your system clock])
213fi
214rm -f conftest*
215AC_MSG_RESULT(yes)])
216
217dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
218dnl The program must properly implement --version.
219AC_DEFUN(AM_MISSING_PROG,
220[AC_MSG_CHECKING(for working $2)
221# Run test in a subshell; some versions of sh will print an error if
222# an executable is not found, even if stderr is redirected.
223# Redirect stdin to placate older versions of autoconf. Sigh.
224if ($2 --version) < /dev/null > /dev/null 2>&1; then
225 $1=$2
226 AC_MSG_RESULT(found)
227else
228 $1="$3/missing $2"
229 AC_MSG_RESULT(missing)
230fi
231AC_SUBST($1)])
232
233# Add --enable-maintainer-mode option to configure.
234# From Jim Meyering
235
236# serial 1
237
238AC_DEFUN(AM_MAINTAINER_MODE,
239[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
240 dnl maintainer-mode is disabled by default
241 AC_ARG_ENABLE(maintainer-mode,
242[ --enable-maintainer-mode enable make rules and dependencies not useful
243 (and sometimes confusing) to the casual installer],
244 USE_MAINTAINER_MODE=$enableval,
245 USE_MAINTAINER_MODE=no)
246 AC_MSG_RESULT($USE_MAINTAINER_MODE)
247 AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes)
248 MAINT=$MAINTAINER_MODE_TRUE
249 AC_SUBST(MAINT)dnl
250]
251)
252
253# Define a conditional.
254
255AC_DEFUN(AM_CONDITIONAL,
256[AC_SUBST($1_TRUE)
257AC_SUBST($1_FALSE)
258if $2; then
259 $1_TRUE=
260 $1_FALSE='#'
261else
262 $1_TRUE='#'
263 $1_FALSE=
264fi])
265
This page took 0.267007 seconds and 5 git commands to generate.