From ae7d0cac8ce971f7108d270c1d3f8481919b1e86 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Sat, 14 Mar 2015 23:41:25 -0400 Subject: sim: rename tconfig.in to tconfig.h Rather than manually include tconfig.h when we think we'll need it (which is error prone as it can define symbols we expect from config.h), have it be included directly by config.h. Since we know we have to include that header everywhere already, this will make sure tconfig.h isn't missed. It should also be fine as tconfig.h is supposed to be simple and only set up a few core defines for the target. This allows us to stop symlinking it in place all the time and just use it straight out of the respective source directory. --- sim/common/ChangeLog | 9 +++++++++ sim/common/acinclude.m4 | 13 +++---------- sim/common/config.in | 2 ++ sim/common/configure | 14 ++++---------- sim/common/nrun.c | 1 - sim/common/run.c | 1 - sim/common/sim-basics.h | 5 ----- sim/common/tconfig.h | 19 +++++++++++++++++++ sim/common/tconfig.in | 19 ------------------- 9 files changed, 37 insertions(+), 46 deletions(-) create mode 100644 sim/common/tconfig.h delete mode 100644 sim/common/tconfig.in (limited to 'sim/common') diff --git a/sim/common/ChangeLog b/sim/common/ChangeLog index 08d3b93..b756733 100644 --- a/sim/common/ChangeLog +++ b/sim/common/ChangeLog @@ -1,3 +1,12 @@ +2015-03-16 Mike Frysinger + + * acinclude.m4 (SIM_AC_COMMON): Call AH_BOTTOM. Delete logic for + symlinking tconfig.h to tconfig.in. + * config.in, configure: Regenerate. + * nrun.c, run.c, sim-basics.h: Delete tconfig.h include. + * tconfig.in: Rename file ... + * tconfig.h: ... here. + 2015-03-15 Mike Frysinger * dv-socker.h (dv_sockser_install): Declare. diff --git a/sim/common/acinclude.m4 b/sim/common/acinclude.m4 index f96ec35..2e1d31f 100644 --- a/sim/common/acinclude.m4 +++ b/sim/common/acinclude.m4 @@ -53,6 +53,9 @@ AR=${AR-ar} AC_SUBST(AR) AC_PROG_RANLIB +dnl Pull in the target configuration file directly. +AH_BOTTOM([#include "tconfig.h"]) + # Some of the common include files depend on bfd.h, and bfd.h checks # that config.h is included first by testing that the PACKAGE macro # is defined. @@ -247,16 +250,6 @@ dnl These are available to append to as desired. sim_link_files= sim_link_links= -dnl Create tconfig.h either from simulator's tconfig.in or default one -dnl in common. -sim_link_links=tconfig.h -if test -f ${srcdir}/tconfig.in -then - sim_link_files=tconfig.in -else - sim_link_files=../common/tconfig.in -fi - # targ-vals.def points to the libc macro description file. case "${target}" in *-*-*) TARG_VALS_DEF=../common/nltvals.def ;; diff --git a/sim/common/config.in b/sim/common/config.in index 5b8ebd8..e0ca8ae 100644 --- a/sim/common/config.in +++ b/sim/common/config.in @@ -210,3 +210,5 @@ /* Define to 1 if you need to in order for `stat' and other things to work. */ #undef _POSIX_SOURCE + +#include "tconfig.h" diff --git a/sim/common/configure b/sim/common/configure index add4c0f..db5f661 100755 --- a/sim/common/configure +++ b/sim/common/configure @@ -6541,6 +6541,8 @@ else fi + + # Some of the common include files depend on bfd.h, and bfd.h checks # that config.h is included first by testing that the PACKAGE macro # is defined. @@ -10623,7 +10625,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 10626 "configure" +#line 10628 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -10729,7 +10731,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 10732 "configure" +#line 10734 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11210,14 +11212,6 @@ _ACEOF sim_link_files= sim_link_links= -sim_link_links=tconfig.h -if test -f ${srcdir}/tconfig.in -then - sim_link_files=tconfig.in -else - sim_link_files=../common/tconfig.in -fi - # targ-vals.def points to the libc macro description file. case "${target}" in *-*-*) TARG_VALS_DEF=../common/nltvals.def ;; diff --git a/sim/common/nrun.c b/sim/common/nrun.c index eccb0cb..e3f3c42 100644 --- a/sim/common/nrun.c +++ b/sim/common/nrun.c @@ -17,7 +17,6 @@ along with this program. If not, see . */ /* Need to be before general includes, to pick up e.g. _GNU_SOURCE. */ #ifdef HAVE_CONFIG_H #include "cconfig.h" -#include "tconfig.h" #endif #include diff --git a/sim/common/run.c b/sim/common/run.c index e474661..3be10ab 100644 --- a/sim/common/run.c +++ b/sim/common/run.c @@ -19,7 +19,6 @@ along with this program. If not, see . */ #ifdef HAVE_CONFIG_H #include "cconfig.h" -#include "tconfig.h" #endif #include diff --git a/sim/common/sim-basics.h b/sim/common/sim-basics.h index 2a410bb..2730569 100644 --- a/sim/common/sim-basics.h +++ b/sim/common/sim-basics.h @@ -126,11 +126,6 @@ typedef enum { /* Basic definitions - ordered so that nothing calls what comes after it. */ -/* FIXME: conditionalizing tconfig.h on HAVE_CONFIG_H seems wrong. */ -#ifdef HAVE_CONFIG_H -#include "tconfig.h" -#endif - #include "ansidecl.h" #include "gdb/callback.h" #include "gdb/remote-sim.h" diff --git a/sim/common/tconfig.h b/sim/common/tconfig.h new file mode 100644 index 0000000..fd8b5be --- /dev/null +++ b/sim/common/tconfig.h @@ -0,0 +1,19 @@ +/* Default target configuration file. + To override this, create file `tconfig.in' in the simulator's + source directory. */ + +/* Define this if the simulator supports profiling. + See the mips simulator for an example. + This enables the `-p foo' and `-s bar' options. + The target is required to provide sim_set_profile{,_size}. */ +/* #define SIM_HAVE_PROFILE */ + +/* Define this if the simulator uses an instruction cache. + See the h8/300 simulator for an example. + This enables the `-c size' option to set the size of the cache. + The target is required to provide sim_set_simcache_size. */ +/* #define SIM_HAVE_SIMCACHE */ + +/* Define this if the target cpu is bi-endian + and the simulator supports it. */ +/* #define SIM_HAVE_BIENDIAN */ diff --git a/sim/common/tconfig.in b/sim/common/tconfig.in deleted file mode 100644 index fd8b5be..0000000 --- a/sim/common/tconfig.in +++ /dev/null @@ -1,19 +0,0 @@ -/* Default target configuration file. - To override this, create file `tconfig.in' in the simulator's - source directory. */ - -/* Define this if the simulator supports profiling. - See the mips simulator for an example. - This enables the `-p foo' and `-s bar' options. - The target is required to provide sim_set_profile{,_size}. */ -/* #define SIM_HAVE_PROFILE */ - -/* Define this if the simulator uses an instruction cache. - See the h8/300 simulator for an example. - This enables the `-c size' option to set the size of the cache. - The target is required to provide sim_set_simcache_size. */ -/* #define SIM_HAVE_SIMCACHE */ - -/* Define this if the target cpu is bi-endian - and the simulator supports it. */ -/* #define SIM_HAVE_BIENDIAN */ -- cgit v1.1