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