Mercurial > hg > CbC > CbC_gcc
comparison libgcc/configure.ac @ 0:a06113de4d67
first commit
author | kent <kent@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Fri, 17 Jul 2009 14:47:48 +0900 |
parents | |
children | 77e2b8dfacca |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:a06113de4d67 |
---|---|
1 dnl Process this file with autoconf to produce a configure script. | |
2 | |
3 sinclude(../config/enable.m4) | |
4 sinclude(../config/tls.m4) | |
5 sinclude(../config/acx.m4) | |
6 sinclude(../config/no-executables.m4) | |
7 sinclude(../config/override.m4) | |
8 | |
9 AC_PREREQ(2.59) | |
10 AC_INIT([GNU C Runtime Library], 1.0,,[libgcc]) | |
11 AC_CONFIG_SRCDIR([static-object.mk]) | |
12 | |
13 AC_ARG_WITH(target-subdir, | |
14 [ --with-target-subdir=SUBDIR Configuring in a subdirectory for target]) | |
15 AC_ARG_WITH(cross-host, | |
16 [ --with-cross-host=HOST Configuring with a cross compiler]) | |
17 AC_ARG_WITH(ld, | |
18 [ --with-ld arrange to use the specified ld (full pathname)]) | |
19 | |
20 if test "${srcdir}" = "."; then | |
21 if test -n "${with_build_subdir}"; then | |
22 libgcc_topdir="${srcdir}/../.." | |
23 with_target_subdir= | |
24 elif test -z "${with_target_subdir}"; then | |
25 libgcc_topdir="${srcdir}/.." | |
26 else | |
27 if test "${with_target_subdir}" != "."; then | |
28 libgcc_topdir="${srcdir}/${with_multisrctop}../.." | |
29 else | |
30 libgcc_topdir="${srcdir}/${with_multisrctop}.." | |
31 fi | |
32 fi | |
33 else | |
34 libgcc_topdir="${srcdir}/.." | |
35 fi | |
36 AC_SUBST(libgcc_topdir) | |
37 AC_CONFIG_AUX_DIR($libgcc_topdir) | |
38 | |
39 AC_ARG_ENABLE(shared, | |
40 [ --disable-shared don't provide a shared libgcc], | |
41 [ | |
42 case $enable_shared in | |
43 yes | no) ;; | |
44 *) | |
45 enable_shared=no | |
46 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," | |
47 for pkg in $enableval; do | |
48 if test "X$pkg" = "Xgcc" || test "X$pkg" = "Xlibgcc"; then | |
49 enable_shared=yes | |
50 fi | |
51 done | |
52 IFS="$ac_save_ifs" | |
53 ;; | |
54 esac | |
55 ], [enable_shared=yes]) | |
56 AC_SUBST(enable_shared) | |
57 | |
58 AC_MSG_CHECKING([for --enable-version-specific-runtime-libs]) | |
59 AC_ARG_ENABLE(version-specific-runtime-libs, | |
60 [ --enable-version-specific-runtime-libs Specify that runtime libraries should be installed in a compiler-specific directory ], | |
61 [case "$enableval" in | |
62 yes) version_specific_libs=yes ;; | |
63 no) version_specific_libs=no ;; | |
64 *) AC_MSG_ERROR([Unknown argument to enable/disable version-specific libs]);; | |
65 esac], | |
66 [version_specific_libs=no]) | |
67 AC_MSG_RESULT($version_specific_libs) | |
68 | |
69 AC_ARG_WITH(slibdir, | |
70 [ --with-slibdir=DIR shared libraries in DIR [LIBDIR]], | |
71 slibdir="$with_slibdir", | |
72 if test "${version_specific_libs}" = yes; then | |
73 slibdir='$(libsubdir)' | |
74 elif test -n "$with_cross_host" && test x"$with_cross_host" != x"no"; then | |
75 slibdir='$(exec_prefix)/$(host_noncanonical)/lib' | |
76 else | |
77 slibdir='$(libdir)' | |
78 fi) | |
79 AC_SUBST(slibdir) | |
80 | |
81 AC_PROG_INSTALL | |
82 | |
83 AC_PROG_AWK | |
84 # We need awk; bail out if it's missing. | |
85 case ${AWK} in | |
86 "") AC_MSG_ERROR([can't build without awk, bailing out]) ;; | |
87 esac | |
88 | |
89 AC_CANONICAL_HOST | |
90 ACX_NONCANONICAL_HOST | |
91 GCC_TOPLEV_SUBDIRS | |
92 | |
93 dnl These must be called before AM_PROG_LIBTOOL, because it may want | |
94 dnl to call AC_CHECK_PROG. | |
95 AC_CHECK_TOOL(AR, ar) | |
96 AC_CHECK_TOOL(LIPO, lipo, :) | |
97 AC_CHECK_TOOL(NM, nm) | |
98 AC_CHECK_TOOL(RANLIB, ranlib, :) | |
99 AC_CHECK_TOOL(STRIP, strip, :) | |
100 AC_PROG_LN_S | |
101 | |
102 GCC_NO_EXECUTABLES | |
103 AC_PROG_CC | |
104 AC_PROG_CPP_WERROR | |
105 | |
106 # Check for decimal float support. | |
107 AC_CACHE_CHECK([whether decimal floating point is supported], [libgcc_cv_dfp], | |
108 [AC_COMPILE_IFELSE([_Decimal32 x;], [libgcc_cv_dfp=yes], | |
109 [libgcc_cv_dfp=no])]) | |
110 decimal_float=$libgcc_cv_dfp | |
111 AC_SUBST(decimal_float) | |
112 | |
113 AC_ARG_ENABLE(decimal-float, | |
114 [ --enable-decimal-float={no,yes,bid,dpd} | |
115 enable decimal float extension to C. Selecting 'bid' | |
116 or 'dpd' choses which decimal floating point format | |
117 to use], | |
118 [ | |
119 case $enable_decimal_float in | |
120 yes | no | bid | dpd) ;; | |
121 *) AC_MSG_ERROR(['$enable_decimal_float' is an invalid value for --enable-decimal-float. | |
122 Valid choices are 'yes', 'bid', 'dpd', and 'no'.]) ;; | |
123 esac | |
124 ], | |
125 [ | |
126 case $host in | |
127 powerpc*-*-linux* | i?86*-*-linux* | x86_64*-*-linux*) | |
128 enable_decimal_float=yes | |
129 ;; | |
130 *) | |
131 enable_decimal_float=no | |
132 ;; | |
133 esac | |
134 ]) | |
135 | |
136 # x86's use BID format instead of DPD | |
137 if test x$enable_decimal_float = xyes; then | |
138 case $host in | |
139 i?86*-*-linux* | x86_64*-*-linux*) | |
140 enable_decimal_float=bid | |
141 ;; | |
142 *) | |
143 enable_decimal_float=dpd | |
144 ;; | |
145 esac | |
146 fi | |
147 AC_SUBST(enable_decimal_float) | |
148 | |
149 # Check for fixed-point support. | |
150 AC_CACHE_CHECK([whether fixed-point is supported], [libgcc_cv_fixed_point], | |
151 [AC_COMPILE_IFELSE([_Sat _Fract x;], [libgcc_cv_fixed_point=yes], | |
152 [libgcc_cv_fixed_point=no])]) | |
153 fixed_point=$libgcc_cv_fixed_point | |
154 AC_SUBST(fixed_point) | |
155 | |
156 # Check 32bit or 64bit for x86. | |
157 case ${host} in | |
158 i?86*-*-* | x86_64*-*-*) | |
159 cat > conftest.c <<EOF | |
160 #ifdef __x86_64__ | |
161 host_address=64 | |
162 #else | |
163 host_address=32 | |
164 #endif | |
165 EOF | |
166 eval `${CC-cc} -E conftest.c | grep host_address=` | |
167 rm -f conftest.c | |
168 ;; | |
169 esac | |
170 | |
171 # Collect host-machine-specific information. | |
172 . ${srcdir}/config.host | |
173 | |
174 # Check if Solaris/x86 linker supports ZERO terminator unwind entries. | |
175 # This is after config.host so we can augment tmake_file. | |
176 # Link with -nostartfiles -nodefaultlibs since neither are present while | |
177 # building libgcc. | |
178 case ${host} in | |
179 i?86-*-solaris2.1[[0-9]]*) | |
180 cat > conftest.s <<EOF | |
181 .section .eh_frame,"a",@unwind | |
182 .zero 4 | |
183 .section .jcr,"aw",@progbits | |
184 .zero 8 | |
185 EOF | |
186 if AC_TRY_COMMAND(${CC-cc} -shared -nostartfiles -nodefaultlibs -o conftest.so conftest.s 1>&AS_MESSAGE_LOG_FD); then | |
187 # configure expects config files in libgcc/config, so need a relative | |
188 # path here. | |
189 tmake_file="${tmake_file} ../../gcc/config/i386/t-crtstuff" | |
190 fi | |
191 ;; | |
192 esac | |
193 | |
194 # Check for visibility support. This is after config.host so that | |
195 # we can check for asm_hidden_op. | |
196 AC_CACHE_CHECK([for __attribute__((visibility("hidden")))], | |
197 libgcc_cv_hidden_visibility_attribute, [ | |
198 echo 'int __attribute__ ((visibility ("hidden"))) foo (void) { return 1; }' > conftest.c | |
199 libgcc_cv_hidden_visibility_attribute=no | |
200 if AC_TRY_COMMAND(${CC-cc} -Werror -S conftest.c -o conftest.s 1>&AS_MESSAGE_LOG_FD); then | |
201 if grep "\\$asm_hidden_op.*foo" conftest.s >/dev/null; then | |
202 libgcc_cv_hidden_visibility_attribute=yes | |
203 fi | |
204 fi | |
205 rm -f conftest.* | |
206 ]) | |
207 | |
208 if test $libgcc_cv_hidden_visibility_attribute = yes; then | |
209 vis_hide='-fvisibility=hidden -DHIDE_EXPORTS' | |
210 else | |
211 vis_hide= | |
212 fi | |
213 AC_SUBST(vis_hide) | |
214 | |
215 # See if we have thread-local storage. We can only test assembler | |
216 # sicne link-time and run-time tests require the newly built | |
217 # gcc, which can't be used to build executable due to that libgcc | |
218 # is yet to be built here. | |
219 GCC_CHECK_CC_TLS | |
220 set_have_cc_tls= | |
221 if test "$enable_tls $gcc_cv_have_cc_tls" = "yes yes"; then | |
222 set_have_cc_tls="-DHAVE_CC_TLS" | |
223 fi | |
224 AC_SUBST(set_have_cc_tls) | |
225 | |
226 # Conditionalize the makefile for this target machine. | |
227 tmake_file_= | |
228 for f in ${tmake_file} | |
229 do | |
230 if test -f ${srcdir}/config/$f | |
231 then | |
232 tmake_file_="${tmake_file_} \$(srcdir)/config/$f" | |
233 fi | |
234 done | |
235 tmake_file="${tmake_file_}" | |
236 AC_SUBST(tmake_file) | |
237 | |
238 # Substitute configuration variables | |
239 AC_SUBST(extra_parts) | |
240 AC_SUBST(asm_hidden_op) | |
241 | |
242 # We need multilib support. | |
243 AC_CONFIG_FILES([Makefile]) | |
244 AC_CONFIG_COMMANDS([default], | |
245 [[test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h | |
246 if test -n "$CONFIG_FILES"; then | |
247 # FIXME: We shouldn't need to set ac_file | |
248 ac_file=Makefile | |
249 . ${libgcc_topdir}/config-ml.in | |
250 fi]], | |
251 [[srcdir=${srcdir} | |
252 host=${host} | |
253 with_target_subdir=${with_target_subdir} | |
254 with_multisubdir=${with_multisubdir} | |
255 ac_configure_args="--enable-multilib ${ac_configure_args}" | |
256 CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} | |
257 libgcc_topdir=${libgcc_topdir} | |
258 CC="${CC}" | |
259 ]]) | |
260 AC_OUTPUT |