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:
49 AC_MSG_CHECKING([whether ${CC} accepts -fpermissive])
51 AC_TRY_COMPILE(,, aros_permissive="yes", aros_permissive="no")
52 AC_MSG_RESULT($aros_permissive)
53 if test "x-$aros_permissive" = "x-yes" ; then
54 aros_cflags_permissive=-fpermissive
57 AC_MSG_CHECKING([whether ${CC} accepts -ffast-math])
59 AC_TRY_COMPILE(,, aros_fast_math="yes", aros_fast_math="no")
60 AC_MSG_RESULT($aros_fast_math)
61 if test "x-$aros_fast_math" = "x-yes" ; then
62 aros_cflags_fast_math=-ffast-math
65 AC_MSG_CHECKING([whether ${CC} accepts -fno-builtin-floor])
66 CFLAGS=-fno-builtin-floor
67 AC_TRY_COMPILE(,, aros_no_builtin_floor="yes", aros_no_builtin_floor="no")
68 AC_MSG_RESULT($aros_no_builtin_floor)
69 if test "x-$aros_no_builtin_floor" = "x-yes" ; then
70 aros_cflags_no_builtin_floor=-fno-builtin-floor
73 AC_MSG_CHECKING([whether ${CC} accepts -flto])
75 AC_TRY_COMPILE(,, aros_lto="yes", aros_lto="no")
76 AC_MSG_RESULT($aros_lto)
77 if test "x-$aros_lto" = "x-yes" ; then
79 aros_cflags_nolto=-fno-lto
81 AC_MSG_CHECKING([whether ${CC} accepts -fwhole-program])
82 CFLAGS=-fwhole-program
83 AC_TRY_COMPILE(,, aros_whole_program="yes", aros_whole_program="no")
84 AC_MSG_RESULT($aros_whole_program)
85 if test "x-$aros_whole_program" = "x-yes" ; then
86 aros_cflags_whole_program=-fwhole-program
89 AC_MSG_CHECKING([whether ${CC} accepts -floop-block])
91 AC_TRY_COMPILE(,, aros_loop_block="yes", aros_loop_block="no")
92 AC_MSG_RESULT($aros_loop_block)
93 if test "x-$aros_loop_block" = "x-yes" ; then
94 aros_cflags_loop_block=-floop-block
97 AC_MSG_CHECKING([whether ${CC} accepts -floop-interchange])
98 CFLAGS=-floop-interchange
99 AC_TRY_COMPILE(,, aros_loop_interchange="yes", aros_loop_interchange="no")
100 AC_MSG_RESULT($aros_loop_interchange)
101 if test "x-$aros_loop_interchange" = "x-yes" ; then
102 aros_cflags_loop_interchange=-floop-interchange
105 AC_MSG_CHECKING([whether ${CC} accepts -floop-strip-mine])
106 CFLAGS=-floop-strip-mine
107 AC_TRY_COMPILE(,, aros_loop_strip_mine="yes", aros_loop_strip_mine="no")
108 AC_MSG_RESULT($aros_loop_strip_mine)
109 if test "x-$aros_loop_strip_mine" = "x-yes" ; then
110 aros_cflags_loop_strip_mine=-floop-strip-mine
114 AC_MSG_CHECKING([whether ${CC} accepts -fpeel-loops])
116 AC_TRY_COMPILE(,, aros_peel_loops="yes", aros_peel_loops="no")
117 AC_MSG_RESULT($aros_peel_loops)
118 if test "x-$aros_peel_loops" = "x-yes" ; then
119 aros_cflags_peel_loops=-fpeel-loops
122 AC_MSG_CHECKING([whether ${CC} accepts -funroll-loops])
123 CFLAGS=-funroll-loops
124 AC_TRY_COMPILE(,, aros_unroll_loops="yes", aros_unroll_loops="no")
125 AC_MSG_RESULT($aros_unroll_loops)
126 if test "x-$aros_unroll_loops" = "x-yes" ; then
127 aros_cflags_unroll_loops=-funroll-loops
130 AC_MSG_CHECKING([whether ${CC} accepts -fstrict-aliasing])
131 CFLAGS=-fstrict-aliasing
132 AC_TRY_COMPILE(,, aros_strict_aliasing="yes", aros_strict_aliasing="no")
133 AC_MSG_RESULT($aros_strict_aliasing)
134 if test "x-$aros_strict_aliasing" = "x-yes" ; then
135 aros_cflags_strictaliasing=-fstrict-aliasing
136 aros_cflags_nostrictaliasing=-fno-strict-aliasing
139 AC_MSG_CHECKING([whether ${CC} accepts -iquote])
141 AC_TRY_COMPILE(,, has_iquote="yes", has_iquote="no")
142 AC_MSG_RESULT($has_iquote)
143 if test "x-$has_iquote" = "x-yes" ; then
144 aros_cflags_iquote=-iquote
145 aros_cflags_iquote_end=
147 aros_cflags_iquote=-I
148 aros_cflags_iquote_end=-I-
151 #-----------------------------------------------------------------------------
153 # Check if the target compiler supports some options:
156 AC_MSG_CHECKING([whether ${CC} accepts -mno-red-zone])
158 AC_TRY_COMPILE(,, aros_no_red_zone="yes", aros_no_red_zone="no")
159 AC_MSG_RESULT($aros_no_red_zone)
160 if test "x-$aros_no_red_zone" = "x-yes" ; then
161 aros_cflags_no_red_zone=-mno-red-zone
164 #-----------------------------------------------------------------------------
166 # Check if the target compiler supports some options used for de-linting:
168 # -Wunused-command-line-argument
169 # -Wunknown-warning-option
170 # -Wunused-but-set-variable
174 # -Wstrict-prototypes
177 # -Wmisleading-indentation
185 # -Wmaybe-uninitialized
186 # -Wimplicit-function-declaration
191 # -Wformat-contains-nul
193 # -Waggressive-loop-optimizations
196 # -Wdiscarded-qualifiers
199 # -Wdiscarded-array-qualifiers
201 # -Wint-to-pointer-cast
202 # -Wpointer-to-int-cast
203 # -Wunused-const-variable
206 # -Wincompatible-pointer-types
208 # -Wlogical-not-parentheses
212 # -Wdeprecated-declarations
216 # -Wunused-local-typedefs
220 # -Wvolatile-register-var
221 # -Wsizeof-pointer-memaccess
223 # -Wformat-zero-length
224 # -Wlto-type-mismatch
226 AC_MSG_CHECKING([whether ${CC} accepts -Werror])
228 AC_TRY_COMPILE(,, aros_error="yes", aros_error="no")
229 AC_MSG_RESULT($aros_error)
230 if test "x-$aros_error" = "x-yes" ; then
231 aros_warnflags_error=-Werror
232 aros_nowarnflags_error=-Wno-error
235 AC_MSG_CHECKING([whether ${CC} accepts -Wunused-command-line-argument])
236 CFLAGS=-Wunused-command-line-argument
237 AC_TRY_COMPILE(,, aros_unused_command_line_argument="yes", aros_unused_command_line_argument="no")
238 AC_MSG_RESULT($aros_unused_command_line_argument)
239 if test "x-$aros_unused_command_line_argument" = "x-yes" ; then
240 aros_warnflags_unused_command_line_argument=-Wunused-command-line-argument
241 aros_nowarnflags_unused_command_line_argument=-Wno-unused-command-line-argument
244 AC_MSG_CHECKING([whether ${CC} accepts -Wunknown-warning-option])
245 CFLAGS=-Wunknown-warning-option
246 AC_TRY_COMPILE(,, aros_unknown_warning_option="yes", aros_unknown_warning_option="no")
247 AC_MSG_RESULT($aros_unknown_warning_option)
248 if test "x-$aros_unknown_warning_option" = "x-yes" ; then
249 aros_warnflags_unknown_warning_option=-Wunknown-warning-option
250 aros_nowarnflags_unknown_warning_option=-Wno-unknown-warning-option
253 AC_MSG_CHECKING([whether ${CC} accepts -Wunused-but-set-variable])
254 CFLAGS=-Wunused-but-set-variable
255 AC_TRY_COMPILE(,, aros_unused_but_set_variable="yes", aros_unused_but_set_variable="no")
256 AC_MSG_RESULT($aros_unused_but_set_variable)
257 if test "x-$aros_unused_but_set_variable" = "x-yes" ; then
258 aros_warnflags_unused_but_set_variable=-Wunused-but-set-variable
259 aros_nowarnflags_unused_but_set_variable=-Wno-unused-but-set-variable
262 AC_MSG_CHECKING([whether ${CC} accepts -Wstrict-aliasing])
263 CFLAGS=-Wstrict-aliasing
264 AC_TRY_COMPILE(,, aros_strict_aliasing="yes", aros_strict_aliasing="no")
265 AC_MSG_RESULT($aros_strict_aliasing)
266 if test "x-$aros_strict_aliasing" = "x-yes" ; then
267 aros_warnflags_strict_aliasing=-Wstrict-aliasing
268 aros_nowarnflags_strict_aliasing=-Wno-strict-aliasing
271 AC_MSG_CHECKING([whether ${CC} accepts -Warray-bounds])
272 CFLAGS=-Warray-bounds
273 AC_TRY_COMPILE(,, aros_array_bounds="yes", aros_array_bounds="no")
274 AC_MSG_RESULT($aros_array_bounds)
275 if test "x-$aros_array_bounds" = "x-yes" ; then
276 aros_warnflags_array_bounds=-Warray-bounds
277 aros_nowarnflags_array_bounds=-Wno-array-bounds
280 AC_MSG_CHECKING([whether ${CC} accepts -Wenum-compare])
281 CFLAGS=-Wenum-compare
282 AC_TRY_COMPILE(,, aros_enum_compare="yes", aros_enum_compare="no")
283 AC_MSG_RESULT($aros_enum_compare)
284 if test "x-$aros_enum_compare" = "x-yes" ; then
285 aros_warnflags_enum_compare=-Wenum-compare
286 aros_nowarnflags_enum_compare=-Wno-enum-compare
289 AC_MSG_CHECKING([whether ${CC} accepts -Wstrict-prototypes])
290 CFLAGS=-Wstrict-prototypes
291 AC_TRY_COMPILE(,, aros_strict_prototypes="yes", aros_strict_prototypes="no")
292 AC_MSG_RESULT($aros_strict_prototypes)
293 if test "x-$aros_strict_prototypes" = "x-yes" ; then
294 aros_warnflags_strict_prototypes=-Wstrict-prototypes
295 aros_nowarnflags_strict_prototypes=-Wno-strict-prototypes
298 AC_MSG_CHECKING([whether ${CC} accepts -Wstrict-overflow])
299 CFLAGS=-Wstrict-overflow
300 AC_TRY_COMPILE(,, aros_strict_overflow="yes", aros_strict_overflow="no")
301 AC_MSG_RESULT($aros_strict_overflow)
302 if test "x-$aros_strict_overflow" = "x-yes" ; then
303 aros_warnflags_strict_overflow=-Wstrict-overflow
304 aros_nowarnflags_strict_overflow=-Wno-strict-overflow
307 AC_MSG_CHECKING([whether ${CC} accepts -Wformat-security])
308 CFLAGS=-Wformat-security
309 AC_TRY_COMPILE(,, aros_format_security="yes", aros_format_security="no")
310 AC_MSG_RESULT($aros_format_security)
311 if test "x-$aros_format_security" = "x-yes" ; then
312 aros_warnflags_format_security=-Wformat-security
313 aros_nowarnflags_format_security=-Wno-format-security
316 AC_MSG_CHECKING([whether ${CC} accepts -Wmisleading-indentation])
317 CFLAGS=-Wmisleading-indentation
318 AC_TRY_COMPILE(,, aros_misleading_indentation="yes", aros_misleading_indentation="no")
319 AC_MSG_RESULT($aros_misleading_indentation)
320 if test "x-$aros_misleading_indentation" = "x-yes" ; then
321 aros_warnflags_misleading_indentation=-Wmisleading-indentation
322 aros_nowarnflags_misleading_indentation=-Wno-misleading-indentation
325 AC_MSG_CHECKING([whether ${CC} accepts -Wnonnull-compare])
326 CFLAGS=-Wnonnull-compare
327 AC_TRY_COMPILE(,, aros_nonnull_compare="yes", aros_nonnull_compare="no")
328 AC_MSG_RESULT($aros_nonnull_compare)
329 if test "x-$aros_nonnull_compare" = "x-yes" ; then
330 aros_warnflags_nonnull_compare=-Wnonnull-compare
331 aros_nowarnflags_nonnull_compare=-Wno-nonnull-compare
334 AC_MSG_CHECKING([whether ${CC} accepts -Wunused])
336 AC_TRY_COMPILE(,, aros_unused="yes", aros_unused="no")
337 AC_MSG_RESULT($aros_unused)
338 if test "x-$aros_unused" = "x-yes" ; then
339 aros_warnflags_unused=-Wunused
340 aros_nowarnflags_unused=-Wno-unused
343 AC_MSG_CHECKING([whether ${CC} accepts -Wunused-value])
344 CFLAGS=-Wunused-value
345 AC_TRY_COMPILE(,, aros_unused_value="yes", aros_unused_value="no")
346 AC_MSG_RESULT($aros_unused_value)
347 if test "x-$aros_unused_value" = "x-yes" ; then
348 aros_warnflags_unused_value=-Wunused-value
349 aros_nowarnflags_unused_value=-Wno-unused-value
352 AC_MSG_CHECKING([whether ${CC} accepts -Wunused-variable])
353 CFLAGS=-Wunused-variable
354 AC_TRY_COMPILE(,, aros_unused_variable="yes", aros_unused_variable="no")
355 AC_MSG_RESULT($aros_unused_variable)
356 if test "x-$aros_unused_variable" = "x-yes" ; then
357 aros_warnflags_unused_variable=-Wunused-variable
358 aros_nowarnflags_unused_variable=-Wno-unused-variable
361 AC_MSG_CHECKING([whether ${CC} accepts -Wunused-function])
362 CFLAGS=-Wunused-function
363 AC_TRY_COMPILE(,, aros_unused_function="yes", aros_unused_function="no")
364 AC_MSG_RESULT($aros_unused_function)
365 if test "x-$aros_unused_function" = "x-yes" ; then
366 aros_warnflags_unused_function=-Wunused-function
367 aros_nowarnflags_unused_function=-Wno-unused-function
370 AC_MSG_CHECKING([whether ${CC} accepts -Wunused-parameter])
371 CFLAGS=-Wunused-parameter
372 AC_TRY_COMPILE(,, aros_unused_parameter="yes", aros_unused_parameter="no")
373 AC_MSG_RESULT($aros_unused_parameter)
374 if test "x-$aros_unused_parameter" = "x-yes" ; then
375 aros_warnflags_unused_parameter=-Wunused-parameter
376 aros_nowarnflags_unused_parameter=-Wno-unused-parameter
379 AC_MSG_CHECKING([whether ${CC} accepts -Wuninitialized])
380 CFLAGS=-Wuninitialized
381 AC_TRY_COMPILE(,, aros_uninitialized="yes", aros_uninitialized="no")
382 AC_MSG_RESULT($aros_uninitialized)
383 if test "x-$aros_uninitialized" = "x-yes" ; then
384 aros_warnflags_uninitialized=-Wuninitialized
385 aros_nowarnflags_uninitialized=-Wno-uninitialized
388 AC_MSG_CHECKING([whether ${CC} accepts -Wmaybe-uninitialized])
389 CFLAGS=-Wmaybe-uninitialized
390 AC_TRY_COMPILE(,, aros_maybe_uninitialized="yes", aros_maybe_uninitialized="no")
391 AC_MSG_RESULT($aros_maybe_uninitialized)
392 if test "x-$aros_maybe_uninitialized" = "x-yes" ; then
393 aros_warnflags_maybe_uninitialized=-Wmaybe-uninitialized
394 aros_nowarnflags_maybe_uninitialized=-Wno-maybe-uninitialized
396 aros_warnflags_maybe_uninitialized=$aros_warnflags_uninitialized
397 aros_nowarnflags_maybe_uninitialized=$aros_nowarnflags_uninitialized
400 AC_MSG_CHECKING([whether ${CC} accepts -Wimplicit-function-declaration])
401 CFLAGS=-Wimplicit-function-declaration
402 AC_TRY_COMPILE(,, aros_implicit_function_declaration="yes", aros_implicit_function_declaration="no")
403 AC_MSG_RESULT($aros_implicit_function_declaration)
404 if test "x-$aros_implicit_function_declaration" = "x-yes" ; then
405 aros_warnflags_implicit_function_declaration=-Wimplicit-function-declaration
406 aros_nowarnflags_implicit_function_declaration=-Wno-implicit-function-declaration
409 AC_MSG_CHECKING([whether ${CC} accepts -Wformat])
411 AC_TRY_COMPILE(,, aros_format="yes", aros_format="no")
412 AC_MSG_RESULT($aros_format)
413 if test "x-$aros_format" = "x-yes" ; then
414 aros_warnflags_format=-Wformat
415 aros_nowarnflags_format=-Wno-format
418 AC_MSG_CHECKING([whether ${CC} accepts -Wparentheses])
420 AC_TRY_COMPILE(,, aros_parentheses="yes", aros_parentheses="no")
421 AC_MSG_RESULT($aros_parentheses)
422 if test "x-$aros_parentheses" = "x-yes" ; then
423 aros_warnflags_parentheses=-Wparentheses
424 aros_nowarnflags_parentheses=-Wno-parentheses
427 AC_MSG_CHECKING([whether ${CC} accepts -Wchar-subscripts])
428 CFLAGS=-Wchar-subscripts
429 AC_TRY_COMPILE(,, aros_char_subscripts="yes", aros_char_subscripts="no")
430 AC_MSG_RESULT($aros_char_subscripts)
431 if test "x-$aros_char_subscripts" = "x-yes" ; then
432 aros_warnflags_char_subscripts=-Wchar-subscripts
433 aros_nowarnflags_char_subscripts=-Wno-char-subscripts
436 AC_MSG_CHECKING([whether ${CC} accepts -Wendif-labels])
437 CFLAGS=-Wendif-labels
438 AC_TRY_COMPILE(,, aros_endif_labels="yes", aros_endif_labels="no")
439 AC_MSG_RESULT($aros_endif_labels)
440 if test "x-$aros_endif_labels" = "x-yes" ; then
441 aros_warnflags_endif_labels=-Wendif-labels
442 aros_nowarnflags_endif_labels=-Wno-endif-labels
445 AC_MSG_CHECKING([whether ${CC} accepts -Wformat-contains-nul])
446 CFLAGS=-Wformat-contains-nul
447 AC_TRY_COMPILE(,, aros_format_contains_nul="yes", aros_format_contains_nul="no")
448 AC_MSG_RESULT($aros_format_contains_nul)
449 if test "x-$aros_format_contains_nul" = "x-yes" ; then
450 aros_warnflags_format_contains_nul=-Wformat-contains-nul
451 aros_nowarnflags_format_contains_nul=-Wno-format-contains-nul
454 AC_MSG_CHECKING([whether ${CC} accepts -Wimplicit-int])
455 CFLAGS=-Wimplicit-int
456 AC_TRY_COMPILE(,, aros_implicit_int="yes", aros_implicit_int="no")
457 AC_MSG_RESULT($aros_implicit_int)
458 if test "x-$aros_implicit_int" = "x-yes" ; then
459 aros_warnflags_implicit_int=-Wimplicit-int
460 aros_nowarnflags_implicit_int=-Wno-implicit-int
463 AC_MSG_CHECKING([whether ${CC} accepts -Waggressive-loop-optimizations])
464 CFLAGS=-Waggressive-loop-optimizations
465 AC_TRY_COMPILE(,, aros_aggressive_loop_optimizations="yes", aros_aggressive_loop_optimizations="no")
466 AC_MSG_RESULT($aros_aggressive_loop_optimizations)
467 if test "x-$aros_aggressive_loop_optimizations" = "x-yes" ; then
468 aros_warnflags_aggressive_loop_optimizations=-Waggressive-loop-optimizations
469 aros_nowarnflags_aggressive_loop_optimizations=-Wno-aggressive-loop-optimizations
472 AC_MSG_CHECKING([whether ${CC} accepts -Wcpp])
474 AC_TRY_COMPILE(,, aros_cpp="yes", aros_cpp="no")
475 AC_MSG_RESULT($aros_cpp)
476 if test "x-$aros_cpp" = "x-yes" ; then
477 aros_warnflags_cpp=-Wcpp
478 aros_nowarnflags_cpp=-Wno-cpp
481 AC_MSG_CHECKING([whether ${CC} accepts -Wswitch])
483 AC_TRY_COMPILE(,, aros_switch="yes", aros_switch="no")
484 AC_MSG_RESULT($aros_switch)
485 if test "x-$aros_switch" = "x-yes" ; then
486 aros_warnflags_switch=-Wswitch
487 aros_nowarnflags_switch=-Wno-switch
490 AC_MSG_CHECKING([whether ${CC} accepts -Wdiscarded-qualifiers])
491 CFLAGS=-Wdiscarded-qualifiers
492 AC_TRY_COMPILE(,, aros_discarded_qualifiers="yes", aros_discarded_qualifiers="no")
493 AC_MSG_RESULT($aros_discarded_qualifiers)
494 if test "x-$aros_discarded_qualifiers" = "x-yes" ; then
495 aros_warnflags_discarded_qualifiers=-Wdiscarded-qualifiers
496 aros_nowarnflags_discarded_qualifiers=-Wno-discarded-qualifiers
499 AC_MSG_CHECKING([whether ${CC} accepts -Wsequence-point])
500 CFLAGS=-Wsequence-point
501 AC_TRY_COMPILE(,, aros_sequence_point="yes", aros_sequence_point="no")
502 AC_MSG_RESULT($aros_sequence_point)
503 if test "x-$aros_sequence_point" = "x-yes" ; then
504 aros_warnflags_sequence_point=-Wsequence-point
505 aros_nowarnflags_sequence_point=-Wno-sequence-point
508 AC_MSG_CHECKING([whether ${CC} accepts -Wunknown-pragmas])
509 CFLAGS=-Wunknown-pragmas
510 AC_TRY_COMPILE(,, aros_unknown_pragmas="yes", aros_unknown_pragmas="no")
511 AC_MSG_RESULT($aros_unknown_pragmas)
512 if test "x-$aros_unknown_pragmas" = "x-yes" ; then
513 aros_warnflags_unknown_pragmas=-Wunknown-pragmas
514 aros_nowarnflags_unknown_pragmas=-Wno-unknown-pragmas
517 AC_MSG_CHECKING([whether ${CC} accepts -Wdiscarded-array-qualifiers])
518 CFLAGS=-Wdiscarded-array-qualifiers
519 AC_TRY_COMPILE(,, aros_discarded_array_qualifiers="yes", aros_discarded_array_qualifiers="no")
520 AC_MSG_RESULT($aros_discarded_array_qualifiers)
521 if test "x-$aros_discarded_array_qualifiers" = "x-yes" ; then
522 aros_warnflags_discarded_array_qualifiers=-Wdiscarded-array-qualifiers
523 aros_nowarnflags_discarded_array_qualifiers=-Wno-discarded-array-qualifiers
526 AC_MSG_CHECKING([whether ${CC} accepts -Wint-conversion])
527 CFLAGS=-Wint-conversion
528 AC_TRY_COMPILE(,, aros_int_conversion="yes", aros_int_conversion="no")
529 AC_MSG_RESULT($aros_int_conversion)
530 if test "x-$aros_int_conversion" = "x-yes" ; then
531 aros_warnflags_int_conversion=-Wint-conversion
532 aros_nowarnflags_int_conversion=-Wno-int-conversion
535 AC_MSG_CHECKING([whether ${CC} accepts -Wint-to-pointer-cast])
536 CFLAGS=-Wint-to-pointer-cast
537 AC_TRY_COMPILE(,, aros_int_to_pointer_cast="yes", aros_int_to_pointer_cast="no")
538 AC_MSG_RESULT($aros_int_to_pointer_cast)
539 if test "x-$aros_int_to_pointer_cast" = "x-yes" ; then
540 aros_warnflags_int_to_pointer_cast=-Wint-to-pointer-cast
541 aros_nowarnflags_int_to_pointer_cast=-Wno-int-to-pointer-cast
544 AC_MSG_CHECKING([whether ${CC} accepts -Wpointer-to-int-cast])
545 CFLAGS=-Wpointer-to-int-cast
546 AC_TRY_COMPILE(,, aros_pointer_to_int_cast="yes", aros_pointer_to_int_cast="no")
547 AC_MSG_RESULT($aros_pointer_to_int_cast)
548 if test "x-$aros_pointer_to_int_cast" = "x-yes" ; then
549 aros_warnflags_pointer_to_int_cast=-Wpointer-to-int-cast
550 aros_nowarnflags_pointer_to_int_cast=-Wno-pointer-to-int-cast
553 AC_MSG_CHECKING([whether ${CC} accepts -Wunused-const-variable])
554 CFLAGS=-Wunused-const-variable
555 AC_TRY_COMPILE(,, aros_unused_const_variable="yes", aros_unused_const_variable="no")
556 AC_MSG_RESULT($aros_unused_const_variable)
557 if test "x-$aros_unused_const_variable" = "x-yes" ; then
558 aros_warnflags_unused_const_variable=-Wunused-const-variable
559 aros_nowarnflags_unused_const_variable=-Wno-unused-const-variable
562 AC_MSG_CHECKING([whether ${CC} accepts -Wwrite-strings])
563 CFLAGS=-Wwrite-strings
564 AC_TRY_COMPILE(,, aros_write_strings="yes", aros_write_strings="no")
565 AC_MSG_RESULT($aros_write_strings)
566 if test "x-$aros_write_strings" = "x-yes" ; then
567 aros_warnflags_write_strings=-Wwrite-strings
568 aros_nowarnflags_write_strings=-Wno-write-strings
571 AC_MSG_CHECKING([whether ${CC} accepts -Wcomment])
573 AC_TRY_COMPILE(,, aros_comment="yes", aros_comment="no")
574 AC_MSG_RESULT($aros_comment)
575 if test "x-$aros_comment" = "x-yes" ; then
576 aros_warnflags_comment=-Wcomment
577 aros_nowarnflags_comment=-Wno-comment
580 AC_MSG_CHECKING([whether ${CC} accepts -Wincompatible-pointer-types])
581 CFLAGS=-Wincompatible-pointer-types
582 AC_TRY_COMPILE(,, aros_incompatible_pointer_types="yes", aros_incompatible_pointer_types="no")
583 AC_MSG_RESULT($aros_incompatible_pointer_types)
584 if test "x-$aros_incompatible_pointer_types" = "x-yes" ; then
585 aros_warnflags_incompatible_pointer_types=-Wincompatible-pointer-types
586 aros_nowarnflags_incompatible_pointer_types=-Wno-incompatible-pointer-types
589 AC_MSG_CHECKING([whether ${CC} accepts -Wbool-compare])
590 CFLAGS=-Wbool-compare
591 AC_TRY_COMPILE(,, aros_bool_compare="yes", aros_bool_compare="no")
592 AC_MSG_RESULT($aros_bool_compare)
593 if test "x-$aros_bool_compare" = "x-yes" ; then
594 aros_warnflags_bool_compare=-Wbool-compare
595 aros_nowarnflags_bool_compare=-Wno-bool-compare
598 AC_MSG_CHECKING([whether ${CC} accepts -Wlogical-not-parentheses])
599 CFLAGS=-Wlogical-not-parentheses
600 AC_TRY_COMPILE(,, aros_logical_not_parentheses="yes", aros_logical_not_parentheses="no")
601 AC_MSG_RESULT($aros_logical_not_parentheses)
602 if test "x-$aros_logical_not_parentheses" = "x-yes" ; then
603 aros_warnflags_logical_not_parentheses=-Wlogical-not-parentheses
604 aros_nowarnflags_logical_not_parentheses=-Wno-logical-not-parentheses
607 AC_MSG_CHECKING([whether ${CC} accepts -Wpointer-sign])
608 CFLAGS=-Wpointer-sign
609 AC_TRY_COMPILE(,, aros_pointer_sign="yes", aros_pointer_sign="no")
610 AC_MSG_RESULT($aros_pointer_sign)
611 if test "x-$aros_pointer_sign" = "x-yes" ; then
612 aros_warnflags_pointer_sign=-Wpointer-sign
613 aros_nowarnflags_pointer_sign=-Wno-pointer-sign
616 AC_MSG_CHECKING([whether ${CC} accepts -Wshift-overflow])
617 CFLAGS=-Wshift-overflow
618 AC_TRY_COMPILE(,, aros_shift_overflow="yes", aros_shift_overflow="no")
619 AC_MSG_RESULT($aros_shift_overflow)
620 if test "x-$aros_shift_overflow" = "x-yes" ; then
621 aros_warnflags_shift_overflow=-Wshift-overflow
622 aros_nowarnflags_shift_overflow=-Wno-shift-overflow
625 AC_MSG_CHECKING([whether ${CC} accepts -Wframe-address])
626 CFLAGS=-Wframe-address
627 AC_TRY_COMPILE(,, aros_frame_address="yes", aros_frame_address="no")
628 AC_MSG_RESULT($aros_frame_address)
629 if test "x-$aros_frame_address" = "x-yes" ; then
630 aros_warnflags_frame_address=-Wframe-address
631 aros_nowarnflags_frame_address=-Wno-frame-address
634 AC_MSG_CHECKING([whether ${CC} accepts -Wdeprecated-declarations])
635 CFLAGS=-Wdeprecated-declarations
636 AC_TRY_COMPILE(,, aros_deprecated_declarations="yes", aros_deprecated_declarations="no")
637 AC_MSG_RESULT($aros_deprecated_declarations)
638 if test "x-$aros_deprecated_declarations" = "x-yes" ; then
639 aros_warnflags_deprecated_declarations=-Wdeprecated-declarations
640 aros_nowarnflags_deprecated_declarations=-Wno-deprecated-declarations
643 AC_MSG_CHECKING([whether ${CC} accepts -Wsign-compare])
644 CFLAGS=-Wsign-compare
645 AC_TRY_COMPILE(,, aros_sign_compare="yes", aros_sign_compare="no")
646 AC_MSG_RESULT($aros_sign_compare)
647 if test "x-$aros_sign_compare" = "x-yes" ; then
648 aros_warnflags_sign_compare=-Wsign-compare
649 aros_nowarnflags_sign_compare=-Wno-sign-compare
652 AC_MSG_CHECKING([whether ${CC} accepts -Wattributes])
654 AC_TRY_COMPILE(,, aros_attributes="yes", aros_attributes="no")
655 AC_MSG_RESULT($aros_attributes)
656 if test "x-$aros_attributes" = "x-yes" ; then
657 aros_warnflags_attributes=-Wattributes
658 aros_nowarnflags_attributes=-Wno-attributes
661 AC_MSG_CHECKING([whether ${CC} accepts -Woverflow])
663 AC_TRY_COMPILE(,, aros_overflow="yes", aros_overflow="no")
664 AC_MSG_RESULT($aros_overflow)
665 if test "x-$aros_overflow" = "x-yes" ; then
666 aros_warnflags_overflow=-Woverflow
667 aros_nowarnflags_overflow=-Wno-overflow
670 AC_MSG_CHECKING([whether ${CC} accepts -Wunused-local-typedefs])
671 CFLAGS=-Wunused-local-typedefs
672 AC_TRY_COMPILE(,, aros_unused_local_typedefs="yes", aros_unused_local_typedefs="no")
673 AC_MSG_RESULT($aros_unused_local_typedefs)
674 if test "x-$aros_unused_local_typedefs" = "x-yes" ; then
675 aros_warnflags_unused_local_typedefs=-Wunused-local-typedefs
676 aros_nowarnflags_unused_local_typedefs=-Wno-unused-local-typedefs
679 AC_MSG_CHECKING([whether ${CC} accepts -Wmissing-braces])
680 CFLAGS=-Wmissing-braces
681 AC_TRY_COMPILE(,, aros_missing_braces="yes", aros_missing_braces="no")
682 AC_MSG_RESULT($aros_missing_braces)
683 if test "x-$aros_missing_braces" = "x-yes" ; then
684 aros_warnflags_missing_braces=-Wmissing-braces
685 aros_nowarnflags_missing_braces=-Wno-missing-braces
688 AC_MSG_CHECKING([whether ${CC} accepts -Wconversion-null])
689 CFLAGS=-Wconversion-null
690 AC_TRY_COMPILE(,, aros_conversion_null="yes", aros_conversion_null="no")
691 AC_MSG_RESULT($aros_conversion_null)
692 if test "x-$aros_conversion_null" = "x-yes" ; then
693 aros_warnflags_conversion_null=-Wconversion-null
694 aros_nowarnflags_conversion_null=-Wno-conversion-null
697 AC_MSG_CHECKING([whether ${CC} accepts -Wnarrowing])
699 AC_TRY_COMPILE(,, aros_narrowing="yes", aros_narrowing="no")
700 AC_MSG_RESULT($aros_narrowing)
701 if test "x-$aros_narrowing" = "x-yes" ; then
702 aros_warnflags_narrowing=-Wnarrowing
703 aros_nowarnflags_narrowing=-Wno-narrowing
706 AC_MSG_CHECKING([whether ${CC} accepts -Wvolatile-register-var])
707 CFLAGS=-Wvolatile-register-var
708 AC_TRY_COMPILE(,, aros_volatile_register_var="yes", aros_volatile_register_var="no")
709 AC_MSG_RESULT($aros_volatile_register_var)
710 if test "x-$aros_volatile_register_var" = "x-yes" ; then
711 aros_warnflags_volatile_register_var=-Wvolatile-register-var
712 aros_nowarnflags_volatile_register_var=-Wno-volatile-register-var
715 AC_MSG_CHECKING([whether ${CC} accepts -Wsizeof-pointer-memaccess])
716 CFLAGS=-Wsizeof-pointer-memaccess
717 AC_TRY_COMPILE(,, aros_sizeof_pointer_memaccess="yes", aros_sizeof_pointer_memaccess="no")
718 AC_MSG_RESULT($aros_sizeof_pointer_memaccess)
719 if test "x-$aros_sizeof_pointer_memaccess" = "x-yes" ; then
720 aros_warnflags_sizeof_pointer_memaccess=-Wsizeof-pointer-memaccess
721 aros_nowarnflags_sizeof_pointer_memaccess=-Wno-sizeof-pointer-memaccess
724 AC_MSG_CHECKING([whether ${CC} accepts -Wreturn-type])
726 AC_TRY_COMPILE(,, aros_return_type="yes", aros_return_type="no")
727 AC_MSG_RESULT($aros_return_type)
728 if test "x-$aros_return_type" = "x-yes" ; then
729 aros_warnflags_return_type=-Wreturn-type
730 aros_nowarnflags_return_type=-Wno-return-type
733 AC_MSG_CHECKING([whether ${CC} accepts -Wformat-zero-length])
734 CFLAGS=-Wformat-zero-length
735 AC_TRY_COMPILE(,, aros_format_zero_length="yes", aros_format_zero_length="no")
736 AC_MSG_RESULT($aros_format_zero_length)
737 if test "x-$aros_format_zero_length" = "x-yes" ; then
738 aros_warnflags_format_zero_length=-Wformat-zero-length
739 aros_nowarnflags_format_zero_length=-Wno-format-zero-length
742 AC_MSG_CHECKING([whether ${CC} accepts -Wlto-type-mismatch])
743 CFLAGS=-Wlto-type-mismatch
744 AC_TRY_COMPILE(,, aros_lto_type_mismatch="yes", aros_lto_type_mismatch="no")
745 AC_MSG_RESULT($aros_lto_type_mismatch)
746 if test "x-$aros_lto_type_mismatch" = "x-yes" ; then
747 aros_warnflags_lto_type_mismatch=-Wlto-type-mismatch
748 aros_nowarnflags_lto_type_mismatch=-Wno-lto-type-mismatch
752 # export the feature flags...
754 AC_SUBST(aros_cflags_permissive)
755 AC_SUBST(aros_cflags_fast_math)
756 AC_SUBST(aros_cflags_no_builtin_floor)
757 AC_SUBST(aros_cflags_lto)
758 AC_SUBST(aros_cflags_nolto)
759 AC_SUBST(aros_cflags_whole_program)
760 AC_SUBST(aros_cflags_loop_block)
761 AC_SUBST(aros_cflags_loop_interchange)
762 AC_SUBST(aros_cflags_loop_strip_mine)
763 AC_SUBST(aros_cflags_peel_loops)
764 AC_SUBST(aros_cflags_unroll_loops)
766 AC_SUBST(aros_cflags_strictaliasing)
767 AC_SUBST(aros_cflags_nostrictaliasing)
769 AC_SUBST(aros_cflags_iquote)
770 AC_SUBST(aros_cflags_iquote_end)
773 # export the feature options...
775 AC_SUBST(aros_cflags_no_red_zone)
778 # ...and warning flags...
780 AC_SUBST(aros_warnflags_error)
781 AC_SUBST(aros_nowarnflags_error)
782 AC_SUBST(aros_warnflags_unused_command_line_argument)
783 AC_SUBST(aros_nowarnflags_unused_command_line_argument)
784 AC_SUBST(aros_warnflags_unknown_warning_option)
785 AC_SUBST(aros_nowarnflags_unknown_warning_option)
786 AC_SUBST(aros_warnflags_unused_but_set_variable)
787 AC_SUBST(aros_nowarnflags_unused_but_set_variable)
788 AC_SUBST(aros_warnflags_strict_aliasing)
789 AC_SUBST(aros_nowarnflags_strict_aliasing)
790 AC_SUBST(aros_warnflags_array_bounds)
791 AC_SUBST(aros_nowarnflags_array_bounds)
792 AC_SUBST(aros_warnflags_enum_compare)
793 AC_SUBST(aros_nowarnflags_enum_compare)
794 AC_SUBST(aros_warnflags_strict_prototypes)
795 AC_SUBST(aros_nowarnflags_strict_prototypes)
796 AC_SUBST(aros_warnflags_strict_overflow)
797 AC_SUBST(aros_nowarnflags_strict_overflow)
798 AC_SUBST(aros_warnflags_format_security)
799 AC_SUBST(aros_nowarnflags_format_security)
800 AC_SUBST(aros_warnflags_misleading_indentation)
801 AC_SUBST(aros_nowarnflags_misleading_indentation)
802 AC_SUBST(aros_warnflags_nonnull_compare)
803 AC_SUBST(aros_nowarnflags_nonnull_compare)
804 AC_SUBST(aros_warnflags_unused)
805 AC_SUBST(aros_nowarnflags_unused)
806 AC_SUBST(aros_warnflags_unused_value)
807 AC_SUBST(aros_nowarnflags_unused_value)
808 AC_SUBST(aros_warnflags_unused_variable)
809 AC_SUBST(aros_nowarnflags_unused_variable)
810 AC_SUBST(aros_warnflags_unused_function)
811 AC_SUBST(aros_nowarnflags_unused_function)
812 AC_SUBST(aros_warnflags_unused_parameter)
813 AC_SUBST(aros_nowarnflags_unused_parameter)
814 AC_SUBST(aros_warnflags_uninitialized)
815 AC_SUBST(aros_nowarnflags_uninitialized)
816 AC_SUBST(aros_warnflags_maybe_uninitialized)
817 AC_SUBST(aros_nowarnflags_maybe_uninitialized)
818 AC_SUBST(aros_warnflags_implicit_function_declaration)
819 AC_SUBST(aros_nowarnflags_implicit_function_declaration)
820 AC_SUBST(aros_warnflags_format)
821 AC_SUBST(aros_nowarnflags_format)
822 AC_SUBST(aros_warnflags_parentheses)
823 AC_SUBST(aros_nowarnflags_parentheses)
824 AC_SUBST(aros_warnflags_char_subscripts)
825 AC_SUBST(aros_nowarnflags_char_subscripts)
826 AC_SUBST(aros_warnflags_endif_labels)
827 AC_SUBST(aros_nowarnflags_endif_labels)
828 AC_SUBST(aros_warnflags_format_contains_nul)
829 AC_SUBST(aros_nowarnflags_format_contains_nul)
830 AC_SUBST(aros_warnflags_implicit_int)
831 AC_SUBST(aros_nowarnflags_implicit_int)
832 AC_SUBST(aros_warnflags_aggressive_loop_optimizations)
833 AC_SUBST(aros_nowarnflags_aggressive_loop_optimizations)
834 AC_SUBST(aros_warnflags_cpp)
835 AC_SUBST(aros_nowarnflags_cpp)
836 AC_SUBST(aros_warnflags_switch)
837 AC_SUBST(aros_nowarnflags_switch)
838 AC_SUBST(aros_warnflags_discarded_qualifiers)
839 AC_SUBST(aros_nowarnflags_discarded_qualifiers)
840 AC_SUBST(aros_warnflags_sequence_point)
841 AC_SUBST(aros_nowarnflags_sequence_point)
842 AC_SUBST(aros_warnflags_unknown_pragmas)
843 AC_SUBST(aros_nowarnflags_unknown_pragmas)
844 AC_SUBST(aros_warnflags_discarded_array_qualifiers)
845 AC_SUBST(aros_nowarnflags_discarded_array_qualifiers)
846 AC_SUBST(aros_warnflags_int_conversion)
847 AC_SUBST(aros_nowarnflags_int_conversion)
848 AC_SUBST(aros_warnflags_int_to_pointer_cast)
849 AC_SUBST(aros_nowarnflags_int_to_pointer_cast)
850 AC_SUBST(aros_warnflags_pointer_to_int_cast)
851 AC_SUBST(aros_nowarnflags_pointer_to_int_cast)
852 AC_SUBST(aros_warnflags_unused_const_variable)
853 AC_SUBST(aros_nowarnflags_unused_const_variable)
854 AC_SUBST(aros_warnflags_write_strings)
855 AC_SUBST(aros_nowarnflags_write_strings)
856 AC_SUBST(aros_warnflags_comment)
857 AC_SUBST(aros_nowarnflags_comment)
858 AC_SUBST(aros_warnflags_incompatible_pointer_types)
859 AC_SUBST(aros_nowarnflags_incompatible_pointer_types)
860 AC_SUBST(aros_warnflags_bool_compare)
861 AC_SUBST(aros_nowarnflags_bool_compare)
862 AC_SUBST(aros_warnflags_logical_not_parentheses)
863 AC_SUBST(aros_nowarnflags_logical_not_parentheses)
864 AC_SUBST(aros_warnflags_pointer_sign)
865 AC_SUBST(aros_nowarnflags_pointer_sign)
866 AC_SUBST(aros_warnflags_shift_overflow)
867 AC_SUBST(aros_nowarnflags_shift_overflow)
868 AC_SUBST(aros_warnflags_frame_address)
869 AC_SUBST(aros_nowarnflags_frame_address)
870 AC_SUBST(aros_warnflags_deprecated_declarations)
871 AC_SUBST(aros_nowarnflags_deprecated_declarations)
872 AC_SUBST(aros_warnflags_sign_compare)
873 AC_SUBST(aros_nowarnflags_sign_compare)
874 AC_SUBST(aros_warnflags_attributes)
875 AC_SUBST(aros_nowarnflags_attributes)
876 AC_SUBST(aros_warnflags_overflow)
877 AC_SUBST(aros_nowarnflags_overflow)
878 AC_SUBST(aros_warnflags_unused_local_typedefs)
879 AC_SUBST(aros_nowarnflags_unused_local_typedefs)
880 AC_SUBST(aros_warnflags_missing_braces)
881 AC_SUBST(aros_nowarnflags_missing_braces)
882 AC_SUBST(aros_warnflags_conversion_null)
883 AC_SUBST(aros_nowarnflags_conversion_null)
884 AC_SUBST(aros_warnflags_narrowing)
885 AC_SUBST(aros_nowarnflags_narrowing)
886 AC_SUBST(aros_warnflags_volatile_register_var)
887 AC_SUBST(aros_nowarnflags_volatile_register_var)
888 AC_SUBST(aros_warnflags_sizeof_pointer_memaccess)
889 AC_SUBST(aros_nowarnflags_sizeof_pointer_memaccess)
890 AC_SUBST(aros_warnflags_return_type)
891 AC_SUBST(aros_nowarnflags_return_type)
892 AC_SUBST(aros_warnflags_format_zero_length)
893 AC_SUBST(aros_nowarnflags_format_zero_length)
894 AC_SUBST(aros_warnflags_lto_type_mismatch)
895 AC_SUBST(aros_nowarnflags_lto_type_mismatch)
898 ${aros_targetcfg_dir}/compiler.cfg:compiler.cfg.in