1 dnl See whether we need a declaration for a function.
2 AC_DEFUN(GCC_NEED_DECLARATION,
3 [AC_MSG_CHECKING([whether $1 must be declared])
4 AC_CACHE_VAL(gcc_cv_decl_needed_$1,
21 #define rindex strrchr
26 [char *(*pfn) = (char *(*)) $1],
27 eval "gcc_cv_decl_needed_$1=no", eval "gcc_cv_decl_needed_$1=yes")])
28 if eval "test \"`echo '$gcc_cv_decl_needed_'$1`\" = yes"; then
30 gcc_tr_decl=NEED_DECLARATION_`echo $1 | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
31 AC_DEFINE_UNQUOTED($gcc_tr_decl)
37 dnl Check multiple functions to see whether each needs a declaration.
38 AC_DEFUN(GCC_NEED_DECLARATIONS,
41 GCC_NEED_DECLARATION($ac_func)
45 dnl See if the printf functions in libc support %p in format strings.
46 AC_DEFUN(GCC_FUNC_PRINTF_PTR,
47 [AC_CACHE_CHECK(whether the printf functions support %p,
48 gcc_cv_func_printf_ptr,
49 [AC_TRY_RUN([#include <stdio.h>
54 char *p = buf, *q = NULL;
55 sprintf(buf, "%p", p);
56 sscanf(buf, "%p", &q);
58 }], gcc_cv_func_printf_ptr=yes, gcc_cv_func_printf_ptr=no,
59 gcc_cv_func_printf_ptr=no)
60 rm -f core core.* *.core])
61 if test $gcc_cv_func_printf_ptr = yes ; then
62 AC_DEFINE(HOST_PTR_PRINTF, "%p")
66 dnl See if symbolic links work and if not, try to substitute either hard links or simple copy.
67 AC_DEFUN(GCC_PROG_LN_S,
68 [AC_MSG_CHECKING(whether ln -s works)
69 AC_CACHE_VAL(gcc_cv_prog_LN_S,
72 if ln -s conftestdata_f conftestdata_t 2>/dev/null
74 gcc_cv_prog_LN_S="ln -s"
76 if ln conftestdata_f conftestdata_t 2>/dev/null
83 rm -f conftestdata_f conftestdata_t
85 LN_S="$gcc_cv_prog_LN_S"
86 if test "$gcc_cv_prog_LN_S" = "ln -s"; then
89 if test "$gcc_cv_prog_LN_S" = "ln"; then
90 AC_MSG_RESULT([no, using ln])
92 AC_MSG_RESULT([no, and neither does ln, so using cp])
98 dnl See if hard links work and if not, try to substitute either symbolic links or simple copy.
100 [AC_MSG_CHECKING(whether ln works)
101 AC_CACHE_VAL(gcc_cv_prog_LN,
102 [rm -f conftestdata_t
104 if ln conftestdata_f conftestdata_t 2>/dev/null
108 if ln -s conftestdata_f conftestdata_t 2>/dev/null
110 gcc_cv_prog_LN="ln -s"
115 rm -f conftestdata_f conftestdata_t
118 if test "$gcc_cv_prog_LN" = "ln"; then
121 if test "$gcc_cv_prog_LN" = "ln -s"; then
122 AC_MSG_RESULT([no, using ln -s])
124 AC_MSG_RESULT([no, and neither does ln -s, so using cp])
130 AC_DEFUN(EGCS_PROG_INSTALL,
131 [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
132 # Find a good install program. We prefer a C program (faster),
133 # so one script is as good as another. But avoid the broken or
134 # incompatible versions:
135 # SysV /etc/install, /usr/sbin/install
136 # SunOS /usr/etc/install
139 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
140 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
141 # ./install, which can be erroneously created by make from ./install.sh.
142 AC_MSG_CHECKING(for a BSD compatible install)
143 if test -z "$INSTALL"; then
144 AC_CACHE_VAL(ac_cv_path_install,
145 [ IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS="${IFS}:"
146 for ac_dir in $PATH; do
147 # Account for people who put trailing slashes in PATH elements.
149 /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
151 # OSF1 and SCO ODT 3.0 have their own names for install.
152 for ac_prog in ginstall scoinst install; do
153 if test -f $ac_dir/$ac_prog; then
154 if test $ac_prog = install &&
155 grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
156 # AIX install. It has an incompatible calling convention.
157 # OSF/1 installbsd also uses dspmsg, but is usable.
160 ac_cv_path_install="$ac_dir/$ac_prog -c"
170 if test "${ac_cv_path_install+set}" = set; then
171 INSTALL="$ac_cv_path_install"
173 # As a last resort, use the slow shell script. We don't cache a
174 # path for INSTALL within a source directory, because that will
175 # break other packages using the cache if that directory is
176 # removed, or if the path is relative.
177 INSTALL="$ac_install_sh"
180 dnl We do special magic for INSTALL instead of AC_SUBST, to get
181 dnl relative paths right.
182 AC_MSG_RESULT($INSTALL)
185 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
186 # It thinks the first close brace ends the variable substitution.
187 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
188 AC_SUBST(INSTALL_PROGRAM)dnl
190 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
191 AC_SUBST(INSTALL_DATA)dnl