fix non-smp builds
[AROS.git] / config / features.in
blob4b10e315c9dfd2c6a4e246671cf8986148697abf
1 dnl Copyright © 1997-2016, 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 #  -ffast-math 
38 #  -flto
39 #  -fwhole-program
40 #  -floop-block
41 #  -floop-interchange
42 #  -floop-strip-mine
43 #  -fpeel-loops
44 #  -fstrict-aliasing
46 AC_MSG_CHECKING([whether ${CC} accepts -ffast-math])
47 CFLAGS=-ffast-math
48 AC_TRY_COMPILE(,, aros_fast_math="yes", aros_fast_math="no")
49 AC_MSG_RESULT($aros_fast_math)
50 if test "x-$aros_fast_math" = "x-yes" ; then
51     aros_cflags_fast_math=-ffast-math
54 AC_MSG_CHECKING([whether ${CC} accepts -flto])
55 CFLAGS=-flto
56 AC_TRY_COMPILE(,, aros_lto="yes", aros_lto="no")
57 AC_MSG_RESULT($aros_lto)
58 if test "x-$aros_lto" = "x-yes" ; then
59     aros_cflags_lto=-flto
60     aros_cflags_nolto=-fno-lto
61     
62     AC_MSG_CHECKING([whether ${CC} accepts -fwhole-program])
63     CFLAGS=-fwhole-program
64     AC_TRY_COMPILE(,, aros_whole_program="yes", aros_whole_program="no")
65     AC_MSG_RESULT($aros_whole_program)
66     if test "x-$aros_whole_program" = "x-yes" ; then
67         aros_cflags_whole_program=-fwhole-program
68     fi
69     
70     AC_MSG_CHECKING([whether ${CC} accepts -floop-block])
71     CFLAGS=-floop-block
72     AC_TRY_COMPILE(,, aros_loop_block="yes", aros_loop_block="no")
73     AC_MSG_RESULT($aros_loop_block)
74     if test "x-$aros_loop_block" = "x-yes" ; then
75         aros_cflags_loop_block=-floop-block
76     fi
77     
78     AC_MSG_CHECKING([whether ${CC} accepts -floop-interchange])
79     CFLAGS=-floop-interchange
80     AC_TRY_COMPILE(,, aros_loop_interchange="yes", aros_loop_interchange="no")
81     AC_MSG_RESULT($aros_loop_interchange)
82     if test "x-$aros_loop_interchange" = "x-yes" ; then
83         aros_cflags_loop_interchange=-floop-interchange
84     fi
85     
86     AC_MSG_CHECKING([whether ${CC} accepts -floop-strip-mine])
87     CFLAGS=-floop-strip-mine
88     AC_TRY_COMPILE(,, aros_loop_strip_mine="yes", aros_loop_strip_mine="no")
89     AC_MSG_RESULT($aros_loop_strip_mine)
90     if test "x-$aros_loop_strip_mine" = "x-yes" ; then
91         aros_cflags_loop_strip_mine=-floop-strip-mine
92     fi
95 AC_MSG_CHECKING([whether ${CC} accepts -fpeel-loops])
96 CFLAGS=-fpeel-loops
97 AC_TRY_COMPILE(,, aros_peel_loops="yes", aros_peel_loops="no")
98 AC_MSG_RESULT($aros_peel_loops)
99 if test "x-$aros_peel_loops" = "x-yes" ; then
100     aros_cflags_peel_loops=-fpeel-loops
103 AC_MSG_CHECKING([whether ${CC} accepts -fstrict-aliasing])
104 CFLAGS=-fstrict-aliasing
105 AC_TRY_COMPILE(,, aros_strict_aliasing="yes", aros_strict_aliasing="no")
106 AC_MSG_RESULT($aros_strict_aliasing)
107 if test "x-$aros_strict_aliasing" = "x-yes" ; then
108     aros_cflags_strictaliasing=-fstrict-aliasing
109     aros_cflags_nostrictaliasing=-fno-strict-aliasing
112 AC_MSG_CHECKING([whether ${CC} accepts -iquote])
113 CFLAGS="-iquote."
114 AC_TRY_COMPILE(,, has_iquote="yes", has_iquote="no")
115 AC_MSG_RESULT($has_iquote)
116 if test "x-$has_iquote" = "x-yes" ; then
117     aros_cflags_iquote=-iquote
118     aros_cflags_iquote_end=
119 else
120     aros_cflags_iquote=-I
121     aros_cflags_iquote_end=-I-
124 #-----------------------------------------------------------------------------
126 # Check if the target compiler supports some options used for de-linting:
127 #  -Wunused-command-line-argument
128 #  -Wunknown-warning-option
129 #  -Wunused-but-set-variable
130 #  -Wstrict-aliasing
131 #  -Warray-bounds
132 #  -Wenum-compare
133 #  -Wstrict-prototypes
134 #  -Wstrict-overflow
135 #  -Wformat-security
136 #  -Wmisleading-indentation
137 #  -Wnonnull-compare
138 #  -Wunused
139 #  -Wunused-value
140 #  -Wunused-variable
141 #  -Wunused-function
142 #  -Wunused-parameter
143 #  -Wuninitialized
144 #  -Wmaybe-uninitialized
145 #  -Wimplicit-function-declaration
146 #  -Wformat
147 #  -Wparentheses
148 #  -Wchar-subscripts
149 #  -Wendif-labels
150 #  -Wformat-contains-nul
151 #  -Wimplicit-int
152 #  -Waggressive-loop-optimizations
153 #  -Wcpp
154 #  -Wswitch
155 #  -Wdiscarded-qualifiers
156 #  -Wsequence-point
157 #  -Wunknown-pragmas
158 #  -Wdiscarded-array-qualifiers
159 #  -Wint-conversion
160 #  -Wint-to-pointer-cast
161 #  -Wpointer-to-int-cast
162 #  -Wunused-const-variable
163 #  -Wwrite-strings 
164 #  -Wcomment
165 #  -Wincompatible-pointer-types
166 #  -Wbool-compare
167 #  -Wlogical-not-parentheses
168 #  -Wpointer-sign
169 #  -Wshift-overflow
170 #  -Wframe-address
171 #  -Wdeprecated-declarations
172 #  -Wsign-compare
173 #  -Wattributes
174 #  -Woverflow
175 #  -Wunused-local-typedefs
176 #  -Wmissing-braces
177 #  -Wconversion-null
178 #  -Wnarrowing
179 #  -Wvolatile-register-var
180 #  -Wsizeof-pointer-memaccess
181 #  -Wreturn-type
182 #  -Wformat-zero-length
183 #  -Wlto-type-mismatch
185 AC_MSG_CHECKING([whether ${CC} accepts -Wunused-command-line-argument])
186 CFLAGS=-Wunused-command-line-argument
187 AC_TRY_COMPILE(,, aros_unused_command_line_argument="yes", aros_unused_command_line_argument="no")
188 AC_MSG_RESULT($aros_unused_command_line_argument)
189 if test "x-$aros_unused_command_line_argument" = "x-yes" ; then
190     aros_warnflags_unused_command_line_argument=-Wunused-command-line-argument
191     aros_nowarnflags_unused_command_line_argument=-Wno-unused-command-line-argument
194 AC_MSG_CHECKING([whether ${CC} accepts -Wunknown-warning-option])
195 CFLAGS=-Wunknown-warning-option
196 AC_TRY_COMPILE(,, aros_unknown_warning_option="yes", aros_unknown_warning_option="no")
197 AC_MSG_RESULT($aros_unknown_warning_option)
198 if test "x-$aros_unknown_warning_option" = "x-yes" ; then
199     aros_warnflags_unknown_warning_option=-Wunknown-warning-option
200     aros_nowarnflags_unknown_warning_option=-Wno-unknown-warning-option
203 AC_MSG_CHECKING([whether ${CC} accepts -Wunused-but-set-variable])
204 CFLAGS=-Wunused-but-set-variable
205 AC_TRY_COMPILE(,, aros_unused_but_set_variable="yes", aros_unused_but_set_variable="no")
206 AC_MSG_RESULT($aros_unused_but_set_variable)
207 if test "x-$aros_unused_but_set_variable" = "x-yes" ; then
208     aros_warnflags_unused_but_set_variable=-Wunused-but-set-variable
209     aros_nowarnflags_unused_but_set_variable=-Wno-unused-but-set-variable
212 AC_MSG_CHECKING([whether ${CC} accepts -Wstrict-aliasing])
213 CFLAGS=-Wstrict-aliasing
214 AC_TRY_COMPILE(,, aros_strict_aliasing="yes", aros_strict_aliasing="no")
215 AC_MSG_RESULT($aros_strict_aliasing)
216 if test "x-$aros_strict_aliasing" = "x-yes" ; then
217     aros_warnflags_strict_aliasing=-Wstrict-aliasing
218     aros_nowarnflags_strict_aliasing=-Wno-strict-aliasing
221 AC_MSG_CHECKING([whether ${CC} accepts -Warray-bounds])
222 CFLAGS=-Warray-bounds
223 AC_TRY_COMPILE(,, aros_array_bounds="yes", aros_array_bounds="no")
224 AC_MSG_RESULT($aros_array_bounds)
225 if test "x-$aros_array_bounds" = "x-yes" ; then
226     aros_warnflags_array_bounds=-Warray-bounds
227     aros_nowarnflags_array_bounds=-Wno-array-bounds
230 AC_MSG_CHECKING([whether ${CC} accepts -Wenum-compare])
231 CFLAGS=-Wenum-compare
232 AC_TRY_COMPILE(,, aros_enum_compare="yes", aros_enum_compare="no")
233 AC_MSG_RESULT($aros_enum_compare)
234 if test "x-$aros_enum_compare" = "x-yes" ; then
235     aros_warnflags_enum_compare=-Wenum-compare
236     aros_nowarnflags_enum_compare=-Wno-enum-compare
239 AC_MSG_CHECKING([whether ${CC} accepts -Wstrict-prototypes])
240 CFLAGS=-Wstrict-prototypes
241 AC_TRY_COMPILE(,, aros_strict_prototypes="yes", aros_strict_prototypes="no")
242 AC_MSG_RESULT($aros_strict_prototypes)
243 if test "x-$aros_strict_prototypes" = "x-yes" ; then
244     aros_warnflags_strict_prototypes=-Wstrict-prototypes
245     aros_nowarnflags_strict_prototypes=-Wno-strict-prototypes
248 AC_MSG_CHECKING([whether ${CC} accepts -Wstrict-overflow])
249 CFLAGS=-Wstrict-overflow
250 AC_TRY_COMPILE(,, aros_strict_overflow="yes", aros_strict_overflow="no")
251 AC_MSG_RESULT($aros_strict_overflow)
252 if test "x-$aros_strict_overflow" = "x-yes" ; then
253     aros_warnflags_strict_overflow=-Wstrict-overflow
254     aros_nowarnflags_strict_overflow=-Wno-strict-overflow
257 AC_MSG_CHECKING([whether ${CC} accepts -Wformat-security])
258 CFLAGS=-Wformat-security
259 AC_TRY_COMPILE(,, aros_format_security="yes", aros_format_security="no")
260 AC_MSG_RESULT($aros_format_security)
261 if test "x-$aros_format_security" = "x-yes" ; then
262     aros_warnflags_format_security=-Wformat-security
263     aros_nowarnflags_format_security=-Wno-format-security
266 AC_MSG_CHECKING([whether ${CC} accepts -Wmisleading-indentation])
267 CFLAGS=-Wmisleading-indentation
268 AC_TRY_COMPILE(,, aros_misleading_indentation="yes", aros_misleading_indentation="no")
269 AC_MSG_RESULT($aros_misleading_indentation)
270 if test "x-$aros_misleading_indentation" = "x-yes" ; then
271     aros_warnflags_misleading_indentation=-Wmisleading-indentation
272     aros_nowarnflags_misleading_indentation=-Wno-misleading-indentation
275 AC_MSG_CHECKING([whether ${CC} accepts -Wnonnull-compare])
276 CFLAGS=-Wnonnull-compare
277 AC_TRY_COMPILE(,, aros_nonnull_compare="yes", aros_nonnull_compare="no")
278 AC_MSG_RESULT($aros_nonnull_compare)
279 if test "x-$aros_nonnull_compare" = "x-yes" ; then
280     aros_warnflags_nonnull_compare=-Wnonnull-compare
281     aros_nowarnflags_nonnull_compare=-Wno-nonnull-compare
284 AC_MSG_CHECKING([whether ${CC} accepts -Wunused])
285 CFLAGS=-Wunused
286 AC_TRY_COMPILE(,, aros_unused="yes", aros_unused="no")
287 AC_MSG_RESULT($aros_unused)
288 if test "x-$aros_unused" = "x-yes" ; then
289     aros_warnflags_unused=-Wunused
290     aros_nowarnflags_unused=-Wno-unused
293 AC_MSG_CHECKING([whether ${CC} accepts -Wunused-value])
294 CFLAGS=-Wunused-value
295 AC_TRY_COMPILE(,, aros_unused_value="yes", aros_unused_value="no")
296 AC_MSG_RESULT($aros_unused_value)
297 if test "x-$aros_unused_value" = "x-yes" ; then
298     aros_warnflags_unused_value=-Wunused-value
299     aros_nowarnflags_unused_value=-Wno-unused-value
302 AC_MSG_CHECKING([whether ${CC} accepts -Wunused-variable])
303 CFLAGS=-Wunused-variable
304 AC_TRY_COMPILE(,, aros_unused_variable="yes", aros_unused_variable="no")
305 AC_MSG_RESULT($aros_unused_variable)
306 if test "x-$aros_unused_variable" = "x-yes" ; then
307     aros_warnflags_unused_variable=-Wunused-variable
308     aros_nowarnflags_unused_variable=-Wno-unused-variable
311 AC_MSG_CHECKING([whether ${CC} accepts -Wunused-function])
312 CFLAGS=-Wunused-function
313 AC_TRY_COMPILE(,, aros_unused_function="yes", aros_unused_function="no")
314 AC_MSG_RESULT($aros_unused_function)
315 if test "x-$aros_unused_function" = "x-yes" ; then
316     aros_warnflags_unused_function=-Wunused-function
317     aros_nowarnflags_unused_function=-Wno-unused-function
320 AC_MSG_CHECKING([whether ${CC} accepts -Wunused-parameter])
321 CFLAGS=-Wunused-parameter
322 AC_TRY_COMPILE(,, aros_unused_parameter="yes", aros_unused_parameter="no")
323 AC_MSG_RESULT($aros_unused_parameter)
324 if test "x-$aros_unused_parameter" = "x-yes" ; then
325     aros_warnflags_unused_parameter=-Wunused-parameter
326     aros_nowarnflags_unused_parameter=-Wno-unused-parameter
329 AC_MSG_CHECKING([whether ${CC} accepts -Wuninitialized])
330 CFLAGS=-Wuninitialized
331 AC_TRY_COMPILE(,, aros_uninitialized="yes", aros_uninitialized="no")
332 AC_MSG_RESULT($aros_uninitialized)
333 if test "x-$aros_uninitialized" = "x-yes" ; then
334     aros_warnflags_uninitialized=-Wuninitialized
335     aros_nowarnflags_uninitialized=-Wno-uninitialized
338 AC_MSG_CHECKING([whether ${CC} accepts -Wmaybe-uninitialized])
339 CFLAGS=-Wmaybe-uninitialized
340 AC_TRY_COMPILE(,, aros_maybe_uninitialized="yes", aros_maybe_uninitialized="no")
341 AC_MSG_RESULT($aros_maybe_uninitialized)
342 if test "x-$aros_maybe_uninitialized" = "x-yes" ; then
343     aros_warnflags_maybe_uninitialized=-Wmaybe-uninitialized
344     aros_nowarnflags_maybe_uninitialized=-Wno-maybe-uninitialized
345 else
346     aros_warnflags_maybe_uninitialized=$aros_warnflags_uninitialized
347     aros_nowarnflags_maybe_uninitialized=$aros_nowarnflags_uninitialized
350 AC_MSG_CHECKING([whether ${CC} accepts -Wimplicit-function-declaration])
351 CFLAGS=-Wimplicit-function-declaration
352 AC_TRY_COMPILE(,, aros_implicit_function_declaration="yes", aros_implicit_function_declaration="no")
353 AC_MSG_RESULT($aros_implicit_function_declaration)
354 if test "x-$aros_implicit_function_declaration" = "x-yes" ; then
355     aros_warnflags_implicit_function_declaration=-Wimplicit-function-declaration
356     aros_nowarnflags_implicit_function_declaration=-Wno-implicit-function-declaration
359 AC_MSG_CHECKING([whether ${CC} accepts -Wformat])
360 CFLAGS=-Wformat
361 AC_TRY_COMPILE(,, aros_format="yes", aros_format="no")
362 AC_MSG_RESULT($aros_format)
363 if test "x-$aros_format" = "x-yes" ; then
364     aros_warnflags_format=-Wformat
365     aros_nowarnflags_format=-Wno-format
368 AC_MSG_CHECKING([whether ${CC} accepts -Wparentheses])
369 CFLAGS=-Wparentheses
370 AC_TRY_COMPILE(,, aros_parentheses="yes", aros_parentheses="no")
371 AC_MSG_RESULT($aros_parentheses)
372 if test "x-$aros_parentheses" = "x-yes" ; then
373     aros_warnflags_parentheses=-Wparentheses
374     aros_nowarnflags_parentheses=-Wno-parentheses
377 AC_MSG_CHECKING([whether ${CC} accepts -Wchar-subscripts])
378 CFLAGS=-Wchar-subscripts
379 AC_TRY_COMPILE(,, aros_char_subscripts="yes", aros_char_subscripts="no")
380 AC_MSG_RESULT($aros_char_subscripts)
381 if test "x-$aros_char_subscripts" = "x-yes" ; then
382     aros_warnflags_char_subscripts=-Wchar-subscripts
383     aros_nowarnflags_char_subscripts=-Wno-char-subscripts
386 AC_MSG_CHECKING([whether ${CC} accepts -Wendif-labels])
387 CFLAGS=-Wendif-labels
388 AC_TRY_COMPILE(,, aros_endif_labels="yes", aros_endif_labels="no")
389 AC_MSG_RESULT($aros_endif_labels)
390 if test "x-$aros_endif_labels" = "x-yes" ; then
391     aros_warnflags_endif_labels=-Wendif-labels
392     aros_nowarnflags_endif_labels=-Wno-endif-labels
395 AC_MSG_CHECKING([whether ${CC} accepts -Wformat-contains-nul])
396 CFLAGS=-Wformat-contains-nul
397 AC_TRY_COMPILE(,, aros_format_contains_nul="yes", aros_format_contains_nul="no")
398 AC_MSG_RESULT($aros_format_contains_nul)
399 if test "x-$aros_format_contains_nul" = "x-yes" ; then
400     aros_warnflags_format_contains_nul=-Wformat-contains-nul
401     aros_nowarnflags_format_contains_nul=-Wno-format-contains-nul
404 AC_MSG_CHECKING([whether ${CC} accepts -Wimplicit-int])
405 CFLAGS=-Wimplicit-int
406 AC_TRY_COMPILE(,, aros_implicit_int="yes", aros_implicit_int="no")
407 AC_MSG_RESULT($aros_implicit_int)
408 if test "x-$aros_implicit_int" = "x-yes" ; then
409     aros_warnflags_implicit_int=-Wimplicit-int
410     aros_nowarnflags_implicit_int=-Wno-implicit-int
413 AC_MSG_CHECKING([whether ${CC} accepts -Waggressive-loop-optimizations])
414 CFLAGS=-Waggressive-loop-optimizations
415 AC_TRY_COMPILE(,, aros_aggressive_loop_optimizations="yes", aros_aggressive_loop_optimizations="no")
416 AC_MSG_RESULT($aros_aggressive_loop_optimizations)
417 if test "x-$aros_aggressive_loop_optimizations" = "x-yes" ; then
418     aros_warnflags_aggressive_loop_optimizations=-Waggressive-loop-optimizations
419     aros_nowarnflags_aggressive_loop_optimizations=-Wno-aggressive-loop-optimizations
422 AC_MSG_CHECKING([whether ${CC} accepts -Wcpp])
423 CFLAGS=-Wcpp
424 AC_TRY_COMPILE(,, aros_cpp="yes", aros_cpp="no")
425 AC_MSG_RESULT($aros_cpp)
426 if test "x-$aros_cpp" = "x-yes" ; then
427     aros_warnflags_cpp=-Wcpp
428     aros_nowarnflags_cpp=-Wno-cpp
431 AC_MSG_CHECKING([whether ${CC} accepts -Wswitch])
432 CFLAGS=-Wswitch
433 AC_TRY_COMPILE(,, aros_switch="yes", aros_switch="no")
434 AC_MSG_RESULT($aros_switch)
435 if test "x-$aros_switch" = "x-yes" ; then
436     aros_warnflags_switch=-Wswitch
437     aros_nowarnflags_switch=-Wno-switch
440 AC_MSG_CHECKING([whether ${CC} accepts -Wdiscarded-qualifiers])
441 CFLAGS=-Wdiscarded-qualifiers
442 AC_TRY_COMPILE(,, aros_discarded_qualifiers="yes", aros_discarded_qualifiers="no")
443 AC_MSG_RESULT($aros_discarded_qualifiers)
444 if test "x-$aros_discarded_qualifiers" = "x-yes" ; then
445     aros_warnflags_discarded_qualifiers=-Wdiscarded-qualifiers
446     aros_nowarnflags_discarded_qualifiers=-Wno-discarded-qualifiers
449 AC_MSG_CHECKING([whether ${CC} accepts -Wsequence-point])
450 CFLAGS=-Wsequence-point
451 AC_TRY_COMPILE(,, aros_sequence_point="yes", aros_sequence_point="no")
452 AC_MSG_RESULT($aros_sequence_point)
453 if test "x-$aros_sequence_point" = "x-yes" ; then
454     aros_warnflags_sequence_point=-Wsequence-point
455     aros_nowarnflags_sequence_point=-Wno-sequence-point
458 AC_MSG_CHECKING([whether ${CC} accepts -Wunknown-pragmas])
459 CFLAGS=-Wunknown-pragmas
460 AC_TRY_COMPILE(,, aros_unknown_pragmas="yes", aros_unknown_pragmas="no")
461 AC_MSG_RESULT($aros_unknown_pragmas)
462 if test "x-$aros_unknown_pragmas" = "x-yes" ; then
463     aros_warnflags_unknown_pragmas=-Wunknown-pragmas
464     aros_nowarnflags_unknown_pragmas=-Wno-unknown-pragmas
467 AC_MSG_CHECKING([whether ${CC} accepts -Wdiscarded-array-qualifiers])
468 CFLAGS=-Wdiscarded-array-qualifiers
469 AC_TRY_COMPILE(,, aros_discarded_array_qualifiers="yes", aros_discarded_array_qualifiers="no")
470 AC_MSG_RESULT($aros_discarded_array_qualifiers)
471 if test "x-$aros_discarded_array_qualifiers" = "x-yes" ; then
472     aros_warnflags_discarded_array_qualifiers=-Wdiscarded-array-qualifiers
473     aros_nowarnflags_discarded_array_qualifiers=-Wno-discarded-array-qualifiers
476 AC_MSG_CHECKING([whether ${CC} accepts -Wint-conversion])
477 CFLAGS=-Wint-conversion
478 AC_TRY_COMPILE(,, aros_int_conversion="yes", aros_int_conversion="no")
479 AC_MSG_RESULT($aros_int_conversion)
480 if test "x-$aros_int_conversion" = "x-yes" ; then
481     aros_warnflags_int_conversion=-Wint-conversion
482     aros_nowarnflags_int_conversion=-Wno-int-conversion
485 AC_MSG_CHECKING([whether ${CC} accepts -Wint-to-pointer-cast])
486 CFLAGS=-Wint-to-pointer-cast
487 AC_TRY_COMPILE(,, aros_int_to_pointer_cast="yes", aros_int_to_pointer_cast="no")
488 AC_MSG_RESULT($aros_int_to_pointer_cast)
489 if test "x-$aros_int_to_pointer_cast" = "x-yes" ; then
490     aros_warnflags_int_to_pointer_cast=-Wint-to-pointer-cast
491     aros_nowarnflags_int_to_pointer_cast=-Wno-int-to-pointer-cast
494 AC_MSG_CHECKING([whether ${CC} accepts -Wpointer-to-int-cast])
495 CFLAGS=-Wpointer-to-int-cast
496 AC_TRY_COMPILE(,, aros_pointer_to_int_cast="yes", aros_pointer_to_int_cast="no")
497 AC_MSG_RESULT($aros_pointer_to_int_cast)
498 if test "x-$aros_pointer_to_int_cast" = "x-yes" ; then
499     aros_warnflags_pointer_to_int_cast=-Wpointer-to-int-cast
500     aros_nowarnflags_pointer_to_int_cast=-Wno-pointer-to-int-cast
503 AC_MSG_CHECKING([whether ${CC} accepts -Wunused-const-variable])
504 CFLAGS=-Wunused-const-variable
505 AC_TRY_COMPILE(,, aros_unused_const_variable="yes", aros_unused_const_variable="no")
506 AC_MSG_RESULT($aros_unused_const_variable)
507 if test "x-$aros_unused_const_variable" = "x-yes" ; then
508     aros_warnflags_unused_const_variable=-Wunused-const-variable
509     aros_nowarnflags_unused_const_variable=-Wno-unused-const-variable
512 AC_MSG_CHECKING([whether ${CC} accepts -Wwrite-strings])
513 CFLAGS=-Wwrite-strings
514 AC_TRY_COMPILE(,, aros_write_strings="yes", aros_write_strings="no")
515 AC_MSG_RESULT($aros_write_strings)
516 if test "x-$aros_write_strings" = "x-yes" ; then
517     aros_warnflags_write_strings=-Wwrite-strings
518     aros_nowarnflags_write_strings=-Wno-write-strings
521 AC_MSG_CHECKING([whether ${CC} accepts -Wcomment])
522 CFLAGS=-Wcomment
523 AC_TRY_COMPILE(,, aros_comment="yes", aros_comment="no")
524 AC_MSG_RESULT($aros_comment)
525 if test "x-$aros_comment" = "x-yes" ; then
526     aros_warnflags_comment=-Wcomment
527     aros_nowarnflags_comment=-Wno-comment
530 AC_MSG_CHECKING([whether ${CC} accepts -Wincompatible-pointer-types])
531 CFLAGS=-Wincompatible-pointer-types
532 AC_TRY_COMPILE(,, aros_incompatible_pointer_types="yes", aros_incompatible_pointer_types="no")
533 AC_MSG_RESULT($aros_incompatible_pointer_types)
534 if test "x-$aros_incompatible_pointer_types" = "x-yes" ; then
535     aros_warnflags_incompatible_pointer_types=-Wincompatible-pointer-types
536     aros_nowarnflags_incompatible_pointer_types=-Wno-incompatible-pointer-types
539 AC_MSG_CHECKING([whether ${CC} accepts -Wbool-compare])
540 CFLAGS=-Wbool-compare
541 AC_TRY_COMPILE(,, aros_bool_compare="yes", aros_bool_compare="no")
542 AC_MSG_RESULT($aros_bool_compare)
543 if test "x-$aros_bool_compare" = "x-yes" ; then
544     aros_warnflags_bool_compare=-Wbool-compare
545     aros_nowarnflags_bool_compare=-Wno-bool-compare
548 AC_MSG_CHECKING([whether ${CC} accepts -Wlogical-not-parentheses])
549 CFLAGS=-Wlogical-not-parentheses
550 AC_TRY_COMPILE(,, aros_logical_not_parentheses="yes", aros_logical_not_parentheses="no")
551 AC_MSG_RESULT($aros_logical_not_parentheses)
552 if test "x-$aros_logical_not_parentheses" = "x-yes" ; then
553     aros_warnflags_logical_not_parentheses=-Wlogical-not-parentheses
554     aros_nowarnflags_logical_not_parentheses=-Wno-logical-not-parentheses
557 AC_MSG_CHECKING([whether ${CC} accepts -Wpointer-sign])
558 CFLAGS=-Wpointer-sign
559 AC_TRY_COMPILE(,, aros_pointer_sign="yes", aros_pointer_sign="no")
560 AC_MSG_RESULT($aros_pointer_sign)
561 if test "x-$aros_pointer_sign" = "x-yes" ; then
562     aros_warnflags_pointer_sign=-Wpointer-sign
563     aros_nowarnflags_pointer_sign=-Wno-pointer-sign
566 AC_MSG_CHECKING([whether ${CC} accepts -Wshift-overflow])
567 CFLAGS=-Wshift-overflow
568 AC_TRY_COMPILE(,, aros_shift_overflow="yes", aros_shift_overflow="no")
569 AC_MSG_RESULT($aros_shift_overflow)
570 if test "x-$aros_shift_overflow" = "x-yes" ; then
571     aros_warnflags_shift_overflow=-Wshift-overflow
572     aros_nowarnflags_shift_overflow=-Wno-shift-overflow
575 AC_MSG_CHECKING([whether ${CC} accepts -Wframe-address])
576 CFLAGS=-Wframe-address
577 AC_TRY_COMPILE(,, aros_frame_address="yes", aros_frame_address="no")
578 AC_MSG_RESULT($aros_frame_address)
579 if test "x-$aros_frame_address" = "x-yes" ; then
580     aros_warnflags_frame_address=-Wframe-address
581     aros_nowarnflags_frame_address=-Wno-frame-address
584 AC_MSG_CHECKING([whether ${CC} accepts -Wdeprecated-declarations])
585 CFLAGS=-Wdeprecated-declarations
586 AC_TRY_COMPILE(,, aros_deprecated_declarations="yes", aros_deprecated_declarations="no")
587 AC_MSG_RESULT($aros_deprecated_declarations)
588 if test "x-$aros_deprecated_declarations" = "x-yes" ; then
589     aros_warnflags_deprecated_declarations=-Wdeprecated-declarations
590     aros_nowarnflags_deprecated_declarations=-Wno-deprecated-declarations
593 AC_MSG_CHECKING([whether ${CC} accepts -Wsign-compare])
594 CFLAGS=-Wsign-compare
595 AC_TRY_COMPILE(,, aros_sign_compare="yes", aros_sign_compare="no")
596 AC_MSG_RESULT($aros_sign_compare)
597 if test "x-$aros_sign_compare" = "x-yes" ; then
598     aros_warnflags_sign_compare=-Wsign-compare
599     aros_nowarnflags_sign_compare=-Wno-sign-compare
602 AC_MSG_CHECKING([whether ${CC} accepts -Wattributes])
603 CFLAGS=-Wattributes
604 AC_TRY_COMPILE(,, aros_attributes="yes", aros_attributes="no")
605 AC_MSG_RESULT($aros_attributes)
606 if test "x-$aros_attributes" = "x-yes" ; then
607     aros_warnflags_attributes=-Wattributes
608     aros_nowarnflags_attributes=-Wno-attributes
611 AC_MSG_CHECKING([whether ${CC} accepts -Woverflow])
612 CFLAGS=-Woverflow
613 AC_TRY_COMPILE(,, aros_overflow="yes", aros_overflow="no")
614 AC_MSG_RESULT($aros_overflow)
615 if test "x-$aros_overflow" = "x-yes" ; then
616     aros_warnflags_overflow=-Woverflow
617     aros_nowarnflags_overflow=-Wno-overflow
620 AC_MSG_CHECKING([whether ${CC} accepts -Wunused-local-typedefs])
621 CFLAGS=-Wunused-local-typedefs
622 AC_TRY_COMPILE(,, aros_unused_local_typedefs="yes", aros_unused_local_typedefs="no")
623 AC_MSG_RESULT($aros_unused_local_typedefs)
624 if test "x-$aros_unused_local_typedefs" = "x-yes" ; then
625     aros_warnflags_unused_local_typedefs=-Wunused-local-typedefs
626     aros_nowarnflags_unused_local_typedefs=-Wno-unused-local-typedefs
629 AC_MSG_CHECKING([whether ${CC} accepts -Wmissing-braces])
630 CFLAGS=-Wmissing-braces
631 AC_TRY_COMPILE(,, aros_missing_braces="yes", aros_missing_braces="no")
632 AC_MSG_RESULT($aros_missing_braces)
633 if test "x-$aros_missing_braces" = "x-yes" ; then
634     aros_warnflags_missing_braces=-Wmissing-braces
635     aros_nowarnflags_missing_braces=-Wno-missing-braces
638 AC_MSG_CHECKING([whether ${CC} accepts -Wconversion-null])
639 CFLAGS=-Wconversion-null
640 AC_TRY_COMPILE(,, aros_conversion_null="yes", aros_conversion_null="no")
641 AC_MSG_RESULT($aros_conversion_null)
642 if test "x-$aros_conversion_null" = "x-yes" ; then
643     aros_warnflags_conversion_null=-Wconversion-null
644     aros_nowarnflags_conversion_null=-Wno-conversion-null
647 AC_MSG_CHECKING([whether ${CC} accepts -Wnarrowing])
648 CFLAGS=-Wnarrowing
649 AC_TRY_COMPILE(,, aros_narrowing="yes", aros_narrowing="no")
650 AC_MSG_RESULT($aros_narrowing)
651 if test "x-$aros_narrowing" = "x-yes" ; then
652     aros_warnflags_narrowing=-Wnarrowing
653     aros_nowarnflags_narrowing=-Wno-narrowing
656 AC_MSG_CHECKING([whether ${CC} accepts -Wvolatile-register-var])
657 CFLAGS=-Wvolatile-register-var
658 AC_TRY_COMPILE(,, aros_volatile_register_var="yes", aros_volatile_register_var="no")
659 AC_MSG_RESULT($aros_volatile_register_var)
660 if test "x-$aros_volatile_register_var" = "x-yes" ; then
661     aros_warnflags_volatile_register_var=-Wvolatile-register-var
662     aros_nowarnflags_volatile_register_var=-Wno-volatile-register-var
665 AC_MSG_CHECKING([whether ${CC} accepts -Wsizeof-pointer-memaccess])
666 CFLAGS=-Wsizeof-pointer-memaccess
667 AC_TRY_COMPILE(,, aros_sizeof_pointer_memaccess="yes", aros_sizeof_pointer_memaccess="no")
668 AC_MSG_RESULT($aros_sizeof_pointer_memaccess)
669 if test "x-$aros_sizeof_pointer_memaccess" = "x-yes" ; then
670     aros_warnflags_sizeof_pointer_memaccess=-Wsizeof-pointer-memaccess
671     aros_nowarnflags_sizeof_pointer_memaccess=-Wno-sizeof-pointer-memaccess
674 AC_MSG_CHECKING([whether ${CC} accepts -Wreturn-type])
675 CFLAGS=-Wreturn-type
676 AC_TRY_COMPILE(,, aros_return_type="yes", aros_return_type="no")
677 AC_MSG_RESULT($aros_return_type)
678 if test "x-$aros_return_type" = "x-yes" ; then
679     aros_warnflags_return_type=-Wreturn-type
680     aros_nowarnflags_return_type=-Wno-return-type
683 AC_MSG_CHECKING([whether ${CC} accepts -Wformat-zero-length])
684 CFLAGS=-Wformat-zero-length
685 AC_TRY_COMPILE(,, aros_format_zero_length="yes", aros_format_zero_length="no")
686 AC_MSG_RESULT($aros_format_zero_length)
687 if test "x-$aros_format_zero_length" = "x-yes" ; then
688     aros_warnflags_format_zero_length=-Wformat-zero-length
689     aros_nowarnflags_format_zero_length=-Wno-format-zero-length
692 AC_MSG_CHECKING([whether ${CC} accepts -Wlto-type-mismatch])
693 CFLAGS=-Wlto-type-mismatch
694 AC_TRY_COMPILE(,, aros_lto_type_mismatch="yes", aros_lto_type_mismatch="no")
695 AC_MSG_RESULT($aros_lto_type_mismatch)
696 if test "x-$aros_lto_type_mismatch" = "x-yes" ; then
697     aros_warnflags_lto_type_mismatch=-Wlto-type-mismatch
698     aros_nowarnflags_lto_type_mismatch=-Wno-lto-type-mismatch
702 # export the feature flags...
704 AC_SUBST(aros_cflags_fast_math)
705 AC_SUBST(aros_cflags_lto)
706 AC_SUBST(aros_cflags_nolto)
707 AC_SUBST(aros_cflags_whole_program)
708 AC_SUBST(aros_cflags_loop_block)
709 AC_SUBST(aros_cflags_loop_interchange)
710 AC_SUBST(aros_cflags_loop_strip_mine)
711 AC_SUBST(aros_cflags_peel_loops)
713 AC_SUBST(aros_cflags_strictaliasing)
714 AC_SUBST(aros_cflags_nostrictaliasing)
716 AC_SUBST(aros_cflags_iquote)
717 AC_SUBST(aros_cflags_iquote_end)
720 # ...and warning flags...
722 AC_SUBST(aros_warnflags_unused_command_line_argument)
723 AC_SUBST(aros_nowarnflags_unused_command_line_argument)
724 AC_SUBST(aros_warnflags_unknown_warning_option)
725 AC_SUBST(aros_nowarnflags_unknown_warning_option)
726 AC_SUBST(aros_warnflags_unused_but_set_variable)
727 AC_SUBST(aros_nowarnflags_unused_but_set_variable)
728 AC_SUBST(aros_warnflags_strict_aliasing)
729 AC_SUBST(aros_nowarnflags_strict_aliasing)
730 AC_SUBST(aros_warnflags_array_bounds)
731 AC_SUBST(aros_nowarnflags_array_bounds)
732 AC_SUBST(aros_warnflags_enum_compare)
733 AC_SUBST(aros_nowarnflags_enum_compare)
734 AC_SUBST(aros_warnflags_strict_prototypes)
735 AC_SUBST(aros_nowarnflags_strict_prototypes)
736 AC_SUBST(aros_warnflags_strict_overflow)
737 AC_SUBST(aros_nowarnflags_strict_overflow)
738 AC_SUBST(aros_warnflags_format_security)
739 AC_SUBST(aros_nowarnflags_format_security)
740 AC_SUBST(aros_warnflags_misleading_indentation)
741 AC_SUBST(aros_nowarnflags_misleading_indentation)
742 AC_SUBST(aros_warnflags_nonnull_compare)
743 AC_SUBST(aros_nowarnflags_nonnull_compare)
744 AC_SUBST(aros_warnflags_unused)
745 AC_SUBST(aros_nowarnflags_unused)
746 AC_SUBST(aros_warnflags_unused_value)
747 AC_SUBST(aros_nowarnflags_unused_value)
748 AC_SUBST(aros_warnflags_unused_variable)
749 AC_SUBST(aros_nowarnflags_unused_variable)
750 AC_SUBST(aros_warnflags_unused_function)
751 AC_SUBST(aros_nowarnflags_unused_function)
752 AC_SUBST(aros_warnflags_unused_parameter)
753 AC_SUBST(aros_nowarnflags_unused_parameter)
754 AC_SUBST(aros_warnflags_uninitialized)
755 AC_SUBST(aros_nowarnflags_uninitialized)
756 AC_SUBST(aros_warnflags_maybe_uninitialized)
757 AC_SUBST(aros_nowarnflags_maybe_uninitialized)
758 AC_SUBST(aros_warnflags_implicit_function_declaration)
759 AC_SUBST(aros_nowarnflags_implicit_function_declaration)
760 AC_SUBST(aros_warnflags_format)
761 AC_SUBST(aros_nowarnflags_format)
762 AC_SUBST(aros_warnflags_parentheses)
763 AC_SUBST(aros_nowarnflags_parentheses)
764 AC_SUBST(aros_warnflags_char_subscripts)
765 AC_SUBST(aros_nowarnflags_char_subscripts)
766 AC_SUBST(aros_warnflags_endif_labels)
767 AC_SUBST(aros_nowarnflags_endif_labels)
768 AC_SUBST(aros_warnflags_format_contains_nul)
769 AC_SUBST(aros_nowarnflags_format_contains_nul)
770 AC_SUBST(aros_warnflags_implicit_int)
771 AC_SUBST(aros_nowarnflags_implicit_int)
772 AC_SUBST(aros_warnflags_aggressive_loop_optimizations)
773 AC_SUBST(aros_nowarnflags_aggressive_loop_optimizations)
774 AC_SUBST(aros_warnflags_cpp)
775 AC_SUBST(aros_nowarnflags_cpp)
776 AC_SUBST(aros_warnflags_switch)
777 AC_SUBST(aros_nowarnflags_switch)
778 AC_SUBST(aros_warnflags_discarded_qualifiers)
779 AC_SUBST(aros_nowarnflags_discarded_qualifiers)
780 AC_SUBST(aros_warnflags_sequence_point)
781 AC_SUBST(aros_nowarnflags_sequence_point)
782 AC_SUBST(aros_warnflags_unknown_pragmas)
783 AC_SUBST(aros_nowarnflags_unknown_pragmas)
784 AC_SUBST(aros_warnflags_discarded_array_qualifiers)
785 AC_SUBST(aros_nowarnflags_discarded_array_qualifiers)
786 AC_SUBST(aros_warnflags_int_conversion)
787 AC_SUBST(aros_nowarnflags_int_conversion)
788 AC_SUBST(aros_warnflags_int_to_pointer_cast)
789 AC_SUBST(aros_nowarnflags_int_to_pointer_cast)
790 AC_SUBST(aros_warnflags_pointer_to_int_cast)
791 AC_SUBST(aros_nowarnflags_pointer_to_int_cast)
792 AC_SUBST(aros_warnflags_unused_const_variable)
793 AC_SUBST(aros_nowarnflags_unused_const_variable)
794 AC_SUBST(aros_warnflags_write_strings)
795 AC_SUBST(aros_nowarnflags_write_strings)
796 AC_SUBST(aros_warnflags_comment)
797 AC_SUBST(aros_nowarnflags_comment)
798 AC_SUBST(aros_warnflags_incompatible_pointer_types)
799 AC_SUBST(aros_nowarnflags_incompatible_pointer_types)
800 AC_SUBST(aros_warnflags_bool_compare)
801 AC_SUBST(aros_nowarnflags_bool_compare)
802 AC_SUBST(aros_warnflags_logical_not_parentheses)
803 AC_SUBST(aros_nowarnflags_logical_not_parentheses)
804 AC_SUBST(aros_warnflags_pointer_sign)
805 AC_SUBST(aros_nowarnflags_pointer_sign)
806 AC_SUBST(aros_warnflags_shift_overflow)
807 AC_SUBST(aros_nowarnflags_shift_overflow)
808 AC_SUBST(aros_warnflags_frame_address)
809 AC_SUBST(aros_nowarnflags_frame_address)
810 AC_SUBST(aros_warnflags_deprecated_declarations)
811 AC_SUBST(aros_nowarnflags_deprecated_declarations)
812 AC_SUBST(aros_warnflags_sign_compare)
813 AC_SUBST(aros_nowarnflags_sign_compare)
814 AC_SUBST(aros_warnflags_attributes)
815 AC_SUBST(aros_nowarnflags_attributes)
816 AC_SUBST(aros_warnflags_overflow)
817 AC_SUBST(aros_nowarnflags_overflow)
818 AC_SUBST(aros_warnflags_unused_local_typedefs)
819 AC_SUBST(aros_nowarnflags_unused_local_typedefs)
820 AC_SUBST(aros_warnflags_missing_braces)
821 AC_SUBST(aros_nowarnflags_missing_braces)
822 AC_SUBST(aros_warnflags_conversion_null)
823 AC_SUBST(aros_nowarnflags_conversion_null)
824 AC_SUBST(aros_warnflags_narrowing)
825 AC_SUBST(aros_nowarnflags_narrowing)
826 AC_SUBST(aros_warnflags_volatile_register_var)
827 AC_SUBST(aros_nowarnflags_volatile_register_var)
828 AC_SUBST(aros_warnflags_sizeof_pointer_memaccess)
829 AC_SUBST(aros_nowarnflags_sizeof_pointer_memaccess)
830 AC_SUBST(aros_warnflags_return_type)
831 AC_SUBST(aros_nowarnflags_return_type)
832 AC_SUBST(aros_warnflags_format_zero_length)
833 AC_SUBST(aros_nowarnflags_format_zero_length)
834 AC_SUBST(aros_warnflags_lto_type_mismatch)
835 AC_SUBST(aros_nowarnflags_lto_type_mismatch)
836     
837 AC_CONFIG_FILES(
838     ${aros_targetcfg_dir}/compiler.cfg:compiler.cfg.in
841 AC_OUTPUT