From d97f059309eee9aa49df892d91cab64563bdc94b Mon Sep 17 00:00:00 2001 From: wawa Date: Thu, 21 Feb 2019 10:39:34 +0000 Subject: [PATCH] detect if the compiler supports -fno-builtin and -fno-builtin-vsnprintf. (NicJA) git-svn-id: https://svn.aros.org/svn/aros/trunk/AROS@55698 fb15a70f-31f2-0310-bbcc-cdcc74a49acc --- config/compiler.cfg.in | 6 ++- config/features | 133 ++++++++++++++++++++++++++++++++++++++----------- config/features.in | 47 ++++++++++++----- 3 files changed, 143 insertions(+), 43 deletions(-) diff --git a/config/compiler.cfg.in b/config/compiler.cfg.in index b50871f87b..cb64e146d6 100644 --- a/config/compiler.cfg.in +++ b/config/compiler.cfg.in @@ -10,7 +10,6 @@ CFLAGS_PERMISSIVE := @aros_cflags_permissive@ # CFLAGS_FAST_MATH := @aros_cflags_fast_math@ -CFLAGS_NO_BUILTIN_FLOOR := @aros_cflags_no_builtin_floor@ # # LTO/Graphite optimization flags @@ -49,6 +48,11 @@ CFLAGS_NO_PROFILE_ARCS := @aros_cflags_noprofilearcs@ CFLAGS_TEST_COVERAGE := @aros_cflags_testcoverage@ CFLAGS_NO_TEST_COVERAGE := @aros_cflags_notestcoverage@ +#Builtins +CFLAGS_NO_BUILTIN := @aros_cflags_no_builtin@ +CFLAGS_NO_BUILTIN_FLOOR := @aros_cflags_no_builtin_floor@ +CFLAGS_NO_BUILTIN_VSNPRINTF := @aros_cflags_no_builtin_vsnprintf@ + # # -iquote support # diff --git a/config/features b/config/features index db4a3af1b0..5e78245ead 100755 --- a/config/features +++ b/config/features @@ -732,6 +732,9 @@ aros_warnflags_error aros_cflags_no_red_zone aros_cflags_iquote_end aros_cflags_iquote +aros_cflags_no_builtin_vsnprintf +aros_cflags_no_builtin_floor +aros_cflags_no_builtin aros_cflags_notestcoverage aros_cflags_testcoverage aros_cflags_noprofilearcs @@ -752,7 +755,6 @@ aros_cflags_loop_block aros_cflags_whole_program aros_cflags_nolto aros_cflags_lto -aros_cflags_no_builtin_floor aros_cflags_fast_math aros_cflags_permissive aros_cflags_exceptions @@ -782,6 +784,7 @@ infodir docdir oldincludedir includedir +runstatedir localstatedir sharedstatedir sysconfdir @@ -852,6 +855,7 @@ datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' +runstatedir='${localstatedir}/run' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE}' @@ -1104,6 +1108,15 @@ do | -silent | --silent | --silen | --sile | --sil) silent=yes ;; + -runstatedir | --runstatedir | --runstatedi | --runstated \ + | --runstate | --runstat | --runsta | --runst | --runs \ + | --run | --ru | --r) + ac_prev=runstatedir ;; + -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ + | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ + | --run=* | --ru=* | --r=*) + runstatedir=$ac_optarg ;; + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ @@ -1241,7 +1254,7 @@ fi for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ - libdir localedir mandir + libdir localedir mandir runstatedir do eval ac_val=\$$ac_var # Remove trailing slashes. @@ -1394,6 +1407,7 @@ Fine tuning of the installation directories: --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] @@ -2755,7 +2769,6 @@ $as_echo "$aros_targetcfg_dir" >&6; } # -fexceptions # -fpermissive # -ffast-math -# -fno-builtin-floor # -flto # -fwhole-program # -floop-block @@ -2770,6 +2783,10 @@ $as_echo "$aros_targetcfg_dir" >&6; } # -fprofile-arcs # -ftest-coverage +# -fno-builtin +# -fno-builtin-floor +# -fno-builtin-vsnprintf + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CC} accepts -fexceptions" >&5 $as_echo_n "checking whether ${CC} accepts -fexceptions... " >&6; } CFLAGS=-fexceptions @@ -2850,32 +2867,6 @@ if test "x-$aros_fast_math" = "x-yes" ; then aros_cflags_fast_math=-ffast-math fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CC} accepts -fno-builtin-floor" >&5 -$as_echo_n "checking whether ${CC} accepts -fno-builtin-floor... " >&6; } -CFLAGS=-fno-builtin-floor -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - aros_no_builtin_floor="yes" -else - aros_no_builtin_floor="no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $aros_no_builtin_floor" >&5 -$as_echo "$aros_no_builtin_floor" >&6; } -if test "x-$aros_no_builtin_floor" = "x-yes" ; then - aros_cflags_no_builtin_floor=-fno-builtin-floor -fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CC} accepts -flto" >&5 $as_echo_n "checking whether ${CC} accepts -flto... " >&6; } CFLAGS=-flto @@ -3221,7 +3212,85 @@ if test "x-$aros_test_coverage" = "x-yes" ; then aros_cflags_notestcoverage=-fno-test-coverage fi -# +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CC} accepts -fno-builtin" >&5 +$as_echo_n "checking whether ${CC} accepts -fno-builtin... " >&6; } +CFLAGS=-fno-builtin +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + aros_no_builtin="yes" +else + aros_no_builtin="no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $aros_no_builtin" >&5 +$as_echo "$aros_no_builtin" >&6; } +if test "x-$aros_no_builtin" = "x-yes" ; then + aros_cflags_no_builtin=-fno-builtin +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CC} accepts -fno-builtin-floor" >&5 +$as_echo_n "checking whether ${CC} accepts -fno-builtin-floor... " >&6; } +CFLAGS=-fno-builtin-floor +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + aros_no_builtin_floor="yes" +else + aros_no_builtin_floor="no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $aros_no_builtin_floor" >&5 +$as_echo "$aros_no_builtin_floor" >&6; } +if test "x-$aros_no_builtin_floor" = "x-yes" ; then + aros_cflags_no_builtin_floor=-fno-builtin-floor +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CC} accepts -fno-builtin-vsnprintf" >&5 +$as_echo_n "checking whether ${CC} accepts -fno-builtin-vsnprintf... " >&6; } +CFLAGS=-fno-builtin-vsnprintf +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + aros_no_builtin_vsnprintf="yes" +else + aros_no_builtin_vsnprintf="no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $aros_no_builtin_vsnprintf" >&5 +$as_echo "$aros_no_builtin_vsnprintf" >&6; } +if test "x-$aros_no_builtin_vsnprintf" = "x-yes" ; then + aros_cflags_no_builtin_vsnprintf=-fno-builtin-vsnprintf +fi + +#----------------------------------------------------------------------------- # { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CC} accepts -iquote" >&5 @@ -5373,6 +5442,10 @@ fi # + + + +# # export the feature options... # diff --git a/config/features.in b/config/features.in index 96808dfa23..fb67143d20 100644 --- a/config/features.in +++ b/config/features.in @@ -37,7 +37,6 @@ AC_MSG_RESULT($aros_targetcfg_dir) # -fexceptions # -fpermissive # -ffast-math -# -fno-builtin-floor # -flto # -fwhole-program # -floop-block @@ -52,6 +51,10 @@ AC_MSG_RESULT($aros_targetcfg_dir) # -fprofile-arcs # -ftest-coverage +# -fno-builtin +# -fno-builtin-floor +# -fno-builtin-vsnprintf + AC_MSG_CHECKING([whether ${CC} accepts -fexceptions]) CFLAGS=-fexceptions AC_TRY_COMPILE(,, aros_exceptions="yes", aros_exceptions="no") @@ -77,14 +80,6 @@ if test "x-$aros_fast_math" = "x-yes" ; then aros_cflags_fast_math=-ffast-math fi -AC_MSG_CHECKING([whether ${CC} accepts -fno-builtin-floor]) -CFLAGS=-fno-builtin-floor -AC_TRY_COMPILE(,, aros_no_builtin_floor="yes", aros_no_builtin_floor="no") -AC_MSG_RESULT($aros_no_builtin_floor) -if test "x-$aros_no_builtin_floor" = "x-yes" ; then - aros_cflags_no_builtin_floor=-fno-builtin-floor -fi - AC_MSG_CHECKING([whether ${CC} accepts -flto]) CFLAGS=-flto AC_TRY_COMPILE(,, aros_lto="yes", aros_lto="no") @@ -196,7 +191,31 @@ if test "x-$aros_test_coverage" = "x-yes" ; then aros_cflags_notestcoverage=-fno-test-coverage fi -# +AC_MSG_CHECKING([whether ${CC} accepts -fno-builtin]) +CFLAGS=-fno-builtin +AC_TRY_COMPILE(,, aros_no_builtin="yes", aros_no_builtin="no") +AC_MSG_RESULT($aros_no_builtin) +if test "x-$aros_no_builtin" = "x-yes" ; then + aros_cflags_no_builtin=-fno-builtin +fi + +AC_MSG_CHECKING([whether ${CC} accepts -fno-builtin-floor]) +CFLAGS=-fno-builtin-floor +AC_TRY_COMPILE(,, aros_no_builtin_floor="yes", aros_no_builtin_floor="no") +AC_MSG_RESULT($aros_no_builtin_floor) +if test "x-$aros_no_builtin_floor" = "x-yes" ; then + aros_cflags_no_builtin_floor=-fno-builtin-floor +fi + +AC_MSG_CHECKING([whether ${CC} accepts -fno-builtin-vsnprintf]) +CFLAGS=-fno-builtin-vsnprintf +AC_TRY_COMPILE(,, aros_no_builtin_vsnprintf="yes", aros_no_builtin_vsnprintf="no") +AC_MSG_RESULT($aros_no_builtin_vsnprintf) +if test "x-$aros_no_builtin_vsnprintf" = "x-yes" ; then + aros_cflags_no_builtin_vsnprintf=-fno-builtin-vsnprintf +fi + +#----------------------------------------------------------------------------- # AC_MSG_CHECKING([whether ${CC} accepts -iquote]) @@ -966,7 +985,6 @@ fi AC_SUBST(aros_cflags_exceptions) AC_SUBST(aros_cflags_permissive) AC_SUBST(aros_cflags_fast_math) -AC_SUBST(aros_cflags_no_builtin_floor) AC_SUBST(aros_cflags_lto) AC_SUBST(aros_cflags_nolto) AC_SUBST(aros_cflags_whole_program) @@ -993,7 +1011,12 @@ AC_SUBST(aros_cflags_noprofilearcs) AC_SUBST(aros_cflags_testcoverage) AC_SUBST(aros_cflags_notestcoverage) - + +AC_SUBST(aros_cflags_no_builtin) +AC_SUBST(aros_cflags_no_builtin_floor) +AC_SUBST(aros_cflags_no_builtin_vsnprintf) + +# AC_SUBST(aros_cflags_iquote) AC_SUBST(aros_cflags_iquote_end) -- 2.11.4.GIT