OSDN Git Service

* aclocal.m4 (conftestdata_from, conftestdata_to): Names shortened to
[pf3gnuchains/gcc-fork.git] / gcc / aclocal.m4
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,
5 [AC_TRY_COMPILE([
6 #include <stdio.h>
7 #ifdef HAVE_STRING_H
8 #include <string.h>
9 #else
10 #ifdef HAVE_STRINGS_H
11 #include <strings.h>
12 #endif
13 #endif
14 #ifdef HAVE_STDLIB_H
15 #include <stdlib.h>
16 #endif
17 #ifdef HAVE_UNISTD_H
18 #include <unistd.h>
19 #endif],
20 [char *(*pfn) = (char *(*)) $1],
21 gcc_cv_decl_needed_$1=no, gcc_cv_decl_needed_$1=yes)])
22 AC_MSG_RESULT($gcc_cv_decl_needed_$1)
23 if test $gcc_cv_decl_needed_$1 = yes; then
24   gcc_tr_decl=NEED_DECLARATION_`echo $1 | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
25   AC_DEFINE_UNQUOTED($gcc_tr_decl)
26 fi
27 ])dnl
28
29 dnl See if symbolic links work and if not, try to substitute either hard links or simple copy.
30 AC_DEFUN(GCC_PROG_LN_S,
31 [AC_MSG_CHECKING(whether ln -s works)
32 AC_CACHE_VAL(gcc_cv_prog_LN_S,
33 [rm -f conftestdata_t
34 echo >conftestdata_f
35 if ln -s conftestdata_f conftestdata_t 2>/dev/null
36 then
37   gcc_cv_prog_LN_S="ln -s"
38 else
39   if ln conftestdata_f conftestdata_t 2>/dev/null
40   then
41     gcc_cv_prog_LN_S=ln
42   else
43     gcc_cv_prog_LN_S=cp
44   fi
45 fi
46 rm -f conftestdata_f conftestdata_t
47 ])dnl
48 LN_S="$gcc_cv_prog_LN_S"
49 if test "$gcc_cv_prog_LN_S" = "ln -s"; then
50   AC_MSG_RESULT(yes)
51 else
52   if test "$gcc_cv_prog_LN_S" = "ln"; then
53     AC_MSG_RESULT([no, using ln])
54   else
55     AC_MSG_RESULT([no, and neither does ln, so using cp])
56   fi
57 fi
58 AC_SUBST(LN_S)dnl
59 ])
60
61 dnl See if hard links work and if not, try to substitute either symbolic links or simple copy.
62 AC_DEFUN(GCC_PROG_LN,
63 [AC_MSG_CHECKING(whether ln works)
64 AC_CACHE_VAL(gcc_cv_prog_LN,
65 [rm -f conftestdata_t
66 echo >conftestdata_f
67 if ln conftestdata_f conftestdata_t 2>/dev/null
68 then
69   gcc_cv_prog_LN="ln"
70 else
71   if ln -s conftestdata_f conftestdata_t 2>/dev/null
72   then
73     gcc_cv_prog_LN="ln -s"
74   else
75     gcc_cv_prog_LN=cp
76   fi
77 fi
78 rm -f conftestdata_f conftestdata_t
79 ])dnl
80 LN="$gcc_cv_prog_LN"
81 if test "$gcc_cv_prog_LN" = "ln"; then
82   AC_MSG_RESULT(yes)
83 else
84   if test "$gcc_cv_prog_LN" = "ln -s"; then
85     AC_MSG_RESULT([no, using ln -s])
86   else
87     AC_MSG_RESULT([no, and neither does ln -s, so using cp])
88   fi
89 fi
90 AC_SUBST(LN)dnl
91 ])
92
93 AC_DEFUN(EGCS_PROG_INSTALL,
94 [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
95 # Find a good install program.  We prefer a C program (faster),
96 # so one script is as good as another.  But avoid the broken or
97 # incompatible versions:
98 # SysV /etc/install, /usr/sbin/install
99 # SunOS /usr/etc/install
100 # IRIX /sbin/install
101 # AIX /bin/install
102 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
103 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
104 # ./install, which can be erroneously created by make from ./install.sh.
105 AC_MSG_CHECKING(for a BSD compatible install)
106 if test -z "$INSTALL"; then
107 AC_CACHE_VAL(ac_cv_path_install,
108 [  IFS="${IFS=  }"; ac_save_IFS="$IFS"; IFS="${IFS}:"
109   for ac_dir in $PATH; do
110     # Account for people who put trailing slashes in PATH elements.
111     case "$ac_dir/" in
112     /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
113     *)
114       # OSF1 and SCO ODT 3.0 have their own names for install.
115       for ac_prog in ginstall scoinst install; do
116         if test -f $ac_dir/$ac_prog; then
117           if test $ac_prog = install &&
118             grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
119             # AIX install.  It has an incompatible calling convention.
120             # OSF/1 installbsd also uses dspmsg, but is usable.
121             :
122           else
123             ac_cv_path_install="$ac_dir/$ac_prog -c"
124             break 2
125           fi
126         fi
127       done
128       ;;
129     esac
130   done
131   IFS="$ac_save_IFS"
132 ])dnl
133   if test "${ac_cv_path_install+set}" = set; then
134     INSTALL="$ac_cv_path_install"
135   else
136     # As a last resort, use the slow shell script.  We don't cache a
137     # path for INSTALL within a source directory, because that will
138     # break other packages using the cache if that directory is
139     # removed, or if the path is relative.
140     INSTALL="$ac_install_sh"
141   fi
142 fi
143 dnl We do special magic for INSTALL instead of AC_SUBST, to get
144 dnl relative paths right.
145 AC_MSG_RESULT($INSTALL)
146 AC_SUBST(INSTALL)dnl
147
148 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
149 # It thinks the first close brace ends the variable substitution.
150 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
151 AC_SUBST(INSTALL_PROGRAM)dnl
152
153 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
154 AC_SUBST(INSTALL_DATA)dnl
155 ])