]> gcc.gnu.org Git - gcc.git/blame - gcc/aclocal.m4
reload1.c (struct elim_table): Delete MAX_OFFSET member.
[gcc.git] / gcc / aclocal.m4
CommitLineData
ccc7d11a
KG
1dnl See whether we can include both string.h and strings.h.
2AC_DEFUN(GCC_HEADER_STRING,
3[AC_CACHE_CHECK([whether string.h and strings.h may both be included],
4 gcc_cv_header_string,
5[AC_TRY_COMPILE([#include <string.h>
6#include <strings.h>], , gcc_cv_header_string=yes, gcc_cv_header_string=no)])
7if test $gcc_cv_header_string = yes; then
8 AC_DEFINE(STRING_WITH_STRINGS)
9fi
10])
11
2f51182a 12dnl See whether we need a declaration for a function.
d2cabf16 13dnl GCC_NEED_DECLARATION(FUNCTION [, EXTRA-HEADER-FILES])
2f51182a
DE
14AC_DEFUN(GCC_NEED_DECLARATION,
15[AC_MSG_CHECKING([whether $1 must be declared])
16AC_CACHE_VAL(gcc_cv_decl_needed_$1,
17[AC_TRY_COMPILE([
18#include <stdio.h>
ccc7d11a
KG
19#ifdef STRING_WITH_STRINGS
20# include <string.h>
21# include <strings.h>
2f51182a 22#else
ccc7d11a
KG
23# ifdef HAVE_STRING_H
24# include <string.h>
25# else
26# ifdef HAVE_STRINGS_H
27# include <strings.h>
28# endif
29# endif
2f51182a
DE
30#endif
31#ifdef HAVE_STDLIB_H
32#include <stdlib.h>
33#endif
34#ifdef HAVE_UNISTD_H
35#include <unistd.h>
956d6950
JL
36#endif
37#ifndef HAVE_RINDEX
38#define rindex strrchr
39#endif
40#ifndef HAVE_INDEX
41#define index strchr
d2cabf16
KG
42#endif
43$2],
2f51182a 44[char *(*pfn) = (char *(*)) $1],
a81fb89e
KG
45eval "gcc_cv_decl_needed_$1=no", eval "gcc_cv_decl_needed_$1=yes")])
46if eval "test \"`echo '$gcc_cv_decl_needed_'$1`\" = yes"; then
47 AC_MSG_RESULT(yes)
2f51182a
DE
48 gcc_tr_decl=NEED_DECLARATION_`echo $1 | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
49 AC_DEFINE_UNQUOTED($gcc_tr_decl)
a81fb89e
KG
50else
51 AC_MSG_RESULT(no)
2f51182a
DE
52fi
53])dnl
ac64120e 54
a81fb89e 55dnl Check multiple functions to see whether each needs a declaration.
d2cabf16 56dnl GCC_NEED_DECLARATIONS(FUNCTION... [, EXTRA-HEADER-FILES])
a81fb89e
KG
57AC_DEFUN(GCC_NEED_DECLARATIONS,
58[for ac_func in $1
59do
d2cabf16 60GCC_NEED_DECLARATION($ac_func, $2)
a81fb89e
KG
61done
62])
63
76b4b31e
KG
64dnl Check if we have vprintf and possibly _doprnt.
65dnl Note autoconf checks for vprintf even though we care about vfprintf.
66AC_DEFUN(GCC_FUNC_VFPRINTF_DOPRNT,
67[AC_FUNC_VPRINTF
68vfprintf=
69doprint=
70if test $ac_cv_func_vprintf != yes ; then
71 vfprintf=vfprintf.o
72 if test $ac_cv_func__doprnt != yes ; then
73 doprint=doprint.o
74 fi
75fi
76AC_SUBST(vfprintf)
77AC_SUBST(doprint)
78])
79
f1b54f9b
KG
80dnl See if the printf functions in libc support %p in format strings.
81AC_DEFUN(GCC_FUNC_PRINTF_PTR,
82[AC_CACHE_CHECK(whether the printf functions support %p,
83 gcc_cv_func_printf_ptr,
84[AC_TRY_RUN([#include <stdio.h>
85
86main()
87{
88 char buf[64];
89 char *p = buf, *q = NULL;
90 sprintf(buf, "%p", p);
91 sscanf(buf, "%p", &q);
92 exit (p != q);
93}], gcc_cv_func_printf_ptr=yes, gcc_cv_func_printf_ptr=no,
94 gcc_cv_func_printf_ptr=no)
95rm -f core core.* *.core])
96if test $gcc_cv_func_printf_ptr = yes ; then
092f7be3 97 AC_DEFINE(HAVE_PRINTF_PTR)
f1b54f9b
KG
98fi
99])
100
ac64120e
JW
101dnl See if symbolic links work and if not, try to substitute either hard links or simple copy.
102AC_DEFUN(GCC_PROG_LN_S,
103[AC_MSG_CHECKING(whether ln -s works)
104AC_CACHE_VAL(gcc_cv_prog_LN_S,
e566af04
MH
105[rm -f conftestdata_t
106echo >conftestdata_f
107if ln -s conftestdata_f conftestdata_t 2>/dev/null
ac64120e
JW
108then
109 gcc_cv_prog_LN_S="ln -s"
110else
e566af04 111 if ln conftestdata_f conftestdata_t 2>/dev/null
ac64120e
JW
112 then
113 gcc_cv_prog_LN_S=ln
114 else
115 gcc_cv_prog_LN_S=cp
116 fi
117fi
e566af04 118rm -f conftestdata_f conftestdata_t
ac64120e
JW
119])dnl
120LN_S="$gcc_cv_prog_LN_S"
121if test "$gcc_cv_prog_LN_S" = "ln -s"; then
122 AC_MSG_RESULT(yes)
123else
124 if test "$gcc_cv_prog_LN_S" = "ln"; then
125 AC_MSG_RESULT([no, using ln])
126 else
127 AC_MSG_RESULT([no, and neither does ln, so using cp])
128 fi
129fi
130AC_SUBST(LN_S)dnl
131])
132
133dnl See if hard links work and if not, try to substitute either symbolic links or simple copy.
134AC_DEFUN(GCC_PROG_LN,
135[AC_MSG_CHECKING(whether ln works)
136AC_CACHE_VAL(gcc_cv_prog_LN,
e566af04
MH
137[rm -f conftestdata_t
138echo >conftestdata_f
139if ln conftestdata_f conftestdata_t 2>/dev/null
ac64120e
JW
140then
141 gcc_cv_prog_LN="ln"
142else
e566af04 143 if ln -s conftestdata_f conftestdata_t 2>/dev/null
ac64120e
JW
144 then
145 gcc_cv_prog_LN="ln -s"
146 else
147 gcc_cv_prog_LN=cp
148 fi
149fi
e566af04 150rm -f conftestdata_f conftestdata_t
ac64120e
JW
151])dnl
152LN="$gcc_cv_prog_LN"
153if test "$gcc_cv_prog_LN" = "ln"; then
154 AC_MSG_RESULT(yes)
155else
156 if test "$gcc_cv_prog_LN" = "ln -s"; then
157 AC_MSG_RESULT([no, using ln -s])
158 else
159 AC_MSG_RESULT([no, and neither does ln -s, so using cp])
160 fi
161fi
162AC_SUBST(LN)dnl
163])
76143254 164
e9b4fabf
JL
165dnl See whether the stage1 host compiler accepts the volatile keyword.
166AC_DEFUN(GCC_C_VOLATILE,
167[AC_CACHE_CHECK([for volatile], gcc_cv_c_volatile,
168[AC_TRY_COMPILE(, [volatile int foo;],
169 gcc_cv_c_volatile=yes, gcc_cv_c_volatile=no)])
170if test $gcc_cv_c_volatile = yes ; then
171 AC_DEFINE(HAVE_VOLATILE)
172fi
173])
174
76143254
JL
175AC_DEFUN(EGCS_PROG_INSTALL,
176[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
177# Find a good install program. We prefer a C program (faster),
178# so one script is as good as another. But avoid the broken or
179# incompatible versions:
180# SysV /etc/install, /usr/sbin/install
181# SunOS /usr/etc/install
182# IRIX /sbin/install
183# AIX /bin/install
184# AFS /usr/afsws/bin/install, which mishandles nonexistent args
185# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
186# ./install, which can be erroneously created by make from ./install.sh.
187AC_MSG_CHECKING(for a BSD compatible install)
188if test -z "$INSTALL"; then
189AC_CACHE_VAL(ac_cv_path_install,
190[ IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS="${IFS}:"
191 for ac_dir in $PATH; do
192 # Account for people who put trailing slashes in PATH elements.
193 case "$ac_dir/" in
194 /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
195 *)
196 # OSF1 and SCO ODT 3.0 have their own names for install.
197 for ac_prog in ginstall scoinst install; do
198 if test -f $ac_dir/$ac_prog; then
199 if test $ac_prog = install &&
200 grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
201 # AIX install. It has an incompatible calling convention.
202 # OSF/1 installbsd also uses dspmsg, but is usable.
203 :
204 else
205 ac_cv_path_install="$ac_dir/$ac_prog -c"
206 break 2
207 fi
208 fi
209 done
210 ;;
211 esac
212 done
213 IFS="$ac_save_IFS"
214])dnl
215 if test "${ac_cv_path_install+set}" = set; then
216 INSTALL="$ac_cv_path_install"
217 else
218 # As a last resort, use the slow shell script. We don't cache a
219 # path for INSTALL within a source directory, because that will
220 # break other packages using the cache if that directory is
221 # removed, or if the path is relative.
222 INSTALL="$ac_install_sh"
223 fi
224fi
225dnl We do special magic for INSTALL instead of AC_SUBST, to get
226dnl relative paths right.
227AC_MSG_RESULT($INSTALL)
5643c767 228AC_SUBST(INSTALL)dnl
76143254
JL
229
230# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
231# It thinks the first close brace ends the variable substitution.
232test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
233AC_SUBST(INSTALL_PROGRAM)dnl
234
235test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
236AC_SUBST(INSTALL_DATA)dnl
237])
This page took 0.344026 seconds and 5 git commands to generate.