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 symbolic links work and if not, try to substitute either hard links or simple copy.
46 AC_DEFUN(GCC_PROG_LN_S,
47 [AC_MSG_CHECKING(whether ln -s works)
48 AC_CACHE_VAL(gcc_cv_prog_LN_S,
51 if ln -s conftestdata_f conftestdata_t 2>/dev/null
53 gcc_cv_prog_LN_S="ln -s"
55 if ln conftestdata_f conftestdata_t 2>/dev/null
62 rm -f conftestdata_f conftestdata_t
64 LN_S="$gcc_cv_prog_LN_S"
65 if test "$gcc_cv_prog_LN_S" = "ln -s"; then
68 if test "$gcc_cv_prog_LN_S" = "ln"; then
69 AC_MSG_RESULT([no, using ln])
71 AC_MSG_RESULT([no, and neither does ln, so using cp])
77 dnl See if hard links work and if not, try to substitute either symbolic links or simple copy.
79 [AC_MSG_CHECKING(whether ln works)
80 AC_CACHE_VAL(gcc_cv_prog_LN,
83 if ln conftestdata_f conftestdata_t 2>/dev/null
87 if ln -s conftestdata_f conftestdata_t 2>/dev/null
89 gcc_cv_prog_LN="ln -s"
94 rm -f conftestdata_f conftestdata_t
97 if test "$gcc_cv_prog_LN" = "ln"; then
100 if test "$gcc_cv_prog_LN" = "ln -s"; then
101 AC_MSG_RESULT([no, using ln -s])
103 AC_MSG_RESULT([no, and neither does ln -s, so using cp])
109 AC_DEFUN(EGCS_PROG_INSTALL,
110 [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
111 # Find a good install program. We prefer a C program (faster),
112 # so one script is as good as another. But avoid the broken or
113 # incompatible versions:
114 # SysV /etc/install, /usr/sbin/install
115 # SunOS /usr/etc/install
118 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
119 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
120 # ./install, which can be erroneously created by make from ./install.sh.
121 AC_MSG_CHECKING(for a BSD compatible install)
122 if test -z "$INSTALL"; then
123 AC_CACHE_VAL(ac_cv_path_install,
124 [ IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS="${IFS}:"
125 for ac_dir in $PATH; do
126 # Account for people who put trailing slashes in PATH elements.
128 /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
130 # OSF1 and SCO ODT 3.0 have their own names for install.
131 for ac_prog in ginstall scoinst install; do
132 if test -f $ac_dir/$ac_prog; then
133 if test $ac_prog = install &&
134 grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
135 # AIX install. It has an incompatible calling convention.
136 # OSF/1 installbsd also uses dspmsg, but is usable.
139 ac_cv_path_install="$ac_dir/$ac_prog -c"
149 if test "${ac_cv_path_install+set}" = set; then
150 INSTALL="$ac_cv_path_install"
152 # As a last resort, use the slow shell script. We don't cache a
153 # path for INSTALL within a source directory, because that will
154 # break other packages using the cache if that directory is
155 # removed, or if the path is relative.
156 INSTALL="$ac_install_sh"
159 dnl We do special magic for INSTALL instead of AC_SUBST, to get
160 dnl relative paths right.
161 AC_MSG_RESULT($INSTALL)
164 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
165 # It thinks the first close brace ends the variable substitution.
166 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
167 AC_SUBST(INSTALL_PROGRAM)dnl
169 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
170 AC_SUBST(INSTALL_DATA)dnl