1 | dnl This is the newlib configure.in file. |
---|
2 | dnl Process this file with autoconf to produce a configure script. |
---|
3 | |
---|
4 | AC_PREREQ(2.59) |
---|
5 | AC_INIT([newlib],[NEWLIB_VERSION]) |
---|
6 | AC_CONFIG_SRCDIR([libc]) |
---|
7 | AC_CONFIG_HEADERS([_newlib_version.h:_newlib_version.hin newlib.h:newlib.hin]) |
---|
8 | |
---|
9 | dnl Can't be done in NEWLIB_CONFIGURE because that confuses automake. |
---|
10 | AC_CONFIG_AUX_DIR(..) |
---|
11 | |
---|
12 | dnl Support --enable-newlib-io-pos-args |
---|
13 | dnl This option is actually read in libc/configure.in. It is repeated |
---|
14 | dnl here so that it shows up in the help text. |
---|
15 | AC_ARG_ENABLE(newlib-io-pos-args, |
---|
16 | [ --enable-newlib-io-pos-args enable printf-family positional arg support], |
---|
17 | [case "${enableval}" in |
---|
18 | yes) newlib_io_pos_args=yes ;; |
---|
19 | no) newlib_io_pos_args=no ;; |
---|
20 | *) AC_MSG_ERROR(bad value ${enableval} for newlib-io-pos-args option) ;; |
---|
21 | esac], [newlib_io_pos_args=])dnl |
---|
22 | |
---|
23 | dnl Support --enable-newlib-io-c99-formats |
---|
24 | AC_ARG_ENABLE(newlib-io-c99-formats, |
---|
25 | [ --enable-newlib-io-c99-formats enable C99 support in IO functions like printf/scanf], |
---|
26 | [case "${enableval}" in |
---|
27 | yes) newlib_io_c99_formats=yes;; |
---|
28 | no) newlib_io_c99_formats=no ;; |
---|
29 | *) AC_MSG_ERROR(bad value ${enableval} for newlib-io-c99-formats option) ;; |
---|
30 | esac], [newlib_io_c99_formats=])dnl |
---|
31 | |
---|
32 | dnl Support --enable-newlib-register-fini |
---|
33 | AC_ARG_ENABLE(newlib-register-fini, |
---|
34 | [ --enable-newlib-register-fini enable finalization function registration using atexit], |
---|
35 | [case "${enableval}" in |
---|
36 | yes) newlib_register_fini=yes;; |
---|
37 | no) newlib_register_fini=no ;; |
---|
38 | *) AC_MSG_ERROR(bad value ${enableval} for newlib-register-fini option) ;; |
---|
39 | esac], [newlib_register_fini=])dnl |
---|
40 | |
---|
41 | dnl Support --enable-newlib-io-long-long |
---|
42 | AC_ARG_ENABLE(newlib-io-long-long, |
---|
43 | [ --enable-newlib-io-long-long enable long long type support in IO functions like printf/scanf], |
---|
44 | [case "${enableval}" in |
---|
45 | yes) newlib_io_long_long=yes;; |
---|
46 | no) newlib_io_long_long=no ;; |
---|
47 | *) AC_MSG_ERROR(bad value ${enableval} for newlib-io-long-long option) ;; |
---|
48 | esac], [newlib_io_long_long=])dnl |
---|
49 | |
---|
50 | dnl Support --enable-newlib-io-long-double |
---|
51 | AC_ARG_ENABLE(newlib-io-long-double, |
---|
52 | [ --enable-newlib-io-long-double enable long double type support in IO functions printf/scanf], |
---|
53 | [case "${enableval}" in |
---|
54 | yes) newlib_io_long_double=yes;; |
---|
55 | no) newlib_io_long_double=no ;; |
---|
56 | *) AC_MSG_ERROR(bad value ${enableval} for newlib-io-long-double option) ;; |
---|
57 | esac], [newlib_io_long_double=])dnl |
---|
58 | |
---|
59 | dnl If multibyte support is enabled, iconv should be enabled too |
---|
60 | dnl Support --enable-newlib-mb |
---|
61 | AC_ARG_ENABLE(newlib-mb, |
---|
62 | [ --enable-newlib-mb enable multibyte support], |
---|
63 | [case "${enableval}" in |
---|
64 | yes) newlib_mb=yes;; |
---|
65 | no) newlib_mb=no ;; |
---|
66 | *) AC_MSG_ERROR(bad value ${enableval} for newlib-mb option) ;; |
---|
67 | esac], [newlib_mb=])dnl |
---|
68 | |
---|
69 | dnl Support --enable-newlib-iconv-encodings |
---|
70 | AC_ARG_ENABLE(newlib-iconv-encodings, |
---|
71 | [ --enable-newlib-iconv-encodings enable specific comma-separated list of bidirectional iconv encodings to be built-in], |
---|
72 | [if test x${enableval} = x; then |
---|
73 | AC_MSG_ERROR(bad value ${enableval} for newlib-iconv-encodings option - use comma-separated encodings list) |
---|
74 | fi |
---|
75 | iconv_encodings=${enableval} |
---|
76 | ], [iconv_encodings=])dnl |
---|
77 | |
---|
78 | dnl Support --enable-newlib-iconv-from-encodings |
---|
79 | AC_ARG_ENABLE(newlib-iconv-from-encodings, |
---|
80 | [ --enable-newlib-iconv-from-encodings enable specific comma-separated list of \"from\" iconv encodings to be built-in], |
---|
81 | [if test x${enableval} = x; then |
---|
82 | AC_MSG_ERROR(bad value ${enableval} for newlib-iconv-from-encodings option - use comma-separated encodings list) |
---|
83 | fi |
---|
84 | iconv_from_encodings=${enableval} |
---|
85 | ], [iconv_from_encodings=])dnl |
---|
86 | |
---|
87 | dnl Support --enable-newlib-iconv-to-encodings |
---|
88 | AC_ARG_ENABLE(newlib-iconv-to-encodings, |
---|
89 | [ --enable-newlib-iconv-to-encodings enable specific comma-separated list of \"to\" iconv encodings to be built-in], |
---|
90 | [if test x${enableval} = x; then |
---|
91 | AC_MSG_ERROR(bad value ${enableval} for newlib-iconv-to-encodings option - use comma-separated encodings list) |
---|
92 | fi |
---|
93 | iconv_to_encodings=${enableval} |
---|
94 | ], [iconv_to_encodings=])dnl |
---|
95 | |
---|
96 | dnl Support --enable-newlib-iconv-external-ccs |
---|
97 | AC_ARG_ENABLE(newlib-iconv-external-ccs, |
---|
98 | [ --enable-newlib-iconv-external-ccs enable capabilities to load external CCS files for iconv], |
---|
99 | [if test "${newlib_iconv_external_ccs+set}" != set; then |
---|
100 | case "${enableval}" in |
---|
101 | yes) newlib_iconv_external_ccs=yes ;; |
---|
102 | no) newlib_iconv_external_ccs=no ;; |
---|
103 | *) AC_MSG_ERROR(bad value ${enableval} for newlib-iconv-external-ccs option) ;; |
---|
104 | esac |
---|
105 | fi], [newlib_iconv_external_ccs=${newlib_iconv_external_ccs}])dnl |
---|
106 | |
---|
107 | dnl Support --disable-newlib-atexit-dynamic-alloc |
---|
108 | AC_ARG_ENABLE(newlib-atexit-dynamic-alloc, |
---|
109 | [ --disable-newlib-atexit-dynamic-alloc disable dynamic allocation of atexit entries], |
---|
110 | [if test "${newlib_atexit_dynamic_alloc+set}" != set; then |
---|
111 | case "${enableval}" in |
---|
112 | yes) newlib_atexit_dynamic_alloc=yes ;; |
---|
113 | no) newlib_atexit_dynamic_alloc=no ;; |
---|
114 | *) AC_MSG_ERROR(bad value ${enableval} for newlib-atexit-dynamic-alloc option) ;; |
---|
115 | esac |
---|
116 | fi], [newlib_atexit_dynamic_alloc=${newlib_atexit_dynamic_alloc}])dnl |
---|
117 | |
---|
118 | dnl Support --enable-newlib-global-atexit |
---|
119 | dnl Enable atexit data structure as global variables to save memory usage in |
---|
120 | dnl _reent. |
---|
121 | AC_ARG_ENABLE(newlib-global-atexit, |
---|
122 | [ --enable-newlib-global-atexit enable atexit data structure as global], |
---|
123 | [if test "${newlib_global_atexit+set}" != set; then |
---|
124 | case "${enableval}" in |
---|
125 | yes) newlib_global_atexit=yes ;; |
---|
126 | no) newlib_global_atexit=no ;; |
---|
127 | *) AC_MSG_ERROR(bad value ${enableval} for newlib-global-atexit option) ;; |
---|
128 | esac |
---|
129 | fi], [newlib_global_atexit=no])dnl |
---|
130 | |
---|
131 | dnl Support --enable-newlib-reent-small |
---|
132 | AC_ARG_ENABLE(newlib-reent-small, |
---|
133 | [ --enable-newlib-reent-small enable small reentrant struct support], |
---|
134 | [case "${enableval}" in |
---|
135 | yes) newlib_reent_small=yes;; |
---|
136 | no) newlib_reent_small=no ;; |
---|
137 | *) AC_MSG_ERROR(bad value ${enableval} for newlib-reent-small option) ;; |
---|
138 | esac], [newlib_reent_small=])dnl |
---|
139 | |
---|
140 | dnl Support --enable-newlib-global-stdio-streams |
---|
141 | AC_ARG_ENABLE(newlib-global-stdio-streams, |
---|
142 | [ --enable-newlib-global-stdio-streams enable global stdio streams], |
---|
143 | [case "${enableval}" in |
---|
144 | yes) newlib_global_stdio_streams=yes;; |
---|
145 | no) newlib_global_stdio_streams=no ;; |
---|
146 | *) AC_MSG_ERROR(bad value ${enableval} for newlib-global-stdio-streams option) ;; |
---|
147 | esac], [newlib_global_stdio_streams=])dnl |
---|
148 | |
---|
149 | dnl Support --disable-newlib-fvwrite-in-streamio |
---|
150 | AC_ARG_ENABLE(newlib-fvwrite-in-streamio, |
---|
151 | [ --disable-newlib-fvwrite-in-streamio disable iov in streamio], |
---|
152 | [if test "${newlib_fvwrite_in_streamio+set}" != set; then |
---|
153 | case "${enableval}" in |
---|
154 | yes) newlib_fvwrite_in_streamio=yes ;; |
---|
155 | no) newlib_fvwrite_in_streamio=no ;; |
---|
156 | *) AC_MSG_ERROR(bad value ${enableval} for newlib-fvwrite-in-streamio option) ;; |
---|
157 | esac |
---|
158 | fi], [newlib_fvwrite_in_streamio=yes])dnl |
---|
159 | |
---|
160 | dnl Support --disable-newlib-fseek-optimization |
---|
161 | AC_ARG_ENABLE(newlib-fseek-optimization, |
---|
162 | [ --disable-newlib-fseek-optimization disable fseek optimization], |
---|
163 | [if test "${newlib_fseek_optimization+set}" != set; then |
---|
164 | case "${enableval}" in |
---|
165 | yes) newlib_fseek_optimization=yes ;; |
---|
166 | no) newlib_fseek_optimization=no ;; |
---|
167 | *) AC_MSG_ERROR(bad value ${enableval} for newlib-fseek-optimization option) ;; |
---|
168 | esac |
---|
169 | fi], [newlib_fseek_optimization=yes])dnl |
---|
170 | |
---|
171 | dnl Support --enable-newlib-wide-orient |
---|
172 | dnl This option is also read in libc/configure.in. It is repeated |
---|
173 | dnl here so that it shows up in the help text. |
---|
174 | AC_ARG_ENABLE(newlib_wide_orient, |
---|
175 | [ --disable-newlib-wide-orient Turn off wide orientation in streamio], |
---|
176 | [case "${enableval}" in |
---|
177 | yes) newlib_wide_orient=yes ;; |
---|
178 | no) newlib_wide_orient=no ;; |
---|
179 | *) AC_MSG_ERROR(bad value ${enableval} for newlib-wide-orient) ;; |
---|
180 | esac],[newlib_wide_orient=yes]) |
---|
181 | |
---|
182 | dnl Support --enable-newlib-nano-malloc |
---|
183 | dnl This option is also read in libc/configure.in. It is repeated |
---|
184 | dnl here so that it shows up in the help text. |
---|
185 | AC_ARG_ENABLE(newlib-nano-malloc, |
---|
186 | [ --enable-newlib-nano-malloc use small-footprint nano-malloc implementation], |
---|
187 | [if test "${newlib_nano_malloc+set}" != set; then |
---|
188 | case "${enableval}" in |
---|
189 | yes) newlib_nano_malloc=yes ;; |
---|
190 | no) newlib_nano_malloc=no ;; |
---|
191 | *) AC_MSG_ERROR(bad value ${enableval} for newlib-nano-malloc option) ;; |
---|
192 | esac |
---|
193 | fi], [newlib_nano_malloc=])dnl |
---|
194 | |
---|
195 | dnl Support --disable-newlib-unbuf-stream-opt |
---|
196 | AC_ARG_ENABLE(newlib-unbuf-stream-opt, |
---|
197 | [ --disable-newlib-unbuf-stream-opt disable unbuffered stream optimization in streamio], |
---|
198 | [if test "${newlib_unbuf_stream_opt+set}" != set; then |
---|
199 | case "${enableval}" in |
---|
200 | yes) newlib_unbuf_stream_opt=yes ;; |
---|
201 | no) newlib_unbuf_stream_opt=no ;; |
---|
202 | *) AC_MSG_ERROR(bad value ${enableval} for newlib-unbuf-stream-opt option) ;; |
---|
203 | esac |
---|
204 | fi], [newlib_unbuf_stream_opt=yes])dnl |
---|
205 | |
---|
206 | dnl Support --enable-lite-exit |
---|
207 | dnl Lite exit is a size-reduced implementation of exit that doesn't invoke |
---|
208 | dnl clean-up functions such as _fini or global destructors. |
---|
209 | AC_ARG_ENABLE(lite-exit, |
---|
210 | [ --enable-lite-exit enable light weight exit], |
---|
211 | [if test "${lite_exit+set}" != set; then |
---|
212 | case "${enableval}" in |
---|
213 | yes) lite_exit=yes ;; |
---|
214 | no) lite_exit=no ;; |
---|
215 | *) AC_MSG_ERROR(bad value ${enableval} for lite-exit option) ;; |
---|
216 | esac |
---|
217 | fi], [lite_exit=no])dnl |
---|
218 | |
---|
219 | dnl Support --enable-newlib-nano-formatted-io |
---|
220 | dnl This option is also read in libc/configure.in. It is repeated |
---|
221 | dnl here so that it shows up in the help text. |
---|
222 | AC_ARG_ENABLE(newlib_nano_formatted_io, |
---|
223 | [ --enable-newlib-nano-formatted-io Use nano version formatted IO], |
---|
224 | [case "${enableval}" in |
---|
225 | yes) newlib_nano_formatted_io=yes ;; |
---|
226 | no) newlib_nano_formatted_io=no ;; |
---|
227 | *) AC_MSG_ERROR(bad value ${enableval} for newlib-nano-formatted-io) ;; |
---|
228 | esac],[newlib_nano_formatted_io=no]) |
---|
229 | |
---|
230 | dnl Support --enable-retargetable-locking |
---|
231 | dnl This option is also read in libc/configure.in. It is repeated |
---|
232 | dnl here so that it shows up in the help text. |
---|
233 | AC_ARG_ENABLE(newlib-retargetable-locking, |
---|
234 | [ --enable-newlib-retargetable-locking Allow locking routines to be retargeted at link time], |
---|
235 | [case "${enableval}" in |
---|
236 | yes) newlib_retargetable_locking=yes ;; |
---|
237 | no) newlib_retargetable_locking=no ;; |
---|
238 | *) AC_MSG_ERROR(bad value ${enableval} for newlib-retargetable-locking) ;; |
---|
239 | esac],[newlib_retargetable_locking=no]) |
---|
240 | |
---|
241 | dnl Support --enable-newlib-long-time_t |
---|
242 | AC_ARG_ENABLE(newlib-long-time_t, |
---|
243 | [ --enable-newlib-long-time_t define time_t to long], |
---|
244 | [if test "${newlib_long_time_t+set}" != set; then |
---|
245 | case "${enableval}" in |
---|
246 | yes) newlib_long_time_t=yes ;; |
---|
247 | no) newlib_long_time_t=no ;; |
---|
248 | *) AC_MSG_ERROR(bad value ${enableval} for newlib-long-time_t option) ;; |
---|
249 | esac |
---|
250 | fi], [newlib_long_time_t=no])dnl |
---|
251 | |
---|
252 | NEWLIB_CONFIGURE(.) |
---|
253 | |
---|
254 | dnl We have to enable libtool after NEWLIB_CONFIGURE because if we try and |
---|
255 | dnl add it into NEWLIB_CONFIGURE, executable tests are made before the first |
---|
256 | dnl line of the macro which fail because appropriate LDFLAGS are not set. |
---|
257 | _LT_DECL_SED |
---|
258 | _LT_PROG_ECHO_BACKSLASH |
---|
259 | AC_PROG_AWK |
---|
260 | if test "${use_libtool}" = "yes"; then |
---|
261 | AC_LIBTOOL_WIN32_DLL |
---|
262 | AM_PROG_LIBTOOL |
---|
263 | fi |
---|
264 | |
---|
265 | dnl The following is being disabled because the mathfp library is |
---|
266 | dnl not up to standard due to inaccuracies caused by some of the |
---|
267 | dnl floating-point algorithms used. If you wish to work on this, |
---|
268 | dnl comment out the following line and uncomment out the lines |
---|
269 | dnl following it to re-enable the feature. |
---|
270 | newlib_hw_fp=false |
---|
271 | #AC_ARG_ENABLE(newlib_hw_fp, |
---|
272 | #[ --enable-newlib-hw-fp Turn on hardware floating point math], |
---|
273 | #[case "${enableval}" in |
---|
274 | # yes) newlib_hw_fp=true ;; |
---|
275 | # no) newlib_hw_fp=false ;; |
---|
276 | # *) AC_MSG_ERROR(bad value ${enableval} for --enable-newlib-hw-fp) ;; |
---|
277 | # esac],[newlib_hw_fp=false]) |
---|
278 | AM_CONDITIONAL(NEWLIB_HW_FP, test x$newlib_hw_fp = xtrue) |
---|
279 | |
---|
280 | # These get added in the top-level configure.in, except in the case where |
---|
281 | # newlib is being built natively. |
---|
282 | LIBC_INCLUDE_GREP=`echo ${CC} | grep \/libc\/include` |
---|
283 | abs_newlib_basedir=`cd ${newlib_basedir} && pwd` |
---|
284 | if test -z "${LIBC_INCLUDE_GREP}"; then |
---|
285 | CC_FOR_NEWLIB="${CC} -I$PWD/targ-include -I${abs_newlib_basedir}/libc/include" |
---|
286 | else |
---|
287 | CC_FOR_NEWLIB="${CC}" |
---|
288 | fi |
---|
289 | AC_SUBST(CC_FOR_NEWLIB) |
---|
290 | |
---|
291 | AC_CONFIG_SUBDIRS(libc) |
---|
292 | AC_CONFIG_SUBDIRS(libm) |
---|
293 | |
---|
294 | if test -z "${with_multisubdir}"; then |
---|
295 | have_multisubdir=no |
---|
296 | AC_CONFIG_SUBDIRS(doc) |
---|
297 | else |
---|
298 | have_multisubdir=yes |
---|
299 | fi |
---|
300 | AM_CONDITIONAL(HAVE_DOC, test x$have_multisubdir = xno) |
---|
301 | |
---|
302 | # Some run-time support libraries provided by GCC (e.g. libgomp) use configure |
---|
303 | # checks to detect certain features, e.g. availability of thread-local storage. |
---|
304 | # The configure script generates a test program and tries to compile and link |
---|
305 | # it. It should use target libraries and startfiles of the build tree if |
---|
306 | # available and not random ones from the installation prefix for this |
---|
307 | # procedure. The search directories specified by -B are a bit special, see |
---|
308 | # for_each_path() in gcc.c of the GCC sources. First a search is performed on |
---|
309 | # all search paths with the multilib directory appended (if desired), then a |
---|
310 | # second search is performed on demand with the base directory only. For each |
---|
311 | # multilib there is a "newlib" subdirectory. This directory is specified by a |
---|
312 | # -B option for the support libraries. In order to find the newlib artifacts |
---|
313 | # (ctr0.o, libc.a, libg.a and libm.a) they must be located in a proper multilib |
---|
314 | # subdirectory withing the build directory. |
---|
315 | AM_CONDITIONAL(HAVE_MULTISUBDIR, test x$have_multisubdir = xyes) |
---|
316 | |
---|
317 | EXTRA_DIRS= |
---|
318 | case $host in |
---|
319 | i[[34567]]86-pc-linux-*) |
---|
320 | AC_CONFIG_SUBDIRS(iconvdata) |
---|
321 | EXTRA_DIRS=iconvdata |
---|
322 | ;; |
---|
323 | esac |
---|
324 | AC_SUBST(EXTRA_DIRS) |
---|
325 | |
---|
326 | CRT0= |
---|
327 | CRT0_DIR= |
---|
328 | if test "x${have_crt0}" = "xyes"; then |
---|
329 | CRT0=crt0.o |
---|
330 | CRT0_DIR=libc/ |
---|
331 | fi |
---|
332 | AM_CONDITIONAL(HAVE_CRT0, test x$have_crt0 = xyes) |
---|
333 | AC_SUBST(CRT0) |
---|
334 | AC_SUBST(CRT0_DIR) |
---|
335 | |
---|
336 | CRT1=${crt1} |
---|
337 | CRT1_DIR= |
---|
338 | if test -n "${crt1_dir}"; then |
---|
339 | CRT1_DIR=${crt1_dir}/ |
---|
340 | fi |
---|
341 | AC_SUBST(CRT1) |
---|
342 | AC_SUBST(CRT1_DIR) |
---|
343 | |
---|
344 | if test -n "${libm_machine_dir}"; then |
---|
345 | LIBM_MACHINE_OBJECTLIST=libm/machine/${libm_machine_dir}/objectlist.awk.in |
---|
346 | fi |
---|
347 | AC_SUBST(LIBM_MACHINE_OBJECTLIST) |
---|
348 | |
---|
349 | if test -n "${machine_dir}"; then |
---|
350 | MACHINE_OBJECTLIST=libc/machine/${machine_dir}/objectlist.awk.in |
---|
351 | fi |
---|
352 | AC_SUBST(MACHINE_OBJECTLIST) |
---|
353 | |
---|
354 | if test -n "${sys_dir}"; then |
---|
355 | SYS_OBJECTLIST=libc/sys/${sys_dir}/objectlist.awk.in |
---|
356 | fi |
---|
357 | AC_SUBST(SYS_OBJECTLIST) |
---|
358 | |
---|
359 | if test "${have_sys_mach_dir}" = "yes"; then |
---|
360 | SYS_MACH_OBJECTLIST=libc/sys/${sys_dir}/machine/${machine_dir}/objectlist.awk.in |
---|
361 | fi |
---|
362 | AC_SUBST(SYS_MACH_OBJECTLIST) |
---|
363 | |
---|
364 | if test -n "${posix_dir}"; then |
---|
365 | POSIX_OBJECTLIST=libc/${posix_dir}/objectlist.awk.in |
---|
366 | fi |
---|
367 | AC_SUBST(POSIX_OBJECTLIST) |
---|
368 | |
---|
369 | if test -n "${signal_dir}"; then |
---|
370 | SIGNAL_OBJECTLIST=libc/${signal_dir}/objectlist.awk.in |
---|
371 | fi |
---|
372 | AC_SUBST(SIGNAL_OBJECTLIST) |
---|
373 | |
---|
374 | if test -n "${syscall_dir}"; then |
---|
375 | SYSCALL_OBJECTLIST=libc/${syscall_dir}/objectlist.awk.in |
---|
376 | fi |
---|
377 | AC_SUBST(SYSCALL_OBJECTLIST) |
---|
378 | |
---|
379 | if test -n "${unix_dir}"; then |
---|
380 | UNIX_OBJECTLIST=libc/${unix_dir}/objectlist.awk.in |
---|
381 | fi |
---|
382 | AC_SUBST(UNIX_OBJECTLIST) |
---|
383 | |
---|
384 | if test -n "${stdio64_dir}"; then |
---|
385 | STDIO64_OBJECTLIST=libc/${stdio64_dir}/objectlist.awk.in |
---|
386 | fi |
---|
387 | AC_SUBST(STDIO64_OBJECTLIST) |
---|
388 | |
---|
389 | # Put a plausible default for CC_FOR_BUILD in Makefile. |
---|
390 | if test -z "$CC_FOR_BUILD"; then |
---|
391 | CC_FOR_BUILD=gcc |
---|
392 | fi |
---|
393 | AC_SUBST(CC_FOR_BUILD) |
---|
394 | |
---|
395 | if test "${newlib_elix_level}" -gt "0"; then |
---|
396 | AC_DEFINE_UNQUOTED(_ELIX_LEVEL,${newlib_elix_level}) |
---|
397 | fi |
---|
398 | |
---|
399 | if test "${newlib_io_c99_formats}" = "yes"; then |
---|
400 | AC_DEFINE_UNQUOTED(_WANT_IO_C99_FORMATS) |
---|
401 | fi |
---|
402 | |
---|
403 | if test "${newlib_register_fini}" = "yes"; then |
---|
404 | AC_DEFINE_UNQUOTED(_WANT_REGISTER_FINI) |
---|
405 | fi |
---|
406 | |
---|
407 | if test "${newlib_io_long_long}" = "yes"; then |
---|
408 | AC_DEFINE_UNQUOTED(_WANT_IO_LONG_LONG) |
---|
409 | fi |
---|
410 | |
---|
411 | if test "${newlib_io_long_double}" = "yes"; then |
---|
412 | AC_DEFINE_UNQUOTED(_WANT_IO_LONG_DOUBLE) |
---|
413 | fi |
---|
414 | |
---|
415 | if test "${newlib_io_pos_args}" = "yes"; then |
---|
416 | AC_DEFINE_UNQUOTED(_WANT_IO_POS_ARGS) |
---|
417 | fi |
---|
418 | |
---|
419 | if test "${newlib_reent_small}" = "yes"; then |
---|
420 | AC_DEFINE_UNQUOTED(_WANT_REENT_SMALL) |
---|
421 | fi |
---|
422 | |
---|
423 | if test "${newlib_global_stdio_streams}" = "yes"; then |
---|
424 | AC_DEFINE_UNQUOTED(_WANT_REENT_GLOBAL_STDIO_STREAMS) |
---|
425 | fi |
---|
426 | |
---|
427 | if test "${newlib_mb}" = "yes"; then |
---|
428 | AC_DEFINE_UNQUOTED(_MB_CAPABLE) |
---|
429 | AC_DEFINE_UNQUOTED(_MB_LEN_MAX,8) |
---|
430 | else |
---|
431 | AC_DEFINE_UNQUOTED(_MB_LEN_MAX,1) |
---|
432 | fi |
---|
433 | |
---|
434 | if test "${newlib_iconv_external_ccs}" = "yes"; then |
---|
435 | AC_DEFINE_UNQUOTED(_ICONV_ENABLE_EXTERNAL_CCS) |
---|
436 | fi |
---|
437 | |
---|
438 | AC_DEFINE(_NEWLIB_VERSION,"NEWLIB_VERSION","The newlib version in string format.") |
---|
439 | AC_DEFINE(__NEWLIB__,NEWLIB_MAJOR_VERSION,"The newlib major version number.") |
---|
440 | AC_DEFINE(__NEWLIB_MINOR__,NEWLIB_MINOR_VERSION,"The newlib minor version number.") |
---|
441 | AC_DEFINE(__NEWLIB_PATCHLEVEL__,NEWLIB_PATCHLEVEL_VERSION,"The newlib patch level.") |
---|
442 | |
---|
443 | if test "${multilib}" = "yes"; then |
---|
444 | multilib_arg="--enable-multilib" |
---|
445 | else |
---|
446 | multilib_arg= |
---|
447 | fi |
---|
448 | |
---|
449 | if test "${newlib_iconv}" = "yes"; then |
---|
450 | AC_DEFINE_UNQUOTED(_ICONV_ENABLED,1) |
---|
451 | fi |
---|
452 | |
---|
453 | if test "x${newlib_iconv_external_ccs}" = "xyes"; then |
---|
454 | if test "x${newlib_iconv}" = "x"; then |
---|
455 | AC_MSG_ERROR(--enable-newlib-iconv-external-ccs option can't be used if iconv library is disabled, use --enable-newlib-iconv to enable it.) |
---|
456 | fi |
---|
457 | AC_DEFINE_UNQUOTED(_ICONV_ENABLE_EXTERNAL_CCS,1) |
---|
458 | fi |
---|
459 | |
---|
460 | if test "${newlib_atexit_dynamic_alloc}" = "yes"; then |
---|
461 | AC_DEFINE_UNQUOTED(_ATEXIT_DYNAMIC_ALLOC) |
---|
462 | fi |
---|
463 | |
---|
464 | if test "${newlib_global_atexit}" = "yes"; then |
---|
465 | AC_DEFINE_UNQUOTED(_REENT_GLOBAL_ATEXIT) |
---|
466 | fi |
---|
467 | |
---|
468 | if test "${newlib_fvwrite_in_streamio}" = "yes"; then |
---|
469 | AC_DEFINE_UNQUOTED(_FVWRITE_IN_STREAMIO) |
---|
470 | fi |
---|
471 | |
---|
472 | if test "${newlib_fseek_optimization}" = "yes"; then |
---|
473 | AC_DEFINE_UNQUOTED(_FSEEK_OPTIMIZATION) |
---|
474 | fi |
---|
475 | |
---|
476 | if test "${newlib_wide_orient}" = "yes"; then |
---|
477 | AC_DEFINE_UNQUOTED(_WIDE_ORIENT) |
---|
478 | fi |
---|
479 | |
---|
480 | if test "${newlib_nano_malloc}" = "yes"; then |
---|
481 | AC_DEFINE_UNQUOTED(_NANO_MALLOC) |
---|
482 | fi |
---|
483 | |
---|
484 | if test "${newlib_unbuf_stream_opt}" = "yes"; then |
---|
485 | AC_DEFINE_UNQUOTED(_UNBUF_STREAM_OPT) |
---|
486 | fi |
---|
487 | |
---|
488 | if test "${lite_exit}" = "yes"; then |
---|
489 | AC_DEFINE_UNQUOTED(_LITE_EXIT) |
---|
490 | fi |
---|
491 | |
---|
492 | if test "${newlib_nano_formatted_io}" = "yes"; then |
---|
493 | AC_DEFINE_UNQUOTED(_NANO_FORMATTED_IO) |
---|
494 | fi |
---|
495 | |
---|
496 | if test "${newlib_retargetable_locking}" = "yes"; then |
---|
497 | AC_DEFINE_UNQUOTED(_RETARGETABLE_LOCKING) |
---|
498 | fi |
---|
499 | |
---|
500 | if test "${newlib_long_time_t}" = "yes"; then |
---|
501 | AC_DEFINE_UNQUOTED(_WANT_USE_LONG_TIME_T) |
---|
502 | fi |
---|
503 | |
---|
504 | dnl |
---|
505 | dnl Parse --enable-newlib-iconv-encodings option argument |
---|
506 | dnl |
---|
507 | |
---|
508 | if test "x${iconv_encodings}" != "x" \ |
---|
509 | || test "x${iconv_to_encodings}" != "x" \ |
---|
510 | || test "x${iconv_from_encodings}" != "x"; then |
---|
511 | if test "x${newlib_iconv}" = "x"; then |
---|
512 | AC_MSG_ERROR([--enable-newlib-iconv-encodings, --enable-newlib-iconv-from-encodings and --enable-newlib-iconv-to-encodings option can't be used if iconv library is disabled, use --enable-newlib-iconv to enable it.]) |
---|
513 | fi |
---|
514 | |
---|
515 | dnl Normalize encodings names and delete commas |
---|
516 | iconv_encodings=`echo "${iconv_encodings}" | sed -e 's/,/ /g' -e 's/-/_/g' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'` |
---|
517 | iconv_to_encodings=`echo "${iconv_to_encodings}" | sed -e 's/,/ /g' -e 's/-/_/g' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'` |
---|
518 | iconv_from_encodings=`echo "${iconv_from_encodings}" | sed -e 's/,/ /g' -e 's/-/_/g' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'` |
---|
519 | |
---|
520 | dnl Get the list of available encodings excluding comments |
---|
521 | dnl Join line with previous if the first character is whitespace |
---|
522 | available_encodings=`cat "${srcdir}/libc/iconv/encoding.aliases" | sed -e '/^#.*/d'` |
---|
523 | |
---|
524 | dnl Check if required encodings are supported |
---|
525 | dnl Convert aliases to names |
---|
526 | |
---|
527 | dnl iconv_encodings |
---|
528 | iconv_encodings1="${iconv_encodings}" |
---|
529 | iconv_encodings="" |
---|
530 | for encoding in ${iconv_encodings1}; do |
---|
531 | result=`echo "${available_encodings}" | grep -e "\(^\| \)${encoding}\( \|\$\)"` |
---|
532 | if test $? != "0"; then |
---|
533 | AC_MSG_ERROR(${encoding} is not supported - see ${srcdir}/libc/iconv/encoding.aliases file for the list of available encodings) |
---|
534 | fi |
---|
535 | encoding1=`echo "${result}" | sed -e 's/\(^[[^ ]]*\).*$/\1/'` |
---|
536 | iconv_encodings="${iconv_encodings} ${encoding1}" |
---|
537 | done |
---|
538 | dnl Enable appropriate option in newlib.h |
---|
539 | for encoding in ${iconv_encodings}; do |
---|
540 | opt=_ICONV_TO_ENCODING_`echo "${encoding}" | sed -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` |
---|
541 | AC_DEFINE_UNQUOTED($opt,1) |
---|
542 | opt=_ICONV_FROM_ENCODING_`echo "${encoding}" | sed -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` |
---|
543 | AC_DEFINE_UNQUOTED($opt,1) |
---|
544 | done |
---|
545 | |
---|
546 | dnl iconv_to_encodings |
---|
547 | iconv_encodings1="${iconv_to_encodings}" |
---|
548 | iconv_to_encodings="" |
---|
549 | for encoding in ${iconv_encodings1}; do |
---|
550 | result=`echo "${available_encodings}" | grep -e "\(^\| \)${encoding}\( \|\$\)"` |
---|
551 | if test $? != "0"; then |
---|
552 | AC_MSG_ERROR(${encoding} is not supported - see ${srcdir}/libc/iconv/encoding.aliases file for the list of available encodings) |
---|
553 | fi |
---|
554 | encoding1=`echo "${result}" | sed -e 's/\(^[[^ ]]*\).*$/\1/'` |
---|
555 | iconv_to_encodings="${iconv_to_encodings} ${encoding1}" |
---|
556 | done |
---|
557 | dnl Enable appropriate option in newlib.h |
---|
558 | for encoding in ${iconv_to_encodings}; do |
---|
559 | opt=_ICONV_TO_ENCODING_`echo "${encoding}" | sed -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` |
---|
560 | AC_DEFINE_UNQUOTED($opt,1) |
---|
561 | done |
---|
562 | |
---|
563 | dnl iconv_from_encodings |
---|
564 | iconv_encodings1="${iconv_from_encodings}" |
---|
565 | iconv_from_encodings="" |
---|
566 | for encoding in ${iconv_encodings1}; do |
---|
567 | result=`echo "${available_encodings}" | grep -e "\(^\| \)${encoding}\( \|\$\)"` |
---|
568 | if test $? != "0"; then |
---|
569 | AC_MSG_ERROR(${encoding} is not supported - see ${srcdir}/libc/iconv/encoding.aliases file for the list of available encodings) |
---|
570 | fi |
---|
571 | encoding1=`echo "${result}" | sed -e 's/\(^[[^ ]]*\).*$/\1/'` |
---|
572 | iconv_from_encodings="${iconv_from_encodings} ${encoding1}" |
---|
573 | done |
---|
574 | dnl Enable appropriate option in newlib.h |
---|
575 | for encoding in ${iconv_from_encodings}; do |
---|
576 | opt=_ICONV_FROM_ENCODING_`echo "${encoding}" | sed -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` |
---|
577 | AC_DEFINE_UNQUOTED($opt,1) |
---|
578 | done |
---|
579 | fi; |
---|
580 | |
---|
581 | AC_CACHE_CHECK(for .preinit_array/.init_array/.fini_array support, |
---|
582 | libc_cv_initfinit_array, [dnl |
---|
583 | cat > conftest.c <<EOF |
---|
584 | int _start (void) { return 0; } |
---|
585 | int __start (void) { return 0; } |
---|
586 | int foo (void) { return 1; } |
---|
587 | int (*fp) (void) __attribute__ ((section (".init_array"))) = foo; |
---|
588 | EOF |
---|
589 | if AC_TRY_COMMAND([${CC} $CFLAGS $CPPFLAGS -c -o conftest conftest.c |
---|
590 | 1>&AS_MESSAGE_LOG_FD]) |
---|
591 | then |
---|
592 | if ${READELF} -S conftest | grep -e INIT_ARRAY > /dev/null; then |
---|
593 | libc_cv_initfinit_array=yes |
---|
594 | else |
---|
595 | libc_cv_initfinit_array=no |
---|
596 | fi |
---|
597 | else |
---|
598 | libc_cv_initfinit_array=no |
---|
599 | fi |
---|
600 | rm -f conftest*]) |
---|
601 | AC_SUBST(libc_cv_initfinit_array) |
---|
602 | if test $libc_cv_initfinit_array = yes; then |
---|
603 | AC_DEFINE_UNQUOTED(HAVE_INITFINI_ARRAY) |
---|
604 | fi |
---|
605 | |
---|
606 | AC_CACHE_CHECK(if $CC accepts -fno-tree-loop-distribute-patterns with \ |
---|
607 | __attribute__ ((__optimize__)), libc_cv_cc_loop_to_function, [dnl |
---|
608 | cat > conftest.c <<EOF |
---|
609 | void |
---|
610 | __attribute__ ((__optimize__ ("-fno-tree-loop-distribute-patterns"))) |
---|
611 | foo (void) {} |
---|
612 | EOF |
---|
613 | libc_cv_cc_loop_to_function=no |
---|
614 | if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS -c |
---|
615 | -fno-tree-loop-distribute-patterns conftest.c]) |
---|
616 | then |
---|
617 | libc_cv_cc_loop_to_function=yes |
---|
618 | fi |
---|
619 | rm -f conftest*]) |
---|
620 | if test $libc_cv_cc_loop_to_function = yes; then |
---|
621 | AC_DEFINE(_HAVE_CC_INHIBIT_LOOP_TO_LIBCALL) |
---|
622 | fi |
---|
623 | AC_SUBST(libc_cv_cc_loop_to_function) |
---|
624 | |
---|
625 | dnl Autoconf 2.59 doesn't support the AC_TYPE_LONG_DOUBLE macro. Instead of: |
---|
626 | dnl AC_TYPE_LONG_DOUBLE |
---|
627 | dnl AM_CONDITIONAL(HAVE_LONG_DOUBLE, test x"$ac_cv_type_long_double" = x"yes") |
---|
628 | dnl we specify our own long double test. |
---|
629 | dnl Additionally, ac_cv_objext is broken so that AC_COMPILE_IFELSE cannot be |
---|
630 | dnl used, so use AC_TRY_COMMAND instead. |
---|
631 | AC_CACHE_CHECK(whether long double type exists, |
---|
632 | acnewlib_cv_type_long_double, [dnl |
---|
633 | cat > conftest.c <<EOF |
---|
634 | /* Check two ways: float.h defines and direct type declaration. */ |
---|
635 | #include <float.h> |
---|
636 | #if defined(LDBL_MANT_DIG) |
---|
637 | #define _HAVE_LONG_DOUBLE |
---|
638 | #else |
---|
639 | #error "LDBL != DBL" |
---|
640 | #endif |
---|
641 | long double test() { |
---|
642 | long double ld = 0.0L; |
---|
643 | return ld; |
---|
644 | } |
---|
645 | EOF |
---|
646 | if AC_TRY_COMMAND([${CC} $CFLAGS $CPPFLAGS -c -o conftest.o conftest.c |
---|
647 | 1>&AS_MESSAGE_LOG_FD]) |
---|
648 | then |
---|
649 | acnewlib_cv_type_long_double=yes; |
---|
650 | else |
---|
651 | acnewlib_cv_type_long_double=no; |
---|
652 | fi |
---|
653 | rm -f conftest*]) |
---|
654 | if test $acnewlib_cv_type_long_double = yes; then |
---|
655 | AC_DEFINE_UNQUOTED(_HAVE_LONG_DOUBLE) |
---|
656 | fi |
---|
657 | AM_CONDITIONAL(HAVE_LONG_DOUBLE, test x"$acnewlib_cv_type_long_double" = x"yes") |
---|
658 | |
---|
659 | AC_CACHE_CHECK(whether long double equals double, |
---|
660 | newlib_cv_ldbl_eq_dbl, [dnl |
---|
661 | cat > conftest.c <<EOF |
---|
662 | #include <float.h> |
---|
663 | #if DBL_MANT_DIG == LDBL_MANT_DIG && LDBL_MIN_EXP == DBL_MIN_EXP && \ |
---|
664 | LDBL_MAX_EXP == DBL_MAX_EXP |
---|
665 | #define _LDBL_EQ_DBL |
---|
666 | #else |
---|
667 | #error "LDBL != DBL" |
---|
668 | #endif |
---|
669 | EOF |
---|
670 | if AC_TRY_COMMAND([${CC} $CFLAGS $CPPFLAGS -c -o conftest.o conftest.c |
---|
671 | 1>&AS_MESSAGE_LOG_FD]) |
---|
672 | then |
---|
673 | newlib_cv_ldbl_eq_dbl=yes; |
---|
674 | else |
---|
675 | newlib_cv_ldbl_eq_dbl=no; |
---|
676 | fi |
---|
677 | rm -f conftest*]) |
---|
678 | if test $newlib_cv_ldbl_eq_dbl = yes; then |
---|
679 | AC_DEFINE_UNQUOTED(_LDBL_EQ_DBL) |
---|
680 | fi |
---|
681 | |
---|
682 | AC_SUBST(CFLAGS) |
---|
683 | |
---|
684 | AC_CONFIG_FILES([Makefile], |
---|
685 | [if test -n "$CONFIG_FILES"; then |
---|
686 | unset ac_file |
---|
687 | . ${newlib_basedir}/../config-ml.in |
---|
688 | fi], |
---|
689 | srcdir=${srcdir} |
---|
690 | host=${host} |
---|
691 | with_multisubdir=${with_multisubdir} |
---|
692 | ac_configure_args="${multilib_arg} ${ac_configure_args}" |
---|
693 | CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} |
---|
694 | newlib_basedir=${newlib_basedir} |
---|
695 | CC="${CC}" |
---|
696 | LDFLAGS="${LDFLAGS}" |
---|
697 | ) |
---|
698 | AC_OUTPUT |
---|