1 dnl Copyright © 1997-2019, 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:
51 # -finline-small-functions
54 # -fomit-frame-pointer
57 # -finstrument-functions
62 # -fno-builtin-vsnprintf
65 # -fasynchronous-unwind-tables
77 AC_MSG_CHECKING([whether ${CC} accepts -fexceptions])
79 AC_TRY_COMPILE(,, aros_exceptions="yes", aros_exceptions="no")
80 AC_MSG_RESULT($aros_exceptions)
81 if test "x-$aros_exceptions" = "x-yes" ; then
82 aros_cflags_exceptions=-fexceptions
83 aros_cflags_noexceptions=-fno-exceptions
86 AC_MSG_CHECKING([whether ${CC} accepts -ffast-math])
88 AC_TRY_COMPILE(,, aros_fast_math="yes", aros_fast_math="no")
89 AC_MSG_RESULT($aros_fast_math)
90 if test "x-$aros_fast_math" = "x-yes" ; then
91 aros_cflags_fast_math=-ffast-math
94 AC_MSG_CHECKING([whether ${CC} accepts -fassociative-math])
95 CFLAGS=-fassociative-math
96 AC_TRY_COMPILE(,, aros_associative_math="yes", aros_associative_math="no")
97 AC_MSG_RESULT($aros_associative_math)
98 if test "x-$aros_associative_math" = "x-yes" ; then
99 aros_cflags_associative_math=-fassociative-math
102 AC_MSG_CHECKING([whether ${CC} accepts -fno-math-errno])
103 CFLAGS=-fno-math-errno
104 AC_TRY_COMPILE(,, aros_no_math_errno="yes", aros_no_math_errno="no")
105 AC_MSG_RESULT($aros_no_math_errno)
106 if test "x-$aros_no_math_errno" = "x-yes" ; then
107 aros_cflags_no_math_errno=-fno-math-errno
110 AC_MSG_CHECKING([whether ${CC} accepts -fno-trapping-math])
111 CFLAGS=-fno-trapping-math
112 AC_TRY_COMPILE(,, aros_no_trapping_math="yes", aros_no_trapping_math="no")
113 AC_MSG_RESULT($aros_no_trapping_math)
114 if test "x-$aros_no_trapping_math" = "x-yes" ; then
115 aros_cflags_no_trapping_math=-fno-trapping-math
118 AC_MSG_CHECKING([whether ${CC} accepts -ftree-vectorize])
119 CFLAGS=-ftree-vectorize
120 AC_TRY_COMPILE(,, aros_tree_vectorize="yes", aros_tree_vectorize="no")
121 AC_MSG_RESULT($aros_tree_vectorize)
122 if test "x-$aros_tree_vectorize" = "x-yes" ; then
123 aros_cflags_tree_vectorize=-ftree-vectorize
126 AC_MSG_CHECKING([whether ${CC} accepts -flto])
128 AC_TRY_COMPILE(,, aros_lto="yes", aros_lto="no")
129 AC_MSG_RESULT($aros_lto)
130 if test "x-$aros_lto" = "x-yes" ; then
131 aros_cflags_lto=-flto
132 aros_cflags_nolto=-fno-lto
134 AC_MSG_CHECKING([whether ${CC} accepts -fwhole-program])
135 CFLAGS=-fwhole-program
136 AC_TRY_COMPILE(,, aros_whole_program="yes", aros_whole_program="no")
137 AC_MSG_RESULT($aros_whole_program)
138 if test "x-$aros_whole_program" = "x-yes" ; then
139 aros_cflags_whole_program=-fwhole-program
142 AC_MSG_CHECKING([whether ${CC} accepts -floop-block])
144 AC_TRY_COMPILE(,, aros_loop_block="yes", aros_loop_block="no")
145 AC_MSG_RESULT($aros_loop_block)
146 if test "x-$aros_loop_block" = "x-yes" ; then
147 aros_cflags_loop_block=-floop-block
150 AC_MSG_CHECKING([whether ${CC} accepts -floop-interchange])
151 CFLAGS=-floop-interchange
152 AC_TRY_COMPILE(,, aros_loop_interchange="yes", aros_loop_interchange="no")
153 AC_MSG_RESULT($aros_loop_interchange)
154 if test "x-$aros_loop_interchange" = "x-yes" ; then
155 aros_cflags_loop_interchange=-floop-interchange
158 AC_MSG_CHECKING([whether ${CC} accepts -floop-strip-mine])
159 CFLAGS=-floop-strip-mine
160 AC_TRY_COMPILE(,, aros_loop_strip_mine="yes", aros_loop_strip_mine="no")
161 AC_MSG_RESULT($aros_loop_strip_mine)
162 if test "x-$aros_loop_strip_mine" = "x-yes" ; then
163 aros_cflags_loop_strip_mine=-floop-strip-mine
167 AC_MSG_CHECKING([whether ${CC} accepts -fpeel-loops])
169 AC_TRY_COMPILE(,, aros_peel_loops="yes", aros_peel_loops="no")
170 AC_MSG_RESULT($aros_peel_loops)
171 if test "x-$aros_peel_loops" = "x-yes" ; then
172 aros_cflags_peel_loops=-fpeel-loops
175 AC_MSG_CHECKING([whether ${CC} accepts -funroll-loops])
176 CFLAGS=-funroll-loops
177 AC_TRY_COMPILE(,, aros_unroll_loops="yes", aros_unroll_loops="no")
178 AC_MSG_RESULT($aros_unroll_loops)
179 if test "x-$aros_unroll_loops" = "x-yes" ; then
180 aros_cflags_unroll_loops=-funroll-loops
183 AC_MSG_CHECKING([whether ${CC} accepts -fstrict-aliasing])
184 CFLAGS=-fstrict-aliasing
185 AC_TRY_COMPILE(,, aros_strict_aliasing="yes", aros_strict_aliasing="no")
186 AC_MSG_RESULT($aros_strict_aliasing)
187 if test "x-$aros_strict_aliasing" = "x-yes" ; then
188 aros_cflags_strictaliasing=-fstrict-aliasing
189 aros_cflags_nostrictaliasing=-fno-strict-aliasing
192 AC_MSG_CHECKING([whether ${CC} accepts -finline-small-functions])
193 CFLAGS=-finline-small-functions
194 AC_TRY_COMPILE(,, aros_inline_small_functions="yes", aros_inline_small_functions="no")
195 AC_MSG_RESULT($aros_inline_small_functions)
196 if test "x-$aros_inline_small_functions" = "x-yes" ; then
197 aros_cflags_inlinesmallfunctions=-finline-small-functions
198 aros_cflags_noinlinesmallfunctions=-fno-inline-small-functions
201 AC_MSG_CHECKING([whether ${CC} accepts -fipa-cp])
203 AC_TRY_COMPILE(,, aros_ipa_cp="yes", aros_ipa_cp="no")
204 AC_MSG_RESULT($aros_ipa_cp)
205 if test "x-$aros_ipa_cp" = "x-yes" ; then
206 aros_cflags_ipacp=-fipa-cp
207 aros_cflags_noipacp=-fno-ipa-cp
210 AC_MSG_CHECKING([whether ${CC} accepts -fomit-frame-pointer])
211 CFLAGS=-fomit-frame-pointer
212 AC_TRY_COMPILE(,, aros_omit_frame_pointer="yes", aros_omit_frame_pointer="no")
213 AC_MSG_RESULT($aros_omit_frame_pointer)
214 if test "x-$aros_omit_frame_pointer" = "x-yes" ; then
215 aros_cflags_omitfp=-fomit-frame-pointer
216 aros_cflags_noomitfp=-fno-omit-frame-pointer
219 AC_MSG_CHECKING([whether ${CC} accepts -fprofile-arcs])
220 CFLAGS=-fprofile-arcs
221 AC_TRY_COMPILE(,, aros_profile_arcs="yes", aros_profile_arcs="no")
222 AC_MSG_RESULT($aros_profile_arcs)
223 if test "x-$aros_profile_arcs" = "x-yes" ; then
224 aros_cflags_profilearcs=-fprofile-arcs
225 aros_cflags_noprofilearcs=-fno-profile-arcs
228 AC_MSG_CHECKING([whether ${CC} accepts -ftest-coverage])
229 CFLAGS=-ftest-coverage
230 AC_TRY_COMPILE(,, aros_test_coverage="yes", aros_test_coverage="no")
231 AC_MSG_RESULT($aros_test_coverage)
232 if test "x-$aros_test_coverage" = "x-yes" ; then
233 aros_cflags_testcoverage=-ftest-coverage
234 aros_cflags_notestcoverage=-fno-test-coverage
237 AC_MSG_CHECKING([whether ${CC} accepts -finstrument-functions])
238 CFLAGS=-finstrument-functions
239 AC_TRY_COMPILE(,, aros_instrument_functions="yes", aros_instrument_functions="no")
240 AC_MSG_RESULT($aros_instrument_functions)
241 if test "x-$aros_instrument_functions" = "x-yes" ; then
242 aros_cflags_instrfuncs=-finstrument-functions
243 aros_cflags_noinstrfuncs=-fno-instrument-functions
246 AC_MSG_CHECKING([whether ${CC} accepts -faligned-new])
248 AC_TRY_COMPILE(,, aros_aligned_new="yes", aros_aligned_new="no")
249 AC_MSG_RESULT($aros_aligned_new)
250 if test "x-$aros_aligned_new" = "x-yes" ; then
251 aros_cflags_alignednew=-faligned-new
252 aros_cflags_noalignednew=-fno-aligned-new
255 AC_MSG_CHECKING([whether ${CC} accepts -fbuiltin])
257 AC_TRY_COMPILE(,, aros_builtin="yes", aros_builtin="no")
258 AC_MSG_RESULT($aros_builtin)
259 if test "x-$aros_builtin" = "x-yes" ; then
260 aros_cflags_builtin=-fbuiltin
261 aros_cflags_no_builtin=-fno-builtin
264 AC_MSG_CHECKING([whether ${CC} accepts -fno-builtin-floor])
265 CFLAGS=-fno-builtin-floor
266 AC_TRY_COMPILE(,, aros_no_builtin_floor="yes", aros_no_builtin_floor="no")
267 AC_MSG_RESULT($aros_no_builtin_floor)
268 if test "x-$aros_no_builtin_floor" = "x-yes" ; then
269 aros_cflags_no_builtin_floor=-fno-builtin-floor
272 AC_MSG_CHECKING([whether ${CC} accepts -fno-builtin-vsnprintf])
273 CFLAGS=-fno-builtin-vsnprintf
274 AC_TRY_COMPILE(,, aros_no_builtin_vsnprintf="yes", aros_no_builtin_vsnprintf="no")
275 AC_MSG_RESULT($aros_no_builtin_vsnprintf)
276 if test "x-$aros_no_builtin_vsnprintf" = "x-yes" ; then
277 aros_cflags_no_builtin_vsnprintf=-fno-builtin-vsnprintf
280 AC_MSG_CHECKING([whether ${CC} accepts -ffreestanding])
281 CFLAGS=-ffreestanding
282 AC_TRY_COMPILE(,, aros_freestanding="yes", aros_freestanding="no")
283 AC_MSG_RESULT($aros_freestanding)
284 if test "x-$aros_freestanding" = "x-yes" ; then
285 aros_cflags_freestanding=-ffreestanding
286 aros_cflags_no_freestanding=-fno-freestanding
289 AC_MSG_CHECKING([whether ${CC} accepts -fasynchronous-unwind-tables])
290 CFLAGS=-fasynchronous-unwind-tables
291 AC_TRY_COMPILE(,, aros_asynchronous_unwind_tables="yes", aros_asynchronous_unwind_tables="no")
292 AC_MSG_RESULT($aros_asynchronous_unwind_tables)
293 if test "x-$aros_asynchronous_unwind_tables" = "x-yes" ; then
294 aros_cflags_asynchronous_unwind_tables=-fasynchronous-unwind-tables
295 aros_cflags_no_asynchronous_unwind_tables=-fno-asynchronous-unwind-tables
298 AC_MSG_CHECKING([whether ${CC} accepts -fvisibility=hidden])
299 CFLAGS=-fvisibility=hidden
300 AC_TRY_COMPILE(,, aros_visibility_hidden="yes", aros_visibility_hidden="no")
301 AC_MSG_RESULT($aros_visibility_hidden)
302 if test "x-$aros_visibility_hidden" = "x-yes" ; then
303 aros_cflags_visibility_hidden=-fvisibility=hidden
308 save_cxxflags="$CXXFLAGS"
310 AC_MSG_CHECKING([whether ${CXX} accepts -fpermissive])
311 CXXFLAGS=-fpermissive
312 AC_TRY_COMPILE(,, aros_permissive="yes", aros_permissive="no")
313 AC_MSG_RESULT($aros_permissive)
314 if test "x-$aros_permissive" = "x-yes" ; then
315 aros_cxxflags_permissive=-fpermissive
316 aros_cxxflags_nopermissive=-fno-permissive
319 AC_MSG_CHECKING([whether ${CXX} accepts -frtti])
321 AC_TRY_COMPILE(,, aros_rtti="yes", aros_rtti="no")
322 AC_MSG_RESULT($aros_rtti)
323 if test "x-$aros_rtti" = "x-yes" ; then
324 aros_cxxflags_rtti=-frtti
325 aros_cxxflags_nortti=-fno-rtti
328 CXXFLAGS="$save_cxxflags"
331 # Check for additional C compiler options..
334 #-----------------------------------------------------------------------------
336 # Check if the target compiler supports some include directory options:
338 AC_MSG_CHECKING([whether ${CC} accepts -iquote])
340 AC_TRY_COMPILE(,, has_iquote="yes", has_iquote="no")
341 AC_MSG_RESULT($has_iquote)
342 if test "x-$has_iquote" = "x-yes" ; then
343 aros_cflags_iquote=-iquote
344 aros_cflags_iquote_end=
346 aros_cflags_iquote=-I
347 aros_cflags_iquote_end=-I-
350 AC_MSG_CHECKING([whether ${CC} accepts -isystem])
352 AC_TRY_COMPILE(,, has_isystem="yes", has_isystem="no")
353 AC_MSG_RESULT($has_isystem)
354 if test "x-$has_isystem" = "x-yes" ; then
355 aros_cflags_isystem=-isystem
356 aros_cflags_isystem_end=
358 aros_cflags_isystem=-I
359 aros_cflags_isystem_end=
362 #-----------------------------------------------------------------------------
364 # Check if the target compiler supports some ISA options:
367 AC_MSG_CHECKING([whether ${CC} accepts -mred-zone])
369 AC_TRY_COMPILE(,, aros_no_red_zone="yes", aros_no_red_zone="no")
370 AC_MSG_RESULT($aros_no_red_zone)
371 if test "x-$aros_no_red_zone" = "x-yes" ; then
372 aros_cflags_red_zone=-mred-zone
373 aros_cflags_no_red_zone=-mno-red-zone
376 AC_MSG_CHECKING([whether ${CC} accepts -mms-bitfields])
377 CFLAGS=-mms-bitfields
378 AC_TRY_COMPILE(,, aros_ms_bitfields="yes", aros_ms_bitfields="no")
379 AC_MSG_RESULT($aros_ms_bitfields)
380 if test "x-$aros_ms_bitfields" = "x-yes" ; then
381 aros_cflags_ms_bitfields=-mms-bitfields
382 aros_cflags_no_ms_bitfields=-mno-ms-bitfields
385 CFLAGS="$save_cflags"
387 #-----------------------------------------------------------------------------
389 # Check if the target compiler supports some options used for de-linting:
393 # -Wunused-command-line-argument
394 # -Wunknown-warning-option
395 # -Wunused-but-set-variable
399 # -Wstrict-prototypes
402 # -Wmisleading-indentation
411 # -Wmaybe-uninitialized
412 # -Wimplicit-function-declaration
417 # -Wformat-contains-nul
419 # -Waggressive-loop-optimizations
422 # -Wdiscarded-qualifiers
425 # -Wdiscarded-array-qualifiers
427 # -Wint-to-pointer-cast
428 # -Wpointer-to-int-cast
429 # -Wunused-const-variable
432 # -Wincompatible-pointer-types
434 # -Wlogical-not-parentheses
438 # -Wdeprecated-declarations
442 # -Wunused-local-typedefs
446 # -Wvolatile-register-var
447 # -Wsizeof-pointer-memaccess
449 # -Wformat-zero-length
450 # -Wlto-type-mismatch
451 # -Wtautological-compare
454 # -Wstringop-overflow
455 # -Wformat-truncation
456 # -Wstringop-truncation
457 # -Wshift-negative-value
458 # -Wmissing-field-initializers
459 # -Wimplicit-fallthrough
460 # -Wmissing-prototypes
462 # -Wint-in-bool-context
467 save_cflags="$CFLAGS"
468 AC_MSG_CHECKING([whether ${CC} accepts -Werror])
470 AC_TRY_COMPILE(,, aros_error="yes", aros_error="no")
471 AC_MSG_RESULT($aros_error)
472 if test "x-$aros_error" = "x-yes" ; then
473 aros_warnflags_error=-Werror
474 aros_nowarnflags_error=-Wno-error
477 AC_MSG_CHECKING([whether ${CC} accepts -Wall])
479 AC_TRY_COMPILE(,, aros_all="yes", aros_all="no")
480 AC_MSG_RESULT($aros_all)
481 if test "x-$aros_all" = "x-yes" ; then
482 aros_warnflags_all=-Wall
485 AC_MSG_CHECKING([whether ${CC} accepts -Wrestrict])
487 AC_TRY_COMPILE(,, aros_restrict="yes", aros_restrict="no")
488 AC_MSG_RESULT($aros_restrict)
489 if test "x-$aros_restrict" = "x-yes" ; then
490 aros_warnflags_restrict=-Wrestrict
491 aros_nowarnflags_restrict=-Wno-restrict
494 AC_MSG_CHECKING([whether ${CC} accepts -Wunused-command-line-argument])
495 CFLAGS=-Wunused-command-line-argument
496 AC_TRY_COMPILE(,, aros_unused_command_line_argument="yes", aros_unused_command_line_argument="no")
497 AC_MSG_RESULT($aros_unused_command_line_argument)
498 if test "x-$aros_unused_command_line_argument" = "x-yes" ; then
499 aros_warnflags_unused_command_line_argument=-Wunused-command-line-argument
500 aros_nowarnflags_unused_command_line_argument=-Wno-unused-command-line-argument
503 AC_MSG_CHECKING([whether ${CC} accepts -Wunknown-warning-option])
504 CFLAGS=-Wunknown-warning-option
505 AC_TRY_COMPILE(,, aros_unknown_warning_option="yes", aros_unknown_warning_option="no")
506 AC_MSG_RESULT($aros_unknown_warning_option)
507 if test "x-$aros_unknown_warning_option" = "x-yes" ; then
508 aros_warnflags_unknown_warning_option=-Wunknown-warning-option
509 aros_nowarnflags_unknown_warning_option=-Wno-unknown-warning-option
512 AC_MSG_CHECKING([whether ${CC} accepts -Wunused-but-set-variable])
513 CFLAGS=-Wunused-but-set-variable
514 AC_TRY_COMPILE(,, aros_unused_but_set_variable="yes", aros_unused_but_set_variable="no")
515 AC_MSG_RESULT($aros_unused_but_set_variable)
516 if test "x-$aros_unused_but_set_variable" = "x-yes" ; then
517 aros_warnflags_unused_but_set_variable=-Wunused-but-set-variable
518 aros_nowarnflags_unused_but_set_variable=-Wno-unused-but-set-variable
521 AC_MSG_CHECKING([whether ${CC} accepts -Wstrict-aliasing])
522 CFLAGS=-Wstrict-aliasing
523 AC_TRY_COMPILE(,, aros_strict_aliasing="yes", aros_strict_aliasing="no")
524 AC_MSG_RESULT($aros_strict_aliasing)
525 if test "x-$aros_strict_aliasing" = "x-yes" ; then
526 aros_warnflags_strict_aliasing=-Wstrict-aliasing
527 aros_nowarnflags_strict_aliasing=-Wno-strict-aliasing
530 AC_MSG_CHECKING([whether ${CC} accepts -Warray-bounds])
531 CFLAGS=-Warray-bounds
532 AC_TRY_COMPILE(,, aros_array_bounds="yes", aros_array_bounds="no")
533 AC_MSG_RESULT($aros_array_bounds)
534 if test "x-$aros_array_bounds" = "x-yes" ; then
535 aros_warnflags_array_bounds=-Warray-bounds
536 aros_nowarnflags_array_bounds=-Wno-array-bounds
539 AC_MSG_CHECKING([whether ${CC} accepts -Wenum-compare])
540 CFLAGS=-Wenum-compare
541 AC_TRY_COMPILE(,, aros_enum_compare="yes", aros_enum_compare="no")
542 AC_MSG_RESULT($aros_enum_compare)
543 if test "x-$aros_enum_compare" = "x-yes" ; then
544 aros_warnflags_enum_compare=-Wenum-compare
545 aros_nowarnflags_enum_compare=-Wno-enum-compare
548 AC_MSG_CHECKING([whether ${CC} accepts -Wstrict-prototypes])
549 CFLAGS=-Wstrict-prototypes
550 AC_TRY_COMPILE(,, aros_strict_prototypes="yes", aros_strict_prototypes="no")
551 AC_MSG_RESULT($aros_strict_prototypes)
552 if test "x-$aros_strict_prototypes" = "x-yes" ; then
553 aros_warnflags_strict_prototypes=-Wstrict-prototypes
554 aros_nowarnflags_strict_prototypes=-Wno-strict-prototypes
557 AC_MSG_CHECKING([whether ${CC} accepts -Wstrict-overflow])
558 CFLAGS=-Wstrict-overflow
559 AC_TRY_COMPILE(,, aros_strict_overflow="yes", aros_strict_overflow="no")
560 AC_MSG_RESULT($aros_strict_overflow)
561 if test "x-$aros_strict_overflow" = "x-yes" ; then
562 aros_warnflags_strict_overflow=-Wstrict-overflow
563 aros_nowarnflags_strict_overflow=-Wno-strict-overflow
566 AC_MSG_CHECKING([whether ${CC} accepts -Wformat-security])
567 CFLAGS=-Wformat-security
568 AC_TRY_COMPILE(,, aros_format_security="yes", aros_format_security="no")
569 AC_MSG_RESULT($aros_format_security)
570 if test "x-$aros_format_security" = "x-yes" ; then
571 aros_warnflags_format_security=-Wformat-security
572 aros_nowarnflags_format_security=-Wno-format-security
575 AC_MSG_CHECKING([whether ${CC} accepts -Wmisleading-indentation])
576 CFLAGS=-Wmisleading-indentation
577 AC_TRY_COMPILE(,, aros_misleading_indentation="yes", aros_misleading_indentation="no")
578 AC_MSG_RESULT($aros_misleading_indentation)
579 if test "x-$aros_misleading_indentation" = "x-yes" ; then
580 aros_warnflags_misleading_indentation=-Wmisleading-indentation
581 aros_nowarnflags_misleading_indentation=-Wno-misleading-indentation
584 AC_MSG_CHECKING([whether ${CC} accepts -Wnonnull-compare])
585 CFLAGS=-Wnonnull-compare
586 AC_TRY_COMPILE(,, aros_nonnull_compare="yes", aros_nonnull_compare="no")
587 AC_MSG_RESULT($aros_nonnull_compare)
588 if test "x-$aros_nonnull_compare" = "x-yes" ; then
589 aros_warnflags_nonnull_compare=-Wnonnull-compare
590 aros_nowarnflags_nonnull_compare=-Wno-nonnull-compare
593 AC_MSG_CHECKING([whether ${CC} accepts -Wunused])
595 AC_TRY_COMPILE(,, aros_unused="yes", aros_unused="no")
596 AC_MSG_RESULT($aros_unused)
597 if test "x-$aros_unused" = "x-yes" ; then
598 aros_warnflags_unused=-Wunused
599 aros_nowarnflags_unused=-Wno-unused
602 AC_MSG_CHECKING([whether ${CC} accepts -Wunused-label])
603 CFLAGS=-Wunused-label
604 AC_TRY_COMPILE(,, aros_unused_label="yes", aros_unused_label="no")
605 AC_MSG_RESULT($aros_unused_label)
606 if test "x-$aros_unused_label" = "x-yes" ; then
607 aros_warnflags_unused_label=-Wunused-label
608 aros_nowarnflags_unused_label=-Wno-unused-label
611 AC_MSG_CHECKING([whether ${CC} accepts -Wunused-value])
612 CFLAGS=-Wunused-value
613 AC_TRY_COMPILE(,, aros_unused_value="yes", aros_unused_value="no")
614 AC_MSG_RESULT($aros_unused_value)
615 if test "x-$aros_unused_value" = "x-yes" ; then
616 aros_warnflags_unused_value=-Wunused-value
617 aros_nowarnflags_unused_value=-Wno-unused-value
620 AC_MSG_CHECKING([whether ${CC} accepts -Wunused-variable])
621 CFLAGS=-Wunused-variable
622 AC_TRY_COMPILE(,, aros_unused_variable="yes", aros_unused_variable="no")
623 AC_MSG_RESULT($aros_unused_variable)
624 if test "x-$aros_unused_variable" = "x-yes" ; then
625 aros_warnflags_unused_variable=-Wunused-variable
626 aros_nowarnflags_unused_variable=-Wno-unused-variable
629 AC_MSG_CHECKING([whether ${CC} accepts -Wunused-function])
630 CFLAGS=-Wunused-function
631 AC_TRY_COMPILE(,, aros_unused_function="yes", aros_unused_function="no")
632 AC_MSG_RESULT($aros_unused_function)
633 if test "x-$aros_unused_function" = "x-yes" ; then
634 aros_warnflags_unused_function=-Wunused-function
635 aros_nowarnflags_unused_function=-Wno-unused-function
638 AC_MSG_CHECKING([whether ${CC} accepts -Wunused-parameter])
639 CFLAGS=-Wunused-parameter
640 AC_TRY_COMPILE(,, aros_unused_parameter="yes", aros_unused_parameter="no")
641 AC_MSG_RESULT($aros_unused_parameter)
642 if test "x-$aros_unused_parameter" = "x-yes" ; then
643 aros_warnflags_unused_parameter=-Wunused-parameter
644 aros_nowarnflags_unused_parameter=-Wno-unused-parameter
647 AC_MSG_CHECKING([whether ${CC} accepts -Wuninitialized])
648 CFLAGS=-Wuninitialized
649 AC_TRY_COMPILE(,, aros_uninitialized="yes", aros_uninitialized="no")
650 AC_MSG_RESULT($aros_uninitialized)
651 if test "x-$aros_uninitialized" = "x-yes" ; then
652 aros_warnflags_uninitialized=-Wuninitialized
653 aros_nowarnflags_uninitialized=-Wno-uninitialized
656 AC_MSG_CHECKING([whether ${CC} accepts -Wmaybe-uninitialized])
657 CFLAGS=-Wmaybe-uninitialized
658 AC_TRY_COMPILE(,, aros_maybe_uninitialized="yes", aros_maybe_uninitialized="no")
659 AC_MSG_RESULT($aros_maybe_uninitialized)
660 if test "x-$aros_maybe_uninitialized" = "x-yes" ; then
661 aros_warnflags_maybe_uninitialized=-Wmaybe-uninitialized
662 aros_nowarnflags_maybe_uninitialized=-Wno-maybe-uninitialized
664 aros_warnflags_maybe_uninitialized=$aros_warnflags_uninitialized
665 aros_nowarnflags_maybe_uninitialized=$aros_nowarnflags_uninitialized
668 AC_MSG_CHECKING([whether ${CC} accepts -Wimplicit-function-declaration])
669 CFLAGS=-Wimplicit-function-declaration
670 AC_TRY_COMPILE(,, aros_implicit_function_declaration="yes", aros_implicit_function_declaration="no")
671 AC_MSG_RESULT($aros_implicit_function_declaration)
672 if test "x-$aros_implicit_function_declaration" = "x-yes" ; then
673 aros_warnflags_implicit_function_declaration=-Wimplicit-function-declaration
674 aros_nowarnflags_implicit_function_declaration=-Wno-implicit-function-declaration
677 AC_MSG_CHECKING([whether ${CC} accepts -Wformat])
679 AC_TRY_COMPILE(,, aros_format="yes", aros_format="no")
680 AC_MSG_RESULT($aros_format)
681 if test "x-$aros_format" = "x-yes" ; then
682 aros_warnflags_format=-Wformat
683 aros_nowarnflags_format=-Wno-format
686 AC_MSG_CHECKING([whether ${CC} accepts -Wparentheses])
688 AC_TRY_COMPILE(,, aros_parentheses="yes", aros_parentheses="no")
689 AC_MSG_RESULT($aros_parentheses)
690 if test "x-$aros_parentheses" = "x-yes" ; then
691 aros_warnflags_parentheses=-Wparentheses
692 aros_nowarnflags_parentheses=-Wno-parentheses
695 AC_MSG_CHECKING([whether ${CC} accepts -Wchar-subscripts])
696 CFLAGS=-Wchar-subscripts
697 AC_TRY_COMPILE(,, aros_char_subscripts="yes", aros_char_subscripts="no")
698 AC_MSG_RESULT($aros_char_subscripts)
699 if test "x-$aros_char_subscripts" = "x-yes" ; then
700 aros_warnflags_char_subscripts=-Wchar-subscripts
701 aros_nowarnflags_char_subscripts=-Wno-char-subscripts
704 AC_MSG_CHECKING([whether ${CC} accepts -Wendif-labels])
705 CFLAGS=-Wendif-labels
706 AC_TRY_COMPILE(,, aros_endif_labels="yes", aros_endif_labels="no")
707 AC_MSG_RESULT($aros_endif_labels)
708 if test "x-$aros_endif_labels" = "x-yes" ; then
709 aros_warnflags_endif_labels=-Wendif-labels
710 aros_nowarnflags_endif_labels=-Wno-endif-labels
713 AC_MSG_CHECKING([whether ${CC} accepts -Wformat-contains-nul])
714 CFLAGS=-Wformat-contains-nul
715 AC_TRY_COMPILE(,, aros_format_contains_nul="yes", aros_format_contains_nul="no")
716 AC_MSG_RESULT($aros_format_contains_nul)
717 if test "x-$aros_format_contains_nul" = "x-yes" ; then
718 aros_warnflags_format_contains_nul=-Wformat-contains-nul
719 aros_nowarnflags_format_contains_nul=-Wno-format-contains-nul
722 AC_MSG_CHECKING([whether ${CC} accepts -Wimplicit-int])
723 CFLAGS=-Wimplicit-int
724 AC_TRY_COMPILE(,, aros_implicit_int="yes", aros_implicit_int="no")
725 AC_MSG_RESULT($aros_implicit_int)
726 if test "x-$aros_implicit_int" = "x-yes" ; then
727 aros_warnflags_implicit_int=-Wimplicit-int
728 aros_nowarnflags_implicit_int=-Wno-implicit-int
731 AC_MSG_CHECKING([whether ${CC} accepts -Waggressive-loop-optimizations])
732 CFLAGS=-Waggressive-loop-optimizations
733 AC_TRY_COMPILE(,, aros_aggressive_loop_optimizations="yes", aros_aggressive_loop_optimizations="no")
734 AC_MSG_RESULT($aros_aggressive_loop_optimizations)
735 if test "x-$aros_aggressive_loop_optimizations" = "x-yes" ; then
736 aros_warnflags_aggressive_loop_optimizations=-Waggressive-loop-optimizations
737 aros_nowarnflags_aggressive_loop_optimizations=-Wno-aggressive-loop-optimizations
740 AC_MSG_CHECKING([whether ${CC} accepts -Wcpp])
742 AC_TRY_COMPILE(,, aros_cpp="yes", aros_cpp="no")
743 AC_MSG_RESULT($aros_cpp)
744 if test "x-$aros_cpp" = "x-yes" ; then
745 aros_warnflags_cpp=-Wcpp
746 aros_nowarnflags_cpp=-Wno-cpp
749 AC_MSG_CHECKING([whether ${CC} accepts -Wswitch])
751 AC_TRY_COMPILE(,, aros_switch="yes", aros_switch="no")
752 AC_MSG_RESULT($aros_switch)
753 if test "x-$aros_switch" = "x-yes" ; then
754 aros_warnflags_switch=-Wswitch
755 aros_nowarnflags_switch=-Wno-switch
758 AC_MSG_CHECKING([whether ${CC} accepts -Wdiscarded-qualifiers])
759 CFLAGS=-Wdiscarded-qualifiers
760 AC_TRY_COMPILE(,, aros_discarded_qualifiers="yes", aros_discarded_qualifiers="no")
761 AC_MSG_RESULT($aros_discarded_qualifiers)
762 if test "x-$aros_discarded_qualifiers" = "x-yes" ; then
763 aros_warnflags_discarded_qualifiers=-Wdiscarded-qualifiers
764 aros_nowarnflags_discarded_qualifiers=-Wno-discarded-qualifiers
767 AC_MSG_CHECKING([whether ${CC} accepts -Wsequence-point])
768 CFLAGS=-Wsequence-point
769 AC_TRY_COMPILE(,, aros_sequence_point="yes", aros_sequence_point="no")
770 AC_MSG_RESULT($aros_sequence_point)
771 if test "x-$aros_sequence_point" = "x-yes" ; then
772 aros_warnflags_sequence_point=-Wsequence-point
773 aros_nowarnflags_sequence_point=-Wno-sequence-point
776 AC_MSG_CHECKING([whether ${CC} accepts -Wunknown-pragmas])
777 CFLAGS=-Wunknown-pragmas
778 AC_TRY_COMPILE(,, aros_unknown_pragmas="yes", aros_unknown_pragmas="no")
779 AC_MSG_RESULT($aros_unknown_pragmas)
780 if test "x-$aros_unknown_pragmas" = "x-yes" ; then
781 aros_warnflags_unknown_pragmas=-Wunknown-pragmas
782 aros_nowarnflags_unknown_pragmas=-Wno-unknown-pragmas
785 AC_MSG_CHECKING([whether ${CC} accepts -Wdiscarded-array-qualifiers])
786 CFLAGS=-Wdiscarded-array-qualifiers
787 AC_TRY_COMPILE(,, aros_discarded_array_qualifiers="yes", aros_discarded_array_qualifiers="no")
788 AC_MSG_RESULT($aros_discarded_array_qualifiers)
789 if test "x-$aros_discarded_array_qualifiers" = "x-yes" ; then
790 aros_warnflags_discarded_array_qualifiers=-Wdiscarded-array-qualifiers
791 aros_nowarnflags_discarded_array_qualifiers=-Wno-discarded-array-qualifiers
794 AC_MSG_CHECKING([whether ${CC} accepts -Wint-conversion])
795 CFLAGS=-Wint-conversion
796 AC_TRY_COMPILE(,, aros_int_conversion="yes", aros_int_conversion="no")
797 AC_MSG_RESULT($aros_int_conversion)
798 if test "x-$aros_int_conversion" = "x-yes" ; then
799 aros_warnflags_int_conversion=-Wint-conversion
800 aros_nowarnflags_int_conversion=-Wno-int-conversion
803 AC_MSG_CHECKING([whether ${CC} accepts -Wint-to-pointer-cast])
804 CFLAGS=-Wint-to-pointer-cast
805 AC_TRY_COMPILE(,, aros_int_to_pointer_cast="yes", aros_int_to_pointer_cast="no")
806 AC_MSG_RESULT($aros_int_to_pointer_cast)
807 if test "x-$aros_int_to_pointer_cast" = "x-yes" ; then
808 aros_warnflags_int_to_pointer_cast=-Wint-to-pointer-cast
809 aros_nowarnflags_int_to_pointer_cast=-Wno-int-to-pointer-cast
812 AC_MSG_CHECKING([whether ${CC} accepts -Wpointer-to-int-cast])
813 CFLAGS=-Wpointer-to-int-cast
814 AC_TRY_COMPILE(,, aros_pointer_to_int_cast="yes", aros_pointer_to_int_cast="no")
815 AC_MSG_RESULT($aros_pointer_to_int_cast)
816 if test "x-$aros_pointer_to_int_cast" = "x-yes" ; then
817 aros_warnflags_pointer_to_int_cast=-Wpointer-to-int-cast
818 aros_nowarnflags_pointer_to_int_cast=-Wno-pointer-to-int-cast
821 AC_MSG_CHECKING([whether ${CC} accepts -Wunused-const-variable])
822 CFLAGS=-Wunused-const-variable
823 AC_TRY_COMPILE(,, aros_unused_const_variable="yes", aros_unused_const_variable="no")
824 AC_MSG_RESULT($aros_unused_const_variable)
825 if test "x-$aros_unused_const_variable" = "x-yes" ; then
826 aros_warnflags_unused_const_variable=-Wunused-const-variable
827 aros_nowarnflags_unused_const_variable=-Wno-unused-const-variable
830 AC_MSG_CHECKING([whether ${CC} accepts -Wwrite-strings])
831 CFLAGS=-Wwrite-strings
832 AC_TRY_COMPILE(,, aros_write_strings="yes", aros_write_strings="no")
833 AC_MSG_RESULT($aros_write_strings)
834 if test "x-$aros_write_strings" = "x-yes" ; then
835 aros_warnflags_write_strings=-Wwrite-strings
836 aros_nowarnflags_write_strings=-Wno-write-strings
839 AC_MSG_CHECKING([whether ${CC} accepts -Wcomment])
841 AC_TRY_COMPILE(,, aros_comment="yes", aros_comment="no")
842 AC_MSG_RESULT($aros_comment)
843 if test "x-$aros_comment" = "x-yes" ; then
844 aros_warnflags_comment=-Wcomment
845 aros_nowarnflags_comment=-Wno-comment
848 AC_MSG_CHECKING([whether ${CC} accepts -Wincompatible-pointer-types])
849 CFLAGS=-Wincompatible-pointer-types
850 AC_TRY_COMPILE(,, aros_incompatible_pointer_types="yes", aros_incompatible_pointer_types="no")
851 AC_MSG_RESULT($aros_incompatible_pointer_types)
852 if test "x-$aros_incompatible_pointer_types" = "x-yes" ; then
853 aros_warnflags_incompatible_pointer_types=-Wincompatible-pointer-types
854 aros_nowarnflags_incompatible_pointer_types=-Wno-incompatible-pointer-types
857 AC_MSG_CHECKING([whether ${CC} accepts -Wbool-compare])
858 CFLAGS=-Wbool-compare
859 AC_TRY_COMPILE(,, aros_bool_compare="yes", aros_bool_compare="no")
860 AC_MSG_RESULT($aros_bool_compare)
861 if test "x-$aros_bool_compare" = "x-yes" ; then
862 aros_warnflags_bool_compare=-Wbool-compare
863 aros_nowarnflags_bool_compare=-Wno-bool-compare
866 AC_MSG_CHECKING([whether ${CC} accepts -Wlogical-not-parentheses])
867 CFLAGS=-Wlogical-not-parentheses
868 AC_TRY_COMPILE(,, aros_logical_not_parentheses="yes", aros_logical_not_parentheses="no")
869 AC_MSG_RESULT($aros_logical_not_parentheses)
870 if test "x-$aros_logical_not_parentheses" = "x-yes" ; then
871 aros_warnflags_logical_not_parentheses=-Wlogical-not-parentheses
872 aros_nowarnflags_logical_not_parentheses=-Wno-logical-not-parentheses
875 AC_MSG_CHECKING([whether ${CC} accepts -Wpointer-sign])
876 CFLAGS=-Wpointer-sign
877 AC_TRY_COMPILE(,, aros_pointer_sign="yes", aros_pointer_sign="no")
878 AC_MSG_RESULT($aros_pointer_sign)
879 if test "x-$aros_pointer_sign" = "x-yes" ; then
880 aros_warnflags_pointer_sign=-Wpointer-sign
881 aros_nowarnflags_pointer_sign=-Wno-pointer-sign
884 AC_MSG_CHECKING([whether ${CC} accepts -Wshift-overflow])
885 CFLAGS=-Wshift-overflow
886 AC_TRY_COMPILE(,, aros_shift_overflow="yes", aros_shift_overflow="no")
887 AC_MSG_RESULT($aros_shift_overflow)
888 if test "x-$aros_shift_overflow" = "x-yes" ; then
889 aros_warnflags_shift_overflow=-Wshift-overflow
890 aros_nowarnflags_shift_overflow=-Wno-shift-overflow
893 AC_MSG_CHECKING([whether ${CC} accepts -Wframe-address])
894 CFLAGS=-Wframe-address
895 AC_TRY_COMPILE(,, aros_frame_address="yes", aros_frame_address="no")
896 AC_MSG_RESULT($aros_frame_address)
897 if test "x-$aros_frame_address" = "x-yes" ; then
898 aros_warnflags_frame_address=-Wframe-address
899 aros_nowarnflags_frame_address=-Wno-frame-address
902 AC_MSG_CHECKING([whether ${CC} accepts -Wdeprecated-declarations])
903 CFLAGS=-Wdeprecated-declarations
904 AC_TRY_COMPILE(,, aros_deprecated_declarations="yes", aros_deprecated_declarations="no")
905 AC_MSG_RESULT($aros_deprecated_declarations)
906 if test "x-$aros_deprecated_declarations" = "x-yes" ; then
907 aros_warnflags_deprecated_declarations=-Wdeprecated-declarations
908 aros_nowarnflags_deprecated_declarations=-Wno-deprecated-declarations
911 AC_MSG_CHECKING([whether ${CC} accepts -Wsign-compare])
912 CFLAGS=-Wsign-compare
913 AC_TRY_COMPILE(,, aros_sign_compare="yes", aros_sign_compare="no")
914 AC_MSG_RESULT($aros_sign_compare)
915 if test "x-$aros_sign_compare" = "x-yes" ; then
916 aros_warnflags_sign_compare=-Wsign-compare
917 aros_nowarnflags_sign_compare=-Wno-sign-compare
920 AC_MSG_CHECKING([whether ${CC} accepts -Wattributes])
922 AC_TRY_COMPILE(,, aros_attributes="yes", aros_attributes="no")
923 AC_MSG_RESULT($aros_attributes)
924 if test "x-$aros_attributes" = "x-yes" ; then
925 aros_warnflags_attributes=-Wattributes
926 aros_nowarnflags_attributes=-Wno-attributes
929 AC_MSG_CHECKING([whether ${CC} accepts -Woverflow])
931 AC_TRY_COMPILE(,, aros_overflow="yes", aros_overflow="no")
932 AC_MSG_RESULT($aros_overflow)
933 if test "x-$aros_overflow" = "x-yes" ; then
934 aros_warnflags_overflow=-Woverflow
935 aros_nowarnflags_overflow=-Wno-overflow
938 AC_MSG_CHECKING([whether ${CC} accepts -Wunused-local-typedefs])
939 CFLAGS=-Wunused-local-typedefs
940 AC_TRY_COMPILE(,, aros_unused_local_typedefs="yes", aros_unused_local_typedefs="no")
941 AC_MSG_RESULT($aros_unused_local_typedefs)
942 if test "x-$aros_unused_local_typedefs" = "x-yes" ; then
943 aros_warnflags_unused_local_typedefs=-Wunused-local-typedefs
944 aros_nowarnflags_unused_local_typedefs=-Wno-unused-local-typedefs
947 AC_MSG_CHECKING([whether ${CC} accepts -Wmissing-braces])
948 CFLAGS=-Wmissing-braces
949 AC_TRY_COMPILE(,, aros_missing_braces="yes", aros_missing_braces="no")
950 AC_MSG_RESULT($aros_missing_braces)
951 if test "x-$aros_missing_braces" = "x-yes" ; then
952 aros_warnflags_missing_braces=-Wmissing-braces
953 aros_nowarnflags_missing_braces=-Wno-missing-braces
956 AC_MSG_CHECKING([whether ${CC} accepts -Wnarrowing])
958 AC_TRY_COMPILE(,, aros_narrowing="yes", aros_narrowing="no")
959 AC_MSG_RESULT($aros_narrowing)
960 if test "x-$aros_narrowing" = "x-yes" ; then
961 aros_warnflags_narrowing=-Wnarrowing
962 aros_nowarnflags_narrowing=-Wno-narrowing
965 AC_MSG_CHECKING([whether ${CC} accepts -Wvolatile-register-var])
966 CFLAGS=-Wvolatile-register-var
967 AC_TRY_COMPILE(,, aros_volatile_register_var="yes", aros_volatile_register_var="no")
968 AC_MSG_RESULT($aros_volatile_register_var)
969 if test "x-$aros_volatile_register_var" = "x-yes" ; then
970 aros_warnflags_volatile_register_var=-Wvolatile-register-var
971 aros_nowarnflags_volatile_register_var=-Wno-volatile-register-var
974 AC_MSG_CHECKING([whether ${CC} accepts -Wsizeof-pointer-memaccess])
975 CFLAGS=-Wsizeof-pointer-memaccess
976 AC_TRY_COMPILE(,, aros_sizeof_pointer_memaccess="yes", aros_sizeof_pointer_memaccess="no")
977 AC_MSG_RESULT($aros_sizeof_pointer_memaccess)
978 if test "x-$aros_sizeof_pointer_memaccess" = "x-yes" ; then
979 aros_warnflags_sizeof_pointer_memaccess=-Wsizeof-pointer-memaccess
980 aros_nowarnflags_sizeof_pointer_memaccess=-Wno-sizeof-pointer-memaccess
983 AC_MSG_CHECKING([whether ${CC} accepts -Wreturn-type])
985 AC_TRY_COMPILE(,, aros_return_type="yes", aros_return_type="no")
986 AC_MSG_RESULT($aros_return_type)
987 if test "x-$aros_return_type" = "x-yes" ; then
988 aros_warnflags_return_type=-Wreturn-type
989 aros_nowarnflags_return_type=-Wno-return-type
992 AC_MSG_CHECKING([whether ${CC} accepts -Wformat-zero-length])
993 CFLAGS=-Wformat-zero-length
994 AC_TRY_COMPILE(,, aros_format_zero_length="yes", aros_format_zero_length="no")
995 AC_MSG_RESULT($aros_format_zero_length)
996 if test "x-$aros_format_zero_length" = "x-yes" ; then
997 aros_warnflags_format_zero_length=-Wformat-zero-length
998 aros_nowarnflags_format_zero_length=-Wno-format-zero-length
1001 AC_MSG_CHECKING([whether ${CC} accepts -Wlto-type-mismatch])
1002 CFLAGS=-Wlto-type-mismatch
1003 AC_TRY_COMPILE(,, aros_lto_type_mismatch="yes", aros_lto_type_mismatch="no")
1004 AC_MSG_RESULT($aros_lto_type_mismatch)
1005 if test "x-$aros_lto_type_mismatch" = "x-yes" ; then
1006 aros_warnflags_lto_type_mismatch=-Wlto-type-mismatch
1007 aros_nowarnflags_lto_type_mismatch=-Wno-lto-type-mismatch
1010 AC_MSG_CHECKING([whether ${CC} accepts -Wtautological-compare])
1011 CFLAGS=-Wtautological-compare
1012 AC_TRY_COMPILE(,, aros_tautological_compare="yes", aros_tautological_compare="no")
1013 AC_MSG_RESULT($aros_tautological_compare)
1014 if test "x-$aros_tautological_compare" = "x-yes" ; then
1015 aros_warnflags_tautological_compare=-Wtautological-compare
1016 aros_nowarnflags_tautological_compare=-Wno-tautological-compare
1019 AC_MSG_CHECKING([whether ${CC} accepts -Wempty-body])
1021 AC_TRY_COMPILE(,, aros_empty_body="yes", aros_empty_body="no")
1022 AC_MSG_RESULT($aros_empty_body)
1023 if test "x-$aros_empty_body" = "x-yes" ; then
1024 aros_warnflags_empty_body=-Wempty-body
1025 aros_nowarnflags_empty_body=-Wno-empty-body
1028 AC_MSG_CHECKING([whether ${CC} accepts -Wformat-overflow])
1029 CFLAGS=-Wformat-overflow
1030 AC_TRY_COMPILE(,, aros_format_overflow="yes", aros_format_overflow="no")
1031 AC_MSG_RESULT($aros_format_overflow)
1032 if test "x-$aros_format_overflow" = "x-yes" ; then
1033 aros_warnflags_format_overflow=-Wformat-overflow
1034 aros_nowarnflags_format_overflow=-Wno-format-overflow
1037 AC_MSG_CHECKING([whether ${CC} accepts -Wstringop-overflow])
1038 CFLAGS=-Wstringop-overflow
1039 AC_TRY_COMPILE(,, aros_stringop_overflow="yes", aros_stringop_overflow="no")
1040 AC_MSG_RESULT($aros_stringop_overflow)
1041 if test "x-$aros_stringop_overflow" = "x-yes" ; then
1042 aros_warnflags_stringop_overflow=-Wstringop-overflow
1043 aros_nowarnflags_stringop_overflow=-Wno-stringop-overflow
1046 AC_MSG_CHECKING([whether ${CC} accepts -Wformat-truncation])
1047 CFLAGS=-Wformat-truncation
1048 AC_TRY_COMPILE(,, aros_format_truncation="yes", aros_format_truncation="no")
1049 AC_MSG_RESULT($aros_format_truncation)
1050 if test "x-$aros_format_truncation" = "x-yes" ; then
1051 aros_warnflags_format_truncation=-Wformat-truncation
1052 aros_nowarnflags_format_truncation=-Wno-format-truncation
1055 AC_MSG_CHECKING([whether ${CC} accepts -Wstringop-truncation])
1056 CFLAGS=-Wstringop-truncation
1057 AC_TRY_COMPILE(,, aros_stringop_truncation="yes", aros_stringop_truncation="no")
1058 AC_MSG_RESULT($aros_stringop_truncation)
1059 if test "x-$aros_stringop_truncation" = "x-yes" ; then
1060 aros_warnflags_stringop_truncation=-Wstringop-truncation
1061 aros_nowarnflags_stringop_truncation=-Wno-stringop-truncation
1064 AC_MSG_CHECKING([whether ${CC} accepts -Wshift-negative-value])
1065 CFLAGS=-Wshift-negative-value
1066 AC_TRY_COMPILE(,, aros_shift_negative_value="yes", aros_shift_negative_value="no")
1067 AC_MSG_RESULT($aros_shift_negative_value)
1068 if test "x-$aros_shift_negative_value" = "x-yes" ; then
1069 aros_warnflags_shift_negative_value=-Wshift-negative-value
1070 aros_nowarnflags_shift_negative_value=-Wno-shift-negative-value
1073 AC_MSG_CHECKING([whether ${CC} accepts -Wmissing-field-initializers])
1074 CFLAGS=-Wmissing-field-initializers
1075 AC_TRY_COMPILE(,, aros_missing_field_initializers="yes", aros_missing_field_initializers="no")
1076 AC_MSG_RESULT($aros_missing_field_initializers)
1077 if test "x-$aros_missing_field_initializers" = "x-yes" ; then
1078 aros_warnflags_missing_field_initializers=-Wmissing-field-initializers
1079 aros_nowarnflags_missing_field_initializers=-Wno-missing-field-initializers
1082 AC_MSG_CHECKING([whether ${CC} accepts -Wimplicit-fallthrough])
1083 CFLAGS=-Wimplicit-fallthrough
1084 AC_TRY_COMPILE(,, aros_implicit_fallthrough="yes", aros_implicit_fallthrough="no")
1085 AC_MSG_RESULT($aros_implicit_fallthrough)
1086 if test "x-$aros_implicit_fallthrough" = "x-yes" ; then
1087 aros_warnflags_implicit_fallthrough=-Wimplicit-fallthrough
1088 aros_nowarnflags_implicit_fallthrough=-Wno-implicit-fallthrough
1091 AC_MSG_CHECKING([whether ${CC} accepts -Wmissing-prototypes])
1092 CFLAGS=-Wmissing-prototypes
1093 AC_TRY_COMPILE(,, aros_missing_prototypes="yes", aros_missing_prototypes="no")
1094 AC_MSG_RESULT($aros_missing_prototypes)
1095 if test "x-$aros_missing_prototypes" = "x-yes" ; then
1096 aros_warnflags_missing_prototypes=-Wmissing-prototypes
1097 aros_nowarnflags_missing_prototypes=-Wno-missing-prototypes
1100 AC_MSG_CHECKING([whether ${CC} accepts -Wclass-memaccess])
1101 CFLAGS=-Wclass-memaccess
1102 AC_TRY_COMPILE(,, aros_class_memaccess="yes", aros_class_memaccess="no")
1103 AC_MSG_RESULT($aros_class_memaccess)
1104 if test "x-$aros_class_memaccess" = "x-yes" ; then
1105 aros_warnflags_class_memaccess=-Wclass-memaccess
1106 aros_nowarnflags_class_memaccess=-Wno-class-memaccess
1109 AC_MSG_CHECKING([whether ${CC} accepts -Wint-in-bool-context])
1110 CFLAGS=-Wint-in-bool-context
1111 AC_TRY_COMPILE(,, aros_int_in_bool_context="yes", aros_int_in_bool_context="no")
1112 AC_MSG_RESULT($aros_int_in_bool_context)
1113 if test "x-$aros_int_in_bool_context" = "x-yes" ; then
1114 aros_warnflags_int_in_bool_context=-Wint-in-bool-context
1115 aros_nowarnflags_int_in_bool_context=-Wno-int-in-bool-context
1117 CFLAGS="$save_cflags"
1119 # Check the C++ warnings
1121 save_cxxflags="$CXXFLAGS"
1123 AC_MSG_CHECKING([whether ${CXX} accepts -Wconversion-null])
1124 CXXFLAGS=-Wconversion-null
1125 AC_TRY_COMPILE(,, aros_conversion_null="yes", aros_conversion_null="no")
1126 AC_MSG_RESULT($aros_conversion_null)
1127 if test "x-$aros_conversion_null" = "x-yes" ; then
1128 aros_warnflags_conversion_null=-Wconversion-null
1129 aros_nowarnflags_conversion_null=-Wno-conversion-null
1132 CXXFLAGS="$save_cxxflags"
1136 #########################################################
1138 # Now check what we need to use with the toolchain
1140 cat >$AROS_DEVELOPER/include/__testsincdir.h <<_ACEOF
1141 /* Copyright (c) The AROS Dev Team */
1142 #define _TESTINCFOUND
1145 AC_MSG_CHECKING([if we need to use --sysroot])
1146 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
1148 #include <__testsincdir.h>
1149 #ifndef _TESTINCFOUND
1150 error: Couldnt find include!
1153 [toolchain_needs_sysroot=no],
1154 [toolchain_needs_sysroot=yes])
1155 AC_MSG_RESULT($toolchain_needs_sysroot)
1157 if test "$toolchain_needs_sysroot" = "yes" ; then
1158 aros_toolchain_sysroot="--sysroot $""(AROS_DEVELOPER)"
1161 #AC_MSG_CHECKING([if we need to use --isysroot])
1162 #AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
1164 # (#include <__testsincdir.h>
1165 # #ifndef _TESTINCFOUND
1166 # error: Couldnt find include!
1169 # [toolchain_needs_isysroot=no],
1170 # [toolchain_needs_isysroot=yes])
1171 #AC_MSG_RESULT($toolchain_needs_isysroot)
1173 #if test "$toolchain_needs_isysroot" = "yes" ; then
1174 # aros_toolchain_isysroot="-isysroot $""(AROS_SDK)"
1175 # aros_toolchain_iarchdir="-I $""(AROS_SDK)/$""(AROS_TARGET_CPU)-aros/include"
1177 rm -f $AROS_DEVELOPER/include/__testsincdir.h
1180 # export the feature flags...
1182 AC_SUBST(aros_cflags_exceptions)
1183 AC_SUBST(aros_cflags_noexceptions)
1184 AC_SUBST(aros_cxxflags_permissive)
1185 AC_SUBST(aros_cxxflags_nopermissive)
1186 AC_SUBST(aros_cxxflags_rtti)
1187 AC_SUBST(aros_cxxflags_nortti)
1188 AC_SUBST(aros_cflags_fast_math)
1189 AC_SUBST(aros_cflags_associative_math)
1190 AC_SUBST(aros_cflags_no_math_errno)
1191 AC_SUBST(aros_cflags_no_trapping_math)
1192 AC_SUBST(aros_cflags_tree_vectorize)
1193 AC_SUBST(aros_cflags_lto)
1194 AC_SUBST(aros_cflags_nolto)
1195 AC_SUBST(aros_cflags_whole_program)
1196 AC_SUBST(aros_cflags_loop_block)
1197 AC_SUBST(aros_cflags_loop_interchange)
1198 AC_SUBST(aros_cflags_loop_strip_mine)
1199 AC_SUBST(aros_cflags_peel_loops)
1200 AC_SUBST(aros_cflags_unroll_loops)
1202 AC_SUBST(aros_cflags_strictaliasing)
1203 AC_SUBST(aros_cflags_nostrictaliasing)
1205 AC_SUBST(aros_cflags_inlinesmallfunctions)
1206 AC_SUBST(aros_cflags_noinlinesmallfunctions)
1208 AC_SUBST(aros_cflags_ipacp)
1209 AC_SUBST(aros_cflags_noipacp)
1211 AC_SUBST(aros_cflags_omitfp)
1212 AC_SUBST(aros_cflags_noomitfp)
1214 AC_SUBST(aros_cflags_profilearcs)
1215 AC_SUBST(aros_cflags_noprofilearcs)
1217 AC_SUBST(aros_cflags_testcoverage)
1218 AC_SUBST(aros_cflags_notestcoverage)
1220 AC_SUBST(aros_cflags_instrfuncs)
1221 AC_SUBST(aros_cflags_noinstrfuncs)
1223 AC_SUBST(aros_cflags_alignednew)
1224 AC_SUBST(aros_cflags_noalignednew)
1226 AC_SUBST(aros_cflags_builtin)
1227 AC_SUBST(aros_cflags_no_builtin)
1228 AC_SUBST(aros_cflags_no_builtin_floor)
1229 AC_SUBST(aros_cflags_no_builtin_vsnprintf)
1231 AC_SUBST(aros_cflags_freestanding)
1232 AC_SUBST(aros_cflags_no_freestanding)
1234 AC_SUBST(aros_cflags_asynchronous_unwind_tables)
1235 AC_SUBST(aros_cflags_no_asynchronous_unwind_tables)
1237 AC_SUBST(aros_cflags_visibility_hidden)
1240 AC_SUBST(aros_cflags_isystem)
1241 AC_SUBST(aros_cflags_isystem_end)
1242 AC_SUBST(aros_cflags_iquote)
1243 AC_SUBST(aros_cflags_iquote_end)
1246 # export the feature options...
1248 AC_SUBST(aros_cflags_red_zone)
1249 AC_SUBST(aros_cflags_no_red_zone)
1250 AC_SUBST(aros_cflags_ms_bitfields)
1251 AC_SUBST(aros_cflags_no_ms_bitfields)
1254 # ...and warning flags...
1256 AC_SUBST(aros_warnflags_error)
1257 AC_SUBST(aros_nowarnflags_error)
1258 AC_SUBST(aros_warnflags_all)
1259 AC_SUBST(aros_warnflags_restrict)
1260 AC_SUBST(aros_nowarnflags_restrict)
1261 AC_SUBST(aros_warnflags_unused_command_line_argument)
1262 AC_SUBST(aros_nowarnflags_unused_command_line_argument)
1263 AC_SUBST(aros_warnflags_unknown_warning_option)
1264 AC_SUBST(aros_nowarnflags_unknown_warning_option)
1265 AC_SUBST(aros_warnflags_unused_but_set_variable)
1266 AC_SUBST(aros_nowarnflags_unused_but_set_variable)
1267 AC_SUBST(aros_warnflags_strict_aliasing)
1268 AC_SUBST(aros_nowarnflags_strict_aliasing)
1269 AC_SUBST(aros_warnflags_array_bounds)
1270 AC_SUBST(aros_nowarnflags_array_bounds)
1271 AC_SUBST(aros_warnflags_enum_compare)
1272 AC_SUBST(aros_nowarnflags_enum_compare)
1273 AC_SUBST(aros_warnflags_strict_prototypes)
1274 AC_SUBST(aros_nowarnflags_strict_prototypes)
1275 AC_SUBST(aros_warnflags_strict_overflow)
1276 AC_SUBST(aros_nowarnflags_strict_overflow)
1277 AC_SUBST(aros_warnflags_format_security)
1278 AC_SUBST(aros_nowarnflags_format_security)
1279 AC_SUBST(aros_warnflags_misleading_indentation)
1280 AC_SUBST(aros_nowarnflags_misleading_indentation)
1281 AC_SUBST(aros_warnflags_nonnull_compare)
1282 AC_SUBST(aros_nowarnflags_nonnull_compare)
1283 AC_SUBST(aros_warnflags_unused)
1284 AC_SUBST(aros_nowarnflags_unused)
1285 AC_SUBST(aros_warnflags_unused_label)
1286 AC_SUBST(aros_nowarnflags_unused_label)
1287 AC_SUBST(aros_warnflags_unused_value)
1288 AC_SUBST(aros_nowarnflags_unused_value)
1289 AC_SUBST(aros_warnflags_unused_variable)
1290 AC_SUBST(aros_nowarnflags_unused_variable)
1291 AC_SUBST(aros_warnflags_unused_function)
1292 AC_SUBST(aros_nowarnflags_unused_function)
1293 AC_SUBST(aros_warnflags_unused_parameter)
1294 AC_SUBST(aros_nowarnflags_unused_parameter)
1295 AC_SUBST(aros_warnflags_uninitialized)
1296 AC_SUBST(aros_nowarnflags_uninitialized)
1297 AC_SUBST(aros_warnflags_maybe_uninitialized)
1298 AC_SUBST(aros_nowarnflags_maybe_uninitialized)
1299 AC_SUBST(aros_warnflags_implicit_function_declaration)
1300 AC_SUBST(aros_nowarnflags_implicit_function_declaration)
1301 AC_SUBST(aros_warnflags_format)
1302 AC_SUBST(aros_nowarnflags_format)
1303 AC_SUBST(aros_warnflags_parentheses)
1304 AC_SUBST(aros_nowarnflags_parentheses)
1305 AC_SUBST(aros_warnflags_char_subscripts)
1306 AC_SUBST(aros_nowarnflags_char_subscripts)
1307 AC_SUBST(aros_warnflags_endif_labels)
1308 AC_SUBST(aros_nowarnflags_endif_labels)
1309 AC_SUBST(aros_warnflags_format_contains_nul)
1310 AC_SUBST(aros_nowarnflags_format_contains_nul)
1311 AC_SUBST(aros_warnflags_implicit_int)
1312 AC_SUBST(aros_nowarnflags_implicit_int)
1313 AC_SUBST(aros_warnflags_aggressive_loop_optimizations)
1314 AC_SUBST(aros_nowarnflags_aggressive_loop_optimizations)
1315 AC_SUBST(aros_warnflags_cpp)
1316 AC_SUBST(aros_nowarnflags_cpp)
1317 AC_SUBST(aros_warnflags_switch)
1318 AC_SUBST(aros_nowarnflags_switch)
1319 AC_SUBST(aros_warnflags_discarded_qualifiers)
1320 AC_SUBST(aros_nowarnflags_discarded_qualifiers)
1321 AC_SUBST(aros_warnflags_sequence_point)
1322 AC_SUBST(aros_nowarnflags_sequence_point)
1323 AC_SUBST(aros_warnflags_unknown_pragmas)
1324 AC_SUBST(aros_nowarnflags_unknown_pragmas)
1325 AC_SUBST(aros_warnflags_discarded_array_qualifiers)
1326 AC_SUBST(aros_nowarnflags_discarded_array_qualifiers)
1327 AC_SUBST(aros_warnflags_int_conversion)
1328 AC_SUBST(aros_nowarnflags_int_conversion)
1329 AC_SUBST(aros_warnflags_int_to_pointer_cast)
1330 AC_SUBST(aros_nowarnflags_int_to_pointer_cast)
1331 AC_SUBST(aros_warnflags_pointer_to_int_cast)
1332 AC_SUBST(aros_nowarnflags_pointer_to_int_cast)
1333 AC_SUBST(aros_warnflags_unused_const_variable)
1334 AC_SUBST(aros_nowarnflags_unused_const_variable)
1335 AC_SUBST(aros_warnflags_write_strings)
1336 AC_SUBST(aros_nowarnflags_write_strings)
1337 AC_SUBST(aros_warnflags_comment)
1338 AC_SUBST(aros_nowarnflags_comment)
1339 AC_SUBST(aros_warnflags_incompatible_pointer_types)
1340 AC_SUBST(aros_nowarnflags_incompatible_pointer_types)
1341 AC_SUBST(aros_warnflags_bool_compare)
1342 AC_SUBST(aros_nowarnflags_bool_compare)
1343 AC_SUBST(aros_warnflags_logical_not_parentheses)
1344 AC_SUBST(aros_nowarnflags_logical_not_parentheses)
1345 AC_SUBST(aros_warnflags_pointer_sign)
1346 AC_SUBST(aros_nowarnflags_pointer_sign)
1347 AC_SUBST(aros_warnflags_shift_overflow)
1348 AC_SUBST(aros_nowarnflags_shift_overflow)
1349 AC_SUBST(aros_warnflags_frame_address)
1350 AC_SUBST(aros_nowarnflags_frame_address)
1351 AC_SUBST(aros_warnflags_deprecated_declarations)
1352 AC_SUBST(aros_nowarnflags_deprecated_declarations)
1353 AC_SUBST(aros_warnflags_sign_compare)
1354 AC_SUBST(aros_nowarnflags_sign_compare)
1355 AC_SUBST(aros_warnflags_attributes)
1356 AC_SUBST(aros_nowarnflags_attributes)
1357 AC_SUBST(aros_warnflags_overflow)
1358 AC_SUBST(aros_nowarnflags_overflow)
1359 AC_SUBST(aros_warnflags_unused_local_typedefs)
1360 AC_SUBST(aros_nowarnflags_unused_local_typedefs)
1361 AC_SUBST(aros_warnflags_missing_braces)
1362 AC_SUBST(aros_nowarnflags_missing_braces)
1363 AC_SUBST(aros_warnflags_conversion_null)
1364 AC_SUBST(aros_nowarnflags_conversion_null)
1365 AC_SUBST(aros_warnflags_narrowing)
1366 AC_SUBST(aros_nowarnflags_narrowing)
1367 AC_SUBST(aros_warnflags_volatile_register_var)
1368 AC_SUBST(aros_nowarnflags_volatile_register_var)
1369 AC_SUBST(aros_warnflags_sizeof_pointer_memaccess)
1370 AC_SUBST(aros_nowarnflags_sizeof_pointer_memaccess)
1371 AC_SUBST(aros_warnflags_return_type)
1372 AC_SUBST(aros_nowarnflags_return_type)
1373 AC_SUBST(aros_warnflags_format_zero_length)
1374 AC_SUBST(aros_nowarnflags_format_zero_length)
1375 AC_SUBST(aros_warnflags_lto_type_mismatch)
1376 AC_SUBST(aros_nowarnflags_lto_type_mismatch)
1377 AC_SUBST(aros_warnflags_tautological_compare)
1378 AC_SUBST(aros_nowarnflags_tautological_compare)
1379 AC_SUBST(aros_warnflags_empty_body)
1380 AC_SUBST(aros_nowarnflags_empty_body)
1381 AC_SUBST(aros_warnflags_format_overflow)
1382 AC_SUBST(aros_nowarnflags_format_overflow)
1383 AC_SUBST(aros_warnflags_stringop_overflow)
1384 AC_SUBST(aros_nowarnflags_stringop_overflow)
1385 AC_SUBST(aros_warnflags_format_truncation)
1386 AC_SUBST(aros_nowarnflags_format_truncation)
1387 AC_SUBST(aros_warnflags_stringop_truncation)
1388 AC_SUBST(aros_nowarnflags_stringop_truncation)
1389 AC_SUBST(aros_warnflags_shift_negative_value)
1390 AC_SUBST(aros_nowarnflags_shift_negative_value)
1391 AC_SUBST(aros_warnflags_missing_field_initializers)
1392 AC_SUBST(aros_nowarnflags_missing_field_initializers)
1393 AC_SUBST(aros_warnflags_implicit_fallthrough)
1394 AC_SUBST(aros_nowarnflags_implicit_fallthrough)
1395 AC_SUBST(aros_warnflags_missing_prototypes)
1396 AC_SUBST(aros_nowarnflags_missing_prototypes)
1397 AC_SUBST(aros_warnflags_class_memaccess)
1398 AC_SUBST(aros_nowarnflags_class_memaccess)
1399 AC_SUBST(aros_warnflags_int_in_bool_context)
1400 AC_SUBST(aros_nowarnflags_int_in_bool_context)
1402 # Additional toolchain support ...
1403 AC_SUBST(aros_toolchain_sysroot)
1406 ${aros_targetcfg_dir}/compiler.cfg:compiler.cfg.in