1 dnl Copyright © 1997-2016, The AROS Development Team. All rights reserved.
4 dnl Desc: Autoconf source for target compiler feature detection
7 # Note: After file changes, generate features anew and commit _both_ files.
8 -------------------------
12 AC_CONFIG_AUX_DIR(../scripts/autoconf)
14 AROS_BUILDDIR=`${PWDCMD-pwd}`
15 AROS_BUILDDIR_UNIX=${PWD}
17 srcpwd=`cd ${srcdir} ; ${PWDCMD-pwd}`
20 NOLINKFLAGS="-nostdlib -nostartfiles"
22 # The first step is to find the binaries.
25 AC_MSG_CHECKING([target config location])
26 AC_ARG_WITH(config-dir,AC_HELP_STRING([--with-config-dir=VERSION],[Location of generated target config files]),targetcfg_dir="$withval",targetcfg_dir="")
27 if test "$targetcfg_dir" = ""; then
28 AC_MSG_ERROR([missing config directory!])
30 aros_targetcfg_dir="$targetcfg_dir"
32 AC_MSG_RESULT($aros_targetcfg_dir)
34 #-----------------------------------------------------------------------------
36 # Check if the target compiler supports some features:
50 AC_MSG_CHECKING([whether ${CC} accepts -fexceptions])
52 AC_TRY_COMPILE(,, aros_exceptions="yes", aros_exceptions="no")
53 AC_MSG_RESULT($aros_exceptions)
54 if test "x-$aros_exceptions" = "x-yes" ; then
55 aros_cflags_exceptions=-fexceptions
58 AC_MSG_CHECKING([whether ${CC} accepts -fpermissive])
60 AC_TRY_COMPILE(,, aros_permissive="yes", aros_permissive="no")
61 AC_MSG_RESULT($aros_permissive)
62 if test "x-$aros_permissive" = "x-yes" ; then
63 aros_cflags_permissive=-fpermissive
66 AC_MSG_CHECKING([whether ${CC} accepts -ffast-math])
68 AC_TRY_COMPILE(,, aros_fast_math="yes", aros_fast_math="no")
69 AC_MSG_RESULT($aros_fast_math)
70 if test "x-$aros_fast_math" = "x-yes" ; then
71 aros_cflags_fast_math=-ffast-math
74 AC_MSG_CHECKING([whether ${CC} accepts -fno-builtin-floor])
75 CFLAGS=-fno-builtin-floor
76 AC_TRY_COMPILE(,, aros_no_builtin_floor="yes", aros_no_builtin_floor="no")
77 AC_MSG_RESULT($aros_no_builtin_floor)
78 if test "x-$aros_no_builtin_floor" = "x-yes" ; then
79 aros_cflags_no_builtin_floor=-fno-builtin-floor
82 AC_MSG_CHECKING([whether ${CC} accepts -flto])
84 AC_TRY_COMPILE(,, aros_lto="yes", aros_lto="no")
85 AC_MSG_RESULT($aros_lto)
86 if test "x-$aros_lto" = "x-yes" ; then
88 aros_cflags_nolto=-fno-lto
90 AC_MSG_CHECKING([whether ${CC} accepts -fwhole-program])
91 CFLAGS=-fwhole-program
92 AC_TRY_COMPILE(,, aros_whole_program="yes", aros_whole_program="no")
93 AC_MSG_RESULT($aros_whole_program)
94 if test "x-$aros_whole_program" = "x-yes" ; then
95 aros_cflags_whole_program=-fwhole-program
98 AC_MSG_CHECKING([whether ${CC} accepts -floop-block])
100 AC_TRY_COMPILE(,, aros_loop_block="yes", aros_loop_block="no")
101 AC_MSG_RESULT($aros_loop_block)
102 if test "x-$aros_loop_block" = "x-yes" ; then
103 aros_cflags_loop_block=-floop-block
106 AC_MSG_CHECKING([whether ${CC} accepts -floop-interchange])
107 CFLAGS=-floop-interchange
108 AC_TRY_COMPILE(,, aros_loop_interchange="yes", aros_loop_interchange="no")
109 AC_MSG_RESULT($aros_loop_interchange)
110 if test "x-$aros_loop_interchange" = "x-yes" ; then
111 aros_cflags_loop_interchange=-floop-interchange
114 AC_MSG_CHECKING([whether ${CC} accepts -floop-strip-mine])
115 CFLAGS=-floop-strip-mine
116 AC_TRY_COMPILE(,, aros_loop_strip_mine="yes", aros_loop_strip_mine="no")
117 AC_MSG_RESULT($aros_loop_strip_mine)
118 if test "x-$aros_loop_strip_mine" = "x-yes" ; then
119 aros_cflags_loop_strip_mine=-floop-strip-mine
123 AC_MSG_CHECKING([whether ${CC} accepts -fpeel-loops])
125 AC_TRY_COMPILE(,, aros_peel_loops="yes", aros_peel_loops="no")
126 AC_MSG_RESULT($aros_peel_loops)
127 if test "x-$aros_peel_loops" = "x-yes" ; then
128 aros_cflags_peel_loops=-fpeel-loops
131 AC_MSG_CHECKING([whether ${CC} accepts -funroll-loops])
132 CFLAGS=-funroll-loops
133 AC_TRY_COMPILE(,, aros_unroll_loops="yes", aros_unroll_loops="no")
134 AC_MSG_RESULT($aros_unroll_loops)
135 if test "x-$aros_unroll_loops" = "x-yes" ; then
136 aros_cflags_unroll_loops=-funroll-loops
139 AC_MSG_CHECKING([whether ${CC} accepts -fstrict-aliasing])
140 CFLAGS=-fstrict-aliasing
141 AC_TRY_COMPILE(,, aros_strict_aliasing="yes", aros_strict_aliasing="no")
142 AC_MSG_RESULT($aros_strict_aliasing)
143 if test "x-$aros_strict_aliasing" = "x-yes" ; then
144 aros_cflags_strictaliasing=-fstrict-aliasing
145 aros_cflags_nostrictaliasing=-fno-strict-aliasing
148 AC_MSG_CHECKING([whether ${CC} accepts -iquote])
150 AC_TRY_COMPILE(,, has_iquote="yes", has_iquote="no")
151 AC_MSG_RESULT($has_iquote)
152 if test "x-$has_iquote" = "x-yes" ; then
153 aros_cflags_iquote=-iquote
154 aros_cflags_iquote_end=
156 aros_cflags_iquote=-I
157 aros_cflags_iquote_end=-I-
160 #-----------------------------------------------------------------------------
162 # Check if the target compiler supports some options:
165 AC_MSG_CHECKING([whether ${CC} accepts -mno-red-zone])
167 AC_TRY_COMPILE(,, aros_no_red_zone="yes", aros_no_red_zone="no")
168 AC_MSG_RESULT($aros_no_red_zone)
169 if test "x-$aros_no_red_zone" = "x-yes" ; then
170 aros_cflags_no_red_zone=-mno-red-zone
173 #-----------------------------------------------------------------------------
175 # Check if the target compiler supports some options used for de-linting:
177 # -Wunused-command-line-argument
178 # -Wunknown-warning-option
179 # -Wunused-but-set-variable
183 # -Wstrict-prototypes
186 # -Wmisleading-indentation
194 # -Wmaybe-uninitialized
195 # -Wimplicit-function-declaration
200 # -Wformat-contains-nul
202 # -Waggressive-loop-optimizations
205 # -Wdiscarded-qualifiers
208 # -Wdiscarded-array-qualifiers
210 # -Wint-to-pointer-cast
211 # -Wpointer-to-int-cast
212 # -Wunused-const-variable
215 # -Wincompatible-pointer-types
217 # -Wlogical-not-parentheses
221 # -Wdeprecated-declarations
225 # -Wunused-local-typedefs
229 # -Wvolatile-register-var
230 # -Wsizeof-pointer-memaccess
232 # -Wformat-zero-length
233 # -Wlto-type-mismatch
234 # -Wtautological-compare
236 AC_MSG_CHECKING([whether ${CC} accepts -Werror])
238 AC_TRY_COMPILE(,, aros_error="yes", aros_error="no")
239 AC_MSG_RESULT($aros_error)
240 if test "x-$aros_error" = "x-yes" ; then
241 aros_warnflags_error=-Werror
242 aros_nowarnflags_error=-Wno-error
245 AC_MSG_CHECKING([whether ${CC} accepts -Wunused-command-line-argument])
246 CFLAGS=-Wunused-command-line-argument
247 AC_TRY_COMPILE(,, aros_unused_command_line_argument="yes", aros_unused_command_line_argument="no")
248 AC_MSG_RESULT($aros_unused_command_line_argument)
249 if test "x-$aros_unused_command_line_argument" = "x-yes" ; then
250 aros_warnflags_unused_command_line_argument=-Wunused-command-line-argument
251 aros_nowarnflags_unused_command_line_argument=-Wno-unused-command-line-argument
254 AC_MSG_CHECKING([whether ${CC} accepts -Wunknown-warning-option])
255 CFLAGS=-Wunknown-warning-option
256 AC_TRY_COMPILE(,, aros_unknown_warning_option="yes", aros_unknown_warning_option="no")
257 AC_MSG_RESULT($aros_unknown_warning_option)
258 if test "x-$aros_unknown_warning_option" = "x-yes" ; then
259 aros_warnflags_unknown_warning_option=-Wunknown-warning-option
260 aros_nowarnflags_unknown_warning_option=-Wno-unknown-warning-option
263 AC_MSG_CHECKING([whether ${CC} accepts -Wunused-but-set-variable])
264 CFLAGS=-Wunused-but-set-variable
265 AC_TRY_COMPILE(,, aros_unused_but_set_variable="yes", aros_unused_but_set_variable="no")
266 AC_MSG_RESULT($aros_unused_but_set_variable)
267 if test "x-$aros_unused_but_set_variable" = "x-yes" ; then
268 aros_warnflags_unused_but_set_variable=-Wunused-but-set-variable
269 aros_nowarnflags_unused_but_set_variable=-Wno-unused-but-set-variable
272 AC_MSG_CHECKING([whether ${CC} accepts -Wstrict-aliasing])
273 CFLAGS=-Wstrict-aliasing
274 AC_TRY_COMPILE(,, aros_strict_aliasing="yes", aros_strict_aliasing="no")
275 AC_MSG_RESULT($aros_strict_aliasing)
276 if test "x-$aros_strict_aliasing" = "x-yes" ; then
277 aros_warnflags_strict_aliasing=-Wstrict-aliasing
278 aros_nowarnflags_strict_aliasing=-Wno-strict-aliasing
281 AC_MSG_CHECKING([whether ${CC} accepts -Warray-bounds])
282 CFLAGS=-Warray-bounds
283 AC_TRY_COMPILE(,, aros_array_bounds="yes", aros_array_bounds="no")
284 AC_MSG_RESULT($aros_array_bounds)
285 if test "x-$aros_array_bounds" = "x-yes" ; then
286 aros_warnflags_array_bounds=-Warray-bounds
287 aros_nowarnflags_array_bounds=-Wno-array-bounds
290 AC_MSG_CHECKING([whether ${CC} accepts -Wenum-compare])
291 CFLAGS=-Wenum-compare
292 AC_TRY_COMPILE(,, aros_enum_compare="yes", aros_enum_compare="no")
293 AC_MSG_RESULT($aros_enum_compare)
294 if test "x-$aros_enum_compare" = "x-yes" ; then
295 aros_warnflags_enum_compare=-Wenum-compare
296 aros_nowarnflags_enum_compare=-Wno-enum-compare
299 AC_MSG_CHECKING([whether ${CC} accepts -Wstrict-prototypes])
300 CFLAGS=-Wstrict-prototypes
301 AC_TRY_COMPILE(,, aros_strict_prototypes="yes", aros_strict_prototypes="no")
302 AC_MSG_RESULT($aros_strict_prototypes)
303 if test "x-$aros_strict_prototypes" = "x-yes" ; then
304 aros_warnflags_strict_prototypes=-Wstrict-prototypes
305 aros_nowarnflags_strict_prototypes=-Wno-strict-prototypes
308 AC_MSG_CHECKING([whether ${CC} accepts -Wstrict-overflow])
309 CFLAGS=-Wstrict-overflow
310 AC_TRY_COMPILE(,, aros_strict_overflow="yes", aros_strict_overflow="no")
311 AC_MSG_RESULT($aros_strict_overflow)
312 if test "x-$aros_strict_overflow" = "x-yes" ; then
313 aros_warnflags_strict_overflow=-Wstrict-overflow
314 aros_nowarnflags_strict_overflow=-Wno-strict-overflow
317 AC_MSG_CHECKING([whether ${CC} accepts -Wformat-security])
318 CFLAGS=-Wformat-security
319 AC_TRY_COMPILE(,, aros_format_security="yes", aros_format_security="no")
320 AC_MSG_RESULT($aros_format_security)
321 if test "x-$aros_format_security" = "x-yes" ; then
322 aros_warnflags_format_security=-Wformat-security
323 aros_nowarnflags_format_security=-Wno-format-security
326 AC_MSG_CHECKING([whether ${CC} accepts -Wmisleading-indentation])
327 CFLAGS=-Wmisleading-indentation
328 AC_TRY_COMPILE(,, aros_misleading_indentation="yes", aros_misleading_indentation="no")
329 AC_MSG_RESULT($aros_misleading_indentation)
330 if test "x-$aros_misleading_indentation" = "x-yes" ; then
331 aros_warnflags_misleading_indentation=-Wmisleading-indentation
332 aros_nowarnflags_misleading_indentation=-Wno-misleading-indentation
335 AC_MSG_CHECKING([whether ${CC} accepts -Wnonnull-compare])
336 CFLAGS=-Wnonnull-compare
337 AC_TRY_COMPILE(,, aros_nonnull_compare="yes", aros_nonnull_compare="no")
338 AC_MSG_RESULT($aros_nonnull_compare)
339 if test "x-$aros_nonnull_compare" = "x-yes" ; then
340 aros_warnflags_nonnull_compare=-Wnonnull-compare
341 aros_nowarnflags_nonnull_compare=-Wno-nonnull-compare
344 AC_MSG_CHECKING([whether ${CC} accepts -Wunused])
346 AC_TRY_COMPILE(,, aros_unused="yes", aros_unused="no")
347 AC_MSG_RESULT($aros_unused)
348 if test "x-$aros_unused" = "x-yes" ; then
349 aros_warnflags_unused=-Wunused
350 aros_nowarnflags_unused=-Wno-unused
353 AC_MSG_CHECKING([whether ${CC} accepts -Wunused-value])
354 CFLAGS=-Wunused-value
355 AC_TRY_COMPILE(,, aros_unused_value="yes", aros_unused_value="no")
356 AC_MSG_RESULT($aros_unused_value)
357 if test "x-$aros_unused_value" = "x-yes" ; then
358 aros_warnflags_unused_value=-Wunused-value
359 aros_nowarnflags_unused_value=-Wno-unused-value
362 AC_MSG_CHECKING([whether ${CC} accepts -Wunused-variable])
363 CFLAGS=-Wunused-variable
364 AC_TRY_COMPILE(,, aros_unused_variable="yes", aros_unused_variable="no")
365 AC_MSG_RESULT($aros_unused_variable)
366 if test "x-$aros_unused_variable" = "x-yes" ; then
367 aros_warnflags_unused_variable=-Wunused-variable
368 aros_nowarnflags_unused_variable=-Wno-unused-variable
371 AC_MSG_CHECKING([whether ${CC} accepts -Wunused-function])
372 CFLAGS=-Wunused-function
373 AC_TRY_COMPILE(,, aros_unused_function="yes", aros_unused_function="no")
374 AC_MSG_RESULT($aros_unused_function)
375 if test "x-$aros_unused_function" = "x-yes" ; then
376 aros_warnflags_unused_function=-Wunused-function
377 aros_nowarnflags_unused_function=-Wno-unused-function
380 AC_MSG_CHECKING([whether ${CC} accepts -Wunused-parameter])
381 CFLAGS=-Wunused-parameter
382 AC_TRY_COMPILE(,, aros_unused_parameter="yes", aros_unused_parameter="no")
383 AC_MSG_RESULT($aros_unused_parameter)
384 if test "x-$aros_unused_parameter" = "x-yes" ; then
385 aros_warnflags_unused_parameter=-Wunused-parameter
386 aros_nowarnflags_unused_parameter=-Wno-unused-parameter
389 AC_MSG_CHECKING([whether ${CC} accepts -Wuninitialized])
390 CFLAGS=-Wuninitialized
391 AC_TRY_COMPILE(,, aros_uninitialized="yes", aros_uninitialized="no")
392 AC_MSG_RESULT($aros_uninitialized)
393 if test "x-$aros_uninitialized" = "x-yes" ; then
394 aros_warnflags_uninitialized=-Wuninitialized
395 aros_nowarnflags_uninitialized=-Wno-uninitialized
398 AC_MSG_CHECKING([whether ${CC} accepts -Wmaybe-uninitialized])
399 CFLAGS=-Wmaybe-uninitialized
400 AC_TRY_COMPILE(,, aros_maybe_uninitialized="yes", aros_maybe_uninitialized="no")
401 AC_MSG_RESULT($aros_maybe_uninitialized)
402 if test "x-$aros_maybe_uninitialized" = "x-yes" ; then
403 aros_warnflags_maybe_uninitialized=-Wmaybe-uninitialized
404 aros_nowarnflags_maybe_uninitialized=-Wno-maybe-uninitialized
406 aros_warnflags_maybe_uninitialized=$aros_warnflags_uninitialized
407 aros_nowarnflags_maybe_uninitialized=$aros_nowarnflags_uninitialized
410 AC_MSG_CHECKING([whether ${CC} accepts -Wimplicit-function-declaration])
411 CFLAGS=-Wimplicit-function-declaration
412 AC_TRY_COMPILE(,, aros_implicit_function_declaration="yes", aros_implicit_function_declaration="no")
413 AC_MSG_RESULT($aros_implicit_function_declaration)
414 if test "x-$aros_implicit_function_declaration" = "x-yes" ; then
415 aros_warnflags_implicit_function_declaration=-Wimplicit-function-declaration
416 aros_nowarnflags_implicit_function_declaration=-Wno-implicit-function-declaration
419 AC_MSG_CHECKING([whether ${CC} accepts -Wformat])
421 AC_TRY_COMPILE(,, aros_format="yes", aros_format="no")
422 AC_MSG_RESULT($aros_format)
423 if test "x-$aros_format" = "x-yes" ; then
424 aros_warnflags_format=-Wformat
425 aros_nowarnflags_format=-Wno-format
428 AC_MSG_CHECKING([whether ${CC} accepts -Wparentheses])
430 AC_TRY_COMPILE(,, aros_parentheses="yes", aros_parentheses="no")
431 AC_MSG_RESULT($aros_parentheses)
432 if test "x-$aros_parentheses" = "x-yes" ; then
433 aros_warnflags_parentheses=-Wparentheses
434 aros_nowarnflags_parentheses=-Wno-parentheses
437 AC_MSG_CHECKING([whether ${CC} accepts -Wchar-subscripts])
438 CFLAGS=-Wchar-subscripts
439 AC_TRY_COMPILE(,, aros_char_subscripts="yes", aros_char_subscripts="no")
440 AC_MSG_RESULT($aros_char_subscripts)
441 if test "x-$aros_char_subscripts" = "x-yes" ; then
442 aros_warnflags_char_subscripts=-Wchar-subscripts
443 aros_nowarnflags_char_subscripts=-Wno-char-subscripts
446 AC_MSG_CHECKING([whether ${CC} accepts -Wendif-labels])
447 CFLAGS=-Wendif-labels
448 AC_TRY_COMPILE(,, aros_endif_labels="yes", aros_endif_labels="no")
449 AC_MSG_RESULT($aros_endif_labels)
450 if test "x-$aros_endif_labels" = "x-yes" ; then
451 aros_warnflags_endif_labels=-Wendif-labels
452 aros_nowarnflags_endif_labels=-Wno-endif-labels
455 AC_MSG_CHECKING([whether ${CC} accepts -Wformat-contains-nul])
456 CFLAGS=-Wformat-contains-nul
457 AC_TRY_COMPILE(,, aros_format_contains_nul="yes", aros_format_contains_nul="no")
458 AC_MSG_RESULT($aros_format_contains_nul)
459 if test "x-$aros_format_contains_nul" = "x-yes" ; then
460 aros_warnflags_format_contains_nul=-Wformat-contains-nul
461 aros_nowarnflags_format_contains_nul=-Wno-format-contains-nul
464 AC_MSG_CHECKING([whether ${CC} accepts -Wimplicit-int])
465 CFLAGS=-Wimplicit-int
466 AC_TRY_COMPILE(,, aros_implicit_int="yes", aros_implicit_int="no")
467 AC_MSG_RESULT($aros_implicit_int)
468 if test "x-$aros_implicit_int" = "x-yes" ; then
469 aros_warnflags_implicit_int=-Wimplicit-int
470 aros_nowarnflags_implicit_int=-Wno-implicit-int
473 AC_MSG_CHECKING([whether ${CC} accepts -Waggressive-loop-optimizations])
474 CFLAGS=-Waggressive-loop-optimizations
475 AC_TRY_COMPILE(,, aros_aggressive_loop_optimizations="yes", aros_aggressive_loop_optimizations="no")
476 AC_MSG_RESULT($aros_aggressive_loop_optimizations)
477 if test "x-$aros_aggressive_loop_optimizations" = "x-yes" ; then
478 aros_warnflags_aggressive_loop_optimizations=-Waggressive-loop-optimizations
479 aros_nowarnflags_aggressive_loop_optimizations=-Wno-aggressive-loop-optimizations
482 AC_MSG_CHECKING([whether ${CC} accepts -Wcpp])
484 AC_TRY_COMPILE(,, aros_cpp="yes", aros_cpp="no")
485 AC_MSG_RESULT($aros_cpp)
486 if test "x-$aros_cpp" = "x-yes" ; then
487 aros_warnflags_cpp=-Wcpp
488 aros_nowarnflags_cpp=-Wno-cpp
491 AC_MSG_CHECKING([whether ${CC} accepts -Wswitch])
493 AC_TRY_COMPILE(,, aros_switch="yes", aros_switch="no")
494 AC_MSG_RESULT($aros_switch)
495 if test "x-$aros_switch" = "x-yes" ; then
496 aros_warnflags_switch=-Wswitch
497 aros_nowarnflags_switch=-Wno-switch
500 AC_MSG_CHECKING([whether ${CC} accepts -Wdiscarded-qualifiers])
501 CFLAGS=-Wdiscarded-qualifiers
502 AC_TRY_COMPILE(,, aros_discarded_qualifiers="yes", aros_discarded_qualifiers="no")
503 AC_MSG_RESULT($aros_discarded_qualifiers)
504 if test "x-$aros_discarded_qualifiers" = "x-yes" ; then
505 aros_warnflags_discarded_qualifiers=-Wdiscarded-qualifiers
506 aros_nowarnflags_discarded_qualifiers=-Wno-discarded-qualifiers
509 AC_MSG_CHECKING([whether ${CC} accepts -Wsequence-point])
510 CFLAGS=-Wsequence-point
511 AC_TRY_COMPILE(,, aros_sequence_point="yes", aros_sequence_point="no")
512 AC_MSG_RESULT($aros_sequence_point)
513 if test "x-$aros_sequence_point" = "x-yes" ; then
514 aros_warnflags_sequence_point=-Wsequence-point
515 aros_nowarnflags_sequence_point=-Wno-sequence-point
518 AC_MSG_CHECKING([whether ${CC} accepts -Wunknown-pragmas])
519 CFLAGS=-Wunknown-pragmas
520 AC_TRY_COMPILE(,, aros_unknown_pragmas="yes", aros_unknown_pragmas="no")
521 AC_MSG_RESULT($aros_unknown_pragmas)
522 if test "x-$aros_unknown_pragmas" = "x-yes" ; then
523 aros_warnflags_unknown_pragmas=-Wunknown-pragmas
524 aros_nowarnflags_unknown_pragmas=-Wno-unknown-pragmas
527 AC_MSG_CHECKING([whether ${CC} accepts -Wdiscarded-array-qualifiers])
528 CFLAGS=-Wdiscarded-array-qualifiers
529 AC_TRY_COMPILE(,, aros_discarded_array_qualifiers="yes", aros_discarded_array_qualifiers="no")
530 AC_MSG_RESULT($aros_discarded_array_qualifiers)
531 if test "x-$aros_discarded_array_qualifiers" = "x-yes" ; then
532 aros_warnflags_discarded_array_qualifiers=-Wdiscarded-array-qualifiers
533 aros_nowarnflags_discarded_array_qualifiers=-Wno-discarded-array-qualifiers
536 AC_MSG_CHECKING([whether ${CC} accepts -Wint-conversion])
537 CFLAGS=-Wint-conversion
538 AC_TRY_COMPILE(,, aros_int_conversion="yes", aros_int_conversion="no")
539 AC_MSG_RESULT($aros_int_conversion)
540 if test "x-$aros_int_conversion" = "x-yes" ; then
541 aros_warnflags_int_conversion=-Wint-conversion
542 aros_nowarnflags_int_conversion=-Wno-int-conversion
545 AC_MSG_CHECKING([whether ${CC} accepts -Wint-to-pointer-cast])
546 CFLAGS=-Wint-to-pointer-cast
547 AC_TRY_COMPILE(,, aros_int_to_pointer_cast="yes", aros_int_to_pointer_cast="no")
548 AC_MSG_RESULT($aros_int_to_pointer_cast)
549 if test "x-$aros_int_to_pointer_cast" = "x-yes" ; then
550 aros_warnflags_int_to_pointer_cast=-Wint-to-pointer-cast
551 aros_nowarnflags_int_to_pointer_cast=-Wno-int-to-pointer-cast
554 AC_MSG_CHECKING([whether ${CC} accepts -Wpointer-to-int-cast])
555 CFLAGS=-Wpointer-to-int-cast
556 AC_TRY_COMPILE(,, aros_pointer_to_int_cast="yes", aros_pointer_to_int_cast="no")
557 AC_MSG_RESULT($aros_pointer_to_int_cast)
558 if test "x-$aros_pointer_to_int_cast" = "x-yes" ; then
559 aros_warnflags_pointer_to_int_cast=-Wpointer-to-int-cast
560 aros_nowarnflags_pointer_to_int_cast=-Wno-pointer-to-int-cast
563 AC_MSG_CHECKING([whether ${CC} accepts -Wunused-const-variable])
564 CFLAGS=-Wunused-const-variable
565 AC_TRY_COMPILE(,, aros_unused_const_variable="yes", aros_unused_const_variable="no")
566 AC_MSG_RESULT($aros_unused_const_variable)
567 if test "x-$aros_unused_const_variable" = "x-yes" ; then
568 aros_warnflags_unused_const_variable=-Wunused-const-variable
569 aros_nowarnflags_unused_const_variable=-Wno-unused-const-variable
572 AC_MSG_CHECKING([whether ${CC} accepts -Wwrite-strings])
573 CFLAGS=-Wwrite-strings
574 AC_TRY_COMPILE(,, aros_write_strings="yes", aros_write_strings="no")
575 AC_MSG_RESULT($aros_write_strings)
576 if test "x-$aros_write_strings" = "x-yes" ; then
577 aros_warnflags_write_strings=-Wwrite-strings
578 aros_nowarnflags_write_strings=-Wno-write-strings
581 AC_MSG_CHECKING([whether ${CC} accepts -Wcomment])
583 AC_TRY_COMPILE(,, aros_comment="yes", aros_comment="no")
584 AC_MSG_RESULT($aros_comment)
585 if test "x-$aros_comment" = "x-yes" ; then
586 aros_warnflags_comment=-Wcomment
587 aros_nowarnflags_comment=-Wno-comment
590 AC_MSG_CHECKING([whether ${CC} accepts -Wincompatible-pointer-types])
591 CFLAGS=-Wincompatible-pointer-types
592 AC_TRY_COMPILE(,, aros_incompatible_pointer_types="yes", aros_incompatible_pointer_types="no")
593 AC_MSG_RESULT($aros_incompatible_pointer_types)
594 if test "x-$aros_incompatible_pointer_types" = "x-yes" ; then
595 aros_warnflags_incompatible_pointer_types=-Wincompatible-pointer-types
596 aros_nowarnflags_incompatible_pointer_types=-Wno-incompatible-pointer-types
599 AC_MSG_CHECKING([whether ${CC} accepts -Wbool-compare])
600 CFLAGS=-Wbool-compare
601 AC_TRY_COMPILE(,, aros_bool_compare="yes", aros_bool_compare="no")
602 AC_MSG_RESULT($aros_bool_compare)
603 if test "x-$aros_bool_compare" = "x-yes" ; then
604 aros_warnflags_bool_compare=-Wbool-compare
605 aros_nowarnflags_bool_compare=-Wno-bool-compare
608 AC_MSG_CHECKING([whether ${CC} accepts -Wlogical-not-parentheses])
609 CFLAGS=-Wlogical-not-parentheses
610 AC_TRY_COMPILE(,, aros_logical_not_parentheses="yes", aros_logical_not_parentheses="no")
611 AC_MSG_RESULT($aros_logical_not_parentheses)
612 if test "x-$aros_logical_not_parentheses" = "x-yes" ; then
613 aros_warnflags_logical_not_parentheses=-Wlogical-not-parentheses
614 aros_nowarnflags_logical_not_parentheses=-Wno-logical-not-parentheses
617 AC_MSG_CHECKING([whether ${CC} accepts -Wpointer-sign])
618 CFLAGS=-Wpointer-sign
619 AC_TRY_COMPILE(,, aros_pointer_sign="yes", aros_pointer_sign="no")
620 AC_MSG_RESULT($aros_pointer_sign)
621 if test "x-$aros_pointer_sign" = "x-yes" ; then
622 aros_warnflags_pointer_sign=-Wpointer-sign
623 aros_nowarnflags_pointer_sign=-Wno-pointer-sign
626 AC_MSG_CHECKING([whether ${CC} accepts -Wshift-overflow])
627 CFLAGS=-Wshift-overflow
628 AC_TRY_COMPILE(,, aros_shift_overflow="yes", aros_shift_overflow="no")
629 AC_MSG_RESULT($aros_shift_overflow)
630 if test "x-$aros_shift_overflow" = "x-yes" ; then
631 aros_warnflags_shift_overflow=-Wshift-overflow
632 aros_nowarnflags_shift_overflow=-Wno-shift-overflow
635 AC_MSG_CHECKING([whether ${CC} accepts -Wframe-address])
636 CFLAGS=-Wframe-address
637 AC_TRY_COMPILE(,, aros_frame_address="yes", aros_frame_address="no")
638 AC_MSG_RESULT($aros_frame_address)
639 if test "x-$aros_frame_address" = "x-yes" ; then
640 aros_warnflags_frame_address=-Wframe-address
641 aros_nowarnflags_frame_address=-Wno-frame-address
644 AC_MSG_CHECKING([whether ${CC} accepts -Wdeprecated-declarations])
645 CFLAGS=-Wdeprecated-declarations
646 AC_TRY_COMPILE(,, aros_deprecated_declarations="yes", aros_deprecated_declarations="no")
647 AC_MSG_RESULT($aros_deprecated_declarations)
648 if test "x-$aros_deprecated_declarations" = "x-yes" ; then
649 aros_warnflags_deprecated_declarations=-Wdeprecated-declarations
650 aros_nowarnflags_deprecated_declarations=-Wno-deprecated-declarations
653 AC_MSG_CHECKING([whether ${CC} accepts -Wsign-compare])
654 CFLAGS=-Wsign-compare
655 AC_TRY_COMPILE(,, aros_sign_compare="yes", aros_sign_compare="no")
656 AC_MSG_RESULT($aros_sign_compare)
657 if test "x-$aros_sign_compare" = "x-yes" ; then
658 aros_warnflags_sign_compare=-Wsign-compare
659 aros_nowarnflags_sign_compare=-Wno-sign-compare
662 AC_MSG_CHECKING([whether ${CC} accepts -Wattributes])
664 AC_TRY_COMPILE(,, aros_attributes="yes", aros_attributes="no")
665 AC_MSG_RESULT($aros_attributes)
666 if test "x-$aros_attributes" = "x-yes" ; then
667 aros_warnflags_attributes=-Wattributes
668 aros_nowarnflags_attributes=-Wno-attributes
671 AC_MSG_CHECKING([whether ${CC} accepts -Woverflow])
673 AC_TRY_COMPILE(,, aros_overflow="yes", aros_overflow="no")
674 AC_MSG_RESULT($aros_overflow)
675 if test "x-$aros_overflow" = "x-yes" ; then
676 aros_warnflags_overflow=-Woverflow
677 aros_nowarnflags_overflow=-Wno-overflow
680 AC_MSG_CHECKING([whether ${CC} accepts -Wunused-local-typedefs])
681 CFLAGS=-Wunused-local-typedefs
682 AC_TRY_COMPILE(,, aros_unused_local_typedefs="yes", aros_unused_local_typedefs="no")
683 AC_MSG_RESULT($aros_unused_local_typedefs)
684 if test "x-$aros_unused_local_typedefs" = "x-yes" ; then
685 aros_warnflags_unused_local_typedefs=-Wunused-local-typedefs
686 aros_nowarnflags_unused_local_typedefs=-Wno-unused-local-typedefs
689 AC_MSG_CHECKING([whether ${CC} accepts -Wmissing-braces])
690 CFLAGS=-Wmissing-braces
691 AC_TRY_COMPILE(,, aros_missing_braces="yes", aros_missing_braces="no")
692 AC_MSG_RESULT($aros_missing_braces)
693 if test "x-$aros_missing_braces" = "x-yes" ; then
694 aros_warnflags_missing_braces=-Wmissing-braces
695 aros_nowarnflags_missing_braces=-Wno-missing-braces
698 AC_MSG_CHECKING([whether ${CC} accepts -Wconversion-null])
699 CFLAGS=-Wconversion-null
700 AC_TRY_COMPILE(,, aros_conversion_null="yes", aros_conversion_null="no")
701 AC_MSG_RESULT($aros_conversion_null)
702 if test "x-$aros_conversion_null" = "x-yes" ; then
703 aros_warnflags_conversion_null=-Wconversion-null
704 aros_nowarnflags_conversion_null=-Wno-conversion-null
707 AC_MSG_CHECKING([whether ${CC} accepts -Wnarrowing])
709 AC_TRY_COMPILE(,, aros_narrowing="yes", aros_narrowing="no")
710 AC_MSG_RESULT($aros_narrowing)
711 if test "x-$aros_narrowing" = "x-yes" ; then
712 aros_warnflags_narrowing=-Wnarrowing
713 aros_nowarnflags_narrowing=-Wno-narrowing
716 AC_MSG_CHECKING([whether ${CC} accepts -Wvolatile-register-var])
717 CFLAGS=-Wvolatile-register-var
718 AC_TRY_COMPILE(,, aros_volatile_register_var="yes", aros_volatile_register_var="no")
719 AC_MSG_RESULT($aros_volatile_register_var)
720 if test "x-$aros_volatile_register_var" = "x-yes" ; then
721 aros_warnflags_volatile_register_var=-Wvolatile-register-var
722 aros_nowarnflags_volatile_register_var=-Wno-volatile-register-var
725 AC_MSG_CHECKING([whether ${CC} accepts -Wsizeof-pointer-memaccess])
726 CFLAGS=-Wsizeof-pointer-memaccess
727 AC_TRY_COMPILE(,, aros_sizeof_pointer_memaccess="yes", aros_sizeof_pointer_memaccess="no")
728 AC_MSG_RESULT($aros_sizeof_pointer_memaccess)
729 if test "x-$aros_sizeof_pointer_memaccess" = "x-yes" ; then
730 aros_warnflags_sizeof_pointer_memaccess=-Wsizeof-pointer-memaccess
731 aros_nowarnflags_sizeof_pointer_memaccess=-Wno-sizeof-pointer-memaccess
734 AC_MSG_CHECKING([whether ${CC} accepts -Wreturn-type])
736 AC_TRY_COMPILE(,, aros_return_type="yes", aros_return_type="no")
737 AC_MSG_RESULT($aros_return_type)
738 if test "x-$aros_return_type" = "x-yes" ; then
739 aros_warnflags_return_type=-Wreturn-type
740 aros_nowarnflags_return_type=-Wno-return-type
743 AC_MSG_CHECKING([whether ${CC} accepts -Wformat-zero-length])
744 CFLAGS=-Wformat-zero-length
745 AC_TRY_COMPILE(,, aros_format_zero_length="yes", aros_format_zero_length="no")
746 AC_MSG_RESULT($aros_format_zero_length)
747 if test "x-$aros_format_zero_length" = "x-yes" ; then
748 aros_warnflags_format_zero_length=-Wformat-zero-length
749 aros_nowarnflags_format_zero_length=-Wno-format-zero-length
752 AC_MSG_CHECKING([whether ${CC} accepts -Wlto-type-mismatch])
753 CFLAGS=-Wlto-type-mismatch
754 AC_TRY_COMPILE(,, aros_lto_type_mismatch="yes", aros_lto_type_mismatch="no")
755 AC_MSG_RESULT($aros_lto_type_mismatch)
756 if test "x-$aros_lto_type_mismatch" = "x-yes" ; then
757 aros_warnflags_lto_type_mismatch=-Wlto-type-mismatch
758 aros_nowarnflags_lto_type_mismatch=-Wno-lto-type-mismatch
761 AC_MSG_CHECKING([whether ${CC} accepts -Wtautological-compare])
762 CFLAGS=-Wtautological-compare
763 AC_TRY_COMPILE(,, aros_tautological_compare="yes", aros_tautological_compare="no")
764 AC_MSG_RESULT($aros_tautological_compare)
765 if test "x-$aros_tautological_compare" = "x-yes" ; then
766 aros_warnflags_tautological_compare=-Wtautological-compare
767 aros_nowarnflags_tautological_compare=-Wno-tautological-compare
771 # export the feature flags...
773 AC_SUBST(aros_cflags_exceptions)
774 AC_SUBST(aros_cflags_permissive)
775 AC_SUBST(aros_cflags_fast_math)
776 AC_SUBST(aros_cflags_no_builtin_floor)
777 AC_SUBST(aros_cflags_lto)
778 AC_SUBST(aros_cflags_nolto)
779 AC_SUBST(aros_cflags_whole_program)
780 AC_SUBST(aros_cflags_loop_block)
781 AC_SUBST(aros_cflags_loop_interchange)
782 AC_SUBST(aros_cflags_loop_strip_mine)
783 AC_SUBST(aros_cflags_peel_loops)
784 AC_SUBST(aros_cflags_unroll_loops)
786 AC_SUBST(aros_cflags_strictaliasing)
787 AC_SUBST(aros_cflags_nostrictaliasing)
789 AC_SUBST(aros_cflags_iquote)
790 AC_SUBST(aros_cflags_iquote_end)
793 # export the feature options...
795 AC_SUBST(aros_cflags_no_red_zone)
798 # ...and warning flags...
800 AC_SUBST(aros_warnflags_error)
801 AC_SUBST(aros_nowarnflags_error)
802 AC_SUBST(aros_warnflags_unused_command_line_argument)
803 AC_SUBST(aros_nowarnflags_unused_command_line_argument)
804 AC_SUBST(aros_warnflags_unknown_warning_option)
805 AC_SUBST(aros_nowarnflags_unknown_warning_option)
806 AC_SUBST(aros_warnflags_unused_but_set_variable)
807 AC_SUBST(aros_nowarnflags_unused_but_set_variable)
808 AC_SUBST(aros_warnflags_strict_aliasing)
809 AC_SUBST(aros_nowarnflags_strict_aliasing)
810 AC_SUBST(aros_warnflags_array_bounds)
811 AC_SUBST(aros_nowarnflags_array_bounds)
812 AC_SUBST(aros_warnflags_enum_compare)
813 AC_SUBST(aros_nowarnflags_enum_compare)
814 AC_SUBST(aros_warnflags_strict_prototypes)
815 AC_SUBST(aros_nowarnflags_strict_prototypes)
816 AC_SUBST(aros_warnflags_strict_overflow)
817 AC_SUBST(aros_nowarnflags_strict_overflow)
818 AC_SUBST(aros_warnflags_format_security)
819 AC_SUBST(aros_nowarnflags_format_security)
820 AC_SUBST(aros_warnflags_misleading_indentation)
821 AC_SUBST(aros_nowarnflags_misleading_indentation)
822 AC_SUBST(aros_warnflags_nonnull_compare)
823 AC_SUBST(aros_nowarnflags_nonnull_compare)
824 AC_SUBST(aros_warnflags_unused)
825 AC_SUBST(aros_nowarnflags_unused)
826 AC_SUBST(aros_warnflags_unused_value)
827 AC_SUBST(aros_nowarnflags_unused_value)
828 AC_SUBST(aros_warnflags_unused_variable)
829 AC_SUBST(aros_nowarnflags_unused_variable)
830 AC_SUBST(aros_warnflags_unused_function)
831 AC_SUBST(aros_nowarnflags_unused_function)
832 AC_SUBST(aros_warnflags_unused_parameter)
833 AC_SUBST(aros_nowarnflags_unused_parameter)
834 AC_SUBST(aros_warnflags_uninitialized)
835 AC_SUBST(aros_nowarnflags_uninitialized)
836 AC_SUBST(aros_warnflags_maybe_uninitialized)
837 AC_SUBST(aros_nowarnflags_maybe_uninitialized)
838 AC_SUBST(aros_warnflags_implicit_function_declaration)
839 AC_SUBST(aros_nowarnflags_implicit_function_declaration)
840 AC_SUBST(aros_warnflags_format)
841 AC_SUBST(aros_nowarnflags_format)
842 AC_SUBST(aros_warnflags_parentheses)
843 AC_SUBST(aros_nowarnflags_parentheses)
844 AC_SUBST(aros_warnflags_char_subscripts)
845 AC_SUBST(aros_nowarnflags_char_subscripts)
846 AC_SUBST(aros_warnflags_endif_labels)
847 AC_SUBST(aros_nowarnflags_endif_labels)
848 AC_SUBST(aros_warnflags_format_contains_nul)
849 AC_SUBST(aros_nowarnflags_format_contains_nul)
850 AC_SUBST(aros_warnflags_implicit_int)
851 AC_SUBST(aros_nowarnflags_implicit_int)
852 AC_SUBST(aros_warnflags_aggressive_loop_optimizations)
853 AC_SUBST(aros_nowarnflags_aggressive_loop_optimizations)
854 AC_SUBST(aros_warnflags_cpp)
855 AC_SUBST(aros_nowarnflags_cpp)
856 AC_SUBST(aros_warnflags_switch)
857 AC_SUBST(aros_nowarnflags_switch)
858 AC_SUBST(aros_warnflags_discarded_qualifiers)
859 AC_SUBST(aros_nowarnflags_discarded_qualifiers)
860 AC_SUBST(aros_warnflags_sequence_point)
861 AC_SUBST(aros_nowarnflags_sequence_point)
862 AC_SUBST(aros_warnflags_unknown_pragmas)
863 AC_SUBST(aros_nowarnflags_unknown_pragmas)
864 AC_SUBST(aros_warnflags_discarded_array_qualifiers)
865 AC_SUBST(aros_nowarnflags_discarded_array_qualifiers)
866 AC_SUBST(aros_warnflags_int_conversion)
867 AC_SUBST(aros_nowarnflags_int_conversion)
868 AC_SUBST(aros_warnflags_int_to_pointer_cast)
869 AC_SUBST(aros_nowarnflags_int_to_pointer_cast)
870 AC_SUBST(aros_warnflags_pointer_to_int_cast)
871 AC_SUBST(aros_nowarnflags_pointer_to_int_cast)
872 AC_SUBST(aros_warnflags_unused_const_variable)
873 AC_SUBST(aros_nowarnflags_unused_const_variable)
874 AC_SUBST(aros_warnflags_write_strings)
875 AC_SUBST(aros_nowarnflags_write_strings)
876 AC_SUBST(aros_warnflags_comment)
877 AC_SUBST(aros_nowarnflags_comment)
878 AC_SUBST(aros_warnflags_incompatible_pointer_types)
879 AC_SUBST(aros_nowarnflags_incompatible_pointer_types)
880 AC_SUBST(aros_warnflags_bool_compare)
881 AC_SUBST(aros_nowarnflags_bool_compare)
882 AC_SUBST(aros_warnflags_logical_not_parentheses)
883 AC_SUBST(aros_nowarnflags_logical_not_parentheses)
884 AC_SUBST(aros_warnflags_pointer_sign)
885 AC_SUBST(aros_nowarnflags_pointer_sign)
886 AC_SUBST(aros_warnflags_shift_overflow)
887 AC_SUBST(aros_nowarnflags_shift_overflow)
888 AC_SUBST(aros_warnflags_frame_address)
889 AC_SUBST(aros_nowarnflags_frame_address)
890 AC_SUBST(aros_warnflags_deprecated_declarations)
891 AC_SUBST(aros_nowarnflags_deprecated_declarations)
892 AC_SUBST(aros_warnflags_sign_compare)
893 AC_SUBST(aros_nowarnflags_sign_compare)
894 AC_SUBST(aros_warnflags_attributes)
895 AC_SUBST(aros_nowarnflags_attributes)
896 AC_SUBST(aros_warnflags_overflow)
897 AC_SUBST(aros_nowarnflags_overflow)
898 AC_SUBST(aros_warnflags_unused_local_typedefs)
899 AC_SUBST(aros_nowarnflags_unused_local_typedefs)
900 AC_SUBST(aros_warnflags_missing_braces)
901 AC_SUBST(aros_nowarnflags_missing_braces)
902 AC_SUBST(aros_warnflags_conversion_null)
903 AC_SUBST(aros_nowarnflags_conversion_null)
904 AC_SUBST(aros_warnflags_narrowing)
905 AC_SUBST(aros_nowarnflags_narrowing)
906 AC_SUBST(aros_warnflags_volatile_register_var)
907 AC_SUBST(aros_nowarnflags_volatile_register_var)
908 AC_SUBST(aros_warnflags_sizeof_pointer_memaccess)
909 AC_SUBST(aros_nowarnflags_sizeof_pointer_memaccess)
910 AC_SUBST(aros_warnflags_return_type)
911 AC_SUBST(aros_nowarnflags_return_type)
912 AC_SUBST(aros_warnflags_format_zero_length)
913 AC_SUBST(aros_nowarnflags_format_zero_length)
914 AC_SUBST(aros_warnflags_lto_type_mismatch)
915 AC_SUBST(aros_nowarnflags_lto_type_mismatch)
916 AC_SUBST(aros_warnflags_tautological_compare)
917 AC_SUBST(aros_nowarnflags_tautological_compare)
920 ${aros_targetcfg_dir}/compiler.cfg:compiler.cfg.in