annotate gcc/acinclude.m4 @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents f6334be47118
children 84e7813d76e9
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents: 67
diff changeset
1 dnl Copyright (C) 2005-2017 Free Software Foundation, Inc.
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
2 dnl
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
3 dnl This file is part of GCC.
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
4 dnl
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
5 dnl GCC is free software; you can redistribute it and/or modify
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
6 dnl it under the terms of the GNU General Public License as published by
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
7 dnl the Free Software Foundation; either version 3, or (at your option)
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
8 dnl any later version.
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
9 dnl
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
10 dnl GCC is distributed in the hope that it will be useful,
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
11 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
12 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
13 dnl GNU General Public License for more details.
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
14 dnl
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
15 dnl You should have received a copy of the GNU General Public License
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
16 dnl along with GCC; see the file COPYING3. If not see
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
17 dnl <http://www.gnu.org/licenses/>.
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
18
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
19 dnl See whether we need a declaration for a function.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
20 dnl The result is highly dependent on the INCLUDES passed in, so make sure
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
21 dnl to use a different cache variable name in this macro if it is invoked
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
22 dnl in a different context somewhere else.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
23 dnl gcc_AC_CHECK_DECL(SYMBOL,
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
24 dnl [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, INCLUDES]]])
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
25 AC_DEFUN([gcc_AC_CHECK_DECL],
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
26 [AC_MSG_CHECKING([whether $1 is declared])
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
27 AC_CACHE_VAL(gcc_cv_have_decl_$1,
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
28 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([$4],
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
29 [#ifndef $1
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
30 char *(*pfn) = (char *(*)) $1 ;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
31 #endif])], eval "gcc_cv_have_decl_$1=yes", eval "gcc_cv_have_decl_$1=no")])
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
32 if eval "test \"`echo '$gcc_cv_have_decl_'$1`\" = yes"; then
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
33 AC_MSG_RESULT(yes) ; ifelse([$2], , :, [$2])
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
34 else
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
35 AC_MSG_RESULT(no) ; ifelse([$3], , :, [$3])
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
36 fi
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
37 ])dnl
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
38
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
39 dnl Check multiple functions to see whether each needs a declaration.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
40 dnl Arrange to define HAVE_DECL_<FUNCTION> to 0 or 1 as appropriate.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
41 dnl gcc_AC_CHECK_DECLS(SYMBOLS,
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
42 dnl [ACTION-IF-NEEDED [, ACTION-IF-NOT-NEEDED [, INCLUDES]]])
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
43 AC_DEFUN([gcc_AC_CHECK_DECLS],
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
44 [AC_FOREACH([gcc_AC_Func], [$1],
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
45 [AH_TEMPLATE(AS_TR_CPP(HAVE_DECL_[]gcc_AC_Func),
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
46 [Define to 1 if we found a declaration for ']gcc_AC_Func[', otherwise
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
47 define to 0.])])dnl
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
48 for ac_func in $1
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
49 do
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
50 ac_tr_decl=AS_TR_CPP([HAVE_DECL_$ac_func])
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
51 gcc_AC_CHECK_DECL($ac_func,
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
52 [AC_DEFINE_UNQUOTED($ac_tr_decl, 1) $2],
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
53 [AC_DEFINE_UNQUOTED($ac_tr_decl, 0) $3],
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
54 dnl It is possible that the include files passed in here are local headers
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
55 dnl which supply a backup declaration for the relevant prototype based on
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
56 dnl the definition of (or lack of) the HAVE_DECL_ macro. If so, this test
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
57 dnl will always return success. E.g. see libiberty.h's handling of
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
58 dnl `basename'. To avoid this, we define the relevant HAVE_DECL_ macro to
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
59 dnl 1 so that any local headers used do not provide their own prototype
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
60 dnl during this test.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
61 #undef $ac_tr_decl
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
62 #define $ac_tr_decl 1
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
63 $4
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
64 )
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
65 done
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
66 ])
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
67
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
68 dnl 'make compare' can be significantly faster, if cmp itself can
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
69 dnl skip bytes instead of using tail. The test being performed is
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
70 dnl "if cmp --ignore-initial=2 t1 t2 && ! cmp --ignore-initial=1 t1 t2"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
71 dnl but we need to sink errors and handle broken shells. We also test
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
72 dnl for the parameter format "cmp file1 file2 skip1 skip2" which is
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
73 dnl accepted by cmp on some systems.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
74 AC_DEFUN([gcc_AC_PROG_CMP_IGNORE_INITIAL],
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
75 [AC_CACHE_CHECK([for cmp's capabilities], gcc_cv_prog_cmp_skip,
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
76 [ echo abfoo >t1
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
77 echo cdfoo >t2
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
78 gcc_cv_prog_cmp_skip=slowcompare
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
79 if cmp --ignore-initial=2 t1 t2 > /dev/null 2>&1; then
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
80 if cmp --ignore-initial=1 t1 t2 > /dev/null 2>&1; then
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
81 :
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
82 else
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
83 gcc_cv_prog_cmp_skip=gnucompare
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
84 fi
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
85 fi
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
86 if test $gcc_cv_prog_cmp_skip = slowcompare ; then
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
87 if cmp t1 t2 2 2 > /dev/null 2>&1; then
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
88 if cmp t1 t2 1 1 > /dev/null 2>&1; then
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
89 :
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
90 else
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
91 gcc_cv_prog_cmp_skip=fastcompare
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
92 fi
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
93 fi
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
94 fi
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
95 rm t1 t2
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
96 ])
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
97 make_compare_target=$gcc_cv_prog_cmp_skip
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
98 AC_SUBST(make_compare_target)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
99 ])
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
100
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
101 dnl See if symbolic links work and if not, try to substitute either hard links or simple copy.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
102 AC_DEFUN([gcc_AC_PROG_LN_S],
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
103 [AC_MSG_CHECKING(whether ln -s works)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
104 AC_CACHE_VAL(gcc_cv_prog_LN_S,
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
105 [rm -f conftestdata_t
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
106 echo >conftestdata_f
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
107 if ln -s conftestdata_f conftestdata_t 2>/dev/null
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
108 then
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
109 gcc_cv_prog_LN_S="ln -s"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
110 else
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
111 if ln conftestdata_f conftestdata_t 2>/dev/null
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
112 then
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
113 gcc_cv_prog_LN_S=ln
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
114 else
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
115 if cp -p conftestdata_f conftestdata_t 2>/dev/null
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
116 then
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
117 gcc_cv_prog_LN_S="cp -p"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
118 else
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
119 gcc_cv_prog_LN_S=cp
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
120 fi
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
121 fi
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
122 fi
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
123 rm -f conftestdata_f conftestdata_t
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
124 ])dnl
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
125 LN_S="$gcc_cv_prog_LN_S"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
126 if test "$gcc_cv_prog_LN_S" = "ln -s"; then
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
127 AC_MSG_RESULT(yes)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
128 else
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
129 if test "$gcc_cv_prog_LN_S" = "ln"; then
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
130 AC_MSG_RESULT([no, using ln])
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
131 else
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
132 AC_MSG_RESULT([no, and neither does ln, so using $gcc_cv_prog_LN_S])
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
133 fi
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
134 fi
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
135 AC_SUBST(LN_S)dnl
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
136 ])
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
137
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
138 dnl Define MKDIR_TAKES_ONE_ARG if mkdir accepts only one argument instead
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
139 dnl of the usual 2.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
140 AC_DEFUN([gcc_AC_FUNC_MKDIR_TAKES_ONE_ARG],
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
141 [AC_CACHE_CHECK([if mkdir takes one argument], gcc_cv_mkdir_takes_one_arg,
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
142 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
143 #include <sys/types.h>
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
144 #ifdef HAVE_SYS_STAT_H
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
145 # include <sys/stat.h>
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
146 #endif
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
147 #ifdef HAVE_UNISTD_H
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
148 # include <unistd.h>
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
149 #endif
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
150 #ifdef HAVE_DIRECT_H
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
151 # include <direct.h>
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
152 #endif], [mkdir ("foo", 0);])],
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
153 gcc_cv_mkdir_takes_one_arg=no, gcc_cv_mkdir_takes_one_arg=yes)])
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
154 if test $gcc_cv_mkdir_takes_one_arg = yes ; then
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
155 AC_DEFINE(MKDIR_TAKES_ONE_ARG, 1, [Define if host mkdir takes a single argument.])
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
156 fi
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
157 ])
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
158
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
159 AC_DEFUN([gcc_AC_PROG_INSTALL],
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
160 [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
161 # Find a good install program. We prefer a C program (faster),
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
162 # so one script is as good as another. But avoid the broken or
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
163 # incompatible versions:
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
164 # SysV /etc/install, /usr/sbin/install
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
165 # SunOS /usr/etc/install
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
166 # IRIX /sbin/install
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
167 # AIX /bin/install
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
168 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
169 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
170 # ./install, which can be erroneously created by make from ./install.sh.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
171 AC_MSG_CHECKING(for a BSD compatible install)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
172 if test -z "$INSTALL"; then
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
173 AC_CACHE_VAL(ac_cv_path_install,
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
174 [ IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS="${IFS}:"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
175 for ac_dir in $PATH; do
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
176 # Account for people who put trailing slashes in PATH elements.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
177 case "$ac_dir/" in
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
178 /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
179 *)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
180 # OSF1 and SCO ODT 3.0 have their own names for install.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
181 for ac_prog in ginstall scoinst install; do
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
182 if test -f $ac_dir/$ac_prog; then
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
183 if test $ac_prog = install &&
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
184 grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
185 # AIX install. It has an incompatible calling convention.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
186 # OSF/1 installbsd also uses dspmsg, but is usable.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
187 :
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
188 else
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
189 ac_cv_path_install="$ac_dir/$ac_prog -c"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
190 break 2
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
191 fi
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
192 fi
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
193 done
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
194 ;;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
195 esac
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
196 done
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
197 IFS="$ac_save_IFS"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
198 ])dnl
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
199 if test "${ac_cv_path_install+set}" = set; then
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
200 INSTALL="$ac_cv_path_install"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
201 else
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
202 # As a last resort, use the slow shell script. We don't cache a
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
203 # path for INSTALL within a source directory, because that will
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
204 # break other packages using the cache if that directory is
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
205 # removed, or if the path is relative.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
206 INSTALL="$ac_install_sh"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
207 fi
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
208 fi
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
209 dnl We do special magic for INSTALL instead of AC_SUBST, to get
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
210 dnl relative paths right.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
211 AC_MSG_RESULT($INSTALL)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
212 AC_SUBST(INSTALL)dnl
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
213
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
214 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
215 # It thinks the first close brace ends the variable substitution.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
216 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
217 AC_SUBST(INSTALL_PROGRAM)dnl
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
218
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
219 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
220 AC_SUBST(INSTALL_DATA)dnl
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
221 ])
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
222
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
223 dnl Determine if enumerated bitfields are unsigned. ISO C says they can
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
224 dnl be either signed or unsigned.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
225 dnl
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
226 AC_DEFUN([gcc_AC_C_ENUM_BF_UNSIGNED],
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
227 [AC_CACHE_CHECK(for unsigned enumerated bitfields, gcc_cv_enum_bf_unsigned,
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
228 [AC_RUN_IFELSE([AC_LANG_SOURCE([#include <stdlib.h>
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
229 enum t { BLAH = 128 } ;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
230 struct s_t { enum t member : 8; } s ;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
231 int main(void)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
232 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
233 s.member = BLAH;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
234 if (s.member < 0) exit(1);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
235 exit(0);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
236
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
237 }])], gcc_cv_enum_bf_unsigned=yes, gcc_cv_enum_bf_unsigned=no, gcc_cv_enum_bf_unsigned=yes)])
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
238 if test $gcc_cv_enum_bf_unsigned = yes; then
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
239 AC_DEFINE(ENUM_BITFIELDS_ARE_UNSIGNED, 1,
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
240 [Define if enumerated bitfields are treated as unsigned values.])
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
241 fi])
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
242
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
243 dnl Probe number of bits in a byte.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
244 dnl Note C89 requires CHAR_BIT >= 8.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
245 dnl
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
246 AC_DEFUN([gcc_AC_C_CHAR_BIT],
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
247 [AC_CACHE_CHECK(for CHAR_BIT, gcc_cv_decl_char_bit,
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
248 [AC_EGREP_CPP(found,
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
249 [#ifdef HAVE_LIMITS_H
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
250 #include <limits.h>
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
251 #endif
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
252 #ifdef CHAR_BIT
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
253 found
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
254 #endif], gcc_cv_decl_char_bit=yes, gcc_cv_decl_char_bit=no)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
255 ])
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
256 if test $gcc_cv_decl_char_bit = no; then
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
257 AC_CACHE_CHECK(number of bits in a byte, gcc_cv_c_nbby,
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
258 [i=8
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
259 gcc_cv_c_nbby=
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
260 while test $i -lt 65; do
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
261 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
262 [switch(0) {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
263 case (unsigned char)((unsigned long)1 << $i) == ((unsigned long)1 << $i):
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
264 case (unsigned char)((unsigned long)1<<($i-1)) == ((unsigned long)1<<($i-1)):
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
265 ; }])],
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
266 [gcc_cv_c_nbby=$i; break])
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
267 i=`expr $i + 1`
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
268 done
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
269 test -z "$gcc_cv_c_nbby" && gcc_cv_c_nbby=failed
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
270 ])
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
271 if test $gcc_cv_c_nbby = failed; then
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
272 AC_MSG_ERROR(cannot determine number of bits in a byte)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
273 else
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
274 AC_DEFINE_UNQUOTED(CHAR_BIT, $gcc_cv_c_nbby,
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
275 [Define as the number of bits in a byte, if `limits.h' doesn't.])
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
276 fi
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
277 fi])
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
278
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
279 AC_DEFUN([gcc_AC_INITFINI_ARRAY],
111
kono
parents: 67
diff changeset
280 [AC_REQUIRE([gcc_SUN_LD_VERSION])dnl
kono
parents: 67
diff changeset
281 AC_ARG_ENABLE(initfini-array,
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
282 [ --enable-initfini-array use .init_array/.fini_array sections],
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
283 [], [
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
284 AC_CACHE_CHECK(for .preinit_array/.init_array/.fini_array support,
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
285 gcc_cv_initfini_array, [dnl
111
kono
parents: 67
diff changeset
286 if test "x${build}" = "x${target}" && test "x${build}" = "x${host}"; then
kono
parents: 67
diff changeset
287 case "${target}" in
kono
parents: 67
diff changeset
288 ia64-*)
kono
parents: 67
diff changeset
289 AC_RUN_IFELSE([AC_LANG_SOURCE([
kono
parents: 67
diff changeset
290 #ifndef __ELF__
kono
parents: 67
diff changeset
291 #error Not an ELF OS
kono
parents: 67
diff changeset
292 #endif
kono
parents: 67
diff changeset
293 /* We turn on .preinit_array/.init_array/.fini_array support for ia64
kono
parents: 67
diff changeset
294 if it can be used. */
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
295 static int x = -1;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
296 int main (void) { return x; }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
297 int foo (void) { x = 0; }
111
kono
parents: 67
diff changeset
298 int (*fp) (void) __attribute__ ((section (".init_array"))) = foo;
kono
parents: 67
diff changeset
299 ])],
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
300 [gcc_cv_initfini_array=yes], [gcc_cv_initfini_array=no],
111
kono
parents: 67
diff changeset
301 [gcc_cv_initfini_array=no]);;
kono
parents: 67
diff changeset
302 *)
kono
parents: 67
diff changeset
303 gcc_cv_initfini_array=no
kono
parents: 67
diff changeset
304 if test $in_tree_ld = yes ; then
kono
parents: 67
diff changeset
305 if test "$gcc_cv_gld_major_version" -eq 2 \
kono
parents: 67
diff changeset
306 -a "$gcc_cv_gld_minor_version" -ge 22 \
kono
parents: 67
diff changeset
307 -o "$gcc_cv_gld_major_version" -gt 2 \
kono
parents: 67
diff changeset
308 && test $in_tree_ld_is_elf = yes; then
kono
parents: 67
diff changeset
309 gcc_cv_initfini_array=yes
kono
parents: 67
diff changeset
310 fi
kono
parents: 67
diff changeset
311 elif test x$gcc_cv_as != x -a x$gcc_cv_ld != x -a x$gcc_cv_objdump != x ; then
kono
parents: 67
diff changeset
312 case $target:$gas in
kono
parents: 67
diff changeset
313 *:yes)
kono
parents: 67
diff changeset
314 sh_flags='"a"'
kono
parents: 67
diff changeset
315 sh_type='%progbits'
kono
parents: 67
diff changeset
316 ;;
kono
parents: 67
diff changeset
317 i?86-*-solaris2*:no | x86_64-*-solaris2*:no)
kono
parents: 67
diff changeset
318 sh_flags='"a"'
kono
parents: 67
diff changeset
319 sh_type='@progbits'
kono
parents: 67
diff changeset
320 ;;
kono
parents: 67
diff changeset
321 sparc*-*-solaris2*:no)
kono
parents: 67
diff changeset
322 sh_flags='#alloc'
kono
parents: 67
diff changeset
323 sh_type='#progbits'
kono
parents: 67
diff changeset
324 sh_quote='"'
kono
parents: 67
diff changeset
325 ;;
kono
parents: 67
diff changeset
326 esac
kono
parents: 67
diff changeset
327 case "$target:$gnu_ld" in
kono
parents: 67
diff changeset
328 *:yes)
kono
parents: 67
diff changeset
329 cat > conftest.s <<EOF
kono
parents: 67
diff changeset
330 .section .dtors,$sh_flags,$sh_type
kono
parents: 67
diff changeset
331 .balign 4
kono
parents: 67
diff changeset
332 .byte 'A', 'A', 'A', 'A'
kono
parents: 67
diff changeset
333 .section .ctors,$sh_flags,$sh_type
kono
parents: 67
diff changeset
334 .balign 4
kono
parents: 67
diff changeset
335 .byte 'B', 'B', 'B', 'B'
kono
parents: 67
diff changeset
336 .section .fini_array.65530,$sh_flags,$sh_type
kono
parents: 67
diff changeset
337 .balign 4
kono
parents: 67
diff changeset
338 .byte 'C', 'C', 'C', 'C'
kono
parents: 67
diff changeset
339 .section .init_array.65530,$sh_flags,$sh_type
kono
parents: 67
diff changeset
340 .balign 4
kono
parents: 67
diff changeset
341 .byte 'D', 'D', 'D', 'D'
kono
parents: 67
diff changeset
342 .section .dtors.64528,$sh_flags,$sh_type
kono
parents: 67
diff changeset
343 .balign 4
kono
parents: 67
diff changeset
344 .byte 'E', 'E', 'E', 'E'
kono
parents: 67
diff changeset
345 .section .ctors.64528,$sh_flags,$sh_type
kono
parents: 67
diff changeset
346 .balign 4
kono
parents: 67
diff changeset
347 .byte 'F', 'F', 'F', 'F'
kono
parents: 67
diff changeset
348 .section .fini_array.01005,$sh_flags,$sh_type
kono
parents: 67
diff changeset
349 .balign 4
kono
parents: 67
diff changeset
350 .byte 'G', 'G', 'G', 'G'
kono
parents: 67
diff changeset
351 .section .init_array.01005,$sh_flags,$sh_type
kono
parents: 67
diff changeset
352 .balign 4
kono
parents: 67
diff changeset
353 .byte 'H', 'H', 'H', 'H'
kono
parents: 67
diff changeset
354 .text
kono
parents: 67
diff changeset
355 .globl _start
kono
parents: 67
diff changeset
356 _start:
kono
parents: 67
diff changeset
357 EOF
kono
parents: 67
diff changeset
358 if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1 \
kono
parents: 67
diff changeset
359 && $gcc_cv_ld -o conftest conftest.o > /dev/null 2>&1 \
kono
parents: 67
diff changeset
360 && $gcc_cv_objdump -s -j .init_array conftest \
kono
parents: 67
diff changeset
361 | grep HHHHFFFFDDDDBBBB > /dev/null 2>&1 \
kono
parents: 67
diff changeset
362 && $gcc_cv_objdump -s -j .fini_array conftest \
kono
parents: 67
diff changeset
363 | grep GGGGEEEECCCCAAAA > /dev/null 2>&1; then
kono
parents: 67
diff changeset
364 gcc_cv_initfini_array=yes
kono
parents: 67
diff changeset
365 fi
kono
parents: 67
diff changeset
366 ;;
kono
parents: 67
diff changeset
367 *-*-solaris2*:no)
kono
parents: 67
diff changeset
368 # When Solaris ld added constructor priority support, it was
kono
parents: 67
diff changeset
369 # decided to only handle .init_array.N/.fini_array.N since
kono
parents: 67
diff changeset
370 # there was no need for backwards compatibility with
kono
parents: 67
diff changeset
371 # .ctors.N/.dtors.N. .ctors/.dtors remain as separate
kono
parents: 67
diff changeset
372 # sections with correct execution order resp. to
kono
parents: 67
diff changeset
373 # .init_array/.fini_array, while gld merges them into
kono
parents: 67
diff changeset
374 # .init_array/.fini_array.
kono
parents: 67
diff changeset
375 cat > conftest.s <<EOF
kono
parents: 67
diff changeset
376 .section $sh_quote.fini_array.65530$sh_quote,$sh_flags,$sh_type
kono
parents: 67
diff changeset
377 .align 4
kono
parents: 67
diff changeset
378 .byte 'C', 'C', 'C', 'C'
kono
parents: 67
diff changeset
379 .section $sh_quote.init_array.65530$sh_quote,$sh_flags,$sh_type
kono
parents: 67
diff changeset
380 .align 4
kono
parents: 67
diff changeset
381 .byte 'D', 'D', 'D', 'D'
kono
parents: 67
diff changeset
382 .section $sh_quote.fini_array.01005$sh_quote,$sh_flags,$sh_type
kono
parents: 67
diff changeset
383 .align 4
kono
parents: 67
diff changeset
384 .byte 'G', 'G', 'G', 'G'
kono
parents: 67
diff changeset
385 .section $sh_quote.init_array.01005$sh_quote,$sh_flags,$sh_type
kono
parents: 67
diff changeset
386 .align 4
kono
parents: 67
diff changeset
387 .byte 'H', 'H', 'H', 'H'
kono
parents: 67
diff changeset
388 .text
kono
parents: 67
diff changeset
389 .globl _start
kono
parents: 67
diff changeset
390 _start:
kono
parents: 67
diff changeset
391 EOF
kono
parents: 67
diff changeset
392 if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1 \
kono
parents: 67
diff changeset
393 && $gcc_cv_ld -o conftest conftest.o > /dev/null 2>&1 \
kono
parents: 67
diff changeset
394 && $gcc_cv_objdump -s -j .init_array conftest \
kono
parents: 67
diff changeset
395 | grep HHHHDDDD > /dev/null 2>&1 \
kono
parents: 67
diff changeset
396 && $gcc_cv_objdump -s -j .fini_array conftest \
kono
parents: 67
diff changeset
397 | grep GGGGCCCC > /dev/null 2>&1; then
kono
parents: 67
diff changeset
398 gcc_cv_initfini_array=yes
kono
parents: 67
diff changeset
399 fi
kono
parents: 67
diff changeset
400 ;;
kono
parents: 67
diff changeset
401 esac
kono
parents: 67
diff changeset
402 changequote(,)dnl
kono
parents: 67
diff changeset
403 rm -f conftest conftest.*
kono
parents: 67
diff changeset
404 changequote([,])dnl
kono
parents: 67
diff changeset
405 fi
kono
parents: 67
diff changeset
406 AC_PREPROC_IFELSE([AC_LANG_SOURCE([
kono
parents: 67
diff changeset
407 #ifndef __ELF__
kono
parents: 67
diff changeset
408 # error Not an ELF OS
kono
parents: 67
diff changeset
409 #endif
kono
parents: 67
diff changeset
410 #include <stdlib.h>
kono
parents: 67
diff changeset
411 #if defined __GLIBC_PREREQ
kono
parents: 67
diff changeset
412 # if __GLIBC_PREREQ (2, 4)
kono
parents: 67
diff changeset
413 # else
kono
parents: 67
diff changeset
414 # error GLIBC 2.4 required
kono
parents: 67
diff changeset
415 # endif
kono
parents: 67
diff changeset
416 #else
kono
parents: 67
diff changeset
417 # if defined __sun__ && defined __svr4__
kono
parents: 67
diff changeset
418 /* Solaris ld.so.1 supports .init_array/.fini_array since Solaris 8. */
kono
parents: 67
diff changeset
419 # else
kono
parents: 67
diff changeset
420 # error The C library not known to support .init_array/.fini_array
kono
parents: 67
diff changeset
421 # endif
kono
parents: 67
diff changeset
422 #endif
kono
parents: 67
diff changeset
423 ])],, [gcc_cv_initfini_array=no]);;
kono
parents: 67
diff changeset
424 esac
kono
parents: 67
diff changeset
425 else
kono
parents: 67
diff changeset
426 AC_MSG_CHECKING(cross compile... guessing)
kono
parents: 67
diff changeset
427 gcc_cv_initfini_array=no
kono
parents: 67
diff changeset
428 fi])
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
429 enable_initfini_array=$gcc_cv_initfini_array
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
430 ])
111
kono
parents: 67
diff changeset
431 AC_DEFINE_UNQUOTED(HAVE_INITFINI_ARRAY_SUPPORT,
kono
parents: 67
diff changeset
432 [`if test $enable_initfini_array = yes; then echo 1; else echo 0; fi`],
kono
parents: 67
diff changeset
433 [Define 0/1 if .init_array/.fini_array sections are available and working.])
kono
parents: 67
diff changeset
434 ])
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
435
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
436 dnl # _gcc_COMPUTE_GAS_VERSION
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
437 dnl # Used by gcc_GAS_VERSION_GTE_IFELSE
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
438 dnl #
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
439 dnl # WARNING:
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
440 dnl # gcc_cv_as_gas_srcdir must be defined before this.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
441 dnl # This gross requirement will go away eventually.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
442 AC_DEFUN([_gcc_COMPUTE_GAS_VERSION],
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
443 [gcc_cv_as_bfd_srcdir=`echo $srcdir | sed -e 's,/gcc$,,'`/bfd
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
444 for f in $gcc_cv_as_bfd_srcdir/configure \
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
445 $gcc_cv_as_gas_srcdir/configure \
111
kono
parents: 67
diff changeset
446 $gcc_cv_as_gas_srcdir/configure.ac \
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
447 $gcc_cv_as_gas_srcdir/Makefile.in ; do
111
kono
parents: 67
diff changeset
448 gcc_cv_gas_version=`sed -n -e 's/^[[ ]]*VERSION=[[^0-9A-Za-z_]]*\([[0-9]]*\.[[0-9]]*.*\)/VERSION=\1/p' < $f`
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
449 if test x$gcc_cv_gas_version != x; then
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
450 break
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
451 fi
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
452 done
111
kono
parents: 67
diff changeset
453 case $gcc_cv_gas_version in
kono
parents: 67
diff changeset
454 VERSION=[[0-9]]*) ;;
kono
parents: 67
diff changeset
455 *) AC_MSG_ERROR([[cannot find version of in-tree assembler]]);;
kono
parents: 67
diff changeset
456 esac
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
457 gcc_cv_gas_major_version=`expr "$gcc_cv_gas_version" : "VERSION=\([[0-9]]*\)"`
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
458 gcc_cv_gas_minor_version=`expr "$gcc_cv_gas_version" : "VERSION=[[0-9]]*\.\([[0-9]]*\)"`
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
459 gcc_cv_gas_patch_version=`expr "$gcc_cv_gas_version" : "VERSION=[[0-9]]*\.[[0-9]]*\.\([[0-9]]*\)"`
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
460 case $gcc_cv_gas_patch_version in
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
461 "") gcc_cv_gas_patch_version="0" ;;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
462 esac
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
463 gcc_cv_gas_vers=`expr \( \( $gcc_cv_gas_major_version \* 1000 \) \
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
464 + $gcc_cv_gas_minor_version \) \* 1000 \
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
465 + $gcc_cv_gas_patch_version`
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
466 ]) []dnl # _gcc_COMPUTE_GAS_VERSION
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
467
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
468 dnl # gcc_GAS_VERSION_GTE_IFELSE([elf,] major, minor, patchlevel,
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
469 dnl # [command_if_true = :], [command_if_false = :])
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
470 dnl # Check to see if the version of GAS is greater than or
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
471 dnl # equal to the specified version.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
472 dnl #
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
473 dnl # The first ifelse() shortens the shell code if the patchlevel
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
474 dnl # is unimportant (the usual case). The others handle missing
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
475 dnl # commands. Note that the tests are structured so that the most
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
476 dnl # common version number cases are tested first.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
477 AC_DEFUN([_gcc_GAS_VERSION_GTE_IFELSE],
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
478 [ifelse([$1], elf,
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
479 [if test $in_tree_gas_is_elf = yes \
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
480 &&],
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
481 [if]) test $gcc_cv_gas_vers -ge `expr \( \( $2 \* 1000 \) + $3 \) \* 1000 + $4`
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
482 then dnl
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
483 ifelse([$5],,:,[$5])[]dnl
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
484 ifelse([$6],,,[
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
485 else $6])
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
486 fi])
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
487
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
488 AC_DEFUN([gcc_GAS_VERSION_GTE_IFELSE],
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
489 [AC_REQUIRE([_gcc_COMPUTE_GAS_VERSION])dnl
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
490 ifelse([$1], elf, [_gcc_GAS_VERSION_GTE_IFELSE($@)],
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
491 [_gcc_GAS_VERSION_GTE_IFELSE(,$@)])])
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
492
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
493 dnl # gcc_GAS_FLAGS
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
494 dnl # Used by gcc_GAS_CHECK_FEATURE
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
495 dnl #
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
496 AC_DEFUN([gcc_GAS_FLAGS],
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
497 [AC_CACHE_CHECK([assembler flags], gcc_cv_as_flags,
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
498 [ case "$target" in
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
499 i[[34567]]86-*-linux*)
111
kono
parents: 67
diff changeset
500 dnl Override the default, which may be incompatible.
kono
parents: 67
diff changeset
501 gcc_cv_as_flags=--32
kono
parents: 67
diff changeset
502 ;;
kono
parents: 67
diff changeset
503 x86_64-*-linux-gnux32)
kono
parents: 67
diff changeset
504 dnl Override the default, which may be incompatible.
kono
parents: 67
diff changeset
505 gcc_cv_as_flags=--x32
kono
parents: 67
diff changeset
506 ;;
kono
parents: 67
diff changeset
507 x86_64-*-linux*)
kono
parents: 67
diff changeset
508 dnl Override the default, which may be incompatible.
kono
parents: 67
diff changeset
509 gcc_cv_as_flags=--64
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
510 ;;
67
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
511 powerpc*-*-darwin*)
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
512 dnl Always pass -arch ppc to assembler.
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
513 gcc_cv_as_flags="-arch ppc"
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
514 ;;
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
515 *)
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
516 gcc_cv_as_flags=" "
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
517 ;;
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
518 esac])
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
519 ])
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
520
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
521 dnl gcc_GAS_CHECK_FEATURE(description, cv, [[elf,]major,minor,patchlevel],
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
522 dnl [extra switches to as], [assembler input],
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
523 dnl [extra testing logic], [command if feature available])
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
524 dnl
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
525 dnl Checks for an assembler feature. If we are building an in-tree
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
526 dnl gas, the feature is available if the associated assembler version
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
527 dnl is greater than or equal to major.minor.patchlevel. If not, then
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
528 dnl ASSEMBLER INPUT is fed to the assembler and the feature is available
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
529 dnl if assembly succeeds. If EXTRA TESTING LOGIC is not the empty string,
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
530 dnl then it is run instead of simply setting CV to "yes" - it is responsible
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
531 dnl for doing so, if appropriate.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
532 AC_DEFUN([gcc_GAS_CHECK_FEATURE],
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
533 [AC_REQUIRE([gcc_GAS_FLAGS])dnl
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
534 AC_CACHE_CHECK([assembler for $1], [$2],
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
535 [[$2]=no
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
536 ifelse([$3],,,[dnl
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
537 if test $in_tree_gas = yes; then
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
538 gcc_GAS_VERSION_GTE_IFELSE($3, [[$2]=yes])
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
539 el])if test x$gcc_cv_as != x; then
111
kono
parents: 67
diff changeset
540 AS_ECHO([ifelse(m4_substr([$5],0,1),[$], "[$5]", '[$5]')]) > conftest.s
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
541 if AC_TRY_COMMAND([$gcc_cv_as $gcc_cv_as_flags $4 -o conftest.o conftest.s >&AS_MESSAGE_LOG_FD])
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
542 then
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
543 ifelse([$6],, [$2]=yes, [$6])
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
544 else
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
545 echo "configure: failed program was" >&AS_MESSAGE_LOG_FD
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
546 cat conftest.s >&AS_MESSAGE_LOG_FD
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
547 fi
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
548 rm -f conftest.o conftest.s
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
549 fi])
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
550 ifelse([$7],,,[dnl
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
551 if test $[$2] = yes; then
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
552 $7
111
kono
parents: 67
diff changeset
553 fi])
kono
parents: 67
diff changeset
554 ifelse([$8],,,[dnl
kono
parents: 67
diff changeset
555 if test $[$2] != yes; then
kono
parents: 67
diff changeset
556 $8
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
557 fi])])
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
558
111
kono
parents: 67
diff changeset
559 dnl gcc_SUN_LD_VERSION
kono
parents: 67
diff changeset
560 dnl
kono
parents: 67
diff changeset
561 dnl Determines Sun linker version numbers, setting gcc_cv_sun_ld_vers to
kono
parents: 67
diff changeset
562 dnl the complete version number and gcc_cv_sun_ld_vers_{major, minor} to
kono
parents: 67
diff changeset
563 dnl the corresponding fields.
kono
parents: 67
diff changeset
564 dnl
kono
parents: 67
diff changeset
565 dnl ld and ld.so.1 are guaranteed to be updated in lockstep, so ld version
kono
parents: 67
diff changeset
566 dnl numbers can be used in ld.so.1 feature checks even if a different
kono
parents: 67
diff changeset
567 dnl linker is configured.
kono
parents: 67
diff changeset
568 dnl
kono
parents: 67
diff changeset
569 AC_DEFUN([gcc_SUN_LD_VERSION],
kono
parents: 67
diff changeset
570 [changequote(,)dnl
kono
parents: 67
diff changeset
571 if test "x${build}" = "x${target}" && test "x${build}" = "x${host}"; then
kono
parents: 67
diff changeset
572 case "${target}" in
kono
parents: 67
diff changeset
573 *-*-solaris2*)
kono
parents: 67
diff changeset
574 #
kono
parents: 67
diff changeset
575 # Solaris 2 ld -V output looks like this for a regular version:
kono
parents: 67
diff changeset
576 #
kono
parents: 67
diff changeset
577 # ld: Software Generation Utilities - Solaris Link Editors: 5.11-1.1699
kono
parents: 67
diff changeset
578 #
kono
parents: 67
diff changeset
579 # but test versions add stuff at the end:
kono
parents: 67
diff changeset
580 #
kono
parents: 67
diff changeset
581 # ld: Software Generation Utilities - Solaris Link Editors: 5.11-1.1701:onnv-ab196087-6931056-03/25/10
kono
parents: 67
diff changeset
582 #
kono
parents: 67
diff changeset
583 gcc_cv_sun_ld_ver=`/usr/ccs/bin/ld -V 2>&1`
kono
parents: 67
diff changeset
584 if echo "$gcc_cv_sun_ld_ver" | grep 'Solaris Link Editors' > /dev/null; then
kono
parents: 67
diff changeset
585 gcc_cv_sun_ld_vers=`echo $gcc_cv_sun_ld_ver | sed -n \
kono
parents: 67
diff changeset
586 -e 's,^.*: 5\.[0-9][0-9]*-\([0-9]\.[0-9][0-9]*\).*$,\1,p'`
kono
parents: 67
diff changeset
587 gcc_cv_sun_ld_vers_major=`expr "$gcc_cv_sun_ld_vers" : '\([0-9]*\)'`
kono
parents: 67
diff changeset
588 gcc_cv_sun_ld_vers_minor=`expr "$gcc_cv_sun_ld_vers" : '[0-9]*\.\([0-9]*\)'`
kono
parents: 67
diff changeset
589 fi
kono
parents: 67
diff changeset
590 ;;
kono
parents: 67
diff changeset
591 esac
kono
parents: 67
diff changeset
592 fi
kono
parents: 67
diff changeset
593 changequote([,])dnl
kono
parents: 67
diff changeset
594 ])
kono
parents: 67
diff changeset
595
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
596 dnl GCC_TARGET_TEMPLATE(KEY)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
597 dnl ------------------------
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
598 dnl Define KEY as a valid configure key on the target machine.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
599
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
600 m4_define([GCC_TARGET_TEMPLATE],
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
601 [m4_define([GCC_TARGET_TEMPLATE($1)],[])])
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
602
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
603 dnl AH_TEMPLATE(KEY, DESCRIPTION)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
604 dnl -----------------------------
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
605 dnl Issue an autoheader template for KEY, i.e., a comment composed of
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
606 dnl DESCRIPTION (properly wrapped), and then #undef KEY. Redefinition
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
607 dnl of the macro in autoheader.m4, to support definition of only a few
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
608 dnl keys while compiling target libraries.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
609
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
610 m4_define([AH_TEMPLATE],
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
611 [AH_VERBATIM([$1],m4_text_wrap([$2 */], [ ], [/* ])
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
612 m4_ifdef([GCC_TARGET_TEMPLATE($1)],[],[#ifndef USED_FOR_TARGET
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
613 ])[#undef $1]m4_ifdef([GCC_TARGET_TEMPLATE($1)],[],[
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
614 #endif
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
615 ]))])
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
616
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
617 dnl Make sure that build_exeext is looked for
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
618 AC_DEFUN([gcc_AC_BUILD_EXEEXT], [
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
619 ac_executable_extensions="$build_exeext"])
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
620
111
kono
parents: 67
diff changeset
621 dnl GCC_GLIBC_VERSION_GTE_IFELSE(MAJOR, MINOR, IF-TRUE, IF-FALSE)
kono
parents: 67
diff changeset
622 dnl -------------------------------------------------------------
kono
parents: 67
diff changeset
623 dnl If the target glibc version ($glibc_version_major.$glibc_version_minor)
kono
parents: 67
diff changeset
624 dnl is at least MAJOR.MINOR, call IF-TRUE, otherwise call IF-FALSE.
kono
parents: 67
diff changeset
625 AC_DEFUN([GCC_GLIBC_VERSION_GTE_IFELSE],
kono
parents: 67
diff changeset
626 [
kono
parents: 67
diff changeset
627 AS_IF([test $glibc_version_major -gt $1 \
kono
parents: 67
diff changeset
628 || ( test $glibc_version_major -eq $1 && test $glibc_version_minor -ge $2 )],
kono
parents: 67
diff changeset
629 [$3], [$4])])