revert 213 commits (to 56092) from the last month. 10 still need work to resolve...
[AROS.git] / config / features.in
blob4b194b736673571563d7f4fba1dd8aae458de435
1 dnl Copyright © 1997-2019, The AROS Development Team. All rights reserved.
2 dnl $Id$
3 dnl
4 dnl Desc: Autoconf source for target compiler feature detection
5 dnl Lang: english 
7 # Note: After file changes, generate features anew and commit _both_ files.
8 -------------------------
10 AC_INIT(../mmakefile)
11 AC_PREREQ(2.61)
12 AC_CONFIG_AUX_DIR(../scripts/autoconf)
14 AROS_BUILDDIR=`${PWDCMD-pwd}`
15 AROS_BUILDDIR_UNIX=${PWD}
17 srcpwd=`cd ${srcdir} ; ${PWDCMD-pwd}`
18 SRCDIR=${srcpwd}
20 NOLINKFLAGS="-nostdlib -nostartfiles"
21 LDFLAGS=$NOLINKFLAGS
22 # The first step is to find the binaries.
23 AC_PROG_CC
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!])
29 else
30     aros_targetcfg_dir="$targetcfg_dir"
32 AC_MSG_RESULT($aros_targetcfg_dir)
34 #-----------------------------------------------------------------------------
36 # Check if the target compiler supports some features:
37 # C/ObjC
38 #  -fexceptions
39 #  -ffast-math
40 #  -flto
41 #  -fwhole-program
42 #  -floop-block
43 #  -floop-interchange
44 #  -floop-strip-mine
45 #  -fpeel-loops
46 #  -fstrict-aliasing
47 #  -finline-small-functions
48 #  -fipa-cp
49 #  -funroll-loops
50 #  -fomit-frame-pointer
51 #  -fprofile-arcs
52 #  -ftest-coverage
53 #  -finstrument-functions
54 #  -faligned-new
56 #  -fno-builtin
57 #  -fno-builtin-floor
58 #  -fno-builtin-vsnprintf
60 #  -ffreestanding
61 #  -fasynchronous-unwind-tables
63 # C++/ObjC++
64 #  -fpermissive
65 #  -frtti
67 # C features first 
68 AC_LANG_PUSH(C)
70 save_cflags="$CFLAGS"
71 AC_MSG_CHECKING([whether ${CC} accepts -fexceptions])
72 CFLAGS=-fexceptions
73 AC_TRY_COMPILE(,, aros_exceptions="yes", aros_exceptions="no")
74 AC_MSG_RESULT($aros_exceptions)
75 if test "x-$aros_exceptions" = "x-yes" ; then
76     aros_cflags_exceptions=-fexceptions
77     aros_cflags_noexceptions=-fno-exceptions
80 AC_MSG_CHECKING([whether ${CC} accepts -ffast-math])
81 CFLAGS=-ffast-math
82 AC_TRY_COMPILE(,, aros_fast_math="yes", aros_fast_math="no")
83 AC_MSG_RESULT($aros_fast_math)
84 if test "x-$aros_fast_math" = "x-yes" ; then
85     aros_cflags_fast_math=-ffast-math
88 AC_MSG_CHECKING([whether ${CC} accepts -flto])
89 CFLAGS=-flto
90 AC_TRY_COMPILE(,, aros_lto="yes", aros_lto="no")
91 AC_MSG_RESULT($aros_lto)
92 if test "x-$aros_lto" = "x-yes" ; then
93     aros_cflags_lto=-flto
94     aros_cflags_nolto=-fno-lto
95     
96     AC_MSG_CHECKING([whether ${CC} accepts -fwhole-program])
97     CFLAGS=-fwhole-program
98     AC_TRY_COMPILE(,, aros_whole_program="yes", aros_whole_program="no")
99     AC_MSG_RESULT($aros_whole_program)
100     if test "x-$aros_whole_program" = "x-yes" ; then
101         aros_cflags_whole_program=-fwhole-program
102     fi
103     
104     AC_MSG_CHECKING([whether ${CC} accepts -floop-block])
105     CFLAGS=-floop-block
106     AC_TRY_COMPILE(,, aros_loop_block="yes", aros_loop_block="no")
107     AC_MSG_RESULT($aros_loop_block)
108     if test "x-$aros_loop_block" = "x-yes" ; then
109         aros_cflags_loop_block=-floop-block
110     fi
111     
112     AC_MSG_CHECKING([whether ${CC} accepts -floop-interchange])
113     CFLAGS=-floop-interchange
114     AC_TRY_COMPILE(,, aros_loop_interchange="yes", aros_loop_interchange="no")
115     AC_MSG_RESULT($aros_loop_interchange)
116     if test "x-$aros_loop_interchange" = "x-yes" ; then
117         aros_cflags_loop_interchange=-floop-interchange
118     fi
119     
120     AC_MSG_CHECKING([whether ${CC} accepts -floop-strip-mine])
121     CFLAGS=-floop-strip-mine
122     AC_TRY_COMPILE(,, aros_loop_strip_mine="yes", aros_loop_strip_mine="no")
123     AC_MSG_RESULT($aros_loop_strip_mine)
124     if test "x-$aros_loop_strip_mine" = "x-yes" ; then
125         aros_cflags_loop_strip_mine=-floop-strip-mine
126     fi
129 AC_MSG_CHECKING([whether ${CC} accepts -fpeel-loops])
130 CFLAGS=-fpeel-loops
131 AC_TRY_COMPILE(,, aros_peel_loops="yes", aros_peel_loops="no")
132 AC_MSG_RESULT($aros_peel_loops)
133 if test "x-$aros_peel_loops" = "x-yes" ; then
134     aros_cflags_peel_loops=-fpeel-loops
137 AC_MSG_CHECKING([whether ${CC} accepts -funroll-loops])
138 CFLAGS=-funroll-loops
139 AC_TRY_COMPILE(,, aros_unroll_loops="yes", aros_unroll_loops="no")
140 AC_MSG_RESULT($aros_unroll_loops)
141 if test "x-$aros_unroll_loops" = "x-yes" ; then
142     aros_cflags_unroll_loops=-funroll-loops
145 AC_MSG_CHECKING([whether ${CC} accepts -fstrict-aliasing])
146 CFLAGS=-fstrict-aliasing
147 AC_TRY_COMPILE(,, aros_strict_aliasing="yes", aros_strict_aliasing="no")
148 AC_MSG_RESULT($aros_strict_aliasing)
149 if test "x-$aros_strict_aliasing" = "x-yes" ; then
150     aros_cflags_strictaliasing=-fstrict-aliasing
151     aros_cflags_nostrictaliasing=-fno-strict-aliasing
154 AC_MSG_CHECKING([whether ${CC} accepts -finline-small-functions])
155 CFLAGS=-finline-small-functions
156 AC_TRY_COMPILE(,, aros_inline_small_functions="yes", aros_inline_small_functions="no")
157 AC_MSG_RESULT($aros_inline_small_functions)
158 if test "x-$aros_inline_small_functions" = "x-yes" ; then
159     aros_cflags_inlinesmallfunctions=-finline-small-functions
160     aros_cflags_noinlinesmallfunctions=-fno-inline-small-functions
163 AC_MSG_CHECKING([whether ${CC} accepts -fipa-cp])
164 CFLAGS=-fipa-cp
165 AC_TRY_COMPILE(,, aros_ipa_cp="yes", aros_ipa_cp="no")
166 AC_MSG_RESULT($aros_ipa_cp)
167 if test "x-$aros_ipa_cp" = "x-yes" ; then
168     aros_cflags_ipacp=-fipa-cp
169     aros_cflags_noipacp=-fno-ipa-cp
172 AC_MSG_CHECKING([whether ${CC} accepts -fomit-frame-pointer])
173 CFLAGS=-fomit-frame-pointer
174 AC_TRY_COMPILE(,, aros_omit_frame_pointer="yes", aros_omit_frame_pointer="no")
175 AC_MSG_RESULT($aros_omit_frame_pointer)
176 if test "x-$aros_omit_frame_pointer" = "x-yes" ; then
177     aros_cflags_omitfp=-fomit-frame-pointer
178     aros_cflags_noomitfp=-fno-omit-frame-pointer
181 AC_MSG_CHECKING([whether ${CC} accepts -fprofile-arcs])
182 CFLAGS=-fprofile-arcs
183 AC_TRY_COMPILE(,, aros_profile_arcs="yes", aros_profile_arcs="no")
184 AC_MSG_RESULT($aros_profile_arcs)
185 if test "x-$aros_profile_arcs" = "x-yes" ; then
186     aros_cflags_profilearcs=-fprofile-arcs
187     aros_cflags_noprofilearcs=-fno-profile-arcs
190 AC_MSG_CHECKING([whether ${CC} accepts -ftest-coverage])
191 CFLAGS=-ftest-coverage
192 AC_TRY_COMPILE(,, aros_test_coverage="yes", aros_test_coverage="no")
193 AC_MSG_RESULT($aros_test_coverage)
194 if test "x-$aros_test_coverage" = "x-yes" ; then
195     aros_cflags_testcoverage=-ftest-coverage
196     aros_cflags_notestcoverage=-fno-test-coverage
199 AC_MSG_CHECKING([whether ${CC} accepts -finstrument-functions])
200 CFLAGS=-finstrument-functions
201 AC_TRY_COMPILE(,, aros_instrument_functions="yes", aros_instrument_functions="no")
202 AC_MSG_RESULT($aros_instrument_functions)
203 if test "x-$aros_instrument_functions" = "x-yes" ; then
204     aros_cflags_instrfuncs=-finstrument-functions
205     aros_cflags_noinstrfuncs=-fno-instrument-functions
208 AC_MSG_CHECKING([whether ${CC} accepts -faligned-new])
209 CFLAGS=-faligned-new
210 AC_TRY_COMPILE(,, aros_aligned_new="yes", aros_aligned_new="no")
211 AC_MSG_RESULT($aros_aligned_new)
212 if test "x-$aros_aligned_new" = "x-yes" ; then
213     aros_cflags_alignednew=-faligned-new
214     aros_cflags_noalignednew=-fno-aligned-new
217 AC_MSG_CHECKING([whether ${CC} accepts -fbuiltin])
218 CFLAGS=-fbuiltin
219 AC_TRY_COMPILE(,, aros_builtin="yes", aros_builtin="no")
220 AC_MSG_RESULT($aros_builtin)
221 if test "x-$aros_builtin" = "x-yes" ; then
222     aros_cflags_builtin=-fbuiltin
223     aros_cflags_no_builtin=-fno-builtin
226 AC_MSG_CHECKING([whether ${CC} accepts -fno-builtin-floor])
227 CFLAGS=-fno-builtin-floor
228 AC_TRY_COMPILE(,, aros_no_builtin_floor="yes", aros_no_builtin_floor="no")
229 AC_MSG_RESULT($aros_no_builtin_floor)
230 if test "x-$aros_no_builtin_floor" = "x-yes" ; then
231     aros_cflags_no_builtin_floor=-fno-builtin-floor
234 AC_MSG_CHECKING([whether ${CC} accepts -fno-builtin-vsnprintf])
235 CFLAGS=-fno-builtin-vsnprintf
236 AC_TRY_COMPILE(,, aros_no_builtin_vsnprintf="yes", aros_no_builtin_vsnprintf="no")
237 AC_MSG_RESULT($aros_no_builtin_vsnprintf)
238 if test "x-$aros_no_builtin_vsnprintf" = "x-yes" ; then
239     aros_cflags_no_builtin_vsnprintf=-fno-builtin-vsnprintf
242 AC_MSG_CHECKING([whether ${CC} accepts -ffreestanding])
243 CFLAGS=-ffreestanding
244 AC_TRY_COMPILE(,, aros_freestanding="yes", aros_freestanding="no")
245 AC_MSG_RESULT($aros_freestanding)
246 if test "x-$aros_freestanding" = "x-yes" ; then
247     aros_cflags_freestanding=-ffreestanding
248     aros_cflags_no_freestanding=-fno-freestanding
251 AC_MSG_CHECKING([whether ${CC} accepts -fasynchronous-unwind-tables])
252 CFLAGS=-fasynchronous-unwind-tables
253 AC_TRY_COMPILE(,, aros_asynchronous_unwind_tables="yes", aros_asynchronous_unwind_tables="no")
254 AC_MSG_RESULT($aros_asynchronous_unwind_tables)
255 if test "x-$aros_asynchronous_unwind_tables" = "x-yes" ; then
256     aros_cflags_asynchronous_unwind_tables=-fasynchronous-unwind-tables
257     aros_cflags_no_asynchronous_unwind_tables=-fno-asynchronous-unwind-tables
260 # C++ features
261 AC_LANG_PUSH(C++)
262 save_cxxflags="$CXXFLAGS"
264 AC_MSG_CHECKING([whether ${CXX} accepts -fpermissive])
265 CXXFLAGS=-fpermissive
266 AC_TRY_COMPILE(,, aros_permissive="yes", aros_permissive="no")
267 AC_MSG_RESULT($aros_permissive)
268 if test "x-$aros_permissive" = "x-yes" ; then
269     aros_cxxflags_permissive=-fpermissive
270     aros_cxxflags_nopermissive=-fno-permissive
273 AC_MSG_CHECKING([whether ${CXX} accepts -frtti])
274 CXXFLAGS=-frtti
275 AC_TRY_COMPILE(,, aros_rtti="yes", aros_rtti="no")
276 AC_MSG_RESULT($aros_rtti)
277 if test "x-$aros_rtti" = "x-yes" ; then
278     aros_cxxflags_rtti=-frtti
279     aros_cxxflags_nortti=-fno-rtti
282 CXXFLAGS="$save_cxxflags"
285 # Check for additional C compiler options..
286 AC_LANG_PUSH(C)
288 #-----------------------------------------------------------------------------
290 # Check if the target compiler supports some include directory options:
292 AC_MSG_CHECKING([whether ${CC} accepts -iquote])
293 CFLAGS="-iquote."
294 AC_TRY_COMPILE(,, has_iquote="yes", has_iquote="no")
295 AC_MSG_RESULT($has_iquote)
296 if test "x-$has_iquote" = "x-yes" ; then
297     aros_cflags_iquote=-iquote
298     aros_cflags_iquote_end=
299 else
300     aros_cflags_iquote=-I
301     aros_cflags_iquote_end=-I-
304 AC_MSG_CHECKING([whether ${CC} accepts -isystem])
305 CFLAGS="-isystem."
306 AC_TRY_COMPILE(,, has_isystem="yes", has_isystem="no")
307 AC_MSG_RESULT($has_isystem)
308 if test "x-$has_isystem" = "x-yes" ; then
309     aros_cflags_isystem=-isystem
310     aros_cflags_isystem_end=
311 else
312     aros_cflags_isystem=-I
313     aros_cflags_isystem_end=
316 #-----------------------------------------------------------------------------
318 # Check if the target compiler supports some ISA options:
319 #  -mno-red-zone
321 AC_MSG_CHECKING([whether ${CC} accepts -mred-zone])
322 CFLAGS=-mred-zone
323 AC_TRY_COMPILE(,, aros_no_red_zone="yes", aros_no_red_zone="no")
324 AC_MSG_RESULT($aros_no_red_zone)
325 if test "x-$aros_no_red_zone" = "x-yes" ; then
326     aros_cflags_red_zone=-mred-zone
327     aros_cflags_no_red_zone=-mno-red-zone
330 AC_MSG_CHECKING([whether ${CC} accepts -mms-bitfields])
331 CFLAGS=-mms-bitfields
332 AC_TRY_COMPILE(,, aros_ms_bitfields="yes", aros_ms_bitfields="no")
333 AC_MSG_RESULT($aros_ms_bitfields)
334 if test "x-$aros_ms_bitfields" = "x-yes" ; then
335     aros_cflags_ms_bitfields=-mms-bitfields
336     aros_cflags_no_ms_bitfields=-mno-ms-bitfields
339 CFLAGS="$save_cflags"
341 #-----------------------------------------------------------------------------
343 # Check if the target compiler supports some options used for de-linting:
344 #  -Werror
345 #  -Wall
346 #  -Wrestrict
347 #  -Wunused-command-line-argument
348 #  -Wunknown-warning-option
349 #  -Wunused-but-set-variable
350 #  -Wstrict-aliasing
351 #  -Warray-bounds
352 #  -Wenum-compare
353 #  -Wstrict-prototypes
354 #  -Wstrict-overflow
355 #  -Wformat-security
356 #  -Wmisleading-indentation
357 #  -Wnonnull-compare
358 #  -Wunused
359 #  -Wunused-label
360 #  -Wunused-value
361 #  -Wunused-variable
362 #  -Wunused-function
363 #  -Wunused-parameter
364 #  -Wuninitialized
365 #  -Wmaybe-uninitialized
366 #  -Wimplicit-function-declaration
367 #  -Wformat
368 #  -Wparentheses
369 #  -Wchar-subscripts
370 #  -Wendif-labels
371 #  -Wformat-contains-nul
372 #  -Wimplicit-int
373 #  -Waggressive-loop-optimizations
374 #  -Wcpp
375 #  -Wswitch
376 #  -Wdiscarded-qualifiers
377 #  -Wsequence-point
378 #  -Wunknown-pragmas
379 #  -Wdiscarded-array-qualifiers
380 #  -Wint-conversion
381 #  -Wint-to-pointer-cast
382 #  -Wpointer-to-int-cast
383 #  -Wunused-const-variable
384 #  -Wwrite-strings 
385 #  -Wcomment
386 #  -Wincompatible-pointer-types
387 #  -Wbool-compare
388 #  -Wlogical-not-parentheses
389 #  -Wpointer-sign
390 #  -Wshift-overflow
391 #  -Wframe-address
392 #  -Wdeprecated-declarations
393 #  -Wsign-compare
394 #  -Wattributes
395 #  -Woverflow
396 #  -Wunused-local-typedefs
397 #  -Wmissing-braces
398 #  -Wconversion-null
399 #  -Wnarrowing
400 #  -Wvolatile-register-var
401 #  -Wsizeof-pointer-memaccess
402 #  -Wreturn-type
403 #  -Wformat-zero-length
404 #  -Wlto-type-mismatch
405 #  -Wtautological-compare
406 #  -Wempty-body
407 #  -Wformat-overflow
408 #  -Wstringop-overflow
409 #  -Wformat-truncation
410 #  -Wstringop-truncation
411 #  -Wshift-negative-value
412 #  -Wmissing-field-initializers
413 #  -Wimplicit-fallthrough
414 #  -Wmissing-prototypes
415 #  -Wclass-memaccess
416 #  -Wint-in-bool-context
418 # C warnings first
419 AC_LANG_PUSH(C)
421 save_cflags="$CFLAGS"
422 AC_MSG_CHECKING([whether ${CC} accepts -Werror])
423 CFLAGS=-Werror
424 AC_TRY_COMPILE(,, aros_error="yes", aros_error="no")
425 AC_MSG_RESULT($aros_error)
426 if test "x-$aros_error" = "x-yes" ; then
427     aros_warnflags_error=-Werror
428     aros_nowarnflags_error=-Wno-error
431 AC_MSG_CHECKING([whether ${CC} accepts -Wall])
432 CFLAGS=-Wall
433 AC_TRY_COMPILE(,, aros_all="yes", aros_all="no")
434 AC_MSG_RESULT($aros_all)
435 if test "x-$aros_all" = "x-yes" ; then
436     aros_warnflags_all=-Wall
439 AC_MSG_CHECKING([whether ${CC} accepts -Wrestrict])
440 CFLAGS=-Wrestrict
441 AC_TRY_COMPILE(,, aros_restrict="yes", aros_restrict="no")
442 AC_MSG_RESULT($aros_restrict)
443 if test "x-$aros_restrict" = "x-yes" ; then
444     aros_warnflags_restrict=-Wrestrict
445     aros_nowarnflags_restrict=-Wno-restrict
448 AC_MSG_CHECKING([whether ${CC} accepts -Wunused-command-line-argument])
449 CFLAGS=-Wunused-command-line-argument
450 AC_TRY_COMPILE(,, aros_unused_command_line_argument="yes", aros_unused_command_line_argument="no")
451 AC_MSG_RESULT($aros_unused_command_line_argument)
452 if test "x-$aros_unused_command_line_argument" = "x-yes" ; then
453     aros_warnflags_unused_command_line_argument=-Wunused-command-line-argument
454     aros_nowarnflags_unused_command_line_argument=-Wno-unused-command-line-argument
457 AC_MSG_CHECKING([whether ${CC} accepts -Wunknown-warning-option])
458 CFLAGS=-Wunknown-warning-option
459 AC_TRY_COMPILE(,, aros_unknown_warning_option="yes", aros_unknown_warning_option="no")
460 AC_MSG_RESULT($aros_unknown_warning_option)
461 if test "x-$aros_unknown_warning_option" = "x-yes" ; then
462     aros_warnflags_unknown_warning_option=-Wunknown-warning-option
463     aros_nowarnflags_unknown_warning_option=-Wno-unknown-warning-option
466 AC_MSG_CHECKING([whether ${CC} accepts -Wunused-but-set-variable])
467 CFLAGS=-Wunused-but-set-variable
468 AC_TRY_COMPILE(,, aros_unused_but_set_variable="yes", aros_unused_but_set_variable="no")
469 AC_MSG_RESULT($aros_unused_but_set_variable)
470 if test "x-$aros_unused_but_set_variable" = "x-yes" ; then
471     aros_warnflags_unused_but_set_variable=-Wunused-but-set-variable
472     aros_nowarnflags_unused_but_set_variable=-Wno-unused-but-set-variable
475 AC_MSG_CHECKING([whether ${CC} accepts -Wstrict-aliasing])
476 CFLAGS=-Wstrict-aliasing
477 AC_TRY_COMPILE(,, aros_strict_aliasing="yes", aros_strict_aliasing="no")
478 AC_MSG_RESULT($aros_strict_aliasing)
479 if test "x-$aros_strict_aliasing" = "x-yes" ; then
480     aros_warnflags_strict_aliasing=-Wstrict-aliasing
481     aros_nowarnflags_strict_aliasing=-Wno-strict-aliasing
484 AC_MSG_CHECKING([whether ${CC} accepts -Warray-bounds])
485 CFLAGS=-Warray-bounds
486 AC_TRY_COMPILE(,, aros_array_bounds="yes", aros_array_bounds="no")
487 AC_MSG_RESULT($aros_array_bounds)
488 if test "x-$aros_array_bounds" = "x-yes" ; then
489     aros_warnflags_array_bounds=-Warray-bounds
490     aros_nowarnflags_array_bounds=-Wno-array-bounds
493 AC_MSG_CHECKING([whether ${CC} accepts -Wenum-compare])
494 CFLAGS=-Wenum-compare
495 AC_TRY_COMPILE(,, aros_enum_compare="yes", aros_enum_compare="no")
496 AC_MSG_RESULT($aros_enum_compare)
497 if test "x-$aros_enum_compare" = "x-yes" ; then
498     aros_warnflags_enum_compare=-Wenum-compare
499     aros_nowarnflags_enum_compare=-Wno-enum-compare
502 AC_MSG_CHECKING([whether ${CC} accepts -Wstrict-prototypes])
503 CFLAGS=-Wstrict-prototypes
504 AC_TRY_COMPILE(,, aros_strict_prototypes="yes", aros_strict_prototypes="no")
505 AC_MSG_RESULT($aros_strict_prototypes)
506 if test "x-$aros_strict_prototypes" = "x-yes" ; then
507     aros_warnflags_strict_prototypes=-Wstrict-prototypes
508     aros_nowarnflags_strict_prototypes=-Wno-strict-prototypes
511 AC_MSG_CHECKING([whether ${CC} accepts -Wstrict-overflow])
512 CFLAGS=-Wstrict-overflow
513 AC_TRY_COMPILE(,, aros_strict_overflow="yes", aros_strict_overflow="no")
514 AC_MSG_RESULT($aros_strict_overflow)
515 if test "x-$aros_strict_overflow" = "x-yes" ; then
516     aros_warnflags_strict_overflow=-Wstrict-overflow
517     aros_nowarnflags_strict_overflow=-Wno-strict-overflow
520 AC_MSG_CHECKING([whether ${CC} accepts -Wformat-security])
521 CFLAGS=-Wformat-security
522 AC_TRY_COMPILE(,, aros_format_security="yes", aros_format_security="no")
523 AC_MSG_RESULT($aros_format_security)
524 if test "x-$aros_format_security" = "x-yes" ; then
525     aros_warnflags_format_security=-Wformat-security
526     aros_nowarnflags_format_security=-Wno-format-security
529 AC_MSG_CHECKING([whether ${CC} accepts -Wmisleading-indentation])
530 CFLAGS=-Wmisleading-indentation
531 AC_TRY_COMPILE(,, aros_misleading_indentation="yes", aros_misleading_indentation="no")
532 AC_MSG_RESULT($aros_misleading_indentation)
533 if test "x-$aros_misleading_indentation" = "x-yes" ; then
534     aros_warnflags_misleading_indentation=-Wmisleading-indentation
535     aros_nowarnflags_misleading_indentation=-Wno-misleading-indentation
538 AC_MSG_CHECKING([whether ${CC} accepts -Wnonnull-compare])
539 CFLAGS=-Wnonnull-compare
540 AC_TRY_COMPILE(,, aros_nonnull_compare="yes", aros_nonnull_compare="no")
541 AC_MSG_RESULT($aros_nonnull_compare)
542 if test "x-$aros_nonnull_compare" = "x-yes" ; then
543     aros_warnflags_nonnull_compare=-Wnonnull-compare
544     aros_nowarnflags_nonnull_compare=-Wno-nonnull-compare
547 AC_MSG_CHECKING([whether ${CC} accepts -Wunused])
548 CFLAGS=-Wunused
549 AC_TRY_COMPILE(,, aros_unused="yes", aros_unused="no")
550 AC_MSG_RESULT($aros_unused)
551 if test "x-$aros_unused" = "x-yes" ; then
552     aros_warnflags_unused=-Wunused
553     aros_nowarnflags_unused=-Wno-unused
556 AC_MSG_CHECKING([whether ${CC} accepts -Wunused-label])
557 CFLAGS=-Wunused-label
558 AC_TRY_COMPILE(,, aros_unused_label="yes", aros_unused_label="no")
559 AC_MSG_RESULT($aros_unused_label)
560 if test "x-$aros_unused_label" = "x-yes" ; then
561     aros_warnflags_unused_label=-Wunused-label
562     aros_nowarnflags_unused_label=-Wno-unused-label
565 AC_MSG_CHECKING([whether ${CC} accepts -Wunused-value])
566 CFLAGS=-Wunused-value
567 AC_TRY_COMPILE(,, aros_unused_value="yes", aros_unused_value="no")
568 AC_MSG_RESULT($aros_unused_value)
569 if test "x-$aros_unused_value" = "x-yes" ; then
570     aros_warnflags_unused_value=-Wunused-value
571     aros_nowarnflags_unused_value=-Wno-unused-value
574 AC_MSG_CHECKING([whether ${CC} accepts -Wunused-variable])
575 CFLAGS=-Wunused-variable
576 AC_TRY_COMPILE(,, aros_unused_variable="yes", aros_unused_variable="no")
577 AC_MSG_RESULT($aros_unused_variable)
578 if test "x-$aros_unused_variable" = "x-yes" ; then
579     aros_warnflags_unused_variable=-Wunused-variable
580     aros_nowarnflags_unused_variable=-Wno-unused-variable
583 AC_MSG_CHECKING([whether ${CC} accepts -Wunused-function])
584 CFLAGS=-Wunused-function
585 AC_TRY_COMPILE(,, aros_unused_function="yes", aros_unused_function="no")
586 AC_MSG_RESULT($aros_unused_function)
587 if test "x-$aros_unused_function" = "x-yes" ; then
588     aros_warnflags_unused_function=-Wunused-function
589     aros_nowarnflags_unused_function=-Wno-unused-function
592 AC_MSG_CHECKING([whether ${CC} accepts -Wunused-parameter])
593 CFLAGS=-Wunused-parameter
594 AC_TRY_COMPILE(,, aros_unused_parameter="yes", aros_unused_parameter="no")
595 AC_MSG_RESULT($aros_unused_parameter)
596 if test "x-$aros_unused_parameter" = "x-yes" ; then
597     aros_warnflags_unused_parameter=-Wunused-parameter
598     aros_nowarnflags_unused_parameter=-Wno-unused-parameter
601 AC_MSG_CHECKING([whether ${CC} accepts -Wuninitialized])
602 CFLAGS=-Wuninitialized
603 AC_TRY_COMPILE(,, aros_uninitialized="yes", aros_uninitialized="no")
604 AC_MSG_RESULT($aros_uninitialized)
605 if test "x-$aros_uninitialized" = "x-yes" ; then
606     aros_warnflags_uninitialized=-Wuninitialized
607     aros_nowarnflags_uninitialized=-Wno-uninitialized
610 AC_MSG_CHECKING([whether ${CC} accepts -Wmaybe-uninitialized])
611 CFLAGS=-Wmaybe-uninitialized
612 AC_TRY_COMPILE(,, aros_maybe_uninitialized="yes", aros_maybe_uninitialized="no")
613 AC_MSG_RESULT($aros_maybe_uninitialized)
614 if test "x-$aros_maybe_uninitialized" = "x-yes" ; then
615     aros_warnflags_maybe_uninitialized=-Wmaybe-uninitialized
616     aros_nowarnflags_maybe_uninitialized=-Wno-maybe-uninitialized
617 else
618     aros_warnflags_maybe_uninitialized=$aros_warnflags_uninitialized
619     aros_nowarnflags_maybe_uninitialized=$aros_nowarnflags_uninitialized
622 AC_MSG_CHECKING([whether ${CC} accepts -Wimplicit-function-declaration])
623 CFLAGS=-Wimplicit-function-declaration
624 AC_TRY_COMPILE(,, aros_implicit_function_declaration="yes", aros_implicit_function_declaration="no")
625 AC_MSG_RESULT($aros_implicit_function_declaration)
626 if test "x-$aros_implicit_function_declaration" = "x-yes" ; then
627     aros_warnflags_implicit_function_declaration=-Wimplicit-function-declaration
628     aros_nowarnflags_implicit_function_declaration=-Wno-implicit-function-declaration
631 AC_MSG_CHECKING([whether ${CC} accepts -Wformat])
632 CFLAGS=-Wformat
633 AC_TRY_COMPILE(,, aros_format="yes", aros_format="no")
634 AC_MSG_RESULT($aros_format)
635 if test "x-$aros_format" = "x-yes" ; then
636     aros_warnflags_format=-Wformat
637     aros_nowarnflags_format=-Wno-format
640 AC_MSG_CHECKING([whether ${CC} accepts -Wparentheses])
641 CFLAGS=-Wparentheses
642 AC_TRY_COMPILE(,, aros_parentheses="yes", aros_parentheses="no")
643 AC_MSG_RESULT($aros_parentheses)
644 if test "x-$aros_parentheses" = "x-yes" ; then
645     aros_warnflags_parentheses=-Wparentheses
646     aros_nowarnflags_parentheses=-Wno-parentheses
649 AC_MSG_CHECKING([whether ${CC} accepts -Wchar-subscripts])
650 CFLAGS=-Wchar-subscripts
651 AC_TRY_COMPILE(,, aros_char_subscripts="yes", aros_char_subscripts="no")
652 AC_MSG_RESULT($aros_char_subscripts)
653 if test "x-$aros_char_subscripts" = "x-yes" ; then
654     aros_warnflags_char_subscripts=-Wchar-subscripts
655     aros_nowarnflags_char_subscripts=-Wno-char-subscripts
658 AC_MSG_CHECKING([whether ${CC} accepts -Wendif-labels])
659 CFLAGS=-Wendif-labels
660 AC_TRY_COMPILE(,, aros_endif_labels="yes", aros_endif_labels="no")
661 AC_MSG_RESULT($aros_endif_labels)
662 if test "x-$aros_endif_labels" = "x-yes" ; then
663     aros_warnflags_endif_labels=-Wendif-labels
664     aros_nowarnflags_endif_labels=-Wno-endif-labels
667 AC_MSG_CHECKING([whether ${CC} accepts -Wformat-contains-nul])
668 CFLAGS=-Wformat-contains-nul
669 AC_TRY_COMPILE(,, aros_format_contains_nul="yes", aros_format_contains_nul="no")
670 AC_MSG_RESULT($aros_format_contains_nul)
671 if test "x-$aros_format_contains_nul" = "x-yes" ; then
672     aros_warnflags_format_contains_nul=-Wformat-contains-nul
673     aros_nowarnflags_format_contains_nul=-Wno-format-contains-nul
676 AC_MSG_CHECKING([whether ${CC} accepts -Wimplicit-int])
677 CFLAGS=-Wimplicit-int
678 AC_TRY_COMPILE(,, aros_implicit_int="yes", aros_implicit_int="no")
679 AC_MSG_RESULT($aros_implicit_int)
680 if test "x-$aros_implicit_int" = "x-yes" ; then
681     aros_warnflags_implicit_int=-Wimplicit-int
682     aros_nowarnflags_implicit_int=-Wno-implicit-int
685 AC_MSG_CHECKING([whether ${CC} accepts -Waggressive-loop-optimizations])
686 CFLAGS=-Waggressive-loop-optimizations
687 AC_TRY_COMPILE(,, aros_aggressive_loop_optimizations="yes", aros_aggressive_loop_optimizations="no")
688 AC_MSG_RESULT($aros_aggressive_loop_optimizations)
689 if test "x-$aros_aggressive_loop_optimizations" = "x-yes" ; then
690     aros_warnflags_aggressive_loop_optimizations=-Waggressive-loop-optimizations
691     aros_nowarnflags_aggressive_loop_optimizations=-Wno-aggressive-loop-optimizations
694 AC_MSG_CHECKING([whether ${CC} accepts -Wcpp])
695 CFLAGS=-Wcpp
696 AC_TRY_COMPILE(,, aros_cpp="yes", aros_cpp="no")
697 AC_MSG_RESULT($aros_cpp)
698 if test "x-$aros_cpp" = "x-yes" ; then
699     aros_warnflags_cpp=-Wcpp
700     aros_nowarnflags_cpp=-Wno-cpp
703 AC_MSG_CHECKING([whether ${CC} accepts -Wswitch])
704 CFLAGS=-Wswitch
705 AC_TRY_COMPILE(,, aros_switch="yes", aros_switch="no")
706 AC_MSG_RESULT($aros_switch)
707 if test "x-$aros_switch" = "x-yes" ; then
708     aros_warnflags_switch=-Wswitch
709     aros_nowarnflags_switch=-Wno-switch
712 AC_MSG_CHECKING([whether ${CC} accepts -Wdiscarded-qualifiers])
713 CFLAGS=-Wdiscarded-qualifiers
714 AC_TRY_COMPILE(,, aros_discarded_qualifiers="yes", aros_discarded_qualifiers="no")
715 AC_MSG_RESULT($aros_discarded_qualifiers)
716 if test "x-$aros_discarded_qualifiers" = "x-yes" ; then
717     aros_warnflags_discarded_qualifiers=-Wdiscarded-qualifiers
718     aros_nowarnflags_discarded_qualifiers=-Wno-discarded-qualifiers
721 AC_MSG_CHECKING([whether ${CC} accepts -Wsequence-point])
722 CFLAGS=-Wsequence-point
723 AC_TRY_COMPILE(,, aros_sequence_point="yes", aros_sequence_point="no")
724 AC_MSG_RESULT($aros_sequence_point)
725 if test "x-$aros_sequence_point" = "x-yes" ; then
726     aros_warnflags_sequence_point=-Wsequence-point
727     aros_nowarnflags_sequence_point=-Wno-sequence-point
730 AC_MSG_CHECKING([whether ${CC} accepts -Wunknown-pragmas])
731 CFLAGS=-Wunknown-pragmas
732 AC_TRY_COMPILE(,, aros_unknown_pragmas="yes", aros_unknown_pragmas="no")
733 AC_MSG_RESULT($aros_unknown_pragmas)
734 if test "x-$aros_unknown_pragmas" = "x-yes" ; then
735     aros_warnflags_unknown_pragmas=-Wunknown-pragmas
736     aros_nowarnflags_unknown_pragmas=-Wno-unknown-pragmas
739 AC_MSG_CHECKING([whether ${CC} accepts -Wdiscarded-array-qualifiers])
740 CFLAGS=-Wdiscarded-array-qualifiers
741 AC_TRY_COMPILE(,, aros_discarded_array_qualifiers="yes", aros_discarded_array_qualifiers="no")
742 AC_MSG_RESULT($aros_discarded_array_qualifiers)
743 if test "x-$aros_discarded_array_qualifiers" = "x-yes" ; then
744     aros_warnflags_discarded_array_qualifiers=-Wdiscarded-array-qualifiers
745     aros_nowarnflags_discarded_array_qualifiers=-Wno-discarded-array-qualifiers
748 AC_MSG_CHECKING([whether ${CC} accepts -Wint-conversion])
749 CFLAGS=-Wint-conversion
750 AC_TRY_COMPILE(,, aros_int_conversion="yes", aros_int_conversion="no")
751 AC_MSG_RESULT($aros_int_conversion)
752 if test "x-$aros_int_conversion" = "x-yes" ; then
753     aros_warnflags_int_conversion=-Wint-conversion
754     aros_nowarnflags_int_conversion=-Wno-int-conversion
757 AC_MSG_CHECKING([whether ${CC} accepts -Wint-to-pointer-cast])
758 CFLAGS=-Wint-to-pointer-cast
759 AC_TRY_COMPILE(,, aros_int_to_pointer_cast="yes", aros_int_to_pointer_cast="no")
760 AC_MSG_RESULT($aros_int_to_pointer_cast)
761 if test "x-$aros_int_to_pointer_cast" = "x-yes" ; then
762     aros_warnflags_int_to_pointer_cast=-Wint-to-pointer-cast
763     aros_nowarnflags_int_to_pointer_cast=-Wno-int-to-pointer-cast
766 AC_MSG_CHECKING([whether ${CC} accepts -Wpointer-to-int-cast])
767 CFLAGS=-Wpointer-to-int-cast
768 AC_TRY_COMPILE(,, aros_pointer_to_int_cast="yes", aros_pointer_to_int_cast="no")
769 AC_MSG_RESULT($aros_pointer_to_int_cast)
770 if test "x-$aros_pointer_to_int_cast" = "x-yes" ; then
771     aros_warnflags_pointer_to_int_cast=-Wpointer-to-int-cast
772     aros_nowarnflags_pointer_to_int_cast=-Wno-pointer-to-int-cast
775 AC_MSG_CHECKING([whether ${CC} accepts -Wunused-const-variable])
776 CFLAGS=-Wunused-const-variable
777 AC_TRY_COMPILE(,, aros_unused_const_variable="yes", aros_unused_const_variable="no")
778 AC_MSG_RESULT($aros_unused_const_variable)
779 if test "x-$aros_unused_const_variable" = "x-yes" ; then
780     aros_warnflags_unused_const_variable=-Wunused-const-variable
781     aros_nowarnflags_unused_const_variable=-Wno-unused-const-variable
784 AC_MSG_CHECKING([whether ${CC} accepts -Wwrite-strings])
785 CFLAGS=-Wwrite-strings
786 AC_TRY_COMPILE(,, aros_write_strings="yes", aros_write_strings="no")
787 AC_MSG_RESULT($aros_write_strings)
788 if test "x-$aros_write_strings" = "x-yes" ; then
789     aros_warnflags_write_strings=-Wwrite-strings
790     aros_nowarnflags_write_strings=-Wno-write-strings
793 AC_MSG_CHECKING([whether ${CC} accepts -Wcomment])
794 CFLAGS=-Wcomment
795 AC_TRY_COMPILE(,, aros_comment="yes", aros_comment="no")
796 AC_MSG_RESULT($aros_comment)
797 if test "x-$aros_comment" = "x-yes" ; then
798     aros_warnflags_comment=-Wcomment
799     aros_nowarnflags_comment=-Wno-comment
802 AC_MSG_CHECKING([whether ${CC} accepts -Wincompatible-pointer-types])
803 CFLAGS=-Wincompatible-pointer-types
804 AC_TRY_COMPILE(,, aros_incompatible_pointer_types="yes", aros_incompatible_pointer_types="no")
805 AC_MSG_RESULT($aros_incompatible_pointer_types)
806 if test "x-$aros_incompatible_pointer_types" = "x-yes" ; then
807     aros_warnflags_incompatible_pointer_types=-Wincompatible-pointer-types
808     aros_nowarnflags_incompatible_pointer_types=-Wno-incompatible-pointer-types
811 AC_MSG_CHECKING([whether ${CC} accepts -Wbool-compare])
812 CFLAGS=-Wbool-compare
813 AC_TRY_COMPILE(,, aros_bool_compare="yes", aros_bool_compare="no")
814 AC_MSG_RESULT($aros_bool_compare)
815 if test "x-$aros_bool_compare" = "x-yes" ; then
816     aros_warnflags_bool_compare=-Wbool-compare
817     aros_nowarnflags_bool_compare=-Wno-bool-compare
820 AC_MSG_CHECKING([whether ${CC} accepts -Wlogical-not-parentheses])
821 CFLAGS=-Wlogical-not-parentheses
822 AC_TRY_COMPILE(,, aros_logical_not_parentheses="yes", aros_logical_not_parentheses="no")
823 AC_MSG_RESULT($aros_logical_not_parentheses)
824 if test "x-$aros_logical_not_parentheses" = "x-yes" ; then
825     aros_warnflags_logical_not_parentheses=-Wlogical-not-parentheses
826     aros_nowarnflags_logical_not_parentheses=-Wno-logical-not-parentheses
829 AC_MSG_CHECKING([whether ${CC} accepts -Wpointer-sign])
830 CFLAGS=-Wpointer-sign
831 AC_TRY_COMPILE(,, aros_pointer_sign="yes", aros_pointer_sign="no")
832 AC_MSG_RESULT($aros_pointer_sign)
833 if test "x-$aros_pointer_sign" = "x-yes" ; then
834     aros_warnflags_pointer_sign=-Wpointer-sign
835     aros_nowarnflags_pointer_sign=-Wno-pointer-sign
838 AC_MSG_CHECKING([whether ${CC} accepts -Wshift-overflow])
839 CFLAGS=-Wshift-overflow
840 AC_TRY_COMPILE(,, aros_shift_overflow="yes", aros_shift_overflow="no")
841 AC_MSG_RESULT($aros_shift_overflow)
842 if test "x-$aros_shift_overflow" = "x-yes" ; then
843     aros_warnflags_shift_overflow=-Wshift-overflow
844     aros_nowarnflags_shift_overflow=-Wno-shift-overflow
847 AC_MSG_CHECKING([whether ${CC} accepts -Wframe-address])
848 CFLAGS=-Wframe-address
849 AC_TRY_COMPILE(,, aros_frame_address="yes", aros_frame_address="no")
850 AC_MSG_RESULT($aros_frame_address)
851 if test "x-$aros_frame_address" = "x-yes" ; then
852     aros_warnflags_frame_address=-Wframe-address
853     aros_nowarnflags_frame_address=-Wno-frame-address
856 AC_MSG_CHECKING([whether ${CC} accepts -Wdeprecated-declarations])
857 CFLAGS=-Wdeprecated-declarations
858 AC_TRY_COMPILE(,, aros_deprecated_declarations="yes", aros_deprecated_declarations="no")
859 AC_MSG_RESULT($aros_deprecated_declarations)
860 if test "x-$aros_deprecated_declarations" = "x-yes" ; then
861     aros_warnflags_deprecated_declarations=-Wdeprecated-declarations
862     aros_nowarnflags_deprecated_declarations=-Wno-deprecated-declarations
865 AC_MSG_CHECKING([whether ${CC} accepts -Wsign-compare])
866 CFLAGS=-Wsign-compare
867 AC_TRY_COMPILE(,, aros_sign_compare="yes", aros_sign_compare="no")
868 AC_MSG_RESULT($aros_sign_compare)
869 if test "x-$aros_sign_compare" = "x-yes" ; then
870     aros_warnflags_sign_compare=-Wsign-compare
871     aros_nowarnflags_sign_compare=-Wno-sign-compare
874 AC_MSG_CHECKING([whether ${CC} accepts -Wattributes])
875 CFLAGS=-Wattributes
876 AC_TRY_COMPILE(,, aros_attributes="yes", aros_attributes="no")
877 AC_MSG_RESULT($aros_attributes)
878 if test "x-$aros_attributes" = "x-yes" ; then
879     aros_warnflags_attributes=-Wattributes
880     aros_nowarnflags_attributes=-Wno-attributes
883 AC_MSG_CHECKING([whether ${CC} accepts -Woverflow])
884 CFLAGS=-Woverflow
885 AC_TRY_COMPILE(,, aros_overflow="yes", aros_overflow="no")
886 AC_MSG_RESULT($aros_overflow)
887 if test "x-$aros_overflow" = "x-yes" ; then
888     aros_warnflags_overflow=-Woverflow
889     aros_nowarnflags_overflow=-Wno-overflow
892 AC_MSG_CHECKING([whether ${CC} accepts -Wunused-local-typedefs])
893 CFLAGS=-Wunused-local-typedefs
894 AC_TRY_COMPILE(,, aros_unused_local_typedefs="yes", aros_unused_local_typedefs="no")
895 AC_MSG_RESULT($aros_unused_local_typedefs)
896 if test "x-$aros_unused_local_typedefs" = "x-yes" ; then
897     aros_warnflags_unused_local_typedefs=-Wunused-local-typedefs
898     aros_nowarnflags_unused_local_typedefs=-Wno-unused-local-typedefs
901 AC_MSG_CHECKING([whether ${CC} accepts -Wmissing-braces])
902 CFLAGS=-Wmissing-braces
903 AC_TRY_COMPILE(,, aros_missing_braces="yes", aros_missing_braces="no")
904 AC_MSG_RESULT($aros_missing_braces)
905 if test "x-$aros_missing_braces" = "x-yes" ; then
906     aros_warnflags_missing_braces=-Wmissing-braces
907     aros_nowarnflags_missing_braces=-Wno-missing-braces
910 AC_MSG_CHECKING([whether ${CC} accepts -Wnarrowing])
911 CFLAGS=-Wnarrowing
912 AC_TRY_COMPILE(,, aros_narrowing="yes", aros_narrowing="no")
913 AC_MSG_RESULT($aros_narrowing)
914 if test "x-$aros_narrowing" = "x-yes" ; then
915     aros_warnflags_narrowing=-Wnarrowing
916     aros_nowarnflags_narrowing=-Wno-narrowing
919 AC_MSG_CHECKING([whether ${CC} accepts -Wvolatile-register-var])
920 CFLAGS=-Wvolatile-register-var
921 AC_TRY_COMPILE(,, aros_volatile_register_var="yes", aros_volatile_register_var="no")
922 AC_MSG_RESULT($aros_volatile_register_var)
923 if test "x-$aros_volatile_register_var" = "x-yes" ; then
924     aros_warnflags_volatile_register_var=-Wvolatile-register-var
925     aros_nowarnflags_volatile_register_var=-Wno-volatile-register-var
928 AC_MSG_CHECKING([whether ${CC} accepts -Wsizeof-pointer-memaccess])
929 CFLAGS=-Wsizeof-pointer-memaccess
930 AC_TRY_COMPILE(,, aros_sizeof_pointer_memaccess="yes", aros_sizeof_pointer_memaccess="no")
931 AC_MSG_RESULT($aros_sizeof_pointer_memaccess)
932 if test "x-$aros_sizeof_pointer_memaccess" = "x-yes" ; then
933     aros_warnflags_sizeof_pointer_memaccess=-Wsizeof-pointer-memaccess
934     aros_nowarnflags_sizeof_pointer_memaccess=-Wno-sizeof-pointer-memaccess
937 AC_MSG_CHECKING([whether ${CC} accepts -Wreturn-type])
938 CFLAGS=-Wreturn-type
939 AC_TRY_COMPILE(,, aros_return_type="yes", aros_return_type="no")
940 AC_MSG_RESULT($aros_return_type)
941 if test "x-$aros_return_type" = "x-yes" ; then
942     aros_warnflags_return_type=-Wreturn-type
943     aros_nowarnflags_return_type=-Wno-return-type
946 AC_MSG_CHECKING([whether ${CC} accepts -Wformat-zero-length])
947 CFLAGS=-Wformat-zero-length
948 AC_TRY_COMPILE(,, aros_format_zero_length="yes", aros_format_zero_length="no")
949 AC_MSG_RESULT($aros_format_zero_length)
950 if test "x-$aros_format_zero_length" = "x-yes" ; then
951     aros_warnflags_format_zero_length=-Wformat-zero-length
952     aros_nowarnflags_format_zero_length=-Wno-format-zero-length
955 AC_MSG_CHECKING([whether ${CC} accepts -Wlto-type-mismatch])
956 CFLAGS=-Wlto-type-mismatch
957 AC_TRY_COMPILE(,, aros_lto_type_mismatch="yes", aros_lto_type_mismatch="no")
958 AC_MSG_RESULT($aros_lto_type_mismatch)
959 if test "x-$aros_lto_type_mismatch" = "x-yes" ; then
960     aros_warnflags_lto_type_mismatch=-Wlto-type-mismatch
961     aros_nowarnflags_lto_type_mismatch=-Wno-lto-type-mismatch
964 AC_MSG_CHECKING([whether ${CC} accepts -Wtautological-compare])
965 CFLAGS=-Wtautological-compare
966 AC_TRY_COMPILE(,, aros_tautological_compare="yes", aros_tautological_compare="no")
967 AC_MSG_RESULT($aros_tautological_compare)
968 if test "x-$aros_tautological_compare" = "x-yes" ; then
969     aros_warnflags_tautological_compare=-Wtautological-compare
970     aros_nowarnflags_tautological_compare=-Wno-tautological-compare
973 AC_MSG_CHECKING([whether ${CC} accepts -Wempty-body])
974 CFLAGS=-Wempty-body
975 AC_TRY_COMPILE(,, aros_empty_body="yes", aros_empty_body="no")
976 AC_MSG_RESULT($aros_empty_body)
977 if test "x-$aros_empty_body" = "x-yes" ; then
978     aros_warnflags_empty_body=-Wempty-body
979     aros_nowarnflags_empty_body=-Wno-empty-body
982 AC_MSG_CHECKING([whether ${CC} accepts -Wformat-overflow])
983 CFLAGS=-Wformat-overflow
984 AC_TRY_COMPILE(,, aros_format_overflow="yes", aros_format_overflow="no")
985 AC_MSG_RESULT($aros_format_overflow)
986 if test "x-$aros_format_overflow" = "x-yes" ; then
987     aros_warnflags_format_overflow=-Wformat-overflow
988     aros_nowarnflags_format_overflow=-Wno-format-overflow
991 AC_MSG_CHECKING([whether ${CC} accepts -Wstringop-overflow])
992 CFLAGS=-Wstringop-overflow
993 AC_TRY_COMPILE(,, aros_stringop_overflow="yes", aros_stringop_overflow="no")
994 AC_MSG_RESULT($aros_stringop_overflow)
995 if test "x-$aros_stringop_overflow" = "x-yes" ; then
996     aros_warnflags_stringop_overflow=-Wstringop-overflow
997     aros_nowarnflags_stringop_overflow=-Wno-stringop-overflow
1000 AC_MSG_CHECKING([whether ${CC} accepts -Wformat-truncation])
1001 CFLAGS=-Wformat-truncation
1002 AC_TRY_COMPILE(,, aros_format_truncation="yes", aros_format_truncation="no")
1003 AC_MSG_RESULT($aros_format_truncation)
1004 if test "x-$aros_format_truncation" = "x-yes" ; then
1005     aros_warnflags_format_truncation=-Wformat-truncation
1006     aros_nowarnflags_format_truncation=-Wno-format-truncation
1009 AC_MSG_CHECKING([whether ${CC} accepts -Wstringop-truncation])
1010 CFLAGS=-Wstringop-truncation
1011 AC_TRY_COMPILE(,, aros_stringop_truncation="yes", aros_stringop_truncation="no")
1012 AC_MSG_RESULT($aros_stringop_truncation)
1013 if test "x-$aros_stringop_truncation" = "x-yes" ; then
1014     aros_warnflags_stringop_truncation=-Wstringop-truncation
1015     aros_nowarnflags_stringop_truncation=-Wno-stringop-truncation
1018 AC_MSG_CHECKING([whether ${CC} accepts -Wshift-negative-value])
1019 CFLAGS=-Wshift-negative-value
1020 AC_TRY_COMPILE(,, aros_shift_negative_value="yes", aros_shift_negative_value="no")
1021 AC_MSG_RESULT($aros_shift_negative_value)
1022 if test "x-$aros_shift_negative_value" = "x-yes" ; then
1023     aros_warnflags_shift_negative_value=-Wshift-negative-value
1024     aros_nowarnflags_shift_negative_value=-Wno-shift-negative-value
1027 AC_MSG_CHECKING([whether ${CC} accepts -Wmissing-field-initializers])
1028 CFLAGS=-Wmissing-field-initializers
1029 AC_TRY_COMPILE(,, aros_missing_field_initializers="yes", aros_missing_field_initializers="no")
1030 AC_MSG_RESULT($aros_missing_field_initializers)
1031 if test "x-$aros_missing_field_initializers" = "x-yes" ; then
1032     aros_warnflags_missing_field_initializers=-Wmissing-field-initializers
1033     aros_nowarnflags_missing_field_initializers=-Wno-missing-field-initializers
1036 AC_MSG_CHECKING([whether ${CC} accepts -Wimplicit-fallthrough])
1037 CFLAGS=-Wimplicit-fallthrough
1038 AC_TRY_COMPILE(,, aros_implicit_fallthrough="yes", aros_implicit_fallthrough="no")
1039 AC_MSG_RESULT($aros_implicit_fallthrough)
1040 if test "x-$aros_implicit_fallthrough" = "x-yes" ; then
1041     aros_warnflags_implicit_fallthrough=-Wimplicit-fallthrough
1042     aros_nowarnflags_implicit_fallthrough=-Wno-implicit-fallthrough
1045 AC_MSG_CHECKING([whether ${CC} accepts -Wmissing-prototypes])
1046 CFLAGS=-Wmissing-prototypes
1047 AC_TRY_COMPILE(,, aros_missing_prototypes="yes", aros_missing_prototypes="no")
1048 AC_MSG_RESULT($aros_missing_prototypes)
1049 if test "x-$aros_missing_prototypes" = "x-yes" ; then
1050     aros_warnflags_missing_prototypes=-Wmissing-prototypes
1051     aros_nowarnflags_missing_prototypes=-Wno-missing-prototypes
1054 AC_MSG_CHECKING([whether ${CC} accepts -Wclass-memaccess])
1055 CFLAGS=-Wclass-memaccess
1056 AC_TRY_COMPILE(,, aros_class_memaccess="yes", aros_class_memaccess="no")
1057 AC_MSG_RESULT($aros_class_memaccess)
1058 if test "x-$aros_class_memaccess" = "x-yes" ; then
1059     aros_warnflags_class_memaccess=-Wclass-memaccess
1060     aros_nowarnflags_class_memaccess=-Wno-class-memaccess
1063 AC_MSG_CHECKING([whether ${CC} accepts -Wint-in-bool-context])
1064 CFLAGS=-Wint-in-bool-context
1065 AC_TRY_COMPILE(,, aros_int_in_bool_context="yes", aros_int_in_bool_context="no")
1066 AC_MSG_RESULT($aros_int_in_bool_context)
1067 if test "x-$aros_int_in_bool_context" = "x-yes" ; then
1068     aros_warnflags_int_in_bool_context=-Wint-in-bool-context
1069     aros_nowarnflags_int_in_bool_context=-Wno-int-in-bool-context
1071 CFLAGS="$save_cflags"
1073 # Check the C++ warnings
1074 AC_LANG_PUSH(C++)
1075 save_cxxflags="$CXXFLAGS"
1077 AC_MSG_CHECKING([whether ${CXX} accepts -Wconversion-null])
1078 CXXFLAGS=-Wconversion-null
1079 AC_TRY_COMPILE(,, aros_conversion_null="yes", aros_conversion_null="no")
1080 AC_MSG_RESULT($aros_conversion_null)
1081 if test "x-$aros_conversion_null" = "x-yes" ; then
1082     aros_warnflags_conversion_null=-Wconversion-null
1083     aros_nowarnflags_conversion_null=-Wno-conversion-null
1086 CXXFLAGS="$save_cxxflags"
1088 AC_LANG_PUSH(C)
1090 #########################################################
1092 # Now check what we need to use with the toolchain
1094 cat >$AROS_DEVELOPER/include/__testsincdir.h <<_ACEOF
1095 /* Copyright (c) The AROS Dev Team  */
1096 #define _TESTINCFOUND
1097 _ACEOF
1099 AC_MSG_CHECKING([if we need to use --sysroot])
1100 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
1101      [[
1102      #include <__testsincdir.h>
1103      #ifndef _TESTINCFOUND
1104       error: Couldnt find include!
1105      #endif
1106      ]])],
1107      [toolchain_needs_sysroot=no],
1108      [toolchain_needs_sysroot=yes])
1109 AC_MSG_RESULT($toolchain_needs_sysroot)
1111 if test "$toolchain_needs_sysroot" = "yes" ; then
1112     aros_toolchain_sysroot="--sysroot $""(AROS_DEVELOPER)"
1115 #AC_MSG_CHECKING([if we need to use --isysroot])
1116 #AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
1117 #     [[
1118 #     (#include <__testsincdir.h>
1119 #     #ifndef _TESTINCFOUND
1120 #      error: Couldnt find include!
1121 #     #endif
1122 #     ]])],
1123 #     [toolchain_needs_isysroot=no],
1124 #     [toolchain_needs_isysroot=yes])
1125 #AC_MSG_RESULT($toolchain_needs_isysroot)
1127 #if test "$toolchain_needs_isysroot" = "yes" ; then
1128 #    aros_toolchain_isysroot="-isysroot $""(AROS_SDK)"
1129 #    aros_toolchain_iarchdir="-I $""(AROS_SDK)/$""(AROS_TARGET_CPU)-aros/include"
1131 rm -f $AROS_DEVELOPER/include/__testsincdir.h
1134 # export the feature flags...
1136 AC_SUBST(aros_cflags_exceptions)
1137 AC_SUBST(aros_cflags_noexceptions)
1138 AC_SUBST(aros_cxxflags_permissive)
1139 AC_SUBST(aros_cxxflags_nopermissive)
1140 AC_SUBST(aros_cxxflags_rtti)
1141 AC_SUBST(aros_cxxflags_nortti)
1142 AC_SUBST(aros_cflags_fast_math)
1143 AC_SUBST(aros_cflags_lto)
1144 AC_SUBST(aros_cflags_nolto)
1145 AC_SUBST(aros_cflags_whole_program)
1146 AC_SUBST(aros_cflags_loop_block)
1147 AC_SUBST(aros_cflags_loop_interchange)
1148 AC_SUBST(aros_cflags_loop_strip_mine)
1149 AC_SUBST(aros_cflags_peel_loops)
1150 AC_SUBST(aros_cflags_unroll_loops)
1152 AC_SUBST(aros_cflags_strictaliasing)
1153 AC_SUBST(aros_cflags_nostrictaliasing)
1155 AC_SUBST(aros_cflags_inlinesmallfunctions)
1156 AC_SUBST(aros_cflags_noinlinesmallfunctions)
1158 AC_SUBST(aros_cflags_ipacp)
1159 AC_SUBST(aros_cflags_noipacp)
1161 AC_SUBST(aros_cflags_omitfp)
1162 AC_SUBST(aros_cflags_noomitfp)
1164 AC_SUBST(aros_cflags_profilearcs)
1165 AC_SUBST(aros_cflags_noprofilearcs)
1167 AC_SUBST(aros_cflags_testcoverage)
1168 AC_SUBST(aros_cflags_notestcoverage)
1170 AC_SUBST(aros_cflags_instrfuncs)
1171 AC_SUBST(aros_cflags_noinstrfuncs)
1173 AC_SUBST(aros_cflags_alignednew)
1174 AC_SUBST(aros_cflags_noalignednew)
1176 AC_SUBST(aros_cflags_builtin)
1177 AC_SUBST(aros_cflags_no_builtin)
1178 AC_SUBST(aros_cflags_no_builtin_floor)
1179 AC_SUBST(aros_cflags_no_builtin_vsnprintf)
1181 AC_SUBST(aros_cflags_freestanding)
1182 AC_SUBST(aros_cflags_no_freestanding)
1184 AC_SUBST(aros_cflags_asynchronous_unwind_tables)
1185 AC_SUBST(aros_cflags_no_asynchronous_unwind_tables)
1188 AC_SUBST(aros_cflags_isystem)
1189 AC_SUBST(aros_cflags_isystem_end)
1190 AC_SUBST(aros_cflags_iquote)
1191 AC_SUBST(aros_cflags_iquote_end)
1194 # export the feature options...
1196 AC_SUBST(aros_cflags_red_zone)
1197 AC_SUBST(aros_cflags_no_red_zone)
1198 AC_SUBST(aros_cflags_ms_bitfields)
1199 AC_SUBST(aros_cflags_no_ms_bitfields)
1202 # ...and warning flags...
1204 AC_SUBST(aros_warnflags_error)
1205 AC_SUBST(aros_nowarnflags_error)
1206 AC_SUBST(aros_warnflags_all)
1207 AC_SUBST(aros_warnflags_restrict)
1208 AC_SUBST(aros_nowarnflags_restrict)
1209 AC_SUBST(aros_warnflags_unused_command_line_argument)
1210 AC_SUBST(aros_nowarnflags_unused_command_line_argument)
1211 AC_SUBST(aros_warnflags_unknown_warning_option)
1212 AC_SUBST(aros_nowarnflags_unknown_warning_option)
1213 AC_SUBST(aros_warnflags_unused_but_set_variable)
1214 AC_SUBST(aros_nowarnflags_unused_but_set_variable)
1215 AC_SUBST(aros_warnflags_strict_aliasing)
1216 AC_SUBST(aros_nowarnflags_strict_aliasing)
1217 AC_SUBST(aros_warnflags_array_bounds)
1218 AC_SUBST(aros_nowarnflags_array_bounds)
1219 AC_SUBST(aros_warnflags_enum_compare)
1220 AC_SUBST(aros_nowarnflags_enum_compare)
1221 AC_SUBST(aros_warnflags_strict_prototypes)
1222 AC_SUBST(aros_nowarnflags_strict_prototypes)
1223 AC_SUBST(aros_warnflags_strict_overflow)
1224 AC_SUBST(aros_nowarnflags_strict_overflow)
1225 AC_SUBST(aros_warnflags_format_security)
1226 AC_SUBST(aros_nowarnflags_format_security)
1227 AC_SUBST(aros_warnflags_misleading_indentation)
1228 AC_SUBST(aros_nowarnflags_misleading_indentation)
1229 AC_SUBST(aros_warnflags_nonnull_compare)
1230 AC_SUBST(aros_nowarnflags_nonnull_compare)
1231 AC_SUBST(aros_warnflags_unused)
1232 AC_SUBST(aros_nowarnflags_unused)
1233 AC_SUBST(aros_warnflags_unused_label)
1234 AC_SUBST(aros_nowarnflags_unused_label)
1235 AC_SUBST(aros_warnflags_unused_value)
1236 AC_SUBST(aros_nowarnflags_unused_value)
1237 AC_SUBST(aros_warnflags_unused_variable)
1238 AC_SUBST(aros_nowarnflags_unused_variable)
1239 AC_SUBST(aros_warnflags_unused_function)
1240 AC_SUBST(aros_nowarnflags_unused_function)
1241 AC_SUBST(aros_warnflags_unused_parameter)
1242 AC_SUBST(aros_nowarnflags_unused_parameter)
1243 AC_SUBST(aros_warnflags_uninitialized)
1244 AC_SUBST(aros_nowarnflags_uninitialized)
1245 AC_SUBST(aros_warnflags_maybe_uninitialized)
1246 AC_SUBST(aros_nowarnflags_maybe_uninitialized)
1247 AC_SUBST(aros_warnflags_implicit_function_declaration)
1248 AC_SUBST(aros_nowarnflags_implicit_function_declaration)
1249 AC_SUBST(aros_warnflags_format)
1250 AC_SUBST(aros_nowarnflags_format)
1251 AC_SUBST(aros_warnflags_parentheses)
1252 AC_SUBST(aros_nowarnflags_parentheses)
1253 AC_SUBST(aros_warnflags_char_subscripts)
1254 AC_SUBST(aros_nowarnflags_char_subscripts)
1255 AC_SUBST(aros_warnflags_endif_labels)
1256 AC_SUBST(aros_nowarnflags_endif_labels)
1257 AC_SUBST(aros_warnflags_format_contains_nul)
1258 AC_SUBST(aros_nowarnflags_format_contains_nul)
1259 AC_SUBST(aros_warnflags_implicit_int)
1260 AC_SUBST(aros_nowarnflags_implicit_int)
1261 AC_SUBST(aros_warnflags_aggressive_loop_optimizations)
1262 AC_SUBST(aros_nowarnflags_aggressive_loop_optimizations)
1263 AC_SUBST(aros_warnflags_cpp)
1264 AC_SUBST(aros_nowarnflags_cpp)
1265 AC_SUBST(aros_warnflags_switch)
1266 AC_SUBST(aros_nowarnflags_switch)
1267 AC_SUBST(aros_warnflags_discarded_qualifiers)
1268 AC_SUBST(aros_nowarnflags_discarded_qualifiers)
1269 AC_SUBST(aros_warnflags_sequence_point)
1270 AC_SUBST(aros_nowarnflags_sequence_point)
1271 AC_SUBST(aros_warnflags_unknown_pragmas)
1272 AC_SUBST(aros_nowarnflags_unknown_pragmas)
1273 AC_SUBST(aros_warnflags_discarded_array_qualifiers)
1274 AC_SUBST(aros_nowarnflags_discarded_array_qualifiers)
1275 AC_SUBST(aros_warnflags_int_conversion)
1276 AC_SUBST(aros_nowarnflags_int_conversion)
1277 AC_SUBST(aros_warnflags_int_to_pointer_cast)
1278 AC_SUBST(aros_nowarnflags_int_to_pointer_cast)
1279 AC_SUBST(aros_warnflags_pointer_to_int_cast)
1280 AC_SUBST(aros_nowarnflags_pointer_to_int_cast)
1281 AC_SUBST(aros_warnflags_unused_const_variable)
1282 AC_SUBST(aros_nowarnflags_unused_const_variable)
1283 AC_SUBST(aros_warnflags_write_strings)
1284 AC_SUBST(aros_nowarnflags_write_strings)
1285 AC_SUBST(aros_warnflags_comment)
1286 AC_SUBST(aros_nowarnflags_comment)
1287 AC_SUBST(aros_warnflags_incompatible_pointer_types)
1288 AC_SUBST(aros_nowarnflags_incompatible_pointer_types)
1289 AC_SUBST(aros_warnflags_bool_compare)
1290 AC_SUBST(aros_nowarnflags_bool_compare)
1291 AC_SUBST(aros_warnflags_logical_not_parentheses)
1292 AC_SUBST(aros_nowarnflags_logical_not_parentheses)
1293 AC_SUBST(aros_warnflags_pointer_sign)
1294 AC_SUBST(aros_nowarnflags_pointer_sign)
1295 AC_SUBST(aros_warnflags_shift_overflow)
1296 AC_SUBST(aros_nowarnflags_shift_overflow)
1297 AC_SUBST(aros_warnflags_frame_address)
1298 AC_SUBST(aros_nowarnflags_frame_address)
1299 AC_SUBST(aros_warnflags_deprecated_declarations)
1300 AC_SUBST(aros_nowarnflags_deprecated_declarations)
1301 AC_SUBST(aros_warnflags_sign_compare)
1302 AC_SUBST(aros_nowarnflags_sign_compare)
1303 AC_SUBST(aros_warnflags_attributes)
1304 AC_SUBST(aros_nowarnflags_attributes)
1305 AC_SUBST(aros_warnflags_overflow)
1306 AC_SUBST(aros_nowarnflags_overflow)
1307 AC_SUBST(aros_warnflags_unused_local_typedefs)
1308 AC_SUBST(aros_nowarnflags_unused_local_typedefs)
1309 AC_SUBST(aros_warnflags_missing_braces)
1310 AC_SUBST(aros_nowarnflags_missing_braces)
1311 AC_SUBST(aros_warnflags_conversion_null)
1312 AC_SUBST(aros_nowarnflags_conversion_null)
1313 AC_SUBST(aros_warnflags_narrowing)
1314 AC_SUBST(aros_nowarnflags_narrowing)
1315 AC_SUBST(aros_warnflags_volatile_register_var)
1316 AC_SUBST(aros_nowarnflags_volatile_register_var)
1317 AC_SUBST(aros_warnflags_sizeof_pointer_memaccess)
1318 AC_SUBST(aros_nowarnflags_sizeof_pointer_memaccess)
1319 AC_SUBST(aros_warnflags_return_type)
1320 AC_SUBST(aros_nowarnflags_return_type)
1321 AC_SUBST(aros_warnflags_format_zero_length)
1322 AC_SUBST(aros_nowarnflags_format_zero_length)
1323 AC_SUBST(aros_warnflags_lto_type_mismatch)
1324 AC_SUBST(aros_nowarnflags_lto_type_mismatch)
1325 AC_SUBST(aros_warnflags_tautological_compare)
1326 AC_SUBST(aros_nowarnflags_tautological_compare)
1327 AC_SUBST(aros_warnflags_empty_body)
1328 AC_SUBST(aros_nowarnflags_empty_body)
1329 AC_SUBST(aros_warnflags_format_overflow)
1330 AC_SUBST(aros_nowarnflags_format_overflow)
1331 AC_SUBST(aros_warnflags_stringop_overflow)
1332 AC_SUBST(aros_nowarnflags_stringop_overflow)
1333 AC_SUBST(aros_warnflags_format_truncation)
1334 AC_SUBST(aros_nowarnflags_format_truncation)
1335 AC_SUBST(aros_warnflags_stringop_truncation)
1336 AC_SUBST(aros_nowarnflags_stringop_truncation)
1337 AC_SUBST(aros_warnflags_shift_negative_value)
1338 AC_SUBST(aros_nowarnflags_shift_negative_value)
1339 AC_SUBST(aros_warnflags_missing_field_initializers)
1340 AC_SUBST(aros_nowarnflags_missing_field_initializers)
1341 AC_SUBST(aros_warnflags_implicit_fallthrough)
1342 AC_SUBST(aros_nowarnflags_implicit_fallthrough)
1343 AC_SUBST(aros_warnflags_missing_prototypes)
1344 AC_SUBST(aros_nowarnflags_missing_prototypes)
1345 AC_SUBST(aros_warnflags_class_memaccess)
1346 AC_SUBST(aros_nowarnflags_class_memaccess)
1347 AC_SUBST(aros_warnflags_int_in_bool_context)
1348 AC_SUBST(aros_nowarnflags_int_in_bool_context)
1350 # Additional toolchain support ...
1351 AC_SUBST(aros_toolchain_sysroot)
1353 AC_CONFIG_FILES(
1354     ${aros_targetcfg_dir}/compiler.cfg:compiler.cfg.in
1357 AC_OUTPUT