diff options
author | Andrew Cagney <cagney@redhat.com> | 2004-11-12 16:45:32 +0000 |
---|---|---|
committer | Andrew Cagney <cagney@redhat.com> | 2004-11-12 16:45:32 +0000 |
commit | c46ec85da270994b50ccc5c8de0f1751cf3a0683 (patch) | |
tree | a5941765ceb8c03216c7a82f0a9f92c02b368a39 /sim/z8k | |
parent | 4fab48b9c48377889af365990e148954c3343287 (diff) | |
download | gdb-c46ec85da270994b50ccc5c8de0f1751cf3a0683.zip gdb-c46ec85da270994b50ccc5c8de0f1751cf3a0683.tar.gz gdb-c46ec85da270994b50ccc5c8de0f1751cf3a0683.tar.bz2 |
2004-11-12 Andrew Cagney <cagney@gnu.org>
* d30v, fr30, mn10200, z8k: Delete directory.
Diffstat (limited to 'sim/z8k')
-rw-r--r-- | sim/z8k/ChangeLog | 514 | ||||
-rw-r--r-- | sim/z8k/Makefile.in | 63 | ||||
-rw-r--r-- | sim/z8k/acconfig.h | 15 | ||||
-rw-r--r-- | sim/z8k/comped1.c | 31 | ||||
-rw-r--r-- | sim/z8k/comped2.c | 25 | ||||
-rw-r--r-- | sim/z8k/comped3.c | 28 | ||||
-rw-r--r-- | sim/z8k/compedb3.c | 29 | ||||
-rw-r--r-- | sim/z8k/config.in | 161 | ||||
-rwxr-xr-x | sim/z8k/configure | 4024 | ||||
-rw-r--r-- | sim/z8k/configure.in | 10 | ||||
-rw-r--r-- | sim/z8k/iface.c | 263 | ||||
-rw-r--r-- | sim/z8k/inlines.h | 486 | ||||
-rw-r--r-- | sim/z8k/mem.c | 126 | ||||
-rw-r--r-- | sim/z8k/mem.h | 8 | ||||
-rw-r--r-- | sim/z8k/quick.c | 783 | ||||
-rw-r--r-- | sim/z8k/sim.h | 9 | ||||
-rw-r--r-- | sim/z8k/support.c | 784 | ||||
-rw-r--r-- | sim/z8k/syscall.h | 43 | ||||
-rw-r--r-- | sim/z8k/tconfig.in | 13 | ||||
-rw-r--r-- | sim/z8k/tm.h | 192 | ||||
-rw-r--r-- | sim/z8k/writecode.c | 1948 |
21 files changed, 0 insertions, 9555 deletions
diff --git a/sim/z8k/ChangeLog b/sim/z8k/ChangeLog deleted file mode 100644 index 1bc783b..0000000 --- a/sim/z8k/ChangeLog +++ /dev/null @@ -1,514 +0,0 @@ -2003-02-27 Andrew Cagney <cagney@redhat.com> - - * iface.c (sim_open, sim_create_inferior): Rename _bfd to bfd. - -2002-06-16 Andrew Cagney <ac131313@redhat.com> - - * configure: Regenerated to track ../common/aclocal.m4 changes. - -2002-06-09 Andrew Cagney <cagney@redhat.com> - - * iface.c: Include "gdb/callback.h" and "gdb/remote-sim.h". - * support.c: Ditto. - -2002-06-06 Andrew Cagney <ac131313@redhat.com> - - * writecode.c (lookup_inst): Generate inverse table on-the-fly. - (z8k_inv_list): Delete global. - (DIRTY_HACK): Delete macro. - (makelist): Delete global. - (main): Delete code making a list. Delete dirty hack code. Use - lookup_inst instead of z8k_inv_list. - * list.c: Delete file. - * Makefile.in (writecode): Do not link in list.o. - (list.o): Delete target. - -2002-04-29 Nick Clifton <nickc@cambridge.redhat.com> - - * writecode.c (lookup_inst): Ignore CLASS_IGNORE. - (info_args): Treat CLASS_IGNORE like CLASS_BIT. - Handle ARG_NIM4. - (info_len_in_words): Handle CLASS_IGNORE and ARG_NIM4. - -Tue May 23 21:39:23 2000 Andrew Cagney <cagney@b1.cygnus.com> - - * configure: Regenerated to track ../common/aclocal.m4 changes. - -Thu Sep 2 18:15:53 1999 Andrew Cagney <cagney@b1.cygnus.com> - - * configure: Regenerated to track ../common/aclocal.m4 changes. - -1999-05-08 Felix Lee <flee@cygnus.com> - - * configure: Regenerated to track ../common/aclocal.m4 changes. - -Wed Nov 25 18:22:10 1998 Andrew Cagney <cagney@b1.cygnus.com> - - * support.c: Include <errno.h> - -Tue Apr 28 18:33:31 1998 Geoffrey Noer <noer@cygnus.com> - - * configure: Regenerated to track ../common/aclocal.m4 changes. - -Sun Apr 26 15:31:55 1998 Tom Tromey <tromey@creche> - - * configure: Regenerated to track ../common/aclocal.m4 changes. - * config.in: Ditto. - -Sun Apr 26 15:18:45 1998 Tom Tromey <tromey@cygnus.com> - - * acconfig.h: New file. - * configure.in: Reverted change of Apr 24; use sinclude again. - -Fri Apr 24 14:16:40 1998 Tom Tromey <tromey@creche> - - * configure: Regenerated to track ../common/aclocal.m4 changes. - * config.in: Ditto. - -Fri Apr 24 11:17:28 1998 Tom Tromey <tromey@cygnus.com> - - * configure.in: Don't use sinclude. - -Sat Apr 4 20:36:25 1998 Andrew Cagney <cagney@b1.cygnus.com> - - * configure: Regenerated to track ../common/aclocal.m4 changes. - -Fri Mar 27 16:15:52 1998 Andrew Cagney <cagney@b1.cygnus.com> - - * configure: Regenerated to track ../common/aclocal.m4 changes. - -Wed Mar 25 12:35:29 1998 Andrew Cagney <cagney@b1.cygnus.com> - - * configure: Regenerated to track ../common/aclocal.m4 changes. - -Wed Mar 18 12:38:12 1998 Andrew Cagney <cagney@b1.cygnus.com> - - * configure: Regenerated to track ../common/aclocal.m4 changes. - -Tue Feb 17 12:54:05 1998 Andrew Cagney <cagney@b1.cygnus.com> - - * iface.c (sim_store_register, sim_fetch_register): Pass in length - parameter. Return -1. - -Sun Feb 1 16:47:51 1998 Andrew Cagney <cagney@b1.cygnus.com> - - * configure: Regenerated to track ../common/aclocal.m4 changes. - -Sat Jan 31 18:15:41 1998 Andrew Cagney <cagney@b1.cygnus.com> - - * configure: Regenerated to track ../common/aclocal.m4 changes. - -Mon Jan 19 22:26:29 1998 Doug Evans <devans@seba> - - * configure: Regenerated to track ../common/aclocal.m4 changes. - -Mon Dec 15 23:17:11 1997 Andrew Cagney <cagney@b1.cygnus.com> - - * configure: Regenerated to track ../common/aclocal.m4 changes. - * config.in: Ditto. - -Thu Dec 4 09:21:05 1997 Doug Evans <devans@canuck.cygnus.com> - - * configure: Regenerated to track ../common/aclocal.m4 changes. - -Wed Oct 22 14:43:00 1997 Andrew Cagney <cagney@b1.cygnus.com> - - * iface.c (sim_load): Pass lma_p and sim_write args to - sim_load_file. - -Fri Oct 3 09:28:00 1997 Andrew Cagney <cagney@b1.cygnus.com> - - * configure: Regenerated to track ../common/aclocal.m4 changes. - -Wed Sep 24 17:38:57 1997 Andrew Cagney <cagney@b1.cygnus.com> - - * configure: Regenerated to track ../common/aclocal.m4 changes. - -Tue Sep 23 11:04:38 1997 Andrew Cagney <cagney@b1.cygnus.com> - - * configure: Regenerated to track ../common/aclocal.m4 changes. - -Mon Sep 22 11:46:20 1997 Andrew Cagney <cagney@b1.cygnus.com> - - * configure: Regenerated to track ../common/aclocal.m4 changes. - -Fri Sep 19 17:45:25 1997 Andrew Cagney <cagney@b1.cygnus.com> - - * configure: Regenerated to track ../common/aclocal.m4 changes. - -Wed Sep 17 13:23:45 1997 Andrew Cagney <cagney@b1.cygnus.com> - - * Makefile.in (CONFIG_H): Use config.h from local directory. - -Mon Sep 15 17:36:15 1997 Andrew Cagney <cagney@b1.cygnus.com> - - * configure: Regenerated to track ../common/aclocal.m4 changes. - -Thu Sep 4 17:21:23 1997 Doug Evans <dje@seba> - - * configure: Regenerated to track ../common/aclocal.m4 changes. - -Wed Aug 27 18:13:22 1997 Andrew Cagney <cagney@b1.cygnus.com> - - * configure: Regenerated to track ../common/aclocal.m4 changes. - * config.in: Ditto. - -Tue Aug 26 10:43:33 1997 Andrew Cagney <cagney@b1.cygnus.com> - - * iface.c (sim_kill): Delete. - (sim_create_inferior): Add ABFD argument. - (sim_load): Move setting of PC from here. - (sim_create_inferior): To here. - (sim_open, sim_load): Add FIXME about need to move arch test to - sim_open. - -Mon Aug 25 17:50:22 1997 Andrew Cagney <cagney@b1.cygnus.com> - - * configure: Regenerated to track ../common/aclocal.m4 changes. - * config.in: Ditto. - -Mon Aug 25 16:36:10 1997 Andrew Cagney <cagney@b1.cygnus.com> - - * iface.c (sim_open): Add ABFD argument. Change ARGV to PARGV. - -Tue May 20 10:28:07 1997 Andrew Cagney <cagney@b1.cygnus.com> - - * iface.c (sim_set_callbacs): Delete SIM_DESC argument. - (sim_open): Add callback argument. - -Wed Apr 30 10:28:34 1997 Doug Evans <dje@canuck.cygnus.com> - - * iface.c (sim_load): Set sim_z8001_mode if bfd_mach_z8001. - * tconfig.in (SIM_PRE_LOAD): Delete, no longer used. - -Thu Apr 24 00:39:51 1997 Doug Evans <dje@canuck.cygnus.com> - - * configure: Regenerated to track ../common/aclocal.m4 changes. - -Fri Apr 18 14:18:06 1997 Andrew Cagney <cagney@b1.cygnus.com> - - * mem.h (Z8k_PAGE_SIZE): Rename from PAGE_SIZE. Is it used? - - * iface.c (sim_stop): New function. - (NULL): Define if not already. - -Thu Apr 17 03:54:23 1997 Doug Evans <dje@canuck.cygnus.com> - - * Makefile.in (SIM_OBJS): Add sim-load.o. - * iface.c: #include bfd.h. - (z8k_callback): New global. - (sim_kind, myname): New static locals. - (sim_open): Set sim_kind, myname. - (sim_load): Return SIM_RC. New arg abfd. Call sim_load_file to - load file into simulator. Set start address from bfd. - (sim_create_inferior): Return SIM_RC. Delete arg start_address. - (sim_set_callbacks): Set z8k_callback. - -Thu Apr 17 11:36:04 1997 Andrew Cagney <cagney@b1.cygnus.com> - - * tm.h (sim_trace) : Remove prototype - now in remote-sim.h - * support.c (sim_trace): Update. - -Mon Apr 7 15:45:02 1997 Andrew Cagney <cagney@kremvax.cygnus.com> - - * configure: Regenerated to track ../common/aclocal.m4 changes. - * config.in: Ditto. - -Wed Apr 2 15:06:28 1997 Doug Evans <dje@canuck.cygnus.com> - - * iface.c (sim_open): New arg `kind'. - - * configure: Regenerated to track ../common/aclocal.m4 changes. - -Wed Apr 2 14:34:19 1997 Andrew Cagney <cagney@kremvax.cygnus.com> - - * configure: Regenerated to track ../common/aclocal.m4 changes. - -Wed Mar 19 01:14:00 1997 Andrew Cagney <cagney@kremvax.cygnus.com> - - * configure: Regenerated to track ../common/aclocal.m4 changes. - -Mon Mar 17 15:10:07 1997 Andrew Cagney <cagney@kremvax.cygnus.com> - - * configure: Re-generate. - -Fri Mar 14 10:34:11 1997 Michael Meissner <meissner@cygnus.com> - - * configure: Regenerate to track ../common/aclocal.m4 changes. - -Thu Mar 13 13:02:08 1997 Doug Evans <dje@canuck.cygnus.com> - - * iface.c (sim_open): New SIM_DESC result. Argument is now - in argv form. - (other sim_*): New SIM_DESC argument. - -Tue Feb 4 13:33:30 1997 Doug Evans <dje@canuck.cygnus.com> - - * Makefile.in (@COMMON_MAKEFILE_FRAG): Use - COMMON_{PRE,POST}_CONFIG_FRAG instead. - * configure.in: sinclude ../common/aclocal.m4. - * configure: Regenerated. - -Thu Jan 23 11:46:23 1997 Stu Grossman (grossman@critters.cygnus.com) - - * configure configure.in Makefile.in: Update to new configure - scheme which is more compatible with WinGDB builds. - * configure.in: Improve comment on how to run autoconf. - * configure: Re-run autoconf to get new ../common/aclocal.m4. - * Makefile.in: Use autoconf substitution to install common - makefile fragment. - -Wed Nov 20 02:28:21 1996 Doug Evans <dje@canuck.cygnus.com> - - * Makefile.in: Delete stuff moved to ../common/Make-common.in. - (SIM_OBJS,SIM_EXTRA_CFLAGS,SIM_EXTRA_CLEAN): Define. - * configure.in: Simplify using macros in ../common/aclocal.m4. - * configure: Regenerated. - * iface.c (sim_size): New function. - (sim_stop_reason): Properly set sim_exited return code. - * support.c: #include "callback.h". - * run.c: Deleted, using one in ../common now. - * tconfig.in: New file. - -Thu Oct 3 16:19:07 1996 Jason Molenda (crash@godzilla.cygnus.co.jp) - - * Makefile.in (mostlyclean): Don't remove config.log here. - -Wed Jun 26 12:32:29 1996 Jason Molenda (crash@godzilla.cygnus.co.jp) - - * Makefile.in (bindir, libdir, datadir, mandir, infodir, includedir, - INSTALL_PROGRAM, INSTALL_DATA): Use autoconf-set values. - (docdir): Removed. - * configure.in (AC_PREREQ): autoconf 2.5 or higher. - (AC_PROG_INSTALL): Added. - * configure: Rebuilt. - -Wed Feb 21 12:17:27 1996 Ian Lance Taylor <ian@cygnus.com> - - * configure: Regenerate with autoconf 2.7. - -Thu Jan 11 16:59:07 1996 Jim Wilson <wilson@chestnut.cygnus.com> - - * writecode.c (info_args, case CLASS_DISP8): Sign extend using - shifts instead of char cast. - (shift): Likewise. - -Fri Jan 5 15:36:26 1996 Jim Wilson <wilson@chestnut.cygnus.com> - - * mem.c (get_page_and_offset): Allocate 16MB not 8MB. - -Fri Oct 13 15:02:45 1995 steve chamberlain <sac@slash.cygnus.com> - - * iface.c (sim_set_callbacks): New. - -Tue Oct 10 11:13:55 1995 Fred Fish <fnf@cygnus.com> - - * Makefile.in (BISON): Remove macro. - -Wed Sep 20 13:35:35 1995 Ian Lance Taylor <ian@cygnus.com> - - * Makefile.in (maintainer-clean): New synonym for realclean. - -Fri Sep 8 13:16:10 1995 Ian Lance Taylor <ian@cygnus.com> - - * Makefile.in (install): Don't install in $(tooldir). - - * configure.in: Call AC_CONFIG_HEADER. Don't try to use - bfd/hosts/*.h file or bfd/config/*.mh file. Call AC_PROG_CC and - AC_PROG_RANLIB. Substitute in values for CFLAGS, HDEFINES, AR, - and CC_FOR_BUILD. Call AC_CHECK_HEADERS for various header files. - Touch stamp.h if creating config.h. - * configure: Rebuild. - * config.in: New file, created by autoheader. - * Makefile.in (AR): Define as @AR@. - (CC): New variable, defined as @CC@. - (CFLAGS): Define as @CFLAGS@. - (CC_FOR_BUILD): New variable, defined as @CC_FOR_BUILD@. - (RANLIB): Define as @RANLIB@. - (HDEFINES, TDEFINES): New variables. - (@host_makefile_frag@): Remove. - (support.o, comped1.o, comped3.o): Depend upon config.h. - (compedb3.o, comped2.o): Likewise. - (mem.o): New target. - (tc-gen2.h): Depend upon writecode, not quick.c. - (writecode): Build using $(CC_FOR_BUILD). - (writecode.o, list.o, quick.o): New targets. - (mostlyclean): Make the same as clean, not distclean. - (clean): Remove config.log. - (distclean): Remove config.h and stamp-h. - (Makefile): Don't depend upon @frags@. Just rebuild Makefile when - invoking config.status. - (config.h, stamp-h): New targets. - * comped1.c: Don't include "sysdep.h". - (INLINE): Define as inline, not static inline. - * comped3.c, compedb3.c, run.c: Don't include "sysdep.h". - * mem.c: Include "config.h". Don't include "sysdep.h". Include - <stdlib.h> if it exists. - * support.c: Include "config.h". Don't include "sysdep.h". - Include <stdio.h>. Include <time.h> and <sys/times.h> if they - exists. Include <sys/types.h> and <sys/stat.h>. - (get_now): Only use times if <sys/times.h> exists; otherwise use - time. - * writecode.c: Include "config.h". Include <stdio.h>. Include - <stdlib.h> and <string.h> if they exist. Include <strings.h> if - it exists and <string.h> does not. - -Thu Aug 3 10:45:37 1995 Fred Fish <fnf@cygnus.com> - - * Update all FSF addresses except those in COPYING* files. - -Mon Jul 31 10:18:06 1995 steve chamberlain <sac@slash.cygnus.com> - - * support.c (normal_flags_16): Calculate carry correctly. - (support_call): Return values in std regs too. - -Fri Jul 28 12:10:06 1995 steve chamberlain <sac@slash.cygnus.com> - - * inlines.h (put_byte_mem_da): Moved. - * run.c (main): Return program result. - * support.c (support_call): Return exit argument. - * writecode.c (rotate): Fix a load of bugs. - (info_decode): Insert missing break after OPC_rrc. - -Wed Jul 5 16:13:43 1995 J.T. Conklin <jtc@rtl.cygnus.com> - - * Makefile.in, configure.in: converted to autoconf. - * configure: New file, generated with autconf 2.4. - - * z8k.mt: Removed. - -Fri Jun 30 16:53:09 1995 Stan Shebs <shebs@andros.cygnus.com> - - * iface.c (sim_do_command): New function. - -Wed May 24 16:31:38 1995 Jim Wilson <wilson@chestnut.cygnus.com> - - * configure.in: Fix typo in last change. - -Mon Mar 27 10:32:34 1995 J.T. Conklin <jtc@rtl.cygnus.com> - - * run.c: parse arguments with getopt(). - -Tue Feb 28 17:31:00 1995 Ian Lance Taylor <ian@cygnus.com> - - * configure.in: Use ../../bfd/hosts/std-host.h if specific - host unavailable. - -Sun Feb 12 16:03:29 1995 Steve Chamberlain <sac@splat> - - * iface.c (sim_stop_reason): (Make a bad syscall give a SIGILL. - * writecode.c (adiv): Divides are always signed. - -Wed Dec 28 21:30:09 1994 Steve Chamberlain (sac@jonny.cygnus.com) - - * inlines.h: Make INLINES static. - * mem.c (sitoptr): New instance. - * support.c (normal_flags_[32|16|8]): New functions. - (optimize_normal_flags): Use new functions. - * writecode.c (info_special): Handle sbc. (optimize_normal_flags): - Always recalc flags. - -Wed May 18 14:38:49 1994 Doug Evans (dje@canuck.cygnus.com) - - * support.c (sim_open): Delete from here. - (sim_set_args): Delete from here. - (sim_kill): Delete from here. - * iface.c (sim_*): Make result void where there isn't one. - (sim_clear_breakpoints): Delete. - (sim_set_pc): Delete. - (sim_info): Delete printf_fn arg, all callers changed. - (sim_open): Define here. - (sim_close): New function. - (sim_load): New function. - (sim_create_inferior): Renamed from sim_set_args. - (sim_kill): Define here. - * run.c (printf): Delete declaration. - (main): Call sim_create_inferior instead of sim_set_pc. - * sim.h (sim_clear_breakpoints): Delete. - -Wed May 18 13:22:02 1994 Steve Chamberlain (sac@jonny.cygnus.com) - - * writecode.c (main): Disable the chopping of large initializers. - GCC can now cope. - -Sat May 7 17:24:46 1994 Steve Chamberlain (sac@cygnus.com) - - * writecode.c (info_args): Add resflg and setflg. - * list.c : Regenerated. - * Makefile.in: First rule is now called 'all' - -Sat Dec 11 16:39:30 1993 Steve Chamberlain (sac@thepub.cygnus.com) - - * iface.c (sim_store_register): Get regval the right way up. - * writecode.c (info_args): Add lda. - -Tue Oct 26 13:01:46 1993 Doug Evans (dje@canuck.cygnus.com) - - * Makefile.in (INCDIR): Fix definition. - (CSEARCH): Add -I$(srcdir)/../../gdb - (comped1.o, comped3.o, compedb3.o, comped2.o): Use CSEARCH, not INCDIR. - * iface.c: Replace #include "../include/wait.h" with "remote-sim.h". - (sim_set_pc): int result, use SIM_ADDR for type of arg `addr'. - (sim_store_register): int result, pass value by reference. - (sim_fetch_register): Use unsigned char * for arg `buf'. - (sim_write): int result, use SIM_ADDR for `where' arg, - use unsigned char * for `what' arg. - (sim_read): Ditto. - (sim_resume): int result. - (sim_stop_reason): Renamed from sim_stop_signal, int result, - new arg `reason'. - (sim_info): int result, merge sim_info_print into here. - (sim_info_print): Deleted. - * run.c: #include <stdio.h> - (main): Update call to sim_info. - * sim.h: Remove various prototypes defined in remote-sim.h. - -Sat Oct 23 15:16:45 1993 Doug Evans (dje@canuck.cygnus.com) - - * iface.c (sim_stop_signal): Result is now enum sim_stop. - -Thu Oct 7 19:01:07 1993 Steve Chamberlain (sac@phydeaux.cygnus.com) - - * writecode.c (doset, info_docode): Understand set and res insns. - -Thu Sep 30 11:30:42 1993 Steve Chamberlain (sac@phydeaux.cygnus.com) - - * support.c (tm_info_print): If no timetaken, don't divide by zero. - -Fri Jul 30 15:51:54 1993 david d `zoo' zuhn (zoo@rtl.cygnus.com) - - * writecode.c (div): rename to divide, to resolve conflict with - ANSI function div from <stdlib.h> - -Mon Mar 15 15:48:50 1993 Ian Lance Taylor (ian@cygnus.com) - - * z8k.mt (DO_INSTALL): Renamed from INSTALL. - -Tue Mar 9 12:32:29 1993 Steve Chamberlain (sac@thepub.cygnus.com) - - * writecode.c (main): Make the vector 'big' static, so that it - will compile on the apollo. - * support.c: Use the ANSI compilant __inline__. - -Fri Mar 5 07:54:18 1993 Steve Chamberlain (sac@thepub.cygnus.com) - - * writecode.c (main): When using gcc, split the tables into - sections so that it will compile. - * Makefile.in: Get ar args right. - * tm.h: Fix gcc prototypes. - -Wed Mar 3 15:04:48 1993 Steve Chamberlain (sac@poseidon.cygnus.com) - - * support.c (fail): Get the argument count right. - * tm.h: Lint. - * writecode.c (main): Pass all the arguments emit needs. - -Tue Feb 2 07:49:42 1993 Steve Chamberlain (sac@thepub.cygnus.com) - - * lint, prototypes - -Fri Jan 15 12:43:08 1993 Steve Chamberlain (sac@thepub.cygnus.com) - - * New - - diff --git a/sim/z8k/Makefile.in b/sim/z8k/Makefile.in deleted file mode 100644 index db3f931..0000000 --- a/sim/z8k/Makefile.in +++ /dev/null @@ -1,63 +0,0 @@ -# Makefile template for Configure for the z8k sim library. -# Copyright (C) 1993, 95, 96, 1997 Free Software Foundation, Inc. -# Written by Cygnus Support. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# 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. - -## COMMON_PRE_CONFIG_FRAG - -SIM_OBJS = iface.o mem.o support.o quick.o \ - comped1.o comped2.o comped3.o compedb3.o sim-load.o -# FIXME: hack to find syscall.h. Better support for syscall.h is -# in progress. -SIM_EXTRA_CFLAGS = -I$(srcdir)/../../newlib/libc/sys/z8k -SIM_EXTRA_CLEAN = clean-extra - -CONFIG_H = config.h - -## COMMON_POST_CONFIG_FRAG - -support.o:support.c inlines.h $(CONFIG_H) -mem.o: mem.c tm.h mem.h sim.h $(CONFIG_H) - -comped1.o:comped1.c tc-gen1.h $(CONFIG_H) -comped3.o:comped3.c tc-gen3.h $(CONFIG_H) -compedb3.o:compedb3.c tc-genb3.h $(CONFIG_H) -comped2.o:comped2.c tc-gen2.h $(CONFIG_H) - -tc-gen1.h:writecode - ./writecode -1 >tc-gen1.h - -tc-gen2.h:writecode - ./writecode -2 >tc-gen2.h - -tc-gen3.h:writecode - ./writecode -3 >tc-gen3.h - -tc-genb3.h:writecode - ./writecode -b3 >tc-genb3.h - -writecode: writecode.o bquick.o - $(CC_FOR_BUILD) -o writecode writecode.o bquick.o - -writecode.o: writecode.c $(CONFIG_H) - $(CC_FOR_BUILD) -c $(CFLAGS) $(HDEFINES) $(CSEARCH) $(CSWITCHES) $(srcdir)/writecode.c - -# Two copies of quick.o are created. One for $build and one for $host. -bquick.o: quick.c - $(CC_FOR_BUILD) -c $(CFLAGS) $(HDEFINES) $(CSEARCH) $(CSWITCHES) $(srcdir)/quick.c -o bquick.o - -clean-extra: - rm -f tc-gen1.h tc-gen2.h tc-gen3.h tc-genb3.h writecode diff --git a/sim/z8k/acconfig.h b/sim/z8k/acconfig.h deleted file mode 100644 index f9b87a1..0000000 --- a/sim/z8k/acconfig.h +++ /dev/null @@ -1,15 +0,0 @@ - -/* Define to 1 if NLS is requested. */ -#undef ENABLE_NLS - -/* Define as 1 if you have catgets and don't want to use GNU gettext. */ -#undef HAVE_CATGETS - -/* Define as 1 if you have gettext and don't want to use GNU gettext. */ -#undef HAVE_GETTEXT - -/* Define as 1 if you have the stpcpy function. */ -#undef HAVE_STPCPY - -/* Define if your locale.h file contains LC_MESSAGES. */ -#undef HAVE_LC_MESSAGES diff --git a/sim/z8k/comped1.c b/sim/z8k/comped1.c deleted file mode 100644 index 6c56513..0000000 --- a/sim/z8k/comped1.c +++ /dev/null @@ -1,31 +0,0 @@ -/* instruction interpreter module 1 - Copyright (C) 1992, 1993 Free Software Foundation, Inc. - -This file is part of Z8KSIM - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -Z8KZIM is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with Z8KZIM; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#include <ansidecl.h> -#include "tm.h" -#include "sim.h" - - -#ifdef __GNUC__ -#define INLINE inline -#include "inlines.h" -#endif - -#include "tc-gen1.h" - diff --git a/sim/z8k/comped2.c b/sim/z8k/comped2.c deleted file mode 100644 index 60012d1..0000000 --- a/sim/z8k/comped2.c +++ /dev/null @@ -1,25 +0,0 @@ -/* instruction interpreter module 2 - Copyright (C) 1992, 1993 Free Software Foundation, Inc. - -This file is part of Z8KSIM - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with Z8KZIM; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#include <ansidecl.h> -#include "tm.h" -#include "sim.h" -#include "tc-gen2.h" - - diff --git a/sim/z8k/comped3.c b/sim/z8k/comped3.c deleted file mode 100644 index c526969..0000000 --- a/sim/z8k/comped3.c +++ /dev/null @@ -1,28 +0,0 @@ -/* instruction interpreter module 2 - Copyright (C) 1987, 1992 Free Software Foundation, Inc. - -This file is part of Z8KSIM - -Z8KSIM is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -Z8KSIM is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with Z8KZIM; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - - -#include <ansidecl.h> -#include "tm.h" -#include "sim.h" - -#include "inlines.h" -#include "tc-gen3.h" - - diff --git a/sim/z8k/compedb3.c b/sim/z8k/compedb3.c deleted file mode 100644 index 54541db..0000000 --- a/sim/z8k/compedb3.c +++ /dev/null @@ -1,29 +0,0 @@ -/* instruction interpreter module 3 - Copyright (C) 1992, 1993 Free Software Foundation, Inc. - -This file is part of Z8KSIM - -Z8KSIM is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -Z8KSIM is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with Z8KZIM; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#define ushort_type unsigned short - -#include <ansidecl.h> -#include "tm.h" -#include "sim.h" -#include "inlines.h" - -#include "tc-genb3.h" - - diff --git a/sim/z8k/config.in b/sim/z8k/config.in deleted file mode 100644 index 7547724..0000000 --- a/sim/z8k/config.in +++ /dev/null @@ -1,161 +0,0 @@ -/* config.in. Generated automatically from configure.in by autoheader. */ - -/* Define if using alloca.c. */ -#undef C_ALLOCA - -/* Define to empty if the keyword does not work. */ -#undef const - -/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems. - This function is required for alloca.c support on those systems. */ -#undef CRAY_STACKSEG_END - -/* Define if you have alloca, as a function or macro. */ -#undef HAVE_ALLOCA - -/* Define if you have <alloca.h> and it should be used (not on Ultrix). */ -#undef HAVE_ALLOCA_H - -/* Define if you have a working `mmap' system call. */ -#undef HAVE_MMAP - -/* Define as __inline if that's what the C compiler calls it. */ -#undef inline - -/* Define to `long' if <sys/types.h> doesn't define. */ -#undef off_t - -/* Define if you need to in order for stat and other things to work. */ -#undef _POSIX_SOURCE - -/* Define as the return type of signal handlers (int or void). */ -#undef RETSIGTYPE - -/* Define to `unsigned' if <sys/types.h> doesn't define. */ -#undef size_t - -/* If using the C implementation of alloca, define if you know the - direction of stack growth for your system; otherwise it will be - automatically deduced at run-time. - STACK_DIRECTION > 0 => grows toward higher addresses - STACK_DIRECTION < 0 => grows toward lower addresses - STACK_DIRECTION = 0 => direction of growth unknown - */ -#undef STACK_DIRECTION - -/* Define if you have the ANSI C header files. */ -#undef STDC_HEADERS - -/* Define to 1 if NLS is requested. */ -#undef ENABLE_NLS - -/* Define as 1 if you have gettext and don't want to use GNU gettext. */ -#undef HAVE_GETTEXT - -/* Define as 1 if you have the stpcpy function. */ -#undef HAVE_STPCPY - -/* Define if your locale.h file contains LC_MESSAGES. */ -#undef HAVE_LC_MESSAGES - -/* Define if you have the __argz_count function. */ -#undef HAVE___ARGZ_COUNT - -/* Define if you have the __argz_next function. */ -#undef HAVE___ARGZ_NEXT - -/* Define if you have the __argz_stringify function. */ -#undef HAVE___ARGZ_STRINGIFY - -/* Define if you have the __setfpucw function. */ -#undef HAVE___SETFPUCW - -/* Define if you have the dcgettext function. */ -#undef HAVE_DCGETTEXT - -/* Define if you have the getcwd function. */ -#undef HAVE_GETCWD - -/* Define if you have the getpagesize function. */ -#undef HAVE_GETPAGESIZE - -/* Define if you have the getrusage function. */ -#undef HAVE_GETRUSAGE - -/* Define if you have the munmap function. */ -#undef HAVE_MUNMAP - -/* Define if you have the putenv function. */ -#undef HAVE_PUTENV - -/* Define if you have the setenv function. */ -#undef HAVE_SETENV - -/* Define if you have the setlocale function. */ -#undef HAVE_SETLOCALE - -/* Define if you have the sigaction function. */ -#undef HAVE_SIGACTION - -/* Define if you have the stpcpy function. */ -#undef HAVE_STPCPY - -/* Define if you have the strcasecmp function. */ -#undef HAVE_STRCASECMP - -/* Define if you have the strchr function. */ -#undef HAVE_STRCHR - -/* Define if you have the time function. */ -#undef HAVE_TIME - -/* Define if you have the <argz.h> header file. */ -#undef HAVE_ARGZ_H - -/* Define if you have the <fcntl.h> header file. */ -#undef HAVE_FCNTL_H - -/* Define if you have the <fpu_control.h> header file. */ -#undef HAVE_FPU_CONTROL_H - -/* Define if you have the <limits.h> header file. */ -#undef HAVE_LIMITS_H - -/* Define if you have the <locale.h> header file. */ -#undef HAVE_LOCALE_H - -/* Define if you have the <malloc.h> header file. */ -#undef HAVE_MALLOC_H - -/* Define if you have the <nl_types.h> header file. */ -#undef HAVE_NL_TYPES_H - -/* Define if you have the <stdlib.h> header file. */ -#undef HAVE_STDLIB_H - -/* Define if you have the <string.h> header file. */ -#undef HAVE_STRING_H - -/* Define if you have the <strings.h> header file. */ -#undef HAVE_STRINGS_H - -/* Define if you have the <sys/param.h> header file. */ -#undef HAVE_SYS_PARAM_H - -/* Define if you have the <sys/resource.h> header file. */ -#undef HAVE_SYS_RESOURCE_H - -/* Define if you have the <sys/time.h> header file. */ -#undef HAVE_SYS_TIME_H - -/* Define if you have the <sys/times.h> header file. */ -#undef HAVE_SYS_TIMES_H - -/* Define if you have the <time.h> header file. */ -#undef HAVE_TIME_H - -/* Define if you have the <unistd.h> header file. */ -#undef HAVE_UNISTD_H - -/* Define if you have the <values.h> header file. */ -#undef HAVE_VALUES_H diff --git a/sim/z8k/configure b/sim/z8k/configure deleted file mode 100755 index c21edf8..0000000 --- a/sim/z8k/configure +++ /dev/null @@ -1,4024 +0,0 @@ -#! /bin/sh - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -sim_inline="-DDEFAULT_INLINE=0" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -# This file is derived from `gettext.m4'. The difference is that the -# included macros assume Cygnus-style source and build trees. - -# Macro to add for using GNU gettext. -# Ulrich Drepper <drepper@cygnus.com>, 1995. -# -# This file file be copied and used freely without restrictions. It can -# be used in projects which are not available under the GNU Public License -# but which still want to provide support for the GNU gettext functionality. -# Please note that the actual code is *not* freely available. - -# serial 3 - - - - - -# Search path for a program which passes the given test. -# Ulrich Drepper <drepper@cygnus.com>, 1996. -# -# This file file be copied and used freely without restrictions. It can -# be used in projects which are not available under the GNU Public License -# but which still want to provide support for the GNU gettext functionality. -# Please note that the actual code is *not* freely available. - -# serial 1 - - - -# Check whether LC_MESSAGES is available in <locale.h>. -# Ulrich Drepper <drepper@cygnus.com>, 1995. -# -# This file file be copied and used freely without restrictions. It can -# be used in projects which are not available under the GNU Public License -# but which still want to provide support for the GNU gettext functionality. -# Please note that the actual code is *not* freely available. - -# serial 1 - - - - - - -# Guess values for system-dependent variables and create Makefiles. -# Generated automatically using autoconf version 2.13 -# 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 - --disable-nls do not use Native Language Support" -ac_help="$ac_help - --with-included-gettext use the GNU gettext library included here" -ac_help="$ac_help - --enable-maintainer-mode Enable developer functionality." -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" - -# 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= -sitefile= -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= -SHELL=${CONFIG_SHELL-/bin/sh} -# 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 - --site-file=FILE use FILE as the site file - --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" ;; - - -site-file | --site-file | --site-fil | --site-fi | --site-f) - ac_prev=sitefile ;; - -site-file=* | --site-file=* | --site-fil=* | --site-fi=* | --site-f=*) - sitefile="$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.13" - 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 "$sitefile"; then - 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 -else - CONFIG_SITE="$sitefile" -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${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cc_cross - -ac_exeext= -ac_objext=o -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:679: 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 <<EOF -#line 694 "configure" -#include "confdefs.h" -#include <assert.h> -Syntax Error -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:700: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -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 <<EOF -#line 711 "configure" -#include "confdefs.h" -#include <assert.h> -Syntax Error -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:717: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -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} -nologo -E" - cat > conftest.$ac_ext <<EOF -#line 728 "configure" -#include "confdefs.h" -#include <assert.h> -Syntax Error -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:734: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -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* -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 - -echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 -echo "configure:759: checking whether ${MAKE-make} sets \${MAKE}" >&5 -set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftestmake <<\EOF -all: - @echo 'ac_maketemp="${MAKE}"' -EOF -# GNU make sometimes prints "make[1]: Entering...", which would confuse us. -eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=` -if test -n "$ac_maketemp"; then - eval ac_cv_prog_make_${ac_make}_set=yes -else - eval ac_cv_prog_make_${ac_make}_set=no -fi -rm -f conftestmake -fi -if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then - echo "$ac_t""yes" 1>&6 - SET_MAKE= -else - echo "$ac_t""no" 1>&6 - SET_MAKE="MAKE=${MAKE-make}" -fi - -echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6 -echo "configure:786: checking for POSIXized ISC" >&5 -if test -d /etc/conf/kconfig.d && - grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1 -then - echo "$ac_t""yes" 1>&6 - ISC=yes # If later tests want to check for ISC. - cat >> confdefs.h <<\EOF -#define _POSIX_SOURCE 1 -EOF - - if test "$GCC" = yes; then - CC="$CC -posix" - else - CC="$CC -Xp" - fi -else - echo "$ac_t""no" 1>&6 - ISC= -fi - -echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:807: checking for ANSI C header files" >&5 -if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <<EOF -#line 812 "configure" -#include "confdefs.h" -#include <stdlib.h> -#include <stdarg.h> -#include <string.h> -#include <float.h> -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:820: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - rm -rf conftest* - ac_cv_header_stdc=yes -else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ac_cv_header_stdc=no -fi -rm -f conftest* - -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. -cat > conftest.$ac_ext <<EOF -#line 837 "configure" -#include "confdefs.h" -#include <string.h> -EOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "memchr" >/dev/null 2>&1; then - : -else - rm -rf conftest* - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. -cat > conftest.$ac_ext <<EOF -#line 855 "configure" -#include "confdefs.h" -#include <stdlib.h> -EOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "free" >/dev/null 2>&1; then - : -else - rm -rf conftest* - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. -if test "$cross_compiling" = yes; then - : -else - cat > conftest.$ac_ext <<EOF -#line 876 "configure" -#include "confdefs.h" -#include <ctype.h> -#define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -int main () { int i; for (i = 0; i < 256; i++) -if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); -exit (0); } - -EOF -if { (eval echo configure:887: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -then - : -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -fr conftest* - ac_cv_header_stdc=no -fi -rm -fr conftest* -fi - -fi -fi - -echo "$ac_t""$ac_cv_header_stdc" 1>&6 -if test $ac_cv_header_stdc = yes; then - cat >> confdefs.h <<\EOF -#define STDC_HEADERS 1 -EOF - -fi - -echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:911: checking for working const" >&5 -if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <<EOF -#line 916 "configure" -#include "confdefs.h" - -int main() { - -/* Ultrix mips cc rejects this. */ -typedef int charset[2]; const charset x; -/* SunOS 4.1.1 cc rejects this. */ -char const *const *ccp; -char **p; -/* NEC SVR4.0.2 mips cc rejects this. */ -struct point {int x, y;}; -static struct point const zero = {0,0}; -/* AIX XL C 1.02.0.0 rejects this. - It does not let you subtract one const X* pointer from another in an arm - of an if-expression whose if-part is not a constant expression */ -const char *g = "string"; -ccp = &g + (g ? g-g : 0); -/* HPUX 7.0 cc rejects these. */ -++ccp; -p = (char**) ccp; -ccp = (char const *const *) p; -{ /* SCO 3.2v4 cc rejects this. */ - char *t; - char const *s = 0 ? (char *) 0 : (char const *) 0; - - *t++ = 0; -} -{ /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ - int x[] = {25, 17}; - const int *foo = &x[0]; - ++foo; -} -{ /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ - typedef const int *iptr; - iptr p = 0; - ++p; -} -{ /* AIX XL C 1.02.0.0 rejects this saying - "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ - struct s { int j; const int *ap[3]; }; - struct s *b; b->j = 5; -} -{ /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ - const int foo = 10; -} - -; return 0; } -EOF -if { (eval echo configure:965: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - ac_cv_c_const=yes -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ac_cv_c_const=no -fi -rm -f conftest* -fi - -echo "$ac_t""$ac_cv_c_const" 1>&6 -if test $ac_cv_c_const = no; then - cat >> confdefs.h <<\EOF -#define const -EOF - -fi - -echo $ac_n "checking for inline""... $ac_c" 1>&6 -echo "configure:986: checking for inline" >&5 -if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_cv_c_inline=no -for ac_kw in inline __inline__ __inline; do - cat > conftest.$ac_ext <<EOF -#line 993 "configure" -#include "confdefs.h" - -int main() { -} $ac_kw foo() { -; return 0; } -EOF -if { (eval echo configure:1000: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - ac_cv_c_inline=$ac_kw; break -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 -fi -rm -f conftest* -done - -fi - -echo "$ac_t""$ac_cv_c_inline" 1>&6 -case "$ac_cv_c_inline" in - inline | yes) ;; - no) cat >> confdefs.h <<\EOF -#define inline -EOF - ;; - *) cat >> confdefs.h <<EOF -#define inline $ac_cv_c_inline -EOF - ;; -esac - -echo $ac_n "checking for off_t""... $ac_c" 1>&6 -echo "configure:1026: checking for off_t" >&5 -if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <<EOF -#line 1031 "configure" -#include "confdefs.h" -#include <sys/types.h> -#if STDC_HEADERS -#include <stdlib.h> -#include <stddef.h> -#endif -EOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "(^|[^a-zA-Z_0-9])off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then - rm -rf conftest* - ac_cv_type_off_t=yes -else - rm -rf conftest* - ac_cv_type_off_t=no -fi -rm -f conftest* - -fi -echo "$ac_t""$ac_cv_type_off_t" 1>&6 -if test $ac_cv_type_off_t = no; then - cat >> confdefs.h <<\EOF -#define off_t long -EOF - -fi - -echo $ac_n "checking for size_t""... $ac_c" 1>&6 -echo "configure:1059: checking for size_t" >&5 -if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <<EOF -#line 1064 "configure" -#include "confdefs.h" -#include <sys/types.h> -#if STDC_HEADERS -#include <stdlib.h> -#include <stddef.h> -#endif -EOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then - rm -rf conftest* - ac_cv_type_size_t=yes -else - rm -rf conftest* - ac_cv_type_size_t=no -fi -rm -f conftest* - -fi -echo "$ac_t""$ac_cv_type_size_t" 1>&6 -if test $ac_cv_type_size_t = no; then - cat >> confdefs.h <<\EOF -#define size_t unsigned -EOF - -fi - -# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works -# for constant arguments. Useless! -echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6 -echo "configure:1094: checking for working alloca.h" >&5 -if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <<EOF -#line 1099 "configure" -#include "confdefs.h" -#include <alloca.h> -int main() { -char *p = alloca(2 * sizeof(int)); -; return 0; } -EOF -if { (eval echo configure:1106: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - ac_cv_header_alloca_h=yes -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ac_cv_header_alloca_h=no -fi -rm -f conftest* -fi - -echo "$ac_t""$ac_cv_header_alloca_h" 1>&6 -if test $ac_cv_header_alloca_h = yes; then - cat >> confdefs.h <<\EOF -#define HAVE_ALLOCA_H 1 -EOF - -fi - -echo $ac_n "checking for alloca""... $ac_c" 1>&6 -echo "configure:1127: checking for alloca" >&5 -if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <<EOF -#line 1132 "configure" -#include "confdefs.h" - -#ifdef __GNUC__ -# define alloca __builtin_alloca -#else -# ifdef _MSC_VER -# include <malloc.h> -# define alloca _alloca -# else -# if HAVE_ALLOCA_H -# include <alloca.h> -# else -# ifdef _AIX - #pragma alloca -# else -# ifndef alloca /* predefined by HP cc +Olibcalls */ -char *alloca (); -# endif -# endif -# endif -# endif -#endif - -int main() { -char *p = (char *) alloca(1); -; return 0; } -EOF -if { (eval echo configure:1160: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - ac_cv_func_alloca_works=yes -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ac_cv_func_alloca_works=no -fi -rm -f conftest* -fi - -echo "$ac_t""$ac_cv_func_alloca_works" 1>&6 -if test $ac_cv_func_alloca_works = yes; then - cat >> confdefs.h <<\EOF -#define HAVE_ALLOCA 1 -EOF - -fi - -if test $ac_cv_func_alloca_works = no; then - # The SVR3 libPW and SVR4 libucb both contain incompatible functions - # that cause trouble. Some versions do not even contain alloca or - # contain a buggy version. If you still want to use their alloca, - # use ar to extract alloca.o from them instead of compiling alloca.c. - ALLOCA=alloca.${ac_objext} - cat >> confdefs.h <<\EOF -#define C_ALLOCA 1 -EOF - - -echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 -echo "configure:1192: checking whether alloca needs Cray hooks" >&5 -if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <<EOF -#line 1197 "configure" -#include "confdefs.h" -#if defined(CRAY) && ! defined(CRAY2) -webecray -#else -wenotbecray -#endif - -EOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "webecray" >/dev/null 2>&1; then - rm -rf conftest* - ac_cv_os_cray=yes -else - rm -rf conftest* - ac_cv_os_cray=no -fi -rm -f conftest* - -fi - -echo "$ac_t""$ac_cv_os_cray" 1>&6 -if test $ac_cv_os_cray = yes; then -for ac_func in _getb67 GETB67 getb67; do - echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1222: 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 <<EOF -#line 1227 "configure" -#include "confdefs.h" -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func(); below. */ -#include <assert.h> -/* 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:1250: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; 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 - cat >> confdefs.h <<EOF -#define CRAY_STACKSEG_END $ac_func -EOF - - break -else - echo "$ac_t""no" 1>&6 -fi - -done -fi - -echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 -echo "configure:1277: checking stack direction for C alloca" >&5 -if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test "$cross_compiling" = yes; then - ac_cv_c_stack_direction=0 -else - cat > conftest.$ac_ext <<EOF -#line 1285 "configure" -#include "confdefs.h" -find_stack_direction () -{ - static char *addr = 0; - auto char dummy; - if (addr == 0) - { - addr = &dummy; - return find_stack_direction (); - } - else - return (&dummy > addr) ? 1 : -1; -} -main () -{ - exit (find_stack_direction() < 0); -} -EOF -if { (eval echo configure:1304: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -then - ac_cv_c_stack_direction=1 -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -fr conftest* - ac_cv_c_stack_direction=-1 -fi -rm -fr conftest* -fi - -fi - -echo "$ac_t""$ac_cv_c_stack_direction" 1>&6 -cat >> confdefs.h <<EOF -#define STACK_DIRECTION $ac_cv_c_stack_direction -EOF - -fi - -for ac_hdr in unistd.h -do -ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:1329: 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 -#line 1334 "configure" -#include "confdefs.h" -#include <$ac_hdr> -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1339: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -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 <<EOF -#define $ac_tr_hdr 1 -EOF - -else - echo "$ac_t""no" 1>&6 -fi -done - -for ac_func in getpagesize -do -echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1368: 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 <<EOF -#line 1373 "configure" -#include "confdefs.h" -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func(); below. */ -#include <assert.h> -/* 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:1396: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; 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 <<EOF -#define $ac_tr_func 1 -EOF - -else - echo "$ac_t""no" 1>&6 -fi -done - -echo $ac_n "checking for working mmap""... $ac_c" 1>&6 -echo "configure:1421: checking for working mmap" >&5 -if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test "$cross_compiling" = yes; then - ac_cv_func_mmap_fixed_mapped=no -else - cat > conftest.$ac_ext <<EOF -#line 1429 "configure" -#include "confdefs.h" - -/* Thanks to Mike Haertel and Jim Avera for this test. - Here is a matrix of mmap possibilities: - mmap private not fixed - mmap private fixed at somewhere currently unmapped - mmap private fixed at somewhere already mapped - mmap shared not fixed - mmap shared fixed at somewhere currently unmapped - mmap shared fixed at somewhere already mapped - For private mappings, we should verify that changes cannot be read() - back from the file, nor mmap's back from the file at a different - address. (There have been systems where private was not correctly - implemented like the infamous i386 svr4.0, and systems where the - VM page cache was not coherent with the filesystem buffer cache - like early versions of FreeBSD and possibly contemporary NetBSD.) - For shared mappings, we should conversely verify that changes get - propogated back to all the places they're supposed to be. - - Grep wants private fixed already mapped. - The main things grep needs to know about mmap are: - * does it exist and is it safe to write into the mmap'd area - * how to use it (BSD variants) */ -#include <sys/types.h> -#include <fcntl.h> -#include <sys/mman.h> - -/* This mess was copied from the GNU getpagesize.h. */ -#ifndef HAVE_GETPAGESIZE -# ifdef HAVE_UNISTD_H -# include <unistd.h> -# endif - -/* Assume that all systems that can run configure have sys/param.h. */ -# ifndef HAVE_SYS_PARAM_H -# define HAVE_SYS_PARAM_H 1 -# endif - -# ifdef _SC_PAGESIZE -# define getpagesize() sysconf(_SC_PAGESIZE) -# else /* no _SC_PAGESIZE */ -# ifdef HAVE_SYS_PARAM_H -# include <sys/param.h> -# ifdef EXEC_PAGESIZE -# define getpagesize() EXEC_PAGESIZE -# else /* no EXEC_PAGESIZE */ -# ifdef NBPG -# define getpagesize() NBPG * CLSIZE -# ifndef CLSIZE -# define CLSIZE 1 -# endif /* no CLSIZE */ -# else /* no NBPG */ -# ifdef NBPC -# define getpagesize() NBPC -# else /* no NBPC */ -# ifdef PAGESIZE -# define getpagesize() PAGESIZE -# endif /* PAGESIZE */ -# endif /* no NBPC */ -# endif /* no NBPG */ -# endif /* no EXEC_PAGESIZE */ -# else /* no HAVE_SYS_PARAM_H */ -# define getpagesize() 8192 /* punt totally */ -# endif /* no HAVE_SYS_PARAM_H */ -# endif /* no _SC_PAGESIZE */ - -#endif /* no HAVE_GETPAGESIZE */ - -#ifdef __cplusplus -extern "C" { void *malloc(unsigned); } -#else -char *malloc(); -#endif - -int -main() -{ - char *data, *data2, *data3; - int i, pagesize; - int fd; - - pagesize = getpagesize(); - - /* - * First, make a file with some known garbage in it. - */ - data = malloc(pagesize); - if (!data) - exit(1); - for (i = 0; i < pagesize; ++i) - *(data + i) = rand(); - umask(0); - fd = creat("conftestmmap", 0600); - if (fd < 0) - exit(1); - if (write(fd, data, pagesize) != pagesize) - exit(1); - close(fd); - - /* - * Next, try to mmap the file at a fixed address which - * already has something else allocated at it. If we can, - * also make sure that we see the same garbage. - */ - fd = open("conftestmmap", O_RDWR); - if (fd < 0) - exit(1); - data2 = malloc(2 * pagesize); - if (!data2) - exit(1); - data2 += (pagesize - ((int) data2 & (pagesize - 1))) & (pagesize - 1); - if (data2 != mmap(data2, pagesize, PROT_READ | PROT_WRITE, - MAP_PRIVATE | MAP_FIXED, fd, 0L)) - exit(1); - for (i = 0; i < pagesize; ++i) - if (*(data + i) != *(data2 + i)) - exit(1); - - /* - * Finally, make sure that changes to the mapped area - * do not percolate back to the file as seen by read(). - * (This is a bug on some variants of i386 svr4.0.) - */ - for (i = 0; i < pagesize; ++i) - *(data2 + i) = *(data2 + i) + 1; - data3 = malloc(pagesize); - if (!data3) - exit(1); - if (read(fd, data3, pagesize) != pagesize) - exit(1); - for (i = 0; i < pagesize; ++i) - if (*(data + i) != *(data3 + i)) - exit(1); - close(fd); - unlink("conftestmmap"); - exit(0); -} - -EOF -if { (eval echo configure:1569: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -then - ac_cv_func_mmap_fixed_mapped=yes -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -fr conftest* - ac_cv_func_mmap_fixed_mapped=no -fi -rm -fr conftest* -fi - -fi - -echo "$ac_t""$ac_cv_func_mmap_fixed_mapped" 1>&6 -if test $ac_cv_func_mmap_fixed_mapped = yes; then - cat >> confdefs.h <<\EOF -#define HAVE_MMAP 1 -EOF - -fi - -echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 -echo "configure:1592: checking for Cygwin environment" >&5 -if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <<EOF -#line 1597 "configure" -#include "confdefs.h" - -int main() { - -#ifndef __CYGWIN__ -#define __CYGWIN__ __CYGWIN32__ -#endif -return __CYGWIN__; -; return 0; } -EOF -if { (eval echo configure:1608: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - ac_cv_cygwin=yes -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ac_cv_cygwin=no -fi -rm -f conftest* -rm -f conftest* -fi - -echo "$ac_t""$ac_cv_cygwin" 1>&6 -CYGWIN= -test "$ac_cv_cygwin" = yes && CYGWIN=yes -echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6 -echo "configure:1625: checking for mingw32 environment" >&5 -if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <<EOF -#line 1630 "configure" -#include "confdefs.h" - -int main() { -return __MINGW32__; -; return 0; } -EOF -if { (eval echo configure:1637: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - ac_cv_mingw32=yes -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ac_cv_mingw32=no -fi -rm -f conftest* -rm -f conftest* -fi - -echo "$ac_t""$ac_cv_mingw32" 1>&6 -MINGW32= -test "$ac_cv_mingw32" = yes && MINGW32=yes - -# 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 ${CONFIG_SHELL-/bin/sh} $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:1704: checking host system type" >&5 - -host_alias=$host -case "$host_alias" in -NONE) - case $nonopt in - NONE) - if host_alias=`${CONFIG_SHELL-/bin/sh} $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=`${CONFIG_SHELL-/bin/sh} $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:1725: 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=`${CONFIG_SHELL-/bin/sh} $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:1743: 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=`${CONFIG_SHELL-/bin/sh} $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:1787: 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=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; 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:1817: 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=":" - ac_prog_rejected=no - ac_dummy="$PATH" - for ac_dir in $ac_dummy; 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 - - if test -z "$CC"; then - case "`uname -s`" in - *win32* | *WIN32*) - # Extract the first word of "cl", so it can be a program name with args. -set dummy cl; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1868: 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=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_CC="cl" - 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 - ;; - esac - 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:1900: 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${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cc_cross - -cat > conftest.$ac_ext << EOF - -#line 1911 "configure" -#include "confdefs.h" - -main(){return(0);} -EOF -if { (eval echo configure:1916: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; 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* -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${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cc_cross - -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:1942: 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:1947: 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 <<EOF -#ifdef __GNUC__ - yes; -#endif -EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1956: \"$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 -fi -fi - -echo "$ac_t""$ac_cv_prog_gcc" 1>&6 - -if test $ac_cv_prog_gcc = yes; then - GCC=yes -else - GCC= -fi - -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:1975: 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 - if test "$GCC" = yes; then - CFLAGS="-g -O2" - else - CFLAGS="-g" - fi -else - if test "$GCC" = yes; then - CFLAGS="-O2" - else - CFLAGS= - fi -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 -# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag -# 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:2018: 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=":" - 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. - # Don't use installbsd from OSF since it installs stuff as root - # by default. - for ac_prog in ginstall 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. - : - 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_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' - -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:2086: 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=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; 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 - - -ALL_LINGUAS= - - for ac_hdr in argz.h limits.h locale.h nl_types.h malloc.h string.h \ -unistd.h values.h sys/param.h -do -ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2121: 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 -#line 2126 "configure" -#include "confdefs.h" -#include <$ac_hdr> -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2131: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -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 <<EOF -#define $ac_tr_hdr 1 -EOF - -else - echo "$ac_t""no" 1>&6 -fi -done - - for ac_func in getcwd munmap putenv setenv setlocale strchr strcasecmp \ -__argz_count __argz_stringify __argz_next -do -echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2161: 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 <<EOF -#line 2166 "configure" -#include "confdefs.h" -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func(); below. */ -#include <assert.h> -/* 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:2189: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; 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 <<EOF -#define $ac_tr_func 1 -EOF - -else - echo "$ac_t""no" 1>&6 -fi -done - - - if test "${ac_cv_func_stpcpy+set}" != "set"; then - for ac_func in stpcpy -do -echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2218: 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 <<EOF -#line 2223 "configure" -#include "confdefs.h" -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func(); below. */ -#include <assert.h> -/* 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:2246: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; 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 <<EOF -#define $ac_tr_func 1 -EOF - -else - echo "$ac_t""no" 1>&6 -fi -done - - fi - if test "${ac_cv_func_stpcpy}" = "yes"; then - cat >> confdefs.h <<\EOF -#define HAVE_STPCPY 1 -EOF - - fi - - if test $ac_cv_header_locale_h = yes; then - echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6 -echo "configure:2280: checking for LC_MESSAGES" >&5 -if eval "test \"`echo '$''{'am_cv_val_LC_MESSAGES'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <<EOF -#line 2285 "configure" -#include "confdefs.h" -#include <locale.h> -int main() { -return LC_MESSAGES -; return 0; } -EOF -if { (eval echo configure:2292: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - am_cv_val_LC_MESSAGES=yes -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - am_cv_val_LC_MESSAGES=no -fi -rm -f conftest* -fi - -echo "$ac_t""$am_cv_val_LC_MESSAGES" 1>&6 - if test $am_cv_val_LC_MESSAGES = yes; then - cat >> confdefs.h <<\EOF -#define HAVE_LC_MESSAGES 1 -EOF - - fi - fi - echo $ac_n "checking whether NLS is requested""... $ac_c" 1>&6 -echo "configure:2313: checking whether NLS is requested" >&5 - # Check whether --enable-nls or --disable-nls was given. -if test "${enable_nls+set}" = set; then - enableval="$enable_nls" - USE_NLS=$enableval -else - USE_NLS=yes -fi - - echo "$ac_t""$USE_NLS" 1>&6 - - - USE_INCLUDED_LIBINTL=no - - if test "$USE_NLS" = "yes"; then - cat >> confdefs.h <<\EOF -#define ENABLE_NLS 1 -EOF - - echo $ac_n "checking whether included gettext is requested""... $ac_c" 1>&6 -echo "configure:2333: checking whether included gettext is requested" >&5 - # Check whether --with-included-gettext or --without-included-gettext was given. -if test "${with_included_gettext+set}" = set; then - withval="$with_included_gettext" - nls_cv_force_use_gnu_gettext=$withval -else - nls_cv_force_use_gnu_gettext=no -fi - - echo "$ac_t""$nls_cv_force_use_gnu_gettext" 1>&6 - - nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext" - if test "$nls_cv_force_use_gnu_gettext" != "yes"; then - nls_cv_header_intl= - nls_cv_header_libgt= - CATOBJEXT=NONE - - ac_safe=`echo "libintl.h" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for libintl.h""... $ac_c" 1>&6 -echo "configure:2352: checking for libintl.h" >&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 -#line 2357 "configure" -#include "confdefs.h" -#include <libintl.h> -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2362: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -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 - echo $ac_n "checking for gettext in libc""... $ac_c" 1>&6 -echo "configure:2379: checking for gettext in libc" >&5 -if eval "test \"`echo '$''{'gt_cv_func_gettext_libc'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <<EOF -#line 2384 "configure" -#include "confdefs.h" -#include <libintl.h> -int main() { -return (int) gettext ("") -; return 0; } -EOF -if { (eval echo configure:2391: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - gt_cv_func_gettext_libc=yes -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - gt_cv_func_gettext_libc=no -fi -rm -f conftest* -fi - -echo "$ac_t""$gt_cv_func_gettext_libc" 1>&6 - - if test "$gt_cv_func_gettext_libc" != "yes"; then - echo $ac_n "checking for bindtextdomain in -lintl""... $ac_c" 1>&6 -echo "configure:2407: checking for bindtextdomain in -lintl" >&5 -ac_lib_var=`echo intl'_'bindtextdomain | 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="-lintl $LIBS" -cat > conftest.$ac_ext <<EOF -#line 2415 "configure" -#include "confdefs.h" -/* 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 bindtextdomain(); - -int main() { -bindtextdomain() -; return 0; } -EOF -if { (eval echo configure:2426: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; 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 -rm -f conftest* -LIBS="$ac_save_LIBS" - -fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - echo $ac_n "checking for gettext in libintl""... $ac_c" 1>&6 -echo "configure:2442: checking for gettext in libintl" >&5 -if eval "test \"`echo '$''{'gt_cv_func_gettext_libintl'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <<EOF -#line 2447 "configure" -#include "confdefs.h" - -int main() { -return (int) gettext ("") -; return 0; } -EOF -if { (eval echo configure:2454: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - gt_cv_func_gettext_libintl=yes -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - gt_cv_func_gettext_libintl=no -fi -rm -f conftest* -fi - -echo "$ac_t""$gt_cv_func_gettext_libintl" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - - fi - - if test "$gt_cv_func_gettext_libc" = "yes" \ - || test "$gt_cv_func_gettext_libintl" = "yes"; then - cat >> confdefs.h <<\EOF -#define HAVE_GETTEXT 1 -EOF - - # Extract the first word of "msgfmt", so it can be a program name with args. -set dummy msgfmt; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2482: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - case "$MSGFMT" in - /*) - ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path. - ;; - *) - 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 - if test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"; then - ac_cv_path_MSGFMT="$ac_dir/$ac_word" - break - fi - fi - done - IFS="$ac_save_ifs" - test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT="no" - ;; -esac -fi -MSGFMT="$ac_cv_path_MSGFMT" -if test -n "$MSGFMT"; then - echo "$ac_t""$MSGFMT" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - if test "$MSGFMT" != "no"; then - for ac_func in dcgettext -do -echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2516: 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 <<EOF -#line 2521 "configure" -#include "confdefs.h" -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func(); below. */ -#include <assert.h> -/* 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:2544: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; 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 <<EOF -#define $ac_tr_func 1 -EOF - -else - echo "$ac_t""no" 1>&6 -fi -done - - # Extract the first word of "gmsgfmt", so it can be a program name with args. -set dummy gmsgfmt; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2571: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - case "$GMSGFMT" in - /*) - ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path. - ;; - ?:/*) - ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a dos path. - ;; - *) - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_path_GMSGFMT="$ac_dir/$ac_word" - break - fi - done - IFS="$ac_save_ifs" - test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT" - ;; -esac -fi -GMSGFMT="$ac_cv_path_GMSGFMT" -if test -n "$GMSGFMT"; then - echo "$ac_t""$GMSGFMT" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - - # Extract the first word of "xgettext", so it can be a program name with args. -set dummy xgettext; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2607: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - case "$XGETTEXT" in - /*) - ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path. - ;; - *) - 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 - if test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"; then - ac_cv_path_XGETTEXT="$ac_dir/$ac_word" - break - fi - fi - done - IFS="$ac_save_ifs" - test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":" - ;; -esac -fi -XGETTEXT="$ac_cv_path_XGETTEXT" -if test -n "$XGETTEXT"; then - echo "$ac_t""$XGETTEXT" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - - cat > conftest.$ac_ext <<EOF -#line 2639 "configure" -#include "confdefs.h" - -int main() { -extern int _nl_msg_cat_cntr; - return _nl_msg_cat_cntr -; return 0; } -EOF -if { (eval echo configure:2647: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - CATOBJEXT=.gmo - DATADIRNAME=share -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - CATOBJEXT=.mo - DATADIRNAME=lib -fi -rm -f conftest* - INSTOBJEXT=.mo - fi - fi - -else - echo "$ac_t""no" 1>&6 -fi - - - - if test "$CATOBJEXT" = "NONE"; then - nls_cv_use_gnu_gettext=yes - fi - fi - - if test "$nls_cv_use_gnu_gettext" = "yes"; then - INTLOBJS="\$(GETTOBJS)" - # Extract the first word of "msgfmt", so it can be a program name with args. -set dummy msgfmt; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2679: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - case "$MSGFMT" in - /*) - ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path. - ;; - *) - 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 - if test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"; then - ac_cv_path_MSGFMT="$ac_dir/$ac_word" - break - fi - fi - done - IFS="$ac_save_ifs" - test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT="msgfmt" - ;; -esac -fi -MSGFMT="$ac_cv_path_MSGFMT" -if test -n "$MSGFMT"; then - echo "$ac_t""$MSGFMT" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - - # Extract the first word of "gmsgfmt", so it can be a program name with args. -set dummy gmsgfmt; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2713: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - case "$GMSGFMT" in - /*) - ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path. - ;; - ?:/*) - ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a dos path. - ;; - *) - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_path_GMSGFMT="$ac_dir/$ac_word" - break - fi - done - IFS="$ac_save_ifs" - test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT" - ;; -esac -fi -GMSGFMT="$ac_cv_path_GMSGFMT" -if test -n "$GMSGFMT"; then - echo "$ac_t""$GMSGFMT" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - - # Extract the first word of "xgettext", so it can be a program name with args. -set dummy xgettext; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2749: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - case "$XGETTEXT" in - /*) - ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path. - ;; - *) - 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 - if test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"; then - ac_cv_path_XGETTEXT="$ac_dir/$ac_word" - break - fi - fi - done - IFS="$ac_save_ifs" - test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":" - ;; -esac -fi -XGETTEXT="$ac_cv_path_XGETTEXT" -if test -n "$XGETTEXT"; then - echo "$ac_t""$XGETTEXT" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - - - USE_INCLUDED_LIBINTL=yes - CATOBJEXT=.gmo - INSTOBJEXT=.mo - DATADIRNAME=share - INTLDEPS='$(top_builddir)/../intl/libintl.a' - INTLLIBS=$INTLDEPS - LIBS=`echo $LIBS | sed -e 's/-lintl//'` - nls_cv_header_intl=libintl.h - nls_cv_header_libgt=libgettext.h - fi - - if test "$XGETTEXT" != ":"; then - if $XGETTEXT --omit-header /dev/null 2> /dev/null; then - : ; - else - echo "$ac_t""found xgettext programs is not GNU xgettext; ignore it" 1>&6 - XGETTEXT=":" - fi - fi - - # We need to process the po/ directory. - POSUB=po - else - DATADIRNAME=share - nls_cv_header_intl=libintl.h - nls_cv_header_libgt=libgettext.h - fi - - # If this is used in GNU gettext we have to set USE_NLS to `yes' - # because some of the sources are only built for this goal. - if test "$PACKAGE" = gettext; then - USE_NLS=yes - USE_INCLUDED_LIBINTL=yes - fi - - for lang in $ALL_LINGUAS; do - GMOFILES="$GMOFILES $lang.gmo" - POFILES="$POFILES $lang.po" - done - - - - - - - - - - - - - - - if test "x$CATOBJEXT" != "x"; then - if test "x$ALL_LINGUAS" = "x"; then - LINGUAS= - else - echo $ac_n "checking for catalogs to be installed""... $ac_c" 1>&6 -echo "configure:2839: checking for catalogs to be installed" >&5 - NEW_LINGUAS= - for lang in ${LINGUAS=$ALL_LINGUAS}; do - case "$ALL_LINGUAS" in - *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;; - esac - done - LINGUAS=$NEW_LINGUAS - echo "$ac_t""$LINGUAS" 1>&6 - fi - - if test -n "$LINGUAS"; then - for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done - fi - fi - - if test $ac_cv_header_locale_h = yes; then - INCLUDE_LOCALE_H="#include <locale.h>" - else - INCLUDE_LOCALE_H="\ -/* The system does not provide the header <locale.h>. Take care yourself. */" - fi - - - if test -f $srcdir/po2tbl.sed.in; then - if test "$CATOBJEXT" = ".cat"; then - ac_safe=`echo "linux/version.h" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for linux/version.h""... $ac_c" 1>&6 -echo "configure:2867: checking for linux/version.h" >&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 -#line 2872 "configure" -#include "confdefs.h" -#include <linux/version.h> -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2877: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -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 - msgformat=linux -else - echo "$ac_t""no" 1>&6 -msgformat=xopen -fi - - - sed -e '/^#/d' $srcdir/$msgformat-msg.sed > po2msg.sed - fi - sed -e '/^#.*[^\\]$/d' -e '/^#$/d' \ - $srcdir/po2tbl.sed.in > po2tbl.sed - fi - - if test "$PACKAGE" = "gettext"; then - GT_NO="#NO#" - GT_YES= - else - GT_NO= - GT_YES="#YES#" - fi - - - - MKINSTALLDIRS="\$(srcdir)/../../mkinstalldirs" - - - l= - - - if test -d $srcdir/po; then - test -d po || mkdir po - if test "x$srcdir" != "x."; then - if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then - posrcprefix="$srcdir/" - else - posrcprefix="../$srcdir/" - fi - else - posrcprefix="../" - fi - rm -f po/POTFILES - sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \ - < $srcdir/po/POTFILES.in > po/POTFILES - 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 -do -ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2946: 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 -#line 2951 "configure" -#include "confdefs.h" -#include <$ac_hdr> -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2956: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -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 <<EOF -#define $ac_tr_hdr 1 -EOF - -else - echo "$ac_t""no" 1>&6 -fi -done - -for ac_hdr in 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:2986: 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 -#line 2991 "configure" -#include "confdefs.h" -#include <$ac_hdr> -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2996: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -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 <<EOF -#define $ac_tr_hdr 1 -EOF - -else - echo "$ac_t""no" 1>&6 -fi -done - -for ac_hdr in fcntl.h fpu_control.h -do -ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:3026: 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 -#line 3031 "configure" -#include "confdefs.h" -#include <$ac_hdr> -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3036: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -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 <<EOF -#define $ac_tr_hdr 1 -EOF - -else - echo "$ac_t""no" 1>&6 -fi -done - -for ac_hdr in dlfcn.h errno.h sys/stat.h -do -ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:3066: 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 -#line 3071 "configure" -#include "confdefs.h" -#include <$ac_hdr> -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3076: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -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 <<EOF -#define $ac_tr_hdr 1 -EOF - -else - echo "$ac_t""no" 1>&6 -fi -done - -for ac_func in getrusage time sigaction __setfpucw -do -echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3105: 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 <<EOF -#line 3110 "configure" -#include "confdefs.h" -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func(); below. */ -#include <assert.h> -/* 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:3133: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; 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 <<EOF -#define $ac_tr_func 1 -EOF - -else - echo "$ac_t""no" 1>&6 -fi -done - - -# Check for socket libraries -echo $ac_n "checking for bind in -lsocket""... $ac_c" 1>&6 -echo "configure:3160: checking for bind in -lsocket" >&5 -ac_lib_var=`echo socket'_'bind | 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="-lsocket $LIBS" -cat > conftest.$ac_ext <<EOF -#line 3168 "configure" -#include "confdefs.h" -/* 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 bind(); - -int main() { -bind() -; return 0; } -EOF -if { (eval echo configure:3179: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; 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 -rm -f conftest* -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 socket | sed -e 's/[^a-zA-Z0-9_]/_/g' \ - -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` - cat >> confdefs.h <<EOF -#define $ac_tr_lib 1 -EOF - - LIBS="-lsocket $LIBS" - -else - echo "$ac_t""no" 1>&6 -fi - -echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6 -echo "configure:3207: checking for gethostbyname in -lnsl" >&5 -ac_lib_var=`echo nsl'_'gethostbyname | 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="-lnsl $LIBS" -cat > conftest.$ac_ext <<EOF -#line 3215 "configure" -#include "confdefs.h" -/* 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 gethostbyname(); - -int main() { -gethostbyname() -; return 0; } -EOF -if { (eval echo configure:3226: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; 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 -rm -f conftest* -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 nsl | sed -e 's/[^a-zA-Z0-9_]/_/g' \ - -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` - cat >> confdefs.h <<EOF -#define $ac_tr_lib 1 -EOF - - LIBS="-lnsl $LIBS" - -else - echo "$ac_t""no" 1>&6 -fi - - -. ${srcdir}/../../bfd/configure.host - - - -USE_MAINTAINER_MODE=no -# Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. -if test "${enable_maintainer_mode+set}" = set; then - enableval="$enable_maintainer_mode" - case "${enableval}" in - yes) MAINT="" USE_MAINTAINER_MODE=yes ;; - no) MAINT="#" ;; - *) { echo "configure: error: "--enable-maintainer-mode does not take a value"" 1>&2; exit 1; }; MAINT="#" ;; -esac -if test x"$silent" != x"yes" && test x"$MAINT" = x""; then - echo "Setting maintainer mode" 6>&1 -fi -else - MAINT="#" -fi - - - -# 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 -fomit-frame-pointer";; - 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="-DPROFILE=1 -DWITH_PROFILE=-1" -fi - - - -echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 -echo "configure:3402: 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 <<EOF -#line 3407 "configure" -#include "confdefs.h" -#include <sys/types.h> -#include <signal.h> -#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:3424: \"$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 <<EOF -#define RETSIGTYPE $ac_cv_type_signal -EOF - - - - - -echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 -echo "configure:3446: checking for executable suffix" >&5 -if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test "$CYGWIN" = yes || test "$MINGW32" = yes; then - ac_cv_exeext=.exe -else - rm -f conftest* - echo 'int main () { return 0; }' > conftest.$ac_ext - ac_cv_exeext= - if { (eval echo configure:3456: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then - for file in conftest.*; do - case $file in - *.c | *.o | *.obj | *.ilk | *.pdb) ;; - *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;; - esac - done - else - { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; } - fi - rm -f conftest* - test x"${ac_cv_exeext}" = x && ac_cv_exeext=no -fi -fi - -EXEEXT="" -test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext} -echo "$ac_t""${ac_cv_exeext}" 1>&6 -ac_exeext=$EXEEXT - - -sim_link_files= -sim_link_links= - -sim_link_links=tconfig.h -if test -f ${srcdir}/tconfig.in -then - sim_link_files=tconfig.in -else - sim_link_files=../common/tconfig.in -fi - -# targ-vals.def points to the libc macro description file. -case "${target}" in -*-*-*) TARG_VALS_DEF=../common/nltvals.def ;; -esac -sim_link_files="${sim_link_files} ${TARG_VALS_DEF}" -sim_link_links="${sim_link_links} targ-vals.def" - - - -for ac_hdr in string.h strings.h stdlib.h time.h sys/times.h -do -ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:3501: 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 -#line 3506 "configure" -#include "confdefs.h" -#include <$ac_hdr> -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3511: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -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 <<EOF -#define $ac_tr_hdr 1 -EOF - -else - echo "$ac_t""no" 1>&6 -fi -done - - - - -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 | grep ac_space) 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 <<EOF -#! /bin/sh -# Generated automatically by configure. -# Run this file to recreate the current configuration. -# This directory was configured as follows, -# on host `(hostname || uname -n) 2>/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.13" - 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 .gdbinit:../common/gdbinit.in config.h:config.in" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 -EOF -cat >> $CONFIG_STATUS <<EOF - -# Protect against being on the right side of a sed subst in config.status. -sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g; - s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF -$ac_vpsub -$extrasub -s%@sim_environment@%$sim_environment%g -s%@sim_alignment@%$sim_alignment%g -s%@sim_assert@%$sim_assert%g -s%@sim_bitsize@%$sim_bitsize%g -s%@sim_endian@%$sim_endian%g -s%@sim_hostendian@%$sim_hostendian%g -s%@sim_float@%$sim_float%g -s%@sim_scache@%$sim_scache%g -s%@sim_default_model@%$sim_default_model%g -s%@sim_hw_cflags@%$sim_hw_cflags%g -s%@sim_hw_objs@%$sim_hw_objs%g -s%@sim_hw@%$sim_hw%g -s%@sim_inline@%$sim_inline%g -s%@sim_packages@%$sim_packages%g -s%@sim_regparm@%$sim_regparm%g -s%@sim_reserved_bits@%$sim_reserved_bits%g -s%@sim_smp@%$sim_smp%g -s%@sim_stdcall@%$sim_stdcall%g -s%@sim_xor_endian@%$sim_xor_endian%g -s%@WARN_CFLAGS@%$WARN_CFLAGS%g -s%@WERROR_CFLAGS@%$WERROR_CFLAGS%g -s%@SHELL@%$SHELL%g -s%@CFLAGS@%$CFLAGS%g -s%@CPPFLAGS@%$CPPFLAGS%g -s%@CXXFLAGS@%$CXXFLAGS%g -s%@FFLAGS@%$FFLAGS%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_SCRIPT@%$INSTALL_SCRIPT%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%@SET_MAKE@%$SET_MAKE%g -s%@CPP@%$CPP%g -s%@ALLOCA@%$ALLOCA%g -s%@USE_NLS@%$USE_NLS%g -s%@MSGFMT@%$MSGFMT%g -s%@GMSGFMT@%$GMSGFMT%g -s%@XGETTEXT@%$XGETTEXT%g -s%@USE_INCLUDED_LIBINTL@%$USE_INCLUDED_LIBINTL%g -s%@CATALOGS@%$CATALOGS%g -s%@CATOBJEXT@%$CATOBJEXT%g -s%@DATADIRNAME@%$DATADIRNAME%g -s%@GMOFILES@%$GMOFILES%g -s%@INSTOBJEXT@%$INSTOBJEXT%g -s%@INTLDEPS@%$INTLDEPS%g -s%@INTLLIBS@%$INTLLIBS%g -s%@INTLOBJS@%$INTLOBJS%g -s%@POFILES@%$POFILES%g -s%@POSUB@%$POSUB%g -s%@INCLUDE_LOCALE_H@%$INCLUDE_LOCALE_H%g -s%@GT_NO@%$GT_NO%g -s%@GT_YES@%$GT_YES%g -s%@MKINSTALLDIRS@%$MKINSTALLDIRS%g -s%@l@%$l%g -s%@MAINT@%$MAINT%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%@EXEEXT@%$EXEEXT%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 <<EOF - -CONFIG_FILES=\${CONFIG_FILES-"Makefile.sim:Makefile.in Make-common.sim:../common/Make-common.in .gdbinit:../common/gdbinit.in"} -EOF -cat >> $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 <<EOF - CONFIG_HEADERS="config.h:config.in" -EOF -cat >> $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 <<CEOF' >> $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 <<EOF -ac_sources="$sim_link_files" -ac_dests="$sim_link_links" -EOF - -cat >> $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 <<EOF - -EOF -cat >> $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' <Make-common.sim >Makesim1.tmp - sed -n -e '/^## COMMON_POST_/,/^## End COMMON_POST_/ p' <Make-common.sim >Makesim2.tmp - sed -e '/^## COMMON_PRE_/ r Makesim1.tmp' \ - -e '/^## COMMON_POST_/ r Makesim2.tmp' \ - <Makefile.sim >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/z8k/configure.in b/sim/z8k/configure.in deleted file mode 100644 index e96fc7d..0000000 --- a/sim/z8k/configure.in +++ /dev/null @@ -1,10 +0,0 @@ -dnl Process this file with autoconf to produce a configure script. -sinclude(../common/aclocal.m4) -AC_PREREQ(2.5)dnl -AC_INIT(Makefile.in) - -SIM_AC_COMMON - -AC_CHECK_HEADERS(string.h strings.h stdlib.h time.h sys/times.h) - -SIM_AC_OUTPUT diff --git a/sim/z8k/iface.c b/sim/z8k/iface.c deleted file mode 100644 index 5104172..0000000 --- a/sim/z8k/iface.c +++ /dev/null @@ -1,263 +0,0 @@ -/* gdb->simulator interface. - Copyright (C) 1992, 1993, 1994, 1997 Free Software Foundation, Inc. - -This file is part of Z8KSIM - -Z8KSIM is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -Z8KSIM is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with Z8KZIM; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#include "ansidecl.h" -#include "sim.h" -#include "tm.h" -#include "signal.h" -#include "bfd.h" -#include "gdb/callback.h" -#include "gdb/remote-sim.h" - -#ifndef NULL -#define NULL 0 -#endif - -host_callback *z8k_callback; - -static SIM_OPEN_KIND sim_kind; -static char *myname; - -void -sim_size (n) - int n; -{ - /* Size is fixed. */ -} - -int -sim_store_register (sd, regno, value, length) - SIM_DESC sd; - int regno; - unsigned char *value; - int length; -{ - /* FIXME: Review the computation of regval. */ - int regval = (value[0] << 24) | (value[1] << 16) | (value[2] << 8) | value[3]; - - tm_store_register (regno, regval); - return -1; -} - -int -sim_fetch_register (sd, regno, buf, length) - SIM_DESC sd; - int regno; - unsigned char *buf; - int length; -{ - tm_fetch_register (regno, buf); - return -1; -} - -int -sim_write (sd, where, what, howmuch) - SIM_DESC sd; - SIM_ADDR where; - unsigned char *what; - int howmuch; -{ - int i; - - for (i = 0; i < howmuch; i++) - tm_write_byte (where + i, what[i]); - return howmuch; -} - -int -sim_read (sd, where, what, howmuch) - SIM_DESC sd; - SIM_ADDR where; - unsigned char *what; - int howmuch; -{ - int i; - - for (i = 0; i < howmuch; i++) - what[i] = tm_read_byte (where + i); - return howmuch; -} - -static void -control_c (sig, code, scp, addr) - int sig; - int code; - char *scp; - char *addr; -{ - tm_exception (SIM_INTERRUPT); -} - -int -sim_stop (sd) - SIM_DESC sd; -{ - tm_exception (SIM_INTERRUPT); - return 1; -} - -void -sim_resume (sd, step, sig) - SIM_DESC sd; - int step; - int sig; -{ - void (*prev) (); - - prev = signal (SIGINT, control_c); - tm_resume (step); - signal (SIGINT, prev); -} - -void -sim_stop_reason (sd, reason, sigrc) - SIM_DESC sd; - enum sim_stop *reason; - int *sigrc; -{ - switch (tm_signal ()) - { - case SIM_DIV_ZERO: - *sigrc = SIGFPE; - break; - case SIM_INTERRUPT: - *sigrc = SIGINT; - break; - case SIM_BAD_INST: - *sigrc = SIGILL; - break; - case SIM_BREAKPOINT: - *sigrc = SIGTRAP; - break; - case SIM_SINGLE_STEP: - *sigrc = SIGTRAP; - break; - case SIM_BAD_SYSCALL: - *sigrc = SIGILL; - break; - case SIM_BAD_ALIGN: - *sigrc = SIGSEGV; - break; - case SIM_DONE: - { - sim_state_type x; - tm_state (&x); - *sigrc = x.regs[2].word & 255; - *reason = sim_exited; - return; - } - default: - abort (); - } - *reason = sim_stopped; -} - -void -sim_info (sd, verbose) - SIM_DESC sd; - int verbose; -{ - sim_state_type x; - - tm_state (&x); - tm_info_print (&x); -} - -SIM_DESC -sim_open (kind, cb, abfd, argv) - SIM_OPEN_KIND kind; - host_callback *cb; - struct bfd *abfd; - char **argv; -{ - /* FIXME: The code in sim_load that determines the exact z8k arch - should be moved to here */ - - sim_kind = kind; - myname = argv[0]; - z8k_callback = cb; - - /* fudge our descriptor for now */ - return (SIM_DESC) 1; -} - -void -sim_close (sd, quitting) - SIM_DESC sd; - int quitting; -{ - /* nothing to do */ -} - -SIM_RC -sim_load (sd, prog, abfd, from_tty) - SIM_DESC sd; - char *prog; - bfd *abfd; - int from_tty; -{ - extern bfd *sim_load_file (); /* ??? Don't know where this should live. */ - bfd *prog_bfd; - - /* FIXME: The code determining the type of z9k processor should be - moved from here to sim_open. */ - - prog_bfd = sim_load_file (sd, myname, z8k_callback, prog, abfd, - sim_kind == SIM_OPEN_DEBUG, - 0, sim_write); - if (prog_bfd == NULL) - return SIM_RC_FAIL; - if (bfd_get_mach (prog_bfd) == bfd_mach_z8001) - { - extern int sim_z8001_mode; - sim_z8001_mode = 1; - } - /* Close the bfd if we opened it. */ - if (abfd == NULL) - bfd_close (prog_bfd); - return SIM_RC_OK; -} - -SIM_RC -sim_create_inferior (sd, abfd, argv, env) - SIM_DESC sd; - struct bfd *abfd; - char **argv; - char **env; -{ - if (abfd != NULL) - tm_store_register (REG_PC, bfd_get_start_address (abfd)); - else - tm_store_register (REG_PC, 0); - return SIM_RC_OK; -} - -void -sim_do_command (sd, cmd) - SIM_DESC sd; - char *cmd; -{ -} - -void -sim_set_callbacks (ptr) - host_callback *ptr; -{ - z8k_callback = ptr; -} diff --git a/sim/z8k/inlines.h b/sim/z8k/inlines.h deleted file mode 100644 index 1bf209e..0000000 --- a/sim/z8k/inlines.h +++ /dev/null @@ -1,486 +0,0 @@ -/* inline functions for Z8KSIM - Copyright (C) 1992, 1993 Free Software Foundation, Inc. - -This file is part of Z8KSIM - -GNU CC is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -GNU CC is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with Z8KZIM; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#ifndef INLINE -#define INLINE -#endif -#define UGT 0x0b -#define ULE 0x03 -#define ULT 0x07 -#define UGE 0x0f -#define SLOW 0 -#define T 0x8 -#define F 0x0 -#define LT 0x1 -#define GT 0xa -#define LE 0x2 -#define EQ 0x6 -#define NE 0xe -#define GE 0x9 - - static int is_cond_true PARAMS((sim_state_type *context, int c)); - static void makeflags PARAMS((sim_state_type *context, int mask)); - -static INLINE -long -sitoptr (si) -long si; -{ - return ((si & 0xff000000) >> 8) | (si & 0xffff); -} -static INLINE long -ptrtosi (ptr) -long ptr; -{ - return ((ptr & 0xff0000) << 8) | (ptr & 0xffff); -} - -static INLINE -void -put_long_reg (context, reg, val) - sim_state_type *context; - int reg; - int val; -{ - context->regs[reg].word = val >> 16; - context->regs[reg + 1].word = val; -} - -static INLINE -void -put_quad_reg (context, reg, val1, val2) - sim_state_type *context; - int reg; - int val1; - int val2; -{ - context->regs[reg].word = val2 >> 16; - context->regs[reg + 1].word = val2; - context->regs[reg + 2].word = val1 >> 16; - context->regs[reg + 3].word = val1; -} - -static INLINE -void -put_word_reg (context, reg, val) - sim_state_type *context; - int reg; - int val; -{ - context->regs[reg].word = val; -} - -static INLINE -SItype get_long_reg (context, reg) - sim_state_type *context; - int reg; -{ - USItype lsw = context->regs[reg + 1].word; - USItype msw = context->regs[reg].word; - - return (msw << 16) | lsw; -} - -#ifdef __GNUC__ -static INLINE -struct UDIstruct -get_quad_reg (context, reg) - sim_state_type *context; - int reg; -{ - UDItype res; - USItype lsw = get_long_reg (context, reg + 2); - USItype msw = get_long_reg (context, reg); - - res.low = lsw; - res.high = msw; - return res; -} - -#endif - -static INLINE void -put_byte_mem_da (context, addr, value) - sim_state_type *context; - int addr; - int value; -{ - ((unsigned char *) (context->memory))[addr] = value; -} - -static INLINE -void -put_byte_reg (context, reg, val) - sim_state_type *context; - int reg; - int val; -{ - int old = context->regs[reg & 0x7].word; - if (reg & 0x8) - { - old = old & 0xff00 | (val & 0xff); - } - else - { - old = old & 0x00ff | (val << 8); - } - context->regs[reg & 0x7].word = old; -} - -static INLINE -int -get_byte_reg (context, reg) - sim_state_type *context; - int reg; -{ - if (reg & 0x8) - return context->regs[reg & 0x7].word & 0xff; - else - return (context->regs[reg & 0x7].word >> 8) & 0xff; -} - -static INLINE -void -put_word_mem_da (context, addr, value) - sim_state_type *context; - int addr; - int value; -{ - if (addr & 1) - { - context->exception = SIM_BAD_ALIGN; - addr &= ~1; - } - put_byte_mem_da(context, addr, value>>8); - put_byte_mem_da(context, addr+1, value); -} - -static INLINE unsigned char -get_byte_mem_da (context, addr) - sim_state_type *context; - int addr; -{ - return ((unsigned char *) (context->memory))[addr]; -} - - -#if 0 -#define get_word_mem_da(context,addr)\ - *((unsigned short*)((char*)((context)->memory)+(addr))) - -#else -#define get_word_mem_da(context,addr) (get_byte_mem_da(context, addr) << 8) | (get_byte_mem_da(context,addr+1)) -#endif - -#define get_word_reg(context,reg) (context)->regs[reg].word - -static INLINE -SItype -get_long_mem_da (context, addr) - sim_state_type *context; - int addr; -{ - USItype lsw = get_word_mem_da(context,addr+2); - USItype msw = get_word_mem_da(context, addr); - - return (msw << 16) + lsw; -} - -static INLINE -void -put_long_mem_da (context, addr, value) - sim_state_type *context; - int addr; - int value; -{ - put_word_mem_da(context,addr, value>>16); - put_word_mem_da(context,addr+2, value); -} - -static INLINE -int -get_word_mem_ir (context, reg) - sim_state_type *context; - int reg; -{ - return get_word_mem_da (context, get_word_reg (context, reg)); -} - -static INLINE -void -put_word_mem_ir (context, reg, value) - sim_state_type *context; - int reg; - int value; -{ - - put_word_mem_da (context, get_word_reg (context, reg), value); -} - -static INLINE -int -get_byte_mem_ir (context, reg) - sim_state_type *context; - int reg; -{ - return get_byte_mem_da (context, get_word_reg (context, reg)); -} - -static INLINE -void -put_byte_mem_ir (context, reg, value) - sim_state_type *context; - int reg; - int value; -{ - put_byte_mem_da (context, get_word_reg (context, reg), value); -} - -static INLINE -int -get_long_mem_ir (context, reg) - sim_state_type *context; - int reg; -{ - return get_long_mem_da (context, get_word_reg (context, reg)); -} - -static INLINE -void -put_long_mem_ir (context, reg, value) - sim_state_type *context; - int reg; - int value; -{ - - put_long_mem_da (context, get_word_reg (context, reg), value); -} - -static INLINE -void -put_long_mem_x (context, base, reg, value) - sim_state_type *context; - int base; - int reg; - int value; -{ - put_long_mem_da (context, get_word_reg (context, reg) + base, value); -} - -static INLINE -void -put_word_mem_x (context, base, reg, value) - sim_state_type *context; - int base; - int reg; - int value; -{ - put_word_mem_da (context, get_word_reg (context, reg) + base, value); -} - -static INLINE -void -put_byte_mem_x (context, base, reg, value) - sim_state_type *context; - int base; - int reg; - int value; -{ - put_byte_mem_da (context, get_word_reg (context, reg) + base, value); -} - -static INLINE -int -get_word_mem_x (context, base, reg) - sim_state_type *context; - int base; - int reg; -{ - return get_word_mem_da (context, base + get_word_reg (context, reg)); -} - -static INLINE -int -get_byte_mem_x (context, base, reg) - sim_state_type *context; - int base; - int reg; -{ - return get_byte_mem_da (context, base + get_word_reg (context, reg)); -} - -static INLINE -int -get_long_mem_x (context, base, reg) - sim_state_type *context; - int base; - int reg; -{ - return get_long_mem_da (context, base + get_word_reg (context, reg)); -} - - -static -void -makeflags (context, mask) - sim_state_type *context; - int mask; -{ - - PSW_ZERO = (context->dst & mask) == 0; - PSW_SIGN = (context->dst >> (context->size - 1)); - - if (context->broken_flags == TST_FLAGS) - { - extern char the_parity[]; - - if (context->size == 8) - { - PSW_OVERFLOW = the_parity[context->dst & 0xff]; - } - } - else - { - /* Overflow is set if both operands have the same sign and the - result is of different sign. - - V = A==B && R!=B jumping logic - (~(A^B))&(R^B) - V = (A^B)^(R^B) boolean - */ - - PSW_OVERFLOW = - (( - (~(context->srca ^ context->srcb) - & (context->srca ^ context->dst)) - ) >> (context->size - 1) - ); - - if (context->size < 32) - { - PSW_CARRY = ((context->dst >> context->size)) & 1; - } - else - { - /* carry is set when the result is smaller than a source */ - - - PSW_CARRY = (unsigned) context->dst > (unsigned) context->srca ; - - } - } - context->broken_flags = 0; -} - - -/* There are two ways to calculate the flags. We can - either always calculate them and so the cc will always - be correct, or we can only keep the arguments around and - calc the flags when they're actually going to be used. */ - -/* Right now we always calc the flags - I think it may be faster*/ - - -#define NORMAL_FLAGS(c,s,d,sa,sb,sub) \ - if (s == 8) \ - normal_flags_8(c,d,sa,sb,sub); \ - else if (s == 16) \ - normal_flags_16(c,d,sa,sb,sub); \ - else if (s == 32) \ - normal_flags_32(c,d,sa,sb,sub); - -static INLINE -void -normal_flags (context, size, dst, srca, srcb) - sim_state_type *context; - int size; - int dst; - int srca; - int srcb; -{ - context->srca = srca; - context->srcb = srcb; - context->dst = dst; - context->size = size; - context->broken_flags = CMP_FLAGS; -} - -static INLINE -void -TEST_NORMAL_FLAGS (context, size, dst) - sim_state_type *context; - int size; - int dst; -{ - context->dst = dst; - context->size = size; - context->broken_flags = TST_FLAGS; -} - -static INLINE -void -put_ptr_long_reg (context, reg, val) - sim_state_type *context; - int reg; - int val; -{ - context->regs[reg].word = (val >> 8) & 0x7f00; - context->regs[reg + 1].word = val; -} - -static INLINE -long -get_ptr_long_reg (context, reg) - sim_state_type *context; - int reg; -{ - int val; - - val = (context->regs[reg].word << 8) | context->regs[reg + 1].word; - return val; -} - -static INLINE -long -get_ptr_long_mem_ir (context, reg) -sim_state_type *context; -int reg; -{ - return sitoptr (get_long_mem_da (context, get_ptr_long_reg (context, reg))); -} - -static INLINE -long -get_ptr_long_mem_da (context, addr) -sim_state_type *context; -long addr; -{ - return sitoptr (get_long_mem_da (context, addr)); -} - -static INLINE -void -put_ptr_long_mem_da (context, addr, ptr) -sim_state_type *context; -long addr; -long ptr; -{ - put_long_mem_da (context, addr, ptrtosi (ptr)); - -} diff --git a/sim/z8k/mem.c b/sim/z8k/mem.c deleted file mode 100644 index 6942a66..0000000 --- a/sim/z8k/mem.c +++ /dev/null @@ -1,126 +0,0 @@ -/* memory support for Z8KSIM - Copyright (C) 1987, 1992 Free Software Foundation, Inc. - -This file is part of Z8KSIM - -Z8KSIM is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -Z8KSIM is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with Z8KZIM; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#include "config.h" - -#include <ansidecl.h> - -#ifdef HAVE_STDLIB_H -#include <stdlib.h> -#endif - -#include "tm.h" -#include "mem.h" -#include "sim.h" - -#define INLINE -static -long -sitoptr (si) -long si; -{ - return ((si & 0xff000000) >> 8) | (si & 0xffff); -} - -static -unsigned short * -get_page_and_offset (context, where, offset_ptr) - sim_state_type *context; - sim_phys_addr_type where; - int *offset_ptr; -{ - /* Is the page allocated ? */ - - if (context->memory == 0) - { - /* Must allocate 16MB in order to run Z8001 programs. */ - context->memory = (unsigned short *)calloc(64*1024*64,4); - } - - *offset_ptr = sitoptr(where); - return context->memory; -} - -void -sim_write_byte (context, where, what) - sim_state_type *context; - sim_phys_addr_type where; - int what; -{ - unsigned int offset; - char *ptr = (char *)get_page_and_offset (context, where, &offset); - - ptr[offset] = what; -} - -void -sim_write_short (context, where, what) - sim_state_type *context; - sim_phys_addr_type where; - int what; -{ - int offset; - char *ptr = (char *)get_page_and_offset (context, where, &offset); - - ptr[offset] = what >> 8; - ptr[offset + 1] = what; -} - -void -sim_write_long (context, where, what) - sim_state_type *context; - sim_phys_addr_type where; - int what; -{ - int offset; - char *ptr = (char *)get_page_and_offset (context, where, &offset); - - ptr[offset] = what >> 24; - ptr[offset + 1] = what >> 16; - ptr[offset + 3] = what >> 8; - ptr[offset + 4] = what; -} - -int -sim_read_byte (context, where) - sim_state_type *context; - sim_phys_addr_type where; -{ - int offset; - char *ptr = (char *)get_page_and_offset (context, where, &offset); - - return ptr[offset]; -} - -unsigned -sim_read_short (context, where) - sim_state_type *context; - sim_phys_addr_type where; -{ - int what; - int offset; - - char *ptr = (char *)get_page_and_offset (context, where, &offset); - - what = (ptr[offset] << 8) | ptr[offset + 1]; - return what; -} - - - diff --git a/sim/z8k/mem.h b/sim/z8k/mem.h deleted file mode 100644 index 2089bd4..0000000 --- a/sim/z8k/mem.h +++ /dev/null @@ -1,8 +0,0 @@ -#define Z8k_PAGE_SIZE (1<<PAGE_POWER) - -int sim_read_byte PARAMS((sim_state_type *, sim_phys_addr_type)); -unsigned int sim_read_short PARAMS((sim_state_type *, sim_phys_addr_type)); -void sim_write_long PARAMS((sim_state_type *, sim_phys_addr_type, - int)); -void sim_write_short PARAMS((sim_state_type *, sim_phys_addr_type, int)); -void sim_write_byte PARAMS((sim_state_type *, sim_phys_addr_type, int)); diff --git a/sim/z8k/quick.c b/sim/z8k/quick.c deleted file mode 100644 index e847c7d..0000000 --- a/sim/z8k/quick.c +++ /dev/null @@ -1,783 +0,0 @@ -/* list of opcodes to compile all the way */ -int quick[]= -{ -#if 0 - /* 110000*/ 0xc, - /* 35*/ 0x104, - /* 4*/ 0x105, - /* 3*/ 0x107, - /* 20*/ 0x10d, - /* 2*/ 0x1dc, - /* 69*/ 0x20f, - /* 1*/ 0x40d, - /* 40*/ 0x501, - /* 7*/ 0x504, - /* 7*/ 0x505, - /* 6*/ 0x508, - /* 6*/ 0x509, - /* 8*/ 0x609, - /* 118*/ 0x60c, - /* 2*/ 0x702, - /* 85*/ 0x704, - /* 88*/ 0x705, - /* 3*/ 0x707, - /* 5*/ 0x708, - /* 4*/ 0x709, - /* 110000*/ 0xa08, - /* 101571*/ 0xa09, - /* 110000*/ 0xa0c, - /* 100000*/ 0xa0f, - /* 300000*/ 0xa6d, - /* 101681*/ 0xb02, - /* 100077*/ 0xb04, - /* 8*/ 0xb05, - /* 110000*/ 0xb07, - /* 10005*/ 0xb08, - /* 140000*/ 0xb0a, - /* 100036*/ 0xb0c, - /* 100042*/ 0xb0d, - /* 3*/ 0xc25, - /* 105158*/ 0xc58, - /* 300236*/ 0xc74, - /* 20*/ 0xd41, - /* 100008*/ 0xd45, - /* 10*/ 0xd51, - /* 10*/ 0xd54, - /* 110000*/ 0xdc5, - /* 100000*/ 0xdd5, - /* 79*/ 0xdf9, - /* 6*/ 0x1004, - /* 53*/ 0x1008, - /* 5*/ 0x13f4, - /* 1*/ 0x1402, - /* 2*/ 0x1404, - /* 2*/ 0x1406, - /* 7*/ 0x1408, - /* 4*/ 0x1606, - /* 72*/ 0x1e48, - /* 6*/ 0x1f40, - /* 100006*/ 0x205e, - /* 2*/ 0x2068, - /* 110000*/ 0x206c, - /* 110000*/ 0x207c, - /* 300000*/ 0x207d, - /* 101642*/ 0x2088, - /* 101539*/ 0x2089, - /* 101679*/ 0x208c, - /* 40*/ 0x209c, - /* 8*/ 0x2102, - /* 120009*/ 0x2104, - /* 110003*/ 0x2105, - /* 130000*/ 0x2106, - /* 110068*/ 0x2107, - /* 32*/ 0x2108, - /* 1*/ 0x2109, - /* 105*/ 0x210c, - /* 1*/ 0x210d, - /* 3*/ 0x2126, - /* 3*/ 0x2142, - /* 120002*/ 0x2144, - /* 100012*/ 0x2145, - /* 10000*/ 0x2147, - /* 100000*/ 0x2148, - /* 6*/ 0x2156, - /* 100000*/ 0x2157, - /* 100000*/ 0x2158, - /* 101677*/ 0x2165, - /* 100000*/ 0x2168, - /* 110000*/ 0x2174, - /* 2*/ 0x2190, - /* 2*/ 0x2198, - /* 2*/ 0x21c4, - /* 2*/ 0x21c5, - /* 110000*/ 0x21c8, - /* 110000*/ 0x21ca, - /* 2*/ 0x21cd, - /* 100002*/ 0x21d7, - /* 100000*/ 0x21dc, - /* 101677*/ 0x2960, - /* 2*/ 0x29c0, - /* 4*/ 0x2e48, - /* 101677*/ 0x2e5c, - /* 100000*/ 0x2e7c, - /* 31*/ 0x2f24, - /* 1*/ 0x2f28, - /* 100000*/ 0x2f45, - /* 3*/ 0x2f46, - /* 100000*/ 0x2f47, - /* 100000*/ 0x2f48, - /* 100000*/ 0x2f54, - /* 130000*/ 0x2f56, - /* 100000*/ 0x2f58, - /* 10000*/ 0x2f64, - /* 100000*/ 0x2f65, - /* 100000*/ 0x2f72, - /* 110000*/ 0x2f74, - /* 10000*/ 0x2f78, - /* 110000*/ 0x2fa4, - /* 110000*/ 0x2fa8, - /* 1*/ 0x2fc2, - /* 100000*/ 0x2fc4, - /* 100000*/ 0x2fc7, - /* 2*/ 0x2fc8, - /* 110000*/ 0x2fca, - /* 100002*/ 0x2fdc, - /* 77*/ 0x3144, - /* 3*/ 0x3146, - /* 2*/ 0x3342, - /* 3*/ 0x3346, - /* 100000*/ 0x3445, - /* 2*/ 0x3454, - /* 100000*/ 0x3456, - /* 10000*/ 0x3458, - /* 6*/ 0x3459, - /* 100000*/ 0x3464, - /* 100000*/ 0x3468, - /* 10000*/ 0x3485, - /* 100000*/ 0x3486, - /* 1*/ 0x34a0, - /* 110026*/ 0x34a4, - /* 110069*/ 0x34a5, - /* 110014*/ 0x34a6, - /* 20038*/ 0x34a7, - /* 1*/ 0x34a9, - /* 1*/ 0x34ad, - /* 100000*/ 0x34c4, - /* 100000*/ 0x34c5, - /* 2*/ 0x34d4, - /* 100000*/ 0x34f5, - /* 100000*/ 0x34f7, - /* 4*/ 0x4102, - /* 4*/ 0x4104, - /* 1*/ 0x4169, - /* 110000*/ 0x41a4, - /* 100000*/ 0x41a5, - /* 100000*/ 0x41a6, - /* 100000*/ 0x41a8, - /* 100000*/ 0x41f4, - /* 100000*/ 0x4302, - /* 100000*/ 0x4305, - /* 110000*/ 0x4308, - /* 1*/ 0x4369, - /* 1*/ 0x43a4, - /* 100000*/ 0x43a5, - /* 100000*/ 0x43a8, - /* 100000*/ 0x43a9, - /* 120000*/ 0x43ac, - /* 2*/ 0x43c5, - /* 100000*/ 0x43f5, - /* 100000*/ 0x43fa, - /* 110000*/ 0x4504, - /* 4*/ 0x45a1, - /* 18*/ 0x45a4, - /* 100018*/ 0x45a5, - /* 1*/ 0x4968, - /* 130000*/ 0x4a08, - /* 100000*/ 0x4a0b, - /* 100000*/ 0x4aac, - /* 3*/ 0x4b68, - /* 100000*/ 0x4ba8, - /* 100000*/ 0x4ba9, - /* 4*/ 0x4bc5, - /* 110000*/ 0x4c01, - /* 120000*/ 0x4c05, - /* 32*/ 0x4c78, - /* 100000*/ 0x4ca1, - /* 100000*/ 0x4ca5, - /* 1*/ 0x4cc4, - /* 20*/ 0x4cd4, - /* 110007*/ 0x4d04, - /* 110004*/ 0x4d05, - /* 110000*/ 0x4d08, - /* 2*/ 0x4d25, - /* 1*/ 0x4d28, - /* 8*/ 0x4d41, - /* 100000*/ 0x4d44, - /* 100000*/ 0x4d45, - /* 101679*/ 0x4d64, - /* 100034*/ 0x4da1, - /* 110005*/ 0x4da4, - /* 140014*/ 0x4da5, - /* 100001*/ 0x4da8, - /* 100003*/ 0x4dc4, - /* 110000*/ 0x4dc5, - /* 2*/ 0x4dd4, - /* 100000*/ 0x4dd5, - /* 100000*/ 0x4df5, - /* 3*/ 0x4e2d, - /* 30000*/ 0x4ea8, - /* 52*/ 0x4ea9, - /* 100000*/ 0x4eab, - /* 100000*/ 0x4eac, - /* 32*/ 0x4ead, - /* 100000*/ 0x4eae, - /* 100000*/ 0x4eaf, - /* 2*/ 0x4ec8, - /* 2*/ 0x4ecd, - /* 3*/ 0x50a6, - /* 32*/ 0x50a8, - /* 1*/ 0x520c, - /* 18*/ 0x52a8, - /* 2*/ 0x53f0, - /* 6*/ 0x53f4, - /* 3*/ 0x53fa, - /* 1*/ 0x5406, - /* 8*/ 0x5448, - /* 4*/ 0x54a2, - /* 42*/ 0x54a4, - /* 10*/ 0x54a6, - /* 322*/ 0x54a8, - /* 3*/ 0x56a4, - /* 3*/ 0x56a6, - /* 110000*/ 0x59a4, - /* 100000*/ 0x59f4, - /* 4*/ 0x5d02, - /* 1*/ 0x5d0c, - /* 2*/ 0x5d48, - /* 33*/ 0x5da4, - /* 48*/ 0x5da6, - /* 213*/ 0x5da8, - /* 32*/ 0x5e01, - /* 110005*/ 0x5e02, - /* 100005*/ 0x5e03, - /* 101728*/ 0x5e06, - /* 31*/ 0x5e07, - /* 100266*/ 0x5e08, - /* 100006*/ 0x5e09, - /* 100033*/ 0x5e0a, - /* 100080*/ 0x5e0b, - /* 100030*/ 0x5e0e, - /* 1*/ 0x5e0f, - /* 262032*/ 0x5f00, - /* 110000*/ 0x6008, - /* 100000*/ 0x6009, - /* 2*/ 0x600c, - /* 110000*/ 0x604c, - /* 4*/ 0x604d, - /* 6*/ 0x606f, - /* 36*/ 0x6089, - /* 140064*/ 0x60a8, - /* 48*/ 0x60a9, - /* 100096*/ 0x60ac, - /* 100000*/ 0x60ad, - /* 2*/ 0x60c8, - /* 19*/ 0x60cc, - /* 2*/ 0x60cd, - /* 8*/ 0x60dc, - /* 120009*/ 0x6104, - /* 120032*/ 0x6105, - /* 110001*/ 0x6106, - /* 110000*/ 0x6107, - /* 2*/ 0x6108, - /* 1*/ 0x6109, - /* 1*/ 0x610d, - /* 1*/ 0x610f, - /* 4*/ 0x6145, - /* 100000*/ 0x6147, - /* 2*/ 0x614c, - /* 2*/ 0x614d, - /* 100000*/ 0x6157, - /* 100002*/ 0x6158, - /* 3*/ 0x6159, - /* 6*/ 0x6165, - /* 12*/ 0x6168, - /* 32*/ 0x6181, - /* 4*/ 0x6191, - /* 2*/ 0x6194, - /* 2*/ 0x6198, - /* 68*/ 0x61a0, - /* 101682*/ 0x61a1, - /* 110066*/ 0x61a2, - /* 100040*/ 0x61a3, - /* 120232*/ 0x61a4, - /* 110172*/ 0x61a5, - /* 101800*/ 0x61a6, - /* 110119*/ 0x61a7, - /* 143923*/ 0x61a8, - /* 110098*/ 0x61a9, - /* 44*/ 0x61ac, - /* 4*/ 0x61c0, - /* 2*/ 0x61c4, - /* 1*/ 0x61c5, - /* 110002*/ 0x61c7, - /* 3*/ 0x61c8, - /* 100000*/ 0x61d4, - /* 2*/ 0x61d8, - /* 2*/ 0x61dc, - /* 100000*/ 0x61f3, - /* 100000*/ 0x61f4, - /* 100000*/ 0x61f5, - /* 100000*/ 0x61f7, - /* 100000*/ 0x61fb, - /* 100000*/ 0x68a0, - /* 110000*/ 0x6940, - /* 110032*/ 0x69a0, - /* 100000*/ 0x69f0, - /* 2*/ 0x6b40, - /* 101679*/ 0x6b60, - /* 100044*/ 0x6ba0, - /* 2*/ 0x6bc0, - /* 6*/ 0x6f02, - /* 120000*/ 0x6f04, - /* 100002*/ 0x6f05, - /* 7*/ 0x6f45, - /* 110000*/ 0x6f47, - /* 100007*/ 0x6f48, - /* 15*/ 0x6f49, - /* 100000*/ 0x6f4b, - /* 100000*/ 0x6f54, - /* 100000*/ 0x6f58, - /* 10000*/ 0x6f64, - /* 10000*/ 0x6f68, - /* 2*/ 0x6f94, - /* 145*/ 0x6fa0, - /* 101714*/ 0x6fa1, - /* 94*/ 0x6fa2, - /* 120060*/ 0x6fa4, - /* 100109*/ 0x6fa5, - /* 100123*/ 0x6fa6, - /* 100157*/ 0x6fa7, - /* 111842*/ 0x6fa8, - /* 100091*/ 0x6fa9, - /* 4*/ 0x6fc0, - /* 1*/ 0x6fc2, - /* 1*/ 0x6fc5, - /* 1*/ 0x6fcd, - /* 2*/ 0x6fd8, - /* 100000*/ 0x6ff4, - /* 56*/ 0x705c, - /* 100000*/ 0x706d, - /* 100000*/ 0x7078, - /* 100000*/ 0x708d, - /* 100000*/ 0x708e, - /* 100000*/ 0x709e, - /* 110000*/ 0x70dd, - /* 110000*/ 0x7157, - /* 100000*/ 0x715b, - /* 56*/ 0x727c, - /* 120000*/ 0x7348, - /* 31*/ 0x7424, - /* 100000*/ 0x7446, - /* 100000*/ 0x7447, - /* 10000*/ 0x7449, - /* 120000*/ 0x7454, - /* 2*/ 0x7468, - /* 32*/ 0x7472, - /* 110000*/ 0x74a4, - /* 100000*/ 0x74b4, - /* 100000*/ 0x74b5, - /* 10*/ 0x74c2, - /* 100000*/ 0x74c4, - /* 32*/ 0x74d4, - /* 1*/ 0x7f01, - /* 2*/ 0x7f04, - /* 2*/ 0x7f13, - /* 1*/ 0x7f16, - /* 2*/ 0x7f17, - /* 2*/ 0x8128, - /* 190091*/ 0x8144, - /* 100000*/ 0x8145, - /* 100000*/ 0x8154, - /* 110000*/ 0x8155, - /* 100000*/ 0x8156, - /* 100000*/ 0x8164, - /* 100000*/ 0x8165, - /* 110000*/ 0x8166, - /* 100000*/ 0x8167, - /* 140000*/ 0x8176, - /* 100000*/ 0x8177, - /* 130000*/ 0x8184, - /* 40*/ 0x818c, - /* 100000*/ 0x8194, - /* 110000*/ 0x81b4, - /* 100000*/ 0x81bb, - /* 2*/ 0x81c9, - /* 36*/ 0x81d0, - /* 4*/ 0x81d1, - /* 40*/ 0x81dc, - /* 111677*/ 0x8222, - /* 110076*/ 0x8244, - /* 100038*/ 0x8255, - /* 110006*/ 0x8266, - /* 131679*/ 0x8277, - /* 107*/ 0x8300, - /* 131*/ 0x8311, - /* 140015*/ 0x8322, - /* 2*/ 0x832d, - /* 110056*/ 0x8342, - /* 100019*/ 0x8344, - /* 100000*/ 0x8352, - /* 100000*/ 0x8354, - /* 110003*/ 0x8355, - /* 100001*/ 0x8366, - /* 6*/ 0x8377, - /* 71*/ 0x8388, - /* 2*/ 0x838d, - /* 34*/ 0x8399, - /* 100000*/ 0x83a4, - /* 120002*/ 0x83c4, - /* 4*/ 0x83c8, - /* 113*/ 0x83cc, - /* 2*/ 0x83d4, - /* 4*/ 0x84c9, - /* 4*/ 0x84d9, - /* 3*/ 0x8524, - /* 4*/ 0x8559, - /* 100000*/ 0x8adc, - /* 10000*/ 0x8ae8, - /* 100000*/ 0x8ae9, - /* 130000*/ 0x8aef, - /* 100000*/ 0x8af8, - /* 2*/ 0x8b26, - /* 20000*/ 0x8b28, - /* 1*/ 0x8b45, - /* 100000*/ 0x8b48, - /* 32*/ 0x8b49, - /* 20000*/ 0x8b56, - /* 10000*/ 0x8b58, - /* 100000*/ 0x8b59, - /* 105158*/ 0x8b65, - /* 100000*/ 0x8b68, - /* 2*/ 0x8b75, - /* 2*/ 0x8b82, - /* 260*/ 0x8b8c, - /* 100000*/ 0x8ba3, - /* 100000*/ 0x8bab, - /* 100000*/ 0x8bc2, - /* 100000*/ 0x8bc3, - /* 10000*/ 0x8bc8, - /* 10002*/ 0x8bc9, - /* 2*/ 0x8bd5, - /* 4*/ 0x8bd9, - /* 32*/ 0x8bdc, - /* 101674*/ 0x8c84, - /* 100063*/ 0x8cc4, - /* 1*/ 0x8ce2, - /* 100000*/ 0x8ce4, - /* 32*/ 0x8d04, - /* 107*/ 0x8d14, - /* 140019*/ 0x8d24, - /* 20*/ 0x8d28, - /* 100040*/ 0x8d44, - /* 120003*/ 0x8d48, - /* 110013*/ 0x8d54, - /* 2*/ 0x8d58, - /* 2*/ 0x8d62, - /* 100088*/ 0x8d64, - /* 218*/ 0x8d84, - /* 91*/ 0x8dc4, - /* 85*/ 0x8dd4, - /* 110127*/ 0x91fc, - /* 1*/ 0x93f0, - /* 36*/ 0x93f1, - /* 3*/ 0x93f4, - /* 1*/ 0x93f8, - /* 6*/ 0x93f9, - /* 142037*/ 0x93fa, - /* 120015*/ 0x93fc, - /* 100000*/ 0x9420, - /* 4*/ 0x9426, - /* 1*/ 0x942c, - /* 42*/ 0x9446, - /* 1*/ 0x9462, - /* 3*/ 0x9464, - /* 1*/ 0x94c4, - /* 1*/ 0x94c6, - /* 110126*/ 0x95fc, - /* 3*/ 0x9646, - /* 32*/ 0x9666, - /* 110*/ 0x9688, - /* 142033*/ 0x97fa, - /* 120014*/ 0x97fc, - /* 1*/ 0x9a40, - /* 110112*/ 0x9b20, - /* 100000*/ 0x9b40, - /* 64*/ 0x9c48, - /* 38*/ 0x9c88, - /* 100000*/ 0x9e06, - /* 262035*/ 0x9e08, - /* 110000*/ 0x9e0e, - /* 100002*/ 0xa08c, - /* 32*/ 0xa08d, - /* 20000*/ 0xa08f, - /* 8*/ 0xa0ac, - /* 111681*/ 0xa0ca, - /* 100000*/ 0xa0cd, - /* 110001*/ 0xa0ce, - /* 101684*/ 0xa0cf, - /* 100032*/ 0xa0dc, - /* 110000*/ 0xa0df, - /* 100000*/ 0xa0ec, - /* 100006*/ 0xa0ed, - /* 101677*/ 0xa0fc, - /* 6*/ 0xa0fe, - /* 100056*/ 0xa104, - /* 100000*/ 0xa105, - /* 100000*/ 0xa108, - /* 110000*/ 0xa114, - /* 100000*/ 0xa115, - /* 56*/ 0xa116, - /* 100032*/ 0xa124, - /* 76*/ 0xa12d, - /* 1*/ 0xa134, - /* 40*/ 0xa13d, - /* 100000*/ 0xa141, - /* 100041*/ 0xa142, - /* 1*/ 0xa143, - /* 1*/ 0xa144, - /* 110009*/ 0xa145, - /* 100007*/ 0xa146, - /* 100008*/ 0xa147, - /* 110000*/ 0xa148, - /* 100000*/ 0xa149, - /* 100000*/ 0xa14a, - /* 100000*/ 0xa14b, - /* 110000*/ 0xa14c, - /* 100002*/ 0xa14d, - /* 100000*/ 0xa150, - /* 100004*/ 0xa154, - /* 100000*/ 0xa156, - /* 100006*/ 0xa157, - /* 100000*/ 0xa158, - /* 100000*/ 0xa159, - /* 100000*/ 0xa15a, - /* 110000*/ 0xa15c, - /* 100002*/ 0xa15d, - /* 112*/ 0xa161, - /* 120006*/ 0xa164, - /* 100006*/ 0xa165, - /* 100000*/ 0xa167, - /* 6*/ 0xa168, - /* 10000*/ 0xa16b, - /* 120012*/ 0xa16c, - /* 100062*/ 0xa172, - /* 60*/ 0xa174, - /* 100000*/ 0xa175, - /* 100000*/ 0xa176, - /* 6*/ 0xa179, - /* 110000*/ 0xa17a, - /* 110008*/ 0xa17c, - /* 110014*/ 0xa17d, - /* 110000*/ 0xa184, - /* 110000*/ 0xa185, - /* 20000*/ 0xa186, - /* 100004*/ 0xa189, - /* 100000*/ 0xa18b, - /* 4*/ 0xa191, - /* 56*/ 0xa192, - /* 100000*/ 0xa1a1, - /* 100000*/ 0xa1a5, - /* 110000*/ 0xa1a6, - /* 110000*/ 0xa1a7, - /* 112033*/ 0xa1af, - /* 10000*/ 0xa1c1, - /* 100062*/ 0xa1c2, - /* 110009*/ 0xa1c4, - /* 110005*/ 0xa1c5, - /* 120000*/ 0xa1c6, - /* 15*/ 0xa1c7, - /* 4*/ 0xa1d0, - /* 2*/ 0xa1d2, - /* 4*/ 0xa1d4, - /* 100004*/ 0xa1d5, - /* 120036*/ 0xa1d6, - /* 110004*/ 0xa1d7, - /* 112038*/ 0xa1fa, - /* 20000*/ 0xa880, - /* 101499*/ 0xa910, - /* 3*/ 0xa921, - /* 100002*/ 0xa940, - /* 100000*/ 0xa941, - /* 100000*/ 0xa943, - /* 100000*/ 0xa945, - /* 110000*/ 0xa949, - /* 105160*/ 0xa950, - /* 120000*/ 0xa955, - /* 100000*/ 0xa959, - /* 310005*/ 0xa960, - /* 100000*/ 0xa965, - /* 1*/ 0xa967, - /* 290180*/ 0xa970, - /* 130000*/ 0xa971, - /* 3*/ 0xa974, - /* 111751*/ 0xa980, - /* 100036*/ 0xa981, - /* 100000*/ 0xa984, - /* 1*/ 0xa987, - /* 100040*/ 0xa990, - /* 5*/ 0xa991, - /* 2*/ 0xa993, - /* 1*/ 0xa997, - /* 110000*/ 0xa9a0, - /* 100194*/ 0xa9c0, - /* 100000*/ 0xa9d0, - /* 63*/ 0xa9f1, - /* 40*/ 0xa9f3, - /* 110000*/ 0xab40, - /* 100004*/ 0xab50, - /* 56*/ 0xab80, - /* 55*/ 0xabc0, - /* 100069*/ 0xabf1, - /* 100000*/ 0xabf3, - /* 100001*/ 0xabf5, - /* 100006*/ 0xabf7, - /* 50*/ 0xabf9, - /* 100014*/ 0xabfb, - /* 2*/ 0xabfd, - /* 2*/ 0xabff, - /* 20*/ 0xaf26, - /* 120000*/ 0xaf46, - /* 3*/ 0xaf47, - /* 1*/ 0xaf56, - /* 1*/ 0xaf5e, - /* 1*/ 0xb107, - /* 110112*/ 0xb10a, - /* 4*/ 0xb120, - /* 100001*/ 0xb12a, - /* 3*/ 0xb14a, - /* 5*/ 0xb170, - /* 1*/ 0xb18a, - /* 4*/ 0xb2d1, - /* 6*/ 0xb2e1, - /* 2*/ 0xb345, - /* 1*/ 0xb347, - /* 130000*/ 0xb349, - /* 4*/ 0xb359, - /* 2*/ 0xb35b, - /* 100006*/ 0xb369, - /* 6*/ 0xb36d, - /* 100017*/ 0xb379, - /* 2*/ 0xb37b, - /* 67*/ 0xb385, - /* 2*/ 0xb3cb, - /* 120002*/ 0xba51, - /* 110000*/ 0xbd21, - /* 2*/ 0xbd32, - /* 100000*/ 0xbd41, - /* 100000*/ 0xbd4a, - /* 2*/ 0xbd51, - /* 100000*/ 0xbd5a, - /* 2*/ 0xbd5b, - /* 4*/ 0xbd61, - /* 110000*/ 0xbd6a, - /* 2*/ 0xbd71, - /* 110000*/ 0xbd7a, - /* 1*/ 0xbd91, - /* 32*/ 0xbd9a, - /* 110000*/ 0xbda2, - /* 100000*/ 0xbda3, - /* 34*/ 0xbdc1, - /* 100000*/ 0xbdc2, - /* 110000*/ 0xbdc3, - /* 120000*/ 0xc841, - /* 100000*/ 0xcb41, - /* 110000*/ 0xcc41, - /* 110000*/ 0xce41, - /* 100000*/ 0xcf41, - /* 2*/ 0xe106, - /* 3*/ 0xe10a, - /* 110000*/ 0xe1ea, - /* 220*/ 0xe1ec, - /* 40*/ 0xe1f2, - /* 2*/ 0xe202, - /* 40*/ 0xe203, - /* 32*/ 0xe204, - /* 2*/ 0xe2ea, - /* 100000*/ 0xe2ec, - /* 110000*/ 0xe2ee, - /* 120000*/ 0xe2f9, - /* 100000*/ 0xe2fb, - /* 30000*/ 0xe3db, - /* 7*/ 0xe602, - /* 300128*/ 0xe603, - /* 15*/ 0xe604, - /* 110002*/ 0xe605, - /* 32*/ 0xe606, - /* 72*/ 0xe607, - /* 3*/ 0xe608, - /* 101624*/ 0xe609, - /* 34*/ 0xe60a, - /* 110002*/ 0xe60b, - /* 100040*/ 0xe60c, - /* 120000*/ 0xe60d, - /* 1*/ 0xe60e, - /* 1*/ 0xe60f, - /* 3*/ 0xe610, - /* 40*/ 0xe614, - /* 2*/ 0xe616, - /* 2*/ 0xe619, - /* 30*/ 0xe622, - /* 3*/ 0xe62c, - /* 180*/ 0xe62d, - /* 4*/ 0xe632, - /* 2*/ 0xe639, - /* 56*/ 0xe63a, - /* 40*/ 0xe640, - /* 2*/ 0xe6f2, - /* 300000*/ 0xe6f9, - /* 4*/ 0xe706, - /* 105158*/ 0xe7fc, - /* 100045*/ 0xe801, - /* 121677*/ 0xe802, - /* 110000*/ 0xe803, - /* 110002*/ 0xe804, - /* 110000*/ 0xe806, - /* 42*/ 0xe808, - /* 40*/ 0xe80a, - /* 2*/ 0xe80e, - /* 40*/ 0xe810, - /* 103*/ 0xe815, - /* 1*/ 0xe81b, - /* 2*/ 0xe81c, - /* 10000*/ 0xe820, - /* 2*/ 0xe831, - /* 2*/ 0xe83b, - /* 34*/ 0xe901, - /* 32*/ 0xe903, - /* 1*/ 0xe906, - /* 101679*/ 0xe908, - /* 32*/ 0xe90f, - /* 110000*/ 0xe916, - /* 24*/ 0xe9ee, - /* 22*/ 0xe9ef, - /* 110000*/ 0xea02, - /* 110000*/ 0xea03, - /* 100000*/ 0xea11, - /* 110000*/ 0xea13, - /* 4*/ 0xeaee, - /* 33*/ 0xeaf9, - /* 110000*/ 0xeb01, - /* 100000*/ 0xeb24, - /* 100000*/ 0xeb26, - /* 40*/ 0xebbf, - /* 110000*/ 0xee01, - /* 110002*/ 0xee02, - /* 8*/ 0xee03, - /* 130076*/ 0xee04, - /* 6*/ 0xee05, - /* 110002*/ 0xee06, - /* 1*/ 0xee0b, - /* 4*/ 0xee0e, - /* 1*/ 0xee0f, - /* 20000*/ 0xee11, - /* 100000*/ 0xee14, - /* 110000*/ 0xee15, - /* 1*/ 0xee18, - /* 1*/ 0xee27, - /* 1*/ 0xee2d, - /* 103*/ 0xee33, - /* 2*/ 0xee3b, - /* 1*/ 0xee42, - /* 3*/ 0xeee1, - /* 101539*/ 0xeee2, - /* 110000*/ 0xeef4, - /* 2*/ 0xeef9, - /* 100000*/ 0xeefa, - /* 14*/ 0xeefc, - /* 180*/ 0xeefd, - /* 2*/ 0xef02, - /* 1*/ 0xef04, - /* 2*/ 0xef11, - /* 2*/ 0xef15, -#endif - 0,}; diff --git a/sim/z8k/sim.h b/sim/z8k/sim.h deleted file mode 100644 index 65332f5..0000000 --- a/sim/z8k/sim.h +++ /dev/null @@ -1,9 +0,0 @@ -#define SIM_SINGLE_STEP 1 -#define SIM_DONE 2 -#define SIM_BREAKPOINT 3 -#define SIM_INTERRUPT 4 -#define SIM_BAD_INST 5 -#define SIM_DIV_ZERO 6 -#define SIM_BAD_SYSCALL 7 -#define SIM_BAD_ALIGN 8 -#define SIM_BAD_ADDR 9 diff --git a/sim/z8k/support.c b/sim/z8k/support.c deleted file mode 100644 index e3cdc73..0000000 --- a/sim/z8k/support.c +++ /dev/null @@ -1,784 +0,0 @@ -/* support routines for interpreted instructions - Copyright (C) 1992, 1993 Free Software Foundation, Inc. - -This file is part of Z8KSIM - -Z8KSIM is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -Z8KSIM is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with Z8KZIM; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#include "config.h" - -#include <ansidecl.h> -#include <signal.h> -#include <errno.h> - -#include "tm.h" -#include "sim.h" -#include "mem.h" -#include <stdio.h> -#ifdef HAVE_TIME_H -#include <time.h> -#endif -#ifdef HAVE_SYS_TIMES_H -#include <sys/times.h> -#endif -#include <sys/types.h> -#include <sys/stat.h> -#include <sys/param.h> -#include "gdb/callback.h" -#include "gdb/remote-sim.h" -#include "syscall.h" - -static int get_now PARAMS ((void)); -static int now_persec PARAMS ((void)); -static int put_long PARAMS ((sim_state_type * context, int ptr, int value)); -static int put_short PARAMS ((sim_state_type * context, int ptr, int value)); - -int sim_z8001_mode; - -static int -get_now () -{ -#ifdef HAVE_SYS_TIMES_H - struct tms b; - - times (&b); - return b.tms_utime + b.tms_stime; -#else - return time (0); -#endif -} - -static int -now_persec () -{ - return 50; -} - - -/* #define LOG /* define this to print instruction use counts */ - -#ifdef __GNUC__ -#define INLINE __inline__ -#include "inlines.h" -#else -#include "inlines.h" -#endif - -/* This holds the entire cpu context */ -static sim_state_type the_state; - -int -fail (context, dummy) - sim_state_type *context; - int dummy; -{ - context->exception = SIM_BAD_INST; - return 1; -} - -void -sfop_bad1 (context) - sim_state_type *context; -{ - context->exception - = SIM_BAD_INST; -} - -void -bfop_bad1 (context) - sim_state_type *context; -{ - context->exception - = SIM_BAD_INST; -} - -void -fop_bad (context) - sim_state_type *context; -{ - context->exception = - SIM_BAD_INST; -} - -/* Table of bit counts for all byte values */ - -char the_parity[256] = -{ - 0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4, 1, 2, 2, 3, 2, 3, 3, - 4, 2, 3, 3, 4, 3, 4, 4, 5, 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, - 4, 5, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 1, 2, 2, 3, 2, - 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, - 4, 5, 5, 6, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 3, 4, 4, - 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, - 3, 4, 3, 4, 4, 5, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 2, - 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 3, 4, 4, 5, 4, 5, 5, 6, - 4, 5, 5, 6, 5, 6, 6, 7, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, - 6, 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, 3, 4, 4, 5, 4, 5, - 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, 4, 5, 5, 6, 5, 6, 6, 7, 5, 6, 6, 7, 6, - 7, 7, 8}; - - -int read (); -int write (); -int open (); -int close (); -int open (); -int close (); - -int link (); -int fstat (); - -static int -put_short (context, ptr, value) - sim_state_type *context; - int ptr; - int value; -{ - put_word_mem_da (context, ptr, value); - return ptr + 2; -} - -static int -put_long (context, ptr, value) - sim_state_type *context; - int - ptr; - int value; -{ - put_long_mem_da (context, ptr, value); - return ptr + 4; -} - -#define aptr(x) ((sitoptr(x)) + (char *)(context->memory)) - -static int args[3]; -static int arg_index; /* Translate a z8k system call into a host system call */ -void -support_call (context, sc) - sim_state_type *context; - int sc; -{ - extern int errno; - int ret; - int retnext = 0; - int fd; - - int olderrno = errno; - errno = 0; - switch (sc) - { - case SYS_ARG: - args[arg_index++] = context->regs[0].word << 16 | context->regs[1].word; - break; - case SYS_exit: - context->exception = SIM_DONE; - ret = args[0]; - arg_index = 0; - break; - case SYS_close: - ret = close ((int) (args[0])); - arg_index = 0; - break; - case SYS_creat: - ret = creat (aptr (args[0]), args[1]); - arg_index = 0; - break; - case SYS_isatty: - ret = isatty (args[0]); - arg_index = 0; - break; - case SYS_open: - ret = open (aptr (args[0]), args[1], args[2]); - arg_index = 0; - break; - case SYS_lseek: - ret = lseek (args[0], (off_t) args[1], args[2]); - arg_index = 0; - break; - case SYS_read: - ret = read (args[0], aptr (args[1]), args[2]); - arg_index = 0; - break; - case SYS_write: - ret = write (args[0],aptr (args[1]), args[2]); - arg_index = 0; - break; - case SYS_time: - { - int dst = args[0]; - - ret = time (0); - if (dst) - { - put_long_mem_da (context, - sitoptr (dst), ret); - } - retnext = ret; - ret = retnext >> 16; - arg_index = 0; - } - break; - case SYS_fstat: - { - int buf; - struct stat host_stat; - fd = args[0]; - buf = sitoptr (args[1]); - ret = fstat (fd, &host_stat); - buf = put_short (context, buf, host_stat.st_dev); - buf = put_short (context, buf, host_stat.st_ino); - /* FIXME: Isn't mode_t 4 bytes? */ - buf = put_short (context, buf, host_stat.st_mode); - buf = put_short (context, buf, host_stat.st_nlink); - buf = put_short (context, buf, host_stat.st_uid); - buf = put_short (context, buf, host_stat.st_uid); - buf = put_short (context, buf, host_stat.st_rdev); - buf = put_long (context, buf, host_stat.st_size); - buf = put_long (context, buf, host_stat.st_atime); - arg_index = 0; - } break; - default: - case SYS_link: - context->exception = SIM_BAD_SYSCALL; - arg_index = 0; - break; - } - context->regs[2].word = ret; - context->regs[3].word = retnext; - context->regs[5].word = errno; - - - /* support for the stdcall calling convention */ - context->regs[6].word = retnext; - context->regs[7].word = ret; - - errno = olderrno; -} - -#undef get_word_mem_da - -int -get_word_mem_da (context, addr) - sim_state_type *context; - int addr; -{ - return (get_byte_mem_da (context, addr) << 8) | (get_byte_mem_da (context, addr + 1)); - -} - -#undef get_word_reg -int -get_word_reg (context, reg) sim_state_type -* context; - int reg; -{ - return context->regs[reg].word; -} - -#ifdef LOG -int log[64 * 1024]; - -#endif - -void -tm_store_register (regno, value) - int regno; - int value; -{ - switch - (regno) - { - case REG_PC: - the_state.sometimes_pc = value; - break; - - default: - put_word_reg (&the_state, regno, value); - } -} - -void -swap_long (buf, val) - char *buf; - int val; -{ - buf[0] = val >> 24; - buf[1] = val >> 16; - buf[2] = val >> 8; - buf[3] = val >> 0; -} - -void -swap_word (buf, val) - char *buf; - int val; -{ - buf[0] = val >> 8; - buf[1] = val >> 0; -} - -void -tm_fetch_register (regno, buf) - int regno; - char *buf; -{ - switch - (regno) - { - case REG_CYCLES: - swap_long (buf, the_state.cycles); - break; - case REG_INSTS: - swap_long (buf, the_state.insts); - break; - case - REG_TIME: - swap_long (buf, the_state.ticks); - break; - case REG_PC: - swap_long (buf, the_state.sometimes_pc); - break; - case REG_SP: - { - if (sim_z8001_mode) - { - swap_long (buf, get_long_reg (&the_state, 14)); - } - else - { - swap_long (buf, get_word_reg (&the_state, 15)); - } - } - break; - case - REG_FP: - { - if (sim_z8001_mode) - { - swap_long (buf, get_long_reg - (&the_state, 10)); - } - else - { - swap_long (buf, - get_word_reg (&the_state, 10)); - } - } - break; - default: - { - swap_word (buf, - get_word_reg (&the_state, regno)); - } - } -} - -void -tm_resume (step) - int step; -{ - int now = get_now (); - struct op_info - *p; - int word; - int pc; - extern int (*(sfop_table[])) (); - extern int (*(bfop_table[])) (); - int (*((*table))) (); - sim_state_type *context = &the_state; - - if (step) - { - context->exception = SIM_SINGLE_STEP; - } - else - { - context->exception = 0; - } - - pc = context->sometimes_pc; - if (sim_z8001_mode) - { - table = bfop_table; - pc = MAP_PHYSICAL_TO_LOGICAL (pc); - } - else - { - table = sfop_table; - } - - - do - { - word = get_word_mem_da (context, pc); - p = op_info_table + word; - -#ifdef LOG - log[word]++; -#endif - pc = table[p->exec] (context, pc, word); - context->insts++; - - } - while (!context->exception); - - - - context->sometimes_pc = MAP_LOGICAL_TO_PHYSICAL (pc); - context->ticks += get_now () - now; -} - -int -tm_signal () -{ - return the_state.exception; -} - -void -tm_info_print (x) - sim_state_type *x; -{ - double timetaken = (double) x->ticks / (double) now_persec (); - double virttime = x->cycles / 4.0e6; - - printf ("instructions executed : %9d\n", x->insts); - printf ("cycles counted : %9d \n", x->cycles); - printf ("cycles / inst : %9.1f \n", (double) x->cycles / (double) x->insts); - printf ("virtual time taked (at 4 Mhz) : %9.1f \n", virttime); - printf ("real time taken : %9.1f \n", timetaken); - - if (timetaken) - { - printf ("virtual instructions per second : %9.1f\n", x->insts / timetaken); - printf ("emulation speed : %9.1f%%\n", virttime / timetaken * 100.0); - } -#ifdef LOG - { - extern int quick[]; - - for (i = 0; quick[i]; i++) - { - log[quick[i]] += 100000; - } - } - - for (i = 0; i < 64 * 1024; i++) - { - if (log[i]) - { - printf (" /*%7d*/ 0x%x,\n", log[i], i); - } - } -#endif - -} - -int -sim_trace (sd) - SIM_DESC sd; -{ - int i; - char buffer[10]; - int r; - - printf ("\n"); - for (r = 0; r < 16; r++) - { - int m; - - printf ("r%2d", r); - printf ("=%04x ", get_word_reg (&the_state, - r)); - for (m = -4; m < 8; m++) - { - if (m == 0) - printf (">"); - printf ("%04x ", - get_word_mem_da (&the_state, (0xfffe & get_word_reg (&the_state, r)) + m * 2)); - } - printf ("\n"); - } - - printf ("\n"); - printf ("%9d %9d %08x ", the_state.cycles, - the_state.insts, the_state.sometimes_pc); - - for (i = 0; i < 6; i++) - { - buffer[i] = get_byte_mem_da (&the_state, - the_state.sometimes_pc + i); - } - - print_insn_z8001 (the_state.sometimes_pc, buffer, stdout); - printf - ("\n"); - tm_resume (1); - if (the_state.exception != SIM_SINGLE_STEP) - return 1; - return 0; -} - -void -tm_state (x) - sim_state_type *x; -{ - *x = the_state; -} - -void -tm_exception (x) - int x; -{ - the_state.exception = x; -} - -int -tm_read_byte (x) - int x; -{ - x &= 0x3f00ffff; - return sim_read_byte (&the_state, x); -} - -void -tm_write_byte (x, y) - int x, y; -{ - x &= 0x3f00ffff; - sim_write_byte (&the_state, x, y); -} - -#define SIGN(x) ((x) & MASK) -normal_flags_32(context,d,sa,sb,sub) -sim_state_type *context; -unsigned int d; -unsigned int sa; -unsigned int sb; -unsigned int sub; -{ -#undef MASK -#define MASK (1<<31) - context->broken_flags = 0; - if (sub) - PSW_CARRY = sa < sb; - else - PSW_CARRY = d < sa; - if (sub) - PSW_OVERFLOW = (SIGN(sa) != SIGN(sb)) && (SIGN(d) == SIGN(sb)); - else - PSW_OVERFLOW = (SIGN(sa) == SIGN(sb)) && (SIGN(d) != SIGN(sb)); - - PSW_SIGN = ((int)d) <0; - PSW_ZERO = d == 0; -} - -normal_flags_16(context,d,sal,sbl,sub) -sim_state_type *context; -unsigned int d; -unsigned int sal; -unsigned int sbl; -unsigned short int sub; -{ - unsigned short sa = sal; - unsigned short sb = sbl; -#undef MASK -#define MASK (1<<15) - context->broken_flags = 0; - if (sub) - PSW_CARRY = sal < sbl; - else - PSW_CARRY = (d & 0x10000) != 0; - - if (sub) - PSW_OVERFLOW = (SIGN(sa) != SIGN(sb)) && (SIGN(d) == SIGN(sb)); - else - PSW_OVERFLOW = (SIGN(sa) == SIGN(sb)) && (SIGN(d) != SIGN(sb)); - - PSW_SIGN = ((short int)d) <0; - PSW_ZERO = ((short)d) == 0; -} - -normal_flags_8(context,d,sa,sb,sub) -sim_state_type *context; -unsigned char d; -unsigned char sa; -unsigned char sb; -unsigned char sub; -{ -#undef MASK -#define MASK (1<<7) - context->broken_flags = 0; - if (sub) - PSW_CARRY = sa < sb; - else - PSW_CARRY = d < sa; - if (sub) - PSW_OVERFLOW = (SIGN(sa) != SIGN(sb)) && (SIGN(d) == SIGN(sb)); - else - PSW_OVERFLOW = (SIGN(sa) == SIGN(sb)) && (SIGN(d) != SIGN(sb)); - PSW_SIGN = ((char)d) <0; - PSW_ZERO = d == 0; -} - - -static int -is_cond_true (context, c) - sim_state_type *context; - int c; -{ - switch (c) - { - case T: - return 1; - case F: - return 0; /* F */ - case LE: - return (PSW_ZERO | (PSW_SIGN ^ PSW_OVERFLOW)) & 1; /*LE */ - case GT: - return (~(PSW_ZERO | (PSW_SIGN ^ PSW_OVERFLOW))) & 1; /*GT */ - case 0x5: - return (PSW_SIGN & 1); /* sign */ - case 0xd: - return (~(PSW_SIGN)) & 1; /* not sign */ - case 0x3: - return ((PSW_CARRY | PSW_ZERO) & 1); /* ule*/ - case UGT: - return ((~(PSW_CARRY | PSW_ZERO)) & 1); /* ugt */ - case 0x4: - return (PSW_OVERFLOW & 1);/* overflow */ - case 0xc: - return (~(PSW_OVERFLOW)) & 1; /* not overflow */ - case LT: - return (PSW_SIGN ^ PSW_OVERFLOW) & 1; /* LT */ - case GE: - return (~(PSW_SIGN ^ PSW_OVERFLOW)) & 1; /* GE */ - case EQ: - return (PSW_ZERO) & 1; /* zero */ - case NE: - return ((~PSW_ZERO) & 1); /* not zero */ - case 0x7: - return (PSW_CARRY) & 1; /* carry */ - case 0xf: - return (~PSW_CARRY) & 1; /* not carry */ - default: - abort (); - } -} - -int -COND (context, c) - sim_state_type *context; - int c; -{ - if (c == 8) - return 1; - - /* We can calculate what the flags would have been by - looking at the src and dst and size of the operation */ - - if (context->broken_flags) - { - int slow = 0; - int size; - int dst; - int srca; - int srcb; - int mask; - int ans; - - /* see if we can short-cut the nasty flag calcs */ - - switch (size = context->size) - { - default: - abort(); - return 0; - case 8: - srca = (char) (context->srca); - srcb = (char) (context->srcb); - dst = (char) (context->dst); - mask = 0xff; - break; - case 16: - srca = (short) (context->srca); - srcb = (short) (context->srcb); - dst = (short) (context->dst); - mask = 0xffff; - break; - case 32: - srca = (long) (context->srca); - srcb = (long) (context->srcb); - dst = (long) (context->dst); - mask = 0xffffffff; - break; - } - - switch (c) - { - case T: - return 1; - case F: - return 0; - case EQ: - return !dst; - case NE: - return dst; - case GT: - ans = ((dst)) > 0; - if (slow) - { - if (is_cond_true (context, c) != ans) - abort (); - } - return ans; - case LE: - ans = ((dst)) <= 0; - if (slow) - { - if (is_cond_true (context, c) != ans) - abort (); - } - return ans; - case GE: - ans = ((dst)) >= 0; - if (slow) - { - if (is_cond_true (context, c) != ans) - abort (); - } - return ans; - case LT: - ans = ((dst)) < 0; - if (slow) - { - if (is_cond_true (context, c) != ans) - abort (); - } - return ans; - default: - break; - } - - /* Can't fake it, we'll have to work out the flags the - hard way */ - - makeflags (context, mask); - } - - /* don't know how to fake a test, inspect the flags - the hard way */ - - return is_cond_true (context, c); -} diff --git a/sim/z8k/syscall.h b/sim/z8k/syscall.h deleted file mode 100644 index 489cd5f..0000000 --- a/sim/z8k/syscall.h +++ /dev/null @@ -1,43 +0,0 @@ -/* system call numbers - Copyright (C) 1992, 1993 Free Software Foundation, Inc. - -This file is part of Z8KSIM - -Z8KSIM is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -Z8KSIM is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with Z8KZIM; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - - -#define SYS_exit 1 -#define SYS_fork 2 -#define SYS_read 3 -#define SYS_write 4 -#define SYS_open 5 -#define SYS_close 6 -#define SYS_wait4 7 -#define SYS_creat 8 -#define SYS_link 9 -#define SYS_unlink 10 -#define SYS_execv 11 -#define SYS_chdir 12 -#define SYS_mknod 14 -#define SYS_chmod 15 -#define SYS_chown 16 -#define SYS_lseek 19 -#define SYS_getpid 20 -#define SYS_isatty 21 -#define SYS_fstat 22 -#define SYS_time 23 - - -#define SYS_ARG 24 diff --git a/sim/z8k/tconfig.in b/sim/z8k/tconfig.in deleted file mode 100644 index 8dc0c32..0000000 --- a/sim/z8k/tconfig.in +++ /dev/null @@ -1,13 +0,0 @@ -/* z8k target configuration file. */ - -/* Define this if the simulator supports profiling. - See the mips simulator for an example. - This enables the `-p foo' and `-s bar' options. - The target is required to provide sim_set_profile{,_size}. */ -/* #define SIM_HAVE_PROFILE */ - -/* Define this if the simulator uses an instruction cache. - See the h8/300 simulator for an example. - This enables the `-c size' option to set the size of the cache. - The target is required to provide sim_set_simcache_size. */ -/* #define SIM_HAVE_SIMCACHE */ diff --git a/sim/z8k/tm.h b/sim/z8k/tm.h deleted file mode 100644 index 4527ff9..0000000 --- a/sim/z8k/tm.h +++ /dev/null @@ -1,192 +0,0 @@ -/* tm.h - Copyright (C) 1992, 1993 Free Software Foundation, Inc. - -This file is part of Z8KSIM - -Z8KSIM is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -Z8KSIM is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with Z8KZIM; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#ifndef _TM_H -#define _TM_H - -#ifdef __FOOBEYGNUC__ -typedef SFtype __attribute__ ((mode (SF))); -typedef DFtype __attribute__ ((mode (DF))); - -typedef int HItype __attribute__ ((mode (HI))); -typedef int SItype __attribute__ ((mode (SI))); - -typedef unsigned int UHItype __attribute__ ((mode (HI))); -typedef unsigned int USItype __attribute__ ((mode (SI))); -#else -typedef float SFtype; -typedef double DFtype; -typedef short int HItype; -typedef long int SItype; -typedef unsigned short UHItype ; -typedef unsigned int USItype ; -#endif - -typedef struct UDIstruct -{ - USItype high; - USItype low; -} UDItype; - -#define BIG_ENDIAN_HOST -typedef unsigned int sim_phys_addr_type; -typedef unsigned int sim_logical_addr_type; - -#define PAGE_POWER 23 /* only one pages */ - -#define MAP_PHYSICAL_TO_LOGICAL(x) (((x >> 8) & 0x7f0000) | (x & 0xffff)) -#define MAP_LOGICAL_TO_PHYSICAL(x) (((x <<8) & 0x7f000000) | (x & 0xffff)) -#define REG_PC 17 -#define REG_CYCLES 18 -#define REG_INSTS 19 -#define REG_TIME 20 -#define REG_FP 21 -#define REG_SP 22 -#define REG_CCR 16 - -#define SET_REG(x,y) set_reg(x,y) -#define SINGLE_STEP 1 - -#define PSW_CARRY context->carry -#define PSW_OP context->op -#define PSW_OVERFLOW context->overflow -#define PSW_SIGN context->sign -#define PSW_ZERO context->zero -#define GET_PC() context->pc -#define SET_PC(x) context->pc = x - -struct op_info -{ - short int exec; -}; - -extern struct op_info op_info_table[]; - -typedef union -{ - unsigned short int word; - -} - -borw_type; - -typedef struct state_struct -{ - unsigned short *memory; - int carry; - int sign; - int zero; - int overflow; - int op; - int cycles; - - borw_type regs[16]; - - sim_phys_addr_type sometimes_pc; -#ifdef __GNUC__ - volatile -#endif - int exception; - -#define iwords_0 iwords0 -#define iwords_1 iwords1 -#define iwords_2 iwords2 -#define iwords_3 iwords3 - -#define ibytes_0 (iwords_0>>8) -#define ibytes_1 (iwords_0&0xff) -#define ibytes_2 (iwords_1>>8) -#define ibytes_3 (iwords_1& 0xff) -#define ibytes_4 (iwords_2>>8) - - int insts; - int ticks; - - int next_inst; - int broken_flags; - - int srca; - int srcb; - int dst; - int size; -} - -sim_state_type; - -#define CMP_FLAGS 100 -#define TST_FLAGS 101 -#endif - -extern int get_word_mem_da PARAMS((sim_state_type *context, int addr)); -extern int get_word_reg PARAMS((sim_state_type *context, int reg)); -extern void support_call PARAMS((sim_state_type *context, int sc)); -extern void tm_exception PARAMS((int x)); -extern int tm_read_byte PARAMS((int x)); -extern int tm_signal PARAMS((void)); -extern void tm_state PARAMS((sim_state_type *x)); -extern void tm_write_byte PARAMS((int x, int y)); -extern void bfop_bad1 PARAMS(()); -extern int fail PARAMS((sim_state_type *context, int v)); -extern void fop_bad PARAMS((sim_state_type *context)); -extern void sfop_bad1 PARAMS(()); -extern void swap_long PARAMS((char *buf, int val)); -extern void swap_word PARAMS((char *buf, int val)); -extern void tm_fetch_register PARAMS((int regno, char *buf)); -extern void tm_info_print PARAMS((sim_state_type *x)); -extern void tm_resume PARAMS((int step)); -extern void tm_store_register PARAMS((int regno, int value)); - - -#ifndef __GNUC__ -/* If were using gnuc then these will be inlined, so the prototypes - won't be right */ -long int sitoptr PARAMS((long int si)); -long int ptrtosi PARAMS((long int ptr)); -void put_long_reg PARAMS((sim_state_type *context, int reg, int val)); -void put_quad_reg PARAMS((sim_state_type *context, int reg, int val1, int val2)); -void put_word_reg PARAMS((sim_state_type *context, int reg, int val)); -SItype get_long_reg PARAMS((sim_state_type *context, int reg)); -void put_byte_reg PARAMS((sim_state_type *context, int reg, int val)); -int get_byte_reg PARAMS((sim_state_type *context, int reg)); -void put_word_mem_da PARAMS((sim_state_type *context, int addr, int value)); -unsigned char get_byte_mem_da PARAMS((sim_state_type *context, int addr)); -void put_byte_mem_da PARAMS((sim_state_type *context, int addr, int value)); -SItype get_long_mem_da PARAMS((sim_state_type *context, int addr)); -void put_long_mem_da PARAMS((sim_state_type *context, int addr, int value)); -int get_word_mem_ir PARAMS((sim_state_type *context, int reg)); -void put_word_mem_ir PARAMS((sim_state_type *context, int reg, int value)); -int get_byte_mem_ir PARAMS((sim_state_type *context, int reg)); -void put_byte_mem_ir PARAMS((sim_state_type *context, int reg, int value)); -int get_long_mem_ir PARAMS((sim_state_type *context, int reg)); -void put_long_mem_ir PARAMS((sim_state_type *context, int reg, int value)); -void put_long_mem_x PARAMS((sim_state_type *context, int base, int reg, int value)); -void put_word_mem_x PARAMS((sim_state_type *context, int base, int reg, int value)); -void put_byte_mem_x PARAMS((sim_state_type *context, int base, int reg, int value)); -int get_word_mem_x PARAMS((sim_state_type *context, int base, int reg)); -int get_byte_mem_x PARAMS((sim_state_type *context, int base, int reg)); -int get_long_mem_x PARAMS((sim_state_type *context, int base, int reg)); -int COND PARAMS((sim_state_type *context, int c)); -void NORMAL_FLAGS PARAMS((sim_state_type *context, int size, int dst, int srca, int srcb)); -void TEST_NORMAL_FLAGS PARAMS((sim_state_type *context, int size, int dst)); -void put_ptr_long_reg PARAMS((sim_state_type *context, int reg, int val)); -long int get_ptr_long_reg PARAMS((sim_state_type *context, int reg)); -long int get_ptr_long_mem_ir PARAMS((sim_state_type *context, int reg)); -long int get_ptr_long_mem_da PARAMS((sim_state_type *context, long int addr)); -void put_ptr_long_mem_da PARAMS((sim_state_type *context, long int addr, long int ptr)); -#endif diff --git a/sim/z8k/writecode.c b/sim/z8k/writecode.c deleted file mode 100644 index acff7c4..0000000 --- a/sim/z8k/writecode.c +++ /dev/null @@ -1,1948 +0,0 @@ -/* generate instructions for Z8KSIM - - Copyright 1992, 1993, 2002 Free Software Foundation, Inc. - -This file is part of Z8KSIM - -Z8KSIM is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -Z8KSIM is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with Z8KZIM; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -/* This program generates the code which emulates each of the z8k - instructions - - code goes into three files, tc-gen1.h, tc-gen2.h and tc-gen3.h. - which file being made depends upon the options - - -1 tc-gen1.h contains the fully expanded code for some selected - opcodes, (those in the quick.c list) - - -2 tc-gen2.h contains a list of pointers to functions, one for each - opcode. It points to functions in tc-gen3.h and tc-gen1.h - depending upon quick.c - - -3 tc-gen3.h contains all the opcodes in unexpanded form. - - -b3 tc-genb3.h same as -3 but for long pointers - - */ - -/* steve chamberlain - sac@cygnus.com */ - -#include "config.h" - -#include <ansidecl.h> -#include <stdio.h> -#ifdef HAVE_STDLIB_H -#include <stdlib.h> -#endif -#ifdef HAVE_STRING_H -#include <string.h> -#else -#ifdef HAVE_STRINGS_H -#include <strings.h> -#endif -#endif - -#define NICENAMES - -#define DEFINE_TABLE -#include "../opcodes/z8k-opc.h" - -#define NOPS 500 - -struct opcode_value -{ - int n; - struct opcode_value *next; -}; - -#define NICENAMES -int BIG; - -static char *reg_names[] = -{"bad", "src", "dst", "aux_a", "aux_b", "aux_r", "aux_x"}; - -#define IS_DST(x) ((x & 0xf) == 2) -#define IS_SRC(x) ((x & 0xf)==1) -#define SIZE_ADDRESS (BIG ? 8 : 4) /* number of nibbles in a ptr*/ - -static int file; - -static int nibs = 0; - -static char *current_size; -static char *current_name; -static char current_word0[40]; -static char current_byte0[40]; -static char current_byte1[40]; -static int indent; -static char *p; -static char *d; - -struct opcode_value *list[NOPS]; - -static opcode_entry_type * -lookup_inst (what) - int what; -{ - static short *z8k_inv_list = NULL; - const nr_z8k_inv_list_elements = 1 << 16; - if (z8k_inv_list == NULL) - { - /* Initialize the list to 0xff == -1 */ - z8k_inv_list = calloc (nr_z8k_inv_list_elements, sizeof (short)); - memset (z8k_inv_list, 0xff, nr_z8k_inv_list_elements * sizeof (short)); - } - /* Entry empty? Fill it in. */ - if (z8k_inv_list[what] == -1) - { - - int nibl_index; - int nibl_matched; - unsigned short instr_nibl; - unsigned short tabl_datum, datum_class, datum_value; - char instr_nibbles[8]; - - opcode_entry_type *ptr = z8k_table; - - nibl_matched = 0; - - instr_nibbles[3] = (what >> 0) & 0xf; - instr_nibbles[2] = (what >> 4) & 0xf; - instr_nibbles[1] = (what >> 8) & 0xf; - instr_nibbles[0] = (what >> 12) & 0xf; - - /* Assume it won't be found. */ - z8k_inv_list[what] = -2; - - while (ptr->name) - { - nibl_matched = 1; - for (nibl_index = 0; nibl_index < 4 && nibl_matched; nibl_index++) - { - instr_nibl = instr_nibbles[nibl_index]; - - tabl_datum = ptr->byte_info[nibl_index]; - datum_class = tabl_datum & CLASS_MASK; - datum_value = ~CLASS_MASK & tabl_datum; - - switch (datum_class) - { - case CLASS_BIT_1OR2: - if (datum_value != (instr_nibl & ~0x2)) - nibl_matched = 0; - break; - - case CLASS_IGNORE: - break; - case CLASS_BIT: - if (datum_value != instr_nibl) - nibl_matched = 0; - break; - case CLASS_00II: - if (!((~instr_nibl) & 0x4)) - nibl_matched = 0; - break; - case CLASS_01II: - if (!(instr_nibl & 0x4)) - nibl_matched = 0; - break; - case CLASS_0CCC: - if (!((~instr_nibl) & 0x8)) - nibl_matched = 0; - break; - case CLASS_1CCC: - if (!(instr_nibl & 0x8)) - nibl_matched = 0; - break; - case CLASS_0DISP7: - if (!((~instr_nibl) & 0x8)) - nibl_matched = 0; - nibl_index += 1; - break; - case CLASS_1DISP7: - if (!(instr_nibl & 0x8)) - nibl_matched = 0; - nibl_index += 1; - break; - case CLASS_REGN0: - if (instr_nibl == 0) - nibl_matched = 0; - break; - default: - break; - } - } - if (nibl_matched) - { - z8k_inv_list[what] = ptr->idx; - break; /* while */ - } - ptr++; - } - } - if (z8k_inv_list[what] >= 0) - return z8k_table + z8k_inv_list[what]; - return 0; -} - -static char * -insn_4 (n) - int n; -{ - switch (n) - { - case 1: - return "((iwords_0>>8) & 0xf)"; - case 2: - return "((ibytes_1 >> 4) & 0xf)"; - case 3: - return "((ibytes_1) & 0xf)"; - case 4: - return "((ibytes_2>>4) & 0xf)"; - case 5: - return "((ibytes_2) & 0xf)"; - case 6: - return "((ibytes_3 >> 4) & 0xf)"; - case 7: - return "((ibytes_3) & 0xf)"; - default: - return "****"; - } -} - -char * -ptr_mode () -{ - if (BIG) - { - return "ptr_long"; - } - return "word"; -} - -static -char * -ptr_size () -{ - if (BIG) - return "4"; - return "2"; -} - -static char * -reg_n (x) - unsigned int x; -{ - return reg_names[x & 0xf]; -} - -char * -stack_ptr () -{ - return BIG ? "14" : "15"; -} - -char * -mem () -{ -#if 0 - return BIG ? "segmem" : "unsegmem"; -#else - return "mem"; -#endif -} - -int -match (a) - char *a; -{ - if (strncmp (p, a, strlen (a)) == 0) - { - p += strlen (a); - return 1; - } - return 0; -} - -static -void -sub (y) - char *y; -{ - sprintf (d, "%s", y); - d += strlen (d); -} - -static char * -insn_16 (n) - int n; -{ - switch (n) - { - case 0: - return "(iwords_0)"; - case 4: - return "(iwords_1)"; - case 8: - return "(iwords_2)"; - case 12: - return "(iwords_3)"; - default: - return "****"; - } -} - -static -char * -insn_32 (n) - int n; -{ - switch (n) - { - case 0: - return "((iwords_0<<16) | (iwords_1))"; - case 4: - return "((iwords_1<<16) | (iwords_2))"; - case 8: - return "((iwords_2<<16) | (iwords_3))"; - default: - return "****"; - } -} - -static char * -size_name (x) - int x; -{ - switch (x) - { - case 8: - return "byte"; - case 16: - return "word"; - case 32: - return "long"; - case 64: - return "quad"; - } - return "!!"; -} - -/*VARARGS*/ -void -emit (string, a1, a2, a3, a4, a5) - char *string; - char* a1; - char* a2; - char* a3; - char* a4; - char* a5; -{ - int indent_inc = 0; - int indent_dec = 0; - int i; - char buffer[1000]; - - d = buffer; - p = string; - - while (*p) - { - if (match ("<fop>")) - { - if (BIG) - { - sub ("bfop"); - } - else - { - sub ("sfop"); - } - } - else if (match ("<iptr>")) - { - if (BIG) - { - switch (nibs) - { - case 4: - sub ("(((iwords_1 << 8) | (iwords_2)) & 0x7fffff)"); - break; - default: - sub ("fail(context,124)"); - break; - } - } - else - { - switch (nibs) - { - case 4: - sub ("iwords_1"); - break; - default: - sub ("fail(context,123)"); - break; - } - } - } - else if (match ("<name>")) - { - sub (current_name); - } - else if (match ("<size>")) - { - sub (current_size); - } - else if (match ("<insn_4>")) - { - sub (insn_4 (nibs)); - } - else if (match ("<insn_16>")) - { - sub (insn_16 (nibs)); - } - else if (match ("<insn_32>")) - { - sub (insn_32 (nibs)); - } - else if (match ("iwords_0")) - { - sub (current_word0); - } - else if (match ("ibytes_0")) - { - sub (current_byte0); - } - else if (match ("<ibytes_1>")) - { - sub (current_byte1); - } - else if (match ("<next_size>")) - { - if (strcmp (current_size, "word") == 0) - sub ("long"); - if (strcmp (current_size, "byte") == 0) - sub ("word"); - else if (strcmp (current_size, "long") == 0) - sub ("quad"); - else - abort (); - } - else if (match ("<addr_type>")) - { - if (BIG) - sub ("unsigned long"); - else - sub ("unsigned short"); - } - - else if (match ("<c_size>")) - { - if (strcmp (current_size, "word") == 0) - sub ("short"); - else if (strcmp (current_size, "byte") == 0) - sub ("char"); - else if (strcmp (current_size, "long") == 0) - sub ("long"); - else - abort (); - } - - else if (match ("<pc>")) - { - sub ("pc"); - } - else if (match ("<mem>")) - { - sub (mem ()); - } - else if (match ("<sp>")) - { - sub (stack_ptr ()); - } - else if (match ("<ptr_size>")) - { - sub (ptr_size ()); - } - else if (match ("<ptr_mode>")) - { - sub (ptr_mode ()); - } - else if (match ("<insn_8>")) - { - switch (nibs) - { - case 2: - sub ("(iwords_0&0xff)"); - break; - case 4: - sub ("(iwords_1>>8)"); - break; - case 6: - sub ("(iwords_1&0xff)"); - break; - case 8: - sub ("(iwords_2>>8)"); - break; - case 12: - sub ("(/* WHO */iwords_3&0xff)"); - break; - default: - abort (); - } - } - else - { - if (*p == '{') - indent_inc++; - if (*p == '}') - indent_dec++; - *d++ = *p; - p++; - } - } - *d++ = 0; - indent -= indent_dec; - for (i = 0; i < indent; i++) - printf ("\t"); - indent += indent_inc; - printf (buffer, a1, a2, a3, a4, a5); - -} - -/* fetch the lvalues of the operands */ -void -info_args (p) - opcode_entry_type *p; -{ - unsigned int *s; - - int done_one_imm8 = 0; - - /* int done_read = 4;*/ - s = p->byte_info; - nibs = 0; - while (*s) - { - switch (*s & CLASS_MASK) - { - case CLASS_BIT_1OR2: - emit ("register unsigned int imm_src=(<insn_4>& 2)?2:1;\n"); - break; - case CLASS_IGNORE: - case CLASS_BIT: - /* Just ignore these, we've already decoded this bit */ - nibs++; - break; - case CLASS_REGN0: - case CLASS_REG: - /* this nibble tells us which register to use as an arg, - if we've already gobbled the nibble we know what to use */ - { - int regname = *s & 0xf; - - emit ("register unsigned int reg_%s=<insn_4>;\n", - reg_names[regname]); - - nibs++; - } - break; - case CLASS_ADDRESS: - emit ("register unsigned base_%s=<iptr>;\n", reg_n (*s)); - - nibs += SIZE_ADDRESS; - - break; - case CLASS_01II: - case CLASS_00II: - emit ("register unsigned int imm_src=<insn_4>&0x2;\n"); - nibs++; - break; - case CLASS_FLAGS: - emit ("register unsigned int imm_src=<insn_4>;\n"); - nibs++; -break; - case CLASS_IMM: - /* Work out the size of the think to fetch */ - - { - switch (*s & ~CLASS_MASK) - { - case ARG_IMM16: - emit ("register unsigned imm_src=<insn_16>;\n"); - nibs += 4; - break; - case ARG_IMM32: - emit ("register unsigned int imm_src= %s;\n", insn_32 (nibs)); - nibs += 8; - break; - case ARG_IMM4: - emit ("register unsigned int imm_src=<insn_4>;\n"); - nibs++; - break; - case ARG_NIM4: - emit ("register unsigned int imm_src = - <insn_4>;\n"); - nibs++; - break; - case ARG_IMM2: - emit ("register unsigned int imm_src=<insn_4> & 0x2;\n"); - nibs++; - break; - - case ARG_IMM4M1: - emit ("register unsigned int imm_src=(<insn_4> + 1);\n"); - nibs++; - break; - case ARG_IMM_1: - emit ("register unsigned int imm_src=1;\n"); - break; - case ARG_IMM_2: - emit ("register unsigned int imm_src=2;\n"); - break; - case ARG_NIM8: - emit ("register unsigned int imm_src=-<insn_8>;\n"); - nibs += 2; - break; - case ARG_IMM8: - if (!done_one_imm8) - { - emit ("register unsigned int imm_src=<insn_8>;\n"); - nibs += 2; - done_one_imm8 = 1; - } - break; - default: - emit ("register int fail%d=fail(context,1);\n", nibs); - break; - } - break; - - case CLASS_DISP8: - /* We can't use `(char)' since char might be unsigned. - We can't use `(signed char)' because the compiler might be K&R. - This seems safe, since it only assumes that bytes are 8 - bits. */ - emit ("register unsigned int oplval_dst=((ibytes_1 << (sizeof (int) * 8 - 8)) >> (sizeof (int) * 8 - 9)) + pc;\n"); -#if 0 - /* Original code: fails if characters are unsigned. */ - emit ("register unsigned int oplval_dst=(((char)ibytes_1)<<1) + pc;\n"); -#endif - nibs += 2; - break; - case CLASS_CC: - emit ("register unsigned int op_cc=<insn_4>;\n"); - nibs++; - break; - default: - emit ("register int FAIL%d=fail(context,2);\n", nibs); - break; - } - ; - /* work out how to fetch the immediate value */ - } - - s++; - } -} - -void -info_special (p, getdst, nostore, before, nosrc) - opcode_entry_type *p; - int *getdst; - int *nostore; - int *before; - int *nosrc; -{ - switch (p->opcode) - { - case OPC_exts: - case OPC_extsb: - case OPC_extsl: - *nostore = 1; - *nosrc = 1; - break; - case OPC_ldm: - *nostore = 1; - *nosrc = 1; - break; - case OPC_negb: - case OPC_neg: - case OPC_sla: - case OPC_slab: - case OPC_slal: - case OPC_sda: - case OPC_sdab: - case OPC_sdal: - case OPC_com: - case OPC_comb: - case OPC_adc: - case OPC_sbc: - case OPC_nop: - case OPC_adcb: - case OPC_add: - case OPC_addb: - case OPC_addl: - case OPC_inc: - case OPC_sub: - case OPC_subb: - case OPC_subl: - case OPC_and: - case OPC_andb: - case OPC_xorb: - case OPC_xor: - break; - - case OPC_mult: - case OPC_multl: - case OPC_div: - case OPC_divl: - - *nostore = 1; - break; - - case OPC_testb: - case OPC_test: - case OPC_testl: - case OPC_cp: - case OPC_cpb: - case OPC_cpl: - case OPC_bit: - *nostore = 1; - *before = 0; - break; - - case OPC_bpt: - case OPC_jr: - case OPC_jp: - case OPC_ret: - case OPC_call: - case OPC_tcc: - *nosrc = 1; - *nostore = 1; - *before = 1; - break; - case OPC_sc: - *nostore = 1; - *before = 0; - break; - case OPC_clrb: - case OPC_clr: - *before = 1; - *nosrc = 1; - break; - case OPC_ldi: - case OPC_ldib: - case OPC_lddb: - case OPC_ldd: - - *before = 1; - *nostore = 1; - *nosrc = 1; - break; - case OPC_ldk: - case OPC_ld: - case OPC_ldb: - case OPC_ldl: - *before = 1; - *getdst = 0; - break; - case OPC_push: - case OPC_pushl: - case OPC_pop: - case OPC_popl: - *before = 1; - *getdst = 0; - break; - case OPC_lda: - *nosrc = 1; - break; - } -} - -/* calculate the lvalues required for the opcode */ -void -info_lvals (p) - opcode_entry_type *p; -{ - /* emit code to work out lvalues, if any */ - unsigned int *i = p->arg_info; - - while (*i) - { - current_name = reg_n (*i); - current_size = size_name (p->type); - switch (*i & CLASS_MASK) - { - case CLASS_X: - /* address(reg) */ - emit ("register <addr_type> oplval_<name>= ((base_<name> + (short)get_word_reg(context,reg_<name>)) & 0xffff) + (base_<name> & ~0xffff);\n"); - break; - case CLASS_IR: - /* Indirect register */ - emit ("register int oplval_<name> = get_<ptr_mode>_reg(context,reg_<name>);\n"); - break; - case CLASS_DA: - emit ("register int oplval_<name>=base_<name>;\n"); - break; - case CLASS_IMM: - case CLASS_REG_WORD: - case CLASS_REG_LONG: - case CLASS_REG_BYTE: - case CLASS_PR: - break; - case CLASS_BA: - emit ("register int oplval_<name> = get_<ptr_mode>_reg(context,reg_<name>) + (short)(imm_src);\n"); - break; - case CLASS_BX: - emit ("register int oplval_<name> = get_<ptr_mode>_reg(context,reg_<name>)\n"); - emit (" + get_word_reg(context,reg_aux_x);\n"); - break; - } - i++; - } -} - -/* emit code to fetch the args from calculated lvalues */ -int allregs; -void -info_fetch (p, getdst) - opcode_entry_type *p; - int getdst; -{ - unsigned int *i = p->arg_info; - int had_src = 0; - - allregs = 1; - while (*i) - { - - current_name = reg_n (*i); - current_size = size_name (p->type); - switch (*i & CLASS_MASK) - { - case CLASS_X: - case CLASS_IR: - case CLASS_BA: - case CLASS_BX: - case CLASS_DA: - if (!getdst && IS_DST (*i)) - break; - emit ("register int op_<name>= get_<size>_<mem>_da(context,oplval_<name>);\n"); - allregs = 0; - break; - case CLASS_IMM: - if (!had_src) - { - if (p->opcode == OPC_out || - p->opcode == OPC_outb || - p->opcode == OPC_sout || - p->opcode == OPC_soutb) - { - /* The imm is a dest here */ - emit ("register int op_dst = imm_src;\n"); - } - else - { - emit ("register int op_src = imm_src;\n"); - } - } - break; - case CLASS_REG_QUAD: - if (!getdst && IS_DST (*i)) - break; - had_src |= IS_SRC (*i); - emit ("UDItype op_<name> ;\n"); - - break; - case CLASS_REG_WORD: - if (!getdst && IS_DST (*i)) - break; - had_src |= IS_SRC (*i); - emit ("register int op_<name> = get_word_reg(context,reg_<name>);\n"); - break; - - case CLASS_REG_LONG: - if (!getdst && IS_DST (*i)) - break; - had_src |= IS_SRC (*i); - emit ("register int op_<name> = get_long_reg(context,reg_<name>);\n"); - break; - case CLASS_REG_BYTE: - if (!getdst && IS_DST (*i)) - break; - had_src |= IS_SRC (*i); - emit ("register int op_<name> = get_byte_reg(context,reg_<name>);\n"); - break; - } - i++; - } -} - -static void -normal_flags (p, s, neg) - opcode_entry_type *p; - char *s; -{ - emit (" %s;\n", s); - emit ("NORMAL_FLAGS(context,%d, tmp, op_dst, op_src,%d); \n", p->type,neg); -} - -static void -test_normal_flags (p, s, opt) - opcode_entry_type *p; - char *s; - int opt; -{ - emit (" %s;\n", s); - if (0 && opt) - { - emit ("context->broken_flags = TST_FLAGS;\n"); - emit ("context->size = %d;\n", p->type); - } - else - { - emit ("TEST_NORMAL_FLAGS(context,%d, tmp); \n", p->type); - } - -} - -static void -optimize_normal_flags (p, s,neg) - opcode_entry_type *p; - char *s; -{ - emit (" %s;\n", s); -#if 0 - emit ("context->broken_flags = CMP_FLAGS;\n"); -#else - emit ("NORMAL_FLAGS(context,%d, tmp, op_dst, op_src,%d); \n", p->type, neg); -#endif -} - -static -void -jp (p) - opcode_entry_type *p; -{ - - emit ("if(op_cc == 8 || COND(context,op_cc)) pc = oplval_dst;\n"); -} - -static void -jr (p) - opcode_entry_type *p; -{ - emit ("if(op_cc == 8 || COND(context,op_cc)) pc = oplval_dst;\n"); -} - -static void -ret (p) - opcode_entry_type *p; -{ - emit ("if(op_cc == 8 || COND(context,op_cc))\n{\n"); - emit ("pc = get_<ptr_mode>_<mem>_ir(context,<sp>);\n"); - emit ("put_<ptr_mode>_reg(context,<sp>, get_<ptr_mode>_reg(context,<sp>) + <ptr_size>);\n"); - emit ("};\n"); -} - -static void -call (p) - opcode_entry_type *p; -{ - emit ("put_<ptr_mode>_reg(context,<sp>,tmp = get_<ptr_mode>_reg(context,<sp>) - <ptr_size>);\n"); - emit ("put_<ptr_mode>_<mem>_da(context,tmp, pc);\n"); - emit ("pc = oplval_dst;\n"); -} - -static void -push (p) - opcode_entry_type *p; -{ - emit ("tmp = op_src;\n"); - emit ("oplval_dst -= %d;\n", p->type / 8); - emit ("put_<ptr_mode>_reg(context,reg_dst, oplval_dst);\n"); -} - -static void -pop (p) - opcode_entry_type *p; -{ - emit ("tmp = op_src;\n"); - emit ("put_<ptr_mode>_reg(context,reg_src, oplval_src + %d);\n", p->type / 8); -} - -static void -ld (p) - opcode_entry_type *p; -{ - emit ("tmp = op_src;\n"); -} - -static void -sc () -{ - emit ("support_call(context,imm_src);\n"); -} - -static void -bpt () -{ - emit ("pc -=2; \n"); - emit ("context->exception = SIM_BREAKPOINT;\n"); -} - -static void -ldi (p, size, inc) - opcode_entry_type *p; - int size; - int inc; -{ - int dinc = (size / 8) * inc; - - current_size = size_name (size); - emit ("{ \n"); - emit ("int type = %s;\n", insn_4 (7)); - emit ("int rs = get_<ptr_mode>_reg(context,reg_src);\n"); - emit ("int rd = get_<ptr_mode>_reg(context,reg_dst);\n"); - emit ("int rr = get_word_reg(context,reg_aux_r);\n"); - emit ("do {\n"); - emit ("put_<size>_<mem>_da(context,rd, get_<size>_<mem>_da(context,rs));\n"); - emit ("rd += %d;\n", dinc); - emit ("rs += %d;\n", dinc); - emit ("rr --;\n"); - emit ("context->cycles += 9;\n"); - emit ("} while (!type && rr != 0 && context->exception <= 1);\n"); - emit ("if (context->exception>1) pc -=4;\n"); - emit ("put_<ptr_mode>_reg(context,reg_src, rs);\n"); - emit ("put_<ptr_mode>_reg(context,reg_dst, rd);\n"); - emit ("put_word_reg(context,reg_aux_r, rr);\n"); - emit ("}\n"); - -} - -static void -shift (p, arith) - opcode_entry_type *p; - int arith; -{ - - /* We can't use `(char)' since char might be unsigned. - We can't use `(signed char)' because the compiler might be K&R. - This seems safe, since it only assumes that bytes are 8 bits. */ - emit ("op_src = (op_src << (sizeof (int) * 8 - 8)) >> (sizeof (int) * 8 - 8);\n"); -#if 0 - /* Original code: fails if characters are unsigned. */ - emit ("op_src = (char)op_src;\n"); -#endif - emit ("if (op_src < 0) \n"); - emit ("{\n"); - emit ("op_src = -op_src;\n"); - emit ("op_dst = (%s <c_size>)op_dst;\n", arith ? "" : "unsigned"); - emit ("tmp = (%s op_dst) >> op_src;\n", arith ? "" : "(unsigned)"); - emit ("context->carry = op_dst >> (op_src-1);\n", p->type); - emit ("}\n"); - emit ("else\n"); - emit ("{\n"); - emit ("tmp = op_dst << op_src;\n"); - emit ("context->carry = op_dst >> (%d - op_src);\n", p->type); - emit ("}\n"); - emit ("context->zero = (<c_size>)tmp == 0;\n"); - emit ("context->sign = (int)((<c_size>)tmp) < 0;\n"); - emit ("context->overflow = ((int)tmp < 0) != ((int)op_dst < 0);\n"); - emit ("context->cycles += 3*op_src;\n"); - emit ("context->broken_flags = 0;\n"); - -} - -static void -rotate (p, through_carry, size, left) - opcode_entry_type *p; - int through_carry; - int size; - int left; -{ - - if (!left) - { - emit ("while (op_src--) {\n"); - emit ("int rotbit;\n"); - emit ("rotbit = op_dst & 1;\n"); - emit ("op_dst = ((unsigned)op_dst) >> 1;\n"); - - if (through_carry) - { - emit ("op_dst |= context->carry << %d;\n", size - 1); - } - else - { - emit ("op_dst |= rotbit << %d;\n", size - 1); - } - emit ("context->carry = rotbit;\n"); - emit ("}\n"); - } - else - { - emit ("while (op_src--) {\n"); - emit ("int rotbit;\n"); - - emit ("rotbit = (op_dst >> (%d))&1;\n", size - 1); - emit ("op_dst <<=1;\n"); - if (through_carry) - { - emit ("if (context->carry) op_dst |=1;\n"); - } - else - { - emit ("if (rotbit) op_dst |= 1;\n"); - } - emit ("context->carry = rotbit;\n"); - emit ("}\n"); - } - emit ("tmp = (<c_size>)op_dst;\n"); - emit ("context->zero = tmp == 0;\n"); - emit ("context->sign = (int)tmp < 0;\n"); - emit ("context->overflow = ((int)tmp < 0) != ((int)op_dst < 0);\n"); - emit ("context->cycles += 3*op_src;\n"); - emit ("context->broken_flags = 0;\n"); - -} - -static void -adiv (p) - opcode_entry_type *p; -{ - emit ("if (op_src==0)\n"); - emit ("{\n"); - emit ("context->exception = SIM_DIV_ZERO;\n"); - emit ("}\n"); - emit ("else\n"); - emit ("{\n"); - - if (p->type == 32) - { - emit ("op_dst.low = (int)get_long_reg(context,reg_dst+2);\n"); - emit ("op_dst.high = (int)get_long_reg(context,reg_dst+0);\n"); -#ifdef __GNUC__ - emit ("tmp = (((long long)op_dst.high << 32) + (op_dst.low)) / (int)op_src;\n"); -#else - emit ("tmp = (long)op_dst.low / (int)op_src;\n"); -#endif - emit ("put_long_reg(context,reg_dst+2, tmp);\n"); -#ifdef __GNUC__ - emit ("put_long_reg(context,reg_dst, (((long long)op_dst.high << 32) + (op_dst.low)) %% (int)op_src);\n"); -#else - emit ("put_long_reg(context,reg_dst, (int)op_dst.low %% (int)op_src);\n"); -#endif - - emit ("context->zero = op_src == 0 || (op_dst.low==0 && op_dst.high==0);\n"); - } - else - { - emit ("tmp = (long)op_dst / (short)op_src;\n"); - emit ("put_word_reg(context,reg_dst+1, tmp);\n"); - emit ("put_word_reg(context,reg_dst, (long) op_dst %% (short)op_src);\n"); - emit ("context->zero = op_src == 0 || op_dst==0;\n"); - } - - emit ("context->sign = (int)tmp < 0;\n"); - emit ("context->overflow =(tmp & 0x%x) != 0;\n", - ~((1 << (p->type)) - 1)); - emit ("context->carry = (tmp & 0x%x) != 0;\n", - ~(1 << (p->type))); - - emit ("}\n"); -} - -static void -dobit (p) -opcode_entry_type *p; -{ - emit("context->zero = (op_dst & (1<<op_src))==0;\n"); - emit("context->broken_flags = 0;\n"); -} -static void -doset (p, v) -opcode_entry_type*p; -int v; -{ - if (v) - emit (" tmp = op_dst | (1<< op_src);\n"); - else - emit (" tmp = op_dst & ~(1<< op_src);\n"); -} - -static void -mult (p) - opcode_entry_type *p; -{ - - if (p->type == 32) - { - emit ("op_dst.low = get_long_reg(context,reg_dst+2);\n"); - emit ("tmp = op_dst.low * op_src;\n"); - emit ("put_long_reg(context,reg_dst+2, tmp);\n"); - emit ("put_long_reg(context,reg_dst, 0);\n"); - } - else - { - emit ("op_dst = get_word_reg(context,reg_dst+1);\n"); - emit ("tmp = op_dst * op_src;\n"); - emit ("put_long_reg(context,reg_dst, tmp);\n"); - } - - emit ("context->sign = (int)tmp < 0;\n"); - emit ("context->overflow =0;\n"); - emit ("context->carry = (tmp & 0x%x) != 0;\n", ~((1 << (p->type)) - 1)); - emit ("context->zero = tmp == 0;\n"); - -} - -static void -exts (p) - opcode_entry_type *p; -{ - /* Fetch the ls part of the src */ - current_size = size_name (p->type * 2); - - if (p->type == 32) - { - emit ("tmp= get_long_reg(context,reg_dst+2);\n"); - emit ("if (tmp & (1<<%d)) {\n", p->type - 1); - emit ("put_long_reg(context,reg_dst, 0xffffffff);\n"); - emit ("}\n"); - emit ("else\n"); - emit ("{\n"); - emit ("put_long_reg(context,reg_dst, 0);\n"); - emit ("}\n"); - } - else - { - emit ("tmp= get_<size>_reg(context,reg_dst);\n"); - emit ("if (tmp & (1<<%d)) {\n", p->type - 1); - emit ("tmp |= 0x%x;\n", ~((1 << p->type) - 1)); - emit ("}\n"); - emit ("else\n"); - emit ("{\n"); - - emit ("tmp &= 0x%x;\n", ((1 << p->type) - 1)); - emit ("}\n"); - emit ("put_<size>_reg(context,reg_dst, tmp);\n"); - } -} -doflag(on) -int on; -{ - /* Load up the flags */ - emit(" COND (context, 0x0b);\n"); - - if (on) - emit ("{ int on =1;\n "); - else - emit ("{ int on =0;\n "); - - emit ("if (imm_src & 1)\n"); - emit ("PSW_OVERFLOW = on;\n"); - - emit ("if (imm_src & 2)\n"); - emit ("PSW_SIGN = on;\n"); - - emit ("if (imm_src & 4)\n"); - emit ("PSW_ZERO = on;\n"); - - emit ("if (imm_src & 8)\n"); - emit ("PSW_CARRY = on;\n"); - emit("}\n"); - - -} -/* emit code to perform operation */ -void -info_docode (p) - opcode_entry_type *p; -{ - switch (p->opcode) - { - case OPC_clr: - case OPC_clrb: - emit ("tmp = 0;\n"); - break; - case OPC_ex: - case OPC_exb: - - emit ("tmp = op_src; \n"); - if (allregs) - { - emit ("put_<size>_reg(context,reg_src, op_dst);\n"); - } - else - { - emit ("put_<size>_mem_da(context, oplval_src, op_dst);\n"); - } - break; - case OPC_adc: - case OPC_adcb: - normal_flags (p, "op_src += COND(context,7);tmp = op_dst + op_src ;",0); - break; - case OPC_sbc: - normal_flags (p, "op_src += COND(context,7);tmp = op_dst - op_src ;",1); - break; - case OPC_nop: - break; - case OPC_com: - case OPC_comb: - test_normal_flags (p, "tmp = ~ op_dst", 1); - break; - case OPC_and: - case OPC_andb: - test_normal_flags (p, "tmp = op_dst & op_src", 1); - break; - case OPC_xor: - case OPC_xorb: - test_normal_flags (p, "tmp = op_dst ^ op_src", 1); - break; - case OPC_or: - case OPC_orb: - test_normal_flags (p, "tmp = op_dst | op_src", 1); - break; - case OPC_sla: - case OPC_slab: - case OPC_slal: - case OPC_sda: - case OPC_sdab: - case OPC_sdal: - shift (p, 1); - break; - - case OPC_sll: - case OPC_sllb: - case OPC_slll: - case OPC_sdl: - case OPC_sdlb: - case OPC_sdll: - shift (p, 0); - break; - case OPC_rl: - rotate (p, 0, 16, 1); - break; - case OPC_rlb: - rotate (p, 0, 8, 1); - break; - case OPC_rr: - rotate (p, 0, 16, 0); - break; - case OPC_rrb: - rotate (p, 0, 8, 0); - break; - case OPC_rrc: - rotate (p, 1, 16, 0); - break; - case OPC_rrcb: - rotate (p, 1, 8, 0); - break; - case OPC_rlc: - rotate (p, 1, 16, 1); - break; - case OPC_rlcb: - rotate (p, 1, 8, 1); - break; - - case OPC_extsb: - case OPC_exts: - case OPC_extsl: - exts (p); - break; - case OPC_add: - case OPC_addb: - case OPC_addl: - case OPC_inc: - case OPC_incb: - optimize_normal_flags (p, "tmp = op_dst + op_src",0); - break; - case OPC_testb: - case OPC_test: - case OPC_testl: - test_normal_flags (p, "tmp = op_dst", 0); - break; - case OPC_cp: - case OPC_cpb: - case OPC_cpl: - normal_flags (p, "tmp = op_dst - op_src",1); - break; - case OPC_negb: - case OPC_neg: - emit ("{\n"); - emit ("int op_src = -op_dst;\n"); - emit ("op_dst = 0;\n"); - optimize_normal_flags (p, "tmp = op_dst + op_src;\n",1); - emit ("}"); - break; - - case OPC_sub: - case OPC_subb: - case OPC_subl: - case OPC_dec: - case OPC_decb: - optimize_normal_flags (p, "tmp = op_dst - op_src",1); - break; - case OPC_bpt: - bpt (); - break; - case OPC_jr: - jr (p); - break; - case OPC_sc: - sc (); - break; - case OPC_jp: - jp (p); - break; - case OPC_ret: - ret (p); - break; - case OPC_call: - call (p); - break; - case OPC_tcc: - case OPC_tccb: - emit ("if(op_cc == 8 || COND(context,op_cc)) put_word_reg(context,reg_dst, 1);\n"); - break; - case OPC_lda: - emit ("tmp = oplval_src; \n"); - /*(((oplval_src) & 0xff0000) << 8) | (oplval_src & 0xffff); \n");*/ - break; - case OPC_ldk: - case OPC_ld: - - case OPC_ldb: - case OPC_ldl: - ld (p); - break; - case OPC_ldib: - ldi (p, 8, 1); - break; - case OPC_ldi: - ldi (p, 16, 1); - break; - - case OPC_lddb: - ldi (p, 8, -1); - break; - case OPC_ldd: - ldi (p, 16, -1); - break; - - case OPC_push: - case OPC_pushl: - push (p); - break; - - case OPC_div: - case OPC_divl: - adiv (p); - break; - case OPC_mult: - case OPC_multl: - mult (p); - break; - case OPC_pop: - case OPC_popl: - pop (p); - break; - case OPC_set: - doset (p,1); - break; - case OPC_res: - doset (p,0); - break; - case OPC_bit: - dobit(p); - break; - case OPC_resflg: - doflag(0); - break; - case OPC_setflg: - doflag(1); - break; - default: - - emit ("tmp = fail(context,%d);\n", p->opcode); - break; - } -} - -/* emit code to store result in calculated lvalue */ - -void -info_store (p) - opcode_entry_type *p; -{ - unsigned int *i = p->arg_info; - - while (*i) - { - current_name = reg_n (*i); - current_size = size_name (p->type); - - if (IS_DST (*i)) - { - switch (*i & CLASS_MASK) - { - case CLASS_PR: - emit ("put_<ptr_mode>_reg(context,reg_<name>, tmp);\n"); - break; - case CLASS_REG_LONG: - case CLASS_REG_WORD: - case CLASS_REG_BYTE: - - emit ("put_<size>_reg(context,reg_<name>,tmp);\n"); - break; - case CLASS_X: - case CLASS_IR: - case CLASS_DA: - case CLASS_BX: - case CLASS_BA: - - emit ("put_<size>_<mem>_da(context,oplval_<name>, tmp);\n"); - break; - case CLASS_IMM: - break; - default: - emit ("abort(); "); - break; - } - - } - i++; - } -} - -static -void -mangle (p, shortcut, value) - opcode_entry_type *p; - int shortcut; - int value; -{ - int nostore = 0; - int extra; - int getdst = 1; - int before = 0; - int nosrc = 0; - - emit ("/\052 %s \052/\n", p->nicename); - if (shortcut) - { - emit ("int <fop>_%04x(context,pc)\n", value); - } - else - { - emit ("int <fop>_%d(context,pc,iwords0)\n", p->idx); - emit ("int iwords0;\n"); - } - emit ("sim_state_type *context;\n"); - emit ("int pc;\n"); - emit ("{\n"); - emit ("register unsigned int tmp;\n"); - if (shortcut) - { - emit ("register unsigned int iwords0 = 0x%x;\n", value); - } - - /* work out how much bigger this opcode could be because it's large - model */ - if (BIG) - { - int i; - - extra = 0; - for (i = 0; i < 4; i++) - { - if ((p->arg_info[i] & CLASS_MASK) == CLASS_DA - || (p->arg_info[i] & CLASS_MASK) == CLASS_X) - extra += 2; - } - } - else - { - extra = 0; - } - printf (" /* Length %d */ \n", p->length + extra); - switch (p->length + extra) - { - case 2: - emit ("pc += 2\n;"); - break; - case 4: - emit ("register unsigned int iwords1 = get_word_mem_da(context,pc+2);\n"); - emit ("pc += 4;\n"); - break; - case 6: - - emit ("register unsigned int iwords1 = get_word_mem_da(context,pc+2);\n"); - emit ("register unsigned int iwords2 = get_word_mem_da(context,pc+4);\n"); - emit ("pc += 6;\n"); - break; - case 8: - emit ("register unsigned int iwords1 = get_word_mem_da(context,pc+2);\n"); - emit ("register unsigned int iwords2 = get_word_mem_da(context,pc+4);\n"); - emit ("register unsigned int iwords3 = get_word_mem_da(context,pc+6);\n"); - emit ("pc += 8;\n"); - break; - default: - break; - - } - emit ("context->cycles += %d;\n", p->cycles); - - emit ("{\n"); - info_args (p); - info_special (p, &getdst, &nostore, &before, &nosrc); - - info_lvals (p); - if (!nosrc) - { - info_fetch (p, getdst); - } - - if (before) - { - info_docode (p); - } - else - { - info_docode (p); - } - if (!nostore) - info_store (p); - emit ("}\n"); - emit ("return pc;\n"); - emit ("}\n"); -} - -void -static -one_instruction (i) - int i; -{ - /* find the table entry */ - opcode_entry_type *p = z8k_table + i; - - if (!p) - return; - mangle (p, 0, 0); -} - -void -add_to_list (ptr, value) - struct opcode_value **ptr; - int value; -{ - struct opcode_value *prev; - - prev = *ptr; - *ptr = (struct opcode_value *) malloc (sizeof (struct opcode_value)); - - (*ptr)->n = value; - (*ptr)->next = prev; -} - -void -build_list (i) - int i; -{ - opcode_entry_type *p = lookup_inst (i); - - if (!p) - return; - add_to_list (&list[p->idx], i); -} - -int -main (ac, av) - int ac; - char **av; -{ - int i; - int needcomma = 0; - - for (i = 1; i < ac; i++) - { - if (strcmp (av[i], "-1") == 0) - file = 1; - if (strcmp (av[i], "-2") == 0) - file = 2; - if (strcmp (av[i], "-3") == 0) - file = 3; - if (strcmp (av[i], "-b3") == 0) - { - file = 3; - BIG = 1; - } - - } - - /* First work out which opcodes use which bit patterns, - build a list of all matching bit pattens */ - for (i = 0; i < 1 << 16; i++) - { - build_list (i); - } -#if DUMP_LIST - for (i = 0; i < NOPS; i++) - { - struct opcode_value *p; - - printf ("%d,", i); - p = list[i]; - while (p) - { - printf (" %04x,", p->n); - p = p->next; - } - printf ("-1\n"); - } - -#endif - - if (file == 1) - { - extern int quick[]; - - /* Do the shortcuts */ - printf (" /* SHORTCUTS */\n"); - for (i = 0; quick[i]; i++) - { - int t = quick[i]; - - mangle (lookup_inst (t), 1, t); - } - } - if (file == 3) - { - printf (" /* NOT -SHORTCUTS */\n"); - for (i = 0; i < NOPS; i++) - { - if (list[i]) - { - one_instruction (i); - } - else - { - emit ("int <fop>_%d(context,pc)\n", i); - printf ("sim_state_type *context;\n"); - printf ("int pc;\n"); - emit ("{ <fop>_bad1();return pc; }\n"); - } - } - emit ("int <fop>_bad() ;\n"); - - /* Write the jump table */ - emit ("int (*(<fop>_table[]))() = {"); - needcomma = 0; - for (i = 0; i < NOPS; i++) - { - if (needcomma) - printf (","); - emit ("<fop>_%d\n", i); - needcomma = 1; - } - emit ("};\n"); - } - - if (file == 2) - { - extern int quick[]; - /* Static - since it's too be to be automatic on the apollo */ - static int big[64 * 1024]; - - for (i = 0; i < 64 * 1024; i++) - big[i] = 0; - - for (i = 0; quick[i]; i++) - { -#if 0 - - printf ("extern int <fop>_%04x();\n", quick[i]); -#endif - - big[quick[i]] = 1; - } - - for (i = 0; i < NOPS; i++) - { -#if 0 - printf ("extern int fop_%d();\n", i); -#endif - } -#if 0 - printf ("extern int fop_bad();\n"); -#endif - printf ("struct op_info op_info_table[] = {\n"); - for (i = 0; i < 1 << 16; i++) - { - opcode_entry_type *p = lookup_inst (i); - - if (needcomma) - printf (","); -#if 0 - if (big[i]) - { - printf ("<fop>_%04x", i); - } - else -#endif - if (p != NULL) - { - printf ("%d", p->idx); - } - else - printf ("400"); - if (p != NULL) - { - printf (" /* %04x %s */\n", i, p->nicename); - } - else - { - printf ("\n"); - } - needcomma = 1; - } - printf ("};\n"); - - } - return 0; -} - -char * -insn_ptr (n) - int n; -{ - if (BIG) - { - abort (); - } - - switch (n) - { - case 4: - return "iwords_1"; - default: - return "fail(context,123)"; - } -} - -/* work out if the opcode only wants lvalues */ -int -lvalue (p) - opcode_entry_type *p; -{ - switch (p->opcode) - { - case OPC_lda: - return 1; - case OPC_call: - case OPC_jp: - return 1; - default: - return 0; - } -} - -int -info_len_in_words (o) - opcode_entry_type *o; -{ - unsigned int *p = o->byte_info; - int nibs = 0; - - while (*p) - { - switch (*p & CLASS_MASK) - { - case CLASS_IGNORE: - case CLASS_BIT: - case CLASS_REGN0: - case CLASS_REG: - case CLASS_01II: - case CLASS_00II: - nibs++; - break; - case CLASS_ADDRESS: - nibs += SIZE_ADDRESS; - break; - case CLASS_IMM: - switch (*p & ~CLASS_MASK) - { - case ARG_IMM16: - nibs += 4; - break; - case ARG_IMM32: - nibs += 8; - break; - case ARG_IMM2: - case ARG_IMM4: - case ARG_NIM4: - case ARG_IMM4M1: - case ARG_IMM_1: - case ARG_IMM_2: - case ARG_IMMNMINUS1: - nibs++; - break; - case ARG_NIM8: - - case ARG_IMM8: - nibs += 2; - break; - default: - abort (); - } - break; - case CLASS_DISP: - switch (*p & ~CLASS_MASK) - { - case ARG_DISP16: - nibs += 4; - break; - case ARG_DISP12: - nibs += 3; - break; - case ARG_DISP8: - nibs += 2; - break; - default: - abort (); - } - break; - case CLASS_0DISP7: - case CLASS_1DISP7: - case CLASS_DISP8: - nibs += 2; - break; - case CLASS_BIT_1OR2: - case CLASS_0CCC: - case CLASS_1CCC: - case CLASS_CC: - nibs++; - break; - default: - emit ("don't know %x\n", *p); - } - p++; - } - - return nibs / 4; /* return umber of words */ -} |