]> git.ipfire.org Git - thirdparty/gcc.git/blame - libffi/aclocal.m4
hpux.h (TARGET_INIT_LIBFUNCS): Add undef.
[thirdparty/gcc.git] / libffi / aclocal.m4
CommitLineData
5196736e 1dnl aclocal.m4 generated automatically by aclocal 1.4
63e5e3e0 2
5196736e 3dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
63e5e3e0
AG
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],)
4977bab6 19AC_DEFUN([AM_PROG_LIBTOOL],)
2f7bf5b7
AO
20AC_SUBST(LIBTOOL)
21])
22
5196736e
AJ
23# mmap(2) blacklisting. Some platforms provide the mmap library routine
24# but don't support all of the features we need from it.
25AC_DEFUN([AC_FUNC_MMAP_BLACKLIST],
26[if test $ac_cv_header_sys_mman_h != yes \
27 || test $ac_cv_func_mmap != yes; then
28 ac_cv_func_mmap_file=no
29 ac_cv_func_mmap_dev_zero=no
30 ac_cv_func_mmap_anon=no
31else
32 AC_CACHE_CHECK([whether read-only mmap of a plain file works],
33 ac_cv_func_mmap_file,
34 [# Add a system to this blacklist if
35 # mmap(0, stat_size, PROT_READ, MAP_PRIVATE, fd, 0) doesn't return a
36 # memory area containing the same data that you'd get if you applied
37 # read() to the same fd. The only system known to have a problem here
38 # is VMS, where text files have record structure.
39 case "$host_os" in
40 vms* | ultrix*)
41 ac_cv_func_mmap_file=no ;;
42 *)
43 ac_cv_func_mmap_file=yes;;
44 esac])
45 AC_CACHE_CHECK([whether mmap from /dev/zero works],
46 ac_cv_func_mmap_dev_zero,
47 [# Add a system to this blacklist if it has mmap() but /dev/zero
48 # does not exist, or if mmapping /dev/zero does not give anonymous
49 # zeroed pages with both the following properties:
50 # 1. If you map N consecutive pages in with one call, and then
51 # unmap any subset of those pages, the pages that were not
52 # explicitly unmapped remain accessible.
53 # 2. If you map two adjacent blocks of memory and then unmap them
54 # both at once, they must both go away.
55 # Systems known to be in this category are Windows (all variants),
56 # VMS, and Darwin.
57 case "$host_os" in
58 vms* | cygwin* | pe | mingw* | darwin* | ultrix* | hpux10* | hpux11.00)
59 ac_cv_func_mmap_dev_zero=no ;;
60 *)
61 ac_cv_func_mmap_dev_zero=yes;;
62 esac])
63
64 # Unlike /dev/zero, the MAP_ANON(YMOUS) defines can be probed for.
65 AC_CACHE_CHECK([for MAP_ANON(YMOUS)], ac_cv_decl_map_anon,
66 [AC_TRY_COMPILE(
67[#include <sys/types.h>
68#include <sys/mman.h>
69#include <unistd.h>
70
71#ifndef MAP_ANONYMOUS
72#define MAP_ANONYMOUS MAP_ANON
73#endif
74],
75[int n = MAP_ANONYMOUS;],
76 ac_cv_decl_map_anon=yes,
77 ac_cv_decl_map_anon=no)])
78
79 if test $ac_cv_decl_map_anon = no; then
80 ac_cv_func_mmap_anon=no
81 else
82 AC_CACHE_CHECK([whether mmap with MAP_ANON(YMOUS) works],
83 ac_cv_func_mmap_anon,
84 [# Add a system to this blacklist if it has mmap() and MAP_ANON or
85 # MAP_ANONYMOUS, but using mmap(..., MAP_PRIVATE|MAP_ANONYMOUS, -1, 0)
86 # doesn't give anonymous zeroed pages with the same properties listed
87 # above for use of /dev/zero.
88 # Systems known to be in this category are Windows, VMS, and SCO Unix.
89 case "$host_os" in
90 vms* | cygwin* | pe | mingw* | sco* | udk* )
91 ac_cv_func_mmap_anon=no ;;
92 *)
93 ac_cv_func_mmap_anon=yes;;
94 esac])
95 fi
96fi
97
98if test $ac_cv_func_mmap_file = yes; then
99 AC_DEFINE(HAVE_MMAP_FILE, 1,
100 [Define if read-only mmap of a plain file works.])
101fi
102if test $ac_cv_func_mmap_dev_zero = yes; then
103 AC_DEFINE(HAVE_MMAP_DEV_ZERO, 1,
104 [Define if mmap of /dev/zero works.])
105fi
106if test $ac_cv_func_mmap_anon = yes; then
107 AC_DEFINE(HAVE_MMAP_ANON, 1,
108 [Define if mmap with MAP_ANON(YMOUS) works.])
109fi
110])
111
4977bab6 112sinclude(../config/accross.m4)
e2f2e70a 113
63e5e3e0
AG
114# Like AC_CONFIG_HEADER, but automatically create stamp file.
115
5196736e 116AC_DEFUN(AM_CONFIG_HEADER,
63e5e3e0
AG
117[AC_PREREQ([2.12])
118AC_CONFIG_HEADER([$1])
119dnl When config.status generates a header, we must update the stamp-h file.
120dnl This file resides in the same directory as the config header
121dnl that is generated. We must strip everything past the first ":",
122dnl and everything past the last "/".
123AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
124ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
125<<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
126<<am_indx=1
127for am_file in <<$1>>; do
128 case " <<$>>CONFIG_HEADERS " in
129 *" <<$>>am_file "*<<)>>
130 echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
131 ;;
132 esac
133 am_indx=`expr "<<$>>am_indx" + 1`
134done<<>>dnl>>)
135changequote([,]))])
136
137# Do all the work for Automake. This macro actually does too much --
138# some checks are only needed if your package does certain things.
139# But this isn't really a big deal.
140
141# serial 1
142
143dnl Usage:
144dnl AM_INIT_AUTOMAKE(package,version, [no-define])
145
5196736e 146AC_DEFUN(AM_INIT_AUTOMAKE,
63e5e3e0 147[AC_REQUIRE([AC_PROG_INSTALL])
63e5e3e0
AG
148PACKAGE=[$1]
149AC_SUBST(PACKAGE)
150VERSION=[$2]
151AC_SUBST(VERSION)
152dnl test to see if srcdir already configured
153if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
154 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
155fi
156ifelse([$3],,
157AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
158AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
159AC_REQUIRE([AM_SANITY_CHECK])
160AC_REQUIRE([AC_ARG_PROGRAM])
161dnl FIXME This is truly gross.
162missing_dir=`cd $ac_aux_dir && pwd`
163AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
164AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
165AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
166AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
167AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
63e5e3e0
AG
168AC_REQUIRE([AC_PROG_MAKE_SET])])
169
170#
171# Check to make sure that the build environment is sane.
172#
173
5196736e 174AC_DEFUN(AM_SANITY_CHECK,
63e5e3e0
AG
175[AC_MSG_CHECKING([whether build environment is sane])
176# Just in case
177sleep 1
178echo timestamp > conftestfile
179# Do `set' in a subshell so we don't clobber the current shell's
180# arguments. Must try -L first in case configure is actually a
181# symlink; some systems play weird games with the mod time of symlinks
182# (eg FreeBSD returns the mod time of the symlink's containing
183# directory).
184if (
185 set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
186 if test "[$]*" = "X"; then
187 # -L didn't work.
188 set X `ls -t $srcdir/configure conftestfile`
189 fi
190 if test "[$]*" != "X $srcdir/configure conftestfile" \
191 && test "[$]*" != "X conftestfile $srcdir/configure"; then
192
193 # If neither matched, then we have a broken ls. This can happen
194 # if, for instance, CONFIG_SHELL is bash and it inherits a
195 # broken ls alias from the environment. This has actually
196 # happened. Such a system could not be considered "sane".
197 AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
198alias in your environment])
199 fi
200
201 test "[$]2" = conftestfile
202 )
203then
204 # Ok.
205 :
206else
207 AC_MSG_ERROR([newly created file is older than distributed files!
208Check your system clock])
209fi
210rm -f conftest*
211AC_MSG_RESULT(yes)])
212
213dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
214dnl The program must properly implement --version.
5196736e 215AC_DEFUN(AM_MISSING_PROG,
63e5e3e0
AG
216[AC_MSG_CHECKING(for working $2)
217# Run test in a subshell; some versions of sh will print an error if
218# an executable is not found, even if stderr is redirected.
219# Redirect stdin to placate older versions of autoconf. Sigh.
220if ($2 --version) < /dev/null > /dev/null 2>&1; then
221 $1=$2
222 AC_MSG_RESULT(found)
223else
224 $1="$3/missing $2"
225 AC_MSG_RESULT(missing)
226fi
227AC_SUBST($1)])
228
229# Add --enable-maintainer-mode option to configure.
230# From Jim Meyering
231
232# serial 1
233
5196736e 234AC_DEFUN(AM_MAINTAINER_MODE,
63e5e3e0
AG
235[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
236 dnl maintainer-mode is disabled by default
237 AC_ARG_ENABLE(maintainer-mode,
238[ --enable-maintainer-mode enable make rules and dependencies not useful
239 (and sometimes confusing) to the casual installer],
240 USE_MAINTAINER_MODE=$enableval,
241 USE_MAINTAINER_MODE=no)
242 AC_MSG_RESULT($USE_MAINTAINER_MODE)
243 AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes)
244 MAINT=$MAINTAINER_MODE_TRUE
245 AC_SUBST(MAINT)dnl
246]
247)
248
249# Define a conditional.
250
5196736e 251AC_DEFUN(AM_CONDITIONAL,
63e5e3e0
AG
252[AC_SUBST($1_TRUE)
253AC_SUBST($1_FALSE)
254if $2; then
255 $1_TRUE=
256 $1_FALSE='#'
257else
258 $1_TRUE='#'
259 $1_FALSE=
260fi])
261