From ce39bd389039d99458950b072550ab52f0a07a34 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Sat, 9 Jan 2016 04:09:35 -0500 Subject: sim: move many common settings from CPPFLAGS to config.h Rather than stuffing the command line with a bunch of -D flags, start moving things to config.h which is managed by autoheader. This makes the makefile a bit simpler and the build output tighter, and it makes the migration to automake easier as there are fewer vars to juggle. We'll want to move the other options out too, but it'll take more work. --- sim/ppc/ChangeLog | 13 +++++++ sim/ppc/Makefile.in | 8 ---- sim/ppc/config.in | 12 ++++++ sim/ppc/configure | 105 +++++++++++++++++++++++++++------------------------ sim/ppc/configure.ac | 68 ++++++++++++++++----------------- sim/ppc/std-config.h | 22 ----------- 6 files changed, 115 insertions(+), 113 deletions(-) (limited to 'sim/ppc') diff --git a/sim/ppc/ChangeLog b/sim/ppc/ChangeLog index c8ecc03..7ed024e 100644 --- a/sim/ppc/ChangeLog +++ b/sim/ppc/ChangeLog @@ -1,5 +1,18 @@ 2016-01-10 Mike Frysinger + * configure.ac (sim-assert): Call AC_MSG_CHECKING, + AC_DEFINE_UNQUOTED, and AC_MSG_RESULT + (sim-env, sim-stdio, sim-trace): Delete. + * config.in, configure: Regenerate. + * Make-common.in (ENV_CFLAGS, TRACE_CFLAGS, ASSERT_CFLAGS, + STDIO_CFLAGS): Delete. + (CONFIG_CFLAGS): Delete $(ENV_CFLAGS), $(TRACE_CFLAGS), + $(ASSERT_CFLAGS), and $(STDIO_CFLAGS). + * std-config.h (WITH_ENVIRONMENT, WITH_TRACE, WITH_ASSERT, + WITH_STDIO): Delete. + +2016-01-10 Mike Frysinger + * configure: Regenerate. 2016-01-10 Mike Frysinger diff --git a/sim/ppc/Makefile.in b/sim/ppc/Makefile.in index 7d30fae..1635e01 100644 --- a/sim/ppc/Makefile.in +++ b/sim/ppc/Makefile.in @@ -77,16 +77,12 @@ SMP_CFLAGS = @sim_smp@ XOR_ENDIAN_CFLAGS = @sim_xor_endian@ BITSIZE_CFLAGS = @sim_bitsize@ HOSTBITSIZE_CFLAGS = @sim_hostbitsize@ -ENV_CFLAGS = @sim_env@ TIMEBASE_CFLAGS = @sim_timebase@ ALIGNMENT_CFLAGS = @sim_alignment@ FLOAT_CFLAGS = @sim_float@ -TRACE_CFLAGS = @sim_trace@ -ASSERT_CFLAGS = @sim_assert@ RESERVED_CFLAGS = @sim_reserved@ MONITOR_CFLAGS = @sim_monitor@ MODEL_CFLAGS = @sim_model@ @sim_default_model@ @sim_model_issue@ -STDIO_CFLAGS = @sim_stdio@ TERMIO_CFLAGS = @sim_termio@ WARNING_CFLAGS = @sim_warnings@ DEVZERO_CFLAGS = @sim_devzero@ @@ -97,16 +93,12 @@ CONFIG_CFLAGS = \ $(XOR_ENDIAN_CFLAGS) \ $(BITSIZE_CFLAGS) \ $(HOSTBITSIZE_CFLAGS) \ - $(ENV_CFLAGS) \ $(TIMEBASE_CFLAGS) \ $(ALIGNMENT_CFLAGS) \ $(FLOAT_CFLAGS) \ - $(TRACE_CFLAGS) \ - $(ASSERT_CFLAGS) \ $(RESERVED_CFLAGS) \ $(MONITOR_CFLAGS) \ $(MODEL_CFLAGS) \ - $(STDIO_CFLAGS) \ $(TERMIO_CFLAGS) \ $(DEVZERO_CFLAGS) SIM_FPU_CFLAGS = @sim_fpu_cflags@ diff --git a/sim/ppc/config.in b/sim/ppc/config.in index 02c7bf0..d001811 100644 --- a/sim/ppc/config.in +++ b/sim/ppc/config.in @@ -325,6 +325,18 @@ when building for Cygwin. */ #undef USE_WIN32API +/* Sim assert settings */ +#undef WITH_ASSERT + +/* Sim default environment */ +#undef WITH_ENVIRONMENT + +/* How to route I/O */ +#undef WITH_STDIO + +/* Sim trace settings */ +#undef WITH_TRACE + /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ #if defined AC_APPLE_UNIVERSAL_BUILD diff --git a/sim/ppc/configure b/sim/ppc/configure index a77265d..2331479 100755 --- a/sim/ppc/configure +++ b/sim/ppc/configure @@ -595,17 +595,16 @@ sim_targ_vals sim_callback sim_devzero sim_termio -sim_stdio sim_model_issue sim_model sim_monitor sim_reserved -sim_trace sim_timebase -sim_env sim_hostbitsize sim_igen_smp +sim_smp sim_hostendian +sim_xor_endian sim_pk_obj sim_pk_src sim_hw_obj @@ -670,8 +669,6 @@ INSTALL_SCRIPT INSTALL_PROGRAM WERROR_CFLAGS WARN_CFLAGS -sim_xor_endian -sim_smp sim_reserved_bits sim_inline sim_hw @@ -682,9 +679,7 @@ sim_scache sim_float sim_endian sim_bitsize -sim_assert sim_alignment -sim_environment target_alias host_alias build_alias @@ -4075,10 +4070,6 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu - - - - # intl sister-directory configuration rules. # @@ -5179,20 +5170,25 @@ else fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable sim asserts" >&5 +$as_echo_n "checking whether to enable sim asserts... " >&6; } +sim_assert="1" # Check whether --enable-sim-assert was given. if test "${enable_sim_assert+set}" = set; then : enableval=$enable_sim_assert; case "${enableval}" in - yes) sim_assert="-DWITH_ASSERT=1";; - no) sim_assert="-DWITH_ASSERT=0";; - *) as_fn_error "\"--enable-sim-assert does not take a value\"" "$LINENO" 5; sim_assert="";; + yes) sim_assert="1";; + no) sim_assert="0";; + *) as_fn_error "--enable-sim-assert does not take a value" "$LINENO" 5;; esac -if test x"$silent" != x"yes" && test x"$sim_assert" != x""; then - echo "Setting assert flags = $sim_assert" 6>&1 -fi -else - sim_assert="" fi +cat >>confdefs.h <<_ACEOF +#define WITH_ASSERT $sim_assert +_ACEOF + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $sim_assert" >&5 +$as_echo "$sim_assert" >&6; } + # Check whether --enable-sim-bitsize was given. if test "${enable_sim_bitsize+set}" = set; then : @@ -5304,22 +5300,27 @@ else fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking default sim environment setting" >&5 +$as_echo_n "checking default sim environment setting... " >&6; } +sim_env="0" # Check whether --enable-sim-env was given. if test "${enable_sim_env+set}" = set; then : enableval=$enable_sim_env; case "${enableval}" in - operating | os | oea) sim_env="-DWITH_ENVIRONMENT=OPERATING_ENVIRONMENT";; - virtual | vea) sim_env="-DWITH_ENVIRONMENT=VIRTUAL_ENVIRONMENT";; - user | uea) sim_env="-DWITH_ENVIRONMENT=USER_ENVIRONMENT";; - no) sim_env="-DWITH_ENVIRONMENT=0";; - *) as_fn_error "\"Unknown value $enableval passed to --enable-sim-env\"" "$LINENO" 5; sim_env="";; + operating | os | oea) sim_env="OPERATING_ENVIRONMENT";; + virtual | vea) sim_env="VIRTUAL_ENVIRONMENT";; + user | uea) sim_env="USER_ENVIRONMENT";; + no) sim_env="0";; + *) as_fn_error "Unknown value $enableval passed to --enable-sim-env" "$LINENO" 5;; esac -if test x"$silent" != x"yes" && test x"$sim_env" != x""; then - echo "Setting env flags = $sim_env" 6>&1 -fi -else - sim_env="" fi +cat >>confdefs.h <<_ACEOF +#define WITH_ENVIRONMENT $sim_env +_ACEOF + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $sim_env" >&5 +$as_echo "$sim_env" >&6; } + # Check whether --enable-sim-filter was given. if test "${enable_sim_filter+set}" = set; then : @@ -6452,20 +6453,25 @@ fi fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sim stdio debug behavior" >&5 +$as_echo_n "checking for sim stdio debug behavior... " >&6; } +sim_stdio=0 # Check whether --enable-sim-stdio was given. if test "${enable_sim_stdio+set}" = set; then : enableval=$enable_sim_stdio; case "${enableval}" in - yes) sim_stdio="-DWITH_STDIO=DO_USE_STDIO";; - no) sim_stdio="-DWITH_STDIO=DONT_USE_STDIO";; - *) as_fn_error "\"Unknown value $enableval passed to --enable-sim-stdio\"" "$LINENO" 5; sim_stdio="";; + yes) sim_stdio="DO_USE_STDIO";; + no) sim_stdio="DONT_USE_STDIO";; + *) as_fn_error "Unknown value $enableval passed to --enable-sim-stdio" "$LINENO" 5;; esac -if test x"$silent" != x"yes" && test x"$sim_stdio" != x""; then - echo "Setting stdio flags = $sim_stdio" 6>&1 -fi -else - sim_stdio="" fi +cat >>confdefs.h <<_ACEOF +#define WITH_STDIO $sim_stdio +_ACEOF + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $sim_stdio" >&5 +$as_echo "$sim_stdio" >&6; } + # Check whether --enable-sim-switch was given. if test "${enable_sim_switch+set}" = set; then : @@ -6500,20 +6506,25 @@ else fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sim trace settings" >&5 +$as_echo_n "checking for sim trace settings... " >&6; } +sim_trace="1" # Check whether --enable-sim-trace was given. if test "${enable_sim_trace+set}" = set; then : enableval=$enable_sim_trace; case "${enableval}" in - yes) sim_trace="-DWITH_TRACE=1";; - no) sim_trace="-DWITH_TRACE=0";; - *) as_fn_error "\"--enable-sim-trace does not take a value\"" "$LINENO" 5; sim_trace="";; + yes) sim_trace="1";; + no) sim_trace="0";; + *) as_fn_error "--enable-sim-trace does not take a value" "$LINENO" 5;; esac -if test x"$silent" != x"yes" && test x"$sim_trace" != x""; then - echo "Setting trace flags = $sim_trace" 6>&1 -fi -else - sim_trace="" fi +cat >>confdefs.h <<_ACEOF +#define WITH_TRACE $sim_trace +_ACEOF + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $sim_trace" >&5 +$as_echo "$sim_trace" >&6; } + # Check whether --enable-sim-warnings was given. if test "${enable_sim_warnings+set}" = set; then : @@ -7844,10 +7855,6 @@ fi - - - - ac_config_files="$ac_config_files Makefile" ac_config_commands="$ac_config_commands default" diff --git a/sim/ppc/configure.ac b/sim/ppc/configure.ac index 8ac9fd0..8635d8f 100644 --- a/sim/ppc/configure.ac +++ b/sim/ppc/configure.ac @@ -33,16 +33,17 @@ if test x"$silent" != x"yes" && test x"$sim_alignment" != x""; then fi],[sim_alignment=""])dnl +AC_MSG_CHECKING([whether to enable sim asserts]) +sim_assert="1" AC_ARG_ENABLE(sim-assert, [ --enable-sim-assert Specify whether to perform random assertions.], [case "${enableval}" in - yes) sim_assert="-DWITH_ASSERT=1";; - no) sim_assert="-DWITH_ASSERT=0";; - *) AC_MSG_ERROR("--enable-sim-assert does not take a value"); sim_assert="";; -esac -if test x"$silent" != x"yes" && test x"$sim_assert" != x""; then - echo "Setting assert flags = $sim_assert" 6>&1 -fi],[sim_assert=""])dnl + yes) sim_assert="1";; + no) sim_assert="0";; + *) AC_MSG_ERROR([--enable-sim-assert does not take a value]);; +esac])dnl +AC_DEFINE_UNQUOTED([WITH_ASSERT], [$sim_assert], [Sim assert settings]) +AC_MSG_RESULT($sim_assert) AC_ARG_ENABLE(sim-bitsize, @@ -137,18 +138,19 @@ if test x"$silent" != x"yes" && test x"$sim_endian" != x""; then fi],[sim_endian=""])dnl +AC_MSG_CHECKING([default sim environment setting]) +sim_env="0" AC_ARG_ENABLE(sim-env, [ --enable-sim-env=env Specify target environment (operating, virtual, user).], [case "${enableval}" in - operating | os | oea) sim_env="-DWITH_ENVIRONMENT=OPERATING_ENVIRONMENT";; - virtual | vea) sim_env="-DWITH_ENVIRONMENT=VIRTUAL_ENVIRONMENT";; - user | uea) sim_env="-DWITH_ENVIRONMENT=USER_ENVIRONMENT";; - no) sim_env="-DWITH_ENVIRONMENT=0";; - *) AC_MSG_ERROR("Unknown value $enableval passed to --enable-sim-env"); sim_env="";; -esac -if test x"$silent" != x"yes" && test x"$sim_env" != x""; then - echo "Setting env flags = $sim_env" 6>&1 -fi],[sim_env=""])dnl + operating | os | oea) sim_env="OPERATING_ENVIRONMENT";; + virtual | vea) sim_env="VIRTUAL_ENVIRONMENT";; + user | uea) sim_env="USER_ENVIRONMENT";; + no) sim_env="0";; + *) AC_MSG_ERROR([Unknown value $enableval passed to --enable-sim-env]);; +esac])dnl +AC_DEFINE_UNQUOTED([WITH_ENVIRONMENT], [$sim_env], [Sim default environment]) +AC_MSG_RESULT($sim_env) AC_ARG_ENABLE(sim-filter, @@ -533,16 +535,17 @@ if test x"$silent" != x"yes"; then fi])dnl +AC_MSG_CHECKING([for sim stdio debug behavior]) +sim_stdio=0 AC_ARG_ENABLE(sim-stdio, [ --enable-sim-stdio Specify whether to use stdio for console input/output.], [case "${enableval}" in - yes) sim_stdio="-DWITH_STDIO=DO_USE_STDIO";; - no) sim_stdio="-DWITH_STDIO=DONT_USE_STDIO";; - *) AC_MSG_ERROR("Unknown value $enableval passed to --enable-sim-stdio"); sim_stdio="";; -esac -if test x"$silent" != x"yes" && test x"$sim_stdio" != x""; then - echo "Setting stdio flags = $sim_stdio" 6>&1 -fi],[sim_stdio=""])dnl + yes) sim_stdio="DO_USE_STDIO";; + no) sim_stdio="DONT_USE_STDIO";; + *) AC_MSG_ERROR([Unknown value $enableval passed to --enable-sim-stdio]);; +esac])dnl +AC_DEFINE_UNQUOTED([WITH_STDIO], [$sim_stdio], [How to route I/O]) +AC_MSG_RESULT($sim_stdio) AC_ARG_ENABLE(sim-switch, @@ -572,16 +575,17 @@ if test x"$silent" != x"yes" && test x"$sim_timebase" != x""; then fi],[sim_timebase=""])dnl +AC_MSG_CHECKING([for sim trace settings]) +sim_trace="1" AC_ARG_ENABLE(sim-trace, [ --enable-sim-trace Specify whether tracing is supported.], [case "${enableval}" in - yes) sim_trace="-DWITH_TRACE=1";; - no) sim_trace="-DWITH_TRACE=0";; - *) AC_MSG_ERROR("--enable-sim-trace does not take a value"); sim_trace="";; -esac -if test x"$silent" != x"yes" && test x"$sim_trace" != x""; then - echo "Setting trace flags = $sim_trace" 6>&1 -fi],[sim_trace=""])dnl + yes) sim_trace="1";; + no) sim_trace="0";; + *) AC_MSG_ERROR([--enable-sim-trace does not take a value]);; +esac])dnl +AC_DEFINE_UNQUOTED([WITH_TRACE], [$sim_trace], [Sim trace settings]) +AC_MSG_RESULT($sim_trace) AC_ARG_ENABLE(sim-warnings, @@ -858,18 +862,14 @@ AC_SUBST(sim_smp) AC_SUBST(sim_igen_smp) AC_SUBST(sim_bitsize) AC_SUBST(sim_hostbitsize) -AC_SUBST(sim_env) AC_SUBST(sim_timebase) AC_SUBST(sim_alignment) AC_SUBST(sim_float) -AC_SUBST(sim_trace) -AC_SUBST(sim_assert) AC_SUBST(sim_reserved) AC_SUBST(sim_monitor) AC_SUBST(sim_model) AC_SUBST(sim_default_model) AC_SUBST(sim_model_issue) -AC_SUBST(sim_stdio) AC_SUBST(sim_termio) AC_SUBST(sim_devzero) AC_SUBST(sim_callback) diff --git a/sim/ppc/std-config.h b/sim/ppc/std-config.h index badce3d..7e6b8c2 100644 --- a/sim/ppc/std-config.h +++ b/sim/ppc/std-config.h @@ -111,10 +111,6 @@ extern int current_target_byte_order; #define VIRTUAL_ENVIRONMENT 2 #define OPERATING_ENVIRONMENT 3 -#ifndef WITH_ENVIRONMENT -#define WITH_ENVIRONMENT 0 -#endif - extern int current_environment; #define CURRENT_ENVIRONMENT (WITH_ENVIRONMENT \ ? WITH_ENVIRONMENT \ @@ -223,20 +219,6 @@ extern int current_floating_point; Control the inclusion of debugging code. */ -/* Include the tracing code. Disabling this eliminates all tracing - code */ - -#ifndef WITH_TRACE -#define WITH_TRACE 1 -#endif - -/* include code that checks assertions scattered through out the - program */ - -#ifndef WITH_ASSERT -#define WITH_ASSERT 1 -#endif - /* Whether to check instructions for reserved bits being set */ #ifndef WITH_RESERVED_BITS @@ -283,10 +265,6 @@ extern int current_model_issue; #define DONT_USE_STDIO 2 #define DO_USE_STDIO 1 -#ifndef WITH_STDIO -#define WITH_STDIO 0 -#endif - extern int current_stdio; #define CURRENT_STDIO (WITH_STDIO \ ? WITH_STDIO \ -- cgit v1.1