From 247fccdeb54a09a14287b2e829511803ad9d7cc1 Mon Sep 17 00:00:00 2001 From: Andrew Cagney Date: Mon, 25 Aug 1997 23:14:25 +0000 Subject: Add ABFD argument to sim_open call. Pass through to sim_config so that image properties such as endianness can be checked. More strongly document the expected behavour of each of the sim_* interfaces. Add default endian argument to simulator config macro SIM_AC_OPTION_ENDIAN. Use in sim_config. --- gdb/ChangeLog | 4 + gdb/remote-sim.c | 2 +- include/ChangeLog | 5 +- include/remote-sim.h | 120 ++- sim/ChangeLog | 27 + sim/arm/ChangeLog | 18 + sim/arm/wrapper.c | 15 +- sim/common/ChangeLog | 32 + sim/common/aclocal.m4 | 110 ++- sim/common/nrun.c | 39 +- sim/common/run.c | 10 +- sim/common/sim-config.c | 187 +++-- sim/common/sim-config.h | 106 +-- sim/configure | 29 +- sim/configure.in | 17 +- sim/d10v/ChangeLog | 18 + sim/d10v/interp.c | 13 +- sim/erc32/ChangeLog | 22 + sim/erc32/interf.c | 13 +- sim/h8300/ChangeLog | 16 + sim/h8300/compile.c | 46 +- sim/m32r/ChangeLog | 25 + sim/m32r/configure | 1932 +++++++++++++++++++++++++++++++++++++++++++++++ sim/m32r/sim-if.c | 35 +- sim/mips/ChangeLog | 23 + sim/mips/configure | 609 +++++++++++++-- sim/mips/gencode.c | 3 - sim/mips/interp.c | 44 +- sim/mn10300/ChangeLog | 17 + sim/mn10300/interp.c | 12 +- sim/ppc/ChangeLog | 41 +- sim/ppc/sim_calls.c | 15 +- sim/sh/ChangeLog | 24 + sim/sh/interp.c | 20 +- sim/tic80/ChangeLog | 11 + sim/tic80/configure | 46 +- sim/tic80/sim-calls.c | 11 +- sim/v850/ChangeLog | 9 + sim/v850/interp.c | 204 ++--- sim/w65/ChangeLog | 4 + sim/w65/interp.c | 3 +- 41 files changed, 3424 insertions(+), 513 deletions(-) create mode 100755 sim/m32r/configure diff --git a/gdb/ChangeLog b/gdb/ChangeLog index c2c6f23..6ab0351 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,7 @@ +Mon Aug 25 12:21:46 1997 Andrew Cagney + + * remote-sim.c (gdbsim_open): Pass exec_bfd to sim_open call. + Sun Aug 24 21:16:59 1997 Geoffrey Noer * ocd.c: comment out sections that create and flush wigglers.log diff --git a/gdb/remote-sim.c b/gdb/remote-sim.c index ba9695f..212cc98 100644 --- a/gdb/remote-sim.c +++ b/gdb/remote-sim.c @@ -515,7 +515,7 @@ gdbsim_open (args, from_tty) make_cleanup (freeargv, (char *) argv); init_callbacks (); - gdbsim_desc = sim_open (SIM_OPEN_DEBUG, &gdb_callback, argv); + gdbsim_desc = sim_open (SIM_OPEN_DEBUG, &gdb_callback, exec_bfd, argv); if (gdbsim_desc == 0) error ("unable to create simulator instance"); diff --git a/include/ChangeLog b/include/ChangeLog index 0e5b3ad..42d62f6 100644 --- a/include/ChangeLog +++ b/include/ChangeLog @@ -1,6 +1,7 @@ -Thu Aug 14 12:54:07 1997 Doug Evans +Mon Aug 25 10:50:51 1997 Andrew Cagney - * callback.h (cb_printf, cb_eprintf): Declare. + * remote-sim.h (sim_open): Add ABFD arg. Change ARGV to PARGV. + Document. Fri Aug 8 16:43:56 1997 Doug Evans diff --git a/include/remote-sim.h b/include/remote-sim.h index 369f4fa..f77a9fc 100644 --- a/include/remote-sim.h +++ b/include/remote-sim.h @@ -64,45 +64,114 @@ struct _bfd; /* Main simulator entry points. */ -/* Create a simulator instance. +/* Create a fully initialized simulator instance. + (This function is called when the simulator is selected from the gdb command line.) + KIND specifies how the simulator will be used. Currently there are only - two kinds: standalone and debug. + two kinds: stand-alone and debug. + CALLBACK specifies a standard host callback (defined in callback.h). - ARGV is passed from the command line and can be used to select whatever - run time options the simulator provides. It is the standard NULL - terminated array of pointers, with argv[0] being the program name. - The result is a descriptor that shall be passed to the other - sim_foo functions. */ -SIM_DESC sim_open PARAMS ((SIM_OPEN_KIND kind, struct host_callback_struct *callback, char **argv)); + ABFD, when non NULL, designates a target program. The program is + not loaded. + + ARGV is a standard ARGV pointer such as that passed from the + command line. The syntax of the argument list is is assumed to be + ``SIM-PROG { SIM-OPTION } [ TARGET-PROGRAM { TARGET-OPTION } ]''. + + On success, the result is a non NULL descriptor that shall be + passed to the other sim_foo functions. While the simulator + configuration can be parameterized by (in decreasing precedence) + ARGV's SIM-OPTION, ARGV's TARGET-PROGRAM and the ABFD argument, the + successful creation of the simulator shall not dependent on the + presence of any of these arguments/options. + + For a simulator modeling real hardware, the created simulator shall + be sufficiently initialized to handle, with out restrictions any + client requests (including memory reads/writes, register + fetch/stores and a resume). + + For a simulator modeling a process, that process is not created + until a call to sim_create_inferior. FIXME: What should the state + of the simulator be? */ + +SIM_DESC sim_open PARAMS ((SIM_OPEN_KIND kind, struct host_callback_struct *callback, struct _bfd *abfd, char **argv)); /* Destory a simulator instance. + + QUITTING is non-zero if we cannot hang on errors. + This may involve freeing target memory and closing any open files and mmap'd areas. You cannot assume sim_kill has already been - called. - QUITTING is non-zero if we cannot hang on errors. */ + called. */ void sim_close PARAMS ((SIM_DESC sd, int quitting)); -/* Load program PROG into the simulator. +/* Load program PROG into the simulators memory. + If ABFD is non-NULL, the bfd for the file has already been opened. - The result is a return code indicating success. */ + The result is a return code indicating success. + + For a simulator modeling real hardware, the client is permitted to + make multiple calls to this function. Such calls have an + accumulative effect. + + For a simulator modeling a process, calls to this function may be + ignored. */ SIM_RC sim_load PARAMS ((SIM_DESC sd, char *prog, struct _bfd *abfd, int from_tty)); /* Prepare to run the simulated program. - ARGV and ENV are NULL terminated lists of pointers. */ + + ARGV and ENV are NULL terminated lists of pointers. + + For a simulator modeling real hardware, this function shall + initialize the processor registers to a known value. The program + counter shall be set to the start address obtained from the last + program loaded (or the hardware reset default). The ARGV and ENV + arguments can be ignored. + + For a simulator modeling a process, after a call to this function a + new process instance shall exist - the TEXT, DATA, BSS and stack + regions shall all be initialized, ARGV and ENV shall be written to + process address space (according to the applicable ABI), and the + program counter and stack pointer set accordingly. (NB: A simulator + may in fact initialize the TEXT, DATA and BSS sections during an + earlier stage). + + -- + + FIXME: Is the below a better definition - assuming that ABFD arg is + added. + + Prepare to run the simulated program. + + ABFD, if not NULL, can be used to obtain initial processor state + information (eg PC value). + ARGV and ENV, if non NULL, are NULL terminated lists of pointers. + + For a simulator modeling real hardware, this function shall + initialize the processor registers to a known value. The program + counter shall be set to the start address obtained from the ABFD + struct (or the hardware reset default). The ARGV and ENV arguments + can be ignored. + + For a simulator modeling a process, after a call to this function a + new process instance shall exist - the TEXT, DATA, BSS and stack + regions shall all be initialized, ARGV and ENV shall be written to + process address space (according to the applicable ABI), and the + program counter and stack pointer set accordingly. */ SIM_RC sim_create_inferior PARAMS ((SIM_DESC sd, char **argv, char **env)); -/* Read LENGTH bytes of the simulated program's memory and store in BUF. - Result is number of bytes read, or zero if error. */ +/* Read LENGTH bytes of the simulated program's memory and store in + BUF. Result is number of bytes read, or zero if error. */ int sim_read PARAMS ((SIM_DESC sd, SIM_ADDR mem, unsigned char *buf, int length)); @@ -113,7 +182,8 @@ int sim_read PARAMS ((SIM_DESC sd, SIM_ADDR mem, unsigned char *buf, int length) int sim_write PARAMS ((SIM_DESC sd, SIM_ADDR mem, unsigned char *buf, int length)); -/* Fetch register REGNO and store the raw (target endian) value in BUF. */ +/* Fetch register REGNO and store the raw (target endian) value in + BUF. */ void sim_fetch_register PARAMS ((SIM_DESC sd, int regno, unsigned char *buf)); @@ -124,6 +194,7 @@ void sim_store_register PARAMS ((SIM_DESC sd, int regno, unsigned char *buf)); /* Print whatever statistics the simulator has collected. + VERBOSE is currently unused and must always be zero. */ void sim_info PARAMS ((SIM_DESC sd, int verbose)); @@ -142,14 +213,18 @@ int sim_stop PARAMS ((SIM_DESC sd)); /* Fetch the REASON why the program stopped. + SIM_EXITED: The program has terminated. SIGRC indicates the target dependant exit status. + SIM_STOPPED: The program has stopped. SIGRC indicates the reason: program interrupted by user via a sim_stop request (SIGINT); a breakpoint instruction (SIGTRAP); a completed step (SIGTRAP); an internal error condition (SIGABRT). + SIM_SIGNALLED: The simulator encountered target code that requires the signal SIGRC to be delivered to the simulated program. + SIM_RUNNING, SIM_POLLING: The return of one of these values indicates a problem internal to the simulator. */ @@ -163,10 +238,10 @@ void sim_stop_reason PARAMS ((SIM_DESC sd, enum sim_stop *reason, int *sigrc)); or empty CMD. */ void sim_do_command PARAMS ((SIM_DESC sd, char *cmd)); - + /* Provide simulator with a default (global) host_callback_struct. - THIS PROCEDURE IS IS DEPRECIATED. + THIS PROCEDURE IS DEPRECIATED. GDB and NRUN do not use this interface. This procedure does not take a SIM_DESC argument as it is used before sim_open. */ @@ -175,7 +250,7 @@ void sim_set_callbacks PARAMS ((struct host_callback_struct *)); /* Set the size of the simulator memory array. - THIS PROCEDURE IS IS DEPRECIATED. + THIS PROCEDURE IS DEPRECIATED. GDB and NRUN do not use this interface. This procedure does not take a SIM_DESC argument as it is used before sim_open. */ @@ -184,7 +259,7 @@ void sim_size PARAMS ((int i)); /* Run a simulation with tracing enabled. - THIS PROCEDURE IS IS DEPRECIATED. + THIS PROCEDURE IS DEPRECIATED. GDB and NRUN do not use this interface. This procedure does not take a SIM_DESC argument as it is used before sim_open. */ @@ -193,7 +268,7 @@ int sim_trace PARAMS ((SIM_DESC sd)); /* Configure the size of the profile buffer. - THIS PROCEDURE IS IS DEPRECIATED. + THIS PROCEDURE IS DEPRECIATED. GDB and NRUN do not use this interface. This procedure does not take a SIM_DESC argument as it is used before sim_open. */ @@ -202,12 +277,11 @@ void sim_set_profile_size PARAMS ((int n)); /* Kill the running program. - THIS PROCEDURE IS IS DEPRECIATED. + THIS PROCEDURE IS DEPRECIATED. GDB and NRUN do not use this interface. This procedure will be replaced as part of the introduction of multi-cpu simulators. */ void sim_kill PARAMS ((SIM_DESC sd)); - #endif /* !defined (REMOTE_SIM_H) */ diff --git a/sim/ChangeLog b/sim/ChangeLog index 5bb7e99..74ad51f 100644 --- a/sim/ChangeLog +++ b/sim/ChangeLog @@ -1,5 +1,32 @@ +Mon Aug 25 16:26:53 1997 Andrew Cagney + + * configure.in (sparc*-*-*, only_if_enabled): Set + only_if_enabled=yes. Check only_if_enabled before enabling a + simulator. + * configure: Regenerate. + +start-sanitize-v850e +Mon Aug 18 10:56:59 1997 Nick Clifton + + * configure.in (extra_subdirs): Add v850e target. + +end-sanitize-v850e +start-sanitize-v850eq +Mon Aug 18 10:56:59 1997 Nick Clifton + + * configure.in (extra_subdirs): Add v850eq target. + +end-sanitize-v850eq +Fri Jul 25 11:40:47 1997 Doug Evans + + * configure.in (sparc*-*-*): Don't build erc32. + * configure: Regenerate. + Thu Apr 24 00:47:20 1997 Doug Evans + * configure.in (m32r-*-*): New target. + * configure: Regenerate. + * Makefile.in (autoconf-common, autoconf-changelog): Change $* to $@. Mon Apr 21 22:57:55 1997 Andrew Cagney diff --git a/sim/arm/ChangeLog b/sim/arm/ChangeLog index 28314dd..40571c8 100644 --- a/sim/arm/ChangeLog +++ b/sim/arm/ChangeLog @@ -1,3 +1,21 @@ +Mon Aug 25 17:50:22 1997 Andrew Cagney + + * configure: Regenerated to track ../common/aclocal.m4 changes. + * config.in: Ditto. + +Mon Aug 25 15:35:45 1997 Andrew Cagney + + * wrapper.c (sim_open): Add ABFD argument. + +Tue May 20 10:13:26 1997 Andrew Cagney + + * wrapper.c (sim_open): Add callback argument. + (sim_set_callbacks): Drop SIM_DESC argument. + +Thu Apr 24 00:39:51 1997 Doug Evans + + * configure: Regenerated to track ../common/aclocal.m4 changes. + Fri Apr 18 13:32:23 1997 Andrew Cagney * wrapper.c (sim_stop): Stub sim_stop function. diff --git a/sim/arm/wrapper.c b/sim/arm/wrapper.c index f1e6153..37a3723 100644 --- a/sim/arm/wrapper.c +++ b/sim/arm/wrapper.c @@ -146,6 +146,13 @@ sim_trace (sd) return 1; } +int +sim_stop (sd) + SIM_DESC sd; +{ + return 0; +} + void sim_resume (sd, step, siggnal) SIM_DESC sd; @@ -252,12 +259,15 @@ sim_fetch_register (sd, rn, memory) SIM_DESC -sim_open (kind, argv) +sim_open (kind, ptr, abfd, argv) SIM_OPEN_KIND kind; + host_callback *ptr; + struct _bfd *abfd; char **argv; { sim_kind = kind; myname = argv[0]; + sim_callback = ptr; return (SIM_DESC) 1; } @@ -327,8 +337,7 @@ sim_do_command (sd, cmd) void -sim_set_callbacks (sd, ptr) - SIM_DESC sd; +sim_set_callbacks (ptr) host_callback *ptr; { sim_callback = ptr; diff --git a/sim/common/ChangeLog b/sim/common/ChangeLog index ba550cc..7fc83af 100644 --- a/sim/common/ChangeLog +++ b/sim/common/ChangeLog @@ -1,8 +1,40 @@ +Mon Aug 25 17:50:22 1997 Andrew Cagney + + * configure: Regenerated to track ../common/aclocal.m4 changes. + * config.in: Ditto. + +Mon Aug 25 12:11:06 1997 Andrew Cagney + + * aclocal.m4 (sim-endian): Add second argument to + SIM_AC_OPTION_ENDIAN. First is hardwired endian, second is + default endian when not hardwired. + + * sim-config.h (WITH_DEFAULT_TARGET_BYTE_ORDER): New macro, if all + else failes value for target byte order. + + * sim-config.c (sim_config): Add abfd arguments. Set + STATE_PROG_BFD accordingly. Determine prefered_target_byte_order + from same. + (sim_config): Return SIM_RC, don't abort. + (bfd.h): Include. + + * run.c (main): Update call to sim_open - add ABFD argument. + * nrun.c (main): Add NULL ABFD argument. + Thu Aug 14 12:48:57 1997 Doug Evans * callback.c (os_poll_quit): Make static. Call sim_cb_eprintf, not p->eprintf. (sim_cb_printf, sim_cb_eprintf): New functions. + * sim-utils.h (sim_cb_printf, sim_cb_eprintf): Declare. + + * sim-basics.h (zalloc,zfree,sim_add_commas,SIM_ELAPSED_TIME, + sim_elapsed_time_get,sim_elapsed_time_since): Move decls to + sim-utils.h. #include sim-utils.h. + * sim-utils.h: Above decls moved here. + (sim_analyze_program,sim_load_file): Use `struct _bfd', not `bfd'. + + * sim-watch.c (action_watchpoint): Fix thinkos. Thu Jul 24 08:48:05 1997 Stu Grossman (grossman@critters.cygnus.com) diff --git a/sim/common/aclocal.m4 b/sim/common/aclocal.m4 index 68896d0..541420f 100644 --- a/sim/common/aclocal.m4 +++ b/sim/common/aclocal.m4 @@ -118,13 +118,27 @@ AC_SUBST(sim_stdio) dnl --enable-sim-trace is for users of the simulator -dnl the allowable values are work-in-progress +dnl The argument is either a bitmask of things to enable [exactly what is +dnl up to the simulator], or is a comma separated list of names of tracing +dnl elements to enable. The latter is only supported on simulators that +dnl use WITH_TRACE. AC_ARG_ENABLE(sim-trace, [ --enable-sim-trace=opts Enable tracing flags], [case "${enableval}" in - yes) sim_trace="-DTRACE=1 -DWITH_TRACE=1";; + yes) sim_trace="-DTRACE=1 -DWITH_TRACE=-1";; no) sim_trace="-DTRACE=0 -DWITH_TRACE=0";; - *) sim_trace="-DTRACE='(${enableval})' -DWITH_TRACE='(${enableval})'";; + [[-0-9]]*) + sim_trace="-DTRACE='(${enableval})' -DWITH_TRACE='(${enableval})'";; + [[a-z]]*) + sim_trace="" + for x in `echo "$enableval" | sed -e "s/,/ /g"`; do + if test x"$sim_trace" = x; then + sim_trace="-DWITH_TRACE='(TRACE_$x" + else + sim_trace="${sim_trace}|TRACE_$x" + fi + done + sim_trace="$sim_trace)'" ;; esac if test x"$silent" != x"yes" && test x"$sim_trace" != x""; then echo "Setting sim trace = $sim_trace" 6>&1 @@ -132,6 +146,35 @@ fi],[sim_trace=""])dnl AC_SUBST(sim_trace) +dnl --enable-sim-profile +dnl The argument is either a bitmask of things to enable [exactly what is +dnl up to the simulator], or is a comma separated list of names of profiling +dnl elements to enable. The latter is only supported on simulators that +dnl use WITH_PROFILE. +AC_ARG_ENABLE(sim-profile, +[ --enable-sim-profile=opts Enable profiling flags], +[case "${enableval}" in + yes) sim_profile="-DPROFILE=1 -DWITH_PROFILE=-1";; + no) sim_profile="-DPROFILE=0 -DWITH_PROFILE=0";; + [[-0-9]]*) + sim_profile="-DPROFILE='(${enableval})' -DWITH_PROFILE='(${enableval})'";; + [[a-z]]*) + sim_profile="" + for x in `echo "$enableval" | sed -e "s/,/ /g"`; do + if test x"$sim_profile" = x; then + sim_profile="-DWITH_PROFILE='(PROFILE_$x" + else + sim_profile="${sim_profile}|PROFILE_$x" + fi + done + sim_profile="$sim_profile)'" ;; +esac +if test x"$silent" != x"yes" && test x"$sim_profile" != x""; then + echo "Setting sim profile = $sim_profile" 6>&1 +fi],[sim_profile=""])dnl +AC_SUBST(sim_profile) + + dnl Types used by common code AC_TYPE_SIGNAL @@ -205,20 +248,30 @@ AC_SUBST(sim_assert) dnl --enable-sim-endian={yes,no,big,little} is for simulators dnl that support both big and little endian targets. +dnl arg[1] is hardwired target endianness. +dnl arg[2] is default target endianness. AC_DEFUN(SIM_AC_OPTION_ENDIAN, [ -default_sim_endian="ifelse([$1],,,-DWITH_TARGET_BYTE_ORDER=[$1])" +wire_endian="ifelse([$1],,ifelse([$2],,,[$2]),[$1])" +default_endian="ifelse([$2],,ifelse([$1],,,[$1]),[$2])" +default_sim_endian="ifelse([$1],,ifelse([$2],,,-DWITH_DEFAULT_TARGET_BYTE_ORDER=[$2]),-DWITH_TARGET_BYTE_ORDER=[$1])" AC_ARG_ENABLE(sim-endian, [ --enable-sim-endian=endian Specify target byte endian orientation.], [case "${enableval}" in - yes) case "$target" in - *powerpc-*) sim_endian="-DWITH_TARGET_BYTE_ORDER=BIG_ENDIAN";; - *powerpcle-*) sim_endian="-DWITH_TARGET_BYTE_ORDER=LITTLE_ENDIAN";; - *) echo "Unknown target $target" 1>&6; sim_endian="-DWITH_TARGET_BYTE_ORDER=0";; - esac;; - no) sim_endian="-DWITH_TARGET_BYTE_ORDER=0";; b*|B*) sim_endian="-DWITH_TARGET_BYTE_ORDER=BIG_ENDIAN";; l*|L*) sim_endian="-DWITH_TARGET_BYTE_ORDER=LITTLE_ENDIAN";; + yes) if test x"$wire_endian" != x; then + sim_endian="-DWITH_TARGET_BYTE_ORDER=${wire_endian}" + else + echo "No hard-wired endian for target $target" 1>&6 + sim_endian="-DWITH_TARGET_BYTE_ORDER=0" + fi;; + no) if test x"$default_endian" != x; then + sim_endian="-DWITH_DEFAULT_TARGET_BYTE_ORDER=${default_endian}" + else + echo "No default endian for target $target" 1>&6 + sim_endian="-DWITH_DEFAULT_TARGET_BYTE_ORDER=0" + fi;; *) AC_MSG_ERROR("Unknown value $enableval for --enable-sim-endian"); sim_endian="";; esac if test x"$silent" != x"yes" && test x"$sim_endian" != x""; then @@ -275,6 +328,43 @@ AC_SUBST(sim_float) ]) +dnl The argument is the default cache size if none is specified. +AC_DEFUN(SIM_AC_OPTION_SCACHE, +[ +default_sim_scache="ifelse([$1],,0,[$1])" +AC_ARG_ENABLE(sim-scache, +[ --enable-sim-scache=size Specify simulator execution cache size.], +[case "${enableval}" in + yes) sim_scache="-DWITH_SCACHE=${default_sim_scache}";; + no) sim_scace= ;; + [[0-9]]*) sim_cache=${enableval};; + *) AC_MSG_ERROR("Bad value $enableval passed to --enable-sim-scache"); + sim_scache="";; +esac +if test x"$silent" != x"yes" && test x"$sim_scache" != x""; then + echo "Setting scache size = $sim_scache" 6>&1 +fi],[sim_scache="-DWITH_SCACHE=${default_sim_scache}"]) +AC_SUBST(sim_scache) +]) + + +dnl The argument is the default model if none is specified. +AC_DEFUN(SIM_AC_OPTION_DEFAULT_MODEL, +[ +default_sim_default_model="ifelse([$1],,0,[$1])" +AC_ARG_ENABLE(sim-default-model, +[ --enable-sim-default-model=model Specify default model to simulate.], +[case "${enableval}" in + yes|no) AC_MSG_ERROR("Missing argument to --enable-sim-default-model");; + *) sim_default_model="-DWITH_DEFAULT_MODEL='\"${enableval}\"'";; +esac +if test x"$silent" != x"yes" && test x"$sim_default_model" != x""; then + echo "Setting default model = $sim_default_model" 6>&1 +fi],[sim_default_model="-DWITH_DEFAULT_MODEL='\"${default_sim_default_model}\"'"]) +AC_SUBST(sim_default_model) +]) + + AC_DEFUN(SIM_AC_OPTION_HARDWARE, [ AC_ARG_ENABLE(sim-hardware, diff --git a/sim/common/nrun.c b/sim/common/nrun.c index 17fdfcc..16525c9 100644 --- a/sim/common/nrun.c +++ b/sim/common/nrun.c @@ -15,40 +15,54 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#include #include "sim-main.h" #ifdef HAVE_ENVIRON extern char **environ; #endif -static void usage PARAMS ((void)); +static void usage (void); extern host_callback default_callback; static char *myname; +static SIM_DESC sd; + +static RETSIGTYPE +cntrl_c (int sig) +{ + if (! sim_stop (sd)) + { + fprintf (stderr, "Quit!\n"); + exit (1); + } +} + int -main (argc, argv) - int argc; - char **argv; +main (int argc, char **argv) { char *name; char **prog_argv = NULL; enum sim_stop reason; int sigrc; - SIM_DESC sd; + RETSIGTYPE (*prev_sigint) (); myname = argv[0] + strlen (argv[0]); while (myname > argv[0] && myname[-1] != '/') --myname; - sim_set_callbacks (NULL, &default_callback); - default_callback.init (&default_callback); - /* Create an instance of the simulator. */ - sd = sim_open (SIM_OPEN_STANDALONE, argv); + default_callback.init (&default_callback); + sd = sim_open (SIM_OPEN_STANDALONE, &default_callback, NULL, argv); if (sd == 0) exit (1); + if (STATE_MAGIC (sd) != SIM_MAGIC_NUMBER) + { + fprintf (stderr, "Internal error - bad magic number in simulator struct\n"); + abort (); + } /* Was there a program to run? */ prog_argv = STATE_PROG_ARGV (sd); @@ -72,7 +86,9 @@ main (argc, argv) #endif /* Run the program. */ + prev_sigint = signal (SIGINT, cntrl_c); sim_resume (sd, 0, 0); + signal (SIGINT, prev_sigint); /* Print any stats the simulator collected. */ sim_info (sd, 0); @@ -104,6 +120,11 @@ main (argc, argv) case sim_exited: break; + + default: + fprintf (stderr, "program in undefined state (%d:%d)\n", reason, sigrc); + break; + } #endif diff --git a/sim/common/run.c b/sim/common/run.c index dff278d..3f032d3 100644 --- a/sim/common/run.c +++ b/sim/common/run.c @@ -58,7 +58,6 @@ static char *myname; /* NOTE: sim_size() and sim_trace() are going away */ -extern void sim_size PARAMS ((int i)); extern int sim_trace PARAMS ((SIM_DESC sd)); extern int getopt (); @@ -104,6 +103,12 @@ main (ac, av) no_args[2] = "set-later"; #endif + /* FIXME: This is currently being migrated into sim_open. + Simulators that use functions such as sim_size() still require + this. */ + default_callback.init (&default_callback); + sim_set_callbacks (&default_callback); + /* FIXME: This is currently being rewritten to have each simulator do all argv processing. */ @@ -212,8 +217,7 @@ main (ac, av) /* Ensure that any run-time initialisation that needs to be performed by the simulator can occur. */ - default_callback.init (&default_callback); - sd = sim_open (SIM_OPEN_STANDALONE, &default_callback, sim_argv); + sd = sim_open (SIM_OPEN_STANDALONE, &default_callback, abfd, sim_argv); if (sd == 0) exit (1); diff --git a/sim/common/sim-config.c b/sim/common/sim-config.c index c6ee907..5f2efc3 100644 --- a/sim/common/sim-config.c +++ b/sim/common/sim-config.c @@ -19,7 +19,8 @@ */ -#include "sim-state.h" +#include "sim-main.h" +#include "bfd.h" int current_host_byte_order; @@ -31,7 +32,7 @@ int current_environment; #endif #if defined (WITH_ALIGNMENT) -int current_alignment; +enum sim_alignments current_alignment; #endif #if defined (WITH_FLOATING_POINT) @@ -94,22 +95,22 @@ config_environment_to_a (int environment) #endif -#if defined (WITH_ALIGNMENT) static const char * config_alignment_to_a (int alignment) { switch (alignment) { + case MIXED_ALIGNMENT: + return "MIXED_ALIGNMENT"; case NONSTRICT_ALIGNMENT: return "NONSTRICT_ALIGNMENT"; case STRICT_ALIGNMENT: return "STRICT_ALIGNMENT"; - case 0: - return "0"; + case FORCED_ALIGNMENT: + return "FORCED_ALIGNMENT"; } return "UNKNOWN"; } -#endif #if defined (WITH_FLOATING_POINT) @@ -130,10 +131,48 @@ config_floating_point_to_a (int floating_point) #endif -void +SIM_RC sim_config (SIM_DESC sd, - int prefered_target_byte_order) + struct _bfd *abfd) { + int prefered_target_byte_order; + + /* clone the bfd struct (or open prog_name directly) */ + { + const char *prog_name; + if (STATE_PROG_ARGV (sd) == NULL) + { + if (abfd != NULL) + prog_name = bfd_get_filename (abfd); + else + prog_name = NULL; + } + else + prog_name = *STATE_PROG_ARGV (sd); + if (prog_name != NULL) + { + abfd = bfd_openr (prog_name, 0); + if (abfd == NULL) + { + sim_io_eprintf (sd, "%s: can't open \"%s\": %s\n", + STATE_MY_NAME (sd), + prog_name, + bfd_errmsg (bfd_get_error ())); + return SIM_RC_FAIL; + } + STATE_PROG_BFD (sd) = abfd; + } + else + STATE_PROG_BFD (sd) = NULL; + } + + /* extract all relevant information */ + if (abfd == NULL) + prefered_target_byte_order = 0; + else + prefered_target_byte_order = (bfd_little_endian(abfd) + ? LITTLE_ENDIAN + : BIG_ENDIAN); /* set the host byte order */ current_host_byte_order = 1; @@ -144,16 +183,19 @@ sim_config (SIM_DESC sd, /* verify the host byte order */ if (CURRENT_HOST_BYTE_ORDER != current_host_byte_order) - sim_io_error (sd, "host (%s) and configured (%s) byte order in conflict", - config_byte_order_to_a (current_host_byte_order), - config_byte_order_to_a (CURRENT_HOST_BYTE_ORDER)); + { + sim_io_eprintf (sd, "host (%s) and configured (%s) byte order in conflict", + config_byte_order_to_a (current_host_byte_order), + config_byte_order_to_a (CURRENT_HOST_BYTE_ORDER)); + return SIM_RC_FAIL; + } /* set the target byte order */ #if (WITH_DEVICES) if (current_target_byte_order == 0) current_target_byte_order - = (tree_find_boolean_property(root, "/options/little-endian?") + = (tree_find_boolean_property (root, "/options/little-endian?") ? LITTLE_ENDIAN : BIG_ENDIAN); #endif @@ -162,17 +204,22 @@ sim_config (SIM_DESC sd, current_target_byte_order = prefered_target_byte_order; if (current_target_byte_order == 0) current_target_byte_order = WITH_TARGET_BYTE_ORDER; + if (current_target_byte_order == 0) + current_target_byte_order = WITH_DEFAULT_TARGET_BYTE_ORDER; /* verify the target byte order */ if (CURRENT_TARGET_BYTE_ORDER == 0) - sim_io_error (sd, "target byte order unspecified"); + { + sim_io_eprintf (sd, "target byte order unspecified"); + return SIM_RC_FAIL; + } if (CURRENT_TARGET_BYTE_ORDER != current_target_byte_order) - sim_io_error (sd, "target (%s) and configured (%s) byte order in conflict", + sim_io_eprintf (sd, "target (%s) and configured (%s) byte order in conflict", config_byte_order_to_a (current_target_byte_order), config_byte_order_to_a (CURRENT_TARGET_BYTE_ORDER)); if (prefered_target_byte_order != 0 && CURRENT_TARGET_BYTE_ORDER != prefered_target_byte_order) - sim_io_error (sd, "target (%s) and specified (%s) byte order in conflict", + sim_io_eprintf (sd, "target (%s) and specified (%s) byte order in conflict", config_byte_order_to_a (CURRENT_TARGET_BYTE_ORDER), config_byte_order_to_a (prefered_target_byte_order)); @@ -185,15 +232,31 @@ sim_config (SIM_DESC sd, /* verify the stdio */ if (CURRENT_STDIO == 0) - sim_io_error (sd, "target standard IO unspecified"); + { + sim_io_eprintf (sd, "target standard IO unspecified"); + return SIM_RC_FAIL; + } if (CURRENT_STDIO != current_stdio) - sim_io_error (sd, "target (%s) and configured (%s) standard IO in conflict", - config_stdio_to_a (CURRENT_STDIO), - config_stdio_to_a (current_stdio)); - - + { + sim_io_eprintf (sd, "target (%s) and configured (%s) standard IO in conflict", + config_stdio_to_a (CURRENT_STDIO), + config_stdio_to_a (current_stdio)); + return SIM_RC_FAIL; + } + + + /* check the value of MSB */ + if (WITH_TARGET_WORD_MSB != 0 + && WITH_TARGET_WORD_MSB != (WITH_TARGET_WORD_BITSIZE - 1)) + { + sim_io_eprintf (sd, "target bitsize (%d) contradicts target most significant bit (%d)", + WITH_TARGET_WORD_BITSIZE, WITH_TARGET_WORD_MSB); + return SIM_RC_FAIL; + } + + #if defined (WITH_ENVIRONMENT) - + /* set the environment */ #if (WITH_DEVICES) if (current_environment == 0) @@ -214,19 +277,25 @@ sim_config (SIM_DESC sd, #endif if (current_environment == 0) current_environment = WITH_ENVIRONMENT; - + /* verify the environment */ if (CURRENT_ENVIRONMENT == 0) - sim_io_error (sd, "target environment unspecified"); + { + sim_io_eprintf (sd, "target environment unspecified"); + return SIM_RC_FAIL; + } if (CURRENT_ENVIRONMENT != current_environment) - sim_io_error (sd, "target (%s) and configured (%s) environment in conflict", - config_environment_to_a (CURRENT_ENVIRONMENT), - config_environment_to_a (current_environment)); + { + sim_io_eprintf (sd, "target (%s) and configured (%s) environment in conflict", + config_environment_to_a (CURRENT_ENVIRONMENT), + config_environment_to_a (current_environment)); + return SIM_RC_FAIL; + } #endif - - + + #if defined (WITH_ALIGNMENT) - + /* set the alignment */ #if defined (WITH_DEVICES) if (current_alignment == 0) @@ -237,34 +306,45 @@ sim_config (SIM_DESC sd, #endif if (current_alignment == 0) current_alignment = WITH_ALIGNMENT; - + /* verify the alignment */ if (CURRENT_ALIGNMENT == 0) - sim_io_error (sd, "target alignment unspecified"); + { + sim_io_eprintf (sd, "target alignment unspecified"); + return SIM_RC_FAIL; + } if (CURRENT_ALIGNMENT != current_alignment) - sim_io_error (sd, "target (%s) and configured (%s) alignment in conflict", - config_alignment_to_a (CURRENT_ALIGNMENT), - config_alignment_to_a (current_alignment)); + { + sim_io_eprintf (sd, "target (%s) and configured (%s) alignment in conflict", + config_alignment_to_a (CURRENT_ALIGNMENT), + config_alignment_to_a (current_alignment)); + return SIM_RC_FAIL; + } #endif - - + + #if defined (WITH_FLOAING_POINT) - + /* set the floating point */ if (current_floating_point == 0) current_floating_point = WITH_FLOATING_POINT; - + /* verify the floating point */ if (CURRENT_FLOATING_POINT == 0) - sim_io_error (sd, "target floating-point unspecified"); + { + sim_io_eprintf (sd, "target floating-point unspecified"); + return SIM_RC_FAIL; + } if (CURRENT_FLOATING_POINT != current_floating_point) - sim_io_error (sd, "target (%s) and configured (%s) floating-point in conflict", - config_alignment_to_a (CURRENT_FLOATING_POINT), - config_alignment_to_a (current_floating_point)); - + { + sim_io_eprintf (sd, "target (%s) and configured (%s) floating-point in conflict", + config_alignment_to_a (CURRENT_FLOATING_POINT), + config_alignment_to_a (current_floating_point)); + return SIM_RC_FAIL; + } + #endif - - + return SIM_RC_OK; } @@ -278,15 +358,24 @@ print_sim_config (SIM_DESC sd) sim_io_printf (sd, "Compiled on %s %s\n", __DATE__, __TIME__); #endif - sim_io_printf (sd, "WITH_TARGET_BYTE_ORDER = %s\n", + sim_io_printf (sd, "WITH_TARGET_BYTE_ORDER = %s\n", config_byte_order_to_a (WITH_TARGET_BYTE_ORDER)); - sim_io_printf (sd, "WITH_HOST_BYTE_ORDER = %s\n", + sim_io_printf (sd, "WITH_DEFAULT_TARGET_BYTE_ORDER = %s\n", + config_byte_order_to_a (WITH_DEFAULT_TARGET_BYTE_ORDER)); + + sim_io_printf (sd, "WITH_HOST_BYTE_ORDER = %s\n", config_byte_order_to_a (WITH_HOST_BYTE_ORDER)); - sim_io_printf (sd, "WITH_STDIO = %s\n", + sim_io_printf (sd, "WITH_STDIO = %s\n", config_stdio_to_a (WITH_STDIO)); + sim_io_printf (sd, "WITH_TARGET_WORD_BITSIZE = %d\n", + WITH_TARGET_WORD_BITSIZE); + + sim_io_printf (sd, "WITH_TARGET_WORD_MSB = %d\n", + WITH_TARGET_WORD_MSB); + #if defined (WITH_XOR_ENDIAN) sim_io_printf (sd, "WITH_XOR_ENDIAN = %d\n", WITH_XOR_ENDIAN); #endif diff --git a/sim/common/sim-config.h b/sim/common/sim-config.h index 7278b3b..157eb1d 100644 --- a/sim/common/sim-config.h +++ b/sim/common/sim-config.h @@ -222,6 +222,10 @@ #define WITH_TARGET_BYTE_ORDER 0 /*unknown*/ #endif +#ifndef WITH_DEFAULT_TARGET_BYTE_ORDER +#define WITH_DEFAULT_TARGET_BYTE_ORDER 0 /* fatal */ +#endif + extern int current_host_byte_order; #define CURRENT_HOST_BYTE_ORDER (WITH_HOST_BYTE_ORDER \ ? WITH_HOST_BYTE_ORDER \ @@ -235,12 +239,16 @@ extern int current_target_byte_order; /* XOR endian. - In addition to the above, the simulator can support the's horrible - XOR endian mode (for instance implemented by the PowerPC). This - feature makes it possible to control the endian mode of a processor - using the MSR. */ + In addition to the above, the simulator can support the horrible + XOR endian mode (as found in the PowerPC and MIPS ISA). See + sim-core for more information. -/* #define WITH_XOR_ENDIAN 8 */ + If WITH_XOR_ENDIAN is non-zero, it specifies the number of bytes + potentially involved in the XOR munge. A typical value is 8. */ + +#ifndef WITH_XOR_ENDIAN +#define WITH_XOR_ENDIAN 0 +#endif @@ -258,24 +266,21 @@ extern int current_target_byte_order; Sets a limit on the number of processors that can be simulated. If WITH_SMP is set to zero (0), the simulator is restricted to - suporting only on processor (and as a consequence leaves the SMP + suporting only one processor (and as a consequence leaves the SMP code out of the build process). The actual number of processors is taken from the device /options/smp@ */ -#if defined (WITH_SMP) - -#if WITH_SMP +#if defined (WITH_SMP) && WITH_SMP > 0 #define MAX_NR_PROCESSORS WITH_SMP -#else -#define MAX_NR_PROCESSORS 1 #endif +#ifndef MAX_NR_PROCESSORS +#define MAX_NR_PROCESSORS 1 #endif - /* Word size of host/target: Set these according to your host and target requirements. At this @@ -369,29 +374,35 @@ extern int current_environment; /* Alignment: - The PowerPC may or may not handle miss aligned transfers. An - implementation normally handles miss aligned transfers in big - endian mode but generates an exception in little endian mode. + A processor architecture may or may not handle miss aligned + transfers. + + As alternatives: both little and big endian modes take an exception + (STRICT_ALIGNMENT); big and little endian models handle mis aligned + transfers (NONSTRICT_ALIGNMENT); or the address is forced into + alignment using a mask (FORCED_ALIGNMENT). - This model. Instead allows both little and big endian modes to - either take exceptions or handle miss aligned transfers. + Mixed alignment should be specified when the simulator needs to be + able to change the alignment requirements on the fly (eg for + bi-endian support). */ - If 0 is specified then for big-endian mode miss alligned accesses - are permitted (NONSTRICT_ALIGNMENT) while in little-endian mode the - processor will fault on them (STRICT_ALIGNMENT). */ +enum sim_alignments { + MIXED_ALIGNMENT, + NONSTRICT_ALIGNMENT, + STRICT_ALIGNMENT, + FORCED_ALIGNMENT, +}; -#if defined (WITH_ALIGNMENT) +extern enum sim_alignments current_alignment; -#define NONSTRICT_ALIGNMENT 1 -#define STRICT_ALIGNMENT 2 +#if !defined (WITH_ALIGNMENT) +#define WITH_ALIGNMENT NONSTRICT_ALIGNMENT +#endif -extern int current_alignment; #define CURRENT_ALIGNMENT (WITH_ALIGNMENT \ ? WITH_ALIGNMENT \ : current_alignment) -#endif - /* Floating point suport: @@ -414,6 +425,18 @@ extern int current_floating_point; +/* Engine module. + + Use the common start/stop/restart framework (sim-engine). + Simulators using the other modules but not the engine should define + WITH_ENGINE=0. */ + +#ifndef WITH_ENGINE +#define WITH_ENGINE 1 +#endif + + + /* Debugging: Control the inclusion of debugging code. @@ -428,7 +451,14 @@ extern int current_floating_point; code */ #ifndef WITH_TRACE -#define WITH_TRACE 1 +#define WITH_TRACE (-1) +#endif + +/* Include the profiling code. Disabling this eliminates all profiling + code. */ + +#ifndef WITH_PROFILE +#define WITH_PROFILE (-1) #endif @@ -515,26 +545,10 @@ extern int current_stdio; /* complete/verify/print the simulator configuration */ +extern SIM_RC sim_config +(SIM_DESC sd, + struct _bfd *abfd); -/* For prefered_target_byte_order arugment */ - -#if defined (bfd_little_endian) -#define PREFERED_TARGET_BYTE_ORDER(IMAGE) ((IMAGE) == NULL \ - ? 0 \ - : bfd_little_endian(IMAGE) \ - ? LITTLE_ENDIAN \ - : BIG_ENDIAN) -#else -#define PREFERED_TARGET_BYTE_ORDER(IMAGE) ((IMAGE) == NULL \ - ? 0 \ - : !(IMAGE)->xvec->byteorder_big_p \ - ? LITTLE_ENDIAN \ - : BIG_ENDIAN) -#endif - - -extern void sim_config (SIM_DESC sd, - int prefered_target_byte_order); extern void print_sim_config (SIM_DESC sd); diff --git a/sim/configure b/sim/configure index 0f9cf45..72091fa 100755 --- a/sim/configure +++ b/sim/configure @@ -1273,6 +1273,7 @@ fi # Assume simulator can be built with cc. # If the user passes --enable-sim built it regardless of $(CC). only_if_gcc=no +only_if_enabled=no extra_subdirs=common # WHEN ADDING ENTRIES TO THIS MATRIX: @@ -1292,6 +1293,7 @@ case "${target}" in # end-sanitize-d30v h8300*-*-*) sim_target=h8300 ;; h8500-*-*) sim_target=h8500 ;; + m32r-*-*) sim_target=m32r ;; mips*-*-*) # The MIPS simulator can only be compiled by gcc. sim_target=mips @@ -1328,6 +1330,20 @@ case "${target}" in only_if_gcc=yes ;; # end-sanitize-v850 +# start-sanitize-v850e + v850e-*-*) + # The V850 simulator can only be compiled by gcc. + sim_target=v850 + only_if_gcc=yes + ;; +# end-sanitize-v850e +# start-sanitize-v850eq + v850eq-*-*) + # The V850 simulator can only be compiled by gcc. + sim_target=v850 + only_if_gcc=yes + ;; +# end-sanitize-v850eq w65-*-*) sim_target=w65 ;; z8k*-*-*) sim_target=z8k ;; sparc64-*-*) @@ -1337,6 +1353,9 @@ case "${target}" in # The SPARC simulator can only be compiled by gcc. sim_target=erc32 only_if_gcc=yes + # Unfortunately erc32 won't build on many hosts, so only enable + # it if the user really really wants it. + only_if_enabled=yes ;; *) sim_target=none ;; esac @@ -1352,9 +1371,13 @@ yes) fi ;; *) - if test ${only_if_gcc} = yes ; then - if test "${GCC}" != yes ; then - sim_target=none + if test ${only_if_enabled} = yes ; then + sim_target=none + else + if test ${only_if_gcc} = yes ; then + if test "${GCC}" != yes ; then + sim_target=none + fi fi fi ;; diff --git a/sim/configure.in b/sim/configure.in index e316e3a..6274b87 100644 --- a/sim/configure.in +++ b/sim/configure.in @@ -38,6 +38,7 @@ esac]) # Assume simulator can be built with cc. # If the user passes --enable-sim built it regardless of $(CC). only_if_gcc=no +only_if_enabled=no extra_subdirs=common # WHEN ADDING ENTRIES TO THIS MATRIX: @@ -116,10 +117,10 @@ case "${target}" in sparc*-*-*) # The SPARC simulator can only be compiled by gcc. sim_target=erc32 - # Unfortunately erc32 won't build on many hosts, so don't - # build it at all - sim_target=none only_if_gcc=yes + # Unfortunately erc32 won't build on many hosts, so only enable + # it if the user really really wants it. + only_if_enabled=yes ;; *) sim_target=none ;; esac @@ -135,9 +136,13 @@ yes) fi ;; *) - if test ${only_if_gcc} = yes ; then - if test "${GCC}" != yes ; then - sim_target=none + if test ${only_if_enabled} = yes ; then + sim_target=none + else + if test ${only_if_gcc} = yes ; then + if test "${GCC}" != yes ; then + sim_target=none + fi fi fi ;; diff --git a/sim/d10v/ChangeLog b/sim/d10v/ChangeLog index da36e6c..e3c2791 100644 --- a/sim/d10v/ChangeLog +++ b/sim/d10v/ChangeLog @@ -1,3 +1,21 @@ +Mon Aug 25 17:50:22 1997 Andrew Cagney + + * configure: Regenerated to track ../common/aclocal.m4 changes. + * config.in: Ditto. + +Mon Aug 25 15:39:29 1997 Andrew Cagney + + * interp.c (sim_open): Add ABFD argument. + +Tue May 20 10:14:45 1997 Andrew Cagney + + * interp.c (sim_open): Add callback argument. + (sim_set_callbacks): Remove SIM_DESC argument. + +Thu Apr 24 00:39:51 1997 Doug Evans + + * configure: Regenerated to track ../common/aclocal.m4 changes. + Tue Apr 22 10:29:23 1997 Doug Evans * interp.c (sim_open): Undo patch to add -E support. diff --git a/sim/d10v/interp.c b/sim/d10v/interp.c index 5eed234..e738cb8 100644 --- a/sim/d10v/interp.c +++ b/sim/d10v/interp.c @@ -36,7 +36,6 @@ static void do_long PARAMS ((uint32 ins)); static void do_2_short PARAMS ((uint16 ins1, uint16 ins2, enum _leftright leftright)); static void do_parallel PARAMS ((uint16 ins1, uint16 ins2)); static char *add_commas PARAMS ((char *buf, int sizeof_buf, unsigned long value)); -extern void sim_size PARAMS ((int power)); static void init_system PARAMS ((void)); extern void sim_set_profile PARAMS ((int n)); extern void sim_set_profile_size PARAMS ((int n)); @@ -456,8 +455,10 @@ sim_read (sd, addr, buffer, size) SIM_DESC -sim_open (kind, argv) +sim_open (kind, callback, abfd, argv) SIM_OPEN_KIND kind; + host_callback *callback; + struct _bfd *abfd; char **argv; { struct simops *s; @@ -466,14 +467,11 @@ sim_open (kind, argv) char **p; sim_kind = kind; + d10v_callback = callback; myname = argv[0]; for (p = argv + 1; *p; ++p) { - /* Ignore endian specification. */ - if (strcmp (*p, "-E") == 0) - ++p; - else #ifdef DEBUG if (strcmp (*p, "-t") == 0) d10v_debug = DEBUG; @@ -834,8 +832,7 @@ sim_kill (sd) } void -sim_set_callbacks (sd, p) - SIM_DESC sd; +sim_set_callbacks (p) host_callback *p; { d10v_callback = p; diff --git a/sim/erc32/ChangeLog b/sim/erc32/ChangeLog index 8814350..f9b8f67 100644 --- a/sim/erc32/ChangeLog +++ b/sim/erc32/ChangeLog @@ -1,3 +1,25 @@ +Mon Aug 25 17:50:22 1997 Andrew Cagney + + * configure: Regenerated to track ../common/aclocal.m4 changes. + * config.in: Ditto. + +Mon Aug 25 16:19:49 1997 Andrew Cagney + + * interf.c (sim_open): Add ABFD argument. Change ARGV to PARGV. + +Mon Jun 30 11:45:25 1997 Doug Evans + + * Makefile.in (install-sis): Change $(srcdir)/sis to sis. + +Wed May 28 09:46:13 1997 Andrew Cagney + + * interf.c (sim_set_callbacks): Drop SD argument - not applicable. + (sim_open): Add callback arg, save it. + +Thu Apr 24 00:39:51 1997 Doug Evans + + * configure: Regenerated to track ../common/aclocal.m4 changes. + Tue Apr 22 11:05:01 1997 Doug Evans * interf.c (sim_open): Undo patch to add -E support. diff --git a/sim/erc32/interf.c b/sim/erc32/interf.c index 2a3f331..0470558 100644 --- a/sim/erc32/interf.c +++ b/sim/erc32/interf.c @@ -115,7 +115,7 @@ run_sim(sregs, go, icount, dis) if (sis_verbose) (*sim_callback->printf_filtered) (sim_callback, "SW BP hit at %x\n", sregs->pc); - sim_stop(); + sim_halt(); restore_stdio(); clearerr(stdin); return (BPT_HIT); @@ -133,7 +133,7 @@ run_sim(sregs, go, icount, dis) go = icount = 0; } } - sim_stop(); + sim_halt(); sregs->tottime += time(NULL) - sregs->starttime; restore_stdio(); clearerr(stdin); @@ -155,8 +155,7 @@ run_sim(sregs, go, icount, dis) } void -sim_set_callbacks (sd, ptr) - SIM_DESC sd; +sim_set_callbacks (ptr) host_callback *ptr; { sim_callback = ptr; @@ -169,8 +168,10 @@ sim_size (memsize) } SIM_DESC -sim_open(kind, argv) +sim_open (kind, callback, abfd, argv) SIM_OPEN_KIND kind; + struct host_callback_struct *callback; + struct _bfd *abfd; char **argv; { @@ -180,6 +181,8 @@ sim_open(kind, argv) int grdl = 0; int freq = 15; + sim_callback = callback; + (*sim_callback->printf_filtered) (sim_callback, "\n SIS - SPARC instruction simulator %s\n", sis_version); (*sim_callback->printf_filtered) (sim_callback, " Bug-reports to Jiri Gaisler ESA/ESTEC (jgais@wd.estec.esa.nl)\n"); while (argv[argc]) diff --git a/sim/h8300/ChangeLog b/sim/h8300/ChangeLog index fc6b424..73ba2e3 100644 --- a/sim/h8300/ChangeLog +++ b/sim/h8300/ChangeLog @@ -1,5 +1,21 @@ +Mon Aug 25 17:50:22 1997 Andrew Cagney + + * configure: Regenerated to track ../common/aclocal.m4 changes. + * config.in: Ditto. + +Mon Aug 25 15:47:41 1997 Andrew Cagney + + * compile.c (sim_open): Add ABFD argument. + +Tue May 20 10:16:48 1997 Andrew Cagney + + * compile.c (sim_open): Add callback argument. + (sim_set_callbacks): Delete SIM_DESC argument. + Wed Apr 30 10:22:29 1997 Doug Evans + * compile.c (sim_load): Call bfd_get_mach instead of examining + bfd fields directly. * tconfig.in (SIM_PRE_LOAD): Delete, no longer used. Thu Apr 24 00:39:51 1997 Doug Evans diff --git a/sim/h8300/compile.c b/sim/h8300/compile.c index 4973ed7..b498968 100644 --- a/sim/h8300/compile.c +++ b/sim/h8300/compile.c @@ -916,6 +916,15 @@ case O(name, SB): \ if(s) store (&code->dst,ea); goto next; \ } +int +sim_stop (sd) + SIM_DESC sd; +{ + cpu.state = SIM_STATE_STOPPED; + cpu.exception = SIGINT; + return 1; +} + void sim_resume (sd, step, siggnal) SIM_DESC sd; @@ -1705,29 +1714,13 @@ sim_resume (sd, step, siggnal) ; /* if (cpu.regs[8] ) abort(); */ -#if defined (WIN32) - /* Poll after every 100th insn, */ if (poll_count++ > 100) { poll_count = 0; - if (win32pollquit()) - { - control_c(); - } + if ((*sim_callback->poll_quit) != NULL + && (*sim_callback->poll_quit) (sim_callback)) + sim_stop (sd); } -#endif -#if defined(__GO32__) - /* Poll after every 100th insn, */ - if (poll_count++ > 100) - { - poll_count = 0; - if (kbhit ()) - { - int c = getkey (); - control_c (); - } - } -#endif } while (cpu.state == SIM_STATE_RUNNING); @@ -2027,12 +2020,15 @@ sim_kill (sd) } SIM_DESC -sim_open (kind,argv) +sim_open (kind, ptr, abfd, argv) SIM_OPEN_KIND kind; + struct host_callback_struct *ptr; + struct _bfd *abfd; char **argv; { sim_kind = kind; myname = argv[0]; + sim_callback = ptr; /* fudge our descriptor */ return (SIM_DESC) 1; } @@ -2065,10 +2061,13 @@ sim_load (sd, prog, abfd, from_tty) prog_bfd = bfd_openr (prog, "coff-h8300"); if (prog_bfd != NULL) { + /* Set the cpu type. We ignore failure from bfd_check_format + and bfd_openr as sim_load_file checks too. */ if (bfd_check_format (prog_bfd, bfd_object)) { - set_h8300h (prog_bfd->arch_info->mach == bfd_mach_h8300h - || prog_bfd->arch_info->mach == bfd_mach_h8300s); + unsigned long mach = bfd_get_mach (prog_bfd); + set_h8300h (mach == bfd_mach_h8300h + || mach == bfd_mach_h8300s); } } @@ -2143,8 +2142,7 @@ sim_do_command (sd, cmd) } void -sim_set_callbacks (sd, ptr) - SIM_DESC sd; +sim_set_callbacks (ptr) struct host_callback_struct *ptr; { sim_callback = ptr; diff --git a/sim/m32r/ChangeLog b/sim/m32r/ChangeLog index ba131c5..4101d83 100644 --- a/sim/m32r/ChangeLog +++ b/sim/m32r/ChangeLog @@ -1,3 +1,28 @@ +Mon Aug 25 17:50:22 1997 Andrew Cagney + + * configure: Regenerated to track ../common/aclocal.m4 changes. + * config.in: Ditto. + +Mon Aug 25 15:54:08 1997 Andrew Cagney + + * sim-if.c (sim_open): Add ABFD argument. + +Tue Jul 22 10:16:16 1997 Doug Evans + + * sim-main.h (M32R_DEFAULT_MEM_SIZE): New macro. + * sim-if.c (sim_open): Use it. + +Wed Jun 4 12:48:12 1997 Andrew Cagney + + * sim-main.h (WITH_ENGINE): Disable the common engine for now. + +Tue May 27 14:15:44 1997 Andrew Cagney + + * sim-if.c (sim_read): Pass NULL cpu to sim_core_read_buffer. + (sim_write): Ditto for write. + + * m32r.c (do_trap): Ditto for read/write. + Tue May 20 10:18:25 1997 Andrew Cagney * sim-if.c (sim_open): Add callback argument. diff --git a/sim/m32r/configure b/sim/m32r/configure new file mode 100755 index 0000000..baeaf88 --- /dev/null +++ b/sim/m32r/configure @@ -0,0 +1,1932 @@ +#! /bin/sh + +# Guess values for system-dependent variables and create Makefiles. +# Generated automatically using autoconf version 2.12 +# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. + +# Defaults: +ac_help= +ac_default_prefix=/usr/local +# Any additions from configure.in: +ac_help="$ac_help + --enable-sim-bswap Use Host specific BSWAP instruction." +ac_help="$ac_help + --enable-sim-cflags=opts Extra CFLAGS for use in building simulator" +ac_help="$ac_help + --enable-sim-debug=opts Enable debugging flags" +ac_help="$ac_help + --enable-sim-stdio Specify whether to use stdio for console input/output." +ac_help="$ac_help + --enable-sim-trace=opts Enable tracing flags" +ac_help="$ac_help + --enable-sim-profile=opts Enable profiling flags" +ac_help="$ac_help + --enable-sim-endian=endian Specify target byte endian orientation." +ac_help="$ac_help + --enable-sim-hostendain=end Specify host byte endian orientation." +ac_help="$ac_help + --enable-sim-scache=size Specify simulator execution cache size." +ac_help="$ac_help + --enable-sim-default-model=model Specify default model to simulate." + +# Initialize some variables set by options. +# The variables have the same names as the options, with +# dashes changed to underlines. +build=NONE +cache_file=./config.cache +exec_prefix=NONE +host=NONE +no_create= +nonopt=NONE +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +target=NONE +verbose= +x_includes=NONE +x_libraries=NONE +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datadir='${prefix}/share' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +libdir='${exec_prefix}/lib' +includedir='${prefix}/include' +oldincludedir='/usr/include' +infodir='${prefix}/info' +mandir='${prefix}/man' + +# Initialize some other variables. +subdirs= +MFLAGS= MAKEFLAGS= +# Maximum number of lines to put in a shell here document. +ac_max_here_lines=12 + +ac_prev= +for ac_option +do + + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval "$ac_prev=\$ac_option" + ac_prev= + continue + fi + + case "$ac_option" in + -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; + *) ac_optarg= ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case "$ac_option" in + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir="$ac_optarg" ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build="$ac_optarg" ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file="$ac_optarg" ;; + + -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ + | --da=*) + datadir="$ac_optarg" ;; + + -disable-* | --disable-*) + ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + eval "enable_${ac_feature}=no" ;; + + -enable-* | --enable-*) + ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "enable_${ac_feature}='$ac_optarg'" ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix="$ac_optarg" ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he) + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat << EOF +Usage: configure [options] [host] +Options: [defaults in brackets after descriptions] +Configuration: + --cache-file=FILE cache test results in FILE + --help print this message + --no-create do not create output files + --quiet, --silent do not print \`checking...' messages + --version print the version of autoconf that created configure +Directory and file names: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [same as prefix] + --bindir=DIR user executables in DIR [EPREFIX/bin] + --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] + --libexecdir=DIR program executables in DIR [EPREFIX/libexec] + --datadir=DIR read-only architecture-independent data in DIR + [PREFIX/share] + --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data in DIR + [PREFIX/com] + --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] + --libdir=DIR object code libraries in DIR [EPREFIX/lib] + --includedir=DIR C header files in DIR [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] + --infodir=DIR info documentation in DIR [PREFIX/info] + --mandir=DIR man documentation in DIR [PREFIX/man] + --srcdir=DIR find the sources in DIR [configure dir or ..] + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM + run sed PROGRAM on installed program names +EOF + cat << EOF +Host type: + --build=BUILD configure for building on BUILD [BUILD=HOST] + --host=HOST configure for HOST [guessed] + --target=TARGET configure for TARGET [TARGET=HOST] +Features and packages: + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --x-includes=DIR X include files are in DIR + --x-libraries=DIR X library files are in DIR +EOF + if test -n "$ac_help"; then + echo "--enable and --with options recognized:$ac_help" + fi + exit 0 ;; + + -host | --host | --hos | --ho) + ac_prev=host ;; + -host=* | --host=* | --hos=* | --ho=*) + host="$ac_optarg" ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir="$ac_optarg" ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir="$ac_optarg" ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir="$ac_optarg" ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir="$ac_optarg" ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst \ + | --locals | --local | --loca | --loc | --lo) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* \ + | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + localstatedir="$ac_optarg" ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir="$ac_optarg" ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir="$ac_optarg" ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix="$ac_optarg" ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix="$ac_optarg" ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix="$ac_optarg" ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name="$ac_optarg" ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir="$ac_optarg" ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir="$ac_optarg" ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site="$ac_optarg" ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir="$ac_optarg" ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir="$ac_optarg" ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target="$ac_optarg" ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers) + echo "configure generated by autoconf version 2.12" + exit 0 ;; + + -with-* | --with-*) + ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "with_${ac_package}='$ac_optarg'" ;; + + -without-* | --without-*) + ac_package=`echo $ac_option|sed -e 's/-*without-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + eval "with_${ac_package}=no" ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes="$ac_optarg" ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries="$ac_optarg" ;; + + -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } + ;; + + *) + if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then + echo "configure: warning: $ac_option: invalid host type" 1>&2 + fi + if test "x$nonopt" != xNONE; then + { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } + fi + nonopt="$ac_option" + ;; + + esac +done + +if test -n "$ac_prev"; then + { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } +fi + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +# File descriptor usage: +# 0 standard input +# 1 file creation +# 2 errors and warnings +# 3 some systems may open it to /dev/tty +# 4 used on the Kubota Titan +# 6 checking for... messages and results +# 5 compiler messages saved in config.log +if test "$silent" = yes; then + exec 6>/dev/null +else + exec 6>&1 +fi +exec 5>./config.log + +echo "\ +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. +" 1>&5 + +# Strip out --no-create and --no-recursion so they do not pile up. +# Also quote any args containing shell metacharacters. +ac_configure_args= +for ac_arg +do + case "$ac_arg" in + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) ;; + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) + ac_configure_args="$ac_configure_args '$ac_arg'" ;; + *) ac_configure_args="$ac_configure_args $ac_arg" ;; + esac +done + +# NLS nuisances. +# Only set these to C if already set. These must not be set unconditionally +# because not all systems understand e.g. LANG=C (notably SCO). +# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! +# Non-C LC_CTYPE values break the ctype check. +if test "${LANG+set}" = set; then LANG=C; export LANG; fi +if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi +if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi +if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -rf conftest* confdefs.h +# AIX cpp loses on an empty file, so make sure it contains at least a newline. +echo > confdefs.h + +# A filename unique to this package, relative to the directory that +# configure is in, which we can look for to find out if srcdir is correct. +ac_unique_file=Makefile.in + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then its parent. + ac_prog=$0 + ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` + test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. + srcdir=$ac_confdir + if test ! -r $srcdir/$ac_unique_file; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r $srcdir/$ac_unique_file; then + if test "$ac_srcdir_defaulted" = yes; then + { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } + else + { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } + fi +fi +srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` + +# Prefer explicitly selected file to automatically selected ones. +if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi +fi +for ac_site_file in $CONFIG_SITE; do + if test -r "$ac_site_file"; then + echo "loading site script $ac_site_file" + . "$ac_site_file" + fi +done + +if test -r "$cache_file"; then + echo "loading cache $cache_file" + . $cache_file +else + echo "creating cache $cache_file" + > $cache_file +fi + +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then + # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. + if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then + ac_n= ac_c=' +' ac_t=' ' + else + ac_n=-n ac_c= ac_t= + fi +else + ac_n= ac_c='\c' ac_t= +fi + + + +echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 +echo "configure:544: checking how to run the C preprocessor" >&5 +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then +if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + # This must be in double quotes, not single quotes, because CPP may get + # substituted into the Makefile and "${CC-cc}" will confuse make. + CPP="${CC-cc} -E" + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. + cat > conftest.$ac_ext < +Syntax Error +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:565: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out` +if test -z "$ac_err"; then + : +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + CPP="${CC-cc} -E -traditional-cpp" + cat > conftest.$ac_ext < +Syntax Error +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:582: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out` +if test -z "$ac_err"; then + : +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + CPP=/lib/cpp +fi +rm -f conftest* +fi +rm -f conftest* + ac_cv_prog_CPP="$CPP" +fi + CPP="$ac_cv_prog_CPP" +else + ac_cv_prog_CPP="$CPP" +fi +echo "$ac_t""$CPP" 1>&6 + + +# autoconf.info says this should be called right after AC_INIT. + + +ac_aux_dir= +for ac_dir in `cd $srcdir;pwd`/../.. $srcdir/`cd $srcdir;pwd`/../..; do + if test -f $ac_dir/install-sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f $ac_dir/install.sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + fi +done +if test -z "$ac_aux_dir"; then + { echo "configure: error: can not find install-sh or install.sh in `cd $srcdir;pwd`/../.. $srcdir/`cd $srcdir;pwd`/../.." 1>&2; exit 1; } +fi +ac_config_guess=$ac_aux_dir/config.guess +ac_config_sub=$ac_aux_dir/config.sub +ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. + + +# Do some error checking and defaulting for the host and target type. +# The inputs are: +# configure --host=HOST --target=TARGET --build=BUILD NONOPT +# +# The rules are: +# 1. You are not allowed to specify --host, --target, and nonopt at the +# same time. +# 2. Host defaults to nonopt. +# 3. If nonopt is not specified, then host defaults to the current host, +# as determined by config.guess. +# 4. Target and build default to nonopt. +# 5. If nonopt is not specified, then target and build default to host. + +# The aliases save the names the user supplied, while $host etc. +# will get canonicalized. +case $host---$target---$nonopt in +NONE---*---* | *---NONE---* | *---*---NONE) ;; +*) { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ;; +esac + + +# Make sure we can run config.sub. +if $ac_config_sub sun4 >/dev/null 2>&1; then : +else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } +fi + +echo $ac_n "checking host system type""... $ac_c" 1>&6 +echo "configure:655: checking host system type" >&5 + +host_alias=$host +case "$host_alias" in +NONE) + case $nonopt in + NONE) + if host_alias=`$ac_config_guess`; then : + else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; } + fi ;; + *) host_alias=$nonopt ;; + esac ;; +esac + +host=`$ac_config_sub $host_alias` +host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +echo "$ac_t""$host" 1>&6 + +echo $ac_n "checking target system type""... $ac_c" 1>&6 +echo "configure:676: checking target system type" >&5 + +target_alias=$target +case "$target_alias" in +NONE) + case $nonopt in + NONE) target_alias=$host_alias ;; + *) target_alias=$nonopt ;; + esac ;; +esac + +target=`$ac_config_sub $target_alias` +target_cpu=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +target_vendor=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +echo "$ac_t""$target" 1>&6 + +echo $ac_n "checking build system type""... $ac_c" 1>&6 +echo "configure:694: checking build system type" >&5 + +build_alias=$build +case "$build_alias" in +NONE) + case $nonopt in + NONE) build_alias=$host_alias ;; + *) build_alias=$nonopt ;; + esac ;; +esac + +build=`$ac_config_sub $build_alias` +build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +echo "$ac_t""$build" 1>&6 + +test "$host_alias" != "$target_alias" && + test "$program_prefix$program_suffix$program_transform_name" = \ + NONENONEs,x,x, && + program_prefix=${target_alias}- + +if test "$program_transform_name" = s,x,x,; then + program_transform_name= +else + # Double any \ or $. echo might interpret backslashes. + cat <<\EOF_SED > conftestsed +s,\\,\\\\,g; s,\$,$$,g +EOF_SED + program_transform_name="`echo $program_transform_name|sed -f conftestsed`" + rm -f conftestsed +fi +test "$program_prefix" != NONE && + program_transform_name="s,^,${program_prefix},; $program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s,\$\$,${program_suffix},; $program_transform_name" + +# sed with no file args requires a program. +test "$program_transform_name" = "" && program_transform_name="s,x,x," + +# Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:738: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" + for ac_dir in $PATH; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_CC="gcc" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:767: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" + ac_prog_rejected=no + for ac_dir in $PATH; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + break + fi + done + IFS="$ac_save_ifs" +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# -gt 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + set dummy "$ac_dir/$ac_word" "$@" + shift + ac_cv_prog_CC="$@" + fi +fi +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } +fi + +echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 +echo "configure:815: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 + +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then + ac_cv_prog_cc_works=yes + # If we can't run a trivial program, we are probably using a cross compiler. + if (./conftest; exit) 2>/dev/null; then + ac_cv_prog_cc_cross=no + else + ac_cv_prog_cc_cross=yes + fi +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + ac_cv_prog_cc_works=no +fi +rm -fr conftest* + +echo "$ac_t""$ac_cv_prog_cc_works" 1>&6 +if test $ac_cv_prog_cc_works = no; then + { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } +fi +echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 +echo "configure:849: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 +cross_compiling=$ac_cv_prog_cc_cross + +echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 +echo "configure:854: checking whether we are using GNU C" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then + ac_cv_prog_gcc=yes +else + ac_cv_prog_gcc=no +fi +fi + +echo "$ac_t""$ac_cv_prog_gcc" 1>&6 + +if test $ac_cv_prog_gcc = yes; then + GCC=yes + ac_test_CFLAGS="${CFLAGS+set}" + ac_save_CFLAGS="$CFLAGS" + CFLAGS= + echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 +echo "configure:878: checking whether ${CC-cc} accepts -g" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + echo 'void f(){}' > conftest.c +if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then + ac_cv_prog_cc_g=yes +else + ac_cv_prog_cc_g=no +fi +rm -f conftest* + +fi + +echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 + if test "$ac_test_CFLAGS" = set; then + CFLAGS="$ac_save_CFLAGS" + elif test $ac_cv_prog_cc_g = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-O2" + fi +else + GCC= + test "${CFLAGS+set}" = set || CFLAGS="-g" +fi + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# ./install, which can be erroneously created by make from ./install.sh. +echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +echo "configure:916: checking for a BSD compatible install" >&5 +if test -z "$INSTALL"; then +if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS="${IFS}:" + for ac_dir in $PATH; do + # Account for people who put trailing slashes in PATH elements. + case "$ac_dir/" in + /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + for ac_prog in ginstall installbsd scoinst install; do + if test -f $ac_dir/$ac_prog; then + if test $ac_prog = install && + grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + # OSF/1 installbsd also uses dspmsg, but is usable. + : + else + ac_cv_path_install="$ac_dir/$ac_prog -c" + break 2 + fi + fi + done + ;; + esac + done + IFS="$ac_save_IFS" + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL="$ac_cv_path_install" + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL="$ac_install_sh" + fi +fi +echo "$ac_t""$INSTALL" 1>&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + + +# Put a plausible default for CC_FOR_BUILD in Makefile. +if test "x$cross_compiling" = "xno"; then + CC_FOR_BUILD='$(CC)' +else + CC_FOR_BUILD=gcc +fi + + + + +AR=${AR-ar} + +# Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:981: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" + for ac_dir in $PATH; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_RANLIB="ranlib" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":" +fi +fi +RANLIB="$ac_cv_prog_RANLIB" +if test -n "$RANLIB"; then + echo "$ac_t""$RANLIB" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + +# Check for common headers. +# FIXME: Seems to me this can cause problems for i386-windows hosts. +# At one point there were hardcoded AC_DEFINE's if ${host} = i386-*-windows*. +for ac_hdr in stdlib.h string.h strings.h unistd.h time.h sys/time.h sys/resource.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:1015: checking for $ac_hdr" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:1025: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 +fi +done + +for ac_func in getrusage time +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:1054: checking for $ac_func" >&5 +if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +$ac_func(); +#endif + +; return 0; } +EOF +if { (eval echo configure:1082: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <&6 +fi +done + + +. ${srcdir}/../../bfd/configure.host + + + +# Check whether --enable-sim-bswap or --disable-sim-bswap was given. +if test "${enable_sim_bswap+set}" = set; then + enableval="$enable_sim_bswap" + case "${enableval}" in + yes) sim_bswap="-DWITH_BSWAP=1 -DUSE_BSWAP=1";; + no) sim_bswap="-DWITH_BSWAP=0";; + *) { echo "configure: error: "--enable-sim-bswap does not take a value"" 1>&2; exit 1; }; sim_bswap="";; +esac +if test x"$silent" != x"yes" && test x"$sim_bswap" != x""; then + echo "Setting bswap flags = $sim_bswap" 6>&1 +fi +else + sim_bswap="" +fi + + + +# Check whether --enable-sim-cflags or --disable-sim-cflags was given. +if test "${enable_sim_cflags+set}" = set; then + enableval="$enable_sim_cflags" + case "${enableval}" in + yes) sim_cflags="-O2";; + trace) { echo "configure: error: "Please use --enable-sim-debug instead."" 1>&2; exit 1; }; sim_cflags="";; + no) sim_cflags="";; + *) sim_cflags=`echo "${enableval}" | sed -e "s/,/ /g"`;; +esac +if test x"$silent" != x"yes" && test x"$sim_cflags" != x""; then + echo "Setting sim cflags = $sim_cflags" 6>&1 +fi +else + sim_cflags="" +fi + + + +# Check whether --enable-sim-debug or --disable-sim-debug was given. +if test "${enable_sim_debug+set}" = set; then + enableval="$enable_sim_debug" + case "${enableval}" in + yes) sim_debug="-DDEBUG=7 -DWITH_DEBUG=7";; + no) sim_debug="-DDEBUG=0 -DWITH_DEBUG=0";; + *) sim_debug="-DDEBUG='(${enableval})' -DWITH_DEBUG='(${enableval})'";; +esac +if test x"$silent" != x"yes" && test x"$sim_debug" != x""; then + echo "Setting sim debug = $sim_debug" 6>&1 +fi +else + sim_debug="" +fi + + + +# Check whether --enable-sim-stdio or --disable-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";; + *) { echo "configure: error: "Unknown value $enableval passed to --enable-sim-stdio"" 1>&2; exit 1; }; sim_stdio="";; +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 + + + +# Check whether --enable-sim-trace or --disable-sim-trace was given. +if test "${enable_sim_trace+set}" = set; then + enableval="$enable_sim_trace" + case "${enableval}" in + yes) sim_trace="-DTRACE=1 -DWITH_TRACE=-1";; + no) sim_trace="-DTRACE=0 -DWITH_TRACE=0";; + [-0-9]*) + sim_trace="-DTRACE='(${enableval})' -DWITH_TRACE='(${enableval})'";; + [a-z]*) + sim_trace="" + for x in `echo "$enableval" | sed -e "s/,/ /g"`; do + if test x"$sim_trace" = x; then + sim_trace="-DWITH_TRACE='(TRACE_$x" + else + sim_trace="${sim_trace}|TRACE_$x" + fi + done + sim_trace="$sim_trace)'" ;; +esac +if test x"$silent" != x"yes" && test x"$sim_trace" != x""; then + echo "Setting sim trace = $sim_trace" 6>&1 +fi +else + sim_trace="" +fi + + + +# Check whether --enable-sim-profile or --disable-sim-profile was given. +if test "${enable_sim_profile+set}" = set; then + enableval="$enable_sim_profile" + case "${enableval}" in + yes) sim_profile="-DPROFILE=1 -DWITH_PROFILE=-1";; + no) sim_profile="-DPROFILE=0 -DWITH_PROFILE=0";; + [-0-9]*) + sim_profile="-DPROFILE='(${enableval})' -DWITH_PROFILE='(${enableval})'";; + [a-z]*) + sim_profile="" + for x in `echo "$enableval" | sed -e "s/,/ /g"`; do + if test x"$sim_profile" = x; then + sim_profile="-DWITH_PROFILE='(PROFILE_$x" + else + sim_profile="${sim_profile}|PROFILE_$x" + fi + done + sim_profile="$sim_profile)'" ;; +esac +if test x"$silent" != x"yes" && test x"$sim_profile" != x""; then + echo "Setting sim profile = $sim_profile" 6>&1 +fi +else + sim_profile="" +fi + + + +echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 +echo "configure:1237: checking return type of signal handlers" >&5 +if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +#include +#ifdef signal +#undef signal +#endif +#ifdef __cplusplus +extern "C" void (*signal (int, void (*)(int)))(int); +#else +void (*signal ()) (); +#endif + +int main() { +int i; +; return 0; } +EOF +if { (eval echo configure:1259: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_type_signal=void +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_type_signal=int +fi +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_type_signal" 1>&6 +cat >> confdefs.h <&6 + sim_endian="-DWITH_TARGET_BYTE_ORDER=0" + fi;; + no) if test x"$default_endian" != x; then + sim_endian="-DWITH_DEFAULT_TARGET_BYTE_ORDER=${default_endian}" + else + echo "No default endian for target $target" 1>&6 + sim_endian="-DWITH_DEFAULT_TARGET_BYTE_ORDER=0" + fi;; + *) { echo "configure: error: "Unknown value $enableval for --enable-sim-endian"" 1>&2; exit 1; }; sim_endian="";; +esac +if test x"$silent" != x"yes" && test x"$sim_endian" != x""; then + echo "Setting endian flags = $sim_endian" 6>&1 +fi +else + sim_endian="${default_sim_endian}" +fi + + + +# Check whether --enable-sim-hostendian or --disable-sim-hostendian was given. +if test "${enable_sim_hostendian+set}" = set; then + enableval="$enable_sim_hostendian" + case "${enableval}" in + no) sim_hostendian="-DWITH_HOST_BYTE_ORDER=0";; + b*|B*) sim_hostendian="-DWITH_HOST_BYTE_ORDER=BIG_ENDIAN";; + l*|L*) sim_hostendian="-DWITH_HOST_BYTE_ORDER=LITTLE_ENDIAN";; + *) { echo "configure: error: "Unknown value $enableval for --enable-sim-hostendian"" 1>&2; exit 1; }; sim_hostendian="";; +esac +if test x"$silent" != x"yes" && test x"$sim_hostendian" != x""; then + echo "Setting hostendian flags = $sim_hostendian" 6>&1 +fi +else + +if test "x$cross_compiling" = "xno"; then + echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6 +echo "configure:1351: checking whether byte ordering is bigendian" >&5 +if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_cv_c_bigendian=unknown +# See if sys/param.h defines the BYTE_ORDER macro. +cat > conftest.$ac_ext < +#include +int main() { + +#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN + bogus endian macros +#endif +; return 0; } +EOF +if { (eval echo configure:1369: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + # It does; now see whether it defined to BIG_ENDIAN or not. +cat > conftest.$ac_ext < +#include +int main() { + +#if BYTE_ORDER != BIG_ENDIAN + not big endian +#endif +; return 0; } +EOF +if { (eval echo configure:1384: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_c_bigendian=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_c_bigendian=no +fi +rm -f conftest* +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 +fi +rm -f conftest* +if test $ac_cv_c_bigendian = unknown; then +if test "$cross_compiling" = yes; then + { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } +else + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +then + ac_cv_c_bigendian=no +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + ac_cv_c_bigendian=yes +fi +rm -fr conftest* +fi + +fi +fi + +echo "$ac_t""$ac_cv_c_bigendian" 1>&6 +if test $ac_cv_c_bigendian = yes; then + cat >> confdefs.h <<\EOF +#define WORDS_BIGENDIAN 1 +EOF + +fi + + if test $ac_cv_c_bigendian = yes; then + sim_hostendian="-DWITH_HOST_BYTE_ORDER=BIG_ENDIAN" + else + sim_hostendian="-DWITH_HOST_BYTE_ORDER=LITTLE_ENDIAN" + fi +else + sim_hostendian="-DWITH_HOST_BYTE_ORDER=0" +fi +fi + + + +default_sim_scache="1024" +# Check whether --enable-sim-scache or --disable-sim-scache was given. +if test "${enable_sim_scache+set}" = set; then + enableval="$enable_sim_scache" + case "${enableval}" in + yes) sim_scache="-DWITH_SCACHE=${default_sim_scache}";; + no) sim_scace= ;; + [0-9]*) sim_cache=${enableval};; + *) { echo "configure: error: "Bad value $enableval passed to --enable-sim-scache"" 1>&2; exit 1; }; + sim_scache="";; +esac +if test x"$silent" != x"yes" && test x"$sim_scache" != x""; then + echo "Setting scache size = $sim_scache" 6>&1 +fi +else + sim_scache="-DWITH_SCACHE=${default_sim_scache}" +fi + + + + +default_sim_default_model="m32r/d" +# Check whether --enable-sim-default-model or --disable-sim-default-model was given. +if test "${enable_sim_default_model+set}" = set; then + enableval="$enable_sim_default_model" + case "${enableval}" in + yes|no) { echo "configure: error: "Missing argument to --enable-sim-default-model"" 1>&2; exit 1; };; + *) sim_default_model="-DWITH_DEFAULT_MODEL='\"${enableval}\"'";; +esac +if test x"$silent" != x"yes" && test x"$sim_default_model" != x""; then + echo "Setting default model = $sim_default_model" 6>&1 +fi +else + sim_default_model="-DWITH_DEFAULT_MODEL='\"${default_sim_default_model}\"'" +fi + + + + + + +trap '' 1 2 15 +cat > confcache <<\EOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs. It is not useful on other systems. +# If it contains results you don't want to keep, you may remove or edit it. +# +# By default, configure uses ./config.cache as the cache file, +# creating it if it does not exist already. You can give configure +# the --cache-file=FILE option to use a different cache file; that is +# what configure does when it calls configure scripts in +# subdirectories, so they share the cache. +# Giving --cache-file=/dev/null disables caching, for debugging configure. +# config.status only pays attention to the cache file if you give it the +# --recheck option to rerun configure. +# +EOF +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, don't put newlines in cache variables' values. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +(set) 2>&1 | + case `(ac_space=' '; set) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote substitution + # turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + -e "s/'/'\\\\''/g" \ + -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' + ;; + esac >> confcache +if cmp -s $cache_file confcache; then + : +else + if test -w $cache_file; then + echo "updating cache $cache_file" + cat confcache > $cache_file + else + echo "not updating unwritable cache $cache_file" + fi +fi +rm -f confcache + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# Any assignment to VPATH causes Sun make to only execute +# the first set of double-colon rules, so remove it if not needed. +# If there is a colon in the path, we need to keep it. +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' +fi + +trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 + +DEFS=-DHAVE_CONFIG_H + +# Without the "./", some shells look in PATH for config.status. +: ${CONFIG_STATUS=./config.status} + +echo creating $CONFIG_STATUS +rm -f $CONFIG_STATUS +cat > $CONFIG_STATUS </dev/null | sed 1q`: +# +# $0 $ac_configure_args +# +# Compiler output produced by configure, useful for debugging +# configure, is in ./config.log if it exists. + +ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" +for ac_option +do + case "\$ac_option" in + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" + exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; + -version | --version | --versio | --versi | --vers | --ver | --ve | --v) + echo "$CONFIG_STATUS generated by autoconf version 2.12" + exit 0 ;; + -help | --help | --hel | --he | --h) + echo "\$ac_cs_usage"; exit 0 ;; + *) echo "\$ac_cs_usage"; exit 1 ;; + esac +done + +ac_given_srcdir=$srcdir +ac_given_INSTALL="$INSTALL" + +trap 'rm -fr `echo "Makefile.sim:Makefile.in Make-common.sim:../common/Make-common.in config.h:config.in" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 +EOF +cat >> $CONFIG_STATUS < conftest.subs <<\\CEOF +$ac_vpsub +$extrasub +s%@CFLAGS@%$CFLAGS%g +s%@CPPFLAGS@%$CPPFLAGS%g +s%@CXXFLAGS@%$CXXFLAGS%g +s%@DEFS@%$DEFS%g +s%@LDFLAGS@%$LDFLAGS%g +s%@LIBS@%$LIBS%g +s%@exec_prefix@%$exec_prefix%g +s%@prefix@%$prefix%g +s%@program_transform_name@%$program_transform_name%g +s%@bindir@%$bindir%g +s%@sbindir@%$sbindir%g +s%@libexecdir@%$libexecdir%g +s%@datadir@%$datadir%g +s%@sysconfdir@%$sysconfdir%g +s%@sharedstatedir@%$sharedstatedir%g +s%@localstatedir@%$localstatedir%g +s%@libdir@%$libdir%g +s%@includedir@%$includedir%g +s%@oldincludedir@%$oldincludedir%g +s%@infodir@%$infodir%g +s%@mandir@%$mandir%g +s%@host@%$host%g +s%@host_alias@%$host_alias%g +s%@host_cpu@%$host_cpu%g +s%@host_vendor@%$host_vendor%g +s%@host_os@%$host_os%g +s%@target@%$target%g +s%@target_alias@%$target_alias%g +s%@target_cpu@%$target_cpu%g +s%@target_vendor@%$target_vendor%g +s%@target_os@%$target_os%g +s%@build@%$build%g +s%@build_alias@%$build_alias%g +s%@build_cpu@%$build_cpu%g +s%@build_vendor@%$build_vendor%g +s%@build_os@%$build_os%g +s%@CC@%$CC%g +s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g +s%@INSTALL_DATA@%$INSTALL_DATA%g +s%@CC_FOR_BUILD@%$CC_FOR_BUILD%g +s%@HDEFINES@%$HDEFINES%g +s%@AR@%$AR%g +s%@RANLIB@%$RANLIB%g +s%@CPP@%$CPP%g +s%@sim_bswap@%$sim_bswap%g +s%@sim_cflags@%$sim_cflags%g +s%@sim_debug@%$sim_debug%g +s%@sim_stdio@%$sim_stdio%g +s%@sim_trace@%$sim_trace%g +s%@sim_profile@%$sim_profile%g +s%@sim_endian@%$sim_endian%g +s%@sim_hostendian@%$sim_hostendian%g +s%@sim_scache@%$sim_scache%g +s%@sim_default_model@%$sim_default_model%g + +CEOF +EOF + +cat >> $CONFIG_STATUS <<\EOF + +# Split the substitutions into bite-sized pieces for seds with +# small command number limits, like on Digital OSF/1 and HP-UX. +ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. +ac_file=1 # Number of current file. +ac_beg=1 # First line for current file. +ac_end=$ac_max_sed_cmds # Line after last line for current file. +ac_more_lines=: +ac_sed_cmds="" +while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file + else + sed "${ac_end}q" conftest.subs > conftest.s$ac_file + fi + if test ! -s conftest.s$ac_file; then + ac_more_lines=false + rm -f conftest.s$ac_file + else + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f conftest.s$ac_file" + else + ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" + fi + ac_file=`expr $ac_file + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_cmds` + fi +done +if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat +fi +EOF + +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF +for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case "$ac_file" in + *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` + ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + *) ac_file_in="${ac_file}.in" ;; + esac + + # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. + + # Remove last slash and all that follows it. Not all systems have dirname. + ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` + if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then + # The file is in a subdirectory. + test ! -d "$ac_dir" && mkdir "$ac_dir" + ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" + # A "../" for each directory in $ac_dir_suffix. + ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` + else + ac_dir_suffix= ac_dots= + fi + + case "$ac_given_srcdir" in + .) srcdir=. + if test -z "$ac_dots"; then top_srcdir=. + else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; + /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; + *) # Relative path. + srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" + top_srcdir="$ac_dots$ac_given_srcdir" ;; + esac + + case "$ac_given_INSTALL" in + [/$]*) INSTALL="$ac_given_INSTALL" ;; + *) INSTALL="$ac_dots$ac_given_INSTALL" ;; + esac + + echo creating "$ac_file" + rm -f "$ac_file" + configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." + case "$ac_file" in + *Makefile*) ac_comsub="1i\\ +# $configure_input" ;; + *) ac_comsub= ;; + esac + + ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` + sed -e "$ac_comsub +s%@configure_input@%$configure_input%g +s%@srcdir@%$srcdir%g +s%@top_srcdir@%$top_srcdir%g +s%@INSTALL@%$INSTALL%g +" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file +fi; done +rm -f conftest.s* + +# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where +# NAME is the cpp macro being defined and VALUE is the value it is being given. +# +# ac_d sets the value in "#define NAME VALUE" lines. +ac_dA='s%^\([ ]*\)#\([ ]*define[ ][ ]*\)' +ac_dB='\([ ][ ]*\)[^ ]*%\1#\2' +ac_dC='\3' +ac_dD='%g' +# ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE". +ac_uA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' +ac_uB='\([ ]\)%\1#\2define\3' +ac_uC=' ' +ac_uD='\4%g' +# ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE". +ac_eA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' +ac_eB='$%\1#\2define\3' +ac_eC=' ' +ac_eD='%g' + +if test "${CONFIG_HEADERS+set}" != set; then +EOF +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF +fi +for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case "$ac_file" in + *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` + ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + *) ac_file_in="${ac_file}.in" ;; + esac + + echo creating $ac_file + + rm -f conftest.frag conftest.in conftest.out + ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` + cat $ac_file_inputs > conftest.in + +EOF + +# Transform confdefs.h into a sed script conftest.vals that substitutes +# the proper values into config.h.in to produce config.h. And first: +# Protect against being on the right side of a sed subst in config.status. +# Protect against being in an unquoted here document in config.status. +rm -f conftest.vals +cat > conftest.hdr <<\EOF +s/[\\&%]/\\&/g +s%[\\$`]%\\&%g +s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp +s%ac_d%ac_u%gp +s%ac_u%ac_e%gp +EOF +sed -n -f conftest.hdr confdefs.h > conftest.vals +rm -f conftest.hdr + +# This sed command replaces #undef with comments. This is necessary, for +# example, in the case of _POSIX_SOURCE, which is predefined and required +# on some systems where configure will not decide to define it. +cat >> conftest.vals <<\EOF +s%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */% +EOF + +# Break up conftest.vals because some shells have a limit on +# the size of here documents, and old seds have small limits too. + +rm -f conftest.tail +while : +do + ac_lines=`grep -c . conftest.vals` + # grep -c gives empty output for an empty file on some AIX systems. + if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi + # Write a limited-size here document to conftest.frag. + echo ' cat > conftest.frag <> $CONFIG_STATUS + sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS + echo 'CEOF + sed -f conftest.frag conftest.in > conftest.out + rm -f conftest.in + mv conftest.out conftest.in +' >> $CONFIG_STATUS + sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail + rm -f conftest.vals + mv conftest.tail conftest.vals +done +rm -f conftest.vals + +cat >> $CONFIG_STATUS <<\EOF + rm -f conftest.frag conftest.h + echo "/* $ac_file. Generated automatically by configure. */" > conftest.h + cat conftest.in >> conftest.h + rm -f conftest.in + if cmp -s $ac_file conftest.h 2>/dev/null; then + echo "$ac_file is unchanged" + rm -f conftest.h + else + # Remove last slash and all that follows it. Not all systems have dirname. + ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` + if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then + # The file is in a subdirectory. + test ! -d "$ac_dir" && mkdir "$ac_dir" + fi + rm -f $ac_file + mv conftest.h $ac_file + fi +fi; done + +EOF + +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF +srcdir=$ac_given_srcdir +while test -n "$ac_sources"; do + set $ac_dests; ac_dest=$1; shift; ac_dests=$* + set $ac_sources; ac_source=$1; shift; ac_sources=$* + + echo "linking $srcdir/$ac_source to $ac_dest" + + if test ! -r $srcdir/$ac_source; then + { echo "configure: error: $srcdir/$ac_source: File not found" 1>&2; exit 1; } + fi + rm -f $ac_dest + + # Make relative symlinks. + # Remove last slash and all that follows it. Not all systems have dirname. + ac_dest_dir=`echo $ac_dest|sed 's%/[^/][^/]*$%%'` + if test "$ac_dest_dir" != "$ac_dest" && test "$ac_dest_dir" != .; then + # The dest file is in a subdirectory. + test ! -d "$ac_dest_dir" && mkdir "$ac_dest_dir" + ac_dest_dir_suffix="/`echo $ac_dest_dir|sed 's%^\./%%'`" + # A "../" for each directory in $ac_dest_dir_suffix. + ac_dots=`echo $ac_dest_dir_suffix|sed 's%/[^/]*%../%g'` + else + ac_dest_dir_suffix= ac_dots= + fi + + case "$srcdir" in + [/$]*) ac_rel_source="$srcdir/$ac_source" ;; + *) ac_rel_source="$ac_dots$srcdir/$ac_source" ;; + esac + + # Make a symlink if possible; otherwise try a hard link. + if ln -s $ac_rel_source $ac_dest 2>/dev/null || + ln $srcdir/$ac_source $ac_dest; then : + else + { echo "configure: error: can not link $ac_dest to $srcdir/$ac_source" 1>&2; exit 1; } + fi +done +EOF +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF +case "x$CONFIG_FILES" in xMakefile*) + echo "Merging Makefile.sim+Make-common.sim into Makefile ..." + rm -f Makesim1.tmp Makesim2.tmp Makefile + sed -n -e '/^## COMMON_PRE_/,/^## End COMMON_PRE_/ p' Makesim1.tmp + sed -n -e '/^## COMMON_POST_/,/^## End COMMON_POST_/ p' Makesim2.tmp + sed -e '/^## COMMON_PRE_/ r Makesim1.tmp' \ + -e '/^## COMMON_POST_/ r Makesim2.tmp' \ + Makefile + rm -f Makefile.sim Make-common.sim Makesim1.tmp Makesim2.tmp + ;; + esac + case "x$CONFIG_HEADERS" in xconfig.h:config.in) echo > stamp-h ;; esac + +exit 0 +EOF +chmod +x $CONFIG_STATUS +rm -fr confdefs* $ac_clean_files +test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 + + diff --git a/sim/m32r/sim-if.c b/sim/m32r/sim-if.c index 7e97528..6aab891 100644 --- a/sim/m32r/sim-if.c +++ b/sim/m32r/sim-if.c @@ -26,8 +26,6 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "sim-core.h" #include "cpu-sim.h" -struct host_callback_struct *sim_callback; - /* Global state until sim_open starts creating and returning it [and the other simulator i/f fns take it as an argument]. */ struct sim_state sim_global_state; @@ -38,8 +36,10 @@ STATE current_state; /* Create an instance of the simulator. */ SIM_DESC -sim_open (kind, argv) +sim_open (kind, callback, abfd, argv) SIM_OPEN_KIND kind; + host_callback *callback; + struct _bfd *abfd; char **argv; { int i; @@ -48,7 +48,7 @@ sim_open (kind, argv) /* FIXME: until we alloc one, use the global. */ memset (sd, 0, sizeof (sim_global_state)); STATE_OPEN_KIND (sd) = kind; - STATE_CALLBACK (sd) = sim_callback; + STATE_CALLBACK (sd) = callback; if (sim_pre_argv_init (sd, argv[0]) != SIM_RC_OK) return 0; @@ -80,14 +80,10 @@ sim_open (kind, argv) cgen_init (sd); /* FIXME:wip */ - sim_core_attach (sd, - NULL, - attach_raw_memory, - access_read_write_exec, - 0, 0, 0x100000, NULL, NULL); - - /* We could only do this if profiling has been enabled, but the - structure member is small so we don't bother. */ + sim_core_attach (sd, NULL, attach_raw_memory, access_read_write_exec, + 0, 0, M32R_DEFAULT_MEM_SIZE, NULL, NULL); + + /* Only needed for profiling, but the structure member is small. */ for (i = 0; i < MAX_NR_PROCESSORS; ++i) memset (& CPU_M32R_PROFILE (STATE_CPU (sd, i)), 0, sizeof (CPU_M32R_PROFILE (STATE_CPU (sd, i)))); @@ -212,17 +208,6 @@ sim_info (sd, verbose) profile_print (sd, STATE_VERBOSE_P (sd), NULL, print_m32r_misc_cpu); } -void -sim_set_callbacks (sd, p) - SIM_DESC sd; - host_callback *p; -{ - if (sd == NULL) - sim_callback = p; - else - STATE_CALLBACK (sd) = p; -} - /* The contents of BUF are in target byte order. */ void @@ -300,7 +285,7 @@ sim_read (sd, addr, buf, len) int len; { #if 1 - return sim_core_read_buffer (sd, sim_core_read_map, + return sim_core_read_buffer (sd, NULL, sim_core_read_map, buf, addr, len); #else return (*STATE_MEM_READ (sd)) (sd, addr, buf, len); @@ -315,7 +300,7 @@ sim_write (sd, addr, buf, len) int len; { #if 1 - return sim_core_write_buffer (sd, sim_core_write_map, + return sim_core_write_buffer (sd, NULL, sim_core_write_map, buf, addr, len); #else return (*STATE_MEM_WRITE (sd)) (sd, addr, buf, len); diff --git a/sim/mips/ChangeLog b/sim/mips/ChangeLog index d0575e7..d4faa02 100644 --- a/sim/mips/ChangeLog +++ b/sim/mips/ChangeLog @@ -1,3 +1,26 @@ +Mon Aug 25 17:50:22 1997 Andrew Cagney + + * configure: Regenerated to track ../common/aclocal.m4 changes. + * config.in: Ditto. + +Mon Aug 25 15:59:48 1997 Andrew Cagney + + * interp.c (sim_open): Add ABFD argument. + (sim_load): Move call to sim_config from here. + (sim_open): To here. Check return status. + +start-sanitize-r5900 + * gencode.c (build_instruction): Do not define x8000000000000000, + x7FFFFFFFFFFFFFFF, or xFFFFFFFF80000000. + +end-sanitize-r5900 +start-sanitize-r5900 +Mon Jul 28 19:49:29 1997 Andrew Cagney + + * gencode.c (build_instruction): For "pdivw", "pdivbw" and + "pdivuw" check for overflow due to signed divide by -1. + +end-sanitize-r5900 Fri Jul 25 15:00:45 1997 Gavin Koch * gencode.c (build_instruction): Two arg MADD should diff --git a/sim/mips/configure b/sim/mips/configure index b64bb8e..c1becce 100755 --- a/sim/mips/configure +++ b/sim/mips/configure @@ -1,7 +1,7 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated automatically using autoconf version 2.10 +# Generated automatically using autoconf version 2.12 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. # # This configure script is free software; the Free Software Foundation @@ -21,6 +21,16 @@ ac_help="$ac_help --enable-sim-stdio Specify whether to use stdio for console input/output." ac_help="$ac_help --enable-sim-trace=opts Enable tracing flags" +ac_help="$ac_help + --enable-sim-profile=opts Enable profiling flags" +ac_help="$ac_help + --enable-sim-inline=inlines Specify which functions should be inlined." +ac_help="$ac_help + --enable-sim-endian=endian Specify target byte endian orientation." +ac_help="$ac_help + --enable-sim-hostendain=end Specify host byte endian orientation." +ac_help="$ac_help + --enable-sim-warnings=opts Extra CFLAGS for turning on compiler warnings except for idecode.o, semantics.o and psim.o" # Initialize some variables set by options. # The variables have the same names as the options, with @@ -59,6 +69,8 @@ mandir='${prefix}/man' # Initialize some other variables. subdirs= MFLAGS= MAKEFLAGS= +# Maximum number of lines to put in a shell here document. +ac_max_here_lines=12 ac_prev= for ac_option @@ -340,7 +352,7 @@ EOF verbose=yes ;; -version | --version | --versio | --versi | --vers) - echo "configure generated by autoconf version 2.10" + echo "configure generated by autoconf version 2.12" exit 0 ;; -with-* | --with-*) @@ -442,11 +454,14 @@ do done # NLS nuisances. -# Only set LANG and LC_ALL to C if already set. -# These must not be set unconditionally because not all systems understand -# e.g. LANG=C (notably SCO). -if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi +# Only set these to C if already set. These must not be set unconditionally +# because not all systems understand e.g. LANG=C (notably SCO). +# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! +# Non-C LC_CTYPE values break the ctype check. if test "${LANG+set}" = set; then LANG=C; export LANG; fi +if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi +if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi +if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -rf conftest* confdefs.h @@ -508,6 +523,7 @@ ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. @@ -524,6 +540,7 @@ fi echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 +echo "configure:544: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -538,33 +555,37 @@ else # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:548: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:565: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then : else echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:563: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:582: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then : else echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* CPP=/lib/cpp fi @@ -630,6 +651,7 @@ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } fi echo $ac_n "checking host system type""... $ac_c" 1>&6 +echo "configure:655: checking host system type" >&5 host_alias=$host case "$host_alias" in @@ -644,12 +666,13 @@ NONE) esac host=`$ac_config_sub $host_alias` -host_cpu=`echo $host | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'` -host_vendor=`echo $host | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'` -host_os=`echo $host | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\3/'` +host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo "$ac_t""$host" 1>&6 echo $ac_n "checking target system type""... $ac_c" 1>&6 +echo "configure:676: checking target system type" >&5 target_alias=$target case "$target_alias" in @@ -661,12 +684,13 @@ NONE) esac target=`$ac_config_sub $target_alias` -target_cpu=`echo $target | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'` -target_vendor=`echo $target | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'` -target_os=`echo $target | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\3/'` +target_cpu=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +target_vendor=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo "$ac_t""$target" 1>&6 echo $ac_n "checking build system type""... $ac_c" 1>&6 +echo "configure:694: checking build system type" >&5 build_alias=$build case "$build_alias" in @@ -678,9 +702,9 @@ NONE) esac build=`$ac_config_sub $build_alias` -build_cpu=`echo $build | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'` -build_vendor=`echo $build | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'` -build_os=`echo $build | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\3/'` +build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo "$ac_t""$build" 1>&6 test "$host_alias" != "$target_alias" && @@ -710,6 +734,7 @@ test "$program_transform_name" = "" && program_transform_name="s,x,x," # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:738: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -738,6 +763,7 @@ if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:767: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -784,7 +810,47 @@ fi test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } fi +echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 +echo "configure:815: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 + +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then + ac_cv_prog_cc_works=yes + # If we can't run a trivial program, we are probably using a cross compiler. + if (./conftest; exit) 2>/dev/null; then + ac_cv_prog_cc_cross=no + else + ac_cv_prog_cc_cross=yes + fi +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + ac_cv_prog_cc_works=no +fi +rm -fr conftest* + +echo "$ac_t""$ac_cv_prog_cc_works" 1>&6 +if test $ac_cv_prog_cc_works = no; then + { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } +fi +echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 +echo "configure:849: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 +cross_compiling=$ac_cv_prog_cc_cross + echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 +echo "configure:854: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -793,7 +859,7 @@ else yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:797: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:863: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -801,29 +867,34 @@ fi fi echo "$ac_t""$ac_cv_prog_gcc" 1>&6 + if test $ac_cv_prog_gcc = yes; then GCC=yes - if test "${CFLAGS+set}" != set; then - echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -if eval "test \"`echo '$''{'ac_cv_prog_gcc_g'+set}'`\" = set"; then + ac_test_CFLAGS="${CFLAGS+set}" + ac_save_CFLAGS="$CFLAGS" + CFLAGS= + echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 +echo "configure:878: checking whether ${CC-cc} accepts -g" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else echo 'void f(){}' > conftest.c if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then - ac_cv_prog_gcc_g=yes + ac_cv_prog_cc_g=yes else - ac_cv_prog_gcc_g=no + ac_cv_prog_cc_g=no fi rm -f conftest* fi -echo "$ac_t""$ac_cv_prog_gcc_g" 1>&6 - if test $ac_cv_prog_gcc_g = yes; then - CFLAGS="-g -O" - else - CFLAGS="-O" - fi +echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 + if test "$ac_test_CFLAGS" = set; then + CFLAGS="$ac_save_CFLAGS" + elif test $ac_cv_prog_cc_g = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-O2" fi else GCC= @@ -841,11 +912,12 @@ fi # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +echo "configure:916: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" + IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS="${IFS}:" for ac_dir in $PATH; do # Account for people who put trailing slashes in PATH elements. case "$ac_dir/" in @@ -868,7 +940,7 @@ else ;; esac done - IFS="$ac_save_ifs" + IFS="$ac_save_IFS" fi if test "${ac_cv_path_install+set}" = set; then @@ -905,6 +977,7 @@ AR=${AR-ar} # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:981: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -932,26 +1005,31 @@ fi # Check for common headers. -for ac_hdr in stdlib.h string.h strings.h unistd.h +# FIXME: Seems to me this can cause problems for i386-windows hosts. +# At one point there were hardcoded AC_DEFINE's if ${host} = i386-*-windows*. +for ac_hdr in stdlib.h string.h strings.h unistd.h time.h sys/time.h sys/resource.h do -ac_safe=`echo "$ac_hdr" | tr './\055' '___'` +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:1015: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:949: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1025: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* eval "ac_cv_header_$ac_safe=yes" else echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_header_$ac_safe=no" fi @@ -959,7 +1037,7 @@ rm -f conftest* fi if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 - ac_tr_hdr=HAVE_`echo $ac_hdr | tr 'abcdefghijklmnopqrstuvwxyz./\055' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ___'` + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` cat >> confdefs.h <&6 +echo "configure:1054: checking for $ac_func" >&5 +if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +$ac_func(); +#endif + +; return 0; } +EOF +if { (eval echo configure:1082: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <&6 +fi +done + . ${srcdir}/../../bfd/configure.host @@ -1047,9 +1180,20 @@ fi if test "${enable_sim_trace+set}" = set; then enableval="$enable_sim_trace" case "${enableval}" in - yes) sim_trace="-DTRACE=1 -DWITH_TRACE=1";; + yes) sim_trace="-DTRACE=1 -DWITH_TRACE=-1";; no) sim_trace="-DTRACE=0 -DWITH_TRACE=0";; - *) sim_trace="-DTRACE='(${enableval})' -DWITH_TRACE='(${enableval})'";; + [-0-9]*) + sim_trace="-DTRACE='(${enableval})' -DWITH_TRACE='(${enableval})'";; + [a-z]*) + sim_trace="" + for x in `echo "$enableval" | sed -e "s/,/ /g"`; do + if test x"$sim_trace" = x; then + sim_trace="-DWITH_TRACE='(TRACE_$x" + else + sim_trace="${sim_trace}|TRACE_$x" + fi + done + sim_trace="$sim_trace)'" ;; esac if test x"$silent" != x"yes" && test x"$sim_trace" != x""; then echo "Setting sim trace = $sim_trace" 6>&1 @@ -1060,12 +1204,41 @@ fi +# Check whether --enable-sim-profile or --disable-sim-profile was given. +if test "${enable_sim_profile+set}" = set; then + enableval="$enable_sim_profile" + case "${enableval}" in + yes) sim_profile="-DPROFILE=1 -DWITH_PROFILE=-1";; + no) sim_profile="-DPROFILE=0 -DWITH_PROFILE=0";; + [-0-9]*) + sim_profile="-DPROFILE='(${enableval})' -DWITH_PROFILE='(${enableval})'";; + [a-z]*) + sim_profile="" + for x in `echo "$enableval" | sed -e "s/,/ /g"`; do + if test x"$sim_profile" = x; then + sim_profile="-DWITH_PROFILE='(PROFILE_$x" + else + sim_profile="${sim_profile}|PROFILE_$x" + fi + done + sim_profile="$sim_profile)'" ;; +esac +if test x"$silent" != x"yes" && test x"$sim_profile" != x""; then + echo "Setting sim profile = $sim_profile" 6>&1 +fi +else + sim_profile="" +fi + + + echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 +echo "configure:1237: checking return type of signal handlers" >&5 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -1078,20 +1251,20 @@ extern "C" void (*signal (int, void (*)(int)))(int); void (*signal ()) (); #endif -int main() { return 0; } -int t() { +int main() { int i; ; return 0; } EOF -if { (eval echo configure:1087: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1259: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_type_signal=void else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* ac_cv_type_signal=int fi rm -f conftest* - fi echo "$ac_t""$ac_cv_type_signal" 1>&6 @@ -1122,6 +1295,215 @@ sim_link_links="${sim_link_links} targ-vals.def" + +default_sim_inline="-DDEFAULT_INLINE=0" +# Check whether --enable-sim-inline or --disable-sim-inline was given. +if test "${enable_sim_inline+set}" = set; then + enableval="$enable_sim_inline" + sim_inline="" +case "$enableval" in + no) sim_inline="-DDEFAULT_INLINE=0";; + 0) sim_inline="-DDEFAULT_INLINE=0";; + yes | 2) sim_inline="-DDEFAULT_INLINE=ALL_INLINE";; + 1) sim_inline="-DDEFAULT_INLINE=INLINE_LOCALS";; + *) for x in `echo "$enableval" | sed -e "s/,/ /g"`; do + new_flag="" + case "$x" in + *_INLINE=*) new_flag="-D$x";; + *=*) new_flag=`echo "$x" | sed -e "s/=/_INLINE=/" -e "s/^/-D/"`;; + *_INLINE) new_flag="-D$x=ALL_INLINE";; + *) new_flag="-D$x""_INLINE=ALL_INLINE";; + esac + if test x"$sim_inline" = x""; then + sim_inline="$new_flag" + else + sim_inline="$sim_inline $new_flag" + fi + done;; +esac +if test x"$silent" != x"yes" && test x"$sim_inline" != x""; then + echo "Setting inline flags = $sim_inline" 6>&1 +fi +else + if test x"$GCC" != "x" -a x"${default_sim_inline}" != "x" ; then + sim_inline="${default_sim_inline}" + if test x"$silent" != x"yes"; then + echo "Setting inline flags = $sim_inline" 6>&1 + fi +else + sim_inline="" +fi +fi + + + +wire_endian="0" +default_endian="0" +default_sim_endian="-DWITH_TARGET_BYTE_ORDER=0" +# Check whether --enable-sim-endian or --disable-sim-endian was given. +if test "${enable_sim_endian+set}" = set; then + enableval="$enable_sim_endian" + case "${enableval}" in + b*|B*) sim_endian="-DWITH_TARGET_BYTE_ORDER=BIG_ENDIAN";; + l*|L*) sim_endian="-DWITH_TARGET_BYTE_ORDER=LITTLE_ENDIAN";; + yes) if test x"$wire_endian" != x; then + sim_endian="-DWITH_TARGET_BYTE_ORDER=${wire_endian}" + else + echo "No hard-wired endian for target $target" 1>&6 + sim_endian="-DWITH_TARGET_BYTE_ORDER=0" + fi;; + no) if test x"$default_endian" != x; then + sim_endian="-DWITH_DEFAULT_TARGET_BYTE_ORDER=${default_endian}" + else + echo "No default endian for target $target" 1>&6 + sim_endian="-DWITH_DEFAULT_TARGET_BYTE_ORDER=0" + fi;; + *) { echo "configure: error: "Unknown value $enableval for --enable-sim-endian"" 1>&2; exit 1; }; sim_endian="";; +esac +if test x"$silent" != x"yes" && test x"$sim_endian" != x""; then + echo "Setting endian flags = $sim_endian" 6>&1 +fi +else + sim_endian="${default_sim_endian}" +fi + + + +# Check whether --enable-sim-hostendian or --disable-sim-hostendian was given. +if test "${enable_sim_hostendian+set}" = set; then + enableval="$enable_sim_hostendian" + case "${enableval}" in + no) sim_hostendian="-DWITH_HOST_BYTE_ORDER=0";; + b*|B*) sim_hostendian="-DWITH_HOST_BYTE_ORDER=BIG_ENDIAN";; + l*|L*) sim_hostendian="-DWITH_HOST_BYTE_ORDER=LITTLE_ENDIAN";; + *) { echo "configure: error: "Unknown value $enableval for --enable-sim-hostendian"" 1>&2; exit 1; }; sim_hostendian="";; +esac +if test x"$silent" != x"yes" && test x"$sim_hostendian" != x""; then + echo "Setting hostendian flags = $sim_hostendian" 6>&1 +fi +else + +if test "x$cross_compiling" = "xno"; then + echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6 +echo "configure:1389: checking whether byte ordering is bigendian" >&5 +if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_cv_c_bigendian=unknown +# See if sys/param.h defines the BYTE_ORDER macro. +cat > conftest.$ac_ext < +#include +int main() { + +#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN + bogus endian macros +#endif +; return 0; } +EOF +if { (eval echo configure:1407: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + # It does; now see whether it defined to BIG_ENDIAN or not. +cat > conftest.$ac_ext < +#include +int main() { + +#if BYTE_ORDER != BIG_ENDIAN + not big endian +#endif +; return 0; } +EOF +if { (eval echo configure:1422: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_c_bigendian=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_c_bigendian=no +fi +rm -f conftest* +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 +fi +rm -f conftest* +if test $ac_cv_c_bigendian = unknown; then +if test "$cross_compiling" = yes; then + { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } +else + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +then + ac_cv_c_bigendian=no +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + ac_cv_c_bigendian=yes +fi +rm -fr conftest* +fi + +fi +fi + +echo "$ac_t""$ac_cv_c_bigendian" 1>&6 +if test $ac_cv_c_bigendian = yes; then + cat >> confdefs.h <<\EOF +#define WORDS_BIGENDIAN 1 +EOF + +fi + + if test $ac_cv_c_bigendian = yes; then + sim_hostendian="-DWITH_HOST_BYTE_ORDER=BIG_ENDIAN" + else + sim_hostendian="-DWITH_HOST_BYTE_ORDER=LITTLE_ENDIAN" + fi +else + sim_hostendian="-DWITH_HOST_BYTE_ORDER=0" +fi +fi + + + +# Check whether --enable-sim-warnings or --disable-sim-warnings was given. +if test "${enable_sim_warnings+set}" = set; then + enableval="$enable_sim_warnings" + case "${enableval}" in + yes) sim_warnings="-Werror -Wall -Wpointer-arith -Wmissing-prototypes -Wmissing-declarations ";; + no) sim_warnings="-w";; + *) sim_warnings=`echo "${enableval}" | sed -e "s/,/ /g"`;; +esac +if test x"$silent" != x"yes" && test x"$sim_warnings" != x""; then + echo "Setting warning flags = $sim_warnings" 6>&1 +fi +else + sim_warnings="" +fi + + + + # Ensure a reasonable default simulator is constructed: case "${target}" in # start-sanitize-r5900 @@ -1134,26 +1516,29 @@ case "${target}" in esac -for ac_hdr in string.h strings.h stdlib.h +for ac_hdr in string.h strings.h stdlib.h stdlib.h do -ac_safe=`echo "$ac_hdr" | tr './\055' '___'` +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:1524: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1151: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1534: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* eval "ac_cv_header_$ac_safe=yes" else echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_header_$ac_safe=no" fi @@ -1161,7 +1546,7 @@ rm -f conftest* fi if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 - ac_tr_hdr=HAVE_`echo $ac_hdr | tr 'abcdefghijklmnopqrstuvwxyz./\055' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ___'` + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` cat >> confdefs.h <&6 -ac_lib_var=`echo m'_'fabs | tr './+\055' '__p_'` +echo $ac_n "checking for fabs in -lm""... $ac_c" 1>&6 +echo "configure:1561: checking for fabs in -lm" >&5 +ac_lib_var=`echo m'_'fabs | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lm $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; }; then +if { (eval echo configure:1580: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi @@ -1204,7 +1591,8 @@ LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 - ac_tr_lib=HAVE_LIB`echo m | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + ac_tr_lib=HAVE_LIB`echo m | sed -e 's/[^a-zA-Z0-9_]/_/g' \ + -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` cat >> confdefs.h <&6 +echo "configure:1610: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; }; then +if { (eval echo configure:1638: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_$ac_func=no" fi rm -f conftest* - fi + if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` @@ -1288,11 +1678,25 @@ cat > confcache <<\EOF # --recheck option to rerun configure. # EOF +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, don't put newlines in cache variables' values. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. (set) 2>&1 | - sed -n "s/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=\${\1='\2'}/p" \ - >> confcache + case `(ac_space=' '; set) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote substitution + # turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + -e "s/'/'\\\\''/g" \ + -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' + ;; + esac >> confcache if cmp -s $cache_file confcache; then : else @@ -1347,7 +1751,7 @@ do echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; -version | --version | --versio | --versi | --vers | --ver | --ve | --v) - echo "$CONFIG_STATUS generated by autoconf version 2.10" + echo "$CONFIG_STATUS generated by autoconf version 2.12" exit 0 ;; -help | --help | --hel | --he | --h) echo "\$ac_cs_usage"; exit 0 ;; @@ -1416,24 +1820,65 @@ s%@sim_cflags@%$sim_cflags%g s%@sim_debug@%$sim_debug%g s%@sim_stdio@%$sim_stdio%g s%@sim_trace@%$sim_trace%g +s%@sim_profile@%$sim_profile%g +s%@sim_inline@%$sim_inline%g +s%@sim_endian@%$sim_endian%g +s%@sim_hostendian@%$sim_hostendian%g +s%@sim_warnings@%$sim_warnings%g s%@SIMCONF@%$SIMCONF%g CEOF EOF + +cat >> $CONFIG_STATUS <<\EOF + +# Split the substitutions into bite-sized pieces for seds with +# small command number limits, like on Digital OSF/1 and HP-UX. +ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. +ac_file=1 # Number of current file. +ac_beg=1 # First line for current file. +ac_end=$ac_max_sed_cmds # Line after last line for current file. +ac_more_lines=: +ac_sed_cmds="" +while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file + else + sed "${ac_end}q" conftest.subs > conftest.s$ac_file + fi + if test ! -s conftest.s$ac_file; then + ac_more_lines=false + rm -f conftest.s$ac_file + else + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f conftest.s$ac_file" + else + ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" + fi + ac_file=`expr $ac_file + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_cmds` + fi +done +if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat +fi +EOF + cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then - # Support "outfile[:infile]", defaulting infile="outfile.in". + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case "$ac_file" in - *:*) ac_file_in=`echo "$ac_file"|sed 's%.*:%%'` + *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; *) ac_file_in="${ac_file}.in" ;; esac - # Adjust relative srcdir, etc. for subdirectories. + # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. # Remove last slash and all that follows it. Not all systems have dirname. ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` @@ -1461,6 +1906,7 @@ for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then [/$]*) INSTALL="$ac_given_INSTALL" ;; *) INSTALL="$ac_dots$ac_given_INSTALL" ;; esac + echo creating "$ac_file" rm -f "$ac_file" configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." @@ -1469,14 +1915,16 @@ for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then # $configure_input" ;; *) ac_comsub= ;; esac + + ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` sed -e "$ac_comsub s%@configure_input@%$configure_input%g s%@srcdir@%$srcdir%g s%@top_srcdir@%$top_srcdir%g s%@INSTALL@%$INSTALL%g -" -f conftest.subs $ac_given_srcdir/$ac_file_in > $ac_file +" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file fi; done -rm -f conftest.subs +rm -f conftest.s* # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where # NAME is the cpp macro being defined and VALUE is the value it is being given. @@ -1497,11 +1945,17 @@ ac_eB='$%\1#\2define\3' ac_eC=' ' ac_eD='%g' -CONFIG_HEADERS=${CONFIG_HEADERS-"config.h:config.in"} +if test "${CONFIG_HEADERS+set}" != set; then +EOF +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF +fi for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then - # Support "outfile[:infile]", defaulting infile="outfile.in". + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case "$ac_file" in - *:*) ac_file_in=`echo "$ac_file"|sed 's%.*:%%'` + *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; *) ac_file_in="${ac_file}.in" ;; esac @@ -1509,7 +1963,8 @@ for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then echo creating $ac_file rm -f conftest.frag conftest.in conftest.out - cp $ac_given_srcdir/$ac_file_in conftest.in + ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` + cat $ac_file_inputs > conftest.in EOF @@ -1537,8 +1992,6 @@ EOF # Break up conftest.vals because some shells have a limit on # the size of here documents, and old seds have small limits too. -# Maximum number of lines to put in a single here document. -ac_max_here_lines=12 rm -f conftest.tail while : @@ -1625,7 +2078,11 @@ while test -n "$ac_sources"; do { echo "configure: error: can not link $ac_dest to $srcdir/$ac_source" 1>&2; exit 1; } fi done +EOF +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF case "x$CONFIG_FILES" in xMakefile*) echo "Merging Makefile.sim+Make-common.sim into Makefile ..." rm -f Makesim1.tmp Makesim2.tmp Makefile diff --git a/sim/mips/gencode.c b/sim/mips/gencode.c index 5e4563d..6ef01bf 100644 --- a/sim/mips/gencode.c +++ b/sim/mips/gencode.c @@ -3927,9 +3927,6 @@ build_instruction (doisa, features, mips16, insn) printf(" signed64 t = ((unsigned64)HI_UW(0) << 32) | (unsigned64)LO_UW(0);\n"); printf(" signed64 u = ((unsigned64)HI_UW(2) << 32) | (unsigned64)LO_UW(2);\n"); printf(" signed64 x000000007FFFFFFF = LSMASK64 (31);\n"); - printf(" signed64 xFFFFFFFF80000000 = MSMASK64 (33);\n"); - printf(" signed64 x7FFFFFFFFFFFFFFF = LSMASK64 (63);\n"); - printf(" signed64 x8000000000000000 = MSMASK64 (1);\n"); printf(" signed64 x0000000080000000 = x000000007FFFFFFF + 1;\n"); printf(" signed64 minus0000000080000000 = -x0000000080000000;\n"); printf(" if ( t > x000000007FFFFFFF )\n"); diff --git a/sim/mips/interp.c b/sim/mips/interp.c index 1736ad7..3d68eb4 100644 --- a/sim/mips/interp.c +++ b/sim/mips/interp.c @@ -283,7 +283,14 @@ SUB_REG_FETCH - return as lvalue some sub-part of a "register" A - low part of "register" A1 - high part of register */ -#define SUB_REG_FETCH(T,TC,A,A1,I) (*(((T*)(((I) < (TC)) ? (A) : (A1))) + ((I) % (TC)))) +#define SUB_REG_FETCH(T,TC,A,A1,I) \ +(*(((I) < (TC) ? (T*)(A) : (T*)(A1)) \ + + (CURRENT_HOST_BYTE_ORDER == BIG_ENDIAN \ + ? ((TC) - 1 - (I) % (TC)) \ + : ((I) % (TC)) \ + ) \ + ) \ + ) /* GPR_(R,I) - return, as lvalue, the I'th of general register R @@ -292,18 +299,16 @@ GPR_(R,I) - return, as lvalue, the I'th of general register R 2 is B=byte H=halfword W=word D=doubleword */ -#define SUB_REG_SB(A,A1,I) SUB_REG_FETCH(signed char, BYTES_IN_MIPS_REGS, A, A1, I) -#define SUB_REG_SH(A,A1,I) SUB_REG_FETCH(signed short, HALFWORDS_IN_MIPS_REGS, A, A1, I) -#define SUB_REG_SW(A,A1,I) SUB_REG_FETCH(signed int, WORDS_IN_MIPS_REGS, A, A1, I) -#define SUB_REG_SD(A,A1,I) SUB_REG_FETCH(signed long long, DOUBLEWORDS_IN_MIPS_REGS, A, A1, I) - -#define SUB_REG_UB(A,A1,I) SUB_REG_FETCH(unsigned char, BYTES_IN_MIPS_REGS, A, A1, I) -#define SUB_REG_UH(A,A1,I) SUB_REG_FETCH(unsigned short, HALFWORDS_IN_MIPS_REGS, A, A1, I) -#define SUB_REG_UW(A,A1,I) SUB_REG_FETCH(unsigned int, WORDS_IN_MIPS_REGS, A, A1, I) -#define SUB_REG_UD(A,A1,I) SUB_REG_FETCH(unsigned long long,DOUBLEWORDS_IN_MIPS_REGS, A, A1, I) - - +#define SUB_REG_SB(A,A1,I) SUB_REG_FETCH(signed8, BYTES_IN_MIPS_REGS, A, A1, I) +#define SUB_REG_SH(A,A1,I) SUB_REG_FETCH(signed16, HALFWORDS_IN_MIPS_REGS, A, A1, I) +#define SUB_REG_SW(A,A1,I) SUB_REG_FETCH(signed32, WORDS_IN_MIPS_REGS, A, A1, I) +#define SUB_REG_SD(A,A1,I) SUB_REG_FETCH(signed64, DOUBLEWORDS_IN_MIPS_REGS, A, A1, I) +#define SUB_REG_UB(A,A1,I) SUB_REG_FETCH(unsigned8, BYTES_IN_MIPS_REGS, A, A1, I) +#define SUB_REG_UH(A,A1,I) SUB_REG_FETCH(unsigned16, HALFWORDS_IN_MIPS_REGS, A, A1, I) +#define SUB_REG_UW(A,A1,I) SUB_REG_FETCH(unsigned32, WORDS_IN_MIPS_REGS, A, A1, I) +#define SUB_REG_UD(A,A1,I) SUB_REG_FETCH(unsigned64, DOUBLEWORDS_IN_MIPS_REGS, A, A1, I) + #define GPR_SB(R,I) SUB_REG_SB(®isters[R], ®isters1[R], I) #define GPR_SH(R,I) SUB_REG_SH(®isters[R], ®isters1[R], I) #define GPR_SW(R,I) SUB_REG_SW(®isters[R], ®isters1[R], I) @@ -769,9 +774,10 @@ interrupt_event (SIM_DESC sd, void *data) /*---------------------------------------------------------------------------*/ SIM_DESC -sim_open (kind,cb,argv) +sim_open (kind, cb, abfd, argv) SIM_OPEN_KIND kind; host_callback *cb; + struct _bfd *abfd; char **argv; { SIM_DESC sd = &simulator; @@ -814,6 +820,14 @@ sim_open (kind,cb,argv) return 0; } + /* Configure/verify the target byte order and other runtime + configuration options */ + if (sim_config (sd, abfd) != SIM_RC_OK) + { + sim_module_uninstall (sd); + return 0; + } + if (sim_post_argv_init (sd) != SIM_RC_OK) { /* Uninstall the modules to avoid memory leaks, @@ -1315,10 +1329,6 @@ sim_load (sd,prog,abfd,from_tty) return SIM_RC_FAIL; sim_analyze_program (sd, prog_bfd); - /* Configure/verify the target byte order and other runtime - configuration options */ - sim_config (sd, PREFERED_TARGET_BYTE_ORDER(prog_bfd)); - /* (re) Write the monitor trap address handlers into the monitor (eeprom) address space. This can only be done once the target endianness has been determined. */ diff --git a/sim/mn10300/ChangeLog b/sim/mn10300/ChangeLog index 8fb9861..eb0a337 100644 --- a/sim/mn10300/ChangeLog +++ b/sim/mn10300/ChangeLog @@ -1,3 +1,20 @@ +Mon Aug 25 17:50:22 1997 Andrew Cagney + + * configure: Regenerated to track ../common/aclocal.m4 changes. + * config.in: Ditto. + +Mon Aug 25 16:14:44 1997 Andrew Cagney + + * interp.c (sim_open): Add ABFD argument. + +Tue Jun 24 13:46:20 1997 Jeffrey A Law (law@cygnus.com) + + * interp.c (sim_resume): Clear State.exited. + (sim_stop_reason): If State.exited is nonzero, then indicate that + the simulator exited instead of stopped. + * mn10300_sim.h (struct _state): Add exited field. + * simops.c (syscall): Set State.exited for SYS_exit. + Wed Jun 11 22:07:56 1997 Jeffrey A Law (law@cygnus.com) * simops.c: Fix thinko in last change. diff --git a/sim/mn10300/interp.c b/sim/mn10300/interp.c index 997b032..2246d75 100644 --- a/sim/mn10300/interp.c +++ b/sim/mn10300/interp.c @@ -284,9 +284,10 @@ compare_simops (arg1, arg2) } SIM_DESC -sim_open (kind,cb,argv) +sim_open (kind, cb, abfd, argv) SIM_OPEN_KIND kind; host_callback *cb; + struct _bfd *abfd; char **argv; { struct simops *s; @@ -331,7 +332,7 @@ sim_open (kind,cb,argv) if (h->opcode == s->opcode && h->mask == s->mask && h->ops == s) - continue; + break; else h = h->next; } @@ -404,6 +405,8 @@ sim_resume (sd, step, siggnal) else State.exception = 0; + State.exited = 0; + do { unsigned long insn, extension; @@ -854,7 +857,10 @@ sim_stop_reason (sd, reason, sigrc) enum sim_stop *reason; int *sigrc; { - *reason = sim_stopped; + if (State.exited) + *reason = sim_exited; + else + *reason = sim_stopped; if (State.exception == SIGQUIT) *sigrc = 0; else diff --git a/sim/ppc/ChangeLog b/sim/ppc/ChangeLog index 67b5217..eb7cfa6 100644 --- a/sim/ppc/ChangeLog +++ b/sim/ppc/ChangeLog @@ -1,7 +1,46 @@ +Mon Aug 25 16:17:06 1997 Andrew Cagney + + * sim_calls.c (sim_open): Add ABFD argument. + +Thu Jul 3 10:18:06 1997 Andrew Cagney + + * ppc-instructions (PPC_INSN_INT): From Michael Thies - Monitoring + CR register updates dependant on RC value had logic backwards. + + * ppc-instructions (Load String Word Immediate): From Brad Parker + - sense of wrap test in check for overwriting RA wrong. + (Load String Word Indexed): Ditto. + + * configure.in: From Erik Landry - set sim_default_model not + sim_model for sim-default-model option. + * configure: Regenerate. + + * interrupts.c (check_masked_interrupts): Schedule a hardware + interrupt delivery when FP interrupts get enabled. + (program_interrupt): Generate FP exceptions instead of aborting. + (deliver_hardware_interrupt): Deliver a FP exception if so + enabled. + + * registers.h: Add definition of fpscr_vx_bits. + + * idecode_expression.h (FPSCR_END): Always update FEX and VX bits + in FPSCR. + (FPSCR_END): Explicitly check for possible floating point + exception conditions. + (FPSCR_BEGIN): Simplify. + + * ppc-instructions (Move From FPSCR): Enable. + (Move To FPSCR Bit 1): Ditto. + (Move To FPSCR Bit 0): Ditto. + (Move To FPSCR Field Immediate): Ditto. + (Move to Condition Register from FPSCR): Simplify. + (invalid_arithemetic_operation): Generate a QNaN when invalid + operation exception disabled. + Tue May 20 10:22:50 1997 Andrew Cagney * sim_calls.c (sim_open): Add callback argument. - (sim_set_callbacks): Delete SIM_DESC argument. + (sim_set_callbacks): Delete. Tue Apr 22 22:36:57 1997 Mike Meissner diff --git a/sim/ppc/sim_calls.c b/sim/ppc/sim_calls.c index f7d8803..1bee0df 100644 --- a/sim/ppc/sim_calls.c +++ b/sim/ppc/sim_calls.c @@ -51,13 +51,17 @@ static psim *simulator; static device *root_device; static const char *register_names[] = REGISTER_NAMES; +static host_callback *callbacks; /* For communication between sim_load and sim_create_inferior. This can be made to go away, please do. */ static unsigned_word entry_point; SIM_DESC -sim_open (SIM_OPEN_KIND kind, host_callback *callback, char **argv) +sim_open (SIM_OPEN_KIND kind, + host_callback *callback, + struct _bfd *abfd, + char **argv) { callbacks = callback; @@ -295,8 +299,6 @@ sim_do_command (SIM_DESC sd, char *cmd) advanced operations (such as dup or write) must either be mapped to one of the below calls or handled internally */ -static host_callback *callbacks; - int sim_io_read_stdin(char *buf, int sizeof_buf) @@ -384,13 +386,6 @@ sim_io_flush_stdoutput(void) } } -void -sim_set_callbacks (host_callback *callback) -{ - callbacks = callback; - TRACE(trace_gdb, ("sim_set_callbacks called\n")); -} - /****/ void * diff --git a/sim/sh/ChangeLog b/sim/sh/ChangeLog index dd0444f..17a24e6 100644 --- a/sim/sh/ChangeLog +++ b/sim/sh/ChangeLog @@ -1,3 +1,27 @@ +Mon Aug 25 17:50:22 1997 Andrew Cagney + + * configure: Regenerated to track ../common/aclocal.m4 changes. + * config.in: Ditto. + +Mon Aug 25 16:17:51 1997 Andrew Cagney + + * interp.c (sim_open): Add ABFD argument. + +Tue May 20 10:23:28 1997 Andrew Cagney + + * interp.c (sim_open): Add callback argument. + (sim_set_callbacks): Delete SIM_DESC argument. + +Wed Apr 30 11:38:08 1997 Doug Evans + + * Makefile.in (SIM_EXTRA_CLEAN): Define. + (clean targets): Delete. + (sh-clean): New target. + +Thu Apr 24 00:39:51 1997 Doug Evans + + * configure: Regenerated to track ../common/aclocal.m4 changes. + Wed Apr 23 17:55:22 1997 Doug Evans * tconfig.in: New file. diff --git a/sim/sh/interp.c b/sim/sh/interp.c index 97c95dc..37e4487 100644 --- a/sim/sh/interp.c +++ b/sim/sh/interp.c @@ -1173,19 +1173,32 @@ sim_set_profile_size (n) } SIM_DESC -sim_open (kind,argv) +sim_open (kind, cb, abfd, argv) SIM_OPEN_KIND kind; + host_callback *cb; + struct _bfd *abfd; char **argv; { char **p; sim_kind = kind; myname = argv[0]; + callback = cb; for (p = argv + 1; *p != NULL; ++p) { if (strcmp (*p, "-E") == 0) - little_endian_p = strcmp (*++p, "big") != 0; + { + ++p; + if (*p == NULL) + { + /* FIXME: This doesn't use stderr, but then the rest of the + file doesn't either. */ + callback->printf_filtered (callback, "Missing argument to `-E'.\n"); + return 0; + } + little_endian_p = strcmp (*p, "big") != 0; + } else if (isdigit (**p)) parse_and_set_memory_size (*p); } @@ -1282,8 +1295,7 @@ sim_do_command (sd, cmd) } void -sim_set_callbacks (sd, p) - SIM_DESC sd; +sim_set_callbacks (p) host_callback *p; { callback = p; diff --git a/sim/tic80/ChangeLog b/sim/tic80/ChangeLog index 5b92c84..f4105b5 100644 --- a/sim/tic80/ChangeLog +++ b/sim/tic80/ChangeLog @@ -1,3 +1,14 @@ +Mon Aug 25 17:50:22 1997 Andrew Cagney + + * configure: Regenerated to track ../common/aclocal.m4 changes. + * config.in: Ditto. + +Mon Aug 25 16:33:29 1997 Andrew Cagney + + * sim-calls.c (sim_open): Add ABFD argument. + (sim_open): Move sim_config call to just after argument + parsing. Check return status. + Fri Aug 8 21:52:27 1997 Mark Alexander * sim-calls.c (sim_store_register): Allow accumulators diff --git a/sim/tic80/configure b/sim/tic80/configure index 2b8e6ea..db70f43 100755 --- a/sim/tic80/configure +++ b/sim/tic80/configure @@ -1341,19 +1341,27 @@ fi +wire_endian="LITTLE_ENDIAN" +default_endian="LITTLE_ENDIAN" default_sim_endian="-DWITH_TARGET_BYTE_ORDER=LITTLE_ENDIAN" # Check whether --enable-sim-endian or --disable-sim-endian was given. if test "${enable_sim_endian+set}" = set; then enableval="$enable_sim_endian" case "${enableval}" in - yes) case "$target" in - *powerpc-*) sim_endian="-DWITH_TARGET_BYTE_ORDER=BIG_ENDIAN";; - *powerpcle-*) sim_endian="-DWITH_TARGET_BYTE_ORDER=LITTLE_ENDIAN";; - *) echo "Unknown target $target" 1>&6; sim_endian="-DWITH_TARGET_BYTE_ORDER=0";; - esac;; - no) sim_endian="-DWITH_TARGET_BYTE_ORDER=0";; b*|B*) sim_endian="-DWITH_TARGET_BYTE_ORDER=BIG_ENDIAN";; l*|L*) sim_endian="-DWITH_TARGET_BYTE_ORDER=LITTLE_ENDIAN";; + yes) if test x"$wire_endian" != x; then + sim_endian="-DWITH_TARGET_BYTE_ORDER=${wire_endian}" + else + echo "No hard-wired endian for target $target" 1>&6 + sim_endian="-DWITH_TARGET_BYTE_ORDER=0" + fi;; + no) if test x"$default_endian" != x; then + sim_endian="-DWITH_DEFAULT_TARGET_BYTE_ORDER=${default_endian}" + else + echo "No default endian for target $target" 1>&6 + sim_endian="-DWITH_DEFAULT_TARGET_BYTE_ORDER=0" + fi;; *) { echo "configure: error: "Unknown value $enableval for --enable-sim-endian"" 1>&2; exit 1; }; sim_endian="";; esac if test x"$silent" != x"yes" && test x"$sim_endian" != x""; then @@ -1399,14 +1407,14 @@ else if test "x$cross_compiling" = "xno"; then echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6 -echo "configure:1403: checking whether byte ordering is bigendian" >&5 +echo "configure:1411: checking whether byte ordering is bigendian" >&5 if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_c_bigendian=unknown # See if sys/param.h defines the BYTE_ORDER macro. cat > conftest.$ac_ext < #include @@ -1417,11 +1425,11 @@ int main() { #endif ; return 0; } EOF -if { (eval echo configure:1421: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1429: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* # It does; now see whether it defined to BIG_ENDIAN or not. cat > conftest.$ac_ext < #include @@ -1432,7 +1440,7 @@ int main() { #endif ; return 0; } EOF -if { (eval echo configure:1436: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1444: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_bigendian=yes else @@ -1452,7 +1460,7 @@ if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1477: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_c_bigendian=no else @@ -1539,17 +1547,17 @@ for ac_hdr in stdlib.h unistd.h string.h strings.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:1543: checking for $ac_hdr" >&5 +echo "configure:1551: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1553: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1561: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -1578,12 +1586,12 @@ done for ac_func in getpid kill do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1582: checking for $ac_func" >&5 +echo "configure:1590: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1618: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else diff --git a/sim/tic80/sim-calls.c b/sim/tic80/sim-calls.c index 8f609ee..60659b92 100644 --- a/sim/tic80/sim-calls.c +++ b/sim/tic80/sim-calls.c @@ -52,6 +52,7 @@ struct sim_state simulation = { 0 }; SIM_DESC sim_open (SIM_OPEN_KIND kind, host_callback *callback, + struct _bfd *abfd, char **argv) { SIM_DESC sd = &simulation; @@ -73,6 +74,13 @@ sim_open (SIM_OPEN_KIND kind, return 0; } + /* establish the simulator configuration */ + if (sim_config (sd, abfd) != SIM_RC_OK) + { + sim_module_uninstall (sd); + return 0; + } + if (sim_post_argv_init (sd) != SIM_RC_OK) { /* Uninstall the modules to avoid memory leaks, @@ -89,9 +97,6 @@ sim_open (SIM_OPEN_KIND kind, memset (&STATE_CPU (sd, 0)->cia, 0, sizeof STATE_CPU (sd, 0)->cia); CPU_STATE (STATE_CPU (sd, 0)) = sd; - /* establish the simulator configuration */ - sim_config (sd, LITTLE_ENDIAN/*d30v always big endian*/); - #define TIC80_MEM_START 0x2000000 #define TIC80_MEM_SIZE 0x100000 diff --git a/sim/v850/ChangeLog b/sim/v850/ChangeLog index 56a69a5..f022d15 100644 --- a/sim/v850/ChangeLog +++ b/sim/v850/ChangeLog @@ -1,3 +1,12 @@ +Mon Aug 25 17:50:22 1997 Andrew Cagney + + * configure: Regenerated to track ../common/aclocal.m4 changes. + * config.in: Ditto. + +Mon Aug 25 11:31:23 1997 Andrew Cagney + + * interp.c (sim_open): Add ABFD argument. + start-sanitize-v850e Fri Aug 22 10:39:28 1997 Nick Clifton diff --git a/sim/v850/interp.c b/sim/v850/interp.c index da1cfd8..bbc29f1 100644 --- a/sim/v850/interp.c +++ b/sim/v850/interp.c @@ -76,6 +76,10 @@ host_callback *v850_callback; int v850_debug; +/* non-zero if we opened prog_bfd */ +static int prog_bfd_was_opened_p; +bfd *prog_bfd; + static SIM_OPEN_KIND sim_kind; static char *myname; @@ -110,7 +114,7 @@ static INLINE long hash(insn) long insn; { - if ((insn & 0x0600) == 0 + if ( (insn & 0x0600) == 0 || (insn & 0x0700) == 0x0200 || (insn & 0x0700) == 0x0600 || (insn & 0x0780) == 0x0700) @@ -234,6 +238,8 @@ map (addr) } else { + fprintf (stderr, "segmentation fault: access address: %x not below %x or above %x [ep = %x]\n", addr, low_end, high_start, State.regs[30]); + /* Signal a memory error. */ State.exception = SIGSEGV; /* Point to a location not in main memory - renders invalid @@ -290,104 +296,6 @@ store_mem (addr, len, data) } } -static void -do_format_1_2 (insn) - uint32 insn; -{ - struct hash_entry *h; - - h = lookup_hash (insn); - OP[0] = insn & 0x1f; - OP[1] = (insn >> 11) & 0x1f; - (h->ops->func) (); -} - -static void -do_format_3 (insn) - uint32 insn; -{ - struct hash_entry *h; - - h = lookup_hash (insn); - OP[0] = (((insn & 0x70) >> 4) | ((insn & 0xf800) >> 8)) << 1; - (h->ops->func) (); -} - -static void -do_format_4 (insn) - uint32 insn; -{ - struct hash_entry *h; - - h = lookup_hash (insn); - OP[0] = (insn >> 11) & 0x1f; - OP[1] = (insn & 0x7f); - (h->ops->func) (); -} - -static void -do_format_5 (insn) - uint32 insn; -{ - struct hash_entry *h; - - h = lookup_hash (insn); - OP[0] = (((insn & 0x3f) << 15) | ((insn >> 17) & 0x7fff)) << 1; - OP[1] = (insn >> 11) & 0x1f; - (h->ops->func) (); -} - -static void -do_format_6 (insn) - uint32 insn; -{ - struct hash_entry *h; - - h = lookup_hash (insn); - OP[0] = (insn >> 16) & 0xffff; - OP[1] = insn & 0x1f; - OP[2] = (insn >> 11) & 0x1f; - (h->ops->func) (); -} - -static void -do_format_7 (insn) - uint32 insn; -{ - struct hash_entry *h; - - h = lookup_hash (insn); - OP[0] = insn & 0x1f; - OP[1] = (insn >> 11) & 0x1f; - OP[2] = (insn >> 16) & 0xffff; - (h->ops->func) (); -} - -static void -do_format_8 (insn) - uint32 insn; -{ - struct hash_entry *h; - - h = lookup_hash (insn); - OP[0] = insn & 0x1f; - OP[1] = (insn >> 11) & 0x7; - OP[2] = (insn >> 16) & 0xffff; - (h->ops->func) (); -} - -static void -do_format_9_10 (insn) - uint32 insn; -{ - struct hash_entry *h; - - h = lookup_hash (insn); - OP[0] = insn & 0x1f; - OP[1] = (insn >> 11) & 0x1f; - (h->ops->func) (); -} - void sim_size (power) int power; @@ -494,8 +402,10 @@ sim_write (sd, addr, buffer, size) } SIM_DESC -sim_open (kind,argv) +sim_open (kind, cb, abfd, argv) SIM_OPEN_KIND kind; + host_callback *cb; + struct _bfd *abfd; char **argv; { struct simops *s; @@ -504,18 +414,19 @@ sim_open (kind,argv) sim_kind = kind; myname = argv[0]; + v850_callback = cb; - for (p = argv + 1; *p; ++p) + if (argv != NULL) { - if (strcmp (*p, "-E") == 0) - ++p; /* ignore endian spec */ - else + for (p = argv + 1; *p; ++p) + { #ifdef DEBUG - if (strcmp (*p, "-t") == 0) - v850_debug = DEBUG; - else + if (strcmp (*p, "-t") == 0) + v850_debug = DEBUG; + else #endif - (*v850_callback->printf_filtered) (v850_callback, "ERROR: unsupported option(s): %s\n",*p); + (*v850_callback->printf_filtered) (v850_callback, "ERROR: unsupported option(s): %s\n",*p); + } } /* put all the opcodes in the hash table */ @@ -547,7 +458,8 @@ sim_close (sd, quitting) SIM_DESC sd; int quitting; { - /* nothing to do */ + if (prog_bfd != NULL && prog_bfd_was_opened_p) + bfd_close (prog_bfd); } void @@ -594,58 +506,33 @@ sim_resume (sd, step, siggnal) do { + struct hash_entry * h; /* Fetch the current instruction. */ - inst = RLW (PC); + inst = RLW (PC); oldpc = PC; - opcode = (inst & 0x07e0) >> 5; - /* Decode the opcode field. */ - if ((opcode & 0x30) == 0 - || (opcode & 0x38) == 0x10) - { - do_format_1_2 (inst & 0xffff); - PC += 2; - } - else if ((opcode & 0x3C) == 0x18 - || (opcode & 0x3C) == 0x1C - || (opcode & 0x3C) == 0x20 - || (opcode & 0x3C) == 0x24 - || (opcode & 0x3C) == 0x28) - { - do_format_4 (inst & 0xffff); - PC += 2; - } - else if ((opcode & 0x3C) == 0x2C) - { - do_format_3 (inst & 0xffff); - /* No PC update, it's done in the instruction. */ - } - else if ((opcode & 0x38) == 0x30) - { - do_format_6 (inst); - PC += 4; - } - else if ((opcode & 0x3C) == 0x38) - { - do_format_7 (inst); - PC += 4; - } - else if ((opcode & 0x3E) == 0x3C) - { - do_format_5 (inst); - /* No PC update, it's done in the instruction. */ - } - else if ((opcode & 0x3F) == 0x3E) + h = lookup_hash (inst); + OP[0] = inst & 0x1f; + OP[1] = (inst >> 11) & 0x1f; + OP[2] = (inst >> 16) & 0xffff; + OP[3] = inst; + +// fprintf (stderr, "PC = %x, SP = %x\n", PC, SP ); + + if (inst == 0) { - do_format_8 (inst); - PC += 4; + fprintf (stderr, "NOP encountered!\n"); + break; } - else + + PC += h->ops->func (); + + if (oldpc == PC) { - do_format_9_10 (inst); - PC += 4; + fprintf (stderr, "simulator loop at %x\n", PC ); + break; } - + /* Check for and handle pending interrupts. */ if (intgen_list && (have_nm_generator || !(PSW & PSW_ID))) { @@ -792,8 +679,7 @@ sim_kill (sd) } void -sim_set_callbacks (sd, p) - SIM_DESC sd; +sim_set_callbacks (p) host_callback *p; { v850_callback = p; @@ -1031,14 +917,14 @@ sim_load (sd, prog, abfd, from_tty) int from_tty; { extern bfd *sim_load_file (); /* ??? Don't know where this should live. */ - bfd *prog_bfd; + if (prog_bfd != NULL && prog_bfd_was_opened_p) + bfd_close (prog_bfd); prog_bfd = sim_load_file (sd, myname, v850_callback, prog, abfd, sim_kind == SIM_OPEN_DEBUG); if (prog_bfd == NULL) return SIM_RC_FAIL; PC = bfd_get_start_address (prog_bfd); - if (abfd == NULL) - bfd_close (prog_bfd); + prog_bfd_was_opened_p = abfd == NULL; return SIM_RC_OK; } diff --git a/sim/w65/ChangeLog b/sim/w65/ChangeLog index 0be0da3..f2d9304 100644 --- a/sim/w65/ChangeLog +++ b/sim/w65/ChangeLog @@ -1,3 +1,7 @@ +Mon Aug 25 16:34:33 1997 Andrew Cagney + + * interp.c (sim_open): Add ABFD argument. Change ARGV to PARGV. + Tue May 20 10:24:54 1997 Andrew Cagney * interp.c (sim_open): Add callback argument. diff --git a/sim/w65/interp.c b/sim/w65/interp.c index 70e7b47..54af071 100644 --- a/sim/w65/interp.c +++ b/sim/w65/interp.c @@ -322,9 +322,10 @@ sim_kill () } void -sim_open (kind,cb,argv) +sim_open (kind, cb, abfd, argv) SIM_OPEN_KIND kind; host_callback *cb; + struct _bfd *abfd; char **argv; { } -- cgit v1.1