From 779734bae5a1be2e9b48a9807149df5e38335285 Mon Sep 17 00:00:00 2001 From: Joern Rennecke Date: Fri, 11 Sep 2009 04:45:57 +0000 Subject: gdb/insight for ARCompact (from Richard Stuckey) --- MANIFEST | 249 - Makefile.in | 1 - README.arcgdb | 146 + bfd/archures.c | 2 +- bfd/bfd-in2.h | 12 +- bfd/configure | 13049 ++++++++++++++-------------- bfd/configure.in | 2 +- bfd/cpu-arc.c | 13 +- bfd/doc/Makefile.in | 11 +- bfd/elf32-arc.c | 1004 +-- bfd/libbfd.h | 15 +- bfd/po/SRC-POTFILES.in | 6 + bfd/po/bfd.pot | 966 +- bfd/reloc.c | 117 +- gdb/JTAG_aps_driver.c | 560 ++ gdb/JTAG_download.c | 208 + gdb/JTAG_ops_driver.c | 904 ++ gdb/Makefile.in | 138 +- gdb/arc-architecture.c | 502 ++ gdb/arc-architecture.h | 74 + gdb/arc-arguments.c | 427 + gdb/arc-arguments.h | 48 + gdb/arc-board.c | 1996 +++++ gdb/arc-board.h | 65 + gdb/arc-dummy-gpio.c | 94 + gdb/arc-dummy-jtag-ops.c | 274 + gdb/arc-elf32-tdep.c | 2064 +++++ gdb/arc-elf32-tdep.h | 118 + gdb/arc-gpio.c | 251 + gdb/arc-gpio.h | 72 + gdb/arc-inst-tracing.c | 356 + gdb/arc-inst-tracing.h | 89 + gdb/arc-jtag-actionpoints.c | 1337 +++ gdb/arc-jtag-actionpoints.h | 68 + gdb/arc-jtag-ops.c | 2215 ++--- gdb/arc-jtag-ops.h | 154 +- gdb/arc-jtag-tdep.c | 638 -- gdb/arc-jtag.c | 2008 ++--- gdb/arc-jtag.h | 112 +- gdb/arc-linux-tdep.c | 1143 ++- gdb/arc-linux-tdep.h | 51 + gdb/arc-memory.c | 445 + gdb/arc-memory.h | 64 + gdb/arc-registers.c | 2566 ++++++ gdb/arc-registers.h | 226 + gdb/arc-regnums-defs.h | 195 +- gdb/arc-remote-fileio.c | 741 ++ gdb/arc-remote-fileio.h | 64 + gdb/arc-support.h | 136 + gdb/arc-tdep.c | 3872 +++++---- gdb/arc-tdep.h | 213 +- gdb/arc-xiss.c | 1787 ++++ gdb/arc-xiss.h | 41 + gdb/breakpoint.c | 563 +- gdb/breakpoint.h | 13 +- gdb/cli/cli-script.c | 7 + gdb/config.in | 15 + gdb/config/arc/a4-jtag.mt | 3 - gdb/config/arc/arc.mt | 4 - gdb/config/arc/embed.mt | 3 - gdb/config/arc/linux.mt | 3 - gdb/config/arc/tm-a4-jtag.h | 103 - gdb/config/arc/tm-embed.h | 164 +- gdb/config/arc/tm-linux.h | 112 +- gdb/configure | 236 +- gdb/configure.ac | 33 +- gdb/configure.tgt | 14 +- gdb/doc/observer.texi | 17 + gdb/dwarf2-frame.c | 6 - gdb/dwarf2loc.c | 153 + gdb/exec.c | 2 +- gdb/features/arc-a5-cpu.xml | 258 + gdb/features/arc-registers.dtd | 71 + gdb/features/arc600-cpu.xml | 266 + gdb/features/arc700-cpu.xml | 416 + gdb/gdb-events.c | 33 + gdb/gdb-events.h | 9 + gdb/gdbserver/Makefile.in | 2 +- gdb/gdbserver/build_gdbserver.sh | 6 + gdb/gdbserver/configure.srv | 15 +- gdb/gdbserver/linux-arc-low.c | 4 +- gdb/gdbserver/proc-service.c | 6 +- gdb/gdbserver/remote-utils.c | 7 +- gdb/gpio.h | 38 - gdb/infcmd.c | 28 +- gdb/remote-fileio.c | 1314 +-- gdb/remote-sim.c | 14 +- gdb/stack.c | 26 +- gdb/symtab.h | 20 + gdb/target-fileio.c | 1344 +++ gdb/target-fileio.h | 53 + gdb/target.c | 57 +- gdb/testsuite/config/arc-jtag.exp | 112 - gdb/testsuite/config/remote-gdbserver.exp | 570 -- gdb/testsuite/gdb.arch/arc-step-jtag.exp | 88 - gdb/testsuite/gdb.arch/arc-step-jtag.s | 46 - gdb/testsuite/gdb.arch/arc-step.exp | 83 - gdb/testsuite/gdb.arch/arc-step.s | 43 - gdb/testsuite/gdb.asm/arc.inc | 55 - gdb/testsuite/gdb.asm/asm-source.exp | 6 - gdb/testsuite/gdb.base/callfuncs.exp | 9 + gdb/testsuite/gdb.base/float.exp | 2 - gdb/testsuite/gdb.base/relocate.exp | 8 +- gdb/testsuite/lib/arc-gdbserver.exp | 98 - gdb/testsuite/lib/arc-jtag.exp | 32 - gdb/testsuite/lib/gdb.exp | 16 +- gdb/testsuite/lib/gdbserver-support.exp | 4 - gdb/testsuite/lib/mi-support.exp | 13 + gdb/testsuite/lib/telnet-exec.exp | 29 - gdb/version.in | 2 +- include/dis-asm.h | 3 +- include/elf/dwarf2.h | 4 +- include/gdb/callback.h | 8 - include/opcode/arc.h | 24 +- intl/aclocal.m4 | 6 +- intl/configure | 5907 +++++++------ libdecnumber/configure | 7670 ++++++++-------- opcodes/Makefile.am | 37 +- opcodes/Makefile.in | 45 +- opcodes/arc-dis-cgen.c | 825 ++ opcodes/arc-dis-cgen.h | 28 + opcodes/arc-dis.c | 1823 ++-- opcodes/arc-ext.c | 512 +- opcodes/arc-ext.h | 116 +- opcodes/arc-opc.c | 24 +- opcodes/arcompact-dis.c | 1794 +--- opcodes/arcompact-dis.h | 34 + opcodes/configure | 7126 ++++++++------- opcodes/configure.in | 3 +- opcodes/po/POTFILES.in | 8 + opcodes/po/opcodes.pot | 490 +- sim/arc/ChangeLog | 7 + sim/arc/Makefile.in | 6 +- sim/arc/arc-sim-registers.c | 149 + sim/arc/arc-sim-registers.h | 63 + sim/arc/arc-sim.h | 5 - sim/arc/arc5.c | 154 +- sim/arc/sim-if.c | 883 +- sim/arc/sim-main.h | 20 +- sim/arc/syscall.h | 281 + sim/arc/tconfig.in | 2 + sim/arc/traps-linux.c | 1 + sim/arc/traps.c | 2 +- sim/common/ChangeLog.ARC | 17 +- sim/common/callback.c | 31 +- sim/common/gennltvals.sh | 4 +- sim/common/syscall.c | 18 +- 147 files changed, 48216 insertions(+), 28477 deletions(-) delete mode 100644 MANIFEST create mode 100755 README.arcgdb create mode 100644 gdb/JTAG_aps_driver.c create mode 100755 gdb/JTAG_download.c create mode 100644 gdb/JTAG_ops_driver.c create mode 100755 gdb/arc-architecture.c create mode 100644 gdb/arc-architecture.h create mode 100644 gdb/arc-arguments.c create mode 100644 gdb/arc-arguments.h create mode 100644 gdb/arc-board.c create mode 100644 gdb/arc-board.h create mode 100644 gdb/arc-dummy-gpio.c create mode 100644 gdb/arc-dummy-jtag-ops.c create mode 100755 gdb/arc-elf32-tdep.c create mode 100644 gdb/arc-elf32-tdep.h create mode 100644 gdb/arc-gpio.c create mode 100755 gdb/arc-gpio.h create mode 100644 gdb/arc-inst-tracing.c create mode 100644 gdb/arc-inst-tracing.h create mode 100644 gdb/arc-jtag-actionpoints.c create mode 100644 gdb/arc-jtag-actionpoints.h delete mode 100644 gdb/arc-jtag-tdep.c create mode 100644 gdb/arc-linux-tdep.h create mode 100644 gdb/arc-memory.c create mode 100644 gdb/arc-memory.h create mode 100644 gdb/arc-registers.c create mode 100644 gdb/arc-registers.h create mode 100644 gdb/arc-remote-fileio.c create mode 100644 gdb/arc-remote-fileio.h create mode 100644 gdb/arc-support.h create mode 100755 gdb/arc-xiss.c create mode 100755 gdb/arc-xiss.h delete mode 100644 gdb/config/arc/a4-jtag.mt delete mode 100644 gdb/config/arc/arc.mt delete mode 100644 gdb/config/arc/embed.mt delete mode 100644 gdb/config/arc/linux.mt delete mode 100644 gdb/config/arc/tm-a4-jtag.h create mode 100644 gdb/features/arc-a5-cpu.xml create mode 100644 gdb/features/arc-registers.dtd create mode 100644 gdb/features/arc600-cpu.xml create mode 100644 gdb/features/arc700-cpu.xml create mode 100755 gdb/gdbserver/build_gdbserver.sh delete mode 100644 gdb/gpio.h create mode 100644 gdb/target-fileio.c create mode 100644 gdb/target-fileio.h delete mode 100644 gdb/testsuite/config/arc-jtag.exp delete mode 100644 gdb/testsuite/config/remote-gdbserver.exp delete mode 100644 gdb/testsuite/gdb.arch/arc-step-jtag.exp delete mode 100644 gdb/testsuite/gdb.arch/arc-step-jtag.s delete mode 100644 gdb/testsuite/gdb.arch/arc-step.exp delete mode 100644 gdb/testsuite/gdb.arch/arc-step.s delete mode 100644 gdb/testsuite/gdb.asm/arc.inc delete mode 100644 gdb/testsuite/lib/arc-gdbserver.exp delete mode 100644 gdb/testsuite/lib/arc-jtag.exp delete mode 100644 gdb/testsuite/lib/telnet-exec.exp create mode 100644 opcodes/arc-dis-cgen.c create mode 100644 opcodes/arc-dis-cgen.h create mode 100644 opcodes/arcompact-dis.h create mode 100644 sim/arc/arc-sim-registers.c create mode 100644 sim/arc/arc-sim-registers.h create mode 100755 sim/arc/syscall.h create mode 100755 sim/arc/traps-linux.c diff --git a/MANIFEST b/MANIFEST deleted file mode 100644 index 1e876de..0000000 --- a/MANIFEST +++ /dev/null @@ -1,249 +0,0 @@ -By codito - added files: - gas/testsuite/gas/arc/general_a700.d - gas/testsuite/gas/arc/dsp1.d - gas/testsuite/gas/arc/general_a700.s - gas/testsuite/gas/arc/dsp1.s - gas/testsuite/gas/arc/ld_arc700.s - gas/testsuite/gas/arc/sub_s.d - gas/testsuite/gas/arc/lsl_s.d - gas/testsuite/gas/arc/gen_simd.d - gas/testsuite/gas/arc/sub_s.s - gas/testsuite/gas/arc/lsl_s.s - gas/testsuite/gas/arc/prefetch.d - gas/testsuite/gas/arc/gen_simd.s - gas/testsuite/gas/arc/reloctest.d - gas/testsuite/gas/arc/arc700.exp - gas/testsuite/gas/arc/dsp2.d - gas/testsuite/gas/arc/prefetch.s - gas/testsuite/gas/arc/reloctest.s - gas/testsuite/gas/arc/dsp2.s - gas/testsuite/gas/arc/mpy_a700.d - gas/testsuite/gas/arc/ex_arc700.s - gas/testsuite/gas/arc/mpy_a700.s - gas/config/extlib - gas/config/extlib/configure - gas/config/extlib/Makefile.in - gas/config/extlib/arcsimd.s - gas/config/extlib/configure.in - gas/config/extlib/arcextlib.s - include/elf/ChangeLog.codito - libgloss/arc/syscall.h (delivered as linux/include/asm-arcnommu/unistd.h) - ld/emultempl/arclinux.em - ld/configdoc.texi - ld/scripttempl/elfarc.sc - ld/scripttempl/arclinux.sc - ld/emulparams/arclinux.sh - md5.sum - opcodes/ChangeLog.codito - opcodes/arcompact-dis.c - changed files: - bfd/archures.c (merged) - bfd/bfd-in2.h (merged/regenerated) - bfd/config.bfd - bfd/configure.in - bfd/cpu-arc.c (merged) - bfd/elf32-arc.c - bfd/reloc.c - bfd/cpu-arc.c - Makefile.in - gas/configure.tgt (patch was originally in configure.in) - gas/doc/c-arc.texi - gas/doc/as.texinfo - gas/configure.in - gas/testsuite/gas/arc/swi.d - gas/testsuite/gas/arc/sbc.d - gas/testsuite/gas/arc/sleep.d - gas/testsuite/gas/arc/brk.d - gas/testsuite/gas/arc/swi.s - gas/testsuite/gas/arc/rrc.d - gas/testsuite/gas/arc/bic.d - gas/testsuite/gas/arc/extb.d - gas/testsuite/gas/arc/arc.exp - gas/testsuite/gas/arc/asl.d - gas/testsuite/gas/arc/asr.d - gas/testsuite/gas/arc/sexw.d - gas/testsuite/gas/arc/adc.d - gas/testsuite/gas/arc/lsr.d - gas/testsuite/gas/arc/mov.d - gas/testsuite/gas/arc/ror.d - gas/testsuite/gas/arc/and.d - gas/testsuite/gas/arc/xor.d - gas/testsuite/gas/arc/rlc.d - gas/testsuite/gas/arc/or.d - gas/testsuite/gas/arc/sexb.d - gas/testsuite/gas/arc/jl.d - gas/testsuite/gas/arc/extw.d - gas/testsuite/gas/arc/add.d - gas/testsuite/gas/arc/sub.d - gas/struc-symbol.h - gas/config/tc-arc.c - gas/config/tc-arc.h - gas/Makefile.am - include/dis-asm.h - include/elf/arc.h - include/elf/common.h (adapted) - include/opcode/arc.h - ld/configure.in - ld/emulparams/arcelf.sh - ld/configure.tgt - ld/Makefile.am - binutils/configure.in - binutils/testsuite/binutils-all/objdump.exp - binutils/readelf.c - opcodes/configure.in - opcodes/arc-dis.c - opcodes/arc-dis.h - opcodes/arc-opc.c - opcodes/Makefile.am - opcodes/arc-ext.c - opcodes/arc-ext.h - gdb/doc/Makefile.in - gdb/doc/gdb.texinfo - gdb/remote.c - gdb/testsuite/gdb.base/float.exp - gdb/testsuite/lib/gdbserver-support.exp - gdb/testsuite/gdb.asm/asm-source.exp - gdb/dwarf2read.c - gdb/dwarf2-frame.c - gdb/configure.tgt - gdb/version.in - gdb/gdbserver/Makefile.in - gdb/gdbserver/configure.srv - gdb/gdbserver/proc-service.c - gdb/gdbserver/remote-utils.c - gdb/Makefile.in - -By ARC employees: - added files: - cgen/cpu/ARCompact.cpu - cgen/cpu/arc.opc - cgen/cpu/arc.cpu - cpu/arc.opc - cpu/sh-sim.cpu - cpu/arc.cpu - cpu/ARCompact.cpu - gas/ChangeLog.ARC - gdb/config/arc/arc.mt - include/gdb/target-io/arc.h - ld/ChangeLog.ARC - opcodes/arc-opc.h - opcodes/arc-opinst.c - opcodes/arc-desc.c - opcodes/arc-desc.h - opcodes/arc-ibld.c - opcodes/arc-asm.c - sim/arc/ChangeLog - sim/arc/configure.ac - sim/arc/mloop5.in - sim/arc/mloop6.in - sim/arc/mloop7.in - sim/arc/arc-sim.h - sim/arc/Makefile.in - sim/arc/tconfig.in - sim/arc/sim-main.h - sim/arc/devices.c - sim/arc/sim-if.c - sim/arc/arc5.c - sim/arc/arc6.c - sim/arc/arc7.c - sim/arc/config.in - sim/arc/configure - sim/arc/arch.h - sim/arc/arch.c - sim/arc/decode5.h - sim/arc/decode6.h - sim/arc/decode7.h - sim/arc/decode5.c - sim/arc/decode6.c - sim/arc/decode7.c - sim/arc/sem5-switch.c - sim/arc/sem6-switch.c - sim/arc/sem7-switch.c - sim/arc/sem5.c - sim/arc/sem6.c - sim/arc/sem7.c - sim/arc/cpu5.h - sim/arc/cpu6.h - sim/arc/cpu7.h - sim/arc/cpuall.h - sim/arc/cpu5.c - sim/arc/cpu6.c - sim/arc/cpu7.c - sim/arc/model5.c - sim/arc/model6.c - sim/arc/model7.c - sim/arc/traps.c - sim/common/ChangeLog.ARC - newlib/ChangeLog.ARC - newlib/libc/sys/arc/sys/fcntl.h - replaced files: - opcodes/arc-dis.c - opcodes/arc-opc.c - changed files: - bfd/configure - bfd/elf32-arc.c - bfd/libbfd.h - bfd/bfd-in2.h - cgen/ChangeLog - cgen/read.scm - cgen/sim-cpu.scm - cgen/utils-sim.scm - cgen/cpu/ip2k.opc - cgen/cpu/sparc.opc - cgen/cpu/xc16x.opc - cgen/cpu/fr30.opc - cgen/cpu/mep.opc - cgen/cpu/m32r.opc - cgen/cpu/i960.opc - cgen/cpu/sh.opc - cgen/cpu/iq2000.opc - cgen/cpu/openrisc.opc - cgen/cpu/xstormy16.opc - cgen/opc-itab.scm - cpu/ChangeLog - gas/config/tc-arc.c - gas/config/tc-arc.h - gas/configure - gas/Makefile.in - gas/doc/c-arc.texi - gas/as.c - gas/symbols.c - gas/symbols.h - gdb/ChangeLog - gdb/configure.tgt - include/ChangeLog - include/dis-asm.h - include/gdb/callback.h - include/gdb/ChangeLog - include/opcode/arc.h - include/opcode/cgen.h - ld/ChangeLog - ld/scripttempl/arclinux.sc - ld/scripttempl/elfarc.sc - ld/emulparams/arclinux.sh - ld/Makefile.am - ld/Makefile.in - libgloss/ChangeLog - opcodes/arc-dis.h - opcodes/arc-dis.c - opcodes/arc-ext.h - opcodes/arc-ext.c - opcodes/arc-opc.c - opcodes/ChangeLog - opcodes/configure - opcodes/configure.in - opcodes/Makefile.am - opcodes/Makefile.in - opcodes/cgen-dis.c - sim/ChangeLog - sim/configure.ac - sim/configure - sim/common/callback.c - sim/common/cgen-trace.c - sim/common/ChangeLog - sim/common/gennltvals.sh - sim/common/gentvals.sh - sim/common/nltvals.def - sim/common/sim-utils.c - sim/common/syscall.c diff --git a/Makefile.in b/Makefile.in index 027a03b..981ce54 100644 --- a/Makefile.in +++ b/Makefile.in @@ -354,7 +354,6 @@ AR_FOR_TARGET=@AR_FOR_TARGET@ AS_FOR_TARGET=@AS_FOR_TARGET@ CC_FOR_TARGET=$(STAGE_CC_WRAPPER) @CC_FOR_TARGET@ $(FLAGS_FOR_TARGET) - # If GCC_FOR_TARGET is not overriden on the command line, then this # variable is passed down to the gcc Makefile, where it is used to # build libgcc2.a. We define it here so that it can itself be diff --git a/README.arcgdb b/README.arcgdb new file mode 100755 index 0000000..7710624 --- /dev/null +++ b/README.arcgdb @@ -0,0 +1,146 @@ +Building gdb +============ + +You can build ARC GDB in two possible ways: one for debugging linux applications, +and one for debugging programs directly on the CPU using either the built-in simulator, +or the xISS (a fast instruction set simulator), or a JTAG connection to a hardware target. + + +arc-linux-uclibc-gdb +-------------------- + +You will need to build GDB as well as gdbserver. + +For building GDB, do + $ ./configure --target=arc-linux-uclibc --prefix=/install/path + $ make + $ make install + +(Where /install/path is a path to a directory where you want to install GDB.) + + +For building gdbserver: + +You will need the arc-linux-uclibc-gcc toolchain. It should be in your path. + + $ cd gdbserver + $ source ./build_gdbserver.sh + $ ./configure --host=i386-redhat-linux-gnu --target=arc-linux-uclibc --prefix=/install/path + $ make + $ make install + +If you do not have the build_gdbserver.sh script, you will need these variables set in your +environment: + + CFLAGS="-mA7 -static -O0" + LDFLAGS="-mA7" + CC=arc-linux-uclibc-gcc + +You will find a gdbserver in your install path. +Copy it to an NFS share that is accessible from the board. + +Please use the script at /insight/src/build_gdbserver.sh for reference. + + +arc-elf32-gdb +------------- + +Do + $ ./configure --target=arc-elf32 --prefix=/install/path \ + --with-expat [ --with-libexpat-prefix=/expat/install/path ] \ + [ --with-xiss --with-xiss-prefix=/xISS/install/path ] + $ make + $ make install + +(Where /install/path is a path to a directory where you want to install GDB.) + +You will need to have the expat library (available from http://www.libexpat.org) installed on your machine. +The `configure' script will search for this library in several standard locations; if it is installed in an +unusual path, you can use the `--with-libexpat-prefix' option to specify its location. + +If you have the xISS (ARC Fast Instruction Set Simulator) installed, you may optionally build gdb to be able +to use it directly, by specifying the --with-xiss and --with-xiss-prefix options. In this case, the xISS +installation must have been built with the option "--enable-mdb" specified to the 'configure' script in +order that the required header files are located in the /xISS/install/path/include directory. + + +Running gdb +=========== + +XISS +---- +If you have built arc-elf32-gdb to be able to use the xISS directly, you will need to set the environment +variable XISS_HOME to identify the /xISS/install/path directory in order to be able to use the gdb +'target arcxiss' command. + + +XISS instruction address trace file +----------------------------------- +arc-elf32-gdb may be used in conjection with the xISS to trace instruction execution; it may create a file +containing the address of each instruction executed, in the order in which they were executed. This file +contains the data in a compressed encoding which results in a saving of about 80% of the uncompressed data +size. See the ARC gdb 'Getting Started' manual for more information. + + +Auxiliary registers XML file +---------------------------- + +When using gdb, you will need to provide it with a file which describes the auxiliary registers of the target +(e.g. ARCAngel 4, simulator) upon which you are debugging. + +By default, gdb will look for a file named 'arc-registers.xml'; it will look first in your current working +directory, and then in your home directory. Alternatively, a file may be specified by means of the +'arc-reg-read-file' command. + +It is also possible to add new descriptions using the 'arc-reg-read-extra-file' command, thus allowing +processor variants to be described by sets of common files and variant-specific files. + +Files containing descriptions for the ARC700, ARC600 and A5 variants of the ARC processor architecture are +provided at + + gdb/features/arc700-cpu.xml + gdb/features/arc600-cpu.xml + gdb/features/arc-a5-cpu.xml + +It is suggested that you copy the appropriate file for your target architecture to your home or working directory, +and rename it to 'arc-registers.xml'. + +It is simple to define a new target description; the XML schema for the description is defined in the +file + + gdb/features/arc-registers.dtd + + +In essence, a target description consists of a set of register descriptions. Each register description has +these attributes: + + name : the register name (case-insensitive); may be 'unused' + description : an (optional) textual description of the register's function + number : the number of the register in the auxiliary register set (e.g. 0x0A for STATUS32) + mask : a 32-bit mask which defines which bits of the register are valid (0xFFFFFFFF by default) + access : the register's read/write access: R/O, R/W or W/O (R/W by default) + + +Each register description may also have a set of field descriptions. Each field description has +these attributes: + + name : the field name (case-insensitive); may be 'reserved' + description : an (optional) textual description of the field's function + onwrite : the (optional) value (for a reserved field) which must be supplied on a write operation + offset : the offset in bits of the field from the least significant bit (0) of the register + size : the size of the field in bits + access : the field's read/write access: R/O, R/W or W/O (the register's access by default) + + +Each field description may also have a set of field meanings. Each field meaning has these attributes: + + value : a value that the field may contain + description : a textual explanation of the meaning of the field when it contains that value + + +There may also be a set of Build Configuration Registers (BCRs). The descriptions of these registers do +not have an access attribute; and, although a BCR may have a number of fields (which do not have access +or onwrite attributes), these fields do not have field meanings. + +It is also possible to include definitions of Extension Core Registers: the descriptions of these have +merely the register number (which must be between 32 and 59 inclusive), and mask and access attributes. diff --git a/bfd/archures.c b/bfd/archures.c index 16a4d33..0a9d99b 100644 --- a/bfd/archures.c +++ b/bfd/archures.c @@ -300,7 +300,7 @@ DESCRIPTION .#define bfd_mach_v850e 'E' .#define bfd_mach_v850e1 '1' . bfd_arch_arc, {* ARC Cores *} -.#define bfd_mach_arc_a4 0 +.#define bfd_mach_arc_unknown 0 .#define bfd_mach_arc_a5 1 .#define bfd_mach_arc_arc600 2 .#define bfd_mach_arc_arc700 3 diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h index 12f6a40..78e2ea5 100644 --- a/bfd/bfd-in2.h +++ b/bfd/bfd-in2.h @@ -1977,7 +1977,7 @@ enum bfd_architecture #define bfd_mach_v850e 'E' #define bfd_mach_v850e1 '1' bfd_arch_arc, /* ARC Cores */ -#define bfd_mach_arc_a4 0 +#define bfd_mach_arc_unknown 0 #define bfd_mach_arc_a5 1 #define bfd_mach_arc_arc600 2 #define bfd_mach_arc_arc700 3 @@ -3254,11 +3254,11 @@ are not stored in the the instruction. The upper 11 bits are installed in bits 10 through 0. */ BFD_RELOC_ARC_S13_PCREL, -/* ARCompact Middle-endian 32 bit word relocation */ +/* ARCompact Middle-endian 32 bit word relocation. */ BFD_RELOC_ARC_32_ME, /* ARCompact PC Relative 32 bit relocation. */ - BFD_RELOC_ARC_PC32 , + BFD_RELOC_ARC_PC32, /* ARC 700 GOT specific relocation. This computes the distance from the current pcl to the symbol's global offset table entry. */ @@ -3266,12 +3266,12 @@ pcl to the symbol's global offset table entry. */ /* ARC 700 PLT specific relocation. This computes the distance from the base of the PLT to the symbols PLT entry. */ - BFD_RELOC_ARC_PLT32 , + BFD_RELOC_ARC_PLT32, /* ARC 700 Copy relocation. This refers to a location in the writable segment and during execution the dynamic linker copies data associated with the shared objects symbol to the location specified by the offset. Created for -dynamic linking by the linker . */ +dynamic linking by the linker. */ BFD_RELOC_ARC_COPY, /* ARC 700 Global Data relocaton.This is to set a GOT entry to the address @@ -3294,7 +3294,7 @@ Global Offset Table This causes the linker to build the GOT. */ BFD_RELOC_ARC_GOTOFF, /* This gives the difference between the address of the GOT base and the -current PC. The symbol referenced is _GLOBAL_OFFSET_TABLE . */ +current PC. The symbol referenced is _GLOBAL_OFFSET_TABLE. */ BFD_RELOC_ARC_GOTPC, /* ARC 700 GOT specific relocation. This computes the distance from the base diff --git a/bfd/configure b/bfd/configure index 892d328..bb56d77 100755 --- a/bfd/configure +++ b/bfd/configure @@ -1,25 +1,54 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.59. +# Generated by GNU Autoconf 2.61. # -# Copyright (C) 2003 Free Software Foundation, Inc. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## -# Be Bourne compatible +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' -elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then - set -o posix + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi + + + + +# PATH needs CR +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh fi -DUALCASE=1; export DUALCASE # for MKS sh # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then @@ -29,8 +58,43 @@ else fi +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +as_nl=' +' +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + { (exit 1); exit 1; } +fi + # Work around bugs in pre-3.0 UWIN ksh. -$as_unset ENV MAIL MAILPATH +for as_var in ENV MAIL MAILPATH +do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var +done PS1='$ ' PS2='> ' PS4='+ ' @@ -44,18 +108,19 @@ do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else - $as_unset $as_var + ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. -if expr a : '\(a\)' >/dev/null 2>&1; then +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi -if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false @@ -63,157 +128,388 @@ fi # Name of the executable. -as_me=`$as_basename "$0" || +as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)$' \| \ - . : '\(.\)' 2>/dev/null || + X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } - /^X\/\(\/\/\)$/{ s//\1/; q; } - /^X\/\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` +# CDPATH. +$as_unset CDPATH -# PATH needs CR, and LINENO needs CR and PATH. -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh +if test "x$CONFIG_SHELL" = x; then + if (eval ":") 2>/dev/null; then + as_have_required=yes +else + as_have_required=no fi + if test $as_have_required = yes && (eval ": +(as_func_return () { + (exit \$1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} - as_lineno_1=$LINENO - as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" || { - # Find who we are. Look in the path if we contain no path at all - # relative or not. - case $0 in - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break -done +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi - ;; - esac - # We did not find ourselves, most probably we were run as `sh COMMAND' - # in which case we are not to be found in the path. - if test "x$as_myself" = x; then - as_myself=$0 - fi - if test ! -f "$as_myself"; then - { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 - { (exit 1); exit 1; }; } - fi - case $CONFIG_SHELL in - '') +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = \"\$1\" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test \$exitcode = 0) || { (exit 1); exit 1; } + +( + as_lineno_1=\$LINENO + as_lineno_2=\$LINENO + test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && + test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } +") 2> /dev/null; then + : +else + as_candidate_shells= as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for as_base in sh bash ksh sh5; do - case $as_dir in + case $as_dir in /*) - if ("$as_dir/$as_base" -c ' + for as_base in sh bash ksh sh5; do + as_candidate_shells="$as_candidate_shells $as_dir/$as_base" + done;; + esac +done +IFS=$as_save_IFS + + + for as_shell in $as_candidate_shells $SHELL; do + # Try only shells that exist, to save several forks. + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { ("$as_shell") 2> /dev/null <<\_ASEOF +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi + + +: +_ASEOF +}; then + CONFIG_SHELL=$as_shell + as_have_required=yes + if { "$as_shell" 2> /dev/null <<\_ASEOF +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi + + +: +(as_func_return () { + (exit $1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} + +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi + +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = "$1" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test $exitcode = 0) || { (exit 1); exit 1; } + +( as_lineno_1=$LINENO as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then - $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } - $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } - CONFIG_SHELL=$as_dir/$as_base - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$0" ${1+"$@"} - fi;; - esac - done -done -;; - esac + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } + +_ASEOF +}; then + break +fi + +fi + + done + + if test "x$CONFIG_SHELL" != x; then + for as_var in BASH_ENV ENV + do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var + done + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} +fi + + + if test $as_have_required = no; then + echo This script requires a shell more modern than all the + echo shells that I found on your system. Please install a + echo modern shell, or manually run the script under such a + echo shell if you do have one. + { (exit 1); exit 1; } +fi + + +fi + +fi + + + +(eval "as_func_return () { + (exit \$1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} + +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi + +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = \"\$1\" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test \$exitcode = 0") || { + echo No shell found that supports shell functions. + echo Please tell autoconf@gnu.org about your system, + echo including any error possibly output before this + echo message +} + + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line before each line; the second 'sed' does the real - # work. The second script uses 'N' to pair each line-number line - # with the numbered line, and appends trailing '-' during - # substitution so that $LINENO is not a special case at line end. + # line-number line after each line using $LINENO; the second 'sed' + # does the real work. The second script uses 'N' to pair each + # line-number line with the line containing $LINENO, and appends + # trailing '-' during substitution so that $LINENO is not a special + # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) - sed '=' <$as_myself | + # scripts with optimization help from Paolo Bonzini. Blame Lee + # E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno N - s,$,-, - : loop - s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop - s,-$,, - s,^['$as_cr_digits']*\n,, + s/-\n.*// ' >$as_me.lineno && - chmod +x $as_me.lineno || + chmod +x "$as_me.lineno" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensible to this). - . ./$as_me.lineno + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" # Exit status is that of the last command. exit } -case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in - *c*,-n*) ECHO_N= ECHO_C=' -' ECHO_T=' ' ;; - *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; - *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in +-n*) + case `echo 'x\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + *) ECHO_C='\c';; + esac;; +*) + ECHO_N='-n';; esac -if expr a : '\(a\)' >/dev/null 2>&1; then +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir +fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then - # We could just check for DJGPP; but this test a) works b) is more generic - # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). - if test -f conf$$.exe; then - # Don't use ln at all; we don't have any links + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' - else - as_ln_s='ln -s' - fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi -rm -f conf$$ conf$$.exe conf$$.file +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p=: @@ -222,7 +518,28 @@ else as_mkdir_p=false fi -as_executable_p="test -f" +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' +else + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +fi +as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" @@ -231,15 +548,6 @@ as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" -# IFS -# We need space, tab and new line, in precisely that order. -as_nl=' -' -IFS=" $as_nl" - -# CDPATH. -$as_unset CDPATH - # Check that we are running under the correct shell. @@ -390,29 +698,26 @@ fi +exec 7<&0 &1 + # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` -exec 6>&1 - # # Initializations. # ac_default_prefix=/usr/local +ac_clean_files= ac_config_libobj_dir=. +LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} -# Maximum number of lines to put in a shell here document. -# This variable seems obsolete. It should probably be removed, and -# only ac_max_sed_lines should be used. -: ${ac_max_here_lines=38} - # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= @@ -424,42 +729,207 @@ ac_unique_file="libbfd.c" # Factoring default headers for most tests. ac_includes_default="\ #include -#if HAVE_SYS_TYPES_H +#ifdef HAVE_SYS_TYPES_H # include #endif -#if HAVE_SYS_STAT_H +#ifdef HAVE_SYS_STAT_H # include #endif -#if STDC_HEADERS +#ifdef STDC_HEADERS # include # include #else -# if HAVE_STDLIB_H +# ifdef HAVE_STDLIB_H # include # endif #endif -#if HAVE_STRING_H -# if !STDC_HEADERS && HAVE_MEMORY_H +#ifdef HAVE_STRING_H +# if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif -#if HAVE_STRINGS_H +#ifdef HAVE_STRINGS_H # include #endif -#if HAVE_INTTYPES_H +#ifdef HAVE_INTTYPES_H # include -#else -# if HAVE_STDINT_H -# include -# endif #endif -#if HAVE_UNISTD_H +#ifdef HAVE_STDINT_H +# include +#endif +#ifdef HAVE_UNISTD_H # include #endif" -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE AR ac_ct_AR RANLIB ac_ct_RANLIB LIBTOOL SED EGREP FGREP GREP LD DUMPBIN ac_ct_DUMPBIN NM LN_S lt_ECHO CPP DEBUGDIR PKGVERSION REPORT_BUGS_TO REPORT_BUGS_TEXI WARN_CFLAGS NO_WERROR MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT GENINSRC_NEVER_TRUE GENINSRC_NEVER_FALSE INSTALL_LIBBFD_TRUE INSTALL_LIBBFD_FALSE host_noncanonical target_noncanonical bfdlibdir bfdincludedir USE_NLS LIBINTL LIBINTL_DEP INCINTL XGETTEXT GMSGFMT POSUB CATALOGS DATADIRNAME INSTOBJEXT GENCAT CATOBJEXT MKINSTALLDIRS MSGFMT MSGMERGE HDEFINES BFD_HOST_64BIT_LONG BFD_HOST_64BIT_LONG_LONG BFD_HOST_64_BIT_DEFINED BFD_HOST_64_BIT BFD_HOST_U_64_BIT BFD_HOSTPTR_T CC_FOR_BUILD EXEEXT_FOR_BUILD COREFILE COREFLAG WIN32LDFLAGS WIN32LIBADD TDEFINES wordsize bfd64_libs all_backends bfd_backends bfd_machines bfd_default_target_size bfd_file_ptr bfd_ufile_ptr tdefaults datarootdir docdir htmldir LIBOBJS LTLIBOBJS' +ac_subst_vars='SHELL +PATH_SEPARATOR +PACKAGE_NAME +PACKAGE_TARNAME +PACKAGE_VERSION +PACKAGE_STRING +PACKAGE_BUGREPORT +exec_prefix +prefix +program_transform_name +bindir +sbindir +libexecdir +datarootdir +datadir +sysconfdir +sharedstatedir +localstatedir +includedir +oldincludedir +docdir +infodir +htmldir +dvidir +pdfdir +psdir +libdir +localedir +mandir +DEFS +ECHO_C +ECHO_N +ECHO_T +LIBS +build_alias +host_alias +target_alias +build +build_cpu +build_vendor +build_os +host +host_cpu +host_vendor +host_os +target +target_cpu +target_vendor +target_os +CC +CFLAGS +LDFLAGS +CPPFLAGS +ac_ct_CC +EXEEXT +OBJEXT +INSTALL_PROGRAM +INSTALL_SCRIPT +INSTALL_DATA +CYGPATH_W +PACKAGE +VERSION +ACLOCAL +AUTOCONF +AUTOMAKE +AUTOHEADER +MAKEINFO +install_sh +STRIP +INSTALL_STRIP_PROGRAM +mkdir_p +AWK +SET_MAKE +am__leading_dot +AMTAR +am__tar +am__untar +DEPDIR +am__include +am__quote +AMDEP_TRUE +AMDEP_FALSE +AMDEPBACKSLASH +CCDEPMODE +am__fastdepCC_TRUE +am__fastdepCC_FALSE +AR +RANLIB +LIBTOOL +SED +GREP +EGREP +FGREP +LD +DUMPBIN +ac_ct_DUMPBIN +NM +LN_S +lt_ECHO +CPP +DEBUGDIR +PKGVERSION +REPORT_BUGS_TO +REPORT_BUGS_TEXI +WARN_CFLAGS +NO_WERROR +MAINTAINER_MODE_TRUE +MAINTAINER_MODE_FALSE +MAINT +GENINSRC_NEVER_TRUE +GENINSRC_NEVER_FALSE +INSTALL_LIBBFD_TRUE +INSTALL_LIBBFD_FALSE +host_noncanonical +target_noncanonical +bfdlibdir +bfdincludedir +USE_NLS +LIBINTL +LIBINTL_DEP +INCINTL +XGETTEXT +GMSGFMT +POSUB +CATALOGS +DATADIRNAME +INSTOBJEXT +GENCAT +CATOBJEXT +MKINSTALLDIRS +MSGFMT +MSGMERGE +HDEFINES +BFD_HOST_64BIT_LONG +BFD_HOST_64BIT_LONG_LONG +BFD_HOST_64_BIT_DEFINED +BFD_HOST_64_BIT +BFD_HOST_U_64_BIT +BFD_HOSTPTR_T +CC_FOR_BUILD +EXEEXT_FOR_BUILD +COREFILE +COREFLAG +WIN32LDFLAGS +WIN32LIBADD +TDEFINES +wordsize +bfd64_libs +all_backends +bfd_backends +bfd_machines +bfd_default_target_size +bfd_file_ptr +bfd_ufile_ptr +tdefaults +LIBOBJS +LTLIBOBJS' ac_subst_files='' + ac_precious_vars='build_alias +host_alias +target_alias +CC +CFLAGS +LDFLAGS +LIBS +CPPFLAGS +CPP' + # Initialize some variables set by options. ac_init_help= @@ -486,34 +956,48 @@ x_libraries=NONE # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. +# (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' -datadir='${prefix}/share' +datarootdir='${prefix}/share' +datadir='${datarootdir}' 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' +docdir='${datarootdir}/doc/${PACKAGE}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' ac_prev= +ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then - eval "$ac_prev=\$ac_option" + eval $ac_prev=\$ac_option ac_prev= continue fi - ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` + case $ac_option in + *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *) ac_optarg=yes ;; + esac # Accept the important Cygnus configure options, so we can diagnose typos. - case $ac_option in + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; @@ -535,33 +1019,45 @@ do --config-cache | -C) cache_file=config.cache ;; - -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; - -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ - | --da=*) + -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + -disable-* | --disable-*) ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } - ac_feature=`echo $ac_feature | sed 's/-/_/g'` - eval "enable_$ac_feature=no" ;; + ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` + eval enable_$ac_feature=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } - ac_feature=`echo $ac_feature | sed 's/-/_/g'` - case $ac_option in - *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; - *) ac_optarg=yes ;; - esac - eval "enable_$ac_feature='$ac_optarg'" ;; + ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` + eval enable_$ac_feature=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ @@ -588,6 +1084,12 @@ do -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$ac_optarg ;; + -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; @@ -612,13 +1114,16 @@ do | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + -localstatedir | --localstatedir | --localstatedi | --localstated \ - | --localstate | --localstat | --localsta | --localst \ - | --locals | --local | --loca | --loc | --lo) + | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ - | --localstate=* | --localstat=* | --localsta=* | --localst=* \ - | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) @@ -683,6 +1188,16 @@ do | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$ac_optarg ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; @@ -735,24 +1250,20 @@ do -with-* | --with-*) ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } - ac_package=`echo $ac_package| sed 's/-/_/g'` - case $ac_option in - *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; - *) ac_optarg=yes ;; - esac - eval "with_$ac_package='$ac_optarg'" ;; + ac_package=`echo $ac_package | sed 's/[-.]/_/g'` + eval with_$ac_package=\$ac_optarg ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } - ac_package=`echo $ac_package | sed 's/-/_/g'` - eval "with_$ac_package=no" ;; + ac_package=`echo $ac_package | sed 's/[-.]/_/g'` + eval with_$ac_package=no ;; --x) # Obsolete; use --with-x. @@ -783,8 +1294,7 @@ Try \`$0 --help' for more information." >&2 expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } - ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` - eval "$ac_envvar='$ac_optarg'" + eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) @@ -804,27 +1314,19 @@ if test -n "$ac_prev"; then { (exit 1); exit 1; }; } fi -# Be sure to have absolute paths. -for ac_var in exec_prefix prefix +# Be sure to have absolute directory names. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir do - eval ac_val=$`echo $ac_var` + eval ac_val=\$$ac_var case $ac_val in - [\\/$]* | ?:[\\/]* | NONE | '' ) ;; - *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 - { (exit 1); exit 1; }; };; - esac -done - -# Be sure to have absolute paths. -for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ - localstatedir libdir includedir oldincludedir infodir mandir -do - eval ac_val=$`echo $ac_var` - case $ac_val in - [\\/$]* | ?:[\\/]* ) ;; - *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 - { (exit 1); exit 1; }; };; + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac + { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; } done # There might be people who depend on the old broken behavior: `$host' @@ -851,74 +1353,76 @@ test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + { echo "$as_me: error: Working directory cannot be determined" >&2 + { (exit 1); exit 1; }; } +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + { echo "$as_me: error: pwd does not report name of working directory" >&2 + { (exit 1); exit 1; }; } + + # 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_confdir=`(dirname "$0") 2>/dev/null || + # Try the directory containing this script, then the parent directory. + ac_confdir=`$as_dirname -- "$0" || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || + X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X"$0" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` srcdir=$ac_confdir - if test ! -r $srcdir/$ac_unique_file; then + 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 "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 - { (exit 1); exit 1; }; } - else - { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 +if test ! -r "$srcdir/$ac_unique_file"; then + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } - fi fi -(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || - { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 { (exit 1); exit 1; }; } -srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` -ac_env_build_alias_set=${build_alias+set} -ac_env_build_alias_value=$build_alias -ac_cv_env_build_alias_set=${build_alias+set} -ac_cv_env_build_alias_value=$build_alias -ac_env_host_alias_set=${host_alias+set} -ac_env_host_alias_value=$host_alias -ac_cv_env_host_alias_set=${host_alias+set} -ac_cv_env_host_alias_value=$host_alias -ac_env_target_alias_set=${target_alias+set} -ac_env_target_alias_value=$target_alias -ac_cv_env_target_alias_set=${target_alias+set} -ac_cv_env_target_alias_value=$target_alias -ac_env_CC_set=${CC+set} -ac_env_CC_value=$CC -ac_cv_env_CC_set=${CC+set} -ac_cv_env_CC_value=$CC -ac_env_CFLAGS_set=${CFLAGS+set} -ac_env_CFLAGS_value=$CFLAGS -ac_cv_env_CFLAGS_set=${CFLAGS+set} -ac_cv_env_CFLAGS_value=$CFLAGS -ac_env_LDFLAGS_set=${LDFLAGS+set} -ac_env_LDFLAGS_value=$LDFLAGS -ac_cv_env_LDFLAGS_set=${LDFLAGS+set} -ac_cv_env_LDFLAGS_value=$LDFLAGS -ac_env_CPPFLAGS_set=${CPPFLAGS+set} -ac_env_CPPFLAGS_value=$CPPFLAGS -ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} -ac_cv_env_CPPFLAGS_value=$CPPFLAGS -ac_env_CPP_set=${CPP+set} -ac_env_CPP_value=$CPP -ac_cv_env_CPP_set=${CPP+set} -ac_cv_env_CPP_value=$CPP + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done # # Report the --help message. @@ -947,9 +1451,6 @@ Configuration: -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] -_ACEOF - - cat <<_ACEOF Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] @@ -967,15 +1468,22 @@ Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] - --datadir=DIR read-only architecture-independent data [PREFIX/share] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] - --infodir=DIR info documentation [PREFIX/info] - --mandir=DIR man documentation [PREFIX/man] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF @@ -1001,10 +1509,8 @@ Optional Features: --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors - --enable-shared[=PKGS] - build shared libraries [default=no] - --enable-static[=PKGS] - build static libraries [default=yes] + --enable-shared[=PKGS] build shared libraries [default=no] + --enable-static[=PKGS] build static libraries [default=yes] --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --disable-libtool-lock avoid locking (might break parallel builds) @@ -1039,126 +1545,95 @@ Some influential environment variables: CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory - CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have - headers in a nonstandard directory + LIBS libraries to pass to the linker, e.g. -l + CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I if + you have headers in a nonstandard directory CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. _ACEOF +ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. - ac_popdir=`pwd` for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue - test -d $ac_dir || continue + test -d "$ac_dir" || continue ac_builddir=. -if test "$ac_dir" != .; then +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A "../" for each directory in $ac_dir_suffix. - ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` -else - ac_dir_suffix= ac_top_builddir= -fi + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix case $srcdir in - .) # No --srcdir option. We are building in place. + .) # We are building in place. ac_srcdir=. - if test -z "$ac_top_builddir"; then - ac_top_srcdir=. - else - ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` - fi ;; - [\\/]* | ?:[\\/]* ) # Absolute path. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir ;; - *) # Relative path. - ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_builddir$srcdir ;; -esac - -# Do not use `cd foo && pwd` to compute absolute paths, because -# the directories may not exist. -case `pwd` in -.) ac_abs_builddir="$ac_dir";; -*) - case "$ac_dir" in - .) ac_abs_builddir=`pwd`;; - [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; - *) ac_abs_builddir=`pwd`/"$ac_dir";; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_builddir=${ac_top_builddir}.;; -*) - case ${ac_top_builddir}. in - .) ac_abs_top_builddir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; - *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_srcdir=$ac_srcdir;; -*) - case $ac_srcdir in - .) ac_abs_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; - *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_srcdir=$ac_top_srcdir;; -*) - case $ac_top_srcdir in - .) ac_abs_top_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; - *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; - esac;; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac - - cd $ac_dir - # Check for guested configure; otherwise get Cygnus style configure. - if test -f $ac_srcdir/configure.gnu; then - echo - $SHELL $ac_srcdir/configure.gnu --help=recursive - elif test -f $ac_srcdir/configure; then - echo - $SHELL $ac_srcdir/configure --help=recursive - elif test -f $ac_srcdir/configure.ac || - test -f $ac_srcdir/configure.in; then - echo - $ac_configure --help +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for guested configure. + if test -f "$ac_srcdir/configure.gnu"; then + echo && + $SHELL "$ac_srcdir/configure.gnu" --help=recursive + elif test -f "$ac_srcdir/configure"; then + echo && + $SHELL "$ac_srcdir/configure" --help=recursive else echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 - fi - cd $ac_popdir + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } done fi -test -n "$ac_init_help" && exit 0 +test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF +configure +generated by GNU Autoconf 2.61 -Copyright (C) 2003 Free Software Foundation, Inc. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF - exit 0 + exit fi -exec 5>config.log -cat >&5 <<_ACEOF +cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was -generated by GNU Autoconf 2.59. Invocation command line was +generated by GNU Autoconf 2.61. Invocation command line was $ $0 $@ _ACEOF +exec 5>>config.log { cat <<_ASUNAME ## --------- ## @@ -1177,7 +1652,7 @@ uname -v = `(uname -v) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` -hostinfo = `(hostinfo) 2>/dev/null || echo unknown` +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` @@ -1191,6 +1666,7 @@ do test -z "$as_dir" && as_dir=. echo "PATH: $as_dir" done +IFS=$as_save_IFS } >&5 @@ -1212,7 +1688,6 @@ _ACEOF ac_configure_args= ac_configure_args0= ac_configure_args1= -ac_sep= ac_must_keep_next=false for ac_pass in 1 2 do @@ -1223,7 +1698,7 @@ do -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) + *\'*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in @@ -1245,9 +1720,7 @@ do -* ) ac_must_keep_next=true ;; esac fi - ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" - # Get rid of the leading space. - ac_sep=" " + ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac done @@ -1258,8 +1731,8 @@ $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_ # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. -# WARNING: Be sure not to use single quotes in there, as some shells, -# such as our DU 5.0 friend, will then `close' the trap. +# WARNING: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { @@ -1272,20 +1745,34 @@ trap 'exit_status=$? _ASBOX echo # The following way of writing the cache mishandles newlines in values, -{ +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 +echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + *) $as_unset $ac_var ;; + esac ;; + esac + done (set) 2>&1 | - case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in - *ac_space=\ *) + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) sed -n \ - "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" - ;; + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( *) - sed -n \ - "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; - esac; -} + esac | + sort +) echo cat <<\_ASBOX @@ -1296,22 +1783,28 @@ _ASBOX echo for ac_var in $ac_subst_vars do - eval ac_val=$`echo $ac_var` - echo "$ac_var='"'"'$ac_val'"'"'" + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX -## ------------- ## -## Output files. ## -## ------------- ## +## ------------------- ## +## File substitutions. ## +## ------------------- ## _ASBOX echo for ac_var in $ac_subst_files do - eval ac_val=$`echo $ac_var` - echo "$ac_var='"'"'$ac_val'"'"'" + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + echo "$ac_var='\''$ac_val'\''" done | sort echo fi @@ -1323,26 +1816,24 @@ _ASBOX ## ----------- ## _ASBOX echo - sed "/^$/d" confdefs.h | sort + cat confdefs.h echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" echo "$as_me: exit $exit_status" } >&5 - rm -f core *.core && - rm -rf conftest* confdefs* conf$$* $ac_clean_files && + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status - ' 0 +' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal done ac_signal=0 # 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 +rm -f -r conftest* confdefs.h # Predefined preprocessor variables. @@ -1373,14 +1864,17 @@ _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. -if test -z "$CONFIG_SITE"; then - if test "x$prefix" != xNONE; then - CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" - else - CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" - fi +if test -n "$CONFIG_SITE"; then + set x "$CONFIG_SITE" +elif test "x$prefix" != xNONE; then + set x "$prefix/share/config.site" "$prefix/etc/config.site" +else + set x "$ac_default_prefix/share/config.site" \ + "$ac_default_prefix/etc/config.site" fi -for ac_site_file in $CONFIG_SITE; do +shift +for ac_site_file +do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} @@ -1396,8 +1890,8 @@ if test -r "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in - [\\/]* | ?:[\\/]* ) . $cache_file;; - *) . ./$cache_file;; + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; esac fi else @@ -1409,12 +1903,11 @@ fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false -for ac_var in `(set) 2>&1 | - sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do +for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set - eval ac_old_val="\$ac_cv_env_${ac_var}_value" - eval ac_new_val="\$ac_env_${ac_var}_value" + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 @@ -1439,8 +1932,7 @@ echo "$as_me: current value: $ac_new_val" >&2;} # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) - ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in @@ -1457,12 +1949,6 @@ echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start ov { (exit 1); exit 1; }; } fi -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - @@ -1479,109 +1965,164 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_aux_dir= -for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do - if test -f $ac_dir/install-sh; then +for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; 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 + elif 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/shtool; then + elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then - { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5 -echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;} + { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5 +echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;} { (exit 1); exit 1; }; } fi -ac_config_guess="$SHELL $ac_aux_dir/config.guess" -ac_config_sub="$SHELL $ac_aux_dir/config.sub" -ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. +ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. +ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. + # Make sure we can run config.sub. -$ac_config_sub sun4 >/dev/null 2>&1 || - { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5 -echo "$as_me: error: cannot run $ac_config_sub" >&2;} +$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || + { { echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5 +echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;} { (exit 1); exit 1; }; } -echo "$as_me:$LINENO: checking build system type" >&5 -echo $ECHO_N "checking build system type... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking build system type" >&5 +echo $ECHO_N "checking build system type... $ECHO_C" >&6; } if test "${ac_cv_build+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_cv_build_alias=$build_alias -test -z "$ac_cv_build_alias" && - ac_cv_build_alias=`$ac_config_guess` -test -z "$ac_cv_build_alias" && + ac_build_alias=$build_alias +test "x$ac_build_alias" = x && + ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` +test "x$ac_build_alias" = x && { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 echo "$as_me: error: cannot guess build type; you must specify one" >&2;} { (exit 1); exit 1; }; } -ac_cv_build=`$ac_config_sub $ac_cv_build_alias` || - { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5 -echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;} +ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || + { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5 +echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;} { (exit 1); exit 1; }; } fi -echo "$as_me:$LINENO: result: $ac_cv_build" >&5 -echo "${ECHO_T}$ac_cv_build" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_build" >&5 +echo "${ECHO_T}$ac_cv_build" >&6; } +case $ac_cv_build in +*-*-*) ;; +*) { { echo "$as_me:$LINENO: error: invalid value of canonical build" >&5 +echo "$as_me: error: invalid value of canonical build" >&2;} + { (exit 1); exit 1; }; };; +esac build=$ac_cv_build -build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` - - -echo "$as_me:$LINENO: checking host system type" >&5 -echo $ECHO_N "checking host system type... $ECHO_C" >&6 +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_build +shift +build_cpu=$1 +build_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +build_os=$* +IFS=$ac_save_IFS +case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac + + +{ echo "$as_me:$LINENO: checking host system type" >&5 +echo $ECHO_N "checking host system type... $ECHO_C" >&6; } if test "${ac_cv_host+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_cv_host_alias=$host_alias -test -z "$ac_cv_host_alias" && - ac_cv_host_alias=$ac_cv_build_alias -ac_cv_host=`$ac_config_sub $ac_cv_host_alias` || - { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5 -echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;} + if test "x$host_alias" = x; then + ac_cv_host=$ac_cv_build +else + ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || + { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5 +echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;} { (exit 1); exit 1; }; } +fi fi -echo "$as_me:$LINENO: result: $ac_cv_host" >&5 -echo "${ECHO_T}$ac_cv_host" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_host" >&5 +echo "${ECHO_T}$ac_cv_host" >&6; } +case $ac_cv_host in +*-*-*) ;; +*) { { echo "$as_me:$LINENO: error: invalid value of canonical host" >&5 +echo "$as_me: error: invalid value of canonical host" >&2;} + { (exit 1); exit 1; }; };; +esac host=$ac_cv_host -host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` - - -echo "$as_me:$LINENO: checking target system type" >&5 -echo $ECHO_N "checking target system type... $ECHO_C" >&6 +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_host +shift +host_cpu=$1 +host_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +host_os=$* +IFS=$ac_save_IFS +case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac + + +{ echo "$as_me:$LINENO: checking target system type" >&5 +echo $ECHO_N "checking target system type... $ECHO_C" >&6; } if test "${ac_cv_target+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_cv_target_alias=$target_alias -test "x$ac_cv_target_alias" = "x" && - ac_cv_target_alias=$ac_cv_host_alias -ac_cv_target=`$ac_config_sub $ac_cv_target_alias` || - { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_target_alias failed" >&5 -echo "$as_me: error: $ac_config_sub $ac_cv_target_alias failed" >&2;} + if test "x$target_alias" = x; then + ac_cv_target=$ac_cv_host +else + ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` || + { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&5 +echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&2;} { (exit 1); exit 1; }; } +fi fi -echo "$as_me:$LINENO: result: $ac_cv_target" >&5 -echo "${ECHO_T}$ac_cv_target" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_target" >&5 +echo "${ECHO_T}$ac_cv_target" >&6; } +case $ac_cv_target in +*-*-*) ;; +*) { { echo "$as_me:$LINENO: error: invalid value of canonical target" >&5 +echo "$as_me: error: invalid value of canonical target" >&2;} + { (exit 1); exit 1; }; };; +esac target=$ac_cv_target -target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -target_vendor=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -target_os=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_target +shift +target_cpu=$1 +target_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +target_os=$* +IFS=$ac_save_IFS +case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac # The aliases save the names the user supplied, while $host etc. @@ -1598,8 +2139,8 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -1612,32 +2153,34 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -1650,36 +2193,51 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6 + { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi - CC=$ac_ct_CC + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -1692,74 +2250,34 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - -fi -if test -z "$ac_cv_prog_CC"; then - ac_ct_CC=$CC - # Extract the first word of "cc", so it can be a program name with args. -set dummy cc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="cc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6 + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi - CC=$ac_ct_CC -else - CC="$ac_cv_prog_CC" -fi + fi 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 "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -1773,7 +2291,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue @@ -1784,6 +2302,7 @@ do fi done done +IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. @@ -1801,22 +2320,23 @@ fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then - for ac_prog in cl + for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -1829,36 +2349,38 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC - for ac_prog in cl + for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -1871,29 +2393,45 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6 + { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + test -n "$ac_ct_CC" && break done - CC=$ac_ct_CC + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi fi fi @@ -1906,21 +2444,35 @@ See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. -echo "$as_me:$LINENO:" \ - "checking for C compiler version" >&5 +echo "$as_me:$LINENO: checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` -{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 - (eval $ac_compiler --version &5) 2>&5 +{ (ac_try="$ac_compiler --version >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } -{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 - (eval $ac_compiler -v &5) 2>&5 +{ (ac_try="$ac_compiler -v >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } -{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 - (eval $ac_compiler -V &5) 2>&5 +{ (ac_try="$ac_compiler -V >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } @@ -1945,47 +2497,77 @@ ac_clean_files="$ac_clean_files a.out a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. -echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 -echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 +echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; } ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` -if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 - (eval $ac_link_default) 2>&5 +# +# List of possible output files, starting from the most likely. +# The algorithm is not robust to junk in `.', hence go to wildcards (a.*) +# only as a last resort. b.out is created by i960 compilers. +ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out' +# +# The IRIX 6 linker writes into existing files which may not be +# executable, retaining their permissions. Remove them first so a +# subsequent execution test works. +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { (ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link_default") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then - # Find the output, starting from the most likely. This scheme is -# not robust to junk in `.', hence go to wildcards (a.*) only as a last -# resort. - -# Be careful to initialize this variable, since it used to be cached. -# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. -ac_cv_exeext= -# b.out is created by i960 compilers. -for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out + # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. +# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' +# in a Makefile. We should not override ac_cv_exeext if it was cached, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) - ;; - conftest.$ac_ext ) - # This is the source file. + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) - ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - # FIXME: I believe we export ac_cv_exeext for Libtool, - # but it would be cool to find out if it's true. Does anybody - # maintain Libtool? --akim. - export ac_cv_exeext + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an `-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. break;; * ) break;; esac done +test "$ac_cv_exeext" = no && ac_cv_exeext= + else + ac_file='' +fi + +{ echo "$as_me:$LINENO: result: $ac_file" >&5 +echo "${ECHO_T}$ac_file" >&6; } +if test -z "$ac_file"; then echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -1997,19 +2579,21 @@ See \`config.log' for more details." >&2;} fi ac_exeext=$ac_cv_exeext -echo "$as_me:$LINENO: result: $ac_file" >&5 -echo "${ECHO_T}$ac_file" >&6 -# Check the compiler produces executables we can run. If not, either +# Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. -echo "$as_me:$LINENO: checking whether the C compiler works" >&5 -echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether the C compiler works" >&5 +echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; } # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -2028,22 +2612,27 @@ See \`config.log' for more details." >&2;} fi fi fi -echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 +{ echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save -# Check the compiler produces executables we can run. If not, either +# Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. -echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 -echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 -echo "$as_me:$LINENO: result: $cross_compiling" >&5 -echo "${ECHO_T}$cross_compiling" >&6 - -echo "$as_me:$LINENO: checking for suffix of executables" >&5 -echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +{ echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 +echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; } +{ echo "$as_me:$LINENO: result: $cross_compiling" >&5 +echo "${ECHO_T}$cross_compiling" >&6; } + +{ echo "$as_me:$LINENO: checking for suffix of executables" >&5 +echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; } +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then @@ -2054,9 +2643,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - export ac_cv_exeext break;; * ) break;; esac @@ -2070,14 +2658,14 @@ See \`config.log' for more details." >&2;} fi rm -f conftest$ac_cv_exeext -echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 -echo "${ECHO_T}$ac_cv_exeext" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 +echo "${ECHO_T}$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT -echo "$as_me:$LINENO: checking for suffix of object files" >&5 -echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for suffix of object files" >&5 +echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; } if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -2097,14 +2685,20 @@ main () } _ACEOF rm -f conftest.o conftest.obj -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then - for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac @@ -2122,12 +2716,12 @@ fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 -echo "${ECHO_T}$ac_cv_objext" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 +echo "${ECHO_T}$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT -echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 -echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -2150,50 +2744,49 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_compiler_gnu=no + ac_compiler_gnu=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi -echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 -echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS -CFLAGS="-g" -echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 -echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 +echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -2209,38 +2802,118 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_prog_cc_g=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + CFLAGS="" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_prog_cc_g=no + fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag fi -echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then @@ -2256,12 +2929,12 @@ else CFLAGS= fi fi -echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 -echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 -if test "${ac_cv_prog_cc_stdc+set}" = set; then +{ echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 +echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } +if test "${ac_cv_prog_cc_c89+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_cv_prog_cc_stdc=no + ac_cv_prog_cc_c89=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -2295,12 +2968,17 @@ static char *f (char * (*g) (char **, int), char **p, ...) /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated - as 'x'. The following induces an error, until -std1 is added to get + as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something - that's true only with -std1. */ + that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; @@ -2315,335 +2993,144 @@ return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; return 0; } _ACEOF -# Don't try gcc -ansi; that turns off useful extensions and -# breaks some systems' header files. -# AIX -qlanglvl=ansi -# Ultrix and OSF/1 -std1 -# HP-UX 10.20 and later -Ae -# HP-UX older versions -Aa -D_HPUX_SOURCE -# SVR4 -Xc -D__EXTENSIONS__ -for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_prog_cc_stdc=$ac_arg -break + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_prog_cc_c89=$ac_arg else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest.err conftest.$ac_objext + +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break done -rm -f conftest.$ac_ext conftest.$ac_objext +rm -f conftest.$ac_ext CC=$ac_save_CC fi - -case "x$ac_cv_prog_cc_stdc" in - x|xno) - echo "$as_me:$LINENO: result: none needed" >&5 -echo "${ECHO_T}none needed" >&6 ;; +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { echo "$as_me:$LINENO: result: none needed" >&5 +echo "${ECHO_T}none needed" >&6; } ;; + xno) + { echo "$as_me:$LINENO: result: unsupported" >&5 +echo "${ECHO_T}unsupported" >&6; } ;; *) - echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 - CC="$CC $ac_cv_prog_cc_stdc" ;; + CC="$CC $ac_cv_prog_cc_c89" + { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; esac -# Some people use a C++ compiler to compile C. Since we use `exit', -# in C++ we need to declare it. In case someone uses the same compiler -# for both compiling C and C++ we need to have the C++ compiler decide -# the declaration of exit, since it's the most demanding environment. + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +{ echo "$as_me:$LINENO: checking for library containing strerror" >&5 +echo $ECHO_N "checking for library containing strerror... $ECHO_C" >&6; } +if test "${ac_cv_search_strerror+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_func_search_save_LIBS=$LIBS cat >conftest.$ac_ext <<_ACEOF -#ifndef __cplusplus - choke me -#endif -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - for ac_declaration in \ - '' \ - 'extern "C" void std::exit (int) throw (); using std::exit;' \ - 'extern "C" void std::exit (int); using std::exit;' \ - 'extern "C" void exit (int) throw ();' \ - 'extern "C" void exit (int);' \ - 'void exit (int);' -do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_declaration -#include -int -main () -{ -exit (42); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -continue -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_declaration -int -main () -{ -exit (42); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -done -rm -f conftest* -if test -n "$ac_declaration"; then - echo '#ifdef __cplusplus' >>confdefs.h - echo $ac_declaration >>confdefs.h - echo '#endif' >>confdefs.h -fi - -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - -echo "$as_me:$LINENO: checking for library containing strerror" >&5 -echo $ECHO_N "checking for library containing strerror... $ECHO_C" >&6 -if test "${ac_cv_search_strerror+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_func_search_save_LIBS=$LIBS -ac_cv_search_strerror=no -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ +/* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char strerror (); int main () { -strerror (); +return strerror (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +for ac_lib in '' cposix; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_search_strerror="none required" + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_search_strerror=$ac_res else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -if test "$ac_cv_search_strerror" = no; then - for ac_lib in cposix; do - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char strerror (); -int -main () -{ -strerror (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_search_strerror="-l$ac_lib" -break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +fi +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext + if test "${ac_cv_search_strerror+set}" = set; then + break fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - done +done +if test "${ac_cv_search_strerror+set}" = set; then + : +else + ac_cv_search_strerror=no fi +rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_search_strerror" >&5 -echo "${ECHO_T}$ac_cv_search_strerror" >&6 -if test "$ac_cv_search_strerror" != no; then - test "$ac_cv_search_strerror" = "none required" || LIBS="$ac_cv_search_strerror $LIBS" +{ echo "$as_me:$LINENO: result: $ac_cv_search_strerror" >&5 +echo "${ECHO_T}$ac_cv_search_strerror" >&6; } +ac_res=$ac_cv_search_strerror +if test "$ac_res" != no; then + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi @@ -2662,8 +3149,8 @@ am__api_version="1.9" # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. -echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 -echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 +echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; } if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -2685,7 +3172,7 @@ case $as_dir/ in # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then + if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. @@ -2704,21 +3191,22 @@ case $as_dir/ in ;; esac done +IFS=$as_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 + # As a last resort, use the slow shell script. Don't cache a + # value 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. + # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi -echo "$as_me:$LINENO: result: $INSTALL" >&5 -echo "${ECHO_T}$INSTALL" >&6 +{ echo "$as_me:$LINENO: result: $INSTALL" >&5 +echo "${ECHO_T}$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. @@ -2728,8 +3216,8 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' -echo "$as_me:$LINENO: checking whether build environment is sane" >&5 -echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether build environment is sane" >&5 +echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6; } # Just in case sleep 1 echo timestamp > conftest.file @@ -2771,20 +3259,20 @@ echo "$as_me: error: newly created file is older than distributed files! Check your system clock" >&2;} { (exit 1); exit 1; }; } fi -echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 +{ echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } test "$program_prefix" != NONE && - program_transform_name="s,^,$program_prefix,;$program_transform_name" + 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" + program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. echo might interpret backslashes. # By default was `s,x,x', remove it if useless. cat <<\_ACEOF >conftest.sed s/[\\$]/&&/g;s/;s,x,x,$// _ACEOF program_transform_name=`echo $program_transform_name | sed -f conftest.sed` -rm conftest.sed +rm -f conftest.sed # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` @@ -2836,8 +3324,8 @@ for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_AWK+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -2850,54 +3338,57 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AWK="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then - echo "$as_me:$LINENO: result: $AWK" >&5 -echo "${ECHO_T}$AWK" >&6 + { echo "$as_me:$LINENO: result: $AWK" >&5 +echo "${ECHO_T}$AWK" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + test -n "$AWK" && break done -echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 -echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6 -set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'` -if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then +{ echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6; } +set x ${MAKE-make}; ac_make=`echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.make <<\_ACEOF +SHELL = /bin/sh all: - @echo 'ac_maketemp="$(MAKE)"' + @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. -eval `${MAKE-make} -f conftest.make 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 +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac rm -f conftest.make fi -if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } SET_MAKE= else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi @@ -2912,7 +3403,7 @@ rmdir .tst 2>/dev/null DEPDIR="${am__leading_dot}deps" - ac_config_commands="$ac_config_commands depfiles" +ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} @@ -2922,8 +3413,8 @@ am__doit: .PHONY: am__doit END # If we don't find an include directive, just comment out the code. -echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5 -echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5 +echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6; } am__include="#" am__quote= _am_result=none @@ -2950,15 +3441,15 @@ if test "$am__include" = "#"; then fi -echo "$as_me:$LINENO: result: $_am_result" >&5 -echo "${ECHO_T}$_am_result" >&6 +{ echo "$as_me:$LINENO: result: $_am_result" >&5 +echo "${ECHO_T}$_am_result" >&6; } rm -f confinc confmf -# Check whether --enable-dependency-tracking or --disable-dependency-tracking was given. +# Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then - enableval="$enable_dependency_tracking" + enableval=$enable_dependency_tracking; +fi -fi; if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' @@ -3033,8 +3524,8 @@ if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -3047,32 +3538,34 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then - echo "$as_me:$LINENO: result: $STRIP" >&5 -echo "${ECHO_T}$STRIP" >&6 + { echo "$as_me:$LINENO: result: $STRIP" >&5 +echo "${ECHO_T}$STRIP" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -3085,27 +3578,41 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_STRIP="strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS - test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":" fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then - echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 -echo "${ECHO_T}$ac_ct_STRIP" >&6 + { echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 +echo "${ECHO_T}$ac_ct_STRIP" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi - STRIP=$ac_ct_STRIP + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi else STRIP="$ac_cv_prog_STRIP" fi @@ -3126,8 +3633,8 @@ am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' depcc="$CC" am_compiler_list= -echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 -echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 +echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6; } if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -3216,8 +3723,8 @@ else fi fi -echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 -echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6 +{ echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 +echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type @@ -3238,8 +3745,8 @@ fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. set dummy ${ac_tool_prefix}ar; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_AR+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -3252,32 +3759,34 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AR="${ac_tool_prefix}ar" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then - echo "$as_me:$LINENO: result: $AR" >&5 -echo "${ECHO_T}$AR" >&6 + { echo "$as_me:$LINENO: result: $AR" >&5 +echo "${ECHO_T}$AR" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + fi if test -z "$ac_cv_prog_AR"; then ac_ct_AR=$AR # Extract the first word of "ar", so it can be a program name with args. set dummy ar; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_AR+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -3290,26 +3799,41 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_AR="ar" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then - echo "$as_me:$LINENO: result: $ac_ct_AR" >&5 -echo "${ECHO_T}$ac_ct_AR" >&6 + { echo "$as_me:$LINENO: result: $ac_ct_AR" >&5 +echo "${ECHO_T}$ac_ct_AR" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi - AR=$ac_ct_AR + if test "x$ac_ct_AR" = x; then + AR="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + AR=$ac_ct_AR + fi else AR="$ac_cv_prog_AR" fi @@ -3317,8 +3841,8 @@ fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -3331,32 +3855,34 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then - echo "$as_me:$LINENO: result: $RANLIB" >&5 -echo "${ECHO_T}$RANLIB" >&6 + { echo "$as_me:$LINENO: result: $RANLIB" >&5 +echo "${ECHO_T}$RANLIB" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -3369,36 +3895,49 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_RANLIB="ranlib" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS - test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":" fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then - echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 -echo "${ECHO_T}$ac_ct_RANLIB" >&6 + { echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 +echo "${ECHO_T}$ac_ct_RANLIB" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi - RANLIB=$ac_ct_RANLIB + if test "x$ac_ct_RANLIB" = x; then + RANLIB=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + RANLIB=$ac_ct_RANLIB + fi else RANLIB="$ac_cv_prog_RANLIB" fi -# Check whether --enable-shared or --disable-shared was given. +# Check whether --enable-shared was given. if test "${enable_shared+set}" = set; then - enableval="$enable_shared" - p=${PACKAGE-default} + enableval=$enable_shared; p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; @@ -3417,7 +3956,8 @@ if test "${enable_shared+set}" = set; then esac else enable_shared=no -fi; +fi + @@ -3435,8 +3975,8 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -3449,32 +3989,34 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -3487,36 +4029,51 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6 + { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi - CC=$ac_ct_CC + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -3529,74 +4086,34 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - -fi -if test -z "$ac_cv_prog_CC"; then - ac_ct_CC=$CC - # Extract the first word of "cc", so it can be a program name with args. -set dummy cc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="cc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6 + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi - CC=$ac_ct_CC -else - CC="$ac_cv_prog_CC" -fi + fi 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 "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -3610,7 +4127,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue @@ -3621,6 +4138,7 @@ do fi done done +IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. @@ -3638,22 +4156,23 @@ fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then - for ac_prog in cl + for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -3666,36 +4185,38 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC - for ac_prog in cl + for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -3708,29 +4229,45 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6 + { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + test -n "$ac_ct_CC" && break done - CC=$ac_ct_CC + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi fi fi @@ -3743,27 +4280,41 @@ See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. -echo "$as_me:$LINENO:" \ - "checking for C compiler version" >&5 +echo "$as_me:$LINENO: checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` -{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 - (eval $ac_compiler --version &5) 2>&5 +{ (ac_try="$ac_compiler --version >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } -{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 - (eval $ac_compiler -v &5) 2>&5 +{ (ac_try="$ac_compiler -v >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } -{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 - (eval $ac_compiler -V &5) 2>&5 +{ (ac_try="$ac_compiler -V >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } -echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 -echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -3786,50 +4337,49 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_compiler_gnu=no + ac_compiler_gnu=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi -echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 -echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS -CFLAGS="-g" -echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 -echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 +echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -3845,38 +4395,118 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_prog_cc_g=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + CFLAGS="" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_prog_cc_g=no + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag fi -echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then @@ -3892,12 +4522,12 @@ else CFLAGS= fi fi -echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 -echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 -if test "${ac_cv_prog_cc_stdc+set}" = set; then +{ echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 +echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } +if test "${ac_cv_prog_cc_c89+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_cv_prog_cc_stdc=no + ac_cv_prog_cc_c89=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -3931,12 +4561,17 @@ static char *f (char * (*g) (char **, int), char **p, ...) /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated - as 'x'. The following induces an error, until -std1 is added to get + as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something - that's true only with -std1. */ + that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; @@ -3951,205 +4586,57 @@ return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; return 0; } _ACEOF -# Don't try gcc -ansi; that turns off useful extensions and -# breaks some systems' header files. -# AIX -qlanglvl=ansi -# Ultrix and OSF/1 -std1 -# HP-UX 10.20 and later -Ae -# HP-UX older versions -Aa -D_HPUX_SOURCE -# SVR4 -Xc -D__EXTENSIONS__ -for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_prog_cc_stdc=$ac_arg -break + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_prog_cc_c89=$ac_arg else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest.err conftest.$ac_objext + +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break done -rm -f conftest.$ac_ext conftest.$ac_objext +rm -f conftest.$ac_ext CC=$ac_save_CC fi - -case "x$ac_cv_prog_cc_stdc" in - x|xno) - echo "$as_me:$LINENO: result: none needed" >&5 -echo "${ECHO_T}none needed" >&6 ;; +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { echo "$as_me:$LINENO: result: none needed" >&5 +echo "${ECHO_T}none needed" >&6; } ;; + xno) + { echo "$as_me:$LINENO: result: unsupported" >&5 +echo "${ECHO_T}unsupported" >&6; } ;; *) - echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 - CC="$CC $ac_cv_prog_cc_stdc" ;; + CC="$CC $ac_cv_prog_cc_c89" + { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; esac -# Some people use a C++ compiler to compile C. Since we use `exit', -# in C++ we need to declare it. In case someone uses the same compiler -# for both compiling C and C++ we need to have the C++ compiler decide -# the declaration of exit, since it's the most demanding environment. -cat >conftest.$ac_ext <<_ACEOF -#ifndef __cplusplus - choke me -#endif -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - for ac_declaration in \ - '' \ - 'extern "C" void std::exit (int) throw (); using std::exit;' \ - 'extern "C" void std::exit (int); using std::exit;' \ - 'extern "C" void exit (int) throw ();' \ - 'extern "C" void exit (int);' \ - 'void exit (int);' -do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_declaration -#include -int -main () -{ -exit (42); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 -continue -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_declaration -int -main () -{ -exit (42); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -done -rm -f conftest* -if test -n "$ac_declaration"; then - echo '#ifdef __cplusplus' >>confdefs.h - echo $ac_declaration >>confdefs.h - echo '#endif' >>confdefs.h -fi - -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -4190,10 +4677,9 @@ enable_win32_dll=no -# Check whether --enable-static or --disable-static was given. +# Check whether --enable-static was given. if test "${enable_static+set}" = set; then - enableval="$enable_static" - p=${PACKAGE-default} + enableval=$enable_static; p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; @@ -4212,7 +4698,7 @@ if test "${enable_static+set}" = set; then esac else enable_static=yes -fi; +fi @@ -4222,13 +4708,14 @@ fi; -# Check whether --with-pic or --without-pic was given. + +# Check whether --with-pic was given. if test "${with_pic+set}" = set; then - withval="$with_pic" - pic_mode="$withval" + withval=$with_pic; pic_mode="$withval" else pic_mode=default -fi; +fi + test -z "$pic_mode" && pic_mode=default @@ -4238,10 +4725,9 @@ test -z "$pic_mode" && pic_mode=default -# Check whether --enable-fast-install or --disable-fast-install was given. +# Check whether --enable-fast-install was given. if test "${enable_fast_install+set}" = set; then - enableval="$enable_fast_install" - p=${PACKAGE-default} + enableval=$enable_fast_install; p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; @@ -4260,115 +4746,356 @@ if test "${enable_fast_install+set}" = set; then esac else enable_fast_install=yes -fi; +fi + + + + + + + + + +{ echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5 +echo $ECHO_N "checking for a sed that does not truncate output... $ECHO_C" >&6; } +if test "${ac_cv_path_SED+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ + for ac_i in 1 2 3 4 5 6 7; do + ac_script="$ac_script$as_nl$ac_script" + done + echo "$ac_script" | sed 99q >conftest.sed + $as_unset ac_script || ac_script= + # Extract the first word of "sed gsed" to use in msg output +if test -z "$SED"; then +set dummy sed gsed; ac_prog_name=$2 +if test "${ac_cv_path_SED+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_path_SED_found=false +# Loop through the user's path and test for each of PROGNAME-LIST +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue + # Check for GNU ac_path_SED and select it if it is found. + # Check for GNU $ac_path_SED +case `"$ac_path_SED" --version 2>&1` in +*GNU*) + ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; +*) + ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + echo '' >> "conftest.nl" + "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + ac_count=`expr $ac_count + 1` + if test $ac_count -gt ${ac_path_SED_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_SED="$ac_path_SED" + ac_path_SED_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + + $ac_path_SED_found && break 3 + done +done + +done +IFS=$as_save_IFS + + +fi + +SED="$ac_cv_path_SED" +if test -z "$SED"; then + { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in \$PATH" >&5 +echo "$as_me: error: no acceptable $ac_prog_name could be found in \$PATH" >&2;} + { (exit 1); exit 1; }; } +fi + +else + ac_cv_path_SED=$SED +fi + +fi +{ echo "$as_me:$LINENO: result: $ac_cv_path_SED" >&5 +echo "${ECHO_T}$ac_cv_path_SED" >&6; } + SED="$ac_cv_path_SED" + rm -f conftest.sed + +test -z "$SED" && SED=sed +Xsed="$SED -e 1s/^X//" + + + + + + + + + + + +{ echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 +echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; } +if test "${ac_cv_path_GREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # Extract the first word of "grep ggrep" to use in msg output +if test -z "$GREP"; then +set dummy grep ggrep; ac_prog_name=$2 +if test "${ac_cv_path_GREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_path_GREP_found=false +# Loop through the user's path and test for each of PROGNAME-LIST +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in grep ggrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue + # Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + echo 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + ac_count=`expr $ac_count + 1` + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + + $ac_path_GREP_found && break 3 + done +done + +done +IFS=$as_save_IFS +fi +GREP="$ac_cv_path_GREP" +if test -z "$GREP"; then + { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} + { (exit 1); exit 1; }; } +fi +else + ac_cv_path_GREP=$GREP +fi +fi +{ echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 +echo "${ECHO_T}$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" -echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5 -echo $ECHO_N "checking for a sed that does not truncate output... $ECHO_C" >&6 -if test "${lt_cv_path_SED+set}" = set; then +{ echo "$as_me:$LINENO: checking for egrep" >&5 +echo $ECHO_N "checking for egrep... $ECHO_C" >&6; } +if test "${ac_cv_path_EGREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + # Extract the first word of "egrep" to use in msg output +if test -z "$EGREP"; then +set dummy egrep; ac_prog_name=$2 +if test "${ac_cv_path_EGREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - # Loop through the user's path and test for sed and gsed. -# Then use that list of sed's as ones to test for truncation. + ac_path_EGREP_found=false +# Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for lt_ac_prog in sed gsed; do - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then - lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" - fi - done - done -done -IFS=$as_save_IFS -lt_ac_max=0 -lt_ac_count=0 -# Add /usr/xpg4/bin/sed as it is typically found on Solaris -# along with /bin/sed that truncates output. -for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do - test ! -f $lt_ac_sed && continue - cat /dev/null > conftest.in - lt_ac_count=0 - echo $ECHO_N "0123456789$ECHO_C" >conftest.in - # Check for GNU sed and select it if it is found. - if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then - lt_cv_path_SED=$lt_ac_sed - break - fi - while true; do - cat conftest.in conftest.in >conftest.tmp - mv conftest.tmp conftest.in - cp conftest.in conftest.nl - echo >>conftest.nl - $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break - cmp -s conftest.out conftest.nl || break - # 10000 chars as input seems more than enough - test $lt_ac_count -gt 10 && break - lt_ac_count=`expr $lt_ac_count + 1` - if test $lt_ac_count -gt $lt_ac_max; then - lt_ac_max=$lt_ac_count - lt_cv_path_SED=$lt_ac_sed + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue + # Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + echo 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + ac_count=`expr $ac_count + 1` + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + + $ac_path_EGREP_found && break 3 done done -fi +done +IFS=$as_save_IFS -SED=$lt_cv_path_SED -echo "$as_me:$LINENO: result: $SED" >&5 -echo "${ECHO_T}$SED" >&6 +fi -test -z "$SED" && SED=sed -Xsed="$SED -e 1s/^X//" +EGREP="$ac_cv_path_EGREP" +if test -z "$EGREP"; then + { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} + { (exit 1); exit 1; }; } +fi +else + ac_cv_path_EGREP=$EGREP +fi + fi +fi +{ echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 +echo "${ECHO_T}$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" +{ echo "$as_me:$LINENO: checking for fgrep" >&5 +echo $ECHO_N "checking for fgrep... $ECHO_C" >&6; } +if test "${ac_cv_path_FGREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 + then ac_cv_path_FGREP="$GREP -F" + else + # Extract the first word of "fgrep" to use in msg output +if test -z "$FGREP"; then +set dummy fgrep; ac_prog_name=$2 +if test "${ac_cv_path_FGREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_path_FGREP_found=false +# Loop through the user's path and test for each of PROGNAME-LIST +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in fgrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_FGREP" && $as_test_x "$ac_path_FGREP"; } || continue + # Check for GNU ac_path_FGREP and select it if it is found. + # Check for GNU $ac_path_FGREP +case `"$ac_path_FGREP" --version 2>&1` in +*GNU*) + ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; +*) + ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + echo 'FGREP' >> "conftest.nl" + "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + ac_count=`expr $ac_count + 1` + if test $ac_count -gt ${ac_path_FGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_FGREP="$ac_path_FGREP" + ac_path_FGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + $ac_path_FGREP_found && break 3 + done +done +done +IFS=$as_save_IFS +fi + +FGREP="$ac_cv_path_FGREP" +if test -z "$FGREP"; then + { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} + { (exit 1); exit 1; }; } +fi -echo "$as_me:$LINENO: checking for egrep" >&5 -echo $ECHO_N "checking for egrep... $ECHO_C" >&6 -if test "${ac_cv_prog_egrep+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 else - if echo a | (grep -E '(a|b)') >/dev/null 2>&1 - then ac_cv_prog_egrep='grep -E' - else ac_cv_prog_egrep='egrep' - fi + ac_cv_path_FGREP=$FGREP fi -echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 -echo "${ECHO_T}$ac_cv_prog_egrep" >&6 - EGREP=$ac_cv_prog_egrep -echo "$as_me:$LINENO: checking for fgrep" >&5 -echo $ECHO_N "checking for fgrep... $ECHO_C" >&6 -if test "${ac_cv_prog_fgrep+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if echo 'ab*c' | (grep -F 'ab*c') >/dev/null 2>&1 - then ac_cv_prog_fgrep='grep -F' - else ac_cv_prog_fgrep='fgrep' - fi + fi fi -echo "$as_me:$LINENO: result: $ac_cv_prog_fgrep" >&5 -echo "${ECHO_T}$ac_cv_prog_fgrep" >&6 - FGREP=$ac_cv_prog_fgrep +{ echo "$as_me:$LINENO: result: $ac_cv_path_FGREP" >&5 +echo "${ECHO_T}$ac_cv_path_FGREP" >&6; } + FGREP="$ac_cv_path_FGREP" test -z "$GREP" && GREP=grep @@ -4391,18 +5118,18 @@ test -z "$GREP" && GREP=grep -# Check whether --with-gnu-ld or --without-gnu-ld was given. +# Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then - withval="$with_gnu_ld" - test "$withval" = no || with_gnu_ld=yes + withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no -fi; +fi + ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. - echo "$as_me:$LINENO: checking for ld used by $CC" >&5 -echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for ld used by $CC" >&5 +echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw @@ -4431,11 +5158,11 @@ echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6 ;; esac elif test "$with_gnu_ld" = yes; then - echo "$as_me:$LINENO: checking for GNU ld" >&5 -echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for GNU ld" >&5 +echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6; } else - echo "$as_me:$LINENO: checking for non-GNU ld" >&5 -echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for non-GNU ld" >&5 +echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6; } fi if test "${lt_cv_path_LD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -4468,17 +5195,17 @@ fi LD="$lt_cv_path_LD" if test -n "$LD"; then - echo "$as_me:$LINENO: result: $LD" >&5 -echo "${ECHO_T}$LD" >&6 + { echo "$as_me:$LINENO: result: $LD" >&5 +echo "${ECHO_T}$LD" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} { (exit 1); exit 1; }; } -echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 -echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 +echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6; } if test "${lt_cv_prog_gnu_ld+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -4492,8 +5219,8 @@ case `$LD -v 2>&1 &5 -echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6 +{ echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5 +echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld @@ -4505,8 +5232,8 @@ with_gnu_ld=$lt_cv_prog_gnu_ld -echo "$as_me:$LINENO: checking for BSD- or MS-compatible name lister (nm)" >&5 -echo $ECHO_N "checking for BSD- or MS-compatible name lister (nm)... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for BSD- or MS-compatible name lister (nm)" >&5 +echo $ECHO_N "checking for BSD- or MS-compatible name lister (nm)... $ECHO_C" >&6; } if test "${lt_cv_path_NM+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -4554,8 +5281,8 @@ else : ${lt_cv_path_NM=no} fi fi -echo "$as_me:$LINENO: result: $lt_cv_path_NM" >&5 -echo "${ECHO_T}$lt_cv_path_NM" >&6 +{ echo "$as_me:$LINENO: result: $lt_cv_path_NM" >&5 +echo "${ECHO_T}$lt_cv_path_NM" >&6; } if test "$lt_cv_path_NM" != "no"; then NM="$lt_cv_path_NM" else @@ -4565,8 +5292,8 @@ else do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_DUMPBIN+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -4579,25 +5306,27 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi DUMPBIN=$ac_cv_prog_DUMPBIN if test -n "$DUMPBIN"; then - echo "$as_me:$LINENO: result: $DUMPBIN" >&5 -echo "${ECHO_T}$DUMPBIN" >&6 + { echo "$as_me:$LINENO: result: $DUMPBIN" >&5 +echo "${ECHO_T}$DUMPBIN" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + test -n "$DUMPBIN" && break done fi @@ -4607,8 +5336,8 @@ if test -z "$DUMPBIN"; then do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_DUMPBIN+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -4621,30 +5350,45 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN if test -n "$ac_ct_DUMPBIN"; then - echo "$as_me:$LINENO: result: $ac_ct_DUMPBIN" >&5 -echo "${ECHO_T}$ac_ct_DUMPBIN" >&6 + { echo "$as_me:$LINENO: result: $ac_ct_DUMPBIN" >&5 +echo "${ECHO_T}$ac_ct_DUMPBIN" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + test -n "$ac_ct_DUMPBIN" && break done -test -n "$ac_ct_DUMPBIN" || ac_ct_DUMPBIN=":" - DUMPBIN=$ac_ct_DUMPBIN + if test "x$ac_ct_DUMPBIN" = x; then + DUMPBIN=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + DUMPBIN=$ac_ct_DUMPBIN + fi fi @@ -4659,43 +5403,43 @@ test -z "$NM" && NM=nm -echo "$as_me:$LINENO: checking the name lister ($NM) interface" >&5 -echo $ECHO_N "checking the name lister ($NM) interface... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking the name lister ($NM) interface" >&5 +echo $ECHO_N "checking the name lister ($NM) interface... $ECHO_C" >&6; } if test "${lt_cv_nm_interface+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext - (eval echo "\"\$as_me:4669: $ac_compile\"" >&5) + (eval echo "\"\$as_me:5413: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 - (eval echo "\"\$as_me:4672: $NM \\\"conftest.$ac_objext\\\"\"" >&5) + (eval echo "\"\$as_me:5416: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 - (eval echo "\"\$as_me:4675: output\"" >&5) + (eval echo "\"\$as_me:5419: output\"" >&5) cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest* fi -echo "$as_me:$LINENO: result: $lt_cv_nm_interface" >&5 -echo "${ECHO_T}$lt_cv_nm_interface" >&6 +{ echo "$as_me:$LINENO: result: $lt_cv_nm_interface" >&5 +echo "${ECHO_T}$lt_cv_nm_interface" >&6; } -echo "$as_me:$LINENO: checking whether ln -s works" >&5 -echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether ln -s works" >&5 +echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } else - echo "$as_me:$LINENO: result: no, using $LN_S" >&5 -echo "${ECHO_T}no, using $LN_S" >&6 + { echo "$as_me:$LINENO: result: no, using $LN_S" >&5 +echo "${ECHO_T}no, using $LN_S" >&6; } fi # find the maximum length of command line arguments -echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5 -echo $ECHO_N "checking the maximum length of command line arguments... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5 +echo $ECHO_N "checking the maximum length of command line arguments... $ECHO_C" >&6; } if test "${lt_cv_sys_max_cmd_len+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -4814,11 +5558,11 @@ else fi if test -n $lt_cv_sys_max_cmd_len ; then - echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5 -echo "${ECHO_T}$lt_cv_sys_max_cmd_len" >&6 + { echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5 +echo "${ECHO_T}$lt_cv_sys_max_cmd_len" >&6; } else - echo "$as_me:$LINENO: result: none" >&5 -echo "${ECHO_T}none" >&6 + { echo "$as_me:$LINENO: result: none" >&5 +echo "${ECHO_T}none" >&6; } fi max_cmd_len=$lt_cv_sys_max_cmd_len @@ -4832,26 +5576,26 @@ max_cmd_len=$lt_cv_sys_max_cmd_len : ${MV="mv -f"} : ${RM="rm -f"} -echo "$as_me:$LINENO: checking whether the shell understands some XSI constructs" >&5 -echo $ECHO_N "checking whether the shell understands some XSI constructs... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether the shell understands some XSI constructs" >&5 +echo $ECHO_N "checking whether the shell understands some XSI constructs... $ECHO_C" >&6; } # Try some XSI features xsi_shell=no ( _lt_dummy="a/b/c" test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \ = c,a/b,, ) >/dev/null 2>&1 \ && xsi_shell=yes -echo "$as_me:$LINENO: result: $xsi_shell" >&5 -echo "${ECHO_T}$xsi_shell" >&6 +{ echo "$as_me:$LINENO: result: $xsi_shell" >&5 +echo "${ECHO_T}$xsi_shell" >&6; } -echo "$as_me:$LINENO: checking whether the shell understands \"+=\"" >&5 -echo $ECHO_N "checking whether the shell understands \"+=\"... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether the shell understands \"+=\"" >&5 +echo $ECHO_N "checking whether the shell understands \"+=\"... $ECHO_C" >&6; } lt_shell_append=no ( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \ >/dev/null 2>&1 \ && lt_shell_append=yes -echo "$as_me:$LINENO: result: $lt_shell_append" >&5 -echo "${ECHO_T}$lt_shell_append" >&6 +{ echo "$as_me:$LINENO: result: $lt_shell_append" >&5 +echo "${ECHO_T}$lt_shell_append" >&6; } if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then @@ -4885,15 +5629,15 @@ esac -echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5 -echo $ECHO_N "checking for $LD option to reload object files... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5 +echo $ECHO_N "checking for $LD option to reload object files... $ECHO_C" >&6; } if test "${lt_cv_ld_reload_flag+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_ld_reload_flag='-r' fi -echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5 -echo "${ECHO_T}$lt_cv_ld_reload_flag" >&6 +{ echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5 +echo "${ECHO_T}$lt_cv_ld_reload_flag" >&6; } reload_flag=$lt_cv_ld_reload_flag case $reload_flag in "" | " "*) ;; @@ -4919,8 +5663,8 @@ esac -echo "$as_me:$LINENO: checking how to recognize dependent libraries" >&5 -echo $ECHO_N "checking how to recognize dependent libraries... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking how to recognize dependent libraries" >&5 +echo $ECHO_N "checking how to recognize dependent libraries... $ECHO_C" >&6; } if test "${lt_cv_deplibs_check_method+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -5109,8 +5853,8 @@ tpf*) esac fi -echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5 -echo "${ECHO_T}$lt_cv_deplibs_check_method" >&6 +{ echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5 +echo "${ECHO_T}$lt_cv_deplibs_check_method" >&6; } file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown @@ -5129,8 +5873,8 @@ test -z "$deplibs_check_method" && deplibs_check_method=unknown if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. set dummy ${ac_tool_prefix}ar; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_AR+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -5143,32 +5887,34 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AR="${ac_tool_prefix}ar" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then - echo "$as_me:$LINENO: result: $AR" >&5 -echo "${ECHO_T}$AR" >&6 + { echo "$as_me:$LINENO: result: $AR" >&5 +echo "${ECHO_T}$AR" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + fi if test -z "$ac_cv_prog_AR"; then ac_ct_AR=$AR # Extract the first word of "ar", so it can be a program name with args. set dummy ar; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_AR+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -5181,27 +5927,41 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_AR="ar" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS - test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="false" fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then - echo "$as_me:$LINENO: result: $ac_ct_AR" >&5 -echo "${ECHO_T}$ac_ct_AR" >&6 + { echo "$as_me:$LINENO: result: $ac_ct_AR" >&5 +echo "${ECHO_T}$ac_ct_AR" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi - AR=$ac_ct_AR + if test "x$ac_ct_AR" = x; then + AR="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + AR=$ac_ct_AR + fi else AR="$ac_cv_prog_AR" fi @@ -5222,8 +5982,8 @@ test -z "$AR_FLAGS" && AR_FLAGS=cru if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -5236,32 +5996,34 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then - echo "$as_me:$LINENO: result: $STRIP" >&5 -echo "${ECHO_T}$STRIP" >&6 + { echo "$as_me:$LINENO: result: $STRIP" >&5 +echo "${ECHO_T}$STRIP" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -5274,27 +6036,41 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_STRIP="strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS - test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":" fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then - echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 -echo "${ECHO_T}$ac_ct_STRIP" >&6 + { echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 +echo "${ECHO_T}$ac_ct_STRIP" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi - STRIP=$ac_ct_STRIP + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi else STRIP="$ac_cv_prog_STRIP" fi @@ -5309,8 +6085,8 @@ test -z "$STRIP" && STRIP=: if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -5323,32 +6099,34 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then - echo "$as_me:$LINENO: result: $RANLIB" >&5 -echo "${ECHO_T}$RANLIB" >&6 + { echo "$as_me:$LINENO: result: $RANLIB" >&5 +echo "${ECHO_T}$RANLIB" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -5361,27 +6139,41 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_RANLIB="ranlib" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS - test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":" fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then - echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 -echo "${ECHO_T}$ac_ct_RANLIB" >&6 + { echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 +echo "${ECHO_T}$ac_ct_RANLIB" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi - RANLIB=$ac_ct_RANLIB + if test "x$ac_ct_RANLIB" = x; then + RANLIB=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + RANLIB=$ac_ct_RANLIB + fi else RANLIB="$ac_cv_prog_RANLIB" fi @@ -5454,8 +6246,8 @@ compiler=$CC # Check for command to grab the raw symbol name followed by C symbol from nm. -echo "$as_me:$LINENO: checking command to parse $NM output from $compiler object" >&5 -echo $ECHO_N "checking command to parse $NM output from $compiler object... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking command to parse $NM output from $compiler object" >&5 +echo $ECHO_N "checking command to parse $NM output from $compiler object... $ECHO_C" >&6; } if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -5673,11 +6465,11 @@ if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then - echo "$as_me:$LINENO: result: failed" >&5 -echo "${ECHO_T}failed" >&6 + { echo "$as_me:$LINENO: result: failed" >&5 +echo "${ECHO_T}failed" >&6; } else - echo "$as_me:$LINENO: result: ok" >&5 -echo "${ECHO_T}ok" >&6 + { echo "$as_me:$LINENO: result: ok" >&5 +echo "${ECHO_T}ok" >&6; } fi @@ -5696,11 +6488,11 @@ fi -# Check whether --enable-libtool-lock or --disable-libtool-lock was given. +# Check whether --enable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then - enableval="$enable_libtool_lock" + enableval=$enable_libtool_lock; +fi -fi; test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good @@ -5727,7 +6519,7 @@ ia64-*-hpux*) ;; *-*-irix6*) # Find out which ABI we are using. - echo '#line 5730 "configure"' > conftest.$ac_ext + echo '#line 6522 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -5819,8 +6611,8 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" - echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5 -echo $ECHO_N "checking whether the C compiler needs -belf... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5 +echo $ECHO_N "checking whether the C compiler needs -belf... $ECHO_C" >&6; } if test "${lt_cv_cc_needs_belf+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -5846,35 +6638,32 @@ main () } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then lt_cv_cc_needs_belf=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -lt_cv_cc_needs_belf=no + lt_cv_cc_needs_belf=no fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' @@ -5883,8 +6672,8 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu fi -echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5 -echo "${ECHO_T}$lt_cv_cc_needs_belf" >&6 +{ echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5 +echo "${ECHO_T}$lt_cv_cc_needs_belf" >&6; } if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" @@ -5918,8 +6707,8 @@ ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 -echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 +echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -5953,24 +6742,22 @@ cat >>conftest.$ac_ext <<_ACEOF #endif Syntax error _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then : else echo "$as_me: failed program was:" >&5 @@ -5979,9 +6766,10 @@ sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi + rm -f conftest.err conftest.$ac_ext - # OK, works on sane cases. Now check whether non-existent headers + # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -5991,24 +6779,22 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then # Broken: success on invalid input. continue else @@ -6019,6 +6805,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_preproc_ok=: break fi + rm -f conftest.err conftest.$ac_ext done @@ -6036,8 +6823,8 @@ fi else ac_cv_prog_CPP=$CPP fi -echo "$as_me:$LINENO: result: $CPP" >&5 -echo "${ECHO_T}$CPP" >&6 +{ echo "$as_me:$LINENO: result: $CPP" >&5 +echo "${ECHO_T}$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do @@ -6060,24 +6847,22 @@ cat >>conftest.$ac_ext <<_ACEOF #endif Syntax error _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then : else echo "$as_me: failed program was:" >&5 @@ -6086,9 +6871,10 @@ sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi + rm -f conftest.err conftest.$ac_ext - # OK, works on sane cases. Now check whether non-existent headers + # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -6098,24 +6884,22 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then # Broken: success on invalid input. continue else @@ -6126,6 +6910,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_preproc_ok=: break fi + rm -f conftest.err conftest.$ac_ext done @@ -6148,8 +6933,8 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu -echo "$as_me:$LINENO: checking for ANSI C header files" >&5 -echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5 +echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; } if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -6173,35 +6958,31 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_header_stdc=no + ac_cv_header_stdc=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. @@ -6257,6 +7038,7 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include +#include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) @@ -6276,18 +7058,27 @@ main () for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) - exit(2); - exit (0); + return 2; + return 0; } _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -6300,12 +7091,14 @@ sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi + + fi fi -echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 -echo "${ECHO_T}$ac_cv_header_stdc" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 +echo "${ECHO_T}$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF @@ -6328,9 +7121,9 @@ for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -6344,38 +7137,35 @@ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_Header=no" + eval "$as_ac_Header=no" fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 @@ -6390,9 +7180,9 @@ done for ac_header in dlfcn.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -6406,38 +7196,35 @@ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_Header=no" + eval "$as_ac_Header=no" fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 @@ -6498,8 +7285,8 @@ if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi -echo "$as_me:$LINENO: checking for objdir" >&5 -echo $ECHO_N "checking for objdir... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for objdir" >&5 +echo $ECHO_N "checking for objdir... $ECHO_C" >&6; } if test "${lt_cv_objdir+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -6513,8 +7300,8 @@ else fi rmdir .libs 2>/dev/null fi -echo "$as_me:$LINENO: result: $lt_cv_objdir" >&5 -echo "${ECHO_T}$lt_cv_objdir" >&6 +{ echo "$as_me:$LINENO: result: $lt_cv_objdir" >&5 +echo "${ECHO_T}$lt_cv_objdir" >&6; } objdir=$lt_cv_objdir @@ -6606,8 +7393,8 @@ test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then - echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5 -echo $ECHO_N "checking for ${ac_tool_prefix}file... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5 +echo $ECHO_N "checking for ${ac_tool_prefix}file... $ECHO_C" >&6; } if test "${lt_cv_path_MAGIC_CMD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -6659,11 +7446,11 @@ fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then - echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 -echo "${ECHO_T}$MAGIC_CMD" >&6 + { echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 +echo "${ECHO_T}$MAGIC_CMD" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi @@ -6672,8 +7459,8 @@ fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then - echo "$as_me:$LINENO: checking for file" >&5 -echo $ECHO_N "checking for file... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for file" >&5 +echo $ECHO_N "checking for file... $ECHO_C" >&6; } if test "${lt_cv_path_MAGIC_CMD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -6725,11 +7512,11 @@ fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then - echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 -echo "${ECHO_T}$MAGIC_CMD" >&6 + { echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 +echo "${ECHO_T}$MAGIC_CMD" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi @@ -6809,8 +7596,8 @@ lt_prog_compiler_no_builtin_flag= if test "$GCC" = yes; then lt_prog_compiler_no_builtin_flag=' -fno-builtin' - echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 -echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 +echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6; } if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -6827,11 +7614,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:6830: $lt_compile\"" >&5) + (eval echo "\"\$as_me:7617: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:6834: \$? = $ac_status" >&5 + echo "$as_me:7621: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -6844,8 +7631,8 @@ else $RM conftest* fi -echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 -echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6 +{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6; } if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" @@ -6864,8 +7651,8 @@ fi lt_prog_compiler_pic= lt_prog_compiler_static= -echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 -echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 +echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; } if test "$GCC" = yes; then lt_prog_compiler_wl='-Wl,' @@ -7119,8 +7906,8 @@ case $host_os in lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" ;; esac -echo "$as_me:$LINENO: result: $lt_prog_compiler_pic" >&5 -echo "${ECHO_T}$lt_prog_compiler_pic" >&6 +{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic" >&6; } @@ -7131,8 +7918,8 @@ echo "${ECHO_T}$lt_prog_compiler_pic" >&6 # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic"; then - echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 -echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic works... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 +echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic works... $ECHO_C" >&6; } if test "${lt_prog_compiler_pic_works+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -7149,11 +7936,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:7152: $lt_compile\"" >&5) + (eval echo "\"\$as_me:7939: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:7156: \$? = $ac_status" >&5 + echo "$as_me:7943: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -7166,8 +7953,8 @@ else $RM conftest* fi -echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works" >&5 -echo "${ECHO_T}$lt_prog_compiler_pic_works" >&6 +{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic_works" >&6; } if test x"$lt_prog_compiler_pic_works" = xyes; then case $lt_prog_compiler_pic in @@ -7190,8 +7977,8 @@ fi # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" -echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 -echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; } if test "${lt_prog_compiler_static_works+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -7218,8 +8005,8 @@ else LDFLAGS="$save_LDFLAGS" fi -echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works" >&5 -echo "${ECHO_T}$lt_prog_compiler_static_works" >&6 +{ echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works" >&5 +echo "${ECHO_T}$lt_prog_compiler_static_works" >&6; } if test x"$lt_prog_compiler_static_works" = xyes; then : @@ -7233,8 +8020,8 @@ fi - echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 -echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 +echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; } if test "${lt_cv_prog_compiler_c_o+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -7254,11 +8041,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:7257: $lt_compile\"" >&5) + (eval echo "\"\$as_me:8044: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:7261: \$? = $ac_status" >&5 + echo "$as_me:8048: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -7280,16 +8067,16 @@ else $RM conftest* fi -echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5 -echo "${ECHO_T}$lt_cv_prog_compiler_c_o" >&6 +{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_c_o" >&6; } - echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 -echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 +echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; } if test "${lt_cv_prog_compiler_c_o+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -7309,11 +8096,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:7312: $lt_compile\"" >&5) + (eval echo "\"\$as_me:8099: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:7316: \$? = $ac_status" >&5 + echo "$as_me:8103: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -7335,8 +8122,8 @@ else $RM conftest* fi -echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5 -echo "${ECHO_T}$lt_cv_prog_compiler_c_o" >&6 +{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_c_o" >&6; } @@ -7344,16 +8131,16 @@ echo "${ECHO_T}$lt_cv_prog_compiler_c_o" >&6 hard_links="nottested" if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user - echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 -echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 +echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; } hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no - echo "$as_me:$LINENO: result: $hard_links" >&5 -echo "${ECHO_T}$hard_links" >&6 + { echo "$as_me:$LINENO: result: $hard_links" >&5 +echo "${ECHO_T}$hard_links" >&6; } if test "$hard_links" = no; then { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} @@ -7368,8 +8155,8 @@ fi - echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 -echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; } runpath_var= allow_undefined_flag= @@ -7804,27 +8591,23 @@ main () } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then lt_aix_libpath_sed=' /Import File Strings/,/^$/ { @@ -7842,8 +8625,10 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi @@ -7873,27 +8658,23 @@ main () } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then lt_aix_libpath_sed=' /Import File Strings/,/^$/ { @@ -7911,8 +8692,10 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi @@ -8167,35 +8950,33 @@ fi int foo(void) {} _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LDFLAGS="$save_LDFLAGS" else @@ -8448,8 +9229,8 @@ rm -f conftest.err conftest.$ac_objext \ fi fi -echo "$as_me:$LINENO: result: $ld_shlibs" >&5 -echo "${ECHO_T}$ld_shlibs" >&6 +{ echo "$as_me:$LINENO: result: $ld_shlibs" >&5 +echo "${ECHO_T}$ld_shlibs" >&6; } test "$ld_shlibs" = no && can_build_shared=no with_gnu_ld=$with_gnu_ld @@ -8485,8 +9266,8 @@ x|xyes) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. - echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 -echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 +echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; } $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext @@ -8523,8 +9304,8 @@ echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >& cat conftest.err 1>&5 fi $RM conftest* - echo "$as_me:$LINENO: result: $archive_cmds_need_lc" >&5 -echo "${ECHO_T}$archive_cmds_need_lc" >&6 + { echo "$as_me:$LINENO: result: $archive_cmds_need_lc" >&5 +echo "${ECHO_T}$archive_cmds_need_lc" >&6; } ;; esac fi @@ -8687,8 +9468,8 @@ esac - echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 -echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 +echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; } withGCC=$GCC if test "$withGCC" = yes; then case $host_os in @@ -9120,27 +9901,23 @@ main () } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir"; then shlibpath_overrides_runpath=yes fi @@ -9149,8 +9926,10 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir @@ -9363,8 +10142,8 @@ uts4*) dynamic_linker=no ;; esac -echo "$as_me:$LINENO: result: $dynamic_linker" >&5 -echo "${ECHO_T}$dynamic_linker" >&6 +{ echo "$as_me:$LINENO: result: $dynamic_linker" >&5 +echo "${ECHO_T}$dynamic_linker" >&6; } test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" @@ -9458,8 +10237,8 @@ fi - echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 -echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 +echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; } hardcode_action= if test -n "$hardcode_libdir_flag_spec" || test -n "$runpath_var" || @@ -9483,8 +10262,8 @@ else # directories. hardcode_action=unsupported fi -echo "$as_me:$LINENO: result: $hardcode_action" >&5 -echo "${ECHO_T}$hardcode_action" >&6 +{ echo "$as_me:$LINENO: result: $hardcode_action" >&5 +echo "${ECHO_T}$hardcode_action" >&6; } if test "$hardcode_action" = relink || test "$inherit_rpath" = yes; then @@ -9528,8 +10307,8 @@ else darwin*) # if libdl is installed we need to link against it - echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 -echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 +echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; } if test "${ac_cv_lib_dl_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -9542,56 +10321,53 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char dlopen (); int main () { -dlopen (); +return dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_lib_dl_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_dl_dlopen=no + ac_cv_lib_dl_dlopen=no fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 -echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 +echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; } if test $ac_cv_lib_dl_dlopen = yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else @@ -9605,8 +10381,8 @@ fi ;; *) - echo "$as_me:$LINENO: checking for shl_load" >&5 -echo $ECHO_N "checking for shl_load... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for shl_load" >&5 +echo $ECHO_N "checking for shl_load... $ECHO_C" >&6; } if test "${ac_cv_func_shl_load+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -9633,73 +10409,64 @@ cat >>conftest.$ac_ext <<_ACEOF #undef shl_load -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" -{ #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char shl_load (); /* 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_shl_load) || defined (__stub___shl_load) +#if defined __stub_shl_load || defined __stub___shl_load choke me -#else -char (*f) () = shl_load; -#endif -#ifdef __cplusplus -} #endif int main () { -return f != shl_load; +return shl_load (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_func_shl_load=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_func_shl_load=no + ac_cv_func_shl_load=no fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5 -echo "${ECHO_T}$ac_cv_func_shl_load" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5 +echo "${ECHO_T}$ac_cv_func_shl_load" >&6; } if test $ac_cv_func_shl_load = yes; then lt_cv_dlopen="shl_load" else - echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 -echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 +echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6; } if test "${ac_cv_lib_dld_shl_load+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -9712,61 +10479,58 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char shl_load (); int main () { -shl_load (); +return shl_load (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_lib_dld_shl_load=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_dld_shl_load=no + ac_cv_lib_dld_shl_load=no fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 -echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 +echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6; } if test $ac_cv_lib_dld_shl_load = yes; then lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld" else - echo "$as_me:$LINENO: checking for dlopen" >&5 -echo $ECHO_N "checking for dlopen... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for dlopen" >&5 +echo $ECHO_N "checking for dlopen... $ECHO_C" >&6; } if test "${ac_cv_func_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -9793,73 +10557,64 @@ cat >>conftest.$ac_ext <<_ACEOF #undef dlopen -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" -{ #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char dlopen (); /* 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_dlopen) || defined (__stub___dlopen) +#if defined __stub_dlopen || defined __stub___dlopen choke me -#else -char (*f) () = dlopen; -#endif -#ifdef __cplusplus -} #endif int main () { -return f != dlopen; +return dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_func_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_func_dlopen=no + ac_cv_func_dlopen=no fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5 -echo "${ECHO_T}$ac_cv_func_dlopen" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5 +echo "${ECHO_T}$ac_cv_func_dlopen" >&6; } if test $ac_cv_func_dlopen = yes; then lt_cv_dlopen="dlopen" else - echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 -echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 +echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; } if test "${ac_cv_lib_dl_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -9872,61 +10627,58 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char dlopen (); int main () { -dlopen (); +return dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_lib_dl_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_dl_dlopen=no + ac_cv_lib_dl_dlopen=no fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 -echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 +echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; } if test $ac_cv_lib_dl_dlopen = yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else - echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5 -echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5 +echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6; } if test "${ac_cv_lib_svld_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -9939,61 +10691,58 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char dlopen (); int main () { -dlopen (); +return dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_lib_svld_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_svld_dlopen=no + ac_cv_lib_svld_dlopen=no fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5 -echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5 +echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6; } if test $ac_cv_lib_svld_dlopen = yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" else - echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5 -echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5 +echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6; } if test "${ac_cv_lib_dld_dld_link+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -10006,56 +10755,53 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char dld_link (); int main () { -dld_link (); +return dld_link (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_lib_dld_dld_link=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_dld_dld_link=no + ac_cv_lib_dld_dld_link=no fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5 -echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5 +echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6; } if test $ac_cv_lib_dld_dld_link = yes; then lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld" fi @@ -10095,8 +10841,8 @@ fi save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" - echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5 -echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5 +echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6; } if test "${lt_cv_dlopen_self+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -10106,7 +10852,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 10109 "configure" +#line 10855 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -10190,13 +10936,13 @@ rm -fr conftest* fi -echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5 -echo "${ECHO_T}$lt_cv_dlopen_self" >&6 +{ echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5 +echo "${ECHO_T}$lt_cv_dlopen_self" >&6; } if test "x$lt_cv_dlopen_self" = xyes; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" - echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5 -echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5 +echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6; } if test "${lt_cv_dlopen_self_static+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -10206,7 +10952,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 10209 "configure" +#line 10955 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -10290,8 +11036,8 @@ rm -fr conftest* fi -echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5 -echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6 +{ echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5 +echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6; } fi CPPFLAGS="$save_CPPFLAGS" @@ -10329,13 +11075,13 @@ fi striplib= old_striplib= -echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 -echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 +echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6; } if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in @@ -10343,16 +11089,16 @@ else if test -n "$STRIP" ; then striplib="$STRIP -x" old_striplib="$STRIP -S" - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi ;; *) - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } ;; esac fi @@ -10369,13 +11115,13 @@ fi # Report which library types will actually be built - echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 -echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6 - echo "$as_me:$LINENO: result: $can_build_shared" >&5 -echo "${ECHO_T}$can_build_shared" >&6 + { echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 +echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6; } + { echo "$as_me:$LINENO: result: $can_build_shared" >&5 +echo "${ECHO_T}$can_build_shared" >&6; } - echo "$as_me:$LINENO: checking whether to build shared libraries" >&5 -echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking whether to build shared libraries" >&5 +echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6; } test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and @@ -10395,15 +11141,15 @@ echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6 fi ;; esac - echo "$as_me:$LINENO: result: $enable_shared" >&5 -echo "${ECHO_T}$enable_shared" >&6 + { echo "$as_me:$LINENO: result: $enable_shared" >&5 +echo "${ECHO_T}$enable_shared" >&6; } - echo "$as_me:$LINENO: checking whether to build static libraries" >&5 -echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking whether to build static libraries" >&5 +echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6; } # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes - echo "$as_me:$LINENO: result: $enable_static" >&5 -echo "${ECHO_T}$enable_static" >&6 + { echo "$as_me:$LINENO: result: $enable_static" >&5 +echo "${ECHO_T}$enable_static" >&6; } @@ -10429,7 +11175,7 @@ CC="$lt_save_CC" - ac_config_commands="$ac_config_commands libtool" + ac_config_commands="$ac_config_commands libtool" @@ -10438,10 +11184,9 @@ CC="$lt_save_CC" -# Check whether --enable-64-bit-bfd or --disable-64-bit-bfd was given. +# Check whether --enable-64-bit-bfd was given. if test "${enable_64_bit_bfd+set}" = set; then - enableval="$enable_64_bit_bfd" - case "${enableval}" in + enableval=$enable_64_bit_bfd; case "${enableval}" in yes) want64=true ;; no) want64=false ;; *) { { echo "$as_me:$LINENO: error: bad value ${enableval} for 64-bit-bfd option" >&5 @@ -10450,11 +11195,11 @@ echo "$as_me: error: bad value ${enableval} for 64-bit-bfd option" >&2;} esac else want64=false -fi; -# Check whether --enable-targets or --disable-targets was given. +fi + +# Check whether --enable-targets was given. if test "${enable_targets+set}" = set; then - enableval="$enable_targets" - case "${enableval}" in + enableval=$enable_targets; case "${enableval}" in yes | "") { { echo "$as_me:$LINENO: error: enable-targets option must specify target names or 'all'" >&5 echo "$as_me: error: enable-targets option must specify target names or 'all'" >&2;} { (exit 1); exit 1; }; } @@ -10462,23 +11207,23 @@ echo "$as_me: error: enable-targets option must specify target names or 'all'" > no) enable_targets= ;; *) enable_targets=$enableval ;; esac -fi; -# Check whether --enable-commonbfdlib or --disable-commonbfdlib was given. +fi + +# Check whether --enable-commonbfdlib was given. if test "${enable_commonbfdlib+set}" = set; then - enableval="$enable_commonbfdlib" - case "${enableval}" in + enableval=$enable_commonbfdlib; case "${enableval}" in yes) commonbfdlib=true ;; no) commonbfdlib=false ;; *) { { echo "$as_me:$LINENO: error: bad value ${enableval} for BFD commonbfdlib option" >&5 echo "$as_me: error: bad value ${enableval} for BFD commonbfdlib option" >&2;} { (exit 1); exit 1; }; } ;; esac -fi; +fi + -# Check whether --with-mmap or --without-mmap was given. +# Check whether --with-mmap was given. if test "${with_mmap+set}" = set; then - withval="$with_mmap" - case "${withval}" in + withval=$with_mmap; case "${withval}" in yes) want_mmap=true ;; no) want_mmap=false ;; *) { { echo "$as_me:$LINENO: error: bad value ${withval} for BFD with-mmap option" >&5 @@ -10487,11 +11232,11 @@ echo "$as_me: error: bad value ${withval} for BFD with-mmap option" >&2;} esac else want_mmap=false -fi; -# Check whether --enable-secureplt or --disable-secureplt was given. +fi + +# Check whether --enable-secureplt was given. if test "${enable_secureplt+set}" = set; then - enableval="$enable_secureplt" - case "${enableval}" in + enableval=$enable_secureplt; case "${enableval}" in yes) use_secureplt=true ;; no) use_secureplt=false ;; *) { { echo "$as_me:$LINENO: error: bad value ${enableval} for secureplt option" >&5 @@ -10500,7 +11245,8 @@ echo "$as_me: error: bad value ${enableval} for secureplt option" >&2;} esac else use_secureplt=false -fi; if test $use_secureplt = true; then +fi +if test $use_secureplt = true; then cat >>confdefs.h <<\_ACEOF #define USE_SECUREPLT 1 @@ -10510,19 +11256,18 @@ fi DEBUGDIR=${libdir}/debug -# Check whether --with-separate-debug-dir or --without-separate-debug-dir was given. +# Check whether --with-separate-debug-dir was given. if test "${with_separate_debug_dir+set}" = set; then - withval="$with_separate_debug_dir" - DEBUGDIR="${withval}" -fi; + withval=$with_separate_debug_dir; DEBUGDIR="${withval}" +fi + # Check to see if we should allow the generation of # symbols with the ELF standard's STT_COMMON type. -# Check whether --enable-elf-stt-common or --disable-elf-stt-common was given. +# Check whether --enable-elf-stt-common was given. if test "${enable_elf_stt_common+set}" = set; then - enableval="$enable_elf_stt_common" - case "${enableval}" in + enableval=$enable_elf_stt_common; case "${enableval}" in yes) want_elf_stt_common=true ;; no) want_elf_stt_common=false ;; *) { { echo "$as_me:$LINENO: error: bad value ${enableval} for ELF STT_COMMON option" >&5 @@ -10536,7 +11281,8 @@ else # the loader does not support it. So by default we always choose to # disable this feature. want_elf_stt_common=false -fi; if test $want_elf_stt_common = true; then +fi +if test $want_elf_stt_common = true; then cat >>confdefs.h <<\_ACEOF #define USE_STT_COMMON 1 @@ -10546,10 +11292,9 @@ fi -# Check whether --with-pkgversion or --without-pkgversion was given. +# Check whether --with-pkgversion was given. if test "${with_pkgversion+set}" = set; then - withval="$with_pkgversion" - case "$withval" in + withval=$with_pkgversion; case "$withval" in yes) { { echo "$as_me:$LINENO: error: package version not specified" >&5 echo "$as_me: error: package version not specified" >&2;} { (exit 1); exit 1; }; } ;; @@ -10559,15 +11304,15 @@ echo "$as_me: error: package version not specified" >&2;} else PKGVERSION="(GNU Binutils) " -fi; +fi + -# Check whether --with-bugurl or --without-bugurl was given. +# Check whether --with-bugurl was given. if test "${with_bugurl+set}" = set; then - withval="$with_bugurl" - case "$withval" in + withval=$with_bugurl; case "$withval" in yes) { { echo "$as_me:$LINENO: error: bug URL not specified" >&5 echo "$as_me: error: bug URL not specified" >&2;} { (exit 1); exit 1; }; } ;; @@ -10579,7 +11324,8 @@ echo "$as_me: error: bug URL not specified" >&2;} else BUGURL="http://www.sourceware.org/bugzilla/" -fi; +fi + case ${BUGURL} in "") REPORT_BUGS_TO= @@ -10597,17 +11343,17 @@ fi; GCC_WARN_CFLAGS="-W -Wall -Wstrict-prototypes -Wmissing-prototypes" -# Check whether --enable-werror or --disable-werror was given. +# Check whether --enable-werror was given. if test "${enable_werror+set}" = set; then - enableval="$enable_werror" - case "${enableval}" in + enableval=$enable_werror; case "${enableval}" in yes | y) ERROR_ON_WARNING="yes" ;; no | n) ERROR_ON_WARNING="no" ;; *) { { echo "$as_me:$LINENO: error: bad value ${enableval} for --enable-werror" >&5 echo "$as_me: error: bad value ${enableval} for --enable-werror" >&2;} { (exit 1); exit 1; }; } ;; esac -fi; +fi + # Enable -Wno-format by default when using gcc on mingw case "${host}" in @@ -10634,10 +11380,9 @@ if test "${GCC}" = yes ; then WARN_CFLAGS="${GCC_WARN_CFLAGS}" fi -# Check whether --enable-build-warnings or --disable-build-warnings was given. +# Check whether --enable-build-warnings was given. if test "${enable_build_warnings+set}" = set; then - enableval="$enable_build_warnings" - case "${enableval}" in + enableval=$enable_build_warnings; case "${enableval}" in yes) WARN_CFLAGS="${GCC_WARN_CFLAGS}";; no) if test "${GCC}" = yes ; then WARN_CFLAGS="-w" @@ -10648,7 +11393,8 @@ if test "${enable_build_warnings+set}" = set; then WARN_CFLAGS="${t} ${GCC_WARN_CFLAGS}";; *) WARN_CFLAGS=`echo "${enableval}" | sed -e "s/,/ /g"`;; esac -fi; +fi + if test x"$silent" != x"yes" && test x"$WARN_CFLAGS" != x""; then echo "Setting warning flags = $WARN_CFLAGS" 6>&1 @@ -10658,7 +11404,7 @@ fi - ac_config_headers="$ac_config_headers config.h:config.in" +ac_config_headers="$ac_config_headers config.h:config.in" if test -z "$target" ; then @@ -10667,17 +11413,17 @@ echo "$as_me: error: Unrecognized target system type; please check config.sub." { (exit 1); exit 1; }; } fi -echo "$as_me:$LINENO: checking whether to enable maintainer-specific portions of Makefiles" >&5 -echo $ECHO_N "checking whether to enable maintainer-specific portions of Makefiles... $ECHO_C" >&6 - # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. +{ echo "$as_me:$LINENO: checking whether to enable maintainer-specific portions of Makefiles" >&5 +echo $ECHO_N "checking whether to enable maintainer-specific portions of Makefiles... $ECHO_C" >&6; } + # Check whether --enable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then - enableval="$enable_maintainer_mode" - USE_MAINTAINER_MODE=$enableval + enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval else USE_MAINTAINER_MODE=no -fi; - echo "$as_me:$LINENO: result: $USE_MAINTAINER_MODE" >&5 -echo "${ECHO_T}$USE_MAINTAINER_MODE" >&6 +fi + + { echo "$as_me:$LINENO: result: $USE_MAINTAINER_MODE" >&5 +echo "${ECHO_T}$USE_MAINTAINER_MODE" >&6; } if test $USE_MAINTAINER_MODE = yes; then @@ -10716,21 +11462,21 @@ esac *) target_noncanonical=${target_alias} ;; esac -echo "$as_me:$LINENO: checking whether to install libbfd" >&5 -echo $ECHO_N "checking whether to install libbfd... $ECHO_C" >&6 - # Check whether --enable-install-libbfd or --disable-install-libbfd was given. +{ echo "$as_me:$LINENO: checking whether to install libbfd" >&5 +echo $ECHO_N "checking whether to install libbfd... $ECHO_C" >&6; } + # Check whether --enable-install-libbfd was given. if test "${enable_install_libbfd+set}" = set; then - enableval="$enable_install_libbfd" - install_libbfd_p=$enableval + enableval=$enable_install_libbfd; install_libbfd_p=$enableval else if test "${host}" = "${target}" || test "$enable_shared" = "yes"; then install_libbfd_p=yes else install_libbfd_p=no fi -fi; - echo "$as_me:$LINENO: result: $install_libbfd_p" >&5 -echo "${ECHO_T}$install_libbfd_p" >&6 +fi + + { echo "$as_me:$LINENO: result: $install_libbfd_p" >&5 +echo "${ECHO_T}$install_libbfd_p" >&6; } if test $install_libbfd_p = yes; then @@ -10779,22 +11525,22 @@ POSUB= if test -f ../intl/config.intl; then . ../intl/config.intl fi -echo "$as_me:$LINENO: checking whether NLS is requested" >&5 -echo $ECHO_N "checking whether NLS is requested... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether NLS is requested" >&5 +echo $ECHO_N "checking whether NLS is requested... $ECHO_C" >&6; } if test x"$USE_NLS" != xyes; then - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } else - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } cat >>confdefs.h <<\_ACEOF #define ENABLE_NLS 1 _ACEOF - echo "$as_me:$LINENO: checking for catalogs to be installed" >&5 -echo $ECHO_N "checking for catalogs to be installed... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for catalogs to be installed" >&5 +echo $ECHO_N "checking for catalogs to be installed... $ECHO_C" >&6; } # Look for .po and .gmo files in the source directory. CATALOGS= XLINGUAS= @@ -10825,8 +11571,8 @@ echo $ECHO_N "checking for catalogs to be installed... $ECHO_C" >&6 fi done LINGUAS="$XLINGUAS" - echo "$as_me:$LINENO: result: $LINGUAS" >&5 -echo "${ECHO_T}$LINGUAS" >&6 + { echo "$as_me:$LINENO: result: $LINGUAS" >&5 +echo "${ECHO_T}$LINGUAS" >&6; } DATADIRNAME=share @@ -10852,17 +11598,17 @@ fi - echo "$as_me:$LINENO: checking whether NLS is requested" >&5 -echo $ECHO_N "checking whether NLS is requested... $ECHO_C" >&6 - # Check whether --enable-nls or --disable-nls was given. + { echo "$as_me:$LINENO: checking whether NLS is requested" >&5 +echo $ECHO_N "checking whether NLS is requested... $ECHO_C" >&6; } + # Check whether --enable-nls was given. if test "${enable_nls+set}" = set; then - enableval="$enable_nls" - USE_NLS=$enableval + enableval=$enable_nls; USE_NLS=$enableval else USE_NLS=yes -fi; - echo "$as_me:$LINENO: result: $USE_NLS" >&5 -echo "${ECHO_T}$USE_NLS" >&6 +fi + + { echo "$as_me:$LINENO: result: $USE_NLS" >&5 +echo "${ECHO_T}$USE_NLS" >&6; } @@ -10899,8 +11645,8 @@ rm -f conf$$.file # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_MSGFMT+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -10930,17 +11676,17 @@ esac fi MSGFMT="$ac_cv_path_MSGFMT" if test "$MSGFMT" != ":"; then - echo "$as_me:$LINENO: result: $MSGFMT" >&5 -echo "${ECHO_T}$MSGFMT" >&6 + { echo "$as_me:$LINENO: result: $MSGFMT" >&5 +echo "${ECHO_T}$MSGFMT" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_GMSGFMT+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -10955,30 +11701,31 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_GMSGFMT="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_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 "$as_me:$LINENO: result: $GMSGFMT" >&5 -echo "${ECHO_T}$GMSGFMT" >&6 + { echo "$as_me:$LINENO: result: $GMSGFMT" >&5 +echo "${ECHO_T}$GMSGFMT" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + # Prepare PATH_SEPARATOR. # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then @@ -11009,8 +11756,8 @@ rm -f conf$$.file # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_XGETTEXT+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -11040,11 +11787,11 @@ esac fi XGETTEXT="$ac_cv_path_XGETTEXT" if test "$XGETTEXT" != ":"; then - echo "$as_me:$LINENO: result: $XGETTEXT" >&5 -echo "${ECHO_T}$XGETTEXT" >&6 + { echo "$as_me:$LINENO: result: $XGETTEXT" >&5 +echo "${ECHO_T}$XGETTEXT" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi rm -f messages.po @@ -11080,8 +11827,8 @@ rm -f conf$$.file # Extract the first word of "msgmerge", so it can be a program name with args. set dummy msgmerge; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_MSGMERGE+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -11110,11 +11857,11 @@ esac fi MSGMERGE="$ac_cv_path_MSGMERGE" if test "$MSGMERGE" != ":"; then - echo "$as_me:$LINENO: result: $MSGMERGE" >&5 -echo "${ECHO_T}$MSGMERGE" >&6 + { echo "$as_me:$LINENO: result: $MSGMERGE" >&5 +echo "${ECHO_T}$MSGMERGE" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi @@ -11124,8 +11871,8 @@ fi : ; else GMSGFMT=`echo "$GMSGFMT" | sed -e 's,^.*/,,'` - echo "$as_me:$LINENO: result: found $GMSGFMT program is not GNU msgfmt; ignore it" >&5 -echo "${ECHO_T}found $GMSGFMT program is not GNU msgfmt; ignore it" >&6 + { echo "$as_me:$LINENO: result: found $GMSGFMT program is not GNU msgfmt; ignore it" >&5 +echo "${ECHO_T}found $GMSGFMT program is not GNU msgfmt; ignore it" >&6; } GMSGFMT=":" fi fi @@ -11135,14 +11882,14 @@ echo "${ECHO_T}found $GMSGFMT program is not GNU msgfmt; ignore it" >&6 (if $XGETTEXT --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then : ; else - echo "$as_me:$LINENO: result: found xgettext program is not GNU xgettext; ignore it" >&5 -echo "${ECHO_T}found xgettext program is not GNU xgettext; ignore it" >&6 + { echo "$as_me:$LINENO: result: found xgettext program is not GNU xgettext; ignore it" >&5 +echo "${ECHO_T}found xgettext program is not GNU xgettext; ignore it" >&6; } XGETTEXT=":" fi rm -f messages.po fi - ac_config_commands="$ac_config_commands default-1" + ac_config_commands="$ac_config_commands default-1" @@ -11163,8 +11910,8 @@ echo "${ECHO_T}found xgettext program is not GNU xgettext; ignore it" >&6 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. -echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 -echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 +echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; } if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -11186,7 +11933,7 @@ case $as_dir/ in # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then + if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. @@ -11205,21 +11952,22 @@ case $as_dir/ in ;; esac done +IFS=$as_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 + # As a last resort, use the slow shell script. Don't cache a + # value 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. + # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi -echo "$as_me:$LINENO: result: $INSTALL" >&5 -echo "${ECHO_T}$INSTALL" >&6 +{ echo "$as_me:$LINENO: result: $INSTALL" >&5 +echo "${ECHO_T}$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. @@ -11237,8 +11985,8 @@ BFD_HOST_64_BIT= BFD_HOST_U_64_BIT= BFD_HOSTPTR_T="unsigned long" -echo "$as_me:$LINENO: checking for long long" >&5 -echo $ECHO_N "checking for long long... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for long long" >&5 +echo $ECHO_N "checking for long long... $ECHO_C" >&6; } if test "${ac_cv_type_long_long+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -11249,61 +11997,57 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default +typedef long long ac__type_new_; int main () { -if ((long long *) 0) +if ((ac__type_new_ *) 0) return 0; -if (sizeof (long long)) +if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_type_long_long=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_type_long_long=no + ac_cv_type_long_long=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_type_long_long" >&5 -echo "${ECHO_T}$ac_cv_type_long_long" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_type_long_long" >&5 +echo "${ECHO_T}$ac_cv_type_long_long" >&6; } -echo "$as_me:$LINENO: checking size of long long" >&5 -echo $ECHO_N "checking size of long long... $ECHO_C" >&6 +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ echo "$as_me:$LINENO: checking size of long long" >&5 +echo $ECHO_N "checking size of long long... $ECHO_C" >&6; } if test "${ac_cv_sizeof_long_long+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test "$ac_cv_type_long_long" = yes; then - # The cast to unsigned long works around a bug in the HP C Compiler - # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects - # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. - # This bug is HP SR number 8606223364. if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF @@ -11313,10 +12057,11 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef long long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (long long))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; test_array [0] = 0 ; @@ -11324,27 +12069,22 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF @@ -11354,10 +12094,11 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef long long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (long long))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; @@ -11365,56 +12106,53 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo=`expr $ac_mid + 1` - if test $ac_lo -le $ac_mid; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid + 1` + ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef long long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (long long))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; test_array [0] = 0 ; @@ -11422,27 +12160,22 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF @@ -11452,10 +12185,11 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef long long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (long long))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; test_array [0] = 0 ; @@ -11463,50 +12197,48 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_hi=`expr '(' $ac_mid ')' - 1` - if test $ac_mid -le $ac_hi; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid` + ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo= ac_hi= + ac_lo= ac_hi= fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` @@ -11517,10 +12249,11 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef long long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (long long))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; @@ -11528,52 +12261,45 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo=`expr '(' $ac_mid ')' + 1` + ac_lo=`expr '(' $ac_mid ')' + 1` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_long_long=$ac_lo;; -'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (long long), 77 +'') if test "$ac_cv_type_long_long" = yes; then + { { echo "$as_me:$LINENO: error: cannot compute sizeof (long long) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (long long), 77 +echo "$as_me: error: cannot compute sizeof (long long) See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } ;; + { (exit 77); exit 77; }; } + else + ac_cv_sizeof_long_long=0 + fi ;; esac else - if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run test program while cross compiling -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -11581,8 +12307,9 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -long longval () { return (long) (sizeof (long long)); } -unsigned long ulongval () { return (long) (sizeof (long long)); } + typedef long long ac__type_sizeof_; +static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } +static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } #include #include int @@ -11591,35 +12318,44 @@ main () FILE *f = fopen ("conftest.val", "w"); if (! f) - exit (1); - if (((long) (sizeof (long long))) < 0) + return 1; + if (((long int) (sizeof (ac__type_sizeof_))) < 0) { - long i = longval (); - if (i != ((long) (sizeof (long long)))) - exit (1); + long int i = longval (); + if (i != ((long int) (sizeof (ac__type_sizeof_)))) + return 1; fprintf (f, "%ld\n", i); } else { - unsigned long i = ulongval (); - if (i != ((long) (sizeof (long long)))) - exit (1); + unsigned long int i = ulongval (); + if (i != ((long int) (sizeof (ac__type_sizeof_)))) + return 1; fprintf (f, "%lu\n", i); } - exit (ferror (f) || fclose (f) != 0); + return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -11630,29 +12366,32 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) -{ { echo "$as_me:$LINENO: error: cannot compute sizeof (long long), 77 +if test "$ac_cv_type_long_long" = yes; then + { { echo "$as_me:$LINENO: error: cannot compute sizeof (long long) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (long long), 77 +echo "$as_me: error: cannot compute sizeof (long long) See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext + { (exit 77); exit 77; }; } + else + ac_cv_sizeof_long_long=0 + fi fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val -else - ac_cv_sizeof_long_long=0 -fi fi -echo "$as_me:$LINENO: result: $ac_cv_sizeof_long_long" >&5 -echo "${ECHO_T}$ac_cv_sizeof_long_long" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_long_long" >&5 +echo "${ECHO_T}$ac_cv_sizeof_long_long" >&6; } + + + cat >>confdefs.h <<_ACEOF #define SIZEOF_LONG_LONG $ac_cv_sizeof_long_long _ACEOF -echo "$as_me:$LINENO: checking for void *" >&5 -echo $ECHO_N "checking for void *... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for void *" >&5 +echo $ECHO_N "checking for void *... $ECHO_C" >&6; } if test "${ac_cv_type_void_p+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -11663,61 +12402,57 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default +typedef void * ac__type_new_; int main () { -if ((void * *) 0) +if ((ac__type_new_ *) 0) return 0; -if (sizeof (void *)) +if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_type_void_p=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_type_void_p=no + ac_cv_type_void_p=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_type_void_p" >&5 -echo "${ECHO_T}$ac_cv_type_void_p" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_type_void_p" >&5 +echo "${ECHO_T}$ac_cv_type_void_p" >&6; } -echo "$as_me:$LINENO: checking size of void *" >&5 -echo $ECHO_N "checking size of void *... $ECHO_C" >&6 +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ echo "$as_me:$LINENO: checking size of void *" >&5 +echo $ECHO_N "checking size of void *... $ECHO_C" >&6; } if test "${ac_cv_sizeof_void_p+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test "$ac_cv_type_void_p" = yes; then - # The cast to unsigned long works around a bug in the HP C Compiler - # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects - # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. - # This bug is HP SR number 8606223364. if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF @@ -11727,10 +12462,11 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef void * ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (void *))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; test_array [0] = 0 ; @@ -11738,27 +12474,22 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF @@ -11768,10 +12499,11 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef void * ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (void *))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; @@ -11779,56 +12511,53 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo=`expr $ac_mid + 1` - if test $ac_lo -le $ac_mid; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid + 1` + ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef void * ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (void *))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; test_array [0] = 0 ; @@ -11836,27 +12565,22 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF @@ -11866,10 +12590,11 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef void * ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (void *))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; test_array [0] = 0 ; @@ -11877,50 +12602,48 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_hi=`expr '(' $ac_mid ')' - 1` - if test $ac_mid -le $ac_hi; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid` + ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo= ac_hi= + ac_lo= ac_hi= fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` @@ -11931,10 +12654,11 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef void * ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (void *))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; @@ -11942,52 +12666,45 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo=`expr '(' $ac_mid ')' + 1` + ac_lo=`expr '(' $ac_mid ')' + 1` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_void_p=$ac_lo;; -'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (void *), 77 +'') if test "$ac_cv_type_void_p" = yes; then + { { echo "$as_me:$LINENO: error: cannot compute sizeof (void *) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (void *), 77 +echo "$as_me: error: cannot compute sizeof (void *) See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } ;; + { (exit 77); exit 77; }; } + else + ac_cv_sizeof_void_p=0 + fi ;; esac else - if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run test program while cross compiling -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -11995,8 +12712,9 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -long longval () { return (long) (sizeof (void *)); } -unsigned long ulongval () { return (long) (sizeof (void *)); } + typedef void * ac__type_sizeof_; +static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } +static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } #include #include int @@ -12005,35 +12723,44 @@ main () FILE *f = fopen ("conftest.val", "w"); if (! f) - exit (1); - if (((long) (sizeof (void *))) < 0) + return 1; + if (((long int) (sizeof (ac__type_sizeof_))) < 0) { - long i = longval (); - if (i != ((long) (sizeof (void *)))) - exit (1); + long int i = longval (); + if (i != ((long int) (sizeof (ac__type_sizeof_)))) + return 1; fprintf (f, "%ld\n", i); } else { - unsigned long i = ulongval (); - if (i != ((long) (sizeof (void *)))) - exit (1); + unsigned long int i = ulongval (); + if (i != ((long int) (sizeof (ac__type_sizeof_)))) + return 1; fprintf (f, "%lu\n", i); } - exit (ferror (f) || fclose (f) != 0); + return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -12044,29 +12771,32 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) -{ { echo "$as_me:$LINENO: error: cannot compute sizeof (void *), 77 +if test "$ac_cv_type_void_p" = yes; then + { { echo "$as_me:$LINENO: error: cannot compute sizeof (void *) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (void *), 77 +echo "$as_me: error: cannot compute sizeof (void *) See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext + { (exit 77); exit 77; }; } + else + ac_cv_sizeof_void_p=0 + fi fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val -else - ac_cv_sizeof_void_p=0 fi -fi -echo "$as_me:$LINENO: result: $ac_cv_sizeof_void_p" >&5 -echo "${ECHO_T}$ac_cv_sizeof_void_p" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_void_p" >&5 +echo "${ECHO_T}$ac_cv_sizeof_void_p" >&6; } + + + cat >>confdefs.h <<_ACEOF #define SIZEOF_VOID_P $ac_cv_sizeof_void_p _ACEOF -echo "$as_me:$LINENO: checking for long" >&5 -echo $ECHO_N "checking for long... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for long" >&5 +echo $ECHO_N "checking for long... $ECHO_C" >&6; } if test "${ac_cv_type_long+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -12077,61 +12807,57 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default +typedef long ac__type_new_; int main () { -if ((long *) 0) +if ((ac__type_new_ *) 0) return 0; -if (sizeof (long)) +if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_type_long=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_type_long=no + ac_cv_type_long=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_type_long" >&5 -echo "${ECHO_T}$ac_cv_type_long" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_type_long" >&5 +echo "${ECHO_T}$ac_cv_type_long" >&6; } -echo "$as_me:$LINENO: checking size of long" >&5 -echo $ECHO_N "checking size of long... $ECHO_C" >&6 +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ echo "$as_me:$LINENO: checking size of long" >&5 +echo $ECHO_N "checking size of long... $ECHO_C" >&6; } if test "${ac_cv_sizeof_long+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test "$ac_cv_type_long" = yes; then - # The cast to unsigned long works around a bug in the HP C Compiler - # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects - # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. - # This bug is HP SR number 8606223364. if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF @@ -12141,10 +12867,11 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (long))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; test_array [0] = 0 ; @@ -12152,27 +12879,22 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF @@ -12182,10 +12904,11 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (long))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; @@ -12193,56 +12916,53 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo=`expr $ac_mid + 1` - if test $ac_lo -le $ac_mid; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid + 1` + ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (long))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; test_array [0] = 0 ; @@ -12250,27 +12970,22 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF @@ -12280,10 +12995,11 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (long))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; test_array [0] = 0 ; @@ -12291,50 +13007,48 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_hi=`expr '(' $ac_mid ')' - 1` - if test $ac_mid -le $ac_hi; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid` + ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo= ac_hi= + ac_lo= ac_hi= fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` @@ -12345,10 +13059,11 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (long))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; @@ -12356,52 +13071,45 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo=`expr '(' $ac_mid ')' + 1` + ac_lo=`expr '(' $ac_mid ')' + 1` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_long=$ac_lo;; -'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (long), 77 +'') if test "$ac_cv_type_long" = yes; then + { { echo "$as_me:$LINENO: error: cannot compute sizeof (long) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (long), 77 +echo "$as_me: error: cannot compute sizeof (long) See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } ;; + { (exit 77); exit 77; }; } + else + ac_cv_sizeof_long=0 + fi ;; esac else - if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run test program while cross compiling -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -12409,8 +13117,9 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -long longval () { return (long) (sizeof (long)); } -unsigned long ulongval () { return (long) (sizeof (long)); } + typedef long ac__type_sizeof_; +static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } +static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } #include #include int @@ -12419,35 +13128,44 @@ main () FILE *f = fopen ("conftest.val", "w"); if (! f) - exit (1); - if (((long) (sizeof (long))) < 0) + return 1; + if (((long int) (sizeof (ac__type_sizeof_))) < 0) { - long i = longval (); - if (i != ((long) (sizeof (long)))) - exit (1); + long int i = longval (); + if (i != ((long int) (sizeof (ac__type_sizeof_)))) + return 1; fprintf (f, "%ld\n", i); } else { - unsigned long i = ulongval (); - if (i != ((long) (sizeof (long)))) - exit (1); + unsigned long int i = ulongval (); + if (i != ((long int) (sizeof (ac__type_sizeof_)))) + return 1; fprintf (f, "%lu\n", i); } - exit (ferror (f) || fclose (f) != 0); + return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -12458,22 +13176,25 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) -{ { echo "$as_me:$LINENO: error: cannot compute sizeof (long), 77 +if test "$ac_cv_type_long" = yes; then + { { echo "$as_me:$LINENO: error: cannot compute sizeof (long) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (long), 77 +echo "$as_me: error: cannot compute sizeof (long) See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext + { (exit 77); exit 77; }; } + else + ac_cv_sizeof_long=0 + fi fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val -else - ac_cv_sizeof_long=0 -fi fi -echo "$as_me:$LINENO: result: $ac_cv_sizeof_long" >&5 -echo "${ECHO_T}$ac_cv_sizeof_long" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_long" >&5 +echo "${ECHO_T}$ac_cv_sizeof_long" >&6; } + + + cat >>confdefs.h <<_ACEOF #define SIZEOF_LONG $ac_cv_sizeof_long _ACEOF @@ -12523,8 +13244,8 @@ fi if test "x$cross_compiling" = "xno"; then EXEEXT_FOR_BUILD='$(EXEEXT)' else - echo "$as_me:$LINENO: checking for build system executable suffix" >&5 -echo $ECHO_N "checking for build system executable suffix... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for build system executable suffix" >&5 +echo $ECHO_N "checking for build system executable suffix... $ECHO_C" >&6; } if test "${bfd_cv_build_exeext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -12541,8 +13262,8 @@ else rm -f conftest* test x"${bfd_cv_build_exeext}" = x && bfd_cv_build_exeext=no fi -echo "$as_me:$LINENO: result: $bfd_cv_build_exeext" >&5 -echo "${ECHO_T}$bfd_cv_build_exeext" >&6 +{ echo "$as_me:$LINENO: result: $bfd_cv_build_exeext" >&5 +echo "${ECHO_T}$bfd_cv_build_exeext" >&6; } EXEEXT_FOR_BUILD="" test x"${bfd_cv_build_exeext}" != xno && EXEEXT_FOR_BUILD=${bfd_cv_build_exeext} fi @@ -12558,18 +13279,19 @@ fi for ac_header in alloca.h stddef.h string.h strings.h stdlib.h time.h unistd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? -echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -12580,41 +13302,37 @@ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_header_compiler=no + ac_header_compiler=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -12623,24 +13341,22 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 @@ -12648,9 +13364,10 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi + rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in @@ -12674,25 +13391,19 @@ echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\ echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------------ ## -## Report this to the AC_PACKAGE_NAME lists. ## -## ------------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 + ;; esac -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then @@ -12710,18 +13421,19 @@ done for ac_header in fcntl.h sys/file.h sys/time.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? -echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -12732,41 +13444,37 @@ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_header_compiler=no + ac_header_compiler=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -12775,24 +13483,22 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 @@ -12800,9 +13506,10 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi + rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in @@ -12826,25 +13533,19 @@ echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\ echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------------ ## -## Report this to the AC_PACKAGE_NAME lists. ## -## ------------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 + ;; esac -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then @@ -12869,8 +13570,8 @@ for i in stdint.h $inttype_headers; do unset ac_cv_type_int_fast32_t unset ac_cv_type_uint64_t echo $ECHO_N "looking for a compliant stdint.h in $i, $ECHO_C" >&6 - echo "$as_me:$LINENO: checking for uintmax_t" >&5 -echo $ECHO_N "checking for uintmax_t... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for uintmax_t" >&5 +echo $ECHO_N "checking for uintmax_t... $ECHO_C" >&6; } if test "${ac_cv_type_uintmax_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -12883,58 +13584,55 @@ cat >>conftest.$ac_ext <<_ACEOF #include #include <$i> +typedef uintmax_t ac__type_new_; int main () { -if ((uintmax_t *) 0) +if ((ac__type_new_ *) 0) return 0; -if (sizeof (uintmax_t)) +if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_type_uintmax_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_type_uintmax_t=no + ac_cv_type_uintmax_t=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_type_uintmax_t" >&5 -echo "${ECHO_T}$ac_cv_type_uintmax_t" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_type_uintmax_t" >&5 +echo "${ECHO_T}$ac_cv_type_uintmax_t" >&6; } if test $ac_cv_type_uintmax_t = yes; then acx_cv_header_stdint=$i else continue fi - echo "$as_me:$LINENO: checking for uintptr_t" >&5 -echo $ECHO_N "checking for uintptr_t... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for uintptr_t" >&5 +echo $ECHO_N "checking for uintptr_t... $ECHO_C" >&6; } if test "${ac_cv_type_uintptr_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -12947,58 +13645,55 @@ cat >>conftest.$ac_ext <<_ACEOF #include #include <$i> +typedef uintptr_t ac__type_new_; int main () { -if ((uintptr_t *) 0) +if ((ac__type_new_ *) 0) return 0; -if (sizeof (uintptr_t)) +if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_type_uintptr_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_type_uintptr_t=no + ac_cv_type_uintptr_t=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_type_uintptr_t" >&5 -echo "${ECHO_T}$ac_cv_type_uintptr_t" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_type_uintptr_t" >&5 +echo "${ECHO_T}$ac_cv_type_uintptr_t" >&6; } if test $ac_cv_type_uintptr_t = yes; then : else acx_cv_header_stdint_kind="(mostly complete)" fi - echo "$as_me:$LINENO: checking for int_least32_t" >&5 -echo $ECHO_N "checking for int_least32_t... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for int_least32_t" >&5 +echo $ECHO_N "checking for int_least32_t... $ECHO_C" >&6; } if test "${ac_cv_type_int_least32_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -13011,58 +13706,55 @@ cat >>conftest.$ac_ext <<_ACEOF #include #include <$i> +typedef int_least32_t ac__type_new_; int main () { -if ((int_least32_t *) 0) +if ((ac__type_new_ *) 0) return 0; -if (sizeof (int_least32_t)) +if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_type_int_least32_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_type_int_least32_t=no + ac_cv_type_int_least32_t=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_type_int_least32_t" >&5 -echo "${ECHO_T}$ac_cv_type_int_least32_t" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_type_int_least32_t" >&5 +echo "${ECHO_T}$ac_cv_type_int_least32_t" >&6; } if test $ac_cv_type_int_least32_t = yes; then : else acx_cv_header_stdint_kind="(mostly complete)" fi - echo "$as_me:$LINENO: checking for int_fast32_t" >&5 -echo $ECHO_N "checking for int_fast32_t... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for int_fast32_t" >&5 +echo $ECHO_N "checking for int_fast32_t... $ECHO_C" >&6; } if test "${ac_cv_type_int_fast32_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -13075,58 +13767,55 @@ cat >>conftest.$ac_ext <<_ACEOF #include #include <$i> +typedef int_fast32_t ac__type_new_; int main () { -if ((int_fast32_t *) 0) +if ((ac__type_new_ *) 0) return 0; -if (sizeof (int_fast32_t)) +if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_type_int_fast32_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_type_int_fast32_t=no + ac_cv_type_int_fast32_t=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_type_int_fast32_t" >&5 -echo "${ECHO_T}$ac_cv_type_int_fast32_t" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_type_int_fast32_t" >&5 +echo "${ECHO_T}$ac_cv_type_int_fast32_t" >&6; } if test $ac_cv_type_int_fast32_t = yes; then : else acx_cv_header_stdint_kind="(mostly complete)" fi - echo "$as_me:$LINENO: checking for uint64_t" >&5 -echo $ECHO_N "checking for uint64_t... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for uint64_t" >&5 +echo $ECHO_N "checking for uint64_t... $ECHO_C" >&6; } if test "${ac_cv_type_uint64_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -13139,50 +13828,47 @@ cat >>conftest.$ac_ext <<_ACEOF #include #include <$i> +typedef uint64_t ac__type_new_; int main () { -if ((uint64_t *) 0) +if ((ac__type_new_ *) 0) return 0; -if (sizeof (uint64_t)) +if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_type_uint64_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_type_uint64_t=no + ac_cv_type_uint64_t=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_type_uint64_t" >&5 -echo "${ECHO_T}$ac_cv_type_uint64_t" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_type_uint64_t" >&5 +echo "${ECHO_T}$ac_cv_type_uint64_t" >&6; } if test $ac_cv_type_uint64_t = yes; then : else @@ -13198,8 +13884,8 @@ if test "$acx_cv_header_stdint" = stddef.h; then unset ac_cv_type_uint32_t unset ac_cv_type_uint64_t echo $ECHO_N "looking for an incomplete stdint.h in $i, $ECHO_C" >&6 - echo "$as_me:$LINENO: checking for uint32_t" >&5 -echo $ECHO_N "checking for uint32_t... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for uint32_t" >&5 +echo $ECHO_N "checking for uint32_t... $ECHO_C" >&6; } if test "${ac_cv_type_uint32_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -13212,58 +13898,55 @@ cat >>conftest.$ac_ext <<_ACEOF #include #include <$i> +typedef uint32_t ac__type_new_; int main () { -if ((uint32_t *) 0) +if ((ac__type_new_ *) 0) return 0; -if (sizeof (uint32_t)) +if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_type_uint32_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_type_uint32_t=no + ac_cv_type_uint32_t=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_type_uint32_t" >&5 -echo "${ECHO_T}$ac_cv_type_uint32_t" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_type_uint32_t" >&5 +echo "${ECHO_T}$ac_cv_type_uint32_t" >&6; } if test $ac_cv_type_uint32_t = yes; then acx_cv_header_stdint=$i else continue fi - echo "$as_me:$LINENO: checking for uint64_t" >&5 -echo $ECHO_N "checking for uint64_t... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for uint64_t" >&5 +echo $ECHO_N "checking for uint64_t... $ECHO_C" >&6; } if test "${ac_cv_type_uint64_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -13276,53 +13959,50 @@ cat >>conftest.$ac_ext <<_ACEOF #include #include <$i> +typedef uint64_t ac__type_new_; int main () { -if ((uint64_t *) 0) +if ((ac__type_new_ *) 0) return 0; -if (sizeof (uint64_t)) +if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_type_uint64_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_type_uint64_t=no + ac_cv_type_uint64_t=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_type_uint64_t" >&5 -echo "${ECHO_T}$ac_cv_type_uint64_t" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_type_uint64_t" >&5 +echo "${ECHO_T}$ac_cv_type_uint64_t" >&6; } - echo "$as_me:$LINENO: checking for uintptr_t" >&5 -echo $ECHO_N "checking for uintptr_t... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for uintptr_t" >&5 +echo $ECHO_N "checking for uintptr_t... $ECHO_C" >&6; } if test "${ac_cv_type_uintptr_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -13335,50 +14015,47 @@ cat >>conftest.$ac_ext <<_ACEOF #include #include <$i> +typedef uintptr_t ac__type_new_; int main () { -if ((uintptr_t *) 0) +if ((ac__type_new_ *) 0) return 0; -if (sizeof (uintptr_t)) +if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_type_uintptr_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_type_uintptr_t=no + ac_cv_type_uintptr_t=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_type_uintptr_t" >&5 -echo "${ECHO_T}$ac_cv_type_uintptr_t" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_type_uintptr_t" >&5 +echo "${ECHO_T}$ac_cv_type_uintptr_t" >&6; } break done @@ -13389,8 +14066,8 @@ if test "$acx_cv_header_stdint" = stddef.h; then unset ac_cv_type_u_int32_t unset ac_cv_type_u_int64_t echo $ECHO_N "looking for u_intXX_t types in $i, $ECHO_C" >&6 - echo "$as_me:$LINENO: checking for u_int32_t" >&5 -echo $ECHO_N "checking for u_int32_t... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for u_int32_t" >&5 +echo $ECHO_N "checking for u_int32_t... $ECHO_C" >&6; } if test "${ac_cv_type_u_int32_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -13403,58 +14080,55 @@ cat >>conftest.$ac_ext <<_ACEOF #include #include <$i> +typedef u_int32_t ac__type_new_; int main () { -if ((u_int32_t *) 0) +if ((ac__type_new_ *) 0) return 0; -if (sizeof (u_int32_t)) +if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_type_u_int32_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_type_u_int32_t=no + ac_cv_type_u_int32_t=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_type_u_int32_t" >&5 -echo "${ECHO_T}$ac_cv_type_u_int32_t" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_type_u_int32_t" >&5 +echo "${ECHO_T}$ac_cv_type_u_int32_t" >&6; } if test $ac_cv_type_u_int32_t = yes; then acx_cv_header_stdint=$i else continue fi - echo "$as_me:$LINENO: checking for u_int64_t" >&5 -echo $ECHO_N "checking for u_int64_t... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for u_int64_t" >&5 +echo $ECHO_N "checking for u_int64_t... $ECHO_C" >&6; } if test "${ac_cv_type_u_int64_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -13467,50 +14141,47 @@ cat >>conftest.$ac_ext <<_ACEOF #include #include <$i> +typedef u_int64_t ac__type_new_; int main () { -if ((u_int64_t *) 0) +if ((ac__type_new_ *) 0) return 0; -if (sizeof (u_int64_t)) +if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_type_u_int64_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_type_u_int64_t=no + ac_cv_type_u_int64_t=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_type_u_int64_t" >&5 -echo "${ECHO_T}$ac_cv_type_u_int64_t" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_type_u_int64_t" >&5 +echo "${ECHO_T}$ac_cv_type_u_int64_t" >&6; } break done @@ -13527,19 +14198,27 @@ test -z "$ac_cv_type_int_fast32_t" && ac_cv_type_int_fast32_t=no # ----------------- Summarize what we found so far -echo "$as_me:$LINENO: checking what to include in bfd_stdint.h" >&5 -echo $ECHO_N "checking what to include in bfd_stdint.h... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking what to include in bfd_stdint.h" >&5 +echo $ECHO_N "checking what to include in bfd_stdint.h... $ECHO_C" >&6; } -case `$as_basename bfd_stdint.h || +case `$as_basename -- bfd_stdint.h || $as_expr X/bfd_stdint.h : '.*/\([^/][^/]*\)/*$' \| \ Xbfd_stdint.h : 'X\(//\)$' \| \ - Xbfd_stdint.h : 'X\(/\)$' \| \ - . : '\(.\)' 2>/dev/null || + Xbfd_stdint.h : 'X\(/\)' \| . 2>/dev/null || echo X/bfd_stdint.h | - sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } - /^X\/\(\/\/\)$/{ s//\1/; q; } - /^X\/\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` in + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` in stdint.h) { echo "$as_me:$LINENO: WARNING: are you sure you want it there?" >&5 echo "$as_me: WARNING: are you sure you want it there?" >&2;} ;; inttypes.h) { echo "$as_me:$LINENO: WARNING: are you sure you want it there?" >&5 @@ -13547,15 +14226,15 @@ echo "$as_me: WARNING: are you sure you want it there?" >&2;} ;; *) ;; esac -echo "$as_me:$LINENO: result: $acx_cv_header_stdint $acx_cv_header_stdint_kind" >&5 -echo "${ECHO_T}$acx_cv_header_stdint $acx_cv_header_stdint_kind" >&6 +{ echo "$as_me:$LINENO: result: $acx_cv_header_stdint $acx_cv_header_stdint_kind" >&5 +echo "${ECHO_T}$acx_cv_header_stdint $acx_cv_header_stdint_kind" >&6; } # ----------------- done included file, check C basic types -------- # Lacking an uintptr_t? Test size of void * case "$acx_cv_header_stdint:$ac_cv_type_uintptr_t" in - stddef.h:* | *:no) echo "$as_me:$LINENO: checking for void *" >&5 -echo $ECHO_N "checking for void *... $ECHO_C" >&6 + stddef.h:* | *:no) { echo "$as_me:$LINENO: checking for void *" >&5 +echo $ECHO_N "checking for void *... $ECHO_C" >&6; } if test "${ac_cv_type_void_p+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -13566,61 +14245,57 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default +typedef void * ac__type_new_; int main () { -if ((void * *) 0) +if ((ac__type_new_ *) 0) return 0; -if (sizeof (void *)) +if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_type_void_p=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_type_void_p=no + ac_cv_type_void_p=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_type_void_p" >&5 -echo "${ECHO_T}$ac_cv_type_void_p" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_type_void_p" >&5 +echo "${ECHO_T}$ac_cv_type_void_p" >&6; } -echo "$as_me:$LINENO: checking size of void *" >&5 -echo $ECHO_N "checking size of void *... $ECHO_C" >&6 +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ echo "$as_me:$LINENO: checking size of void *" >&5 +echo $ECHO_N "checking size of void *... $ECHO_C" >&6; } if test "${ac_cv_sizeof_void_p+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test "$ac_cv_type_void_p" = yes; then - # The cast to unsigned long works around a bug in the HP C Compiler - # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects - # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. - # This bug is HP SR number 8606223364. if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF @@ -13630,10 +14305,11 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef void * ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (void *))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; test_array [0] = 0 ; @@ -13641,27 +14317,22 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF @@ -13671,10 +14342,11 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef void * ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (void *))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; @@ -13682,56 +14354,53 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo=`expr $ac_mid + 1` - if test $ac_lo -le $ac_mid; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid + 1` + ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef void * ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (void *))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; test_array [0] = 0 ; @@ -13739,27 +14408,22 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF @@ -13769,10 +14433,11 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef void * ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (void *))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; test_array [0] = 0 ; @@ -13780,50 +14445,48 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_hi=`expr '(' $ac_mid ')' - 1` - if test $ac_mid -le $ac_hi; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid` + ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo= ac_hi= + ac_lo= ac_hi= fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` @@ -13834,10 +14497,11 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef void * ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (void *))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; @@ -13845,52 +14509,45 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo=`expr '(' $ac_mid ')' + 1` + ac_lo=`expr '(' $ac_mid ')' + 1` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_void_p=$ac_lo;; -'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (void *), 77 +'') if test "$ac_cv_type_void_p" = yes; then + { { echo "$as_me:$LINENO: error: cannot compute sizeof (void *) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (void *), 77 +echo "$as_me: error: cannot compute sizeof (void *) See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } ;; + { (exit 77); exit 77; }; } + else + ac_cv_sizeof_void_p=0 + fi ;; esac else - if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run test program while cross compiling -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -13898,8 +14555,9 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -long longval () { return (long) (sizeof (void *)); } -unsigned long ulongval () { return (long) (sizeof (void *)); } + typedef void * ac__type_sizeof_; +static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } +static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } #include #include int @@ -13908,35 +14566,44 @@ main () FILE *f = fopen ("conftest.val", "w"); if (! f) - exit (1); - if (((long) (sizeof (void *))) < 0) + return 1; + if (((long int) (sizeof (ac__type_sizeof_))) < 0) { - long i = longval (); - if (i != ((long) (sizeof (void *)))) - exit (1); + long int i = longval (); + if (i != ((long int) (sizeof (ac__type_sizeof_)))) + return 1; fprintf (f, "%ld\n", i); } else { - unsigned long i = ulongval (); - if (i != ((long) (sizeof (void *)))) - exit (1); + unsigned long int i = ulongval (); + if (i != ((long int) (sizeof (ac__type_sizeof_)))) + return 1; fprintf (f, "%lu\n", i); } - exit (ferror (f) || fclose (f) != 0); + return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -13947,22 +14614,25 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) -{ { echo "$as_me:$LINENO: error: cannot compute sizeof (void *), 77 +if test "$ac_cv_type_void_p" = yes; then + { { echo "$as_me:$LINENO: error: cannot compute sizeof (void *) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (void *), 77 +echo "$as_me: error: cannot compute sizeof (void *) See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext + { (exit 77); exit 77; }; } + else + ac_cv_sizeof_void_p=0 + fi fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val -else - ac_cv_sizeof_void_p=0 fi -fi -echo "$as_me:$LINENO: result: $ac_cv_sizeof_void_p" >&5 -echo "${ECHO_T}$ac_cv_sizeof_void_p" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_void_p" >&5 +echo "${ECHO_T}$ac_cv_sizeof_void_p" >&6; } + + + cat >>confdefs.h <<_ACEOF #define SIZEOF_VOID_P $ac_cv_sizeof_void_p _ACEOF @@ -13972,8 +14642,8 @@ esac # Lacking an uint64_t? Test size of long case "$acx_cv_header_stdint:$ac_cv_type_uint64_t:$ac_cv_type_u_int64_t" in - stddef.h:*:* | *:no:no) echo "$as_me:$LINENO: checking for long" >&5 -echo $ECHO_N "checking for long... $ECHO_C" >&6 + stddef.h:*:* | *:no:no) { echo "$as_me:$LINENO: checking for long" >&5 +echo $ECHO_N "checking for long... $ECHO_C" >&6; } if test "${ac_cv_type_long+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -13984,61 +14654,57 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default +typedef long ac__type_new_; int main () { -if ((long *) 0) +if ((ac__type_new_ *) 0) return 0; -if (sizeof (long)) +if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_type_long=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_type_long=no + ac_cv_type_long=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_type_long" >&5 -echo "${ECHO_T}$ac_cv_type_long" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_type_long" >&5 +echo "${ECHO_T}$ac_cv_type_long" >&6; } -echo "$as_me:$LINENO: checking size of long" >&5 -echo $ECHO_N "checking size of long... $ECHO_C" >&6 +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ echo "$as_me:$LINENO: checking size of long" >&5 +echo $ECHO_N "checking size of long... $ECHO_C" >&6; } if test "${ac_cv_sizeof_long+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test "$ac_cv_type_long" = yes; then - # The cast to unsigned long works around a bug in the HP C Compiler - # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects - # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. - # This bug is HP SR number 8606223364. if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF @@ -14048,10 +14714,11 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (long))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; test_array [0] = 0 ; @@ -14059,27 +14726,22 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF @@ -14089,10 +14751,11 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (long))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; @@ -14100,56 +14763,53 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo=`expr $ac_mid + 1` - if test $ac_lo -le $ac_mid; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid + 1` + ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (long))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; test_array [0] = 0 ; @@ -14157,27 +14817,22 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF @@ -14187,10 +14842,11 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (long))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; test_array [0] = 0 ; @@ -14198,50 +14854,48 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_hi=`expr '(' $ac_mid ')' - 1` - if test $ac_mid -le $ac_hi; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid` + ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo= ac_hi= + ac_lo= ac_hi= fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` @@ -14252,10 +14906,11 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (long))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; @@ -14263,52 +14918,45 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo=`expr '(' $ac_mid ')' + 1` + ac_lo=`expr '(' $ac_mid ')' + 1` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_long=$ac_lo;; -'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (long), 77 +'') if test "$ac_cv_type_long" = yes; then + { { echo "$as_me:$LINENO: error: cannot compute sizeof (long) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (long), 77 +echo "$as_me: error: cannot compute sizeof (long) See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } ;; + { (exit 77); exit 77; }; } + else + ac_cv_sizeof_long=0 + fi ;; esac else - if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run test program while cross compiling -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -14316,8 +14964,9 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -long longval () { return (long) (sizeof (long)); } -unsigned long ulongval () { return (long) (sizeof (long)); } + typedef long ac__type_sizeof_; +static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } +static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } #include #include int @@ -14326,35 +14975,44 @@ main () FILE *f = fopen ("conftest.val", "w"); if (! f) - exit (1); - if (((long) (sizeof (long))) < 0) + return 1; + if (((long int) (sizeof (ac__type_sizeof_))) < 0) { - long i = longval (); - if (i != ((long) (sizeof (long)))) - exit (1); + long int i = longval (); + if (i != ((long int) (sizeof (ac__type_sizeof_)))) + return 1; fprintf (f, "%ld\n", i); } else { - unsigned long i = ulongval (); - if (i != ((long) (sizeof (long)))) - exit (1); + unsigned long int i = ulongval (); + if (i != ((long int) (sizeof (ac__type_sizeof_)))) + return 1; fprintf (f, "%lu\n", i); } - exit (ferror (f) || fclose (f) != 0); + return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -14365,22 +15023,25 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) -{ { echo "$as_me:$LINENO: error: cannot compute sizeof (long), 77 +if test "$ac_cv_type_long" = yes; then + { { echo "$as_me:$LINENO: error: cannot compute sizeof (long) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (long), 77 +echo "$as_me: error: cannot compute sizeof (long) See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext + { (exit 77); exit 77; }; } + else + ac_cv_sizeof_long=0 + fi fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val -else - ac_cv_sizeof_long=0 -fi fi -echo "$as_me:$LINENO: result: $ac_cv_sizeof_long" >&5 -echo "${ECHO_T}$ac_cv_sizeof_long" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_long" >&5 +echo "${ECHO_T}$ac_cv_sizeof_long" >&6; } + + + cat >>confdefs.h <<_ACEOF #define SIZEOF_LONG $ac_cv_sizeof_long _ACEOF @@ -14390,8 +15051,8 @@ esac if test $acx_cv_header_stdint = stddef.h; then # Lacking a good header? Test size of everything and deduce all types. - echo "$as_me:$LINENO: checking for int" >&5 -echo $ECHO_N "checking for int... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for int" >&5 +echo $ECHO_N "checking for int... $ECHO_C" >&6; } if test "${ac_cv_type_int+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -14402,61 +15063,57 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default +typedef int ac__type_new_; int main () { -if ((int *) 0) +if ((ac__type_new_ *) 0) return 0; -if (sizeof (int)) +if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_type_int=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_type_int=no + ac_cv_type_int=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_type_int" >&5 -echo "${ECHO_T}$ac_cv_type_int" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_type_int" >&5 +echo "${ECHO_T}$ac_cv_type_int" >&6; } -echo "$as_me:$LINENO: checking size of int" >&5 -echo $ECHO_N "checking size of int... $ECHO_C" >&6 +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ echo "$as_me:$LINENO: checking size of int" >&5 +echo $ECHO_N "checking size of int... $ECHO_C" >&6; } if test "${ac_cv_sizeof_int+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test "$ac_cv_type_int" = yes; then - # The cast to unsigned long works around a bug in the HP C Compiler - # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects - # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. - # This bug is HP SR number 8606223364. if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF @@ -14466,10 +15123,11 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef int ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (int))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; test_array [0] = 0 ; @@ -14477,27 +15135,22 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF @@ -14507,10 +15160,11 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef int ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (int))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; @@ -14518,56 +15172,53 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo=`expr $ac_mid + 1` - if test $ac_lo -le $ac_mid; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid + 1` + ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef int ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (int))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; test_array [0] = 0 ; @@ -14575,27 +15226,22 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF @@ -14605,10 +15251,11 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef int ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (int))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; test_array [0] = 0 ; @@ -14616,50 +15263,48 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_hi=`expr '(' $ac_mid ')' - 1` - if test $ac_mid -le $ac_hi; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid` + ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo= ac_hi= + ac_lo= ac_hi= fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` @@ -14670,10 +15315,11 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef int ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (int))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; @@ -14681,52 +15327,45 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo=`expr '(' $ac_mid ')' + 1` + ac_lo=`expr '(' $ac_mid ')' + 1` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_int=$ac_lo;; -'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (int), 77 +'') if test "$ac_cv_type_int" = yes; then + { { echo "$as_me:$LINENO: error: cannot compute sizeof (int) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (int), 77 +echo "$as_me: error: cannot compute sizeof (int) See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } ;; + { (exit 77); exit 77; }; } + else + ac_cv_sizeof_int=0 + fi ;; esac else - if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run test program while cross compiling -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -14734,8 +15373,9 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -long longval () { return (long) (sizeof (int)); } -unsigned long ulongval () { return (long) (sizeof (int)); } + typedef int ac__type_sizeof_; +static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } +static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } #include #include int @@ -14744,35 +15384,44 @@ main () FILE *f = fopen ("conftest.val", "w"); if (! f) - exit (1); - if (((long) (sizeof (int))) < 0) + return 1; + if (((long int) (sizeof (ac__type_sizeof_))) < 0) { - long i = longval (); - if (i != ((long) (sizeof (int)))) - exit (1); + long int i = longval (); + if (i != ((long int) (sizeof (ac__type_sizeof_)))) + return 1; fprintf (f, "%ld\n", i); } else { - unsigned long i = ulongval (); - if (i != ((long) (sizeof (int)))) - exit (1); + unsigned long int i = ulongval (); + if (i != ((long int) (sizeof (ac__type_sizeof_)))) + return 1; fprintf (f, "%lu\n", i); } - exit (ferror (f) || fclose (f) != 0); + return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -14783,29 +15432,32 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) -{ { echo "$as_me:$LINENO: error: cannot compute sizeof (int), 77 +if test "$ac_cv_type_int" = yes; then + { { echo "$as_me:$LINENO: error: cannot compute sizeof (int) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (int), 77 +echo "$as_me: error: cannot compute sizeof (int) See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext + { (exit 77); exit 77; }; } + else + ac_cv_sizeof_int=0 + fi fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val -else - ac_cv_sizeof_int=0 fi -fi -echo "$as_me:$LINENO: result: $ac_cv_sizeof_int" >&5 -echo "${ECHO_T}$ac_cv_sizeof_int" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_int" >&5 +echo "${ECHO_T}$ac_cv_sizeof_int" >&6; } + + + cat >>confdefs.h <<_ACEOF #define SIZEOF_INT $ac_cv_sizeof_int _ACEOF - echo "$as_me:$LINENO: checking for short" >&5 -echo $ECHO_N "checking for short... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for short" >&5 +echo $ECHO_N "checking for short... $ECHO_C" >&6; } if test "${ac_cv_type_short+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -14816,61 +15468,57 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default +typedef short ac__type_new_; int main () { -if ((short *) 0) +if ((ac__type_new_ *) 0) return 0; -if (sizeof (short)) +if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_type_short=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_type_short=no + ac_cv_type_short=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_type_short" >&5 -echo "${ECHO_T}$ac_cv_type_short" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_type_short" >&5 +echo "${ECHO_T}$ac_cv_type_short" >&6; } -echo "$as_me:$LINENO: checking size of short" >&5 -echo $ECHO_N "checking size of short... $ECHO_C" >&6 +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ echo "$as_me:$LINENO: checking size of short" >&5 +echo $ECHO_N "checking size of short... $ECHO_C" >&6; } if test "${ac_cv_sizeof_short+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test "$ac_cv_type_short" = yes; then - # The cast to unsigned long works around a bug in the HP C Compiler - # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects - # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. - # This bug is HP SR number 8606223364. if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF @@ -14880,10 +15528,11 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef short ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (short))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; test_array [0] = 0 ; @@ -14891,27 +15540,22 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF @@ -14921,10 +15565,11 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef short ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (short))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; @@ -14932,56 +15577,53 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo=`expr $ac_mid + 1` - if test $ac_lo -le $ac_mid; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid + 1` + ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef short ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (short))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; test_array [0] = 0 ; @@ -14989,27 +15631,22 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF @@ -15019,10 +15656,11 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef short ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (short))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; test_array [0] = 0 ; @@ -15030,50 +15668,48 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_hi=`expr '(' $ac_mid ')' - 1` - if test $ac_mid -le $ac_hi; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid` + ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo= ac_hi= + ac_lo= ac_hi= fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` @@ -15084,10 +15720,11 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef short ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (short))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; @@ -15095,52 +15732,45 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo=`expr '(' $ac_mid ')' + 1` + ac_lo=`expr '(' $ac_mid ')' + 1` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_short=$ac_lo;; -'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (short), 77 +'') if test "$ac_cv_type_short" = yes; then + { { echo "$as_me:$LINENO: error: cannot compute sizeof (short) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (short), 77 +echo "$as_me: error: cannot compute sizeof (short) See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } ;; + { (exit 77); exit 77; }; } + else + ac_cv_sizeof_short=0 + fi ;; esac else - if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run test program while cross compiling -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -15148,8 +15778,9 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -long longval () { return (long) (sizeof (short)); } -unsigned long ulongval () { return (long) (sizeof (short)); } + typedef short ac__type_sizeof_; +static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } +static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } #include #include int @@ -15158,35 +15789,44 @@ main () FILE *f = fopen ("conftest.val", "w"); if (! f) - exit (1); - if (((long) (sizeof (short))) < 0) + return 1; + if (((long int) (sizeof (ac__type_sizeof_))) < 0) { - long i = longval (); - if (i != ((long) (sizeof (short)))) - exit (1); + long int i = longval (); + if (i != ((long int) (sizeof (ac__type_sizeof_)))) + return 1; fprintf (f, "%ld\n", i); } else { - unsigned long i = ulongval (); - if (i != ((long) (sizeof (short)))) - exit (1); + unsigned long int i = ulongval (); + if (i != ((long int) (sizeof (ac__type_sizeof_)))) + return 1; fprintf (f, "%lu\n", i); } - exit (ferror (f) || fclose (f) != 0); + return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -15197,29 +15837,32 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) -{ { echo "$as_me:$LINENO: error: cannot compute sizeof (short), 77 +if test "$ac_cv_type_short" = yes; then + { { echo "$as_me:$LINENO: error: cannot compute sizeof (short) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (short), 77 +echo "$as_me: error: cannot compute sizeof (short) See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext + { (exit 77); exit 77; }; } + else + ac_cv_sizeof_short=0 + fi fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val -else - ac_cv_sizeof_short=0 -fi fi -echo "$as_me:$LINENO: result: $ac_cv_sizeof_short" >&5 -echo "${ECHO_T}$ac_cv_sizeof_short" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_short" >&5 +echo "${ECHO_T}$ac_cv_sizeof_short" >&6; } + + + cat >>confdefs.h <<_ACEOF #define SIZEOF_SHORT $ac_cv_sizeof_short _ACEOF - echo "$as_me:$LINENO: checking for char" >&5 -echo $ECHO_N "checking for char... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for char" >&5 +echo $ECHO_N "checking for char... $ECHO_C" >&6; } if test "${ac_cv_type_char+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -15230,61 +15873,57 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default +typedef char ac__type_new_; int main () { -if ((char *) 0) +if ((ac__type_new_ *) 0) return 0; -if (sizeof (char)) +if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_type_char=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_type_char=no + ac_cv_type_char=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_type_char" >&5 -echo "${ECHO_T}$ac_cv_type_char" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_type_char" >&5 +echo "${ECHO_T}$ac_cv_type_char" >&6; } -echo "$as_me:$LINENO: checking size of char" >&5 -echo $ECHO_N "checking size of char... $ECHO_C" >&6 +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ echo "$as_me:$LINENO: checking size of char" >&5 +echo $ECHO_N "checking size of char... $ECHO_C" >&6; } if test "${ac_cv_sizeof_char+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test "$ac_cv_type_char" = yes; then - # The cast to unsigned long works around a bug in the HP C Compiler - # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects - # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. - # This bug is HP SR number 8606223364. if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF @@ -15294,10 +15933,11 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef char ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (char))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; test_array [0] = 0 ; @@ -15305,27 +15945,22 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF @@ -15335,10 +15970,11 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef char ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (char))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; @@ -15346,56 +15982,53 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo=`expr $ac_mid + 1` - if test $ac_lo -le $ac_mid; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid + 1` + ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef char ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (char))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; test_array [0] = 0 ; @@ -15403,27 +16036,22 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF @@ -15433,10 +16061,11 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef char ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (char))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; test_array [0] = 0 ; @@ -15444,50 +16073,48 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_hi=`expr '(' $ac_mid ')' - 1` - if test $ac_mid -le $ac_hi; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid` + ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo= ac_hi= + ac_lo= ac_hi= fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` @@ -15498,10 +16125,11 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef char ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (char))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; @@ -15509,52 +16137,45 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo=`expr '(' $ac_mid ')' + 1` + ac_lo=`expr '(' $ac_mid ')' + 1` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_char=$ac_lo;; -'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (char), 77 +'') if test "$ac_cv_type_char" = yes; then + { { echo "$as_me:$LINENO: error: cannot compute sizeof (char) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (char), 77 +echo "$as_me: error: cannot compute sizeof (char) See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } ;; + { (exit 77); exit 77; }; } + else + ac_cv_sizeof_char=0 + fi ;; esac else - if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run test program while cross compiling -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -15562,8 +16183,9 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -long longval () { return (long) (sizeof (char)); } -unsigned long ulongval () { return (long) (sizeof (char)); } + typedef char ac__type_sizeof_; +static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } +static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } #include #include int @@ -15572,35 +16194,44 @@ main () FILE *f = fopen ("conftest.val", "w"); if (! f) - exit (1); - if (((long) (sizeof (char))) < 0) + return 1; + if (((long int) (sizeof (ac__type_sizeof_))) < 0) { - long i = longval (); - if (i != ((long) (sizeof (char)))) - exit (1); + long int i = longval (); + if (i != ((long int) (sizeof (ac__type_sizeof_)))) + return 1; fprintf (f, "%ld\n", i); } else { - unsigned long i = ulongval (); - if (i != ((long) (sizeof (char)))) - exit (1); + unsigned long int i = ulongval (); + if (i != ((long int) (sizeof (ac__type_sizeof_)))) + return 1; fprintf (f, "%lu\n", i); } - exit (ferror (f) || fclose (f) != 0); + return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -15611,41 +16242,44 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) -{ { echo "$as_me:$LINENO: error: cannot compute sizeof (char), 77 +if test "$ac_cv_type_char" = yes; then + { { echo "$as_me:$LINENO: error: cannot compute sizeof (char) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (char), 77 +echo "$as_me: error: cannot compute sizeof (char) See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext + { (exit 77); exit 77; }; } + else + ac_cv_sizeof_char=0 + fi fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val -else - ac_cv_sizeof_char=0 fi -fi -echo "$as_me:$LINENO: result: $ac_cv_sizeof_char" >&5 -echo "${ECHO_T}$ac_cv_sizeof_char" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_char" >&5 +echo "${ECHO_T}$ac_cv_sizeof_char" >&6; } + + + cat >>confdefs.h <<_ACEOF #define SIZEOF_CHAR $ac_cv_sizeof_char _ACEOF - echo "$as_me:$LINENO: checking for type equivalent to int8_t" >&5 -echo $ECHO_N "checking for type equivalent to int8_t... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for type equivalent to int8_t" >&5 +echo $ECHO_N "checking for type equivalent to int8_t... $ECHO_C" >&6; } case "$ac_cv_sizeof_char" in 1) acx_cv_type_int8_t=char ;; *) { { echo "$as_me:$LINENO: error: no 8-bit type" >&5 echo "$as_me: error: no 8-bit type" >&2;} { (exit please report a bug); exit please report a bug; }; } esac - echo "$as_me:$LINENO: result: $acx_cv_type_int8_t" >&5 -echo "${ECHO_T}$acx_cv_type_int8_t" >&6 + { echo "$as_me:$LINENO: result: $acx_cv_type_int8_t" >&5 +echo "${ECHO_T}$acx_cv_type_int8_t" >&6; } - echo "$as_me:$LINENO: checking for type equivalent to int16_t" >&5 -echo $ECHO_N "checking for type equivalent to int16_t... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for type equivalent to int16_t" >&5 +echo $ECHO_N "checking for type equivalent to int16_t... $ECHO_C" >&6; } case "$ac_cv_sizeof_int:$ac_cv_sizeof_short" in 2:*) acx_cv_type_int16_t=int ;; *:2) acx_cv_type_int16_t=short ;; @@ -15653,11 +16287,11 @@ echo $ECHO_N "checking for type equivalent to int16_t... $ECHO_C" >&6 echo "$as_me: error: no 16-bit type" >&2;} { (exit please report a bug); exit please report a bug; }; } esac - echo "$as_me:$LINENO: result: $acx_cv_type_int16_t" >&5 -echo "${ECHO_T}$acx_cv_type_int16_t" >&6 + { echo "$as_me:$LINENO: result: $acx_cv_type_int16_t" >&5 +echo "${ECHO_T}$acx_cv_type_int16_t" >&6; } - echo "$as_me:$LINENO: checking for type equivalent to int32_t" >&5 -echo $ECHO_N "checking for type equivalent to int32_t... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for type equivalent to int32_t" >&5 +echo $ECHO_N "checking for type equivalent to int32_t... $ECHO_C" >&6; } case "$ac_cv_sizeof_int:$ac_cv_sizeof_long" in 4:*) acx_cv_type_int32_t=int ;; *:4) acx_cv_type_int32_t=long ;; @@ -15665,8 +16299,8 @@ echo $ECHO_N "checking for type equivalent to int32_t... $ECHO_C" >&6 echo "$as_me: error: no 32-bit type" >&2;} { (exit please report a bug); exit please report a bug; }; } esac - echo "$as_me:$LINENO: result: $acx_cv_type_int32_t" >&5 -echo "${ECHO_T}$acx_cv_type_int32_t" >&6 + { echo "$as_me:$LINENO: result: $acx_cv_type_int32_t" >&5 +echo "${ECHO_T}$acx_cv_type_int32_t" >&6; } fi # These tests are here to make the output prettier @@ -15675,17 +16309,17 @@ if test "$ac_cv_type_uint64_t" != yes && test "$ac_cv_type_u_int64_t" != yes; th case "$ac_cv_sizeof_long" in 8) acx_cv_type_int64_t=long ;; esac - echo "$as_me:$LINENO: checking for type equivalent to int64_t" >&5 -echo $ECHO_N "checking for type equivalent to int64_t... $ECHO_C" >&6 - echo "$as_me:$LINENO: result: ${acx_cv_type_int64_t-'using preprocessor symbols'}" >&5 -echo "${ECHO_T}${acx_cv_type_int64_t-'using preprocessor symbols'}" >&6 + { echo "$as_me:$LINENO: checking for type equivalent to int64_t" >&5 +echo $ECHO_N "checking for type equivalent to int64_t... $ECHO_C" >&6; } + { echo "$as_me:$LINENO: result: ${acx_cv_type_int64_t-'using preprocessor symbols'}" >&5 +echo "${ECHO_T}${acx_cv_type_int64_t-'using preprocessor symbols'}" >&6; } fi # Now we can use the above types if test "$ac_cv_type_uintptr_t" != yes; then - echo "$as_me:$LINENO: checking for type equivalent to intptr_t" >&5 -echo $ECHO_N "checking for type equivalent to intptr_t... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for type equivalent to intptr_t" >&5 +echo $ECHO_N "checking for type equivalent to intptr_t... $ECHO_C" >&6; } case $ac_cv_sizeof_void_p in 2) acx_cv_type_intptr_t=int16_t ;; 4) acx_cv_type_intptr_t=int32_t ;; @@ -15694,17 +16328,17 @@ echo $ECHO_N "checking for type equivalent to intptr_t... $ECHO_C" >&6 echo "$as_me: error: no equivalent for intptr_t" >&2;} { (exit please report a bug); exit please report a bug; }; } esac - echo "$as_me:$LINENO: result: $acx_cv_type_intptr_t" >&5 -echo "${ECHO_T}$acx_cv_type_intptr_t" >&6 + { echo "$as_me:$LINENO: result: $acx_cv_type_intptr_t" >&5 +echo "${ECHO_T}$acx_cv_type_intptr_t" >&6; } fi # ----------------- done all checks, emit header ------------- - ac_config_commands="$ac_config_commands bfd_stdint.h" +ac_config_commands="$ac_config_commands bfd_stdint.h" -echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5 -echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5 +echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6; } if test "${ac_cv_header_time+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -15728,38 +16362,34 @@ return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_header_time=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_header_time=no + ac_cv_header_time=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5 -echo "${ECHO_T}$ac_cv_header_time" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5 +echo "${ECHO_T}$ac_cv_header_time" >&6; } if test $ac_cv_header_time = yes; then cat >>confdefs.h <<\_ACEOF @@ -15776,9 +16406,9 @@ fi ac_header_dirent=no for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_hdr that defines DIR" >&5 -echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_hdr that defines DIR" >&5 +echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -15800,38 +16430,35 @@ return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_Header=no" + eval "$as_ac_Header=no" fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_hdr" | $as_tr_cpp` 1 @@ -15843,13 +16470,12 @@ fi done # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. if test $ac_header_dirent = dirent.h; then - echo "$as_me:$LINENO: checking for library containing opendir" >&5 -echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for library containing opendir" >&5 +echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6; } if test "${ac_cv_search_opendir+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_func_search_save_LIBS=$LIBS -ac_cv_search_opendir=no cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -15857,126 +16483,83 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char opendir (); int main () { -opendir (); +return opendir (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +for ac_lib in '' dir; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_search_opendir="none required" + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_search_opendir=$ac_res else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -if test "$ac_cv_search_opendir" = no; then - for ac_lib in dir; do - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char opendir (); -int -main () -{ -opendir (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_search_opendir="-l$ac_lib" -break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +fi +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext + if test "${ac_cv_search_opendir+set}" = set; then + break fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - done +done +if test "${ac_cv_search_opendir+set}" = set; then + : +else + ac_cv_search_opendir=no fi +rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 -echo "${ECHO_T}$ac_cv_search_opendir" >&6 -if test "$ac_cv_search_opendir" != no; then - test "$ac_cv_search_opendir" = "none required" || LIBS="$ac_cv_search_opendir $LIBS" +{ echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 +echo "${ECHO_T}$ac_cv_search_opendir" >&6; } +ac_res=$ac_cv_search_opendir +if test "$ac_res" != no; then + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi else - echo "$as_me:$LINENO: checking for library containing opendir" >&5 -echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for library containing opendir" >&5 +echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6; } if test "${ac_cv_search_opendir+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_func_search_save_LIBS=$LIBS -ac_cv_search_opendir=no cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -15984,122 +16567,80 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char opendir (); int main () { -opendir (); +return opendir (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +for ac_lib in '' x; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_search_opendir="none required" + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_search_opendir=$ac_res else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -if test "$ac_cv_search_opendir" = no; then - for ac_lib in x; do - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char opendir (); -int -main () -{ -opendir (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_search_opendir="-l$ac_lib" -break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +fi +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext + if test "${ac_cv_search_opendir+set}" = set; then + break fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - done +done +if test "${ac_cv_search_opendir+set}" = set; then + : +else + ac_cv_search_opendir=no fi +rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 -echo "${ECHO_T}$ac_cv_search_opendir" >&6 -if test "$ac_cv_search_opendir" != no; then - test "$ac_cv_search_opendir" = "none required" || LIBS="$ac_cv_search_opendir $LIBS" +{ echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 +echo "${ECHO_T}$ac_cv_search_opendir" >&6; } +ac_res=$ac_cv_search_opendir +if test "$ac_res" != no; then + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi fi -echo "$as_me:$LINENO: checking whether string.h and strings.h may both be included" >&5 -echo $ECHO_N "checking whether string.h and strings.h may both be included... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether string.h and strings.h may both be included" >&5 +echo $ECHO_N "checking whether string.h and strings.h may both be included... $ECHO_C" >&6; } if test "${gcc_cv_header_string+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -16120,38 +16661,34 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then gcc_cv_header_string=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -gcc_cv_header_string=no + gcc_cv_header_string=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $gcc_cv_header_string" >&5 -echo "${ECHO_T}$gcc_cv_header_string" >&6 +{ echo "$as_me:$LINENO: result: $gcc_cv_header_string" >&5 +echo "${ECHO_T}$gcc_cv_header_string" >&6; } if test $gcc_cv_header_string = yes; then cat >>confdefs.h <<\_ACEOF @@ -16170,9 +16707,9 @@ fi for ac_func in fcntl getpagesize setitimer sysconf fdopen getuid getgid do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -16198,68 +16735,60 @@ cat >>conftest.$ac_ext <<_ACEOF #undef $ac_func -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" -{ #endif -/* 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 (); /* 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) +#if defined __stub_$ac_func || defined __stub___$ac_func choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} #endif int main () { -return f != $ac_func; +return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" + eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 @@ -16272,9 +16801,9 @@ done for ac_func in strtoull do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -16300,68 +16829,60 @@ cat >>conftest.$ac_ext <<_ACEOF #undef $ac_func -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" -{ #endif -/* 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 (); /* 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) +#if defined __stub_$ac_func || defined __stub___$ac_func choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} #endif int main () { -return f != $ac_func; +return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" + eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 @@ -16371,8 +16892,8 @@ fi done -echo "$as_me:$LINENO: checking whether basename is declared" >&5 -echo $ECHO_N "checking whether basename is declared... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether basename is declared" >&5 +echo $ECHO_N "checking whether basename is declared... $ECHO_C" >&6; } if test "${ac_cv_have_decl_basename+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -16387,7 +16908,7 @@ int main () { #ifndef basename - char *p = (char *) basename; + (void) basename; #endif ; @@ -16395,38 +16916,34 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_have_decl_basename=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_have_decl_basename=no + ac_cv_have_decl_basename=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_have_decl_basename" >&5 -echo "${ECHO_T}$ac_cv_have_decl_basename" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_basename" >&5 +echo "${ECHO_T}$ac_cv_have_decl_basename" >&6; } if test $ac_cv_have_decl_basename = yes; then cat >>confdefs.h <<_ACEOF @@ -16443,8 +16960,8 @@ _ACEOF fi -echo "$as_me:$LINENO: checking whether ftello is declared" >&5 -echo $ECHO_N "checking whether ftello is declared... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether ftello is declared" >&5 +echo $ECHO_N "checking whether ftello is declared... $ECHO_C" >&6; } if test "${ac_cv_have_decl_ftello+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -16459,7 +16976,7 @@ int main () { #ifndef ftello - char *p = (char *) ftello; + (void) ftello; #endif ; @@ -16467,38 +16984,34 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_have_decl_ftello=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_have_decl_ftello=no + ac_cv_have_decl_ftello=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_have_decl_ftello" >&5 -echo "${ECHO_T}$ac_cv_have_decl_ftello" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_ftello" >&5 +echo "${ECHO_T}$ac_cv_have_decl_ftello" >&6; } if test $ac_cv_have_decl_ftello = yes; then cat >>confdefs.h <<_ACEOF @@ -16515,8 +17028,8 @@ _ACEOF fi -echo "$as_me:$LINENO: checking whether ftello64 is declared" >&5 -echo $ECHO_N "checking whether ftello64 is declared... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether ftello64 is declared" >&5 +echo $ECHO_N "checking whether ftello64 is declared... $ECHO_C" >&6; } if test "${ac_cv_have_decl_ftello64+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -16531,7 +17044,7 @@ int main () { #ifndef ftello64 - char *p = (char *) ftello64; + (void) ftello64; #endif ; @@ -16539,38 +17052,34 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_have_decl_ftello64=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_have_decl_ftello64=no + ac_cv_have_decl_ftello64=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_have_decl_ftello64" >&5 -echo "${ECHO_T}$ac_cv_have_decl_ftello64" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_ftello64" >&5 +echo "${ECHO_T}$ac_cv_have_decl_ftello64" >&6; } if test $ac_cv_have_decl_ftello64 = yes; then cat >>confdefs.h <<_ACEOF @@ -16587,8 +17096,8 @@ _ACEOF fi -echo "$as_me:$LINENO: checking whether fseeko is declared" >&5 -echo $ECHO_N "checking whether fseeko is declared... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether fseeko is declared" >&5 +echo $ECHO_N "checking whether fseeko is declared... $ECHO_C" >&6; } if test "${ac_cv_have_decl_fseeko+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -16603,7 +17112,7 @@ int main () { #ifndef fseeko - char *p = (char *) fseeko; + (void) fseeko; #endif ; @@ -16611,38 +17120,34 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_have_decl_fseeko=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_have_decl_fseeko=no + ac_cv_have_decl_fseeko=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_have_decl_fseeko" >&5 -echo "${ECHO_T}$ac_cv_have_decl_fseeko" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_fseeko" >&5 +echo "${ECHO_T}$ac_cv_have_decl_fseeko" >&6; } if test $ac_cv_have_decl_fseeko = yes; then cat >>confdefs.h <<_ACEOF @@ -16659,8 +17164,8 @@ _ACEOF fi -echo "$as_me:$LINENO: checking whether fseeko64 is declared" >&5 -echo $ECHO_N "checking whether fseeko64 is declared... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether fseeko64 is declared" >&5 +echo $ECHO_N "checking whether fseeko64 is declared... $ECHO_C" >&6; } if test "${ac_cv_have_decl_fseeko64+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -16675,7 +17180,7 @@ int main () { #ifndef fseeko64 - char *p = (char *) fseeko64; + (void) fseeko64; #endif ; @@ -16683,38 +17188,34 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_have_decl_fseeko64=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_have_decl_fseeko64=no + ac_cv_have_decl_fseeko64=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_have_decl_fseeko64" >&5 -echo "${ECHO_T}$ac_cv_have_decl_fseeko64" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_fseeko64" >&5 +echo "${ECHO_T}$ac_cv_have_decl_fseeko64" >&6; } if test $ac_cv_have_decl_fseeko64 = yes; then cat >>confdefs.h <<_ACEOF @@ -16742,8 +17243,8 @@ _ACEOF ;; esac -echo "$as_me:$LINENO: checking whether ffs is declared" >&5 -echo $ECHO_N "checking whether ffs is declared... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether ffs is declared" >&5 +echo $ECHO_N "checking whether ffs is declared... $ECHO_C" >&6; } if test "${ac_cv_have_decl_ffs+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -16758,7 +17259,7 @@ int main () { #ifndef ffs - char *p = (char *) ffs; + (void) ffs; #endif ; @@ -16766,38 +17267,34 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_have_decl_ffs=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_have_decl_ffs=no + ac_cv_have_decl_ffs=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_have_decl_ffs" >&5 -echo "${ECHO_T}$ac_cv_have_decl_ffs" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_ffs" >&5 +echo "${ECHO_T}$ac_cv_have_decl_ffs" >&6; } if test $ac_cv_have_decl_ffs = yes; then cat >>confdefs.h <<_ACEOF @@ -16814,8 +17311,8 @@ _ACEOF fi -echo "$as_me:$LINENO: checking whether free is declared" >&5 -echo $ECHO_N "checking whether free is declared... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether free is declared" >&5 +echo $ECHO_N "checking whether free is declared... $ECHO_C" >&6; } if test "${ac_cv_have_decl_free+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -16830,7 +17327,7 @@ int main () { #ifndef free - char *p = (char *) free; + (void) free; #endif ; @@ -16838,38 +17335,34 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_have_decl_free=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_have_decl_free=no + ac_cv_have_decl_free=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_have_decl_free" >&5 -echo "${ECHO_T}$ac_cv_have_decl_free" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_free" >&5 +echo "${ECHO_T}$ac_cv_have_decl_free" >&6; } if test $ac_cv_have_decl_free = yes; then cat >>confdefs.h <<_ACEOF @@ -16886,8 +17379,8 @@ _ACEOF fi -echo "$as_me:$LINENO: checking whether getenv is declared" >&5 -echo $ECHO_N "checking whether getenv is declared... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether getenv is declared" >&5 +echo $ECHO_N "checking whether getenv is declared... $ECHO_C" >&6; } if test "${ac_cv_have_decl_getenv+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -16902,7 +17395,7 @@ int main () { #ifndef getenv - char *p = (char *) getenv; + (void) getenv; #endif ; @@ -16910,38 +17403,34 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_have_decl_getenv=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_have_decl_getenv=no + ac_cv_have_decl_getenv=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_have_decl_getenv" >&5 -echo "${ECHO_T}$ac_cv_have_decl_getenv" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_getenv" >&5 +echo "${ECHO_T}$ac_cv_have_decl_getenv" >&6; } if test $ac_cv_have_decl_getenv = yes; then cat >>confdefs.h <<_ACEOF @@ -16958,8 +17447,8 @@ _ACEOF fi -echo "$as_me:$LINENO: checking whether malloc is declared" >&5 -echo $ECHO_N "checking whether malloc is declared... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether malloc is declared" >&5 +echo $ECHO_N "checking whether malloc is declared... $ECHO_C" >&6; } if test "${ac_cv_have_decl_malloc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -16974,7 +17463,7 @@ int main () { #ifndef malloc - char *p = (char *) malloc; + (void) malloc; #endif ; @@ -16982,38 +17471,34 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_have_decl_malloc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_have_decl_malloc=no + ac_cv_have_decl_malloc=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_have_decl_malloc" >&5 -echo "${ECHO_T}$ac_cv_have_decl_malloc" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_malloc" >&5 +echo "${ECHO_T}$ac_cv_have_decl_malloc" >&6; } if test $ac_cv_have_decl_malloc = yes; then cat >>confdefs.h <<_ACEOF @@ -17030,8 +17515,8 @@ _ACEOF fi -echo "$as_me:$LINENO: checking whether realloc is declared" >&5 -echo $ECHO_N "checking whether realloc is declared... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether realloc is declared" >&5 +echo $ECHO_N "checking whether realloc is declared... $ECHO_C" >&6; } if test "${ac_cv_have_decl_realloc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -17046,7 +17531,7 @@ int main () { #ifndef realloc - char *p = (char *) realloc; + (void) realloc; #endif ; @@ -17054,38 +17539,34 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_have_decl_realloc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_have_decl_realloc=no + ac_cv_have_decl_realloc=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_have_decl_realloc" >&5 -echo "${ECHO_T}$ac_cv_have_decl_realloc" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_realloc" >&5 +echo "${ECHO_T}$ac_cv_have_decl_realloc" >&6; } if test $ac_cv_have_decl_realloc = yes; then cat >>confdefs.h <<_ACEOF @@ -17102,8 +17583,8 @@ _ACEOF fi -echo "$as_me:$LINENO: checking whether stpcpy is declared" >&5 -echo $ECHO_N "checking whether stpcpy is declared... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether stpcpy is declared" >&5 +echo $ECHO_N "checking whether stpcpy is declared... $ECHO_C" >&6; } if test "${ac_cv_have_decl_stpcpy+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -17118,7 +17599,7 @@ int main () { #ifndef stpcpy - char *p = (char *) stpcpy; + (void) stpcpy; #endif ; @@ -17126,38 +17607,34 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_have_decl_stpcpy=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_have_decl_stpcpy=no + ac_cv_have_decl_stpcpy=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_have_decl_stpcpy" >&5 -echo "${ECHO_T}$ac_cv_have_decl_stpcpy" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_stpcpy" >&5 +echo "${ECHO_T}$ac_cv_have_decl_stpcpy" >&6; } if test $ac_cv_have_decl_stpcpy = yes; then cat >>confdefs.h <<_ACEOF @@ -17174,8 +17651,8 @@ _ACEOF fi -echo "$as_me:$LINENO: checking whether strstr is declared" >&5 -echo $ECHO_N "checking whether strstr is declared... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether strstr is declared" >&5 +echo $ECHO_N "checking whether strstr is declared... $ECHO_C" >&6; } if test "${ac_cv_have_decl_strstr+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -17190,7 +17667,7 @@ int main () { #ifndef strstr - char *p = (char *) strstr; + (void) strstr; #endif ; @@ -17198,38 +17675,34 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_have_decl_strstr=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_have_decl_strstr=no + ac_cv_have_decl_strstr=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_have_decl_strstr" >&5 -echo "${ECHO_T}$ac_cv_have_decl_strstr" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_strstr" >&5 +echo "${ECHO_T}$ac_cv_have_decl_strstr" >&6; } if test $ac_cv_have_decl_strstr = yes; then cat >>confdefs.h <<_ACEOF @@ -17246,8 +17719,8 @@ _ACEOF fi -echo "$as_me:$LINENO: checking whether snprintf is declared" >&5 -echo $ECHO_N "checking whether snprintf is declared... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether snprintf is declared" >&5 +echo $ECHO_N "checking whether snprintf is declared... $ECHO_C" >&6; } if test "${ac_cv_have_decl_snprintf+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -17262,7 +17735,7 @@ int main () { #ifndef snprintf - char *p = (char *) snprintf; + (void) snprintf; #endif ; @@ -17270,38 +17743,34 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_have_decl_snprintf=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_have_decl_snprintf=no + ac_cv_have_decl_snprintf=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_have_decl_snprintf" >&5 -echo "${ECHO_T}$ac_cv_have_decl_snprintf" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_snprintf" >&5 +echo "${ECHO_T}$ac_cv_have_decl_snprintf" >&6; } if test $ac_cv_have_decl_snprintf = yes; then cat >>confdefs.h <<_ACEOF @@ -17318,8 +17787,8 @@ _ACEOF fi -echo "$as_me:$LINENO: checking whether vsnprintf is declared" >&5 -echo $ECHO_N "checking whether vsnprintf is declared... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether vsnprintf is declared" >&5 +echo $ECHO_N "checking whether vsnprintf is declared... $ECHO_C" >&6; } if test "${ac_cv_have_decl_vsnprintf+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -17334,7 +17803,7 @@ int main () { #ifndef vsnprintf - char *p = (char *) vsnprintf; + (void) vsnprintf; #endif ; @@ -17342,38 +17811,34 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_have_decl_vsnprintf=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_have_decl_vsnprintf=no + ac_cv_have_decl_vsnprintf=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_have_decl_vsnprintf" >&5 -echo "${ECHO_T}$ac_cv_have_decl_vsnprintf" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_vsnprintf" >&5 +echo "${ECHO_T}$ac_cv_have_decl_vsnprintf" >&6; } if test $ac_cv_have_decl_vsnprintf = yes; then cat >>confdefs.h <<_ACEOF @@ -17554,8 +18019,8 @@ if test "${target}" = "${host}"; then COREFLAG="$COREFLAG -DAIX_CORE_DUMPX_CORE" # Not all versions of AIX with -DAIX_CORE_DUMPX_CORE # have c_impl as a member of struct core_dumpx - echo "$as_me:$LINENO: checking for c_impl in struct core_dumpx" >&5 -echo $ECHO_N "checking for c_impl in struct core_dumpx... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for c_impl in struct core_dumpx" >&5 +echo $ECHO_N "checking for c_impl in struct core_dumpx... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -17572,42 +18037,38 @@ struct core_dumpx c; c.c_impl = 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then cat >>confdefs.h <<\_ACEOF #define HAVE_ST_C_IMPL 1 _ACEOF - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ;; rs6000-*-aix4*) COREFILE=rs6000-core.lo ;; rs6000-*-*) COREFILE=rs6000-core.lo ;; @@ -17673,18 +18134,19 @@ rm -f conftest.err conftest.$ac_objext conftest.$ac_ext for ac_header in sys/procfs.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? -echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -17695,41 +18157,37 @@ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_header_compiler=no + ac_header_compiler=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -17738,24 +18196,22 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 @@ -17763,9 +18219,10 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi + rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in @@ -17789,25 +18246,19 @@ echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\ echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------------ ## -## Report this to the AC_PACKAGE_NAME lists. ## -## ------------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 + ;; esac -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then @@ -17820,8 +18271,8 @@ fi done if test "$ac_cv_header_sys_procfs_h" = yes; then - echo "$as_me:$LINENO: checking for prstatus_t in sys/procfs.h" >&5 -echo $ECHO_N "checking for prstatus_t in sys/procfs.h... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for prstatus_t in sys/procfs.h" >&5 +echo $ECHO_N "checking for prstatus_t in sys/procfs.h... $ECHO_C" >&6; } if test "${bfd_cv_have_sys_procfs_type_prstatus_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -17843,36 +18294,32 @@ prstatus_t avar } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then bfd_cv_have_sys_procfs_type_prstatus_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -bfd_cv_have_sys_procfs_type_prstatus_t=no + bfd_cv_have_sys_procfs_type_prstatus_t=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test $bfd_cv_have_sys_procfs_type_prstatus_t = yes; then @@ -17882,11 +18329,11 @@ cat >>confdefs.h <<\_ACEOF _ACEOF fi - echo "$as_me:$LINENO: result: $bfd_cv_have_sys_procfs_type_prstatus_t" >&5 -echo "${ECHO_T}$bfd_cv_have_sys_procfs_type_prstatus_t" >&6 + { echo "$as_me:$LINENO: result: $bfd_cv_have_sys_procfs_type_prstatus_t" >&5 +echo "${ECHO_T}$bfd_cv_have_sys_procfs_type_prstatus_t" >&6; } - echo "$as_me:$LINENO: checking for prstatus32_t in sys/procfs.h" >&5 -echo $ECHO_N "checking for prstatus32_t in sys/procfs.h... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for prstatus32_t in sys/procfs.h" >&5 +echo $ECHO_N "checking for prstatus32_t in sys/procfs.h... $ECHO_C" >&6; } if test "${bfd_cv_have_sys_procfs_type_prstatus32_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -17908,36 +18355,32 @@ prstatus32_t avar } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then bfd_cv_have_sys_procfs_type_prstatus32_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -bfd_cv_have_sys_procfs_type_prstatus32_t=no + bfd_cv_have_sys_procfs_type_prstatus32_t=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test $bfd_cv_have_sys_procfs_type_prstatus32_t = yes; then @@ -17947,11 +18390,11 @@ cat >>confdefs.h <<\_ACEOF _ACEOF fi - echo "$as_me:$LINENO: result: $bfd_cv_have_sys_procfs_type_prstatus32_t" >&5 -echo "${ECHO_T}$bfd_cv_have_sys_procfs_type_prstatus32_t" >&6 + { echo "$as_me:$LINENO: result: $bfd_cv_have_sys_procfs_type_prstatus32_t" >&5 +echo "${ECHO_T}$bfd_cv_have_sys_procfs_type_prstatus32_t" >&6; } - echo "$as_me:$LINENO: checking for prstatus_t.pr_who in sys/procfs.h" >&5 -echo $ECHO_N "checking for prstatus_t.pr_who in sys/procfs.h... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for prstatus_t.pr_who in sys/procfs.h" >&5 +echo $ECHO_N "checking for prstatus_t.pr_who in sys/procfs.h... $ECHO_C" >&6; } if test "${bfd_cv_have_sys_procfs_type_member_prstatus_t_pr_who+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -17973,36 +18416,32 @@ prstatus_t avar; void* aref = (void*) &avar.pr_who } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then bfd_cv_have_sys_procfs_type_member_prstatus_t_pr_who=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -bfd_cv_have_sys_procfs_type_member_prstatus_t_pr_who=no + bfd_cv_have_sys_procfs_type_member_prstatus_t_pr_who=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test $bfd_cv_have_sys_procfs_type_member_prstatus_t_pr_who = yes; then @@ -18012,11 +18451,11 @@ cat >>confdefs.h <<\_ACEOF _ACEOF fi - echo "$as_me:$LINENO: result: $bfd_cv_have_sys_procfs_type_member_prstatus_t_pr_who" >&5 -echo "${ECHO_T}$bfd_cv_have_sys_procfs_type_member_prstatus_t_pr_who" >&6 + { echo "$as_me:$LINENO: result: $bfd_cv_have_sys_procfs_type_member_prstatus_t_pr_who" >&5 +echo "${ECHO_T}$bfd_cv_have_sys_procfs_type_member_prstatus_t_pr_who" >&6; } - echo "$as_me:$LINENO: checking for prstatus32_t.pr_who in sys/procfs.h" >&5 -echo $ECHO_N "checking for prstatus32_t.pr_who in sys/procfs.h... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for prstatus32_t.pr_who in sys/procfs.h" >&5 +echo $ECHO_N "checking for prstatus32_t.pr_who in sys/procfs.h... $ECHO_C" >&6; } if test "${bfd_cv_have_sys_procfs_type_member_prstatus32_t_pr_who+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -18038,36 +18477,32 @@ prstatus32_t avar; void* aref = (void*) &avar.pr_who } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then bfd_cv_have_sys_procfs_type_member_prstatus32_t_pr_who=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -bfd_cv_have_sys_procfs_type_member_prstatus32_t_pr_who=no + bfd_cv_have_sys_procfs_type_member_prstatus32_t_pr_who=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test $bfd_cv_have_sys_procfs_type_member_prstatus32_t_pr_who = yes; then @@ -18077,11 +18512,11 @@ cat >>confdefs.h <<\_ACEOF _ACEOF fi - echo "$as_me:$LINENO: result: $bfd_cv_have_sys_procfs_type_member_prstatus32_t_pr_who" >&5 -echo "${ECHO_T}$bfd_cv_have_sys_procfs_type_member_prstatus32_t_pr_who" >&6 + { echo "$as_me:$LINENO: result: $bfd_cv_have_sys_procfs_type_member_prstatus32_t_pr_who" >&5 +echo "${ECHO_T}$bfd_cv_have_sys_procfs_type_member_prstatus32_t_pr_who" >&6; } - echo "$as_me:$LINENO: checking for pstatus_t in sys/procfs.h" >&5 -echo $ECHO_N "checking for pstatus_t in sys/procfs.h... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for pstatus_t in sys/procfs.h" >&5 +echo $ECHO_N "checking for pstatus_t in sys/procfs.h... $ECHO_C" >&6; } if test "${bfd_cv_have_sys_procfs_type_pstatus_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -18103,36 +18538,32 @@ pstatus_t avar } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then bfd_cv_have_sys_procfs_type_pstatus_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -bfd_cv_have_sys_procfs_type_pstatus_t=no + bfd_cv_have_sys_procfs_type_pstatus_t=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test $bfd_cv_have_sys_procfs_type_pstatus_t = yes; then @@ -18142,11 +18573,11 @@ cat >>confdefs.h <<\_ACEOF _ACEOF fi - echo "$as_me:$LINENO: result: $bfd_cv_have_sys_procfs_type_pstatus_t" >&5 -echo "${ECHO_T}$bfd_cv_have_sys_procfs_type_pstatus_t" >&6 + { echo "$as_me:$LINENO: result: $bfd_cv_have_sys_procfs_type_pstatus_t" >&5 +echo "${ECHO_T}$bfd_cv_have_sys_procfs_type_pstatus_t" >&6; } - echo "$as_me:$LINENO: checking for pxstatus_t in sys/procfs.h" >&5 -echo $ECHO_N "checking for pxstatus_t in sys/procfs.h... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for pxstatus_t in sys/procfs.h" >&5 +echo $ECHO_N "checking for pxstatus_t in sys/procfs.h... $ECHO_C" >&6; } if test "${bfd_cv_have_sys_procfs_type_pxstatus_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -18168,36 +18599,32 @@ pxstatus_t avar } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then bfd_cv_have_sys_procfs_type_pxstatus_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -bfd_cv_have_sys_procfs_type_pxstatus_t=no + bfd_cv_have_sys_procfs_type_pxstatus_t=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test $bfd_cv_have_sys_procfs_type_pxstatus_t = yes; then @@ -18207,11 +18634,11 @@ cat >>confdefs.h <<\_ACEOF _ACEOF fi - echo "$as_me:$LINENO: result: $bfd_cv_have_sys_procfs_type_pxstatus_t" >&5 -echo "${ECHO_T}$bfd_cv_have_sys_procfs_type_pxstatus_t" >&6 + { echo "$as_me:$LINENO: result: $bfd_cv_have_sys_procfs_type_pxstatus_t" >&5 +echo "${ECHO_T}$bfd_cv_have_sys_procfs_type_pxstatus_t" >&6; } - echo "$as_me:$LINENO: checking for pstatus32_t in sys/procfs.h" >&5 -echo $ECHO_N "checking for pstatus32_t in sys/procfs.h... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for pstatus32_t in sys/procfs.h" >&5 +echo $ECHO_N "checking for pstatus32_t in sys/procfs.h... $ECHO_C" >&6; } if test "${bfd_cv_have_sys_procfs_type_pstatus32_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -18233,36 +18660,32 @@ pstatus32_t avar } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then bfd_cv_have_sys_procfs_type_pstatus32_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -bfd_cv_have_sys_procfs_type_pstatus32_t=no + bfd_cv_have_sys_procfs_type_pstatus32_t=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test $bfd_cv_have_sys_procfs_type_pstatus32_t = yes; then @@ -18272,11 +18695,11 @@ cat >>confdefs.h <<\_ACEOF _ACEOF fi - echo "$as_me:$LINENO: result: $bfd_cv_have_sys_procfs_type_pstatus32_t" >&5 -echo "${ECHO_T}$bfd_cv_have_sys_procfs_type_pstatus32_t" >&6 + { echo "$as_me:$LINENO: result: $bfd_cv_have_sys_procfs_type_pstatus32_t" >&5 +echo "${ECHO_T}$bfd_cv_have_sys_procfs_type_pstatus32_t" >&6; } - echo "$as_me:$LINENO: checking for prpsinfo_t in sys/procfs.h" >&5 -echo $ECHO_N "checking for prpsinfo_t in sys/procfs.h... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for prpsinfo_t in sys/procfs.h" >&5 +echo $ECHO_N "checking for prpsinfo_t in sys/procfs.h... $ECHO_C" >&6; } if test "${bfd_cv_have_sys_procfs_type_prpsinfo_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -18298,36 +18721,32 @@ prpsinfo_t avar } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then bfd_cv_have_sys_procfs_type_prpsinfo_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -bfd_cv_have_sys_procfs_type_prpsinfo_t=no + bfd_cv_have_sys_procfs_type_prpsinfo_t=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test $bfd_cv_have_sys_procfs_type_prpsinfo_t = yes; then @@ -18337,11 +18756,11 @@ cat >>confdefs.h <<\_ACEOF _ACEOF fi - echo "$as_me:$LINENO: result: $bfd_cv_have_sys_procfs_type_prpsinfo_t" >&5 -echo "${ECHO_T}$bfd_cv_have_sys_procfs_type_prpsinfo_t" >&6 + { echo "$as_me:$LINENO: result: $bfd_cv_have_sys_procfs_type_prpsinfo_t" >&5 +echo "${ECHO_T}$bfd_cv_have_sys_procfs_type_prpsinfo_t" >&6; } - echo "$as_me:$LINENO: checking for prpsinfo32_t in sys/procfs.h" >&5 -echo $ECHO_N "checking for prpsinfo32_t in sys/procfs.h... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for prpsinfo32_t in sys/procfs.h" >&5 +echo $ECHO_N "checking for prpsinfo32_t in sys/procfs.h... $ECHO_C" >&6; } if test "${bfd_cv_have_sys_procfs_type_prpsinfo32_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -18363,36 +18782,32 @@ prpsinfo32_t avar } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then bfd_cv_have_sys_procfs_type_prpsinfo32_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -bfd_cv_have_sys_procfs_type_prpsinfo32_t=no + bfd_cv_have_sys_procfs_type_prpsinfo32_t=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test $bfd_cv_have_sys_procfs_type_prpsinfo32_t = yes; then @@ -18402,11 +18817,11 @@ cat >>confdefs.h <<\_ACEOF _ACEOF fi - echo "$as_me:$LINENO: result: $bfd_cv_have_sys_procfs_type_prpsinfo32_t" >&5 -echo "${ECHO_T}$bfd_cv_have_sys_procfs_type_prpsinfo32_t" >&6 + { echo "$as_me:$LINENO: result: $bfd_cv_have_sys_procfs_type_prpsinfo32_t" >&5 +echo "${ECHO_T}$bfd_cv_have_sys_procfs_type_prpsinfo32_t" >&6; } - echo "$as_me:$LINENO: checking for psinfo_t in sys/procfs.h" >&5 -echo $ECHO_N "checking for psinfo_t in sys/procfs.h... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for psinfo_t in sys/procfs.h" >&5 +echo $ECHO_N "checking for psinfo_t in sys/procfs.h... $ECHO_C" >&6; } if test "${bfd_cv_have_sys_procfs_type_psinfo_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -18428,36 +18843,32 @@ psinfo_t avar } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then bfd_cv_have_sys_procfs_type_psinfo_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -bfd_cv_have_sys_procfs_type_psinfo_t=no + bfd_cv_have_sys_procfs_type_psinfo_t=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test $bfd_cv_have_sys_procfs_type_psinfo_t = yes; then @@ -18467,11 +18878,11 @@ cat >>confdefs.h <<\_ACEOF _ACEOF fi - echo "$as_me:$LINENO: result: $bfd_cv_have_sys_procfs_type_psinfo_t" >&5 -echo "${ECHO_T}$bfd_cv_have_sys_procfs_type_psinfo_t" >&6 + { echo "$as_me:$LINENO: result: $bfd_cv_have_sys_procfs_type_psinfo_t" >&5 +echo "${ECHO_T}$bfd_cv_have_sys_procfs_type_psinfo_t" >&6; } - echo "$as_me:$LINENO: checking for psinfo32_t in sys/procfs.h" >&5 -echo $ECHO_N "checking for psinfo32_t in sys/procfs.h... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for psinfo32_t in sys/procfs.h" >&5 +echo $ECHO_N "checking for psinfo32_t in sys/procfs.h... $ECHO_C" >&6; } if test "${bfd_cv_have_sys_procfs_type_psinfo32_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -18493,36 +18904,32 @@ psinfo32_t avar } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then bfd_cv_have_sys_procfs_type_psinfo32_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -bfd_cv_have_sys_procfs_type_psinfo32_t=no + bfd_cv_have_sys_procfs_type_psinfo32_t=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test $bfd_cv_have_sys_procfs_type_psinfo32_t = yes; then @@ -18532,11 +18939,11 @@ cat >>confdefs.h <<\_ACEOF _ACEOF fi - echo "$as_me:$LINENO: result: $bfd_cv_have_sys_procfs_type_psinfo32_t" >&5 -echo "${ECHO_T}$bfd_cv_have_sys_procfs_type_psinfo32_t" >&6 + { echo "$as_me:$LINENO: result: $bfd_cv_have_sys_procfs_type_psinfo32_t" >&5 +echo "${ECHO_T}$bfd_cv_have_sys_procfs_type_psinfo32_t" >&6; } - echo "$as_me:$LINENO: checking for lwpstatus_t in sys/procfs.h" >&5 -echo $ECHO_N "checking for lwpstatus_t in sys/procfs.h... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for lwpstatus_t in sys/procfs.h" >&5 +echo $ECHO_N "checking for lwpstatus_t in sys/procfs.h... $ECHO_C" >&6; } if test "${bfd_cv_have_sys_procfs_type_lwpstatus_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -18558,36 +18965,32 @@ lwpstatus_t avar } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then bfd_cv_have_sys_procfs_type_lwpstatus_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -bfd_cv_have_sys_procfs_type_lwpstatus_t=no + bfd_cv_have_sys_procfs_type_lwpstatus_t=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test $bfd_cv_have_sys_procfs_type_lwpstatus_t = yes; then @@ -18597,11 +19000,11 @@ cat >>confdefs.h <<\_ACEOF _ACEOF fi - echo "$as_me:$LINENO: result: $bfd_cv_have_sys_procfs_type_lwpstatus_t" >&5 -echo "${ECHO_T}$bfd_cv_have_sys_procfs_type_lwpstatus_t" >&6 + { echo "$as_me:$LINENO: result: $bfd_cv_have_sys_procfs_type_lwpstatus_t" >&5 +echo "${ECHO_T}$bfd_cv_have_sys_procfs_type_lwpstatus_t" >&6; } - echo "$as_me:$LINENO: checking for lwpxstatus_t in sys/procfs.h" >&5 -echo $ECHO_N "checking for lwpxstatus_t in sys/procfs.h... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for lwpxstatus_t in sys/procfs.h" >&5 +echo $ECHO_N "checking for lwpxstatus_t in sys/procfs.h... $ECHO_C" >&6; } if test "${bfd_cv_have_sys_procfs_type_lwpxstatus_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -18623,36 +19026,32 @@ lwpxstatus_t avar } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then bfd_cv_have_sys_procfs_type_lwpxstatus_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -bfd_cv_have_sys_procfs_type_lwpxstatus_t=no + bfd_cv_have_sys_procfs_type_lwpxstatus_t=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test $bfd_cv_have_sys_procfs_type_lwpxstatus_t = yes; then @@ -18662,11 +19061,11 @@ cat >>confdefs.h <<\_ACEOF _ACEOF fi - echo "$as_me:$LINENO: result: $bfd_cv_have_sys_procfs_type_lwpxstatus_t" >&5 -echo "${ECHO_T}$bfd_cv_have_sys_procfs_type_lwpxstatus_t" >&6 + { echo "$as_me:$LINENO: result: $bfd_cv_have_sys_procfs_type_lwpxstatus_t" >&5 +echo "${ECHO_T}$bfd_cv_have_sys_procfs_type_lwpxstatus_t" >&6; } - echo "$as_me:$LINENO: checking for lwpstatus_t.pr_context in sys/procfs.h" >&5 -echo $ECHO_N "checking for lwpstatus_t.pr_context in sys/procfs.h... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for lwpstatus_t.pr_context in sys/procfs.h" >&5 +echo $ECHO_N "checking for lwpstatus_t.pr_context in sys/procfs.h... $ECHO_C" >&6; } if test "${bfd_cv_have_sys_procfs_type_member_lwpstatus_t_pr_context+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -18688,36 +19087,32 @@ lwpstatus_t avar; void* aref = (void*) &avar.pr_context } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then bfd_cv_have_sys_procfs_type_member_lwpstatus_t_pr_context=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -bfd_cv_have_sys_procfs_type_member_lwpstatus_t_pr_context=no + bfd_cv_have_sys_procfs_type_member_lwpstatus_t_pr_context=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test $bfd_cv_have_sys_procfs_type_member_lwpstatus_t_pr_context = yes; then @@ -18727,11 +19122,11 @@ cat >>confdefs.h <<\_ACEOF _ACEOF fi - echo "$as_me:$LINENO: result: $bfd_cv_have_sys_procfs_type_member_lwpstatus_t_pr_context" >&5 -echo "${ECHO_T}$bfd_cv_have_sys_procfs_type_member_lwpstatus_t_pr_context" >&6 + { echo "$as_me:$LINENO: result: $bfd_cv_have_sys_procfs_type_member_lwpstatus_t_pr_context" >&5 +echo "${ECHO_T}$bfd_cv_have_sys_procfs_type_member_lwpstatus_t_pr_context" >&6; } - echo "$as_me:$LINENO: checking for lwpstatus_t.pr_reg in sys/procfs.h" >&5 -echo $ECHO_N "checking for lwpstatus_t.pr_reg in sys/procfs.h... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for lwpstatus_t.pr_reg in sys/procfs.h" >&5 +echo $ECHO_N "checking for lwpstatus_t.pr_reg in sys/procfs.h... $ECHO_C" >&6; } if test "${bfd_cv_have_sys_procfs_type_member_lwpstatus_t_pr_reg+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -18753,36 +19148,32 @@ lwpstatus_t avar; void* aref = (void*) &avar.pr_reg } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then bfd_cv_have_sys_procfs_type_member_lwpstatus_t_pr_reg=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -bfd_cv_have_sys_procfs_type_member_lwpstatus_t_pr_reg=no + bfd_cv_have_sys_procfs_type_member_lwpstatus_t_pr_reg=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test $bfd_cv_have_sys_procfs_type_member_lwpstatus_t_pr_reg = yes; then @@ -18792,11 +19183,11 @@ cat >>confdefs.h <<\_ACEOF _ACEOF fi - echo "$as_me:$LINENO: result: $bfd_cv_have_sys_procfs_type_member_lwpstatus_t_pr_reg" >&5 -echo "${ECHO_T}$bfd_cv_have_sys_procfs_type_member_lwpstatus_t_pr_reg" >&6 + { echo "$as_me:$LINENO: result: $bfd_cv_have_sys_procfs_type_member_lwpstatus_t_pr_reg" >&5 +echo "${ECHO_T}$bfd_cv_have_sys_procfs_type_member_lwpstatus_t_pr_reg" >&6; } - echo "$as_me:$LINENO: checking for win32_pstatus_t in sys/procfs.h" >&5 -echo $ECHO_N "checking for win32_pstatus_t in sys/procfs.h... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for win32_pstatus_t in sys/procfs.h" >&5 +echo $ECHO_N "checking for win32_pstatus_t in sys/procfs.h... $ECHO_C" >&6; } if test "${bfd_cv_have_sys_procfs_type_win32_pstatus_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -18818,36 +19209,32 @@ win32_pstatus_t avar } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then bfd_cv_have_sys_procfs_type_win32_pstatus_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -bfd_cv_have_sys_procfs_type_win32_pstatus_t=no + bfd_cv_have_sys_procfs_type_win32_pstatus_t=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test $bfd_cv_have_sys_procfs_type_win32_pstatus_t = yes; then @@ -18857,8 +19244,8 @@ cat >>confdefs.h <<\_ACEOF _ACEOF fi - echo "$as_me:$LINENO: result: $bfd_cv_have_sys_procfs_type_win32_pstatus_t" >&5 -echo "${ECHO_T}$bfd_cv_have_sys_procfs_type_win32_pstatus_t" >&6 + { echo "$as_me:$LINENO: result: $bfd_cv_have_sys_procfs_type_win32_pstatus_t" >&5 +echo "${ECHO_T}$bfd_cv_have_sys_procfs_type_win32_pstatus_t" >&6; } fi fi @@ -19362,8 +19749,8 @@ echo "$as_me: WARNING: your compiler may not have a 64 bit integral type" >&2;} fi if test -n "$GCC" ; then bad_64bit_gcc=no; - echo "$as_me:$LINENO: checking for gcc version with buggy 64-bit support" >&5 -echo $ECHO_N "checking for gcc version with buggy 64-bit support... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for gcc version with buggy 64-bit support" >&5 +echo $ECHO_N "checking for gcc version with buggy 64-bit support... $ECHO_C" >&6; } # Add more tests for gcc versions with non-working 64-bit support here. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -19376,11 +19763,11 @@ _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP ": 2 : 91 : 1 :" >/dev/null 2>&1; then bad_64bit_gcc=yes; - echo "$as_me:$LINENO: result: yes: egcs-1.1.2 on ix86 spotted" >&5 -echo "${ECHO_T}yes: egcs-1.1.2 on ix86 spotted" >&6 + { echo "$as_me:$LINENO: result: yes: egcs-1.1.2 on ix86 spotted" >&5 +echo "${ECHO_T}yes: egcs-1.1.2 on ix86 spotted" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi rm -f conftest* @@ -19417,9 +19804,9 @@ esac for ac_func in ftello ftello64 fseeko fseeko64 fopen64 do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -19445,68 +19832,60 @@ cat >>conftest.$ac_ext <<_ACEOF #undef $ac_func -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" -{ #endif -/* 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 (); /* 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) +#if defined __stub_$ac_func || defined __stub___$ac_func choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} #endif int main () { -return f != $ac_func; +return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" + eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 @@ -19516,8 +19895,8 @@ fi done if test x"$ac_cv_func_ftello" = xyes -a x"$ac_cv_func_fseeko" = xyes; then - echo "$as_me:$LINENO: checking for off_t" >&5 -echo $ECHO_N "checking for off_t... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for off_t" >&5 +echo $ECHO_N "checking for off_t... $ECHO_C" >&6; } if test "${ac_cv_type_off_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -19528,61 +19907,57 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default +typedef off_t ac__type_new_; int main () { -if ((off_t *) 0) +if ((ac__type_new_ *) 0) return 0; -if (sizeof (off_t)) +if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_type_off_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_type_off_t=no + ac_cv_type_off_t=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_type_off_t" >&5 -echo "${ECHO_T}$ac_cv_type_off_t" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_type_off_t" >&5 +echo "${ECHO_T}$ac_cv_type_off_t" >&6; } -echo "$as_me:$LINENO: checking size of off_t" >&5 -echo $ECHO_N "checking size of off_t... $ECHO_C" >&6 +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ echo "$as_me:$LINENO: checking size of off_t" >&5 +echo $ECHO_N "checking size of off_t... $ECHO_C" >&6; } if test "${ac_cv_sizeof_off_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test "$ac_cv_type_off_t" = yes; then - # The cast to unsigned long works around a bug in the HP C Compiler - # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects - # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. - # This bug is HP SR number 8606223364. if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF @@ -19592,10 +19967,11 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef off_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (off_t))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; test_array [0] = 0 ; @@ -19603,27 +19979,22 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF @@ -19633,10 +20004,11 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef off_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (off_t))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; @@ -19644,56 +20016,53 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo=`expr $ac_mid + 1` - if test $ac_lo -le $ac_mid; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid + 1` + ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef off_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (off_t))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; test_array [0] = 0 ; @@ -19701,27 +20070,22 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF @@ -19731,10 +20095,11 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef off_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (off_t))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; test_array [0] = 0 ; @@ -19742,50 +20107,48 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_hi=`expr '(' $ac_mid ')' - 1` - if test $ac_mid -le $ac_hi; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid` + ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo= ac_hi= + ac_lo= ac_hi= fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` @@ -19796,10 +20159,11 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef off_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (off_t))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; @@ -19807,52 +20171,45 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo=`expr '(' $ac_mid ')' + 1` + ac_lo=`expr '(' $ac_mid ')' + 1` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_off_t=$ac_lo;; -'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (off_t), 77 +'') if test "$ac_cv_type_off_t" = yes; then + { { echo "$as_me:$LINENO: error: cannot compute sizeof (off_t) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (off_t), 77 +echo "$as_me: error: cannot compute sizeof (off_t) See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } ;; + { (exit 77); exit 77; }; } + else + ac_cv_sizeof_off_t=0 + fi ;; esac else - if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run test program while cross compiling -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -19860,8 +20217,9 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -long longval () { return (long) (sizeof (off_t)); } -unsigned long ulongval () { return (long) (sizeof (off_t)); } + typedef off_t ac__type_sizeof_; +static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } +static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } #include #include int @@ -19870,35 +20228,44 @@ main () FILE *f = fopen ("conftest.val", "w"); if (! f) - exit (1); - if (((long) (sizeof (off_t))) < 0) + return 1; + if (((long int) (sizeof (ac__type_sizeof_))) < 0) { - long i = longval (); - if (i != ((long) (sizeof (off_t)))) - exit (1); + long int i = longval (); + if (i != ((long int) (sizeof (ac__type_sizeof_)))) + return 1; fprintf (f, "%ld\n", i); } else { - unsigned long i = ulongval (); - if (i != ((long) (sizeof (off_t)))) - exit (1); + unsigned long int i = ulongval (); + if (i != ((long int) (sizeof (ac__type_sizeof_)))) + return 1; fprintf (f, "%lu\n", i); } - exit (ferror (f) || fclose (f) != 0); + return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -19909,30 +20276,33 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) -{ { echo "$as_me:$LINENO: error: cannot compute sizeof (off_t), 77 +if test "$ac_cv_type_off_t" = yes; then + { { echo "$as_me:$LINENO: error: cannot compute sizeof (off_t) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (off_t), 77 +echo "$as_me: error: cannot compute sizeof (off_t) See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext + { (exit 77); exit 77; }; } + else + ac_cv_sizeof_off_t=0 + fi fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val -else - ac_cv_sizeof_off_t=0 -fi fi -echo "$as_me:$LINENO: result: $ac_cv_sizeof_off_t" >&5 -echo "${ECHO_T}$ac_cv_sizeof_off_t" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_off_t" >&5 +echo "${ECHO_T}$ac_cv_sizeof_off_t" >&6; } + + + cat >>confdefs.h <<_ACEOF #define SIZEOF_OFF_T $ac_cv_sizeof_off_t _ACEOF fi -echo "$as_me:$LINENO: checking file_ptr type" >&5 -echo $ECHO_N "checking file_ptr type... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking file_ptr type" >&5 +echo $ECHO_N "checking file_ptr type... $ECHO_C" >&6; } bfd_file_ptr="long" bfd_ufile_ptr="unsigned long" if test x"$ac_cv_func_ftello64" = xyes -a x"$ac_cv_func_fseeko64" = xyes \ @@ -19940,8 +20310,8 @@ if test x"$ac_cv_func_ftello64" = xyes -a x"$ac_cv_func_fseeko64" = xyes \ bfd_file_ptr=BFD_HOST_64_BIT bfd_ufile_ptr=BFD_HOST_U_64_BIT fi -echo "$as_me:$LINENO: result: $bfd_file_ptr" >&5 -echo "${ECHO_T}$bfd_file_ptr" >&6 +{ echo "$as_me:$LINENO: result: $bfd_file_ptr" >&5 +echo "${ECHO_T}$bfd_file_ptr" >&6; } @@ -19959,18 +20329,19 @@ test -n "${havevecs}" && tdefaults="${tdefaults} ${havevecs}" for ac_header in stdlib.h unistd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? -echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -19981,41 +20352,37 @@ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_header_compiler=no + ac_header_compiler=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -20024,24 +20391,22 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 @@ -20049,9 +20414,10 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi + rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in @@ -20075,25 +20441,19 @@ echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\ echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------------ ## -## Report this to the AC_PACKAGE_NAME lists. ## -## ------------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 + ;; esac -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then @@ -20109,9 +20469,9 @@ done for ac_func in getpagesize do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -20137,68 +20497,60 @@ cat >>conftest.$ac_ext <<_ACEOF #undef $ac_func -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" -{ #endif -/* 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 (); /* 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) +#if defined __stub_$ac_func || defined __stub___$ac_func choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} #endif int main () { -return f != $ac_func; +return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" + eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 @@ -20207,8 +20559,8 @@ _ACEOF fi done -echo "$as_me:$LINENO: checking for working mmap" >&5 -echo $ECHO_N "checking for working mmap... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for working mmap" >&5 +echo $ECHO_N "checking for working mmap... $ECHO_C" >&6; } if test "${ac_cv_func_mmap_fixed_mapped+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -20250,21 +20602,21 @@ $ac_includes_default #include #include -#if !STDC_HEADERS && !HAVE_STDLIB_H +#if !defined STDC_HEADERS && !defined HAVE_STDLIB_H char *malloc (); #endif /* This mess was copied from the GNU getpagesize.h. */ -#if !HAVE_GETPAGESIZE +#ifndef HAVE_GETPAGESIZE /* Assume that all systems that can run configure have sys/param.h. */ -# if !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 */ -# if HAVE_SYS_PARAM_H +# ifdef HAVE_SYS_PARAM_H # include # ifdef EXEC_PAGESIZE # define getpagesize() EXEC_PAGESIZE @@ -20303,15 +20655,15 @@ main () /* First, make a file with some known garbage in it. */ data = (char *) malloc (pagesize); if (!data) - exit (1); + return 1; for (i = 0; i < pagesize; ++i) *(data + i) = rand (); umask (0); fd = creat ("conftest.mmap", 0600); if (fd < 0) - exit (1); + return 1; if (write (fd, data, pagesize) != pagesize) - exit (1); + return 1; close (fd); /* Next, try to mmap the file at a fixed address which already has @@ -20319,17 +20671,17 @@ main () we see the same garbage. */ fd = open ("conftest.mmap", O_RDWR); if (fd < 0) - exit (1); + return 1; data2 = (char *) malloc (2 * pagesize); if (!data2) - exit (1); - data2 += (pagesize - ((long) data2 & (pagesize - 1))) & (pagesize - 1); + return 1; + data2 += (pagesize - ((long int) data2 & (pagesize - 1))) & (pagesize - 1); if (data2 != mmap (data2, pagesize, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_FIXED, fd, 0L)) - exit (1); + return 1; for (i = 0; i < pagesize; ++i) if (*(data + i) != *(data2 + i)) - exit (1); + return 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 @@ -20338,24 +20690,33 @@ main () *(data2 + i) = *(data2 + i) + 1; data3 = (char *) malloc (pagesize); if (!data3) - exit (1); + return 1; if (read (fd, data3, pagesize) != pagesize) - exit (1); + return 1; for (i = 0; i < pagesize; ++i) if (*(data + i) != *(data3 + i)) - exit (1); + return 1; close (fd); - exit (0); + return 0; } _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -20368,11 +20729,13 @@ sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_func_mmap_fixed_mapped=no fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi + + fi -echo "$as_me:$LINENO: result: $ac_cv_func_mmap_fixed_mapped" >&5 -echo "${ECHO_T}$ac_cv_func_mmap_fixed_mapped" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_func_mmap_fixed_mapped" >&5 +echo "${ECHO_T}$ac_cv_func_mmap_fixed_mapped" >&6; } if test $ac_cv_func_mmap_fixed_mapped = yes; then cat >>confdefs.h <<\_ACEOF @@ -20387,9 +20750,9 @@ rm -f conftest.mmap for ac_func in madvise mprotect do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -20415,68 +20778,60 @@ cat >>conftest.$ac_ext <<_ACEOF #undef $ac_func -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" -{ #endif -/* 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 (); /* 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) +#if defined __stub_$ac_func || defined __stub___$ac_func choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} #endif int main () { -return f != $ac_func; +return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" + eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 @@ -20494,10 +20849,10 @@ _ACEOF esac rm -f doc/config.status - ac_config_files="$ac_config_files Makefile doc/Makefile bfd-in3.h:bfd-in2.h po/Makefile.in:po/Make-in" +ac_config_files="$ac_config_files Makefile doc/Makefile bfd-in3.h:bfd-in2.h po/Makefile.in:po/Make-in" - ac_config_commands="$ac_config_commands default" +ac_config_commands="$ac_config_commands default" @@ -20522,39 +20877,58 @@ _ACEOF # 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. +# So, we kill variables containing newlines. # 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. -{ +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 +echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + *) $as_unset $ac_var ;; + esac ;; + esac + done + (set) 2>&1 | - case `(ac_space=' '; set | grep ac_space) 2>&1` in - *ac_space=\ *) + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" - ;; + ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n \ - "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; - esac; -} | + esac | + sort +) | sed ' + /^ac_cv_env_/b end t clear - : clear + :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end - /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ - : end' >>confcache -if diff $cache_file confcache >/dev/null 2>&1; then :; else - if test -w $cache_file; then - test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + :end' >>confcache +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else + if test -w "$cache_file"; then + test "x$cache_file" != "x/dev/null" && + { echo "$as_me:$LINENO: updating cache $cache_file" >&5 +echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else - echo "not updating unwritable cache $cache_file" + { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 +echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache @@ -20563,32 +20937,18 @@ test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' -# VPATH may cause trouble with some makes, so we remove $(srcdir), -# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and -# trailing colons and then remove the whole line if VPATH becomes empty -# (actually we leave an empty line to preserve line numbers). -if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=/{ -s/:*\$(srcdir):*/:/; -s/:*\${srcdir}:*/:/; -s/:*@srcdir@:*/:/; -s/^\([^=]*=[ ]*\):*/\1/; -s/:*$//; -s/^[^=]*=[ ]*$//; -}' -fi - DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. - ac_i=`echo "$ac_i" | - sed 's/\$U\././;s/\.o$//;s/\.obj$//'` - # 2. Add them. - ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" - ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`echo "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" + ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs @@ -20654,17 +21014,45 @@ cat >>$CONFIG_STATUS <<\_ACEOF ## M4sh Initialization. ## ## --------------------- ## -# Be Bourne compatible +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' -elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then - set -o posix + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi + + + + +# PATH needs CR +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh fi -DUALCASE=1; export DUALCASE # for MKS sh # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then @@ -20674,8 +21062,43 @@ else fi +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +as_nl=' +' +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + { (exit 1); exit 1; } +fi + # Work around bugs in pre-3.0 UWIN ksh. -$as_unset ENV MAIL MAILPATH +for as_var in ENV MAIL MAILPATH +do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var +done PS1='$ ' PS2='> ' PS4='+ ' @@ -20689,18 +21112,19 @@ do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else - $as_unset $as_var + ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. -if expr a : '\(a\)' >/dev/null 2>&1; then +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi -if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false @@ -20708,159 +21132,120 @@ fi # Name of the executable. -as_me=`$as_basename "$0" || +as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)$' \| \ - . : '\(.\)' 2>/dev/null || + X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } - /^X\/\(\/\/\)$/{ s//\1/; q; } - /^X\/\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - - -# PATH needs CR, and LINENO needs CR and PATH. -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh -fi +# CDPATH. +$as_unset CDPATH - as_lineno_1=$LINENO - as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" || { - # Find who we are. Look in the path if we contain no path at all - # relative or not. - case $0 in - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break -done - ;; - esac - # We did not find ourselves, most probably we were run as `sh COMMAND' - # in which case we are not to be found in the path. - if test "x$as_myself" = x; then - as_myself=$0 - fi - if test ! -f "$as_myself"; then - { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 -echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} - { (exit 1); exit 1; }; } - fi - case $CONFIG_SHELL in - '') - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for as_base in sh bash ksh sh5; do - case $as_dir in - /*) - if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then - $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } - $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } - CONFIG_SHELL=$as_dir/$as_base - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$0" ${1+"$@"} - fi;; - esac - done -done -;; - esac + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line before each line; the second 'sed' does the real - # work. The second script uses 'N' to pair each line-number line - # with the numbered line, and appends trailing '-' during - # substitution so that $LINENO is not a special case at line end. + # line-number line after each line using $LINENO; the second 'sed' + # does the real work. The second script uses 'N' to pair each + # line-number line with the line containing $LINENO, and appends + # trailing '-' during substitution so that $LINENO is not a special + # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) - sed '=' <$as_myself | + # scripts with optimization help from Paolo Bonzini. Blame Lee + # E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno N - s,$,-, - : loop - s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop - s,-$,, - s,^['$as_cr_digits']*\n,, + s/-\n.*// ' >$as_me.lineno && - chmod +x $as_me.lineno || - { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 -echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} + chmod +x "$as_me.lineno" || + { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensible to this). - . ./$as_me.lineno + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" # Exit status is that of the last command. exit } -case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in - *c*,-n*) ECHO_N= ECHO_C=' -' ECHO_T=' ' ;; - *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; - *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in +-n*) + case `echo 'x\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + *) ECHO_C='\c';; + esac;; +*) + ECHO_N='-n';; esac -if expr a : '\(a\)' >/dev/null 2>&1; then +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir +fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then - # We could just check for DJGPP; but this test a) works b) is more generic - # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). - if test -f conf$$.exe; then - # Don't use ln at all; we don't have any links + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' - else - as_ln_s='ln -s' - fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi -rm -f conf$$ conf$$.exe conf$$.file +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p=: @@ -20869,7 +21254,28 @@ else as_mkdir_p=false fi -as_executable_p="test -f" +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' +else + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +fi +as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" @@ -20878,31 +21284,14 @@ as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" -# IFS -# We need space, tab and new line, in precisely that order. -as_nl=' -' -IFS=" $as_nl" - -# CDPATH. -$as_unset CDPATH - exec 6>&1 -# Open the log real soon, to keep \$[0] and so on meaningful, and to +# Save the log message, to keep $[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their -# values after options handling. Logging --version etc. is OK. -exec 5>>config.log -{ - echo - sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX -## Running $as_me. ## -_ASBOX -} >&5 -cat >&5 <<_CSEOF - +# values after options handling. +ac_log=" This file was extended by $as_me, which was -generated by GNU Autoconf 2.59. Invocation command line was +generated by GNU Autoconf 2.61. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -20910,30 +21299,20 @@ generated by GNU Autoconf 2.59. Invocation command line was CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ -_CSEOF -echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 -echo >&5 +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + _ACEOF +cat >>$CONFIG_STATUS <<_ACEOF # Files that config.status was made for. -if test -n "$ac_config_files"; then - echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS -fi - -if test -n "$ac_config_headers"; then - echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS -fi - -if test -n "$ac_config_links"; then - echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS -fi +config_files="$ac_config_files" +config_headers="$ac_config_headers" +config_commands="$ac_config_commands" -if test -n "$ac_config_commands"; then - echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS -fi +_ACEOF cat >>$CONFIG_STATUS <<\_ACEOF - ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. @@ -20941,7 +21320,7 @@ current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit - -V, --version print version number, then exit + -V, --version print version number and configuration settings, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions @@ -20960,19 +21339,21 @@ Configuration commands: $config_commands Report bugs to ." -_ACEOF +_ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ config.status -configured by $0, generated by GNU Autoconf 2.59, - with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" +configured by $0, generated by GNU Autoconf 2.61, + with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" -Copyright (C) 2003 Free Software Foundation, Inc. +Copyright (C) 2006 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." -srcdir=$srcdir -INSTALL="$INSTALL" + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +INSTALL='$INSTALL' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF @@ -20983,39 +21364,24 @@ while test $# != 0 do case $1 in --*=*) - ac_option=`expr "x$1" : 'x\([^=]*\)='` - ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; - -*) + *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; - *) # This is not an option, so the user has probably given explicit - # arguments. - ac_option=$1 - ac_need_defaults=false;; esac case $ac_option in # Handling of the options. -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; - --version | --vers* | -V ) - echo "$ac_cs_version"; exit 0 ;; - --he | --h) - # Conflict between --help and --header - { { echo "$as_me:$LINENO: error: ambiguous option: $1 -Try \`$0 --help' for more information." >&5 -echo "$as_me: error: ambiguous option: $1 -Try \`$0 --help' for more information." >&2;} - { (exit 1); exit 1; }; };; - --help | --hel | -h ) - echo "$ac_cs_usage"; exit 0 ;; - --debug | --d* | -d ) + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + echo "$ac_cs_version"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift @@ -21025,18 +21391,24 @@ Try \`$0 --help' for more information." >&2;} $ac_shift CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" ac_need_defaults=false;; + --he | --h) + # Conflict between --help and --header + { echo "$as_me: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&2 + { (exit 1); exit 1; }; };; + --help | --hel | -h ) + echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. - -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 -Try \`$0 --help' for more information." >&5 -echo "$as_me: error: unrecognized option: $1 -Try \`$0 --help' for more information." >&2;} + -*) { echo "$as_me: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; - *) ac_config_targets="$ac_config_targets $1" ;; + *) ac_config_targets="$ac_config_targets $1" + ac_need_defaults=false ;; esac shift @@ -21052,17 +21424,28 @@ fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF if \$ac_cs_recheck; then - echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 - exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 + CONFIG_SHELL=$SHELL + export CONFIG_SHELL + exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX + echo "$ac_log" +} >&5 +_ACEOF cat >>$CONFIG_STATUS <<_ACEOF # -# INIT-COMMANDS section. +# INIT-COMMANDS # - AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" @@ -21334,29 +21717,30 @@ ac_cv_sizeof_void_p="$ac_cv_sizeof_void_p" _ACEOF - - cat >>$CONFIG_STATUS <<\_ACEOF + +# Handling of arguments. for ac_config_target in $ac_config_targets do - case "$ac_config_target" in - # Handling of arguments. - "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; - "doc/Makefile" ) CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; - "bfd-in3.h" ) CONFIG_FILES="$CONFIG_FILES bfd-in3.h:bfd-in2.h" ;; - "po/Makefile.in" ) CONFIG_FILES="$CONFIG_FILES po/Makefile.in:po/Make-in" ;; - "depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; - "libtool" ) CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; - "default-1" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default-1" ;; - "bfd_stdint.h" ) CONFIG_COMMANDS="$CONFIG_COMMANDS bfd_stdint.h" ;; - "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;; - "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h:config.in" ;; + case $ac_config_target in + "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; + "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h:config.in" ;; + "default-1") CONFIG_COMMANDS="$CONFIG_COMMANDS default-1" ;; + "bfd_stdint.h") CONFIG_COMMANDS="$CONFIG_COMMANDS bfd_stdint.h" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; + "bfd-in3.h") CONFIG_FILES="$CONFIG_FILES bfd-in3.h:bfd-in2.h" ;; + "po/Makefile.in") CONFIG_FILES="$CONFIG_FILES po/Makefile.in:po/Make-in" ;; + "default") CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;; + *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done + # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely @@ -21368,410 +21752,512 @@ if $ac_need_defaults; then fi # Have a temporary directory for convenience. Make it in the build tree -# simply because there is no reason to put it here, and in addition, +# simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. -# Create a temporary directory, and hook for its removal unless debugging. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. $debug || { - trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 + tmp= + trap 'exit_status=$? + { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status +' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } - # Create a (secure) tmp directory for tmp files. { - tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { - tmp=./confstat$$-$RANDOM - (umask 077 && mkdir $tmp) + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } -_ACEOF - -cat >>$CONFIG_STATUS <<_ACEOF - # -# CONFIG_FILES section. +# Set up the sed scripts for CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h -if test -n "\$CONFIG_FILES"; then - # Protect against being on the right side of a sed subst in config.status. - sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; - s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF -s,@SHELL@,$SHELL,;t t -s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t -s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t -s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t -s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t -s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t -s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t -s,@exec_prefix@,$exec_prefix,;t t -s,@prefix@,$prefix,;t t -s,@program_transform_name@,$program_transform_name,;t t -s,@bindir@,$bindir,;t t -s,@sbindir@,$sbindir,;t t -s,@libexecdir@,$libexecdir,;t t -s,@datadir@,$datadir,;t t -s,@sysconfdir@,$sysconfdir,;t t -s,@sharedstatedir@,$sharedstatedir,;t t -s,@localstatedir@,$localstatedir,;t t -s,@libdir@,$libdir,;t t -s,@includedir@,$includedir,;t t -s,@oldincludedir@,$oldincludedir,;t t -s,@infodir@,$infodir,;t t -s,@mandir@,$mandir,;t t -s,@build_alias@,$build_alias,;t t -s,@host_alias@,$host_alias,;t t -s,@target_alias@,$target_alias,;t t -s,@DEFS@,$DEFS,;t t -s,@ECHO_C@,$ECHO_C,;t t -s,@ECHO_N@,$ECHO_N,;t t -s,@ECHO_T@,$ECHO_T,;t t -s,@LIBS@,$LIBS,;t t -s,@build@,$build,;t t -s,@build_cpu@,$build_cpu,;t t -s,@build_vendor@,$build_vendor,;t t -s,@build_os@,$build_os,;t t -s,@host@,$host,;t t -s,@host_cpu@,$host_cpu,;t t -s,@host_vendor@,$host_vendor,;t t -s,@host_os@,$host_os,;t t -s,@target@,$target,;t t -s,@target_cpu@,$target_cpu,;t t -s,@target_vendor@,$target_vendor,;t t -s,@target_os@,$target_os,;t t -s,@CC@,$CC,;t t -s,@CFLAGS@,$CFLAGS,;t t -s,@LDFLAGS@,$LDFLAGS,;t t -s,@CPPFLAGS@,$CPPFLAGS,;t t -s,@ac_ct_CC@,$ac_ct_CC,;t t -s,@EXEEXT@,$EXEEXT,;t t -s,@OBJEXT@,$OBJEXT,;t t -s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t -s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t -s,@INSTALL_DATA@,$INSTALL_DATA,;t t -s,@CYGPATH_W@,$CYGPATH_W,;t t -s,@PACKAGE@,$PACKAGE,;t t -s,@VERSION@,$VERSION,;t t -s,@ACLOCAL@,$ACLOCAL,;t t -s,@AUTOCONF@,$AUTOCONF,;t t -s,@AUTOMAKE@,$AUTOMAKE,;t t -s,@AUTOHEADER@,$AUTOHEADER,;t t -s,@MAKEINFO@,$MAKEINFO,;t t -s,@install_sh@,$install_sh,;t t -s,@STRIP@,$STRIP,;t t -s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t -s,@INSTALL_STRIP_PROGRAM@,$INSTALL_STRIP_PROGRAM,;t t -s,@mkdir_p@,$mkdir_p,;t t -s,@AWK@,$AWK,;t t -s,@SET_MAKE@,$SET_MAKE,;t t -s,@am__leading_dot@,$am__leading_dot,;t t -s,@AMTAR@,$AMTAR,;t t -s,@am__tar@,$am__tar,;t t -s,@am__untar@,$am__untar,;t t -s,@DEPDIR@,$DEPDIR,;t t -s,@am__include@,$am__include,;t t -s,@am__quote@,$am__quote,;t t -s,@AMDEP_TRUE@,$AMDEP_TRUE,;t t -s,@AMDEP_FALSE@,$AMDEP_FALSE,;t t -s,@AMDEPBACKSLASH@,$AMDEPBACKSLASH,;t t -s,@CCDEPMODE@,$CCDEPMODE,;t t -s,@am__fastdepCC_TRUE@,$am__fastdepCC_TRUE,;t t -s,@am__fastdepCC_FALSE@,$am__fastdepCC_FALSE,;t t -s,@AR@,$AR,;t t -s,@ac_ct_AR@,$ac_ct_AR,;t t -s,@RANLIB@,$RANLIB,;t t -s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t -s,@LIBTOOL@,$LIBTOOL,;t t -s,@SED@,$SED,;t t -s,@EGREP@,$EGREP,;t t -s,@FGREP@,$FGREP,;t t -s,@GREP@,$GREP,;t t -s,@LD@,$LD,;t t -s,@DUMPBIN@,$DUMPBIN,;t t -s,@ac_ct_DUMPBIN@,$ac_ct_DUMPBIN,;t t -s,@NM@,$NM,;t t -s,@LN_S@,$LN_S,;t t -s,@lt_ECHO@,$lt_ECHO,;t t -s,@CPP@,$CPP,;t t -s,@DEBUGDIR@,$DEBUGDIR,;t t -s,@PKGVERSION@,$PKGVERSION,;t t -s,@REPORT_BUGS_TO@,$REPORT_BUGS_TO,;t t -s,@REPORT_BUGS_TEXI@,$REPORT_BUGS_TEXI,;t t -s,@WARN_CFLAGS@,$WARN_CFLAGS,;t t -s,@NO_WERROR@,$NO_WERROR,;t t -s,@MAINTAINER_MODE_TRUE@,$MAINTAINER_MODE_TRUE,;t t -s,@MAINTAINER_MODE_FALSE@,$MAINTAINER_MODE_FALSE,;t t -s,@MAINT@,$MAINT,;t t -s,@GENINSRC_NEVER_TRUE@,$GENINSRC_NEVER_TRUE,;t t -s,@GENINSRC_NEVER_FALSE@,$GENINSRC_NEVER_FALSE,;t t -s,@INSTALL_LIBBFD_TRUE@,$INSTALL_LIBBFD_TRUE,;t t -s,@INSTALL_LIBBFD_FALSE@,$INSTALL_LIBBFD_FALSE,;t t -s,@host_noncanonical@,$host_noncanonical,;t t -s,@target_noncanonical@,$target_noncanonical,;t t -s,@bfdlibdir@,$bfdlibdir,;t t -s,@bfdincludedir@,$bfdincludedir,;t t -s,@USE_NLS@,$USE_NLS,;t t -s,@LIBINTL@,$LIBINTL,;t t -s,@LIBINTL_DEP@,$LIBINTL_DEP,;t t -s,@INCINTL@,$INCINTL,;t t -s,@XGETTEXT@,$XGETTEXT,;t t -s,@GMSGFMT@,$GMSGFMT,;t t -s,@POSUB@,$POSUB,;t t -s,@CATALOGS@,$CATALOGS,;t t -s,@DATADIRNAME@,$DATADIRNAME,;t t -s,@INSTOBJEXT@,$INSTOBJEXT,;t t -s,@GENCAT@,$GENCAT,;t t -s,@CATOBJEXT@,$CATOBJEXT,;t t -s,@MKINSTALLDIRS@,$MKINSTALLDIRS,;t t -s,@MSGFMT@,$MSGFMT,;t t -s,@MSGMERGE@,$MSGMERGE,;t t -s,@HDEFINES@,$HDEFINES,;t t -s,@BFD_HOST_64BIT_LONG@,$BFD_HOST_64BIT_LONG,;t t -s,@BFD_HOST_64BIT_LONG_LONG@,$BFD_HOST_64BIT_LONG_LONG,;t t -s,@BFD_HOST_64_BIT_DEFINED@,$BFD_HOST_64_BIT_DEFINED,;t t -s,@BFD_HOST_64_BIT@,$BFD_HOST_64_BIT,;t t -s,@BFD_HOST_U_64_BIT@,$BFD_HOST_U_64_BIT,;t t -s,@BFD_HOSTPTR_T@,$BFD_HOSTPTR_T,;t t -s,@CC_FOR_BUILD@,$CC_FOR_BUILD,;t t -s,@EXEEXT_FOR_BUILD@,$EXEEXT_FOR_BUILD,;t t -s,@COREFILE@,$COREFILE,;t t -s,@COREFLAG@,$COREFLAG,;t t -s,@WIN32LDFLAGS@,$WIN32LDFLAGS,;t t -s,@WIN32LIBADD@,$WIN32LIBADD,;t t -s,@TDEFINES@,$TDEFINES,;t t -s,@wordsize@,$wordsize,;t t -s,@bfd64_libs@,$bfd64_libs,;t t -s,@all_backends@,$all_backends,;t t -s,@bfd_backends@,$bfd_backends,;t t -s,@bfd_machines@,$bfd_machines,;t t -s,@bfd_default_target_size@,$bfd_default_target_size,;t t -s,@bfd_file_ptr@,$bfd_file_ptr,;t t -s,@bfd_ufile_ptr@,$bfd_ufile_ptr,;t t -s,@tdefaults@,$tdefaults,;t t -s,@datarootdir@,$datarootdir,;t t -s,@docdir@,$docdir,;t t -s,@htmldir@,$htmldir,;t t -s,@LIBOBJS@,$LIBOBJS,;t t -s,@LTLIBOBJS@,$LTLIBOBJS,;t t -CEOF - -_ACEOF - - cat >>$CONFIG_STATUS <<\_ACEOF - # 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_lines=48 - ac_sed_frag=1 # Number of current file. - ac_beg=1 # First line for current file. - ac_end=$ac_max_sed_lines # 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" $tmp/subs.sed >$tmp/subs.frag - else - sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag - fi - if test ! -s $tmp/subs.frag; then - ac_more_lines=false - else - # The purpose of the label and of the branching condition is to - # speed up the sed processing (if there are no `@' at all, there - # is no need to browse any of the substitutions). - # These are the two extra sed commands mentioned above. - (echo ':t - /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed - if test -z "$ac_sed_cmds"; then - ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" - else - ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" - fi - ac_sed_frag=`expr $ac_sed_frag + 1` - ac_beg=$ac_end - ac_end=`expr $ac_end + $ac_max_sed_lines` - fi - done - if test -z "$ac_sed_cmds"; then - ac_sed_cmds=cat +if test -n "$CONFIG_FILES"; then + +_ACEOF + + + +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + cat >conf$$subs.sed <<_ACEOF +SHELL!$SHELL$ac_delim +PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim +PACKAGE_NAME!$PACKAGE_NAME$ac_delim +PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim +PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim +PACKAGE_STRING!$PACKAGE_STRING$ac_delim +PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim +exec_prefix!$exec_prefix$ac_delim +prefix!$prefix$ac_delim +program_transform_name!$program_transform_name$ac_delim +bindir!$bindir$ac_delim +sbindir!$sbindir$ac_delim +libexecdir!$libexecdir$ac_delim +datarootdir!$datarootdir$ac_delim +datadir!$datadir$ac_delim +sysconfdir!$sysconfdir$ac_delim +sharedstatedir!$sharedstatedir$ac_delim +localstatedir!$localstatedir$ac_delim +includedir!$includedir$ac_delim +oldincludedir!$oldincludedir$ac_delim +docdir!$docdir$ac_delim +infodir!$infodir$ac_delim +htmldir!$htmldir$ac_delim +dvidir!$dvidir$ac_delim +pdfdir!$pdfdir$ac_delim +psdir!$psdir$ac_delim +libdir!$libdir$ac_delim +localedir!$localedir$ac_delim +mandir!$mandir$ac_delim +DEFS!$DEFS$ac_delim +ECHO_C!$ECHO_C$ac_delim +ECHO_N!$ECHO_N$ac_delim +ECHO_T!$ECHO_T$ac_delim +LIBS!$LIBS$ac_delim +build_alias!$build_alias$ac_delim +host_alias!$host_alias$ac_delim +target_alias!$target_alias$ac_delim +build!$build$ac_delim +build_cpu!$build_cpu$ac_delim +build_vendor!$build_vendor$ac_delim +build_os!$build_os$ac_delim +host!$host$ac_delim +host_cpu!$host_cpu$ac_delim +host_vendor!$host_vendor$ac_delim +host_os!$host_os$ac_delim +target!$target$ac_delim +target_cpu!$target_cpu$ac_delim +target_vendor!$target_vendor$ac_delim +target_os!$target_os$ac_delim +CC!$CC$ac_delim +CFLAGS!$CFLAGS$ac_delim +LDFLAGS!$LDFLAGS$ac_delim +CPPFLAGS!$CPPFLAGS$ac_delim +ac_ct_CC!$ac_ct_CC$ac_delim +EXEEXT!$EXEEXT$ac_delim +OBJEXT!$OBJEXT$ac_delim +INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim +INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim +INSTALL_DATA!$INSTALL_DATA$ac_delim +CYGPATH_W!$CYGPATH_W$ac_delim +PACKAGE!$PACKAGE$ac_delim +VERSION!$VERSION$ac_delim +ACLOCAL!$ACLOCAL$ac_delim +AUTOCONF!$AUTOCONF$ac_delim +AUTOMAKE!$AUTOMAKE$ac_delim +AUTOHEADER!$AUTOHEADER$ac_delim +MAKEINFO!$MAKEINFO$ac_delim +install_sh!$install_sh$ac_delim +STRIP!$STRIP$ac_delim +INSTALL_STRIP_PROGRAM!$INSTALL_STRIP_PROGRAM$ac_delim +mkdir_p!$mkdir_p$ac_delim +AWK!$AWK$ac_delim +SET_MAKE!$SET_MAKE$ac_delim +am__leading_dot!$am__leading_dot$ac_delim +AMTAR!$AMTAR$ac_delim +am__tar!$am__tar$ac_delim +am__untar!$am__untar$ac_delim +DEPDIR!$DEPDIR$ac_delim +am__include!$am__include$ac_delim +am__quote!$am__quote$ac_delim +AMDEP_TRUE!$AMDEP_TRUE$ac_delim +AMDEP_FALSE!$AMDEP_FALSE$ac_delim +AMDEPBACKSLASH!$AMDEPBACKSLASH$ac_delim +CCDEPMODE!$CCDEPMODE$ac_delim +am__fastdepCC_TRUE!$am__fastdepCC_TRUE$ac_delim +am__fastdepCC_FALSE!$am__fastdepCC_FALSE$ac_delim +AR!$AR$ac_delim +RANLIB!$RANLIB$ac_delim +LIBTOOL!$LIBTOOL$ac_delim +SED!$SED$ac_delim +GREP!$GREP$ac_delim +EGREP!$EGREP$ac_delim +FGREP!$FGREP$ac_delim +LD!$LD$ac_delim +DUMPBIN!$DUMPBIN$ac_delim +ac_ct_DUMPBIN!$ac_ct_DUMPBIN$ac_delim +NM!$NM$ac_delim +_ACEOF + + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then + break + elif $ac_last_try; then + { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi -fi # test -n "$CONFIG_FILES" +done + +ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` +if test -n "$ac_eof"; then + ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` + ac_eof=`expr $ac_eof + 1` +fi + +cat >>$CONFIG_STATUS <<_ACEOF +cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +_ACEOF +sed ' +s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g +s/^/s,@/; s/!/@,|#_!!_#|/ +:n +t n +s/'"$ac_delim"'$/,g/; t +s/$/\\/; p +N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n +' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF +CEOF$ac_eof +_ACEOF + + +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + cat >conf$$subs.sed <<_ACEOF +LN_S!$LN_S$ac_delim +lt_ECHO!$lt_ECHO$ac_delim +CPP!$CPP$ac_delim +DEBUGDIR!$DEBUGDIR$ac_delim +PKGVERSION!$PKGVERSION$ac_delim +REPORT_BUGS_TO!$REPORT_BUGS_TO$ac_delim +REPORT_BUGS_TEXI!$REPORT_BUGS_TEXI$ac_delim +WARN_CFLAGS!$WARN_CFLAGS$ac_delim +NO_WERROR!$NO_WERROR$ac_delim +MAINTAINER_MODE_TRUE!$MAINTAINER_MODE_TRUE$ac_delim +MAINTAINER_MODE_FALSE!$MAINTAINER_MODE_FALSE$ac_delim +MAINT!$MAINT$ac_delim +GENINSRC_NEVER_TRUE!$GENINSRC_NEVER_TRUE$ac_delim +GENINSRC_NEVER_FALSE!$GENINSRC_NEVER_FALSE$ac_delim +INSTALL_LIBBFD_TRUE!$INSTALL_LIBBFD_TRUE$ac_delim +INSTALL_LIBBFD_FALSE!$INSTALL_LIBBFD_FALSE$ac_delim +host_noncanonical!$host_noncanonical$ac_delim +target_noncanonical!$target_noncanonical$ac_delim +bfdlibdir!$bfdlibdir$ac_delim +bfdincludedir!$bfdincludedir$ac_delim +USE_NLS!$USE_NLS$ac_delim +LIBINTL!$LIBINTL$ac_delim +LIBINTL_DEP!$LIBINTL_DEP$ac_delim +INCINTL!$INCINTL$ac_delim +XGETTEXT!$XGETTEXT$ac_delim +GMSGFMT!$GMSGFMT$ac_delim +POSUB!$POSUB$ac_delim +CATALOGS!$CATALOGS$ac_delim +DATADIRNAME!$DATADIRNAME$ac_delim +INSTOBJEXT!$INSTOBJEXT$ac_delim +GENCAT!$GENCAT$ac_delim +CATOBJEXT!$CATOBJEXT$ac_delim +MKINSTALLDIRS!$MKINSTALLDIRS$ac_delim +MSGFMT!$MSGFMT$ac_delim +MSGMERGE!$MSGMERGE$ac_delim +HDEFINES!$HDEFINES$ac_delim +BFD_HOST_64BIT_LONG!$BFD_HOST_64BIT_LONG$ac_delim +BFD_HOST_64BIT_LONG_LONG!$BFD_HOST_64BIT_LONG_LONG$ac_delim +BFD_HOST_64_BIT_DEFINED!$BFD_HOST_64_BIT_DEFINED$ac_delim +BFD_HOST_64_BIT!$BFD_HOST_64_BIT$ac_delim +BFD_HOST_U_64_BIT!$BFD_HOST_U_64_BIT$ac_delim +BFD_HOSTPTR_T!$BFD_HOSTPTR_T$ac_delim +CC_FOR_BUILD!$CC_FOR_BUILD$ac_delim +EXEEXT_FOR_BUILD!$EXEEXT_FOR_BUILD$ac_delim +COREFILE!$COREFILE$ac_delim +COREFLAG!$COREFLAG$ac_delim +WIN32LDFLAGS!$WIN32LDFLAGS$ac_delim +WIN32LIBADD!$WIN32LIBADD$ac_delim +TDEFINES!$TDEFINES$ac_delim +wordsize!$wordsize$ac_delim +bfd64_libs!$bfd64_libs$ac_delim +all_backends!$all_backends$ac_delim +bfd_backends!$bfd_backends$ac_delim +bfd_machines!$bfd_machines$ac_delim +bfd_default_target_size!$bfd_default_target_size$ac_delim +bfd_file_ptr!$bfd_file_ptr$ac_delim +bfd_ufile_ptr!$bfd_ufile_ptr$ac_delim +tdefaults!$tdefaults$ac_delim +LIBOBJS!$LIBOBJS$ac_delim +LTLIBOBJS!$LTLIBOBJS$ac_delim +_ACEOF + + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 60; then + break + elif $ac_last_try; then + { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done + +ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` +if test -n "$ac_eof"; then + ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` + ac_eof=`expr $ac_eof + 1` +fi +cat >>$CONFIG_STATUS <<_ACEOF +cat >"\$tmp/subs-2.sed" <<\CEOF$ac_eof +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end +_ACEOF +sed ' +s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g +s/^/s,@/; s/!/@,|#_!!_#|/ +:n +t n +s/'"$ac_delim"'$/,g/; t +s/$/\\/; p +N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n +' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF +:end +s/|#_!!_#|//g +CEOF$ac_eof _ACEOF + + +# VPATH may cause trouble with some makes, so we remove $(srcdir), +# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=/{ +s/:*\$(srcdir):*/:/ +s/:*\${srcdir}:*/:/ +s/:*@srcdir@:*/:/ +s/^\([^=]*=[ ]*\):*/\1/ +s/:*$// +s/^[^=]*=[ ]*$// +}' +fi + cat >>$CONFIG_STATUS <<\_ACEOF -for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue - # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". - case $ac_file in - - | *:- | *:-:* ) # input from stdin - cat >$tmp/stdin - ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - * ) ac_file_in=$ac_file.in ;; +fi # test -n "$CONFIG_FILES" + + +for ac_tag in :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 +echo "$as_me: error: Invalid tag $ac_tag." >&2;} + { (exit 1); exit 1; }; };; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 +echo "$as_me: error: cannot find input file: $ac_f" >&2;} + { (exit 1); exit 1; }; };; + esac + ac_file_inputs="$ac_file_inputs $ac_f" + done + + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input="Generated from "`IFS=: + echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + fi + + case $ac_tag in + *:-:* | *:-) cat >"$tmp/stdin";; + esac + ;; esac - # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. - ac_dir=`(dirname "$ac_file") 2>/dev/null || + ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ - X"$ac_file" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || echo X"$ac_file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - { if $as_mkdir_p; then - mkdir -p "$ac_dir" - else - as_dir="$ac_dir" + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + { as_dir="$ac_dir" + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= - while test ! -d "$as_dir"; do - as_dirs="$as_dir $as_dirs" - as_dir=`(dirname "$as_dir") 2>/dev/null || + while :; do + case $as_dir in #( + *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break done - test ! -n "$as_dirs" || mkdir $as_dirs - fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 -echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 +echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } - ac_builddir=. -if test "$ac_dir" != .; then +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A "../" for each directory in $ac_dir_suffix. - ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` -else - ac_dir_suffix= ac_top_builddir= -fi + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix case $srcdir in - .) # No --srcdir option. We are building in place. + .) # We are building in place. ac_srcdir=. - if test -z "$ac_top_builddir"; then - ac_top_srcdir=. - else - ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` - fi ;; - [\\/]* | ?:[\\/]* ) # Absolute path. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir ;; - *) # Relative path. - ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_builddir$srcdir ;; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix -# Do not use `cd foo && pwd` to compute absolute paths, because -# the directories may not exist. -case `pwd` in -.) ac_abs_builddir="$ac_dir";; -*) - case "$ac_dir" in - .) ac_abs_builddir=`pwd`;; - [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; - *) ac_abs_builddir=`pwd`/"$ac_dir";; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_builddir=${ac_top_builddir}.;; -*) - case ${ac_top_builddir}. in - .) ac_abs_top_builddir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; - *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_srcdir=$ac_srcdir;; -*) - case $ac_srcdir in - .) ac_abs_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; - *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_srcdir=$ac_top_srcdir;; -*) - case $ac_top_srcdir in - .) ac_abs_top_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; - *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; - esac;; -esac + case $ac_mode in + :F) + # + # CONFIG_FILE + # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; - *) ac_INSTALL=$ac_top_builddir$INSTALL ;; + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac +_ACEOF - if test x"$ac_file" != x-; then - { echo "$as_me:$LINENO: creating $ac_file" >&5 -echo "$as_me: creating $ac_file" >&6;} - rm -f "$ac_file" - fi - # Let's still pretend it is `configure' which instantiates (i.e., don't - # use $as_me), people would be surprised to read: - # /* config.h. Generated by config.status. */ - if test x"$ac_file" = x-; then - configure_input= - else - configure_input="$ac_file. " - fi - configure_input=$configure_input"Generated from `echo $ac_file_in | - sed 's,.*/,,'` by configure." - - # First look for the input files in the build tree, otherwise in the - # src tree. - ac_file_inputs=`IFS=: - for f in $ac_file_in; do - case $f in - -) echo $tmp/stdin ;; - [\\/$]*) - # Absolute (can't be DOS-style, as IFS=:) - test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - echo "$f";; - *) # Relative - if test -f "$f"; then - # Build tree - echo "$f" - elif test -f "$srcdir/$f"; then - # Source tree - echo "$srcdir/$f" - else - # /dev/null tree - { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - fi;; - esac - done` || { (exit 1); exit 1; } +cat >>$CONFIG_STATUS <<\_ACEOF +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= + +case `sed -n '/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p +' $ac_file_inputs` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac _ACEOF + +# Neutralize VPATH when `$srcdir' = `.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF sed "$ac_vpsub $extrasub @@ -21779,248 +22265,130 @@ _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b -s,@configure_input@,$configure_input,;t t -s,@srcdir@,$ac_srcdir,;t t -s,@abs_srcdir@,$ac_abs_srcdir,;t t -s,@top_srcdir@,$ac_top_srcdir,;t t -s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t -s,@builddir@,$ac_builddir,;t t -s,@abs_builddir@,$ac_abs_builddir,;t t -s,@top_builddir@,$ac_top_builddir,;t t -s,@abs_top_builddir@,$ac_abs_top_builddir,;t t -s,@INSTALL@,$ac_INSTALL,;t t -" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out - rm -f $tmp/stdin - if test x"$ac_file" != x-; then - mv $tmp/out $ac_file - else - cat $tmp/out - rm -f $tmp/out - fi - -done -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF - -# -# CONFIG_HEADER section. -# - -# 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=' ' -ac_dD=',;t' -# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE". -ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' -ac_uB='$,\1#\2define\3' -ac_uC=' ' -ac_uD=',;t' - -for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue - # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". +s&@configure_input@&$configure_input&;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +s&@INSTALL@&$ac_INSTALL&;t t +$ac_datarootdir_hack +" $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed -f "$tmp/subs-2.sed" >$tmp/out + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && + { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined." >&5 +echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined." >&2;} + + rm -f "$tmp/stdin" case $ac_file in - - | *:- | *:-:* ) # input from stdin - cat >$tmp/stdin - ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - * ) ac_file_in=$ac_file.in ;; + -) cat "$tmp/out"; rm -f "$tmp/out";; + *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; esac - - test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5 -echo "$as_me: creating $ac_file" >&6;} - - # First look for the input files in the build tree, otherwise in the - # src tree. - ac_file_inputs=`IFS=: - for f in $ac_file_in; do - case $f in - -) echo $tmp/stdin ;; - [\\/$]*) - # Absolute (can't be DOS-style, as IFS=:) - test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - # Do quote $f, to prevent DOS paths from being IFS'd. - echo "$f";; - *) # Relative - if test -f "$f"; then - # Build tree - echo "$f" - elif test -f "$srcdir/$f"; then - # Source tree - echo "$srcdir/$f" - else - # /dev/null tree - { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - fi;; - esac - done` || { (exit 1); exit 1; } - # Remove the trailing spaces. - sed 's/[ ]*$//' $ac_file_inputs >$tmp/in - -_ACEOF - -# Transform confdefs.h into two sed scripts, `conftest.defines' and -# `conftest.undefs', that substitutes the proper values into -# config.h.in to produce config.h. The first handles `#define' -# templates, and the second `#undef' templates. -# 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.defines conftest.undefs -# Using a here document instead of a string reduces the quoting nightmare. -# Putting comments in sed scripts is not portable. -# -# `end' is used to avoid that the second main sed command (meant for -# 0-ary CPP macros) applies to n-ary macro definitions. -# See the Autoconf documentation for `clear'. -cat >confdef2sed.sed <<\_ACEOF -s/[\\&,]/\\&/g -s,[\\$`],\\&,g -t clear -: clear -s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp -t end -s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp -: end -_ACEOF -# If some macros were called several times there might be several times -# the same #defines, which is useless. Nevertheless, we may not want to -# sort them, since we want the *last* AC-DEFINE to be honored. -uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines -sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs -rm -f confdef2sed.sed - -# This sed command replaces #undef with comments. This is necessary, for + ;; + :H) + # + # CONFIG_HEADER + # +_ACEOF + +# Transform confdefs.h into a sed script `conftest.defines', that +# substitutes the proper values into config.h.in to produce config.h. +rm -f conftest.defines conftest.tail +# First, append a space to every undef/define line, to ease matching. +echo 's/$/ /' >conftest.defines +# Then, protect against being on the right side of a sed subst, or in +# an unquoted here document, in config.status. If some macros were +# called several times there might be several #defines for the same +# symbol, which is useless. But do not sort them, since the last +# AC_DEFINE must be honored. +ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* +# These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where +# NAME is the cpp macro being defined, VALUE is the value it is being given. +# PARAMS is the parameter list in the macro definition--in most cases, it's +# just an empty string. +ac_dA='s,^\\([ #]*\\)[^ ]*\\([ ]*' +ac_dB='\\)[ (].*,\\1define\\2' +ac_dC=' ' +ac_dD=' ,' + +uniq confdefs.h | + sed -n ' + t rset + :rset + s/^[ ]*#[ ]*define[ ][ ]*// + t ok + d + :ok + s/[\\&,]/\\&/g + s/^\('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p + s/^\('"$ac_word_re"'\)[ ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p + ' >>conftest.defines + +# Remove the space that was appended to ease matching. +# Then replace #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.undefs <<\_ACEOF -s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */, -_ACEOF - -# Break up conftest.defines because some shells have a limit on the size -# of here documents, and old seds have small limits too (100 cmds). -echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS -echo ' if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS -echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS -echo ' :' >>$CONFIG_STATUS -rm -f conftest.tail -while grep . conftest.defines >/dev/null +# (The regexp can be short, since the line contains either #define or #undef.) +echo 's/ $// +s,^[ #]*u.*,/* & */,' >>conftest.defines + +# Break up conftest.defines: +ac_max_sed_lines=50 + +# First sed command is: sed -f defines.sed $ac_file_inputs >"$tmp/out1" +# Second one is: sed -f defines.sed "$tmp/out1" >"$tmp/out2" +# Third one will be: sed -f defines.sed "$tmp/out2" >"$tmp/out1" +# et cetera. +ac_in='$ac_file_inputs' +ac_out='"$tmp/out1"' +ac_nxt='"$tmp/out2"' + +while : do - # Write a limited-size here document to $tmp/defines.sed. - echo ' cat >$tmp/defines.sed <>$CONFIG_STATUS - # Speed up: don't consider the non `#define' lines. - echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS - # Work around the forget-to-reset-the-flag bug. - echo 't clr' >>$CONFIG_STATUS - echo ': clr' >>$CONFIG_STATUS - sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS + # Write a here document: + cat >>$CONFIG_STATUS <<_ACEOF + # First, check the format of the line: + cat >"\$tmp/defines.sed" <<\\CEOF +/^[ ]*#[ ]*undef[ ][ ]*$ac_word_re[ ]*\$/b def +/^[ ]*#[ ]*define[ ][ ]*$ac_word_re[( ]/b def +b +:def +_ACEOF + sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS echo 'CEOF - sed -f $tmp/defines.sed $tmp/in >$tmp/out - rm -f $tmp/in - mv $tmp/out $tmp/in -' >>$CONFIG_STATUS - sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail + sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS + ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in + sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail + grep . conftest.tail >/dev/null || break rm -f conftest.defines mv conftest.tail conftest.defines done -rm -f conftest.defines -echo ' fi # grep' >>$CONFIG_STATUS -echo >>$CONFIG_STATUS - -# Break up conftest.undefs because some shells have a limit on the size -# of here documents, and old seds have small limits too (100 cmds). -echo ' # Handle all the #undef templates' >>$CONFIG_STATUS -rm -f conftest.tail -while grep . conftest.undefs >/dev/null -do - # Write a limited-size here document to $tmp/undefs.sed. - echo ' cat >$tmp/undefs.sed <>$CONFIG_STATUS - # Speed up: don't consider the non `#undef' - echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS - # Work around the forget-to-reset-the-flag bug. - echo 't clr' >>$CONFIG_STATUS - echo ': clr' >>$CONFIG_STATUS - sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS - echo 'CEOF - sed -f $tmp/undefs.sed $tmp/in >$tmp/out - rm -f $tmp/in - mv $tmp/out $tmp/in -' >>$CONFIG_STATUS - sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail - rm -f conftest.undefs - mv conftest.tail conftest.undefs -done -rm -f conftest.undefs +rm -f conftest.defines conftest.tail +echo "ac_result=$ac_in" >>$CONFIG_STATUS cat >>$CONFIG_STATUS <<\_ACEOF - # Let's still pretend it is `configure' which instantiates (i.e., don't - # use $as_me), people would be surprised to read: - # /* config.h. Generated by config.status. */ - if test x"$ac_file" = x-; then - echo "/* Generated by configure. */" >$tmp/config.h - else - echo "/* $ac_file. Generated by configure. */" >$tmp/config.h - fi - cat $tmp/in >>$tmp/config.h - rm -f $tmp/in if test x"$ac_file" != x-; then - if diff $ac_file $tmp/config.h >/dev/null 2>&1; then + echo "/* $configure_input */" >"$tmp/config.h" + cat "$ac_result" >>"$tmp/config.h" + if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 echo "$as_me: $ac_file is unchanged" >&6;} else - ac_dir=`(dirname "$ac_file") 2>/dev/null || -$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_file" : 'X\(//\)[^/]' \| \ - X"$ac_file" : 'X\(//\)$' \| \ - X"$ac_file" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$ac_file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - { if $as_mkdir_p; then - mkdir -p "$ac_dir" - else - as_dir="$ac_dir" - as_dirs= - while test ! -d "$as_dir"; do - as_dirs="$as_dir $as_dirs" - as_dir=`(dirname "$as_dir") 2>/dev/null || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - done - test ! -n "$as_dirs" || mkdir $as_dirs - fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 -echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} - { (exit 1); exit 1; }; }; } - rm -f $ac_file - mv $tmp/config.h $ac_file + mv "$tmp/config.h" $ac_file fi else - cat $tmp/config.h - rm -f $tmp/config.h + echo "/* $configure_input */" + cat "$ac_result" fi + rm -f "$tmp/out12" # Compute $ac_file's index in $config_headers. _am_stamp_count=1 for _am_header in $config_headers :; do @@ -22031,135 +22399,39 @@ for _am_header in $config_headers :; do _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done -echo "timestamp for $ac_file" >`(dirname $ac_file) 2>/dev/null || +echo "timestamp for $ac_file" >`$as_dirname -- $ac_file || $as_expr X$ac_file : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X$ac_file : 'X\(//\)[^/]' \| \ X$ac_file : 'X\(//\)$' \| \ - X$ac_file : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || + X$ac_file : 'X\(/\)' \| . 2>/dev/null || echo X$ac_file | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'`/stamp-h$_am_stamp_count -done -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF - -# -# CONFIG_COMMANDS section. -# -for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue - ac_dest=`echo "$ac_file" | sed 's,:.*,,'` - ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_dir=`(dirname "$ac_dest") 2>/dev/null || -$as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_dest" : 'X\(//\)[^/]' \| \ - X"$ac_dest" : 'X\(//\)$' \| \ - X"$ac_dest" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$ac_dest" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - { if $as_mkdir_p; then - mkdir -p "$ac_dir" - else - as_dir="$ac_dir" - as_dirs= - while test ! -d "$as_dir"; do - as_dirs="$as_dir $as_dirs" - as_dir=`(dirname "$as_dir") 2>/dev/null || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - done - test ! -n "$as_dirs" || mkdir $as_dirs - fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 -echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} - { (exit 1); exit 1; }; }; } - - ac_builddir=. - -if test "$ac_dir" != .; then - ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A "../" for each directory in $ac_dir_suffix. - ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` -else - ac_dir_suffix= ac_top_builddir= -fi - -case $srcdir in - .) # No --srcdir option. We are building in place. - ac_srcdir=. - if test -z "$ac_top_builddir"; then - ac_top_srcdir=. - else - ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` - fi ;; - [\\/]* | ?:[\\/]* ) # Absolute path. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir ;; - *) # Relative path. - ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_builddir$srcdir ;; -esac + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'`/stamp-h$_am_stamp_count + ;; -# Do not use `cd foo && pwd` to compute absolute paths, because -# the directories may not exist. -case `pwd` in -.) ac_abs_builddir="$ac_dir";; -*) - case "$ac_dir" in - .) ac_abs_builddir=`pwd`;; - [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; - *) ac_abs_builddir=`pwd`/"$ac_dir";; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_builddir=${ac_top_builddir}.;; -*) - case ${ac_top_builddir}. in - .) ac_abs_top_builddir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; - *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_srcdir=$ac_srcdir;; -*) - case $ac_srcdir in - .) ac_abs_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; - *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_srcdir=$ac_top_srcdir;; -*) - case $ac_top_srcdir in - .) ac_abs_top_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; - *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; - esac;; -esac + :C) { echo "$as_me:$LINENO: executing $ac_file commands" >&5 +echo "$as_me: executing $ac_file commands" >&6;} + ;; + esac - { echo "$as_me:$LINENO: executing $ac_dest commands" >&5 -echo "$as_me: executing $ac_dest commands" >&6;} - case $ac_dest in - depfiles ) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do + case $ac_file$ac_mode in + "depfiles":C) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. @@ -22169,18 +22441,29 @@ echo "$as_me: executing $ac_dest commands" >&6;} # each Makefile.in and add a new line on top of each file to say so. # So let's grep whole file. if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then - dirpart=`(dirname "$mf") 2>/dev/null || + dirpart=`$as_dirname -- "$mf" || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ - X"$mf" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || + X"$mf" : 'X\(/\)' \| . 2>/dev/null || echo X"$mf" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` else continue fi @@ -22202,49 +22485,76 @@ echo X"$mf" | sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue - fdir=`(dirname "$file") 2>/dev/null || + fdir=`$as_dirname -- "$file" || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ - X"$file" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || + X"$file" : 'X\(/\)' \| . 2>/dev/null || echo X"$file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - { if $as_mkdir_p; then - mkdir -p $dirpart/$fdir - else - as_dir=$dirpart/$fdir + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + { as_dir=$dirpart/$fdir + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= - while test ! -d "$as_dir"; do - as_dirs="$as_dir $as_dirs" - as_dir=`(dirname "$as_dir") 2>/dev/null || + while :; do + case $as_dir in #( + *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break done - test ! -n "$as_dirs" || mkdir $as_dirs - fi || { { echo "$as_me:$LINENO: error: cannot create directory $dirpart/$fdir" >&5 -echo "$as_me: error: cannot create directory $dirpart/$fdir" >&2;} + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 +echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } - # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done ;; - libtool ) + "libtool":C) # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes. @@ -22793,7 +23103,7 @@ _LT_EOF chmod +x "$ofile" ;; - default-1 ) + "default-1":C) for ac_file in $CONFIG_FILES; do # Support "outfile[:infile[:infile...]]" case "$ac_file" in @@ -22894,7 +23204,7 @@ _LT_EOF ;; esac done ;; - bfd_stdint.h ) + "bfd_stdint.h":C) if test "$GCC" = yes; then echo "/* generated for " `$CC --version | sed 1q` "*/" > tmp-stdint.h else @@ -23222,7 +23532,7 @@ else fi ;; - default ) + "default":C) case "$srcdir" in .) srcdirpre= ;; *) srcdirpre='$(srcdir)/' ;; @@ -23240,11 +23550,10 @@ sed -e '/SRC-POTFILES =/r po/SRC-POTFILES' \ -e "s,@POFILES@,$POFILES," \ -e "s,@GMOFILES@,$GMOFILES," \ po/Makefile.in > po/Makefile ;; + esac -done -_ACEOF +done # for ac_tag -cat >>$CONFIG_STATUS <<\_ACEOF { (exit 0); exit 0; } _ACEOF diff --git a/bfd/configure.in b/bfd/configure.in index 295cf36..99ea584 100644 --- a/bfd/configure.in +++ b/bfd/configure.in @@ -8,7 +8,7 @@ AC_CONFIG_SRCDIR([libbfd.c]) AC_CANONICAL_TARGET AC_ISC_POSIX -AM_INIT_AUTOMAKE(bfd, 2.18-arc-20070530) +AM_INIT_AUTOMAKE(bfd, 2.18.50) dnl These must be called before AM_PROG_LIBTOOL, because it may want dnl to call AC_CHECK_PROG. diff --git a/bfd/cpu-arc.c b/bfd/cpu-arc.c index 69ed133..4f7cc88 100644 --- a/bfd/cpu-arc.c +++ b/bfd/cpu-arc.c @@ -42,16 +42,15 @@ static const bfd_arch_info_type arch_info_struct[] = { - ARC ( bfd_mach_arc_a4, "A4", FALSE, &arch_info_struct[1] ), - ARC ( bfd_mach_arc_a5, "A5", FALSE, &arch_info_struct[2] ), - ARC ( bfd_mach_arc_arc600, "ARC600", FALSE, &arch_info_struct[3] ), - ARC ( bfd_mach_arc_arc600, "A6", FALSE, &arch_info_struct[4] ), - ARC ( bfd_mach_arc_arc700, "ARC700", FALSE, &arch_info_struct[5]), - ARC ( bfd_mach_arc_arc700, "A7", FALSE, NULL), + ARC ( bfd_mach_arc_a5, "A5", FALSE, &arch_info_struct[1] ), + ARC ( bfd_mach_arc_arc600, "ARC600", FALSE, &arch_info_struct[2] ), + ARC ( bfd_mach_arc_arc600, "A6", FALSE, &arch_info_struct[3] ), + ARC ( bfd_mach_arc_arc700, "ARC700", FALSE, &arch_info_struct[4] ), + ARC ( bfd_mach_arc_arc700, "A7", FALSE, NULL ), }; const bfd_arch_info_type bfd_arc_arch = - ARC ( bfd_mach_arc_a4, "A4", TRUE, &arch_info_struct[0] ); + ARC ( bfd_mach_arc_arc700, "ARC700", TRUE, &arch_info_struct[0] ); /* Utility routines. */ diff --git a/bfd/doc/Makefile.in b/bfd/doc/Makefile.in index e27d0f3..c21fefd 100644 --- a/bfd/doc/Makefile.in +++ b/bfd/doc/Makefile.in @@ -461,10 +461,13 @@ dist-info: $(INFO_DEPS) $(srcdir)/*) base=`echo "$$base" | sed "s|^$$srcdirstrip/||"`;; \ esac; \ if test -f $$base; then d=.; else d=$(srcdir); fi; \ - for file in $$d/$$base*; do \ - relfile=`expr "$$file" : "$$d/\(.*\)"`; \ - test -f $(distdir)/$$relfile || \ - cp -p $$file $(distdir)/$$relfile; \ + base_i=`echo "$$base" | sed 's|\.info$$||;s|$$|.i|'`; \ + for file in $$d/$$base $$d/$$base-[0-9] $$d/$$base-[0-9][0-9] $$d/$$base_i[0-9] $$d/$$base_i[0-9][0-9]; do \ + if test -f $$file; then \ + relfile=`expr "$$file" : "$$d/\(.*\)"`; \ + test -f $(distdir)/$$relfile || \ + cp -p $$file $(distdir)/$$relfile; \ + else :; fi; \ done; \ done diff --git a/bfd/elf32-arc.c b/bfd/elf32-arc.c index 548d726..43ff90e 100644 --- a/bfd/elf32-arc.c +++ b/bfd/elf32-arc.c @@ -3,13 +3,6 @@ Free Software Foundation, Inc. Contributed by Doug Evans (dje@cygnus.com). - Sources derived from work done by Sankhya Technologies (www.sankhya.com) - - Cleaned up , Comments and Position Independent Code support added by - Saurabh Verma (saurabh.verma@codito.com) - Ramana Radhakrishnan(ramana.radhakrishnan@codito.com) - - This file is part of BFD, the Binary File Descriptor library. This program is free software; you can redistribute it and/or modify @@ -27,20 +20,28 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "sysdep.h" #include "bfd.h" +#include "sysdep.h" #include "libbfd.h" #include "elf-bfd.h" #include "elf/arc.h" /* **************************************************************** - * NOTE: The pic related work starts after the comment marked as + * NOTE: The pic related work starts after the comment marked as * ~~~~~~ "* PIC-related routines for the arc backend " * ****************************************************************/ #define BFD_DEBUG_PIC(x) - -/* #define BFD_DEBUG_PIC(x) (fprintf(stderr,"DEBUG: %d@%s: ", \ - __LINE__,__PRETTY_FUNCTION__),x) */ + + /*#define BFD_DEBUG_PIC(x) (fprintf(stderr,"DEBUG: %d@%s: ",__LINE__,__PRETTY_FUNCTION__),x)*/ + +static reloc_howto_type *arc_elf32_bfd_reloc_type_lookup + PARAMS ((bfd *abfd, bfd_reloc_code_real_type code)); +static void arc_info_to_howto_rel + PARAMS ((bfd *, arelent *, Elf_Internal_Rela *)); +static bfd_boolean arc_elf_object_p PARAMS ((bfd *)); +static void arc_elf_final_write_processing PARAMS ((bfd *, bfd_boolean)); +static bfd_reloc_status_type arc_elf_b22_pcrel + PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); /* We must define USE_RELA to get the proper fixups for PC relative branches to symbols defined in other object files. The addend is @@ -48,43 +49,21 @@ relative address is calculated. mlm */ #define USE_RELA -/* Handle PC relative relocation */ -static bfd_reloc_status_type -arc_elf_b22_pcrel (bfd *abfd ATTRIBUTE_UNUSED, - arelent *reloc_entry, - asymbol *symbol, - void *data ATTRIBUTE_UNUSED, - asection *input_section, - bfd *output_bfd, - char **error_message ATTRIBUTE_UNUSED) -{ - /* If incremental linking, update the address of the relocation with the - section offset */ - - - if (output_bfd != (bfd *) NULL) - { - reloc_entry->address += input_section->output_offset; - if ((symbol->flags & BSF_SECTION_SYM) && symbol->section) - reloc_entry->addend - += ((**(reloc_entry->sym_ptr_ptr)).section)->output_offset; - return bfd_reloc_ok; - } - return bfd_reloc_continue; -} - #define bfd_put32(a,b,c) -static bfd_vma bfd_get_32_me (bfd *, const unsigned char *); -static void bfd_put_32_me (bfd *, bfd_vma, unsigned char *); +static bfd_vma bfd_get_32_me +PARAMS ((bfd *, const unsigned char *)); +static void bfd_put_32_me +PARAMS ((bfd *, bfd_vma, unsigned char *)); static bfd_reloc_status_type arcompact_elf_me_reloc - (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **); +PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); static bfd_reloc_status_type arc_unsupported_reloc - (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **); -static bfd_boolean arc_elf_merge_private_bfd_data (bfd *ibfd, bfd *obfd); +PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); +static bfd_boolean arc_elf_merge_private_bfd_data +PARAMS ((bfd *ibfd, bfd *obfd)); static reloc_howto_type * arc_elf_calculate_howto_index - (enum elf_arc_reloc_type r_type); +(enum elf_arc_reloc_type r_type); #define INIT_SYM_STRING "init" @@ -135,14 +114,14 @@ struct elf_ARC_link_hash_table /* Declare this now that the above structures are defined. */ static bfd_boolean elf_ARC_discard_copies - (struct elf_ARC_link_hash_entry *, void *); + PARAMS ((struct elf_ARC_link_hash_entry *, PTR)); /* Traverse an ARC ELF linker hash table. */ #define elf_ARC_link_hash_traverse(table, func, info) \ (elf_link_hash_traverse \ (&(table)->root, \ - (bfd_boolean (*) (struct elf_link_hash_entry *, void *)) (func), \ + (bfd_boolean (*) PARAMS ((struct elf_link_hash_entry *, PTR))) (func), \ (info))) /* Get the ARC ELF linker hash table from a link_info structure. */ @@ -153,8 +132,8 @@ static bfd_boolean elf_ARC_discard_copies /* Create an entry in an ARC ELF linker hash table. */ static struct bfd_hash_entry * -elf_ARC_link_hash_newfunc (struct bfd_hash_entry *entry, - struct bfd_hash_table *table, +elf_ARC_link_hash_newfunc (struct bfd_hash_entry *entry, + struct bfd_hash_table *table, const char *string) { struct elf_ARC_link_hash_entry *ret = @@ -193,9 +172,9 @@ elf_ARC_link_hash_table_create (bfd * abfd) if (ret == (struct elf_ARC_link_hash_table *) NULL) return NULL; + if (! _bfd_elf_link_hash_table_init (&ret->root, abfd, - elf_ARC_link_hash_newfunc, - sizeof (struct elf_ARC_link_hash_entry))) + elf_ARC_link_hash_newfunc,/* stub for ARC (according to ChangeLog 2006-05-24 Bjoern Haase )*/0 )) { bfd_release (abfd, ret); return NULL; @@ -214,48 +193,47 @@ elf_ARC_link_hash_table_create (bfd * abfd) /*ARGSUSED*/ static bfd_boolean elf_ARC_discard_copies (struct elf_ARC_link_hash_entry * h, - void *ignore ATTRIBUTE_UNUSED) + PTR ignore ATTRIBUTE_UNUSED) { struct elf_ARC_pcrel_relocs_copied *s; - + /* We only discard relocs for symbols defined in a regular object. */ - if (!h->root.def_regular) + if((h->root.def_regular) == 0) return TRUE; for (s = h->pcrel_relocs_copied; s != NULL; s = s->next) - s->section->size -= - s->count * sizeof (Elf32_External_Rela); /* relA */ + s->section->rawsize -= s->count * sizeof (Elf32_External_Rel); return TRUE; } -/* The HOWTO Array needs to be specified as follows. +/* The HOWTO Array needs to be specified as follows. HOWTO { type --- > Relocation Type rightshift --- > Rightshift the value by this amount. size --- > Size 0- byte , 1-short, 2 -long - bitsize --- > Exact bitsize. + bitsize --- > Exact bitsize. pcrel --- > PC Relative reloc. - bitpos --- > Bit Position. - complain_on_overflow ---> What complaint on overflow. - function --- > Any special function to be used . + bitpos --- > Bit Position. + complain_on_overflow ---> What complaint on overflow. + function --- > Any special function to be used . name --- > Relocation Name. - partial_inplace--> Addend sits partially in place and in + partial_inplace--> Addend sits partially in place and in Reloc Table. - srcmask ---> Source Mask 0 for RELA and corresponding + srcmask ---> Source Mask 0 for RELA and corresponding field if USE_REL or partial_inplace - is set. + is set. dstmask ---> Destination Mask . Destination field mask. pcreloffset ---> pcrel offset . If a PCREL reloc is created - and the assembler leaves an offset in here. - + and the assembler leaves an offset in here. + } If in the backend you need to access the howto array, please - use the arc_elf_calculate_howto_index function. All changes in - the HOWTO array need a corresponding change in the above mentioned - function. The need for this function is the presence of a hole - in the ARC ABI. + use the arc_elf_calculate_howto_index function. All changes in + the HOWTO array need a corresponding change in the above mentioned + function. The need for this function is the presence of a hole + in the ARC ABI. */ #define ARC_RELA_HOWTO(type,rightshift,size,bitsz,pcrel,bitpos , \ @@ -289,16 +267,13 @@ static reloc_howto_type elf_arc_howto_table[] = "R_ARC_16",0xffff), ARC_RELA_HOWTO (R_ARC_24 ,0 ,2 ,24,FALSE,0,bfd_elf_generic_reloc, "R_ARC_24",0xffffff), - /* A standard 32 bit relocation. */ - ARC_RELA_HOWTO (R_ARC_32 ,0 ,2 ,32,FALSE,0,bfd_elf_generic_reloc, + ARC_RELA_HOWTO (R_ARC_32 ,0 ,3 ,32,FALSE,0,bfd_elf_generic_reloc, "R_ARC_32",-1), - /* A 26 bit absolute branch, right shifted by 2. */ ARC_RELA_HOWTO (R_ARC_B26 ,2 ,2 ,26,FALSE,0,bfd_elf_generic_reloc, "R_ARC_B26",0xffffff), - /* A relative 22 bit branch; bits 21-2 are stored in bits 26-7. */ ARC_RELA_HOWTO (R_ARC_B22_PCREL,2,2,22,TRUE,7,arc_elf_b22_pcrel, "R_ARC_B22_PCREL",0x7ffff80), - ARC_RELA_HOWTO (R_ARC_H30 ,2 ,2 ,32, FALSE, 0, bfd_elf_generic_reloc, + ARC_RELA_HOWTO (R_ARC_H30 ,2 ,3 ,32, FALSE, 0, bfd_elf_generic_reloc, "R_ARC_H30",-1), ARC_UNSUPPORTED_HOWTO(R_ARC_N8,"R_ARC_N8"), ARC_UNSUPPORTED_HOWTO(R_ARC_N16,"R_ARC_N16"), @@ -318,27 +293,20 @@ static reloc_howto_type elf_arc_howto_table[] = ARCOMPACT_RELA_HOWTO (R_ARC_S25W_PCREL,2,2,25,TRUE,0,arcompact_elf_me_reloc, "R_ARC_S25W_PCREL",0x7fcffcf), - ARCOMPACT_RELA_HOWTO (R_ARC_SDA32,0,2,32,FALSE,0,arcompact_elf_me_reloc, - "R_ARC_SDA32",-1), - ARCOMPACT_RELA_HOWTO (R_ARC_SDA_LDST,0,2,9,FALSE,15,arcompact_elf_me_reloc, - "R_ARC_SDA_LDST",0x00ff8000), - ARCOMPACT_RELA_HOWTO (R_ARC_SDA_LDST1,1,2,10,FALSE,15,arcompact_elf_me_reloc, - "R_ARC_SDA_LDST1",0x00ff8000), - ARCOMPACT_RELA_HOWTO (R_ARC_SDA_LDST2,2,2,11,FALSE,15,arcompact_elf_me_reloc, - "R_ARC_SDA_LDST2",0x00ff8000), - - ARCOMPACT_RELA_HOWTO (R_ARC_SDA16_LD,0,2,9,FALSE,0,arcompact_elf_me_reloc, - "R_ARC_SDA16_LD",0x01ff), - ARCOMPACT_RELA_HOWTO (R_ARC_SDA16_LD1,1,2,10,FALSE,0,arcompact_elf_me_reloc, - "R_ARC_SDA16_LD1",0x01ff), - ARCOMPACT_RELA_HOWTO (R_ARC_SDA16_LD2,2,2,11,FALSE,0,arcompact_elf_me_reloc, - "R_ARC_SDA16_LD2",0x01ff), + ARC_UNSUPPORTED_HOWTO (R_ARC_SDA32,"R_ARC_SDA32"), + ARC_UNSUPPORTED_HOWTO (R_ARC_SDA_LDST,"R_ARC_SDALDST"), + ARC_UNSUPPORTED_HOWTO (R_ARC_SDA_LDST1,"R_ARC_SDALDST1"), + ARC_UNSUPPORTED_HOWTO (R_ARC_SDA_LDST2,"R_ARC_SDALDST2"), + ARC_UNSUPPORTED_HOWTO (R_ARC_SDA16_LD,"R_ARC_SDA16_LD"), + ARC_UNSUPPORTED_HOWTO (R_ARC_SDA16_LD1,"R_ARC_SDA16_LD1"), + ARC_UNSUPPORTED_HOWTO (R_ARC_SDA16_LD2,"R_ARC_SDA16_LD2"), ARCOMPACT_RELA_HOWTO (R_ARC_S13_PCREL,2,1,13,TRUE,0,arcompact_elf_me_reloc, "R_ARC_S13_PCREL",0x7ff), ARC_UNSUPPORTED_HOWTO (R_ARC_W,"R_ARC_W"), + /* 'Middle-endian' (ME) 32-bit word relocations, stored in two half-words. The individual half-words are stored in the native endian of the machine; this is how all 32-bit instructions and long-words are stored @@ -346,13 +314,10 @@ static reloc_howto_type elf_arc_howto_table[] = ARC_RELA_HOWTO (R_ARC_32_ME ,0 ,2 ,32, FALSE, 0, arcompact_elf_me_reloc, "R_ARC_32_ME",-1), - + ARC_UNSUPPORTED_HOWTO (R_ARC_N32_ME,"R_ARC_N32_ME"), ARC_UNSUPPORTED_HOWTO (R_ARC_SECTOFF_ME,"R_ARC_SECTOFF_ME"), - - ARCOMPACT_RELA_HOWTO (R_ARC_SDA32_ME,0,2,32,FALSE,0,arcompact_elf_me_reloc, - "R_ARC_SDA32_ME",-1), - + ARC_UNSUPPORTED_HOWTO (R_ARC_SDA32_ME,"R_ARC_SDA32_ME"), ARC_UNSUPPORTED_HOWTO (R_ARC_W_ME,"R_ARC_W_ME"), ARC_UNSUPPORTED_HOWTO (R_ARC_H30_ME,"R_ARC_H30_ME"), ARC_UNSUPPORTED_HOWTO (R_ARC_SECTOFF_U8,"R_ARC_SECTOFF_U8"), @@ -399,96 +364,14 @@ static reloc_howto_type elf_arc_howto_table[] = "R_ARC_GOTPC",-1), }; -/*Indicates whether the value contained in - the relocation type is signed, usnigned - or the reclocation type is unsupported. - 0 -> unsigned reloc type - 1 -> signed reloc type - -1 -> reloc type unsupported*/ -short arc_signed_reloc_type[] = -{ - 0, // R_ARC_NONE Reloc Number - 0, // R_ARC_8 - 0, // R_ARC_16 - 0, // R_ARC_24 - 0, // R_ARC_32 - 0, // R_ARC_B26 - 1, // R_ARC_B22_PCREL 0x6 - - 0, // R_ARC_H30 0x7 - -1, // R_ARC_N8 - -1, // R_ARC_N16 - -1, // R_ARC_N24 - -1, // R_ARC_N32 - -1, // R_ARC_SDA - -1, // R_ARC_SECTOFF 0xD - - 1, // R_ARC_S21H_PCREL 0xE - 1, // R_ARC_S21W_PCREL - 1, // R_ARC_S25H_PCREL - 1, // R_ARC_S25W_PCREL 0x11 - - 1, // R_ARC_SDA32 0x12 - 1, // R_ARC_SDA_LDST - 1, // R_ARC_SDA_LDST1 - 1, // R_ARC_SDA_LDST2 0x15 - - 1, // R_ARC_SDA16_LD 0x16 - 1, // R_ARC_SDA16_LD1 - 1, // R_ARC_SDA16_LD2 0x18 - - 1, // R_ARC_S13_PCREL 0x19 - - -1, // R_ARC_W 0x1A - 0, // R_ARC_32_ME 0x1B - - -1, // R_ARC_N32_ME 0x1c - -1, // R_ARC_SECTOFF_ME 0x1D - - 0, // R_ARC_SDA32_ME 0x1E - - -1, // R_ARC_W_ME 0x1F - -1, // R_ARC_H30_ME - -1, // R_ARC_SECTOFF_U8 - -1, // R_ARC_SECTOFF_S9 - -1, // R_AC_SECTOFF_U8 - -1, // R_AC_SECTOFF_U8_1 - -1, // R_AC_SECTOFF_U8_2 - -1, // R_AC_SECTOFF_S9 - -1, // R_AC_SECTOFF_S9_1 - -1, // R_AC_SECTOFF_S9_2 - -1, // R_ARC_SECTOFF_ME_1 - -1, // R_ARC_SECTOFF_ME_2 - -1, // R_ARC_SECTOFF_1 - -1, // R_ARC_SECTOFF_2 0x2c - - -1, // R_ARC_hole_base starts here 0x2d - -1, // 0x2e - -1, // 0x2f - -1, // 0x30 - -1, // ends here 0x31 - - 0, // R_ARC_PC32 0x32 - 0, // R_ARC_GOTPC32 - 0, // R_ARC_PLT32 - 0, // R_ARC_COPY - 0, // R_ARC_GLOB_DAT - 0, // R_ARC_JMP_SLOT - 0, // R_ARC_RELATIVE - 0, // R_ARC_GOTOFF - 0, // R_ARC_GOTPC 0x3a - 0, // R_ARC_GOT32 0x3b -}; - - -static bfd_reloc_status_type -arc_unsupported_reloc (bfd * ibfd ATTRIBUTE_UNUSED, +static bfd_reloc_status_type +arc_unsupported_reloc (bfd * ibfd ATTRIBUTE_UNUSED, arelent * rel ATTRIBUTE_UNUSED, - asymbol * sym ATTRIBUTE_UNUSED, - void *ptr ATTRIBUTE_UNUSED, - asection * section ATTRIBUTE_UNUSED, - bfd *obfd ATTRIBUTE_UNUSED, + asymbol * sym ATTRIBUTE_UNUSED, + PTR ptr ATTRIBUTE_UNUSED, + asection * section ATTRIBUTE_UNUSED, + bfd *obfd ATTRIBUTE_UNUSED, char ** data ATTRIBUTE_UNUSED ) { @@ -522,35 +405,26 @@ static const struct arc_reloc_map arc_reloc_map[] = { BFD_RELOC_ARC_32_ME, R_ARC_32_ME }, { BFD_RELOC_ARC_PC32, R_ARC_PC32 }, { BFD_RELOC_ARC_GOTPC32, R_ARC_GOTPC32 }, - { BFD_RELOC_ARC_COPY , R_ARC_COPY }, + { BFD_RELOC_ARC_COPY , R_ARC_COPY}, { BFD_RELOC_ARC_JMP_SLOT, R_ARC_JMP_SLOT }, { BFD_RELOC_ARC_GLOB_DAT, R_ARC_GLOB_DAT }, - { BFD_RELOC_ARC_GOTOFF , R_ARC_GOTOFF }, - { BFD_RELOC_ARC_GOTPC , R_ARC_GOTPC }, + { BFD_RELOC_ARC_GOTOFF , R_ARC_GOTOFF}, + { BFD_RELOC_ARC_GOTPC , R_ARC_GOTPC}, { BFD_RELOC_ARC_PLT32 , R_ARC_PLT32 }, - - { BFD_RELOC_ARC_SDA, R_ARC_SDA }, - { BFD_RELOC_ARC_SDA32, R_ARC_SDA32 }, - { BFD_RELOC_ARC_SDA32_ME, R_ARC_SDA32_ME }, - { BFD_RELOC_ARC_SDA_LDST, R_ARC_SDA_LDST }, - { BFD_RELOC_ARC_SDA_LDST1, R_ARC_SDA_LDST1 }, - { BFD_RELOC_ARC_SDA_LDST2, R_ARC_SDA_LDST2 }, - { BFD_RELOC_ARC_SDA16_LD, R_ARC_SDA16_LD }, - { BFD_RELOC_ARC_SDA16_LD1, R_ARC_SDA16_LD1 }, - { BFD_RELOC_ARC_SDA16_LD2, R_ARC_SDA16_LD2 } }; static reloc_howto_type * -arc_elf32_bfd_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED, - bfd_reloc_code_real_type code) +arc_elf32_bfd_reloc_type_lookup (bfd * abfd ATTRIBUTE_UNUSED, + bfd_reloc_code_real_type code) { unsigned int i; + for (i = 0; i < sizeof (arc_reloc_map) / sizeof (struct arc_reloc_map); i++) { if (arc_reloc_map[i].bfd_reloc_val == code) - { + { enum elf_arc_reloc_type r_type; r_type = arc_reloc_map[i].elf_reloc_val; return arc_elf_calculate_howto_index(r_type); @@ -560,31 +434,15 @@ arc_elf32_bfd_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED, return NULL; } -static reloc_howto_type * -bfd_elf32_bfd_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, - const char *r_name) -{ - unsigned int i; - - for (i = 0; - i < sizeof (elf_arc_howto_table) / sizeof (elf_arc_howto_table[0]); - i++) - if (elf_arc_howto_table[i].name != NULL - && strcasecmp (elf_arc_howto_table[i].name, r_name) == 0) - return &elf_arc_howto_table[i]; - - return NULL; -} - /* Calculate the howto index. */ -static reloc_howto_type * +static reloc_howto_type * arc_elf_calculate_howto_index(enum elf_arc_reloc_type r_type) { BFD_ASSERT (r_type < (unsigned int) R_ARC_max); - BFD_ASSERT ((r_type < (unsigned int) R_ARC_hole_base) - || (r_type - >= (unsigned int) R_ARC_hole_base + R_ARC_reloc_hole_gap)); - if (r_type > R_ARC_hole_base) + BFD_ASSERT ((r_type < (unsigned int)R_ARC_hole_base) || + (r_type >= (unsigned int) R_ARC_hole_base + + R_ARC_reloc_hole_gap)); + if(r_type > R_ARC_hole_base) r_type -= R_ARC_reloc_hole_gap; return &elf_arc_howto_table[r_type]; @@ -592,17 +450,17 @@ arc_elf_calculate_howto_index(enum elf_arc_reloc_type r_type) /* Set the howto pointer for an ARC ELF reloc. */ static void -arc_info_to_howto_rel (bfd *abfd ATTRIBUTE_UNUSED, - arelent *cache_ptr, - Elf_Internal_Rela *dst) +arc_info_to_howto_rel (bfd * abfd ATTRIBUTE_UNUSED, + arelent * cache_ptr, + Elf_Internal_Rela *dst) { enum elf_arc_reloc_type r_type; - r_type = ELF32_R_TYPE (dst->r_info); cache_ptr->howto = arc_elf_calculate_howto_index(r_type); } - + + /* Merge backend specific data from an object file to the output object file when linking. */ static bfd_boolean @@ -610,26 +468,22 @@ arc_elf_merge_private_bfd_data (bfd *ibfd, bfd *obfd) { unsigned short mach_ibfd; static unsigned short mach_obfd = EM_NONE; - + if ( bfd_get_flavour (ibfd) != bfd_target_elf_flavour || bfd_get_flavour (obfd) != bfd_target_elf_flavour) return TRUE; - if (bfd_count_sections (ibfd) == 0) + if(bfd_count_sections(ibfd) == 0) return TRUE ; /* For the case of empty archive files */ - - mach_ibfd = elf_elfheader (ibfd)->e_machine; + + mach_ibfd = elf_elfheader(ibfd)->e_machine; /* Check if we have the same endianess. */ if (! _bfd_generic_verify_endian_match (ibfd, obfd)) { - _bfd_error_handler (_("\ -ERROR: Endian Match failed . Attempting to link %B with binary %s \ -of opposite endian-ness"), - ibfd, bfd_get_filename (obfd)); return FALSE; } - if (mach_obfd == EM_NONE) + if(mach_obfd == EM_NONE) { mach_obfd = mach_ibfd; } @@ -638,37 +492,35 @@ of opposite endian-ness"), if((mach_ibfd==EM_ARC && mach_obfd==EM_ARCOMPACT) || (mach_ibfd==EM_ARCOMPACT && mach_obfd==EM_ARC)) { - _bfd_error_handler (_("\ERROR: Attempting to link an %s binary(%B) \ + _bfd_error_handler(_("\ERROR: Attempting to link an %s binary(%s) \ with a binary incompatible %s binary(%s)"), - (mach_ibfd == EM_ARC) ? "A4" : "ARCompact", - ibfd, - (mach_obfd == EM_ARC) ? "A4" : "ARCompact", - bfd_get_filename (obfd)); + (mach_ibfd == EM_ARC)?"A4":"ARCompact", + bfd_get_filename(ibfd) , + (mach_obfd == EM_ARC)?"A4":"ARCompact", + bfd_get_filename(obfd)); return FALSE; } } - + if (bfd_get_mach (obfd) < bfd_get_mach (ibfd)) { return bfd_set_arch_mach (obfd, bfd_arch_arc, bfd_get_mach(ibfd)); } - + return TRUE; } /* Set the right machine number for an ARC ELF file. */ static bfd_boolean -arc_elf_object_p (bfd *abfd) +arc_elf_object_p (abfd) + bfd *abfd; { int mach; unsigned long arch = elf_elfheader (abfd)->e_flags & EF_ARC_MACH; switch (arch) { - case E_ARC_MACH_A4: - mach = bfd_mach_arc_a4; - break; case E_ARC_MACH_A5: mach = bfd_mach_arc_a5; break; @@ -691,18 +543,15 @@ arc_elf_object_p (bfd *abfd) This gets the ARC architecture right based on the machine number. */ static void -arc_elf_final_write_processing (bfd *abfd, - bfd_boolean linker ATTRIBUTE_UNUSED) +arc_elf_final_write_processing (abfd, linker) + bfd *abfd; + bfd_boolean linker ATTRIBUTE_UNUSED; { int mach; unsigned long val; switch (mach = bfd_get_mach (abfd)) { - case bfd_mach_arc_a4: - val = E_ARC_MACH_A4; - elf_elfheader (abfd)->e_machine = EM_ARC; - break; case bfd_mach_arc_a5: val = E_ARC_MACH_A5; elf_elfheader (abfd)->e_machine = EM_ARCOMPACT; @@ -725,10 +574,10 @@ arc_elf_final_write_processing (bfd *abfd, /* Handle an ARCompact 'middle-endian' relocation. */ static bfd_reloc_status_type -arcompact_elf_me_reloc (bfd *abfd , +arcompact_elf_me_reloc (bfd *abfd , arelent *reloc_entry, asymbol *symbol_in, - void *data, + PTR data, asection *input_section, bfd *output_bfd, char ** error_message ATTRIBUTE_UNUSED) @@ -750,7 +599,7 @@ arcompact_elf_me_reloc (bfd *abfd , /* In case of relocateable link and if the reloc is against a section symbol, the addend needs to be adjusted according to - where the section symbol winds up in the output section. */ + where the section symbol winds up in the output section. */ if ((symbol_in->flags & BSF_SECTION_SYM) && symbol_in->section) reloc_entry->addend += symbol_in->section->output_offset; @@ -759,9 +608,9 @@ arcompact_elf_me_reloc (bfd *abfd , } /* Return an error if the symbol is not defined. An undefined weak - symbol is considered to have a value of zero (SVR4 ABI, p. 4-27). */ + symbol is considered to have a value of zero (SVR4 ABI, p. 4-27). */ - if (symbol_in != NULL && bfd_is_und_section (symbol_in->section) + if (symbol_in != NULL && bfd_is_und_section (symbol_in->section) && ((symbol_in->flags & BSF_WEAK) == 0)) return bfd_reloc_undefined; @@ -851,6 +700,7 @@ arcompact_elf_me_reloc (bfd *abfd , /* Extract the instruction opcode alone from 'insn' */ insn = insn & 0xf8010030; + insn |= ((((sym_value >> 1) & 0x3ff) << 17) | (((sym_value >> 1) & 0xffc00) >> 4) | (((sym_value >> 1) & 0xf00000) >> 20)); @@ -924,7 +774,7 @@ bfd_get_32_me (bfd * abfd,const unsigned char * data) { bfd_vma value = 0; - if (bfd_big_endian(abfd)) { + if (bfd_big_endian(abfd)) { value = bfd_get_32 (abfd, data); } else { @@ -933,10 +783,10 @@ bfd_get_32_me (bfd * abfd,const unsigned char * data) value |= (bfd_get_8 (abfd, data + 2) & 255); value |= ((bfd_get_8 (abfd, data + 3) & 255) << 8); } - + return value; } - + static void bfd_put_32_me (bfd *abfd, bfd_vma value,unsigned char *data) { @@ -944,24 +794,50 @@ bfd_put_32_me (bfd *abfd, bfd_vma value,unsigned char *data) bfd_put_16 (abfd, value & 0xffff, data + 2); } +/* Handle PC relative relocation */ +bfd_reloc_status_type +arc_elf_b22_pcrel (bfd *abfd ATTRIBUTE_UNUSED, + arelent *reloc_entry, + asymbol *symbol, + PTR data ATTRIBUTE_UNUSED, + asection *input_section, + bfd *output_bfd, + char **error_message ATTRIBUTE_UNUSED) +{ + /* If incremental linking, update the address of the relocation with the + section offset */ + + + if (output_bfd != (bfd *) NULL) + { + reloc_entry->address += input_section->output_offset; + if ((symbol->flags & BSF_SECTION_SYM) && symbol->section) + reloc_entry->addend += ((**(reloc_entry->sym_ptr_ptr)).section)->output_offset; + + return bfd_reloc_ok; + } + + return bfd_reloc_continue; +} /* ****************************************** - * PIC-related routines for the arc backend + * PIC-related routines for the arc backend * ******************************************/ -/* This will be overridden by the interpreter specified in +/* This will be overridden by the interpreter ld-linux.so specified in the linker specs */ -#define ELF_DYNAMIC_INTERPRETER "/sbin/ld-uClibc.so" +#define ELF_DYNAMIC_INTERPRETER "/sbin/ld-uClibc-0.9.26.so" +/*"/usr/local/arc/lib/libc.so.1"*/ /* size of one plt entry */ #define PLT_ENTRY_SIZE 12 /* The zeroth entry in the absolute plt entry */ -static const bfd_byte elf_arc_abs_plt0_entry [2 * PLT_ENTRY_SIZE] = - { +static const bfd_byte elf_arc_abs_plt0_entry [2 * PLT_ENTRY_SIZE] = + { 0x00, 0x16, /* ld %r11, [0] */ 0x0b, 0x70, - 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x16, /* ld %r10, [0] */ 0x0a, 0x70, /* */ @@ -974,22 +850,22 @@ static const bfd_byte elf_arc_abs_plt0_entry [2 * PLT_ENTRY_SIZE] = }; /* Contents of the subsequent entries in the absolute plt */ -static const bfd_byte elf_arc_abs_pltn_entry [PLT_ENTRY_SIZE] = - { +static const bfd_byte elf_arc_abs_pltn_entry [PLT_ENTRY_SIZE] = + { 0x30, 0x27, /* ld %r12, [%pc,func@gotpc] */ 0x8c, 0x7f, /* ------ " " -------------- */ 0x00, 0x00, /* ------ " " -------------- */ 0x00, 0x00, /* ------ " " -------------- */ - 0x20, 0x7c, /* j_s.d [%r12] */ + 0x20, 0x7c, /* j_s.d [%r12] */ 0xef, 0x74, /* mov_s %r12, %pcl */ }; /* The zeroth entry in the pic plt entry */ -static const bfd_byte elf_arc_pic_plt0_entry [2 * PLT_ENTRY_SIZE] = - { +static const bfd_byte elf_arc_pic_plt0_entry [2 * PLT_ENTRY_SIZE] = + { 0x30, 0x27, /* ld %r11, [pcl,0] : 0 to be replaced by _DYNAMIC@GOTPC+4 */ 0x8b, 0x7f, - 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x30, 0x27, /* ld %r10, [pcl,0] : 0 to be replaced by -DYNAMIC@GOTPC+8 */ 0x8a, 0x7f, /* */ @@ -1002,80 +878,34 @@ static const bfd_byte elf_arc_pic_plt0_entry [2 * PLT_ENTRY_SIZE] = }; /* Contents of the subsequent entries in the pic plt */ -static const bfd_byte elf_arc_pic_pltn_entry [PLT_ENTRY_SIZE] = - { +static const bfd_byte elf_arc_pic_pltn_entry [PLT_ENTRY_SIZE] = + { 0x30, 0x27, /* ld %r12, [%pc,func@got] */ 0x8c, 0x7f, /* ------ " " -------------- */ 0x00, 0x00, /* ------ " " -------------- */ 0x00, 0x00, /* ------ " " -------------- */ - 0x20, 0x7c, /* j_s.d [%r12] */ + 0x20, 0x7c, /* j_s.d [%r12] */ 0xef, 0x74, /* mov_s %r12, %pcl */ }; /* Function: arc_plugin_one_reloc * Brief : Fill in the relocated value of the symbol into an insn - * depending on the relocation type. The instruction is + * depending on the relocation type. The instruction is * assumed to have been read in the correct format (ME / LE/ BE) - * Args : 1. insn : the original insn into which the relocated - * value has to be filled in. - * 2. rel : the relocation entry. - * 3. value : the value to be plugged in the insn. - * 4. overflow_detected : Pointer to short to indicate relocation - * overflows. - * 5. symbol_defined : bool value representing if the symbol - * definition is present. + * Args : 1. insn : the original insn into which the relocated + * value has to be filled in. + * 2. r_type : the relocation type. + * 3. value : the value to be plugged in the insn. * Returns : the insn with the relocated value plugged in. */ +/* FIXME::: Ramana this whole function needs to check for overflows. */ static unsigned long -arc_plugin_one_reloc (unsigned long insn, Elf_Internal_Rela *rel, - int value, - short *overflow_detected, bfd_boolean symbol_defined - ) +arc_plugin_one_reloc (unsigned long insn, enum elf_arc_reloc_type r_type, + int value) { unsigned long offset; - long long check_overfl_pos,check_overfl_neg; - reloc_howto_type *howto; - enum elf_arc_reloc_type r_type; - - r_type = ELF32_R_TYPE (rel->r_info); - howto = arc_elf_calculate_howto_index(r_type); - if (arc_signed_reloc_type [howto->type] == 1) - { - check_overfl_pos = (long long)1 << (howto->bitsize-1); - check_overfl_neg = -check_overfl_pos; - if ((value >= check_overfl_pos) || (check_overfl_neg > value)) - *overflow_detected = 1; - } - else - { - check_overfl_pos = (long long)1 << (howto->bitsize); - check_overfl_neg = 0; - if ((unsigned int) value >= check_overfl_pos) - *overflow_detected = 1; - } - - if (*overflow_detected - && symbol_defined == TRUE) - { - (*_bfd_error_handler ) ("Error: Overflow detected in relocation value;"); - if (howto->pc_relative) - (*_bfd_error_handler) ("Relocation value should be between %lld and %lld whereas it %d", - check_overfl_pos - 1, (signed long long) check_overfl_neg, - value); - else - (*_bfd_error_handler) ("Relocation value should be between %lld and %lld whereas it %ld", - check_overfl_pos - 1, (signed long long) check_overfl_neg, - (unsigned int) value); - - bfd_set_error (bfd_error_bad_value); - *overflow_detected = 1; - return 0; - } - else - *overflow_detected = 0; - switch(r_type) { case R_ARC_B26: @@ -1089,36 +919,33 @@ arc_plugin_one_reloc (unsigned long insn, Elf_Internal_Rela *rel, /* Extract the instruction opcode alone from 'insn' */ insn = insn & 0xff000000; - /* With the addend now being in the addend table, there is no - * need to use this + /* With the addend now being in the addend table, there is no + * need to use this */ /* Ramana : No longer required since - * addends no longer exist in place + * addends no longer exist in place */ /* value += offset; */ insn |= ((value >> 2) & (~0xff000000)); break; - + case R_ARC_B22_PCREL: /* Retrieve the offset from the instruction, if any */ /* Extract the first 10 bits from Position 6 to 15 in insn */ offset = ((insn << 5) >> 12); - + /* Fill in 2 bit to get the 22 bit Offset Value */ offset = offset << 2; - + /* Extract the instruction opcode alone from 'insn' */ insn = insn & 0xf800007f; - - /* Ramana: All addends exist in the relocation table. Ignore - * the in place addend - */ - /*value += offset; */ - + + value += offset; + insn |= ((value >> 2) << 7) & (~0xf800007f); - + break; - + case R_ARC_S21H_PCREL: /* Retrieve the offset from the instruction, if any */ /* Extract the first 10 bits from Position 6 to 15 in insn */ @@ -1134,12 +961,12 @@ arc_plugin_one_reloc (unsigned long insn, Elf_Internal_Rela *rel, insn = insn & 0xf801003f; - + /* Ramana: All addends exist in the relocation table. Ignore - * the in place addend + * the in place addend */ /*value += offset; */ - + insn |= ((((value >> 1) & 0x3ff) << 17) | (((value >> 1) & 0xffc00) >> 4)); @@ -1159,9 +986,9 @@ arc_plugin_one_reloc (unsigned long insn, Elf_Internal_Rela *rel, insn = insn & 0xf803003f; /* Ramana: All addends exist in the relocation table. Ignore - * the in place addend + * the in place addend */ - + /*value += offset;*/ @@ -1187,9 +1014,9 @@ arc_plugin_one_reloc (unsigned long insn, Elf_Internal_Rela *rel, insn = insn & 0xf8010030; /* Ramana: All addends exist in the relocation table. Ignore - * the in place addend + * the in place addend */ - + /* value += offset; */ insn |= ((((value >> 1) & 0x3ff) << 17) @@ -1215,31 +1042,31 @@ arc_plugin_one_reloc (unsigned long insn, Elf_Internal_Rela *rel, { insn = insn & 0xf803003f; } - + insn |= ((((value >> 2) & 0x1ff) << 18) | (((value >> 2) & 0x7fe00) >> 3)); break; case R_ARC_S25W_PCREL: - /* Retrieve the offset from the instruction, if any */ - /* Extract the high 4 bits from Position 0 to 3 in insn */ - offset = ((insn << 28) >> 28) << 10; - - /* Extract the next 10 bits from Position 6 to 15 in insn */ - offset |= ((insn << 16) >> 22); - offset = offset << 9; - - /* Extract the remaining 9 bits from Position 18 to 26 in insn */ - offset |= ((insn << 5) >> 23); - - /* Fill in 2 bits to get the 25 bit Offset Value */ + /* Retrieve the offset from the instruction, if any */ + /* Extract the high 4 bits from Position 0 to 3 in insn */ + offset = ((insn << 28) >> 28) << 10; + + /* Extract the next 10 bits from Position 6 to 15 in insn */ + offset |= ((insn << 16) >> 22); + offset = offset << 9; + + /* Extract the remaining 9 bits from Position 18 to 26 in insn */ + offset |= ((insn << 5) >> 23); + + /* Fill in 2 bits to get the 25 bit Offset Value */ offset = offset << 2; /* Extract the instruction opcode alone from 'insn' */ insn = insn & 0xf8030030; /* Ramana: All addends exist in the relocation table. Ignore - * the in place addend + * the in place addend */ - + /* value += offset; */ insn |= ((((value >> 2) & 0x1ff) << 18) @@ -1258,9 +1085,9 @@ arc_plugin_one_reloc (unsigned long insn, Elf_Internal_Rela *rel, insn = (insn & 0xf800ffff); /* Ramana: All addends exist in the relocation table. Ignore - * the in place addend + * the in place addend */ - + /* value += offset; */ insn |= ((value >> 2) & 0x7ff) << 16; @@ -1272,53 +1099,23 @@ arc_plugin_one_reloc (unsigned long insn, Elf_Internal_Rela *rel, case R_ARC_GOTPC32: case R_ARC_32_ME: insn = value; - + case R_ARC_8: case R_ARC_16: case R_ARC_24: - /* One would have to OR the value here since + /* One would have to OR the value here since insn would contain the bits read in correctly. */ - + insn |= value ; break; - - case R_ARC_SDA32_ME: - insn |= value; - break; - - case R_ARC_SDA_LDST2: - value >>= 1; - case R_ARC_SDA_LDST1: - value >>= 1; - case R_ARC_SDA_LDST: - value &= 0x1ff; - insn |= ( ((value & 0xff) << 16) | ((value >> 8) << 15)); - break; - - case R_ARC_SDA16_LD: - /* FIXME: The 16-bit insns shd not come in as higher bits of a 32-bit word */ - insn |= (value & 0x1ff) <<16; - break; - - case R_ARC_SDA16_LD1: - /* FIXME: The 16-bit insns shd not come in as higher bits of a 32-bit word */ - insn |= ((value >> 1) & 0x1ff ) <<16; - break; - - case R_ARC_SDA16_LD2: - /* FIXME: The 16-bit insns shd not come in as higher bits of a 32-bit word */ - insn |= ((value >> 2) & 0x1ff) <<16; - break; - default: - /* FIXME:: This should go away once the HOWTO Array - is used for this purpose. + /* FIXME:: This should go away once the HOWTO Array + is used for this purpose. */ - fprintf(stderr, "Unsupported reloc used : %s (value = %d)\n", (arc_elf_calculate_howto_index(r_type))->name, value); break; } - + return insn; } @@ -1332,9 +1129,9 @@ arc_plugin_one_reloc (unsigned long insn, Elf_Internal_Rela *rel, * Returns : True/False as the return status. */ static bfd_boolean -elf_arc_check_relocs (bfd *abfd, - struct bfd_link_info *info, - asection *sec, +elf_arc_check_relocs (bfd *abfd, + struct bfd_link_info *info, + asection *sec, const Elf_Internal_Rela *relocs) { bfd *dynobj; @@ -1434,7 +1231,7 @@ elf_arc_check_relocs (bfd *abfd, } - h->got.offset = sgot->size; + h->got.offset = sgot->rawsize; BFD_DEBUG_PIC(fprintf(stderr, "got entry stab entry %d got offset=0x%x\n",r_symndx, h->got.offset)); @@ -1446,7 +1243,7 @@ elf_arc_check_relocs (bfd *abfd, } BFD_DEBUG_PIC(fprintf (stderr, "Got raw size increased\n")); - srelgot->size += sizeof (Elf32_External_Rela); + srelgot->rawsize += sizeof (Elf32_External_Rela); } else { @@ -1475,21 +1272,21 @@ elf_arc_check_relocs (bfd *abfd, BFD_DEBUG_PIC(fprintf(stderr, "got entry stab entry %d\n",r_symndx)); - - local_got_offsets[r_symndx] = sgot->size; + + local_got_offsets[r_symndx] = sgot->rawsize; if (info->shared) { /* If we are generating a shared object, we need to output a R_ARC_RELATIVE reloc so that the dynamic linker can adjust this GOT entry. */ - srelgot->size += sizeof (Elf32_External_Rela); + srelgot->rawsize += sizeof (Elf32_External_Rela); } } - + BFD_DEBUG_PIC(fprintf (stderr, "Got raw size increased\n")); - sgot->size += 4; + sgot->rawsize += 4; break; @@ -1528,7 +1325,8 @@ elf_arc_check_relocs (bfd *abfd, if (info->shared && (ELF32_R_TYPE (rel->r_info) != R_ARC_PC32 || (h != NULL - && (!info->symbolic || !h->def_regular)))) + && (! info->symbolic + || (h->def_regular) == 0)))) { /* When creating a shared object, we must copy these reloc types into the output file. We create a reloc @@ -1565,7 +1363,7 @@ elf_arc_check_relocs (bfd *abfd, } } - sreloc->size += sizeof (Elf32_External_Rela); + sreloc->rawsize += sizeof (Elf32_External_Rela); /* If we are linking with -Bsymbolic, and this is a global symbol, we count the number of PC relative @@ -1619,7 +1417,7 @@ elf_arc_check_relocs (bfd *abfd, /* Function : elf_arc_relocate_section * Brief : Relocate an arc section, by handling all the relocations * appearing in that section. - * Args : output_bfd : The bfd being written to. + * Args : output_bfd : The bfd being written to. * info : Link information. * input_bfd : The input bfd. * input_section : The section being relocated. @@ -1627,18 +1425,18 @@ elf_arc_check_relocs (bfd *abfd, * relocs : List of relocations in the section. * local_syms : is a pointer to the swapped in local symbols. * local_section : is an array giving the section in the input file - * corresponding to the st_shndx field of each + * corresponding to the st_shndx field of each * local symbol. - * Returns : + * Returns : */ static bfd_boolean -elf_arc_relocate_section (bfd *output_bfd, - struct bfd_link_info *info, - bfd *input_bfd, +elf_arc_relocate_section (bfd *output_bfd, + struct bfd_link_info *info, + bfd *input_bfd, asection *input_section, - bfd_byte * contents, - Elf_Internal_Rela *relocs, - Elf_Internal_Sym *local_syms, + bfd_byte * contents, + Elf_Internal_Rela *relocs, + Elf_Internal_Sym *local_syms, asection **local_sections) { bfd *dynobj; @@ -1650,7 +1448,6 @@ elf_arc_relocate_section (bfd *output_bfd, asection *sreloc; Elf_Internal_Rela *rel; Elf_Internal_Rela *relend; - short overflow_detected=0; dynobj = elf_hash_table (info)->dynobj; symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr; @@ -1673,9 +1470,8 @@ elf_arc_relocate_section (bfd *output_bfd, asection *sec; bfd_vma relocation; bfd_reloc_status_type r; - bfd_boolean symbol_defined = TRUE; - /* Distance of the relocation slot in the insn .This value is used for + /* Distance of the relocation slot in the insn .This value is used for handling relative relocations. */ long offset_in_insn = 0; @@ -1684,7 +1480,7 @@ elf_arc_relocate_section (bfd *output_bfd, r_type = ELF32_R_TYPE (rel->r_info); - + if (r_type >= (int) R_ARC_max) { bfd_set_error (bfd_error_bad_value); @@ -1706,7 +1502,7 @@ elf_arc_relocate_section (bfd *output_bfd, in which case we have to adjust according to where the section symbol winds up in the output section. */ - /* Checks if this is a local symbol + /* Checks if this is a local symbol * and thus the reloc might (will??) be against a section symbol. */ if (r_symndx < symtab_hdr->sh_info) @@ -1716,15 +1512,13 @@ elf_arc_relocate_section (bfd *output_bfd, { sec = local_sections[r_symndx]; - /* for RELA relocs.Just adjust the addend + /* for RELA relocs.Just adjust the addend value in the relocation entry. */ rel->r_addend += sec->output_offset + sym->st_value; BFD_DEBUG_PIC(fprintf (stderr, "local symbols reloc \ -(section=%d %s) seen in %s\n", \ - r_symndx,\ - local_sections[r_symndx]->name, \ - __PRETTY_FUNCTION__)); +(section=%d %s) seen in %s\n", r_symndx, local_sections[r_symndx]->name, \ + __PRETTY_FUNCTION__)); } } @@ -1751,18 +1545,18 @@ elf_arc_relocate_section (bfd *output_bfd, { asection *msec; msec = sec; - rel->r_addend = _bfd_elf_rel_local_sym (output_bfd, sym, + rel->r_addend = _bfd_elf_rel_local_sym (output_bfd, sym, &msec, rel->r_addend); rel->r_addend -= relocation; rel->r_addend += msec->output_section->vma + msec->output_offset; } - - relocation += rel->r_addend; + + relocation += rel->r_addend; } else { /* Global symbols */ - + /* get the symbol's entry in the symtab */ h = sym_hashes[r_symndx - symtab_hdr->sh_info]; @@ -1782,10 +1576,10 @@ elf_arc_relocate_section (bfd *output_bfd, && elf_hash_table (info)->dynamic_sections_created && (! info->shared || (! info->symbolic && h->dynindx != -1) - || !h->def_regular)) + || (h->def_regular) == 0)) || (info->shared && ((! info->symbolic && h->dynindx != -1) - || !h->def_regular) + || (h->def_regular) == 0) && (r_type == R_ARC_32 || r_type == R_ARC_PC32) && (input_section->flags & SEC_ALLOC) != 0)) @@ -1803,13 +1597,6 @@ elf_arc_relocate_section (bfd *output_bfd, bfd_get_section_name (input_bfd, input_section)); relocation = 0; } - else if (0 && r_type == R_ARC_SDA16_LD2) /* FIXME: delete this piece of code */ - { - relocation = (h->root.u.def.value - + sec->output_offset); - /* add the addend since the arc has RELA relocations */ - relocation += rel->r_addend; - } else { relocation = (h->root.u.def.value @@ -1829,7 +1616,6 @@ elf_arc_relocate_section (bfd *output_bfd, (info, h->root.root.string, input_bfd, input_section, rel->r_offset, TRUE))) return FALSE; - symbol_defined = FALSE; relocation = 0; } } @@ -1858,7 +1644,7 @@ elf_arc_relocate_section (bfd *output_bfd, if (! elf_hash_table (info)->dynamic_sections_created || (info->shared && (info->symbolic || h->dynindx == -1) - && h->def_regular)) + && (h->def_regular))) { /* This is actually a static link, or it is a -Bsymbolic link and the symbol is defined @@ -1908,7 +1694,7 @@ elf_arc_relocate_section (bfd *output_bfd, { asection *srelgot; Elf_Internal_Rela outrel; - bfd_byte *loc; + bfd_byte *loc; srelgot = bfd_get_section_by_name (dynobj, ".rela.got"); BFD_ASSERT (srelgot != NULL); @@ -1933,7 +1719,7 @@ elf_arc_relocate_section (bfd *output_bfd, } BFD_DEBUG_PIC(fprintf(stderr, "RELOCATION =%x\n",relocation)); - /* the data in GOT32 relocs is 4 bytes into the insn */ + /* the data in GOTPC32 relocs is 4 bytes into the insn */ offset_in_insn = 4; break; @@ -1968,7 +1754,7 @@ elf_arc_relocate_section (bfd *output_bfd, } relocation = sgot->output_section->vma; - + offset_in_insn = 4; break; @@ -2008,7 +1794,8 @@ elf_arc_relocate_section (bfd *output_bfd, && (r_type != R_ARC_PC32 || (h != NULL && h->dynindx != -1 - && (!info->symbolic || !h->def_regular)))) + && (! info->symbolic + || (h->def_regular) == 0)))) { Elf_Internal_Rela outrel; bfd_boolean skip, relocate; @@ -2041,13 +1828,13 @@ elf_arc_relocate_section (bfd *output_bfd, skip = FALSE; - outrel.r_offset = _bfd_elf_section_offset (output_bfd, - info, + outrel.r_offset = _bfd_elf_section_offset (output_bfd, + info, input_section, rel->r_offset); if (outrel.r_offset == (bfd_vma) -1) skip = TRUE; - + outrel.r_addend = 0; outrel.r_offset += (input_section->output_section->vma + input_section->output_offset); @@ -2072,7 +1859,7 @@ elf_arc_relocate_section (bfd *output_bfd, become local. */ if (h == NULL || ((info->symbolic || h->dynindx == -1) - && h->def_regular)) + && (h->def_regular) != 0)) { relocate = TRUE; outrel.r_addend = 0; @@ -2114,38 +1901,7 @@ elf_arc_relocate_section (bfd *output_bfd, offset_in_insn = -4; break; - case R_ARC_SDA32_ME: - - case R_ARC_SDA_LDST: - case R_ARC_SDA_LDST1: - case R_ARC_SDA_LDST2: - - case R_ARC_SDA16_LD: - case R_ARC_SDA16_LD1: - case R_ARC_SDA16_LD2: - { - /* Get the base of .sdata section */ - struct elf_link_hash_entry *h; - - h = elf_link_hash_lookup (elf_hash_table (info), "__SDATA_BEGIN__", - FALSE, FALSE, TRUE); - - if (h->root.type == bfd_link_hash_undefined) - { - (*_bfd_error_handler)("Error: Linker symbol __SDATA_BEGIN__ not found"); - bfd_set_error (bfd_error_bad_value); - return FALSE; - } - - /* Subtract the address of __SDATA_BEGIN__ from the relocation value */ - /// fprintf (stderr, "relocation BEFORE = 0x%x SDATA_BEGIN = 0x%x\n", relocation, h->root.u.def.value); - relocation -= (h->root.u.def.value + h->root.u.def.section->output_section->vma); - // fprintf (stderr, "relocation AFTER = 0x%x SDATA_BEGIN = 0x%x\n", relocation, h->root.u.def.value); - break; - } default: - /* FIXME: Putting in a random dummy relocation value for the time being */ - // fprintf (stderr, "In %s, relocation = 0x%x, r_type = %d\n", __PRETTY_FUNCTION__, relocation, r_type); break; } @@ -2158,50 +1914,36 @@ elf_arc_relocate_section (bfd *output_bfd, insn = bfd_get_32_me (input_bfd, contents + rel->r_offset); else insn = bfd_get_32 (input_bfd, contents + rel->r_offset); - - BFD_DEBUG_PIC(fprintf(stderr, "relocation before the pc relative stuff @offset 0x%x= %d[0x%x]\n", + + BFD_DEBUG_PIC(fprintf(stderr, "relocation before the pc relative stuff @offset 0x%x= %d[0x%x]\n", rel->r_offset,relocation, relocation)); BFD_DEBUG_PIC(fprintf(stderr,"addend = 0x%x\n",rel->r_addend)); /* For branches we need to find the offset from pcl rounded down to 4 byte boundary.Hence the (& ~3) */ - if (howto->pc_relative || r_type==R_ARC_PLT32 || r_type==R_ARC_GOTPC || r_type==R_ARC_GOTPC32) + if (howto->pc_relative || r_type==R_ARC_PLT32 || r_type==R_ARC_GOTPC) { - relocation -= (((input_section->output_section->vma + input_section->output_offset + rel->r_offset) & ~3) - offset_in_insn ); + relocation -= (((input_section->output_section->vma + input_section->output_offset + + rel->r_offset) & ~3) - offset_in_insn ); } -#if 0 else if (r_type==R_ARC_GOTPC32) { - relocation -= (input_section->output_section->vma + - input_section->output_offset + rel->r_offset + relocation -= (input_section->output_section->vma + + input_section->output_offset + rel->r_offset - offset_in_insn ); } -#endif - BFD_DEBUG_PIC(fprintf(stderr, "relocation AFTER the pc relative handling = %d[0x%x]\n", relocation, relocation)); + BFD_DEBUG_PIC(fprintf(stderr, \ + "relocation AFTER the pc relative \ +handling = %d[0x%x]\n", relocation, relocation)); /* What does the modified insn look like */ - insn = arc_plugin_one_reloc (insn, rel, relocation, - &overflow_detected, symbol_defined); - - if (overflow_detected) - { - if(h) - (*_bfd_error_handler) ("Global symbol: \"%s\".", h->root.root.string); - else - (*_bfd_error_handler) ("Local symbol: \"%s\".", local_sections[r_symndx]->name); - (*_bfd_error_handler) ("\nRelocation type is:%s \nFileName:%s \ - \nSection Name:%s\ - \nOffset in Section:%ld", howto->name, bfd_get_filename (input_bfd), - bfd_get_section_name (input_bfd, input_section), - rel->r_offset); + insn = arc_plugin_one_reloc (insn, r_type, relocation); - return FALSE; - } - - BFD_DEBUG_PIC (fprintf (stderr, "Relocation = %d [0x%x]\n", relocation, relocation)); + BFD_DEBUG_PIC (fprintf (stderr, "Relocation = %d [0x%x]\n", \ + relocation, relocation)); /* now write back into the section, with middle endian encoding only for executable section */ @@ -2214,7 +1956,7 @@ elf_arc_relocate_section (bfd *output_bfd, bfd_put_32 (input_bfd, insn, contents + rel->r_offset); r = bfd_reloc_ok; - + if (r != bfd_reloc_ok) { @@ -2239,34 +1981,35 @@ elf_arc_relocate_section (bfd *output_bfd, if (*name == '\0') name = bfd_section_name (input_bfd, sec); } + /* if (! ((*info->callbacks->reloc_overflow) - (info, (h ? &h->root : NULL), name, howto->name, - (bfd_vma) 0, input_bfd, input_section, rel->r_offset))) - return FALSE; + (info, name, howto->name, (bfd_vma) 0, + input_bfd, input_section, rel->r_offset))) + return FALSE;*/ } break; } } - + } - + return TRUE; } /* Function : elf_arc_finish_dynamic_symbol * Brief : Finish up dynamic symbol handling. We set the - * contents of various dynamic sections here. - * Args : output_bfd : + * contents of various dynamic sections here. + * Args : output_bfd : * info : * h : * sym : * Returns : True/False as the return status. */ static bfd_boolean -elf_arc_finish_dynamic_symbol (bfd *output_bfd, - struct bfd_link_info *info, - struct elf_link_hash_entry *h, +elf_arc_finish_dynamic_symbol (bfd *output_bfd, + struct bfd_link_info *info, + struct elf_link_hash_entry *h, Elf_Internal_Sym *sym) { bfd *dynobj; @@ -2350,7 +2093,7 @@ elf_arc_finish_dynamic_symbol (bfd *output_bfd, bfd_elf32_swap_reloca_out (output_bfd, &rel, loc); - if (!h->def_regular) + if ((h->def_regular) == 0) { /* Mark the symbol as undefined, rather than as defined in the .plt section. Leave the value alone. */ @@ -2384,7 +2127,7 @@ elf_arc_finish_dynamic_symbol (bfd *output_bfd, initialized in the relocate_section function. */ if (info->shared && (info->symbolic || h->dynindx == -1) - && h->def_regular) + && (h->def_regular)) { rel.r_addend = 0; rel.r_info = ELF32_R_INFO (0, R_ARC_RELATIVE); @@ -2398,12 +2141,12 @@ elf_arc_finish_dynamic_symbol (bfd *output_bfd, } loc = srel->contents; - loc += srel->reloc_count++ * sizeof (Elf32_External_Rela);/* relA */ - + loc += srel->reloc_count++ * sizeof (Elf32_External_Rel); + bfd_elf32_swap_reloca_out (output_bfd, &rel, loc); } - if (h->needs_copy) + if ((h->needs_copy) != 0) { asection *s; Elf_Internal_Rela rel; @@ -2418,8 +2161,7 @@ elf_arc_finish_dynamic_symbol (bfd *output_bfd, s = bfd_get_section_by_name (h->root.u.def.section->owner, ".rela.bss"); BFD_ASSERT (s != NULL); - - rel.r_addend = 0; + rel.r_offset = (h->root.u.def.value + h->root.u.def.section->output_section->vma + h->root.u.def.section->output_offset); @@ -2427,7 +2169,7 @@ elf_arc_finish_dynamic_symbol (bfd *output_bfd, loc = s->contents; loc += s->reloc_count++ * sizeof (Elf32_External_Rela); /* relA */ - + bfd_elf32_swap_reloca_out (output_bfd, &rel, loc); } @@ -2442,15 +2184,14 @@ elf_arc_finish_dynamic_symbol (bfd *output_bfd, /* Function : elf_arc_finish_dynamic_sections - * Brief : Finish up the dynamic sections handling. - * Args : output_bfd : + * Brief : Finish up the dynamic sections handling. + * Args : output_bfd : * info : * h : * sym : * Returns : True/False as the return status. */ -static bfd_boolean -elf_arc_finish_dynamic_sections (bfd *output_bfd,struct bfd_link_info *info) +static bfd_boolean elf_arc_finish_dynamic_sections (bfd * output_bfd, struct bfd_link_info *info) { bfd *dynobj; asection *sgot; @@ -2473,7 +2214,7 @@ elf_arc_finish_dynamic_sections (bfd *output_bfd,struct bfd_link_info *info) BFD_ASSERT (splt != NULL && sdyn != NULL); dyncon = (Elf32_External_Dyn *) sdyn->contents; - dynconend = (Elf32_External_Dyn *) (sdyn->contents + sdyn->size); + dynconend = (Elf32_External_Dyn *) (sdyn->contents + sdyn->rawsize); for (; dyncon < dynconend; dyncon++) { Elf_Internal_Dyn dyn; @@ -2524,8 +2265,7 @@ elf_arc_finish_dynamic_sections (bfd *output_bfd,struct bfd_link_info *info) else { (*_bfd_error_handler) - ("warning: specified init/fini symbol %s not found.Defaulting to address of symbol %s", - name, oldname); + ("warning: specified init/fini symbol %s not found.Defaulting to address of symbol %s", name, oldname); /* restore the default name */ name = oldname; @@ -2547,15 +2287,15 @@ elf_arc_finish_dynamic_sections (bfd *output_bfd,struct bfd_link_info *info) library and does not apply to this one. */ dyn.d_un.d_val = 0; } - + bfd_elf32_swap_dyn_out (dynobj, &dyn, dyncon); } - + } } break; - + case DT_PLTGOT: name = ".plt"; goto get_vma; @@ -2571,7 +2311,10 @@ elf_arc_finish_dynamic_sections (bfd *output_bfd,struct bfd_link_info *info) case DT_PLTRELSZ: s = bfd_get_section_by_name (output_bfd, ".rela.plt"); BFD_ASSERT (s != NULL); - dyn.d_un.d_val = s->size; + if (s->size != 0) + dyn.d_un.d_val = s->size; + else + dyn.d_un.d_val = s->rawsize; bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon); break; @@ -2587,21 +2330,25 @@ elf_arc_finish_dynamic_sections (bfd *output_bfd,struct bfd_link_info *info) about changing the DT_REL entry. */ s = bfd_get_section_by_name (output_bfd, ".rela.plt"); if (s != NULL) - dyn.d_un.d_val -= s->size; + { + if (s->size != 0) + dyn.d_un.d_val -= s->size; + else + dyn.d_un.d_val -= s->rawsize; + } bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon); break; } } /* Fill in the first entry in the procedure linkage table. */ - if (splt->size > 0) + if (splt->rawsize > 0) { if (info->shared) { memcpy (splt->contents, elf_arc_pic_plt0_entry, 2 * PLT_ENTRY_SIZE); - - /* fill in the _DYNAMIC@GOTPC+4 and - _DYNAMIC@GOTPC+8 at PLT0+4 and PLT0+12 */ + + /* fill in the _DYNAMIC@GOTPC+4 and _DYNAMIC@GOTPC+8 at PLT0+4 and PLT0+12 */ bfd_put_32_me (output_bfd, ( sgot->output_section->vma + sgot->output_offset + 4 ) -(splt->output_section->vma + splt->output_offset ), @@ -2610,7 +2357,7 @@ elf_arc_finish_dynamic_sections (bfd *output_bfd,struct bfd_link_info *info) (sgot->output_section->vma + sgot->output_offset + 8) -(splt->output_section->vma + splt->output_offset +8), splt->contents + 12); - + /* put got base at plt0+12 */ bfd_put_32 (output_bfd, (sgot->output_section->vma + sgot->output_offset), @@ -2648,7 +2395,7 @@ elf_arc_finish_dynamic_sections (bfd *output_bfd,struct bfd_link_info *info) /* Fill in the first three entries in the global offset table. */ - if (sgot->size > 0) + if (sgot->rawsize > 0) { if (sdyn == NULL) bfd_put_32 (output_bfd, (bfd_vma) 0, sgot->contents); @@ -2671,9 +2418,7 @@ elf_arc_finish_dynamic_sections (bfd *output_bfd,struct bfd_link_info *info) change the definition to something the rest of the link can understand. */ -static bfd_boolean -elf_arc_adjust_dynamic_symbol (struct bfd_link_info *info, - struct elf_link_hash_entry *h) +static bfd_boolean elf_arc_adjust_dynamic_symbol (struct bfd_link_info * info, struct elf_link_hash_entry *h) { bfd *dynobj; asection *s; @@ -2683,23 +2428,28 @@ elf_arc_adjust_dynamic_symbol (struct bfd_link_info *info, /* Make sure we know what is going on here. */ BFD_ASSERT (dynobj != NULL - && (h->needs_plt + && ((h->needs_plt) || h->u.weakdef != NULL - || (h->def_dynamic && h->ref_regular && !h->def_regular))); + || ((h->def_dynamic) != 0 + && (h->ref_regular) != 0 + && (h->def_regular) == 0))); /* If this is a function, put it in the procedure linkage table. We will fill in the contents of the procedure linkage table later, when we know the address of the .got section. */ - if (h->type == STT_FUNC || h->needs_plt) + if (h->type == STT_FUNC + || (h->needs_plt) != 0) { - if (!info->shared && !h->def_dynamic && !h->ref_dynamic) + if (! info->shared + && (h->def_dynamic) == 0 + && (h->ref_dynamic) == 0) { /* This case can occur if we saw a PLT32 reloc in an input file, but the symbol was never referred to by a dynamic object. In such a case, we don't actually need to build a procedure linkage table, and we can just do a PC32 reloc instead. */ - BFD_ASSERT (h->needs_plt); + BFD_ASSERT ((h->needs_plt) != 0); return TRUE; } @@ -2715,43 +2465,44 @@ elf_arc_adjust_dynamic_symbol (struct bfd_link_info *info, /* If this is the first .plt entry, make room for the special first entry. */ - if (s->size == 0) - { - s->size += 2 *PLT_ENTRY_SIZE; - BFD_DEBUG_PIC (fprintf (stderr, "first plt entry at %d\n", s->size)); - } - else + if (s->rawsize == 0) { - BFD_DEBUG_PIC (fprintf (stderr, "Next plt entry at %d\n", s->size)); + s->rawsize += 2 *PLT_ENTRY_SIZE; + BFD_DEBUG_PIC (fprintf (stderr, "first plt entry at %d\n", s->rawsize)); } - + else { + BFD_DEBUG_PIC (fprintf (stderr, "Next plt entry at %d\n", s->rawsize)); + printf("Unimplimented path: elf32-arc.c: "); + } + /* If this symbol is not defined in a regular file, and we are not generating a shared library, then set the symbol to this location in the .plt. This is required to make function pointers compare as equal between the normal executable and the shared library. */ - if (!info->shared && !h->def_regular) + if (! info->shared + && (h->def_regular) == 0) { h->root.u.def.section = s; - h->root.u.def.value = s->size; + h->root.u.def.value = s->rawsize; } - h->plt.offset = s->size; + h->plt.offset = s->rawsize; /* Make room for this entry. */ - s->size += PLT_ENTRY_SIZE; + s->rawsize += PLT_ENTRY_SIZE; /* We also need to make an entry in the .got.plt section, which will be placed in the .got section by the linker script. */ s = bfd_get_section_by_name (dynobj, ".got.plt"); BFD_ASSERT (s != NULL); - s->size += 4; + s->rawsize += 4; /* We also need to make an entry in the .rela.plt section. */ s = bfd_get_section_by_name (dynobj, ".rela.plt"); BFD_ASSERT (s != NULL); - s->size += sizeof (Elf32_External_Rela); + s->rawsize += sizeof (Elf32_External_Rela); return TRUE; } @@ -2801,7 +2552,7 @@ elf_arc_adjust_dynamic_symbol (struct bfd_link_info *info, srel = bfd_get_section_by_name (dynobj, ".rela.bss"); BFD_ASSERT (srel != NULL); - srel->size += sizeof (Elf32_External_Rela); + srel->rawsize += sizeof (Elf32_External_Rela); h->needs_copy = 1; } @@ -2812,7 +2563,8 @@ elf_arc_adjust_dynamic_symbol (struct bfd_link_info *info, power_of_two = 3; /* Apply the required alignment. */ - s->size = BFD_ALIGN (s->size, (bfd_size_type) (1 << power_of_two)); + s->rawsize = BFD_ALIGN (s->rawsize, + (bfd_size_type) (1 << power_of_two)); if (power_of_two > bfd_get_section_alignment (dynobj, s)) { if (! bfd_set_section_alignment (dynobj, s, power_of_two)) @@ -2821,10 +2573,10 @@ elf_arc_adjust_dynamic_symbol (struct bfd_link_info *info, /* Define the symbol as being at this point in the section. */ h->root.u.def.section = s; - h->root.u.def.value = s->size; + h->root.u.def.value = s->rawsize; /* Increment the section size to make room for the symbol. */ - s->size += h->size; + s->rawsize += h->size; return TRUE; } @@ -2832,7 +2584,7 @@ elf_arc_adjust_dynamic_symbol (struct bfd_link_info *info, /* Set the sizes of the dynamic sections. */ static bfd_boolean -elf_arc_size_dynamic_sections (bfd *output_bfd, +elf_arc_size_dynamic_sections (bfd *output_bfd, struct bfd_link_info *info) { bfd *dynobj; @@ -2847,13 +2599,13 @@ elf_arc_size_dynamic_sections (bfd *output_bfd, if (elf_hash_table (info)->dynamic_sections_created) { struct elf_link_hash_entry *h; - + /* Set the contents of the .interp section to the interpreter. */ if (! info->shared) { s = bfd_get_section_by_name (dynobj, ".interp"); BFD_ASSERT (s != NULL); - s->size = sizeof ELF_DYNAMIC_INTERPRETER; + s->rawsize = sizeof ELF_DYNAMIC_INTERPRETER; s->contents = (unsigned char *) ELF_DYNAMIC_INTERPRETER; } @@ -2861,13 +2613,13 @@ elf_arc_size_dynamic_sections (bfd *output_bfd, values later, in elf_bfd_final_link, but we must add the entries now so that we know the final size of the .dynamic section. */ /* Checking if the .init section is present. We also create DT_INIT / DT_FINE - * entries if the init_str has been changed by the user + * entries if the init_str has been changed by the user */ h = elf_link_hash_lookup (elf_hash_table (info), "init", FALSE, FALSE, FALSE); if ((h != NULL - && (h->ref_regular || h->def_regular)) - || (strcmp (init_str, INIT_SYM_STRING) != 0)) + && (h->ref_regular || h->def_regular) != 0) + || (strcmp(init_str,INIT_SYM_STRING) != 0)) { /*Ravi: changed from bfd_elf32_add_dynamic_entry */ if (! _bfd_elf_add_dynamic_entry (info, DT_INIT, 0)) @@ -2876,9 +2628,9 @@ elf_arc_size_dynamic_sections (bfd *output_bfd, h = elf_link_hash_lookup (elf_hash_table (info), "fini", FALSE, FALSE, FALSE); if ((h != NULL - && (h->ref_regular || h->def_regular)) - || (strcmp (fini_str, FINI_SYM_STRING) != 0)) - + && (h->ref_regular || h->def_regular) != 0) + || (strcmp(fini_str,FINI_SYM_STRING) != 0)) + { /*Ravi: changed from bfd_elf32_add_dynamic_entry */ if (! _bfd_elf_add_dynamic_entry (info, DT_FINI, 0)) @@ -2895,7 +2647,7 @@ elf_arc_size_dynamic_sections (bfd *output_bfd, below. */ s = bfd_get_section_by_name (dynobj, ".rela.got"); if (s != NULL) - s->size = 0; + s->rawsize = 0; } /* If this is a -Bsymbolic shared link, then we need to discard all @@ -2905,7 +2657,7 @@ elf_arc_size_dynamic_sections (bfd *output_bfd, if (info->shared && info->symbolic) elf_ARC_link_hash_traverse (elf_ARC_hash_table (info), elf_ARC_discard_copies, - (void *) NULL); + (PTR) NULL); /* The check_relocs and adjust_dynamic_symbol entry points have determined the sizes of the various dynamic sections. Allocate @@ -2929,7 +2681,7 @@ elf_arc_size_dynamic_sections (bfd *output_bfd, if (strcmp (name, ".plt") == 0) { - if (s->size == 0) + if (s->rawsize == 0) { /* Strip this section if we don't need it; see the comment below. */ @@ -2943,7 +2695,7 @@ elf_arc_size_dynamic_sections (bfd *output_bfd, } else if (strncmp (name, ".rela", 5) == 0) { - if (s->size == 0) + if (s->rawsize == 0) { /* If we don't need this section, strip it from the output file. This is mostly to handle .rela.bss and @@ -3008,8 +2760,8 @@ elf_arc_size_dynamic_sections (bfd *output_bfd, } /* Allocate memory for the section contents. */ - s->contents = (bfd_byte *) bfd_alloc (dynobj, s->size); - if (s->contents == NULL && s->size != 0) + s->contents = (bfd_byte *) bfd_alloc (dynobj, s->rawsize); + if (s->contents == NULL && s->rawsize != 0) return FALSE; } @@ -3057,7 +2809,6 @@ elf_arc_size_dynamic_sections (bfd *output_bfd, return TRUE; } - /* Core file support. */ /* Support for core dump NOTE sections. */ @@ -3066,16 +2817,16 @@ elf_arc_grok_prstatus (bfd *abfd, Elf_Internal_Note *note) { int offset; size_t size; - + switch (note->descsz) { default: return FALSE; - + case 240: /* Linux/ARC700 */ /* pr_cursig */ elf_tdata (abfd)->core_signal = bfd_get_16 (abfd, note->descdata + 12); - + /* pr_pid */ elf_tdata (abfd)->core_pid = bfd_get_32 (abfd, note->descdata + 24); @@ -3085,7 +2836,7 @@ elf_arc_grok_prstatus (bfd *abfd, Elf_Internal_Note *note) break; } - + /* Make a ".reg/999" section. */ return _bfd_elfcore_make_pseudosection (abfd, ".reg", @@ -3095,34 +2846,35 @@ elf_arc_grok_prstatus (bfd *abfd, Elf_Internal_Note *note) static bfd_boolean elf_arc_grok_psinfo (bfd *abfd, Elf_Internal_Note *note) { - + switch (note->descsz) { default: return FALSE; - + case 124: /* ARC / Linux elf_prpsinfo. */ elf_tdata (abfd)->core_program = _bfd_elfcore_strndup (abfd, note->descdata + 28, 16); elf_tdata (abfd)->core_command = _bfd_elfcore_strndup (abfd, note->descdata + 44, 80); } - - + + /* Note that for some reason, a spurious space is tacked onto the end of the args in some (at least one anyway) implementations, so strip it off if it exists. */ { char *command = elf_tdata (abfd)->core_command; int n = strlen (command); - + if (0 < n && command[n - 1] == ' ') command[n - 1] = '\0'; } - + return TRUE; } + #define TARGET_LITTLE_SYM bfd_elf32_littlearc_vec #define TARGET_LITTLE_NAME "elf32-littlearc" #define TARGET_BIG_SYM bfd_elf32_bigarc_vec @@ -3132,24 +2884,48 @@ elf_arc_grok_psinfo (bfd *abfd, Elf_Internal_Note *note) #define ELF_MACHINE_ALT1 EM_ARCOMPACT #define ELF_MAXPAGESIZE 0x1000 -#define elf_info_to_howto arc_info_to_howto_rel -#define elf_info_to_howto_rel arc_info_to_howto_rel -#define bfd_elf32_bfd_merge_private_bfd_data arc_elf_merge_private_bfd_data -#define bfd_elf32_bfd_reloc_type_lookup arc_elf32_bfd_reloc_type_lookup -#define elf_backend_object_p arc_elf_object_p -#define elf_backend_final_write_processing arc_elf_final_write_processing -#define elf_backend_relocate_section elf_arc_relocate_section -#define elf_backend_check_relocs elf_arc_check_relocs -#define elf_backend_adjust_dynamic_symbol elf_arc_adjust_dynamic_symbol +#define elf_info_to_howto arc_info_to_howto_rel +#define elf_info_to_howto_rel arc_info_to_howto_rel +#define bfd_elf32_bfd_merge_private_bfd_data \ + arc_elf_merge_private_bfd_data +#define bfd_elf32_bfd_reloc_type_lookup \ + arc_elf32_bfd_reloc_type_lookup +static reloc_howto_type * +bfd_elf32_bfd_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, + const char *r_name) +{ + unsigned int i; + + for (i = 0; + i < sizeof (elf_arc_howto_table) / sizeof (elf_arc_howto_table[0]); + i++) + if (elf_arc_howto_table[i].name != NULL + && strcasecmp (elf_arc_howto_table[i].name, r_name) == 0) + return &elf_arc_howto_table[i]; + + return NULL; +} + +#define elf_backend_object_p arc_elf_object_p +#define elf_backend_final_write_processing \ + arc_elf_final_write_processing +#define elf_backend_relocate_section elf_arc_relocate_section +#define elf_backend_check_relocs elf_arc_check_relocs +#define elf_backend_adjust_dynamic_symbol \ + elf_arc_adjust_dynamic_symbol -#define elf_backend_finish_dynamic_sections elf_arc_finish_dynamic_sections +#define elf_backend_finish_dynamic_sections \ + elf_arc_finish_dynamic_sections -#define elf_backend_finish_dynamic_symbol elf_arc_finish_dynamic_symbol +#define elf_backend_finish_dynamic_symbol \ + elf_arc_finish_dynamic_symbol -#define elf_backend_create_dynamic_sections _bfd_elf_create_dynamic_sections +#define elf_backend_create_dynamic_sections \ + _bfd_elf_create_dynamic_sections -#define elf_backend_size_dynamic_sections elf_arc_size_dynamic_sections +#define elf_backend_size_dynamic_sections \ + elf_arc_size_dynamic_sections #define elf_backend_want_got_plt 1 #define elf_backend_plt_readonly 1 diff --git a/bfd/libbfd.h b/bfd/libbfd.h index 0eced4c..cd21fc9 100644 --- a/bfd/libbfd.h +++ b/bfd/libbfd.h @@ -1408,26 +1408,15 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@", "BFD_RELOC_ARC_S25W_PCREL", "BFD_RELOC_ARC_S13_PCREL", "BFD_RELOC_ARC_32_ME", - "BFD_RELOC_ARC_PC32 ", + "BFD_RELOC_ARC_PC32", "BFD_RELOC_ARC_GOTPC32", - "BFD_RELOC_ARC_PLT32 ", + "BFD_RELOC_ARC_PLT32", "BFD_RELOC_ARC_COPY", "BFD_RELOC_ARC_GLOB_DAT", "BFD_RELOC_ARC_JMP_SLOT", "BFD_RELOC_ARC_RELATIVE", "BFD_RELOC_ARC_GOTOFF", "BFD_RELOC_ARC_GOTPC", - "BFD_RELOC_ARC_GOT32", - "BFD_RELOC_ARC_SDA", - "BFD_RELOC_ARC_SDA32", - "BFD_RELOC_ARC_SDA_LDST", - "BFD_RELOC_ARC_SDA_LDST1", - "BFD_RELOC_ARC_SDA_LDST2", - "BFD_RELOC_ARC_SDA16_LD", - "BFD_RELOC_ARC_SDA16_LD1", - "BFD_RELOC_ARC_SDA16_LD2", - "BFD_RELOC_ARC_SDA32_ME", - "BFD_RELOC_BFIN_16_IMM", "BFD_RELOC_BFIN_16_HIGH", "BFD_RELOC_BFIN_4_PCREL", diff --git a/bfd/po/SRC-POTFILES.in b/bfd/po/SRC-POTFILES.in index 5a3d361..afe567a 100644 --- a/bfd/po/SRC-POTFILES.in +++ b/bfd/po/SRC-POTFILES.in @@ -134,6 +134,12 @@ ecoffswap.h efi-app-ia32.c efi-app-ia64.c efi-app-x86_64.c +efi-bsdrv-ia32.c +efi-bsdrv-ia64.c +efi-bsdrv-x86_64.c +efi-rtdrv-ia32.c +efi-rtdrv-ia64.c +efi-rtdrv-x86_64.c elf32-am33lin.c elf32-arc.c elf32-arm.c diff --git a/bfd/po/bfd.pot b/bfd/po/bfd.pot index 81d7dba..594afcf 100644 --- a/bfd/po/bfd.pot +++ b/bfd/po/bfd.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: bug-binutils@gnu.org\n" -"POT-Creation-Date: 2007-09-17 15:01+0100\n" +"POT-Creation-Date: 2009-03-23 14:17+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -222,29 +222,29 @@ msgstr "" msgid "%B: unsupported relocation: ALPHA_R_GPRELLOW" msgstr "" -#: coff-alpha.c:1574 elf32-m32r.c:2487 elf64-alpha.c:3953 elf64-alpha.c:4106 +#: coff-alpha.c:1574 elf32-m32r.c:2487 elf64-alpha.c:3970 elf64-alpha.c:4125 #: elf32-ia64.c:4468 elf64-ia64.c:4468 msgid "%B: unknown relocation type %d" msgstr "" -#: coff-arm.c:1036 +#: coff-arm.c:1039 #, c-format msgid "%B: unable to find THUMB glue '%s' for `%s'" msgstr "" -#: coff-arm.c:1065 +#: coff-arm.c:1068 #, c-format msgid "%B: unable to find ARM glue '%s' for `%s'" msgstr "" -#: coff-arm.c:1367 elf32-arm.c:4167 +#: coff-arm.c:1370 elf32-arm.c:4299 #, c-format msgid "" "%B(%s): warning: interworking not enabled.\n" " first occurrence: %B: arm call to thumb" msgstr "" -#: coff-arm.c:1457 +#: coff-arm.c:1460 #, c-format msgid "" "%B(%s): warning: interworking not enabled.\n" @@ -252,105 +252,105 @@ msgid "" " consider relinking with --support-old-code enabled" msgstr "" -#: coff-arm.c:1750 cofflink.c:3018 coff-tic80.c:695 +#: coff-arm.c:1755 cofflink.c:3018 coff-tic80.c:695 msgid "%B: bad reloc address 0x%lx in section `%A'" msgstr "" -#: coff-arm.c:2075 +#: coff-arm.c:2080 msgid "%B: illegal symbol index in reloc: %d" msgstr "" -#: coff-arm.c:2206 +#: coff-arm.c:2211 #, c-format msgid "ERROR: %B is compiled for APCS-%d, whereas %B is compiled for APCS-%d" msgstr "" -#: coff-arm.c:2222 elf32-arm.c:7072 +#: coff-arm.c:2227 elf32-arm.c:7255 #, c-format msgid "" "ERROR: %B passes floats in float registers, whereas %B passes them in " "integer registers" msgstr "" -#: coff-arm.c:2225 elf32-arm.c:7076 +#: coff-arm.c:2230 elf32-arm.c:7259 #, c-format msgid "" "ERROR: %B passes floats in integer registers, whereas %B passes them in " "float registers" msgstr "" -#: coff-arm.c:2239 +#: coff-arm.c:2244 #, c-format msgid "" "ERROR: %B is compiled as position independent code, whereas target %B is " "absolute position" msgstr "" -#: coff-arm.c:2242 +#: coff-arm.c:2247 #, c-format msgid "" "ERROR: %B is compiled as absolute position code, whereas target %B is " "position independent" msgstr "" -#: coff-arm.c:2270 elf32-arm.c:7141 +#: coff-arm.c:2275 elf32-arm.c:7324 #, c-format msgid "Warning: %B supports interworking, whereas %B does not" msgstr "" -#: coff-arm.c:2273 elf32-arm.c:7147 +#: coff-arm.c:2278 elf32-arm.c:7330 #, c-format msgid "Warning: %B does not support interworking, whereas %B does" msgstr "" -#: coff-arm.c:2297 +#: coff-arm.c:2302 #, c-format msgid "private flags = %x:" msgstr "" -#: coff-arm.c:2305 elf32-arm.c:7198 +#: coff-arm.c:2310 elf32-arm.c:7381 #, c-format msgid " [floats passed in float registers]" msgstr "" -#: coff-arm.c:2307 +#: coff-arm.c:2312 #, c-format msgid " [floats passed in integer registers]" msgstr "" -#: coff-arm.c:2310 elf32-arm.c:7201 +#: coff-arm.c:2315 elf32-arm.c:7384 #, c-format msgid " [position independent]" msgstr "" -#: coff-arm.c:2312 +#: coff-arm.c:2317 #, c-format msgid " [absolute position]" msgstr "" -#: coff-arm.c:2316 +#: coff-arm.c:2321 #, c-format msgid " [interworking flag not initialised]" msgstr "" -#: coff-arm.c:2318 +#: coff-arm.c:2323 #, c-format msgid " [interworking supported]" msgstr "" -#: coff-arm.c:2320 +#: coff-arm.c:2325 #, c-format msgid " [interworking not supported]" msgstr "" -#: coff-arm.c:2366 elf32-arm.c:6578 +#: coff-arm.c:2371 elf32-arm.c:6763 #, c-format msgid "" "Warning: Not setting interworking flag of %B since it has already been " "specified as non-interworking" msgstr "" -#: coff-arm.c:2370 elf32-arm.c:6582 +#: coff-arm.c:2375 elf32-arm.c:6767 #, c-format msgid "Warning: Clearing the interworking flag of %B due to outside request" msgstr "" @@ -426,7 +426,7 @@ msgstr "" msgid "uncertain calling convention for non-COFF symbol" msgstr "" -#: cofflink.c:513 elflink.c:4175 +#: cofflink.c:513 elflink.c:4217 msgid "Warning: type of symbol `%s' changed from %d to %d in %B" msgstr "" @@ -444,7 +444,7 @@ msgstr "" msgid "%s: warning: %s: line number overflow: 0x%lx > 0xffff" msgstr "" -#: coff-m68k.c:506 elf32-bfin.c:5434 elf32-m68k.c:2400 +#: coff-m68k.c:506 elf32-bfin.c:5414 elf32-m68k.c:2405 msgid "unsupported reloc type" msgstr "" @@ -646,415 +646,427 @@ msgid "" " Type: %s" msgstr "" -#: elf32-arm.c:2524 +#: elf32-arc.c:625 +msgid "" +"ERROR: Endian Match failed . Attempting to link %B with binary %s of " +"opposite endian-ness" +msgstr "" + +#: elf32-arc.c:641 +msgid "" +"\\ERROR: Attempting to link an %s binary(%B) with a binary incompatible %s " +"binary(%s)" +msgstr "" + +#: elf32-arm.c:2538 #, c-format msgid "unable to find THUMB glue '%s' for '%s'" msgstr "" -#: elf32-arm.c:2557 +#: elf32-arm.c:2572 #, c-format msgid "unable to find ARM glue '%s' for '%s'" msgstr "" -#: elf32-arm.c:3127 +#: elf32-arm.c:3242 msgid "%B: BE8 images only valid in big-endian mode." msgstr "" #. Give a warning, but do as the user requests anyway. -#: elf32-arm.c:3331 +#: elf32-arm.c:3462 msgid "" "%B: warning: selected VFP11 erratum workaround is not necessary for target " "architecture" msgstr "" -#: elf32-arm.c:3865 elf32-arm.c:3885 +#: elf32-arm.c:3996 elf32-arm.c:4016 msgid "%B: unable to find VFP11 veneer `%s'" msgstr "" -#: elf32-arm.c:3930 +#: elf32-arm.c:4061 #, c-format msgid "Invalid TARGET2 relocation type '%s'." msgstr "" -#: elf32-arm.c:4071 +#: elf32-arm.c:4203 msgid "" "%B(%s): warning: interworking not enabled.\n" " first occurrence: %B: thumb call to arm" msgstr "" -#: elf32-arm.c:4759 +#: elf32-arm.c:4930 msgid "\\%B: Warning: Arm BLX instruction targets Arm function '%s'." msgstr "" -#: elf32-arm.c:5059 +#: elf32-arm.c:5230 msgid "%B: Warning: Thumb BLX instruction targets thumb function '%s'." msgstr "" -#: elf32-arm.c:5689 +#: elf32-arm.c:5860 msgid "%B(%A+0x%lx): R_ARM_TLS_LE32 relocation not permitted in shared object" msgstr "" -#: elf32-arm.c:5890 +#: elf32-arm.c:6075 msgid "" "%B(%A+0x%lx): Only ADD or SUB instructions are allowed for ALU group " "relocations" msgstr "" -#: elf32-arm.c:5930 elf32-arm.c:6017 elf32-arm.c:6100 elf32-arm.c:6185 +#: elf32-arm.c:6115 elf32-arm.c:6202 elf32-arm.c:6285 elf32-arm.c:6370 msgid "%B(%A+0x%lx): Overflow whilst splitting 0x%lx for group relocation %s" msgstr "" -#: elf32-arm.c:6369 elf32-sh.c:3304 elf64-sh64.c:1556 +#: elf32-arm.c:6554 elf32-sh.c:3308 elf64-sh64.c:1556 msgid "%B(%A+0x%lx): %s relocation against SEC_MERGE section" msgstr "" -#: elf32-arm.c:6458 elf64-ppc.c:10050 +#: elf32-arm.c:6643 elf64-ppc.c:10111 msgid "%B(%A+0x%lx): %s used with TLS symbol %s" msgstr "" -#: elf32-arm.c:6459 elf64-ppc.c:10051 +#: elf32-arm.c:6644 elf64-ppc.c:10112 msgid "%B(%A+0x%lx): %s used with non-TLS symbol %s" msgstr "" -#: elf32-arm.c:6482 elf32-i386.c:3492 elf32-m32r.c:2598 elf32-m68k.c:1989 -#: elf32-ppc.c:6796 elf32-s390.c:3048 elf32-sh.c:3408 elf32-xtensa.c:2290 -#: elf64-ppc.c:11215 elf64-s390.c:3009 elf64-sh64.c:1648 elf64-x86-64.c:3168 -#: elf-hppa.h:2194 elf-m10300.c:1460 elfxx-sparc.c:3256 +#: elf32-arm.c:6667 elf32-i386.c:3499 elf32-m32r.c:2598 elf32-m68k.c:1994 +#: elf32-ppc.c:6909 elf32-s390.c:3058 elf32-sh.c:3412 elf32-xtensa.c:2268 +#: elf64-ppc.c:11254 elf64-s390.c:3019 elf64-sh64.c:1648 elf64-x86-64.c:3176 +#: elf-hppa.h:2201 elf-m10300.c:1546 elfxx-sparc.c:3268 msgid "%B(%A+0x%lx): unresolvable %s relocation against symbol `%s'" msgstr "" -#: elf32-arm.c:6516 +#: elf32-arm.c:6701 msgid "out of range" msgstr "" -#: elf32-arm.c:6520 +#: elf32-arm.c:6705 msgid "unsupported relocation" msgstr "" -#: elf32-arm.c:6528 +#: elf32-arm.c:6713 msgid "unknown error" msgstr "" -#: elf32-arm.c:6628 +#: elf32-arm.c:6812 msgid "" "Warning: Clearing the interworking flag of %B because non-interworking code " "in %B has been linked with it" msgstr "" -#: elf32-arm.c:6730 +#: elf32-arm.c:6914 msgid "ERROR: %B uses VFP register arguments, %B does not" msgstr "" -#: elf32-arm.c:6780 +#: elf32-arm.c:6964 msgid "ERROR: %B: Conflicting architecture profiles %c/%c" msgstr "" -#: elf32-arm.c:6795 +#: elf32-arm.c:6979 msgid "Warning: %B: Conflicting platform configuration" msgstr "" -#: elf32-arm.c:6804 +#: elf32-arm.c:6988 msgid "ERROR: %B: Conflicting use of R9" msgstr "" -#: elf32-arm.c:6816 +#: elf32-arm.c:7000 msgid "ERROR: %B: SB relative addressing conflicts with use of R9" msgstr "" -#: elf32-arm.c:6838 +#: elf32-arm.c:7022 msgid "ERROR: %B: Conflicting definitions of wchar_t" msgstr "" -#: elf32-arm.c:6867 +#: elf32-arm.c:7051 msgid "" "warning: %B uses %s enums yet the output is to use %s enums; use of enum " "values across objects may fail" msgstr "" -#: elf32-arm.c:6880 +#: elf32-arm.c:7064 msgid "ERROR: %B uses iWMMXt register arguments, %B does not" msgstr "" -#: elf32-arm.c:6920 +#: elf32-arm.c:7104 msgid "Warning: %B: Unknown EABI object attribute %d" msgstr "" -#: elf32-arm.c:7045 +#: elf32-arm.c:7228 msgid "" "ERROR: Source object %B has EABI version %d, but target %B has EABI version %" "d" msgstr "" -#: elf32-arm.c:7061 +#: elf32-arm.c:7244 msgid "ERROR: %B is compiled for APCS-%d, whereas target %B uses APCS-%d" msgstr "" -#: elf32-arm.c:7086 +#: elf32-arm.c:7269 msgid "ERROR: %B uses VFP instructions, whereas %B does not" msgstr "" -#: elf32-arm.c:7090 +#: elf32-arm.c:7273 msgid "ERROR: %B uses FPA instructions, whereas %B does not" msgstr "" -#: elf32-arm.c:7100 +#: elf32-arm.c:7283 msgid "ERROR: %B uses Maverick instructions, whereas %B does not" msgstr "" -#: elf32-arm.c:7104 +#: elf32-arm.c:7287 msgid "ERROR: %B does not use Maverick instructions, whereas %B does" msgstr "" -#: elf32-arm.c:7123 +#: elf32-arm.c:7306 msgid "ERROR: %B uses software FP, whereas %B uses hardware FP" msgstr "" -#: elf32-arm.c:7127 +#: elf32-arm.c:7310 msgid "ERROR: %B uses hardware FP, whereas %B uses software FP" msgstr "" #. Ignore init flag - it may not be set, despite the flags field #. containing valid data. #. Ignore init flag - it may not be set, despite the flags field containing valid data. -#: elf32-arm.c:7174 elf32-bfin.c:4795 elf32-cris.c:3234 elf32-m68hc1x.c:1277 -#: elf32-m68k.c:623 elf32-score.c:3753 elf32-vax.c:538 elfxx-mips.c:11351 +#: elf32-arm.c:7357 elf32-bfin.c:4803 elf32-cris.c:3235 elf32-m68hc1x.c:1274 +#: elf32-m68k.c:623 elf32-score.c:3750 elf32-vax.c:538 elfxx-mips.c:11714 #, c-format msgid "private flags = %lx:" msgstr "" -#: elf32-arm.c:7183 +#: elf32-arm.c:7366 #, c-format msgid " [interworking enabled]" msgstr "" -#: elf32-arm.c:7191 +#: elf32-arm.c:7374 #, c-format msgid " [VFP float format]" msgstr "" -#: elf32-arm.c:7193 +#: elf32-arm.c:7376 #, c-format msgid " [Maverick float format]" msgstr "" -#: elf32-arm.c:7195 +#: elf32-arm.c:7378 #, c-format msgid " [FPA float format]" msgstr "" -#: elf32-arm.c:7204 +#: elf32-arm.c:7387 #, c-format msgid " [new ABI]" msgstr "" -#: elf32-arm.c:7207 +#: elf32-arm.c:7390 #, c-format msgid " [old ABI]" msgstr "" -#: elf32-arm.c:7210 +#: elf32-arm.c:7393 #, c-format msgid " [software FP]" msgstr "" -#: elf32-arm.c:7219 +#: elf32-arm.c:7402 #, c-format msgid " [Version1 EABI]" msgstr "" -#: elf32-arm.c:7222 elf32-arm.c:7233 +#: elf32-arm.c:7405 elf32-arm.c:7416 #, c-format msgid " [sorted symbol table]" msgstr "" -#: elf32-arm.c:7224 elf32-arm.c:7235 +#: elf32-arm.c:7407 elf32-arm.c:7418 #, c-format msgid " [unsorted symbol table]" msgstr "" -#: elf32-arm.c:7230 +#: elf32-arm.c:7413 #, c-format msgid " [Version2 EABI]" msgstr "" -#: elf32-arm.c:7238 +#: elf32-arm.c:7421 #, c-format msgid " [dynamic symbols use segment index]" msgstr "" -#: elf32-arm.c:7241 +#: elf32-arm.c:7424 #, c-format msgid " [mapping symbols precede others]" msgstr "" -#: elf32-arm.c:7248 +#: elf32-arm.c:7431 #, c-format msgid " [Version3 EABI]" msgstr "" -#: elf32-arm.c:7252 +#: elf32-arm.c:7435 #, c-format msgid " [Version4 EABI]" msgstr "" -#: elf32-arm.c:7256 +#: elf32-arm.c:7439 #, c-format msgid " [Version5 EABI]" msgstr "" -#: elf32-arm.c:7259 +#: elf32-arm.c:7442 #, c-format msgid " [BE8]" msgstr "" -#: elf32-arm.c:7262 +#: elf32-arm.c:7445 #, c-format msgid " [LE8]" msgstr "" -#: elf32-arm.c:7268 +#: elf32-arm.c:7451 #, c-format msgid " " msgstr "" -#: elf32-arm.c:7275 +#: elf32-arm.c:7458 #, c-format msgid " [relocatable executable]" msgstr "" -#: elf32-arm.c:7278 +#: elf32-arm.c:7461 #, c-format msgid " [has entry point]" msgstr "" -#: elf32-arm.c:7283 +#: elf32-arm.c:7466 #, c-format msgid "" msgstr "" -#: elf32-arm.c:7522 elf32-i386.c:1231 elf32-s390.c:1003 elf32-xtensa.c:814 -#: elf64-s390.c:958 elf64-x86-64.c:1011 elfxx-sparc.c:1115 +#: elf32-arm.c:7704 elf32-i386.c:1232 elf32-s390.c:1006 elf32-xtensa.c:821 +#: elf64-s390.c:961 elf64-x86-64.c:1012 elfxx-sparc.c:1117 msgid "%B: bad symbol index: %d" msgstr "" -#: elf32-arm.c:8080 elf32-cris.c:2400 elf32-hppa.c:1906 elf32-i370.c:506 -#: elf32-i386.c:1801 elf32-m32r.c:1931 elf32-m68k.c:1338 elf32-ppc.c:4314 -#: elf32-s390.c:1679 elf32-sh.c:2584 elf32-vax.c:1050 elf64-ppc.c:5906 -#: elf64-s390.c:1654 elf64-sh64.c:3438 elf64-x86-64.c:1631 elf-m10300.c:4207 -#: elfxx-sparc.c:1797 +#: elf32-arm.c:8265 elf32-cris.c:2403 elf32-hppa.c:1920 elf32-i370.c:506 +#: elf32-i386.c:1803 elf32-m32r.c:1931 elf32-m68k.c:1343 elf32-ppc.c:4431 +#: elf32-s390.c:1687 elf32-sh.c:2583 elf32-vax.c:1055 elf64-ppc.c:5902 +#: elf64-s390.c:1662 elf64-sh64.c:3437 elf64-x86-64.c:1637 elf-m10300.c:4389 +#: elfxx-sparc.c:1806 #, c-format msgid "dynamic variable `%s' is zero size" msgstr "" -#: elf32-arm.c:8603 +#: elf32-arm.c:8791 #, c-format msgid "Errors encountered processing file %s" msgstr "" -#: elf32-arm.c:9853 elf32-arm.c:9875 +#: elf32-arm.c:10059 elf32-arm.c:10081 msgid "%B: error: VFP11 veneer out of range" msgstr "" -#: elf32-avr.c:1253 elf32-bfin.c:2795 elf32-cr16.c:887 elf32-cr16c.c:790 -#: elf32-cris.c:1538 elf32-crx.c:933 elf32-d10v.c:517 elf32-fr30.c:616 -#: elf32-frv.c:4129 elf32-h8300.c:516 elf32-i860.c:1218 elf32-ip2k.c:1499 -#: elf32-iq2000.c:647 elf32-m32c.c:560 elf32-m32r.c:3124 elf32-m68hc1x.c:1133 -#: elf32-mep.c:642 elf32-msp430.c:497 elf32-mt.c:402 elf32-openrisc.c:411 -#: elf32-score.c:2456 elf32-spu.c:2813 elf32-v850.c:1701 elf32-xstormy16.c:946 -#: elf64-mmix.c:1533 elf-m10200.c:456 elf-m10300.c:1523 +#: elf32-avr.c:1250 elf32-bfin.c:2796 elf32-cr16.c:959 elf32-cr16c.c:790 +#: elf32-cris.c:1538 elf32-crx.c:933 elf32-d10v.c:516 elf32-fr30.c:616 +#: elf32-frv.c:4112 elf32-h8300.c:516 elf32-i860.c:1218 elf32-ip2k.c:1499 +#: elf32-iq2000.c:691 elf32-m32c.c:560 elf32-m32r.c:3124 elf32-m68hc1x.c:1130 +#: elf32-mep.c:541 elf32-msp430.c:493 elf32-mt.c:402 elf32-openrisc.c:411 +#: elf32-score.c:2451 elf32-spu.c:2797 elf32-v850.c:1703 elf32-xstormy16.c:948 +#: elf64-mmix.c:1533 elf-m10200.c:456 elf-m10300.c:1609 msgid "internal error: out of range error" msgstr "" -#: elf32-avr.c:1257 elf32-bfin.c:2799 elf32-cr16.c:891 elf32-cr16c.c:794 -#: elf32-cris.c:1542 elf32-crx.c:937 elf32-d10v.c:521 elf32-fr30.c:620 -#: elf32-frv.c:4133 elf32-h8300.c:520 elf32-i860.c:1222 elf32-iq2000.c:651 -#: elf32-m32c.c:564 elf32-m32r.c:3128 elf32-m68hc1x.c:1137 elf32-mep.c:646 -#: elf32-msp430.c:501 elf32-openrisc.c:415 elf32-score.c:2460 elf32-spu.c:2817 -#: elf32-v850.c:1705 elf32-xstormy16.c:950 elf64-mmix.c:1537 elf-m10200.c:460 -#: elf-m10300.c:1527 elfxx-mips.c:8032 +#: elf32-avr.c:1254 elf32-bfin.c:2800 elf32-cr16.c:963 elf32-cr16c.c:794 +#: elf32-cris.c:1542 elf32-crx.c:937 elf32-d10v.c:520 elf32-fr30.c:620 +#: elf32-frv.c:4116 elf32-h8300.c:520 elf32-i860.c:1222 elf32-iq2000.c:695 +#: elf32-m32c.c:564 elf32-m32r.c:3128 elf32-m68hc1x.c:1134 elf32-mep.c:545 +#: elf32-msp430.c:497 elf32-openrisc.c:415 elf32-score.c:2455 elf32-spu.c:2801 +#: elf32-v850.c:1707 elf32-xstormy16.c:952 elf64-mmix.c:1537 elf-m10200.c:460 +#: elf-m10300.c:1613 elfxx-mips.c:8326 msgid "internal error: unsupported relocation error" msgstr "" -#: elf32-avr.c:1261 elf32-bfin.c:2803 elf32-cris.c:1546 elf32-fr30.c:624 -#: elf32-frv.c:4137 elf32-i860.c:1226 elf32-ip2k.c:1510 elf32-iq2000.c:655 -#: elf32-m32c.c:568 elf32-mep.c:650 elf32-msp430.c:505 elf32-mt.c:406 -#: elf32-openrisc.c:419 elf32-v850.c:1709 elf32-xstormy16.c:954 +#: elf32-avr.c:1258 elf32-bfin.c:2804 elf32-cris.c:1546 elf32-fr30.c:624 +#: elf32-frv.c:4120 elf32-i860.c:1226 elf32-ip2k.c:1510 elf32-iq2000.c:699 +#: elf32-m32c.c:568 elf32-mep.c:549 elf32-msp430.c:501 elf32-mt.c:406 +#: elf32-openrisc.c:419 elf32-v850.c:1711 elf32-xstormy16.c:956 #: elf64-mmix.c:1541 msgid "internal error: dangerous relocation" msgstr "" -#: elf32-avr.c:1265 elf32-bfin.c:2807 elf32-cr16.c:899 elf32-cr16c.c:802 -#: elf32-cris.c:1550 elf32-crx.c:945 elf32-d10v.c:529 elf32-fr30.c:628 -#: elf32-frv.c:4141 elf32-h8300.c:528 elf32-i860.c:1230 elf32-ip2k.c:1514 -#: elf32-iq2000.c:659 elf32-m32c.c:572 elf32-m32r.c:3136 elf32-m68hc1x.c:1145 -#: elf32-mep.c:654 elf32-msp430.c:509 elf32-mt.c:410 elf32-openrisc.c:423 -#: elf32-score.c:2468 elf32-spu.c:2825 elf32-v850.c:1725 elf32-xstormy16.c:958 -#: elf64-mmix.c:1545 elf-m10200.c:468 elf-m10300.c:1540 +#: elf32-avr.c:1262 elf32-bfin.c:2808 elf32-cr16.c:971 elf32-cr16c.c:802 +#: elf32-cris.c:1550 elf32-crx.c:945 elf32-d10v.c:528 elf32-fr30.c:628 +#: elf32-frv.c:4124 elf32-h8300.c:528 elf32-i860.c:1230 elf32-ip2k.c:1514 +#: elf32-iq2000.c:703 elf32-m32c.c:572 elf32-m32r.c:3136 elf32-m68hc1x.c:1142 +#: elf32-mep.c:553 elf32-msp430.c:505 elf32-mt.c:410 elf32-openrisc.c:423 +#: elf32-score.c:2463 elf32-spu.c:2809 elf32-v850.c:1727 elf32-xstormy16.c:960 +#: elf64-mmix.c:1545 elf-m10200.c:468 elf-m10300.c:1626 msgid "internal error: unknown error" msgstr "" -#: elf32-avr.c:2369 elf32-hppa.c:595 elf32-m68hc1x.c:164 elf64-ppc.c:3808 +#: elf32-avr.c:2366 elf32-hppa.c:604 elf32-m68hc1x.c:164 elf64-ppc.c:3807 msgid "%B: cannot create stub entry %s" msgstr "" -#: elf32-bfin.c:2274 +#: elf32-bfin.c:2259 msgid "%B: relocation at `%A+0x%x' references symbol `%s' with nonzero addend" msgstr "" -#: elf32-bfin.c:2288 elf32-frv.c:2919 +#: elf32-bfin.c:2273 elf32-frv.c:2902 msgid "relocation references symbol not defined in the module" msgstr "" -#: elf32-bfin.c:2385 +#: elf32-bfin.c:2370 msgid "R_BFIN_FUNCDESC references dynamic symbol with nonzero addend" msgstr "" -#: elf32-bfin.c:2424 elf32-bfin.c:2547 elf32-frv.c:3656 elf32-frv.c:3777 +#: elf32-bfin.c:2409 elf32-bfin.c:2535 elf32-frv.c:3639 elf32-frv.c:3760 msgid "cannot emit fixups in read-only section" msgstr "" -#: elf32-bfin.c:2452 elf32-bfin.c:2587 elf32-frv.c:3687 elf32-frv.c:3821 +#: elf32-bfin.c:2437 elf32-bfin.c:2584 elf32-frv.c:3670 elf32-frv.c:3804 msgid "cannot emit dynamic relocations in read-only section" msgstr "" -#: elf32-bfin.c:2505 +#: elf32-bfin.c:2493 msgid "R_BFIN_FUNCDESC_VALUE references dynamic symbol with nonzero addend" msgstr "" -#: elf32-bfin.c:2673 +#: elf32-bfin.c:2674 msgid "relocations between different segments are not supported" msgstr "" -#: elf32-bfin.c:2674 +#: elf32-bfin.c:2675 msgid "warning: relocation references a different segment" msgstr "" -#: elf32-bfin.c:3083 +#: elf32-bfin.c:3092 msgid "%B(%A+0x%lx): unresolvable relocation against symbol `%s'" msgstr "" -#: elf32-bfin.c:3116 elf32-i386.c:3533 elf32-m68k.c:2030 elf32-s390.c:3100 -#: elf64-s390.c:3061 elf64-x86-64.c:3207 +#: elf32-bfin.c:3125 elf32-i386.c:3540 elf32-m68k.c:2035 elf32-s390.c:3110 +#: elf64-s390.c:3071 elf64-x86-64.c:3215 msgid "%B(%A+0x%lx): reloc against `%s': error %d" msgstr "" -#: elf32-bfin.c:4687 elf32-frv.c:6423 +#: elf32-bfin.c:4695 elf32-frv.c:6402 msgid "%B: unsupported relocation type %i" msgstr "" -#: elf32-bfin.c:4868 elf32-frv.c:6831 +#: elf32-bfin.c:4848 elf32-frv.c:6810 #, c-format msgid "%s: cannot link non-fdpic object file into fdpic executable" msgstr "" -#: elf32-bfin.c:4872 elf32-frv.c:6835 +#: elf32-bfin.c:4852 elf32-frv.c:6814 #, c-format msgid "%s: cannot link fdpic object file into non-fdpic executable" msgstr "" -#: elf32-cr16.c:895 elf32-cr16c.c:798 elf32-crx.c:941 elf32-d10v.c:525 -#: elf32-h8300.c:524 elf32-m32r.c:3132 elf32-m68hc1x.c:1141 elf32-score.c:2464 -#: elf32-spu.c:2821 elf-m10200.c:464 +#: elf32-cr16.c:967 elf32-cr16c.c:798 elf32-crx.c:941 elf32-d10v.c:524 +#: elf32-h8300.c:524 elf32-m32r.c:3132 elf32-m68hc1x.c:1138 elf32-score.c:2459 +#: elf32-spu.c:2805 elf-m10200.c:464 msgid "internal error: dangerous error" msgstr "" @@ -1096,144 +1108,144 @@ msgstr "" msgid "%B: Internal inconsistency; no relocation section %s" msgstr "" -#: elf32-cris.c:2511 +#: elf32-cris.c:2510 msgid "" "%B, section %A:\n" " v10/v32 compatible object %s must not contain a PIC relocation" msgstr "" -#: elf32-cris.c:2698 elf32-cris.c:2766 +#: elf32-cris.c:2697 elf32-cris.c:2765 msgid "" "%B, section %A:\n" " relocation %s should not be used in a shared object; recompile with -fPIC" msgstr "" -#: elf32-cris.c:3183 +#: elf32-cris.c:3184 msgid "Unexpected machine number" msgstr "" -#: elf32-cris.c:3237 +#: elf32-cris.c:3238 #, c-format msgid " [symbols have a _ prefix]" msgstr "" -#: elf32-cris.c:3240 +#: elf32-cris.c:3241 #, c-format msgid " [v10 and v32]" msgstr "" -#: elf32-cris.c:3243 +#: elf32-cris.c:3244 #, c-format msgid " [v32]" msgstr "" -#: elf32-cris.c:3288 +#: elf32-cris.c:3289 msgid "%B: uses _-prefixed symbols, but writing file with non-prefixed symbols" msgstr "" -#: elf32-cris.c:3289 +#: elf32-cris.c:3290 msgid "%B: uses non-prefixed symbols, but writing file with _-prefixed symbols" msgstr "" -#: elf32-cris.c:3308 +#: elf32-cris.c:3309 msgid "%B contains CRIS v32 code, incompatible with previous objects" msgstr "" -#: elf32-cris.c:3310 +#: elf32-cris.c:3311 msgid "%B contains non-CRIS-v32 code, incompatible with previous objects" msgstr "" -#: elf32-frv.c:1523 elf32-frv.c:1672 +#: elf32-frv.c:1506 elf32-frv.c:1655 msgid "relocation requires zero addend" msgstr "" -#: elf32-frv.c:2906 +#: elf32-frv.c:2889 msgid "%B(%A+0x%x): relocation to `%s+%x' may have caused the error above" msgstr "" -#: elf32-frv.c:2995 +#: elf32-frv.c:2978 msgid "R_FRV_GETTLSOFF not applied to a call instruction" msgstr "" -#: elf32-frv.c:3037 +#: elf32-frv.c:3020 msgid "R_FRV_GOTTLSDESC12 not applied to an lddi instruction" msgstr "" -#: elf32-frv.c:3108 +#: elf32-frv.c:3091 msgid "R_FRV_GOTTLSDESCHI not applied to a sethi instruction" msgstr "" -#: elf32-frv.c:3145 +#: elf32-frv.c:3128 msgid "R_FRV_GOTTLSDESCLO not applied to a setlo or setlos instruction" msgstr "" -#: elf32-frv.c:3193 +#: elf32-frv.c:3176 msgid "R_FRV_TLSDESC_RELAX not applied to an ldd instruction" msgstr "" -#: elf32-frv.c:3277 +#: elf32-frv.c:3260 msgid "R_FRV_GETTLSOFF_RELAX not applied to a calll instruction" msgstr "" -#: elf32-frv.c:3332 +#: elf32-frv.c:3315 msgid "R_FRV_GOTTLSOFF12 not applied to an ldi instruction" msgstr "" -#: elf32-frv.c:3362 +#: elf32-frv.c:3345 msgid "R_FRV_GOTTLSOFFHI not applied to a sethi instruction" msgstr "" -#: elf32-frv.c:3391 +#: elf32-frv.c:3374 msgid "R_FRV_GOTTLSOFFLO not applied to a setlo or setlos instruction" msgstr "" -#: elf32-frv.c:3422 +#: elf32-frv.c:3405 msgid "R_FRV_TLSOFF_RELAX not applied to an ld instruction" msgstr "" -#: elf32-frv.c:3467 +#: elf32-frv.c:3450 msgid "R_FRV_TLSMOFFHI not applied to a sethi instruction" msgstr "" -#: elf32-frv.c:3494 +#: elf32-frv.c:3477 msgid "R_FRV_TLSMOFFLO not applied to a setlo or setlos instruction" msgstr "" -#: elf32-frv.c:3615 +#: elf32-frv.c:3598 msgid "R_FRV_FUNCDESC references dynamic symbol with nonzero addend" msgstr "" -#: elf32-frv.c:3735 +#: elf32-frv.c:3718 msgid "R_FRV_FUNCDESC_VALUE references dynamic symbol with nonzero addend" msgstr "" -#: elf32-frv.c:3992 elf32-frv.c:4148 +#: elf32-frv.c:3975 elf32-frv.c:4131 msgid "%B(%A+0x%lx): reloc against `%s': %s" msgstr "" -#: elf32-frv.c:3994 elf32-frv.c:3998 +#: elf32-frv.c:3977 elf32-frv.c:3981 msgid "relocation references a different segment" msgstr "" -#: elf32-frv.c:6745 +#: elf32-frv.c:6724 #, c-format msgid "" "%s: compiled with %s and linked with modules that use non-pic relocations" msgstr "" -#: elf32-frv.c:6798 elf32-iq2000.c:808 elf32-m32c.c:819 +#: elf32-frv.c:6777 elf32-iq2000.c:852 elf32-m32c.c:814 #, c-format msgid "%s: compiled with %s and linked with modules compiled with %s" msgstr "" -#: elf32-frv.c:6810 +#: elf32-frv.c:6789 #, c-format msgid "" "%s: uses different unknown e_flags (0x%lx) fields than previous modules (0x%" "lx)" msgstr "" -#: elf32-frv.c:6860 elf32-iq2000.c:845 elf32-m32c.c:855 elf32-mt.c:587 +#: elf32-frv.c:6839 elf32-iq2000.c:889 elf32-m32c.c:850 elf32-mt.c:583 #, c-format msgid "private flags = 0x%lx:" msgstr "" @@ -1242,63 +1254,63 @@ msgstr "" msgid "%B: Relocations in generic ELF (EM: %d)" msgstr "" -#: elf32-hppa.c:844 elf32-hppa.c:3577 +#: elf32-hppa.c:853 elf32-hppa.c:3594 msgid "%B(%A+0x%lx): cannot reach %s, recompile with -ffunction-sections" msgstr "" -#: elf32-hppa.c:1253 +#: elf32-hppa.c:1262 msgid "" "%B: relocation %s can not be used when making a shared object; recompile " "with -fPIC" msgstr "" -#: elf32-hppa.c:1506 +#: elf32-hppa.c:1517 #, c-format msgid "Could not find relocation section for %s" msgstr "" -#: elf32-hppa.c:2795 +#: elf32-hppa.c:2809 msgid "%B: duplicate export stub %s" msgstr "" -#: elf32-hppa.c:3413 +#: elf32-hppa.c:3430 msgid "" "%B(%A+0x%lx): %s fixup for insn 0x%x is not supported in a non-shared link" msgstr "" -#: elf32-hppa.c:4267 +#: elf32-hppa.c:4284 msgid "%B(%A+0x%lx): cannot handle %s for %s" msgstr "" -#: elf32-hppa.c:4574 +#: elf32-hppa.c:4591 msgid ".got section not immediately after .plt section" msgstr "" -#: elf32-i386.c:362 elf32-ppc.c:1616 elf32-s390.c:379 elf64-ppc.c:2152 +#: elf32-i386.c:362 elf32-ppc.c:1616 elf32-s390.c:379 elf64-ppc.c:2153 #: elf64-s390.c:403 elf64-x86-64.c:222 msgid "%B: invalid relocation type %d" msgstr "" -#: elf32-i386.c:1180 elf64-x86-64.c:961 +#: elf32-i386.c:1179 elf64-x86-64.c:960 msgid "" "%B: TLS transition from %s to %s against `%s' at 0x%lx in section `%A' failed" msgstr "" -#: elf32-i386.c:1359 elf32-s390.c:1185 elf32-sh.c:5063 elf64-s390.c:1149 -#: elfxx-sparc.c:1243 +#: elf32-i386.c:1360 elf32-s390.c:1188 elf32-sh.c:5071 elf64-s390.c:1152 +#: elfxx-sparc.c:1245 msgid "%B: `%s' accessed both as normal and thread local symbol" msgstr "" -#: elf32-i386.c:1474 elf32-s390.c:1294 elf64-ppc.c:4870 elf64-s390.c:1261 -#: elf64-x86-64.c:1294 +#: elf32-i386.c:1475 elf32-s390.c:1297 elf64-ppc.c:4869 elf64-s390.c:1264 +#: elf64-x86-64.c:1295 msgid "%B: bad relocation section name `%s'" msgstr "" -#: elf32-i386.c:2536 +#: elf32-i386.c:2543 msgid "%B: unrecognized relocation (0x%x) in section `%A'" msgstr "" -#: elf32-i386.c:2758 +#: elf32-i386.c:2765 msgid "" "%B: relocation R_386_GOTOFF against protected function `%s' can not be used " "when making a shared object" @@ -1328,7 +1340,7 @@ msgstr "" msgid "unsupported relocation between data/insn address spaces" msgstr "" -#: elf32-iq2000.c:821 elf32-m32c.c:831 +#: elf32-iq2000.c:865 elf32-m32c.c:826 #, c-format msgid "%s: uses different e_flags (0x%lx) fields than previous modules (0x%lx)" msgstr "" @@ -1365,88 +1377,88 @@ msgstr "" msgid ": m32r2 instructions" msgstr "" -#: elf32-m68hc1x.c:1045 +#: elf32-m68hc1x.c:1042 #, c-format msgid "" "Reference to the far symbol `%s' using a wrong relocation may result in " "incorrect execution" msgstr "" -#: elf32-m68hc1x.c:1068 +#: elf32-m68hc1x.c:1065 #, c-format msgid "" "banked address [%lx:%04lx] (%lx) is not in the same bank as current banked " "address [%lx:%04lx] (%lx)" msgstr "" -#: elf32-m68hc1x.c:1087 +#: elf32-m68hc1x.c:1084 #, c-format msgid "" "reference to a banked address [%lx:%04lx] in the normal address space at %" "04lx" msgstr "" -#: elf32-m68hc1x.c:1220 +#: elf32-m68hc1x.c:1217 msgid "" "%B: linking files compiled for 16-bit integers (-mshort) and others for 32-" "bit integers" msgstr "" -#: elf32-m68hc1x.c:1227 +#: elf32-m68hc1x.c:1224 msgid "" "%B: linking files compiled for 32-bit double (-fshort-double) and others for " "64-bit double" msgstr "" -#: elf32-m68hc1x.c:1236 +#: elf32-m68hc1x.c:1233 msgid "%B: linking files compiled for HCS12 with others compiled for HC12" msgstr "" -#: elf32-m68hc1x.c:1252 elf32-ppc.c:3734 elf64-sparc.c:697 elfxx-mips.c:11312 +#: elf32-m68hc1x.c:1249 elf32-ppc.c:3784 elf64-sparc.c:697 elfxx-mips.c:11675 msgid "%B: uses different e_flags (0x%lx) fields than previous modules (0x%lx)" msgstr "" -#: elf32-m68hc1x.c:1280 +#: elf32-m68hc1x.c:1277 #, c-format msgid "[abi=32-bit int, " msgstr "" -#: elf32-m68hc1x.c:1282 +#: elf32-m68hc1x.c:1279 #, c-format msgid "[abi=16-bit int, " msgstr "" -#: elf32-m68hc1x.c:1285 +#: elf32-m68hc1x.c:1282 #, c-format msgid "64-bit double, " msgstr "" -#: elf32-m68hc1x.c:1287 +#: elf32-m68hc1x.c:1284 #, c-format msgid "32-bit double, " msgstr "" -#: elf32-m68hc1x.c:1290 +#: elf32-m68hc1x.c:1287 #, c-format msgid "cpu=HC11]" msgstr "" -#: elf32-m68hc1x.c:1292 +#: elf32-m68hc1x.c:1289 #, c-format msgid "cpu=HCS12]" msgstr "" -#: elf32-m68hc1x.c:1294 +#: elf32-m68hc1x.c:1291 #, c-format msgid "cpu=HC12]" msgstr "" -#: elf32-m68hc1x.c:1297 +#: elf32-m68hc1x.c:1294 #, c-format msgid " [memory=bank-model]" msgstr "" -#: elf32-m68hc1x.c:1299 +#: elf32-m68hc1x.c:1296 #, c-format msgid " [memory=flat]" msgstr "" @@ -1463,15 +1475,15 @@ msgstr "" msgid "%B: Unknown relocation type %d\n" msgstr "" -#: elf32-mep.c:812 +#: elf32-mep.c:654 msgid "%B and %B are for different cores" msgstr "" -#: elf32-mep.c:829 +#: elf32-mep.c:671 msgid "%B and %B are for different configurations" msgstr "" -#: elf32-mep.c:867 +#: elf32-mep.c:709 #, c-format msgid "private flags = 0x%lx" msgstr "" @@ -1489,116 +1501,124 @@ msgstr "" msgid "generic linker can't handle %s" msgstr "" -#: elf32-ppc.c:2163 +#: elf32-ppc.c:2161 msgid "corrupt or empty %s section in %B" msgstr "" -#: elf32-ppc.c:2170 +#: elf32-ppc.c:2168 msgid "unable to read in %s section from %B" msgstr "" -#: elf32-ppc.c:2176 +#: elf32-ppc.c:2174 msgid "corrupt %s section in %B" msgstr "" -#: elf32-ppc.c:2219 +#: elf32-ppc.c:2217 msgid "warning: unable to set size of %s section in %B" msgstr "" -#: elf32-ppc.c:2267 +#: elf32-ppc.c:2265 msgid "failed to allocate space for new APUinfo section." msgstr "" -#: elf32-ppc.c:2286 +#: elf32-ppc.c:2284 msgid "failed to compute new APUinfo section." msgstr "" -#: elf32-ppc.c:2289 +#: elf32-ppc.c:2287 msgid "failed to install new APUinfo section." msgstr "" -#: elf32-ppc.c:3022 +#: elf32-ppc.c:3009 msgid "%B: relocation %s cannot be used when making a shared object" msgstr "" #. It does not make sense to have a procedure linkage #. table entry for a local symbol. -#: elf32-ppc.c:3292 +#: elf32-ppc.c:3280 msgid "%B(%A+0x%lx): %s reloc against local symbol" msgstr "" -#: elf32-ppc.c:3633 elf32-ppc.c:3637 elfxx-mips.c:11056 elfxx-mips.c:11075 -#: elfxx-mips.c:11090 +#: elf32-ppc.c:3635 elf32-ppc.c:3638 elfxx-mips.c:11379 elfxx-mips.c:11405 +#: elfxx-mips.c:11427 elfxx-mips.c:11453 msgid "Warning: %B uses hard float, %B uses soft float" msgstr "" -#: elf32-ppc.c:3640 elf32-ppc.c:3644 elfxx-mips.c:11037 elfxx-mips.c:11041 +#: elf32-ppc.c:3641 elf32-ppc.c:3645 elfxx-mips.c:11359 elfxx-mips.c:11363 msgid "Warning: %B uses unknown floating point ABI %d" msgstr "" -#: elf32-ppc.c:3699 +#: elf32-ppc.c:3687 elf32-ppc.c:3691 +msgid "Warning: %B uses unknown vector ABI %d" +msgstr "" + +#: elf32-ppc.c:3695 +msgid "Warning: %B uses vector ABI \"%s\", %B uses \"%s\"" +msgstr "" + +#: elf32-ppc.c:3749 msgid "" "%B: compiled with -mrelocatable and linked with modules compiled normally" msgstr "" -#: elf32-ppc.c:3707 +#: elf32-ppc.c:3757 msgid "" "%B: compiled normally and linked with modules compiled with -mrelocatable" msgstr "" -#: elf32-ppc.c:3793 +#: elf32-ppc.c:3843 msgid "Using bss-plt due to %B" msgstr "" -#: elf32-ppc.c:6002 elf64-ppc.c:10567 +#: elf32-ppc.c:6109 elf64-ppc.c:10606 msgid "%B: unknown relocation type %d for symbol %s" msgstr "" -#: elf32-ppc.c:6252 +#: elf32-ppc.c:6359 msgid "%B(%A+0x%lx): non-zero addend on %s reloc against `%s'" msgstr "" -#: elf32-ppc.c:6597 elf32-ppc.c:6623 elf32-ppc.c:6682 +#: elf32-ppc.c:6710 elf32-ppc.c:6736 elf32-ppc.c:6795 msgid "" "%B: the target (%s) of a %s relocation is in the wrong output section (%s)" msgstr "" -#: elf32-ppc.c:6737 +#: elf32-ppc.c:6850 msgid "%B: relocation %s is not yet supported for symbol %s." msgstr "" -#: elf32-ppc.c:6845 elf64-ppc.c:11262 +#: elf32-ppc.c:6958 elf64-ppc.c:11301 msgid "%B(%A+0x%lx): %s reloc against `%s': error %d" msgstr "" -#: elf32-s390.c:2238 elf64-s390.c:2212 +#: elf32-s390.c:2246 elf64-s390.c:2220 msgid "%B(%A+0x%lx): invalid instruction for TLS relocation %s" msgstr "" -#: elf32-score.c:1418 elfxx-mips.c:2701 +#: elf32-score.c:1415 elfxx-mips.c:2746 msgid "not enough GOT space for local GOT entries" msgstr "" -#: elf32-score.c:2550 +#: elf32-score.c:2545 #, c-format msgid "%s: Malformed reloc detected for section %s" msgstr "" -#: elf32-score.c:2601 +#: elf32-score.c:2596 msgid "%B: CALL15 reloc at 0x%lx not against global symbol" msgstr "" -#: elf32-score.c:3756 +#: elf32-score.c:3753 #, c-format msgid " [pic]" msgstr "" -#: elf32-score.c:3760 +#: elf32-score.c:3757 #, c-format msgid " [fix dep]" msgstr "" -#: elf32-score.c:3802 elfxx-mips.c:11221 +#: elf32-score.c:3799 elfxx-mips.c:11584 msgid "%B: warning: linking PIC files with non-PIC files" msgstr "" @@ -1617,7 +1637,7 @@ msgstr "" msgid "%s: object size does not match that of target %s" msgstr "" -#: elf32-sh64.c:450 elf64-sh64.c:2894 +#: elf32-sh64.c:450 elf64-sh64.c:2893 #, c-format msgid "%s: encountered datalabel symbol in input" msgstr "" @@ -1681,27 +1701,27 @@ msgstr "" msgid "%B: 0x%lx: fatal: reloc overflow while relaxing" msgstr "" -#: elf32-sh.c:3249 elf64-sh64.c:1526 +#: elf32-sh.c:3253 elf64-sh64.c:1526 msgid "Unexpected STO_SH5_ISA32 on local symbol is not handled" msgstr "" -#: elf32-sh.c:3486 +#: elf32-sh.c:3490 msgid "%B: 0x%lx: fatal: unaligned branch target for relax-support relocation" msgstr "" -#: elf32-sh.c:3519 elf32-sh.c:3534 +#: elf32-sh.c:3523 elf32-sh.c:3538 msgid "%B: 0x%lx: fatal: unaligned %s relocation 0x%lx" msgstr "" -#: elf32-sh.c:3548 +#: elf32-sh.c:3552 msgid "%B: 0x%lx: fatal: R_SH_PSHA relocation %d not in range -32..32" msgstr "" -#: elf32-sh.c:3562 +#: elf32-sh.c:3566 msgid "%B: 0x%lx: fatal: R_SH_PSHL relocation %d not in range -32..32" msgstr "" -#: elf32-sh.c:5275 elf64-alpha.c:4533 +#: elf32-sh.c:5283 elf64-alpha.c:4552 msgid "%B: TLS local exec code cannot be linked into shared objects" msgstr "" @@ -1725,153 +1745,161 @@ msgstr "" msgid "%B: linking little endian files with big endian files" msgstr "" -#: elf32-spu.c:995 +#: elf32-spu.c:553 +msgid "%X%P: overlay sections %A and %A do not start at the same address.\n" +msgstr "" + +#: elf32-spu.c:1072 msgid "warning: call to non-function symbol %s defined in %B" msgstr "" -#: elf32-spu.c:1315 +#: elf32-spu.c:1288 msgid "%B is not allowed to define %s" msgstr "" -#: elf32-spu.c:1352 +#: elf32-spu.c:1335 #, c-format msgid "%s in overlay section" msgstr "" -#: elf32-spu.c:1363 +#: elf32-spu.c:1356 elf64-ppc.c:9818 +msgid "stubs don't match calculated size" +msgstr "" + +#: elf32-spu.c:1365 msgid "overlay stub relocation overflow" msgstr "" -#: elf32-spu.c:1820 +#: elf32-spu.c:1799 #, c-format msgid "warning: %s overlaps %s\n" msgstr "" -#: elf32-spu.c:1836 +#: elf32-spu.c:1815 #, c-format msgid "warning: %s exceeds section size\n" msgstr "" -#: elf32-spu.c:1867 +#: elf32-spu.c:1846 msgid "%A:0x%v not found in function table\n" msgstr "" -#: elf32-spu.c:1958 +#: elf32-spu.c:1937 msgid "" "%B(%A+0x%v): call to non-code section %B(%A), stack analysis incomplete\n" msgstr "" -#: elf32-spu.c:2079 +#: elf32-spu.c:2058 #, c-format msgid "%A link_order not found\n" msgstr "" -#: elf32-spu.c:2358 +#: elf32-spu.c:2336 #, c-format msgid "Stack analysis will ignore the call from %s to %s\n" msgstr "" -#: elf32-spu.c:2513 +#: elf32-spu.c:2490 msgid "%s: 0x%v 0x%v\n" msgstr "" -#: elf32-spu.c:2517 +#: elf32-spu.c:2495 msgid " calls:\n" msgstr "" -#: elf32-spu.c:2524 +#: elf32-spu.c:2502 #, c-format msgid " %s%s %s\n" msgstr "" -#: elf32-spu.c:2585 +#: elf32-spu.c:2563 msgid "Stack size for call graph root nodes.\n" msgstr "" -#: elf32-spu.c:2586 +#: elf32-spu.c:2564 msgid "" "\n" "Stack size for functions. Annotations: '*' max stack, 't' tail call\n" msgstr "" -#: elf32-spu.c:2615 +#: elf32-spu.c:2593 msgid " %s: 0x%v\n" msgstr "" -#: elf32-spu.c:2625 +#: elf32-spu.c:2603 msgid "Maximum stack required is 0x%v\n" msgstr "" -#: elf32-spu.c:2751 +#: elf32-spu.c:2729 msgid "%B(%s+0x%lx): unresolvable %s relocation against symbol `%s'" msgstr "" -#: elf32-v850.c:163 +#: elf32-v850.c:165 #, c-format msgid "Variable `%s' cannot occupy in multiple small data regions" msgstr "" -#: elf32-v850.c:166 +#: elf32-v850.c:168 #, c-format msgid "" "Variable `%s' can only be in one of the small, zero, and tiny data regions" msgstr "" -#: elf32-v850.c:169 +#: elf32-v850.c:171 #, c-format msgid "" "Variable `%s' cannot be in both small and zero data regions simultaneously" msgstr "" -#: elf32-v850.c:172 +#: elf32-v850.c:174 #, c-format msgid "" "Variable `%s' cannot be in both small and tiny data regions simultaneously" msgstr "" -#: elf32-v850.c:175 +#: elf32-v850.c:177 #, c-format msgid "" "Variable `%s' cannot be in both zero and tiny data regions simultaneously" msgstr "" -#: elf32-v850.c:478 +#: elf32-v850.c:480 #, c-format msgid "FAILED to find previous HI16 reloc\n" msgstr "" -#: elf32-v850.c:1713 +#: elf32-v850.c:1715 msgid "could not locate special linker symbol __gp" msgstr "" -#: elf32-v850.c:1717 +#: elf32-v850.c:1719 msgid "could not locate special linker symbol __ep" msgstr "" -#: elf32-v850.c:1721 +#: elf32-v850.c:1723 msgid "could not locate special linker symbol __ctbp" msgstr "" -#: elf32-v850.c:1871 +#: elf32-v850.c:1873 msgid "%B: Architecture mismatch with previous modules" msgstr "" -#: elf32-v850.c:1890 +#: elf32-v850.c:1892 #, c-format msgid "private flags = %lx: " msgstr "" -#: elf32-v850.c:1895 +#: elf32-v850.c:1897 #, c-format msgid "v850 architecture" msgstr "" -#: elf32-v850.c:1896 +#: elf32-v850.c:1898 #, c-format msgid "v850e architecture" msgstr "" -#: elf32-v850.c:1897 +#: elf32-v850.c:1899 #, c-format msgid "v850e1 architecture" msgstr "" @@ -1898,17 +1926,17 @@ msgid "" "%ld" msgstr "" -#: elf32-vax.c:1584 +#: elf32-vax.c:1589 #, c-format msgid "%s: warning: PLT addend of %d to `%s' from %s section ignored" msgstr "" -#: elf32-vax.c:1721 +#: elf32-vax.c:1726 #, c-format msgid "%s: warning: %s relocation against symbol `%s' from %s section" msgstr "" -#: elf32-vax.c:1727 +#: elf32-vax.c:1732 #, c-format msgid "%s: warning: %s relocation to 0x%x from %s section" msgstr "" @@ -1917,98 +1945,98 @@ msgstr "" msgid "non-zero addend in @fptr reloc" msgstr "" -#: elf32-xtensa.c:733 +#: elf32-xtensa.c:740 msgid "%B(%A): invalid property table" msgstr "" -#: elf32-xtensa.c:2177 +#: elf32-xtensa.c:2148 msgid "%B(%A+0x%lx): relocation offset out of range (size=0x%x)" msgstr "" -#: elf32-xtensa.c:2234 +#: elf32-xtensa.c:2205 msgid "dynamic relocation in read-only section" msgstr "" -#: elf32-xtensa.c:2407 +#: elf32-xtensa.c:2385 msgid "internal inconsistency in size of .got.loc section" msgstr "" -#: elf32-xtensa.c:2714 +#: elf32-xtensa.c:2695 msgid "%B: incompatible machine type. Output is 0x%x. Input is 0x%x" msgstr "" -#: elf32-xtensa.c:3920 elf32-xtensa.c:3928 +#: elf32-xtensa.c:3901 elf32-xtensa.c:3909 msgid "Attempt to convert L32R/CALLX to CALL failed" msgstr "" -#: elf32-xtensa.c:5522 elf32-xtensa.c:5598 elf32-xtensa.c:6714 +#: elf32-xtensa.c:5511 elf32-xtensa.c:5587 elf32-xtensa.c:6703 msgid "" "%B(%A+0x%lx): could not decode instruction; possible configuration mismatch" msgstr "" -#: elf32-xtensa.c:6454 +#: elf32-xtensa.c:6443 msgid "" "%B(%A+0x%lx): could not decode instruction for XTENSA_ASM_SIMPLIFY " "relocation; possible configuration mismatch" msgstr "" -#: elf32-xtensa.c:8168 +#: elf32-xtensa.c:8204 msgid "invalid relocation address" msgstr "" -#: elf32-xtensa.c:8217 +#: elf32-xtensa.c:8253 msgid "overflow after relaxation" msgstr "" -#: elf32-xtensa.c:9343 +#: elf32-xtensa.c:9389 msgid "%B(%A+0x%lx): unexpected fix for %s relocation" msgstr "" -#: elf64-alpha.c:453 +#: elf64-alpha.c:452 msgid "GPDISP relocation did not find ldah and lda instructions" msgstr "" -#: elf64-alpha.c:2404 +#: elf64-alpha.c:2416 msgid "%B: .got subsegment exceeds 64K (size %d)" msgstr "" -#: elf64-alpha.c:4277 elf64-alpha.c:4289 +#: elf64-alpha.c:4296 elf64-alpha.c:4308 msgid "%B: gp-relative relocation against dynamic symbol %s" msgstr "" -#: elf64-alpha.c:4315 elf64-alpha.c:4450 +#: elf64-alpha.c:4334 elf64-alpha.c:4469 msgid "%B: pc-relative relocation against dynamic symbol %s" msgstr "" -#: elf64-alpha.c:4343 +#: elf64-alpha.c:4362 msgid "%B: change in gp: BRSGP %s" msgstr "" -#: elf64-alpha.c:4368 +#: elf64-alpha.c:4387 msgid "" msgstr "" -#: elf64-alpha.c:4373 +#: elf64-alpha.c:4392 msgid "%B: !samegp reloc against symbol without .prologue: %s" msgstr "" -#: elf64-alpha.c:4425 +#: elf64-alpha.c:4444 msgid "%B: unhandled dynamic relocation against %s" msgstr "" -#: elf64-alpha.c:4457 +#: elf64-alpha.c:4476 msgid "%B: pc-relative relocation against undefined weak symbol %s" msgstr "" -#: elf64-alpha.c:4517 +#: elf64-alpha.c:4536 msgid "%B: dtp-relative relocation against dynamic symbol %s" msgstr "" -#: elf64-alpha.c:4540 +#: elf64-alpha.c:4559 msgid "%B: tp-relative relocation against dynamic symbol %s" msgstr "" -#: elf64-hppa.c:2040 +#: elf64-hppa.c:2066 #, c-format msgid "stub entry for %s cannot load .plt, dp offset = %ld" msgstr "" @@ -2054,89 +2082,85 @@ msgid "" "register is $%ld." msgstr "" -#: elf64-mmix.c:2202 +#: elf64-mmix.c:2201 #, c-format msgid "" "%s: Error: multiple definition of `%s'; start of %s is set in a earlier " "linked file\n" msgstr "" -#: elf64-mmix.c:2260 +#: elf64-mmix.c:2259 msgid "Register section has contents\n" msgstr "" -#: elf64-mmix.c:2452 +#: elf64-mmix.c:2451 #, c-format msgid "" "Internal inconsistency: remaining %u != max %u.\n" " Please report this bug." msgstr "" -#: elf64-ppc.c:2573 libbfd.c:950 +#: elf64-ppc.c:2561 libbfd.c:978 msgid "%B: compiled for a big endian system and target is little endian" msgstr "" -#: elf64-ppc.c:2576 libbfd.c:952 +#: elf64-ppc.c:2564 libbfd.c:980 msgid "%B: compiled for a little endian system and target is big endian" msgstr "" -#: elf64-ppc.c:5896 +#: elf64-ppc.c:5892 #, c-format msgid "" "copy reloc against `%s' requires lazy plt linking; avoid setting " "LD_BIND_NOW=1 or upgrade gcc" msgstr "" -#: elf64-ppc.c:6324 +#: elf64-ppc.c:6320 msgid "dynreloc miscount for %B, section %A" msgstr "" -#: elf64-ppc.c:6428 +#: elf64-ppc.c:6404 msgid "%B: .opd is not a regular array of opd entries" msgstr "" -#: elf64-ppc.c:6437 +#: elf64-ppc.c:6413 msgid "%B: unexpected reloc type %u in .opd section" msgstr "" -#: elf64-ppc.c:6458 +#: elf64-ppc.c:6434 msgid "%B: undefined sym `%s' in .opd section" msgstr "" -#: elf64-ppc.c:7165 elf64-ppc.c:7545 +#: elf64-ppc.c:7211 elf64-ppc.c:7591 #, c-format msgid "%s defined in removed toc entry" msgstr "" -#: elf64-ppc.c:8299 +#: elf64-ppc.c:8349 #, c-format msgid "long branch stub `%s' offset overflow" msgstr "" -#: elf64-ppc.c:8374 +#: elf64-ppc.c:8425 #, c-format msgid "can't find branch stub `%s'" msgstr "" -#: elf64-ppc.c:8440 elf64-ppc.c:8538 +#: elf64-ppc.c:8500 elf64-ppc.c:8598 #, c-format msgid "linkage table error against `%s'" msgstr "" -#: elf64-ppc.c:8676 +#: elf64-ppc.c:8736 #, c-format msgid "can't build branch stub `%s'" msgstr "" -#: elf64-ppc.c:9147 +#: elf64-ppc.c:9206 msgid "%B section %A exceeds stub group size" msgstr "" -#: elf64-ppc.c:9759 -msgid "stubs don't match calculated size" -msgstr "" - -#: elf64-ppc.c:9771 +#: elf64-ppc.c:9830 #, c-format msgid "" "linker stubs in %u group%s\n" @@ -2147,24 +2171,24 @@ msgid "" " plt call %lu" msgstr "" -#: elf64-ppc.c:10455 +#: elf64-ppc.c:10494 msgid "" "%B(%A+0x%lx): automatic multiple TOCs not supported using your crt files; " "recompile with -mminimal-toc or upgrade gcc" msgstr "" -#: elf64-ppc.c:10463 +#: elf64-ppc.c:10502 msgid "" "%B(%A+0x%lx): sibling call optimization to `%s' does not allow automatic " "multiple TOCs; recompile with -mminimal-toc or -fno-optimize-sibling-calls, " "or make `%s' extern" msgstr "" -#: elf64-ppc.c:11114 +#: elf64-ppc.c:11153 msgid "%B: relocation %s is not supported for symbol %s." msgstr "" -#: elf64-ppc.c:11196 +#: elf64-ppc.c:11235 msgid "%B: error: relocation %s not a multiple of %d" msgstr "" @@ -2193,23 +2217,23 @@ msgstr "" msgid "%B: linking UltraSPARC specific with HAL specific code" msgstr "" -#: elf64-x86-64.c:1042 elf64-x86-64.c:1202 elf64-x86-64.c:2609 +#: elf64-x86-64.c:1043 elf64-x86-64.c:1203 elf64-x86-64.c:2617 msgid "" "%B: relocation %s against `%s' can not be used when making a shared object; " "recompile with -fPIC" msgstr "" -#: elf64-x86-64.c:1133 -msgid "%B: %s' accessed both as normal and thread local symbol" +#: elf64-x86-64.c:1134 +msgid "%B: '%s' accessed both as normal and thread local symbol" msgstr "" -#: elf64-x86-64.c:2521 +#: elf64-x86-64.c:2529 msgid "" "%B: relocation R_X86_64_GOTOFF64 against protected function `%s' can not be " "used when making a shared object" msgstr "" -#: elf64-x86-64.c:2605 +#: elf64-x86-64.c:2613 msgid "" "%B: relocation R_X86_64_PC32 against protected function `%s' can not be used " "when making a shared object" @@ -2223,170 +2247,170 @@ msgstr "" msgid "ERROR: %B: Incompatible object tag '%s':%d" msgstr "" -#: elf.c:314 +#: elf.c:324 msgid "%B: invalid string offset %u >= %lu for section `%s'" msgstr "" -#: elf.c:416 +#: elf.c:431 msgid "%B symbol number %lu references nonexistent SHT_SYMTAB_SHNDX section" msgstr "" -#: elf.c:569 +#: elf.c:584 msgid "%B: Corrupt size field in group section header: 0x%lx" msgstr "" -#: elf.c:605 +#: elf.c:620 msgid "%B: invalid SHT_GROUP entry" msgstr "" -#: elf.c:675 +#: elf.c:690 msgid "%B: no group info for section %A" msgstr "" -#: elf.c:705 elf.c:2941 elflink.c:9858 +#: elf.c:720 elf.c:2958 elflink.c:9726 msgid "%B: warning: sh_link not set for section `%A'" msgstr "" -#: elf.c:721 +#: elf.c:736 msgid "%B: sh_link [%d] in section `%A' is incorrect" msgstr "" -#: elf.c:756 +#: elf.c:771 msgid "%B: unknown [%d] section `%s' in group [%s]" msgstr "" -#: elf.c:1132 +#: elf.c:1147 #, c-format msgid "" "\n" "Program Header:\n" msgstr "" -#: elf.c:1174 +#: elf.c:1189 #, c-format msgid "" "\n" "Dynamic Section:\n" msgstr "" -#: elf.c:1300 +#: elf.c:1315 #, c-format msgid "" "\n" "Version definitions:\n" msgstr "" -#: elf.c:1325 +#: elf.c:1340 #, c-format msgid "" "\n" "Version References:\n" msgstr "" -#: elf.c:1330 +#: elf.c:1345 #, c-format msgid " required from %s:\n" msgstr "" -#: elf.c:1714 +#: elf.c:1729 msgid "%B: invalid link %lu for reloc section %s (index %u)" msgstr "" -#: elf.c:1882 +#: elf.c:1899 msgid "" "%B: don't know how to handle allocated, application specific section `%s' [0x" "%8x]" msgstr "" -#: elf.c:1894 +#: elf.c:1911 msgid "%B: don't know how to handle processor specific section `%s' [0x%8x]" msgstr "" -#: elf.c:1905 +#: elf.c:1922 msgid "%B: don't know how to handle OS specific section `%s' [0x%8x]" msgstr "" -#: elf.c:1915 +#: elf.c:1932 msgid "%B: don't know how to handle section `%s' [0x%8x]" msgstr "" -#: elf.c:2498 +#: elf.c:2515 #, c-format -msgid "section `%A' type changed to PROGBITS" +msgid "warning: section `%A' type changed to PROGBITS" msgstr "" -#: elf.c:2898 +#: elf.c:2915 msgid "%B: sh_link of section `%A' points to discarded section `%A' of `%B'" msgstr "" -#: elf.c:2921 +#: elf.c:2938 msgid "%B: sh_link of section `%A' points to removed section `%A' of `%B'" msgstr "" -#: elf.c:4226 +#: elf.c:4282 msgid "" "%B: The first section in the PT_DYNAMIC segment is not the .dynamic section" msgstr "" -#: elf.c:4249 +#: elf.c:4309 msgid "%B: Not enough room for program headers, try linking with -N" msgstr "" -#: elf.c:4327 +#: elf.c:4387 msgid "%B: section %A lma 0x%lx overlaps previous sections" msgstr "" -#: elf.c:4425 +#: elf.c:4483 msgid "%B: section `%A' can't be allocated in segment %d" msgstr "" -#: elf.c:4475 +#: elf.c:4533 msgid "%B: warning: allocated section `%s' not in segment" msgstr "" -#: elf.c:4971 +#: elf.c:5064 msgid "%B: symbol `%s' required but not present" msgstr "" -#: elf.c:5284 +#: elf.c:5388 msgid "%B: warning: Empty loadable segment detected, is this intentional ?\n" msgstr "" -#: elf.c:6190 +#: elf.c:6334 #, c-format msgid "" "Unable to find equivalent output section for symbol '%s' from section '%s'" msgstr "" -#: elf.c:7164 +#: elf.c:7316 msgid "%B: unsupported relocation type %s" msgstr "" -#: elfcode.h:813 +#: elfcode.h:819 #, c-format msgid "warning: %s has a corrupt string table index - ignoring" msgstr "" -#: elfcode.h:1226 +#: elfcode.h:1232 #, c-format msgid "%s: version count (%ld) does not match symbol count (%ld)" msgstr "" -#: elfcode.h:1459 +#: elfcode.h:1469 #, c-format msgid "%s(%s): relocation %d has invalid symbol index %ld" msgstr "" -#: elf-eh-frame.c:823 -msgid "" -"%P: fde encoding in %B(%A) prevents .eh_frame_hdr table being created.\n" +#: elf-eh-frame.c:866 +msgid "%P: error in %B(%A); no .eh_frame_hdr table will be created.\n" msgstr "" -#: elf-eh-frame.c:974 -msgid "%P: error in %B(%A); no .eh_frame_hdr table will be created.\n" +#: elf-eh-frame.c:1098 +msgid "" +"%P: fde encoding in %B(%A) prevents .eh_frame_hdr table being created.\n" msgstr "" -#: elf-hppa.h:2219 elf-hppa.h:2233 +#: elf-hppa.h:2226 elf-hppa.h:2240 msgid "%B(%A): warning: unresolvable relocation against symbol `%s'" msgstr "" @@ -2412,284 +2436,292 @@ msgstr "" msgid "%B: unexpected redefinition of indirect versioned symbol `%s'" msgstr "" -#: elflink.c:1974 +#: elflink.c:1982 msgid "%B: version node not found for symbol %s" msgstr "" -#: elflink.c:2122 +#: elflink.c:2130 msgid "" "%B: bad reloc symbol index (0x%lx >= 0x%lx) for offset 0x%lx in section `%A'" msgstr "" -#: elflink.c:2314 +#: elflink.c:2322 msgid "%B: relocation size mismatch in %B section %A" msgstr "" -#: elflink.c:2616 +#: elflink.c:2624 #, c-format msgid "warning: type and size of dynamic symbol `%s' are not defined" msgstr "" -#: elflink.c:3910 +#: elflink.c:3952 msgid "%B: %s: invalid version %u (max %d)" msgstr "" -#: elflink.c:3946 +#: elflink.c:3988 msgid "%B: %s: invalid needed version %d" msgstr "" -#: elflink.c:4129 +#: elflink.c:4171 msgid "" "Warning: alignment %u of common symbol `%s' in %B is greater than the " "alignment (%u) of its section %A" msgstr "" -#: elflink.c:4135 +#: elflink.c:4177 msgid "Warning: alignment %u of symbol `%s' in %B is smaller than %u in %B" msgstr "" -#: elflink.c:4150 +#: elflink.c:4192 msgid "Warning: size of symbol `%s' changed from %lu in %B to %lu in %B" msgstr "" -#: elflink.c:4326 +#: elflink.c:4370 #, c-format msgid "%s: invalid DSO for symbol `%s' definition" msgstr "" -#: elflink.c:5552 +#: elflink.c:5616 #, c-format msgid "%s: undefined version: %s" msgstr "" -#: elflink.c:5620 +#: elflink.c:5684 msgid "%B: .preinit_array section is not allowed in DSO" msgstr "" -#: elflink.c:7359 +#: elflink.c:7401 #, c-format msgid "undefined %s reference in complex symbol: %s" msgstr "" -#: elflink.c:7514 +#: elflink.c:7555 #, c-format msgid "unknown operator '%c' in complex symbol" msgstr "" -#: elflink.c:8053 elflink.c:8070 elflink.c:8107 elflink.c:8124 +#: elflink.c:7891 elflink.c:7908 elflink.c:7945 elflink.c:7962 msgid "%B: Unable to sort relocs - they are in more than one size" msgstr "" -#: elflink.c:8084 elflink.c:8138 +#: elflink.c:7922 elflink.c:7976 msgid "%B: Unable to sort relocs - they are of an unknown size" msgstr "" -#: elflink.c:8187 +#: elflink.c:8025 msgid "Not enough memory to sort relocations" msgstr "" -#: elflink.c:8374 +#: elflink.c:8213 msgid "%B: Too many sections: %d (>= %d)" msgstr "" -#: elflink.c:8608 +#: elflink.c:8447 msgid "%B: %s symbol `%s' in %B is referenced by DSO" msgstr "" -#: elflink.c:8691 +#: elflink.c:8530 msgid "%B: could not find output section %A for input section %A" msgstr "" -#: elflink.c:8788 +#: elflink.c:8632 msgid "%B: %s symbol `%s' isn't defined" msgstr "" -#: elflink.c:9284 +#: elflink.c:9121 msgid "" "error: %B contains a reloc (0x%s) for section %A that references a non-" "existent global symbol" msgstr "" -#: elflink.c:9318 +#: elflink.c:9185 msgid "" "%X`%s' referenced in section `%A' of %B: defined in discarded section `%A' " "of %B\n" msgstr "" -#: elflink.c:9936 +#: elflink.c:9804 msgid "%A has both ordered [`%A' in %B] and unordered [`%A' in %B] sections" msgstr "" -#: elflink.c:9941 +#: elflink.c:9809 #, c-format msgid "%A has both ordered and unordered sections" msgstr "" -#: elflink.c:10828 elflink.c:10872 +#: elflink.c:10698 elflink.c:10742 msgid "%B: could not find output section %s" msgstr "" -#: elflink.c:10833 +#: elflink.c:10703 #, c-format msgid "warning: %s section has zero size" msgstr "" -#: elflink.c:10937 +#: elflink.c:10807 msgid "%P: warning: creating a DT_TEXTREL in a shared object.\n" msgstr "" -#: elflink.c:11305 -msgid "Removing unused section '%s' in file '%B'" +#: elflink.c:10989 +msgid "%P%X: can not read symbols: %E\n" msgstr "" -#: elflink.c:11496 -msgid "Warning: gc-sections option ignored" +#: elflink.c:11296 +msgid "Removing unused section '%s' in file '%B'" msgstr "" -#: elflink.c:11987 -msgid "%P%X: can not read symbols: %E\n" +#: elflink.c:11508 +msgid "Warning: gc-sections option ignored" msgstr "" -#: elflink.c:12129 +#: elflink.c:12042 msgid "%B: ignoring duplicate section `%A'" msgstr "" -#: elflink.c:12136 elflink.c:12143 +#: elflink.c:12049 elflink.c:12056 msgid "%B: duplicate section `%A' has different size" msgstr "" -#: elflink.c:12151 elflink.c:12156 +#: elflink.c:12064 elflink.c:12069 msgid "%B: warning: could not read contents of section `%A'" msgstr "" -#: elflink.c:12160 +#: elflink.c:12073 msgid "%B: warning: duplicate section `%A' has different contents" msgstr "" -#: elflink.c:12239 linker.c:3081 +#: elflink.c:12152 linker.c:3080 msgid "%F%P: already_linked_table: %E" msgstr "" -#: elf-m10300.c:1532 +#: elf-m10300.c:1618 msgid "" "error: inappropriate relocation type for shared library (did you forget -" "fpic?)" msgstr "" -#: elf-m10300.c:1535 +#: elf-m10300.c:1621 msgid "internal error: suspicious relocation type used in shared library" msgstr "" -#: elfxx-mips.c:992 +#: elfxx-mips.c:1018 msgid "static procedure (no name)" msgstr "" -#: elfxx-mips.c:4669 +#: elfxx-mips.c:4877 msgid "%B: %A+0x%lx: jump to stub routine which is not jal" msgstr "" -#: elfxx-mips.c:5332 elfxx-mips.c:5552 +#: elfxx-mips.c:5549 elfxx-mips.c:5769 msgid "%B: Warning: bad `%s' option size %u smaller than its header" msgstr "" -#: elfxx-mips.c:6411 +#: elfxx-mips.c:6761 msgid "%B: Malformed reloc detected for section %s" msgstr "" -#: elfxx-mips.c:6453 +#: elfxx-mips.c:6803 msgid "%B: GOT reloc at 0x%lx not expected in executables" msgstr "" -#: elfxx-mips.c:6523 +#: elfxx-mips.c:6873 msgid "%B: CALL16 reloc at 0x%lx not against global symbol" msgstr "" -#: elfxx-mips.c:7887 +#: elfxx-mips.c:8207 msgid "" "%B: Can't find matching LO16 reloc against `%s' for %s at 0x%lx in section `%" "A'" msgstr "" -#: elfxx-mips.c:8053 +#: elfxx-mips.c:8347 msgid "" "small-data section exceeds 64KB; lower small-data size limit (see option -G)" msgstr "" -#: elfxx-mips.c:10681 +#: elfxx-mips.c:10998 #, c-format msgid "%s: illegal section name `%s'" msgstr "" -#: elfxx-mips.c:11051 elfxx-mips.c:11070 +#: elfxx-mips.c:11373 elfxx-mips.c:11399 msgid "Warning: %B uses -msingle-float, %B uses -mdouble-float" msgstr "" -#: elfxx-mips.c:11126 +#: elfxx-mips.c:11385 elfxx-mips.c:11441 +msgid "Warning: %B uses -msingle-float, %B uses -mips32r2 -mfp64" +msgstr "" + +#: elfxx-mips.c:11411 elfxx-mips.c:11447 +msgid "Warning: %B uses -mdouble-float, %B uses -mips32r2 -mfp64" +msgstr "" + +#: elfxx-mips.c:11489 msgid "%B: endianness incompatible with that of the selected emulation" msgstr "" -#: elfxx-mips.c:11138 +#: elfxx-mips.c:11501 msgid "%B: ABI is incompatible with that of the selected emulation" msgstr "" -#: elfxx-mips.c:11238 +#: elfxx-mips.c:11601 msgid "%B: linking 32-bit code with 64-bit code" msgstr "" -#: elfxx-mips.c:11266 +#: elfxx-mips.c:11629 msgid "%B: linking %s module with previous %s modules" msgstr "" -#: elfxx-mips.c:11289 +#: elfxx-mips.c:11652 msgid "%B: ABI mismatch: linking %s module with previous %s modules" msgstr "" -#: elfxx-mips.c:11354 +#: elfxx-mips.c:11717 #, c-format msgid " [abi=O32]" msgstr "" -#: elfxx-mips.c:11356 +#: elfxx-mips.c:11719 #, c-format msgid " [abi=O64]" msgstr "" -#: elfxx-mips.c:11358 +#: elfxx-mips.c:11721 #, c-format msgid " [abi=EABI32]" msgstr "" -#: elfxx-mips.c:11360 +#: elfxx-mips.c:11723 #, c-format msgid " [abi=EABI64]" msgstr "" -#: elfxx-mips.c:11362 +#: elfxx-mips.c:11725 #, c-format msgid " [abi unknown]" msgstr "" -#: elfxx-mips.c:11364 +#: elfxx-mips.c:11727 #, c-format msgid " [abi=N32]" msgstr "" -#: elfxx-mips.c:11366 +#: elfxx-mips.c:11729 #, c-format msgid " [abi=64]" msgstr "" -#: elfxx-mips.c:11368 +#: elfxx-mips.c:11731 #, c-format msgid " [no abi set]" msgstr "" -#: elfxx-mips.c:11389 +#: elfxx-mips.c:11752 #, c-format msgid " [unknown ISA]" msgstr "" -#: elfxx-mips.c:11400 +#: elfxx-mips.c:11763 #, c-format msgid " [not 32bitmode]" msgstr "" @@ -2699,7 +2731,7 @@ msgstr "" msgid "invalid relocation type %d" msgstr "" -#: elfxx-sparc.c:2901 +#: elfxx-sparc.c:2913 msgid "%B: probably compiled without -fPIC?" msgstr "" @@ -2786,34 +2818,34 @@ msgstr "" msgid "%s: address 0x%s out of range for Intel Hex file" msgstr "" -#: libbfd.c:980 +#: libbfd.c:1008 #, c-format msgid "Deprecated %s called at %s line %d in %s\n" msgstr "" -#: libbfd.c:983 +#: libbfd.c:1011 #, c-format msgid "Deprecated %s called\n" msgstr "" -#: linker.c:1875 +#: linker.c:1874 msgid "%B: indirect symbol `%s' to `%s' is a loop" msgstr "" -#: linker.c:2741 +#: linker.c:2740 #, c-format msgid "Attempt to do relocatable link with %s input and %s output" msgstr "" -#: linker.c:3048 +#: linker.c:3047 msgid "%B: warning: ignoring duplicate section `%A'\n" msgstr "" -#: linker.c:3062 +#: linker.c:3061 msgid "%B: warning: duplicate section `%A' has different size\n" msgstr "" -#: merge.c:820 +#: merge.c:828 #, c-format msgid "%s: access beyond end of merged section (%ld)" msgstr "" @@ -3070,14 +3102,14 @@ msgstr "" msgid "Partition[%d] length = 0x%.8lx (%ld)\n" msgstr "" -#: som.c:5088 +#: som.c:5116 #, c-format msgid "" "\n" "Exec Auxiliary Header\n" msgstr "" -#: som.c:5349 +#: som.c:5419 msgid "som_sizeof_headers unimplemented" msgstr "" @@ -3085,11 +3117,15 @@ msgstr "" msgid "%B:%d: Unexpected character `%s' in S-record file\n" msgstr "" +#: srec.c:567 srec.c:600 +msgid "%B:%d: Bad checksum in S-record file\n" +msgstr "" + #: stabs.c:279 msgid "%B(%A+0x%lx): Stabs entry has invalid string index." msgstr "" -#: syms.c:1057 +#: syms.c:1064 msgid "Unsupported .stab relocation" msgstr "" @@ -3126,20 +3162,20 @@ msgstr "" msgid "Stack underflow in _bfd_vms_pop" msgstr "" -#: vms-misc.c:803 +#: vms-misc.c:808 msgid "_bfd_vms_output_counted called with zero bytes" msgstr "" -#: vms-misc.c:808 +#: vms-misc.c:813 msgid "_bfd_vms_output_counted called with too many bytes" msgstr "" -#: vms-misc.c:926 +#: vms-misc.c:931 #, c-format msgid "Symbol %s replaced by %s\n" msgstr "" -#: vms-misc.c:985 +#: vms-misc.c:990 #, c-format msgid "failed to enter %s" msgstr "" @@ -3379,33 +3415,33 @@ msgstr "" msgid "%B: @pcrel relocation against dynamic symbol %s" msgstr "" -#: elf32-ia64.c:5072 elf64-ia64.c:5072 +#: elf32-ia64.c:5059 elf64-ia64.c:5059 msgid "unsupported reloc" msgstr "" -#: elf32-ia64.c:5105 elf64-ia64.c:5105 +#: elf32-ia64.c:5092 elf64-ia64.c:5092 msgid "" "%B: Can't relax br (%s) to `%s' at 0x%lx in section `%A' with size 0x%lx (> " "0x1000000)." msgstr "" -#: elf32-ia64.c:5361 elf64-ia64.c:5361 +#: elf32-ia64.c:5348 elf64-ia64.c:5348 msgid "%B: linking trap-on-NULL-dereference with non-trapping files" msgstr "" -#: elf32-ia64.c:5370 elf64-ia64.c:5370 +#: elf32-ia64.c:5357 elf64-ia64.c:5357 msgid "%B: linking big-endian files with little-endian files" msgstr "" -#: elf32-ia64.c:5379 elf64-ia64.c:5379 +#: elf32-ia64.c:5366 elf64-ia64.c:5366 msgid "%B: linking 64-bit files with 32-bit files" msgstr "" -#: elf32-ia64.c:5388 elf64-ia64.c:5388 +#: elf32-ia64.c:5375 elf64-ia64.c:5375 msgid "%B: linking constant-gp files with non-constant-gp files" msgstr "" -#: elf32-ia64.c:5398 elf64-ia64.c:5398 +#: elf32-ia64.c:5385 elf64-ia64.c:5385 msgid "%B: linking auto-pic files with non-auto-pic files" msgstr "" @@ -3724,24 +3760,24 @@ msgid "" "Characteristics 0x%x\n" msgstr "" -#: peigen.c:2088 pepigen.c:2088 pex64igen.c:2088 +#: peigen.c:2097 pepigen.c:2097 pex64igen.c:2097 msgid "%B: unable to fill in DataDictionary[1] because .idata$2 is missing" msgstr "" -#: peigen.c:2106 pepigen.c:2106 pex64igen.c:2106 +#: peigen.c:2115 pepigen.c:2115 pex64igen.c:2115 msgid "%B: unable to fill in DataDictionary[1] because .idata$4 is missing" msgstr "" -#: peigen.c:2125 pepigen.c:2125 pex64igen.c:2125 +#: peigen.c:2134 pepigen.c:2134 pex64igen.c:2134 msgid "%B: unable to fill in DataDictionary[12] because .idata$5 is missing" msgstr "" -#: peigen.c:2143 pepigen.c:2143 pex64igen.c:2143 +#: peigen.c:2152 pepigen.c:2152 pex64igen.c:2152 msgid "" "%B: unable to fill in DataDictionary[PE_IMPORT_ADDRESS_TABLE (12)] because ." "idata$6 is missing" msgstr "" -#: peigen.c:2163 pepigen.c:2163 pex64igen.c:2163 +#: peigen.c:2172 pepigen.c:2172 pex64igen.c:2172 msgid "%B: unable to fill in DataDictionary[9] because __tls_used is missing" msgstr "" diff --git a/bfd/reloc.c b/bfd/reloc.c index 8e1dee5..b5e635e 100644 --- a/bfd/reloc.c +++ b/bfd/reloc.c @@ -3183,13 +3183,13 @@ ENUM BFD_RELOC_ARC_S21H_PCREL ENUMDOC ARCompact 21 bit pc-relative branch. The lowest bit must be zero and is - not stored in the instruction. The remaining 20 bits are installed in - 2 groups of 10 bits each. The high 10 bits are installed in bits 26 + not stored in the instruction. The remaining 20 bits are installed in + 2 groups of 10 bits each. The high 10 bits are installed in bits 26 through 17 and the remaining 10 bits in bits 15 through 6. ENUM BFD_RELOC_ARC_S21W_PCREL ENUMDOC - ARCompact 21 bit pc-relative branch. The lowest two bits must be zero and + ARCompact 21 bit pc-relative branch. The lowest two bits must be zero and are not stored in the instruction. The remaining 19 bits are installed in 2 groups of 9 and 10 bits each. The high 9 bits are installed in bits 26 through 18 and the remaining 10 bits in bits 15 through 6. @@ -3197,9 +3197,9 @@ ENUM BFD_RELOC_ARC_S25H_PCREL ENUMDOC ARCompact 25 bit pc-relative branch. The lowest bit must be zero and is - not stored in the instruction. The remaining 24 bits are installed in + not stored in the instruction. The remaining 24 bits are installed in 3 groups of 10 bits, 10 bits and 4 bits each. The high 10 bits are - installed in bits 26 through 17, next 10 bits in bits 15 through 6 and the + installed in bits 26 through 17, next 10 bits in bits 15 through 6 and the remaining 4 bits in bits 3 through 0. ENUM BFD_RELOC_ARC_S25W_PCREL @@ -3218,99 +3218,56 @@ ENUMDOC ENUM BFD_RELOC_ARC_32_ME ENUMDOC - ARCompact Middle-endian 32 bit word relocation + ARCompact Middle-endian 32 bit word relocation. ENUM - BFD_RELOC_ARC_PC32 + BFD_RELOC_ARC_PC32 ENUMDOC - ARCompact PC Relative 32 bit relocation. -ENUM - BFD_RELOC_ARC_GOTPC32 -ENUMDOC - ARC 700 GOT specific relocation. This computes the distance from the current -pcl to the symbol's global offset table entry. -ENUM - BFD_RELOC_ARC_PLT32 -ENUMDOC - ARC 700 PLT specific relocation. This computes the distance from the base -of the PLT to the symbols PLT entry. -ENUM - BFD_RELOC_ARC_COPY -ENUMDOC - ARC 700 Copy relocation. This refers to a location in the writable segment -and during execution the dynamic linker copies data associated with the shared -objects symbol to the location specified by the offset. Created for -dynamic linking by the linker . -ENUM -BFD_RELOC_ARC_GLOB_DAT -ENUMDOC - ARC 700 Global Data relocaton.This is to set a GOT entry to the address -of the specified symbol . This allows one to determine the correspondence -between symbols and GOT entries. -ENUM -BFD_RELOC_ARC_JMP_SLOT -ENUMDOC - This gives the location of a PLT entrys GOT entry. The dynamic linker -modifies the GOT entry so that the PLT will transfer control to the designated -symbols address. Created by the linker. -ENUM -BFD_RELOC_ARC_RELATIVE -ENUMDOC - This gives the location of a value representing a relative address. -The dynamic linker adds the load address of the shared library to -the relative address to compute the final address. -ENUM -BFD_RELOC_ARC_GOTOFF -ENUMDOC -This gives the difference between a symbols value and the address of the -Global Offset Table This causes the linker to build the GOT. -ENUM -BFD_RELOC_ARC_GOTPC -ENUMDOC -This gives the difference between the address of the GOT base and the -current PC. The symbol referenced is _GLOBAL_OFFSET_TABLE . -ENUM -BFD_RELOC_ARC_GOT32 -ENUMDOC -ARC 700 GOT specific relocation. This computes the distance from the base -of the GOT to the symbol's global offset table entry. -ENUM -BFD_RELOC_ARC_SDA -ENUMDOC -small data reloc 1 + ARCompact PC Relative 32 bit relocation. ENUM -BFD_RELOC_ARC_SDA32 + BFD_RELOC_ARC_GOTPC32 ENUMDOC -small data reloc 2 + ARC 700 GOT specific relocation. This computes the distance from the current + pcl value to the symbol's global offset table entry. ENUM -BFD_RELOC_ARC_SDA_LDST + BFD_RELOC_ARC_PLT32 ENUMDOC -small data reloc 3 + ARC 700 PLT specific relocation. This computes the distance from the base + of the PLT to the symbols PLT entry. ENUM -BFD_RELOC_ARC_SDA_LDST1 + BFD_RELOC_ARC_COPY ENUMDOC -small data reloc 4 + ARC 700 Copy relocation. This refers to a location in the writable segment + and during execution the dynamic linker copies data associated with the shared + objects symbol to the location specified by the offset. Created for + dynamic linking by the linker. ENUM -BFD_RELOC_ARC_SDA_LDST2 + BFD_RELOC_ARC_GLOB_DAT ENUMDOC -small data reloc 5 + ARC 700 Global Data relocaton.This is to set a GOT entry to the address + of the specified symbol . This allows one to determine the correspondence + between symbols and GOT entries. ENUM -BFD_RELOC_ARC_SDA16_LD + BFD_RELOC_ARC_JMP_SLOT ENUMDOC -small data reloc 6 + This gives the location of a PLT entrys GOT entry. The dynamic linker + modifies the GOT entry so that the PLT will transfer control to the designated + symbols address. Created by the linker. ENUM -BFD_RELOC_ARC_SDA16_LD1 + BFD_RELOC_ARC_RELATIVE ENUMDOC -small data reloc 7 + This gives the location of a value representing a relative address. + The dynamic linker adds the load address of the shared library to + the relative address to compute the final address. ENUM -BFD_RELOC_ARC_SDA16_LD2 + BFD_RELOC_ARC_GOTOFF ENUMDOC -small data reloc 8 + This gives the difference between a symbols value and the address of the + Global Offset Table This causes the linker to build the GOT. ENUM -BFD_RELOC_ARC_SDA32_ME + BFD_RELOC_ARC_GOTPC ENUMDOC -small data reloc 9 -COMMENT - + This gives the difference between the address of the GOT base and the + current PC. The symbol referenced is _GLOBAL_OFFSET_TABLE. ENUM BFD_RELOC_BFIN_16_IMM ENUMDOC diff --git a/gdb/JTAG_aps_driver.c b/gdb/JTAG_aps_driver.c new file mode 100644 index 0000000..1118948 --- /dev/null +++ b/gdb/JTAG_aps_driver.c @@ -0,0 +1,560 @@ +/* Target dependent code for ARC700, for GDB, the GNU debugger. + + Copyright 2008, 2009 Free Software Foundation, Inc. + + Contributed by ARC International (www.arc.com) + + Authors: + Richard Stuckey + + 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 3 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, see . */ + +/******************************************************************************/ +/* */ +/* Outline: */ +/* This module contains a test driver for the JTAG actionpoints module of */ +/* the ARC port of gdb. */ +/* */ +/* Usage: */ +/* [ -c ] [ -d ] [ -s ] [ -r ] [ -a N ] */ +/* */ +/* where -c specifies target connection & disconnection only */ +/* -d switches on JTAG operation debuggging */ +/* -s simulates the JTAG target */ +/* -r specifies the JTAG operation retry count */ +/* -a 2 | 4 | 8 specifies the number of simulated actionpoints */ +/* */ +/******************************************************************************/ + +/* system header files */ +#include +#include +#include +#include +#include +#include + +/* gdb header files */ +#include "defs.h" +#include "breakpoint.h" + +/* ARC header files */ +#include "arc-jtag.h" +#include "arc-jtag-ops.h" +#include "arc-jtag-actionpoints.h" +#include "arc-registers.h" + + +/* -------------------------------------------------------------------------- */ +/* local types */ +/* -------------------------------------------------------------------------- */ + +// complete the type here +struct aux_register_definition +{ + const char* name; + ARC_RegisterNumber number; +}; + + +typedef enum +{ + CLEAR_USER_BIT, + RESTORE_USER_BIT +} Status32Action; + + +/* -------------------------------------------------------------------------- */ +/* externally visible data */ +/* -------------------------------------------------------------------------- */ + +/* global debug flag */ +Boolean arc_debug_target; + +ARC_RegisterNumber arc_debug_regnum = ARC_HW_DEBUG_REGNUM; + + +/* -------------------------------------------------------------------------- */ +/* local data */ +/* -------------------------------------------------------------------------- */ + +#define SUCCESS 0 +#define FAILURE (-1) + +// what should this be? +#define DATA_AREA 0x00001000 +#define DATA_AREA_LENGTH 1024 + +#define BP_ADDRESS (DATA_AREA + 0x0400) + +#define MAX_ACTION_POINTS 8 + +#define WRITE_WATCHPOINT 0 +#define READ_WATCHPOINT 1 +#define ACCESS_WATCHPOINT 2 + +#define AP_BUILD 0x76 + + +static Boolean test = TRUE; +static Boolean simulate = FALSE; +static unsigned int num_actionpoints = 2; +static struct target_ops operations; + +static const ARC_AuxRegisterDefinition registers[] = +{ + { "DEBUG", ARC_HW_DEBUG_REGNUM }, + { "IDENTITY", ARC_HW_IDENTITY_REGNUM }, + { "PC", ARC_HW_PC_REGNUM }, + { "STATUS32", ARC_HW_STATUS32_REGNUM }, + { "AP_BUILD", ARC_HW_AP_BUILD_REGNUM }, + { "AMV0", ARC_HW_AMV0_REGNUM }, + { "AMM0", ARC_HW_AMM0_REGNUM }, + { "AC0", ARC_HW_AC0_REGNUM } +}; + + +/* -------------------------------------------------------------------------- */ +/* local macros */ +/* -------------------------------------------------------------------------- */ + +#define CHECK(status, expected) \ +{ \ + if ((status) != (expected)) \ + { \ + failed("%d line: status %d != %d", __LINE__, status, expected); \ + } \ +} + + +/* -------------------------------------------------------------------------- */ +/* local functions */ +/* -------------------------------------------------------------------------- */ + +static void failed(const char* fmt, ...) +{ + va_list ap; + + fprintf(stderr, "*** FAILED: "); + va_start(ap, fmt); + vfprintf(stderr, fmt, ap); + va_end(ap); + fprintf(stderr, "\n"); + +// exit(EXIT_FAILURE); +} + + +static void run_tests(Boolean before_reset) +{ +static struct bp_target_info bpt[MAX_ACTION_POINTS + 1]; + + int status; + int result; + CORE_ADDR addr; + unsigned int i; + unsigned int max_actionpoints; + + if (before_reset) + { + memset(&bpt, sizeof(bpt), 0); + + for (i = 0; i <= MAX_ACTION_POINTS; i++) + bpt[i].placed_address = BP_ADDRESS + 4 * i; + } + else + { + arc_dump_actionpoints("after reset"); + + /* remove the actionpoints that were set before the reset */ + status = operations.to_remove_hw_breakpoint(&bpt[0]); CHECK(status, SUCCESS); + status = operations.to_remove_hw_breakpoint(&bpt[1]); CHECK(status, SUCCESS); + } + + + if (operations.to_can_use_hw_breakpoint(bp_hardware_breakpoint, 8, 0) == 1) + max_actionpoints = 8; + else if (operations.to_can_use_hw_breakpoint(bp_hardware_breakpoint, 4, 0) == 1) + max_actionpoints = 4; + else if (operations.to_can_use_hw_breakpoint(bp_hardware_breakpoint, 2, 0) == 1) + max_actionpoints = 2; + else + { + printf("can not use h/w breakpoints\n"); + return; + } + + printf("target supports %d actionpoints\n", max_actionpoints); + + + /* N breakpoints that each require 1 actionpoint can be set */ + for (i = 0; i < max_actionpoints + 1; i++) + { + status = operations.to_insert_hw_breakpoint(&bpt[i]); + CHECK(status, (i < max_actionpoints) ? SUCCESS : FAILURE); + } + for (i = 0; i < max_actionpoints + 1; i++) + { + status = operations.to_remove_hw_breakpoint(&bpt[i]); + CHECK(status, (i < max_actionpoints) ? SUCCESS : FAILURE); + } + + + if (operations.to_region_ok_for_hw_watchpoint(DATA_AREA, DATA_AREA_LENGTH)) + { + /* N watchpoints that each require 1 actionpoint can be set */ + for (i = 0; i < max_actionpoints + 1; i++) + { + status = operations.to_insert_watchpoint(DATA_AREA, 4, WRITE_WATCHPOINT); + CHECK(status, (i < max_actionpoints) ? SUCCESS : FAILURE); + } + for (i = 0; i < max_actionpoints + 1; i++) + { + status = operations.to_remove_watchpoint(DATA_AREA, 4, WRITE_WATCHPOINT); + CHECK(status, (i < max_actionpoints) ? SUCCESS : FAILURE); + } + + if (max_actionpoints == 8) + { + /* this requires 2 actionpoints (a pair) */ + status = operations.to_insert_watchpoint(DATA_AREA, 6, ACCESS_WATCHPOINT); CHECK(status, SUCCESS); + arc_display_actionpoints(); + status = operations.to_remove_watchpoint(DATA_AREA, 6, ACCESS_WATCHPOINT); CHECK(status, SUCCESS); + + /* this requires 3 actionpoints (a quad) */ + status = operations.to_insert_watchpoint(DATA_AREA, 5, ACCESS_WATCHPOINT); CHECK(status, SUCCESS); + arc_display_actionpoints(); + status = operations.to_remove_watchpoint(DATA_AREA, 5, ACCESS_WATCHPOINT); CHECK(status, SUCCESS); + + /* this requires 4 actionpoints (a quad) */ + status = operations.to_insert_watchpoint(DATA_AREA, 9, ACCESS_WATCHPOINT); CHECK(status, SUCCESS); + + /* this requires another 4 actionpoints (another quad) */ + status = operations.to_insert_watchpoint(DATA_AREA, 25, ACCESS_WATCHPOINT); CHECK(status, SUCCESS); + + status = operations.to_remove_watchpoint(DATA_AREA, 9, ACCESS_WATCHPOINT); CHECK(status, SUCCESS); + status = operations.to_remove_watchpoint(DATA_AREA, 25, ACCESS_WATCHPOINT); CHECK(status, SUCCESS); + + /* this would require 5 actionpoints! */ + status = operations.to_insert_watchpoint(DATA_AREA, 17, ACCESS_WATCHPOINT); CHECK(status, FAILURE); + + /* this will tie up actionpoints 0, 2 and 6 */ + status = operations.to_insert_hw_breakpoint(&bpt[0]); CHECK(status, SUCCESS); + status = operations.to_insert_hw_breakpoint(&bpt[1]); CHECK(status, SUCCESS); + status = operations.to_insert_hw_breakpoint(&bpt[2]); CHECK(status, SUCCESS); + status = operations.to_insert_hw_breakpoint(&bpt[3]); CHECK(status, SUCCESS); + status = operations.to_insert_hw_breakpoint(&bpt[4]); CHECK(status, SUCCESS); + status = operations.to_insert_hw_breakpoint(&bpt[5]); CHECK(status, SUCCESS); + status = operations.to_insert_hw_breakpoint(&bpt[6]); CHECK(status, SUCCESS); + status = operations.to_remove_hw_breakpoint(&bpt[1]); CHECK(status, SUCCESS); + status = operations.to_remove_hw_breakpoint(&bpt[3]); CHECK(status, SUCCESS); + status = operations.to_remove_hw_breakpoint(&bpt[4]); CHECK(status, SUCCESS); + status = operations.to_remove_hw_breakpoint(&bpt[5]); CHECK(status, SUCCESS); + + arc_display_actionpoints(); + + arc_dump_actionpoints("before quad shuffle"); + + /* this requires 4 actionpoints (a quad) - this should cause the + * actionpoints to be shuffled so that a quad is available + */ + status = operations.to_insert_watchpoint(DATA_AREA, 9, ACCESS_WATCHPOINT); CHECK(status, SUCCESS); + + arc_dump_actionpoints("after quad shuffle"); + + arc_display_actionpoints(); + + /* release the tied-up actionpoints */ + status = operations.to_remove_hw_breakpoint(&bpt[0]); CHECK(status, SUCCESS); + status = operations.to_remove_hw_breakpoint(&bpt[2]); CHECK(status, SUCCESS); + status = operations.to_remove_hw_breakpoint(&bpt[6]); CHECK(status, SUCCESS); + + arc_dump_actionpoints("before quad shuffle"); + + /* this requires another 4 actionpoints (a quad) - this should + * cause the actionpoints to be shuffled so that the other quad is + * available + */ + status = operations.to_insert_watchpoint(DATA_AREA, 36, ACCESS_WATCHPOINT); CHECK(status, SUCCESS); + + arc_dump_actionpoints("after quad shuffle"); + + /* release the two quads */ + status = operations.to_remove_watchpoint(DATA_AREA, 9, ACCESS_WATCHPOINT); CHECK(status, SUCCESS); + status = operations.to_remove_watchpoint(DATA_AREA, 36, ACCESS_WATCHPOINT); CHECK(status, SUCCESS); + } + else if (max_actionpoints == 4) + { + /* this requires 2 actionpoints (a pair) */ + status = operations.to_insert_watchpoint(DATA_AREA, 6, ACCESS_WATCHPOINT); CHECK(status, SUCCESS); + status = operations.to_remove_watchpoint(DATA_AREA, 6, ACCESS_WATCHPOINT); CHECK(status, SUCCESS); + + /* this requires 3 actionpoints (a quad) */ + status = operations.to_insert_watchpoint(DATA_AREA, 5, ACCESS_WATCHPOINT); CHECK(status, SUCCESS); + status = operations.to_remove_watchpoint(DATA_AREA, 5, ACCESS_WATCHPOINT); CHECK(status, SUCCESS); + + /* this requires 4 actionpoints (a quad) */ + status = operations.to_insert_watchpoint(DATA_AREA, 9, ACCESS_WATCHPOINT); CHECK(status, SUCCESS); + status = operations.to_remove_watchpoint(DATA_AREA, 9, ACCESS_WATCHPOINT); CHECK(status, SUCCESS); + + /* this would require 5 actionpoints! */ + status = operations.to_insert_watchpoint(DATA_AREA, 17, ACCESS_WATCHPOINT); CHECK(status, FAILURE); + + /* this will tie up actionpoints 0 and 2 */ + status = operations.to_insert_hw_breakpoint(&bpt[0]); CHECK(status, SUCCESS); + status = operations.to_insert_hw_breakpoint(&bpt[1]); CHECK(status, SUCCESS); + status = operations.to_insert_hw_breakpoint(&bpt[2]); CHECK(status, SUCCESS); + status = operations.to_remove_hw_breakpoint(&bpt[1]); CHECK(status, SUCCESS); + + arc_dump_actionpoints("before quad shuffle"); + + /* this requires 2 actionpoints (a pair) - this should cause the + * actionpoints to be shuffled so that a pair is available + */ + status = operations.to_insert_watchpoint(DATA_AREA, 6, ACCESS_WATCHPOINT); CHECK(status, SUCCESS); + status = operations.to_remove_watchpoint(DATA_AREA, 6, ACCESS_WATCHPOINT); CHECK(status, SUCCESS); + + arc_dump_actionpoints("after quad shuffle"); + + status = operations.to_remove_hw_breakpoint(&bpt[0]); CHECK(status, SUCCESS); + status = operations.to_remove_hw_breakpoint(&bpt[2]); CHECK(status, SUCCESS); + } + else if (max_actionpoints == 2) + { + /* this requires 2 actionpoints (a pair) */ + status = operations.to_insert_watchpoint(DATA_AREA, 6, ACCESS_WATCHPOINT); CHECK(status, SUCCESS); + status = operations.to_remove_watchpoint(DATA_AREA, 6, ACCESS_WATCHPOINT); CHECK(status, SUCCESS); + + /* this would require 3 actionpoints! */ + status = operations.to_insert_watchpoint(DATA_AREA, 5, ACCESS_WATCHPOINT); CHECK(status, FAILURE); + } + + result = operations.to_stopped_by_watchpoint(); + printf("%sstopped by watchpoint\n", (result) ? "" : "not "); + + result = operations.to_stopped_data_address(&operations, &addr); + if (result) + printf("stopped by data access at address 0x%08X\n", (unsigned int) addr); + } + else + printf("area %0x08X .. %0x08X does not allow watchpoints\n", DATA_AREA, DATA_AREA + DATA_AREA_LENGTH - 1); + + arc_dump_actionpoints("before reset"); + + /* leave some actionpoints set to ensure that there are some to re-establish + * after target board reset + */ + if (before_reset) + { + status = operations.to_insert_hw_breakpoint(&bpt[0]); CHECK(status, SUCCESS); + status = operations.to_insert_hw_breakpoint(&bpt[1]); CHECK(status, SUCCESS); + } +} + + +static void process_options(int argc, char** argv) +{ + int c; + + while ((c = getopt (argc, argv, "sdcr:a:")) != -1) + { + switch (c) + { + case 'd': + arc_jtag_ops.state_machine_debug = TRUE; + break; + case 'r': + arc_jtag_ops.retry_count = atoi(optarg); + break; + case 'a': + num_actionpoints = atoi(optarg); + if (!(num_actionpoints == 2 || num_actionpoints == 4 || num_actionpoints == 8)) + { + fprintf(stderr, "Usage: %s [ -d ]\n", argv[0]); + exit(EXIT_FAILURE); + } + break; + case 'c': + test = FALSE; + break; + case 's': + simulate = TRUE; + break; + default: + fprintf(stderr, "Usage: %s [ -dcs ] [ -r ] [ -a ]\n", argv[0]); + exit(EXIT_FAILURE); + } + } +} + + +/* -------------------------------------------------------------------------- */ +/* externally visible functions */ +/* -------------------------------------------------------------------------- */ + +extern void _initialize_arc_jtag_ops(void); + + +int main(int argc, char** argv) +{ + Boolean opened; + + printf("Starting test of ARC JTAG actionpoints...\n"); + + _initialize_arc_jtag_ops(); + + process_options(argc, argv); + + opened = ((simulate) ? TRUE : arc_jtag_ops.open()); + + if (opened) + { + printf("ARC processor is connected\n"); + + /* this can be done only after connection */ + if (arc_initialize_actionpoint_ops(&operations)) + { + if (test) + { + run_tests(TRUE); + printf("resetting board...\n"); + if (!simulate) + arc_jtag_ops.reset_board(); + printf("board reset\n"); + if (!arc_restore_actionpoints_after_reset()) + failed("could not restore actionpoints after reset"); + run_tests(FALSE); + } + } + else + printf("processor does not support actionpoints\n"); + + if (!simulate) + arc_jtag_ops.close(); + } + + printf("Finished test of ARC JTAG actionpoints\n"); + + return 0; +} + + +/* N.B. these functions are found in arc-jtag.c and arc-registers.c, but are + * included here in order to avoid including that module in the built test + * driver, as that would also pull in a lot of the gdb modules! + * + * Also, this allows the AUX register read/write operations to be simulated, + * thus making it possible to test much of the logic of the arc-jtag-actionpoints + * module without a real JTAG target. + */ + +void arc_change_status32(Status32Action action) +{ + static ARC_RegisterContents status32; + + if (action == CLEAR_USER_BIT) + { + /* Get processor out of user mode. */ + + if (arc_read_jtag_aux_register(ARC_HW_STATUS32_REGNUM, &status32, FALSE)) + { + /* if the User bit is actually set */ + if (status32 & STATUS32_USER) + if (!arc_write_jtag_aux_register(ARC_HW_STATUS32_REGNUM, + status32 & ~STATUS32_USER, FALSE)) + warning(_("Can not clear User bit in STATUS32 register")); + } + else + warning(_("Can not read STATUS32 register")); + } + else + { + /* if the User bit was actually cleared */ + if (status32 & STATUS32_USER) + if (!arc_write_jtag_aux_register(ARC_HW_STATUS32_REGNUM, status32, FALSE)) + warning(_("Can not restore User bit in STATUS32 register")); + } +} + + +Boolean arc_read_jtag_aux_register (ARC_RegisterNumber hwregno, + ARC_RegisterContents* contents, + Boolean warn_on_failure) +{ + if (simulate) + { + if (hwregno == AP_BUILD) + { + if (num_actionpoints == 2) + *contents = 0x00000004; + else if (num_actionpoints == 4) + *contents = 0x00000104; + else + *contents = 0x00000204; + } + else + *contents = 0; + return TRUE; + } + + return (arc_jtag_ops.read_aux_reg(hwregno, contents) == JTAG_SUCCESS); +} + + +Boolean arc_write_jtag_aux_register (ARC_RegisterNumber hwregno, + ARC_RegisterContents contents, + Boolean warn_on_failure) +{ + if (simulate) + { +// printf("AUX: hwregno = %d, contents = 0x%08X\n", hwregno, contents); + return TRUE; + } + + return (arc_jtag_ops.write_aux_reg(hwregno, contents) == JTAG_SUCCESS); +} + + +ARC_AuxRegisterDefinition* +arc_find_aux_register_by_name(const char* name) +{ + unsigned int i; + + for (i = 0; i < ELEMENTS_IN_ARRAY(registers); i++) + { + const ARC_AuxRegisterDefinition* def = ®isters[i]; + + if (strcmp(name, def->name) == 0) + return (ARC_AuxRegisterDefinition*) def; + } + + return NULL; +} + + +ARC_RegisterNumber arc_aux_hw_register_number(ARC_AuxRegisterDefinition* def) +{ + return def->number; +} + + +ARC_RegisterNumber arc_aux_find_register_number(const char* name, + ARC_RegisterNumber defaultNumber) +{ + ARC_AuxRegisterDefinition* def = arc_find_aux_register_by_name(name); + + return (def) ? def->number : defaultNumber; +} + +/******************************************************************************/ diff --git a/gdb/JTAG_download.c b/gdb/JTAG_download.c new file mode 100755 index 0000000..d3f0626 --- /dev/null +++ b/gdb/JTAG_download.c @@ -0,0 +1,208 @@ +/* Target dependent code for ARC700, for GDB, the GNU debugger. + + Copyright 2008, 2009 Free Software Foundation, Inc. + + Contributed by ARC International (www.arc.com) + + Authors: + Richard Stuckey + + 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 3 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, see . */ + +/******************************************************************************/ +/* */ +/* Outline: */ +/* This module contains a test driver for the JTAG operations module of */ +/* the ARC port of gdb. It measures the speed at which data can be */ +/* downloaded to the target. */ +/* */ +/* Usage: */ +/* [ -c ] [ -d ] [ -r ] */ +/* */ +/* where -c specifies target connection & disconnection only */ +/* -d switches on JTAG operation debuggging */ +/* -r specifies the JTAG operation retry count */ +/* */ +/******************************************************************************/ + +#include +#include +#include +#include +#include +#include +#include + +#include "arc-jtag-ops.h" + + +/* -------------------------------------------------------------------------- */ +/* local data */ +/* -------------------------------------------------------------------------- */ + +#define MB 1024 * 1024 +#define DATA_AREA 0x00001000 +#define DATA_AREA_SIZE 1 * MB + + +static ARC_Byte data[DATA_AREA_SIZE]; + + +static Boolean test = TRUE; + + +/* -------------------------------------------------------------------------- */ +/* externally visible data */ +/* -------------------------------------------------------------------------- */ + +/* global debug flag */ +Boolean arc_debug_target; + + +/* -------------------------------------------------------------------------- */ +/* local functions */ +/* -------------------------------------------------------------------------- */ + +static void failed(const char* fmt, ...) +{ + va_list ap; + + printf("*** FAILED: "); + va_start(ap, fmt); + vprintf(fmt, ap); + va_end(ap); + printf("\n"); + +// exit(EXIT_FAILURE); +} + + +static void run_test(void) +{ + unsigned int i; + unsigned int bytes; + struct timeval start_time, end_time; + long long int time_count; + + for (i = 0; i < DATA_AREA_SIZE; i++) + data[i] = (ARC_Byte) i; + + gettimeofday (&start_time, NULL); + + bytes = arc_jtag_ops.memory_write_chunk(DATA_AREA, data, DATA_AREA_SIZE); + + gettimeofday (&end_time, NULL); + + if (bytes != DATA_AREA_SIZE) + failed("memory write: %d", bytes); + + /* Compute the elapsed time in milliseconds, as a tradeoff between + accuracy and overflow. */ + time_count = (end_time.tv_sec - start_time.tv_sec) * 1000; + time_count += (end_time.tv_usec - start_time.tv_usec) / 1000; + + if (time_count > 0) + { + unsigned long rate = (bytes * 1000) / time_count; + + printf("0x%x bytes downloaded in %lld milliseconds\n", bytes, time_count); + printf("transfer rate: %lu bytes/sec\n", rate); + } + + + gettimeofday (&start_time, NULL); + + bytes = arc_jtag_ops.memory_write_pattern(DATA_AREA, 0, DATA_AREA_SIZE); + + gettimeofday (&end_time, NULL); + + if (bytes != DATA_AREA_SIZE) + failed("memory fill zero: %d", bytes); + + /* Compute the elapsed time in milliseconds, as a tradeoff between + accuracy and overflow. */ + time_count = (end_time.tv_sec - start_time.tv_sec) * 1000; + time_count += (end_time.tv_usec - start_time.tv_usec) / 1000; + + if (time_count > 0) + { + unsigned long rate = (bytes * 1000) / time_count; + + printf("0x%x bytes zeroed in %lld milliseconds\n", bytes, time_count); + printf("zero rate: %lu bytes/sec\n", rate); + } + +} + + +static void process_options(int argc, char** argv) +{ + int c; + + while ((c = getopt (argc, argv, "dcr:")) != -1) + { + switch (c) + { + case 'd': + arc_jtag_ops.state_machine_debug = TRUE; + break; + case 'r': + arc_jtag_ops.retry_count = atoi(optarg); + break; + case 'c': + test = FALSE; + break; + default: + fprintf(stderr, "Usage: %s [ -d ]\n", argv[0]); + exit(EXIT_FAILURE); + } + } +} + + +/* -------------------------------------------------------------------------- */ +/* externally visible functions */ +/* -------------------------------------------------------------------------- */ + +extern void _initialize_arc_jtag_ops(void); + + +int main(int argc, char** argv) +{ + Boolean opened; + + printf("Starting test of ARC JTAG download...\n"); + + _initialize_arc_jtag_ops(); + + process_options(argc, argv); + + opened = arc_jtag_ops.open(); + + if (opened) + { + printf("ARC processor is connected\n"); + + if (test) + run_test(); + + arc_jtag_ops.close(); + } + + printf("Finished test of ARC JTAG download\n"); + + return 0; +} + +/******************************************************************************/ diff --git a/gdb/JTAG_ops_driver.c b/gdb/JTAG_ops_driver.c new file mode 100644 index 0000000..8ae8776 --- /dev/null +++ b/gdb/JTAG_ops_driver.c @@ -0,0 +1,904 @@ +/* Target dependent code for ARC700, for GDB, the GNU debugger. + + Copyright 2008, 2009 Free Software Foundation, Inc. + + Contributed by ARC International (www.arc.com) + + Authors: + Richard Stuckey + + 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, see . */ + +/******************************************************************************/ +/* */ +/* Outline: */ +/* This module contains a test driver for the JTAG operations module of */ +/* the ARC port of gdb. */ +/* */ +/* Usage: */ +/* [ -c ] [ -d ] [ -r ] [ -m ] */ +/* */ +/* where -c specifies target connection & disconnection only */ +/* -d switches on JTAG operation debuggging */ +/* -r specifies the JTAG operation retry count */ +/* -m specifies testing memory operations only */ +/* */ +/******************************************************************************/ + +#include +#include +#include +#include +#include +#include +#include + +#include "arc-jtag-ops.h" +#include "arc-memory.h" + + +/* -------------------------------------------------------------------------- */ +/* local types */ +/* -------------------------------------------------------------------------- */ + +typedef enum +{ + RO, // read-only + RW, // read/write + WO, // write-only + UU +} RegisterMode; + + +typedef struct +{ + const char* name; + ARC_RegisterNumber regno; + ARC_RegisterContents mask; + RegisterMode mode; +} RegisterInfo; + + +/* -------------------------------------------------------------------------- */ +/* local data */ +/* -------------------------------------------------------------------------- */ + +// what should this be? +#define DATA_AREA 0x00001000 +#define BUFFER_LENGTH 128 + +#define ARC_NR_CORE_REGS 32 + + +#undef RBCR +#define RAUX(name, hwregno, desc, gdbregno, mask, mode, version) { #name, hwregno, mask, mode }, +static const RegisterInfo aux[] = +{ + #include "arc-regnums-defs.h" +}; + +#undef RAUX +#define RBCR(name, hwregno, desc, gdbregno, mask, mode, version) { #name, hwregno, mask, mode }, +static const RegisterInfo bcr[] = +{ + #include "arc-regnums-defs.h" +}; + + +static Boolean test = TRUE; +static Boolean memory_only = FALSE; +static TargetOperations operations; + + +/* -------------------------------------------------------------------------- */ +/* externally visible data */ +/* -------------------------------------------------------------------------- */ + +/* global debug flag */ +Boolean arc_debug_target; + + +/* -------------------------------------------------------------------------- */ +/* local functions */ +/* -------------------------------------------------------------------------- */ + +static void failed(const char* fmt, ...) +{ + va_list ap; + + fprintf(stderr, "*** FAILED: "); + va_start(ap, fmt); + vfprintf(stderr, fmt, ap); + va_end(ap); + fprintf(stderr, "\n"); + +// exit(EXIT_FAILURE); +} + + +static void read_core_registers(void) +{ + ARC_RegisterNumber r; + + for (r = 0; r < ARC_NR_CORE_REGS; r++) + { + ARC_RegisterContents contents; + JTAG_OperationStatus status = arc_jtag_ops.read_core_reg(r, &contents); + + if (status == JTAG_SUCCESS) + printf("core register %02d: 0x%08X\n", r, contents); + else + failed("could not read core register %02d: %d", r, (int) status); + } +} + + +static void write_core_registers(void) +{ + ARC_RegisterNumber r; + + for (r = 0; r < ARC_NR_CORE_REGS; r++) + { + ARC_RegisterContents contents = 0xDEADBEEF + r; + JTAG_OperationStatus status = arc_jtag_ops.write_core_reg(r, contents); + + if (status == JTAG_SUCCESS) + { + ARC_RegisterContents new_contents; + + status = arc_jtag_ops.read_core_reg(r, &new_contents); + + if (status == JTAG_SUCCESS) + { + if (new_contents != contents) + failed("discrepancy in core register %02d contents: 0x%08X != 0x%08X", r, contents, new_contents); + } + else + failed("could not read back core register %02d: %d", r, (int) status); + } + else + failed("could not write core register %02d: %d", r, (int) status); + } +} + + +static void read_auxiliary_registers(void) +{ + unsigned int i; + + for (i = 0; i < ELEMENTS_IN_ARRAY(aux); i++) + { + const RegisterInfo* info = &aux[i]; + + if (info->mode != WO) + { + ARC_RegisterContents contents; + JTAG_OperationStatus status = arc_jtag_ops.read_aux_reg(info->regno, &contents); + + if (status == JTAG_SUCCESS) + printf("aux register 0x%03x (%-15s): 0x%08X\n", info->regno, info->name, contents); + else + failed("could not read aux register 0x%03x (%s): %d", info->regno, info->name, (int) status); + } + } +} + + +static void write_auxiliary_registers(void) +{ + unsigned int i; + + for (i = 0; i < ELEMENTS_IN_ARRAY(aux); i++) + { + const RegisterInfo* info = &aux[i]; + + if (info->mode != RO) + { + ARC_RegisterContents contents = 0xFFFFFFFF; + JTAG_OperationStatus status = arc_jtag_ops.write_aux_reg(info->regno, contents); + + if (status == JTAG_SUCCESS) + { + if (info->mode != WO) + { + ARC_RegisterContents new_contents; + + status = arc_jtag_ops.read_aux_reg(info->regno, &new_contents); + + if (status == JTAG_SUCCESS) + { + ARC_RegisterContents masked_contents = contents & info->mask; + ARC_RegisterContents masked_new_contents = new_contents & info->mask; + + if (masked_new_contents != masked_contents) + failed("discrepancy in aux register %03x (%s) contents: 0x%08X != 0x%08X", + info->regno, info->name, masked_contents, masked_new_contents); + } + else + failed("could not read back aux register 0x%03x (%s): %d", info->regno, info->name, (int) status); + } + } + else + failed("could not write aux register 0x%03x (%s): %d", info->regno, info->name, (int) status); + } + } +} + + +static void read_build_configuration_registers(void) +{ + unsigned int i; + + for (i = 0; i < ELEMENTS_IN_ARRAY(bcr); i++) + { + const RegisterInfo* info = &bcr[i]; + + /* if the register is not unused */ + if (info->mode != UU) + { + ARC_RegisterContents contents; + JTAG_OperationStatus status = arc_jtag_ops.read_aux_reg(info->regno, &contents); + + if (status == JTAG_SUCCESS) + printf("BCR 0x%02x (%-16s): 0x%08X\n", info->regno, info->name, contents); + else + failed("could not read BCR 0x%02x (%s): %d", info->regno, info->name, (int) status); + } + } +} + + +/* these functions should NOT be used within this module: they are intended + * purely for use by the arc-memory module for reading/writing multiple words + * of data at word-aligned addresses + */ + +static unsigned int read_jtag_words(ARC_Address address, + ARC_Byte* data, + unsigned int words) +{ + DEBUG("reading %u words from 0x%08X in xISS\n", words, address); + + assert(IS_WORD_ALIGNED(address)); + + return arc_jtag_ops.memory_read_chunk(address, data, words); +} + + +static unsigned int write_jtag_words(ARC_Address address, + ARC_Byte* data, + unsigned int words) +{ + assert(IS_WORD_ALIGNED(address)); + + DEBUG("writing %u words to 0x%08X in xISS\n", words, address); + + return arc_jtag_ops.memory_write_chunk(address, data, words); +} + + +static unsigned int write_jtag_pattern(ARC_Address address, + ARC_Word pattern, + unsigned int words) +{ + assert(IS_WORD_ALIGNED(address)); + + DEBUG("writing pattern 0x%08X repeated %u times to 0x%08X in xISS\n", pattern, words, address); + + return arc_jtag_ops.memory_write_pattern(address, pattern, words); +} + + +/* these functions should be used within this module for all memory accesses */ +static unsigned int read_chunk(ARC_Address addr, ARC_Byte* data, unsigned int bytes) +{ + unsigned int total_read; + + ENTERARGS("addr 0x%08X, bytes %u", addr, bytes); + + total_read = arc_read_memory(&operations, addr, data, bytes); + + DEBUG("read %u bytes\n", total_read); + + return total_read; +} + + +static unsigned int write_chunk(ARC_Address addr, ARC_Byte* data, unsigned int bytes) +{ + unsigned int total_written; + + ENTERARGS("addr 0x%08X, bytes %u", addr, bytes); + + total_written = arc_write_memory(&operations, addr, data, bytes); + + DEBUG("written %u bytes\n", total_written); + + return total_written; +} + + +/* write a repeated pattern of data to memory; + * the start of each pattern is always word-aligned, so if the given address is + * not word-aligned, the first partial word written will contain trailing bytes + * of the pattern + */ +static unsigned int write_pattern(ARC_Address addr, ARC_Word pattern, unsigned int bytes) +{ + unsigned int total_written; + + ENTERARGS("addr 0x%08X, pattern 0x%08X, bytes %u", addr, pattern, bytes); + + total_written = arc_write_pattern(&operations, addr, pattern, bytes); + + DEBUG("written %u bytes\n", total_written); + + return total_written; +} + + +/* test word read/write operations - write several words to different + * addresses to ensure that JTAG Data Register does not still hold first + * word; use both contiguous and non-contiguous words to check that + * JTAG Address Register is loaded correctly + */ +static void read_write_memory_words(void) +{ + const ARC_Word write1 = 0xCAFEBABE; + const ARC_Word write2 = 0xDEADBEEF; + const ARC_Word write3 = 0xBABEFACE; + const ARC_Word write4 = 0x12345678; + ARC_Word read1 = 0; + ARC_Word read2 = 0; + ARC_Word read3 = 0; + ARC_Word read4 = 0; + unsigned int bytes; + + bytes = arc_jtag_ops.memory_write_word(DATA_AREA, write1); + if (bytes != 4) + failed("memory word 1 write: %d", bytes); + + bytes = arc_jtag_ops.memory_write_word(DATA_AREA + 4, write2); + if (bytes != 4) + failed("memory word 2 write: %d", bytes); + + bytes = arc_jtag_ops.memory_write_word(DATA_AREA + 8, write3); + if (bytes != 4) + failed("memory word 3 write: %d", bytes); + + bytes = arc_jtag_ops.memory_write_word(DATA_AREA + 20, write4); + if (bytes != 4) + failed("memory word 4 write: %d", bytes); + + bytes = arc_jtag_ops.memory_read_word(DATA_AREA, &read1); + if (bytes != 4) + failed("memory word 1 read: %d", bytes); + + bytes = arc_jtag_ops.memory_read_word(DATA_AREA + 4, &read2); + if (bytes != 4) + failed("memory word 2 read: %d", bytes); + + bytes = arc_jtag_ops.memory_read_word(DATA_AREA + 8, &read3); + if (bytes != 4) + failed("memory word 3 read: %d", bytes); + + bytes = arc_jtag_ops.memory_read_word(DATA_AREA + 20, &read4); + if (bytes != 4) + failed("memory word 4 read: %d", bytes); + + if (read1 != write1) + failed("word 1: %08X != %08X", read1, write1); + + if (read2 != write2) + failed("word 2: %08X != %08X", read2, write2); + + if (read3 != write3) + failed("word 3: %08X != %08X", read3, write3); + + if (read3 != write3) + failed("word 3: %08X != %08X", read3, write3); + + if (read4 != write4) + failed("word 4: %08X != %08X", read4, write4); +} + + +/* test chunk read/write operations */ +static void read_write_memory_chunks(void) +{ + ARC_Byte in [BUFFER_LENGTH]; + ARC_Byte out[BUFFER_LENGTH]; + unsigned int bytes; + unsigned int i; + unsigned int offset; + + /* initialize output buffer to 7 bit values */ + for (i = 0; i < BUFFER_LENGTH; i++) + out[i] = (ARC_Byte) i; + + /* ----------------------------------------------------------- */ + /* initialize data area */ + /* ----------------------------------------------------------- */ + + /* write series of complete words */ + + bytes = write_chunk(DATA_AREA, out, BUFFER_LENGTH); + if (bytes != BUFFER_LENGTH) + failed("memory chunk write: %d", bytes); + + /* and read them back */ + + bytes = read_chunk(DATA_AREA, in, BUFFER_LENGTH); + if (bytes != BUFFER_LENGTH) + failed("memory chunk read: %d", bytes); + + if (memcmp(in, out, BUFFER_LENGTH) != 0) + failed("memory chunk read/write:"); + + + /* ----------------------------------------------------------- */ + /* read operations */ + /* ----------------------------------------------------------- */ + + /* 0) read single word */ + + bytes = read_chunk(DATA_AREA, in, 4); + if (bytes != 4) + failed("memory chunk read word: %d", bytes); + + if (memcmp(in, out, 4) != 0) + failed("memory chunk read word"); + + /* 1) read leading bytes */ + + for (i = 1; i <= 3; i++) + { + bytes = read_chunk(DATA_AREA + 4 - i, in, i); + if (bytes != i) + failed("memory chunk read leading bytes: %d", bytes); + + if (memcmp(in, out + 4 - i, i) != 0) + failed("memory chunk read leading bytes"); + } + + /* 2) read trailing bytes */ + + for (i = 1; i <= 3; i++) + { + bytes = read_chunk(DATA_AREA, in, i); + if (bytes != i) + failed("memory chunk read trailing bytes: %d", bytes); + + if (memcmp(in, out, i) != 0) + failed("memory chunk read trailing bytes"); + } + + /* 3) read leading bytes and series of complete words */ + + bytes = read_chunk(DATA_AREA + 1, in, 11); + if (bytes != 11) + failed("memory chunk read leading bytes and words: %d", bytes); + + if (memcmp(in, out + 1, 11) != 0) + failed("memory chunk read leading bytes and words"); + + /* 4) read series of complete words and trailing bytes */ + + bytes = read_chunk(DATA_AREA, in, 11); + if (bytes != 11) + failed("memory chunk read words and trailing bytes: %d", bytes); + + if (memcmp(in, out, 11) != 0) + failed("memory chunk read words and trailing bytes"); + + /* 5) read leading bytes and trailing bytes */ + + bytes = read_chunk(DATA_AREA + 1, in, 5); + if (bytes != 5) + failed("memory chunk read leading and trailing bytes: %d", bytes); + + if (memcmp(in, out + 1, 5) != 0) + failed("memory chunk read leading and trailing bytes"); + + /* 6) read leading bytes, series of complete words and trailing bytes */ + + bytes = read_chunk(DATA_AREA + 2, in, 23); + if (bytes != 23) + failed("memory chunk read leading bytes, words and trailing bytes: %d", bytes); + + if (memcmp(in, out + 2, 23) != 0) + failed("memory chunk read leading bytes, words and trailing bytes"); + + /* 7) pathological cases: bytes in middle of word */ + + bytes = read_chunk(DATA_AREA + 1, in, 1); + if (bytes != 1) + failed("memory chunk read bytes in middle (1) : %d", bytes); + + if (memcmp(in, out + 1, 1) != 0) + failed("memory chunk read middle bytes (1)"); + + bytes = read_chunk(DATA_AREA + 2, in, 2); + if (bytes != 2) + failed("memory chunk read bytes in middle (2) : %d", bytes); + + if (memcmp(in, out + 2, 2) != 0) + failed("memory chunk read middle bytes (2)"); + + bytes = read_chunk(DATA_AREA + 3, in, 1); + if (bytes != 1) + failed("memory chunk read bytes in middle (3) : %d", bytes); + + if (memcmp(in, out + 3, 1) != 0) + failed("memory chunk read middle bytes (3)"); + + + /* ----------------------------------------------------------- */ + /* write operations */ + /* ----------------------------------------------------------- */ + + /* on each test, read back the whole area: we must check that no other data + * in the area has been changed, hence the use of 8-bit values on the write + * to distinguish them from the 7-bit values used to initialise the area; + * also, a different section of the area is used for each test + */ + + /* 0) write single word */ + + out[0] = 45; + out[1] = 89; + out[2] = 66; + out[3] = 53; + + bytes = write_chunk(DATA_AREA, out, 4); + if (bytes != 4) + failed("memory chunk write word: %d", bytes); + + bytes = read_chunk(DATA_AREA, in, 4); + if (memcmp(in, out, 4) != 0) + failed("memory chunk write word"); + + /* 1) write leading bytes */ + + for (i = 1; i <= 3; i++) + { + offset = 8 - i; + + /* change data in output buffer to 8-bit values */ + *(out + offset) = 128 + i; + + bytes = write_chunk(DATA_AREA + offset, out + offset, i); + if (bytes != i) + failed("memory chunk write leading bytes: %d", bytes); + + bytes = read_chunk(DATA_AREA, in, BUFFER_LENGTH); + if (memcmp(in, out, BUFFER_LENGTH) != 0) + failed("memory chunk write leading bytes"); + } + + /* 2) write trailing bytes */ + + offset = 8; + + for (i = 1; i <= 3; i++) + { + /* change data in output buffer to 8-bit values */ + *(out + offset + i - 1) = 128 + i; + + bytes = write_chunk(DATA_AREA + offset, out + offset, i); + if (bytes != i) + failed("memory chunk write trailing bytes: %d", bytes); + + bytes = read_chunk(DATA_AREA, in, BUFFER_LENGTH); + if (memcmp(in, out, BUFFER_LENGTH) != 0) + failed("memory chunk write trailing bytes"); + } + + /* 3) write leading bytes and series of complete words */ + + offset = 13; + + for (i = 0; i < 11; i++) + *(out + offset + i) = 128 + i; + + bytes = write_chunk(DATA_AREA + offset, out + offset, 11); + if (bytes != 11) + failed("memory chunk write leading bytes and words: %d", bytes); + + bytes = read_chunk(DATA_AREA, in, BUFFER_LENGTH); + if (memcmp(in, out, BUFFER_LENGTH) != 0) + failed("memory chunk write leading bytes and words"); + + /* 4) write series of complete words and trailing bytes */ + + offset = 28; + + for (i = 0; i < 11; i++) + *(out + offset + i) = 128 + i; + + bytes = write_chunk(DATA_AREA + offset, out + offset, 11); + if (bytes != 11) + failed("memory chunk write words and trailing bytes: %d", bytes); + + bytes = read_chunk(DATA_AREA, in, BUFFER_LENGTH); + if (memcmp(in, out, BUFFER_LENGTH) != 0) + failed("memory chunk write words and trailing bytes"); + + /* 5) write leading bytes and trailing bytes */ + + offset = 40; + + for (i = 0; i < 5; i++) + *(out + offset + i) = 128 + i; + + bytes = write_chunk(DATA_AREA + offset, out + offset, 5); + if (bytes != 5) + failed("memory chunk write leading and trailing bytes: %d", bytes); + + bytes = read_chunk(DATA_AREA, in, BUFFER_LENGTH); + if (memcmp(in, out, BUFFER_LENGTH) != 0) + failed("memory chunk write leading and trailing bytes"); + + /* 6) write leading bytes, series of complete words and trailing bytes */ + + offset = 48; + + for (i = 0; i < 23; i++) + *(out + offset + i) = 128 + i; + + bytes = write_chunk(DATA_AREA + offset, out + offset, 23); + if (bytes != 23) + failed("memory chunk write leading bytes, words and trailing bytes: %d", bytes); + + bytes = read_chunk(DATA_AREA, in, BUFFER_LENGTH); + if (memcmp(in, out, BUFFER_LENGTH) != 0) + failed("memory chunk write leading bytes, words and trailing bytes"); + + /* 7) pathological cases: bytes in middle of word */ + + offset = 85; + *(out + offset) = 128; + + bytes = write_chunk(DATA_AREA + offset, out + offset, 1); + if (bytes != 1) + failed("memory chunk write bytes in middle (1) : %d", bytes); + + bytes = read_chunk(DATA_AREA, in, BUFFER_LENGTH); + if (memcmp(in, out, BUFFER_LENGTH) != 0) + failed("memory chunk write middle bytes (1)"); + + offset = 95; + *(out + offset) = 129; + *(out + offset + 1) = 130; + + bytes = write_chunk(DATA_AREA + offset, out + offset, 2); + if (bytes != 2) + failed("memory chunk write bytes in middle (2) : %d", bytes); + + bytes = read_chunk(DATA_AREA, in, BUFFER_LENGTH); + if (memcmp(in, out, BUFFER_LENGTH) != 0) + failed("memory chunk write middle bytes (2)"); + + offset = 106; + *(out + offset) = 131; + + bytes = write_chunk(DATA_AREA + offset, out + offset, 1); + if (bytes != 1) + failed("memory chunk write bytes in middle (3) : %d", bytes); + + bytes = read_chunk(DATA_AREA, in, BUFFER_LENGTH); + if (memcmp(in, out, BUFFER_LENGTH) != 0) + failed("memory chunk write middle bytes (3)"); + + + /* ----------------------------------------------------------- */ + /* write zeroes operation */ + /* ----------------------------------------------------------- */ + + offset = 110; + + for (i = 0; i < 15; i++) + *(out + offset + i) = 0; + + bytes = write_pattern(DATA_AREA + offset, 0, 15); + if (bytes != 15) + failed("memory zero: %d", bytes); + + bytes = read_chunk(DATA_AREA, in, BUFFER_LENGTH); + if (memcmp(in, out, BUFFER_LENGTH) != 0) + failed("memory zero"); + + + /* ----------------------------------------------------------- */ + /* write pattern operation */ + /* ----------------------------------------------------------- */ + + offset = 38; + + /* the pattern will be word-aligned */ + +#ifdef TARGET_IS_BIG_ENDIAN + *(out + offset + 0) = 0xBE; // leading bytes + *(out + offset + 1) = 0xEF; + + *(out + offset + 2) = 0xDE; // word 0 + *(out + offset + 3) = 0xAD; + *(out + offset + 4) = 0xBE; + *(out + offset + 5) = 0xEF; + + *(out + offset + 6) = 0xDE; // word 1 + *(out + offset + 7) = 0xAD; + *(out + offset + 8) = 0xBE; + *(out + offset + 9) = 0xEF; + + *(out + offset + 10) = 0xDE; // word 2 + *(out + offset + 11) = 0xAD; + *(out + offset + 12) = 0xBE; + *(out + offset + 13) = 0xEF; + + *(out + offset + 14) = 0xDE; // word 3 + *(out + offset + 15) = 0xAD; + *(out + offset + 16) = 0xBE; + *(out + offset + 17) = 0xEF; + + *(out + offset + 18) = 0xDE; // trailing bytes + *(out + offset + 19) = 0xAD; +#else + *(out + offset + 0) = 0xAD; // leading bytes + *(out + offset + 1) = 0xDE; + + *(out + offset + 5) = 0xDE; // word 0 + *(out + offset + 4) = 0xAD; + *(out + offset + 3) = 0xBE; + *(out + offset + 2) = 0xEF; + + *(out + offset + 9) = 0xDE; // word 1 + *(out + offset + 8) = 0xAD; + *(out + offset + 7) = 0xBE; + *(out + offset + 6) = 0xEF; + + *(out + offset + 13) = 0xDE; // word 2 + *(out + offset + 12) = 0xAD; + *(out + offset + 11) = 0xBE; + *(out + offset + 10) = 0xEF; + + *(out + offset + 17) = 0xDE; // word 3 + *(out + offset + 16) = 0xAD; + *(out + offset + 15) = 0xBE; + *(out + offset + 14) = 0xEF; + + *(out + offset + 18) = 0xEF; // trailing bytes + *(out + offset + 19) = 0xBE; +#endif + + bytes = write_pattern(DATA_AREA + offset, 0xDEADBEEF, 20); + if (bytes != 20) + failed("memory pattern: %d", bytes); + + bytes = read_chunk(DATA_AREA, in, BUFFER_LENGTH); + if (memcmp(in, out, BUFFER_LENGTH) != 0) + failed("memory pattern"); + + /* ----------------------------------------------------------- */ + /* write repeated values operation */ + /* ----------------------------------------------------------- */ + + /* initialize output buffer to the same value */ + for (i = 0; i < BUFFER_LENGTH; i++) + out[i] = 0xA; + + bytes = write_chunk(DATA_AREA, out, BUFFER_LENGTH); + if (bytes != BUFFER_LENGTH) + failed("memory chunk write repeated values : %d", bytes); + + bytes = read_chunk(DATA_AREA, in, BUFFER_LENGTH); + if (memcmp(in, out, BUFFER_LENGTH) != 0) + failed("memory chunk write repeated values"); +} + + +static void run_tests(void) +{ + if (!memory_only) + { + read_core_registers(); + read_auxiliary_registers(); + read_build_configuration_registers(); + + write_core_registers(); + write_auxiliary_registers(); + } + + read_write_memory_words(); + read_write_memory_chunks(); +} + + +static void process_options(int argc, char** argv) +{ + int c; + + while ((c = getopt (argc, argv, "mdcr:")) != -1) + { + switch (c) + { + case 'd': + arc_jtag_ops.state_machine_debug = TRUE; + break; + case 'r': + arc_jtag_ops.retry_count = atoi(optarg); + break; + case 'c': + test = FALSE; + break; + case 'm': + memory_only = TRUE; + break; + default: + fprintf(stderr, "Usage: %s [ -d ]\n", argv[0]); + exit(EXIT_FAILURE); + } + } +} + + +/* -------------------------------------------------------------------------- */ +/* externally visible functions */ +/* -------------------------------------------------------------------------- */ + +extern void _initialize_arc_jtag_ops(void); + + +int main(int argc, char** argv) +{ + Boolean opened; + + printf("Starting test of ARC JTAG interface...\n"); + + _initialize_arc_jtag_ops(); + + process_options(argc, argv); + + opened = arc_jtag_ops.open(); + + if (opened) + { + printf("ARC processor is connected\n"); + + if (test) + { + operations.read_core_register = NULL; + operations.write_core_register = NULL; + operations.read_auxiliary_register = NULL; + operations.write_auxiliary_register = NULL; + operations.read_memory = read_jtag_words; + operations.write_memory = write_jtag_words; + operations.fill_memory = write_jtag_pattern; + + run_tests(); + printf("resetting board...\n"); + arc_jtag_ops.reset_board(); + printf("board reset\n"); + run_tests(); + } + + arc_jtag_ops.close(); + } + + printf("Finished test of ARC JTAG interface\n"); + + return 0; +} + +/******************************************************************************/ diff --git a/gdb/Makefile.in b/gdb/Makefile.in index f526073..20cce29 100644 --- a/gdb/Makefile.in +++ b/gdb/Makefile.in @@ -1,5 +1,5 @@ # Copyright (C) 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, -# 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 +# 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 # Free Software Foundation, Inc. # This file is part of GDB. @@ -141,6 +141,9 @@ READLINE_CFLAGS = @READLINE_CFLAGS@ # Where is expat? This will be empty if expat was not available. LIBEXPAT = @LIBEXPAT@ +# Where are the ARC xISS header files? +XISS_INCLUDES = @XISS_INCLUDES@ + WARN_CFLAGS = @WARN_CFLAGS@ WERROR_CFLAGS = @WERROR_CFLAGS@ GDB_WARN_CFLAGS = $(WARN_CFLAGS) @@ -364,7 +367,8 @@ INTERNAL_CFLAGS_BASE = \ $(CFLAGS) $(GLOBAL_CFLAGS) $(PROFILE_CFLAGS) \ $(GDB_CFLAGS) $(OPCODES_CFLAGS) $(READLINE_CFLAGS) \ $(BFD_CFLAGS) $(INCLUDE_CFLAGS) $(LIBDECNUMBER_CFLAGS) \ - $(INTL_CFLAGS) $(ENABLE_CFLAGS) $(INTERNAL_CPPFLAGS) + $(INTL_CFLAGS) $(ENABLE_CFLAGS) $(INTERNAL_CPPFLAGS) \ + $(XISS_INCLUDES) INTERNAL_WARN_CFLAGS = $(INTERNAL_CFLAGS_BASE) $(GDB_WARN_CFLAGS) INTERNAL_CFLAGS = $(INTERNAL_WARN_CFLAGS) $(GDB_WERROR_CFLAGS) @@ -392,7 +396,7 @@ INSTALLED_LIBS=-lbfd -lreadline -lopcodes -liberty -ldecnumber \ CLIBS = $(SIM) $(READLINE) $(OPCODES) $(BFD) $(INTL) $(LIBIBERTY) $(LIBDECNUMBER) \ $(XM_CLIBS) $(TM_CLIBS) $(NAT_CLIBS) $(GDBTKLIBS) @LIBS@ \ $(LIBICONV) $(LIBEXPAT) \ - $(LIBIBERTY) $(WIN32LIBS) + $(LIBIBERTY) $(WIN32LIBS) -lz CDEPS = $(XM_CDEPS) $(TM_CDEPS) $(NAT_CDEPS) $(SIM) $(BFD) $(READLINE_DEPS) \ $(OPCODES) $(INTL_DEPS) $(LIBIBERTY) $(CONFIG_DEPS) @@ -411,7 +415,8 @@ RUNTESTFLAGS= # XML files to build in to GDB. XMLFILES = $(srcdir)/features/gdb-target.dtd $(srcdir)/features/xinclude.dtd \ - $(srcdir)/features/library-list.dtd + $(srcdir)/features/library-list.dtd \ + $(srcdir)/features/arc-registers.dtd # This is ser-unix.o for any system which supports a v7/BSD/SYSV/POSIX # interface to the serial port. Hopefully if get ported to OS/2, VMS, @@ -423,7 +428,7 @@ SER_HARDWIRE = @SER_HARDWIRE@ # The `remote' debugging target is supported for most architectures, # but not all (e.g. 960) -REMOTE_OBS = remote.o dcache.o tracepoint.o ax-general.o ax-gdb.o remote-fileio.o +REMOTE_OBS = remote.o dcache.o tracepoint.o ax-general.o ax-gdb.o remote-fileio.o target-fileio.o # This is remote-sim.o if a simulator is to be linked in. SIM_OBS = @SIM_OBS@ @@ -624,7 +629,7 @@ SFILES = ada-exp.y ada-lang.c ada-typeprint.c ada-valprint.c \ solib.c solib-null.c source.c \ stabsread.c stack.c std-regs.c symfile.c symfile-mem.c symmisc.c \ symtab.c \ - target.c target-descriptions.c target-memory.c \ + target.c target-descriptions.c target-fileio.c target-memory.c \ thread.c top.c tracepoint.c \ trad-frame.c \ tramp-frame.c \ @@ -647,6 +652,7 @@ aout_stabs_gnu_h = $(INCLUDE_DIR)/aout/stabs_gnu.h getopt_h = $(INCLUDE_DIR)/getopt.h floatformat_h = $(INCLUDE_DIR)/floatformat.h bfd_h = $(BFD_DIR)/bfd.h +bfd_in2_h = $(BFD_DIR)/bfd-in2.h coff_sym_h = $(INCLUDE_DIR)/coff/sym.h coff_symconst_h = $(INCLUDE_DIR)/coff/symconst.h coff_ecoff_h = $(INCLUDE_DIR)/coff/ecoff.h @@ -731,10 +737,25 @@ annotate_h = annotate.h $(symtab_h) $(gdbtypes_h) arch_utils_h = arch-utils.h arm_linux_tdep_h = arm-linux-tdep.h arm_tdep_h = arm-tdep.h +arc_board_h = arc-board.h +arc_gpio_h = arc-gpio.h arc_tdep_h = arc-tdep.h arc_jtag_h = arc-jtag.h +arc_xiss_h = arc-xiss.h +arc_inst_tracing_h = arc-inst-tracing.h +arc_memory_h = arc-memory.h +arc_arguments_h = arc-arguments.h +arc_elf32_tdep_h = arc-elf32-tdep.h +arc_linux_tdep_h = arc-linux-tdep.h arc_jtag_ops_h = arc-jtag-ops.h -arc_regnums_defs_h = arc-regnums-defs.h +arc_tm_linux_h = config/arc/tm-linux.h +arc_tm_embed_h = config/arc/tm-embed.h +arc_sim_registers_h = ../sim/arc/arc-sim-registers.h +arc_jtag_actionpoints_h = arc-jtag-actionpoints.h +arc_registers_h = arc-registers.h +arc_remote_fileio_h = arc-remote-fileio.h +arc_architecture_h = arc-architecture.h +arc_support_h = arc-support.h auxv_h = auxv.h ax_gdb_h = ax-gdb.h ax_h = ax.h $(doublest_h) @@ -849,6 +870,8 @@ nto_tdep_h = nto-tdep.h $(solist_h) $(osabi_h) $(regset_h) objc_lang_h = objc-lang.h objfiles_h = objfiles.h $(gdb_obstack_h) $(symfile_h) obsd_tdep_h = obsd-tdep.h +opcodes_arc_dis_h = $(OPCODES_DIR)/arc-dis.h +opcodes_arcompact_dis_h = $(OPCODES_DIR)/arcompact-dis.h osabi_h = osabi.h parser_defs_h = parser-defs.h $(doublest_h) p_lang_h = p-lang.h @@ -895,6 +918,7 @@ symfile_h = symfile.h $(symtab_h) symtab_h = symtab.h target_h = target.h $(bfd_h) $(symtab_h) $(dcache_h) $(memattr_h) $(vec_h) target_descriptions_h = target-descriptions.h +target_fileio_h = target-fileio.h terminal_h = terminal.h top_h = top.h tracepoint_h = tracepoint.h @@ -1535,8 +1559,11 @@ ALLDEPFILES = \ amd64obsd-nat.c amd64obsd-tdep.c \ amd64-linux-nat.c amd64-linux-tdep.c \ amd64-sol2-tdep.c \ - arc-tdep.c arc-linux-tdep.c arc-jtag.c \ - arc-jtag-ops.c arc-jtag.c \ + arc-jtag-actionpoints.c arc-remote-fileio.c \ + arc-tdep.c arc-linux-tdep.c arc-jtag.c arc-architecture.c \ + arc-jtag-ops.c arc-jtag.c arc-registers.c arc-board.c \ + arc-xiss.c arc-gpio.c arc-memory.c arc-arguments.c \ + arc-inst-tracing.c \ arm-linux-nat.c arm-linux-tdep.c arm-tdep.c \ armnbsd-nat.c armbsd-tdep.c armnbsd-tdep.c armobsd-tdep.c \ avr-tdep.c \ @@ -1901,20 +1928,78 @@ arch-utils.o: arch-utils.c $(defs_h) $(arch_utils_h) $(buildsym_h) \ $(gdbcmd_h) $(inferior_h) $(gdb_string_h) $(regcache_h) \ $(gdb_assert_h) $(sim_regno_h) $(gdbcore_h) $(osabi_h) $(version_h) \ $(floatformat_h) $(target_descriptions_h) -arc-jtag.o:arc-jtag.c $(arc_jtag_h) $(defs_h) $(gdbcore_h) \ - $(arc_regnums_defs_h) $(gdbcmd_h) -arc-jtag-ops.o: arc-jtag-ops.c $(arc_jtag_ops_h) $(arc_tdep_h) -arc-jtag-tdep.o:arc-jtag-tdep.c $(arc_tdep_h) $(arc_jtag_h) $(defs_h) \ - $(osabi_h) $(frame_h) $(regcache_h) $(gdb_assert_h) $(inferior_h) \ - $(arc_tdep_h) $(arc_jtag_h) -arc-linux-tdep.o: arc-linux-tdep.c $(defs_h) $(osabi_h) $(frame_h) \ - $(regcache_h) $(gdb_assert_h) $(inferior_h) $(reggroups_h) \ - $(solib_svr4_h) $(symtab_h) $(objfiles_h) $(block_h) $(arc_tdep_h) -arc-tdep.o: arc-tdep.c $(defs_h) $(arch_utils_h) $(frame_h) $(inferior_h) \ - $(gdbcmd_h) $(gdbcore_h) $(gdb_string_h) $(dis_asm_h) $(regcache_h) \ - $(doublest_h) $(value_h) $(frame_unwind_h) $(frame_base_h) \ - $(trad_frame_h) $(arc_tdep_h) $(elf_bfd_h) $(elf_arc_h) \ - $(opcode_arc_h) $(gdb_assert_h) $(bfd_in2_h) $(observer_h) +arc-architecture.o: arc-architecture.c \ + $(arc_architecture_h) $(arc_registers_h) $(arch_utils_h) \ + $(arc_elf32_tdep_h) $(arc_support_h) $(arc_tdep_h) $(bfd_in2_h) \ + $(defs_h) $(gdbarch_h) $(gdb_events_h) $(objfiles_h) $(breakpoint_h) \ + $(target_h) $(gdb_assert_h) + $(CC) -c $(INTERNAL_CFLAGS) -Wno-format-nonliteral $< +arc-registers.o: arc-registers.c \ + $(arc_architecture_h) $(arc_registers_h) $(arc_elf32_tdep_h) \ + $(arc_sim_registers_h) $(arc_support_h) $(arc_tdep_h) \ + $(arc_tm_embed_h) $(bfd_in2_h) $(defs_h) $(gdbarch_h) $(gdbcmd_h) \ + $(inferior_h) $(objfiles_h) $(regcache_h) \ + $(target_h) $(xml_support_h) $(breakpoint_h) $(gdb_assert_h) + $(CC) -c $(INTERNAL_CFLAGS) -Wno-format-nonliteral $< +arc-board.o: arc-board.c $(arc_architecture_h) $(arc_registers_h) \ + $(arc_board_h) $(arc_gpio_h) $(arc_jtag_h) $(arc_jtag_ops_h) \ + $(arc_support_h) $(arc_tdep_h) $(bfd_in2_h) \ + $(completer_h) $(defs_h) $(gdbarch_h) $(gdbcmd_h) $(objfiles_h) + $(CC) -c $(INTERNAL_CFLAGS) -Wno-format-nonliteral $< +arc-gpio.o: arc-gpio.c \ + $(arc_gpio_h) $(arc_support_h) $(defs_h) +arc-jtag.o: arc-jtag.c \ + $(arc_architecture_h) $(arc_registers_h) $(arc_board_h) \ + $(arc_gpio_h) $(arc_jtag_actionpoints_h) $(arc_jtag_h) \ + $(arc_jtag_ops_h) $(arc_elf32_tdep_h) $(arc_support_h) $(arc_tdep_h) \ + $(arc_tm_embed_h) $(bfd_in2_h) $(breakpoint_h) $(defs_h) $(gdbarch_h) \ + $(gdbcmd_h) $(inferior_h) $(libiberty_h) $(objfiles_h) $(target_h) \ + $(gdb_assert_h) +arc-arguments.o: arc-arguments.c $(arc_arguments_h) $(arc_support_h) \ + $(arc_tdep_h) $(defs_h) $(objfiles_h) \ + $(regcache_h) $(symtab_h) $(target_h) +arc-memory.o: arc-memory.c \ + $(arc_memory_h) $(arc_tdep_h) $(arc_support_h) $(defs_h) +arc-inst-tracing.o: arc-inst-tracing.c \ + $(arc_inst_tracing_h) $(arc_tdep_h) $(arc_support_h) +arc-xiss.o: arc-xiss.c \ + $(arc_architecture_h) $(arc_elf32_tdep_h) $(arc_registers_h) \ + $(arc_support_h) $(arc_tdep_h) $(arc_tm_embed_h) $(arc_xiss_h) \ + $(arc_inst_tracing_h) $(bfd_in2_h) $(breakpoint_h) $(defs_h) \ + $(disasm_h) $(gdbarch_h) $(gdbcmd_h) $(inferior_h) $(libiberty_h) \ + $(objfiles_h) $(completer_h) $(target_h) $(gdb_assert_h) +arc-jtag-ops.o: arc-jtag-ops.c $(arc_gpio_h) $(arc_jtag_h) $(arc_jtag_ops_h) \ + $(arc_support_h) $(defs_h) $(gdb_assert_h) +arc-elf32-tdep.o:arc-elf32-tdep.c $(arc_architecture_h) $(arc_registers_h) \ + $(arch_utils_h) $(arc_remote_fileio_h) $(arc_memory_h) \ + $(arc_elf32_tdep_h) $(arc_support_h) $(arc_tdep_h) $(arc_tm_embed_h) \ + $(arc_arguments_h) $(bfd_in2_h) $(defs_h) $(gdbarch_h) $(gdbcmd_h) \ + $(gdb_events_h) $(inferior_h) $(objfiles_h) \ + $(observer_h) $(exceptions_h) $(regcache_h) $(reggroups_h) \ + $(gdbcore_h) $(breakpoint_h) $(target_h) $(gdb_assert_h) + $(CC) -c $(INTERNAL_CFLAGS) -Wno-format-nonliteral $< +arc-linux-tdep.o: arc-linux-tdep.c $(arc_linux_tdep_h) $(arc_support_h) \ + $(arc_tdep_h) $(arc_tm_linux_h) $(block_h) $(defs_h) $(dis_asm_h) \ + $(gdbarch_h) $(inferior_h) $(opcode_arc_h) $(osabi_h) $(regcache_h) \ + $(reggroups_h) $(regset_h) $(solib_svr4_h) $(gdb_assert_h) +arc-tdep.o: arc-tdep.c $(arch_utils_h) $(arc_support_h) $(arc_tdep_h) \ + $(arc_tm_linux_h) $(arc_tm_embed_h) \ + $(block_h) $(defs_h) $(demangle_h) $(dictionary_h) $(dis_asm_h) \ + $(dwarf2_frame_h) $(frame_h) $(frame_unwind_h) $(gdbcmd_h) \ + $(gdbcore_h) $(inferior_h) $(language_h) \ + $(objfiles_h) $(observer_h) $(opcode_arc_h) $(opcodes_arc_dis_h) \ + $(opcodes_arcompact_dis_h) $(osabi_h) $(regcache_h) $(reggroups_h) \ + $(trad_frame_h) $(gdb_assert_h) +arc-jtag-actionpoints.o: arc-jtag-actionpoints.c $(arc_architecture_h) \ + $(arc_registers_h) $(arc_jtag_actionpoints_h) $(arc_jtag_h) \ + $(arc_jtag_ops_h) $(arc_support_h) $(arc_tdep_h) $(arc_elf32_tdep_h) \ + $(bfd_in2_h) $(defs_h) $(gdbarch_h) $(gdb_assert_h) $(inferior_h) \ + $(target_h) $(breakpoint_h) +arc-remote-fileio.o: arc-remote-fileio.c \ + $(arc_remote_fileio_h) $(arc_support_h) $(arc_tm_embed_h) \ + $(block_h) $(defs_h) $(frame_h) $(target_h) \ + $(gdb_fileio_h) $(symtab_h) $(target_fileio_h) $(exceptions_h) + $(CC) -c $(INTERNAL_CFLAGS) -Wno-format-nonliteral $< arm-linux-nat.o: arm-linux-nat.c $(defs_h) $(inferior_h) $(gdbcore_h) \ $(gdb_string_h) $(regcache_h) $(arm_tdep_h) $(gregset_h) \ $(target_h) $(linux_nat_h) $(gdb_proc_service_h) $(arm_linux_tdep_h) \ @@ -2645,8 +2730,8 @@ remote.o: remote.c $(defs_h) $(gdb_string_h) $(inferior_h) $(bfd_h) \ $(cli_decode_h) $(cli_setshow_h) $(memory_map_h) \ $(target_descriptions_h) $(gdb_fileio_h) remote-fileio.o: remote-fileio.c $(defs_h) $(gdb_string_h) $(gdbcmd_h) \ - $(remote_h) $(gdb_fileio_h) $(gdb_wait_h) $(gdb_stat_h) \ - $(exceptions_h) $(remote_fileio_h) + $(remote_h) $(gdb_fileio_h) \ + $(exceptions_h) $(remote_fileio_h) $(target_fileio_h) remote-m32r-sdi.o: remote-m32r-sdi.c $(defs_h) $(gdbcmd_h) $(gdbcore_h) \ $(inferior_h) $(target_h) $(regcache_h) $(gdb_string_h) $(serial_h) remote-mips.o: remote-mips.c $(defs_h) $(inferior_h) $(bfd_h) $(symfile_h) \ @@ -2898,6 +2983,9 @@ target-descriptions.o: target-descriptions.c $(defs_h) $(arch_utils_h) \ $(target_h) $(target_descriptions_h) $(vec_h) $(xml_tdesc_h) \ $(gdbcmd_h) $(gdb_assert_h) $(gdbtypes_h) $(reggroups_h) \ $(xml_support_h) $(gdb_obstack_h) $(hashtab_h) +target-fileio.o: target-fileio.c $(defs_h) $(exceptions_h) $(gdbcmd_h) \ + $(gdb_fileio_h) $(gdb_stat_h) $(gdb_string_h) $(gdb_wait_h) \ + $(target_fileio_h) target-memory.o: target-memory.c $(defs_h) $(vec_h) $(target_h) \ $(memory_map_h) $(gdb_assert_h) thread.o: thread.c $(defs_h) $(symtab_h) $(frame_h) $(inferior_h) \ diff --git a/gdb/arc-architecture.c b/gdb/arc-architecture.c new file mode 100755 index 0000000..f520d61 --- /dev/null +++ b/gdb/arc-architecture.c @@ -0,0 +1,502 @@ +/* Target dependent code for ARC processor family, for GDB, the GNU debugger. + + Copyright 2008, 2009 Free Software Foundation, Inc. + + Contributed by ARC International (www.arc.com) + + Author: + Richard Stuckey + + This file is part of GDB. + + 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 3 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, see . */ + +/******************************************************************************/ +/* */ +/* Outline: */ +/* This module provides support for handling the architectural version of */ +/* of the ARC target processor. */ +/* */ +/* Architectural Checks: */ +/* Checks upon architectural consistency are (currently) performed at */ +/* these points: */ +/* */ +/* 1) after connection to target */ +/* 2) after reading (non-default) XML file */ +/* 3) after blasting JTAG target FPGA */ +/* 4) after attaching to JTAG target */ +/* 5) after selecting executable file */ +/* 6) before downloading program to target */ +/* */ +/******************************************************************************/ + +/* gdb header files. */ +#include "defs.h" +#include "objfiles.h" +#include "arch-utils.h" +#include "gdb-events.h" +#include "gdb_assert.h" + +/* ARC header files. */ +#include "arc-architecture.h" +#include "arc-elf32-tdep.h" + + +/* -------------------------------------------------------------------------- */ +/* local types */ +/* -------------------------------------------------------------------------- */ + +typedef enum +{ + DEFAULT_SIMULATOR_WITH_NO_AUXILIARY_REGISTERS, + DEFAULT_SIMULATOR_WITH_AUXILIARY_REGISTERS, + SELECTED_SIMULATOR_WITH_NO_AUXILIARY_REGISTERS, + SELECTED_SIMULATOR_WITH_AUXILIARY_REGISTERS, + TARGET_WITH_NO_AUXILIARY_REGISTERS, + TARGET_WITH_AUXILIARY_REGISTERS, + EXECUTABLE_WITH_NO_AUXILIARY_REGISTERS, + EXECUTABLE_WITH_AUXILIARY_REGISTERS, + DEFAULT_SIMULATOR_AND_EXECUTABLE_WITH_NO_AUXILIARY_REGISTERS, + DEFAULT_SIMULATOR_AND_EXECUTABLE_WITH_AUXILIARY_REGISTERS, + SELECTED_SIMULATOR_AND_EXECUTABLE_WITH_NO_AUXILIARY_REGISTERS, + SELECTED_SIMULATOR_AND_EXECUTABLE_WITH_AUXILIARY_REGISTERS, + TARGET_AND_EXECUTABLE_WITH_NO_AUXILIARY_REGISTERS, + TARGET_AND_EXECUTABLE_WITH_AUXILIARY_REGISTERS, + NO_ERROR +} Diagnostic; + + +/* -------------------------------------------------------------------------- */ +/* local data */ +/* -------------------------------------------------------------------------- */ + +/* N.B. the messages MUST correspond to the values in the Diagnostic enumeration + type above, as a value of that type is used to index the array. */ + +static const char *messages[] = +{ + "default simulator architecture is %s but auxiliary registers are not defined", + "default simulator architecture is %s but auxiliary registers are defined for %s", + "selected simulator architecture is %s but auxiliary registers are not defined", + "selected simulator architecture is %s but auxiliary registers are defined for %s", + "target architecture is %s but auxiliary registers are not defined", + "target architecture is %s but auxiliary registers are defined for %s", + "executable file %s is built for %s but auxiliary registers are not defined", + "executable file %s is built for %s but auxiliary registers are defined for %s", + "default simulator architecture is %s, executable file %s is built for %s but auxiliary registers are not defined", + "default simulator architecture is %s, executable file %s is built for %s and auxiliary registers are defined for %s", + "selected simulator is %s, executable file %s is built for %s but auxiliary registers are not defined", + "selected simulator is %s, executable file %s is built for %s and auxiliary registers are defined for %s", + "target architecture is %s, executable file %s is built for %s but auxiliary registers are not defined", + "target architecture is %s, executable file %s is built for %s and auxiliary registers are defined for %s" +}; + + +/* This is the architecture of the current target. */ +static ARC_ProcessorVersion ARC_processor = NO_ARCHITECTURE; + + +/* -------------------------------------------------------------------------- */ +/* local functions */ +/* -------------------------------------------------------------------------- */ + +/* Map the BFD architerctural type onto the ARC processor type. */ + +static ARC_ProcessorVersion +architecture (const bfd_arch_info_type *arch) +{ + switch (arch->mach) + { + case bfd_mach_arc_a5 : return A5; + case bfd_mach_arc_arc600: return ARC600; + case bfd_mach_arc_arc700: return ARC700; + default : return UNSUPPORTED_ARCHITECTURE; + } +} + + +/* This function performs the architectural consistency check. + + Parameters: + target : the architectural version of the target + auxregs : the architectural version of the auxiliary registers + program : the architectural version of the executable program + is_builtin_simulator: TRUE if the target is the built-in simulator + is_default : TRUE if built-in simulator's version is the default + objfile_bfd : a pointer to the BFD for the object file + + If the check fails, an appropriate warning message is output. */ + +static void +perform_check (ARC_ProcessorVersion target, + ARC_ProcessorVersion auxregs, + ARC_ProcessorVersion program, + Boolean is_builtin_simulator, + bfd_boolean is_default, + bfd *objfile_bfd) +{ + Diagnostic diagnostic = NO_ERROR; + + /* If we do not yet have an object file (and hence we do not know the + program's architecture). */ + if (program == NO_ARCHITECTURE) + { + if (target != auxregs) + { + if (is_builtin_simulator) + { + if (is_default) + { + if (auxregs == NO_ARCHITECTURE) + diagnostic = DEFAULT_SIMULATOR_WITH_NO_AUXILIARY_REGISTERS; + else + diagnostic = DEFAULT_SIMULATOR_WITH_AUXILIARY_REGISTERS; + } + else + { + if (auxregs == NO_ARCHITECTURE) + diagnostic = SELECTED_SIMULATOR_WITH_NO_AUXILIARY_REGISTERS; + else + diagnostic = SELECTED_SIMULATOR_WITH_AUXILIARY_REGISTERS; + } + } + else + if (auxregs == NO_ARCHITECTURE) + diagnostic = TARGET_WITH_NO_AUXILIARY_REGISTERS; + else + diagnostic = TARGET_WITH_AUXILIARY_REGISTERS; + } + } + else + { + if (program != target || program != auxregs) + { + if (is_builtin_simulator) + { + if (target == program) + { + if (auxregs == NO_ARCHITECTURE) + diagnostic = EXECUTABLE_WITH_NO_AUXILIARY_REGISTERS; + else + diagnostic = EXECUTABLE_WITH_AUXILIARY_REGISTERS; + } + else + { + if (is_default) + { + if (auxregs == NO_ARCHITECTURE) + diagnostic = DEFAULT_SIMULATOR_AND_EXECUTABLE_WITH_NO_AUXILIARY_REGISTERS; + else + diagnostic = DEFAULT_SIMULATOR_AND_EXECUTABLE_WITH_AUXILIARY_REGISTERS; + } + else + { + if (auxregs == NO_ARCHITECTURE) + diagnostic = SELECTED_SIMULATOR_AND_EXECUTABLE_WITH_NO_AUXILIARY_REGISTERS; + else + diagnostic = SELECTED_SIMULATOR_AND_EXECUTABLE_WITH_AUXILIARY_REGISTERS; + } + } + } + else + if (auxregs == NO_ARCHITECTURE) + diagnostic = TARGET_AND_EXECUTABLE_WITH_NO_AUXILIARY_REGISTERS; + else + diagnostic = TARGET_AND_EXECUTABLE_WITH_AUXILIARY_REGISTERS; + } + } + + if (diagnostic != NO_ERROR) + { + const char *message = messages[diagnostic]; + + switch (diagnostic) + { + case DEFAULT_SIMULATOR_WITH_NO_AUXILIARY_REGISTERS: + case SELECTED_SIMULATOR_WITH_NO_AUXILIARY_REGISTERS: + case TARGET_WITH_NO_AUXILIARY_REGISTERS: + warning(message, arc_version_image(target)); + break; + + case DEFAULT_SIMULATOR_WITH_AUXILIARY_REGISTERS: + case SELECTED_SIMULATOR_WITH_AUXILIARY_REGISTERS: + case TARGET_WITH_AUXILIARY_REGISTERS: + warning(message, arc_version_image(target), arc_version_image(auxregs)); + break; + + case EXECUTABLE_WITH_NO_AUXILIARY_REGISTERS: + warning(message, objfile_bfd->filename, arc_version_image(program)); + break; + + case EXECUTABLE_WITH_AUXILIARY_REGISTERS: + warning(message, objfile_bfd->filename, arc_version_image(program), arc_version_image(auxregs)); + break; + + case DEFAULT_SIMULATOR_AND_EXECUTABLE_WITH_NO_AUXILIARY_REGISTERS: + case SELECTED_SIMULATOR_AND_EXECUTABLE_WITH_NO_AUXILIARY_REGISTERS: + case TARGET_AND_EXECUTABLE_WITH_NO_AUXILIARY_REGISTERS: + warning(message, arc_version_image(target), objfile_bfd->filename, arc_version_image(program)); + break; + + case DEFAULT_SIMULATOR_AND_EXECUTABLE_WITH_AUXILIARY_REGISTERS: + case SELECTED_SIMULATOR_AND_EXECUTABLE_WITH_AUXILIARY_REGISTERS: + case TARGET_AND_EXECUTABLE_WITH_AUXILIARY_REGISTERS: + warning(message, arc_version_image(target), objfile_bfd->filename, arc_version_image(program), arc_version_image(auxregs)); + break; + + default: + break; + } + } +} + + +/* -------------------------------------------------------------------------- */ +/* externally visible functions */ +/* -------------------------------------------------------------------------- */ + +/* Set the architectural version of the target processor as being unknown. */ + +void +arc_architecture_is_unknown (void) +{ + ARC_processor = NO_ARCHITECTURE; +} + + +/* Return the processor variant that is connected. */ + +ARC_ProcessorVersion +arc_get_architecture (ReadRegisterFunction read_aux_register) +{ + ENTERMSG; + + if (ARC_processor == NO_ARCHITECTURE) + { + ARC_RegisterNumber identity_regnum = arc_aux_find_register_number("IDENTITY", ARC_HW_IDENTITY_REGNUM); + ARC_RegisterContents value; + + if (read_aux_register(identity_regnum, &value, TRUE)) + { + DEBUG("IDENTITY = 0x%X\n", value); + + /* Get the processor version number. */ + value &= IDENTITY_ARCVER; + + if ((value >= 0x30) && (value <= 0x3f)) + ARC_processor = ARC700; + else if ((value >= 0x20) && (value <= 0x2f)) + ARC_processor = ARC600; + else if ((value >= 0x10) && (value <= 0x1f)) + ARC_processor = A5; + else if (value <= 0x0f) + ARC_processor = A4; + else + warning(_("unsupported processor version 0x%x"), value); + + DEBUG("target (from IDENTITY) is %s\n", arc_version_image(ARC_processor)); + } + } + + return ARC_processor; +} + + +/* Get the target processor architecture, check that is it supported, and + * update any architecture-related information that gdb requires. */ + +void +arc_update_architecture (ReadRegisterFunction read_register) +{ + struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch); + ARC_ProcessorVersion version = arc_get_architecture(read_register); + + /* Record the target processor architecture in the targt-dependent + * variant information. */ + tdep->processor_variant_info->processor_version = version; + + switch (version) + { + case NO_ARCHITECTURE: + break; + case ARC700: + set_gdbarch_decr_pc_after_break (current_gdbarch, 0); + break; + case ARC600: + set_gdbarch_decr_pc_after_break (current_gdbarch, 2); + break; + case A5: + warning(_("A5 debugging is unsupported and may be unreliable.")); + break; + case A4: + /* N.B. this will not return. */ + error(_("A4 debugging is unsupported.")); + break; + case UNSUPPORTED_ARCHITECTURE: + break; + } +} + + +/* This function checks for architectural consistency; there are three possible + architectures to be considered: + + 1) the architecture for which the program to be debugged has been built + 2) the architecture of the target upon which the program is to be debugged + 3) the architecture for which we have a description of the auxiliary registers + + The 'gdbarch' parameter to this function corresponds to 2). + + A hardware target (such as an ARCangel) has a fixed architecture (e.g. that + defined by the XBF file used to configure it; and the xISS simulator's + architecture is defined by the simulator definition (.xis) file; however, + if the target is the built-in simulator, the architecture depends upon how + the simulator instance is created: if the instance is created by use of the + commands + + file + target sim + + then the simulator architecture is taken from the program file; if it is + created by the commands + + set endian big | little + set architecture + target sim + + then the architecture is the named one; if it is created by the commands + + set endian big | little + target sim + + the architecture is the default ARC architecture as defined in bfd/cpu-arc.c, + and this is indicated by the 'the_default' flag in the 'bfd_arch_info' struct + being TRUE. */ + +void +arc_check_architecture (struct gdbarch *gdbarch, bfd *objfile_bfd, + const char* file, const char* function) +{ + ARC_ProcessorVersion target = gdbarch_tdep (gdbarch)->processor_variant_info->processor_version; + ARC_ProcessorVersion auxregs = arc_aux_architecture(gdbarch); + ARC_ProcessorVersion program = NO_ARCHITECTURE; + bfd_boolean is_default = FALSE; + Boolean is_builtin_simulator = FALSE; + + ENTERARGS("current target = %s (%sconnected), objfile = %s", + current_target.to_shortname, + (arc_target_is_connected) ? "" : "not ", + (objfile_bfd) ? bfd_get_filename(objfile_bfd) : ""); + + DEBUG("architectural check in function '%s' in file '%s'\n", function, file); + + /* If the target is the built-in simulator. */ + if (strcmp(current_target.to_shortname, "sim") == 0) + { + const char *name = selected_architecture_name(); + const bfd_arch_info_type *arch; + + if (name) + arch = bfd_scan_arch(name); + else + arch = gdbarch_bfd_arch_info(gdbarch); + + is_default = arch->the_default; + is_builtin_simulator = TRUE; + } + + if (objfile_bfd) + program = architecture(objfile_bfd->arch_info); + else + program = NO_ARCHITECTURE; + + DEBUG("target = %s\n", arc_version_image(target)); + DEBUG("auxregs = %s\n", arc_version_image(auxregs)); + DEBUG("program = %s\n", arc_version_image(program)); + + /* If we are connected to a target, we should know its architecture; if we + are not connected, if we don't know both the program and aux registers + architectures then there is no point in checking anything (this situation + could occur if a 'file ' or 'arc-reg-read-file ' + command has been issued before the connection is made). */ + if (arc_target_is_connected) + gdb_assert(target != NO_ARCHITECTURE); + else + if (program == NO_ARCHITECTURE || auxregs == NO_ARCHITECTURE) + return; + + /* Check that the architectures are the same. */ + perform_check(target, + auxregs, + program, + is_builtin_simulator, + is_default, + objfile_bfd); + + /* Unfortunately, this event can not be sent at the point that it is known + that the register architecture has changed, as at that point the global + variable current_gdbarch may have the value NULL, and that could cause + an error elsewhere where gdbarch_num_regs or gdbarch_num_pseudo_regs is + used (e.g. in setup_architecture_data in gdbtk/generic/gdbtk-register.c). */ + if (arc_pending_register_architecture_change_event) + { + DEBUG("sending register architecture changed event\n"); + arc_pending_register_architecture_change_event = FALSE; + reg_architecture_changed_event(); + } +} + + +/* Get the ARC architectural version from a string. */ + +ARC_ProcessorVersion +arc_version (const char *arch) +{ + ARC_ProcessorVersion version; + +#define ARCH_IS(ident) (strcmp(arch, ident) == 0) + + if (ARCH_IS("ARC700")) + version = ARC700; + else if (ARCH_IS("ARC600")) + version = ARC600; + else if (ARCH_IS("A5")) + version = A5; + else if (ARCH_IS("A4")) + version = A4; + else + version = UNSUPPORTED_ARCHITECTURE; + + return version; +} + + +/* Return a string representation of the ARC architectural version. */ + +const char* +arc_version_image (ARC_ProcessorVersion version) +{ + switch (version) + { + case NO_ARCHITECTURE : return _("NONE"); + case ARC700 : return _("ARC700"); + case ARC600 : return _("ARC600"); + case A5 : return _("A5"); + case A4 : return _("A4"); + case UNSUPPORTED_ARCHITECTURE: return _("UNSUPPORTED"); + default : return _("???"); + } +} + +/******************************************************************************/ diff --git a/gdb/arc-architecture.h b/gdb/arc-architecture.h new file mode 100644 index 0000000..f7a2751 --- /dev/null +++ b/gdb/arc-architecture.h @@ -0,0 +1,74 @@ +/* Target dependent code for ARC processor family, for GDB, the GNU debugger. + + Copyright 2008, 2009 Free Software Foundation, Inc. + + Contributed by ARC International (www.arc.com) + + Authors: + Richard Stuckey + + This file is part of GDB. + + 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 3 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, see . */ + +/******************************************************************************/ +/* */ +/* Outline: */ +/* This header file defines an enumeration type for representing the */ +/* architectural version of an ARC processor, and associated functions. */ +/* */ +/******************************************************************************/ + +#ifndef ARC_ARCHITECTURE_H +#define ARC_ARCHITECTURE_H + +/* gdb header files */ +#include "defs.h" +#include "gdbarch.h" +#include "bfd/bfd-in2.h" + +/* ARC header files */ +#include "arc-support.h" + + +typedef enum arc_processor_version +{ + NO_ARCHITECTURE, + ARC700, + ARC600, + A5, + A4, + UNSUPPORTED_ARCHITECTURE +} ARC_ProcessorVersion; + + +#define ARCHITECTURE_CHECK(arch, bfd) arc_check_architecture (arch, bfd, __FILE__, __FUNCTION__) + + +void arc_architecture_is_unknown (void); + +ARC_ProcessorVersion arc_get_architecture (ReadRegisterFunction read_aux_register); + +void arc_update_architecture (ReadRegisterFunction read_register); + +void arc_check_architecture (struct gdbarch *gdbarch, bfd *objfile_bfd, + const char* file, const char* function); + +ARC_ProcessorVersion arc_version (const char *arch); + +const char* arc_version_image (ARC_ProcessorVersion version); + + +#endif /* ARC_ARCHITECTURE_H */ +/******************************************************************************/ diff --git a/gdb/arc-arguments.c b/gdb/arc-arguments.c new file mode 100644 index 0000000..bd3404a --- /dev/null +++ b/gdb/arc-arguments.c @@ -0,0 +1,427 @@ +/* Target dependent code for ARC processor family, for GDB, the GNU debugger. + + Copyright 2008, 2009 Free Software Foundation, Inc. + + Contributed by ARC International (www.arc.com) + + Authors: + Richard Stuckey + + This file is part of GDB. + + 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 3 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, see . */ + +/******************************************************************************/ +/* */ +/* Outline: */ +/* This module implements operations for setting up the command line */ +/* arguments to the program which is being debugged. */ +/* */ +/* E.g. if we are passing 4 arguments to the program's 'main' function, */ +/* we must place them on the stack in the layout: */ +/* */ +/* . */ +/* . */ +/* stack[top + A3] <== */ +/* . */ +/* . */ +/* stack[top + A2] <== */ +/* . */ +/* . */ +/* stack[top + A1] <== */ +/* . */ +/* . */ +/* stack[top + A0] <== */ +/* stack[top + 24] <== 0x0 # ? NULL terminator */ +/* stack[top + 20] <== 0x0 # envp NULL terminator */ +/* stack[top + 16] <== 0x0 # argv NULL terminator */ +/* stack[top + 12] <== TOP + A3 # argv[3] */ +/* stack[top + 8] <== TOP + A2 # argv[2] */ +/* stack[top + 4] <== TOP + A1 # argv[1] */ +/* stack[top + 0] <== TOP + A0 # argv[0] */ +/* */ +/* where TOP = &stack[top] */ +/* and A0 .. A3 are the offsets of the stored arguments from the stack */ +/* top. */ +/* */ +/******************************************************************************/ + +/* system header files */ +#include + +/* gdb header files */ +#include "defs.h" +#include "target.h" +#include "symtab.h" +#include "regcache.h" +#include "objfiles.h" + +/* ARC header files */ +#include "arc-arguments.h" +#include "arc-support.h" +#include "arc-tdep.h" + + +/* -------------------------------------------------------------------------- */ +/* local data */ +/* -------------------------------------------------------------------------- */ + +#define MINIMUM_INSTRUCTION_SIZE 2 +#define MOV_SP_INSTRUCTION_LE 0x3F80240A +#define MOV_SP_INSTRUCTION_BE 0x803F0A24 + + +/* The address of the top of the target program's stack before the program + arguments were pushed onto the stack. */ +static CORE_ADDR old_stack_top; + +/* The address in the target program code of the instructions which set up the + stack pointer (SP) at program start-up. */ +static CORE_ADDR stack_pointer_setup_code_operand_address; + + +/* -------------------------------------------------------------------------- */ +/* local macros */ +/* -------------------------------------------------------------------------- */ + +#define TARGET_IS_BIG_ENDIAN (gdbarch_byte_order (current_gdbarch) == BFD_ENDIAN_BIG) + +#define TARGET_ENDIAN(word) ((TARGET_IS_BIG_ENDIAN) ? __bswap_32(word) : (word)) + +#define MK_OPERAND_LE(x) (ARC_Word) ((((x) & 0xffff0000) >> 16) | \ + (((x) & 0x0000ffff) << 16)) + +#define MK_OPERAND_BE(x) (ARC_Word) (__bswap_32(x)) + + +/* -------------------------------------------------------------------------- */ +/* local functions */ +/* -------------------------------------------------------------------------- */ + +/* Find the address in the target program code of the given label. + Return 0 if the label is not found. */ + +static CORE_ADDR +find_label (const char *label) +{ + struct minimal_symbol *msymbol = lookup_minimal_symbol(label, NULL, symfile_objfile); + CORE_ADDR address = 0; + + if (msymbol != NULL) + address = SYMBOL_VALUE_ADDRESS (msymbol); + + DEBUG("%s = %x\n", label, (unsigned int) address); + + return address; +} + + +/* Write a word of data to target memory. + + Parameters: + address : the address in memory to write the data + word : the data to be written + + Returns TRUE if the data is written. FALSE otherwise. + + If the data is written, the given address is incremented to reference the + next word in target memory. */ + +static Boolean +write_word (CORE_ADDR *address, ARC_Word word) +{ + word = TARGET_ENDIAN(word); + + if (target_write_memory(*address, (gdb_byte*) &word, BYTES_IN_WORD) == 0) + { + *address += BYTES_IN_WORD; + return TRUE; + } + + return FALSE; +} + + +/* Try to find the address in the target program code of the instructions which + set up the program stack pointer (SP). + + Parameter: + stack_top: the address which is loaded into SP by the setup code + + Return TRUE if the code is found. + + If the setup code is found, the variable stack_pointer_setup_code_operand_address + is set to the code's address. */ + +static Boolean +find_stack_top_setup_code (CORE_ADDR stack_top) +{ + /* Try to find the start address in the target program. */ + CORE_ADDR code_start = find_label("__start"); + + if (code_start != 0) + { + CORE_ADDR code = (ARC_Address) code_start; + ARC_Word set_sp_insn[2]; + ARC_Byte buffer[16 * BYTES_IN_WORD]; + + DEBUG("setting up arguments: stack_top = %x, code_start = %x\n", + (unsigned int) stack_top, (unsigned int) code_start); + + if (TARGET_IS_BIG_ENDIAN) + { + set_sp_insn[0] = MOV_SP_INSTRUCTION_BE; + set_sp_insn[1] = MK_OPERAND_BE(stack_top); + } + else + { + set_sp_insn[0] = MOV_SP_INSTRUCTION_LE; + set_sp_insn[1] = MK_OPERAND_LE(stack_top); + } + + /* Scan through the start code of the program, looking for the code that + sets up the program's stack pointer; we recognize this as a 32-bit + 'mov sp' instruction followed by a 32-bit operand which is the + address of the stack top (which we obtained from the executable file). */ + while (TRUE) + { + int result = target_read_memory(code, (gdb_byte*) buffer, (int) sizeof(buffer)); + + if (result == 0) + { + size_t offset = 0; + + while (offset <= sizeof(buffer) - sizeof(set_sp_insn)) + { + if (memcmp(buffer + offset, set_sp_insn, sizeof(set_sp_insn)) == 0) + { + stack_pointer_setup_code_operand_address = code + (CORE_ADDR) offset + BYTES_IN_WORD; + + DEBUG("found 'mov sp, ' instruction operand at address 0x%x\n", + (unsigned int) stack_pointer_setup_code_operand_address); + return TRUE; + } + + offset += MINIMUM_INSTRUCTION_SIZE; + } + } + else + { + warning(_("can not find read target program start code")); + break; + } + + code += (CORE_ADDR) (sizeof(buffer) - sizeof(set_sp_insn)); + + /* If we haven't found it in the first 100 bytes. */ + if (code - code_start > 100) + { + warning(_("can not find 'mov sp, ' instruction in start code")); + break; + } + } + } + + return FALSE; +} + + +/* Try to change the setup code in the program so that SP is loaded with a + given address. + + Parameters: + old_stack_top: the address which is currently loaded into SP by the code + new_stack_top: the address which we wish to be loaded into SP by the code + + Return TRUE if the setup code is changed. */ + +static Boolean +set_stack_top (CORE_ADDR old_stack_top, CORE_ADDR new_stack_top) +{ + ARC_Word operand = (TARGET_IS_BIG_ENDIAN) ? MK_OPERAND_BE(new_stack_top) + : MK_OPERAND_LE(new_stack_top); + + /* If we do not yet know the address in the program code at which the + program's stack pointer is set up. */ + if (stack_pointer_setup_code_operand_address == 0) + { + /* Try to find it. */ + if (!find_stack_top_setup_code(old_stack_top)) + return FALSE; + } + + DEBUG("set stack top @ 0x%08X to 0x%08X (0x%08X)\n", + (unsigned int) stack_pointer_setup_code_operand_address, + (unsigned int) new_stack_top, + operand); + + return (target_write_memory(stack_pointer_setup_code_operand_address, + (gdb_byte*) &operand, + BYTES_IN_WORD) == 0); +} + + +/* -------------------------------------------------------------------------- */ +/* externally visible functions */ +/* -------------------------------------------------------------------------- */ + +/* This is called when a program is downloaded to the debug target. */ + +void +arc_program_loaded (void) +{ + /* The program has just been loaded, so we do not yet know the address in + the program code at which the program's stack pointer is set up. */ + stack_pointer_setup_code_operand_address = 0; +} + + +/* Store the program's arguments on the stack. + Return TRUE if they are stored successfully. */ + +Boolean +arc_setup_arguments (char *args) +{ + Boolean done = FALSE; + + /* Try to find the top of stack in the target program. */ + old_stack_top = find_label("__stack_top"); + + if (old_stack_top != 0) + { + char **argv = buildargv (args); + char **argp; + size_t string_length = 0; + unsigned int argc = 0; + unsigned int num_pointers; + unsigned int total_size; + CORE_ADDR new_stack_top; + + if (argv == NULL) + nomem (0); + + /* Calculate the space required to hold the args. */ + + for (argp = argv; *argp != NULL; argp++) + { + string_length += strlen (*argp) + 1; + argc++; + } + + DEBUG("%d arguments\n", argc); + + num_pointers = argc + 3; + + total_size = (unsigned int) string_length + num_pointers * BYTES_IN_WORD; + + /* Round up to a multiple of 32: strlen expects memory to come in chunks + * that are at least cache-line (32 bytes) sized. */ + total_size += 31; + total_size &= -32; + + DEBUG("total size: %d\n", total_size); + + new_stack_top = old_stack_top - total_size; + + DEBUG("new stack top: 0x%08x\n", (unsigned int) new_stack_top); + + /* Adjust the setting of the top of the stack in the object code. */ + if (set_stack_top(old_stack_top, new_stack_top)) + { + struct regcache *regcache = get_current_regcache(); + CORE_ADDR data_space = new_stack_top + num_pointers * BYTES_IN_WORD; + CORE_ADDR stack_top = new_stack_top; + unsigned int i; + + DEBUG("data space: 0x%08x\n", (unsigned int) data_space); + + done = TRUE; + + /* Write the args onto the top of the stack. */ + + for (i = 0; i < argc; i++) + { + char *parameter = argv[i]; + size_t length = strlen(parameter) + 1; + int result = target_write_memory(data_space, (gdb_byte*) parameter, (int) length); + + if (result == 0) + { + DEBUG("written argv[%d] to 0x%08x: \"%s\"\n", + i, (unsigned int) data_space, parameter); + } + else + done = FALSE; + + /* Write a pointer to the argument onto the stack. */ + if (!write_word(&stack_top, (ARC_Word) data_space)) + done = FALSE; + + data_space += length; + } + + /* Try to write the NULLs. */ + if (!write_word(&stack_top, 0) || + !write_word(&stack_top, 0) || + !write_word(&stack_top, 0)) + done = FALSE; + + /* Set up the R0 and R1 parameter registers. */ + + /* Convert to target byte order if necessary. */ + if (HOST_AND_TARGET_ENDIANNESS_DIFFER(current_gdbarch)) + { + argc = __bswap_32(argc); + new_stack_top = __bswap_32(new_stack_top); + } + + regcache_raw_supply (regcache, 0, &argc); + regcache_raw_supply (regcache, 1, &new_stack_top); + target_store_registers(regcache, 0); + target_store_registers(regcache, 1); + } + + freeargv(argv); + } + + return done; +} + + +/* This function is called just before disconnection from the debug target. */ + +void +arc_restore_stack_top_address (void) +{ + /* If we know the address in the program start-up code at which the stack + pointer is set up, it must be because we changed the stack top address + in the code - so change it back to the original address as read from the + excutable file. + + This is done so that if the user disconnects from the target, then + reconnects to it in a subsequent debugging session but does NOT download + the program to the target again (as it is still in target memory), the + mechanism for altering the stack top will still work. + + Note that this has no effect if the target is allowed to resume execution + (i.e. a 'detach' is being performed) as we are changing code that has + already been executed. + + 0 is passed as the "old" stack top as it is not used in this situation. */ + + if (stack_pointer_setup_code_operand_address != 0) + (void) set_stack_top(0, old_stack_top); +} + +/******************************************************************************/ diff --git a/gdb/arc-arguments.h b/gdb/arc-arguments.h new file mode 100644 index 0000000..d0d79ed --- /dev/null +++ b/gdb/arc-arguments.h @@ -0,0 +1,48 @@ +/* Target dependent code for ARC processor family, for GDB, the GNU debugger. + + Copyright 2008, 2009 Free Software Foundation, Inc. + + Contributed by ARC International (www.arc.com) + + Authors: + Richard Stuckey + + This file is part of GDB. + + 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 3 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, see . */ + +/******************************************************************************/ +/* */ +/* Outline: */ +/* This header file defines operations for setting up the command line */ +/* arguments to the program which is being debugged. */ +/* */ +/******************************************************************************/ + +#ifndef ARC_ARGUMENTS +#define ARC_ARGUMENTS + +/* ARC header files */ +#include "arc-support.h" + + +void arc_program_loaded (void); + +Boolean arc_setup_arguments (char *args); + +void arc_restore_stack_top_address (void); + + +#endif /* ARC_ARGUMENTS */ +/******************************************************************************/ diff --git a/gdb/arc-board.c b/gdb/arc-board.c new file mode 100644 index 0000000..6642220 --- /dev/null +++ b/gdb/arc-board.c @@ -0,0 +1,1996 @@ +/* Target dependent code for ARC processor family, for GDB, the GNU debugger. + + Copyright 2008, 2009 Free Software Foundation, Inc. + + Contributed by ARC International (www.arc.com) + + Authors: + Tim Gore + Tom Pennello + Justin Wilde + Phil Barnard + Richard Stuckey + + This file is part of GDB. + + 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 3 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, see . */ + +/******************************************************************************/ +/* */ +/* Outline: */ +/* This module implements operations for controlling an ARC target board. */ +/* */ +/* These operations are: */ +/* 1) configuring ("blasting") an FPGA target with the contents of an */ +/* XBF file; */ +/* 2) checking whether a target has been so configured; */ +/* 3) setting the clock frequency of the target; */ +/* 4) setting the clock sources of the target. */ +/* */ +/* Notes: */ +/* The blast_board function implements an ARC-specific command; hence its */ +/* 'args' parameter contains data entered by the debugger user, which */ +/* must be checked for validity. */ +/* */ +/* Target Board: */ +/* It is assumed that the target board is actually an ARCangel 4 (AA4). */ +/* */ +/* See */ +/* ARCangel 4 Development System */ +/* User's Guide */ +/* 5801-001 */ +/* */ +/* for a full description of the target. */ +/* */ +/* The AA4 contains a Configurable Programmable Logic Device (CPLD) which */ +/* is used to control the system services on the board; this includes the */ +/* configuration of the board's PLL (Phase Lock Loop) clock chip, and */ +/* clock routing. */ +/* */ +/* The AA4 also has a 48 MHz crystal oscillator module, and has a number */ +/* of DIP switches which may be set manually: these may be used to select */ +/* a divisor (1, 2, 4 or 8) which may be applied to the crystal frequency */ +/* to obtain a lower frequency. */ +/* */ +/* The target FPGA has 4 global clock pins (GCLK0-3); a different clock */ +/* source may be routed to each of these by the CPLD. The available */ +/* sources are: */ +/* */ +/* crystal : the physical crystal */ +/* dips : the physical crystal divided by the DIP switch divisors */ +/* highimp : high impedance */ +/* host : use the STR (strobe) input of the host interface */ +/* mclk : use a clock provided by the PLL */ +/* vclk : use a clock provided by the PLL */ +/* */ +/* Note that "high impedance" (also referred to as "Tri-state") means, in */ +/* effect, that the clock is switched off. */ +/* */ +/* It is also possible to specify that the PLL clock should be a Harvard */ +/* clock generator. */ +/* */ +/* The main clock for the target's ARC processor is provided by GLCK3. */ +/* */ +/* The PLL is assumed to be a Cypress Semiconductor Corporation ICD2061A */ +/* Dual Programmable Graphics Clock Generator; the Data Sheet describing */ +/* this device may be readily found on the Web, and should be consulted */ +/* for an understanding of how the clock is programmed. */ +/* */ +/* The ICD2061A actually provides two independent clocks: MCLK (Memory or */ +/* I/O Timing Clock) and VCLK (Video Clock). It is recommended that the */ +/* frequency of one clock should not be an integer multiple of that of */ +/* other, in order to avoid clock signal degradation through jitter. */ +/* */ +/******************************************************************************/ + +/* system header files */ +#include +#include +#include +#include + +/* gdb header files */ +#include "defs.h" +#include "completer.h" +#include "objfiles.h" +#include "gdbcmd.h" + +/* ARC header files */ +#include "arc-board.h" +#include "arc-architecture.h" +#include "arc-registers.h" +#include "arc-gpio.h" +#include "arc-jtag.h" +#include "arc-jtag-ops.h" + + +/* -------------------------------------------------------------------------- */ +/* local types */ +/* -------------------------------------------------------------------------- */ + +typedef enum +{ + CLOCK_SOURCE_HIGH_IMPEDANCE, + CLOCK_SOURCE_PLL_MCLK, + CLOCK_SOURCE_PLL_VCLK, + CLOCK_SOURCE_CRYSTAL, + CLOCK_SOURCE_PLL_MCLK_HARVARD, + CLOCK_SOURCE_PLL_VCLK_HARVARD, + CLOCK_SOURCE_HOST_STROBE, + CLOCK_SOURCE_CRYSTAL_DIVIDED +} ClockSource; + +typedef enum +{ + PLL_MCLK = 0, + PLL_VCLK = 1, + NO_PLL_CLK = 2 +} PLL_ClockId; + +typedef unsigned int GlobalClockId; // 0 .. 3 + +typedef double MegaHertz; + +typedef struct global_clock +{ + ClockSource source; + Boolean set; + PLL_ClockId PLL_clock; +} GlobalClock; + +typedef struct pll_clock +{ + MegaHertz requested_frequency; + MegaHertz actual_frequency; + Boolean in_use; +} PLL_Clock; + +typedef struct pll_clock_info +{ + const char *name; + unsigned int PLL_register; + MegaHertz MIN_VCO_FREQ; + MegaHertz MAX_VCO_FREQ; +} PLL_ClockInfo; + + +/* -------------------------------------------------------------------------- */ +/* local data */ +/* -------------------------------------------------------------------------- */ + +#define ARC_SET_CLOCK_FREQUENCY_COMMAND "arc-set-clock-frequency" +#define ARC_SET_CLOCK_SOURCE_COMMAND "arc-set-clock-source" +#define ARC_CLOCK_SETTINGS_COMMAND "arc-clock-settings" +#define ARC_BLAST_BOARD_COMMAND "arc-blast-board" +#define ARC_FPGA_COMMAND "arc-fpga" + +#define ARC_SET_CLOCK_FREQUENCY_COMMAND_USAGE "Usage: " ARC_SET_CLOCK_FREQUENCY_COMMAND " [ = ] |\n" \ + " " \ + " , \n" + +#define ARC_SET_CLOCK_SOURCE_COMMAND_USAGE "Usage: " ARC_SET_CLOCK_SOURCE_COMMAND " gclk[N] = |\n" \ + " " \ + " gclks = { , } |\n" \ + " " \ + " harvard\n" +#define ARC_CLOCK_SETTINGS_COMMAND_USAGE "Usage: info " ARC_CLOCK_SETTINGS_COMMAND "\n" +#define ARC_BLAST_BOARD_COMMAND_USAGE "Usage: " ARC_BLAST_BOARD_COMMAND " \n" +#define ARC_FPGA_COMMAND_USAGE "Usage: info " ARC_FPGA_COMMAND "\n" + + +#define MAX_MAX_BURST 256 + +#define S_XOR (Byte) 0x80 /* XOR value with this to get all bits positive. */ +#define C_XOR (Byte) 0x0b /* with respect to the signal values. */ + +/* Control bits in the masks for the Control port. */ +#define STR (Byte) 0x01 // strobe +#define CNT (Byte) 0x02 +#define SS0 (Byte) 0x04 +#define SS1 (Byte) 0x08 +#define BI (Byte) 0x20 // bi-directional? + +/* Control bits in the masks for the Status port. */ +#define OP (Byte) 0x20 +#define ACK (Byte) 0x40 +#define BUSY (Byte) 0x80 + +/* Special meanings of some of those bits. */ +#define FPA_CFG_DONE OP +#define CFG_FROM_ROM BUSY +#define PAR_CFG_MODE ACK + + +/* Constants for the PLL. */ +#define MREG_ADDRESS 3 +#define VCLK_SETUP_REG_NO 0 /* which of Reg0 .. Reg2 is used to set the VClock freq. */ +#define MCLK_RESET_FREQUENCY (MegaHertz) 25.0 +#define VCLK_RESET_FREQUENCY (MegaHertz) 25.0 + +#define NUM_GLOBAL_CLOCKS 4 +#define NUM_PLL_CLOCKS 2 + +#define UNDEFINED_FREQUENCY (MegaHertz) (-1.0) + + +static const char *CLOCK_SOURCE_STRINGS[] = +{ + "High Impedance", + "PLL MCLK", + "PLL VCLK", + "Crystal", + "High Impedance", + "High Impedance", + "Host Strobe", + "Crystal With Division" +}; + +static const char *GCLOCK3_SOURCE_STRINGS[] = +{ + "High Impedance", + "PLL MCLK", + "PLL VCLK", + "Crystal", + "PLL MCLK (+Harvard)", + "PLL VCLK (+Harvard)", + "Host Strobe", + "Crystal With Division (+Harvard)" +}; + + +static const ClockSource default_GCLK_sources[] = +{ + CLOCK_SOURCE_HIGH_IMPEDANCE, // GCLK0 + CLOCK_SOURCE_CRYSTAL, // GCLK1 + CLOCK_SOURCE_HOST_STROBE, // GCLK2 + CLOCK_SOURCE_CRYSTAL_DIVIDED // GCLK3 +}; + + +static const MegaHertz VCO_PRESET_BOUNDARIES[] = {50.0, 51.0, 53.2, 58.5, 60.7, 64.4, 66.8, + 73.5, 75.6, 80.9, 83.2, 91.5, 100.0, 120.0}; + + +/* Unchanging information for the two PLL clocks. */ +static const PLL_ClockInfo PLL_clock_fixed_info[NUM_PLL_CLOCKS] = +{ + { "MCLK", MREG_ADDRESS, 52.0, 120.0 }, + { "VCLK", VCLK_SETUP_REG_NO, 65.0, 165.0 } +}; + + +/* Data describing the 2 PLL clocks and the 4 global clock sources. */ +static PLL_Clock PLL_clocks [NUM_PLL_CLOCKS]; +static GlobalClock global_clocks[NUM_GLOBAL_CLOCKS]; +static Boolean harvard; + + +/* -------------------------------------------------------------------------- */ +/* local macros */ +/* -------------------------------------------------------------------------- */ + +#define IS_SET(bit, byte) (((bit) & (byte)) == (bit)) +#define __MIN(X, Y) ((X) < (Y) ? (X) : (Y)) +#define __MAX(X, Y) ((X) < (Y) ? (Y) : (X)) + +#define FREQUENCY(clock) ((PLL_clocks[clock].in_use) ? PLL_clocks[clock].requested_frequency \ + : UNDEFINED_FREQUENCY) + +#define PLL_CLOCK_NAME(clock) PLL_clock_fixed_info[clock].name + + +/* -------------------------------------------------------------------------- */ +/* local functions */ +/* -------------------------------------------------------------------------- */ + +/* Sleep for the given number of milliseconds. */ + +static void +Sleep (unsigned int milliseconds) +{ + usleep((unsigned long) (1000 * milliseconds)); +} + + +/* Read a byte of data from the Status port. */ + +static Byte +read_status_port (void) +{ + return gpio_read(STATUS_PORT) ^ S_XOR; +} + + +/* Write a byte of data to the Control port, then sleep for the given delay. */ + +static void +write_control_port (Byte data, unsigned int delay) +{ + Byte value = data ^ C_XOR; + + gpio_write(CONTROL_PORT, value); + Sleep(delay); +} + + +/* Write a byte of data to the Data port. */ + +static void +write_data_port (Byte value) +{ + gpio_write(DATA_PORT, value); +} + + +/* Extract the value from a string containing a name/value pair of the form + + [ = ] + + Return 0 if the string is not of the given form + 1 if the string is of the form + 2 if the string is of the form = +*/ + +static int +name_value_pair (char *args, char **value) +{ + char *equals = strchr(args, '='); + + if (equals) + { + char *val = equals + 1; + + /* If the key is missing from the argument string. */ + if (equals == args) + return 0; + + equals--; + while (*equals == ' ') equals--; + equals[1] = '\0'; + + while (*val == ' ') val++; + if (*val == '\0') + return 0; + + *value = val; + return 2; + } + + return 1; +} + + +/* -------------------------------------------------------------------------- */ +/* local functions for FPGA blasting */ +/* -------------------------------------------------------------------------- */ + +/* Initialize the FPGA ready for blasting. + Return TRUE if the initialization is successful. */ + +static Boolean +initialize_FPGA (void) +{ + Byte status; + Byte iOriginalState; + Byte iControlState; + unsigned int cpld_rev; + + ENTERMSG; + + /* snapshot the control port. */ + iOriginalState = gpio_read(CONTROL_PORT); + + /* Initialize FPGA by taking SS0 and SS1 low (all other ctrl's low as well). */ + iControlState = iOriginalState & (0xFFFFFFFF ^ (SS0 | SS1 | CNT | STR | BI)); + write_control_port(iControlState, 51); + + /* Tri-state port outputs so we can read CPLD revision number. */ + iControlState = iControlState | BI; + write_control_port(iControlState, 1); + + // Read the CPLD revision number LSB. */ + cpld_rev = (unsigned int) gpio_read(DATA_PORT); + + /* Set CNT high and read CPLD revision number MSB. */ + iControlState = iControlState | CNT; + write_control_port(iControlState, 1); + + cpld_rev += (unsigned int) gpio_read(DATA_PORT) << 8; + + /* Test the CPLD rev no; if it is 0xffff then this CPLD may not support + parallel blasting. */ + if ((cpld_rev & 0xffff) == 0xffff) + { + warning(_("old board type (AA2), not supported")); + gpio_close(); + return FALSE; + } + else + { + char rev_string[32]; + unsigned int temp = cpld_rev; + unsigned int char_pos = 0; + unsigned int i; + + for (i = 0; i < 16; i++) + { + if (temp & 0x8000) + rev_string[char_pos++] = '1'; + else + rev_string[char_pos++] = '0'; + + temp <<= 1; + if ((i % 4) == 3) + rev_string[char_pos++] = ' '; + } + + rev_string[char_pos] = '\0'; + + printf_filtered(_("\nCPLD Revision = %20s\n"), rev_string); + } + + /* Take CNT low. */ + iControlState = iControlState & (0xFFFFFFFF ^ (SS0 | SS1 | CNT | STR | BI)); + + /* Now take STR high, CNT low and SS0 high to enter FPGA download mode. */ + iControlState = iControlState | STR; + write_control_port(iControlState, 1); + + iControlState = iControlState | SS0; + write_control_port(iControlState, 3); + + /* Check that FPA_CFG_DONE=0. */ + status = read_status_port(); + + if (IS_SET(FPA_CFG_DONE, status)) + { + warning(_("FPGA is not responding - status = 0x%08x"), status); + gpio_close(); + return FALSE; + } + + LEAVEMSG; + + return TRUE; +} + + +/* Try to send data to the target in a parallel stream. + Return TRUE if it is sent. */ + +static Boolean +parallel_send_data (Byte *buffer, unsigned int count) +{ + GPIO_Pair arr[MAX_MAX_BURST * 3 + 1]; + + /* Work out how many bytes we can send in one PIO program. */ + unsigned const int bytes_per_burst = 127; + + /* Initialize offsets into config data buffer. */ + unsigned int burst_start = 0; + unsigned int burst_end = bytes_per_burst - 1; + + /* Snapshot the control port. */ + Byte iOriginalState = gpio_read(CONTROL_PORT); + Byte iControlState = (iOriginalState | SS0) & (0xFFFFFFFF ^ (SS1 | CNT | STR | BI)); + + while (TRUE) + { + GPIO_Pair *gpio = arr; + unsigned int i; + + /* Do not try to write more data than is in the buffer. */ + if (burst_end > (count - 1)) + burst_end = count - 1; + + /* Initialize the gpio driver instruction stream. */ + for (i = burst_start; i <= burst_end; i++) + { + gpio->port = DATA_PORT; + gpio->data = buffer[i]; + gpio++; + gpio->port = CONTROL_PORT; + gpio->data = iControlState ^ C_XOR; + gpio++; + gpio->port = CONTROL_PORT; + gpio->data = (iControlState | STR) ^ C_XOR; + gpio++; + } + + gpio_write_array(arr, gpio - arr); + + /* Last block of data written. */ + if (burst_end == count - 1) + break; + + burst_start = burst_end + 1; + burst_end = burst_start + bytes_per_burst - 1; + } + + return TRUE; +} + + +/* Try to send data to the target in a serial stream. + Return TRUE if it is sent. */ + +static Boolean +serial_send_data (Byte *buff, unsigned int count) +{ + /* There is code which implements serial blasting in the SeeCode debugger + file os/arc/connect/par/arc/aa3blast.cpp, which is intended to work with + either Win95 or WinNT. If serial blasting is required for Linux, this + code would have to be re-written to use Linux O/S operations. However, + there is currently no requirement for that. */ + warning(_("sorry, serial download is not supported")); + return FALSE; +} + + + +/* Try to blast the target board FPGA with the contents of an XBF file. + Return TRUE if the blast is succcessful. */ + +static Boolean +blast_FPGA (FILE *xbf) +{ + Boolean parallel_cfg; + unsigned long file_size; + unsigned long five_percent; + unsigned long bytes_sent = 0; + unsigned long twentieths_complete = 0; + Byte status; + + ENTERMSG; + + /* Get parallel port status, and see whether the board is expecting parallel + or serial blast. */ + status = read_status_port(); + + if ((status & CFG_FROM_ROM) == CFG_FROM_ROM) + { + /* Oops - FPGA is configured from ROM! */ + if (IS_SET(FPA_CFG_DONE, status)) + printf_filtered(_("FPGA is configured from ROM")); + else + warning(_("FPGA should be configured from ROM - BUT IT IS NOT!")); + return FALSE; + } + + parallel_cfg = ((status & PAR_CFG_MODE) == PAR_CFG_MODE); + + /* Find the length of the file (could use fstat instead here). */ + (void) fseek(xbf, 0, SEEK_END); + file_size = (unsigned long) ftell(xbf); + (void) fseek(xbf, 0, SEEK_SET); + + five_percent = file_size / 20; + + /* Read file and blast. */ + + while (TRUE) + { + Byte data_buffer[1024]; + size_t n_bytes = fread(data_buffer, 1, sizeof(data_buffer), xbf); + + if (gpio_port_error) + error(_("Error in accessing JTAG port (device " GPIO_DEVICE ")")); + + /* End of file reached? (fread returns 0 for both EOF and error!). */ + if (n_bytes == 0) + { + if (!feof(xbf)) + { + warning(_("error in reading XBF file")); + return FALSE; + } + break; + } + + if (!(((parallel_cfg) ? parallel_send_data + : serial_send_data) (data_buffer, (unsigned int) n_bytes))) + break; + + bytes_sent += n_bytes; + if (bytes_sent == file_size) + break; + + if ((bytes_sent / five_percent) > twentieths_complete) + { + twentieths_complete++; + printf_filtered(_("*")); + gdb_flush (gdb_stdout); + } + } + + printf_filtered(_("\n")); + + /* Check for the ConfigDone signal. */ + status = read_status_port(); + + if (!IS_SET(FPA_CFG_DONE, status)) + { + warning(_("FPGA configuration failed")); + return FALSE; + } + + printf_filtered(_("FPGA configured\n")); + + /* Set SS0 and SS1 high to take board out of reset. */ + { + Byte iControlState = (gpio_read(CONTROL_PORT) | SS0 | SS1 | STR) & (0xFFFFFFFF ^ (CNT | BI)); + + write_control_port(iControlState, 1); + } + + LEAVEMSG; + + return TRUE; +} + + +/* -------------------------------------------------------------------------- */ +/* local functions for setting clocks */ +/* -------------------------------------------------------------------------- */ + +/* Reset the clock configuration information to its default values (i.e. the + values that the h/w has after a hard reset of the target. */ + +static void +reset_clock_configuration (void) +{ + unsigned int i; + + for (i = 0; i < ELEMENTS_IN_ARRAY(PLL_clocks); i++) + { + PLL_clocks[i].requested_frequency = MCLK_RESET_FREQUENCY; + PLL_clocks[i].actual_frequency = VCLK_RESET_FREQUENCY; + PLL_clocks[i].in_use = FALSE; + } + + for (i = 0; i < ELEMENTS_IN_ARRAY(global_clocks); i++) + { + global_clocks[i].source = default_GCLK_sources[i]; + global_clocks[i].set = FALSE; + global_clocks[i].PLL_clock = NO_PLL_CLK; + } + + harvard = FALSE; +} + + +/* Calculate the control word required to set a PLL clock to a particular frequency. + + Parameters: + requested_frequency : the frequency we want + min_vco_frequency : the minimum VCO frequency for this clock + max_vco_frequency : the maximum VCO frequency for this clock + actual_frequency : the frequency we actually get + + Result: the control word; 0 if no frequency can be set + + The PLL consists of a VCO and 3 counters that divide by p, q and 2^d. The + VCO runs at 2*RefClk*p/q. This is divided by 2^d to give the PLL output. + + There are several contraints on the various values: + 4 <= p <= 130 + 3 <= q <= 129 + 0 <= d <= 7 + 0.2 <= ref_clk / q <= 1.0 (200kHz .. 1MHz) + + This method is a bit of a palaver - very procedural. Basically it uses + trial and error to find the best values for d, p and q, within the given + contraints. */ + +static unsigned int +calculate_ctrl_word (const MegaHertz requested_frequency, + const MegaHertz min_vco_frequency, + const MegaHertz max_vco_frequency, + MegaHertz *actual_frequency) +{ + const unsigned int MIN_P = 4; + const unsigned int MAX_P = 130; + const unsigned int MIN_Q = 3; + const unsigned int MAX_Q = 129; + const unsigned int MIN_D = 0; + const unsigned int MAX_D = 7; + const MegaHertz MIN_REF_CLK_OVER_Q = 0.2; + const MegaHertz MAX_REF_CLK_OVER_Q = 1.0; + const MegaHertz REF_CLK = 14.31818; // input to PLL + +#define NUM_PRESETS ELEMENTS_IN_ARRAY(VCO_PRESET_BOUNDARIES) + + unsigned int index, p = 0, q = 0, d = MIN_D; /* PLL parameters (see ICD2061A Data Sheet). */ + unsigned int trial_p, trial_q; /* Temp vars for p & q values that we are trying out. */ + unsigned int first_q, last_q; + unsigned int ctrl_word; + double min_delta = 1.0; /* Smallest error so far. */ + MegaHertz vco_frequency = requested_frequency; /* Freq at which the VCO will run. */ + double p_over_q; + + /* Find a value of d which gives a VCO frequency that is within limits (VCO + output is divided by 2^d). */ + while ((vco_frequency < min_vco_frequency) && (d < MAX_D)) + { + vco_frequency *= 2; + d++; + } + + DEBUG("request = %g, vco = %g, min = %g, max = %g, d = %d\n", + requested_frequency, vco_frequency, min_vco_frequency, max_vco_frequency, d); + + /* Check that we have found a suitable value for d. */ + if ((vco_frequency < min_vco_frequency) || (vco_frequency > max_vco_frequency)) + { + DEBUG("frequency is out of range\n"); + return 0; + } + + /* Calculate the ratio needed for p/q, to get vco_frequency from ref_clk. */ + p_over_q = vco_frequency / (2.0 * REF_CLK); + + /* Now use some brute force and ignorance to find the best values for p & q: + we look for p & q such that p / q is the best approximation to p_over_q. */ + + /* Calculate range of values allowed for q. */ + first_q = __MAX((unsigned int) (REF_CLK / MAX_REF_CLK_OVER_Q + 0.999999), MIN_Q); + last_q = __MIN((unsigned int) (REF_CLK / MIN_REF_CLK_OVER_Q), MAX_Q); + + /* Look at each possible value of q. */ + for (trial_q = first_q; trial_q <= last_q; trial_q++) + { + /* Calculate the value of p needed with this q value. */ + double raw_p = p_over_q * (double) trial_q; + double delta; + + /* Round the raw value for p to the nearest integer. */ + trial_p = (unsigned int) (raw_p + 0.5); + + /* Range check the required p value: note that because trial_q is + increasing, trial_p is also increasing, so if it is less than MIN_P + we may find a suitable value in a later iteration, whereas if it is + greater than MAX_P we will never find a suitable value in a later + iteration. */ + if (trial_p < MIN_P) + continue; + if (trial_p > MAX_P) + break; + + /* See how much error is caused by p being an integer. */ + delta = fabs (1.0 - ((double) trial_p / raw_p)); + + /* If this is the most accurate so far, then keep track of it. */ + if (delta < min_delta) + { + p = trial_p; + q = trial_q; + + /* If it is exact then quit (we won't be able to find a better approximation!). */ + if (min_delta == 0.0) + break; + + min_delta = delta; + } + } + + /* Just in case. */ + if (p == 0) + { + DEBUG("loop failed to find p & q!"); + return 0; + } + + /* Have sorted out values for p, q & d - now form them into a control word. */ + + /* First, look up the value for Index (VCO preset). */ + for (index = 0; index < NUM_PRESETS; index++) + { + if (VCO_PRESET_BOUNDARIES[index] > vco_frequency) + break; + } + + // make sure we have found a suitable value for I + if ((index == 0) || (index == NUM_PRESETS)) + { + DEBUG("can not find preset for %g\n", vco_frequency); + return 0; + } + + /* The index must now be in the range 1 .. 13; so subtract 1, to change the + range to 0 .. 12 as required by the encoding. */ + index--; + + /* Return the frequency calculated as best approximation to the one requested. */ + *actual_frequency = (2.0 * REF_CLK * p / q) / (1 << d); + + DEBUG("p = %d, q = %d, d = %d, I = %d\n", p, q, d, index); + + /* The ranges for p, q & d are: + + I : 0 .. 12 + p : 4 .. 130 + d : 0 .. 7 + q : 3 .. 129 + + Subtracting a bias of 3 from p and 2 from q converts these to: + + I : 0 .. 12 which can be held in 4 bits + p : 1 .. 127 which can be held in 7 bits + d : 0 .. 7 which can be held in 3 bits + q : 1 .. 126 which can be held in 7 bits + + which gives a control word with bitfields: + + 00000000000IIIIPPPPPPPDDDQQQQQQQ + + Note that 0 is not a valid value for the control word, which is why + it is safe to return 0 from this function in the error cases. */ + + ctrl_word = (index & 0xf); + ctrl_word = (ctrl_word << 7) | ((p - 3) & 0x7f); + ctrl_word = (ctrl_word << 3) | (d & 0x7); + ctrl_word = (ctrl_word << 7) | ((q - 2) & 0x7f); + + return ctrl_word; +} + + +/* Write a control word to the PLL clock control register whose address is given. + Return TRUE if the write is successful. */ + +static Boolean +write_PLL_register (unsigned int address, unsigned int ctrl_word) +{ + const Byte S0S1_FINAL_STATE[] = {(Byte) 0x0, (Byte) 0x1, (Byte) 0x2}; + const Byte PLL_CLK_BIT = (Byte) 0x08; + const Byte PLL_DATA_BIT = (Byte) 0x10; + unsigned int i; + Byte data; + Byte iControlState; + Byte iOriginalState; + int manchester_bitstream[64]; + + DEBUG("writing 0x%08X to PLL register %d\n", ctrl_word, address); + + /* Add the address in the MSBs of the ctrl_word: this gives us a 24-bit value + with the fields AAAIIIIPPPPPPPDDDQQQQQQQ */ + + ctrl_word = ((address & 0x7) << 21) | (ctrl_word & 0x1fffff); + + /* Create a bit stream at twice the data rate that incorporates the pseudo + Manchester encoding for the data and also the unlock sequence. */ + for (i = 0; i < 11; i++) + manchester_bitstream[i] = 1; + + /* The start bit. */ + manchester_bitstream[11] = 0; + manchester_bitstream[12] = 0; + manchester_bitstream[13] = 0; + + i = 14; + while (i < 62) + { + if ((ctrl_word & 0x1) == 0) + { + manchester_bitstream[i++] = 1; + manchester_bitstream[i++] = 0; + } + else + { + manchester_bitstream[i++] = 0; + manchester_bitstream[i++] = 1; + } + + ctrl_word >>= 1; + } + + /* The stop bit. */ + manchester_bitstream[62] = 1; + manchester_bitstream[63] = 1; + + /* Snapshot the control port state. */ + iOriginalState = gpio_read(CONTROL_PORT); + + /* Set the parallel port data to 0, in preparation for sending config data. */ + write_data_port((Byte) 0); + Sleep(2); + + /* Set CPLD into config mode. */ + + /* Set SS0=1, SS1=1, CNT=1, BIDir=0. */ + iControlState = (iOriginalState | SS0 | SS1 | CNT | BI) ^ BI; + write_control_port(iControlState, 2); + + /* Ensure STROBE is high. */ + iControlState = iControlState | STR; + write_control_port(iControlState, 2); + + /* Set CPLD into config mode by setting SS0=1, SS1=0, CNT=1. */ + iControlState = iControlState ^ SS1; + write_control_port(iControlState, 2); + + /* Now send the double rate data stream. */ + + // Set the clock high and data low. */ + data = PLL_CLK_BIT & ~PLL_DATA_BIT; + write_data_port(data); + //Sleep(1); + + for (i = 0; i < 64; i++) + { + /* Put the next Manchester code bit out. */ + if (manchester_bitstream[i] == 1) + data = data | PLL_DATA_BIT; + else + data = data & ~PLL_DATA_BIT; + + write_data_port(data); + //Sleep(1); + + /* Toggle the clock bit. */ + data = data ^ PLL_CLK_BIT; + write_data_port(data); + //Sleep(1); + } + + /* Set data/clock (alias s1/s0) to select the programmed divisor register + for the video clock. */ + write_data_port(S0S1_FINAL_STATE[VCLK_SETUP_REG_NO]); + //Sleep(1); + + /* Set CPLD into ARC-Run Host-Read mode. */ + iControlState = iControlState | SS1 | BI; + write_control_port(iControlState, 2); + + return TRUE; +} + + +/* Configure the target board's CPLD. */ + +static void +configure_CPLD (void) +{ + const Byte CPLD_CLK_BIT = (Byte) 0x01; + const Byte CPLD_DATA_BIT = (Byte) 0x02; + const Byte CPLD_SET_BIT = (Byte) 0x04; + const unsigned int NUM_OF_CPLD_CFG_BITS = 16; + unsigned int cpldConfigData = 0; + Byte iControlState; + unsigned int i; + + /* Snapshot the control port. */ + Byte iOriginalState = gpio_read(CONTROL_PORT); + + /* Set the parallel port data to 0, in preparation for sending config data. */ + write_data_port((Byte) 0); + Sleep(1); + + /* Set CPLD into configuration mode. */ + + /* Set SS0=1, SS1=1, CNT=1, BIDir=0. */ + iControlState = (iOriginalState | SS0 | SS1 | CNT | BI) ^ BI; + write_control_port(iControlState, 2); + + /* Ensure STROBE is high. */ + iControlState = iControlState | STR; + write_control_port(iControlState, 2); + + /* Set CPLD into config mode by setting SS0=1, SS1=0, CNT=1. */ + iControlState = iControlState ^ SS1; + write_control_port(iControlState, 2); + + /* Now send the config data stream with set low. */ + + /* Set clock high and data low. */ + + for (i = 0; i < ELEMENTS_IN_ARRAY(global_clocks); i++) + cpldConfigData += (unsigned int) global_clocks[i].source << (3 * i); + + for (i = 0; i < NUM_OF_CPLD_CFG_BITS; i++) + { + Byte value; + + /* See if the next cfg bit is 0 or 1. */ + if ((cpldConfigData & 0x1) == 0x1) + value = CPLD_DATA_BIT; + else + value = (Byte) 0; + + /* Put data bit out to parallel port. */ + write_data_port(value); + + /* And toggle the clock line. */ + value |= CPLD_CLK_BIT; + write_data_port(value); + + value &= ~CPLD_CLK_BIT; + write_data_port(value); + + cpldConfigData >>= 1; + } + + /* Now take the clock and set bits high. */ + write_data_port(CPLD_CLK_BIT | CPLD_SET_BIT); + + /* Finally, take the clock low. */ + write_data_port(CPLD_SET_BIT); + + /* And put the CPLD into ARC run mode, SS0=1, SS1= 1, CNT=x. */ + iControlState = iControlState | SS1 | BI; + write_control_port(iControlState, 2); +} + + +/* Try to set the frequency of a PLL clock. + + Parameters: + clock : the identity of the clock (MCLK or VCLK) + requested_frequency: the desired frequency fro the clock + inform : TRUE if a message should be output if the clock is set + emit_warning : TRUE if a warning should be output if the clock is not set + + Returns TRUE if the clock is set. +*/ + +static Boolean +set_PLL_clock_frequency (PLL_ClockId clock, + MegaHertz requested_frequency, + Boolean inform, + Boolean emit_warning) +{ + /* First need to work out the control words for the frequencies set. */ + MegaHertz actual_frequency = UNDEFINED_FREQUENCY; + unsigned int ctrl_word = calculate_ctrl_word (requested_frequency, + PLL_clock_fixed_info[clock].MIN_VCO_FREQ, + PLL_clock_fixed_info[clock].MAX_VCO_FREQ, + &actual_frequency); + Boolean set; + + DEBUG("set_PLL_clock_frequency: %s ctrl_word = %08X, freq = %.2lf MHz\n", + PLL_CLOCK_NAME(clock), ctrl_word, requested_frequency); + + if (ctrl_word == 0) + { + if (emit_warning) + warning(_("it is not possible to set %s to %.2lf"), + PLL_CLOCK_NAME(clock), requested_frequency); + return FALSE; + } + + DEBUG("set_PLL_clock_frequency: %s %.2lf, %.2lf, %.2lf\n", + PLL_CLOCK_NAME(clock), + requested_frequency, + actual_frequency, + PLL_clocks[clock].actual_frequency); + + if (actual_frequency != PLL_clocks[clock].actual_frequency) + { + /* Set up the PLL chip. We program the MREG, the REG0/1/2 - whichever + is selected to control VCLK. */ + set = write_PLL_register (PLL_clock_fixed_info[clock].PLL_register, ctrl_word); + + if (set) + { + PLL_clocks[clock].requested_frequency = requested_frequency; + PLL_clocks[clock].actual_frequency = actual_frequency; + } + else + if (emit_warning) + warning(_("PLL programming failed")); + } + else + set = TRUE; + + if (set && inform) + printf_filtered(_("PLL clock %s set to %.2lf MHz.\n"), PLL_CLOCK_NAME(clock), actual_frequency); + + return set; +} + + +/* Check the frequencies of the two PLL clocks, and emit a warning if necessary. + + The ICD2061A Data Sheet recommends that the two clocks should not be set to + frequencies such that one is an integer multiple of the other, in order to + avoid jitter. */ + +static void +check_PLL_clock_frequencies (void) +{ + DEBUG("check_PLL_clock_frequencies\n"); + + /* If both clocks are in use. */ + if (PLL_clocks[PLL_MCLK].in_use && PLL_clocks[PLL_VCLK].in_use) + { + /* Check whether the two chosen clocks are divisible by one another, in + which case print a warning. */ + double multiplier = PLL_clocks[PLL_VCLK].actual_frequency / + PLL_clocks[PLL_MCLK].actual_frequency; + double modulus; + + if (multiplier < 1.00) + multiplier = 1 / multiplier; + + modulus = multiplier - ((int) multiplier); + + /* Check also for near multiples. */ + if ((modulus < 0.02) || (modulus > 0.98)) + warning(_("PLL MCLK and PLL VCLK frequencies are (near) multiples of each other.\n" + "This may lead to clock degradation.")); + } + else if (PLL_clocks[PLL_MCLK].in_use || PLL_clocks[PLL_VCLK].in_use) + { + MegaHertz requested_frequency; + MegaHertz actual_frequency; + PLL_ClockId clock; + + /* If we now are only using one PLL clock then ensure that the second + clock's frequency is not a multiple of the first's (M == V is OK). */ + if (PLL_clocks[PLL_MCLK].in_use) + { + clock = PLL_VCLK; + actual_frequency = PLL_clocks[PLL_MCLK].actual_frequency; + } + else + { + clock = PLL_MCLK; + actual_frequency = PLL_clocks[PLL_VCLK].actual_frequency; + } + + if (actual_frequency < VCO_PRESET_BOUNDARIES[0]) + requested_frequency = actual_frequency * 1.43; + else + requested_frequency = actual_frequency; + + if (!set_PLL_clock_frequency(clock, requested_frequency, TRUE, FALSE)) + (void) set_PLL_clock_frequency(clock, actual_frequency, TRUE, TRUE); + } +} + + +/* Try to set the source of the given global clock to be a PLL clock set to the + given frequency. + + If one of the PLL clocks is already set to the given frequency, we use that + as the source; otherwise, if the global clock's source is a PLL clock, and + no other global clock is using that PLL clock as its source, we change its + frequency to the required frequency; otherwise, if the other PLL clock is not + already in use, we set that other clock to the required frequency and use it + as the source; otherwise (both PLL clocks are in use), we find the clock + whose frequency is closest to the required frequency and use that clock as + the source. */ + +static void +use_PLL_clock (GlobalClockId clockId, MegaHertz clockValue) +{ + PLL_ClockId PLL_clock_id = NO_PLL_CLK; + PLL_ClockId free_PLL_clock_id = NO_PLL_CLK; + unsigned int i; + + /* Is this global clock not already using a PLL clock? */ + if (global_clocks[clockId].PLL_clock == NO_PLL_CLK) + { + /* Has this frequency already been assigned to a PLL clock? */ + for (i = 0; i < ELEMENTS_IN_ARRAY(PLL_clocks); i++) + { + PLL_Clock* clock = &PLL_clocks[i]; + + if (clock->in_use) + { + /* The actual frequency to which the clock is set may differ + slightly from the frequency that was requested - so check + both. */ + if (clockValue == clock->requested_frequency || + clockValue == clock->actual_frequency) + { + PLL_clock_id = (PLL_ClockId) i; + break; + } + } + else + { + /* Use MCLK (first in array) in preference to VCLK. */ + if (free_PLL_clock_id == NO_PLL_CLK) + free_PLL_clock_id = (PLL_ClockId) i; + } + } + } + else + { + PLL_ClockId this_clock = global_clocks[clockId].PLL_clock; + int users = 0; + + /* How many global clocks are using this PLL clock? */ + for (i = 0; i < ELEMENTS_IN_ARRAY(global_clocks); i++) + { + if (global_clocks[i].PLL_clock == this_clock) + users++; + } + + if (users == 1) + { + /* Just this one - so we can change its frequency without affecting + any other global clocks. */ + free_PLL_clock_id = this_clock; + } + else + { + /* Look at the other clock - if it is not already in use, we can use it. */ + PLL_ClockId other_clock = (this_clock == PLL_MCLK) ? PLL_VCLK : PLL_MCLK; + + if (!PLL_clocks[other_clock].in_use) + free_PLL_clock_id = other_clock; + } + } + + /* Do we need another PLL clock? */ + if (PLL_clock_id == NO_PLL_CLK) + { + /* If so, and there aren't any which are not in use. */ + if (free_PLL_clock_id == NO_PLL_CLK) + { + MegaHertz M_delta = fabs(PLL_clocks[PLL_MCLK].actual_frequency - clockValue); + MegaHertz V_delta = fabs(PLL_clocks[PLL_VCLK].actual_frequency - clockValue); + + /* Which clock has the closet frequency to what we want? */ + PLL_clock_id = (M_delta <= V_delta) ? PLL_MCLK : PLL_VCLK; + + warning(_("can not set GCLK%d to %.2lf MHz - " + "there are no more PLL clocks available.\n" + "Using closest match instead (%s @ %.2lf MHz)."), + clockId, clockValue, + PLL_CLOCK_NAME(PLL_clock_id), + PLL_clocks[PLL_clock_id].actual_frequency); + } + else + { + /* Otherwise, use a free PLL clock. */ + PLL_clock_id = free_PLL_clock_id; + + if (set_PLL_clock_frequency(PLL_clock_id, clockValue, TRUE, TRUE)) + { + PLL_clocks[PLL_clock_id].in_use = TRUE; + check_PLL_clock_frequencies(); + } + } + } + + global_clocks[clockId].PLL_clock = PLL_clock_id; + global_clocks[clockId].source = (PLL_clock_id == PLL_MCLK) ? CLOCK_SOURCE_PLL_MCLK : CLOCK_SOURCE_PLL_VCLK; + global_clocks[clockId].set = TRUE; +} + + +/* Set the source of the given global clock as specified. + This may be one of: crystal, dips, highimp, host, mclk, vclk or . + Specifying an explicit frequency means that the source should be a PLL clock + set to that frequency. */ + +static void +set_global_clock (GlobalClockId clockId, const char *clockData) +{ + static const struct table_entry + { + ClockSource source; + PLL_ClockId clock; + const char *name; + Boolean harvard; + } table[] = + { { CLOCK_SOURCE_CRYSTAL, NO_PLL_CLK, "crystal", FALSE }, + { CLOCK_SOURCE_CRYSTAL_DIVIDED, NO_PLL_CLK, "dips", FALSE }, + { CLOCK_SOURCE_HIGH_IMPEDANCE, NO_PLL_CLK, "highimp", FALSE }, + { CLOCK_SOURCE_HOST_STROBE, NO_PLL_CLK, "host", FALSE }, + { CLOCK_SOURCE_PLL_MCLK_HARVARD, PLL_MCLK, "mclk", TRUE }, + { CLOCK_SOURCE_PLL_VCLK_HARVARD, PLL_MCLK, "vclk", TRUE }, + { CLOCK_SOURCE_PLL_MCLK, PLL_MCLK, "mclk", FALSE }, + { CLOCK_SOURCE_PLL_VCLK, PLL_VCLK, "vclk", FALSE } }; + + MegaHertz clockValue; + unsigned int i; + + /* Look at each possible clock source in the table. */ + for (i = 0; i < ELEMENTS_IN_ARRAY(table); i++) + { + const struct table_entry *entry = &table[i]; + + if (strcasecmp(clockData, entry->name) == 0) + { + /* N.B. the order of the entries in the table is important! */ + if (entry->harvard && !harvard) + continue; + + global_clocks[clockId].source = entry->source; + global_clocks[clockId].PLL_clock = entry->clock; + global_clocks[clockId].set = TRUE; + + /* N.B. "high impedance" effectively means "off". */ + if ((clockId == 3) && (entry->source == CLOCK_SOURCE_HIGH_IMPEDANCE)) + { + warning(_("GCLK3 must be valid in order for the ARC processor's debug interface to interact with the processor.")); + } + else if ((clockId == 2) && (entry->source != CLOCK_SOURCE_HOST_STROBE)) + { + warning(_("GCLK2 must be %s for the JTAG clock to be connected to the ARC processor's debug interface."), + CLOCK_SOURCE_STRINGS[CLOCK_SOURCE_HOST_STROBE]); + } + + return; + } + } + + /* We did not find a match in the table - so the given source may be a frequency. */ + if (sscanf(clockData, "%lf", &clockValue) == 1) + { + if (clockId == 2) + { + warning(_("GCLK2 must be %s for the JTAG clock to be connected to the ARC processor's debug interface."), + CLOCK_SOURCE_STRINGS[CLOCK_SOURCE_HOST_STROBE]); + } + + use_PLL_clock(clockId, clockValue); + } + else + warning(_("'%s' is not a valid source for clock %d\n"), clockData, clockId); +} + + +/* Enable Harvard clock to drive global clock GLK3. */ + +static void +enable_Harvard_clock (void) +{ + /* Does GCLK3 come from the PLL? */ + if (global_clocks[3].PLL_clock != NO_PLL_CLK) + { + /* Save existing settings. */ + const PLL_ClockId saved_clock[] = {global_clocks[0].PLL_clock, + global_clocks[1].PLL_clock, + global_clocks[2].PLL_clock, + global_clocks[3].PLL_clock}; + const MegaHertz saved_value[] = {PLL_clocks[PLL_MCLK].actual_frequency, + PLL_clocks[PLL_VCLK].actual_frequency}; + GlobalClockId clockId; + + printf_filtered(_("Configuring clocks to drive Harvard Ctl_Clk.\n")); + + reset_clock_configuration(); + harvard = TRUE; + + /* Now re-assign the Harvard inputs and double the requested frequency. */ + use_PLL_clock(3, 2 * saved_value[saved_clock[3]]); + + /* Now ensure GCLK3 is configured as a Harvard generator. */ + if (saved_clock[3] == PLL_MCLK) + global_clocks[3].source = CLOCK_SOURCE_PLL_MCLK_HARVARD; + else + global_clocks[3].source = CLOCK_SOURCE_PLL_VCLK_HARVARD; + + /* Re-assign any existing PLL clocks. */ + for (clockId = 0; clockId < 3; clockId++) + { + if (saved_clock[clockId] != NO_PLL_CLK) + use_PLL_clock(saved_clock[clockId], saved_value[saved_clock[clockId]]); + } + } +} + + +/* Print out the settings of the PLL clocks and the global clock sources. + + Parameters: + with_PLL_clocks : if TRUE, print the settings of the PLL clocks + with_global_only_if_using_PLL: if TRUE, print the sources of the global + clocks only if at least one of those sources + is a PLL clock + */ + +static void +print_clock_settings (Boolean with_PLL_clocks, Boolean with_global_only_if_using_PLL) +{ + Boolean with_global_clocks = TRUE; + unsigned int i; + + if (with_global_only_if_using_PLL) + { + with_global_clocks = FALSE; + + for (i = 0; i < ELEMENTS_IN_ARRAY(global_clocks); i++) + { + if (global_clocks[i].PLL_clock != NO_PLL_CLK) + { + with_global_clocks = TRUE; + break; + } + } + } + + if (with_PLL_clocks) + { + printf_filtered(_("PLL clock %s : %.2lf MHz.\n"), PLL_CLOCK_NAME(PLL_MCLK), PLL_clocks[PLL_MCLK].actual_frequency); + printf_filtered(_("PLL clock %s : %.2lf MHz.\n"), PLL_CLOCK_NAME(PLL_VCLK), PLL_clocks[PLL_VCLK].actual_frequency); + } + + if (with_global_clocks) + { + for (i = 0; i < ELEMENTS_IN_ARRAY(global_clocks); i++) + { + GlobalClock clock = global_clocks[i]; + const char *format = "GCLK%d << %s @ %.2lf MHz\n"; + const char *source; + MegaHertz value; + + switch (clock.source) + { + case CLOCK_SOURCE_PLL_MCLK: + source = CLOCK_SOURCE_STRINGS[clock.source]; + value = PLL_clocks[PLL_MCLK].actual_frequency; + break; + + case CLOCK_SOURCE_PLL_VCLK: + source = CLOCK_SOURCE_STRINGS[clock.source]; + value = PLL_clocks[PLL_VCLK].actual_frequency; + break; + + case CLOCK_SOURCE_PLL_MCLK_HARVARD: + source = GCLOCK3_SOURCE_STRINGS[clock.source]; + value = PLL_clocks[PLL_MCLK].actual_frequency / 2.0; + break; + + case CLOCK_SOURCE_PLL_VCLK_HARVARD: + source = GCLOCK3_SOURCE_STRINGS[clock.source]; + value = PLL_clocks[PLL_VCLK].actual_frequency / 2.0; + break; + + default: + format = "GCLK%d << %s\n"; + source = ((i == 3) ? GCLOCK3_SOURCE_STRINGS : CLOCK_SOURCE_STRINGS)[clock.source]; + value = 0.0; + break; + } + + printf_filtered(format, i, source, value); + } + } +} + + +/* Set the two PLL clocks to the given frequencies. */ + +static void +set_PLL_clocks (MegaHertz requested_MCLK_frequency, + MegaHertz requested_VCLK_frequency) +{ + DEBUG("set_PLL_clocks: MCLK = %.2lf MHz, VCLK = %.2lf MHz\n", + requested_MCLK_frequency, requested_VCLK_frequency); + + /* Configure PLL clocks. */ + + if (requested_MCLK_frequency != UNDEFINED_FREQUENCY) + { + if (set_PLL_clock_frequency(PLL_MCLK, requested_MCLK_frequency, TRUE, TRUE)) + PLL_clocks[PLL_MCLK].in_use = TRUE; + } + + if (requested_VCLK_frequency != UNDEFINED_FREQUENCY) + { + if (set_PLL_clock_frequency(PLL_VCLK, requested_VCLK_frequency, TRUE, TRUE)) + PLL_clocks[PLL_VCLK].in_use = TRUE; + } +} + + +/* Set the clock settings. + + The PLL clocks are set only if this is being done after the target board + FPGA has been blasted. + If any of the global clock sources needs to be set, the target CPLD is + configured, and the given message is printed out. */ + +static void +program_clock_settings (const char *message, Boolean after_blast) +{ + unsigned int i; + + /* If the FPGA has been blasted, configure the PLL clocks. */ + if (after_blast) + set_PLL_clocks(FREQUENCY(PLL_MCLK), FREQUENCY(PLL_VCLK)); + + /* Do any of the global clocks need to be set? */ + for (i = 0; i < ELEMENTS_IN_ARRAY(global_clocks); i++) + { + if (global_clocks[i].set) + { + /* Print status message only if there is something to be done. */ + printf_filtered("%s\n", message); + + if (harvard) + enable_Harvard_clock(); + + configure_CPLD(); + + print_clock_settings(after_blast, FALSE); + break; + } + } + + /* Reset the JTAG Test Access Port Controller. */ + arc_jtag_ops.reset(); +} + + +/* -------------------------------------------------------------------------- */ +/* local functions for blasting the FPGA */ +/* -------------------------------------------------------------------------- */ + +/* Try to blast the target board FPGA. + Return TRUE if blasting is done. */ + +static Boolean +blast_board (char *args, int from_tty) +{ + /* Check that a file name has been given. */ + if (args == NULL) + printf_filtered (_(ARC_BLAST_BOARD_COMMAND_USAGE)); + else + { + char *suffix = strrchr(args, '.'); + + /* Check the file is an .xbf file. */ + if ((suffix != NULL) && (strcasecmp(suffix, ".xbf") == 0)) + { + FILE *fp; + + /* Check that the JTAG interface (which opens the GPIO driver) is open + (do this before opening the file, as this function does not return + here if the interface is not open). */ + arc_jtag_ops.check_open(); + + fp = fopen(args, "rb"); + + if (fp) + { + char *message = NULL; + + if (initialize_FPGA()) + { + if (blast_FPGA(fp)) + { + /* Reset the JTAG Test Access Port Controller. */ + arc_jtag_ops.reset(); + + program_clock_settings(_("Reconfiguring clock settings after FPGA blast."), TRUE); + + return TRUE; + } + else + message = _("Can not blast FPGA"); + } + else + message = _("Can not initialize FPGA for blasting"); + + (void) fclose(fp); + + if (message) + error("%s", message); + } + else + error(_("Can not open file '%s': %s"), args, strerror(errno)); + } + else + error(_("Filename does not have suffix .xbf, so is presumably not an XBF file")); + } + + return FALSE; +} + + +/* -------------------------------------------------------------------------- */ +/* local functions implementing commands */ +/* -------------------------------------------------------------------------- */ + +/* Command: + + Blast the target board's FPGA with an XBF file. */ + +static void +arc_blast_board_FPGA (char *args, int from_tty) +{ + if (blast_board(args, from_tty)) + { + /* We no longer know what the target processor is. */ + arc_architecture_is_unknown(); + + /* So find it out again. */ + arc_update_architecture(arc_read_jtag_aux_register); + + /* And check that it matches the aux registers and the executable file. */ + ARCHITECTURE_CHECK(current_gdbarch, + (current_objfile) ? current_objfile->obfd : NULL); + } +} + + +/* Command: [ = ] [ , ] + + Set the frequency of one or both PLL clocks. */ + +static void +arc_set_clock_frequency (char *args, int from_tty) +{ + MegaHertz MCLK_frequency = UNDEFINED_FREQUENCY; + MegaHertz VCLK_frequency = UNDEFINED_FREQUENCY; + int result; + char *value; + + if (args == NULL) + { + printf_filtered (_(ARC_SET_CLOCK_FREQUENCY_COMMAND_USAGE)); + return; + } + + result = name_value_pair(args, &value); + + if (result == 0) + { + printf_filtered (_(ARC_SET_CLOCK_FREQUENCY_COMMAND_USAGE)); + return; + } + + if (result == 1) + { + char *comma = strchr(args, ','); + + if (comma) + { + *comma = '\0'; + MCLK_frequency = strtod(args, NULL); + VCLK_frequency = strtod(comma + 1, NULL); + } + else + MCLK_frequency = strtod(args, NULL); + + } + else if (result == 2) + { + char *comma = strchr(value, ','); + + if (comma) + { + printf_filtered (_(ARC_SET_CLOCK_FREQUENCY_COMMAND_USAGE)); + return; + } + + if (strcasecmp(args, "mclk") == 0) + MCLK_frequency = strtod(value, NULL); + else if (strcasecmp(args, "vclk") == 0) + VCLK_frequency = strtod(value, NULL); + else + { + warning(_("invalid PLL clock '%s'"), args); + return; + } + } + + /* strtod returns 0 for an invalid argument - and 0 is not a valid clock + frequency anyway! */ + if (MCLK_frequency == 0.0 || VCLK_frequency == 0.0) + { + warning(_("invalid clock frequency")); + } + else + { + DEBUG(_("MCLK : %.2lf MHz.\n"), MCLK_frequency); + DEBUG(_("VCLK : %.2lf MHz.\n"), VCLK_frequency); + + /* Check that the JTAG interface (which opens the GPIO driver) is open. */ + arc_jtag_ops.check_open(); + + set_PLL_clocks(MCLK_frequency, VCLK_frequency); + check_PLL_clock_frequencies(); + print_clock_settings(FALSE, TRUE); + + /* Reset the JTAG Test Access Port Controller. */ + arc_jtag_ops.reset(); + } +} + + +/* Command: gclk = + gclk = + gclks = , { } + harvard + + Set the source of one or more global clocks. */ + +static void +arc_set_clock_source (char *args, int from_tty) +{ + Boolean invalid = FALSE; + + if (args) + { + int result; + char *value; + + /* Check that the JTAG interface (which opens the GPIO driver) is open. */ + arc_jtag_ops.check_open(); + + result = name_value_pair(args, &value); + + if (result == 1) + { + if (strcasecmp(args, "harvard") == 0) + harvard = TRUE; + else + invalid = TRUE; + } + else if (result == 2) + { + char *key = args; + + DEBUG("key = %s, value = %s\n", key, value); + + if (strncasecmp(key, "gclk", 4) == 0) + { + size_t keylength = strlen(key); + + if (keylength == 4) + set_global_clock(3, value); + else if (keylength == 5) + { + if (key[4] == 's' || key[4] == 'S') + { + GlobalClockId clockId = 0; + char *clockData = strtok(value, " ,"); + + do + { + if (clockId == NUM_GLOBAL_CLOCKS) + { + warning(_("too many clock sources specified")); + return; + } + + set_global_clock(clockId++, clockData); + clockData = strtok(NULL, " ,"); + } while (clockData != NULL); + } + else if ('0' <= key[4] && key[4] < '0' + (char) NUM_GLOBAL_CLOCKS) + { + DEBUG("gclkN found\n"); + set_global_clock((GlobalClockId) (key[4] - (char) '0'), value); + } + else + { + warning(_("'%c' is not a valid clock number"), key[4]); + return; + } + } + else + invalid = TRUE; + } + else + invalid = TRUE; + } + else + invalid = TRUE; + } + else + invalid = TRUE; + + if (invalid) + printf_filtered (_(ARC_SET_CLOCK_SOURCE_COMMAND_USAGE)); + else + program_clock_settings(_("Attempting to set clocks."), FALSE); +} + + +/* Command: + + Show the current clock settings. */ + +static void +arc_print_clock_settings (char *args, int from_tty) +{ + if (args) + { + printf_filtered (_(ARC_CLOCK_SETTINGS_COMMAND_USAGE)); + return; + } + + /* Check that the JTAG interface (which opens the GPIO driver) is open. */ + arc_jtag_ops.check_open(); + + print_clock_settings(TRUE, FALSE); +} + + +/* Command: + + Show the current target board FPGA status. */ + +static void +arc_check_FPGA_configuration (char *args, int from_tty) +{ + if (args) + { + printf_filtered (_(ARC_FPGA_COMMAND_USAGE)); + return; + } + + switch (arc_is_FPGA_configured()) + { + case INACCESSIBLE: + break; + case CONFIGURED: + printf_filtered(_("FPGA is configured.\n")); + break; + case UNCONFIGURED: + printf_filtered(_("FPGA is not configured.\n")); + break; + } +} + + +/* -------------------------------------------------------------------------- */ +/* externally visible functions */ +/* -------------------------------------------------------------------------- */ + +/* Blast the target board FPGA. */ + +void +arc_blast_board (char *args, int from_tty) +{ + (void) blast_board(args, from_tty); +} + + +/* Reset the target board. */ + +void +arc_reset_board (void) +{ + /* Toggle the SS1 line - this should do a soft reset. */ + + write_control_port(SS1 | SS0 | CNT, 0); + write_control_port( SS0 | CNT, 200); /* TBH 18 JUN 2003 delay needed by slower simulations. */ + write_control_port(SS1 | SS0 | CNT, 0); + + /* Reset the PLL clocks and the global clock sources - this should be done + by the soft reset, but that does not appear to happen! */ + reset_clock_configuration(); + + (void) set_PLL_clock_frequency(PLL_MCLK, MCLK_RESET_FREQUENCY, FALSE, FALSE); + (void) set_PLL_clock_frequency(PLL_VCLK, VCLK_RESET_FREQUENCY, FALSE, FALSE); + + configure_CPLD(); +} + + +/* Check whether the FPGA has been configured (i.e. blasted with an XBF). */ + +FPGA_Status +arc_is_FPGA_configured (void) +{ + FPGA_Status result; + + ENTERMSG; + + /* Try to open the JTAG interface (which opens the GPIO driver). */ + if (arc_jtag_ops.open(arc_aux_find_register_number("MEMSUBSYS", ARC_HW_MEMSUBSYS_REGNUM))) + { + /* Get the current state of the control register. */ + Byte origCTRL = gpio_read(CONTROL_PORT) ^ C_XOR; + Byte newCTRL; + Byte status; + + /* If SS0 is low, bring this high first (to protect against reset). */ + if (SS0 != (origCTRL & SS0)) + { + /* Output new control state. */ + newCTRL = (origCTRL | SS0); + write_control_port(newCTRL, 1); + } + + /* Ensure that SS0 is high, and SS1 and CNT are low. */ + newCTRL = (origCTRL | SS0) & 0xF5; // 11110101 + newCTRL = newCTRL | BI; + write_control_port(newCTRL, 1); + + /* Read the OP input. */ + status = read_status_port(); + + /* If SS1 was originally high then bring high now (to protect against reset). */ + if (SS1 == (origCTRL & SS1)) + { + /* Output new control state (Gray code transition). */ + newCTRL = (origCTRL | SS1); + write_control_port(newCTRL, 1); + } + + /* Restore the control register. */ + write_control_port(origCTRL, 1); + + /* Reset the JTAG Test Access Port Controller. */ + arc_jtag_ops.reset(); + + result = IS_SET(FPA_CFG_DONE, status) ? CONFIGURED : UNCONFIGURED; + } + else + result = INACCESSIBLE; + + LEAVEMSG; + return result; +} + + +/* Initialize the module. This function is called from the gdb core on start-up. */ + +void +_initialize_arc_board (void) +{ + struct cmd_list_element* c; + + /* Reset the configuration info to its default state. */ + reset_clock_configuration(); + + /* Add support for blasting an FPGA board (ARCangel). */ + c = add_cmd (ARC_BLAST_BOARD_COMMAND, + class_obscure, + arc_blast_board_FPGA, + _("Blast the ARC board FPGA.\n" + ARC_BLAST_BOARD_COMMAND_USAGE + " is the filepath of an XBF (eXtended Binary Format) file.\n"), + &cmdlist); + set_cmd_completer (c, filename_completer); + + /* Add support for setting the CPU clock frequency. */ + (void) add_cmd (ARC_SET_CLOCK_FREQUENCY_COMMAND, + class_obscure, + arc_set_clock_frequency, + _("Set the PLL frequency on the ARC board.\n" + ARC_SET_CLOCK_FREQUENCY_COMMAND_USAGE + " is 'mclk' or 'vclk'; if omitted, and only one frequency is given, it defaults to 'mclk'.\n" + " is a number (interpreted as MegaHertz).\n"), + &cmdlist); + + /* Add support for setting the CPU clock sources. */ + (void) add_cmd (ARC_SET_CLOCK_SOURCE_COMMAND, + class_obscure, + arc_set_clock_source, + _("Set the clock sources on the ARC board.\n" + ARC_SET_CLOCK_SOURCE_COMMAND_USAGE + "N is in the range 0 .. 3; if omitted, it defaults to 3.\n" + " is 'crystal', 'dips', 'highimp', 'host', 'mclk', 'vclk' or a number (interpreted as MegaHertz). \n"), + &cmdlist); + + /* Add support for showing the clock settings. */ + (void) add_cmd (ARC_CLOCK_SETTINGS_COMMAND, + class_info, + arc_print_clock_settings, + _("Show the clock settings on the ARC board.\n" + ARC_CLOCK_SETTINGS_COMMAND_USAGE), + &infolist); + + /* Add support for checking whether the FPGA board has been configured. */ + (void) add_cmd (ARC_FPGA_COMMAND, + class_info, + arc_check_FPGA_configuration, + _("Check ARC board FPGA configuration.\n" + ARC_FPGA_COMMAND_USAGE), + &infolist); +} + +/******************************************************************************/ diff --git a/gdb/arc-board.h b/gdb/arc-board.h new file mode 100644 index 0000000..3683b5b --- /dev/null +++ b/gdb/arc-board.h @@ -0,0 +1,65 @@ +/* Target dependent code for ARC processor family, for GDB, the GNU debugger. + + Copyright 2008, 2009 Free Software Foundation, Inc. + + Contributed by ARC International (www.arc.com) + + Authors: + Phil Barnard + Richard Stuckey + + This file is part of GDB. + + 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 3 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, see . */ + +/******************************************************************************/ +/* */ +/* Outline: */ +/* This header file defines operations for controlling an ARC target */ +/* board. */ +/* */ +/* These operations are: */ +/* 1) configuring ("blasting") an FPGA target with the contents of an */ +/* XBF file; */ +/* 2) checking whether a target has been so configured; and */ +/* 3) setting the clock frequency of the target. */ +/* */ +/* Notes: */ +/* The arc_blast_board function implements an ARC-specific command; hence */ +/* its 'args' parameter contains data entered by the debugger user, which */ +/* must be checked for validity. */ +/* */ +/******************************************************************************/ + +#ifndef ARC_BOARD_H +#define ARC_BOARD_H + + +typedef enum +{ + INACCESSIBLE, + CONFIGURED, + UNCONFIGURED +} FPGA_Status; + + +void arc_blast_board (char *args, int from_tty); + +void arc_reset_board (void); + +FPGA_Status arc_is_FPGA_configured (void); + + +#endif /* ARC_BOARD_H */ +/******************************************************************************/ diff --git a/gdb/arc-dummy-gpio.c b/gdb/arc-dummy-gpio.c new file mode 100644 index 0000000..8297408 --- /dev/null +++ b/gdb/arc-dummy-gpio.c @@ -0,0 +1,94 @@ +/* Target dependent code for ARC processor family, for GDB, the GNU debugger. + + Copyright 2008, 2009 Free Software Foundation, Inc. + + Contributed by ARC International (www.arc.com) + + Authors: + Richard Stuckey + + This file is part of GDB. + + 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 3 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, see . */ + +/******************************************************************************/ +/* */ +/* Outline: */ +/* This module implements a dummy set of operations for reading data from */ +/* / writing data to a parallel port using a GPIO (General Purpose Input/ */ +/* Output) driver. */ +/* */ +/* It is useful for testing when no hardware target is available. */ +/* */ +/******************************************************************************/ + +#include "arc-gpio.h" + + +/* -------------------------------------------------------------------------- */ +/* externally visible data */ +/* -------------------------------------------------------------------------- */ + +/* This is set to TRUE if an I/O error occurs in accessing the port. + (This never happens in this dummy module). */ +Boolean gpio_port_error; + + +/* -------------------------------------------------------------------------- */ +/* externally visible functions */ +/* -------------------------------------------------------------------------- */ + +/* Initialization of the GPIO interface. */ + +Boolean +gpio_open (void) +{ + gpio_port_error = FALSE; + return TRUE; +} + + +/* Close the GPIO interface. */ + +void +gpio_close (void) +{ +} + + +/* Write a byte of data to the given port. */ + +void +gpio_write (ParallelPort port, Byte data) +{ +} + + +/* Read a byte of data from the given port. */ + +Byte +gpio_read (ParallelPort port) +{ + return 0; +} + + +/* Write a series of bytes of data to the ports. */ + +void +gpio_write_array (GPIO_Pair array[], unsigned int num_elements) +{ +} + +/******************************************************************************/ diff --git a/gdb/arc-dummy-jtag-ops.c b/gdb/arc-dummy-jtag-ops.c new file mode 100644 index 0000000..257330b --- /dev/null +++ b/gdb/arc-dummy-jtag-ops.c @@ -0,0 +1,274 @@ +/* Target dependent code for ARC processor family, for GDB, the GNU debugger. + + Copyright 2008, 2009 Free Software Foundation, Inc. + + Contributed by ARC International (www.arc.com) + + Author: + Richard Stuckey + + This file is part of GDB. + + 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 3 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, see . */ + +/******************************************************************************/ +/* */ +/* Outline: */ +/* This module implements a dummy set of operations for debug access to */ +/* an ARC processor via its JTAG interface. */ +/* */ +/* It is useful for testing when no hardware target is available. */ +/* */ +/******************************************************************************/ + +/* system header files */ +#include + +/* ARC header files */ +#include "arc-jtag-ops.h" +#include "arc-registers.h" + + +/* -------------------------------------------------------------------------- */ +/* local data */ +/* -------------------------------------------------------------------------- */ + +#define AMV1_REG (ARC_HW_AMV0_REGNUM + 3) + + +/* The number of actionpoints supported by the target. Set this to different + values (2, 4 or 8) when testing. */ +static unsigned int num_actionpoints = 8; + + +/* -------------------------------------------------------------------------- */ +/* externally visible data */ +/* -------------------------------------------------------------------------- */ + +JTAG_Operations arc_jtag_ops; + + +/* -------------------------------------------------------------------------- */ +/* main operations */ +/* -------------------------------------------------------------------------- */ + +/* These are the functions that are called from outside this module via the + pointers in the arc_jtag_ops global object. + + N.B. none of these functions are called from within this module. */ + + +/* Read a processor core register. */ + +static JTAG_OperationStatus +jtag_read_core_reg (ARC_RegisterNumber regnum, ARC_RegisterContents *contents) +{ + return JTAG_SUCCESS; +} + + +/* Write a processor core register. */ + +static JTAG_OperationStatus +jtag_write_core_reg (ARC_RegisterNumber regnum, ARC_RegisterContents contents) +{ + return JTAG_SUCCESS; +} + + +/* Read a processor auxiliary register. */ + +static JTAG_OperationStatus +jtag_read_aux_reg (ARC_RegisterNumber regnum, ARC_RegisterContents *contents) +{ + /* Return a "useful" value for some specific registers. */ + + if (regnum == ARC_HW_PC_REGNUM) + *contents = 0x00001008; + else if (regnum == ARC_HW_AP_BUILD_REGNUM) + { + if (num_actionpoints == 2) + *contents = 0x00000004; + else if (num_actionpoints == 4) + *contents = 0x00000104; + else + *contents = 0x00000204; + } + else if (regnum == ARC_HW_DEBUG_REGNUM) + { + /* Fake trigger of AP 1. */ + *contents = DEBUG_ACTIONPOINT_HALT | + (1 << (DEBUG_ACTIONPOINT_STATUS_SHIFT + 1)); + } + else if (regnum == AMV1_REG) + { + *contents = 0x4008; + } + else if (regnum == ARC_HW_IDENTITY_REGNUM) + { + *contents = 0x31; + } + else if (regnum == ARC_HW_STATUS32_REGNUM) + { + *contents = STATUS32_HALT; + } + else + *contents = 0; + +// DEBUG("regnum = %x, contents = 0x%08X", regnum, *contents); + + return JTAG_SUCCESS; +} + + +/* Write a processor auxiliary register. */ + +static JTAG_OperationStatus +jtag_write_aux_reg (ARC_RegisterNumber regnum, ARC_RegisterContents contents) +{ +// printf(_("AUX: regnum = %d, contents = 0x%08X\n"), regnum, contents); + return JTAG_SUCCESS; +} + + +/* Read a word of data from memory; the given address must be word-aligned. + Returns number of bytes read. */ + +static unsigned int +jtag_read_word (ARC_Address addr, ARC_Word *data) +{ + *data = 0; + return BYTES_IN_WORD; +} + + +/* Write a word of data to memory; the given address must be word-aligned. + Returns number of bytes written. */ + +static unsigned int +jtag_write_word (ARC_Address addr, ARC_Word data) +{ + return BYTES_IN_WORD; +} + + +/* Read a number of words of data from target memory starting at the given address. + Returns number of bytes read. */ + +static unsigned int +jtag_read_chunk (ARC_Address addr, ARC_Byte *data, unsigned int words) +{ + return words * BYTES_IN_WORD; +} + + +/* Write a number of words of data to target memory starting at the given address. + Returns number of bytes written. */ + +static unsigned int +jtag_write_chunk (ARC_Address addr, ARC_Byte *data, unsigned int words) +{ + return words * BYTES_IN_WORD; +} + + +/* Write a number of copies of a word-sized pattern of data to memory starting + at the given address. + Returns number of bytes written. */ + +static unsigned int +jtag_write_pattern (ARC_Address addr, ARC_Word pattern, unsigned int words) +{ + return words * BYTES_IN_WORD; +} + + +/* Open the JTAG interface. + Returns TRUE for success. */ + +static Boolean +jtag_open (void) +{ + arc_jtag_ops.status = JTAG_OPENED; + return TRUE; +} + + +/* Close the JTAG interface. */ + +static void +jtag_close (void) +{ + arc_jtag_ops.status = JTAG_CLOSED; +} + + +/* Reset the target JTAG controller. */ + +static void +jtag_reset (void) +{ +} + + +/* Reset the target board. */ + +static void +jtag_reset_board (void) +{ +} + + +/* Check that the JTAG interface is open. + If it is closed, 'error' is called. */ + +static void +jtag_check_open (void) +{ + if (arc_jtag_ops.status == JTAG_CLOSED) + error(_("JTAG connection is closed. " + "Use command 'target " ARC_TARGET_NAME "' first.")); +} + + +/* -------------------------------------------------------------------------- */ +/* externally visible functions */ +/* -------------------------------------------------------------------------- */ + +/* Initialize the module. This function is called from the gdb core on start-up. */ + +void +_initialize_arc_jtag_ops (void) +{ + arc_jtag_ops.status = JTAG_CLOSED; + arc_jtag_ops.state_machine_debug = FALSE; + arc_jtag_ops.retry_count = 50; + + arc_jtag_ops.open = jtag_open; + arc_jtag_ops.close = jtag_close; + arc_jtag_ops.check_open = jtag_check_open; + arc_jtag_ops.reset_board = jtag_reset_board; + arc_jtag_ops.reset = jtag_reset; + arc_jtag_ops.memory_read_word = jtag_read_word; + arc_jtag_ops.memory_write_word = jtag_write_word; + arc_jtag_ops.memory_read_chunk = jtag_read_chunk; + arc_jtag_ops.memory_write_chunk = jtag_write_chunk; + arc_jtag_ops.memory_write_pattern = jtag_write_pattern; + arc_jtag_ops.read_aux_reg = jtag_read_aux_reg; + arc_jtag_ops.write_aux_reg = jtag_write_aux_reg; + arc_jtag_ops.read_core_reg = jtag_read_core_reg; + arc_jtag_ops.write_core_reg = jtag_write_core_reg; +} + +/******************************************************************************/ diff --git a/gdb/arc-elf32-tdep.c b/gdb/arc-elf32-tdep.c new file mode 100755 index 0000000..2c7de60 --- /dev/null +++ b/gdb/arc-elf32-tdep.c @@ -0,0 +1,2064 @@ +/* Target dependent code for ARC processor family, for GDB, the GNU debugger. + + Copyright 2005, 2008, 2009 Free Software Foundation, Inc. + + Contributed by Codito Technologies Pvt. Ltd. (www.codito.com) + + Authors: + Soam Vasani + Ramana Radhakrishnan + Richard Stuckey + + This file is part of GDB. + + 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 3 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, see . */ + +/******************************************************************************/ +/* */ +/* Outline: */ +/* This module provides support for the ARC processor family's target */ +/* dependencies which are specific to the arc-elf32 configuration of the */ +/* ARC gdb. */ +/* */ +/* */ +/* Functionality: */ +/* This module provides a number of operations: */ +/* */ +/* 1) a function which returns the name of a register, given its number */ +/* */ +/* 2) a function which determines whether a given register belongs to a */ +/* particular group (e.g. the group of registers which should be saved */ +/* and restored across a function call) */ +/* */ +/* 3) a function which prints out registers */ +/* */ +/* 4) functions which implement the gdb extended commands */ +/* */ +/* arc-watch-range [] for setting a watchpoint range */ +/* arc-break-range for setting a breakpoint range */ +/* arc-fill-memory [] for filling memory */ +/* */ +/* 5) functions for various operations (such as program loading) which */ +/* are common to the different arc-elf32 targets supported */ +/* */ +/* */ +/* Usage: */ +/* The module exports a function _initialize_arc_elf32_tdep: the call to */ +/* this function is generated by the gdb build mechanism, so this function*/ +/* should not be explicitly called. */ +/* */ +/* This module exports a function arc_elf32_initialize which creates the */ +/* user commands which use those command-implementing functions; it also */ +/* stores pointers to the other functions in a data structure so that */ +/* they may be called from outside this module. */ +/* */ +/* Some of the operations provided by this module are registered with gdb */ +/* during initialization; gdb then calls them via function pointers, */ +/* rather than by name (this allows gdb to handle multiple target */ +/* architectures): */ +/* */ +/* set_gdbarch_XXX (gdbarch, ); */ +/* */ +/* */ +/* Register Numbering Scheme: */ +/* The N target processor registers are assigned gdb numbers which form a */ +/* contiguous range starting at 0. The scheme used is: */ +/* */ +/* 0 .. n1 : core registers R0 .. R31 */ +/* n1+1 .. n2 : extension core registers R32 .. R59 (if any) */ +/* n2+1 : r60 (LP_COUNT) */ +/* n2+2 : r63 (PCL) */ +/* n2+3 : IDENTITY auxiliary register */ +/* n2+4 .. n3 : non-BCR auxiliary registers in address order */ +/* n3+1 .. N-1 : Build Configuration Registers in address order */ +/* */ +/* N.B. 1) core registers R61 and R62 are not included in the scheme, as */ +/* R61 is reserved, and R62 is not a real register; */ +/* */ +/* 2) the set of non-BCR auxiliary registers, and the set of BCRs, */ +/* are each ordered by increasing register address in the ARC */ +/* auxiliary register space; */ +/* */ +/* 3) the IDENTITY auxiliary register comes before all the other */ +/* auxiliary registers, even though it does not come first in the */ +/* address space: this is so that the debugger can always get the */ +/* contents of the register, and so determine the architectural */ +/* version of the target processor, regardless of what that */ +/* version may be (and hence what the processor's auxiliary */ +/* register set is) - this is vital when the debug target is a */ +/* remote target, as the position of the register contents in the */ +/* 'g' RSP response packet (or the number to be specified in the */ +/* 'p' query packet) depends upon the target processor version; */ +/* otherwise, we would have the problem that the debugger could */ +/* not determine the target processor version without already */ +/* knowing it! */ +/* */ +/* The numbers are assigned to the registers by the arc-registers module, */ +/* after the XML definitions of the auxiliary registers and any extension */ +/* core registers defined for the target processor have been read and */ +/* processed. */ +/* */ +/* */ +/* Auxiliary Registers Definition: */ +/* The ARC processor is configurable, and the set of auxiliary registers */ +/* that a target processor may possess depends upon the configuration. It */ +/* is therefore not possible to hard-code descriptions of this register */ +/* set into the debugger. Instead, the descriptions of the registers are */ +/* read from an XML file (or files). */ +/* */ +/* The arc-elf32-gdb debugger provides commands which allow the user to */ +/* instruct it to read an XML file and use the register definitions in */ +/* that file; these definitions either completely replace, or are added */ +/* to (depending upon which command is used), any existing set of */ +/* definitions the debugger has; this allows processor architecture */ +/* variants to be described by groups of files (e.g. a common main file */ +/* describing the base configuration, plus additional files describing */ +/* cache-related registers, or MMU-related registers, which are specific */ +/* to different variants). */ +/* */ +/* Note that this scheme may also be used to define the set of extension */ +/* core registers (if any) possessed by the target processor. */ +/* */ +/* If no register set is defined by use of the commands, the debugger */ +/* attempts to read the register definitions from a default file; it will */ +/* look for this file first in the user's current working directory, then */ +/* in the user's home directory. In order to provide maximum flexibility, */ +/* the debugger delays the attempt to read the default file until it is */ +/* necessary, e.g. when connection to a target is being attempted, or a */ +/* check is made that the executable file to be debugged has been built */ +/* for the same architectural version (e.g. ARC600, ARC700, etc.) as the */ +/* version of the target processor. */ +/* */ +/* The arc-elf32 specific code makes as few assumptions as possible about */ +/* the auxiliary register set: it will always try to get the number (i.e. */ +/* the hardware number, the offset in the auxiliary register space) of an */ +/* auxiliary register from the definition of that register, even in the */ +/* case that the register is defined in the base ARC architecture, and */ +/* hence should be present in all processor variants. */ +/* */ +/* In particular, no assumption is made about the PC; so, to guarantee */ +/* that the debugger has read a definition of the PC by the time that it */ +/* is needed (as the complete set of auxiliary register definitions may */ +/* be read from a number of files, there is no requirement for the PC's */ +/* definition to be in any given file), a "guard" is set upon the PC such */ +/* that any attempt to read/write the PC by gdb will result in a check */ +/* that the PC is defined: if the PC is defined, the guard is removed, */ +/* and the read/write operation performed - otherwise, an error message */ +/* is reported, and the operation aborted. */ +/* */ +/* Register Byte Order: */ +/* The target register contents are held in gdb's register cache (i.e. in */ +/* a regcache struct) in target byte order; however, when values are */ +/* read/written to/from the xISS target (i.e. the dynamically loaded xISS */ +/* simulator) or the ARCangel4 target those values must be in host byte */ +/* order. */ +/* */ +/* The ARC debugger is currently built only to run on an X86 Linux host, */ +/* so the assumption is made that the host is little-endian. */ +/* */ +/******************************************************************************/ + +/* system header files */ +#include +#include +#include + +/* gdb header files */ +#include "defs.h" +#include "inferior.h" +#include "gdbcore.h" +#include "gdbcmd.h" +#include "regcache.h" +#include "exceptions.h" +#include "reggroups.h" +#include "observer.h" +#include "objfiles.h" +#include "arch-utils.h" +#include "gdb-events.h" +#include "gdb_assert.h" + +/* ARC header files */ +#include "config/arc/tm-embed.h" +#include "arc-tdep.h" +#include "arc-memory.h" +#include "arc-arguments.h" +#include "arc-elf32-tdep.h" +#include "arc-registers.h" +#include "arc-remote-fileio.h" + + +/* -------------------------------------------------------------------------- */ +/* local types */ +/* -------------------------------------------------------------------------- */ + +typedef struct +{ + struct gdbarch *gdbarch; + struct ui_file *file; + struct frame_info *frame; +} PrintData; + + +/* -------------------------------------------------------------------------- */ +/* local data */ +/* -------------------------------------------------------------------------- */ + +#define INVALID_REGISTER_NUMBER (ARC_RegisterNumber) 0xFFFFFFFFU + +#define WATCH_MEMORY_COMMAND "arc-watch-range" +#define BREAK_MEMORY_COMMAND "arc-break-range" +#define FILL_MEMORY_COMMAND "arc-fill-memory" + +#define WATCH_MEMORY_COMMAND_USAGE "Usage: " WATCH_MEMORY_COMMAND " [ read | write | access ]\n" +#define BREAK_MEMORY_COMMAND_USAGE "Usage: " BREAK_MEMORY_COMMAND " \n" +#define FILL_MEMORY_COMMAND_USAGE "Usage: " FILL_MEMORY_COMMAND " [ ]\n" + + + +/* ARC 700 brk_s instruction. */ +static const unsigned char le_breakpoint_instruction[] = { 0xff, 0x7f }; +static const unsigned char be_breakpoint_instruction[] = { 0x7f, 0xff }; + + +/* N.B. the array size is specified in the declaration so that the compiler + will warn of "excess elements in array initializer" if there is a + mismatch (but not of too few elements, unfortunately!). */ +static const char *register_names[ARC_MAX_CORE_REGS] = +{ + "r0", "r1", "r2", "r3", "r4", "r5", "r6", + "r7", "r8", "r9", "r10", "r11", "r12", "r13", + "r14", "r15", "r16", "r17", "r18", "r19", "r20", + "r21", "r22", "r23", "r24", "r25", "r26", + + "fp", // r27 + "sp", // r28 + "ilink1", // r29 + "ilink2", // r30 + "blink", // r31 + + /* Extension core registers are 32 .. 59 inclusive. */ + "r32", "r33", "r34", "r35", "r36", "r37", "r38", "r39", + "r40", "r41", "r42", "r43", "r44", "r45", "r46", "r47", "r48", "r49", + "r50", "r51", "r52", "r53", "r54", "r55", "r56", "r57", "r58", "r59", + + "lp_count", + + /* 61 is reserved, 62 is not a real register. */ + "r61", + "r62", + + "pcl" +}; + + +/* For the Ctrl-C signal handler. */ +static void (*old_signal_handler) (int); + +/* This flag is used by the Ctrl-C interrupt mechanism: it is set by an + interrupt handler and tested by non-interrupt code, so must be declared + as volatile to avoid possible optimisation problems. */ +static volatile Boolean interrupt_processor; + +/* A pointer to the remote target's register store function. */ +static void (*remote_register_store)(struct regcache *regcache, int regno); + + +/* -------------------------------------------------------------------------- */ +/* externally visible data */ +/* -------------------------------------------------------------------------- */ + +/* These are the h/w register numbers of the DEBUG, PC and STATUS32 registers. */ +ARC_RegisterNumber arc_debug_regnum; +ARC_RegisterNumber arc_pc_regnum; +ARC_RegisterNumber arc_status32_regnum; + +/* Whether a program has been loaded to the target. */ +Boolean arc_program_is_loaded; + +/* Whether a target is connected. */ +Boolean arc_target_is_connected; + + +/* -------------------------------------------------------------------------- */ +/* local macros */ +/* -------------------------------------------------------------------------- */ + +#define PRINT(regnum) \ + default_print_registers_info (gdbarch, file, frame, regnum, all) + +#define PRINT_HW(hw_regnum) PRINT(arc_core_register_gdb_number(hw_regnum)) + +#define PRINT_BY_NAME(regname) \ +{ \ + ARC_AuxRegisterDefinition *def = arc_find_aux_register_by_name(regname); \ + \ + if (def) \ + PRINT(arc_aux_gdb_register_number(def)); \ +} while (0) + + +#define EXTRACT(argument, type, result) \ +{ \ + struct expression *expr = parse_expression(argument); \ + struct value *val = evaluate_expression(expr); \ + struct cleanup *chain = make_cleanup(free_current_contents, &expr); \ + \ + result = *(type*) (value_contents (val)); \ + do_cleanups (chain); \ +} + + +/* -------------------------------------------------------------------------- */ +/* local functions */ +/* -------------------------------------------------------------------------- */ + +/* This function creates the processor-specific information for the arc-elf32-gdb + variant of the the ARC gdb deubbger. */ + +static void +create_variant_info (struct gdbarch_tdep *tdep) +{ + tdep->processor_variant_info = xmalloc(sizeof(ARC_VariantsInfo)); + tdep->processor_variant_info->processor_version = NO_ARCHITECTURE; + + arc_initialize_aux_reg_info(&tdep->processor_variant_info->registers); +} + + +/* This function is used to read an auxiliary register on the target. */ + +static Boolean +read_target_aux_register (ARC_RegisterNumber hw_regno, + ARC_RegisterContents *contents, + Boolean warn_on_failure) +{ + struct regcache *regcache = get_current_regcache(); + ARC_AuxRegisterDefinition *def = arc_find_aux_register_by_hw_number(hw_regno); + int gdb_regno = arc_aux_gdb_register_number(def); + + /* Read the register contents from the target to the register cache, + then collect the register value from the cache. */ + target_fetch_registers(regcache, gdb_regno); + regcache_raw_collect (regcache, gdb_regno, contents); + + /* The register cache holds the contents in target byte order, so convert to + host byte order if the target and host orders are different. */ + if (HOST_AND_TARGET_ENDIANNESS_DIFFER(current_gdbarch)) + *contents = __bswap_32(*contents); + + /* Unfortunately, we can not tell whether the read succeeded or failed. */ + return TRUE; +} + + +/* This function returns a pointer to a function which may be used to read an + auxiliary register on the target. The register contents returned by that + function are in host byte order. */ + +static ReadRegisterFunction +read_aux_register (struct target_ops *target) +{ + /* If we have a function which can read an aux register on the target, + and return a success/failure result, use it instead. */ + if ((strcmp(target->to_shortname, "arcxiss") == 0) || + (strcmp(target->to_shortname, "arcjtag") == 0)) + { + TargetOperations *operations = (TargetOperations*) target->to_data; + return operations->read_auxiliary_register; + } + + return read_target_aux_register; +} + + +/* Convert the contents of the given register in the given cache so that it can + be written to the target (i.e. if there are any fields in the register which + are required by the ARC processor architectural definition to have particular + values on write, set those fields to those values). */ + +static void convert_register(int gdb_regno, + struct regcache *regcache) +{ + ARC_RegisterContents contents; + + regcache_raw_collect (regcache, gdb_regno, &contents); + arc_convert_aux_contents_for_write (gdb_regno, &contents); + regcache_raw_supply (regcache, gdb_regno, &contents); +} + + +/* This function is called when a remote target calls its 'to_store_registers' + operation: we intercept that call, and convert the register contents as + required, before calling the real operation. */ + +static void +intercept_remote_register_store (struct regcache *regcache, int gdb_regno) +{ + struct gdbarch *gdbarch = get_regcache_arch(regcache); + struct regcache *savedcache = regcache_xmalloc(gdbarch); + + ENTERARGS("gdb_regno: %d", gdb_regno); + + /* Save the register cache. */ + regcache_cpy(savedcache, regcache); + + /* Convert the value of the register(s) for writing. */ + if (gdb_regno >= 0) + convert_register(gdb_regno, regcache); + else + { + int num_regs = gdbarch_num_regs (gdbarch); + + for (gdb_regno = 0; gdb_regno < num_regs; gdb_regno++) + convert_register(gdb_regno, regcache); + } + + /* Now use the real remote target 'store registers' operation to store the + converted cache. */ + remote_register_store(regcache, gdb_regno); + + /* Restore the register cache. */ + regcache_cpy(regcache, savedcache); + regcache_xfree(savedcache); +} + + +/* This is a callback function which gets called by gdb whenever the current + object file changes. */ + +static void +new_object_file (struct objfile *objfile) +{ + if (objfile) + ARCHITECTURE_CHECK(current_gdbarch, objfile->obfd); +} + + +/* This is a callback function which gets called by gdb just before connection + * to a target is attempted. */ + +static void +pre_target_connection (struct target_ops *target) +{ + DEBUG("pre_target_connect : %s\n", target->to_shortname); + + /* We do not yet know the version of the target processor. */ + arc_architecture_is_unknown(); + + /* If we have not read yet any aux register definitions for this architecture, + * try to read the default file now. */ + if (!arc_aux_regs_defined(current_gdbarch)) + arc_read_default_aux_registers(current_gdbarch); +} + + +/* This is a callback function which gets called by gdb just after connection + to a target is completed. */ + +static void +post_target_connection (struct target_ops *target) +{ + DEBUG("post_target_connect : %s\n", target->to_shortname); + + arc_target_is_connected = TRUE; + + arc_update_architecture(read_aux_register(target)); + + ARCHITECTURE_CHECK(current_gdbarch, + (current_objfile) ? current_objfile->obfd : NULL); +} + + +/* This is a callback function which gets called by gdb just after disconnection + from a target has been completed. */ + +static void +post_target_disconnection (struct target_ops *target) +{ + DEBUG("post_target_disconnect : %s\n", target->to_shortname); + + arc_target_is_connected = FALSE; +} + + +/* This is a callback function which gets called by gdb after a target has been updated. */ + +static void +target_updated (struct target_ops *target) +{ + DEBUG("target_updated : %s\n", target->to_shortname); + + if (strcmp(target->to_shortname, "remote") == 0) + { + DEBUG("remote target register store interception is in force\n"); + + /* We must intercept the remote target's register store operation: we + need to convert register contents before they are written to the + target (we can not do that in remote.c as that is generic gdb code). */ + if (target->to_store_registers != intercept_remote_register_store) + { + remote_register_store = target->to_store_registers; + target->to_store_registers = intercept_remote_register_store; + } + } +} + + +/* -------------------------------------------------------------------------- */ +/* 1) local functions for handling Ctrl-C */ +/* -------------------------------------------------------------------------- */ + +/* The command line interface's stop routines. The interrupted_by_user function + is installed as a signal handler for SIGINT (it gets called when the user + types Ctrl-C). + + The first time a user requests a stop, we set the interrupt_processor flag. + If this does not work, and the user tries a second time, we ask the user if + he'd like to detach from the target. */ + + +static void +interrupted_twice (int signo); + + +/* This function is called when the user types Ctrl-C. */ + +static void +interrupted_by_user (int signo) +{ + /* Change the signal handler for Ctrl-C to the second level handler so that + if we get the signal again whilst waiting for the program to halt, we do + something more drastic. */ + (void) signal (SIGINT, interrupted_twice); + + /* This flag is checked in each iteration of the loop that polls the target + processor to see whether it has halted (e.g. at a breakpoint); if the + flag is set, an attempt will be made to force the processor to halt. + + N.B. once the polling loop is running, this flag is set only by this + handler, and is read only by the polling loop - so there is no + mutual exclusion problem to be worried about here; this is a MUCH + cleaner and more reliable method than trying to have this handler + force the halt itself, e.g. by calling target_stop. */ + interrupt_processor = TRUE; + + DEBUG("Attempting to interrupt...\n"); +} + + +/* This function is called when the user types Ctrl-C twice. */ + +static void +interrupted_twice (int signo) +{ + if (query(_("Interrupted while waiting for the program to halt.\n" + "Give up (and stop debugging it)?"))) + { + struct gdb_exception exception = {RETURN_QUIT, + GDB_NO_ERROR, + _("Interrupted by user")}; + + /* Put the old signal handler back. */ + (void) signal (signo, old_signal_handler); + + target_mourn_inferior(); + DEBUG("interrupted_twice: throwing exception\n"); + throw_exception (exception); + + /* Control does not return here! */ + } + + /* Change the signal handler for Ctrl-C back to the first level handler. */ + (void) signal (SIGINT, interrupted_by_user); +} + + +/* -------------------------------------------------------------------------- */ +/* 2) functions for reading/writing registers */ +/* -------------------------------------------------------------------------- */ + +/* This function maps a gdb internal register number to the hardware number + (i.e. core register number or number in the auxiliary register space). */ + +static ARC_RegisterNumber +get_hw_regnum_mapping (int gdb_regno) +{ + ARC_AuxRegisterDefinition *def; + + if (arc_is_core_register(gdb_regno)) + return arc_core_register_number(gdb_regno); + + def = arc_find_aux_register_by_gdb_number(gdb_regno); + + if (def) + return arc_aux_hw_register_number(def); + + /* Not found. */ + return INVALID_REGISTER_NUMBER; +} + + +/* This function fetches one register from the target and saves its contents in + the given register cache. The register is identified both by its gdb number + and its ARC hardware number. */ + +static void +debug_fetch_one_register (struct regcache * regcache, + ARC_RegisterNumber hw_regno, + int gdb_regno) +{ + TargetOperations *operations = (TargetOperations*) current_target.to_data; + ARC_RegisterContents contents; + Boolean register_read = FALSE; + + ENTERARGS("gdb = %d, h/w = %d", gdb_regno, hw_regno); + + gdb_assert(gdb_regno >= 0); + + /* N.B. do not give a warning message if the register is write-only, as gdb + may be reading all registers, and it is best to quietly ignore the + ones that can not be read! */ + if (arc_is_core_register(gdb_regno)) + { + if (arc_core_register_access(hw_regno) != WRITE_ONLY) + register_read = operations->read_core_register(hw_regno, &contents, TRUE); + } + else + { + ARC_AuxRegisterDefinition *def = arc_find_aux_register_by_hw_number(hw_regno); + + if (arc_aux_register_access(def) != WRITE_ONLY) + register_read = operations->read_auxiliary_register (hw_regno, &contents, TRUE); + } + + if (register_read) + { + DEBUG("read 0x%08X from target\n", contents); + + /* The read__register functions return the register contents in + host order, but the register cache holds them in target byte order, + so swap the bytes if necessary before supplying the contents to the + cache. */ + if (HOST_AND_TARGET_ENDIANNESS_DIFFER(get_regcache_arch(regcache))) + { + contents = __bswap_32(contents); + DEBUG("byte-swapped to 0x%08X\n", contents); + } + + regcache_raw_supply (regcache, (int) gdb_regno, &contents); + } + + LEAVEMSG; +} + + +/* This function is passed to the arc_all_aux_registers iterator. + It fetches one auxiliary register from the target. */ + +static void +debug_fetch_reg (ARC_AuxRegisterDefinition *def, void *data) +{ + debug_fetch_one_register((struct regcache*) data, + arc_aux_hw_register_number (def), + arc_aux_gdb_register_number(def)); +} + + +/* This function gets a register from the given register cache and stores it + to the target. The register is identified both by its gdb number and its + ARC hardware number. */ + +static void +debug_store_one_register (struct regcache *regcache, + ARC_RegisterNumber hw_regno, + int gdb_regno) +{ + TargetOperations *operations = (TargetOperations*) current_target.to_data; + ARC_RegisterContents contents; + + ENTERARGS("gdb = %d, h/w = %d", gdb_regno, hw_regno); + + gdb_assert(gdb_regno >= 0); + + regcache_raw_collect(regcache, gdb_regno, &contents); + + DEBUG("collected 0x%08X from cache\n", contents); + + /* The write__register functions take the register contents in + host order, but the register cache holds them in target byte order, + so swap the bytes if necessary after collecting the contents from the + functions. */ + if (HOST_AND_TARGET_ENDIANNESS_DIFFER(get_regcache_arch(regcache))) + { + contents = __bswap_32(contents); + DEBUG("byte-swapped to 0x%08X\n", contents); + } + + if (arc_is_core_register(gdb_regno)) + { + if (arc_core_register_access(hw_regno) == READ_ONLY) + arc_elf32_core_warning(REGISTER_IS_READ_ONLY, hw_regno); + else + (void) operations->write_core_register(hw_regno, contents, TRUE); + } + else + { + ARC_AuxRegisterDefinition *def = arc_find_aux_register_by_hw_number(hw_regno); + + if (arc_aux_register_access(def) == READ_ONLY) + arc_elf32_aux_warning(REGISTER_IS_READ_ONLY, hw_regno); + else + (void) operations->write_auxiliary_register (hw_regno, contents, TRUE); + } + + LEAVEMSG; +} + + +/* This function is passed to the arc_all_aux_registers iterator. + It stores one auxiliary register to the target. */ + +static void +debug_store_reg (ARC_AuxRegisterDefinition *def, void *data) +{ + debug_store_one_register ((struct regcache*) data, + arc_aux_hw_register_number (def), + arc_aux_gdb_register_number(def)); +} + + +/* -------------------------------------------------------------------------- */ +/* 3) functions for reading/writing mmeory */ +/* -------------------------------------------------------------------------- */ + +static unsigned int +read_bytes (ARC_Address address, + ARC_Byte *data, /* May be not word-aligned. */ + unsigned int bytes) +{ + TargetOperations *operations = (TargetOperations*) current_target.to_data; + + return arc_read_memory(operations, address, data, bytes); +} + + +static unsigned int +write_bytes (ARC_Address address, + ARC_Byte *data, /* May be not word-aligned. */ + unsigned int bytes) +{ + TargetOperations *operations = (TargetOperations*) current_target.to_data; + + return arc_write_memory(operations, address, data, bytes); +} + + +static unsigned int +write_pattern (ARC_Address address, + ARC_Word pattern, + unsigned int bytes) +{ + TargetOperations *operations = (TargetOperations*) current_target.to_data; + + return arc_write_pattern(operations, address, 0, bytes); +} + + +static unsigned int +write_zeros (ARC_Address address, + unsigned int bytes) +{ + TargetOperations *operations = (TargetOperations*) current_target.to_data; + + return arc_write_pattern(operations, address, 0, bytes); +} + + +/* -------------------------------------------------------------------------- */ +/* 4) local functions for processor control */ +/* -------------------------------------------------------------------------- */ + +/* This function is called when execution on the target has halted for some + reason (such as a breakpoint trigger). It determines whether the halt should + be reported to gdb, or execution resumed. + + Parameters: + status : a pointer to the target status information + debug : the contents of the target processor DEBUG register + read_core_register : a function which can read a target core register + + Result: TRUE if the halt is to be reported, FALSE if execution is to resume. */ + +static Boolean +report_processor_halt (struct target_waitstatus *status, + ARC_RegisterContents debug, + ReadRegisterFunction read_core_register) +{ + /* Test BH bit of DEBUG register. */ + if (debug & DEBUG_BH) + { + DEBUG("s/w breakpoint instruction was executed\n"); + + /* If the breakpoint is on an intercepted function entrypoint. */ + switch (arc_check_interception_breakpoint(&status->value.integer)) + { + case INTERCEPTION_RESUME: + /* If the user has typed a Ctrl-C since target execution was + last started. */ + if (interrupt_processor) + { + /* The interception is complete, so honour the interrupt + request by making it appear that the target was stopped + by a SIGINT signal; the PC has been set to the return + address of the intercepted function, so it will look to + the user as though the program was interrupted at that + point. */ + status->kind = TARGET_WAITKIND_STOPPED; + status->value.sig = TARGET_SIGNAL_INT; + } + else + { + /* This is the only case in which we return FALSE. */ + return FALSE; + } + break; + + case INTERCEPTION_HALT: + /* Some other breakpoint has triggered. */ + status->kind = TARGET_WAITKIND_STOPPED; + status->value.sig = TARGET_SIGNAL_TRAP; + break; + + case INTERCEPTION_EXIT: + /* The program called the 'exit' routine (its exit status has + been read by the interception mechanism and returned to us in + status->value.integer). */ + status->kind = TARGET_WAITKIND_EXITED; + break; + + case INTERCEPTION_INTERRUPT: + DEBUG("*** interception was interrupted!\n"); + status->kind = TARGET_WAITKIND_STOPPED; + status->value.sig = TARGET_SIGNAL_INT; + break; + } + } + /* Test SH bit of DEBUG register. */ + else if (debug & DEBUG_SH) + { + ARC_RegisterContents exit_code = 0; + + /* If the DEBUG.SH ("self halt") bit is set, we stopped because of the + flag instruction, which is used by programs to exit. */ + status->kind = TARGET_WAITKIND_EXITED; + + /* Get the exit code of the program (held in R0). */ + if (read_core_register(0, &exit_code, TRUE)) + { + DEBUG("exit code = %d\n", exit_code); + } + else + warning(_("assuming exit code = 0")); + + status->value.integer = (int) exit_code; + } + else + { + /* We stopped for some other reason: if the user had tried to interrupt + with a Ctrl-C, return the event as a SIGINT, otherwise as a SIGTRAP + (and let gdb work out what happened). */ + status->kind = TARGET_WAITKIND_STOPPED; + status->value.sig = (interrupt_processor) ? TARGET_SIGNAL_INT + : TARGET_SIGNAL_TRAP; + } + + return TRUE; +} + + +/* Determine whether the given register is a member of the given group. + + Returns 0, 1, or -1: + 0 means the register is not in the group. + 1 means the register is in the group. + -1 means the tdep has nothing to say about this register and group. */ + +static int +register_reggroup_p (int regnum, struct reggroup *group) +{ + gdb_assert(regnum >= 0); + + /* Save/restore: + 1. all standard core regs, except PCL (PCL is not writable) + 2. those extension core regs which are read/write + 3. aux regs LP_START .. LP_END (IDENTITY is not writable) + 4. aux regs PC_REGNUM .. STATUS32_L2 + 5. aux regs ERET .. EFA */ + + if (arc_is_core_register(regnum)) + { + ARC_RegisterNumber hw_num = arc_core_register_number(regnum); + + /* R61 and R62 are reserved; they are not in any reggroup. */ + if (hw_num == 61 || hw_num == 62) + return 0; + + if ((group == save_reggroup || group == restore_reggroup)) + { + if (IS_EXTENSION_CORE_REGISTER(hw_num)) + return (arc_core_register_access(hw_num) == READ_WRITE) ? 1 : 0; + + return (hw_num == ARC_PCL_REGNUM) ? 0 : 1; + } + + if (group == general_reggroup) + return 1; + } + else + { +#define REGISTER_NAME_IS(ident) (strcasecmp(name, ident) == 0) + + ARC_AuxRegisterDefinition *def = arc_find_aux_register_by_gdb_number(regnum); + + if (def) + { + const char *name = arc_aux_register_name(def); + + if (arc_aux_is_unused(def)) + return 0; + + if ((group == save_reggroup || group == restore_reggroup)) + { + if (arc_aux_register_access(def) != READ_WRITE) + return 0; + } + + /* Which regs to save/restore? */ + if ((group == save_reggroup || group == restore_reggroup)) + { + return (REGISTER_NAME_IS("LP_START") || + REGISTER_NAME_IS("LP_END") || + REGISTER_NAME_IS("PC") || + REGISTER_NAME_IS("STATUS32") || + REGISTER_NAME_IS("STATUS32_L1") || + REGISTER_NAME_IS("STATUS32_L2") || + REGISTER_NAME_IS("ERET") || + REGISTER_NAME_IS("ERBTA") || + REGISTER_NAME_IS("ERSTATUS") || + REGISTER_NAME_IS("ECR") || + REGISTER_NAME_IS("EFA")) ? 1 : 0; + } + + if (group == general_reggroup) + return (REGISTER_NAME_IS("STATUS32")) ? 0 : 1; + + if (group == system_reggroup) + { + return (REGISTER_NAME_IS("SEMAPHORE") || + REGISTER_NAME_IS("STATUS32_L1") || + REGISTER_NAME_IS("STATUS32_L2") || + REGISTER_NAME_IS("AUX_IRQ_LV12") || + REGISTER_NAME_IS("AUX_IRQ_LEV") || + REGISTER_NAME_IS("AUX_IRQ_HINT") || + REGISTER_NAME_IS("ERET") || + REGISTER_NAME_IS("ERBTA") || + REGISTER_NAME_IS("ERSTATUS") || + REGISTER_NAME_IS("ECR") || + REGISTER_NAME_IS("EFA") || + REGISTER_NAME_IS("ICAUSE1") || + REGISTER_NAME_IS("ICAUSE2") || + REGISTER_NAME_IS("AUX_IENABLE") || + REGISTER_NAME_IS("AUX_ITRIGGER") || + REGISTER_NAME_IS("BTA_L1") || + REGISTER_NAME_IS("BTA_L2") || + REGISTER_NAME_IS("AUX_IRQ_PULSE_CANCEL") || + REGISTER_NAME_IS("AUX_IRQ_PENDING")) ? 1 : 0; + } + } + } + + /* Let the caller sort it out! */ + return -1; +} + + +/* This function is passed to the arc_all_aux_registers iterator. + It prints the value of one auxiliary register. */ + +static void +print_one_aux_register (ARC_AuxRegisterDefinition *def, void *data) +{ + if (!arc_aux_is_unused(def)) + { + PrintData *p = (PrintData*) data; + int regnum = arc_aux_gdb_register_number(def); + + default_print_registers_info (p->gdbarch, p->file, p->frame, regnum, TRUE); + } +} + + +/* -------------------------------------------------------------------------- */ +/* 5) local functions called from gdb */ +/* -------------------------------------------------------------------------- */ + +/* Mapping from binutils/gcc register number to gdb register number ("regnum"). + + N.B. registers such as ARC_FP_REGNUM, ARC_SP_REGNUM, etc., actually have + different gdb register numbers in the arc-elf32 and arc-linux-uclibc + configurations of the ARC gdb. */ + +static int +arc_elf32_binutils_reg_to_regnum (struct gdbarch *gdbarch, int reg) +{ + return arc_core_register_gdb_number((ARC_RegisterNumber) reg); +} + + +/* Print the contents of one, some or all registers. */ + +static void +arc_elf32_print_registers_info (struct gdbarch *gdbarch, + struct ui_file *file, + struct frame_info *frame, + int regnum, + int all) +{ + if (regnum >= 0) + PRINT(regnum); + else + /* If regnum < 0, print registers. */ + { + /* R32 .. R59 are the extension core registers, R61 and R62 are reserved. */ + + /* R0 .. R26 */ + for (regnum = 0; regnum <= 26; regnum++) + PRINT_HW ((ARC_RegisterNumber) regnum); + + PRINT_HW (ARC_FP_REGNUM ); // r27 + PRINT_HW (ARC_SP_REGNUM ); // r28 + PRINT_HW (ARC_ILINK1_REGNUM ); // r29 + PRINT_HW (ARC_ILINK2_REGNUM ); // r30 + PRINT_HW (ARC_BLINK_REGNUM ); // r31 + PRINT_HW (ARC_LP_COUNT_REGNUM); // r60 + PRINT_HW (ARC_PCL_REGNUM ); // r63 + + if (all) + { + PrintData data = {gdbarch, file, frame}; + + /* Print all of the aux registers. */ + arc_all_aux_registers(print_one_aux_register, &data); + } + else + { + /* Print just a selection of the aux registers. */ + PRINT_BY_NAME ("LP_START" ); + PRINT_BY_NAME ("LP_END" ); + PRINT_BY_NAME ("STATUS32" ); + PRINT_BY_NAME ("BTA" ); + PRINT_BY_NAME ("EFA" ); + PRINT_BY_NAME ("ERET" ); + PRINT_BY_NAME ("STATUS32_L1"); + PRINT_BY_NAME ("STATUS32_L2"); + PRINT_BY_NAME ("ERSTATUS" ); + PRINT_BY_NAME ("PC" ); + } + } +} + + +/* Return the name of the given register. */ + +static const char* +arc_elf32_register_name (struct gdbarch *gdbarch, int gdb_regno) +{ + if (gdb_regno >= 0) + { + if (arc_is_core_register(gdb_regno)) + { + ARC_RegisterNumber hw_num = arc_core_register_number(gdb_regno); + + if (hw_num < ELEMENTS_IN_ARRAY(register_names)) + return register_names[hw_num]; + } + else + { + ARC_AuxRegisterDefinition *def = arc_find_aux_register_by_gdb_number(gdb_regno); + + /* If it is an auxiliary register. */ + if (def) + return arc_aux_register_name(def); + } + } + + internal_error(__FILE__, __LINE__, _("invalid register number: %d"), gdb_regno); +} + + +/* Determine whether the given register is read-only. */ + +static int +arc_elf32_cannot_store_register (struct gdbarch *gdbarch, int gdb_regno) +{ + ARC_AuxRegisterDefinition *def = arc_find_aux_register_by_gdb_number(gdb_regno); + + /* No warning should be printed. arc_cannot_store_register being + called does not imply that someone is actually writing to regnum. */ + + /* If it is an auxiliary register. */ + if (def) + return (arc_aux_register_access(def) == READ_ONLY) ? 1 : 0; + + /* It is writable. */ + return 0; +} + + +/* -------------------------------------------------------------------------- */ +/* 6) local functions implementing commands */ +/* -------------------------------------------------------------------------- */ + +/* This function handles seeting a hardware breakpoint or watchpoint across a + range of memory address (rather than at a single location). + + Parameters: + args : the user arguments to the command + from_tty : non-zero if the command was issued at the command-line + is_watchpoint : TRUE if a watchpoint to to be set, FALSE if a breakpoint + command : the name of the command + usage : the usage message for the command +*/ + +static void +memory_range_command (char *args, + int from_tty, + Boolean is_watchpoint, + const char *command, + const char *usage) +{ + char *length_arg; + unsigned int start; + int length; + enum target_hw_bp_type type; + + if (!args) + { + printf_filtered (_("%s"), usage); + return; + } + + length_arg = strchr(args, ' '); + + if (!length_arg) + { + printf_filtered (_("%s : no second argument\n%s"), command, usage); + return; + } + + /* Split up the input string. */ + length_arg[0] = (char) 0; + length_arg++; + while (*length_arg == ' ') length_arg++; + + if (is_watchpoint) + { + char *access_arg = strchr(length_arg, ' '); + + if (access_arg) + { + /* Split up the input string. */ + access_arg[0] = (char) 0; + access_arg++; + while (*access_arg == ' ') access_arg++; + + if (strcmp(access_arg, "read") == 0) + type = hw_read; + else if (strcmp(access_arg, "write") == 0) + type = hw_write; + else if (strcmp(access_arg, "access") == 0) + type = hw_access; + else + { + printf_filtered (_("%s: invalid type '%s'\n%s"), command, access_arg, usage); + return; + } + } + else + /* Access is write by default. */ + type = hw_write; + } + else + type = hw_execute; + + /* The address expression. */ + EXTRACT(args, unsigned int, start) + + /* The length expression. */ + EXTRACT(length_arg, int, length) + + if (length <= 0) + { + warning(_("%s: %s <= 0"), command, length_arg); + return; + } + + DEBUG("try to set %u breakpoint at 0x%08X length %d bytes\n", + type, start, length); + + watch_range_command(start, (unsigned int) length, type, from_tty); + + /* Although the call to insert_breakpoints would result in an error message + if the range breakpoint could not be set, the breakpoint would still be + entered into gdb's breakpoint table, and displayed by the 'info break' + command - that would be even more confusing to the user! */ +#if 0 + /* gdb manages breakpoints by deleting them from the target as soon as it + has halted, then re-inserting them again immediately before execution is + resumed (no, I don't know why either, unless it is to make generating a + disassembly display easier by removing all the s/w b/ps from the code) - + so in order to display what actionpoints are currently in use, we must + temporarily re-insert the breakpoints! */ + insert_breakpoints(); + arc_display_actionpoints(); + (void) remove_breakpoints(); +#endif +} + + +/* arc-break-range + Set hardware breakpoint at address START covering LENGTH bytes. */ + +static void +arc_elf32_break_memory_command (char *arg, int from_tty) +{ + memory_range_command(arg, from_tty, FALSE, BREAK_MEMORY_COMMAND, BREAK_MEMORY_COMMAND_USAGE); +} + + +/* arc-watch-range [read|write|access] + Set hardware watchpoint at address START covering LENGTH bytes. */ + +static void +arc_elf32_watch_memory_command (char *arg, int from_tty) +{ + memory_range_command(arg, from_tty, TRUE, WATCH_MEMORY_COMMAND, WATCH_MEMORY_COMMAND_USAGE); +} + + +/* arc-fill-memory [] + Write repeated copies of PATTERN at address START covering LENGTH bytes. */ + +static void +arc_elf32_fill_memory_command (char *arg, int from_tty) +{ + TargetOperations *operations = (TargetOperations*) current_target.to_data; + char *length_arg; + char *pattern_arg; + ARC_Address start; + ARC_Word pattern; + int length; + + gdb_assert(operations != NULL); + + if (!arg) + { + printf_filtered ("%s", _(FILL_MEMORY_COMMAND_USAGE)); + return; + } + + length_arg = strchr(arg, ' '); + + if (!length_arg) + { + printf_filtered (_(FILL_MEMORY_COMMAND " : no second argument\n" FILL_MEMORY_COMMAND_USAGE)); + return; + } + + /* Split up the input string. */ + length_arg[0] = (char) 0; + length_arg++; + while (*length_arg == ' ') length_arg++; + + pattern_arg = strchr(length_arg, ' '); + if (pattern_arg) + { + /* Split up the input string. */ + pattern_arg[0] = (char) 0; + pattern_arg++; + } + + /* The address expression. */ + EXTRACT(arg, ARC_Address, start) + + /* The length expression. */ + EXTRACT(length_arg, int, length) + + if (length <= 0) + { + warning(_(FILL_MEMORY_COMMAND ": %s <= 0"), length_arg); + return; + } + + if (pattern_arg) + { + /* The pattern expression. */ + EXTRACT(pattern_arg, ARC_Word, pattern) + } + else + pattern = 0; + + if (operations) + { + unsigned int written = write_pattern(start, pattern, (unsigned int) length); + + if (written != (unsigned int) length) + warning (_(FILL_MEMORY_COMMAND ": only %u bytes written to target memory"), written); + } + else + error(_(FILL_MEMORY_COMMAND " is not available for this target")); +} + + +/* -------------------------------------------------------------------------- */ +/* externally visible functions */ +/* -------------------------------------------------------------------------- */ + +/* Perform arc-elf32-gdb specific initialization. */ + +struct gdbarch* +arc_elf32_initialize (struct gdbarch *gdbarch, + struct gdbarch_list *arches) +{ + struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); + + /* Set up a guard on the PC: if any attempt is made by gdb to read or write + the PC before an XML definition of the PC aux register has been read this + will cause an error message to be output. */ + arc_aux_pc_guard(gdbarch, TRUE); + + /* N.B. this function may be called twice: once when gdb is started, then again + when the 'target' command is issued; do not try to read the aux + registers definitions the first time (when 'arches' is NULL) as that + results in an error message (if the XML file is not found) which is + output too early in the start-up process (before gdb has identified + itself). */ + if (arches == NULL) + create_variant_info(tdep); + else + { + /* This is the arch that was created earlier. */ + struct gdbarch *gdbarch0 = arches[0].gdbarch; + struct gdbarch_tdep *tdep0 = gdbarch_tdep(gdbarch0); + + /* Have auxiliary registers been defined for that arch? */ + if (arc_aux_regs_defined(gdbarch0)) + { + /* Share the variant info. */ + tdep->processor_variant_info = tdep0->processor_variant_info; + } + else + create_variant_info(tdep); + } + + /* Fill in target-dependent info in ARC-private structure. */ + + tdep->is_sigtramp = NULL; + tdep->sigcontext_addr = NULL; + tdep->sc_reg_offset = NULL; + tdep->sc_num_regs = 0; + tdep->pc_regnum_in_sigcontext = 0; + + tdep->le_breakpoint_instruction = le_breakpoint_instruction; + tdep->be_breakpoint_instruction = be_breakpoint_instruction; + tdep->breakpoint_size = (unsigned int) sizeof(le_breakpoint_instruction); + + tdep->register_reggroup_p = register_reggroup_p; + tdep->lowest_pc = 0; + + /* Pass target-dependent info to gdb. */ + + DEBUG("setting PC %d\n", arc_aux_pc_number(gdbarch)); + DEBUG("setting #regs %d\n", ARC_NR_REGS); + DEBUG("setting #pseudo %d\n", ARC_NR_PSEUDO_REGS); + + /* ARC_NR_REGS and ARC_NR_PSEUDO_REGS are defined in the tm-embed.h configuration file. */ + set_gdbarch_pc_regnum (gdbarch, arc_aux_pc_number(gdbarch)); + set_gdbarch_num_regs (gdbarch, ARC_NR_REGS); + set_gdbarch_num_pseudo_regs (gdbarch, ARC_NR_PSEUDO_REGS); + set_gdbarch_print_registers_info (gdbarch, arc_elf32_print_registers_info); + set_gdbarch_register_name (gdbarch, arc_elf32_register_name); + set_gdbarch_cannot_store_register (gdbarch, arc_elf32_cannot_store_register); + set_gdbarch_dwarf2_reg_to_regnum (gdbarch, arc_elf32_binutils_reg_to_regnum); + + /* See ARC Bug #96650: disable the use of the 'P' and 'p' RSP packets, so + forcing gdb to use the 'G' and 'g' packets instead, in case the arc-elf32 + debug target is the xISS being used as a remote target. */ + { + static Boolean packets_disabled = FALSE; + + /* N.B. this is something of a kluge: if execution of the target program + is restarted (e.g. a 'start' command is followed by a 'run' + command) this function is called again - but if execute_command + is called again, an assertion fails way down in the regcache code + because the target appears to have a stack, but current_gdbarch + is set to NULL! So do this only once. */ + if (!packets_disabled) + { + execute_command("set remote set-register-packet off", 0); + execute_command("set remote fetch-register-packet off", 0); + + packets_disabled = TRUE; + } + } + + return gdbarch; +} + + +/* This is the module initialization function that is called from gdb. */ + +void +_initialize_arc_elf32_tdep (void) +{ + (void) add_cmd (BREAK_MEMORY_COMMAND, + class_breakpoint, + arc_elf32_break_memory_command, + _("Set a breakpoint on a memory address range.\n" + BREAK_MEMORY_COMMAND_USAGE + " and can be any expressions that evaluate to integers.\n"), + &cmdlist); + + (void) add_cmd (WATCH_MEMORY_COMMAND, + class_breakpoint, + arc_elf32_watch_memory_command, + _("Set a watchpoint on a memory address range.\n" + WATCH_MEMORY_COMMAND_USAGE + " and can be any expressions that evaluate to integers.\n" + "If the watchpoint mode is omitted, it defaults to 'access'.\n"), + &cmdlist); + + (void) add_cmd (FILL_MEMORY_COMMAND, + class_obscure, + arc_elf32_fill_memory_command, + _("Fill a memory address range with a repeated pattern.\n" + FILL_MEMORY_COMMAND_USAGE + ", and can be any expressions that evaluate to integers.\n" + "If is omitted, it defaults to 0.\n"), + &cmdlist); + + (void) observer_attach_new_objfile (new_object_file); + (void) observer_attach_target_pre_connect (pre_target_connection); + (void) observer_attach_target_post_connect (post_target_connection); + (void) observer_attach_target_post_disconnect(post_target_disconnection); + (void) observer_attach_target_updated (target_updated); +} + + +/* Find the ARC hardware numbers of the DEBUG, POC and STATUS32 aux registers: this + is the minimal set of registers required for controlling program execution on a + h/w target. */ + +void arc_elf32_find_register_numbers (void) +{ + arc_debug_regnum = arc_aux_find_register_number("DEBUG", ARC_HW_DEBUG_REGNUM); + arc_pc_regnum = arc_aux_find_register_number("PC", ARC_HW_PC_REGNUM); + arc_status32_regnum = arc_aux_find_register_number("STATUS32", ARC_HW_STATUS32_REGNUM); +} + + +/* Check that an XML definition of the PC aux register has been read: 'error' + is called if that is not the case. + + This function is simply a wrapper for a call to arc_aux_check_pc_defined; + there is a function of the same name in the arc-linux-tdep module (which does + nothing) so that it may be called from the arc-tdep module in either of the + builds of the ARC debugger (as the arc-registers module is present only in + the arc-elf32-gdb build). */ + +void +arc_check_pc_defined (struct gdbarch *gdbarch) +{ + arc_aux_check_pc_defined(gdbarch); +} + + +/* Load the program to be debugged to the tarrget. + + Parameters: + filename : the executable file + from_tty : non-zero if the command was issued at the command-line +*/ + +void +arc_elf32_load_program (char *filename, int from_tty) +{ + TargetOperations *operations = (TargetOperations*) current_target.to_data; + asection *bss_section; + + ENTERARGS("%s", filename); + + if (exec_bfd == NULL) + error(_("Must use 'file' command before 'load' command")); + + arc_aux_check_pc_defined(NULL); + + /* Now that we know the program file as well as the target (since we can be + loading only if the target is connected), check that the program has been + built for the processor version that is in the target. */ + ARCHITECTURE_CHECK(current_gdbarch, exec_bfd); + + if (filename == NULL || *filename == '\0') + filename = bfd_get_filename(exec_bfd); + + /* Check that the file has been compiled for the endianness of the target. */ + { + ARC_RegisterNumber memsubsys = arc_aux_find_register_number("MEMSUBSYS", ARC_HW_MEMSUBSYS_REGNUM); + ARC_RegisterContents contents; + + if (read_aux_register(¤t_target)(memsubsys, &contents, TRUE)) + { + Boolean big_endian_target = ((contents & 4) != 0); + + DEBUG("MEMSUBSYS BCR: 0x%08X\n", contents); + + if (big_endian_target && bfd_little_endian(exec_bfd)) + warning(_("target is big-endian but file %s is little-endian"), filename); + + if (!big_endian_target && bfd_big_endian(exec_bfd)) + warning(_("target is little-endian but file %s is big-endian"), filename); + } + } + + /* In case anything was previously loaded. */ + arc_set_IO_interception(operations, INTERCEPTION_RESET); + + /* Let gdb do all the real work of loading. */ + generic_load(filename, from_tty); + + /* Zero the BSS section in memory, if it exists. */ + bss_section = bfd_get_section_by_name (exec_bfd, ".bss"); + + if (bss_section) + { + CORE_ADDR bss_addr = bfd_section_lma (exec_bfd, bss_section); + bfd_size_type bss_size = bfd_get_section_size (bss_section); + unsigned int bytes; + + printf_filtered(_("Zeroing section .bss, size 0x%0x lma 0x%0x\n"), + (unsigned int) bss_size, (unsigned int) bss_addr); + + bytes = write_zeros((ARC_Address) bss_addr, (unsigned int) bss_size); + + if (bytes != (unsigned int) bss_size) + warning(_("load: error zeroing BSS section - only %u bytes zeroed"), bytes); + } + else + { + DEBUG("%s: no BSS section\n", __FUNCTION__); + } + + + /* We now have a program ready for execution on the target; inform the + program arguments module that we have a newly-loaded program (so any + information that it had about any program loaded before is now invalid). */ + arc_program_is_loaded = TRUE; + arc_program_loaded(); + + /* But the program has not yet been executed. */ + current_target.to_has_execution = 0; +} + + +/* Create the inferior, ready for execution on the target to start. + + Parameters: + exec_file : the executable file from which the loaded program was read + args : the arguments to be passed to the program in argc/argv + env : the environment (name/value pairs) for program execution + target_ops : the target operations structure for the target +*/ + +void +arc_elf32_create_inferior (char *exec_file, + char *args, + char **env, + struct target_ops *target_ops) +{ + TargetOperations *operations = (TargetOperations*) target_ops->to_data; + Boolean set_no_args = TRUE; + char *all_args = NULL; + CORE_ADDR start_address; + + ENTERARGS("exec_file = \"%s\", args = \"%s\"", exec_file, args); + + /* If no exec file handed to us, get it from the exec-file command - + with a good, common error message if none is specified. */ + if (exec_file == NULL) + exec_file = get_exec_file (1); + + /* Include the exec file name as arg[0]. */ + if (exec_file != NULL || args != NULL) + { + size_t length = 10; /* Safety margin. */ + + if (exec_file != NULL) + length += strlen(exec_file) + 1; + + if (args != NULL) + length += strlen(args) + 1; + + all_args = xmalloc(length); + + all_args[0] = '\0'; + + if (exec_file != NULL) + (void) strcat(all_args, exec_file); + + if (args != NULL) + { + (void) strcat(all_args, " "); + (void) strcat(all_args, args); + } + } + + /* Check that we do know which register is the PC. */ + arc_aux_check_pc_defined(NULL); + + if (!arc_program_is_loaded) + error(_("No program loaded")); + + /* We don't really have a PID or anything, but GDB uses this value to check + if the program is running. */ + inferior_ptid.pid = 42; + + /* Must set the PC to the program start address. */ + start_address = bfd_get_start_address (exec_bfd); + + DEBUG("setting PC to 0x%x\n", (unsigned int) start_address); + + write_pc (start_address); + + /* This sets the target's to_has_execution flag to 1. */ + target_mark_running(target_ops); + + /* Do we have arguments to pass to the program? */ + if (all_args != NULL) + { + if (arc_setup_arguments(all_args)) + set_no_args = FALSE; + else + warning(_("can not set up arguments to program")); + + xfree(all_args); + } + + /* If there are no arguments to be passed to the program, or we failed to + set them up, at least try to set R0 and R1 to indicate that are no + arguments! */ + if (set_no_args) + { + /* N.B. we do not use the target_store_registers operation here, as that + does not give us an indication of success or failure. */ + if (!operations->write_core_register(0, 0, TRUE)) + warning(_("can not set parameter register R0 to 0 - main parameter 'argc' will be undefined")); + + if (!operations->write_core_register(1, 0, TRUE)) + warning(_("can not set parameter register R1 to 0 - main parameter 'argv' will be undefined")); + } + + /* Set I/O interception on, so that any I/O operations performed by the program + when it is executed will be trapped and handled by the debugger. */ + arc_set_IO_interception(operations, INTERCEPTION_ON); +} + + +/* There are two ways in which the target processor may be executed: + + 1) once started, the processor will run asynchronously until an explicit + attempt to stop it is made (e.g. real h/w); + + 2) the processor may be run synchronously until it has executed a certain + 'chunk' of instructions (e.g. the xISS). + + So, this function gets either 1) a 'run' operation, or 2) 'start' and 'stop' + operations - but not all three of them! + + If an attempt is made (by the user typing Ctrl-C) to interrupt the processor + whilst it is running, in case 1) we must wait until the 'run' operation has + completed before checking the 'interrupt_processor' flag; whereas in case 2), + we can attempt to force the processor to stop. */ + +void +arc_elf32_execute (struct target_waitstatus *status, + ProcessorControlFunction run_processor, + ProcessorControlFunction start_processor, + ProcessorControlFunction stop_processor) +{ + TargetOperations *operations = (TargetOperations*) current_target.to_data; + + /* This flag will be set if the user types Ctrl-C. */ + interrupt_processor = FALSE; + + /* Set up a signal handler for Ctrl-C. */ + old_signal_handler = signal (SIGINT, interrupted_by_user); + + /* Wait until the processor has *really* halted. */ + while (TRUE) + { + /* Set to 0 in case we leave inner loop without reading DEBUG register. */ + ARC_RegisterContents debug = 0; + + /* Wait until the processor has *apparently* halted. */ + while (TRUE) + { + ARC_RegisterContents status32; + + /* Are we running the processor synchronously? */ + if (run_processor) + { + /* If the user has typed a Ctrl-C since the last chunk of + instructions were executed, exit from this inner loop. */ + if (interrupt_processor) + break; + + DEBUG("running processor...\n"); + + /* Otherwise, run the processor to execute another chunk. */ + run_processor(); + } + else + { + /* If the user has typed a Ctrl-C since target execution was + last started, try to force the processor to halt; it does not + matter if we do not succeed, as we will simply try again on + the next iteration of the loop. */ + if (interrupt_processor) + stop_processor(); + } + + /* Now try to read the STATUS32 register, and check whether its H + bit is set, indicating that the processor has really halted (as + opposed to having simply finished executing a chunk); again, it + does not matter if we do not succeed, as we will simply try again + on the next iteration of the loop. */ + if (operations->read_auxiliary_register(arc_status32_regnum, &status32, TRUE)) + { +#if 0 + ARC_RegisterContents PC; + + printf_filtered(_("STATUS32: %08X\n"), status32); + + if (operations->read_auxiliary_register(arc_pc_regnum, &PC, TRUE)) + printf_filtered(_("PC: %08X\n"), PC); +#endif + + if (status32 & STATUS32_HALT) + { + DEBUG("halted: STATUS32 = %08X\n", status32); + + /* Perform a polling wait for any delayed load to complete. + + N.B. this is necessary for real hardware, though the xISS + currently does not simulate pending loads, although + it will do so at some future date - however, it is + not an error to check the flag! */ + while (TRUE) + { + if (operations->read_auxiliary_register(arc_debug_regnum, &debug, TRUE)) + { + if (!(debug & DEBUG_LOAD_PENDING)) + break; + } + } + + break; + } + } + } + + /* The processor is now halted in a reliable state, but it might need to + be re-started... */ + if (report_processor_halt(status, debug, operations->read_core_register)) + break; + + DEBUG("*** resuming execution\n"); + + /* If we are running the processor asynchronously, we must explicitly + start it again - otherwise, we simply execute another chunk in the + next iteration of this loop. */ + if (start_processor) + start_processor(); + } + + /* Put the old signal handler back. */ + (void) signal (SIGINT, old_signal_handler); + + DEBUG("processor has halted\n"); +} + + +/* Close the connection to the target. */ + +void +arc_elf32_close (Boolean resume) +{ + TargetOperations *operations = (TargetOperations*) current_target.to_data; + + /* Do this while the target is halted. */ + arc_restore_stack_top_address(); + + /* We will no longer intercept any I/O operations. */ + arc_set_IO_interception(operations, INTERCEPTION_OFF); + + /* Let the target continue. */ + if (resume) + target_resume (inferior_ptid, 0, 0); + + current_target.to_has_execution = 0; + + arc_architecture_is_unknown(); +} + + +/* Fetch one or all registers from the target. + + Parameters: + regcache : cache to write register to + gdb_regno: register number (-1 means 'all registers') +*/ + +void +arc_elf32_fetch_registers (struct regcache *regcache, int gdb_regno) +{ + ENTERARGS("%d", gdb_regno); + + /* All registers. */ + if (gdb_regno == -1) + { + int num_core_registers = (int) arc_core_register_count(get_regcache_arch(regcache)); + + /* Core registers. */ + for (gdb_regno = 0; gdb_regno < num_core_registers; gdb_regno++) + debug_fetch_one_register(regcache, (ARC_RegisterNumber) gdb_regno, gdb_regno); + + /* Auxiliary registers (incl. build configuration registers). */ + arc_all_aux_registers(debug_fetch_reg, regcache); + } + else + { + ARC_RegisterNumber hw_regno = get_hw_regnum_mapping (gdb_regno); + + if (hw_regno == INVALID_REGISTER_NUMBER) + error(_("Invalid register number: %d"), gdb_regno); + else + debug_fetch_one_register(regcache, hw_regno, gdb_regno); + } + + LEAVEMSG; +} + + +/* Store one or all registers to the target. + + Parameters : + regcache : cache to read register from + gdb_regno: register number (-1 means 'all registers') +*/ + +void +arc_elf32_store_registers (struct regcache *regcache, int gdb_regno) +{ + ENTERARGS("%d", gdb_regno); + + /* All registers. */ + if (gdb_regno == -1) + { + int num_core_registers = (int) arc_core_register_count(get_regcache_arch(regcache)); + + /* Core registers. */ + for (gdb_regno = 0; gdb_regno < num_core_registers; gdb_regno++) + debug_store_one_register(regcache, (ARC_RegisterNumber) gdb_regno, gdb_regno); + + /* Auxiliary registers (excl. build configuration registers, which are not writable). */ + arc_all_aux_registers(debug_store_reg, regcache); + } + else + { + ARC_RegisterNumber hw_regno = get_hw_regnum_mapping (gdb_regno); + + if (hw_regno == INVALID_REGISTER_NUMBER) + error(_("Invalid register number: %d"), gdb_regno); + else + debug_store_one_register(regcache, hw_regno, gdb_regno); + } + + LEAVEMSG; +} + + +/* Read or write data to/from target memory. + + if 'object' is TARGET_OBJECT_MEMORY then + if 'writebuf' is NULL + read 'len' bytes of data from target memory starting at address 'offset' to 'readbuf' + else + write 'len' bytes of data from 'writebuf' to target memory starting at address 'offset' + + Returns number of bytes of memory read/written. + + Returns -1 for all other operations (i.e. object != TARGET_OBJECT_MEMORY). */ + +LONGEST +arc_elf32_xfer_partial (struct target_ops *ops, // unused + enum target_object object, + const char *annex, // unused + gdb_byte *readbuf, + const gdb_byte *writebuf, + ULONGEST offset, + LONGEST len) +{ + ENTERARGS("object %d offset 0x%x len %lld", (unsigned int) object, (unsigned int) offset, len); + + /* Handle memory access. */ + if (object == TARGET_OBJECT_MEMORY) + { + TargetOperations *operations = (TargetOperations*) current_target.to_data; + unsigned int xfered; + + /* No need to worry about the alignment of the address 'offset', or the number + of bytes to be transffered - the memory read/write operations handle that. */ + if (writebuf != NULL) + xfered = write_bytes((ARC_Address) offset, + (ARC_Byte*) writebuf, + (unsigned int) len); + else + xfered = read_bytes((ARC_Address) offset, + (ARC_Byte*) readbuf, + (unsigned int) len); + + DEBUG("...leaving %s(memory %s) with return value %d\n", + __FUNCTION__, (writebuf == NULL) ? "read" : "write", xfered); + + return (LONGEST) xfered; + } + + if (object == TARGET_OBJECT_AVAILABLE_FEATURES) + { + /* We should create and return an XML string here. */ + return -1; + } + + printf_filtered(_("\nRequested target_object %d not yet supported with target %s\n"), + (int) object, current_target.to_shortname); + return -1; +} + + +/* Insert a software breakpoint in the program code on the target. + + Parameters: + bpt: information defining the breakpoint. + + Returns: 0 for success, 1 for failure. */ + +int +arc_elf32_insert_breakpoint (struct bp_target_info *bpt) +{ + TargetOperations *operations = (TargetOperations*) current_target.to_data; + const unsigned char *breakpt_instruction; + unsigned int bytes; + + ENTERARGS("0x%08X", (unsigned int) bpt->placed_address); + + /* Get the breakpoint instruction code, and its size in bytes. */ + breakpt_instruction = gdbarch_breakpoint_from_pc (current_gdbarch, + &bpt->placed_address, + &bpt->placed_size); + + /* FIXME: alignment of breakpt_instruction data! */ + DEBUG("breakpoint size = %d and breakpoint instruction = 0x%x\n", + bpt->placed_size, *(unsigned int *) breakpt_instruction); + + /* Save the existing instruction at the given address as the shadow contents. */ + bytes = read_bytes((ARC_Address) bpt->placed_address, + (ARC_Byte*) bpt->shadow_contents, + (unsigned int) bpt->placed_size); + + if (bytes == (unsigned int) bpt->placed_size) + /* Overwrite the instruction with the breakpoint instruction. */ + bytes = write_bytes((ARC_Address) bpt->placed_address, + (ARC_Byte*) breakpt_instruction, + (unsigned int) bpt->placed_size); + + return (bytes == (unsigned int) bpt->placed_size) ? 0 : 1; +} + + +/* Remove a software breakpoint from the program code on the target. + + Parameters: + bpt: information defining breakpoint. + + Returns: 0 for success, 1 for failure. */ + +int +arc_elf32_remove_breakpoint (struct bp_target_info *bpt) +{ + unsigned int bytes; + + /* FIXME: alignment of shadow_contents data! */ + ENTERARGS("0x%08X, 0x%lx", (unsigned int) bpt->placed_address, + *(unsigned long *) bpt->shadow_contents); + + /* Write the old code back. */ + bytes = write_bytes((ARC_Address) bpt->placed_address, + (ARC_Byte*) bpt->shadow_contents, + (unsigned int) bpt->placed_size); + + return (bytes == (unsigned int) bpt->placed_size) ? 0 : 1; +} + + +/* Output a warning message related to a core register. */ + +void +arc_elf32_core_warning (RegisterError error, + ARC_RegisterNumber hw_regno) +{ + int gdb_regno = arc_core_register_gdb_number(hw_regno); + + /* N.B. the supplied format string contains a %s specifier which + allows the string "extension " to be inserted into the message. */ + warning((error == REGISTER_IS_READ_ONLY) ? _("%score register %s is read-only") : + (error == ERROR_ON_READING_REGISTER) ? _("failure reading %score register %s") : + _("failure writing %score register %s"), + IS_EXTENSION_CORE_REGISTER(hw_regno) ? _("extension ") : _(""), + gdbarch_register_name(current_gdbarch, gdb_regno)); +} + + +/* Output a warning message related to an auxiliary register. */ + +void +arc_elf32_aux_warning (RegisterError error, + ARC_RegisterNumber hw_regno) +{ + warning((error == REGISTER_IS_READ_ONLY) ? _("auxiliary register %s (0x%x) is read-only") : + (error == ERROR_ON_READING_REGISTER) ? _("failure reading auxiliary register %s (0x%x)") : + _("failure writing auxiliary register %s (0x%x)"), + arc_aux_register_name_of(hw_regno), hw_regno); +} + +/******************************************************************************/ diff --git a/gdb/arc-elf32-tdep.h b/gdb/arc-elf32-tdep.h new file mode 100644 index 0000000..eb7d3e9 --- /dev/null +++ b/gdb/arc-elf32-tdep.h @@ -0,0 +1,118 @@ +/* Target dependent code for ARC processor family, for GDB, the GNU debugger. + + Copyright 2008, 2009 Free Software Foundation, Inc. + + Contributed by ARC International (www.arc.com) + + Authors: + Richard Stuckey + + This file is part of GDB. + + 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 3 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, see . */ + +/******************************************************************************/ +/* */ +/* Outline: */ +/* This header file defines an initialization function for the arc_elf32 */ +/* architecture, and various operations which are useful for the various */ +/* arc-elf32 targets supported. */ +/* */ +/******************************************************************************/ + +#ifndef ARC_ELF32_TDEP_H +#define ARC_ELF32_TDEP_H + +/* gdb header files */ +#include "defs.h" +#include "gdbarch.h" +#include "target.h" +#include "breakpoint.h" + +/* ARC header files */ +#include "arc-registers.h" +#include "arc-architecture.h" + + +/* Complete the structure definition here. */ +struct arc_variant_info +{ + ARC_ProcessorVersion processor_version; + ARC_RegisterInfo registers; +}; + + +typedef enum +{ + REGISTER_IS_READ_ONLY, + ERROR_ON_READING_REGISTER, + ERROR_ON_WRITING_REGISTER +} RegisterError; + + +typedef void (*ProcessorControlFunction)(void); + + +struct gdbarch* arc_elf32_initialize (struct gdbarch *gdbarch, + struct gdbarch_list *arches); + +void arc_check_pc_defined (struct gdbarch *gdbarch); + +void arc_elf32_find_register_numbers (void); + +void arc_elf32_load_program (char *filename, int from_tty); + +void arc_elf32_create_inferior (char *exec_file, + char *args, + char **env, + struct target_ops *target_ops); + +void arc_elf32_execute (struct target_waitstatus *status, + ProcessorControlFunction run_processor, + ProcessorControlFunction start_processor, + ProcessorControlFunction stop_processor); + +void arc_elf32_close (Boolean resume); + +void arc_elf32_fetch_registers (struct regcache *regcache, int gdb_regno); +void arc_elf32_store_registers (struct regcache *regcache, int gdb_regno); + +int arc_elf32_insert_breakpoint (struct bp_target_info *bpt); +int arc_elf32_remove_breakpoint (struct bp_target_info *bpt); + +LONGEST arc_elf32_xfer_partial (struct target_ops *ops, + enum target_object object, + const char *annex, + gdb_byte *readbuf, + const gdb_byte *writebuf, + ULONGEST offset, + LONGEST len); + +void arc_elf32_core_warning (RegisterError error, + ARC_RegisterNumber hw_regno); + +void arc_elf32_aux_warning (RegisterError error, + ARC_RegisterNumber hw_regno); + + +extern ARC_RegisterNumber arc_debug_regnum; +extern ARC_RegisterNumber arc_pc_regnum; +extern ARC_RegisterNumber arc_status32_regnum; + +extern Boolean arc_program_is_loaded; +extern Boolean arc_target_is_connected; + + +#endif /* ARC_ELF32_TDEP_H */ +/******************************************************************************/ diff --git a/gdb/arc-gpio.c b/gdb/arc-gpio.c new file mode 100644 index 0000000..cc9f775 --- /dev/null +++ b/gdb/arc-gpio.c @@ -0,0 +1,251 @@ +/* Target dependent code for ARC processor family, for GDB, the GNU debugger. + + Copyright 2005, 2008, 2009 Free Software Foundation, Inc. + + Contributed by ARC International (www.arc.com) + + Authors: + Richard Stuckey + A.N. Other + + This file is part of GDB. + + 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 3 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, see . */ + +/******************************************************************************/ +/* */ +/* Outline: */ +/* This module implements operations for reading data from / writing data */ +/* to a parallel port using a GPIO (General Purpose Input/Output) driver. */ +/* */ +/******************************************************************************/ + +/* system header files */ +#include +#include +#include +#include + +/* gdb header files */ +#include "defs.h" + +/* ARC header files */ +#include "arc-gpio.h" + + +/* -------------------------------------------------------------------------- */ +/* local data */ +/* -------------------------------------------------------------------------- */ + +// I/O control numbers. + +// Linux kernel uses 0x54XX for special purposes. Avoid such. +// We'll pick large numbers. +// We don't use the linux convention of dividing the IOC into a bunch +// of bit fields. We can always switch to this later, as the +// IOC 0 returns the driver version (which IOC value will never change). + +#define GPIO_IOC_VERSION 0 // returns version +#define GPIO_IOC_BASE 0xaa3a0000UL // Intended for use on ARCangel 3! + + +// Switch base address of parallel port. 0x3f8 is assumed. +// WARNING! You can write on any port whatsoever with this driver. +// BE CAREFUL! +#define GPIO_IOC_SET_PORT_BASE (GPIO_IOC_BASE + 1) // cmd, arg=port base + +// General input/output ioctl. See GPIO_ioctl struct. +#define GPIO_IOC_DO_IO (GPIO_IOC_BASE + 2) // cmd, arg=GPIO_ioctl * + +// For emergency purposes in case the driver is goofed up. +#define GPIO_IOC_HARD_RESET (GPIO_IOC_BASE + 3) // cmd, no arg + +// Do you have an antiquated parallel port? You might need to ask +// the driver to use outb_p and inb_p (_p = pause). Default is not to. +#define GPIO_IOC_SET_PAUSE (GPIO_IOC_BASE + 4) // arg = 1 => use pause; otherwise not. + + +/* parallel port I/O addresses (LPT1) */ +#define PORT_BASE_ADDRESS 0x378 +#define DATA_PORT_ADDRESS (PORT_BASE_ADDRESS + DATA_PORT) +#define STATUS_PORT_ADDRESS (PORT_BASE_ADDRESS + STATUS_PORT) +#define CONTROL_PORT_ADDRESS (PORT_BASE_ADDRESS + CONTROL_PORT) + +#define NULL_FILE_DESCRIPTOR (-1) + + +typedef struct +{ + // This is used for general input and output in the same ioctl. + // N.B. "input" is input TO the port, and "output" is output FROM the port. + // + // inlen is always even and represents a number of pairs: + // + // [0|1|2, value] : write value to port_base+0|1|2. + // [0x80|0x81|0x82, ] : read value from port_base+0|1|2 + // and append result to outbuf. + // + // Thus one can intermix read and write in the same ioctl. + + // inlen is replaced by the number of input bytes consumed. + unsigned inlen; + char *inbuf; + + // outlen is replaced by the number of output bytes written. + unsigned outlen; + char *outbuf; +} GPIO_ioctl; + + +/* Buffers to hold data read from / written to ports; we generally read/write + only 1 byte of data at a time, so the buffers need hold only 1 byte pair each. */ +static char input_buffer [2]; +static char output_buffer[2]; +static GPIO_ioctl ioctl_data = { 0, input_buffer, 0, output_buffer }; + +/* A file descriptor for the GPIO driver. */ +static int gpio_driver = NULL_FILE_DESCRIPTOR; + +/* Debug data. */ +// static const char name[] = {'D', 'S', 'C'}; + + +/* -------------------------------------------------------------------------- */ +/* externally visible data */ +/* -------------------------------------------------------------------------- */ + +/* This is set to TRUE if an I/O error occurs in accessing the port. */ +Boolean gpio_port_error; + + +/* -------------------------------------------------------------------------- */ +/* externally visible functions */ +/* -------------------------------------------------------------------------- */ + +/* Initialization of the GPIO interface. */ + +Boolean +gpio_open (void) +{ + /* Open the driver, if not already open. */ + if (gpio_driver == NULL_FILE_DESCRIPTOR) + { + gpio_driver = open(GPIO_DEVICE, O_RDWR); + + if ((gpio_driver == NULL_FILE_DESCRIPTOR) || + ioctl(gpio_driver, GPIO_IOC_HARD_RESET) || + ioctl(gpio_driver, GPIO_IOC_SET_PORT_BASE, PORT_BASE_ADDRESS)) + { + warning(_("unable to open JTAG port (device " GPIO_DEVICE "): %s"), + strerror(errno)); + return FALSE; + } + + gpio_port_error = FALSE; + } + + return TRUE; +} + + +/* Close the GPIO interface. */ + +void +gpio_close (void) +{ + /* Close the driver, if not already closed. */ + if (gpio_driver != NULL_FILE_DESCRIPTOR) + { + /* Close file descriptor opened for communication with gpio driver. */ + if (close(gpio_driver) == -1) + warning(_("unable to close JTAG port (device " GPIO_DEVICE "): %s"), + strerror(errno)); + + gpio_driver = NULL_FILE_DESCRIPTOR; + } +} + + +/* Write a byte of data to the given port. */ + +void +gpio_write (ParallelPort port, Byte data) +{ + ioctl_data.inlen = 2; + ioctl_data.inbuf[0] = (char) port; + ioctl_data.inbuf[1] = (char) data; + + if (ioctl(gpio_driver, GPIO_IOC_DO_IO, &ioctl_data)) + error(_("Failure writing to port %d: %s"), port, strerror(errno)); + + /* If no data has been consumed by the port. */ + if (ioctl_data.inlen == 0) + gpio_port_error = TRUE; + +// DEBUG("ioctl_data.inlen: %d\n", ioctl_data.inlen); +// DEBUG("GPIO write: %02x -> %c\n", data, name[port]); +} + + +/* Read a byte of data from the given port. */ + +Byte +gpio_read (ParallelPort port) +{ + ioctl_data.inlen = 2; + ioctl_data.inbuf[0] = (char) (port + 0x80); +// ioctl_data.inbuf[1] is ignored + + /* N.B. outlen must be set! */ + ioctl_data.outlen = 1; + ioctl_data.outbuf[0] = (char) 0; // in case the read fails + + if (ioctl(gpio_driver, GPIO_IOC_DO_IO, &ioctl_data)) + error(_("Failure reading from port %d: %s"), port, strerror(errno)); + + /* If no data has been provided by the port */ + if (ioctl_data.outlen == 0) + gpio_port_error = TRUE; + +// DEBUG("ioctl_data.outlen: %d\n", ioctl_data.outlen); +// DEBUG("GPIO read : %02x <- %c\n", (Byte) ioctl_data.outbuf[0], name[port]); + + return (Byte) ioctl_data.outbuf[0]; +} + + +/* Write a series of bytes of data to the ports. */ + +void +gpio_write_array (GPIO_Pair array[], unsigned int num_elements) +{ + char buffer[num_elements * 2]; + GPIO_ioctl data = { 0, buffer, 0, NULL }; + unsigned int i; + + for (i = 0; i < num_elements; i++) + { + buffer[data.inlen++] = (char) array[i].port; + buffer[data.inlen++] = (char) array[i].data; + } + + if (ioctl(gpio_driver, GPIO_IOC_DO_IO, &data)) + error(_("Failure writing to port: %s"), strerror(errno)); + + /* If no data has been consumed by the port. */ + if (ioctl_data.inlen == 0) + gpio_port_error = TRUE; +} + +/******************************************************************************/ diff --git a/gdb/arc-gpio.h b/gdb/arc-gpio.h new file mode 100755 index 0000000..914138c --- /dev/null +++ b/gdb/arc-gpio.h @@ -0,0 +1,72 @@ +/* Target dependent code for ARC processor family, for GDB, the GNU debugger. + + Copyright 2008, 2009 Free Software Foundation, Inc. + + Contributed by ARC International (www.arc.com) + + Authors: + Richard Stuckey + + This file is part of GDB. + + 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 3 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, see . */ + +/******************************************************************************/ +/* */ +/* Outline: */ +/* This header file defines operations for reading data from / writing */ +/* data to a parallel port using a GPIO (General Purpose Input/Output) */ +/* driver. */ +/* */ +/******************************************************************************/ + +#ifndef ARC_GPIO_H +#define ARC_GPIO_H + +/* ARC header files */ +#include "arc-support.h" + + +#define GPIO_DEVICE "/dev/gpio" + + +typedef enum +{ + DATA_PORT = 0, + STATUS_PORT = 1, + CONTROL_PORT = 2 +} ParallelPort; + +typedef unsigned char Byte; + +typedef struct +{ + ParallelPort port; + Byte data; +} GPIO_Pair; + + +Boolean gpio_open (void); +void gpio_close (void); + +void gpio_write (ParallelPort port, Byte data); +Byte gpio_read (ParallelPort port); + +void gpio_write_array (GPIO_Pair array[], unsigned int num_elements); + + +extern Boolean gpio_port_error; + +#endif /* ARC_GPIO_H */ +/******************************************************************************/ diff --git a/gdb/arc-inst-tracing.c b/gdb/arc-inst-tracing.c new file mode 100644 index 0000000..c22ddb7 --- /dev/null +++ b/gdb/arc-inst-tracing.c @@ -0,0 +1,356 @@ +/* Target dependent code for ARC processor family, for GDB, the GNU debugger. + + Copyright 2009 Free Software Foundation, Inc. + + Contributed by ARC International (www.arc.com) + + Authors: + Richard Stuckey + + This file is part of GDB. + + 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 3 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, see . */ + +/******************************************************************************/ +/* */ +/* Outline: */ +/* This module implements operations for recording an instruction trace */ +/* of successive PC values in a compressed binary format in a file. */ +/* */ +/* The file is regarded as a linear sequence of bits, of the form: */ +/* */ +/* <64-bit first instruction count> */ +/* <64-bit last instruction count> */ +/* { <3-bit-code> [ <16-bit-data> | <31-bit-data> ] } */ +/* [ ] */ +/* */ +/******************************************************************************/ + +/* system header files */ +#include +#include +#include +#include +#include + +/* gdb header files */ +#include "defs.h" + +/* ARC header files */ +#include "arc-inst-tracing.h" +#include "arc-tdep.h" + + +/* -------------------------------------------------------------------------- */ +/* local data */ +/* -------------------------------------------------------------------------- */ + +#define MAX_ORDINAL 0xFFFFFFFFFFFFFFFFULL + +/* The file that is currently open for read or write. */ +static FILE *file; + +/* The byte of data that has been read from, or is about to be written to, the + currently open file; and the number of bits in that byte that have been used + (i.e. been consumed on input, or produced on output). */ +static unsigned char byte; +static unsigned int bits_used; + +/* Set to TRUE if EOF occurs whilst trying to read from the file. */ +static Boolean EOF_detected; + + +/* -------------------------------------------------------------------------- */ +/* local functions */ +/* -------------------------------------------------------------------------- */ + +/* Write the N least-significant bits of the given value to the file. */ + +static void +output_bits (unsigned int N, unsigned int value) +{ + unsigned int i; + + for (i = 0; i < N; i++) + { + if (bits_used == BITS_IN_BYTE) + { + (void) putc((int) byte, file); + byte = 0; + bits_used = 0; +// printf("byte = %02X\n", byte); + } + + byte <<= 1; + byte |= (value >> (N - i - 1)) & 0x1; + bits_used++; + } +} + + +/* Read N bits from the file and return them as the least-significant bits of a value. */ + +static unsigned int +input_bits (unsigned int N) +{ + unsigned int value = 0; + unsigned int i; + + for (i = 0; i < N; i++) + { + unsigned int bit; + + /* If all the bits in the current input byte have been used. */ + if (bits_used == BITS_IN_BYTE) + { + /* Read the next byte from the file. */ + int input = getc(file); + + if (input == EOF) + { + EOF_detected = TRUE; + return 0; + } + + byte = (unsigned char) input; + bits_used = 0; +// printf("byte = %02X\n", byte); + } + + bit = (unsigned int) ((byte & 0x80) >> 7); + value <<= 1; + value |= bit; + byte <<= 1; + bits_used++; + } + + return value; +} + + +/* Write a 64-bit value to the file. */ + +static void +output_ordinal (Ordinal value) +{ + output_bits(32, (unsigned int) (value >> 32)); + output_bits(32, (unsigned int) (value & 0xFFFFFFFF)); +} + + +/* Read a 64-bit value from the file. */ + +static Ordinal +input_ordinal (void) +{ + unsigned int high = input_bits(32); + unsigned int low = input_bits(32); + + return ((Ordinal) high) << 32 | (Ordinal) low; +} + + +/* Open the named file with the given access mode. */ + +static Boolean +open_file (const char *filename, const char *mode) +{ + file = fopen(filename, mode); + + if (file == NULL) + { + fprintf(stderr, "Can not open file %s: %s\n", filename, strerror(errno)); + return FALSE; + } + + return TRUE; +} + + +/* -------------------------------------------------------------------------- */ +/* externally visible functions */ +/* -------------------------------------------------------------------------- */ + +/* Start encoding trace data into the named file. */ + +Boolean +arc_start_encoding (const char *filename, + Ordinal first_instr_count) +{ + ENTERARGS("filename = %s, first = %llu", filename, first_instr_count); + + byte = 0; + bits_used = 0; + + if (open_file(filename, "wb")) + { + /* The second value will be fixed up later. */ + output_ordinal(first_instr_count); + output_ordinal(MAX_ORDINAL); + return TRUE; + } + + return FALSE; +} + + +/* Stop encoding trace data into the file. */ + +void +arc_stop_encoding (Ordinal last_instr_count) +{ + ENTERARGS("last = %llu", last_instr_count); + + if (file) + { + /* Make sure the last partial byte output is flushed to the file, + padded with 0 bits as necessary. */ + if (bits_used > 0) + output_bits(BITS_IN_BYTE, 0); + + /* N.B. this is necessary! */ + (void) fflush(file); + + /* Now fix up the second 8-byte value in tjhe file. */ + + if (lseek(fileno(file), (off_t) sizeof(Ordinal), SEEK_SET) == -1) + warning(_("can not seek in file: %s"), strerror(errno)); + else + { + bits_used = 0; + byte = 0; + output_ordinal(last_instr_count); + + /* Make sure the last byte is flushed. */ + output_bits(1, 0); + } + + (void) fclose(file); + file = NULL; + } +} + + +/* Start decoding trace data from the named file. + Retrieve the first and last instruction ordinal positions. */ + +Boolean +arc_start_decoding (const char *filename, + Ordinal *first_instr_count, + Ordinal *last_instr_count) +{ + ENTERARGS("filename = %s", filename); + + /* The first attempt to input a bit will result in a read from the file. */ + bits_used = BITS_IN_BYTE; + EOF_detected = FALSE; + + if (open_file(filename, "r")) + { + *first_instr_count = input_ordinal(); + *last_instr_count = input_ordinal(); + + DEBUG("first = %llu, last = %llu\n", *first_instr_count, *last_instr_count); + + return !EOF_detected; + } + + return FALSE; +} + + +/* Stop decoding trace data from the file. */ + +void +arc_stop_decoding (void) +{ + if (file) + { + if (bits_used < BITS_IN_BYTE) + fprintf(stderr, "all data not processed!\n"); + + (void) fclose(file); + file = NULL; + } +} + + +/* Write a PC value into the file with the specified encoding. */ + +void +arc_encode_PC (ARC_ProgramCounterEncoding encoding, unsigned int value) +{ +// printf("%d:%x\n", encoding, value); + + output_bits(3, (unsigned int) encoding); + + switch (encoding) + { + case NO_CHANGE: + case PLUS_16_BITS: + case PLUS_32_BITS: + case PLUS_48_BITS: + case PLUS_64_BITS: + break; + case DELTA_16_BIT_POSITIVE: + case DELTA_16_BIT_NEGATIVE: + output_bits(16, value); + break; + case ABSOLUTE_31_BITS: + output_bits(31, value); + break; + } +} + + +/* Read a PC value and its encoding from the file. + Return TRUE if a value could be read, FALSE otherwise. */ + +Boolean +arc_decode_PC (ARC_ProgramCounterEncoding *encoding, unsigned int *value) +{ + unsigned int code = input_bits(3); + + if (EOF_detected) + return FALSE; + + *encoding = (ARC_ProgramCounterEncoding) code; + + switch (*encoding) + { + case NO_CHANGE: + case PLUS_16_BITS: + case PLUS_32_BITS: + case PLUS_48_BITS: + case PLUS_64_BITS: + *value = 0; + break; + case DELTA_16_BIT_POSITIVE: + case DELTA_16_BIT_NEGATIVE: + *value = input_bits(16); + break; + case ABSOLUTE_31_BITS: + *value = input_bits(31); + break; + } + + if (EOF_detected) + return FALSE; + +// printf("%d:%x\n", *encoding, *value); + + return TRUE; +} + +/******************************************************************************/ diff --git a/gdb/arc-inst-tracing.h b/gdb/arc-inst-tracing.h new file mode 100644 index 0000000..4dacad9 --- /dev/null +++ b/gdb/arc-inst-tracing.h @@ -0,0 +1,89 @@ +/* Target dependent code for ARC processor family, for GDB, the GNU debugger. + + Copyright 2009 Free Software Foundation, Inc. + + Contributed by ARC International (www.arc.com) + + Authors: + Richard Stuckey + + This file is part of GDB. + + 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 3 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, see . */ + +/******************************************************************************/ +/* */ +/* Outline: */ +/* This header file defines operations for recording an instruction trace */ +/* of successive PC values in a compressed binary format in a file. */ +/* */ +/* We use the fact that instructions are always 16-bit aligned to encode */ +/* 17-bit deltas as 16-bit quantities. We apply a 2-byte bias to the */ +/* delta (as the minimum delta could be -2, for a shortest distance */ +/* backward branch), so giving us */ +/* */ +/* delta range: 2 .. 2^17 */ +/* encoding range: 0 .. 2^16 - 1 */ +/* */ +/* We could encode positive and negative deltas differently (since the */ +/* minimum positive delta is 10, given that 2, 4, 6 and 8 byte positive */ +/* deltas are handled diferently), but this hardly seems worthwhile. */ +/* */ +/******************************************************************************/ + +#ifndef ARC_INSTRUCTION_TRACING_H +#define ARC_INSTRUCTION_TRACING_H + +/* ARC header files */ +#include "arc-support.h" + + +typedef enum +{ + NO_CHANGE, + PLUS_16_BITS, + PLUS_32_BITS, + PLUS_48_BITS, + PLUS_64_BITS, + DELTA_16_BIT_POSITIVE, + DELTA_16_BIT_NEGATIVE, + ABSOLUTE_31_BITS +} ARC_ProgramCounterEncoding; + + +typedef unsigned long long Ordinal; + + +#define MAX_DELTA (1 << 17) + +#define ENCODE_DELTA(delta) (unsigned int) (((delta) - 2) / 2) +#define DECODE_DELTA(value) (((value) * 2) + 2) + + +Boolean arc_start_encoding (const char *filename, + Ordinal first_instr_count); + +void arc_stop_encoding (Ordinal last_instr_count); + +Boolean arc_start_decoding (const char *filename, + Ordinal *first_instr_count, + Ordinal *last_instr_count); + +void arc_stop_decoding (void); + +void arc_encode_PC (ARC_ProgramCounterEncoding encoding, unsigned int value); +Boolean arc_decode_PC (ARC_ProgramCounterEncoding *encoding, unsigned int *value); + +#endif /* ARC_INSTRUCTION_TRACING_H */ +/******************************************************************************/ diff --git a/gdb/arc-jtag-actionpoints.c b/gdb/arc-jtag-actionpoints.c new file mode 100644 index 0000000..4c5d818 --- /dev/null +++ b/gdb/arc-jtag-actionpoints.c @@ -0,0 +1,1337 @@ +/* Target dependent code for ARC processor family, for GDB, the GNU debugger. + + Copyright 2008, 2009 Free Software Foundation, Inc. + + Contributed by ARC International (www.arc.com) + + Author: + Richard Stuckey + + This file is part of GDB. + + 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 3 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, see . */ + +/******************************************************************************/ +/* */ +/* Outline: */ +/* This module implements hardware breakpoints and watchpoints on the ARC */ +/* processor using actionpoints. */ +/* */ +/* See */ +/* ARC 700 System Components Reference */ +/* 5126-016 */ +/* */ +/* for a full description of the processor actionpoints mechanism. */ +/* */ +/******************************************************************************/ + +/* gdb header files */ +#include "defs.h" +#include "inferior.h" +#include "gdb_assert.h" + +/* ARC header files */ +#include "arc-jtag-actionpoints.h" +#include "arc-registers.h" +#include "arc-elf32-tdep.h" +#include "arc-jtag.h" +#include "arc-jtag-ops.h" +#include "arc-support.h" + + +/* -------------------------------------------------------------------------- */ +/* local types */ +/* -------------------------------------------------------------------------- */ + +typedef enum +{ + NOT_IN_USE, + SINGLE, + PAIR_0, + PAIR_1, + QUAD_0, + QUAD_1, + QUAD_2, + QUAD_3 +} Actionpoint_Usage; + + +/* This information describes an individual actionpoint. */ +typedef struct arc_actionpoint +{ + Actionpoint_Usage usage; + Boolean triggered; + Boolean is_exclude; + unsigned int length; + ARC_RegisterContents match_value; + ARC_RegisterContents match_mask; + ARC_RegisterContents control; + ARC_RegisterContents point; +} ARC_ActionPoint; + + +/* -------------------------------------------------------------------------- */ +/* local data */ +/* -------------------------------------------------------------------------- */ + +#define SUCCESS 0 +#define FAILURE (-1) + +#define MAX_ACTION_POINTS 8 +#define MAX_ACTION_POINTS_IN_GROUP 4 +#define HW_BP_SIZE 1 + + +/* Bit masks for the Actionpoint Control Registers AP_ACx (10 low-order bits only). */ +#define AP_TARGET_INSTRUCTION_ADDRESS 0x000 +#define AP_TARGET_INSTRUCTION_DATA 0x001 +#define AP_TARGET_LOAD_STORE_ADDRESS 0x002 +#define AP_TARGET_LOAD_STORE_DATA 0x003 +#define AP_TARGET_AUX_REGISTER_ADDRESS 0x004 +#define AP_TARGET_AUX_REGISTER_DATA 0x005 +#define AP_TARGET_EXTERNAL_PARAMETER_0 0x006 +#define AP_TARGET_EXTERNAL_PARAMETER_1 0x007 +#define AP_TARGET_MASK 0x007 +#define AP_TARGET_SHIFT 0 + +#define AP_TRANSACTION_TYPE_DISABLED 0x000 +#define AP_TRANSACTION_TYPE_WRITE 0x010 +#define AP_TRANSACTION_TYPE_READ 0x020 +#define AP_TRANSACTION_TYPE_ACCESS 0x030 +#define AP_TRANSACTION_TYPE_MASK 0x030 +#define AP_TRANSACTION_TYPE_SHIFT 4 + +#define AP_MODE_TRIGGER_IN_RANGE 0x000 +#define AP_MODE_TRIGGER_OUTSIDE_RANGE 0x040 +#define AP_MODE_MASK 0x040 + +#define AP_ACTION_BREAK 0x000 +#define AP_ACTION_EXCEPTION 0x100 +#define AP_ACTION_MASK 0x100 + +#define AP_PAIR 0x080 +#define AP_QUAD 0x200 + + +/* Data defining the actionpoints. */ +static unsigned int num_actionpoints; +static Boolean full_target_actionpoints; +static ARC_ActionPoint actionpoints[MAX_ACTION_POINTS]; + +/* The h/w numbers of the AMV0, AMM0 and AC0 auxiliary registers. */ +static ARC_RegisterNumber amv0_regnum; +static ARC_RegisterNumber amm0_regnum; +static ARC_RegisterNumber ac0_regnum; + + +/* -------------------------------------------------------------------------- */ +/* local macros */ +/* -------------------------------------------------------------------------- */ + +/* The N actionpoint auxiliary registers (where N is 0 .. MAX_ACTION_POINTS - 1) + (fortunately, the numbers of the registers are one contiguous block, so + a simple addition is sufficient here). */ +#define ARC_HW_AMV_REGNUM(n) (ARC_RegisterNumber) (amv0_regnum + 3 * (n)) +#define ARC_HW_AMM_REGNUM(n) (ARC_RegisterNumber) (amm0_regnum + 3 * (n)) +#define ARC_HW_AC_REGNUM(n) (ARC_RegisterNumber) (ac0_regnum + 3 * (n)) + +/* This will give a value in range 0 .. MAX_ACTION_POINTS - 1. */ +#define AP_INSTANCE(ap) ((ap) - actionpoints) +#define IN_USE(ap) ((ap)->usage != NOT_IN_USE) + + +/* -------------------------------------------------------------------------- */ +/* local functions */ +/* -------------------------------------------------------------------------- */ + +#if 0 +/* This function checks that a given number is a power of two, and, if so, + returns a bitmask corresponding to (2 ** number - 1). */ + +static Boolean +is_power_of_two (int number, ARC_Word *mask) +{ + unsigned int power = 1; + unsigned int i; + + *mask = 0; + + for (i = 0; (i < BITS_IN_WORD) && (power <= (unsigned int) number); i++) + { + if (power == (unsigned int) number) + return TRUE; + + power <<= 1; + *mask = (*mask << 1) + 1; + } + + /* not a power */ + return FALSE; +} +#endif + + +/* This function determines whether the ARC processor in the connected target + provides support for actionpoints (that is a configuratiopn option). */ + +static Boolean +target_has_actionpoints (void) +{ + ARC_RegisterNumber ap_build_regnum; + ARC_RegisterContents ap_build; + + ap_build_regnum = arc_aux_find_register_number("AP_BUILD", ARC_HW_AP_BUILD_REGNUM); + amv0_regnum = arc_aux_find_register_number("AMV0", ARC_HW_AMV0_REGNUM); + amm0_regnum = arc_aux_find_register_number("AMM0", ARC_HW_AMM0_REGNUM); + ac0_regnum = arc_aux_find_register_number("AC0", ARC_HW_AC0_REGNUM); + + num_actionpoints = 0; + + if (arc_read_jtag_aux_register(ap_build_regnum, &ap_build, TRUE)) + { + DEBUG("AP_BUILD BCR: 0x%08X\n", ap_build); + + /* AP_BUILD returns 0 if actionpoints are not selected in the + processor configuration. */ + if (ap_build != 0) + { + /* If the processor's implementation of the actionpoint mechanism is + the one we know about. */ + if ((ap_build & AP_BUILD_VERSION) == 0x4) + { + unsigned int type = (ap_build & AP_BUILD_TYPE) >> AP_BUILD_TYPE_SHIFT; + unsigned int i; + + /* The low-order two bits of the type field encode the number + of actionpoints supported by the processor. */ + switch (type % 4) + { + case 0 : num_actionpoints = 2; break; + case 1 : num_actionpoints = 4; break; + case 2 : num_actionpoints = 8; break; + default: internal_error (__FILE__, __LINE__, _("invalid AP_BUILD.TYPE: 0x%X"), type); + } + + /* The next bit specifies whether the processor supports full + or minimum targets for the actionpoints. */ + full_target_actionpoints = ((type & 4) == 0); + + for (i = 0; i < MAX_ACTION_POINTS; i++) + { + actionpoints[i].usage = NOT_IN_USE; + actionpoints[i].triggered = FALSE; + actionpoints[i].is_exclude = FALSE; + } + + DEBUG("ARC processor supports %u %s actionpoints\n", + num_actionpoints, (full_target_actionpoints) ? "full" : "minimum"); + + return TRUE; + } + else + warning(_("ARC processor actionpoint mechanism version (0x%x) is not supported."), + ap_build & AP_BUILD_VERSION); + } + } + + DEBUG("ARC processor supports no actionpoints\n"); + + return FALSE; +} + + +/* This function determines the set of actionpoints that would be required to + cover exactly the memory region specified by (addr,length), by using one + actionpoint with an inclusive range, and zero or more actionpoints with + exclusive ranges. + + The set of values and masks for the actionpoint AMV and AMM registers are + returned in the actionpoint_value and actionpoint_mask arrays - these must + be able to hold 4 entries. The value and mask for the inclusive actionpoint + are returned as the first elements in the arrays. */ + +static unsigned int +map_actionpoints (ARC_Address addr, + unsigned int length, + ARC_Address actionpoint_value[], + ARC_Word actionpoint_mask[]) +{ + ARC_Address first_data = addr; + ARC_Address last_data = first_data + length - 1; + ARC_Address include_start; + ARC_Address include_end; + ARC_Word mask; + unsigned int power_of_two; + unsigned int points; + + ENTERARGS("addr 0x%08X, length %d", addr, length); +// DEBUG("range: %08X .. %08X\n", first_data, last_data); + + /* If the range extends across the midpoint of the address space. */ + if (((first_data & 0x80000000) == 0) && ((last_data & 0x80000000) != 0)) + { +// DEBUG("pathological case!\n"); + + /* Must cover entire address space. */ + include_start = 0x00000000; + include_end = 0xFFFFFFFF; + mask = 0xFFFFFFFF; // Ignore all bits! + } + else + { + unsigned int i; + + mask = 0; + power_of_two = 1; + + /* Determine what actionpoint would be required to include all of the given + memory region (this include range may have leading and trailing parts + that extend beyond the given region). */ + for (i = 0; i < 32; i++) + { + unsigned int include_size = power_of_two; + + include_start = (first_data / include_size) * include_size; + include_end = include_start + include_size - 1; + + if (include_start <= first_data && include_end >= last_data) + { +// DEBUG("include: 0x%08X .. 0x%08X (mask 0x%08x)\n", +// include_start, include_end, mask); + break; + } + + mask = (mask << 1) + 1; + power_of_two <<= 1; + } + } + + /* This is the first actionpoint in the list. */ + actionpoint_value[0] = include_start; + actionpoint_mask [0] = mask; + points = 1; + + + /* Determine what actionpoints would be required to mask out the leading part + of the include range. */ + { + unsigned int to_be_excluded = first_data - include_start; + ARC_Address boundary = include_start; + + while (to_be_excluded > 0) + { + unsigned int j; + + mask = 0; + power_of_two = 1; + + for (j = 0; j < 32; j++) + { + unsigned int exclude_size = power_of_two; + ARC_Address exclude_start = (first_data / exclude_size - 1) * exclude_size; + ARC_Address exclude_end = exclude_start + exclude_size - 1; + + if (exclude_end < first_data && exclude_start <= boundary) + { +// DEBUG("leading exclude: 0x%08X .. 0x%08X (mask 0x%08x)\n", +// exclude_start, exclude_end, mask); + + to_be_excluded = first_data - exclude_end - 1; + boundary = exclude_end + 1; + + /* There is no point in returning the details of + more than the maximum number of actionpoints that + can be linked together (in a quad). */ + if (points < MAX_ACTION_POINTS_IN_GROUP) + { + actionpoint_value[points] = exclude_start; + actionpoint_mask [points] = mask; + } + points++; + + break; + } + + mask = (mask << 1) + 1; + power_of_two <<= 1; + } + } + } + + /* Determine what actionpoints would be required to mask out the trailing + part of the include range. */ + { + unsigned int to_be_excluded = include_end - last_data; + ARC_Address boundary = include_end; + + while (to_be_excluded > 0) + { + unsigned int j; + + mask = 0; + power_of_two = 1; + + for (j = 0; j < 32; j++) + { + unsigned int exclude_size = power_of_two; + ARC_Address exclude_start = (last_data / exclude_size + 1) * exclude_size; + ARC_Address exclude_end = exclude_start + exclude_size - 1; + + if (exclude_start > last_data && exclude_end >= boundary) + { +// DEBUG("trailing exclude: 0x%08X .. 0x%08X (mask 0x%08x)\n", +// exclude_start, exclude_end, mask); + + to_be_excluded = exclude_start - last_data - 1; + boundary = exclude_start - 1; + + /* There is no point in returning the details of + more than the maximum number of actionpoints that + can be linked together (in a quad). */ + if (points < MAX_ACTION_POINTS_IN_GROUP) + { + actionpoint_value[points] = exclude_start; + actionpoint_mask [points] = mask; + } + points++; + + break; + } + + mask = (mask << 1) + 1; + power_of_two <<= 1; + } + } + } + + return points; +} + + +/* Set the given actionpoint on the target by writing to the corresponding set + of AMV, AMM and AC auxiliary registers. + Return TRUE if it is set successfully. */ + +static Boolean +set_actionpoint_on_target (ARC_ActionPoint *actionpoint) +{ + unsigned int instance = AP_INSTANCE(actionpoint); + + return arc_write_jtag_aux_register(ARC_HW_AMV_REGNUM(instance), actionpoint->match_value, TRUE) && + arc_write_jtag_aux_register(ARC_HW_AMM_REGNUM(instance), actionpoint->match_mask, TRUE) && + arc_write_jtag_aux_register(ARC_HW_AC_REGNUM (instance), actionpoint->control, TRUE); +} + + +/* Clear the given actionpoint on the target by writing 'DISABLED' to the + corresponding AC auxiliary register. + Return TRUE if it is cleared successfully. */ + +static Boolean +clear_actionpoint_from_target (ARC_ActionPoint *actionpoint) +{ + return arc_write_jtag_aux_register(ARC_HW_AC_REGNUM (AP_INSTANCE(actionpoint)), + AP_TRANSACTION_TYPE_DISABLED, + TRUE); +} + + +/* Set the given actionpoint on the target, and update its data structure. + Return TRUE if it is set successfully. */ + +static Boolean +set_actionpoint (ARC_ActionPoint *actionpoint) +{ + Boolean set = set_actionpoint_on_target(actionpoint); + + if (set) + { + actionpoint->triggered = FALSE; + actionpoint->point = 0; + } + else + actionpoint->usage = NOT_IN_USE; + + return set; +} + + +/* Insert an actionpoint to cover a range of target memory. + + Parameters: + bpt : the information describing a breakpoint (NULL for a watchpoint) + length : the length in bytes of the range + match_value: the value for the actionpoint value (AMV) aux register + match_mask : the value for the actionpoint mask (AMM) aux register + control : the value for the actionpoint control (AC) aux register + + Returns 0 for success, -1 for failure. */ + +static int +insert_actionpoint (struct bp_target_info *bpt, + unsigned int length, + ARC_RegisterContents match_value, + ARC_RegisterContents match_mask, + ARC_RegisterContents control) +{ + unsigned int i; + + /* Look for an unused actionpoint. */ + for (i = 0; i < num_actionpoints; i++) + { + ARC_ActionPoint *actionpoint = &actionpoints[i]; + + /* Got one! */ + if (!IN_USE(actionpoint)) + { + /* Record its data. */ + actionpoint->match_value = match_value; + actionpoint->match_mask = match_mask; + actionpoint->control = control; + actionpoint->is_exclude = FALSE; + actionpoint->length = length; + + /* Try to set it on the target. */ + if (set_actionpoint(actionpoint)) + { + /* Now it is in use. */ + actionpoint->usage = SINGLE; + + /* Is it a breakpoint? */ + if (bpt) + { + /* We have not actually saved code from the target program. */ + bpt->shadow_len = 0; + bpt->placed_size = (int) actionpoint->length; + } + + return SUCCESS; + } + } + } + + /* Failed: no free actionpoints. */ +// warning(_("no actionpoints available")); + return FAILURE; +} + + +/* Restore the actionpoints on the target according to their current settings. + If 'clear_unused' is TRUE, any actionpoints which are unused are explicitly + cleared on the target. + + Returns 0 for success, -1 for failure. */ + +static int +restore_actionpoints (Boolean clear_unused) +{ + unsigned int i; + + /* Look at each of the actionpoints. */ + for (i = 0; i < num_actionpoints; i++) + { + ARC_ActionPoint *actionpoint = &actionpoints[i]; + + if (IN_USE(actionpoint)) + { + if (!set_actionpoint_on_target(actionpoint)) + { + actionpoint->usage = NOT_IN_USE; + return FAILURE; + } + } + else if (clear_unused) + { + if (!clear_actionpoint_from_target (actionpoint)) + return FAILURE; + } + } + + return SUCCESS; +} + + +/* Find a number of unused actionpoints whose numbers (0..7) lie in a contiguous + range (allowing for wraparound of the numbers, i.e. % 8). + + Parameters: + required : the number of unused actionpoints required + from : set to the number (0..7) of the first actionpoint + compacted: set to TRUE if the currently used set of actionpoints + had to be compacted to give a contiguous range of unused + actionpoints + + Returns TRUE if the required number was found, FALSE otherwise. */ + +static Boolean +find_unused_actionpoints (unsigned int required, + unsigned int *from, + Boolean *compacted) +{ + unsigned int unused = 0; + unsigned int first_unused = 0; + unsigned int i; + + /* How many slots are not currently used? */ + for (i = 0; i < num_actionpoints; i++) + { + ARC_ActionPoint *actionpoint = &actionpoints[i]; + + if (!IN_USE(actionpoint)) + unused++; + } + + DEBUG("%u actionpoints unused, %u required\n", unused, required); + + if (required > unused) + return FALSE; + + /* When used in pairs or quads, the action points wrap around, e.g. a pair + might be actionpoints (3, 0), if the target has 4 actionpoints; and a + quad might be (6, 7, 0, 1), if the target has 8 actionpoints. */ + + /* First try to find 'required' contiguous unused slots. */ + for (i = 0; i < num_actionpoints + required - 2; i++) + { + ARC_ActionPoint *actionpoint = &actionpoints[i % num_actionpoints]; + + if (IN_USE(actionpoint)) + { + /* The first unused one MAY be the next one after this one. */ + first_unused = i + 1; + } + else + { + DEBUG("%u: AP%u is unused\n", i, i % num_actionpoints); + + if (i - first_unused + 1 >= required) + { + /* A sufficiently large sequence of unused actionpoints has been + found. */ + *from = first_unused % num_actionpoints; + *compacted = FALSE; + return TRUE; + } + } + } + + DEBUG("compacting array\n"); + + /* There are sufficient unused slots, but they are not contiguous - so move + all the used ones towards the start of the array so that all the unused + ones are contiguous at the end of the array. */ + first_unused = MAX_ACTION_POINTS; + + for (i = 0; i < num_actionpoints; i++) + { + ARC_ActionPoint *actionpoint = &actionpoints[i]; + + if (IN_USE(actionpoint)) + { + if (first_unused != MAX_ACTION_POINTS) + { + DEBUG("moving %u to %u\n", i, first_unused); + + /* Move the used one into the unused slot. */ + actionpoints[first_unused] = *actionpoint; + + actionpoint->usage = NOT_IN_USE; + + /* The first unused entry in the array is now the next one after + it - this is true whether that next one was the used one that + has just been moved, or was the next in a sequence of unused + entries. */ + first_unused++; + } + } + else if (first_unused == MAX_ACTION_POINTS) + { + /* This one really is the first unused one we have found. */ + first_unused = i; + } + } + + *from = num_actionpoints - unused; + + DEBUG("from = %u\n", *from); + + *compacted = TRUE; + return TRUE; +} + + +/* Insert an actionpoint group to cover a range of target memory. + + Parameters: + length : the length in bytes of the range + number : the number of actionpoints required + match_value: the values for the actionpoint value (AMV) aux registers + match_mask : the values for the actionpoint mask (AMM) aux registers + control : the value for the actionpoint control (AC) aux registers + + Returns 0 for success, -1 for failure. */ + +static int +insert_actionpoint_group (unsigned int length, + unsigned int number, + ARC_RegisterContents match_value[], + ARC_RegisterContents match_mask[], + ARC_RegisterContents control) +{ + /* For 2 actionpoints, we can use a pair; for 3 or 4, we must use a quad. */ + unsigned int required = (number == 2) ? 2 : 4; + unsigned int first_free; + Boolean is_pair = (required == 2); + Boolean compacted; + + gdb_assert(2 <= number && number <= 4); + + /* Try to find the required number of unused actionpoints. */ + if (find_unused_actionpoints(required, &first_free, &compacted)) + { + ARC_ActionPoint *actionpoint[MAX_ACTION_POINTS_IN_GROUP]; + unsigned int i; + + /* Get an array of pointers to the data for those actionpoints. */ + for (i = 0; i < required; i++) + actionpoint[i] = &actionpoints[(first_free + i) % num_actionpoints]; + + actionpoint[0]->length = length; + actionpoint[0]->is_exclude = FALSE; + + /* The Control register for the first actionpoint in the group must be + set to indicate whether the group is a pair or a quad. */ + actionpoint[0]->usage = (is_pair) ? PAIR_0 : QUAD_0; + actionpoint[0]->match_value = match_value[0]; + actionpoint[0]->match_mask = match_mask[0]; + actionpoint[0]->control = control | ((is_pair) ? AP_PAIR : AP_QUAD); + + /* All subsequent actionpoints in the group have exclusive rather than + inclusive address ranges. */ + control &= ~AP_MODE_TRIGGER_IN_RANGE; + control |= AP_MODE_TRIGGER_OUTSIDE_RANGE; + + for (i = 1; i < number; i++) + { + actionpoint[i]->usage = actionpoint[0]->usage + i; + actionpoint[i]->match_value = match_value[i]; + actionpoint[i]->match_mask = match_mask[i]; + actionpoint[i]->control = control; + actionpoint[i]->length = 0; + actionpoint[i]->is_exclude = TRUE; + } + + /* If we are using only 3 of the 4 actionpoints in a quad, the 4th one + must be disabled (or we could just make it the same as one of the + other exclusive ones). */ + if (number == 3) + { + ARC_ActionPoint *disabled = actionpoint[3]; + + disabled->usage = QUAD_3; + disabled->match_value = 0; + disabled->match_mask = 0; + disabled->control = AP_TRANSACTION_TYPE_DISABLED; + disabled->length = 0; + } + + /* If we had to compact the array of actionpoints in order to get a + long enough contiguous sequence of unused entries, then set ALL of + the actionpoints that are now in use, and explicitly clear all that + are not in use (this is simplest!). */ + if (compacted) + return restore_actionpoints(TRUE); + + /* Otherwise, just set the ones for the group, which were previously + unused. */ + for (i = 0; i < required; i++) + if (!set_actionpoint(actionpoint[i])) + return FAILURE; + + return SUCCESS; + } + +// warning(_("insufficient actionpoints available")); + return FAILURE; +} + + +/* Insert a h/w breakpoint or watchpoint to cover a range of target memory. + + Parameters: + address : the start address of the range + control : the value for the actionpoint control (AC) aux register + length : the length in bytes of the range + bpt : the information describing the breakpoint (NULL for a watchpoint) + + Returns 0 for success, -1 for failure. */ + +static int +insert_range (ARC_RegisterContents address, + ARC_RegisterContents control, + unsigned int length, + struct bp_target_info *bpt) +{ + /* At most 4 actionpoints can be connected (as a quad). */ + ARC_Address actionpoint_value[MAX_ACTION_POINTS_IN_GROUP]; + ARC_Word actionpoint_mask [MAX_ACTION_POINTS_IN_GROUP]; + unsigned int actionpoints_needed; + + /* Work out how many actionpoints would be required to exactly cover the + given memory range. */ + actionpoints_needed = map_actionpoints(address, + length, + actionpoint_value, + actionpoint_mask); + + if (actionpoints_needed == 1) + return insert_actionpoint(bpt, + length, + actionpoint_value[0], + actionpoint_mask[0], + control); + + if (actionpoints_needed <= MAX_ACTION_POINTS_IN_GROUP) + return insert_actionpoint_group(length, + actionpoints_needed, + actionpoint_value, + actionpoint_mask, + control); + + warning (_("break/watchpoint would require %u linked actionpoints, " + "but at most %u actionpoints may be linked together"), + actionpoints_needed, MAX_ACTION_POINTS_IN_GROUP); + + return FAILURE; +} + + +/* Remove an actionpoint from a range of target memory. + + Parameters: + address : the start address of the range + length : the length in bytes of the range + + Returns -1 for failure, 0 for success. */ + +static int +remove_actionpoint (CORE_ADDR address, unsigned int length) +{ + unsigned int i; + + /* Look at all the actionpoints. */ + for (i = 0; i < num_actionpoints; i++) + { + ARC_ActionPoint *actionpoint = &actionpoints[i]; + + if (IN_USE(actionpoint) && !actionpoint->is_exclude) + { + if (actionpoint->match_value == (ARC_RegisterContents) address && + actionpoint->length == length) + { + unsigned int points; + unsigned int p; + + /* Is this the first of a pair or quad? */ + if ((actionpoint->control & AP_PAIR) != 0) + points = 2; + else if ((actionpoint->control & AP_QUAD) != 0) + points = 4; + else + points = 1; + +// DEBUG("points = %u\n", points); + + for (p = 1; p < points; p++) + { + ARC_ActionPoint *next = &actionpoints[(i + p) % num_actionpoints]; + + if (clear_actionpoint_from_target (next)) + next->usage = NOT_IN_USE; + else + return FAILURE; + } + + if (clear_actionpoint_from_target (actionpoint)) + { + actionpoint->usage = NOT_IN_USE; + return SUCCESS; + } + + break; + } + } + } + + /* Failed: could not find actionpoint, or could not clear it. */ + return FAILURE; +} + + +/* -------------------------------------------------------------------------- */ +/* local functions called from outside this module */ +/* -------------------------------------------------------------------------- */ + +/* Check if we can set a hardware watchpoint of type TYPE. TYPE is + one of bp_hardware_watchpoint, bp_read_watchpoint, bp_write_watchpoint, or + bp_hardware_breakpoint. COUNT is the number of such watchpoints used so far + (including this one). OTHERTYPE is the total number of hardware breakpoints + and watchpoints of other types that are "already" set (0 if type == bp_hardware_breakpoint). + + Result: 0 if hardware watchpoints are not supported + -1 if there are not enough hardware watchpoints + 1 if there are enough hardware watchpoints + + N.B. this is not what is stated in target.h, but it does conform to the use + made of this function's result in breakpoint.c! */ + +static int +arc_debug_can_use_hw_breakpoint (int type, int count, int othertype) +{ + ENTERARGS("type %d, count %d", type, count); + + if (num_actionpoints == 0) + return 0; + + /* N.B. this will sometimes give a "false positive" result, i.e. that there + sufficient actionpoints available when in fact there are not: the + ARC processor actionpoints can be used for all of the types, but gdb + assumes that there are separate sets of resources for breakpoints + and watchpoints, and when asking for a breakpoint does not give the + number of watchpoints "already" set. + + It is not possible simply to check how many actionpoints are currently + set, as gdb does not actually set the breakpoints and watchpoints + until program execution is started or resumed - so when this function + is called, none are actually set. + + Also, the breakpoints and watchpoints may require pairs or quads of + actionpoints, rather than single actionpoints, and this will not be + known until they are set, and their addresses and ranges are known! */ + return ((int) num_actionpoints >= count + othertype) ? 1 : -1; +} + + +/* Insert a hardware breakpoint on the target. + Returns 0 for success, -1 for failure. */ + +static int +arc_debug_insert_hw_breakpoint (struct bp_target_info *bpt) +{ + ARC_RegisterContents control = AP_TARGET_INSTRUCTION_ADDRESS | + AP_TRANSACTION_TYPE_READ | + AP_MODE_TRIGGER_IN_RANGE | + AP_ACTION_BREAK; + + ENTERARGS("0x%x : %u", (unsigned int) bpt->placed_address, bpt->range); + + /* Is it a range breakpoint? */ + if (bpt->range) + return insert_range((ARC_RegisterContents) bpt->placed_address, + control, + bpt->range, + bpt); + + /* No, just a single-instruction breakpoint? */ + return insert_actionpoint(bpt, + HW_BP_SIZE, + (ARC_RegisterContents) bpt->placed_address, + 0, /* All bits of address. */ + control); +} + + +/* Remove a hardware breakpoint from the target. + Returns 0 for success, non-zero for failure. */ + +static int +arc_debug_remove_hw_breakpoint (struct bp_target_info *bpt) +{ + unsigned int range = (bpt->range) ? bpt->range : HW_BP_SIZE; + + ENTERARGS("0x%x : %u", (unsigned int) bpt->placed_address, range); + + return remove_actionpoint(bpt->placed_address, range); +} + + +/* Insert a hardware watchpoint on the target. + + Parameters: + addr : the start address of the region of memory to be watched + length: the length in bytes of the region of memory + type : 0 => write, 1 => read, 2 => read/write + + Returns 0 for success, -1 for failure. */ + +static int +arc_debug_insert_watchpoint (CORE_ADDR addr, int length, int type) +{ + ARC_RegisterContents control = AP_TARGET_LOAD_STORE_ADDRESS | + AP_MODE_TRIGGER_IN_RANGE | + AP_ACTION_BREAK; + + ENTERARGS("0x%08X:%d %d", (unsigned int) addr, length, type); + + gdb_assert(length > 0); + + switch (type) + { + case 0: + control |= AP_TRANSACTION_TYPE_WRITE; break; + case 1: + control |= AP_TRANSACTION_TYPE_READ; break; + case 2: + control |= AP_TRANSACTION_TYPE_ACCESS; break; + default: + internal_error (__FILE__, __LINE__, _("invalid watchpoint type: %d"), type); + } + + return insert_range((ARC_RegisterContents) addr, + control, + (unsigned int) length, + NULL); +} + + +/* Remove a hardware watchpoint from the target. + + Parameters: + addr : the start address of the region of memory being watched + length: the length in bytes of the region of memory + type : 0 => write, 1 => read, 2 => read/write + + Returns 0 for success, non-zero for failure. */ + +static int +arc_debug_remove_watchpoint (CORE_ADDR addr, int length, int type) +{ + ENTERARGS("0x%x:%d %d", (unsigned int) addr, length, type); + + return remove_actionpoint(addr, (unsigned int) length); +} + + +/* Returns non-zero if the execution of the target program has been stopped by + the trigger of a hardware watchpoint (i.e. on memory read or write), zero + otherwise. */ + +static int +arc_debug_stopped_by_watchpoint (void) +{ + unsigned int i; + + ENTERMSG; + + /* Look at all of the actionpoints. */ + for (i = 0; i < num_actionpoints; i++) + { + ARC_ActionPoint *actionpoint = &actionpoints[i]; + + if (IN_USE(actionpoint) && actionpoint->triggered) + { + /* Is it a memory read or write actionpoint? */ + if ((actionpoint->control & AP_TARGET_LOAD_STORE_ADDRESS) != 0) + { + DEBUG("actionpoint %d (load/store) triggered\n", i); + return 1; + } + } + } + + return 0; +} + + +/* Get the address of the data that was read/written causing a h/w watchpoint to + trigger; the address is returned in the '*addr' parameter. + Returns 0 for failure, non-zero for success. */ + +static int +arc_debug_stopped_data_address (struct target_ops *ops, CORE_ADDR *addr) +{ + unsigned int i; + + ENTERMSG; + + /* Look at each of the actionpoints. */ + for (i = 0; i < num_actionpoints; i++) + { + ARC_ActionPoint *actionpoint = &actionpoints[i]; + + DEBUG("AP%u: in use = %d, triggered = %d\n", i, IN_USE(actionpoint), actionpoint->triggered); + + /* If this actionpoint has been triggered. */ + if (IN_USE(actionpoint) && actionpoint->triggered) + { + /* Is it a memory read or write actionpoint? */ + if ((actionpoint->control & AP_TARGET_LOAD_STORE_ADDRESS) != 0) + { + DEBUG("actionpoint %d (load/store) triggered by access at 0x%08X\n", i, actionpoint->point); + + /* OK, got the data address! */ + *addr = (CORE_ADDR) actionpoint->point; + return 1; + } + } + } + + DEBUG("no watchpoint triggered\n"); + + return 0; +} + + +/* Can a h/w watchpoint 'length' bytes long be set at address 'addr' in target memory? */ + +static int +arc_debug_region_ok_for_hw_watchpoint (CORE_ADDR addr, int length) +{ + /* As far as we know, we can set a h/w watchpoint anywhere! */ + return 1; +} + + +/* -------------------------------------------------------------------------- */ +/* externally visible functions */ +/* -------------------------------------------------------------------------- */ + +/* This function is called after a reset of the target has been performed (which + clears all the aux registers associated with actionpoints). It attempts to + restore all actionpoints to their pre-reset settings. + + Returns TRUE if the actionpoints are restored, FALSE otherwise. */ + +Boolean +arc_restore_actionpoints_after_reset (void) +{ + return (restore_actionpoints(FALSE) == SUCCESS); +} + + +/* If the debug target supports actionpoints, set up the function pointers in + the given target operations structure to point to the functions which + implement the associated operations. + + Returns TRUE if actionpoints are supported, FALSE otherwise. */ + +Boolean +arc_initialize_actionpoint_ops (struct target_ops *debug_ops) +{ + if (target_has_actionpoints()) + { + debug_ops->to_can_use_hw_breakpoint = arc_debug_can_use_hw_breakpoint; + debug_ops->to_insert_hw_breakpoint = arc_debug_insert_hw_breakpoint; + debug_ops->to_remove_hw_breakpoint = arc_debug_remove_hw_breakpoint; + debug_ops->to_insert_watchpoint = arc_debug_insert_watchpoint; + debug_ops->to_remove_watchpoint = arc_debug_remove_watchpoint; + debug_ops->to_stopped_by_watchpoint = arc_debug_stopped_by_watchpoint; + debug_ops->to_stopped_data_address = arc_debug_stopped_data_address; + debug_ops->to_region_ok_for_hw_watchpoint = arc_debug_region_ok_for_hw_watchpoint; + + /* This is the default, but just to make it clear that watchpoints must + be cleared before execution can resume. */ + debug_ops->to_have_continuable_watchpoint = 0; + + return TRUE; + } + + return FALSE; +} + + +/* Display all the target actionpoints. */ + +void +arc_display_actionpoints (void) +{ + unsigned int i; + + char *targets[8] = + { + _("Instruction Address"), + _("Instruction Data"), + _("Load/Store Address"), + _("Load/Store Data"), + _("Aux Register Address"), + _("Aux Register Data"), + _("Ext Parameter 0"), + _("Ext Parameter 1") + }; + + char *transactions[4] = + { + _("disabled"), + _("write"), + _("read"), + _("read/write") + }; + + char *explanations[8] = + { + _("execution of instruction at address"), + _("execution of instruction"), + _("load or store of data at address"), + _("load or store of data"), + _("read or write of auxiliary register"), + _("read or write of auxiliary register contents"), + _("value"), + _("value") + }; + + + /* Look at each of the actionpoints in turn. */ + for (i = 0; i < num_actionpoints; i++) + { + ARC_ActionPoint *actionpoint = &actionpoints[i]; + + if (IN_USE(actionpoint)) + { + ARC_RegisterContents control = actionpoint->control; + const unsigned int targ = (control & AP_TARGET_MASK ) >> AP_TARGET_SHIFT; + const unsigned int trans = (control & AP_TRANSACTION_TYPE_MASK) >> AP_TRANSACTION_TYPE_SHIFT; + const char *target = targets [targ]; + const char *type = transactions[trans]; + const char *mode = ((control & AP_MODE_MASK) == + AP_MODE_TRIGGER_OUTSIDE_RANGE) ? _("outside range") : _("in range"); + const char *action = ((control & AP_ACTION_MASK) == + AP_ACTION_BREAK) ? _("break") : _("raise exception"); + const char *usage; + + switch (actionpoint->usage) + { + case SINGLE: usage = _(" "); break; + case PAIR_0: usage = _(" (Pair 0)"); break; + case PAIR_1: usage = _(" (Pair 1)"); break; + case QUAD_0: usage = _(" (Quad 0)"); break; + case QUAD_1: usage = _(" (Quad 1)"); break; + case QUAD_2: usage = _(" (Quad 2)"); break; + case QUAD_3: usage = _(" (Quad 3)"); break; + default: + internal_error (__FILE__, __LINE__, _("invalid AP usage: %u"), actionpoint->usage); + return; + } + + printf_filtered(_("AP %u%s :: "), i, usage); + + printf_filtered( _("value : %08X\n"), actionpoint->match_value); + printf_filtered( _(" mask : %08X\n"), actionpoint->match_mask); + if ((control & AP_TRANSACTION_TYPE_MASK) == AP_TRANSACTION_TYPE_DISABLED) + printf_filtered(_(" control : %08X disabled\n"), actionpoint->control); + else + printf_filtered(_(" control : %08X %s, %s on %s %s\n"), actionpoint->control, target, action, type, mode); + if (actionpoint->triggered) + { + const char *explain = explanations[targ]; + + printf_filtered(_(" triggered by %s %08x\n"), explain, actionpoint->point); + } + } + else + { + printf_filtered(_("AP %u :: not in use\n"), i); + } + } +} + + +/* This function is called as soon as execution of the target program has halted. + It checks whether the halt is due to an actionpoint trigger, and, if so, + identifies the actionpoint that has been triggered and finds the address (code + or data) at which memory access (read, write or execute) has caused the trigger. */ + +void +arc_target_halted (void) +{ + ARC_RegisterContents debug; + + ENTERMSG; + + if (arc_read_jtag_aux_register(arc_debug_regnum, &debug, TRUE)) + { + /* If the bit indicating that an actionpoint has halted the processor is + set. */ + if ((debug & DEBUG_ACTIONPOINT_HALT) != 0) + { + /* Get the Actionpoints Status Register from the DEBUG register: + this contains one bit for each actionpoint in the processor + configuration. */ + unsigned int ASR = (debug & DEBUG_ACTIONPOINT_STATUS) >> + DEBUG_ACTIONPOINT_STATUS_SHIFT; + unsigned int i; + + /* Now look at each of the actionpoints. */ + for (i = 0; i < num_actionpoints; i++) + { + ARC_ActionPoint *actionpoint = &actionpoints[i]; + + actionpoint->triggered = FALSE; + + /* Is the ASR bit for this actionpoint set? */ + if ((ASR & 1) != 0) + { + if (IN_USE(actionpoint)) + { + actionpoint->triggered = TRUE; + + /* The AMV register for this action point has been + updated with the address to which access has caused + the actionpoint to trigger. */ + (void) arc_read_jtag_aux_register(ARC_HW_AMV_REGNUM(AP_INSTANCE(actionpoint)), + &actionpoint->point, + TRUE); + } + else + internal_error (__FILE__, __LINE__, _("actionpoint %u triggered but not set"), i); + } + + ASR >>= 1; + } + } + } +} + + +/* For debugging - just give the values. */ + +void +arc_dump_actionpoints (const char *message) +{ + unsigned int i; + + DEBUG("%s\n", message); + + /* Look at each of the actionpoints in turn. */ + for (i = 0; i < num_actionpoints; i++) + { + ARC_ActionPoint *actionpoint = &actionpoints[i]; + + DEBUG("slot %u:: ", i); + + if (IN_USE(actionpoint)) + { + DEBUG( "value : %08X\n", actionpoint->match_value); + DEBUG(" mask : %08X\n", actionpoint->match_mask); + DEBUG(" control : %08X\n", actionpoint->control); + DEBUG(" triggered: %u\n", actionpoint->triggered); + DEBUG(" point : %08x\n", actionpoint->point); + } + else + { + DEBUG("not in use\n"); + } + } +} + +/******************************************************************************/ diff --git a/gdb/arc-jtag-actionpoints.h b/gdb/arc-jtag-actionpoints.h new file mode 100644 index 0000000..741d869 --- /dev/null +++ b/gdb/arc-jtag-actionpoints.h @@ -0,0 +1,68 @@ +/* Target dependent code for ARC processor family, for GDB, the GNU debugger. + + Copyright 2008, 2009 Free Software Foundation, Inc. + + Contributed by ARC International (www.arc.com) + + Authors: + Richard Stuckey + + This file is part of GDB. + + 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 3 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, see . */ + +/******************************************************************************/ +/* */ +/* Outline: */ +/* This header file defines the interface to hardware actionpoints in the */ +/* ARC processor. */ +/* */ +/* Usage: */ +/* Once the connection to the target has been established, the function */ +/* arc_initialize_actionpoint_ops should be called: this will update the */ +/* debug_ops structure according to the support provided by the ARC */ +/* processor in the target for hardware breakpoints and watchpoints. */ +/* */ +/* The function arc_restore_actionpoints_after_reset should be called */ +/* after the target board has been reset, in order to re-establish any */ +/* actionpoints that have been set, as they will have been cleared by */ +/* the reset; it returns TRUE if successful. */ +/* */ +/******************************************************************************/ + +#ifndef ARC_JTAG_ACTIONPOINTS_H +#define ARC_JTAG_ACTIONPOINTS_H + +/* gdb header files */ +#include "defs.h" +#include "target.h" + +/* ARC header files */ +#include "arc-support.h" + + +Boolean arc_initialize_actionpoint_ops (struct target_ops *debug_ops); + +Boolean arc_restore_actionpoints_after_reset (void); + +void arc_target_halted (void); + +void arc_display_actionpoints (void); + + +/* For debugging. */ +void arc_dump_actionpoints (const char *message); + +#endif /* ARC_JTAG_ACTIONPOINTS_H */ +/******************************************************************************/ diff --git a/gdb/arc-jtag-ops.c b/gdb/arc-jtag-ops.c index 0a237f6..54631b9 100644 --- a/gdb/arc-jtag-ops.c +++ b/gdb/arc-jtag-ops.c @@ -1,1229 +1,1496 @@ -/* Target dependent code for ARC700, for GDB, the GNU debugger. +/* Target dependent code for ARC processor family, for GDB, the GNU debugger. - Copyright 2005 Free Software Foundation, Inc. + Copyright 2005, 2008, 2009 Free Software Foundation, Inc. - Contributed by Codito Technologies Pvt. Ltd. (www.codito.com) + Contributed by ARC International (www.arc.com) - Authors: - Sameer Dhavale - Soam Vasani + Author: + Sameer Dhavale + Soam Vasani + Richard Stuckey This file is part of GDB. - + 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 + the Free Software Foundation; either version 3 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. -*/ + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +/******************************************************************************/ +/* */ +/* Outline: */ +/* This module implements debug access to an ARC processor via its JTAG */ +/* interface. */ +/* */ +/* See */ +/* ARCompact Instruction Set Architecture */ +/* Programmer's Reference (5115-018) */ +/* */ +/* for a description of ARC processor architecture (in particular */ +/* the auxiliary registers and the halting procedure); */ +/* */ +/* ARC 700 External Interfaces */ +/* Reference (5117-013) */ +/* */ +/* for a description of the JTAG interface (in particular the Test */ +/* Access Port Controller (TAPC) state machine). */ +/* */ +/* The JTAG interface is accessed by three parallel ports: control, data */ +/* and status. Data is read from or written to these ports one byte at a */ +/* at a time, using a GPIO (General Purpose Input/Output) driver. */ +/* */ +/* The TDI and TMS signals are written to the data port. */ +/* The TCK signal is written to the control port. */ +/* The TDO signal is read from the status port. */ +/* */ +/* Host/Target Byte Order: */ +/* The core and auxiliary register contents read from or written to the */ +/* JTAG interface are ALWAYS in little-endian format, regardless of the */ +/* endianness of the target processor. */ +/* */ +/******************************************************************************/ + +/* system header files */ #include -#include -#include +#include #include -#include -#include -#include -#include -#include +#include +#include + +/* gdb header files */ +#include "defs.h" +#include "gdb_assert.h" + +/* ARC header files */ +#include "arc-gpio.h" +#include "arc-jtag.h" #include "arc-jtag-ops.h" -#include "gpio.h" -#include -#include -#include -#include "arc-tdep.h" -#define printf printf_filtered +#include "arc-support.h" -unsigned int arcjtag_retry_count = 50; +/* -------------------------------------------------------------------------- */ +/* conditional compilation flags */ +/* -------------------------------------------------------------------------- */ +/* We would really like to optimise the use of the JTAG Data Register by + loading a word into it only if that word differs from the last word loaded; + but there seems to be undocumented behaviour of the JTAG mechanism in that + the Data Register is altered after a write operation! See ARC Bug #93814. */ +#define JTAG_DATA_REGISTER_IS_CORRUPTED_BY_WRITE -/* ------------------------------------ */ -/* For ARC jtag Cable */ -/* */ -/* Pin no. Signal Word , Bit */ -/* */ -/* - TRST */ -/* 8 TMS Data 6 */ -/* 1 TCK Control 0 */ -/* 9 TDI Data 7 */ -/* 13 TDO Status 4 */ +/* Define this if you wish to check the whether the contents of the JTAG Data + Register are corrupted by write operations. */ +//#define CHECK_JTAG_DATA_REGISTER +/* Define this if you wish to perform low-level debugging of the JTAG state + machine emulated in this module (this should not be necessary). */ +//#define STATE_MACHINE_DEBUG -#define JTAG_TRST 0x00 /* not there */ -#define JTAG_TMS 0x40 /* data port */ -#define JTAG_TCK 0x01 /* control port. Driven Low. */ -#define JTAG_TDI 0x80 /* data port */ -#define JTAG_TDO 0x10 /* status port */ +/* -------------------------------------------------------------------------- */ +/* local types */ +/* -------------------------------------------------------------------------- */ -/* ------------------------------------ */ +/* Sizes of quantities. */ +#define BITS_IN_COMMAND_CODE 4 +#define BITS_IN_REGISTER_CODE 4 -/* */ -#define A4_HALT_VALUE 0x02000000 -#define ARC700_HALT_VALUE 0x1 +typedef unsigned int Bit; /* Only LSB of word is used. */ +typedef unsigned int JTAG_RegisterContents; -/* Parallel port i/o addr. (LPT1) */ -#define DATA_PORT 0x378 -#define STATUS_PORT 0x379 -#define CONTROL_PORT 0x37A +typedef enum +{ + MSB_FIRST, + MSB_LAST +} Order; -unsigned char tapc_dataport=0, tapc_statusport=0, tapc_controlport=0x1; -int fd; -struct GPIO_ioctl jtag_ioctl; -sigset_t block_mask; -enum AA3SSPinState - { - READ_FROM_AA3 = 0, - WRITE_TO_AA3 = 1 - }; -enum AA3SSPinState rw_flag; +typedef enum +{ + Memory, + Register +} JTAG_TransactionType; +typedef enum +{ + STALLED, + FAILURE, + READY, + NOT_READY +} JTAG_TransactionStatus; -struct jtag_ops arc_jtag_ops; -static enum ARCProcessorVersion ARCProcessor = UNSUPPORTED; +/* Only these JTAG registers are currently used. */ +typedef enum +{ + JTAG_STATUS_REGISTER = 0x8, + JTAG_TRANSACTION_COMMAND_REGISTER = 0x9, + JTAG_ADDRESS_REGISTER = 0xA, + JTAG_DATA_REGISTER = 0xB, +} JTAG_Register; -/* Sanity check to give error if jtag is not opened at all. */ -static void -check_and_raise_error_if_jtag_closed (void) +#ifdef STATE_MACHINE_DEBUG +typedef enum +{ + UNDEFINED, + TEST_LOGIC_RESET, + RUN_TEST_IDLE, + SELECT_DR_SCAN, + CAPTURE_DR, + SHIFT_DR, + EXIT1_DR, + PAUSE_DR, + EXIT2_DR, + UPDATE_DR, + SELECT_IR_SCAN, + CAPTURE_IR, + SHIFT_IR, + EXIT1_IR, + PAUSE_IR, + EXIT2_IR, + UPDATE_IR, + NUMBER_OF_STATES /* An end-marker, not a state. */ +} JTAG_ControllerState; +#endif + + +/* -------------------------------------------------------------------------- */ +/* local data */ +/* -------------------------------------------------------------------------- */ + +/* -------------------------------------- */ +/* For ARC JTAG Cable */ +/* */ +/* Pin no. Signal Port Bit */ +/* */ +/* - TRST */ +/* 8 TMS Data 6 */ +/* 1 TCK Control 0 */ +/* 9 TDI Data 7 */ +/* 13 TDO Status 4 */ +/* -------------------------------------- */ + +/* Bit masks for signals written to parallel ports. */ + +#define JTAG_TRST 0 /* not there */ +#define JTAG_TMS (1 << 6) /* on Data port */ +#define JTAG_TCK (1 << 0) /* on Control port (driven low) */ +#define JTAG_TDI (1 << 7) /* on Data port */ +#define JTAG_TDO (1 << 4) /* on Status port */ + + +/* Commands which can be written to the JTAG Transaction Command Register. */ +#define WRITE_MEMORY_LOCATION 0x0 +#define WRITE_CORE_REGISTER 0x1 +#define WRITE_AUX_REGISTER 0x2 +#define NOP 0x3 +#define READ_MEMORY_LOCATION 0x4 +#define READ_CORE_REGISTER 0x5 +#define READ_AUX_REGISTER 0x6 + + +/* Gives the endianness of the target processor. */ +static Boolean target_is_big_endian; + +/* These accumulate the bit masks to be written to the data and control ports. */ +static Byte data_port_value, control_port_value; + +/* Variables for tracking the contents of the JTAG Address and Transaction + Command registers. */ +static JTAG_RegisterContents address_register_contents; +static JTAG_RegisterContents command_register_contents; +static Boolean address_register_contents_known; +static Boolean command_register_contents_known; + + +#ifdef STATE_MACHINE_DEBUG +/* This table encodes all possible transitions of the JTAG Test Access Port + (TAP) Controller State Machine: for each state, the transition to one of two + possible next states is determined by whether a 0 bit or a 1 bit is written + as the JTAG TMS interface signal. */ +static const JTAG_ControllerState transitions[NUMBER_OF_STATES][2] = { - if( arc_jtag_ops.jtag_status == JTAG_CLOSED ) - error ("JTAG connection is closed. Use target arcjtag first\n"); +/* 0 1 */ +/* UNDEFINED */ { UNDEFINED, UNDEFINED }, +/* TEST_LOGIC_RESET */ { RUN_TEST_IDLE, TEST_LOGIC_RESET }, +/* RUN_TEST_IDLE */ { RUN_TEST_IDLE, SELECT_DR_SCAN }, +/* SELECT_DR_SCAN */ { CAPTURE_DR, SELECT_IR_SCAN }, +/* CAPTURE_DR */ { SHIFT_DR, EXIT1_DR }, +/* SHIFT_DR */ { SHIFT_DR, EXIT1_DR }, +/* EXIT1_DR */ { PAUSE_DR, UPDATE_DR }, +/* PAUSE_DR */ { PAUSE_DR, EXIT2_DR }, +/* EXIT2_DR */ { SHIFT_DR, UPDATE_DR }, +/* UPDATE_DR */ { RUN_TEST_IDLE, SELECT_DR_SCAN }, +/* SELECT_IR_SCAN */ { CAPTURE_IR, TEST_LOGIC_RESET }, +/* CAPTURE_IR */ { SHIFT_IR, EXIT1_IR }, +/* SHIFT_IR */ { SHIFT_IR, EXIT1_IR }, +/* EXIT1_IR */ { PAUSE_IR, UPDATE_IR }, +/* PAUSE_IR */ { PAUSE_IR, EXIT2_IR }, +/* EXIT2_IR */ { SHIFT_IR, UPDATE_IR }, +/* UPDATE_IR */ { RUN_TEST_IDLE, SELECT_DR_SCAN }, +}; + +/* The current state of the TAP Controller State Machine. */ +static JTAG_ControllerState current_state = UNDEFINED; +#endif + + +/* -------------------------------------------------------------------------- */ +/* externally visible data */ +/* -------------------------------------------------------------------------- */ + +/* This structure holds the operations and data exported by this module. */ +JTAG_Operations arc_jtag_ops; + + +/* -------------------------------------------------------------------------- */ +/* local macros */ +/* -------------------------------------------------------------------------- */ + +#ifdef DEBUG +#undef DEBUG +#endif + +#define DEBUG(...) \ + if (arc_jtag_ops.state_machine_debug) fprintf_unfiltered(gdb_stdlog, __VA_ARGS__) + + +#ifdef STATE_MACHINE_DEBUG +#define SET_STATE(s) set_state(s) +#define NEXT_STATE(b) next_state(b) +#define CHANGE_STATE(x, s) change_state(x, s) +#define STATE_IS(s) gdb_assert(current_state == s) +#define STATE_IS_EITHER(s1, s2) gdb_assert(current_state == s1 || \ + current_state == s2) +#define STATE_IS_ONE_OF(s1, s2, s3) gdb_assert(current_state == s1 || \ + current_state == s2 || \ + current_state == s3) +#else +#define SET_STATE(s) +#define NEXT_STATE(b) +#define CHANGE_STATE(x, s) tapc_TMS(x) +#define STATE_IS(s) +#define STATE_IS_EITHER(s1, s2) +#define STATE_IS_ONE_OF(s1, s2, s3) +#endif + + +#define IS_WORD_ALIGNED(addr) ((addr) % BYTES_IN_WORD == 0) +#define BYTE(val) (Byte) ((val) & 0xFF) + +/* This is more efficient than memcpy(to, from, BYTES_IN_WORD). */ +#define COPY_WORD(to, from) { ((Byte*) to)[0] = ((Byte*) from)[0]; \ + ((Byte*) to)[1] = ((Byte*) from)[1]; \ + ((Byte*) to)[2] = ((Byte*) from)[2]; \ + ((Byte*) to)[3] = ((Byte*) from)[3]; } + + +/* -------------------------------------------------------------------------- */ +/* forward declarations */ +/* -------------------------------------------------------------------------- */ + +static void tapc_TMS (Bit x); +static void set_interface (JTAG_Status status); +static void interface_is_closed (void); +static JTAG_RegisterContents read_jtag_reg (JTAG_Register regnum, + unsigned int num_data_bits); + + +/* -------------------------------------------------------------------------- */ +/* local functions */ +/* -------------------------------------------------------------------------- */ + +/* -------------------------------------------------------------------------- */ +/* 1) debug functions */ +/* -------------------------------------------------------------------------- */ + +/* Debug function. */ + +static const char* +JTAG_register_name (JTAG_Register r) +{ + switch (r) + { + case JTAG_STATUS_REGISTER : return "Status"; + case JTAG_TRANSACTION_COMMAND_REGISTER : return "Transaction Command"; + case JTAG_ADDRESS_REGISTER : return "Address"; + case JTAG_DATA_REGISTER : return "Data"; + default: internal_error(__FILE__, __LINE__, _("invalid JTAG register %d"), r); + } } -/* Initializations for GPIO interface */ -static int -gpio_setup (void) +/* Debug function. */ + +static const char* +JTAG_TransactionStatus_Image (JTAG_TransactionStatus value) { - fd=open("//dev//gpio",O_RDWR); - ioctl(fd,GPIO_IOC_HARDRESET); - ioctl(fd,GPIO_IOC_SET_PORT_BASE,0x378); - jtag_ioctl.inlen=0; - jtag_ioctl.outlen=0; - jtag_ioctl.inbuf=(unsigned char *)xmalloc(2*sizeof(unsigned char)); - jtag_ioctl.outbuf=(unsigned char *)xmalloc(2*sizeof(unsigned char)); - return 0; + switch (value) + { + case STALLED : return "STALLED"; + case FAILURE : return "FAILURE"; + case READY : return "READY"; + case NOT_READY: return "NOT READY"; + default: internal_error(__FILE__, __LINE__, _("invalid JTAG transaction status %d"), value); + } } -void gpio_write(unsigned int port, unsigned char *data) + +#ifdef STATE_MACHINE_DEBUG +/* Debug function. */ + +static const char* +JTAG_ControllerState_Image (JTAG_ControllerState state) { - jtag_ioctl.inlen=2; - jtag_ioctl.inbuf[1]=*data; - switch(port) + switch (state) { - case DATA_PORT: - jtag_ioctl.inbuf[0]=0; - break; - - case STATUS_PORT: - jtag_ioctl.inbuf[0]=1; - break; - - case CONTROL_PORT: - jtag_ioctl.inbuf[0]=2; - break; - - default: - error("Invalid port\n"); + case UNDEFINED : return " "; + case TEST_LOGIC_RESET: return "Test-Logic-Reset"; + case RUN_TEST_IDLE : return "Run-Test/Idle "; + case SELECT_DR_SCAN : return "Select-DR-Scan "; + case CAPTURE_DR : return "Capture-DR "; + case SHIFT_DR : return "Shift-DR "; + case EXIT1_DR : return "Exit1-DR "; + case PAUSE_DR : return "Pause-DR "; + case EXIT2_DR : return "Exit2-DR "; + case UPDATE_DR : return "Update-DR "; + case SELECT_IR_SCAN : return "Select-IR-Scan "; + case CAPTURE_IR : return "Capture-IR "; + case SHIFT_IR : return "Shift-IR "; + case EXIT1_IR : return "Exit1-IR "; + case PAUSE_IR : return "Pause-IR "; + case EXIT2_IR : return "Exit2-IR "; + case UPDATE_IR : return "Update-IR "; + default : return " "; } +} +#endif - - if(ioctl(fd,GPIO_IOC_DO_IO,&jtag_ioctl)) - error("Failure writing to port 0x%x\n",port); +#ifdef CHECK_JTAG_DATA_REGISTER +/* Read back the contents of the JTAG Data Register, and check that the value + is what is expected, i.e. the last value that was written to that register. */ + +static void +check_Data_Register (ARC_Word expected) +{ + /* Read the data from the JTAG Data Register. */ + ARC_Word actual = (ARC_Word) read_jtag_reg(JTAG_DATA_REGISTER, BITS_IN_WORD); + + /* Is the data still in the register? */ + if (actual != expected) + warning(_("JTAG Data Register: expected = %08X, actual = %08X\n"), expected, actual); + else + printf_unfiltered(_("word %08X is still in JTAG Data Register\n"), expected); } +#endif -unsigned char gpio_read(unsigned int port) -{ - //jtag_ioctl.inbuf[1]=tapc_statusport; - jtag_ioctl.inlen=2; - jtag_ioctl.outlen=1; +/* -------------------------------------------------------------------------- */ +/* 2) helper functions for setting TMS / TCK / TDI */ +/* -------------------------------------------------------------------------- */ - switch(port) - { - case DATA_PORT: - jtag_ioctl.inbuf[0]=0x80; - break; - - case STATUS_PORT: - jtag_ioctl.inbuf[0]=0x81; - break; - - case CONTROL_PORT: - jtag_ioctl.inbuf[0]=0x82; - break; - - default: - error("Invalid port\n"); - } - - if(ioctl(fd,GPIO_IOC_DO_IO,&jtag_ioctl)) - error("Failure reading from port 0x%x\n",port); - - return jtag_ioctl.outbuf[0]; +/* These functions set the accumulated values to be written out to the ports. + The final values are written only by doing the pulse, e.g. if TDI and TMS + are set/unset by subsequent calls, the last GPIO write operation performed + by those calls before the pulse writes the accumulated bit mask value to + the port (overwriting the values written by the preceding calls), and it + is this bit mask that is significant when the JTAG is clocked. */ +static void +tapc_set_TMS (Bit x) +{ + Byte current_value = data_port_value; + + if (x) + data_port_value |= JTAG_TMS; + else + data_port_value &= ~JTAG_TMS; + if (data_port_value != current_value) + gpio_write(DATA_PORT, data_port_value); } -/* Helper functions for setting - TMS / TCK / TDI. Valid inputs - are 1 and 0. The tapc_ - functions set the internal values - to be written out to the port. The - final values are written only by doing - the pulse. - */ static void -tapc_set_tms (char x) +tapc_set_TDI (Bit x) { - if(x) - tapc_dataport |= JTAG_TMS; + Byte current_value = data_port_value; + + if (x) + data_port_value |= JTAG_TDI; else - tapc_dataport &= ~JTAG_TMS; + data_port_value &= ~JTAG_TDI; - /* outb(tapc_dataport, DATA_PORT); */ - gpio_write(DATA_PORT,&tapc_dataport); + if (data_port_value != current_value) + gpio_write(DATA_PORT, data_port_value); } -/* Set TCK. */ static void -tapc_set_tck (char x) +tapc_set_TCK (Bit x) { - /* active low. The clock is active low. */ - if(!x) - tapc_controlport |= JTAG_TCK; + /* The clock is active low. */ + if (x) + control_port_value &= ~JTAG_TCK; else - tapc_controlport &= ~JTAG_TCK; - - if(rw_flag == READ_FROM_AA3) - tapc_controlport |= 0x4; - else - tapc_controlport &= ~(0x4); - - /* outb(tapc_controlport, CONTROL_PORT); */ - gpio_write(CONTROL_PORT,&tapc_controlport); + control_port_value |= JTAG_TCK; + + gpio_write(CONTROL_PORT, control_port_value); } +/* -------------------------------------------------------------------------- */ +/* 3) JTAG state machine handlers */ +/* -------------------------------------------------------------------------- */ + +#ifdef STATE_MACHINE_DEBUG +/* Debug function. Perform a state change to the given state. */ + static void -tapc_set_tdi (char x) +set_state (JTAG_ControllerState new_state) { - if(x) - tapc_dataport |= JTAG_TDI; - else - tapc_dataport &= ~JTAG_TDI; - - /* outb(tapc_dataport, DATA_PORT); */ - gpio_write(DATA_PORT,&tapc_dataport); + DEBUG("TAPC state: %s ====> %s\n", + JTAG_ControllerState_Image(current_state), + JTAG_ControllerState_Image(new_state)); + + current_state = new_state; + + gdb_assert(current_state != UNDEFINED); +} + + +/* Debug function. Perform a state change from the current state according to + the transition specified by the given bit. */ + +static void +next_state (Bit x) +{ + current_state = (transitions[current_state][x]); } -/* Unused function clockdelay. Why not add a command - that allows the user to set the clock delay ? */ + +/* Debug function. Perform a state change from the current state according to + the transition specified by the given bit, and check that the new state is + as expected. */ static void -clockdelay (void) +change_state (Bit x, JTAG_ControllerState new_state) { - int i; - //for (i=0; i<10; ++i) - - // usleep(0); + tapc_TMS(x); + + gdb_assert(current_state == new_state); } +#endif /* STATE_MACHINE_DEBUG */ + + +/* Clock the JTAG on the ARC platform. */ -/* Clock the JTAG on the ARC platform. */ static void tapc_pulse (void) { - /* Control 0 bit is active low */ - unsigned char temp; - assert( (tapc_controlport & JTAG_TCK) ); // clock should be zero on entry - - /* outb(tapc_controlport & ~JTAG_TCK, CONTROL_PORT); */ - temp = tapc_controlport & ~JTAG_TCK; - gpio_write(CONTROL_PORT,&temp); - /* outb(tapc_controlport, CONTROL_PORT); */ - gpio_write(CONTROL_PORT,&tapc_controlport); - + /* TCK control bit is active low. */ + gdb_assert((control_port_value & JTAG_TCK) != (Byte) 0); /* Clock should be zero on entry. */ + + gpio_write(CONTROL_PORT, control_port_value & ~JTAG_TCK); + gpio_write(CONTROL_PORT, control_port_value); } -/* All the JTAG state machine handlers. */ -/* Reset the TAPC controller on the JTAG. - */ +/* Reset the TAP Controller on the JTAG. */ + static void tapc_reset (void) { - /* from any state, these many ones should get us into "test-logic reset" - */ - tapc_set_tms(1); - tapc_set_tck(0); /* want rising edge */ + ENTERMSG; + + /* The Test Clock signal is active low (i.e. the signal is active when the + corresponding bit written to the control bit is 0; so initialize the bit + in the control port value to 1 so that the signal is initially not active. */ + control_port_value = (Byte) JTAG_TCK; + data_port_value = (Byte) 0; + + /* From any state, this many TCK pulses should get the controller into state + Test-Logic-Reset. */ + tapc_set_TMS(1); + tapc_set_TCK(0); /* We want the rising edge. */ tapc_pulse(); tapc_pulse(); tapc_pulse(); tapc_pulse(); tapc_pulse(); tapc_pulse(); + + SET_STATE(TEST_LOGIC_RESET); + + DEBUG("TAPC has been reset\n"); + + /* The reset has re-initialized all the JTAG registers. */ + address_register_contents_known = FALSE; + command_register_contents_known = FALSE; + + CHANGE_STATE(0, RUN_TEST_IDLE); + + LEAVEMSG; } -/* Set the tms to the value of the bit and - clock the jtag. */ + +/* Set the TMS to the value of the bit and clock the JTAG. + This will cause the TAP Controller State Machine to move to another state. */ static void -tapc_tms (char x) +tapc_TMS (Bit x) { - tapc_set_tms(x); + tapc_set_TMS(x); tapc_pulse(); + NEXT_STATE(x); } -/* Read bit from the TDO of the JTAG. */ -static char -tapc_readbit (void) + +/* Read a bit from the TDO of the JTAG. */ + +static Bit +tapc_readTDO (void) { - if(gpio_read(STATUS_PORT) & JTAG_TDO) - return 1; - else - return 0; + Byte byte = gpio_read(STATUS_PORT); + + /* Read from the status port. */ + return ((byte & JTAG_TDO) != (Byte) 0) ? (Bit) 1 : (Bit) 0; } -/* Interface functions that use the below mentioned - JTAG state machine handler functions. -*/ +/* -------------------------------------------------------------------------- */ +/* 4) interface functions that use the JTAG state machine handler functions */ +/* -------------------------------------------------------------------------- */ -/* Shift one bit out on the JTAG TDI. */ -static char -tapc_shiftbit (char x) -{ - char read; +/* Shift one bit out on the JTAG TDO and one bit in on the JTAG TDI. */ - //printf("tapc_shiftbit: Shifted %d\n", x); +static Bit +tapc_shift_bit (Bit out) +{ + Bit in = tapc_readTDO(); - read = tapc_readbit(); - tapc_set_tdi(x); + tapc_set_TDI(out); tapc_pulse(); - return read; +// DEBUG("%u (out) >>> %u (in)\n", out, in); + + return in; } -/* - * Shift N bits from to_write into TDI, and out from TDO into read. - * - * If msb_first=0, shift LSB first, starting from to_write[0], to_write[1], - * etc. - - * If msb_first=1, shift to_write[-1] MSB first, then to_write[-2] etc. - * - * Must be called in Shift DR/IR state. - * Leaves in Exit1 DR/IR state. - */ +/* Shift N bits from to_write into TDI, and out from TDO into to_read. + + If order == MSB_LAST, shift LSB first, starting from to_write[0], to_write[1], + etc. + + If order == MSB_FIRST, shift to_write[N-1] MSB first, then to_write[N-2] etc. + + Must be called in Shift DR/IR state. + Leaves in Exit1-DR/IR state. */ + static void -tapc_shiftnbits (int n, - unsigned char *to_write, - unsigned char *read, - char msb_first) +tapc_shift_N_bits (unsigned int n, + Byte *to_write, + Byte *to_read, + Order order) { - unsigned char outbyte, inbyte; - int nbytes = (n-1)/8 + 1,limit=8; - int i, j; + unsigned int nbytes = (n - 1) / BITS_IN_BYTE + 1; + unsigned int nbits = BITS_IN_BYTE; + unsigned int i, j; + + ENTERARGS("shift %u bits", n); - for(i=0; i < nbytes; ++i) + STATE_IS_EITHER(SHIFT_DR, SHIFT_IR); + + for (i = 0; i < nbytes; i++) { - if(msb_first) - outbyte = to_write[-1-i]; - else - outbyte = to_write[i]; - - inbyte = 0; - /* should write a maximum of 8 bits */ - if(i == nbytes-1) - limit = ((n-1) % 8) + 1; - - for(j = 0; j < limit; ++j) - { - unsigned char outbit, inbit; - - if(msb_first) - outbit = !!(outbyte & 0x80); - else - outbit = outbyte & 1; - /* the last bit of the last byte */ - /* transition to EXIT-1 state before last bit */ - if((i == nbytes-1)&&(j == limit-1)) - tapc_set_tms(1); - - inbit = tapc_shiftbit(outbit); - - if(msb_first) - { - inbyte |= (inbit << (7-j)); - outbyte <<= 1; - } - else - { - inbyte |= inbit << j; - outbyte >>= 1; - } - } - - //tapc_tms(1); - if(msb_first) - read[-1-i] = inbyte; - else - read[i] = inbyte; + Boolean is_last_byte = (i == nbytes - 1); + Byte inbyte = (Byte) 0; + Byte outbyte; + + if (order == MSB_FIRST) + outbyte = to_write[nbytes - 1 - i]; + else + outbyte = to_write[i]; + + if (is_last_byte) + { + /* How many significant bits are in this byte? */ + nbits = ((n - 1) % BITS_IN_BYTE) + 1; + } + + /* gdb_assert (nbits <= BITS_IN_BYTE); */ + + for (j = 0; j < nbits; j++) + { + Bit outbit, inbit; + +// DEBUG("byte %u, bit %u\n", i, j); + + /* Get the next bit to be output from the current byte. */ + if (order == MSB_FIRST) + { + /* Get MSB from byte. */ + outbit = (Bit) ((outbyte >> BITS_IN_BYTE) & 1); + outbyte <<= 1; + } + else + { + /* Get LSB from byte. */ + outbit = (Bit) (outbyte & 1); + outbyte >>= 1; + } + + /* The last bit of the last byte. */ + if (is_last_byte && (j == nbits - 1)) + { + /* Change to Exit1-DR/IR state before the last bit is shifted: + this is necessary because the TAP Controller performs the + last sample of TDI when exiting the Shift-DR/IR state. */ + tapc_set_TMS(1); + NEXT_STATE(1); + } + + /* Shift one bit in from the JTAG TDO and one bit out to the JTAG TDI. */ + inbit = tapc_shift_bit(outbit); + + /* Add the bit read into the input byte. + N.B. the shift amount will always be positive, as 0 <= j < BITS_IN_BYTE */ + if (order == MSB_FIRST) + inbyte |= (Byte) (inbit << (BITS_IN_BYTE - 1 - j)); + else + inbyte |= (Byte) (inbit << j); + } + + if (order == MSB_FIRST) + to_read[nbytes - 1 - i] = inbyte; + else + to_read[i] = inbyte; } -} + STATE_IS_EITHER(EXIT1_DR, EXIT1_IR); -/* Read the JTAG status register. This indicates - the status of the JTAG for the user. -*/ -static unsigned int -read_jtag_status_reg (void) -{ - unsigned int wr, rd; - int x; - //rw_flag=0; - //tapc_tms(0); // runtest/idle - tapc_tms(1); // select dr - tapc_tms(1); // select ir - tapc_tms(0); // capture ir - tapc_tms(0); // shift ir - - wr = 0x8; // IR = status register - - tapc_shiftnbits(4, (unsigned char *)&wr, (unsigned char*)&rd, 0); - - - - // goto shift DR - tapc_tms(1); // update ir - //tapc_tms(0); // runtest/idle - tapc_tms(1); // select dr - tapc_tms(0); // capture dr - tapc_tms(0); // shift dr - - rd = 0; - - // read 1 bit, if it is zero then keep reading - rd = tapc_shiftbit(0); - if (rd) - return rd; - - rd |= tapc_shiftbit(0) << 1; - if (rd) - return rd; - - rd |= tapc_shiftbit(0) << 2; - - /* the last bit is optional */ - /*rd |= tapc_shiftbit(0) << 3;*/ - - return rd; + LEAVEMSG; } -/* Interpret the status message. */ -static void -print_jtag_status_reg_val (unsigned int status) +/* Read the JTAG Status Register. + This indicates the status of the JTAG transaction that has been attempted. */ + +static JTAG_TransactionStatus +read_jtag_status_register( void) { - int i ; - char * messages [] = { "Stalled" , "Failure", "Ready", "PC Selected" }; - for(i=0;i<=3;i++) - { - printf_filtered("%s %s \t",(status & 1)?"":"Not",messages[i]); - status = status >> 1; - } - printf_filtered("\n"); + JTAG_RegisterContents rd, wr; + Bit bit; + + ENTERMSG; + + STATE_IS_EITHER(RUN_TEST_IDLE, UPDATE_DR); + + CHANGE_STATE(1, SELECT_DR_SCAN); + CHANGE_STATE(1, SELECT_IR_SCAN); + CHANGE_STATE(0, CAPTURE_IR); + CHANGE_STATE(0, SHIFT_IR); + + wr = JTAG_STATUS_REGISTER; + + tapc_shift_N_bits(BITS_IN_REGISTER_CODE, (Byte*) &wr, (Byte*) &rd, MSB_LAST); + + CHANGE_STATE(1, UPDATE_IR); +// CHANGE_STATE(0, RUN_TEST_IDLE); + CHANGE_STATE(1, SELECT_DR_SCAN); + CHANGE_STATE(0, CAPTURE_DR); + CHANGE_STATE(0, SHIFT_DR); + + /* The JTAG Status Register is read-only, and any bits shifted in are + ignored - hence the parameter to tapc_shift_bit is irrelevant here. */ + + /* Read Stalled bit; if it is zero then keep reading. */ + bit = tapc_shift_bit(0); + if (bit) + return STALLED; + + /* Read Failed bit; if it is zero then keep reading. */ + bit = tapc_shift_bit(0); + if (bit) + return FAILURE; + + /* Read Ready bit. */ + bit = tapc_shift_bit(0); + if (bit) + return READY; + + /* The last bit (PC_SEL) is optional. */ + + return NOT_READY; } +/* Write a value to a JTAG register. + enter in Update-DR/IR state or Run-Test/Idle. + exit in Update-DR */ -/* Write a JTAG Command to a JTAG register. - enter in update dr/ir state - or Test-Logic-Reset. - exit in update dr -*/ static void -write_jtag_reg (char regnum, unsigned int data, int ndatabits) +write_jtag_reg (JTAG_Register regnum, + JTAG_RegisterContents data, + unsigned int num_data_bits) { - unsigned int wr=0,rd=0; - rw_flag = WRITE_TO_AA3 ; - // tapc_tms(0); // runtest/idle - tapc_tms(1); // select dr - tapc_tms(1); // select ir - tapc_tms(0); // capture ir - tapc_tms(0); // shift ir - - - tapc_shiftnbits(4, (unsigned char *)®num, (unsigned char *)&rd, 0); - - - tapc_tms(1); // update ir - - tapc_tms(1); // select dr - tapc_tms(0); // capture dr - tapc_tms(0); // shift dr - - tapc_shiftnbits(ndatabits, (unsigned char *)&data, - (unsigned char *)&rd, 0); - tapc_tms(1); // update dr + Byte num = (Byte) regnum; + JTAG_RegisterContents rd = 0; + + ENTERARGS("regnum %d <== 0x%08X (:%d)", regnum, data, num_data_bits); + + STATE_IS_ONE_OF(UPDATE_DR, UPDATE_IR, RUN_TEST_IDLE); + +// CHANGE_STATE(0, RUN_TEST_IDLE); + CHANGE_STATE(1, SELECT_DR_SCAN); + CHANGE_STATE(1, SELECT_IR_SCAN); + CHANGE_STATE(0, CAPTURE_IR); + CHANGE_STATE(0, SHIFT_IR); + + tapc_shift_N_bits(BITS_IN_REGISTER_CODE, &num, (Byte*) &rd, MSB_LAST); + + CHANGE_STATE(1, UPDATE_IR); + CHANGE_STATE(1, SELECT_DR_SCAN); + CHANGE_STATE(0, CAPTURE_DR); + CHANGE_STATE(0, SHIFT_DR); + + tapc_shift_N_bits(num_data_bits, (Byte*) &data, (Byte*) &rd, MSB_LAST); + + CHANGE_STATE(1, UPDATE_DR); + + DEBUG("written 0x%08X to JTAG %s register\n", data, JTAG_register_name(regnum)); + + LEAVEMSG; } - -// enter in update dr/ir state -// exit in update dr -static unsigned int -read_jtag_reg (char regnum, int ndatabits) + +/* Read a value from a JTAG register. + enter in Update-DR/IR state + exit in Update-DR */ + +static JTAG_RegisterContents +read_jtag_reg (JTAG_Register regnum, unsigned int num_data_bits) { - unsigned int wr=0x0,rd=0; - rw_flag = READ_FROM_AA3; - // tapc_tms(0); // runtest/idle - tapc_tms(1); // select dr - tapc_tms(1); // select ir - tapc_tms(0); // capture ir - tapc_tms(0); // shift ir - - tapc_shiftnbits(4, (unsigned char *)®num, (unsigned char *)&rd, 0); - tapc_tms(1); // update ir - - /* JTAG registers can be read without going to run-test/idle state. - - Doing tapc_tms(0) will take us to run-test/idle state. - This will make JTAG perform the transaction as per TCR. - We dont want this. - */ - // tapc_tms(0); // runtest/idle - tapc_tms(1); // select dr - tapc_tms(0); // capture dr - tapc_tms(0); // shift dr - - tapc_shiftnbits(ndatabits, (unsigned char *)&wr, (unsigned char *)&rd, 0); - tapc_tms(1); // update dr + Byte num = (Byte) regnum; + JTAG_RegisterContents wr = 0, rd = 0; + + ENTERARGS("regnum %u, %u bits", regnum, num_data_bits); + + STATE_IS_EITHER(UPDATE_DR, UPDATE_IR); + +// CHANGE_STATE(0, RUN_TEST_IDLE); + CHANGE_STATE(1, SELECT_DR_SCAN); + CHANGE_STATE(1, SELECT_IR_SCAN); + CHANGE_STATE(0, CAPTURE_IR); + CHANGE_STATE(0, SHIFT_IR); + + tapc_shift_N_bits(BITS_IN_REGISTER_CODE, &num, (Byte*) &rd, MSB_LAST); + + CHANGE_STATE(1, UPDATE_IR); + + /* JTAG registers can be read without going to Run-Test/Idle state. + + Doing CHANGE_STATE(0) would take us to Run-Test/Idle state. This would + make JTAG perform the transaction in the Transaction Command Register. + We don't want that! */ +// CHANGE_STATE(0, RUN_TEST_IDLE); + CHANGE_STATE(1, SELECT_DR_SCAN); + CHANGE_STATE(0, CAPTURE_DR); + CHANGE_STATE(0, SHIFT_DR); + + tapc_shift_N_bits(num_data_bits, (Byte*) &wr, (Byte*) &rd, MSB_LAST); + CHANGE_STATE(1, UPDATE_DR); + + DEBUG("read 0x%08X from JTAG %s register\n", rd, JTAG_register_name(regnum)); return rd; } +/* -------------------------------------------------------------------------- */ +/* 5) JTAG transaction functions */ +/* -------------------------------------------------------------------------- */ - - - +/* Start a JTAG transaction. + Parameters: + command: the JTAG command to be performed + address: the address (memory address or register number) for the command +*/ -static int -arc_jtag_read_core_reg (unsigned int regnum, unsigned int *readbuf) +static void +start_jtag_transaction (JTAG_RegisterContents command, + JTAG_RegisterContents address) { - unsigned int rd, wr, data, i; - check_and_raise_error_if_jtag_closed(); - tapc_reset(); - tapc_tms(0);//run-test idle - write_jtag_reg(0xA, regnum, 32);//update dr + ENTERARGS("command = %d, address = 0x%x", command, address); - + STATE_IS_ONE_OF(UPDATE_DR, UPDATE_IR, RUN_TEST_IDLE); - // Setup instruction register to 0x9 indicating - // a JTAG instruction is being downloaded. - // jtag transaction command reg = 0x5 (read core reg) - write_jtag_reg(0x9, 0x5, 4);//update dr + /* N.B. do NOT reset the TAP Controller at the start of each transaction, as + that would re-initialize the JTAG registers to their default values + (whatever those might be), so invalidating the optimisation of the + use of the Address and Transaction Command registers performed by + this module. */ - /* Perform the transaction. - */ - tapc_tms(0); // run-test idle - - // poll the status + if (command == READ_MEMORY_LOCATION || command == WRITE_MEMORY_LOCATION) + { + gdb_assert(IS_WORD_ALIGNED(address)); + } - for (i=0;i>8) & 0xff; - break; - - case 3: - ptr[0] = rd & 0xff; - ptr[1] = (rd>>8) & 0xff; - ptr[2] = (rd>>16) & 0xff; - break; - } - - return ((i*4)+len_mod); - +#ifdef JTAG_DATA_REGISTER_IS_CORRUPTED_BY_WRITE + /* Load the pattern into the JTAG Data Register. */ + write_jtag_reg(JTAG_DATA_REGISTER, pattern, BITS_IN_WORD); +#endif + +#ifdef CHECK_JTAG_DATA_REGISTER + check_Data_Register(pattern); +#endif + + /* Write the word - this increments the address in the JTAG + Address Register by the word size, so the register does not + have to be re-loaded with the next address. */ + if (perform_jtag_transaction(Memory, JTAG_WRITE_FAILURE) != JTAG_SUCCESS) + { + DEBUG("FAIL: written %u bytes\n", total_written); + + /* Failed - just return amount of data written so far. */ + return total_written; + } + + total_written += BYTES_IN_WORD; } - + return total_written; } +/* -------------------------------------------------------------------------- */ +/* 7) main operations */ +/* -------------------------------------------------------------------------- */ + +/* These are the functions that are called from outside this module via the + pointers in the arc_jtag_ops global object. + N.B. none of these functions are called from within this module. */ -/* - * Return the Processor Variant that is connected. - */ -int -arc_get_architecture() + +/* Read a processor core register. */ + +static JTAG_OperationStatus +jtag_read_core_reg (ARC_RegisterNumber regnum, ARC_RegisterContents *contents) { - if (ARCProcessor == UNSUPPORTED) { - unsigned int value; - - /* Read the Identity Register. */ - if (arc_jtag_read_aux_reg(4, &value) == JTAG_READ_FAILURE) - error("Failure reading from auxillary IDENTITY register"); - - /* Get Identity Mask. */ - value &= 0xff ; - - if((value >= 0x30) && (value <= 0x3f)) - ARCProcessor = ARC700; - else if((value >= 0x20) && (value <= 0x2f)) - ARCProcessor = ARC600; - else if((value >= 0x10) && (value <= 0x1f)) - ARCProcessor = A5; - else if ((value >= 0x00) && (value <= 0x0f)) - ARCProcessor = A4; - else - error("Unsupported Processor Version 0x%x\n", value); - } - - return ARCProcessor; + ENTERARGS("regnum %d", regnum); + + return read_processor_register(regnum, READ_CORE_REGISTER, contents); } +/* Try to open the JTAG interface. + Returns TRUE for success. */ -static void -arc_jtag_open (void) +static Boolean +jtag_open (ARC_RegisterNumber mem_subsys) { - int retval; - unsigned int read_status = 0; - sigaddset(&block_mask,SIGINT); - retval = gpio_setup(); - if(retval != 0) + ENTERMSG; + + if (arc_jtag_ops.status == JTAG_CLOSED) { - error("Unable to open JTAG Port .%s \n",(retval == EINVAL)? - "Invalid Params":"Permission Denied" ); - arc_jtag_ops.jtag_status = JTAG_CLOSED; - return ; + JTAG_OperationStatus status; + + /* Make sure that the GPIO driver is open. */ + if (!gpio_open()) + return FALSE; + + set_interface(JTAG_OPENED); + + tapc_reset(); + + /* Load the number of the MEMSUBSYS BCR that is to be read into the JTAG + Address Register. */ + start_jtag_transaction(READ_AUX_REGISTER, mem_subsys); + + status = perform_jtag_transaction(Register, JTAG_READ_FAILURE); + + if (status == JTAG_SUCCESS) + { + /* Read the register contents from the JTAG Data Register. */ + ARC_RegisterContents contents = + (ARC_RegisterContents) read_jtag_reg(JTAG_DATA_REGISTER, BITS_IN_REGISTER); + + DEBUG("MEMSUBSYS BCR: 0x%08X\n", contents); + + target_is_big_endian = ((contents & 4) != 0); + } + else + { + warning(_("can not discover endianness of target\n")); + return FALSE; + } + + DEBUG("arcjtag opened\n"); } - arc_jtag_ops.jtag_status = JTAG_OPENED; - tapc_reset(); - //Writing debug bit of debug register - - do - { - /* Note: Reading the status/status32 register here to - check if halt bit is set*/ - if (IS_A4) { - if(arc_jtag_read_aux_reg( 0x0, &read_status) == JTAG_READ_FAILURE) - error("Failure reading auxillary register 0xA\n"); - if(read_status & A4_HALT_VALUE) - break; - } - else { - if(arc_jtag_read_aux_reg( 0xA, &read_status) == JTAG_READ_FAILURE) - error("Failure reading auxillary register 0xA\n"); - if(read_status & ARC700_HALT_VALUE) - break; - } - printf_filtered("Processor running. Trying to halt.....\n"); - if(arc_jtag_write_aux_reg(0x5,0x2)==JTAG_WRITE_FAILURE) - error("Failure writing 0x2 to auxillary register 0x5:debug register\n"); - }while(1); - if (arc_jtag_ops.arc_jtag_state_machine_debug) - printf_filtered("Processor halted.....\n"); + LEAVEMSG; + return TRUE; } -static void -arc_jtag_close (void) + +/* Close the JTAG interface. */ + +static void +jtag_close (void) { - ARCProcessor = UNSUPPORTED; + ENTERMSG; - if(arc_jtag_ops.jtag_status != JTAG_CLOSED) + if (arc_jtag_ops.status == JTAG_OPENED) { - tapc_reset(); - /* closing file descriptor opened for communication with gpio driver */ - close(fd); - if(arc_jtag_ops.arc_jtag_state_machine_debug) - printf_filtered("arc-jtag closed\n"); - arc_jtag_ops.jtag_status = JTAG_CLOSED; + tapc_reset(); + + /* Close the file descriptor opened for communication with gpio driver. */ + gpio_close(); + + set_interface(JTAG_CLOSED); + +#ifdef STATE_MACHINE_DEBUG + current_state = UNDEFINED; +#endif + + DEBUG("arcjtag closed\n"); } + LEAVEMSG; } -static void -arc_jtag_wait(void) + +/* Reset the target JTAG controller. */ + +static void +jtag_reset (void) { - unsigned int read_status; - check_and_raise_error_if_jtag_closed(); - do - { - sigprocmask(SIG_BLOCK,&block_mask, NULL); - - if (IS_A4) { - if(arc_jtag_read_aux_reg( 0x0, &read_status) == JTAG_READ_FAILURE) - error("Failure reading auxillary register 0x0\n"); - //FIXMEA: if(debug_arc_jtag_target_message) - // printf_filtered ("\n Read Status: 0x%x,%d\n", read_status, read_status); - - if(read_status & A4_HALT_VALUE) - { - sigprocmask(SIG_BLOCK,&block_mask, NULL); - break; - } - } - else { - if(arc_jtag_read_aux_reg( 0xA, &read_status) == JTAG_READ_FAILURE) - error("Failure reading auxillary register 0xA\n"); - if(read_status & ARC700_HALT_VALUE) - { - sigprocmask(SIG_BLOCK,&block_mask, NULL); - break; - - } - } - sigprocmask(SIG_UNBLOCK,&block_mask, NULL); - }while(1); - - while (1) + ENTERMSG; + tapc_reset(); + LEAVEMSG; +} + + +/* Reset the target board. */ + +static void +jtag_reset_board (void) +{ + ENTERMSG; + + /* Make sure that the GPIO driver is open. */ + if (gpio_open()) { - if (arc_jtag_read_aux_reg (0x5,&read_status) == JTAG_READ_FAILURE) - error ("Failure reading Debug register \n"); - if (!(read_status & 0x80000000)) - break; + /* Writing 9 did not work. But that's what the manual says. Hmmm. */ +// gpio_write (CONTROL_PORT, 9); + + /* What is this for? */ + gpio_write(CONTROL_PORT, (Byte) JTAG_TCK); + gpio_write(CONTROL_PORT, (Byte) 0xD); + gpio_write(CONTROL_PORT, (Byte) JTAG_TCK); + gpio_write(DATA_PORT, (Byte) 0); + gpio_write(DATA_PORT, (Byte) JTAG_TMS); + gpio_write(DATA_PORT, (Byte) 0); + + tapc_reset(); } + + LEAVEMSG; +} + + +/* Check that the JTAG interface is open. + If it is closed, 'error' is called. */ + +static void jtag_check_open (void) +{ + if (arc_jtag_ops.status == JTAG_CLOSED) + interface_is_closed(); } + +/* -------------------------------------------------------------------------- */ +/* 8) interface management */ +/* -------------------------------------------------------------------------- */ + +/* Report that the JTAG interface is closed. */ + static void -arc_jtag_reset_board (void) +interface_is_closed (void) { - char c = 5; - int auxval = 2 ; - check_and_raise_error_if_jtag_closed (); - - /* - Writing 9 did not work. But thats - what the manual says. Hmmm. - gpio_write (CONTROL_PORT, &c); - */ - - gpio_write ( CONTROL_PORT, &c); - c = 0xd; - gpio_write ( CONTROL_PORT, &c); - c = 5; - gpio_write ( CONTROL_PORT, &c); - - if (arc_jtag_write_aux_reg(0x5 , 2) == JTAG_WRITE_FAILURE) - error ("Failure writing to auxiliary register Debug\n"); - - c = 0; - gpio_write ( 0x378, &c); - c = 0x40; - gpio_write ( 0x378, &c); - c = 0; - gpio_write ( 0x378, &c); - - tapc_reset(); + error(_("JTAG connection is closed. " + "Use command 'target " ARC_TARGET_NAME "' first.")); } +/* Set up the function pointers in the arc_jtag_ops structure according to + whether the JTAG interface is open or closed. Note that if the interface is + closed, all the pointers point to the 'interface_is_closed' function - so any + attempt to invoke one of those operations results in an error; but if the + interface is open, they point to the appropriate operations (which may be + called without incurring the overhead of a check on the interface status). */ + +static void +set_interface (JTAG_Status status) +{ + arc_jtag_ops.status = status; + + if (status == JTAG_OPENED) + { + arc_jtag_ops.memory_read_word = jtag_read_word; + arc_jtag_ops.memory_write_word = jtag_write_word; + arc_jtag_ops.memory_read_chunk = jtag_read_chunk; + arc_jtag_ops.memory_write_chunk = jtag_write_chunk; + arc_jtag_ops.memory_write_pattern = jtag_write_pattern; + arc_jtag_ops.read_aux_reg = jtag_read_aux_reg; + arc_jtag_ops.write_aux_reg = jtag_write_aux_reg; + arc_jtag_ops.read_core_reg = jtag_read_core_reg; + arc_jtag_ops.write_core_reg = jtag_write_core_reg; + arc_jtag_ops.reset = jtag_reset; + } + else + { + typedef unsigned int (*Read_Word) (ARC_Address, ARC_Word*); + typedef unsigned int (*Write_Word) (ARC_Address, ARC_Word); + typedef unsigned int (*Transfer_Chunk) (ARC_Address, ARC_Byte*, unsigned int); + typedef unsigned int (*Write_Pattern) (ARC_Address, ARC_Word, unsigned int); + typedef JTAG_OperationStatus (*Read_Register) (ARC_RegisterNumber, ARC_RegisterContents*); + typedef JTAG_OperationStatus (*Write_Register) (ARC_RegisterNumber, ARC_RegisterContents); + + /* The type casts avoid "assignment from incompatible pointer type" warnings + at compile-time. */ + arc_jtag_ops.memory_read_word = (Read_Word) interface_is_closed; + arc_jtag_ops.memory_write_word = (Write_Word) interface_is_closed; + arc_jtag_ops.memory_read_chunk = (Transfer_Chunk) interface_is_closed; + arc_jtag_ops.memory_write_chunk = (Transfer_Chunk) interface_is_closed; + arc_jtag_ops.memory_write_pattern = (Write_Pattern) interface_is_closed; + arc_jtag_ops.read_aux_reg = (Read_Register) interface_is_closed; + arc_jtag_ops.write_aux_reg = (Write_Register) interface_is_closed; + arc_jtag_ops.read_core_reg = (Read_Register) interface_is_closed; + arc_jtag_ops.write_core_reg = (Write_Register) interface_is_closed; + arc_jtag_ops.reset = interface_is_closed; + } +} + + +/* -------------------------------------------------------------------------- */ +/* externally visible functions */ +/* -------------------------------------------------------------------------- */ + +/* Initialize the module. This function is called from the gdb core on start-up. */ + void _initialize_arc_jtag_ops (void) { - arc_jtag_ops.name=NULL; - arc_jtag_ops.jtag_open = arc_jtag_open; - arc_jtag_ops.jtag_close = arc_jtag_close; - arc_jtag_ops.jtag_memory_write = arc_jtag_write_chunk; - arc_jtag_ops.jtag_memory_read = arc_jtag_read_chunk; - arc_jtag_ops.jtag_memory_chunk_write = arc_jtag_write_chunk; - arc_jtag_ops.jtag_memory_chunk_read = arc_jtag_read_chunk; - arc_jtag_ops.jtag_write_aux_reg = arc_jtag_write_aux_reg; - arc_jtag_ops.jtag_read_aux_reg = arc_jtag_read_aux_reg; - arc_jtag_ops.jtag_read_core_reg = arc_jtag_read_core_reg; - arc_jtag_ops.jtag_write_core_reg = arc_jtag_write_core_reg; - arc_jtag_ops.jtag_wait = arc_jtag_wait; - arc_jtag_ops.jtag_reset_board = arc_jtag_reset_board; - arc_jtag_ops.jtag_status = JTAG_CLOSED ; + ENTERMSG; + + /* Initialize the arc_jtag_ops global variable. */ + + arc_jtag_ops.state_machine_debug = FALSE; + arc_jtag_ops.retry_count = 50; + + /* We want to be able to reset the board, and check whether it is connected, + regardless of the connection state. */ + arc_jtag_ops.open = jtag_open; + arc_jtag_ops.close = jtag_close; + arc_jtag_ops.check_open = jtag_check_open; + arc_jtag_ops.reset_board = jtag_reset_board; + + /* The JTAG interface is initially closed. */ + set_interface(JTAG_CLOSED); } + +/******************************************************************************/ diff --git a/gdb/arc-jtag-ops.h b/gdb/arc-jtag-ops.h index dbf49e6..d278acd 100644 --- a/gdb/arc-jtag-ops.h +++ b/gdb/arc-jtag-ops.h @@ -1,62 +1,126 @@ -/* Target dependent code for ARC700, for GDB, the GNU debugger. +/* Target dependent code for ARC processor family, for GDB, the GNU debugger. - Copyright 2005 Free Software Foundation, Inc. + Copyright 2005, 2008, 2009 Free Software Foundation, Inc. Contributed by Codito Technologies Pvt. Ltd. (www.codito.com) - Authors: - Sameer Dhavale - Soam Vasani + Authors: + Sameer Dhavale + Soam Vasani + Richard Stuckey This file is part of GDB. - + 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 + the Free Software Foundation; either version 3 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. -*/ + along with this program. If not, see . */ + +/******************************************************************************/ +/* */ +/* Outline: */ +/* This header file defines the JTAG interface to an ARC processor. */ +/* */ +/* Operations are provided for: */ +/* 1) controlling the interface */ +/* 2) reading/writing the core registers of the processor */ +/* 3) reading/writing the auxiliary registers of the processor */ +/* 4) reading/writing single words in the target memory */ +/* 5) reading/writing blocks in the target memory */ +/* */ +/* The addresses specified for the memory word read/write operations must */ +/* be word-aligned. Those specified for the memory block read/write */ +/* operations may have any alignment; these operations may transfer an */ +/* arbitrary number of bytes. */ +/* */ +/* Usage: */ +/* The module exports a global variable arc_jtag_ops which holds pointers */ +/* to the functions for the operations, as well as some state information.*/ +/* This variable is initialized by the module's initialization function */ +/* which must be called before any use is made of the module (N.B. the */ +/* call to this function is generated by the gdb build mechanism, so this */ +/* function should not be explicitly called). */ +/* */ +/* The variable arc_jtag_ops.retry_count controls how many repeated */ +/* attempts are made if a read/write operation fail; this variable is */ +/* initially set to 50. */ +/* */ +/* Debugging Facilities: */ +/* If the variable arc_jtag_ops.state_machine_debug is set to TRUE then */ +/* trace information will be output. */ +/* */ +/* Host/Target Byte Order: */ +/* The register contents returned by the read/write aux/core register */ +/* functions, or supplied to them, are in little-endian byte order. */ +/* */ +/* The memory contents returned by the read/write word/chunk/pattern */ +/* functions, or supplied to them, are in host byte order; the functions */ +/* perform whatever byte-swapping is required by the endiannness of the */ +/* target. */ +/* */ +/******************************************************************************/ + +#ifndef ARC_JTAG_OPS +#define ARC_JTAG_OPS + +/* ARC header files */ +#include "arc-support.h" + + +#define ARC_TARGET_NAME "arcjtag" + + +typedef enum +{ + JTAG_SUCCESS, + JTAG_READ_FAILURE, + JTAG_WRITE_FAILURE +} JTAG_OperationStatus; -#define ARC_NR_CORE_REGS 64 -#define MAX_ARC700_REG_SIZE 4 -#define JTAG_READ_FAILURE 0 -#define JTAG_WRITE_FAILURE 0 -enum arc_jtag_status - { +typedef enum +{ JTAG_OPENED, - JTAG_CLOSED, - JTAG_RUNNING - }; - -struct jtag_ops{ - char *name; - void (*jtag_open) (void); - void (*jtag_close) (void); - int (*jtag_memory_write) (unsigned int, unsigned int *, int); - int (*jtag_memory_chunk_write) (unsigned int, unsigned int *, int); - int (*jtag_memory_read) (unsigned int, unsigned int *, int); - int (*jtag_memory_chunk_read) (unsigned int, unsigned int *, int); - int (*jtag_read_aux_reg) (unsigned int, unsigned int *); - int (*jtag_write_aux_reg) (unsigned int, unsigned int); - int (*jtag_read_core_reg) (unsigned int, unsigned int *); - int (*jtag_write_core_reg) (unsigned int, unsigned int); - void (*jtag_wait) (void); - void (*jtag_reset_board) (void); - enum arc_jtag_status jtag_status; - int arc_jtag_state_machine_debug; -}; - - -#define IS_ARC700 (arc_get_architecture() == ARC700) -#define IS_ARC600 (arc_get_architecture() == ARC600) -#define IS_A5 (arc_get_architecture() == A5) -#define IS_A4 (arc_get_architecture() == A4) + JTAG_CLOSED +} JTAG_Status; + + +typedef struct +{ + JTAG_Status status; + unsigned int retry_count; + Boolean state_machine_debug; + + Boolean (*open) (ARC_RegisterNumber mem_subsys); + void (*close) (void); + void (*reset) (void); + void (*reset_board) (void); + void (*check_open) (void); + + /* These operations return the number of bytes read/written. */ + unsigned int (*memory_read_word) (ARC_Address address, ARC_Word *data); /* single word. */ + unsigned int (*memory_write_word) (ARC_Address address, ARC_Word data); /* single word. */ + unsigned int (*memory_read_chunk) (ARC_Address address, ARC_Byte *data, unsigned int words); /* block. */ + unsigned int (*memory_write_chunk) (ARC_Address address, ARC_Byte *data, unsigned int words); /* block. */ + unsigned int (*memory_write_pattern) (ARC_Address address, ARC_Word pattern, unsigned int words); /* block. */ + + JTAG_OperationStatus (*read_aux_reg) (ARC_RegisterNumber reg, ARC_RegisterContents *contents); + JTAG_OperationStatus (*write_aux_reg) (ARC_RegisterNumber reg, ARC_RegisterContents contents); + JTAG_OperationStatus (*read_core_reg) (ARC_RegisterNumber reg, ARC_RegisterContents *contents); + JTAG_OperationStatus (*write_core_reg) (ARC_RegisterNumber reg, ARC_RegisterContents contents); +} JTAG_Operations; + + +extern JTAG_Operations arc_jtag_ops; + + +#endif /* ARC_JTAG_OPS */ +/******************************************************************************/ diff --git a/gdb/arc-jtag-tdep.c b/gdb/arc-jtag-tdep.c deleted file mode 100644 index 8401538..0000000 --- a/gdb/arc-jtag-tdep.c +++ /dev/null @@ -1,638 +0,0 @@ -/* Target dependent code for ARC700, for GDB, the GNU debugger. - - Copyright 2005 Free Software Foundation, Inc. - - Contributed by Codito Technologies Pvt. Ltd. (www.codito.com) - - Authors: - Soam Vasani - Ramana Radhakrishnan - - This file is part of GDB. - - 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. -*/ -#include - -#include "defs.h" -#include "osabi.h" -#include "frame.h" -#include "regcache.h" -#include "gdb_assert.h" -#include "inferior.h" -#include "gdbcmd.h" -#include "reggroups.h" - -#include "arc-tdep.h" -#include "arc-jtag.h" - - -#ifdef ARC4_JTAG -/* brk */ -unsigned int a4_jtag_breakpoint_size = 4; -unsigned char a4_jtag_breakpoint_insn[4] = { 0x00, 0xfe, 0xff, 0x1f }; -#define A4_HALT_VALUE 0x02000000 -#else -/* brk_s */ -unsigned int arc700_jtag_breakpoint_size = 2; -unsigned char arc700_jtag_breakpoint_insn[2] = { 0xff, 0x7f }; -#endif - - - -struct arc_reg_info -{ - char *name ; - int hw_regno; - char *description; -#ifdef ARC4_JTAG - enum arc4_jtag_regnums gdbregno; -#else - enum arc700_jtag_regnums gdbregno; -#endif - enum ARCProcessorVersion arcVersionSupported; -}; - - - -static const char * -arc_jtag_register_name (int regno) -{ - static char jtag_names[][30] = { - "r0", "r1", "r2", "r3", "r4", "r5", "r6", - "r7", "r8", "r9", "r10", "r11", "r12", "r13", - "r14", "r15", "r16", "r17", "r18", "r19", "r20", - "r21", "r22", "r23", "r24", "r25", "r26", - - "fp", - "sp", - "ilink1", - "ilink2", - "blink", - - /* Extension core regs are 32..59 inclusive. */ - "r32", "r33", "r34", "r35", "r36", "r37", "r38", "r39", - "r40", "r41", "r42", "r43", "r44", "r45", "r46", "r47", "r48", "r49", - "r50", "r51", "r52", "r53", "r54", "r55", "r56", "r57", "r58", "r59", - - "lp_count", - - /* 61 is reserved, 62 is not a real register. */ - /*FIXMEA: The following 3 are supposed to be registers - that are used only to encode immediate values in A4*/ - "r61", - "r62", - - "pcl", - - /* Now the aux registers. */ - - "status", - "semaphore", - "lp_start", - "lp_end", - "identity", - "debug", - -#ifndef ARC4_JTAG - "pc", - "status32", - "status32_l1", - "status32_l2", - - "count0", - "control0", - "limit0", - "int_vector_base", - "aux_macmode", - "aux_irq_lv12", - - - "count1", - "control1", - "limit1", - "aux_irq_lev", - "aux_irq_hint", - "eret", - "erbta", - "erstatus", - "ecr", - "efa", - "icause1", - "icause2", - "aux_ienable", - "aux_itrigger", - "xpu", - "bta", - "bta_l1", - "bta_l2", - "aux_irq_pulse_cancel", - "aux_irq_pending", - - /* Build configuration registers. */ - "bcr_0", - "dccm_base_build", - "crc_base_build", - "bta_link_build", - "dvbf_build", - "tel_instr_build", - "bcr_6", - "memsubsys", - "vecbase_ac_build", - "p_base_address", - "bcr_a", - "bcr_b", - "bcr_c", - "bcr_d", - "bcr_e", - "mmu_build", - "arcangel_build", - "bcr_11", - "d_cache_build", - "madi_build", - "dccm_build", - "timer_build", - "ap_build", - "icache_build", - "iccm_build", - "dspram_build", - "mac_build", - "multiply_build", - "swap_build", - "norm_build", - "minmax_build", - "barrel_build", -#endif - - }; - - gdb_assert(ARRAY_SIZE (jtag_names) == NUM_REGS + NUM_PSEUDO_REGS); - gdb_assert(regno >=0 && regno < NUM_REGS + NUM_PSEUDO_REGS); - - return jtag_names[regno]; -} - -int -arc_jtag_register_reggroup_p (int regnum, struct reggroup *group) -{ - /* These registers don't exist, so they are not in any reggroup. */ - if ((regnum >= 32 && regnum <= 59) || (regnum == 61) || (regnum == 62)) - return 0; - - /* Which regs to save/restore ? */ - if ((group == save_reggroup || group == restore_reggroup)) - { - /* Save/restore: - 1. all core regs, except PCL (PCL is not writable) - 2. aux regs LP_START..LP_END (IDENTITY is not writable) - 3. aux regs PC_REGNUM..STATUS32_L2 - 3. aux regs ERET..EFA */ - return ( ( regnum >= 0 && regnum < ARC_PCL_REGNUM) - || ( regnum >= ARC_LP_START_REGNUM && regnum<= ARC_LP_END_REGNUM) -#ifdef ARC4_JTAG - || ( regnum == ARC_STATUS_REGNUM) -#else - || ( regnum >= ARC_PC_REGNUM && regnum <= ARC_STATUS32_L2_REGNUM) - || ( regnum >= ARC_ERET_REGNUM && regnum <= ARC_EFA_REGNUM) -#endif - ); - } - - return -1; -} - -static void -arc_jtag_print_registers_info (struct gdbarch *gdbarch, struct ui_file *file, - struct frame_info *frame, int regnum, int all) -{ - int i; - - if (regnum >= 0 ) - { - default_print_registers_info (gdbarch, file, frame, regnum, all); - return; - } - - /* if regnum < 0 , print all registers */ - - for (i=0; i <= 26; ++i) - default_print_registers_info (gdbarch, file, frame, i, all); - default_print_registers_info (gdbarch, file, frame, - ARC_FP_REGNUM, all); - default_print_registers_info (gdbarch, file, frame, - ARC_SP_REGNUM, all); - default_print_registers_info (gdbarch, file, frame, - ARC_ILINK1_REGNUM, all); - default_print_registers_info (gdbarch, file, frame, - ARC_ILINK2_REGNUM, all); - default_print_registers_info (gdbarch, file, frame, - ARC_BLINK_REGNUM, all); - default_print_registers_info (gdbarch, file, frame, - ARC_LP_COUNT_REGNUM, all); - - /* now the aux registers */ - if (!all) - { - default_print_registers_info (gdbarch, file, frame, - ARC_LP_START_REGNUM, all); - default_print_registers_info (gdbarch, file, frame, - ARC_LP_END_REGNUM, all); - -#ifndef ARC4_JTAG - default_print_registers_info (gdbarch, file,frame, - ARC_STATUS32_REGNUM, all); - default_print_registers_info (gdbarch, file, frame, - ARC_BTA_REGNUM, all); - default_print_registers_info (gdbarch, file, frame, - ARC_EFA_REGNUM, all); - default_print_registers_info (gdbarch, file, frame, - ARC_ERET_REGNUM, all); - default_print_registers_info (gdbarch, file, frame, - ARC_STATUS32_L1_REGNUM, all); - default_print_registers_info (gdbarch, file, frame, - ARC_STATUS32_L2_REGNUM, all); - default_print_registers_info (gdbarch, file, frame, - ARC_ERSTATUS_REGNUM, all); - - - /* PC */ - default_print_registers_info (gdbarch, file, frame, - ARC_PC_REGNUM, all); -#endif - } - else - { - /* This part needs cleaning up. */ - for (i = ARC_STATUS_REGNUM; -#ifndef ARC4_JTAG - i <= ARC_AUX_IRQ_PENDING_REGNUM; -#else /*FIXMEA*/ - i <= ARC_DEBUG_REGNUM; -#endif - i ++ ) - default_print_registers_info (gdbarch, file, frame , - i, all); - - - for (i = ARC_STATUS_REGNUM ; -#ifndef ARC4_JTAG - i <= ARC_AUX_IRQ_PENDING_REGNUM; -#else /*FIXMEA*/ - i <= ARC_DEBUG_REGNUM; -#endif - i ++ ) - default_print_registers_info (gdbarch, file, frame, - i, all); - -#ifndef ARC4_JTAG - for (i = ARC_BCR_1_REGNUM ; - i <= ARC_BCR_5_REGNUM ; - i ++ ) - default_print_registers_info (gdbarch, file , frame, - i , all); - - for (i = ARC_BCR_7_REGNUM ; - i <= ARC_BCR_9_REGNUM; - i ++ ) - default_print_registers_info (gdbarch, file, frame, - i , all); - - for (i = ARC_BCR_F_REGNUM; - i <= ARC_BCR_10_REGNUM; - i ++ ) - default_print_registers_info (gdbarch, file, frame , - i , all); - - for (i = ARC_BCR_12_REGNUM; - i <= ARC_BCR_1F_REGNUM; - i ++) - default_print_registers_info (gdbarch, file, frame , - i , all); -#endif //if no ARC4_JTAG - - - } -} - -/* Command: aux-read - - Read and display a range of aux registers. Some of the aux registers - (pc, debug, etc.) are part of the register set, but this is a more - general interface. - - We should eventually change this to use the ui_out stuff rather than - printf_filtered. */ -static void -arc_jtag_aux_read_command (char *arg, int from_tty) -{ - char *arg2 = 0; - struct expression *expr; - struct value *val; - struct cleanup *old_chain = 0; - int auxregno, auxregno2 = 0, nrregs; - unsigned int *buf; - int i, nrtransfered; - - if (!arg) - { - printf_filtered ("aux-read []\n"); - return; - } - - /* strip leading spaces */ - while(*arg == ' ') - arg++; - - /* two arguments ? */ - /* This assumes that the first arg cannot have spaces. (The disas command - also seems to work this way.) */ - arg2 = strchr (arg, ' '); - - /* get the second one */ - if (arg2) - { - struct expression *expr2; - struct value *val2; - - arg2[0] = 0; - arg2++; - - expr2 = parse_expression (arg2); - val2 = evaluate_expression (expr2); - xfree (expr2); - - auxregno2 = *(int *)(VALUE_CONTENTS (val2)); - } - - /* first arg */ - expr = parse_expression (arg); - val = evaluate_expression (expr); - old_chain = make_cleanup (free_current_contents, &expr); - - auxregno = *(int *)(VALUE_CONTENTS (val)); - - /* so, how many regs do we want ? */ - if (arg2) - { - if (auxregno2 < auxregno) - { - warning ("aux-read: %s < %s, showing one register", arg2, arg); - nrregs = 1; - } - else - nrregs = auxregno2 - auxregno + 1; - } - else - nrregs = 1; - - buf = xcalloc (nrregs, sizeof(int)); - make_cleanup (free_current_contents, &buf); - - /* Go get 'em ! */ - nrtransfered = target_read_aux_reg (buf, auxregno, nrregs); - if (nrtransfered <= 0) - { - do_cleanups (old_chain); - error ("aux-read: couldn't read any registers."); - } - else if (nrtransfered < nrregs) - { - warning ("aux-read: could only read %d registers", nrtransfered); - } - - gdb_assert (nrtransfered <= nrregs); - - /* Show them. */ - for (i = auxregno; i - auxregno < nrtransfered; ++i) - { - if ((i - auxregno) % 4 == 0) - printf_filtered("%s%08x: ", ((i - auxregno) ? "\n" : ""), i); - - printf_filtered ("%08x ", buf[i - auxregno]); - } - printf_filtered ("\n"); - - do_cleanups (old_chain); -} - -/* aux-write = - Write VALUE to aux register REGNUM. */ -static void -arc_jtag_aux_write_command (char *arg, int from_tty) -{ - char *value_arg = 0; - struct expression *regnum_expr, *value_expr; - struct value *regnum_val, *value_val; - struct cleanup *old_chain = 0; - unsigned int regnum, value; - int err; - - if (!arg) - { - printf_filtered ("aux-write = \n"); - return; - } - - value_arg = strchr(arg, '='); - if (!value_arg) - { - error ("aux-write: can't find second argument\n\ -Usage: aux-write = "); - return; - } - value_arg[0] = 0; - value_arg++; - - /* Regnum expression */ - regnum_expr = parse_expression (arg); - regnum_val = evaluate_expression (regnum_expr); - old_chain = make_cleanup (free_current_contents, ®num_expr); - regnum = *(unsigned int *)(VALUE_CONTENTS (regnum_val)); - - /* Value expression */ - value_expr = parse_expression (value_arg); - value_val = evaluate_expression (value_expr); - make_cleanup (free_current_contents, &value_expr); - value = *(unsigned int *)(VALUE_CONTENTS (value_val)); - - /* Write it. */ - err = target_write_aux_reg (&value, regnum, 1); - if (err != 1) - { - do_cleanups (old_chain); - error ("aux-write: couldn't write to register 0x%x", regnum); - } - - do_cleanups (old_chain); -} - -#ifdef ARC4_JTAG -// gdbarch_write_pc_ftype *write_pc; -/* - Write PC - Arguments: - 1.CORE_ADDR val : Contains the value to be written into PC. - 2.ptid_t ptid: Process id of the process. - - Returns: void - Description: FIXMEA: Update - Reads the status register - Inserts the value (upper 24 bit) into the bits - 0-23 in the status register - Write the status register - */ -void -a4_jtag_write_pc (CORE_ADDR val, ptid_t ptid) -{ - CORE_ADDR insert_val = val >> 2; - unsigned int buffer; - - - if(debug_arc_jtag_target_message) - printf_filtered ("\n -----***------------ a4_jtag_write_pc Entered ---*%%*#\n"); - - - target_read_aux_reg (&buffer, ARC_HW_STATUS_REGNUM, 1); - - if (!(buffer & A4_HALT_VALUE)) - { - if(debug_arc_jtag_target_message) - printf_filtered ("\n***** Halting Processor... *********\n"); - - buffer = buffer | A4_HALT_VALUE ; - target_write_aux_reg (&buffer, ARC_HW_STATUS_REGNUM, 1); - /* Now the A4 processor has halted*/ - } - - if(debug_arc_jtag_target_message) - printf_filtered (" \nWriting value %u to PC\n", val); - - - target_read_aux_reg (&buffer, ARC_HW_STATUS_REGNUM, 1); - if(debug_arc_jtag_target_message) - printf_filtered (" \nValue of Status Register before writing %d\ - \n Value of PC: 0x%x\n", buffer, buffer & 0x00ffffff); - - buffer = buffer & 0xff000000; - insert_val = insert_val & 0x00ffffff; - buffer = buffer | insert_val ; - - if(debug_arc_jtag_target_message) - printf_filtered (" \nValue of Status Register to be written %d\ - \n Value of PC: 0x%x\n", buffer, buffer & 0x00ffffff); - - // jtag_ops.jtag_write_aux_reg (ARC_STATUS_REGNUM, buffer); - target_write_aux_reg (&buffer, ARC_HW_STATUS_REGNUM, 1); - - if(debug_arc_jtag_target_message) - { - target_read_aux_reg (&buffer, ARC_HW_STATUS_REGNUM, 1); - printf_filtered (" \nValue of Status Register after reading again %d\ - \n Value of PC: 0x%x\n", buffer, buffer & 0x00ffffff); - } - - if(debug_arc_jtag_target_message) - printf_filtered ("\n -----***------------ a4_jtag_write_pc Leaving ---*%%*#\n"); - -} - - -/* - Read PC - Arguments: - 1.ptid_t ptid: Process id of the process. - - Returns: CORE_ADDR - Description: - Reads the status register - Extracts the PC value from it. - Right shift twice to get correct value of PC - return PC -*/ -CORE_ADDR -a4_jtag_read_pc (ptid_t ptid) -{ - unsigned int buffer; - - if (debug_arc_jtag_target_message) - printf_filtered ("\n Entering a4_jtag_read_pc ()"); - buffer = 0; - target_read_aux_reg (&buffer, ARC_HW_STATUS_REGNUM, 1); - if (debug_arc_jtag_target_message) - printf_filtered ("\n Value of Status Reg: 0x%x",buffer); - buffer = buffer & 0x00ffffff; - buffer = buffer << 2; - - if (debug_arc_jtag_target_message) - printf_filtered ("\n Leaving a4_jtag_read_pc ()\ - \n Value of Pc: 0x%x\n", buffer); - - return buffer; -} - -#endif // ARC4_JTAG - -ARCVariantsInfo arc_debug_processor_information; - -struct gdbarch * -arc_jtag_init (struct gdbarch *gdbarch) -{ - struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); - -#ifndef ARC4_JTAG - tdep->arc_breakpoint_size = arc700_jtag_breakpoint_size; - tdep->arc_breakpoint_insn = arc700_jtag_breakpoint_insn; -#else - tdep->arc_breakpoint_size = a4_jtag_breakpoint_size; - tdep->arc_breakpoint_insn = a4_jtag_breakpoint_insn; -#endif - - set_gdbarch_num_regs (gdbarch, ARC_NR_REGS); -#ifndef ARC4_JTAG - set_gdbarch_pc_regnum (gdbarch, ARC_PC_REGNUM); -#else - // set_gdbarch_pc_regnum (gdbarch, ARC_STATUS_REGNUM); - set_gdbarch_write_pc (gdbarch, a4_jtag_write_pc); - set_gdbarch_read_pc (gdbarch, a4_jtag_read_pc); -#endif - set_gdbarch_register_name (gdbarch, arc_jtag_register_name); - - set_gdbarch_print_registers_info (gdbarch, arc_jtag_print_registers_info); - - tdep->register_reggroup_p = arc_jtag_register_reggroup_p; - - tdep->lowest_pc = 0; - - tdep->sigtramp_p = NULL; - - tdep->arc_processor_variant_info = &arc_debug_processor_information; - - /* Auxillary register commands. */ - add_cmd ("arc-aux-read", class_vars, arc_jtag_aux_read_command, - "Read and show a range of auxillary registers.\n\ -Usage: arc-aux-read []\n\ -REG-FROM and REG-TO can be any expressions that evaluate to integers.\n\ -If REG-TO is not specified, one register is displayed.", - &cmdlist); - - add_cmd ("arc-aux-write", class_vars, arc_jtag_aux_write_command, - "Write to an auxillary register.\n\ -Usage: arc-aux-write = \n\ -REG and VALUE can be any expressions that evaluate to integers.", - &cmdlist); - - return gdbarch; -} - diff --git a/gdb/arc-jtag.c b/gdb/arc-jtag.c index 9a86b6d..02c8b6e 100644 --- a/gdb/arc-jtag.c +++ b/gdb/arc-jtag.c @@ -1,1297 +1,1173 @@ -/* Target dependent code for ARC700, for GDB, the GNU debugger. +/* Target dependent code for ARC processor family, for GDB, the GNU debugger. - Copyright 2005 Free Software Foundation, Inc. + Copyright 2005, 2008, 2009 Free Software Foundation, Inc. Contributed by Codito Technologies Pvt. Ltd. (www.codito.com) - Authors: - Sameer Dhavale - Ramana Radhakrishnan + Authors: + Sameer Dhavale + Ramana Radhakrishnan + Richard Stuckey This file is part of GDB. - + 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 + the Free Software Foundation; either version 3 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. -*/ -#include -#include + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +/******************************************************************************/ +/* */ +/* Outline: */ +/* This module creates an instance of a gdb 'target_ops' structure which */ +/* contains information and operations for debugging a remote ARC target */ +/* with JTAG. */ +/* */ +/* It also registers a number of ARC-specific commands with gdb. */ +/* */ +/* Usage: */ +/* The module exports a function _initialize_arc_jtag: the call to this */ +/* function is generated by the gdb build mechanism, so this function */ +/* should not be explicitly called. */ +/* */ +/******************************************************************************/ + +/* system header files */ + +/* gdb header files */ #include "defs.h" #include "inferior.h" -#include "target.h" -#include "breakpoint.h" +#include "gdbcmd.h" +#include "objfiles.h" +#include "libiberty.h" +#include "gdb_assert.h" +/* ARC header files */ +#include "config/arc/tm-embed.h" +#include "arc-jtag.h" +#include "arc-gpio.h" #include "arc-tdep.h" +#include "arc-board.h" +#include "arc-jtag-ops.h" +#include "arc-elf32-tdep.h" +#include "arc-architecture.h" +#include "arc-registers.h" +#include "arc-jtag-actionpoints.h" -#include -#include -#include -#include +/* -------------------------------------------------------------------------- */ +/* local types */ +/* -------------------------------------------------------------------------- */ -#include +typedef enum +{ + CLEAR_USER_BIT, + RESTORE_USER_BIT +} Status32Action; -#include "arc-jtag.h" -#include "arc-jtag-ops.h" -#include "gdbcore.h" -#include "gdbarch.h" -#include "regcache.h" -#include "command.h" -#include "gdbcmd.h" -#include -/* Flag to print debug messages from here. */ -/* FIXMEA: -static int debug_arc_jtag_target_message; -*/ +/* -------------------------------------------------------------------------- */ +/* local data */ +/* -------------------------------------------------------------------------- */ -#define ENTERMSG \ -do {\ -if(debug_arc_jtag_target_message) \ -printf_filtered ("--- entered %s:%s()\n", __FILE__, __FUNCTION__); \ -} while(0) - -#define ENTERARGS(fmt, args...) \ -do { \ -if(debug_arc_jtag_target_message) \ -printf_filtered ("--- entered %s:%s(" fmt ")\n", __FILE__, __FUNCTION__, args);\ -} while(0) - -#define LEAVEMSG \ -do { \ -if(debug_arc_jtag_target_message) \ -printf_filtered ("--- exited %s:%s()\n", __FILE__, __FUNCTION__); \ -} while(0) - -/* The number of times a memory read/write operation should be attempted - before returning an error. -*/ -#define MEMORY_TRANSFER_ATTEMPTS 10 +#define ARC_CONFIGURATION_COMMAND "arc-configuration" +#define ARC_RESET_BOARD_COMMAND "arc-reset-board" +#define ARC_LIST_ACTIONPOINTS_COMMAND "arc-list-actionpoints" +#define ARC_FSM_DEBUG_COMMAND "arcjtag-debug-statemachine" +#define ARC_JTAG_RETRY_COMMAND "arcjtag-retry-count" -/* defined in arc-jtag-ops.c */ -extern unsigned int arcjtag_retry_count; +#define ARC_CONFIGURATION_COMMAND_USAGE "Usage: info " ARC_CONFIGURATION_COMMAND "\n" +#define ARC_RESET_BOARD_COMMAND_USAGE "Usage: " ARC_RESET_BOARD_COMMAND "\n" +#define ARC_LIST_ACTIONPOINTS_COMMAND_USAGE "Usage: " ARC_LIST_ACTIONPOINTS_COMMAND "\n" -struct target_ops arc_debug_ops; -extern struct jtag_ops arc_jtag_ops; -static void arc_debug_interrupt (int signo); -static void arc_debug_interrupt_twice (int signo); -static void arc_print_processor_variant_info (void); -static int arc_debug_write_aux_register (int hwregno, int *buf); -static int arc_debug_read_aux_register (int hwregno, int *buf); -static int arc_debug_read_core_register (int hwregno, int *buf); +/* The gdb target operations structure for this target. */ +static struct target_ops jtag_target_ops; +/* A set of pointers to operations for reading/writing registers/memory in the + JTAG target. */ +static TargetOperations operations; -/* Register Mapping information between GDB regnums - and actual hardware register numbers. -*/ +/* The h/w register numbers of various auxiliary registers needed for + controlling the target processor. */ +static ARC_RegisterNumber lp_start_regnum; +static ARC_RegisterNumber lp_end_regnum; +static ARC_RegisterNumber icache_ivic_regnum; +static ARC_RegisterNumber icache_control_regnum; +static ARC_RegisterNumber dcache_ivdc_regnum; +static ARC_RegisterNumber dcache_control_regnum; -struct arc_reg_info -{ - char *name ; - enum arc_hw_regnums hw_regno; - char *description; -#ifdef ARC4_JTAG - enum arc4_jtag_regnums gdbregno; -#else - enum arc700_jtag_regnums gdbregno; -#endif - enum ARCProcessorVersion arcVersionSupported; -}; -#define RBCR(name, hwregno , desc, gdbregno, version) { #name, hwregno , desc , gdbregno , version } , +/* -------------------------------------------------------------------------- */ +/* external data */ +/* -------------------------------------------------------------------------- */ -#undef RAUX -struct arc_reg_info arc_bcr_reg_info [] = - { - #include "arc-regnums-defs.h" - }; +/* This declaration should be in the file breakpoint.h (a gdb core file). */ +extern struct breakpoint *breakpoint_chain; -#undef RAUX -#undef RBCR -#define RAUX(name, hwregno , desc, gdbregno, version) { #name , hwregno , desc , gdbregno , version } , -struct arc_reg_info arc_aux_reg_map[] = - { - #include "arc-regnums-defs.h" - }; +/* -------------------------------------------------------------------------- */ +/* local macros */ +/* -------------------------------------------------------------------------- */ +#define IS_ARC700 (arc_get_architecture(arc_read_jtag_aux_register) == ARC700) +#define IS_ARC600 (arc_get_architecture(arc_read_jtag_aux_register) == ARC600) -static void -arc_update_architecture(void) -{ - unsigned int idinfo; - unsigned short tmp; - struct gdbarch_tdep * tdep = gdbarch_tdep (current_gdbarch); - - if (IS_ARC700) { - tdep->arc_processor_variant_info->arcprocessorversion = ARC700; - set_gdbarch_decr_pc_after_break (current_gdbarch,0); - } - else if(IS_ARC600) { - tdep->arc_processor_variant_info->arcprocessorversion = ARC600; - set_gdbarch_decr_pc_after_break (current_gdbarch,2); - } - else if(IS_A5) { - warning ("A5 debugging is unsupported and may be buggy."); - tdep->arc_processor_variant_info->arcprocessorversion = A5; - } - else { - tdep->arc_processor_variant_info->arcprocessorversion = A4; - set_gdbarch_decr_pc_after_break (current_gdbarch,0); - } -} -/* Get us out of user mode. */ -static unsigned int -clear_status32_user_bit () -{ - int rd; -#ifndef ARC4_JTAG - if(arc_jtag_ops.jtag_read_aux_reg(ARC_HW_STATUS32_REGNUM, &rd) == JTAG_READ_FAILURE) - error("Failure reading auxillary register 0x%x:status32 register", ARC_HW_STATUS32_REGNUM); +/* -------------------------------------------------------------------------- */ +/* local functions */ +/* -------------------------------------------------------------------------- */ - if(arc_jtag_ops.jtag_write_aux_reg(ARC_HW_STATUS32_REGNUM, rd & ~0x80) == JTAG_READ_FAILURE) - error("Failure writing to auxillary register 0x%x:status32 register", ARC_HW_STATUS32_REGNUM); -#endif - return rd; -} +/* -------------------------------------------------------------------------- */ +/* 1) functions for reading/writing registers */ +/* -------------------------------------------------------------------------- */ -/* Restore a saved status32; use with clear_status32_user_bit(). */ -static void -restore_status32_user_bit (unsigned int status32) +/* Set UB bit in the DEBUG register: this allows brk_s instruction to work in + User mode. + + Returns TRUE if the operation is successful. */ + +static Boolean +set_debug_user_bit (ARC_RegisterContents extra_bits) { -#ifndef ARC4_JTAG - if(arc_jtag_ops.jtag_write_aux_reg(ARC_HW_STATUS32_REGNUM, status32) == JTAG_READ_FAILURE) - error("Failure writing to auxillary register 0x%x:status32 register", ARC_HW_STATUS32_REGNUM); -#endif + /* The DEBUG User bit exists only in the ARC700 variant. */ + if (IS_ARC700) + extra_bits |= DEBUG_USER; + + /* If we have extra bits to be set in the DEBUG register. */ + if (extra_bits != 0) + { + ARC_RegisterContents debug; + + if (arc_read_jtag_aux_register(arc_debug_regnum, &debug, TRUE)) + { + /* Set UB = 1. */ + ARC_RegisterContents new_debug = debug | extra_bits; + + /* Do the write only if it will change the register contents. */ + if (new_debug != debug) + return arc_write_jtag_aux_register(arc_debug_regnum, new_debug, TRUE); + } + else + return FALSE; + } + + return TRUE; } -/* UB bit in the debug register. It allows brk_s to work in user mode. */ + +/* Clear or restore the User bit in the STATUS32 auxiliary register. */ + static void -set_debug_user_bit () +change_status32 (Status32Action action) { - if(is_arc700 ()) + static ARC_RegisterContents status32 = 0; + + if (action == CLEAR_USER_BIT) { - /* set UB = 1 */ - unsigned int debug; - if (arc_jtag_ops.jtag_read_aux_reg (ARC_HW_DEBUG_REGNUM, &debug) == JTAG_READ_FAILURE) - error("Failure reading auxillary register 0x%x:debug register",ARC_HW_DEBUG_REGNUM); - debug |= 0x10000000; - arc_jtag_ops.jtag_write_aux_reg (ARC_HW_DEBUG_REGNUM, debug); + /* Get processor out of user mode. */ + + if (arc_read_jtag_aux_register(arc_status32_regnum, &status32, FALSE)) + { + /* If the User bit is actually set. */ + if (status32 & STATUS32_USER) + if (!arc_write_jtag_aux_register(arc_status32_regnum, + status32 & ~STATUS32_USER, FALSE)) + warning(_("can not clear User bit in STATUS32 auxiliary register")); + } + else + warning(_("can not read STATUS32 auxiliary register")); + } + else + { + /* If the User bit was actually cleared. */ + if (status32 & STATUS32_USER) + if (!arc_write_jtag_aux_register(arc_status32_regnum, status32, FALSE)) + warning(_("can not restore User bit in STATUS32 auxiliary register")); } } +/* -------------------------------------------------------------------------- */ +/* 2) functions for reading/writing mmeory */ +/* -------------------------------------------------------------------------- */ -static void -invalidateCaches (void) +/* These functions should NOT be used within this module: they are intended + purely for use by the arc-memory module for reading/writing multiple words + of data at word-aligned addresses. */ + +static unsigned int +read_words (ARC_Address address, + ARC_Byte *data, + unsigned int words) { - if(arc_jtag_ops.jtag_write_aux_reg ( ARC_HW_ICACHE_IVIC , 1)==JTAG_WRITE_FAILURE) - error("Failure writing 0x1 to auxillary register 0x%x:Icache invalidate\n",ARC_HW_ICACHE_IVIC); - if(arc_jtag_ops.jtag_write_aux_reg ( ARC_HW_DCACHE_IVIC , 1)==JTAG_WRITE_FAILURE) - error("Failure writing 0x1 to auxillary register 0x%x:Dcache invalidate\n",ARC_HW_DCACHE_IVIC); + DEBUG("reading %u words from 0x%08X on target board\n", words, address); + + gdb_assert(IS_WORD_ALIGNED(address)); + + return arc_jtag_ops.memory_read_chunk(address, data, words); } -static void -disableCaches (void) + +static unsigned int +write_words (ARC_Address address, + ARC_Byte *data, + unsigned int words) { - /* Disabling Icache */ - if(arc_jtag_ops.jtag_write_aux_reg( ARC_HW_ICACHE_CONTROL ,0x1)==JTAG_WRITE_FAILURE) - error("Failure writing 0x1 to auxillary register 0x%x:Icache control register\n",ARC_HW_ICACHE_CONTROL); - /* Disabling Dcache */ - if(arc_jtag_ops.jtag_write_aux_reg( ARC_HW_DCACHE_CONTROL ,0x1)==JTAG_WRITE_FAILURE) - error("Failure writing 0x1 to auxillary register 0x%x:Dcache control register\n",ARC_HW_DCACHE_CONTROL); -} + gdb_assert(IS_WORD_ALIGNED(address)); + DEBUG("writing %u words to 0x%08X on target board\n", words, address); -/* Function: arc_debug_open - * Parameters : - * 1. args : - * 2. from_tty: - * Returns : void - * Description: - 1. Connect to the jtag target . - 2. Read the number of action points supported. - 3. Read the configuration of action points. - 4. Set up internal data structures for number of hardware - breakpoints and watchpoints. - 5. Set the UB bit to 1 for ARC700 and not for ARC600. - * - */ + return arc_jtag_ops.memory_write_chunk(address, data, words); +} -void -arc_debug_open (char *args, int from_tty) + +static unsigned int +write_pattern (ARC_Address address, + ARC_Word pattern, + unsigned int words) { - ENTERARGS("%s", args); - target_preopen(from_tty); - - reopen_exec_file (); - reread_symbols (); - - unpush_target (&arc_debug_ops); - arc_jtag_ops.jtag_open(); - push_target (&arc_debug_ops); - - /* Call arc_update_architecture if opened successfully. */ - arc_update_architecture(); - /* Fixme :: Should these be in create_inferior or - some place else ?. We would not like these here - when attach starts working. - */ - disableCaches(); -#ifdef ARC4_JTAG - if(arc_jtag_ops.jtag_write_aux_reg (ARC_HW_STATUS_REGNUM, 0x02000000)==JTAG_WRITE_FAILURE) - error("Failure writing 0x0200 0000 to auxillary register 0x%x:status register\n",ARC_HW_STATUS_REGNUM); - - if (from_tty) - printf_filtered ("Connected to the arcjtag target.\n"); - -#else - if(arc_jtag_ops.jtag_write_aux_reg (ARC_HW_STATUS32_REGNUM, 0x1)==JTAG_WRITE_FAILURE) - - error("Failure writing 0x1 to auxillary register 0x%x:status32 register\n",ARC_HW_STATUS32_REGNUM); - - /* allow breakpoints in user mode. */ - set_debug_user_bit (); - - - if (from_tty) - printf_filtered ("Connected to the arcjtag target.\n"); -#endif + gdb_assert(IS_WORD_ALIGNED(address)); + + DEBUG("writing pattern 0x%08X repeated %u times to 0x%08X on target board\n", pattern, words, address); + + return arc_jtag_ops.memory_write_pattern(address, pattern, words); } -void arc_debug_close() + +/* -------------------------------------------------------------------------- */ +/* 3) functions for processor cache management */ +/* -------------------------------------------------------------------------- */ + +/* Invalidate the target processor's caches. */ + +static void +invalidate_caches (void) { - arc_jtag_ops.jtag_close(); + /* N.B. when invalidating the data caches, we must first set the DC_CTRL.IM + bit to 1 to ensure that any "dirty" lines in the cache get flushed + to main memory. */ + (void) arc_write_jtag_aux_register(dcache_control_regnum, DC_CTRL_IM, TRUE); + (void) arc_write_jtag_aux_register(icache_ivic_regnum, IC_IVIC_IV, TRUE); + (void) arc_write_jtag_aux_register(dcache_ivdc_regnum, DC_IVDC_IV, TRUE); } -/* Function: arc_debug_attach - * Parameters : - * 1. char *x: - * 2. int i: - * Returns : void - * Description: - * 1. attach without resetting the board - * 2. get all Board configuration registers of interest. - * if ARC700 set the UB bit to 1. (This is invalid in the - * ARC600). - */ +/* Disable the target processor's caches. */ -void -arc_debug_attach (char *x, int i) +static void +disable_caches (void) { - - ENTERMSG; + (void) arc_write_jtag_aux_register(icache_control_regnum, IC_CTRL_DC, TRUE); + (void) arc_write_jtag_aux_register(dcache_control_regnum, DC_CTRL_DC, TRUE); } -/* Function: arc_debug_attach - * Parameters : - * 1. char *x: - * 2. int i: - * Returns : void - * Description: - * 1. Detach without resetting the board. - */ -void -arc_debug_detach (char *x, int i) +/* -------------------------------------------------------------------------- */ +/* 4) functions for JTAG interface management */ +/* -------------------------------------------------------------------------- */ + +/* Open the JTAG interface to the debug target. */ + +static Boolean +open_JTAG_interface (int from_tty) { - - ENTERMSG; + /* This is somewhat inelegant, but commands read from scripts in the gdb + testsuite are regarded as though they were being input interactively + (i.e. from_tty is 1), and interactive queries may be made (such as + asking the user whether the program currently being debugged should be + killed first) - and these queries hang the tests! + + So, if the environment variable is set, assume that the gdb test suite is + being run, so that no such queries will be made. + + It is not possible to make this check in the top-level command handler + loop, as the output from some other commands (e.g. 'file') depend on the + from_tty parameter passed to them, and the gdb test scripts expect to get + the interactive version of the output! */ + target_preopen(from_tty && (getenv("ARC_GDB_TEST") == NULL)); + + gdb_assert(arc_jtag_ops.open != NULL); - /* Let it continue. */ - target_resume (inferior_ptid, 0, 0); + return arc_jtag_ops.open(arc_aux_find_register_number("MEMSUBSYS", ARC_HW_MEMSUBSYS_REGNUM)); } -/* Function: arc_debug_resume - * Parameters : - * 1. ptid_t ptid: - * 2. int step: 1 - single step , 0 run freely. - * 3. enum target_signal signal; - * Returns : void - * Description: - * 1. What about Pipecleaning? - * 2. Write 0 to the HALT bit in status32. - * 3. Send a signal (ignore) in this case. - * 4. if(step) use hardware single step on the ARC700. - * done by setting the IS bit in the debug register - * and clearing the halt bit in status32. - * +/* Close the JTAG interface to the debug target. + + Parameter: + resume: TRUE if program execution on the target should be allowed to resume */ -void -arc_debug_resume (ptid_t ptid, int step, enum target_signal signal) +static void +close_JTAG_interface (Boolean resume) { - - ENTERARGS("%d,%d,%d", ptid.pid, step, signal); - /* Make the inferior resume execution, sending a signal if necessary */ - unsigned int rd; - - /* Because breakpoints may have been set/removed. */ - invalidateCaches (); - - /* This bit is required if breakpoints are to be allowed in user mode. We - set it in target_open, but the operating system might clear it. So we - set it every time we resume. */ - set_debug_user_bit (); - - if(step) - { - - /* reading debug reg */ - if(arc_jtag_ops.jtag_read_aux_reg(ARC_HW_DEBUG_REGNUM,&rd)==JTAG_READ_FAILURE) - error("Failure reading auxillary register 0x%x:debug register",ARC_HW_DEBUG_REGNUM); -#ifdef ARC4_JTAG - rd |= 0x801; /*Setting the IS and the SS bit in the status register - for the A4 core to allow it to single step. */ -#else - /* Mask for Single Stepping changes for ARC600 and ARC700. */ - if(is_arc700()) - rd |= 0x800; - else - if(is_arc600()) - rd |= 0x801; -#endif - - /* Writing to IS bit in DEBUG register for - hardware single instruction stepping. */ - if(arc_jtag_ops.jtag_write_aux_reg(ARC_HW_DEBUG_REGNUM ,rd)==JTAG_WRITE_FAILURE) - error("Failure writing 0x%x to auxillary register 0x%x:debug register\n",rd,ARC_HW_DEBUG_REGNUM); - } - else - { - /* Restarting the processor by clearing the 'H' bit in the status register*/ -#ifdef ARC4_JTAG - /* reading the status reg */ - if(arc_jtag_ops.jtag_read_aux_reg(ARC_HW_STATUS_REGNUM,&rd)==JTAG_READ_FAILURE) - error("Failure reading auxillary register 0x%x:status register",ARC_HW_STATUS_REGNUM); - - rd = rd & ~(0x02000000); - - /* starting the halted processor */ - if(arc_jtag_ops.jtag_write_aux_reg(ARC_HW_STATUS_REGNUM,rd)==JTAG_WRITE_FAILURE) - error("Failure writing 0x%x to auxillary register 0x%x:status register\n",rd,ARC_HW_STATUS_REGNUM); -#else - /* reading the status32 reg */ - if(arc_jtag_ops.jtag_read_aux_reg(ARC_HW_STATUS32_REGNUM,&rd)==JTAG_READ_FAILURE) - error("Failure reading auxillary register 0x%x:status32 register",ARC_HW_STATUS32_REGNUM); - - rd = rd & ~(0x1); - - /* starting the halted processor */ - if(arc_jtag_ops.jtag_write_aux_reg(ARC_HW_STATUS32_REGNUM,rd)==JTAG_WRITE_FAILURE) - error("Failure writing 0x%x to auxillary register 0x%x:status32 register\n",rd,ARC_HW_STATUS32_REGNUM); -#endif - } + /* If we have a target connected. */ + if (arc_jtag_ops.status == JTAG_OPENED) + { + arc_elf32_close(resume); + + /* And close the connection. */ + arc_jtag_ops.close(); + } } -/* For the ^C signal handler. */ -static void (*ofunc) (int); -/* The command line interface's stop routine. This function is installed as - a signal handler for SIGINT. The first time a user requests a stop, we - call target_stop to send a break or ^C. If there is no response from the - target (it didn't stop when the user requested it), we ask the user if - he'd like to detach from the target. */ +/* -------------------------------------------------------------------------- */ +/* 5) functions for starting/stopping the processor */ +/* -------------------------------------------------------------------------- */ + +/* Start the processor by clearing the 'H' bit in the STATUS32 register. */ + static void -arc_debug_interrupt (int signo) +start_processor (void) { - /* If we get the signal twice, do something more drastic. */ - signal (signo, arc_debug_interrupt_twice); - - target_stop (); + ARC_RegisterContents status32; + + if (!arc_read_jtag_aux_register (arc_status32_regnum, &status32, FALSE) || + !arc_write_jtag_aux_register(arc_status32_regnum, status32 & ~STATUS32_HALT, FALSE)) + warning(_("can not clear Halt bit in STATUS32 auxiliary register - can not start processor")); } -/* The user typed ^C twice. */ + +/* Stop the processor by setting the 'FH' bit in the DEBUG register. */ + static void -arc_debug_interrupt_twice (int signo) +stop_processor (void) { - signal (signo, ofunc); + if (!arc_write_jtag_aux_register(arc_debug_regnum, DEBUG_FORCE_HALT, FALSE)) + warning(_("can not set Force Halt bit in DEBUG auxiliary register - can not halt processor")); +} + + +/* Try to halt the processor (if it is running) upon connection to the debug + target. Return TRUE if the processor is successfuly halted. */ - if (query ("Interrupted while waiting for the program.\n\ -Give up (and stop debugging it)? ")) +static Boolean +halt_processor_on_connection (void) +{ + Boolean warn_on_read_failure = TRUE; + Boolean inform_running = TRUE; + Boolean halt_attempted = FALSE; + unsigned int tries = 0; + + /* Unfortunately, if the gpio driver module has been installed on the host + machine, the gpio read/write operations appear to work even if the host + is NOT physically connected to the JTAG target! + + There does not appear to be any way of detecting that situation - all we + can do is bale out if we have not succeded in reading the STATUS32 register + after the required number of retries! */ + do { - target_mourn_inferior (); - throw_exception (RETURN_QUIT); + ARC_RegisterContents status = 0; + + /* Read the STATUS32 register here to check if the halt bit is set. */ + if (arc_read_jtag_aux_register(arc_status32_regnum, &status, warn_on_read_failure)) + { + if (status & STATUS32_HALT) + { + printf_filtered(_("Processor is halted.\n")); + return TRUE; + } + + if (inform_running) + { + /* We inform the user that the processor is running only once + (to avoid swamping the user with messages!). */ + printf_filtered(_("Processor is running. Trying to halt it...\n")); + inform_running = FALSE; + } + + stop_processor(); + halt_attempted = TRUE; + } + else + { + /* We give a warning only on the first read failure (otherwise the + user can get swamped with warnings!). */ + warn_on_read_failure = FALSE; + } + + /* Just in case we actually did fail to read/write the port. */ + if (gpio_port_error) + { + warning(_("error in accessing parallel port via " + GPIO_DEVICE + " - check connection to target board.")); + return FALSE; + } } + while (++tries <= arc_jtag_ops.retry_count); + + if (halt_attempted) + printf_filtered(_("Can not halt processor!\n")); + else + printf_filtered(_("Can not connect to processor!\n")); - signal (signo, arc_debug_interrupt); + return FALSE; } -/* Function: arc_debug_wait - * Parameters : - * 1. ptid_t ptid: - * 2. struct target_waitstatus *status: Indicates status at end - of wait for F.E. - * Returns : void - * Description: - * Poll status32 for the value of H bit. - * After H bit is set in status32. - * Wait till LD(load pending bit) in the DEBUG register - * is cleared. - * SH bit is set if flag instruction was used to halt the processor. - * BH bit is set if the ARCompact processor stopped due to - * a brk_s instruction. Set the target_waitstatus (signal) to SIGTRAP - * only in such a situation. - * - */ -ptid_t -arc_debug_wait (ptid_t ptid, struct target_waitstatus *status) -{ - unsigned int debug; - ENTERMSG; +/* -------------------------------------------------------------------------- */ +/* 6) local functions called from outside this module (from gdb) */ +/* -------------------------------------------------------------------------- */ - /* signal handler for Control-C. */ - ofunc = signal (SIGINT, arc_debug_interrupt); +/* Connect to the JTAG target. - arc_jtag_ops.jtag_wait(); - /* put the old function back. */ - signal (SIGINT, ofunc); + Parameters: + args : user arguments to the 'target' command + from_tty: non-zero if the 'target' command was issued at the terminal - /* If the SH ("self halt") bit is set, we stopped because of the flag - instruction, which is used by programs to exit. */ - if (arc_jtag_ops.jtag_read_aux_reg (ARC_HW_DEBUG_REGNUM, - &debug) == JTAG_READ_FAILURE) - { - error ("Failure reading from debug register"); - } + The arguments may be: + noreset | + + If a XBF file is specified, the target board FPGA is blasted as part of the + connection process. */ + +static void +arc_jtag_open (char *args, int from_tty) +{ + /* By default, reset the board, in case it has been left in a funny state by + the last connection. */ + Boolean reset_required = TRUE; + char *xbf_file = NULL; + FPGA_Status fpga; - /* SH bit of debug register */ - if (debug & ARC_DEBUG_REG_SH_BIT) + ENTERARGS("\"%s\" (%d)", (args) ? args : "", from_tty); + + if (args) { - int exitcode; - status->kind = TARGET_WAITKIND_EXITED; - - /* Exit code of the program. */ - if (arc_jtag_ops.jtag_read_core_reg (0, &exitcode) == JTAG_READ_FAILURE) - { - warning ("Failure reading from register r0, assuming exit code = 0"); - status->value.integer = 0; - } - status->value.integer = exitcode; + if (strcmp(args, "noreset") == 0) + reset_required = FALSE; + else + xbf_file = args; } - else + + /* Is the target board FPGA already configured? */ + fpga = arc_is_FPGA_configured(); + + switch (fpga) { - status->kind = TARGET_WAITKIND_STOPPED; - status->value.sig = TARGET_SIGNAL_TRAP; + case INACCESSIBLE: + /* A warning has already been given. */ + return; + + case UNCONFIGURED: + if (xbf_file == NULL) + { + warning(_("target FPGA is not configured; XBF file must be specified")); + return; + } + break; + + case CONFIGURED: + break; } -#ifndef ARC4_JTAG - /* Bug #1311 (ARC600): Setting a breakpoint on the last instruction of a - ZOL causes GDB to stop at LP_START. Detect this condition and warn the - user. */ - if (is_arc600 ()) + /* As far as we know, there is no program loaded on the target. */ + arc_program_is_loaded = FALSE; + + /* Find the h/w register numbers of various auxiliary registers that we need + for debugging. + + N.B. the gdb 'attach' command can attach only to an arcjtag target that + has been created (by this function) within the *same* debugging + session, i.e. the sequence of commands issued by the user is of the + form: + target arcjtag ... detach ... attach + + This means that we do not need to worry about finding these numbers + again on an 'attach', as they should be the same (they should really + be the same for *any* target, anyway - we are simply being paranoid + in looking them up, rather than having their numbers hard-coded, in + any case!). + + Of course, there are really pathological cases such as the user + blasting the (ARCangel) target with an XBF giving a different + processor configuration, or even physically disconnecting the target + from the host machine and connecting a different target, between + issuing the 'detach' and the 'attach' commands (and that could change + the target's actionpoint configuration, if nothing else!) - but if + the user wants to do that then that is his problem! */ + arc_elf32_find_register_numbers(); + + lp_start_regnum = arc_aux_find_register_number("LP_START", ARC_HW_LP_START_REGNUM); + lp_end_regnum = arc_aux_find_register_number("LP_END", ARC_HW_LP_END_REGNUM); + icache_ivic_regnum = arc_aux_find_register_number("IC_IVIC", ARC_HW_IC_IVIC_REGNUM); + icache_control_regnum = arc_aux_find_register_number("IC_CTRL", ARC_HW_IC_CTRL_REGNUM); + dcache_ivdc_regnum = arc_aux_find_register_number("DC_IVDC", ARC_HW_DC_IVDC_REGNUM); + dcache_control_regnum = arc_aux_find_register_number("DC_CTRL", ARC_HW_DC_CTRL_REGNUM); + + + /* Just to be sure that it is not in the target stack... */ + (void) unpush_target (&jtag_target_ops); + + /* Now try to open the JTAG interface. */ + if (open_JTAG_interface(from_tty)) { - unsigned int pc, lp_start, lp_end, lp_count; - arc_debug_read_core_register (ARC_LP_COUNT_REGNUM, &lp_count); - if (lp_count != 0) - { - arc_debug_read_aux_register (ARC_HW_PC_REGNUM, &pc); - arc_debug_read_aux_register (ARC_HW_LP_START_REGNUM, &lp_start); - - if (pc == lp_start) - { - extern struct breakpoint *breakpoint_chain; - struct breakpoint *b; - arc_debug_read_aux_register (ARC_HW_LP_END_REGNUM, &lp_end); - - for (b = breakpoint_chain; b; b = b->next) - { - /* lp_end is the address of the last instruction + the - size of the last instruction. We could use the - disassembler and find out the size, or just try both - possible sizes. */ - if ((b->enable_state == bp_enabled && !b->pending) && - b->loc->address == lp_end-4 || b->loc->address == lp_end-2) - { - warning ("Did you set a breakpoint on the last instruction of \n\ -a Zero Overhead Loop ? Such breakpoints do not work properly."); - } - } - } - } + /* If a reset is required, do it now, in case it is necessary to reset + the target clock sources to their defaults before trying to access + the target's auxiliary registers! */ + if (reset_required) + { + arc_reset_board(); + arc_jtag_ops.reset_board(); + } + + if (fpga == CONFIGURED) + { + /* If we are going to blast the board, don't bother halting the + processor first. */ + if ((xbf_file == NULL) && !halt_processor_on_connection()) + { + /* We could not halt the processor. */ + close_JTAG_interface(FALSE); + return; + } + } + + /* If we have been given an XBF file. */ + if (xbf_file) + { + /* Try to blast the board. + N.B. if the blasting operation fails for any reason, + arc_blast_board calls error and does not return! */ + arc_blast_board(xbf_file, from_tty); + } + + /* Get out of user mode so that we can access anything anywhere. */ + change_status32(CLEAR_USER_BIT); + + /* We do not know whether the target processor supports actionpoints until + after we have connected to it, as we have to read the AP_BUILD + configuration register to find that out. */ + (void) arc_initialize_actionpoint_ops(&jtag_target_ops); + + (void) push_target (&jtag_target_ops); + + if (!reset_required) + { + /* If we have been explicitly told NOT to reset the board, it is + most likely because we have connected to a target upon which a + program is running and we want to debug that program - so assume + we have a program ready for execution on the target. */ + target_mark_running(&jtag_target_ops); + arc_program_is_loaded = TRUE; + + /* Set to_has_execution back to 0; this stops the user getting the + + A program is being debugged already. + Are you sure you want to change the file? (y or n) n + + message on issuing the 'file' command after the connection. */ + current_target.to_has_execution = 0; + } + + if (from_tty) + printf_filtered (_("Connected to the " ARC_TARGET_NAME " target.\n")); } -#endif - return inferior_ptid; + else + error(_("Can not connect to target")); } -static unsigned int -arc_get_hw_regnum_mapping ( int regno ) -{ - int i; - - if (regno >= ARC_STATUS_REGNUM -#ifdef ARC4_JTAG - && regno <= ARC_DEBUG_REGNUM -#else - && regno <= ARC_AUX_IRQ_PENDING_REGNUM -#endif - ) - return arc_aux_reg_map[regno - ARC_STATUS_REGNUM].hw_regno; - - for ( i = 0 ; i < (sizeof(arc_bcr_reg_info) / sizeof (struct arc_reg_info)) ; i++) - { - if (regno == arc_bcr_reg_info[i].gdbregno) - return arc_bcr_reg_info[i].hw_regno; - } - return -1; +/* Close the connection to the target. */ + +static void +arc_jtag_close (int quitting) +{ + ENTERMSG; + close_JTAG_interface(FALSE); } -/* Function: arc_debug_fetch_regs. - * Parameters : - * 1. int regnum: Register number. If register number is -1.Fetch - * all the registers.Read all core registers here. - * Returns : void - * Description: - * Set up regcache_raw_supply(current_regcache,regno) - * - */ -void -arc_debug_fetch_regs (int regno) +/* Attach to the debug target without resetting the board. + + Parameters: + args : user arguments to the 'attach' command (ignored) + from_tty: non-zero if the 'attach' command was issued at the terminal +*/ + +static void +arc_jtag_attach (char *args, int from_tty) { - /* Read all core registers */ - ENTERARGS("%d",regno); - - int dummyvalue = 0xABCDABCD; - unsigned int hw_regno; - unsigned int read_buf; - - if( regno < ARC_NR_CORE_REGS ) - { - hw_regno = regno; - if(arc_jtag_ops.jtag_read_core_reg(regno,&read_buf)==JTAG_READ_FAILURE) - error("Failure reading from core register 0x%x\n",regno); - } - else - { -#ifndef ARC4_JTAG - if( regno > ARC_NR_REGS) - error("Invalid Register Number\n"); -#endif - - hw_regno = arc_get_hw_regnum_mapping (regno); - if(arc_jtag_ops.jtag_read_aux_reg(hw_regno,&read_buf)==JTAG_READ_FAILURE) - error("Failure reading auxillary register 0x%x",hw_regno); - } - - if(debug_arc_jtag_target_message) + ENTERARGS("\"%s\" (%d)", args, from_tty); + + /* Try to open the JTAG interface. */ + if (open_JTAG_interface(from_tty)) { - printf_filtered("HW_Regno=0x%x",hw_regno); - printf_filtered("Read Regno 0x%x the value 0x%x\n",hw_regno,read_buf); + /* Try to halt the processor (if it is running). */ + if (halt_processor_on_connection()) + { + /* Check that the processor architecture is correct. */ + ARCHITECTURE_CHECK(current_gdbarch, + (current_objfile) ? current_objfile->obfd : NULL); + + if (from_tty) + printf_filtered (_("Connected to the " ARC_TARGET_NAME " target.\n")); + } } - regcache_raw_supply(current_regcache,regno,&read_buf); - - LEAVEMSG; + else + error(_("Can not connect to target")); } -/* Function: arc_debug_fetch_regs. - * Parameters : - * 1. int regnum: Register number. If register number is -1.Fetch - * all the registers.Read all core registers here. - * Returns : void - * Description: - * Use deprecated register information for this or regcache_read_unsigned . - * FIXME: would need to change to use regcache_raw_supply instead. - */ +/* Detach from the debug target without resetting the board. + Parameters: + args : user arguments to the 'detach' command (ignored) + from_tty: non-zero if the 'detach' command was issued at the terminal +*/ -void -arc_debug_store_regs (int regno) +static void +arc_jtag_detach (char *args, int from_tty) { - /* write_all core registers */ - ENTERARGS("%d", regno); - unsigned int hw_regno; - unsigned int write_buf; - - if(debug_arc_jtag_target_message) - printf_filtered("\n%d",regno); - - regcache_raw_collect(current_regcache,regno,&write_buf); - if( regno < ARC_NR_CORE_REGS ) - { - if(arc_jtag_ops.jtag_write_core_reg(regno,write_buf)==JTAG_WRITE_FAILURE) - error("Failure writing 0x%x to core register 0x%x",write_buf,regno); - } - else - { -#ifndef ARC4_JTAG - if (regno > ARC_NR_REGS) - error ("Invalid register number \n"); -#endif - - hw_regno = arc_get_hw_regnum_mapping (regno); + ENTERMSG; + close_JTAG_interface(TRUE); +} - if(debug_arc_jtag_target_message) - printf_filtered("Writing to regno 0x%x the value 0x%x", - hw_regno,write_buf); - if(arc_jtag_ops.jtag_write_aux_reg(hw_regno,write_buf)==JTAG_WRITE_FAILURE) - error("Failure writing 0x%x to auxillary register 0x%x\n",write_buf,hw_regno); - } -} +/* Cause the inferior on the debug target to resume execution, sending a signal + if necessary. + Parameters: + ptid : the thread id of the thread to be resumed (ignored) + step : 1 means single step, 0 run freely. + signal: the number of the signal to be sent -/* Function: arc_debug_prepare_to_store. - * Parameters : - * 1. int regnum: Register number. If register number is -1.Fetch - * all the registers.Read all core registers here. - * Returns : void - * Description: - * Use deprecated register information for this. - * FIXME: would need to change to use regcache_raw_supply instead. - */ + N.B. signals are not supported. */ -/* This gets called just before store_regs */ -void -arc_debug_prepare_to_store (void) +static void +arc_jtag_resume (ptid_t ptid, int step, enum target_signal signal) { - /* does nothing . Why is this around ? */ - ENTERMSG; -} + ENTERARGS("%d, %d, %d", ptid.pid, step, signal); -/* Read or write memory */ + if (signal != TARGET_SIGNAL_0) + error(_("Signals are not supported by the " ARC_TARGET_NAME " target")); + /* If we cleared the User bit in the STATUS32 bit the last time that + execution halted, restore it now. */ + change_status32(RESTORE_USER_BIT); + /* Software breakpoints may have been set/removed, and data in main memory + may have been altered, so invalidate (and flush!) the instruction and + data caches before restarting! -/* Function: arc_debug_xfer_memory. - * Parameters : - * 1. int regnum: Register number. If register number is -1.Fetch - * all the registers.Read all core registers here. - * Returns : void - * Description: - * This has been superceded by target_xfer_memory_partial. - * - */ -int -arc_debug_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len, int write, - struct mem_attrib *attrib, struct target_ops *target) -{ - /* There is no xfer_memory . Its been deprecated in 6.3 .Replace - * this by target_xfer_memory_partial . - */ - ENTERARGS("memaddr=%lx, myaddr=%lx, len=%d, write=%d", - memaddr, (unsigned long)myaddr, len, write); - - return len; /* success */ -} + N.B. arc_jtag_open disabled the caches, so what is the point of doing this? + Also, invalidating a disabled cache when DC_CTRL.IM = 1 seems to have + the effect of overwriting valid data!!!!! */ +// invalidate_caches (); - + /* The DEBUG User bit must be set if breakpoints are to be allowed in user + mode. We could set it in target_open, but something (the user?) might clear it. + So we set it every time we resume (if stepping, we set the extra bit(s) we + need in the DEBUG register in the same operation). */ -LONGEST -arc_debug_xfer_partial (struct target_ops *ops, - enum target_object object, - const char *annex, - void *readbuf, - const void *writebuf, - ULONGEST offset, - LONGEST len) -{ - - int i=0, read_num=0, temp_len=0; - unsigned int small_buf; - char query_type; - ULONGEST temp_offset=0; - if(debug_arc_jtag_target_message) - printf("..Entered arc_debug_xfer_partial()...with offset 0x%x\n",(unsigned int)offset); - /* Handle memory */ - if (object == TARGET_OBJECT_MEMORY) + if (step) { - int saved_status32; - int xfered=0; - int attempts; - errno = 0; - - /* Get out of user mode so that we can read/write anything anywhere. */ - saved_status32 = clear_status32_user_bit (); - - if (writebuf != NULL) - { - char *buffer=(char *)xmalloc(4); - char *temp_buf = (char *)writebuf; - - /* Address alignment to integral multiple of four */ - temp_offset = offset; - temp_len = temp_offset % 4; - - i = 0; - if(temp_len) - { - temp_offset = offset - temp_len; - if(debug_arc_jtag_target_message) - { - printf("---- Aligning-----------\n"); - printf("calling write_chunk at 0x%x where \ -offset = 0x%x\n", - (unsigned int)temp_offset,(unsigned int)offset); - } - - attempts = 0; - do{ - if (attempts++ == MEMORY_TRANSFER_ATTEMPTS) - return 0; - xfered = arc_jtag_ops.jtag_memory_chunk_read(temp_offset, - (unsigned int *)buffer,4); - }while(xfered != 4); - - for(i=0;i0) - len =arc_jtag_ops.jtag_memory_chunk_write(temp_offset, - (unsigned int *)temp_buf,len); - if(debug_arc_jtag_target_message) - printf("...leaving arc_debug_xfer_partial() write.. \ -with return value %d",(int)len); - - restore_status32_user_bit (saved_status32); - return (len + i); - } - else - { - char *buffer=(char *)xmalloc(4); - char *temp_buf = (char *)readbuf; - /* Address alignment to integral multiple of four */ - temp_offset= offset; - temp_len= temp_offset % 4 ; - - i = 0; - if(temp_len) - { - temp_offset = offset - temp_len; - if(debug_arc_jtag_target_message) - { - printf("---- Aligning-----------\n"); - printf("calling read_chunk at 0x%x where offset =0x%x \n", - (unsigned int)temp_offset,(unsigned int)offset); - } - - attempts = 0; - do{ - if (attempts++ == MEMORY_TRANSFER_ATTEMPTS) - return 0; - xfered = arc_jtag_ops.jtag_memory_chunk_read(temp_offset,(unsigned int *)buffer,4); - }while(xfered != 4); - - for(i=0;i0) - len = arc_jtag_ops.jtag_memory_chunk_read(temp_offset,(unsigned int *)temp_buf,len); - if(debug_arc_jtag_target_message) - { - printf("\nlen=%d",(int)len + temp_len); - printf("...leaving arc_debug_xfer_partial() read.. \ -with return value %d", - (int)len + temp_len); - } - - restore_status32_user_bit (saved_status32); - return (len + i); - - } + ARC_RegisterContents mask = 0; - } + DEBUG("setting DEBUG.IS bit for single-step\n"); - /* ARC auxillary registers: they are 32bits wide and are in a 32 bit - address space, although only part of the address space is used. */ - else if (object == ARC_TARGET_OBJECT_AUXREGS) - { - unsigned int regno; - - if (readbuf) - { - for (regno = offset; regno < offset+len; ++regno) - { - unsigned int rd; - - if (arc_jtag_ops.jtag_read_aux_reg (regno, &rd) == JTAG_READ_FAILURE) - { - return (regno - offset); - } - ((int *)readbuf)[regno - offset] = rd; - } - } - else if (writebuf) - { - for (regno = offset; regno < offset+len; ++regno) - { - if (arc_jtag_ops.jtag_write_aux_reg (regno, ((int*)writebuf)[regno - offset]) == - JTAG_WRITE_FAILURE) - { - return (regno - offset); - } - } - } - - /* success */ - return (LONGEST)len; + /* The mask for single-stepping differs between ARC600 and ARC700. */ + if (IS_ARC700) + mask = DEBUG_INSTRUCTION_STEP; + else + if (IS_ARC600) + mask = DEBUG_INSTRUCTION_STEP | DEBUG_SINGLE_STEP; + + /* Allow breakpoints in User mode, and set the IS bit in the DEBUG + register for hardware single instruction stepping. */ + if (!set_debug_user_bit (mask)) + error(_("Can not single-step one instruction")); } else { - printf("\nRequested target_object not yet supported with arc-jtag"); + /* Allow breakpoints in User mode (no extra bits required). */ + (void) set_debug_user_bit (0); + start_processor(); } - return -1; - + LEAVEMSG; } +/* Wait for execution on the target to halt (for whatever reason). + Parameters : + ptid : ignored + status: set to indicate status at end of the wait +*/ -void -arc_debug_files_info (struct target_ops *target) +static ptid_t +arc_jtag_wait (ptid_t ptid, struct target_waitstatus *status) { - /* Do nothing. Just say its a remote target */ - ENTERMSG; -} + ENTERMSG; + /* Execute the program on the target processor. */ + arc_elf32_execute(status, + NULL, + start_processor, + stop_processor); -/* Function: arc_debug_insert_breakpoint - * Parameters : - * 1. CORE_ADDR addr: Address for breakpoint. - * 2. char * contents: Contents for the breakpoint. - * Returns : int - * Description: - * See if you can insert a hardware breakpoint using the actionpoints - * interface. Use brk_s if architecture is ARC700 and you need to use - * a software breakpoint.The gdbarch breakpoint should be initialized to - * the right value if used with target_arc_debug. - * - */ + /* The target has now halted. */ + if (status->kind == TARGET_WAITKIND_EXITED) + target_mark_exited (&jtag_target_ops); -int -arc_debug_insert_breakpoint (CORE_ADDR addr, char *contents) -{ - - ENTERARGS("%x", (unsigned int)addr); -#ifndef ARC4_JTAG - unsigned int bp = 0x20207fff; /*FIXMEA: what does 0x2020 stand for ?*/ -#else - unsigned int bp = 0x1ffffe00; -#endif - unsigned int r; - int instr_size; - const unsigned char *breakpt_instr; - breakpt_instr=BREAKPOINT_FROM_PC(&addr,&instr_size); - - /* save the existing value */ - /* r==0 means the read succeeded */ - if(debug_arc_jtag_target_message) - printf_filtered ("instrcution size = %d and instruction 0x%x", - instr_size, *(unsigned int *)breakpt_instr); - r = target_read_memory (addr, contents, instr_size); - /* put the breakpoint */ - if(r==0) - r = target_write_memory (addr, (char *)&bp, instr_size); - return r; + /* Get out of user mode so that we can access anything anywhere. */ + change_status32(CLEAR_USER_BIT); + + /* Inform the actionpoints module that the target has halted. */ + arc_target_halted(); + + /* Bug #1311 (ARC600): Setting a breakpoint on the last instruction of a + ZOL causes GDB to stop at LP_START. Detect this condition and warn the + user. */ + if (IS_ARC600) + { + ARC_RegisterContents pc, lp_start, lp_end, lp_count; + + if (arc_read_jtag_core_register(ARC_LP_COUNT_REGNUM, &lp_count, TRUE) && (lp_count != 0) && + arc_read_jtag_aux_register (arc_pc_regnum, &pc, TRUE) && + arc_read_jtag_aux_register (lp_start_regnum, &lp_start, TRUE) && (pc == lp_start) && + arc_read_jtag_aux_register (lp_end_regnum, &lp_end, TRUE)) + { + struct breakpoint *b; + + for (b = breakpoint_chain; b != NULL; b = b->next) + { + /* lp_end is the address of the last instruction + the size of + the last instruction. We could use the disassembler and find + out the size, but it's easier just to try both possible sizes. */ + if ((b->enable_state == bp_enabled) && + (b->loc->address == lp_end - 4 || b->loc->address == lp_end - 2)) + { + warning(_("did you set a breakpoint on the last instruction of a" + "Zero Overhead Loop? Such breakpoints do not work properly.")); + } + } + } + } + + LEAVEMSG; + + return inferior_ptid; } -/* Function: arc_debug_remove_breakpoint. - * Parameters : - * 1. CORE_ADDR addr: Address. - * 2. char * contents : contents. - * Returns : int. - * Description: - * Write the old contents back for the breakpoint. - * - */ +/* This gets called just before store_regs. */ -int -arc_debug_remove_breakpoint (CORE_ADDR addr, char *contents) +static void +arc_jtag_prepare_to_store (struct regcache *regcache) { - ENTERARGS("%x, %lx", (unsigned int)addr, *(unsigned long *)contents); - - /* write the old value back */ -#ifdef ARC4_JTAG - return target_write_memory (addr, contents, 4); -#else - return target_write_memory (addr, contents, 2); -#endif + ENTERMSG; } +static void +arc_jtag_files_info (struct target_ops *target) +{ + /* Do nothing. */ + ENTERMSG; +} -/* Function: arc_debug_kill - * Parameters : void. - * Returns : void. - * Description: Heavy duty arsenal.Kill the process. - * Maybe we do a board reset and kill it. Write 1 to Halt - * in Status32. - */ +/* Heavy duty arsenal. Kill the process. + Maybe we should do a board reset and kill it. */ -void -arc_debug_kill (void) +static void +arc_jtag_kill (void) { ENTERMSG; - /* Do stuff */ - target_mourn_inferior (); } -/* Function: arc_debug_load - * Parameters : - * 1. char * args: Arguments. - * 2. int from_tty: Which terminal. - * Returns : void. - * Description: Load the program into jtag. + +/* Create the inferior that will be executed upon the target. + + Parameters : + exec_file: the executable file containing the program to be executed + args : the command line arguments to be passed to the program + env : the environment (name/value pairs) for the program + from_tty : ignored */ -void -arc_debug_load (char *args, int from_tty) +static void +arc_jtag_create_inferior (char *exec_file, char *args, char **env, int from_tty) { - /* Write to RAM of the ARC700 board by running through the sections .*/ - asection *bss_section; - CORE_ADDR bss_addr; - bfd_size_type bss_size; - char *zero_buf; - int target_errno; + arc_elf32_create_inferior(exec_file, args, env, &jtag_target_ops); - ENTERARGS("%s", args); + /* Why are the caches disabled anyway? Particularly as arc_jtag_resume + invalidates them before each restart? */ + disable_caches(); +} - generic_load(args, from_tty); - /* Zero the bss, if it exists. */ - bss_section = bfd_get_section_by_name (exec_bfd, ".bss"); - if (bss_section) - { - bss_addr = bfd_section_lma (exec_bfd, bss_section); - bss_size = bfd_get_section_size (bss_section); - zero_buf = (char *)xcalloc (bss_size, 1); - - if (debug_arc_jtag_target_message) - printf_filtered("%s: bss at %x, size = %x\n", __FUNCTION__, (unsigned int)bss_addr,(unsigned int)bss_size); - - target_errno = target_write_memory (bss_addr, zero_buf, bss_size); - free (zero_buf); - if (target_errno) - { - error ("load: error zeroing bss: %s\n", strerror(target_errno)); - } - } - else - { - if (debug_arc_jtag_target_message) - printf_filtered("%s: no bss\n", __FUNCTION__); - } - - clear_symtab_users(); +/* Mourn the inferior. */ + +static void +arc_jtag_mourn_inferior (void) +{ + ENTERMSG; + +// (void) unpush_target (&jtag_target_ops); + generic_mourn_inferior (); + current_target.to_has_execution = 0; } -/* Function: arc_debug_create_inferior - * Parameters : - * 1. char * exec_file: - * 2. char * args: - * 3. char ** env; - * Returns : void. - * Description: Set up sanity values for arc_debug_create_inferior. More thought - * needed for this. - */ +/* Check whether the given thread is alive. */ -void -arc_debug_create_inferior (char *exec_file, char *args, char **env,int dummy) +static int +arc_jtag_thread_alive (ptid_t ptid) { - ENTERARGS("%s,%s", exec_file, args); - - /* If no exec file handed to us, get it from the exec-file command - -- with a good, common error message if none is specified. */ - if (exec_file == 0) - exec_file = get_exec_file (1); - - /* We dont really have a PID or anything, but GDB uses this value to check - if the program is running. */ - inferior_ptid.pid = 42; - - clear_proceed_status(); - /* -1 means resume from current place - TARGET_SIGNAL_0 means dont give it any signal - Last arg should be true if you want to single step */ - //proceed ((CORE_ADDR) -1, TARGET_SIGNAL_0, 0); - proceed (bfd_get_start_address (exec_bfd), TARGET_SIGNAL_0, 0); + ENTERMSG; + + /* We only have one thread. */ + return 1; } -/* Function: arc_debug_mourn_inferior - * Parameters :void. - * Returns : void. - * Description: Set up sanity values for arc_debug_create_inferior. More thought - * needed for this. - */ +/* Check whether our debug target is runnable: return 1 if it is, 0 otherwise. */ -void -arc_debug_mourn_inferior (void) +static int +arc_jtag_can_run (void) { - ENTERMSG; + /* If we are connected to the JTAG i/f, and a program is loaded. */ + return (arc_jtag_ops.status == JTAG_OPENED) && arc_program_is_loaded; +} + - unpush_target (&arc_debug_ops); +/* We do not support asynchronous execution of the target program (i.e. commands + like 'run' or 'continue' or 'step' can not be executed in background mode + by appending a '&' to them) so we do not need to implement the target stop + operation (called by the 'interrupt' command); interrupting a running program + is handled by the Ctrl-C mechanism. */ - generic_mourn_inferior (); +#if 0 +static void +arc_jtag_stop (void) +{ + ENTERMSG; } +#endif -/* Function: arc_debug_mourn_inferior - * Parameters :ptid_t ptid. - * Returns : 1 always. - * Description: Checks for return values . - */ +/* -------------------------------------------------------------------------- */ +/* 7) local functions implementing commands */ +/* -------------------------------------------------------------------------- */ +/* Print processor-variant information. */ -int -arc_debug_thread_alive (ptid_t ptid) +static void +arc_print_processor_variant_info (char *arg, int from_tty) { - ENTERMSG; - return 1; + printf_filtered + (_("%s\n"), + arc_version_image(arc_get_architecture(arc_read_jtag_aux_register))); } -/* Function: arc_debug_stop - * Parameters: void - * Returns: void. - * Description: Stop the Processor. We stop by writing FH bit to Debug Register . - * write 1 to the FH bit in the Debug register after - * polling for the DEBUG register to have no loads pending . - */ -void -arc_debug_stop (void) -{ +/* Reset the target board. */ - ENTERMSG; - int val = 0x2; - /* Stop using the FH bit in the debug register. */ - arc_debug_write_aux_register (ARC_HW_DEBUG_REGNUM, &val); - +static void +arc_jtag_reset_board (char *arg, int from_tty) +{ + /* Make sure the GPIO interface is open. */ + if (gpio_open()) + { + printf_filtered(_("Attempting to reset target board...\n")); + + if (arc_jtag_ops.status == JTAG_OPENED) + { + /* Try to force the processor to halt. */ + stop_processor(); + } + + /* Try to reset the board. */ + arc_reset_board(); + arc_jtag_ops.reset_board(); + + if (arc_jtag_ops.status == JTAG_OPENED) + { + /* The ARC actionpoint registers are cleared upon reset, so it is + necessary to restore any actionpoints that were set. */ + if (!arc_restore_actionpoints_after_reset()) + warning(_("can not restore hardware actionpoints")); + } + } } -/* Read core register. Return 0 on success. */ -static int -arc_debug_read_core_register (int hwregno, int *buf) + +/* List the ARC target processor actionpoints. */ + +static void +arc_list_actionpoints (char *arg, int from_tty) { - int rd; - if(arc_jtag_ops.jtag_read_core_reg(hwregno,&rd)==JTAG_READ_FAILURE) - error("Failure reading auxillary register 0x%x",hwregno); - *buf = rd; - return 0; + /* gdb manages breakpoints by deleting them from the target as soon as it + has halted, then re-inserting them again immediately before execution is + resumed (no, I don't know why either, unless it is to make generating a + disassembly display easier by removing all the s/w b/ps from the code) - + so in order to display what actionpoints are currently in use, we must + temporarily re-insert the breakpoints! */ + insert_breakpoints(); + arc_display_actionpoints(); + (void) remove_breakpoints(); } -/* Read aux register. Return 0 on success. */ -static int -arc_debug_read_aux_register (int hwregno, int *buf) + +/* -------------------------------------------------------------------------- */ +/* 8) initialization functions */ +/* -------------------------------------------------------------------------- */ + +/* Initialize the JTAG target operations. */ + +static void +initialize_jtag_target_ops (void) { - int rd; - if(arc_jtag_ops.jtag_read_aux_reg(hwregno,&rd)==JTAG_READ_FAILURE) - error("Failure reading auxillary register 0x%x",hwregno); - *buf = rd; - return 0; + ENTERMSG; + + jtag_target_ops.to_data = &operations; + + jtag_target_ops.to_shortname = ARC_TARGET_NAME; + jtag_target_ops.to_longname = "Remote JTAG debug target (ARC Processors)"; + jtag_target_ops.to_doc = "Remote JTAG debug target (ARC Processors)"; + + jtag_target_ops.to_open = arc_jtag_open; + jtag_target_ops.to_close = arc_jtag_close; + jtag_target_ops.to_attach = arc_jtag_attach; + jtag_target_ops.to_detach = arc_jtag_detach; + jtag_target_ops.to_resume = arc_jtag_resume; + jtag_target_ops.to_wait = arc_jtag_wait; + + jtag_target_ops.to_fetch_registers = arc_elf32_fetch_registers; + jtag_target_ops.to_store_registers = arc_elf32_store_registers; + jtag_target_ops.to_prepare_to_store = arc_jtag_prepare_to_store; + jtag_target_ops.to_xfer_partial = arc_elf32_xfer_partial; + jtag_target_ops.to_files_info = arc_jtag_files_info; + + jtag_target_ops.to_insert_breakpoint = arc_elf32_insert_breakpoint; + jtag_target_ops.to_remove_breakpoint = arc_elf32_remove_breakpoint; + + jtag_target_ops.to_kill = arc_jtag_kill; + jtag_target_ops.to_load = arc_elf32_load_program; + + jtag_target_ops.to_create_inferior = arc_jtag_create_inferior; + jtag_target_ops.to_mourn_inferior = arc_jtag_mourn_inferior; + jtag_target_ops.to_thread_alive = arc_jtag_thread_alive; +// jtag_target_ops.to_stop = arc_jtag_stop; + jtag_target_ops.to_can_run = arc_jtag_can_run; + jtag_target_ops.to_terminal_inferior = NULL; + + jtag_target_ops.to_stratum = process_stratum; + + jtag_target_ops.to_has_all_memory = 1; + jtag_target_ops.to_has_memory = 1; + jtag_target_ops.to_has_stack = 0; /* Defer setting this until the program has been loaded. */ + jtag_target_ops.to_has_registers = 1; + jtag_target_ops.to_has_execution = 0; /* Defer setting this until the program has been started. */ + + jtag_target_ops.to_magic = OPS_MAGIC; } -/* Write aux register. Return 0 on success. */ -static int -arc_debug_write_aux_register (int hwregno, int *buf) + +/* -------------------------------------------------------------------------- */ +/* externally visible functions */ +/* -------------------------------------------------------------------------- */ + +/* Initialize the module. This function is called from the gdb core on start-up. */ + +void +_initialize_arc_jtag (void) { - if(arc_jtag_ops.jtag_write_aux_reg(hwregno, *buf)==JTAG_WRITE_FAILURE) - error("Failure writing 0x%x to auxillary register 0x%x\n",*buf,hwregno); - return 0; + ENTERMSG; + + operations.read_core_register = arc_read_jtag_core_register; + operations.write_core_register = arc_write_jtag_core_register; + operations.read_auxiliary_register = arc_read_jtag_aux_register; + operations.write_auxiliary_register = arc_write_jtag_aux_register; + operations.read_memory = read_words; + operations.write_memory = write_words; + operations.fill_memory = write_pattern; + + initialize_jtag_target_ops (); + add_target (&jtag_target_ops); + + /* Register ARC-specific commands with gdb. */ + + add_setshow_boolean_cmd(ARC_FSM_DEBUG_COMMAND, + no_class, + &arc_jtag_ops.state_machine_debug, + _("Set whether to print JTAG state machine debug messages.\n"), + _("Show whether to print JTAG state machine debug messages.\n"), + _("If set the JTAG state machine messages are printed.\n"), + NULL, + NULL, + &setlist, + &showlist); + + add_setshow_uinteger_cmd(ARC_JTAG_RETRY_COMMAND, + no_class, + &arc_jtag_ops.retry_count, + _("Set the number of attempts to be made for a JTAG operation.\n"), + _("Show the number of attempts to be made for a JTAG operation.\n"), + _("Indicates the number of times a JTAG operation is attempted before returning a failure.\n"), + NULL, + NULL, + &setlist, + &showlist); + + (void) add_cmd(ARC_CONFIGURATION_COMMAND, + class_info, + arc_print_processor_variant_info, + _("Show ARC configuration information.\n" + ARC_CONFIGURATION_COMMAND_USAGE), + &infolist); + + (void) add_cmd(ARC_RESET_BOARD_COMMAND, + class_obscure, + arc_jtag_reset_board, + _("Reset the board.\n" + ARC_RESET_BOARD_COMMAND_USAGE), + &cmdlist); + + (void) add_cmd(ARC_LIST_ACTIONPOINTS_COMMAND, + class_obscure, + arc_list_actionpoints, + _("List the processor actionpoints.\n" + ARC_LIST_ACTIONPOINTS_COMMAND_USAGE), + &cmdlist); } -/* Helper routine for commands added. */ -/* Print Processor Variant Info. */ -static void -arc_print_processor_variant_info (void) + +/* N.B. the core and auxiliary register contents read from or written to the + target via the arc-jtag-ops module are ALWAYS in little-endian format, + regardless of the endianness of the target processor. Given that the + values passed to/from the functions below are in host byte order, and + the host is little-endian (since the ARC gdb is currently built only + on an X86 Linux host), this means that no byte-swapping is required + here. This will require changing if the debugger is ever built upon a + big-endian host (such as a Sun). */ + + +/* Read a core register on the target. + + Parameters: + hw_regno : the ARC hardware number of the register + value : set to the contents of the register + warn_on_failure: TRUE if a warning should be issued if the read fails + + Result: TRUE if the register contents are read. */ + +Boolean +arc_read_jtag_core_register (ARC_RegisterNumber hw_regno, + ARC_RegisterContents *contents, + Boolean warn_on_failure) { - struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch); - -#ifdef ARC4_JTAG - if (tdep->arc_processor_variant_info && - tdep->arc_processor_variant_info->arcprocessorversion == A4) - { - printf_filtered ("A4\n"); - } -#else - if (tdep->arc_processor_variant_info) - { - if(tdep->arc_processor_variant_info->arcprocessorversion == ARC700) - printf_filtered ("ARC700\n"); - else - printf_filtered ("ARC600\n"); - } -#endif - else + if (arc_jtag_ops.read_core_reg(hw_regno, contents) == JTAG_SUCCESS) { - printf_filtered ("ARC Processor Information not available \n"); + DEBUG("Read value 0x%08X from core register %d\n", *contents, hw_regno); + return TRUE; } + if (warn_on_failure) + arc_elf32_core_warning(ERROR_ON_READING_REGISTER, hw_regno); + return FALSE; } -static void -arc_print_bcr_regs (void) +/* Write a core register on the target. + + Parameters: + hw_regno : the ARC hardware number of the register + value : set to the contents of the register + warn_on_failure: TRUE if a warning should be issued if the write fails + + Result: TRUE if the register contents are written. */ + +Boolean +arc_write_jtag_core_register (ARC_RegisterNumber hw_regno, + ARC_RegisterContents contents, + Boolean warn_on_failure) { - int i = 0; - unsigned int bcrval = 0; - for ( i = 0 ; i < (sizeof(arc_bcr_reg_info) / sizeof (struct arc_reg_info)) ; i++) + if (arc_jtag_ops.write_core_reg(hw_regno, contents) == JTAG_SUCCESS) { - if(arc_jtag_ops.jtag_read_aux_reg (arc_bcr_reg_info[i].hw_regno, &bcrval)==JTAG_READ_FAILURE) - error("Failure reading auxillary register 0x%x",arc_bcr_reg_info[i].hw_regno); - printf_filtered ("[%02x] %-15s : 0x%02x\n",arc_bcr_reg_info[i].hw_regno, - arc_bcr_reg_info[i].name, bcrval ); + DEBUG("Written value 0x%08X to core register %d\n", contents, hw_regno); + return TRUE; } + if (warn_on_failure) + arc_elf32_core_warning(ERROR_ON_WRITING_REGISTER, hw_regno); + return FALSE; } -static void -arc_debug_jtag_reset_board (void) -{ - arc_jtag_ops.jtag_reset_board(); -} +/* Read an auxiliary register on the target. -/* Function: init_arc_debug_ops - * Parameters: void - * Returns: void. - * Description: Initialize the jtag operations. - */ + Parameters: + hw_regno : the ARC hardware number of the register + value : set to the contents of the register + warn_on_failure: TRUE if a warning should be issued if the read fails -void -init_arc_debug_ops (void) -{ - ENTERMSG; -#ifdef ARC4_JTAG - arc_debug_ops.to_shortname = "arcjtag"; - arc_debug_ops.to_longname = "Target for debugging an A4 board with JTAG."; - arc_debug_ops.to_doc = "Debug a remote A4 board via a JTAG"; /* to_doc */ -#else - arc_debug_ops.to_shortname = "arcjtag"; - arc_debug_ops.to_longname = "Target for debugging an ARC700 board with JTAG."; - arc_debug_ops.to_doc = "Debug a remote ARC700 board via a JTAG"; /* to_doc */ -#endif + Result: TRUE if the register contents are read. */ +Boolean +arc_read_jtag_aux_register (ARC_RegisterNumber hw_regno, + ARC_RegisterContents *contents, + Boolean warn_on_failure) +{ + if (arc_jtag_ops.read_aux_reg(hw_regno, contents) == JTAG_SUCCESS) + { + DEBUG("Read value 0x%08X from auxiliary register %d\n", *contents, hw_regno); + return TRUE; + } - arc_debug_ops.to_open = arc_debug_open; - arc_debug_ops.to_close = arc_debug_close; - arc_debug_ops.to_attach = arc_debug_attach; - arc_debug_ops.to_detach = arc_debug_detach; - arc_debug_ops.to_resume = arc_debug_resume; - arc_debug_ops.to_wait = arc_debug_wait; - - arc_debug_ops.to_fetch_registers = arc_debug_fetch_regs; - arc_debug_ops.to_store_registers = arc_debug_store_regs; - arc_debug_ops.to_prepare_to_store = arc_debug_prepare_to_store; - //arc_debug_ops.to_xfer_memory = arc_debug_xfer_memory; - arc_debug_ops.to_xfer_partial = arc_debug_xfer_partial; - arc_debug_ops.to_files_info = arc_debug_files_info; - arc_debug_ops.to_insert_breakpoint = arc_debug_insert_breakpoint; - arc_debug_ops.to_remove_breakpoint = arc_debug_remove_breakpoint; - arc_debug_ops.to_kill = arc_debug_kill; - arc_debug_ops.to_load = arc_debug_load; - - arc_debug_ops.to_create_inferior = arc_debug_create_inferior; - - arc_debug_ops.to_mourn_inferior = arc_debug_mourn_inferior; - arc_debug_ops.to_thread_alive = arc_debug_thread_alive; - arc_debug_ops.to_stop = arc_debug_stop; - - arc_debug_ops.to_terminal_inferior = NULL; - - - arc_debug_ops.to_stratum = process_stratum; - - arc_debug_ops.to_has_all_memory = 1; - arc_debug_ops.to_has_memory = 1; - arc_debug_ops.to_has_stack = 1; - arc_debug_ops.to_has_registers = 1; - arc_debug_ops.to_has_execution = 1; - - arc_debug_ops.to_magic = OPS_MAGIC; + if (warn_on_failure) + arc_elf32_aux_warning(ERROR_ON_READING_REGISTER, hw_regno); + return FALSE; } +/* Write an auxiliary register on the target. -void -_initialize_arc_debug (void) + Parameters: + hw_regno : the ARC hardware number of the register + value : the contents of the register + warn_on_failure: TRUE if a warning should be issued if the write fails + + Result: TRUE if the register contents are written. */ + +Boolean +arc_write_jtag_aux_register (ARC_RegisterNumber hw_regno, + ARC_RegisterContents contents, + Boolean warn_on_failure) { - ENTERMSG; - init_arc_debug_ops (); - add_target (&arc_debug_ops); - add_setshow_boolean_cmd("arcjtag-debug-target",no_class, - &debug_arc_jtag_target_message, - "Set whether to print arc jtag debug messages.\n", - "Show whether to print arc jtag debug messages.\n", - "If set the jtag debug messages from the target are \ -printed.\n", - "Whether to print debug jtag messages is %s.\n", - NULL,NULL,&setlist,&showlist); - - add_setshow_boolean_cmd("arcjtag-debug-statemachine",no_class, - &(arc_jtag_ops.arc_jtag_state_machine_debug), - "Set whether to print JTAG state machine \ -debug messages \n", - "Show whether to print JTAG state machine \ -debug messages \n", - "If set the JTAG state machine messages are \ -printed.\n", - "Whether to print JTAG state machine debug \ -messages is %s\n", - NULL,NULL,&setlist,&showlist); - - add_setshow_uinteger_cmd("arcjtag-retry-count",no_class, &arcjtag_retry_count, - "Set the number of attempts to be made for \ -a JTAG operation.\n", - "Show the number of attempts to be made for \ -a JTAG operation.\n", - "Indicates the number of times a JTAG operation \ -is attempted before returning a failure.\n", - "The number of times a JTAG operation is attempted \ -before returning a failure is %s.\n", - NULL, NULL, &setlist, &showlist); - - add_cmd ("arc-configuration", class_info, arc_print_processor_variant_info, - "Show ARC configuration information." , &infolist); - - add_cmd ("arc-bcr-registers", class_info, arc_print_bcr_regs, - "Show BCR Registers in the ARC Processor Variant", &infolist); - - add_cmd ("arc-reset-board", class_obscure, arc_debug_jtag_reset_board, - "Reset the board.", &cmdlist); + ARC_AuxRegisterDefinition *def = arc_find_aux_register_by_hw_number(hw_regno); + + if (def) + contents = arc_write_value(def, contents); + if (arc_jtag_ops.write_aux_reg(hw_regno, contents) == JTAG_SUCCESS) + { + DEBUG("Written value 0x%08X to auxiliary register %d\n", contents, hw_regno); + return TRUE; + } + + if (warn_on_failure) + arc_elf32_aux_warning(ERROR_ON_WRITING_REGISTER, hw_regno); + return FALSE; } + +/******************************************************************************/ diff --git a/gdb/arc-jtag.h b/gdb/arc-jtag.h index b770a53..68b747b 100644 --- a/gdb/arc-jtag.h +++ b/gdb/arc-jtag.h @@ -1,76 +1,64 @@ -/* Target dependent code for ARC700, for GDB, the GNU debugger. +/* Target dependent code for ARC processor family, for GDB, the GNU debugger. - Copyright 2005 Free Software Foundation, Inc. + Copyright 2005, 2008, 2009 Free Software Foundation, Inc. Contributed by Codito Technologies Pvt. Ltd. (www.codito.com) - Authors: - Soam Vasani + Authors: + Soam Vasani + Richard Stuckey This file is part of GDB. - + 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 + the Free Software Foundation; either version 3 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. -*/ - -#define ARC_DEBUG_REG_SH_BIT 0x40000000 - -#define RAUX(name, hwregno , desc, gdbregno, version) ARC_HW_##name##_REGNUM = hwregno , -#define RBCR(name, hwregno , desc, gdbregno, version) ARC_HW_##name##_REGNUM = hwregno , - - -enum arc_hw_regnums - { - #include "arc-regnums-defs.h" - /* Specific ARCAngel Registers for Caches. */ - ARC_HW_ICACHE_IVIC = 0x10 , /* Invalidate Cache. */ - ARC_HW_ICACHE_CONTROL = 0x11 , /* Disable ICache. ICache control. */ - ARC_HW_DCACHE_IVIC = 0x47, /* Invalidate Cache. */ - ARC_HW_DCACHE_CONTROL = 0x48 , /* Disable DCache. DCache Control. */ - }; - -#undef RBCR -#undef RAUX - -#define ARC_TARGET_OBJECT_AUXREGS -1 - -#define target_read_aux_reg(readbuf, offset, len) \ - (current_target.to_xfer_partial(¤t_target, \ - ARC_TARGET_OBJECT_AUXREGS, NULL, readbuf, NULL, offset, len)) - -#define target_write_aux_reg(writebuf, offset, len) \ - (current_target.to_xfer_partial(¤t_target, \ - ARC_TARGET_OBJECT_AUXREGS, NULL, NULL, writebuf, offset, len)) - - -static inline int -is_arc700 (void) -{ - struct gdbarch_tdep * tdep = gdbarch_tdep (current_gdbarch); - if(tdep->arc_processor_variant_info->arcprocessorversion == ARC700) - return 1; - return 0; - -} - -static inline int -is_arc600 (void) -{ - struct gdbarch_tdep * tdep = gdbarch_tdep (current_gdbarch); - if(tdep->arc_processor_variant_info->arcprocessorversion == ARC600) - return 1; - return 0; - -} - int debug_arc_jtag_target_message; + along with this program. If not, see . */ + +/******************************************************************************/ +/* */ +/* Outline: */ +/* This header file defines some operations provided by the ARC JTAG */ +/* module. */ +/* */ +/******************************************************************************/ + +#ifndef ARC_JTAG_H +#define ARC_JTAG_H + +/* ARC header files */ +#include "arc-support.h" + + +/* Operations for reading/writing core/auxiliary registers; these must be used + when access to the registers *specifically* via the JTAG i/f is required. + + N.B. the register contents returned by these functions, or supplied to them, + are in host byte order. */ + +Boolean arc_read_jtag_core_register (ARC_RegisterNumber hw_regno, + ARC_RegisterContents *contents, + Boolean warn_on_failure); + +Boolean arc_write_jtag_core_register (ARC_RegisterNumber hw_regno, + ARC_RegisterContents contents, + Boolean warn_on_failure); + +Boolean arc_read_jtag_aux_register (ARC_RegisterNumber hw_regno, + ARC_RegisterContents *contents, + Boolean warn_on_failure); + +Boolean arc_write_jtag_aux_register (ARC_RegisterNumber hw_regno, + ARC_RegisterContents contents, + Boolean warn_on_failure); + +#endif /* ARC_JTAG_H */ +/******************************************************************************/ diff --git a/gdb/arc-linux-tdep.c b/gdb/arc-linux-tdep.c index 14d34a6..479d850 100644 --- a/gdb/arc-linux-tdep.c +++ b/gdb/arc-linux-tdep.c @@ -1,506 +1,881 @@ -/* Target dependent code for ARC700, for GDB, the GNU debugger. +/* Target dependent code for ARC processor family, for GDB, the GNU debugger. - Copyright 2005 Free Software Foundation, Inc. + Copyright 2005, 2008, 2009 Free Software Foundation, Inc. - Authors: - Soam Vasani - Ramana Radhakrishnan + Contributed by Codito Technologies Pvt. Ltd. (www.codito.com) + + Authors: + Soam Vasani + Ramana Radhakrishnan + Richard Stuckey This file is part of GDB. - + 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 + the Free Software Foundation; either version 3 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. -*/ - -#include + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +/******************************************************************************/ +/* */ +/* Outline: */ +/* This module provides support for the ARC processor family's target */ +/* dependencies which are specific to the arc-linux-uclibc configuration */ +/* of the ARC gdb. */ +/* */ +/* Functionality: */ +/* This module provides a number of operations, including: */ +/* */ +/* 1) a function which returns the name of a register, given its number */ +/* */ +/* 2) a function which determines whether a given register belongs to a */ +/* particular group (e.g. the group of registers which should be saved */ +/* and restored across a function call) */ +/* */ +/* 3) a function which prints out registers */ +/* */ +/* */ +/* Usage: */ +/* The module exports a function _initialize_arc_linux_tdep: the call to */ +/* this function is generated by the gdb build mechanism, so this function*/ +/* should not be explicitly called. */ +/* */ +/* Some of the operations provided by this module are registered with gdb */ +/* during initialization; gdb then calls them via function pointers, */ +/* rather than by name (this allows gdb to handle multiple target */ +/* architectures): */ +/* */ +/* set_gdbarch_XXX (gdbarch, ); */ +/* */ +/* */ +/* Register Numbering Scheme: */ +/* The N target processor registers are assigned gdb numbers which form a */ +/* contiguous range starting at 0. The scheme used is: */ +/* */ +/* 0 .. 26 : core registers R0 .. R26 */ +/* 27 : BTA (Branch Target Address) auxiliary register */ +/* 28 : LP_START auxiliary register */ +/* 29 : LP_END auxiliary register */ +/* 30 : LP_COUNT core register (R60) */ +/* 31 : STATUS32 auxiliary register */ +/* 32 : BLINK (Branch Link) core register (R31) */ +/* 33 : FP (Frame Pointer) core register (R27) */ +/* 34 : SP (Stack Pointer) core register (R28) */ +/* 35 : EFA (Exception Fault Address) auxiliary register */ +/* 36 : RET (Exception Return Address) auxiliary register */ +/* 37 : ORIG_R8 */ +/* 38 : STOP_PC */ +/* */ +/* N.B. 1) core registers R61 and R62 are not included in the scheme, as */ +/* R61 is reserved, and R62 is not a real register; */ +/* */ +/* 2) core registers R29 (ILINK1), R30 (ILINK2) and R63 (PCL) are */ +/* not included; */ +/* */ +/* 3) extension core registers R32 .. R59 are not included; */ +/* */ +/* 4) most auxiliary registers (including all Build Configuration */ +/* Registers) are not included. */ +/* */ +/******************************************************************************/ + +/* gdb header files */ #include "defs.h" #include "osabi.h" -#include "frame.h" #include "regcache.h" -#include "gdb_assert.h" #include "inferior.h" #include "reggroups.h" #include "solib-svr4.h" -#include "symtab.h" -#include "objfiles.h" #include "block.h" +#include "regset.h" +#include "dis-asm.h" +#include "opcode/arc.h" +#include "gdb_assert.h" +/* ARC header files */ +#include "config/arc/tm-linux.h" +#include "arc-linux-tdep.h" +#include "arc-support.h" #include "arc-tdep.h" -#include "regset.h" +#include "opcodes/arcompact-dis.h" -//#define ARC_DEBUG 1 -/* Default Breakpoint instructions used for - ARC700 Linux -*/ -unsigned int arc700_linux_breakpoint_size = 2; -unsigned char arc700_linux_breakpoint_insn[2] = { 0x3e,0x78 } ; +/* -------------------------------------------------------------------------- */ +/* local data */ +/* -------------------------------------------------------------------------- */ + +#define STATUS32_L 0x00000100 -static const char * -arc_linux_register_name (int regno) -{ - static char linux_names[][10] = {"r0", "r1", "r2", "r3", "r4", "r5", "r6", - "r7", "r8", "r9", "r10", "r11", "r12", "r13", - "r14", "r15", "r16", "r17", "r18", "r19", "r20", - "r21", "r22", "r23", "r24", "r25", "r26", - - "bta", - "lp_start", "lp_end", "lp_count", - "status32", "blink", - "fp", "sp", "efa", - /* linux-only registers */ - "ret", "orig_r8", "pc", - - /* pseudo-regs */ - "ilink1", "ilink2", "eret", - "status_l1", "status_l2", "erstatus" }; - - gdb_assert(ARRAY_SIZE (linux_names) == NUM_REGS + NUM_PSEUDO_REGS); - gdb_assert(regno >=0 && regno < NUM_REGS + NUM_PSEUDO_REGS); - - return linux_names[regno]; -} -/* - * The kernel stores only one of (ilink1,ilink2,eret). This is stored in - * the ret "register". ilink1 is stored when the kernel has been entered - * because of a level 1 interrupt, etc. - * - * Same story for (status_l1, status_l2, erstatus). - * - * This disambiguity has been fixed by adding orig_r8 to pt_regs. - * It will take the following values - - * 1. if an exception of any kind occurs then orig_r8 >= 0 - * 2. Int level 1 : -1 - * 3. Int level 2 : -2 - * - * Registers whose value we don't know are given the value zero. +/* Default breakpoint instruction used for ARC700 Linux. */ +static const unsigned char le_breakpoint_instruction[] = { 0x3e, 0x78 }; +static const unsigned char be_breakpoint_instruction[] = { 0x78, 0x3e }; + + +/* This array holds the object code of two instructions: + mov r8,nr_sigreturn + swi */ -static void -arc_linux_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache, - int regno, void *buf) +static const gdb_byte arc_sigtramp_insns[] = { 0x8a, 0x20, 0xc1, 0x1d, + 0x6f, 0x22, 0x3f, 0x00 }; + +#define SIGTRAMP_INSNS_LENGTH sizeof(arc_sigtramp_insns) + + +/* N.B. the array size is specified in the declaration so that the compiler + will warn of "excess elements in array initializer" if there is a + mismatch (but not of too few elements, unfortunately!). */ +static const char *register_names[ARC_NR_REGS + ARC_NR_PSEUDO_REGS] = { - int status32, ret, orig_r8; - regcache_cooked_read (current_regcache, ARC_ORIG_R8_REGNUM, &orig_r8); + "r0", "r1", "r2", "r3", "r4", "r5", "r6", + "r7", "r8", "r9", "r10", "r11", "r12", "r13", + "r14", "r15", "r16", "r17", "r18", "r19", "r20", + "r21", "r22", "r23", "r24", "r25", "r26", + + "bta", + "lp_start", + "lp_end", + "lp_count", + "status32", + "blink", + "fp", + "sp", + "efa", + + /* Linux-only registers. */ + "ret", + "orig_r8", + "pc", // stop pc + + /* Pseudo-regs. */ + "ilink1", + "ilink2", + "eret", + "status_l1", + "status_l2", + "erstatus" +}; - if(regno == ARC_ILINK1_REGNUM || - regno == ARC_ILINK2_REGNUM || - regno == ARC_ERET_REGNUM) - { - regcache_cooked_read (current_regcache, ARC_RET_REGNUM, &ret); - if(regno == ARC_ILINK1_REGNUM) - *((unsigned int *)buf) = ((orig_r8 == -1) ? ret : 0); - else if(regno == ARC_ILINK2_REGNUM) - *((unsigned int *)buf) = ((orig_r8 == -2) ? ret : 0); - else if(regno == ARC_ERET_REGNUM) - *((unsigned int *)buf) = ((orig_r8 >= 0) ? ret : 0); +/* Mapping between the general-purpose registers in `struct sigcontext' format + and GDB's register cache layout. + + arc_linux_sc_reg_offset[i] is the sigcontext offset of GDB regnum `i'. */ + +/* From . */ +static const int arc_linux_sc_reg_offset[ARC_NR_REGS] = +{ + 23 * BYTES_IN_REGISTER, /* r0 */ + 22 * BYTES_IN_REGISTER, /* r1 */ + 21 * BYTES_IN_REGISTER, /* r2 */ + 20 * BYTES_IN_REGISTER, /* r3 */ + 19 * BYTES_IN_REGISTER, /* r4 */ + 18 * BYTES_IN_REGISTER, /* r5 */ + 17 * BYTES_IN_REGISTER, /* r6 */ + 16 * BYTES_IN_REGISTER, /* r7 */ + 15 * BYTES_IN_REGISTER, /* r8 */ + 14 * BYTES_IN_REGISTER, /* r9 */ + 13 * BYTES_IN_REGISTER, /* r10 */ + 12 * BYTES_IN_REGISTER, /* r11 */ + 11 * BYTES_IN_REGISTER, /* r12 */ + REGISTER_NOT_PRESENT, /* r13 */ + REGISTER_NOT_PRESENT, /* r14 */ + REGISTER_NOT_PRESENT, /* r15 */ + REGISTER_NOT_PRESENT, /* r16 */ + REGISTER_NOT_PRESENT, /* r17 */ + REGISTER_NOT_PRESENT, /* r18 */ + REGISTER_NOT_PRESENT, /* r19 */ + REGISTER_NOT_PRESENT, /* r20 */ + REGISTER_NOT_PRESENT, /* r21 */ + REGISTER_NOT_PRESENT, /* r22 */ + REGISTER_NOT_PRESENT, /* r23 */ + REGISTER_NOT_PRESENT, /* r24 */ + REGISTER_NOT_PRESENT, /* r25 */ + 10 * BYTES_IN_REGISTER, /* r26 */ + 2 * BYTES_IN_REGISTER, /* bta */ + 3 * BYTES_IN_REGISTER, /* lp_start */ + 4 * BYTES_IN_REGISTER, /* lp_end */ + 5 * BYTES_IN_REGISTER, /* lp_count */ + 6 * BYTES_IN_REGISTER, /* status32 */ + 8 * BYTES_IN_REGISTER, /* blink */ + 9 * BYTES_IN_REGISTER, /* fp */ + 1 * BYTES_IN_REGISTER, /* sp */ + REGISTER_NOT_PRESENT, /* efa */ + 7 * BYTES_IN_REGISTER, /* ret */ + REGISTER_NOT_PRESENT, /* orig_r8 */ + REGISTER_NOT_PRESENT /* stop_pc */ +}; + + +/* arcompact_linux_core_reg_offsets[i] is the offset in the .reg section of GDB regnum i. + From include/asm-arc/user.h in the ARC Linux sources. */ + +static const int arcompact_linux_core_reg_offsets[ARC_NR_REGS] = +{ + 22 * BYTES_IN_REGISTER, /* r0 */ + 21 * BYTES_IN_REGISTER, /* r1 */ + 20 * BYTES_IN_REGISTER, /* r2 */ + 19 * BYTES_IN_REGISTER, /* r3 */ + 18 * BYTES_IN_REGISTER, /* r4 */ + 17 * BYTES_IN_REGISTER, /* r5 */ + 16 * BYTES_IN_REGISTER, /* r6 */ + 15 * BYTES_IN_REGISTER, /* r7 */ + 14 * BYTES_IN_REGISTER, /* r8 */ + 13 * BYTES_IN_REGISTER, /* r9 */ + 12 * BYTES_IN_REGISTER, /* r10 */ + 11 * BYTES_IN_REGISTER, /* r11 */ + 10 * BYTES_IN_REGISTER, /* r12 */ + 39 * BYTES_IN_REGISTER, /* r13 */ + 38 * BYTES_IN_REGISTER, /* r14 */ + 37 * BYTES_IN_REGISTER, /* r15 */ + 36 * BYTES_IN_REGISTER, /* r16 */ + 35 * BYTES_IN_REGISTER, /* r17 */ + 34 * BYTES_IN_REGISTER, /* r18 */ + 33 * BYTES_IN_REGISTER, /* r19 */ + 32 * BYTES_IN_REGISTER, /* r20 */ + 31 * BYTES_IN_REGISTER, /* r21 */ + 30 * BYTES_IN_REGISTER, /* r22 */ + 29 * BYTES_IN_REGISTER, /* r23 */ + 28 * BYTES_IN_REGISTER, /* r24 */ + 27 * BYTES_IN_REGISTER, /* r25 */ + 9 * BYTES_IN_REGISTER, /* r26 */ + 1 * BYTES_IN_REGISTER, /* bta */ + 2 * BYTES_IN_REGISTER, /* lp_start */ + 3 * BYTES_IN_REGISTER, /* lp_end */ + 4 * BYTES_IN_REGISTER, /* lp_count */ + 5 * BYTES_IN_REGISTER, /* status32 */ + 7 * BYTES_IN_REGISTER, /* blink */ + 8 * BYTES_IN_REGISTER, /* fp */ + 25 * BYTES_IN_REGISTER, /* sp */ + REGISTER_NOT_PRESENT, /* efa */ + 6 * BYTES_IN_REGISTER, /* ret */ + 24 * BYTES_IN_REGISTER, /* orig_r8 */ + 40 * BYTES_IN_REGISTER, /* stop_pc */ +}; + + +/* -------------------------------------------------------------------------- */ +/* forward declarations */ +/* -------------------------------------------------------------------------- */ + +static int arc_linux_binutils_reg_to_regnum (struct gdbarch *gdbarch, int reg); + + +/* -------------------------------------------------------------------------- */ +/* local macros */ +/* -------------------------------------------------------------------------- */ + +#define PRINT(regnum) \ + default_print_registers_info (gdbarch, file, frame, regnum, all) + + +/* -------------------------------------------------------------------------- */ +/* local functions */ +/* -------------------------------------------------------------------------- */ + +/* Returns TRUE if the instruction at PC is a branch (of any kind). + *fall_thru is set to the address of the next insn. + *target is set to the branch target. */ + +static Boolean +next_pc (CORE_ADDR pc, CORE_ADDR *fall_thru, CORE_ADDR *target) +{ + struct regcache *regcache = get_current_regcache(); + struct disassemble_info di; + struct arcDisState instr; + Boolean two_targets = FALSE; + + arc_initialize_disassembler(&di); + + /* So what is the instruction at the given PC? */ + instr = arcAnalyzeInstr(pc, &di); + + /* By default, the next instruction is the one immediately after the one at PC. */ + *fall_thru = pc + instr.instructionLen; + DEBUG("--- next_pc(%x) = %x, isBranch = %d, tcnt = %d [%x], flow = %s (%d), " + "reg for indirect jump = %d, nullifyMode = %s\n", + (unsigned int) pc, (unsigned int) *fall_thru, instr.isBranch, instr.tcnt, instr.targets[0], + (instr.flow == direct_jump || instr.flow == direct_call) ? "direct" : "indirect", + instr.flow, + instr.register_for_indirect_jump, + ((instr.nullifyMode == (char) BR_exec_always) ? "delay slot" : "no delay")); + + /* OK, it's a branch. */ + if ((Boolean) instr.isBranch) + { + two_targets = TRUE; + + /* If it's a direct jump or call, the destination address is encoded in + the instruction, so we got it by disassembling the instruction; + otherwise, it's an indirect jump to the address held in the register + named in the instruction, so we must read that register. */ + if (instr.flow == direct_jump || instr.flow == direct_call) + *target = (CORE_ADDR) instr.targets[0]; + else + regcache_cooked_read(regcache, + arc_linux_binutils_reg_to_regnum(current_gdbarch, + instr.register_for_indirect_jump), + (gdb_byte*) target); + + /* For instructions with delay slots, the fall thru is not the instruction + immediately after the branch instruction, but the one after that. */ + if (instr.nullifyMode == (char) BR_exec_always) + { + struct arcDisState instr_d = arcAnalyzeInstr(*fall_thru, &di); + + *fall_thru += instr_d.instructionLen; + } } - else if(regno == ARC_STATUS32_L1_REGNUM || - regno == ARC_STATUS32_L2_REGNUM || - regno == ARC_ERSTATUS_REGNUM) + + + /* Check for a zero-overhead loop. */ { - regcache_cooked_read (current_regcache, ARC_STATUS32_REGNUM, &status32); - - if(regno == ARC_STATUS32_L1_REGNUM) - *((unsigned int *)buf) = ((orig_r8 == -1) ? status32 : 0); - else if(regno == ARC_STATUS32_L2_REGNUM) - *((unsigned int *)buf) = ((orig_r8 == -2) ? status32 : 0); - else if(regno == ARC_ERSTATUS_REGNUM) - *((unsigned int *)buf) = ((orig_r8 >= 0) ? status32 : 0); + unsigned int lp_end, lp_start, lp_count, status32; + + regcache_cooked_read(regcache, ARC_LP_START_REGNUM, (gdb_byte*) &lp_start); + regcache_cooked_read(regcache, ARC_LP_END_REGNUM, (gdb_byte*) &lp_end); + regcache_cooked_read(regcache, ARC_LP_COUNT_REGNUM, (gdb_byte*) &lp_count); + regcache_cooked_read(regcache, ARC_STATUS32_REGNUM, (gdb_byte*) &status32); + + if (!(status32 & STATUS32_L) && *fall_thru == lp_end && lp_count > 1) + { + /* The instruction is in effect a jump back to the start of the loop. */ + two_targets = TRUE; + *target = lp_start; + } } - else - internal_error(__FILE__, __LINE__, "arc_pseudo_register_read: bad register number (%d)", regno); + + return two_targets; } + +/* Extract the register values found in the ABI GREGSET, storing their values in + regcache. */ + static void -arc_linux_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache, - int regno, const void *buf) +arcompact_linux_supply_gregset (struct regcache *regcache, + int regnum, + const void *gregs, + size_t size) { - /* none of our pseudo-regs are writable */ - internal_error(__FILE__, __LINE__, "arc_pseudo_register_write: bad register number"); + const bfd_byte *buf = gregs; + unsigned int reg; + + for (reg = 0; reg < ELEMENTS_IN_ARRAY(arcompact_linux_core_reg_offsets); reg++) + { + if (arcompact_linux_core_reg_offsets[reg] != REGISTER_NOT_PRESENT) + regcache_raw_supply (regcache, + (int) reg, + buf + arcompact_linux_core_reg_offsets[reg]); + } } -/* - * print registers in the correct order. - * - * Why not have the regnums in the right order in the first place ? - * Because some of the registers have to be pseudo-registers because of - * the way the kernel is written, and because gdb assumes that - * pseudo-registers have regnums greater than real register regnums. - */ -static void -arc_linux_print_registers_info (struct gdbarch *gdbarch, struct ui_file *file, - struct frame_info *frame, int regnum, int all) + +/* Return whether the frame preceding next_frame corresponds to a GNU/Linux + sigtramp routine. */ + +static Boolean +is_linux_sigtramp (struct frame_info *next_frame) +{ + /* Find the PC for that previous frame. */ + CORE_ADDR pc = frame_pc_unwind (next_frame); + gdb_byte buf[SIGTRAMP_INSNS_LENGTH]; + + /* Read the memory at that PC (this gives us the code without any s/w + breakpoints that may have been set in it). */ + if (!safe_frame_unwind_memory (next_frame, pc, buf, (int) SIGTRAMP_INSNS_LENGTH)) + /* Failed to unwind frame. */ + return FALSE; + + /* Is that code the sigtramp instruction sequence? */ + if (memcmp(buf, arc_sigtramp_insns, SIGTRAMP_INSNS_LENGTH) == 0) + return TRUE; + + /* No - look one instruction earlier in the code. */ + if (!safe_frame_unwind_memory (next_frame, pc - 4, buf, (int) SIGTRAMP_INSNS_LENGTH)) + /* Failed to unwind frame. */ + return FALSE; + + if (memcmp(buf, arc_sigtramp_insns, SIGTRAMP_INSNS_LENGTH) == 0) + return TRUE; + + return FALSE; +} + + +/* Assuming next_frame is a frame following a GNU/Linux sigtramp + routine, return the address of the associated sigcontext structure. */ + +static CORE_ADDR +linux_sigcontext_addr (struct frame_info *next_frame) { - int i; + gdb_byte buf[4]; + + frame_unwind_register (next_frame, ARC_SP_REGNUM, buf); + + return (CORE_ADDR) extract_unsigned_integer (buf, 4); +} + + +/* Determine whether the given register is a member of the given group. - if (regnum >= 0) + Returns 0, 1, or -1: + 0 means the register is not in the group. + 1 means the register is in the group. + -1 means the tdep has nothing to say about this register and group. */ + +static int +register_reggroup_p (int regnum, struct reggroup *group) +{ + if (system_reggroup) { - default_print_registers_info (gdbarch, file, frame, regnum, all); - return; + if (regnum == ARC_ORIG_R8_REGNUM || + regnum == ARC_EFA_REGNUM || + regnum == ARC_ERET_REGNUM || + regnum == ARC_ERSTATUS_REGNUM) + return 1; + } + else if (group == general_reggroup) + { + if (regnum == ARC_RET_REGNUM) + return 0; + + return (regnum == ARC_STATUS32_REGNUM) ? 0 : 1; } - /* print all registers */ - - /* r0..r26 */ - for (i=0; i <= 26; ++i) - default_print_registers_info (gdbarch, file, frame, i, all); - - default_print_registers_info (gdbarch, file, frame, ARC_FP_REGNUM, all); - default_print_registers_info (gdbarch, file, frame, ARC_SP_REGNUM, all); - default_print_registers_info (gdbarch, file, frame, ARC_ILINK1_REGNUM, all); - default_print_registers_info (gdbarch, file, frame, ARC_ILINK2_REGNUM, all); - default_print_registers_info (gdbarch, file, frame, ARC_BLINK_REGNUM, all); - default_print_registers_info (gdbarch, file, frame, ARC_LP_COUNT_REGNUM, all); - - /* now the aux registers */ - - default_print_registers_info (gdbarch, file, frame, ARC_BTA_REGNUM, all); - default_print_registers_info (gdbarch, file, frame, ARC_LP_START_REGNUM, all); - default_print_registers_info (gdbarch, file, frame, ARC_LP_END_REGNUM, all); - default_print_registers_info (gdbarch, file, frame, ARC_EFA_REGNUM, all); - default_print_registers_info (gdbarch, file, frame, ARC_ERET_REGNUM, all); - default_print_registers_info (gdbarch, file, frame, ARC_STATUS32_L1_REGNUM, all); - default_print_registers_info (gdbarch, file, frame, ARC_STATUS32_L2_REGNUM, all); - default_print_registers_info (gdbarch, file, frame, ARC_ERSTATUS_REGNUM, all); - - /* show the pc */ - default_print_registers_info (gdbarch, file, frame, ARC_STOP_PC_REGNUM, all); + /* Let the caller sort it out! */ + return -1; } -/* - * mov r8,nr_sigreturn - * swi - */ -static char arc_sigtramp_insn[] = { 0x8a, 0x20, 0xc1, 0x1d, 0x6f, 0x22, 0x3f, 0x00 }; +/* -------------------------------------------------------------------------- */ +/* local functions called from gdb */ +/* -------------------------------------------------------------------------- */ -/* Return whether the frame preceding NEXT_FRAME corresponds to a - GNU/Linux sigtramp routine. */ -static int -arc_linux_sigtramp_p (struct frame_info *next_frame) +/* The Linux kernel stores only one of (ilink1, ilink2, eret). This is stored + in the ret "register". ilink1 is stored when the kernel has been entered + because of a level 1 interrupt, etc. + + Same story for (status_l1, status_l2, erstatus). + + This disambiguity has been fixed by adding orig_r8 to pt_regs. + + FIXME: what is pt_regs???? + + It will take the following values - + 1. if an exception of any kind occurs then orig_r8 >= 0 + 2. Interrupt level 1 : orig == -1 + 3. Interrupt level 2 : orig == -2 + + Registers whose value we don't know are given the value zero. + + The only pseudo-registers are: + + ARC_ILINK1_REGNUM + ARC_ILINK2_REGNUM + ARC_ERET_REGNUM + ARC_STATUS32_L1_REGNUM + ARC_STATUS32_L2_REGNUM + ARC_ERSTATUS_REGNUM +*/ + +static void +arc_linux_pseudo_register_read (struct gdbarch *gdbarch, + struct regcache *regcache, + int gdb_regno, + gdb_byte *buf) { - CORE_ADDR pc = frame_pc_unwind (next_frame); - unsigned char buf[8]; + unsigned int* contents = (unsigned int *) buf; + unsigned int status32, ret; + int orig_r8; - if (!safe_frame_unwind_memory (next_frame, pc, buf, 8)) - return 0; + regcache_cooked_read (regcache, ARC_ORIG_R8_REGNUM, (gdb_byte*) &orig_r8); - if (memcmp(buf, arc_sigtramp_insn, 8) == 0) - return 1; - else + if (gdb_regno == ARC_ILINK1_REGNUM || + gdb_regno == ARC_ILINK2_REGNUM || + gdb_regno == ARC_ERET_REGNUM) { - pc -= 4; - - if (!safe_frame_unwind_memory (next_frame, pc, buf, 8)) - return 0; + regcache_cooked_read (regcache, ARC_RET_REGNUM, (gdb_byte*) &ret); - if (memcmp(buf, arc_sigtramp_insn, 8) == 0) - return 1; + if (gdb_regno == ARC_ILINK1_REGNUM) + *contents = ((orig_r8 == -1) ? ret : 0); + else if (gdb_regno == ARC_ILINK2_REGNUM) + *contents = ((orig_r8 == -2) ? ret : 0); + else // (gdb_regno == ARC_ERET_REGNUM) + *contents = ((orig_r8 >= 0) ? ret : 0); + + } + else if (gdb_regno == ARC_STATUS32_L1_REGNUM || + gdb_regno == ARC_STATUS32_L2_REGNUM || + gdb_regno == ARC_ERSTATUS_REGNUM) + { + regcache_cooked_read (regcache, ARC_STATUS32_REGNUM, (gdb_byte*) &status32); + + if (gdb_regno == ARC_STATUS32_L1_REGNUM) + *contents = ((orig_r8 == -1) ? status32 : 0); + else if (gdb_regno == ARC_STATUS32_L2_REGNUM) + *contents = ((orig_r8 == -2) ? status32 : 0); + else // (gdb_regno == ARC_ERSTATUS_REGNUM) + *contents = ((orig_r8 >= 0) ? status32 : 0); } + else + internal_error(__FILE__, __LINE__, _("%s: bad pseudo register number (%d)"), __FUNCTION__, gdb_regno); +} + - return 0; +static void +arc_linux_pseudo_register_write (struct gdbarch *gdbarch, + struct regcache *regcache, + int gdb_regno, + const gdb_byte *buf) +{ + /* None of our pseudo-regs are writable. */ + internal_error(__FILE__, __LINE__, _("%s: pseudo-registers are unwritable"), __FUNCTION__); } -/* Assuming NEXT_FRAME is a frame following a GNU/Linux sigtramp - routine, return the address of the associated sigcontext structure. */ -static CORE_ADDR -arc_linux_sigcontext_addr (struct frame_info *next_frame) + +/* Mapping from binutils/gcc register number to GDB register number ("regnum"). + N.B. registers such as ARC_FP_REGNUM, ARC_SP_REGNUM, etc., actually have + different GDB register numbers in the arc-elf32 and arc-linux-uclibc + configurations of the ARC gdb. */ + +static int +arc_linux_binutils_reg_to_regnum (struct gdbarch *gdbarch, int reg) { - char buf[4]; - CORE_ADDR sp; - - frame_unwind_register (next_frame, ARC_SP_REGNUM, buf); - sp = extract_unsigned_integer (buf, 4); + /* From gcc/config/arc/arc.h header file. */ + + if (reg >= 0 && reg <= 26) + return reg; + else if (reg == ARC_ABI_FRAME_POINTER) /* fp */ + return ARC_FP_REGNUM; + else if (reg == ARC_ABI_STACK_POINTER) /* sp */ + return ARC_SP_REGNUM; + else if (reg == 29) /* ilink1 */ + return ARC_ILINK1_REGNUM; + else if (reg == 30) /* ilink2 */ + return ARC_ILINK2_REGNUM; + else if (reg == 31) /* blink */ + return ARC_BLINK_REGNUM; + else if (IS_EXTENSION_CORE_REGISTER(reg)) /* reserved */ + ; + else if (reg == 60) /* lp_count */ + return ARC_LP_COUNT_REGNUM; +#if 0 + else if (reg == 61) /* reserved */ + ; + else if (reg == 62) /* no such register */ + ; + else if (reg == 63) /* PCL */ + ; +#endif + + warning(_("unmapped register #%d encountered"), reg); + return -1; +} + + +/* Print the contents of one, some or all registers. - return sp; + Print registers in the correct order. + Why not have the regnums in the right order in the first place? + Because some of the registers have to be pseudo-registers because of + the way the kernel is written, and because gdb assumes that + pseudo-registers have regnums greater than real register regnums. */ + +static void +arc_linux_print_registers_info (struct gdbarch *gdbarch, + struct ui_file *file, + struct frame_info *frame, + int regnum, + int all) +{ + if (regnum >= 0) + PRINT (regnum); + else /* If regnum < 0, print all registers. */ + { + int i; + + /* R0 .. R26 */ + for (i = 0; i <= 26; i++) PRINT (i); + + PRINT (ARC_FP_REGNUM ); + PRINT (ARC_SP_REGNUM ); + PRINT (ARC_ILINK1_REGNUM ); + PRINT (ARC_ILINK2_REGNUM ); + PRINT (ARC_BLINK_REGNUM ); + PRINT (ARC_LP_COUNT_REGNUM ); + + /* Now the auxiliary registers. */ + + PRINT (ARC_BTA_REGNUM ); + PRINT (ARC_LP_START_REGNUM ); + PRINT (ARC_LP_END_REGNUM ); + PRINT (ARC_EFA_REGNUM ); + PRINT (ARC_ERET_REGNUM ); + PRINT (ARC_STATUS32_L1_REGNUM); + PRINT (ARC_STATUS32_L2_REGNUM); + PRINT (ARC_ERSTATUS_REGNUM ); + + /* Show the PC. */ + PRINT (ARC_STOP_PC_REGNUM ); + } } -int -arc_linux_register_reggroup_p (int regnum, struct reggroup *group) + +/* Return the name of the given register. */ + +static const char* +arc_linux_register_name (struct gdbarch *gdbarch, int gdb_regno) { - if(regnum == ARC_ORIG_R8_REGNUM && group == system_reggroup) - return 1; + gdb_assert(ELEMENTS_IN_ARRAY(register_names) == (unsigned int) (ARC_NR_REGS + ARC_NR_PSEUDO_REGS)); - if(regnum == ARC_RET_REGNUM && group == general_reggroup) - return 0; + /* Oh, for a proper language with array bounds checking, like Ada... */ + gdb_assert(0 <= gdb_regno && gdb_regno < (int) ELEMENTS_IN_ARRAY(register_names)); - return -1; + return register_names[gdb_regno]; } -/* Mapping between the general-purpose registers in `struct - sigcontext' format and GDB's register cache layout. - arc_linux_sc_reg_offset[i] is the sigcontext offset of GDB regnum `i'. */ -/* From . */ -static int arc_linux_sc_reg_offset[] = +/* Determine whether the given register is read-only. */ + +static int +arc_linux_cannot_store_register (struct gdbarch *gdbarch, int gdb_regno) { - 23 * 4, /* r0 */ - 22 * 4, /* r1 */ - 21 * 4, /* r2 */ - 20 * 4, /* r3 */ - 19 * 4, /* r4 */ - 18 * 4, /* r5 */ - 17 * 4, /* r6 */ - 16 * 4, /* r7 */ - 15 * 4, /* r8 */ - 14 * 4, /* r9 */ - 13 * 4, /* r10 */ - 12 * 4, /* r11 */ - 11 * 4, /* r12 */ - -1, /* r13 */ - -1, /* r14 */ - -1, /* r15 */ - -1, /* r16 */ - -1, /* r17 */ - -1, /* r18 */ - -1, /* r19 */ - -1, /* r20 */ - -1, /* r21 */ - -1, /* r22 */ - -1, /* r23 */ - -1, /* r24 */ - -1, /* r25 */ - 10 * 4, /* r26 */ - 2 * 4, /* bta */ - 3 * 4, /* lp_start */ - 4 * 4, /* lp_end */ - 5 * 4, /* lp_count */ - 6 * 4, /* status32 */ - 8 * 4, /* blink */ - 9 * 4, /* fp */ - 1 * 4, /* sp */ - -1, /* efa */ - 7 * 4, /* ret */ - -1, /* orig_r8 */ - -1, /* stop_pc */ -}; + if (gdb_regno == ARC_EFA_REGNUM || + gdb_regno == ARC_ERET_REGNUM || + gdb_regno == ARC_STATUS32_L1_REGNUM || + gdb_regno == ARC_STATUS32_L2_REGNUM || + gdb_regno == ARC_ERSTATUS_REGNUM || + gdb_regno == ARC_ILINK1_REGNUM || + gdb_regno == ARC_ILINK2_REGNUM) + { + /* No warning should be printed. arc_cannot_store_register being + called does not imply that someone is actually writing to regnum. */ + + /* warning(_("writing to read-only register: %s"), gdbarch_register_name(gdbarch, gdb_regno)); */ + return 1; + } + + return 0; +} + + +/* This function is called just before we resume executing the inferior, if we + want to single-step it. We find the target(s) of the instruction about to + be executed and and place breakpoints there. */ + +static int +arc_linux_software_single_step (struct frame_info *frame) +{ + CORE_ADDR fall_thru, branch_target; + CORE_ADDR pc = get_frame_pc(frame); + Boolean two_breakpoints = next_pc(pc, &fall_thru, &branch_target); + + insert_single_step_breakpoint (fall_thru); + + if (two_breakpoints) + { + if (pc != branch_target) + insert_single_step_breakpoint (branch_target); + } + + /* Always returns true for now. */ + return 1; +} /* Set the program counter for process PTID to PC. */ static void -arc700_linux_write_pc (CORE_ADDR pc, ptid_t ptid) +arc_linux_write_pc (struct regcache *regcache, CORE_ADDR pc) { - ULONGEST val; - write_register_pid (PC_REGNUM, pc, ptid); - - /* We must be careful with modifying the program counter. If we - just interrupted a system call, the kernel might try to restart - it when we resume the inferior. On restarting the system call, - the kernel will try backing up the program counter even though it - no longer points at the system call. This typically results in a - SIGSEGV or SIGILL. We can prevent this by writing `-1' in the - "orig_r8" pseudo-register. - - Note that "orig_r8" is saved when setting up a dummy call frame. - This means that it is properly restored when that frame is - popped, and that the interrupted system call will be restarted - when we resume the inferior on return from a function call from - within GDB. In all other cases the system call will not be - restarted. */ - write_register_pid (ARC_ORIG_R8_REGNUM, -3, ptid); + regcache_cooked_write_unsigned (regcache, ARC_PC_REGNUM, pc); + + /* We must be careful with modifying the program counter. If we + just interrupted a system call, the kernel might try to restart + it when we resume the inferior. On restarting the system call, + the kernel will try backing up the program counter even though it + no longer points at the system call. This typically results in a + SIGSEGV or SIGILL. We can prevent this by writing `-1' in the + "orig_r8" pseudo-register. + + Note that "orig_r8" is saved when setting up a dummy call frame. + This means that it is properly restored when that frame is + popped, and that the interrupted system call will be restarted + when we resume the inferior on return from a function call from + within GDB. In all other cases the system call will not be + restarted. */ + + // FIXME: why -3 and not -1? -3 does not appear to be a defined valued for + // orig_r8 (i.e. -2, -1 or >= 0) - perhaps it means "none of these"? + regcache_cooked_write_signed (regcache, ARC_ORIG_R8_REGNUM, -3); } /* See the comments for SKIP_SOLIB_RESOLVER at the top of infrun.c. - This is called on every single step thru the PLT and runtime resolver. + This is called on every single step through the PLT and runtime resolver. This function: - 1) decides whether a PLT has sent us into the linker to resolve - a function reference, and - 2) if so, tells us where to set a temporary breakpoint that will - trigger when the dynamic linker is done. */ + 1) decides whether a PLT has sent us into the linker to resolve + a function reference, and + 2) if so, tells us where to set a temporary breakpoint that will + trigger when the dynamic linker is done. */ -CORE_ADDR +static CORE_ADDR arc_linux_skip_solib_resolver (struct gdbarch *gdbarch, CORE_ADDR pc) { - /* For uClibc 0.9.26. - - An unresolved PLT entry points to "__dl_linux_resolve", which calls - "__dl_linux_resolver" to do the resolving and then eventually jumps to - the function. - - So we look for the symbol `_dl_linux_resolver', and if we are there, - we set a breakpoint at the return address, and continue. */ - - /* lookup_minimal_symbol didn't work, for some reason. */ - struct symbol *resolver - = lookup_symbol_global ("_dl_linux_resolver", 0, VAR_DOMAIN, 0); - -#ifdef ARC_DEBUG - printf("--- arc_linux_skip_solib_resolver: pc = %x, resolver at %x\n", pc, - resolver ? BLOCK_START (SYMBOL_BLOCK_VALUE (resolver)) : 0); -#endif - - if (resolver && (BLOCK_START (SYMBOL_BLOCK_VALUE (resolver))) == pc) - { - return frame_pc_unwind (get_current_frame ()); - } + /* For uClibc 0.9.26. - return 0; -} + An unresolved PLT entry points to "__dl_linux_resolve", which calls + "__dl_linux_resolver" to do the resolving and then eventually jumps to + the function. + So we look for the symbol `_dl_linux_resolver', and if we are there, + gdb sets a breakpoint at the return address, and continues. */ -/* arcompact_linux_core_reg_offsets[i] is the offset in the .reg section of GDB - regnum i . - - From include/asm-arc/user.h in the ARC Linux sources. */ -static int arcompact_linux_core_reg_offsets[] = { - 22 * 4, /* r0 */ - 21 * 4, /* r1 */ - 20 * 4, /* r2 */ - 19 * 4, /* r3 */ - 18 * 4, /* r4 */ - 17 * 4, /* r5 */ - 16 * 4, /* r6 */ - 15 * 4, /* r7 */ - 14 * 4, /* r8 */ - 13 * 4, /* r9 */ - 12 * 4, /* r10 */ - 11 * 4, /* r11 */ - 10 * 4, /* r12 */ - 39 * 4, /* r13 */ - 38 * 4, /* r14 */ - 37 * 4, /* r15 */ - 36 * 4, /* r16 */ - 35 * 4, /* r17 */ - 34 * 4, /* r18 */ - 33 * 4, /* r19 */ - 32 * 4, /* r20 */ - 31 * 4, /* r21 */ - 30 * 4, /* r22 */ - 29 * 4, /* r23 */ - 28 * 4, /* r24 */ - 27 * 4, /* r25 */ - 9 * 4, /* r26 */ - 1 * 4, /* bta */ - 2 * 4, /* lp_start */ - 3 * 4, /* lp_end */ - 4 * 4, /* lp_count */ - 5 * 4, /* status32 */ - 7 * 4, /* blink */ - 8 * 4, /* fp */ - 25 * 4, /* sp */ - -1, /* efa */ - 6 * 4, /* ret */ - 24 * 4, /* orig_r8 */ - 40 * 4, /* stop_pc */ -}; + /* Lookup_minimal_symbol didn't work, for some reason. */ + struct symbol *resolver = + lookup_symbol_global ("_dl_linux_resolver", 0, 0, VAR_DOMAIN, 0); -/* Extract the register values found in the ABI GREGSET, storing their - values in REGCACHE. */ -static void -arcompact_linux_supply_gregset (struct regcache *regcache, - int regnum, const void *gregs, size_t size) -{ - int regi; - int arc_num_gprs = ARRAY_SIZE (arcompact_linux_core_reg_offsets); - const bfd_byte *buf = gregs; + DEBUG((resolver == NULL) ? "--- %s : pc = %x, no resolver found" + : "--- %s : pc = %x, resolver at %x\n", + __FUNCTION__, + (unsigned int) pc, + (unsigned int) ((resolver == NULL) ? 0 : BLOCK_START (SYMBOL_BLOCK_VALUE (resolver)))); - for (regi = 0; regi < arc_num_gprs; regi++) - { - if (arcompact_linux_core_reg_offsets[regi] > 0) - regcache_raw_supply (regcache, regi, - buf + arcompact_linux_core_reg_offsets[regi]); - } + if ((resolver != NULL) && (BLOCK_START (SYMBOL_BLOCK_VALUE (resolver))) == pc) + /* Find the return address. */ + return frame_pc_unwind (get_current_frame ()); + + /* No breakpoint is required. */ + return 0; } -/* Call the right architecture variant's supply_gregset function. For now, - we only have ARCompact. */ + +/* Call the right architecture variant's supply_gregset function. For now, we + have only ARCompact. */ + static void arc_linux_supply_gregset (const struct regset *regset, - struct regcache *regcache, - int regnum, const void *gregs, size_t size) + struct regcache *regcache, + int regnum, + const void *gregs, + size_t size) { - arcompact_linux_supply_gregset (regcache, regnum, gregs, size); + arcompact_linux_supply_gregset (regcache, regnum, gregs, size); } + /* Functions for handling core files. The first element is a parameter to pass the rest of the functions. We don't need it. supply_gregset is for reading the core file. collect_regset, which we haven't defined, would be for writing the core file. */ -static struct regset arc_linux_gregset = { - NULL, arc_linux_supply_gregset -}; -/* This is called through gdbarch. */ static const struct regset * arc_linux_regset_from_core_section (struct gdbarch *core_arch, - const char *sect_name, size_t sect_size) + const char *sect_name, + size_t sect_size) { - if (strcmp (sect_name, ".reg") == 0) - return &arc_linux_gregset; + static const struct regset arc_linux_gregset = + { + NULL, // descr + arc_linux_supply_gregset, // supply_regset + NULL, // collect_regset + NULL // arch + }; + + if (strcmp (sect_name, ".reg") == 0) + return &arc_linux_gregset; - return NULL; + return NULL; } -/* Add the signal stuff to gdbarch->tdep. */ + +/* Initialize for this ABI. */ + static void arc_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) { - struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); - - tdep->sigtramp_p = arc_linux_sigtramp_p; - tdep->sigcontext_addr = arc_linux_sigcontext_addr; - tdep->sc_reg_offset = arc_linux_sc_reg_offset; - tdep->sc_num_regs = ARRAY_SIZE (arc_linux_sc_reg_offset); - - tdep->arc_breakpoint_size = arc700_linux_breakpoint_size; - tdep->arc_breakpoint_insn = arc700_linux_breakpoint_insn; - - set_gdbarch_num_regs (gdbarch, ARC_NR_REGS); - set_gdbarch_num_pseudo_regs (gdbarch, ARC_NR_PSEUDO_REGS); - - set_gdbarch_pc_regnum (gdbarch, ARC_STOP_PC_REGNUM); - set_gdbarch_register_name (gdbarch, arc_linux_register_name); - - set_gdbarch_software_single_step (gdbarch, arc_software_single_step); - - set_gdbarch_write_pc (gdbarch, arc700_linux_write_pc); - - tdep->pc_regnum_in_sigcontext = ARC_RET_REGNUM; + struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); + + /* Fill in target-dependent info in ARC-private structure. */ + + tdep->is_sigtramp = is_linux_sigtramp; + tdep->sigcontext_addr = linux_sigcontext_addr; + tdep->sc_reg_offset = arc_linux_sc_reg_offset; + tdep->sc_num_regs = ELEMENTS_IN_ARRAY(arc_linux_sc_reg_offset); + tdep->pc_regnum_in_sigcontext = ARC_RET_REGNUM; + + tdep->le_breakpoint_instruction = le_breakpoint_instruction; + tdep->be_breakpoint_instruction = be_breakpoint_instruction; + tdep->breakpoint_size = (unsigned int) sizeof(le_breakpoint_instruction); + + tdep->register_reggroup_p = register_reggroup_p; + + tdep->lowest_pc = 0x74; // FIXME: why this? + tdep->processor_variant_info = NULL; + + /* Pass target-dependent info to gdb. */ + + /* ARC_NR_REGS and ARC_NR_PSEUDO_REGS are defined in the tm.h configuration file. */ + set_gdbarch_pc_regnum (gdbarch, ARC_STOP_PC_REGNUM); + set_gdbarch_num_regs (gdbarch, ARC_NR_REGS); + set_gdbarch_num_pseudo_regs (gdbarch, ARC_NR_PSEUDO_REGS); + set_gdbarch_print_registers_info (gdbarch, arc_linux_print_registers_info); + set_gdbarch_register_name (gdbarch, arc_linux_register_name); + set_gdbarch_cannot_store_register (gdbarch, arc_linux_cannot_store_register); + set_gdbarch_dwarf2_reg_to_regnum (gdbarch, arc_linux_binutils_reg_to_regnum); + + set_gdbarch_decr_pc_after_break (gdbarch, 0); + set_gdbarch_software_single_step (gdbarch, arc_linux_software_single_step); + set_gdbarch_write_pc (gdbarch, arc_linux_write_pc); + set_gdbarch_pseudo_register_read (gdbarch, arc_linux_pseudo_register_read); + set_gdbarch_pseudo_register_write (gdbarch, arc_linux_pseudo_register_write); + set_gdbarch_regset_from_core_section (gdbarch, arc_linux_regset_from_core_section); + set_gdbarch_skip_solib_resolver (gdbarch, arc_linux_skip_solib_resolver); + + /* GNU/Linux uses SVR4-style shared libraries. */ + set_solib_svr4_fetch_link_map_offsets (gdbarch, svr4_ilp32_fetch_link_map_offsets); +} - set_gdbarch_pseudo_register_read (gdbarch, arc_linux_pseudo_register_read); - set_gdbarch_pseudo_register_write (gdbarch, arc_linux_pseudo_register_write); +/* -------------------------------------------------------------------------- */ +/* externally visible functions */ +/* -------------------------------------------------------------------------- */ - set_gdbarch_print_registers_info (gdbarch, arc_linux_print_registers_info); +/* Initialize the module. This function is called from the gdb core on start-up. */ - tdep->register_reggroup_p = arc_linux_register_reggroup_p; - - tdep->lowest_pc = 0x74; +void +_initialize_arc_linux_tdep (void) +{ + /* Register a handler with gdb for the Linux O/S ABI variant for the ARC + processor architecture, providing an initialization function; + 'bfd_arch_arc' is an enumeration value specifically denoting the ARC + architecture. */ + gdbarch_register_osabi (bfd_arch_arc, + 0, // machine (irrelevant) + GDB_OSABI_LINUX, + arc_linux_init_abi); +} - tdep->arc_processor_variant_info = NULL; - set_gdbarch_regset_from_core_section (gdbarch, - arc_linux_regset_from_core_section); - /* GNU/Linux uses SVR4-style shared libraries. */ - set_solib_svr4_fetch_link_map_offsets - (gdbarch, svr4_ilp32_fetch_link_map_offsets); - set_gdbarch_skip_solib_resolver (gdbarch, arc_linux_skip_solib_resolver); -} +/* This function is required simply to avoid an undefined symbol at linkage. */ void -_initialize_arc_linux_tdep (void) +arc_check_pc_defined (struct gdbarch *gdbarch) { - gdbarch_register_osabi (bfd_arch_arc, 0, GDB_OSABI_LINUX, - arc_linux_init_abi); } + +/******************************************************************************/ diff --git a/gdb/arc-linux-tdep.h b/gdb/arc-linux-tdep.h new file mode 100644 index 0000000..af1aa0e --- /dev/null +++ b/gdb/arc-linux-tdep.h @@ -0,0 +1,51 @@ +/* Target dependent code for ARC processor family, for GDB, the GNU debugger. + + Copyright 2008, 2009 Free Software Foundation, Inc. + + Contributed by ARC International (www.arc.com) + + Authors: + Richard Stuckey + + This file is part of GDB. + + 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 3 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, see . */ + +/******************************************************************************/ +/* */ +/* Outline: */ +/* This header file defines the type and operations for the Linux-uclibc */ +/* variant of the ARC debugger. */ +/* */ +/******************************************************************************/ + +#ifndef ARC_LINUX_TDEP_H +#define ARC_LINUX_TDEP_H + +/* gdb header files */ +#include "defs.h" +#include "gdbarch.h" + + +/* Complete the structure definition here. */ +struct arc_variant_info +{ + /* There is currently no variant-specific info. */ +}; + + +void arc_check_pc_defined (struct gdbarch *gdbarch); + +#endif /* ARC_LINUX_TDEP_H */ +/******************************************************************************/ diff --git a/gdb/arc-memory.c b/gdb/arc-memory.c new file mode 100644 index 0000000..806efb0 --- /dev/null +++ b/gdb/arc-memory.c @@ -0,0 +1,445 @@ +/* Target dependent code for ARC processor family, for GDB, the GNU debugger. + + Copyright 2009 Free Software Foundation, Inc. + + Contributed by ARC International (www.arc.com) + + Author: + Richard Stuckey + + This file is part of GDB. + + 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 3 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, see . */ + +/******************************************************************************/ +/* */ +/* Outline: */ +/* This module implements operations for reading data from and writing */ +/* data to target memory. */ +/* */ +/* The operations may be required to transfer arbitrary amounts of data */ +/* to/from arbitrary addresses in memory; however, the supplied transfer */ +/* operations must be assumed to be able only to transfer multiple words */ +/* of data to/from word-aligned addresses. */ +/* */ +/* This gives the general case: */ +/* */ +/* word boundaries */ +/* | */ +/* ------------------------------------------------- */ +/* | | | | | | */ +/* ----------------------------------------------------------- */ +/* | g g L L | W W W W | W W W W | W W W W | T T e e | */ +/* ----------------------------------------------------------- */ +/* ^ */ +/* |-------------------------------------| */ +/* | len */ +/* addr */ +/* */ +/* where addr is the base address of the data to be transferred */ +/* len is the number of bytes of data to be transferred */ +/* W denotes a byte that can be transfered in a whole word */ +/* L denotes a leading byte */ +/* T denotes a trailing byte */ +/* g denotes a gap byte */ +/* e denotes a end gap byte */ +/* */ +/* There may be 0 .. BYTES_IN_WORD - 1 leading bytes, 0 or more whole */ +/* words, and 0 .. BYTES_IN_WORD - 1 trailing bytes. If the given address */ +/* is word-aligned, there is no gap and hence no leading bytes. */ +/* */ +/* There is also a pathological case: */ +/* */ +/* word boundaries */ +/* | */ +/* --------- */ +/* | | */ +/* ----------------------------------------------------------- */ +/* | g B B e | */ +/* ----------------------------------------------------------- */ +/* ^ */ +/* |-| */ +/* | len */ +/* addr */ +/* */ +/* where 1 .. BYTES_IN_WORD - 2 bytes of data in the middle of a word */ +/* must be transfered. */ +/* */ +/* In a write operation, it is necessary to preserve the contents of the */ +/* gap and end gap bytes, if any - this is done by first reading the word */ +/* which contains those bytes, constructing a new word which contains */ +/* those bytes and the new bytes, and writing the new value back to that */ +/* location. */ +/* */ +/******************************************************************************/ + +/* system header files */ + +/* gdb header files */ +#include "defs.h" + +/* ARC header files */ +#include "arc-memory.h" +#include "arc-tdep.h" + + +/* -------------------------------------------------------------------------- */ +/* local types */ +/* -------------------------------------------------------------------------- */ + +typedef struct +{ + unsigned int leading_bytes; + unsigned int trailing_bytes; + unsigned int words; +} Layout; + + +/* -------------------------------------------------------------------------- */ +/* local functions */ +/* -------------------------------------------------------------------------- */ + +/* Split a memory chunk up into its layout - see diagram in file header. */ + +static Layout +split (ARC_Address addr, unsigned int bytes) +{ + unsigned int gap = addr % BYTES_IN_WORD; + Layout layout; + + layout.leading_bytes = (gap == 0) ? 0 : (BYTES_IN_WORD - gap); + layout.trailing_bytes = (addr + bytes) % BYTES_IN_WORD; + layout.words = (bytes - layout.leading_bytes + - layout.trailing_bytes) / BYTES_IN_WORD; + + DEBUG("%u leading bytes, %u words, %u trailing bytes\n", + layout.leading_bytes, layout.words, layout.trailing_bytes); + + return layout; +} + + +/* Read part of a word of data from memory; the given address must be word-aligned. */ + +static unsigned int +read_partial_word (TargetOperations *ops, + ARC_Address addr, + ARC_Byte *data, + unsigned int bytes, + unsigned int offset) /* Offset of required bytes within word. */ +{ + ARC_Byte word[BYTES_IN_WORD]; + + /* Read the word: only some bytes of this are required. */ + if (ops->read_memory(addr, word, 1) > 0) + { + unsigned int i; + + for (i = 0; i < bytes; i++) + data[i] = word[offset + i]; + + /* Have read the specified number of bytes. */ + return bytes; + } + + /* Failed: no data read. */ + return 0; +} + + +/* Write part of a word of data to memory; the given address must be word-aligned. */ + +static unsigned int +write_partial_word (TargetOperations *ops, + ARC_Address addr, + ARC_Byte *data, + unsigned int bytes, + unsigned int offset) /* Offset of required bytes within word. */ +{ + ARC_Byte word[BYTES_IN_WORD]; + + /* First read the word of memory that will be overwritten. */ + if (ops->read_memory(addr, word, 1) > 0) + { + unsigned int i; + + /* Next replace the bytes in that word that are to be written. */ + for (i = 0; i < bytes; i++) + word[offset + i] = data[i]; + + /* Now write it! */ + if (ops->write_memory(addr, word, 1) > 0) + /* Have written the specified number of bytes. */ + return bytes; + } + + /* Failed: no data written. */ + return 0; +} + + +/* -------------------------------------------------------------------------- */ +/* externally visible functions */ +/* -------------------------------------------------------------------------- */ + +/* Read a chunk of data from target memory. + Returns number of bytes read. */ + +unsigned int +arc_read_memory (TargetOperations *ops, + ARC_Address address, + ARC_Byte *data, + unsigned int bytes) +{ + unsigned int gap = address % BYTES_IN_WORD; + unsigned int total_read = 0; + + ENTERARGS("address 0x%08X, bytes %u", address, bytes); + + /* Special fast case for reading a single word. */ + if (gap == 0 && bytes == BYTES_IN_WORD) + { + DEBUG("read single word\n"); + + /* N.B. assumes that 'data' is word-aligned, or that host does not care! */ + total_read = ops->read_memory(address, data, 1); + } + /* Pathological case: bytes in middle of word. */ + else if (gap > 0 && gap + bytes < BYTES_IN_WORD) + { + DEBUG("read pathological\n"); + + total_read = read_partial_word(ops, + address - gap, /* Word-aligned address. */ + data, + bytes, + gap); + } + else /* The general case. */ + { + Layout chunk = split(address, bytes); + + if (chunk.leading_bytes > 0) + { + /* Read the first few bytes. */ + total_read = read_partial_word(ops, + address - gap, /* Word-aligned addres. */ + data, + chunk.leading_bytes, + gap); + data += chunk.leading_bytes; + address += chunk.leading_bytes; + } + + if (chunk.words > 0) + { + unsigned int bytes_read = ops->read_memory(address, data, chunk.words); + + total_read += bytes_read; + address += bytes_read; + data += bytes_read; + } + + if (chunk.trailing_bytes > 0) + { + /* Read the last few bytes of data. */ + total_read += read_partial_word(ops, + address, // Word-aligned address. */ + data, + chunk.trailing_bytes, + 0); + } + } + + DEBUG("read %u bytes\n", total_read); + + return total_read; +} + + +/* Write a chunk of data to target memory. + Returns number of bytes written. */ + +unsigned int +arc_write_memory (TargetOperations *ops, + ARC_Address address, + ARC_Byte *data, + unsigned int bytes) +{ + unsigned int gap = address % BYTES_IN_WORD; + unsigned int total_written = 0; + + ENTERARGS("address 0x%08X, bytes %u", address, bytes); + + /* Useful debugging code: just change 0 to 1. */ + if (0) + { + unsigned int i; + for (i = 0; i < bytes; i++) + { + DEBUG("%02X", data[i]); + if ((i + 1) % 16 == 0) + DEBUG("\n"); + } + DEBUG("\n"); + } + + /* Special fast case for writing a single word. */ + if (gap == 0 && bytes == BYTES_IN_WORD) + { + DEBUG("write single word (%02X %02X %02X %02X)\n", data[0], data[1], data[2], data[3]); + + total_written = ops->write_memory(address, data, 1); + } + /* Pathological case: bytes in middle of word. */ + else if (gap > 0 && gap + bytes < BYTES_IN_WORD) + { + DEBUG("write pathological\n"); + + total_written = write_partial_word(ops, + address - gap, /* Word-aligned address. */ + data, + bytes, + gap); + } + else /* general case */ + { + Layout chunk = split(address, bytes); + + if (chunk.leading_bytes > 0) + { + /* Write the first few bytes. */ + total_written = write_partial_word(ops, + address - gap, /* Word-aligned address. */ + data, + chunk.leading_bytes, + gap); + data += chunk.leading_bytes; + address += chunk.leading_bytes; + } + + if (chunk.words > 0) + { + unsigned int bytes_written = ops->write_memory(address, data, chunk.words); + + total_written += bytes_written; + address += bytes_written; + data += bytes_written; + } + + if (chunk.trailing_bytes > 0) + { + /* Write the last few bytes of data. */ + total_written += write_partial_word(ops, + address, /* Word-aligned address. */ + data, + chunk.trailing_bytes, + 0); + } + } + + DEBUG("written %u bytes\n", total_written); + + return total_written; +} + + +/* Write a repeated pattern of data to memory; + the start of each pattern is always word-aligned, so if the given address is + not word-aligned, the first partial word written will contain trailing bytes + of the pattern. */ + +unsigned int +arc_write_pattern (TargetOperations *ops, + ARC_Address address, + ARC_Word pattern, + unsigned int bytes) +{ + unsigned int gap = address % BYTES_IN_WORD; + unsigned int total_written = 0; + + ENTERARGS("address 0x%08X, pattern 0x%08X, bytes %u", address, pattern, bytes); + + /* Special fast case for writing a single word. */ + if (gap == 0 && bytes == BYTES_IN_WORD) + { + DEBUG("write single word (%08X)\n", pattern); + + total_written = ops->write_memory(address, (ARC_Byte*) &pattern, 1); + } + /* Pathological case: bytes in middle of word. */ + else if (gap > 0 && gap + bytes < BYTES_IN_WORD) + { + DEBUG("write pathological\n"); + + total_written = write_partial_word(ops, + address - gap, /* Word-aligned address. */ + ((ARC_Byte*) &pattern) + gap , + bytes, + gap); + } + else /* General case. */ + { + Layout chunk = split(address, bytes); + + if (chunk.leading_bytes > 0) + { + /* Write the first few bytes. */ + total_written = write_partial_word(ops, + address - gap, /* Word-aligned address. */ + ((ARC_Byte*) &pattern) + gap , + chunk.leading_bytes, + gap); + + address += chunk.leading_bytes; + } + + /* If we have been given a fill_memory operation. */ + if (ops->fill_memory) + { + /* Write the complete words of data in one go. */ + unsigned int bytes_written = ops->fill_memory(address, pattern, chunk.words); + + total_written += bytes_written; + address += bytes_written; + } + else + { + /* Write all the complete words of data, one word at a time. */ + while (chunk.words--) + { + unsigned int bytes_written = ops->write_memory(address, (ARC_Byte*) &pattern, 1); + + total_written += bytes_written; + address += bytes_written; + } + } + + if (chunk.trailing_bytes > 0) + { + /* Write the last few bytes of data. */ + total_written += write_partial_word(ops, + address, /* Word-aligned address. */ + ((ARC_Byte*) &pattern), + chunk.trailing_bytes, + 0); + } + } + + DEBUG("written %u bytes\n", total_written); + + return total_written; +} + +/******************************************************************************/ diff --git a/gdb/arc-memory.h b/gdb/arc-memory.h new file mode 100644 index 0000000..110d5cb --- /dev/null +++ b/gdb/arc-memory.h @@ -0,0 +1,64 @@ +/* Target dependent code for ARC processor family, for GDB, the GNU debugger. + + Copyright 2009 Free Software Foundation, Inc. + + Contributed by ARC International (www.arc.com) + + Authors: + Richard Stuckey + + This file is part of GDB. + + 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 3 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, see . */ + +/******************************************************************************/ +/* */ +/* Outline: */ +/* This header file defines operations for reading data from, and writing */ +/* data to, target memory. */ +/* */ +/* The data transferred may be of any length, and its start address may */ +/* have any alignment. */ +/* */ +/* These operations must be supplied with more basic operations which can */ +/* read or write an arbitrary number of complete words of data to or from */ +/* word-aligned addresses. */ +/* */ +/* Optionally, an operation which can write an arbitrary number of copies */ +/* of a word-sized pattern to memory, starting at a word-aligned address, */ +/* may be supplied for use by the arc_write_pattern operation; this is an */ +/* optimisation for improving performance: if it is not supplied, the */ +/* arc_write_pattern operation will use repeated calls of the supplied */ +/* 'write_words' operation. */ +/* */ +/* A pointer to user-defined data may be passed to these operations: it */ +/* will be passed to the basic operations when they are invoked (this */ +/* allows any required context data to be passed to those operations). */ +/* */ +/******************************************************************************/ + +#ifndef ARC_MEMORY +#define ARC_MEMORY + +/* ARC header files */ +#include "arc-support.h" + + +unsigned int arc_read_memory (TargetOperations *ops, ARC_Address address, ARC_Byte *data, unsigned int bytes); +unsigned int arc_write_memory (TargetOperations *ops, ARC_Address address, ARC_Byte *data, unsigned int bytes); +unsigned int arc_write_pattern (TargetOperations *ops, ARC_Address address, ARC_Word pattern, unsigned int bytes); + + +#endif /* ARC_MEMORY */ +/******************************************************************************/ diff --git a/gdb/arc-registers.c b/gdb/arc-registers.c new file mode 100644 index 0000000..c0f7710 --- /dev/null +++ b/gdb/arc-registers.c @@ -0,0 +1,2566 @@ +/* Target dependent code for ARC processor family, for GDB, the GNU debugger. + + Copyright 2008, 2009 Free Software Foundation, Inc. + + Contributed by ARC International (www.arc.com) + + Author: + Richard Stuckey + + This file is part of GDB. + + 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 3 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, see . */ + +/******************************************************************************/ +/* */ +/* Outline: */ +/* This module implements operations for manipulating the ARC processor */ +/* core registers and auxiliary registers. */ +/* */ +/******************************************************************************/ + +/* system header files */ +#include +#include +#include +#include +#include +#include +#include +#include + +/* gdb header files */ +#include "defs.h" +#include "gdbcmd.h" +#include "regcache.h" +#include "objfiles.h" +#include "inferior.h" +#include "target.h" +#include "xml-support.h" +#include "gdb_assert.h" + +/* ARC header files */ +#include "arc-registers.h" +#include "arc-architecture.h" +#include "arc-tdep.h" +#include "arc-elf32-tdep.h" +#include "config/arc/tm-embed.h" + +/* ARC simulator header files */ +#include "sim/arc/arc-sim-registers.h" + + +/* -------------------------------------------------------------------------- */ +/* local types */ +/* -------------------------------------------------------------------------- */ + +typedef struct field_meaning +{ + char *description; + ARC_RegisterContents value; +} ARC_FieldMeaning; + + +typedef struct field_definition +{ + char *name; + char *description; + unsigned int offset; + unsigned int size; + RegisterAccess access; + ARC_RegisterContents value_for_write; + Boolean fixed; + ARC_FieldMeaning *meanings; + unsigned int meaning_count; +} ARC_FieldDefinition; + + +/* Complete the type (declared in the header file) here. */ +struct aux_register_definition +{ + char *name; + char *description; + ARC_RegisterNumber number; /* The number in the auxiliary register space. */ + int gdb_regno; + Boolean is_BCR; + ARC_Word mask; + RegisterAccess access; + ARC_FieldDefinition *fields; + unsigned int field_count; + unsigned int longest_field_name; + unsigned int max_bits_in_field; +}; + + +/* An instance of this structure is used to pass state data + between the parsing routines. + + The information is accumulated into the 'info' * field; + as each register or field description is parsed, the + information is held in the 'reg' or 'field' field before + validation is performed. If the information is valid, + it is copied into the 'info' structure. */ +typedef struct parsing_data +{ + const char *filename; + ARC_RegisterInfo *info; + ARC_AuxRegisterDefinition *currentRegister; + ARC_FieldDefinition *currentField; + ARC_RegisterContents maxFieldContents; + ARC_AuxRegisterDefinition reg; + ARC_FieldDefinition field; +} ParsingData; + + +/* -------------------------------------------------------------------------- */ +/* forward declarations */ +/* -------------------------------------------------------------------------- */ + +static gdb_xml_element_start_handler start_architecture; +static gdb_xml_element_end_handler end_architecture; +static gdb_xml_element_start_handler start_feature; +static gdb_xml_element_start_handler start_target; +static gdb_xml_element_start_handler start_auxregister; +static gdb_xml_element_start_handler start_bcr; +static gdb_xml_element_start_handler start_ecr; +static gdb_xml_element_start_handler start_field; +static gdb_xml_element_start_handler start_bcrfield; +static gdb_xml_element_start_handler start_meaning; + + +/* -------------------------------------------------------------------------- */ +/* externally visible data */ +/* -------------------------------------------------------------------------- */ + +/* This indicates whether a 'register architecture changed' event must be sent, + but has not yet been sent. */ +Boolean arc_pending_register_architecture_change_event; + + +/* -------------------------------------------------------------------------- */ +/* local data */ +/* -------------------------------------------------------------------------- */ + +#define REG_READ_FILE_COMMAND "arc-reg-read-file" +#define REG_READ_EXTRA_FILE_COMMAND "arc-reg-read-extra-file" +#define AUX_REG_READ_COMMAND "arc-aux-read" +#define AUX_REG_WRITE_COMMAND "arc-aux-write" +#define AUX_REG_SHOW_COMMAND "arc-aux-show" +#define AUX_LIST_REGISTER_COMMAND "arc-aux-list" +#define ARC_BCR_COMMAND "arc-bcr-registers" + +#define REG_READ_FILE_COMMAND_USAGE "Usage: " REG_READ_FILE_COMMAND " \n" +#define REG_READ_EXTRA_FILE_COMMAND_USAGE "Usage: " REG_READ_EXTRA_FILE_COMMAND " \n" +#define AUX_REG_READ_COMMAND_USAGE "Usage: " AUX_REG_READ_COMMAND " [ ]\n" +#define AUX_REG_WRITE_COMMAND_USAGE "Usage: " AUX_REG_WRITE_COMMAND " = \n" +#define AUX_REG_SHOW_COMMAND_USAGE "Usage: " AUX_REG_SHOW_COMMAND " [ ] \n" +#define AUX_LIST_REGISTER_COMMAND_USAGE "Usage: " AUX_LIST_REGISTER_COMMAND " [ ]\n" +#define ARC_BCR_COMMAND_USAGE "Usage: info " ARC_BCR_COMMAND "\n" + + +#define ELEMENT_END_MARKER { NULL, NULL, NULL, GDB_XML_EF_NONE, NULL, NULL } +#define ATTRIBUTE_END_MARKER { NULL, GDB_XML_AF_NONE, NULL, NULL } + + +/* Special values for the name and description fields. */ +static const char *NO_DESCRIPTION = ""; +static const char *RESERVED = ""; +static const char *UNUSED = ""; + + +/* The elements and attributes of an XML target description. */ + +/* A handler_data for access values. */ + +static const struct gdb_xml_enum enums_access[] = +{ + { "RO", READ_ONLY }, + { "RW", READ_WRITE }, + { "WO", WRITE_ONLY }, + { NULL, 0 } +}; + + +static const struct gdb_xml_attribute aux_register_attributes[] = +{ + { "name", GDB_XML_AF_NONE, NULL, NULL }, + { "description", GDB_XML_AF_NONE, NULL, NULL }, + { "number", GDB_XML_AF_NONE, gdb_xml_parse_attr_ulongest, NULL }, + { "mask", GDB_XML_AF_NONE, gdb_xml_parse_attr_ulongest, NULL }, + { "access", GDB_XML_AF_OPTIONAL, gdb_xml_parse_attr_enum, enums_access }, + ATTRIBUTE_END_MARKER +}; + + +static const struct gdb_xml_attribute core_register_attributes[] = +{ + { "number", GDB_XML_AF_NONE, gdb_xml_parse_attr_ulongest, NULL }, + { "mask", GDB_XML_AF_NONE, gdb_xml_parse_attr_ulongest, NULL }, + { "access", GDB_XML_AF_OPTIONAL, gdb_xml_parse_attr_enum, enums_access }, + ATTRIBUTE_END_MARKER +}; + + +static const struct gdb_xml_attribute field_attributes[] = +{ + { "name", GDB_XML_AF_NONE, NULL, NULL }, + { "description", GDB_XML_AF_OPTIONAL, NULL, NULL }, + { "onwrite", GDB_XML_AF_OPTIONAL, gdb_xml_parse_attr_ulongest, NULL }, + { "offset", GDB_XML_AF_NONE, gdb_xml_parse_attr_ulongest, NULL }, + { "size", GDB_XML_AF_NONE, gdb_xml_parse_attr_ulongest, NULL }, + { "access", GDB_XML_AF_OPTIONAL, gdb_xml_parse_attr_enum, enums_access }, + ATTRIBUTE_END_MARKER +}; + + +static const struct gdb_xml_attribute bcrfield_attributes[] = +{ + { "name", GDB_XML_AF_NONE, NULL, NULL }, + { "description", GDB_XML_AF_OPTIONAL, NULL, NULL }, + { "offset", GDB_XML_AF_NONE, gdb_xml_parse_attr_ulongest, NULL }, + { "size", GDB_XML_AF_NONE, gdb_xml_parse_attr_ulongest, NULL }, + ATTRIBUTE_END_MARKER +}; + + +static const struct gdb_xml_attribute meaning_attributes[] = +{ + { "description", GDB_XML_AF_NONE, NULL, NULL }, + { "value", GDB_XML_AF_NONE, gdb_xml_parse_attr_ulongest, NULL }, + ATTRIBUTE_END_MARKER +}; + + +static const struct gdb_xml_attribute feature_attributes[] = +{ + { "name", GDB_XML_AF_NONE, NULL, NULL }, + ATTRIBUTE_END_MARKER +}; + + +static const struct gdb_xml_element field_children[] = +{ + { "meaning", meaning_attributes, NULL, GDB_XML_EF_OPTIONAL | GDB_XML_EF_REPEATABLE, start_meaning, NULL }, + ELEMENT_END_MARKER +}; + + +static const struct gdb_xml_element auxregister_children[] = +{ + { "field", field_attributes, field_children, GDB_XML_EF_OPTIONAL | GDB_XML_EF_REPEATABLE, start_field, NULL }, + ELEMENT_END_MARKER +}; + + +static const struct gdb_xml_element bcr_children[] = +{ + { "bcrfield", bcrfield_attributes, NULL, GDB_XML_EF_OPTIONAL | GDB_XML_EF_REPEATABLE, start_bcrfield, NULL }, + ELEMENT_END_MARKER +}; + + +static const struct gdb_xml_element feature_children[] = +{ + { "auxregister", aux_register_attributes, auxregister_children, GDB_XML_EF_OPTIONAL | GDB_XML_EF_REPEATABLE, start_auxregister, NULL }, + { "bcr", aux_register_attributes, bcr_children, GDB_XML_EF_OPTIONAL | GDB_XML_EF_REPEATABLE, start_bcr, NULL }, + { "ecr", core_register_attributes, NULL, GDB_XML_EF_OPTIONAL | GDB_XML_EF_REPEATABLE, start_ecr, NULL }, + ELEMENT_END_MARKER +}; + + +static const struct gdb_xml_attribute target_attributes[] = +{ + { "version", GDB_XML_AF_NONE, NULL, NULL }, + ATTRIBUTE_END_MARKER +}; + + +static const struct gdb_xml_element target_children[] = +{ + { "architecture", NULL, NULL, GDB_XML_EF_OPTIONAL, start_architecture, end_architecture }, + { "feature", feature_attributes, feature_children, + GDB_XML_EF_OPTIONAL | GDB_XML_EF_REPEATABLE, + start_feature, NULL }, + ELEMENT_END_MARKER +}; + + +static const struct gdb_xml_element elements[] = +{ + { "target", target_attributes, target_children, GDB_XML_EF_NONE, start_target, NULL }, + ELEMENT_END_MARKER +}; + + +/* -------------------------------------------------------------------------- */ +/* local macros */ +/* -------------------------------------------------------------------------- */ + +#define NAME_IS(ident) (strcmp(name, ident) == 0) + +#define INFO_OF(gdbarch) &gdbarch_tdep (gdbarch)->processor_variant_info->registers + +#define EXTRACT(argument, type, result) \ +{ \ + struct expression *expr = parse_expression(argument); \ + struct value *val = evaluate_expression(expr); \ + struct cleanup *chain = make_cleanup(free_current_contents, &expr); \ + \ + result = *(type*) (value_contents (val)); \ + do_cleanups (chain); \ +} + +#define FIND_REGISTER_DEFINITION_SUCH_THAT(condition) \ +{ \ + ARC_RegisterInfo *info = find_info(TRUE); \ + unsigned int i; \ + \ + for (i = 0; i < info->aux_register_count; i++) \ + { \ + ARC_AuxRegisterDefinition *def = &info->aux_registers[i]; \ + \ + if (condition) \ + return def; \ + } \ + \ + return NULL; \ +} + + +/* -------------------------------------------------------------------------- */ +/* local functions for XML file parsing */ +/* -------------------------------------------------------------------------- */ + +/* Return a string corresponding to the given access. */ + +static const char* +RegisterAccess_Image (RegisterAccess val) +{ + switch (val) + { + case READ_ONLY : return "read-only"; + case READ_WRITE: return "read/write"; + case WRITE_ONLY: return "write-only"; + default : return "???"; + } +} + + +static void +initialize_register (ARC_AuxRegisterDefinition *reg) +{ + reg->name = NULL; + reg->number = 0; + reg->gdb_regno = 0; + reg->is_BCR = FALSE; + reg->description = (char*) NO_DESCRIPTION; + reg->mask = 0xFFFFFFFF; + reg->access = READ_WRITE; + reg->field_count = 0; + reg->fields = NULL; + reg->longest_field_name = 0; + reg->max_bits_in_field = 0; +} + + +static void +initialize_field (ARC_FieldDefinition *field, RegisterAccess access) +{ + field->name = NULL; + field->description = (char*) NO_DESCRIPTION; + field->value_for_write = 0; + field->fixed = FALSE; + field->size = 1; + field->offset = 0; + field->access = access; + field->meanings = NULL; + field->meaning_count = 0; +} + + +static void +initialize_meaning (ARC_FieldMeaning *meaning) +{ + meaning->description = (char*) NO_DESCRIPTION; + meaning->value = 0; +} + + +/* Return TRUE if the given register fields overlap within the register. */ + +static Boolean +overlaps(ARC_FieldDefinition *field1, ARC_FieldDefinition *field2) +{ + unsigned int field1_start = field1->offset; + unsigned int field1_end = field1_start + field1->size - 1; + unsigned int field2_start = field2->offset; + unsigned int field2_end = field2_start + field2->size - 1; + + return !(field2_end < field1_start || field1_end < field2_start); +} + + +/* Release all the storage allocated to hold the given register information, + and re-initialize it. */ + +static void +free_register_set (ARC_RegisterInfo *info) +{ + if (info->aux_registers) + { + unsigned int i; + + for (i = 0; i < info->aux_register_count; i++) + { + ARC_AuxRegisterDefinition *r = &info->aux_registers[i]; + + if (r->name != UNUSED) + xfree (r->name); + if (r->description != NO_DESCRIPTION) + xfree (r->description); + + if (r->fields) + { + unsigned int j; + + for (j = 0; j < r->field_count; j++) + { + ARC_FieldDefinition *f = &r->fields[j]; + + if (f->name != RESERVED) + xfree (f->name); + + if (f->description != NO_DESCRIPTION) + xfree (f->description); + + if (f->meanings) + { + unsigned int k; + + for (k = 0; k < f->meaning_count; k++) + { + ARC_FieldMeaning *m = &f->meanings[k]; + + if (m->description != NO_DESCRIPTION) + xfree (m->description); + } + + xfree(f->meanings); + } + } + } + + xfree(r->fields); + } + + xfree(info->aux_registers); + + arc_initialize_aux_reg_info(info); + } +} + + +/* This function reads the contents of a file. + + Parameters: + filename : the name of the file to be accessed + baton : the path to the directory containing the file + + Result: + If the file contents were successfully read, a pointer to a buffer + containing those contents; otherwise NULL. */ + +static char* +read_file_contents (const char *filename, void *baton) +{ + char *name = (char*) filename; + const char *dirname = baton; + char *contents = NULL; + int fd; + + if ((dirname != NULL) && (*dirname != '\0')) + { + name = concat (dirname, "/", filename, NULL); + + if (name == NULL) + { + /* N.B. this does not return */ + nomem (0); + } + } + + if ((fd = open (name, O_RDONLY)) != -1) + { + struct stat stat; + int status; + + if ((status = fstat(fd, &stat)) != -1) + { + size_t size = (size_t) stat.st_size; + + /* Allocate buffer to hold the file contents; note that this space + is deliberately made larger than required, so that it is possible + to add extra characters to the end of the data. */ + if ((contents = xmalloc (size + 10))) + { + ssize_t bytes; + + if ((bytes = read (fd, contents, size)) == (ssize_t) size) + { + /* Append an explicit end-of-line to the data, in case there + was not one there already; also, explicitly NUL-terminate + the data so that it is a valid string. */ + contents[bytes] = '\n'; + contents[bytes + 1] = '\0'; + } + else + { + warning (_("can not read contents of file '%s': %s"), + name, strerror (errno)); + + /* Cannot trust the contents of the buffer. */ + xfree (contents); + contents = NULL; + } + + if ((status = close (fd)) != 0) + warning (_("can not close file '%s': %s"), name, + strerror (errno)); + } + else + warning (_("can not allocate buffer to hold contents of file '%s'"), name); + } + else + warning (_("can not get size of file '%s': %s"), name, + strerror (errno)); + } + else + warning (_("can not open file '%s': %s"), name, strerror (errno)); + + if (name != filename) + xfree (name); + + return contents; +} + + +/* This function is called by the XML parser when the start of a element is seen. */ + +static void +start_target (struct gdb_xml_parser *parser, + const struct gdb_xml_element *element, + void *user_data, + VEC(gdb_xml_value_s) *attributes) +{ +// ParsingData* data = user_data; + char *version = VEC_index (gdb_xml_value_s, attributes, 0)->value; + + if (strcmp (version, "1.0") != 0) + gdb_xml_error (parser, + _("Registers description has unsupported version \"%s\""), + version); + + DEBUG("target started\n"); +} + + +/* This function is called by the XML parser when the start of an element is seen. */ + +static void +start_architecture (struct gdb_xml_parser *parser, + const struct gdb_xml_element *element, + void *user_data, + VEC(gdb_xml_value_s) *attributes) +{ + DEBUG("architecture started\n"); +} + + +/* This function is called by the XML parser when the end of an element is seen. */ + +static void +end_architecture (struct gdb_xml_parser *parser, + const struct gdb_xml_element *element, + void *user_data, + const char *body_text) +{ + ParsingData *data = user_data; + + if (body_text[0] != '\0') + { + data->info->processor = arc_version(body_text); + + if (data->info->processor == UNSUPPORTED_ARCHITECTURE) + warning(_("unknown target architecture '%s' in XML file '%s'\n"), + body_text, data->filename); + } +} + + +/* This function is called by the XML parser when the start of a element is seen. */ + +static void +start_feature (struct gdb_xml_parser *parser, + const struct gdb_xml_element *element, + void *user_data, + VEC(gdb_xml_value_s) *attributes) +{ + DEBUG("feature started\n"); +} + + +/* This function checks the XML description of an auxiliary register for + correctness, and if it is correct, adds a definition of this register to the + register information that is currently being constructed. + + Parameters: + parser : the XML parser being used + element : a pointer to the parse structure + user_data : a pointer to the parsing data + attributes: a vector containing the attributes of the register from the XML + is_BCR : TRUE if the register is a Build Configuration Register + */ + +static void +add_aux_register (struct gdb_xml_parser *parser, + const struct gdb_xml_element *element, + void *user_data, + VEC(gdb_xml_value_s) *attributes, + Boolean is_BCR) +{ + ParsingData *data = user_data; + ARC_RegisterInfo *info = data->info; + ARC_AuxRegisterDefinition *reg = &data->reg; + struct gdb_xml_value *attrs = VEC_address (gdb_xml_value_s, attributes); + unsigned int length = VEC_length (gdb_xml_value_s, attributes); + unsigned int i; + Boolean add = TRUE; + + initialize_register(reg); + + /* Look at all the register attributes. */ + for (i = 0; i < length; i++) + { + const char *name = attrs[i].name; + void *value = attrs[i].value; + + if (NAME_IS("name")) reg->name = value; + else if (NAME_IS("description")) reg->description = xstrdup(value); + else if (NAME_IS("number")) reg->number = (ARC_RegisterNumber) *(ULONGEST*) value; + else if (NAME_IS("mask")) reg->mask = (ARC_Word) *(ULONGEST*) value; + else if (NAME_IS("access")) reg->access = (RegisterAccess) *(ULONGEST*) value; + } + + if (strcasecmp(reg->name, "unused") == 0) + reg->name = (char*) UNUSED; + else + reg->name = xstrdup (reg->name); + + if (is_BCR) + { + reg->is_BCR = is_BCR; + reg->access = READ_ONLY; + } + + /* Sanity checking. */ + for (i = 0; i < info->aux_register_count; i++) + { + if (reg->name != UNUSED) + if (strcasecmp(reg->name, info->aux_registers[i].name) == 0) + { + warning(_("auxiliary register with name '%s' already defined in file %s"), + reg->name, data->filename); + add = FALSE; + } + + if (reg->number == info->aux_registers[i].number) + { + warning(_("auxiliary register with number %u already defined in file %s"), + reg->number, data->filename); + add = FALSE; + } + } + + if (add) + { + unsigned int name_length = (unsigned int) strlen(reg->name); + + if (name_length > info->max_name_length) + info->max_name_length = name_length; + + info->aux_register_count++; + info->aux_registers = xrealloc(info->aux_registers, + info->aux_register_count * sizeof(ARC_AuxRegisterDefinition)); + + if (info->aux_registers == NULL) + { + /* N.B. this does not return. */ + nomem (0); + } + + /* Copy the register description into the array, and make it the current + register that will be referred to when parsing any fields. */ + data->currentRegister = &info->aux_registers[info->aux_register_count - 1]; + *data->currentRegister = *reg; + } + else + /* Do not copy it into the array, but still make it the current register. */ + data->currentRegister = reg; +} + + +/* This function is called by the XML parser when the start of a element is seen. */ + +static void +start_auxregister (struct gdb_xml_parser *parser, + const struct gdb_xml_element *element, + void *user_data, + VEC(gdb_xml_value_s) *attributes) +{ + add_aux_register(parser, element, user_data, attributes, FALSE); +} + + +/* This function is called by the XML parser when the start of a element is seen. */ + +static void +start_bcr (struct gdb_xml_parser *parser, + const struct gdb_xml_element *element, + void *user_data, + VEC(gdb_xml_value_s) *attributes) +{ + add_aux_register(parser, element, user_data, attributes, TRUE); +} + + +/* This function is called by the XML parser when the start of a element + is seen. It checks the XML description of an extension core register for + correctness, and if it is correct, adds a definition of this register to the + register information that is currently being constructed. + + Parameters: + parser : the XML parser being used + element : a pointer to the parse structure + user_data : a pointer to the parsing data + attributes: a vector containing the attributes of the register from the XML + */ + +static void +start_ecr (struct gdb_xml_parser *parser, + const struct gdb_xml_element *element, + void *user_data, + VEC(gdb_xml_value_s) *attributes) +{ + ParsingData *data = user_data; + ARC_RegisterInfo *info = data->info; + struct gdb_xml_value *attrs = VEC_address (gdb_xml_value_s, attributes); + unsigned int length = VEC_length (gdb_xml_value_s, attributes); + ARC_RegisterNumber number = 0; + ARC_Word mask = 0xFFFFFFFF; + RegisterAccess access = READ_WRITE; + unsigned int i; + + /* Look at all the register attributes. */ + for (i = 0; i < length; i++) + { + const char *name = attrs[i].name; + void *value = attrs[i].value; + + if (NAME_IS("number")) number = (ARC_RegisterNumber) *(ULONGEST*) value; + else if (NAME_IS("mask")) mask = (ARC_Word) *(ULONGEST*) value; + else if (NAME_IS("access")) access = (RegisterAccess) *(ULONGEST*) value; + } + + /* Sanity checking. */ + if (IS_EXTENSION_CORE_REGISTER(number)) + { + ARC_CoreRegisterDefinition *reg = &info->core_registers[number]; + + if (reg->exists) + { + warning(_("extension core register with number %d already defined in file %s"), + number, data->filename); + } + else + { + reg->mask = mask; + reg->access = access; + reg->exists = TRUE; + } + } + else + warning(_("extension core register with invalid number %d defined in file %s"), + number, data->filename); +} + + +/* This function checks the XML description of an auxiliary register field for + correctness, and if it is correct, adds a definition of this field to the + register information that is currently being constructed. + + Parameters: + parser : the XML parser being used + element : a pointer to the parse structure + user_data : a pointer to the parsing data + attributes: a vector containing the attributes of the field from the XML + is_BCR : TRUE if the field is part of a Build Configuration Register + */ + +static void +add_field (struct gdb_xml_parser *parser, + const struct gdb_xml_element *element, + void *user_data, + VEC(gdb_xml_value_s) *attributes, + Boolean is_BCR) +{ + ParsingData *data = user_data; + ARC_AuxRegisterDefinition *reg = data->currentRegister; + ARC_FieldDefinition *field = &data->field; + struct gdb_xml_value *attrs = VEC_address (gdb_xml_value_s, attributes); + unsigned int length = VEC_length (gdb_xml_value_s, attributes); + unsigned int i; + Boolean add = TRUE; + + /* By default, a field has the same access as the register that contains it + (though a particular field in a R/W register might be R/O or W/O). */ + initialize_field(field, reg->access); + + /* Look at all the field attributes. */ + for (i = 0; i < length; i++) + { + const char *name = attrs[i].name; + void *value = attrs[i].value; + + if (NAME_IS("name")) field->name = value; + else if (NAME_IS("description")) field->description = xstrdup(value); + else if (NAME_IS("offset")) field->offset = (unsigned int) *(ULONGEST*) value; + else if (NAME_IS("size")) field->size = (unsigned int) *(ULONGEST*) value; + else if (NAME_IS("access")) field->access = (RegisterAccess) *(ULONGEST*) value; + else if (NAME_IS("onwrite")) { field->value_for_write = (ARC_RegisterContents) *(ULONGEST*) value; + field->fixed = TRUE; } + } + + if (strcasecmp(field->name, "reserved") == 0) + field->name = (char*) RESERVED; + else + field->name = xstrdup (field->name); + + /* Sanity checking. */ + if (is_BCR) + { + /* BCRs are, by definition, read-only. */ + field->access = READ_ONLY; + } + else + { + if (field->access != WRITE_ONLY && reg->access == WRITE_ONLY) + { + warning (_("field '%s' is readable in write-only auxiliary register '%s' in file %s"), + field->name, reg->name, data->filename); + add = FALSE; + } + else if (field->access != READ_ONLY && reg->access == READ_ONLY) + { + warning (_("field '%s' is writable in read-only auxiliary register '%s' in file %s"), + field->name, reg->name, data->filename); + add = FALSE; + } + } + + if (field->size == 0) + { + warning(_("field '%s' contains no bits in auxiliary register '%s' in file %s"), + field->name, reg->name, data->filename); + add = FALSE; + } + + if (field->offset > BITS_IN_REGISTER - 1) + { + warning(_("field '%s' offset > %u in auxiliary register '%s' in file %s"), + field->name, BITS_IN_REGISTER - 1, reg->name, data->filename); + add = FALSE; + } + + if (field->offset + field->size > BITS_IN_REGISTER) + { + warning(_("field '%s' is too wide in auxiliary register '%s' in file %s"), + field->name, reg->name, data->filename); + add = FALSE; + } + + for (i = 0; i < reg->field_count; i++) + { + ARC_FieldDefinition *f = ®->fields[i]; + + if (field->name != RESERVED) + if (strcasecmp(field->name, f->name) == 0) + { + warning(_("field '%s' already defined in auxiliary register '%s' in file %s"), + field->name, reg->name, data->filename); + add = FALSE; + } + + if (overlaps(field, f)) + { + warning(_("field '%s' overlaps field '%s' in auxiliary register '%s' in file %s"), + field->name, f->name, reg->name, data->filename); + add = FALSE; + } + } + + data->maxFieldContents = 0; + + for (i = 0; i < field->size; i++) + data->maxFieldContents = (data->maxFieldContents << 1) + 1; + + if (field->value_for_write > data->maxFieldContents) + { + warning(_("value on write %u is too large for %u-bit reserved field in auxiliary register '%s' in file %s"), + field->value_for_write, field->size, reg->name, data->filename); + add = FALSE; + } + + if (add) + { + /* Keep track of the longest field name, and the most number of bits in a field. */ + unsigned int len = (unsigned int) strlen(field->name); + + if (len > reg->longest_field_name) + reg->longest_field_name = len; + + if (field->size > reg->max_bits_in_field) + reg->max_bits_in_field = field->size; + + reg->field_count++; + reg->fields = xrealloc(reg->fields, + reg->field_count * sizeof(ARC_FieldDefinition)); + + if (reg->fields == NULL) + { + /* N.B. this does not return. */ + nomem (0); + } + + /* Copy the field description into the array, and make it the current + field that will be referred to when parsing any meanings. */ + data->currentField = ®->fields[reg->field_count - 1]; + *data->currentField = *field; + } + else + /* Do not copy it into the array, but still make it the current field. */ + data->currentField = field; +} + + +/* This function is called by the XML parser when the start of a element is seen. */ + +static void +start_field (struct gdb_xml_parser *parser, + const struct gdb_xml_element *element, + void *user_data, + VEC(gdb_xml_value_s) *attributes) +{ + add_field(parser, element, user_data, attributes, FALSE); +} + + +/* This function is called by the XML parser when the start of a element is seen. */ + +static void +start_bcrfield (struct gdb_xml_parser *parser, + const struct gdb_xml_element *element, + void *user_data, + VEC(gdb_xml_value_s) *attributes) +{ + add_field(parser, element, user_data, attributes, TRUE); +} + + +/* This function is called by the XML parser when the start of a + element is seen. It checks the XML description of the meaning for + correctness, and if it is correct, adds a definition of this meaning to the + register information that is currently being constructed. + + Parameters: + parser : the XML parser being used + element : a pointer to the parse structure + user_data : a pointer to the parsing data + attributes: a vector containing the attributes of the meaning from the XML + */ + +static void +start_meaning (struct gdb_xml_parser *parser, + const struct gdb_xml_element *element, + void *user_data, + VEC(gdb_xml_value_s) *attributes) +{ + ParsingData *data = user_data; + ARC_AuxRegisterDefinition *reg = data->currentRegister; + ARC_FieldDefinition *field = data->currentField; + ARC_FieldMeaning meaning; + struct gdb_xml_value *attrs = VEC_address (gdb_xml_value_s, attributes); + unsigned int length = VEC_length (gdb_xml_value_s, attributes); + unsigned int i; + Boolean add = TRUE; + + initialize_meaning(&meaning); + + /* Look at all the meaning attributes. */ + for (i = 0; i < length; i++) + { + const char *name = attrs[i].name; + void *value = attrs[i].value; + + if (NAME_IS("description")) meaning.description = xstrdup(value); + else if (NAME_IS("value")) meaning.value = (ARC_RegisterContents) *(ULONGEST*) value; + } + + if (meaning.value > data->maxFieldContents) + { + warning(_("value %u is too large for field '%s' in auxiliary register '%s' in file %s"), + meaning.value, field->name, reg->name, data->filename); + add = FALSE; + } + + /* Sanity checking. */ + for (i = 0; i < field->meaning_count; i++) + { + ARC_FieldMeaning *m = &field->meanings[i]; + + if (strcmp(meaning.description, m->description) == 0) + { + warning(_("meaning '%s' already defined for field '%s' in auxiliary register '%s' in file %s"), + meaning.description, field->name, reg->name, data->filename); + add = FALSE; + } + + if (meaning.value == m->value) + { + warning(_("value %u already has meaning for field '%s' in auxiliary register '%s' in file %s"), + meaning.value, field->name, reg->name, data->filename); + add = FALSE; + } + } + + if (add) + { + field->meaning_count++; + field->meanings = xrealloc(field->meanings, + field->meaning_count * sizeof(ARC_FieldMeaning)); + + if (field->meanings == NULL) + { + /* N.B. this does not return. */ + nomem (0); + } + + field->meanings[field->meaning_count - 1] = meaning; + } +} + + +/* This function is passed to qsort to sort the auxiliary registers into a + canonical order such that BCRs come after the non-BCR aux registers, but + otherwise, the registers are ordered by increasing number, with the + exception that the IDENTITY register must come first. */ + +static int +compare_auxiliary_registers(const void *p1, const void *p2) +{ + ARC_AuxRegisterDefinition* reg1 = (ARC_AuxRegisterDefinition*) p1; + ARC_AuxRegisterDefinition* reg2 = (ARC_AuxRegisterDefinition*) p2; + + if (reg1->is_BCR && !reg2->is_BCR) + return 1; + + if (!reg1->is_BCR && reg2->is_BCR) + return -1; + + if (!reg1->is_BCR && !reg2->is_BCR) + { + if (strcmp(reg1->name, "IDENTITY") == 0) + return -1; + if (strcmp(reg2->name, "IDENTITY") == 0) + return 1; + } + + return (reg1->number < reg2->number) ? -1 : 1; +} + + +/* This function assigns the gdb register numbers to the target processor's + registers, using the scheme defined in arc-elf32-tdep.c. */ + +static void +assign_gdb_register_numbers (struct gdbarch *gdbarch, ARC_RegisterInfo *info) +{ + unsigned int i; + int pc = -1; + + /* Core registers first. */ + for (i = 0; i < ELEMENTS_IN_ARRAY(info->core_registers); i++) + { + ARC_CoreRegisterDefinition *reg = &info->core_registers[i]; + + /* If this core register exists in the target, we have one more core + register in total; and the gdb number of this register is that number + less 1. */ + if (reg->exists) + reg->gdb_regno = (int) info->core_register_count++; + } + + info->first_aux_gdb_regno = (int) info->core_register_count; + + /* Then the auxiliary registers. */ + for (i = 0; i < info->aux_register_count; i++) + { + ARC_AuxRegisterDefinition *reg = &info->aux_registers[i]; + + reg->gdb_regno = info->first_aux_gdb_regno + i; + + /* Is this the PC? */ + if (strcasecmp(reg->name, "PC") == 0) + { + pc = reg->gdb_regno; + info->PC_number = pc; + } + } + + /* We must tell gdb that the total number of registers has changed. */ + set_gdbarch_num_regs (gdbarch, (int) (info->core_register_count + + info->aux_register_count)); + + /* The file may have contained a description of the PC, so we must tell gdb + what its number is. + N.B. if the 'replace' parameter to read_XML_file was true and the file + did NOT contain a description of the PC, we now no longer know which + auxiliary register is the PC, so we must set gdb's PC number back to + -1! */ + set_gdbarch_pc_regnum(gdbarch, pc); + + if (pc >= 0) + { + DEBUG("PC is reg #%d (arch %p)\n", pc, gdbarch); + + /* So PC is defined - so remove the guard. */ + arc_aux_pc_guard(gdbarch, FALSE); + } +} + + +/* Parse the XML file containing the register definitions. + + Parameters: + document : the XML document to be parsed (i.e. the XML text) + fetcher : a function which can be used to read an XML document from a file + fetcher_baton : the directory containing the XML file(s) + data : a pointer to a structure used to pass state data + between the parsing routines. */ + +static void +parse_XML (const char *document, + xml_fetch_another fetcher, + void *fetcher_baton, + ParsingData *data) + +{ + struct cleanup *back_to; + struct gdb_xml_parser *parser; + char *expanded_text; + + /* Expand all XInclude directives. */ + expanded_text = xml_process_xincludes (_("aux registers description"), + document, fetcher, fetcher_baton, 0); + if (expanded_text == NULL) + { + warning (_("can not load XML auxiliary registers description")); + return; + } + + back_to = make_cleanup (null_cleanup, NULL); + parser = gdb_xml_create_parser_and_cleanup (_("aux registers description"), + elements, data); + + /* Do the parsing; the DTD file defines the schema to be used by the XML. */ + gdb_xml_use_dtd (parser, "arc-registers.dtd"); + + (void) make_cleanup (xfree, expanded_text); + + if (gdb_xml_parse (parser, expanded_text) != 0) + warning (_("can not load XML auxiliary registers description")); + + do_cleanups (back_to); +} + + +/* Read an XML file containing the register definitions. + + Parameters: + filename : the path to the file + gdbarch : the architecture for which the register set is are being defined + replace : TRUE if any existing set of register defintions should be deleted first + inform : TRUE if a message should be output say that the file has been read + check : TRUE if an architectural check is to be performed once the file has been read + + Result: TRUE if the file was successfully read and its contents parsed. */ + +static Boolean +read_XML_file (const char *filename, + struct gdbarch *gdbarch, + Boolean replace, + Boolean inform, + Boolean check) +{ + char *xml = read_file_contents(filename, NULL); + + DEBUG("reading XML file: %s\n", filename); + + if (xml) + { + ARC_RegisterInfo *info = INFO_OF(gdbarch); + struct cleanup *back_to = make_cleanup (xfree, xml); + char *dirname = ldirname (filename); + ParsingData data; + + memset (&data, 0, sizeof (ParsingData)); + + if (replace) + free_register_set(info); + + info->processor = NO_ARCHITECTURE; + + data.info = info; + data.filename = filename; + + if (dirname != NULL) + (void) make_cleanup (xfree, dirname); + + parse_XML (xml, read_file_contents, dirname, &data); + do_cleanups (back_to); + + if (inform) + printf_filtered(_("Register definitions read from file %s\n"), filename); + + if (check) + ARCHITECTURE_CHECK(gdbarch, + (current_objfile) ? current_objfile->obfd : NULL); + + /* Sort the auxiliary registers into a canonical order: this allows + entries in the XML file to be in any order without affecting the gdb + register numbers assigned to them; in particular, it aids in ensuring + that when the xISS is being used as a remote debug target gdb and the + xISS agree upon the order in which register contents are held in the + RSP 'G' (set all registers) packet and the 'g' (get all registers) + response packet. */ + qsort(info->aux_registers, + (size_t) info->aux_register_count, + sizeof (ARC_AuxRegisterDefinition), + compare_auxiliary_registers); + + /* Now that we know all of the core and auxiliary registers in this + target, we can assign gdb register numbers to them. */ + assign_gdb_register_numbers(gdbarch, info); + + /* We can send the event now only if current_gdbarch is not NULL, or + it could cause an error elsewhere where gdbarch_num_regs or + gdbarch_num_pseudo_regs is used (e.g. in setup_architecture_data in + gdbtk/generic/gdbtk-register.c). */ + if (current_gdbarch == NULL) + arc_pending_register_architecture_change_event = TRUE; + else + reg_architecture_changed_event(); + + return TRUE; + } + + return FALSE; +} + + +/* Try to find a file containing the default AUX register definitions; look in + 1) the current working directory + 2) the user's home directory + + Parameters: + gdbarch : the architecture for which the register set is are being defined + inform : TRUE if a message should be output say that the file has been read + check : TRUE if an architectural check is to be performed once the file has been read +*/ + +static void +read_default_file (struct gdbarch *gdbarch, Boolean inform, Boolean check) +{ + ENTERARGS("inform = %d, check = %d", inform, check); + +#define DESCR "auxiliary registers definition file " + + if (access(REGISTER_DEFINITION_FILE, F_OK) == 0) + { + if (!read_XML_file(REGISTER_DEFINITION_FILE, gdbarch, FALSE, inform, check)) + error(_("Can not read " DESCR REGISTER_DEFINITION_FILE)); + } + else + { + const char *home_dir = getenv ("HOME"); + + if (home_dir) + { + char *home_file = xstrprintf (_("%s/%s"), home_dir, REGISTER_DEFINITION_FILE); + + if (access(home_file, F_OK) == 0) + { + if (!read_XML_file(home_file, gdbarch, FALSE, inform, check)) + error(_("Can not read " DESCR " %s"), home_file); + } + else + warning(_("can not find " DESCR REGISTER_DEFINITION_FILE " in either current directory or $HOME")); + + xfree (home_file); + } + else + warning(_("HOME environment variable is not set - can not find " DESCR REGISTER_DEFINITION_FILE)); + } +} + + +/* -------------------------------------------------------------------------- */ +/* miscellaneous local functions */ +/* -------------------------------------------------------------------------- */ + +/* This is a callback which is called from gdb when it writes the PC. + It is used to "guard" the PC. */ + +static CORE_ADDR +get_pc (struct regcache *regcache) +{ + struct gdbarch *gdbarch = get_regcache_arch (regcache); + + /* This does not return if PC is not defined. */ + arc_aux_check_pc_defined(gdbarch); + + /* So PC is defined - so remove the guard. */ + arc_aux_pc_guard(gdbarch, FALSE); + + /* Now read and return the PC. */ + return read_pc(); +} + + +/* This is a callback which is called from gdb when it reads the PC. + It is used to "guard" the PC. */ + +static void +set_pc (struct regcache *regcache, CORE_ADDR val) +{ + struct gdbarch *gdbarch = get_regcache_arch (regcache); + + /* This does not return if PC is not defined. */ + arc_aux_check_pc_defined(gdbarch); + + /* So PC is defined - so remove the guard. */ + arc_aux_pc_guard(gdbarch, FALSE); + + write_pc(val); +} + + +/* Try to find the register information for the current architecture. + + Parameter: + must_be_defined : TRUE if the register information must be known + + Result: a pointer to the info; NULL if there is none as yet. */ + +static ARC_RegisterInfo* +find_info (Boolean must_be_defined) +{ + gdb_assert (current_gdbarch != NULL); + + { + ARC_RegisterInfo *info = INFO_OF(current_gdbarch); + + /* If we have no aux register info. */ + if (must_be_defined && info->aux_register_count == 0) + { + /* Try to get it. */ + read_default_file(current_gdbarch, FALSE, FALSE); + + /* No, could not get it. */ + if (info->aux_register_count == 0) + error(_("No auxiliary registers have yet been defined for this target")); + } + + return info; + } +} + + +/* Map a gdb register number to the ARC processor hardware number, and + determine the class of the register (as known to the built-in simulator). */ + +static void +simulator_mapping (int gdb_regno, + int *hw_regno, + ARC_RegisterClass *reg_class) +{ + /* Just in case gdb_regno is invalid. */ + *hw_regno = -1; + *reg_class = ARC_UNKNOWN_REGISTER; + + if (arc_is_core_register(gdb_regno)) + { + *hw_regno = (int) arc_core_register_number(gdb_regno); + *reg_class = ARC_CORE_REGISTER; + } + else if (gdb_regno == arc_aux_pc_number(current_gdbarch)) + { + /* The hw_regno is irrelevant here. */ + *reg_class = ARC_PROGRAM_COUNTER; + } + else + { + ARC_AuxRegisterDefinition *def = arc_find_aux_register_by_gdb_number(gdb_regno); + + if (def) + { + *hw_regno = (int) arc_aux_hw_register_number(def); + *reg_class = ARC_AUX_REGISTER; + } + } +} + + +/* -------------------------------------------------------------------------- */ +/* local functions for supporting commands */ +/* -------------------------------------------------------------------------- */ + +/* This function determines the h/w register number of an auxiliary register + from a command argument provided by a user. The argument might be a register + name, a number, or an expression to be evaluated. */ + +static ARC_RegisterNumber +extractRegisterNumber (char *arg) +{ + ARC_AuxRegisterDefinition *def = arc_find_aux_register_by_name(arg); + ARC_RegisterNumber num; + + /* Is it a register name? */ + if (def) + num = arc_aux_hw_register_number(def); + else + { + int regnum; + + /* Is it some expression? */ + EXTRACT(arg, int, regnum) + + if (regnum < 0) + error(_("Register number '%s < 0"), arg); + + num = (ARC_RegisterNumber) regnum; + } + + return num; +} + + +/* This function finds the definition of an auxiliary register from a command + argument provided by a user. The argument might be a register name, a number, + or an expression to be evaluated. + + NULL is returned if the argumenmt does not identify a defined auxiliary + register. */ + +static ARC_AuxRegisterDefinition* +find_aux_register (char *arg) +{ + ARC_AuxRegisterDefinition* def = arc_find_aux_register_by_name(arg); + + /* Is it not a register name? */ + if (def == NULL) + { + int regnum; + + /* Is it some expression? */ + EXTRACT(arg, int, regnum) + + if (regnum < 0) + error(_("Register number '%s < 0"), arg); + + def = arc_find_aux_register_by_hw_number((ARC_RegisterNumber) regnum); + } + + return def; +} + + +/* This function list the description (but not the contents) of an auxiliary + register. + + Parameters: + r : a pointer to the register definition + full: TRUE if full information is to be listed. +*/ + +static void +list_register (ARC_AuxRegisterDefinition *r, Boolean full) +{ + printf_filtered("%s", r->name); + if (r->is_BCR) + printf_filtered(_(" (BCR)")); + printf_filtered(_("\n")); + + if (r->description != NO_DESCRIPTION) + printf_filtered(_(" description: %s\n"), r->description); + printf_filtered(_(" number : 0x%x\n"), r->number); + + if (full) + { + /* The gdb number of the register is internal information which would + be meaningless to the user; the mask is probably not useful either. */ + printf_filtered(_(" gdb number : %d\n"), r->gdb_regno); + printf_filtered(_(" mask : %08X\n"), r->mask); + } + + if (!r->is_BCR) + printf_filtered(_(" access : %s\n"), RegisterAccess_Image(r->access)); + + if (r->fields) + { + unsigned int j; + + printf_filtered(_(" fields\n")); + + for (j = 0; j < r->field_count; j++) + { + ARC_FieldDefinition *f = &r->fields[j]; + + printf_filtered(_(" %s\n"), f->name); + if (f->description != NO_DESCRIPTION) + printf_filtered(_(" description: %s\n"), f->description); + printf_filtered(_(" position : %u:%u\n"), f->offset, f->size); + printf_filtered(_(" access : %s\n"), RegisterAccess_Image(f->access)); + + if (f->meanings) + { + unsigned int k; + + printf_filtered(_(" field meanings\n")); + + for (k = 0; k < f->meaning_count; k++) + { + ARC_FieldMeaning *m = &f->meanings[k]; + + printf_filtered(_(" %x ==> %s\n"), m->value, m->description); + } + } + } + } + + printf_filtered(_("\n")); +} + + +/* This function list the descriptions (but not the contents) of all auxiliary + registers. + + Parameter: + full: TRUE if full information is to be listed. +*/ + +static void +list_registers (Boolean full) +{ + ARC_RegisterInfo *info = find_info(TRUE); + unsigned int i; + + for (i = 0; i < info->aux_register_count; i++) + { + ARC_AuxRegisterDefinition *def = info->aux_registers + i; + + if (def->name != UNUSED) + list_register(def, full); + } +} + + +/* This function reads the contents of an auxiliary register on the target. + + Parameters: + def : the definition of the register + value : set to the contents of the register + warn_on_failure: TRUE if a warning should be issued if the read fails + + Result: TRUE if the register contents are read. */ + +static Boolean +read_aux_register (ARC_AuxRegisterDefinition *def, + ARC_RegisterContents *value, + Boolean warn_on_failure) +{ + int gdb_regno = arc_aux_gdb_register_number(def); + struct regcache *regcache = get_current_regcache(); + + /* Read the register contents from the target to the register cache, + then collect the register value from the cache. */ + target_fetch_registers(regcache, gdb_regno); + regcache_raw_collect (regcache, gdb_regno, value); + + /* Unfortunately, the target_fetch_registers operation does not give us an + indication of success or failure. */ + return TRUE; +} + + +/* This function writes the contents of an auxiliary register on the target. + + Parameters: + def : the definition of the register + value : the contents of the register + warn_on_failure: TRUE if a warning should be issued if the write fails + + Result: TRUE if the register contents are written. */ + +static Boolean +write_aux_register (ARC_AuxRegisterDefinition *def, + ARC_RegisterContents value, + Boolean warn_on_failure) +{ + int gdb_regno = arc_aux_gdb_register_number(def); + struct regcache *regcache = get_current_regcache(); + ARC_RegisterContents written = arc_write_value(def, value); + + /* Supply the register value to the register cache, then write it from the + cache to the target. */ + regcache_raw_supply (regcache, gdb_regno, &written); + target_store_registers(regcache, gdb_regno); + + /* If the value we actually wrote to the target is not the same as the value + we were given (because the register has fields that must have particular + values when written). */ + if (written != value) + { + DEBUG("%s auxiliary register value %08X written as %08X\n", + arc_aux_register_name(def), value, written); + + /* Put the value we were actually given into the register cache, so if + the user then displays the register contents he will see the + unmodified value. */ + regcache_raw_supply (regcache, gdb_regno, &value); + } + + /* Unfortunately, the target_store_registers operation does not give us an + indication of success or failure. */ + return TRUE; +} + + +/* This function is passed to the arc_all_aux_registers iterator. + It is called for each auxiliary register defined for the current architecture; + if the register is a Build Configuration Register, and it is not unused, the + register's contents are read from the target and printed. */ + +static void +print_bcr (ARC_AuxRegisterDefinition *def, void *data) +{ + if (arc_aux_is_BCR(def) && !arc_aux_is_unused(def)) + { + ARC_RegisterNumber bcr = arc_aux_hw_register_number(def); + ARC_RegisterContents bcr_value; + + if (read_aux_register (def, &bcr_value, TRUE)) + printf_filtered(_("[%02x] %-16s : 0x%02x\n"), + bcr, arc_aux_register_name(def), bcr_value); + } +} + + +/* This function may be passed to the arc_all_aux_registers iterator. + It reads the contents of the register whose definition is given from + the target and prints those contents. */ + +static void +show_one_aux_register (ARC_AuxRegisterDefinition *def, void *data) +{ + ARC_RegisterNumber reg_no = arc_aux_hw_register_number(def); + ARC_RegisterContents contents; + + DEBUG("try to read aux reg %u\n", reg_no); + + if (read_aux_register(def, &contents, TRUE)) + arc_print_aux_register(def, contents); +} + + +/* Read the register definitions from a file. + + Parameters: + filename : the path to the file + gdbarch : the architecture for which the register set is are being defined + replace : TRUE if any existing set of register defintions should be deleted first + inform : TRUE if a message should be output say that the file has been read + check : TRUE if an architectural check is to be performed once the file has been read +*/ +static Boolean +read_aux_regs_file (const char *filename, + struct gdbarch *gdbarch, + Boolean replace, + Boolean inform, + Boolean check) +{ + /* Try to read the register descriptions from the file. */ + if (read_XML_file(filename, gdbarch, replace, inform, check)) + return TRUE; + + printf_filtered(_("can not read file '%s'\n"), filename); + return FALSE; +} + + +/* -------------------------------------------------------------------------- */ +/* local functions implementing commands */ +/* -------------------------------------------------------------------------- */ + +/* Command: [ ] + + Read and display a range of auxiliary registers. + + We should eventually change this to use the ui_out stuff rather than + printf_filtered. */ + +static void +arc_aux_reg_read_command (char *arg, int from_tty) +{ + char *arg2; + ARC_RegisterNumber first_regnum, last_regnum, r; + char format[40]; + + if (!arg) + { + printf_filtered (_(AUX_REG_READ_COMMAND_USAGE)); + return; + } + + /* Strip leading spaces. */ + while (*arg == ' ') + arg++; + + /* This assumes that the first arg cannot have spaces (the disas command + also seems to work this way). */ + arg2 = strchr (arg, ' '); + + /* Are there two arguments? */ + if (arg2) + { + /* Split the input string up. */ + arg2[0] = (char) 0; + arg2++; + } + + /* First arg. */ + first_regnum = extractRegisterNumber(arg); + + /* So, how many regs do we want? */ + if (arg2) + { + last_regnum = extractRegisterNumber(arg2); + + if (last_regnum < first_regnum) + { + warning(_(AUX_REG_READ_COMMAND ": %s < %s, showing one register"), arg2, arg); + last_regnum = first_regnum; + } + } + else + last_regnum = first_regnum; + + DEBUG("try to read aux regs %d .. %d\n", first_regnum, last_regnum); + + (void) snprintf(format, sizeof(format), + _("0x%%08x %%-%us: %%08X\n"), + arc_aux_register_max_name_length() + 1); + + for (r = first_regnum; r <= last_regnum; r++) + { + ARC_AuxRegisterDefinition *def = arc_find_aux_register_by_hw_number(r); + + /* If the aux register exists, and is used. */ + if ((def != NULL) && !arc_aux_is_unused(def)) + { + ARC_RegisterContents contents; + + DEBUG("try to read aux reg %u\n", r); + + if (read_aux_register(def, &contents, TRUE)) + printf_filtered (format, r, arc_aux_register_name(def), contents); + } + } +} + + +/* Command: = + + Write VALUE to auxiliary register REG. + + We should eventually change this to use the ui_out stuff rather than + printf_filtered. */ +static void +arc_aux_reg_write_command (char *arg, int from_tty) +{ + char *value_arg; + char *p; + ARC_RegisterNumber regnum; + ARC_RegisterContents value; + ARC_AuxRegisterDefinition *def; + + if (!arg) + { + printf_filtered (_(AUX_REG_WRITE_COMMAND_USAGE)); + return; + } + + p = strchr(arg, '='); + + if (p == NULL) + { + printf_filtered (_(AUX_REG_WRITE_COMMAND ": no second argument\n" AUX_REG_WRITE_COMMAND_USAGE)); + return; + } + + /* Split up the input string. */ + value_arg = p + 1; + p--; + while (*p == ' ') p--; + p[1] = '\0'; + + /* Register expression. */ + regnum = extractRegisterNumber(arg); + + /* Value expression. */ + EXTRACT(value_arg, ARC_RegisterContents, value) + + def = arc_find_aux_register_by_hw_number(regnum); + + if (def == NULL) + warning(_("no such auxiliary register: %s"), arg); + else + { + DEBUG("try to write aux reg %d = 0x%08X\n", regnum, value); + + /* Write it. */ + (void) write_aux_register(def, value, TRUE); + } +} + + +/* Command: [ ] + + Display the values of one or all of the auxiliary registers. + + We should eventually change this to use the ui_out stuff rather than + printf_filtered. */ + +static void +arc_aux_reg_show_command (char *arg, int from_tty) +{ + if (arg) + { + ARC_AuxRegisterDefinition *def = find_aux_register(arg); + + if (def) + show_one_aux_register(def, NULL); + else + printf_filtered(_("There is no auxiliary register named '%s'\n"), arg); + } + else + /* list them all */ + arc_all_aux_registers(show_one_aux_register, NULL); +} + + +/* Command: [ ] + + Read a definition of a set of auxiliary registers from an XML file. + + We should eventually change this to use the ui_out stuff rather than + printf_filtered. */ + +static void +arc_aux_reg_file_read_command (char *arg, int from_tty) +{ + if (!arg) + { + printf_filtered (REG_READ_FILE_COMMAND_USAGE); + return; + } + + /* The new set replaces the existing set (if any). */ + (void) read_aux_regs_file(arg, current_gdbarch, TRUE, TRUE, TRUE); +} + + +/* Command: + + Read a definition of a set of auxiliary registers from an XML file. + + We should eventually change this to use the ui_out stuff rather than + printf_filtered. */ + +static void +arc_aux_reg_file_read_extra_command (char *arg, int from_tty) +{ + if (!arg) + { + printf_filtered (REG_READ_EXTRA_FILE_COMMAND_USAGE); + return; + } + + /* The new set is added to the existing set (if any). */ + (void) read_aux_regs_file(arg, current_gdbarch, FALSE, TRUE, TRUE); +} + + +/* Command: [ ] + + Display a description of one or all auxiliary registers. + + We should eventually change this to use the ui_out stuff rather than + printf_filtered. */ + +static void +arc_aux_reg_list_command (char *arg, int from_tty) +{ + if (arg) + { + ARC_AuxRegisterDefinition *def = find_aux_register(arg); + + if (def) + list_register(def, FALSE); + else + printf_filtered(_("There is no auxiliary register named '%s'\n"), arg); + } + else + /* List them all. */ + list_registers(FALSE); +} + + +/* Command: + + Display the Build Configuration Registers. + + We should eventually change this to use the ui_out stuff rather than + printf_filtered. */ + +static void +arc_print_bcr_regs (char *arg, int from_tty) +{ + arc_all_aux_registers(print_bcr, NULL); +} + + +/* -------------------------------------------------------------------------- */ +/* externally visible functions */ +/* -------------------------------------------------------------------------- */ + +/* Initialize the given register information to the base configuration: + 1) core registers exist + 2) extension core registers do not exist + 3) no aux registers + */ + +void +arc_initialize_aux_reg_info (ARC_RegisterInfo *info) +{ + unsigned int i; + + info->processor = NO_ARCHITECTURE; + info->aux_registers = NULL; + info->aux_register_count = 0; + info->max_name_length = 0; + info->PC_number = -1; + info->first_aux_gdb_regno = 0; + info->core_register_count = 0; + + /* All possible core registers. */ + for (i = 0; i < ELEMENTS_IN_ARRAY(info->core_registers); i++) + { + ARC_CoreRegisterDefinition *reg = &info->core_registers[i]; + + reg->exists = TRUE; + reg->mask = 0xFFFFFFFF; + reg->access = READ_WRITE; + } + + /* We do not yet know if we have any extension registers. */ + for (i = ARC_FIRST_EXTENSION_CORE_REGISTER; i <= ARC_LAST_EXTENSION_CORE_REGISTER; i++) + info->core_registers[i].exists = FALSE; + + /* R61 is reserved, R62 is not a real register. */ + info->core_registers[61].exists = FALSE; + info->core_registers[62].exists = FALSE; + + /* PCL is read-only */ + info->core_registers[63].access = READ_ONLY; +} + + +/* Read the XML registers definition for the given architecture from the default file. */ + +void +arc_read_default_aux_registers (struct gdbarch *gdbarch) +{ + ENTERMSG; + read_default_file(gdbarch, FALSE, FALSE); +} + + + +/* This function sets up or remaoves a "guard" on the PC */ + +void +arc_aux_pc_guard (struct gdbarch *gdbarch, Boolean on) +{ + set_gdbarch_read_pc (gdbarch, (on) ? get_pc : NULL); + set_gdbarch_write_pc(gdbarch, (on) ? set_pc : NULL); +} + + +/* Check whether the PC aux register is defined for the given architecture. */ + +void +arc_aux_check_pc_defined (struct gdbarch *gdbarch) +{ + ENTERARGS("target %s", current_target.to_shortname); + + if (gdbarch == NULL) + gdbarch = current_gdbarch; + + if (arc_aux_pc_number(gdbarch) < 0) + error(_("There is no auxiliary register description for the PC (Program Counter)")); +} + + +/* Return the gdb register number of the PC (Program Counter); -1 if the PC is not defined. */ + +int +arc_aux_pc_number (struct gdbarch *gdbarch) +{ + ARC_RegisterInfo *info = INFO_OF(gdbarch); + + return (info) ? info->PC_number : -1; +} + + +/* Find the register definition of the given aux register (identified by name). */ + +ARC_AuxRegisterDefinition* +arc_find_aux_register_by_name (const char *name) +{ + FIND_REGISTER_DEFINITION_SUCH_THAT(strcasecmp(name, def->name) == 0) +} + + +/* Find the register definition of the given aux register (identified by hardware register number). */ + +ARC_AuxRegisterDefinition* +arc_find_aux_register_by_hw_number (ARC_RegisterNumber hw_regno) +{ + FIND_REGISTER_DEFINITION_SUCH_THAT(hw_regno == def->number) +} + + +/* Find the register definition of the given aux register (identified by gdb register number). */ + +ARC_AuxRegisterDefinition* +arc_find_aux_register_by_gdb_number (int gdb_regno) +{ + /* N.B. the elements in the info->aux_registers array have strictly increasing + gdb numbers starting at info->first_aux_gdb_regno, so we can index the array + instead of searching it. */ + ARC_RegisterInfo *info = find_info(TRUE); + int index = gdb_regno - info->first_aux_gdb_regno; + + if (0 <= index && index < (int) info->aux_register_count) + { + ARC_AuxRegisterDefinition *def = info->aux_registers + index; + + /* Just to be sure we have found the right element. */ + gdb_assert(def->gdb_regno == gdb_regno); + + return def; + } + + return NULL; +} + + +/* Return the hardware register number of the given named auxiliary register; + if no register set is currently defined, or there is no register of that + name in the set, return the given default number. */ + +ARC_RegisterNumber +arc_aux_find_register_number (const char *name, + ARC_RegisterNumber defaultNumber) +{ + if (arc_aux_regs_defined(current_gdbarch)) + { + ARC_AuxRegisterDefinition *def = arc_find_aux_register_by_name(name); + + if (def != NULL) + return arc_aux_hw_register_number(def); + } + + warning(_("there is no auxiliary register description for the %s register - " + "using 0x%x for the register number"), name, defaultNumber); + return defaultNumber; +} + + +/* Return the hardware register number of the given core register. */ + +ARC_RegisterNumber +arc_core_register_number (int gdb_regno) +{ + ARC_RegisterInfo *info = find_info(TRUE); + unsigned int i; + + /* The lower-numbered set of non-extension core registers (i.e. excluding + R60 .. R63) have fixed gdb numbers which are the same as the h/w number. */ + if (gdb_regno < ARC_FIRST_EXTENSION_CORE_REGISTER) + return (ARC_RegisterNumber) gdb_regno; + + /* Scan the rest of the array. */ + for (i = ARC_FIRST_EXTENSION_CORE_REGISTER; i < ELEMENTS_IN_ARRAY(info->core_registers); i++) + { + ARC_CoreRegisterDefinition *def = &info->core_registers[i]; + + if (def->exists) + if (gdb_regno == def->gdb_regno) + return (ARC_RegisterNumber) (i); + } + + /* Too large to be the number of a core register. */ + return ARC_MAX_CORE_REGS + 1000; +} + + +/* Return the gdb register number of the given core register. */ + +int +arc_core_register_gdb_number (ARC_RegisterNumber hw_regno) +{ + ARC_RegisterInfo *info = find_info(TRUE); + ARC_CoreRegisterDefinition *def = &info->core_registers[hw_regno]; + + gdb_assert(def->exists); + + return def->gdb_regno; +} + + +/* Print the aux register whose definition and contents are given. + The field and meaning information in the definition is used to + give a detailed display of the register. */ + +void +arc_print_aux_register (ARC_AuxRegisterDefinition *def, + ARC_RegisterContents contents) + +{ + printf_filtered (_("%s : %08x\n"), def->name, contents); + + if (def->fields) + { + unsigned int i; + char format[128]; + + printf_filtered(_(" fields\n")); + + /* Create a format string such as + + " %-10s: %8s" + + so that the field name is left-justified, and the field value is + right-justified. */ + (void) snprintf(format, sizeof(format), + _(" %%-%us: %%%us"), + def->longest_field_name, def->max_bits_in_field); + + for (i = 0; i < def->field_count; i++) + { + ARC_FieldDefinition *f = &def->fields[i]; + ARC_RegisterContents val = contents >> f->offset; + ARC_RegisterContents val2 = val; + ARC_RegisterContents mask = 0; + char bits[BITS_IN_REGISTER]; + char *p = &bits[BITS_IN_REGISTER - 1]; + unsigned int b; + + *p = '\0'; + + /* Build up a string representing the bits of the field, starting + with the least significant bit, which will be the rightmost digit + displayed; at the same time, construct a mask of 1-bits of the + same size as the field. */ + for (b = 0; b < f->size; b++) + { + p--; + *p = (val & 1) ? '1' : '0'; + val >>= 1; + + mask <<= 1; + mask++; + } + + printf_filtered(format, f->name, p); + + if (f->meanings) + { + unsigned int j; + + val2 &= mask; + + /* Look for a meaning for this particular value of the field. */ + for (j = 0; j < f->meaning_count; j++) + { + ARC_FieldMeaning *m = &f->meanings[j]; + + if (val2 == m->value) + { + printf_filtered(_(" (%s)"), m->description); + break; + } + } + } + + printf_filtered(_("\n")); + } + } + + printf_filtered(_("\n")); +} + + +/* Return the gdb register number of the given aux register. */ + +int +arc_aux_gdb_register_number (ARC_AuxRegisterDefinition *def) +{ + return def->gdb_regno; +} + + +/* Return the hardware register number of the given aux register. */ + +ARC_RegisterNumber +arc_aux_hw_register_number (ARC_AuxRegisterDefinition *def) +{ + return def->number; +} + + +/* Return the access mode (R/W, RO 0r WO) of the given aux register. */ + +RegisterAccess +arc_aux_register_access (ARC_AuxRegisterDefinition *def) +{ + return def->access; +} + + +/* Return TRUE if the given aux register is not used in the processor architecture, + i.e. there is a "place-holder" definition of that register (possibly a BCR) in + the XML file, but that register does not actually exist on the target. */ + +Boolean +arc_aux_is_unused (ARC_AuxRegisterDefinition *def) +{ + return (def->name == UNUSED); +} + + +/* Return TRUE if the given aux register is a BCR (Build Configuration Register). */ + +Boolean +arc_aux_is_BCR (ARC_AuxRegisterDefinition *def) +{ + return def->is_BCR; +} + + +/* Return the name of the given aux register. */ + +const char* +arc_aux_register_name (ARC_AuxRegisterDefinition *def) +{ + return def->name; +} + + +/* Return the access mode (R/W, RO 0r WO) of the given core register. */ + +RegisterAccess +arc_core_register_access (ARC_RegisterNumber hw_regno) +{ + ARC_RegisterInfo *info = find_info(TRUE); + ARC_CoreRegisterDefinition *def = &info->core_registers[hw_regno]; + + gdb_assert(def->exists); + + return def->access; +} + + +/* Return the name of the given auxiliary register. */ + +const char* +arc_aux_register_name_of (ARC_RegisterNumber hw_regno) +{ + ARC_AuxRegisterDefinition *def = arc_find_aux_register_by_hw_number(hw_regno); + + return (def) ? def->name : ""; +} + + +/* Return TRUE if the given register is a core register. */ + +Boolean +arc_is_core_register (int gdb_regno) +{ + ARC_RegisterInfo *info = find_info(TRUE); + + return (gdb_regno < info->first_aux_gdb_regno); +} + + +/* Iterate across all the aux registers; for each one, call the supplied + function, passing it the defintion of the register and the supplied data. */ + +void +arc_all_aux_registers (ARC_AuxRegisterFunction function, void *data) +{ + ARC_RegisterInfo *info = find_info(TRUE); + unsigned int i; + + for (i = 0; i < info->aux_register_count; i++) + function(info->aux_registers + i, data); +} + + +/* Return the length of the longest aux register name in the current architecture. */ +unsigned int +arc_aux_register_max_name_length (void) +{ + ARC_RegisterInfo *info = find_info(TRUE); + + return info->max_name_length; +} + + +/* Return the number of aux registers defined for the given architecture; + 0 if no register set has yet been defined. */ + +unsigned int +arc_aux_register_count (struct gdbarch *gdbarch) +{ + ARC_RegisterInfo *info = INFO_OF(gdbarch); + + return (info) ? info->aux_register_count : 0; +} + + +/* Return the number of core registers defined for the given architecture; + ARC_NUM_STANDARD_CORE_REGS if no register set has yet been defined. */ + +unsigned int +arc_core_register_count (struct gdbarch *gdbarch) +{ + ARC_RegisterInfo *info = INFO_OF(gdbarch); + + return (info) ? info->core_register_count : ARC_NUM_STANDARD_CORE_REGS; +} + + +/* Return TRUE if the register set has been defined for the given architecture. */ + +Boolean +arc_aux_regs_defined (struct gdbarch *gdbarch) +{ + ARC_RegisterInfo *info = INFO_OF(gdbarch); + + return (info->aux_register_count > 0 && info->aux_registers != NULL); +} + + +/* Return the architectural version of the register set associated with the + given architecture. */ + +ARC_ProcessorVersion +arc_aux_architecture (struct gdbarch *gdbarch) +{ + ARC_RegisterInfo *info = INFO_OF(gdbarch); + + return info->processor; +} + + +/* Compute the value to be written to an auxiliary register so that any fields it + has contain the values that they are required to have by the ARC architectural + specification. + + Parameters: + def : the definition of the aux register + value : the value to be adjusted + + Result: the adjusted register contents. */ + +ARC_RegisterContents +arc_write_value (ARC_AuxRegisterDefinition *def, + ARC_RegisterContents value) +{ + unsigned int i; + + for (i = 0; i < def->field_count; i++) + { + ARC_FieldDefinition *field = &def->fields[i]; + + if (field->fixed) + { + value &= ~(((1 << field->size) - 1) << field->offset); + value |= (field->value_for_write << field->offset); + } + } + + return value; +} + + +/* Adjust the value to be written to a register so that any fields it has contain + the values that they are required to have by the ARC architectural specification. + + Parameters: + gdb_regno : the number of the aux register + buffer : the value to be adjusted + */ + +void +arc_convert_aux_contents_for_write (int gdb_regno, void *buffer) +{ + ARC_AuxRegisterDefinition *def = arc_find_aux_register_by_gdb_number(gdb_regno); + + /* Is it an auxiliary register? If not, do nothing. */ + if (def) + { + ARC_RegisterContents old; + ARC_RegisterContents new; + + memcpy(&old, buffer, BYTES_IN_REGISTER); + new = arc_write_value(def, old); + + if (new != old) + { + DEBUG("*** converted register %s value from %08X to %08X\n", + arc_aux_register_name(def), old, new); + memcpy(buffer, &new, BYTES_IN_REGISTER); + } + } +} + + +/* Initialize the module. This function is called from the gdb core on start-up. */ + +void +_initialize_arc_aux_regs (void) +{ + arc_pending_register_architecture_change_event = FALSE; + + /* If this module is being built with a test driver. */ +#ifdef STANDALONE_TEST + /* N.B. it would be better to set this up in the test driver, but that + causes problems when linking! */ + struct gdbarch_info info; + static ARC_VariantsInfo variant; + struct gdbarch_tdep *tdep = malloc (sizeof (struct gdbarch_tdep)); + struct gdbarch *gdbarch = gdbarch_alloc (&info, tdep); + + tdep->processor_variant_info = &variant; + current_gdbarch = gdbarch; +#endif + + (void) add_cmd (REG_READ_FILE_COMMAND, + class_files, + arc_aux_reg_file_read_command, + _("Read a file describing a set of auxiliary registers.\n" + REG_READ_FILE_COMMAND_USAGE + " is an XML file containing the auxiliary register definitions.\n"), + &cmdlist); + + (void) add_cmd (REG_READ_EXTRA_FILE_COMMAND, + class_files, + arc_aux_reg_file_read_extra_command, + _("Read a file describing an additional set of auxiliary registers.\n" + REG_READ_EXTRA_FILE_COMMAND_USAGE + " is an XML file containing the auxiliary register definitions.\n"), + &cmdlist); + + (void) add_cmd (AUX_LIST_REGISTER_COMMAND, + class_vars, + arc_aux_reg_list_command, + _("Show a description of one or all auxiliary registers.\n" + AUX_LIST_REGISTER_COMMAND_USAGE + " is the name of an auxiliary register.\n"), + &cmdlist); + + (void) add_cmd(ARC_BCR_COMMAND, + class_info, + arc_print_bcr_regs, + _("Show Build Configuration Registers in the ARC processor variant.\n" + ARC_BCR_COMMAND_USAGE), + &infolist); + + (void) add_cmd (AUX_REG_READ_COMMAND, + class_vars, + arc_aux_reg_read_command, + _("Read and show a range of auxiliary registers.\n" + AUX_REG_READ_COMMAND_USAGE + "REG-FROM and REG-TO are the names or numbers of the registers.\n" + "If REG-TO is not specified, one register is displayed.\n"), + &cmdlist); + + (void) add_cmd (AUX_REG_WRITE_COMMAND, + class_vars, + arc_aux_reg_write_command, + _("Write to an auxiliary register.\n" + AUX_REG_WRITE_COMMAND_USAGE + "REG is the name or number of the register.\n" + "VALUE can be any expression that evaluates to an integer.\n"), + &cmdlist); + + (void) add_cmd (AUX_REG_SHOW_COMMAND, + class_vars, + arc_aux_reg_show_command, + _("Read and show one or all auxiliary registers.\n" + AUX_REG_SHOW_COMMAND_USAGE + " is the name of an auxiliary register.\n"), + &cmdlist); + + /* Provide the built-in simulator with a functions that it can use to map + from gdb register numbers to h/w register numbers, and set the fields + of aux registers to any values that they may be required to have on write. */ + arc_set_register_mapping(&simulator_mapping); + arc_set_aux_register_conversion(arc_convert_aux_contents_for_write); +} + +/******************************************************************************/ diff --git a/gdb/arc-registers.h b/gdb/arc-registers.h new file mode 100644 index 0000000..9fb6521 --- /dev/null +++ b/gdb/arc-registers.h @@ -0,0 +1,226 @@ +/* Target dependent code for ARC processor family, for GDB, the GNU debugger. + + Copyright 2008, 2009 Free Software Foundation, Inc. + + Contributed by ARC International (www.arc.com) + + Authors: + Richard Stuckey + + This file is part of GDB. + + 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 3 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, see . */ + +/******************************************************************************/ +/* */ +/* Outline: */ +/* This header file defines operations for manipulating the ARC processor */ +/* core registers and auxiliary registers. */ +/* */ +/******************************************************************************/ + +#ifndef ARC_REGISTERS_H +#define ARC_REGISTERS_H + +/* gdb header files */ +#include "defs.h" +#include "gdbarch.h" + +/* ARC header files */ +#include "arc-support.h" +#include "arc-tdep.h" +#include "arc-architecture.h" + + +#define REGISTER_DEFINITION_FILE "arc-registers.xml" + + +/* ARC aux registers with known (well-defined) numbers. */ +#define ARC_HW_LP_START_REGNUM (ARC_RegisterNumber) 0x2 +#define ARC_HW_LP_END_REGNUM (ARC_RegisterNumber) 0x3 +#define ARC_HW_IDENTITY_REGNUM (ARC_RegisterNumber) 0x4 +#define ARC_HW_DEBUG_REGNUM (ARC_RegisterNumber) 0x5 +#define ARC_HW_PC_REGNUM (ARC_RegisterNumber) 0x6 +#define ARC_HW_STATUS32_REGNUM (ARC_RegisterNumber) 0xA + +/* Specific ARCangel aux registers for caches. */ +#define ARC_HW_IC_IVIC_REGNUM (ARC_RegisterNumber) 0x10 /* Invalidate ICache. */ +#define ARC_HW_IC_CTRL_REGNUM (ARC_RegisterNumber) 0x11 /* Disable ICache. */ +#define ARC_HW_DC_IVDC_REGNUM (ARC_RegisterNumber) 0x47 /* Invalidate DCache. */ +#define ARC_HW_DC_CTRL_REGNUM (ARC_RegisterNumber) 0x48 /* Disable DCache. */ + +/* BCRs. */ +#define ARC_HW_MEMSUBSYS_REGNUM (ARC_RegisterNumber) 0x67 +#define ARC_HW_AP_BUILD_REGNUM (ARC_RegisterNumber) 0x76 + +/* Auxiliary registers for actionpoint 0 (there are up to 8 sets of these). */ +#define ARC_HW_AMV0_REGNUM (ARC_RegisterNumber) 0x220 +#define ARC_HW_AMM0_REGNUM (ARC_RegisterNumber) 0x221 +#define ARC_HW_AC0_REGNUM (ARC_RegisterNumber) 0x222 + + +/* Bit masks for use with the cache-related auxiliary registers. */ +#define IC_IVIC_IV 0x00000001 +#define DC_IVDC_IV 0x00000001 +#define IC_CTRL_DC 0x00000001 +#define DC_CTRL_DC 0x00000001 +#define DC_CTRL_IM 0x00000040 + + +/* Bit masks for use with the auxiliary DEBUG, IDENTITY, STATUS32 and AP_BUILD registers. */ +#define DEBUG_SH 0x40000000 +#define DEBUG_BH 0x20000000 +#define DEBUG_USER 0x10000000 +#define DEBUG_ACTIONPOINT_HALT 0x00000004 +#define DEBUG_ACTIONPOINT_STATUS 0x000007F8 +#define DEBUG_ACTIONPOINT_STATUS_SHIFT 3 +#define DEBUG_FORCE_HALT 0x00000002 +#define DEBUG_INSTRUCTION_STEP 0x00000800 +#define DEBUG_SINGLE_STEP 0x00000001 +#define DEBUG_LOAD_PENDING 0x80000000 +#define IDENTITY_ARCVER 0x000000FF +#define STATUS32_USER 0x00000080 +#define STATUS32_L 0x00000100 +#define STATUS32_HALT 0x00000001 +#define AP_BUILD_VERSION 0x000000FF +#define AP_BUILD_TYPE 0x00000F00 +#define AP_BUILD_TYPE_SHIFT 8 + + +typedef enum register_access +{ + READ_ONLY, + READ_WRITE, + WRITE_ONLY +} RegisterAccess; + + +struct core_register_definition +{ + int gdb_regno; + ARC_Word mask; + RegisterAccess access; + Boolean exists; +}; + + +/* The type 'struct aux_register_definition' is incomplete: it is private to this + module. */ +typedef struct aux_register_definition ARC_AuxRegisterDefinition; +typedef struct core_register_definition ARC_CoreRegisterDefinition; + + +/* This type is essentially private: no access to any of its fields should + be performed outside of this module. */ +typedef struct _register_info +{ + ARC_ProcessorVersion processor; + ARC_AuxRegisterDefinition *aux_registers; + unsigned int aux_register_count; + int first_aux_gdb_regno; + unsigned int max_name_length; + int PC_number; + ARC_CoreRegisterDefinition core_registers[ARC_MAX_CORE_REGS]; + unsigned int core_register_count; +} ARC_RegisterInfo; + + +typedef void (*ARC_AuxRegisterFunction)(ARC_AuxRegisterDefinition *def, void *data); + + +extern Boolean arc_pending_register_architecture_change_event; + + +/* Initialization functions. */ + +void arc_initialize_aux_reg_info (ARC_RegisterInfo *info); + +void arc_read_default_aux_registers (struct gdbarch *gdbarch); + + +/* PC-related functions. */ + +void arc_aux_pc_guard (struct gdbarch *gdbarch, Boolean on); + +void arc_aux_check_pc_defined (struct gdbarch *gdbarch); + +int arc_aux_pc_number (struct gdbarch *gdbarch); + + +/* Output functions. */ + +void arc_print_aux_register (ARC_AuxRegisterDefinition *def, + ARC_RegisterContents contents); + + +/* Search functions. */ + +ARC_AuxRegisterDefinition* arc_find_aux_register_by_name (const char *name); + +ARC_AuxRegisterDefinition* arc_find_aux_register_by_gdb_number (int gdb_regno); + +ARC_AuxRegisterDefinition* arc_find_aux_register_by_hw_number (ARC_RegisterNumber hw_regno); + +ARC_RegisterNumber arc_aux_find_register_number (const char *name, + ARC_RegisterNumber defaultNumber); + +ARC_RegisterNumber arc_core_register_number (int gdb_regno); + +int arc_core_register_gdb_number (ARC_RegisterNumber hw_regno); + +const char* arc_aux_register_name_of (ARC_RegisterNumber hw_regno); + +Boolean arc_is_core_register (int gdb_regno); + + +/* Accessor functions. */ + +int arc_aux_gdb_register_number (ARC_AuxRegisterDefinition *def); + +ARC_RegisterNumber arc_aux_hw_register_number (ARC_AuxRegisterDefinition *def); + +RegisterAccess arc_aux_register_access (ARC_AuxRegisterDefinition *def); + +Boolean arc_aux_is_unused (ARC_AuxRegisterDefinition *def); + +Boolean arc_aux_is_BCR (ARC_AuxRegisterDefinition *def); + +const char* arc_aux_register_name (ARC_AuxRegisterDefinition *def); + +RegisterAccess arc_core_register_access (ARC_RegisterNumber regno); + + +/* Iterator/summary functions. */ + +void arc_all_aux_registers (ARC_AuxRegisterFunction function, void *data); + +unsigned int arc_aux_register_max_name_length (void); + +unsigned int arc_aux_register_count (struct gdbarch *gdbarch); + +unsigned int arc_core_register_count (struct gdbarch *gdbarch); + +Boolean arc_aux_regs_defined (struct gdbarch *gdbarch); + +ARC_ProcessorVersion arc_aux_architecture (struct gdbarch *gdbarch); + +/* Register contents conversion functions. */ + +ARC_RegisterContents arc_write_value (ARC_AuxRegisterDefinition *def, ARC_RegisterContents value); + +void arc_convert_aux_contents_for_write (int gdb_regno, void *buffer); + + +#endif /* ARC_REGISTERS_H */ +/******************************************************************************/ diff --git a/gdb/arc-regnums-defs.h b/gdb/arc-regnums-defs.h index 6071ee4..bc87295 100644 --- a/gdb/arc-regnums-defs.h +++ b/gdb/arc-regnums-defs.h @@ -1,108 +1,125 @@ -/* Target dependent code for ARC700, for GDB, the GNU debugger. +/* Target dependent code for ARC processor family, for GDB, the GNU debugger. - Copyright 2005 Free Software Foundation, Inc. + Copyright 2005, 2008 Free Software Foundation, Inc. Contributed by Codito Technologies Pvt. Ltd. (www.codito.com) - Authors: - Ramana Radhakrishnan + Authors: + Ramana Radhakrishnan + Richard Stuckey This file is part of GDB. - + 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 + the Free Software Foundation; either version 3 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. -*/ + along with this program. If not, see . */ + +/******************************************************************************/ +/* */ +/* Outline: */ +/* This file defines register numbers for ARC processors. */ +/* */ +/* N.B. this file is NOT a module header file and must NOT have an inclusion */ +/* guard: it may be included at multiple points in a module. */ +/* */ +/* THIS FILE IS NO LONGER USED!!!! */ +/* */ +/******************************************************************************/ + +#ifndef STANDALONE_TEST +#error This file is no longer used +#endif + +/* Auxiliary Registers. */ #ifdef RAUX -#ifdef ARC4_JTAG - -RAUX ( STATUS , 0x0, "Status Regnum " , ARC_STATUS_REGNUM , A4 ) -RAUX ( SEMAPHORE , 0x1, "Semaphore Regnum ", ARC_SEMAPHORE_REGNUM , A4 ) -RAUX ( LP_START , 0x2, "Loop Start" , ARC_LP_START_REGNUM , A4 ) -RAUX ( LP_END , 0x3, "Loop End", ARC_LP_END_REGNUM , A4 ) -RAUX ( IDENTITY , 0x4, "Identity", ARC_IDENTITY_REGNUM , A4 ) -RAUX ( DEBUG , 0x5, "Debug" , ARC_DEBUG_REGNUM , A4 ) - -#else - -RAUX ( STATUS , 0x0, "Status Regnum (obsolete)" , ARC_STATUS_REGNUM , ARCompact ) -RAUX ( SEMAPHORE , 0x1, "Semaphore Regnum ", ARC_SEMAPHORE_REGNUM , ARCompact ) -RAUX ( LP_START , 0x2, "Loop Start" , ARC_LP_START_REGNUM , ARCompact ) -RAUX ( LP_END , 0x3, "Loop End", ARC_LP_END_REGNUM , ARCompact ) -RAUX ( IDENTITY , 0x4, "Identity", ARC_IDENTITY_REGNUM , ARCompact ) -RAUX ( DEBUG , 0x5, "Debug" , ARC_DEBUG_REGNUM , ARCompact ) -RAUX ( PC, 0x6,"PC" , ARC_PC_REGNUM ,ARCompact ) -RAUX ( STATUS32 ,0xA,"STATUS32", ARC_STATUS32_REGNUM , ARCompact ) -RAUX ( STATUS32_L1 , 0xB, "STATUS32 register in case of L1 interrupts" ,ARC_STATUS32_L1_REGNUM , ARCompact ) -RAUX ( STATUS32_L2 , 0xC, "STATUS32 register in case of L2 interrupts" ,ARC_STATUS32_L2_REGNUM , ARCompact ) -RAUX ( COUNT0 , 0x21, "Processor Timer 1 Count Value", ARC_COUNT0_REGNUM , ARCompact ) -RAUX ( CONTROL0 , 0x22, "Processor Timer 1 Control Value" , ARC_CONTROL0_REGNUM, ARCompact) -RAUX ( LIMIT0 , 0x23, "Processor Timer 1 Limit Value" , ARC_LIMIT0_REGNUM, ARCompact ) -RAUX ( INT_VECTOR_BASE , 0x25, "Interrupt Vector Base Register", ARC_INT_VECTOR_BASE_REGNUM , ARCompact ) -RAUX ( AUX_IRQ_MACMODE , 0x41, "Aux IRQ MAC Mode " , ARC_AUX_MACMODE_REGNUM , ARCompact ) -RAUX ( AUX_IRQ_LV12 , 0x42, "Aux IRQ Level 2 " , ARC_AUX_IRQ_LV12_REGNUM , ARCompact ) -RAUX ( COUNT1 , 0x100, "Processor Timer 1 Count Value", ARC_COUNT1_REGNUM , ARCompact ) -RAUX ( CONTROL1 , 0x101, "Processor Timer 1 Control Value" , ARC_CONTROL1_REGNUM , ARCompact) -RAUX ( LIMIT1 , 0x102, "Processor Timer 1 Limit Value", ARC_LIMIT1_REGNUM , ARCompact) -RAUX ( AUX_IRQ_LEV , 0x200, "Interrupt Level programming. ", ARC_AUX_IRQ_LEV_REGNUM , ARCompact) -RAUX ( AUX_IRQ_HINT , 0x201, "Software Triggered Interrupt" , ARC_AUX_IRQ_HINT_REGNUM, ARCompact ) -RAUX ( ERET , 0x400, "Exception Return " , ARC_ERET_REGNUM, ARC700 ) -RAUX ( ERBTA , 0x401, "Exception BTA ", ARC_ERBTA_REGNUM, ARC700 ) -RAUX ( ERSTATUS , 0x402, "Exception Return Status" , ARC_ERSTATUS_REGNUM, ARC700 ) -RAUX ( ECR , 0x403, "Exception Cause Register" , ARC_ECR_REGNUM, ARC700 ) -RAUX ( EFA , 0x404, "Exception Fault Address" , ARC_EFA_REGNUM, ARC700 ) -RAUX ( ICAUSE1 , 0x40A, "Interrupt Cause (Level 1)", ARC_ICAUSE1_REGNUM,ARC700 ) -RAUX ( ICAUSE2 , 0x40B, "Interrupt Cause (Level 2)", ARC_ICAUSE2_REGNUM, ARC700) -RAUX ( AUX_IENABLE , 0x40C, "Interrupt Mask Programming", ARC_AUX_IENABLE_REGNUM, ARC700 ) -RAUX ( AUX_ITRIGGER , 0x40D, "Interrupt Sensitivity Programming", ARC_AUX_ITRIGGER_REGNUM, ARC700 ) -RAUX ( XPU , 0x410, "User Mode Extension Permissions", ARC_XPU_REGNUM, ARC700 ) -RAUX ( BTA , 0x412, "Branch Target Address", ARC_BTA_REGNUM, ARC700 ) -RAUX ( BTA_L1 , 0x413, "Branch Target Address in Level 1", ARC_BTA_L1_REGNUM, ARC700 ) -RAUX ( BTA_L2 , 0x414, "Branch Target Address in Level 2", ARC_BTA_L2_REGNUM, ARC700 ) -RAUX ( AUX_IRQ_PULSE_CANCEL , 0x415, "Interrupt Pulse Cancel", ARC_AUX_IRQ_PULSE_CANCEL_REGNUM, ARC700 ) -RAUX ( AUX_IRQ_PENDING , 0x416, "Interrupt Pending Register", ARC_AUX_IRQ_PENDING_REGNUM, ARC700 ) -#endif // ARC4_JTAG + +RAUX ( STATUS, 0x0, "Status (obsolete)", ARC_STATUS_REGNUM, 0xFEFFFFFF, RO, ARCompact ) +RAUX ( SEMAPHORE, 0x1, "Semaphore", ARC_SEMAPHORE_REGNUM, 0x0000000F, RW, ARCompact ) +RAUX ( LP_START, 0x2, "Loop Start", ARC_LP_START_REGNUM, 0xFFFFFFFE, RW, ARCompact ) +RAUX ( LP_END, 0x3, "Loop End", ARC_LP_END_REGNUM, 0xFFFFFFFE, RW, ARCompact ) +RAUX ( IDENTITY, 0x4, "Identity", ARC_IDENTITY_REGNUM, 0xFFFFFFFF, RO, ARCompact ) +RAUX ( DEBUG, 0x5, "Debug", ARC_DEBUG_REGNUM, 0xF0800802, RO, ARCompact ) +RAUX ( PC, 0x6, "PC", ARC_PC_REGNUM, 0xFFFFFFFE, RO, ARCompact ) +RAUX ( STATUS32, 0xA, "STATUS32", ARC_STATUS32_REGNUM, 0x00001FFF, RO, ARCompact ) +RAUX ( STATUS32_L1, 0xB, "STATUS32 register in case of L1 interrupts", ARC_STATUS32_L1_REGNUM, 0x00001FFE, RW, ARCompact ) +RAUX ( STATUS32_L2, 0xC, "STATUS32 register in case of L2 interrupts", ARC_STATUS32_L2_REGNUM, 0x00001FFE, RW, ARCompact ) +RAUX ( COUNT0, 0x21, "Processor Timer 1 Count Value", ARC_COUNT0_REGNUM, 0xFFFFFFFF, RW, ARCompact ) +RAUX ( CONTROL0, 0x22, "Processor Timer 1 Control Value", ARC_CONTROL0_REGNUM, 0x0000000F, RW, ARCompact ) +RAUX ( LIMIT0, 0x23, "Processor Timer 1 Limit Value", ARC_LIMIT0_REGNUM, 0xFFFFFFFF, RW, ARCompact ) +RAUX ( INT_VECTOR_BASE, 0x25, "Interrupt Vector Base Register", ARC_INT_VECTOR_BASE_REGNUM, 0xFFFFFC00, RW, ARCompact ) +RAUX ( AUX_MACMODE, 0x41, "Aux MAC Mode", ARC_AUX_MACMODE_REGNUM, 0xFFFFFFFF, RW, ARCompact ) +RAUX ( AUX_IRQ_LV12, 0x43, "Aux IRQ Level 2", ARC_AUX_IRQ_LV12_REGNUM, 0x00000003, RW, ARCompact ) +RAUX ( COUNT1, 0x100, "Processor Timer 1 Count Value", ARC_COUNT1_REGNUM, 0xFFFFFFFF, RW, ARCompact ) +RAUX ( CONTROL1, 0x101, "Processor Timer 1 Control Value", ARC_CONTROL1_REGNUM, 0x0000000F, RW, ARCompact ) +RAUX ( LIMIT1, 0x102, "Processor Timer 1 Limit Value", ARC_LIMIT1_REGNUM, 0xFFFFFFFF, RW, ARCompact ) +RAUX ( AUX_IRQ_LEV, 0x200, "Interrupt Level programming", ARC_AUX_IRQ_LEV_REGNUM, 0xFFFFFFF8, RW, ARCompact ) +RAUX ( AUX_IRQ_HINT, 0x201, "Software Triggered Interrupt", ARC_AUX_IRQ_HINT_REGNUM, 0x0000001F, RW, ARCompact ) +RAUX ( ERET, 0x400, "Exception Return", ARC_ERET_REGNUM, 0xFFFFFFFE, RW, ARC700 ) +RAUX ( ERBTA, 0x401, "Exception BTA", ARC_ERBTA_REGNUM, 0xFFFFFFFE, RW, ARC700 ) +RAUX ( ERSTATUS, 0x402, "Exception Return Status", ARC_ERSTATUS_REGNUM, 0x00001FFE, RW, ARC700 ) +RAUX ( ECR, 0x403, "Exception Cause Register", ARC_ECR_REGNUM, 0x00FFFFFF, RO, ARC700 ) +RAUX ( EFA, 0x404, "Exception Fault Address", ARC_EFA_REGNUM, 0xFFFFFFFF, RW, ARC700 ) +RAUX ( ICAUSE1, 0x40A, "Interrupt Cause (Level 1)", ARC_ICAUSE1_REGNUM, 0x0000001F, RO, ARC700 ) +RAUX ( ICAUSE2, 0x40B, "Interrupt Cause (Level 2)", ARC_ICAUSE2_REGNUM, 0x0000001F, RO, ARC700 ) +RAUX ( AUX_IENABLE, 0x40C, "Interrupt Mask Programming", ARC_AUX_IENABLE_REGNUM, 0xFFFFFFF8, RW, ARC700 ) +RAUX ( AUX_ITRIGGER, 0x40D, "Interrupt Sensitivity Programming", ARC_AUX_ITRIGGER_REGNUM, 0xFFFFFFF8, RW, ARC700 ) +RAUX ( XPU, 0x410, "User Mode Extension Permissions", ARC_XPU_REGNUM, 0xFFFFFFFF, RW, ARC700 ) +RAUX ( BTA, 0x412, "Branch Target Address", ARC_BTA_REGNUM, 0xFFFFFFFE, RO, ARC700 ) +RAUX ( BTA_L1, 0x413, "Branch Target Address in Level 1", ARC_BTA_L1_REGNUM, 0xFFFFFFFE, RW, ARC700 ) +RAUX ( BTA_L2, 0x414, "Branch Target Address in Level 2", ARC_BTA_L2_REGNUM, 0xFFFFFFFE, RW, ARC700 ) +RAUX ( AUX_IRQ_PULSE_CANCEL, 0x415, "Interrupt Pulse Cancel", ARC_AUX_IRQ_PULSE_CANCEL_REGNUM, 0xFFFFFFFA, WO, ARC700 ) +RAUX ( AUX_IRQ_PENDING, 0x416, "Interrupt Pending Register", ARC_AUX_IRQ_PENDING_REGNUM, 0xFFFFFFF8, RO, ARC700 ) + #endif // RAUX + +/* Build Configuration Registers. */ + #ifdef RBCR -#ifndef ARC4_JTAG - -RBCR ( DCCM_BASE_BUILD , 0x61, "Base address for DCCM.", ARC_BCR_1_REGNUM, ARCompact) -RBCR ( CRC_BASE_BUILD , 0x62, "BCRBCR for CRC Unit.", ARC_BCR_2_REGNUM , ARCompact) -RBCR ( BTA_LINK_BUILD , 0x63, "Interrupt Link Registers Available for BTA",ARC_BCR_3_REGNUM, ARCompact ) -RBCR ( DVBF_BUILD , 0x64, "BCRBCR for Dual Viterbi Instruction.",ARC_BCR_4_REGNUM, ARCompact ) -RBCR ( TEL_INSTR_BUILD , 0x65, "BCRBCR for Extended Arithmetic Instructions. ",ARC_BCR_5_REGNUM, ARCompact) -RBCR ( MEMSUBSYS , 0x67, "BCRBCR for Memory Subsystem. ",ARC_BCR_7_REGNUM, ARCompact) -RBCR ( VECBASE_AC_BUILD ,0x68, "BCRBCR for Interrupt Vector Base. ", ARC_BCR_8_REGNUM,ARCompact) -RBCR ( P_BASE_ADDRESS , 0x69, "Peripheral Base Address" , ARC_BCR_9_REGNUM , ARCompact) -RBCR ( MMU_BUILD , 0x6F, "MMU Build. " , ARC_BCR_F_REGNUM, ARCompact) -RBCR ( ARCANGEL_BUILD , 0x70, "ARC Angel Build config. ", ARC_BCR_10_REGNUM, ARCompact) -RBCR ( D_CACHE_BUILD , 0x72, "D Cache Build Config. ", ARC_BCR_12_REGNUM , ARCompact ) -RBCR ( MADI_BUILD , 0x73 , "Multiple ARC Debug Interface. " , ARC_BCR_13_REGNUM , ARCompact) -RBCR ( DCCM_BUILD , 0x74, "BCRBCR for DCCM.(Data Closely coupled Memory", ARC_BCR_14_REGNUM, ARCompact) -RBCR ( TIMER_BUILD , 0x75, "BCRBCR for Timers. " , ARC_BCR_15_REGNUM , ARCompact) -RBCR ( AP_BUILD, 0x76, "Actionpoints build. ", ARC_BCR_16_REGNUM , ARCompact ) -RBCR ( ICACHE_BUILD , 0x77, "Instruction Cache BCR", ARC_BCR_17_REGNUM , ARCompact ) -RBCR ( ICCM_BUILD , 0x78, "ICCM BCRBCR (Instruction Closely Coupled Memory.", ARC_BCR_18_REGNUM , ARCompact) -RBCR ( DSPRAM_BUILD , 0x79, "DSP RAM Build", ARC_BCR_19_REGNUM , ARCompact) -RBCR ( MAC_BUILD , 0x7A, "MAC Unit Build", ARC_BCR_1A_REGNUM , ARCompact) -RBCR ( MULTIPLY_BUILD , 0x7B, "(32 X 32) Multiply Unit Build", ARC_BCR_1B_REGNUM , ARCompact) -RBCR ( SWAP_BUILD , 0x7C, "SWAP Build", ARC_BCR_1C_REGNUM , ARCompact) -RBCR ( NORM_BUILD , 0x7D ,"NORM Unit Build", ARC_BCR_1D_REGNUM, ARCompact) -RBCR ( MINMAX_BUILD , 0x7E, "Minmax Unit Build", ARC_BCR_1E_REGNUM, ARCompact) -RBCR ( BARREL_BUILD , 0x7F, "Barrel Shifter Build", ARC_BCR_1F_REGNUM , ARCompact) - - -#endif // ARC4_JTAG -#endif // RBCR + +RBCR ( UNUSED_0, 0x60, "unused", ARC_BCR_0_REGNUM, 0xFFFFFFFF, UU, ARCompact ) +RBCR ( DCCM_BASE_BUILD, 0x61, "Base address for DCCM", ARC_BCR_1_REGNUM, 0xFFFFFFFF, RO, ARCompact ) +RBCR ( CRC_BASE_BUILD, 0x62, "BCR for CRC Unit", ARC_BCR_2_REGNUM, 0xFFFFFFFF, RO, ARCompact ) +RBCR ( BTA_LINK_BUILD, 0x63, "Interrupt Link Registers Available for BTA", ARC_BCR_3_REGNUM, 0xFFFFFFFF, RO, ARCompact ) +RBCR ( DVBF_BUILD, 0x64, "BCR for Dual Viterbi Instruction", ARC_BCR_4_REGNUM, 0xFFFFFFFF, RO, ARCompact ) +RBCR ( TEL_INSTR_BUILD, 0x65, "BCR for Extended Arithmetic Instructions", ARC_BCR_5_REGNUM, 0xFFFFFFFF, RO, ARCompact ) +RBCR ( UNUSED_6, 0x66, "unused", ARC_BCR_6_REGNUM, 0xFFFFFFFF, UU, ARCompact ) +RBCR ( MEMSUBSYS, 0x67, "BCR for Memory Subsystem", ARC_BCR_7_REGNUM, 0xFFFFFFFF, RO, ARCompact ) +RBCR ( VECBASE_AC_BUILD, 0x68, "BCR for Interrupt Vector Base", ARC_BCR_8_REGNUM, 0xFFFFFFFF, RO, ARCompact ) +RBCR ( P_BASE_ADDRESS, 0x69, "Peripheral Base Address", ARC_BCR_9_REGNUM, 0xFFFFFFFF, RO, ARCompact ) +RBCR ( UNUSED_A, 0x6A, "unused", ARC_BCR_A_REGNUM, 0xFFFFFFFF, UU, ARCompact ) +RBCR ( UNUSED_B, 0x6B, "unused", ARC_BCR_B_REGNUM, 0xFFFFFFFF, UU, ARCompact ) +RBCR ( UNUSED_C, 0x6C, "unused", ARC_BCR_C_REGNUM, 0xFFFFFFFF, UU, ARCompact ) +RBCR ( UNUSED_D, 0x6D, "unused", ARC_BCR_D_REGNUM, 0xFFFFFFFF, UU, ARCompact ) +RBCR ( UNUSED_E, 0x6E, "unused", ARC_BCR_E_REGNUM, 0xFFFFFFFF, UU, ARCompact ) +RBCR ( MMU_BUILD, 0x6F, "MMU Build", ARC_BCR_F_REGNUM, 0xFFFFFFFF, RO, ARCompact ) +RBCR ( ARCANGEL_BUILD, 0x70, "ARC Angel Build Config", ARC_BCR_10_REGNUM, 0xFFFFFFFF, RO, ARCompact ) +RBCR ( UNUSED_11, 0x6E, "unused", ARC_BCR_11_REGNUM, 0xFFFFFFFF, UU, ARCompact ) +RBCR ( D_CACHE_BUILD, 0x72, "D Cache Build Config", ARC_BCR_12_REGNUM, 0xFFFFFFFF, RO, ARCompact ) +RBCR ( MADI_BUILD, 0x73, "Multiple ARC Debug Interface", ARC_BCR_13_REGNUM, 0xFFFFFFFF, RO, ARCompact ) +RBCR ( DCCM_BUILD, 0x74, "BCR for DCCM (Data Closely Coupled Memory)", ARC_BCR_14_REGNUM, 0xFFFFFFFF, RO, ARCompact ) +RBCR ( TIMER_BUILD, 0x75, "BCR for Timers", ARC_BCR_15_REGNUM, 0xFFFFFFFF, RO, ARCompact ) +RBCR ( AP_BUILD, 0x76, "Actionpoints build", ARC_BCR_16_REGNUM, 0xFFFFFFFF, RO, ARCompact ) +RBCR ( ICACHE_BUILD, 0x77, "Instruction Cache BCR", ARC_BCR_17_REGNUM, 0xFFFFFFFF, RO, ARCompact ) +RBCR ( ICCM_BUILD, 0x78, "ICCM BCR (Instruction Closely Coupled Memory)", ARC_BCR_18_REGNUM, 0xFFFFFFFF, RO, ARCompact ) +RBCR ( DSPRAM_BUILD, 0x79, "DSP RAM Build", ARC_BCR_19_REGNUM, 0xFFFFFFFF, RO, ARCompact ) +RBCR ( MAC_BUILD, 0x7A, "MAC Unit Build", ARC_BCR_1A_REGNUM, 0xFFFFFFFF, RO, ARCompact ) +RBCR ( MULTIPLY_BUILD, 0x7B, "(32 X 32) Multiply Unit Build", ARC_BCR_1B_REGNUM, 0xFFFFFFFF, RO, ARCompact ) +RBCR ( SWAP_BUILD, 0x7C, "SWAP Build", ARC_BCR_1C_REGNUM, 0xFFFFFFFF, RO, ARCompact ) +RBCR ( NORM_BUILD, 0x7D, "NORM Unit Build", ARC_BCR_1D_REGNUM, 0xFFFFFFFF, RO, ARCompact ) +RBCR ( MINMAX_BUILD, 0x7E, "Minmax Unit Build", ARC_BCR_1E_REGNUM, 0xFFFFFFFF, RO, ARCompact ) +RBCR ( BARREL_BUILD, 0x7F, "Barrel Shifter Build", ARC_BCR_1F_REGNUM, 0xFFFFFFFF, RO, ARCompact ) + +#endif // RBCR + +/******************************************************************************/ diff --git a/gdb/arc-remote-fileio.c b/gdb/arc-remote-fileio.c new file mode 100644 index 0000000..5bb22ea --- /dev/null +++ b/gdb/arc-remote-fileio.c @@ -0,0 +1,741 @@ +/* Target dependent code for ARC processor family, for GDB, the GNU debugger. + + Copyright 2008, 2009 Free Software Foundation, Inc. + + Contributed by ARC International (www.arc.com) + + Author: + Richard Stuckey + + This file is part of GDB. + + 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 3 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, see . */ + +/******************************************************************************/ +/* */ +/* Outline: */ +/* This module implements facilities for intercepting I/O (and other) */ +/* operations attempted on an ARC target and performing them on the host, */ +/* using a RPC (Remote Procedure Call) mechanism. */ +/* */ +/* Mechanism: */ +/* When interception is enabled, this module sets a breakpoint at the */ +/* entry point of each operation which is to be intercepted; it finds the */ +/* entry points of named routines in the C runtime library code by using */ +/* gdb's symbol lookup facilities. */ +/* */ +/* When a breakpoint is triggered on the target, the target monitoring */ +/* loop calls the function 'arc_check_interception_breakpoint' to check */ +/* whether the breakpoint triggered is an interception breakpoint; this */ +/* function will return a code indicating either */ +/* */ +/* a) the breakpoint is an interception breakpoint, the interception */ +/* has been performed and execution of the target program should be */ +/* resumed; or */ +/* */ +/* b) the breakpoint is an interception breakpoint, but the intercepted */ +/* routine is 'exit' and execution should not be resumed; or */ +/* */ +/* c) the breakpoint is not an interception breakpoint, so execution */ +/* should not be resumed and the trigger should be reported to gdb. */ +/* */ +/* In case a), this module then reads the routine's parameters from the */ +/* target's registers, performs whatever conversions are required, and */ +/* constructs a gdb RSP File I/O extension 'F' message which it passes to */ +/* the gdb target_fileio module, which performs the requested operation */ +/* on the host machine. */ +/* */ +/* The target_fileio module is passed a set of operations which allow it */ +/* to read data from target memory, write data to target memory, and */ +/* return a result value (and possibly a error code) to the intercepted */ +/* routine. The result value is written into the target's R0 register; */ +/* the error code (if any) is written into the location of the 'errno' */ +/* variable. */ +/* */ +/* Finally, this module copies the routine return address from the BLINK */ +/* register to the PC register - this ensures that when execution of the */ +/* target is resumed, control returns to the code after the call to the */ +/* intercepted routine. */ +/* */ +/* Notes: */ +/* 1) the set of routines to be intercepted, and the parameters to these */ +/* routines, is defined by a table (see below) - so it is simple to */ +/* add more routines to the set; */ +/* */ +/* 2) the 'open' syscall (see man open(2)) has a 'flags' parameter which */ +/* is a bit mask; unfortunately, the bits differ in meaning between */ +/* the host and the elf-32 target program, so the parameter must be */ +/* converted before it can be passed to the target_fileio module; */ +/* */ +/* 3) the 'fstat' syscall (see man fstat(2)) has an out parameter which */ +/* is a 'struct stat' structure (i.e. the address of such a structure */ +/* is a parameter to the syscall): the target_fileio module writes the */ +/* data of the structure to that location in target memory; however, */ +/* the structure does not have the same layout on host and target, so */ +/* the structure must be converted before it can be written to the */ +/* target; */ +/* */ +/* 4) the interception breakpoints are not handled by the core gdb */ +/* breakpoint mechanism; hence, they are not listed by the 'info break'*/ +/* command, and can not be (accidentally) deleted by the user; though */ +/* they could be handled by gdb, that would require the introduction */ +/* of a new "invisible" breakpoint type, and hence more changes to */ +/* supposedly generic code; */ +/* */ +/* 5) it would be more elegant (from one perspective) to intecept these */ +/* operations by placing a breakpoint at the interrupt vector location */ +/* of the 'swi' (SoftWare Interrupt) handler: only one breakpoint */ +/* would then be required, and all syscalls would be intercepted; */ +/* however, this module would then have to simulate a "return from */ +/* exception" in order to resume target execution, which would be more */ +/* complex than the "restart at return address" method currently used. */ +/* */ +/* Restrictions: */ +/* 1) this module places s/w breakpoints at the entry points; therefore, */ +/* the mechanism will not work with programs that are loaded into read */ +/* -only memory; */ +/* */ +/* 2) this mechanism will probably not work if the user sets breakpoints */ +/* on the entry points of the intercepted routines - there will be a */ +/* conflict! */ +/* */ +/******************************************************************************/ + +/* system header files */ +#include +#include +#include + +/* gdb header files */ +#include "defs.h" +#include "symtab.h" +#include "frame.h" +#include "block.h" +#include "target.h" +#include "target-fileio.h" +#include "exceptions.h" +#include "gdb/fileio.h" + +/* ARC header files */ +#include "arc-remote-fileio.h" +#include "config/arc/tm-embed.h" + + +/* -------------------------------------------------------------------------- */ +/* local types */ +/* -------------------------------------------------------------------------- */ + +#define MAX_SYSCALL_PARAMS 4 + +/* These are the intercepted routines. */ +typedef enum +{ + READ_CALL, + WRITE_CALL, + OPEN_CALL, + CLOSE_CALL, + LSEEK_CALL, + FSTAT_CALL, + GETTIMEOFDAY_CALL, + EXIT_CALL +} SystemCall; + + +struct lib_function +{ + SystemCall call; + const char *name; + const char *format; + Boolean bp_is_set; + unsigned int param_count; + ARC_RegisterNumber param_register[MAX_SYSCALL_PARAMS]; + struct bp_target_info breakpoint; +}; + + +/* This structure defines a memory image of the 'stat' structure as it is + represented on the ARC target. */ +struct arc_stat +{ + ARC_Byte fst_dev [4]; + ARC_Byte fst_ino [4]; + ARC_Byte fst_mode [2]; + ARC_Byte fst_nlink [2]; + ARC_Byte fst_uid [2]; + ARC_Byte fst_gid [2]; + ARC_Byte fst_rdev [4]; + ARC_Byte fst_size [4]; + ARC_Byte fst_blksize[4]; + ARC_Byte fst_blocks [4]; + ARC_Byte fst_atime [8]; + ARC_Byte fst_mtime [8]; + ARC_Byte fst_ctime [8]; +}; + + +/* -------------------------------------------------------------------------- */ +/* local data */ +/* -------------------------------------------------------------------------- */ + +/* The %x specifiers in the format strings in this table correspond to the + parameters to the intercepted functions; the register number of the target + register in which the parameter is passed is given by the corresponding + entry in the param_register array. + + N.B. the special value of SL as the number of the register in which a + parameter is passed indicates that the preceding parameter was the + address of a string, and the length of that string (including the + terminating NUL) is required here. + + F indicates that the parameter in register is a word of flag + bits which must be handled specially! + + X indicates that the array element is not used. */ + +#define SL 1000 +#define F2 1002 +#define X 9999 + +static struct lib_function functions[] = +{ + { READ_CALL, "_read_r", "Fread,%x,%x,%x", FALSE, 3, {1, 2, 3, X} }, + { WRITE_CALL, "_write_r", "Fwrite,%x,%x,%x", FALSE, 3, {1, 2, 3, X} }, + { OPEN_CALL, "_open_r", "Fopen,%x/%x,%x,%x", FALSE, 4, {1, SL, F2, 3} }, + { CLOSE_CALL, "_close_r", "Fclose,%x", FALSE, 1, {1, X, X, X} }, + { LSEEK_CALL, "_lseek_r", "Flseek,%x,%x,%x", FALSE, 3, {1, 2, 3, X} }, + { FSTAT_CALL, "_fstat_r", "Ffstat,%x,%x", FALSE, 2, {1, 2, X, X} }, + { GETTIMEOFDAY_CALL, "_gettimeofday_r", "Fgettimeofday,%x,%x", FALSE, 2, {1, 2, X, X} }, + { EXIT_CALL, "_exit_r", NULL, FALSE, 1, {1, X, X, X} } +}; + + +/* A pointer to the set of target operations for the current target. */ +static TargetOperations *target_operations; + +/* TRUE if the operation currently being intercepted has NOT been interrupted + by the user typing a Ctrl-C. */ +static Boolean not_interrupted; + +/* For the Ctrl-C signal handler. */ +static void (*old_signal_handler) (int); + + +/* -------------------------------------------------------------------------- */ +/* local functions */ +/* -------------------------------------------------------------------------- */ + +/* Read a number of bytes of data from the given address in target memory. */ + +static int +read_bytes (CORE_ADDR memaddr, gdb_byte *myaddr, int len) +{ + DEBUG("reading %d bytes from %x\n", len, (unsigned int) memaddr); + + return (int) target_read (¤t_target, TARGET_OBJECT_MEMORY, NULL, myaddr, memaddr, len); +} + + +/* Read a number of bytes of data from the given address in target memory. */ + +static int +write_bytes (CORE_ADDR memaddr, gdb_byte *myaddr, int len) +{ + DEBUG("writing %d bytes to %x\n", len, (unsigned int) memaddr); + + return (int) target_write (¤t_target, TARGET_OBJECT_MEMORY, NULL, myaddr, memaddr, len); +} + + +/* Perform the reply to the intercepted operation: set up the result of the call + and the error code (if any) so that the intercepted operation receives them + just as though the operation had really been performed upon the target. */ + +static void +reply (int retcode, int error) +{ + /* Ignore any Ctrl-Cs while performing the reply. */ + (void) signal (SIGINT, SIG_IGN); + + DEBUG("reply: retcode = %d, error = %d\n", retcode, error); + + /* If an error has occurred. */ + if (retcode == -1) + { + ARC_RegisterContents errno_address; + + if (error == FILEIO_EINTR) + { + DEBUG("*** interrupted by user!\n"); + /* Set the global flag so that it can be tested later. */ + not_interrupted = FALSE; + return; + } + + /* Read the address of the 'errno' variable from R0. */ + if (target_operations->read_core_register(0, &errno_address, TRUE)) + /* Write the error number into the 'errno' variable. */ + (void) write_bytes((CORE_ADDR) errno_address, (gdb_byte*) &error, BYTES_IN_WORD); + } + + /* Write the return code into the function result register R0. */ + (void) target_operations->write_core_register(0, (ARC_RegisterContents) retcode, TRUE); +} + + +/* Copy a number of bytes of data from one buffer to another. Note that the + buffers are not necessarily of the same size. Perform endianess byte-swapping + if necessary. */ + +static void +copy_bytes (char *from, size_t from_size, + ARC_Byte *to, size_t to_size, + Boolean target_is_big_endian) +{ + /* We can not copy more data than we have been given in the source buffer, + or for which there is room in the destination buffer. */ + unsigned int bytes = (unsigned int) ((from_size > to_size) ? to_size : from_size); + unsigned int i; + + /* N.B. 1) the fio_stat structure created by target-fileio.c has the values + in big-endian byte order; so if the ARC target is little-endian + we must reverse the order; + + 2) the fields in the fio_stat structure may be smaller (or larger!) + than the corresponding fields in the ARC target structure - so we + copy the *least* significant bytes of the fields, on the grounds + that the most significant bytes are probably just sign-extensions! */ + for (i = 0; i < bytes; i++) + to[i] = (ARC_Byte) ((target_is_big_endian) ? from[i] + : from[from_size - 1 - i]); +} + + +/* Write a 'stat' structure to the target at a given address in memory. + 'myaddr' points to a fio_stat structure created by the target-fileio module; + this structure is meant for use in the RSP protocol, and is designed for + independence of host/target systems - therefore, we must create an equivalent + structure which is ARC-specific, and write that structure to the target. + + Return the number of bytes of data written. */ + +static int +write_fstat (CORE_ADDR memaddr, gdb_byte *myaddr, int len) +{ + Boolean target_is_big_endian = (gdbarch_byte_order (current_gdbarch) == BFD_ENDIAN_BIG); + struct fio_stat *fst = (struct fio_stat*) myaddr; + struct arc_stat ast; + + memset(&ast, 0, sizeof(ast)); + +#define COPY(from, to) copy_bytes(from, sizeof(from), to, sizeof(to), target_is_big_endian) + + COPY(fst->fst_dev, ast.fst_dev); + COPY(fst->fst_ino, ast.fst_ino); + COPY(fst->fst_mode, ast.fst_mode); + COPY(fst->fst_nlink, ast.fst_nlink); + COPY(fst->fst_uid, ast.fst_uid); + COPY(fst->fst_gid, ast.fst_gid); + COPY(fst->fst_rdev, ast.fst_rdev); + COPY(fst->fst_size, ast.fst_size); + COPY(fst->fst_blksize, ast.fst_blksize); + COPY(fst->fst_blocks, ast.fst_blocks); + COPY(fst->fst_atime, ast.fst_atime); + COPY(fst->fst_mtime, ast.fst_mtime); + COPY(fst->fst_ctime, ast.fst_ctime); + + return write_bytes(memaddr, (gdb_byte*) &ast, (int) sizeof(ast)); +} + + +/* Find the address of the entry point of the given routine in the target program. + Return 0 if the entry point can not be found, or is not a function. */ + +static CORE_ADDR +findEntryPoint (const char *routine) +{ + CORE_ADDR entry = 0; + int is_a_field_of_this; + struct symbol *sym = lookup_symbol (routine, + get_selected_block (0), + VAR_DOMAIN, + &is_a_field_of_this, + (struct symtab **) NULL); + if (sym) + { + if (SYMBOL_CLASS (sym) == LOC_BLOCK) + entry = BLOCK_START (SYMBOL_BLOCK_VALUE (sym)); + else + warning(_("%s is not a function"), routine); + } + else + warning(_("can not find entry point of function %s"), routine); + + return entry; +} + + +/* Insert a s/w breakpoint in the target program code at the entry point of the + given library function. */ + +static void +insert_breakpoint (struct lib_function *f) +{ + if (!f->bp_is_set) + { + if (arc_elf32_insert_breakpoint(&f->breakpoint) == 0) + f->bp_is_set = TRUE; + else + warning(_("can not set breakpoint at entrypoint of %s"), f->name); + } +} + + +/* Remove a s/w breakpoint from the target program code at the entry point of the + given library function. */ + +static void +remove_breakpoint (struct lib_function *f) +{ + if (f->bp_is_set) + { + if (arc_elf32_remove_breakpoint(&f->breakpoint) == 0) + f->bp_is_set = FALSE; + else + warning(_("can not unset breakpoint at entrypoint of %s"), f->name); + } +} + + +/* This function handles any Ctrl-C typed by the user whilst the interception of + an operation is in progress. */ + +static void +Ctrl_C_signal_handler (int signo) +{ + /* Ignore any more Ctrl-Cs. */ + (void) signal (SIGINT, SIG_IGN); + + /* We must use the gdb exception mechanism since the target_fileio_request + function calls catch_exceptions, and if we do something else (like a long + jump) here, gdb's cleanup list would be left in an inconsistent state! */ + DEBUG("*** throwing RETURN_QUIT...\n"); + deprecated_throw_reason (RETURN_QUIT); +} + + +/* This function is called from the gdb target-fileio module: it sets up this + module's handler for Ctrl-C interrupts. */ + +static void +set_Ctrl_C_signal_handler (void) +{ + old_signal_handler = signal (SIGINT, Ctrl_C_signal_handler); +} + + +/* This function finds the length of a C string stored in target memory at the + given address. */ + +static unsigned int +find_string_length (ARC_Address address) +{ + unsigned int length = 0; + + while (TRUE) + { + gdb_byte buf[65]; + int bytes = read_bytes((CORE_ADDR) address, + buf, + (int) sizeof(buf) - 1); + int i; + + for (i = 0; i < bytes; i++) + if (buf[i] == (gdb_byte) '\0') + return (unsigned int) (length + i + 1); + + address += bytes; + length += bytes; + } +} + + +/* Convert flags to target syscall to what they "should" be! */ + +static ARC_RegisterContents +convert_flags (ARC_RegisterContents flags) +{ + ARC_RegisterContents result = flags; + +/* See gcc/src/newlib/libc/sys/arc/sys/fcntl.h */ + +/* The following values have been changed for uclibc compatibility. */ +#define _FAPPEND 0x0400 /* append (writes guaranteed at the end) */ +#define _FASYNC 0x2000 /* signal pgrp when data ready */ +#define _FCREAT 0x0040 /* open with file create */ +#define _FTRUNC 0x0200 /* open with truncation */ +#define _FEXCL 0x0080 /* error on open if file exists */ +#define _FSYNC 0x1000 /* do all writes synchronously */ +#define _FNONBLOCK 0x0800 /* non blocking I/O (POSIX style) */ + +#define REMOVE(flag) if (flags & _F ## flag) result &= ~ _F ## flag +#define ADD(flag) if (flags & _F ## flag) result |= FILEIO_O_ ## flag + + /* N.B. all "old" bits most be removed from the result word before all + "new" bits are added, in case the old and new sets intersect! */ + REMOVE(APPEND); +// REMOVE(ASYNC); // no equivalent flag in gdb/fileio.h + REMOVE(CREAT); + REMOVE(TRUNC); + REMOVE(EXCL); +// REMOVE(SYNC); // no equivalent flag in gdb/fileio.h +// REMOVE(NONBLOCK); // no equivalent flag in gdb/fileio.h + ADD(APPEND); +// ADD(ASYNC); // no equivalent flag in gdb/fileio.h + ADD(CREAT); + ADD(TRUNC); + ADD(EXCL); +// ADD(SYNC); // no equivalent flag in gdb/fileio.h +// ADD(NONBLOCK); // no equivalent flag in gdb/fileio.h + + return result; +} + + +/* Perform the interception of the given library function. + Return TRUE if the interception is completed successfully, + FALSE if it is interrupted by the user. */ + +static Boolean +perform_interception (struct lib_function *f) +{ + ARC_RegisterContents params [MAX_SYSCALL_PARAMS]; + char request[MAX_SYSCALL_PARAMS * 9 + 40]; + unsigned int i; + + /* These operations allow the target_fileio module to read data from target + memory, write data to target memory, and return a result value (and + possibly a error code) to the intercepted routine. + + N.B. if the syscsall is 'fstat', we pass a special write function + which converts the 'struct stat' structure to target layout before + writing it to target memory. */ + struct file_io_operations io_operations = + { + read_bytes, + (f->call == FSTAT_CALL) ? write_fstat : write_bytes, + reply, + set_Ctrl_C_signal_handler + }; + + /* Evaluate the parameters to be passed to the RPC request. */ + for (i = 0; i < f->param_count; i++) + { + ARC_RegisterNumber reg = f->param_register[i]; + + if (reg == SL) + params[i] = find_string_length((ARC_Address) params[i - 1]); + else if (reg == F2) + { + ARC_RegisterContents flags; + + (void) target_operations->read_core_register(2, &flags, TRUE); + params[i] = convert_flags(flags); + } + else + (void) target_operations->read_core_register(reg, ¶ms[i], TRUE); + } + + /* Do not close the target program's stdin, stdout or stderr streams on the + host: it is possible that the program may be re-loaded and re-run on the + target in the same debugging session (so re-initializing its I/O system) + so it may try to read/write those streams again - instead, just tell the + target that the close succeeded. */ + if (f->call == CLOSE_CALL) + { + int fd = (int) params[0]; + + if (fd == STDIN_FILENO || fd == STDOUT_FILENO || fd == STDERR_FILENO) + { + reply(0, 0); + DEBUG("*** RPC close of stream %d ignored\n", fd); + return TRUE; + } + } + + /* Parameters which are extra to those required by the format will simply be + ignored. */ + (void) snprintf(request, sizeof(request), f->format, + params[0], params[1], params[2], params[3]); + + DEBUG("RPC request: %s\n", request); + + /* the interception might be interrupted by the user typing Ctrl-C whilst + the interception is in progress; if that happens, this flag will be set + to FALSE. */ + not_interrupted = TRUE; + + /* Make the RPC request. */ + target_fileio_request(request, &io_operations); + + (void) signal (SIGINT, old_signal_handler); + + /* If the call was not interrupted, the interception has been performed. */ + return not_interrupted; +} + + +/* -------------------------------------------------------------------------- */ +/* externally visible functions */ +/* -------------------------------------------------------------------------- */ + +/* Set the state of the I/O interception mechanism: + ON : set breakpoints on all the functions to be intercepted + OFF : clear breakpoints from all the intercepted functions + RESET: mark the breakpoints as not being set (if a new program has been + downloaded to the target, the s/w breakpoints in the old program + have been lost, and so should not be removed). */ + +void +arc_set_IO_interception (TargetOperations *operations, + InterceptionState state) +{ + unsigned int i; + + DEBUG("*** interception: %s\n", (state == INTERCEPTION_RESET) ? "RESET" : + (state == INTERCEPTION_ON) ? "ON" : + "OFF"); + + target_operations = operations; + + for (i = 0; i < ELEMENTS_IN_ARRAY(functions); i++) + { + struct lib_function* f = &functions[i]; + + switch (state) + { + case INTERCEPTION_RESET: + f->bp_is_set = FALSE; + break; + + case INTERCEPTION_ON: + /* Set a breakpoint on the entry point of the function. */ + f->breakpoint.placed_address = findEntryPoint(f->name); + + if (f->breakpoint.placed_address != 0) + { + DEBUG("intercept 0x%08X : %s\n", (unsigned int) f->breakpoint.placed_address, f->name); + insert_breakpoint(f); + } + break; + + case INTERCEPTION_OFF: + if (f->breakpoint.placed_address != 0) + { + remove_breakpoint(f); + f->breakpoint.placed_address = 0; + } + break; + } + } +} + + +/* This function is called when the execution of the target program has been + halted by a breakpoint trigger. It checks whether the breakpoint that has + been triggered is at the entry point of an intercepted function, and, if so, + performs the required interception. + + Returns: + INTERCEPTION_RESUME : interception has been performed, execution should be resumed + INTERCEPTION_HALT : the program is halted (no interception has been performed) + INTERCEPTION_EXIT : the program has exited + INTERCEPTION_INTERRUPT : the interception has been interrupted by the user + + If the program has exited, the 'exitcode' parameter is set to the program's exit code. */ + +InterceptionAction +arc_check_interception_breakpoint (int *exitcode) +{ + ARC_RegisterContents pc; + + ENTERMSG; + + *exitcode = 0; + + /* Get the current execution point from the PCL, rather than the PC - this + gives the same result on both ARC700 and ARC600 targets. */ + if (target_operations->read_core_register(ARC_PCL_REGNUM, &pc, TRUE)) + { + unsigned int i; + + DEBUG("checking for interception at 0x%08X\n", pc); + + /* Look at each of the intercepted operations. */ + for (i = 0; i < ELEMENTS_IN_ARRAY(functions); i++) + { + struct lib_function *f = &functions[i]; + + if (f->breakpoint.placed_address == (CORE_ADDR) pc) + { + DEBUG("intercepted function %s\n", f->name); + + if (f->call == EXIT_CALL) + { + ARC_RegisterContents code; + + /* The exit code is in parameter register R1. */ + if (target_operations->read_core_register(1, &code, TRUE)) + *exitcode = (int) code; + + return INTERCEPTION_EXIT; + } + else + { + /* If the interception is performed. */ + if (perform_interception(f)) + { + ARC_RegisterContents blink; + + /* Copy BLINK to PC, so that when execution is re-started, + control will return to the point after the call of the + intercepted function. */ + if (target_operations->read_core_register (ARC_BLINK_REGNUM, &blink, TRUE) && + target_operations->write_auxiliary_register(arc_pc_regnum, blink, TRUE)) + { + DEBUG("copied BLINK (%x) to PC (was %x)\n", blink, pc); + return INTERCEPTION_RESUME; + } + + /* If we couldn't set PC, fall through. */ + } + else + { + /* The interception has been interrupted by a Ctrl-C + from the user - do not change the PC, as we want + execution to resume at the same point in the code, + so that the I/O request will be performed (and + intercepted) again: this e.g. allows the user to + break into a program that is in a tight loop doing + reads or writes. */ + return INTERCEPTION_INTERRUPT; + } + } + } + } + } + + return INTERCEPTION_HALT; +} + +/******************************************************************************/ diff --git a/gdb/arc-remote-fileio.h b/gdb/arc-remote-fileio.h new file mode 100644 index 0000000..7a2d76c --- /dev/null +++ b/gdb/arc-remote-fileio.h @@ -0,0 +1,64 @@ +/* Target dependent code for ARC processor family, for GDB, the GNU debugger. + + Copyright 2008, 2009 Free Software Foundation, Inc. + + Contributed by ARC International (www.arc.com) + + Author: + Richard Stuckey + + This file is part of GDB. + + 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 3 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, see . */ + +/******************************************************************************/ +/* */ +/* Outline: */ +/* This header file defines facilities for intercepting I/O (and other) */ +/* operations attempted on an ARC target and performing them on the host, */ +/* using a RPC (Remote Procedure Call) mechanism. */ +/* */ +/******************************************************************************/ + +#ifndef ARC_REMOTE_FILEIO +#define ARC_REMOTE_FILEIO + +/* ARC header files */ +#include "arc-support.h" + + +typedef enum +{ + INTERCEPTION_RESUME, + INTERCEPTION_HALT, + INTERCEPTION_EXIT, + INTERCEPTION_INTERRUPT +} InterceptionAction; + + +typedef enum +{ + INTERCEPTION_RESET, + INTERCEPTION_ON, + INTERCEPTION_OFF +} InterceptionState; + + +void arc_set_IO_interception (TargetOperations *operations, + InterceptionState state); + +InterceptionAction arc_check_interception_breakpoint (int *exitcode); + +#endif /* ARC_REMOTE_FILEIO */ +/******************************************************************************/ diff --git a/gdb/arc-support.h b/gdb/arc-support.h new file mode 100644 index 0000000..76ff0bf --- /dev/null +++ b/gdb/arc-support.h @@ -0,0 +1,136 @@ +/* Target dependent code for ARC processor family, for GDB, the GNU debugger. + + Copyright 2008, 2009 Free Software Foundation, Inc. + + Contributed by ARC International (www.arc.com) + + Authors: + Richard Stuckey + + This file is part of GDB. + + 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 3 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, see . */ + +/******************************************************************************/ +/* */ +/* Outline: */ +/* This header file defines some useful types and constants, and macros */ +/* for use in debugging. */ +/* */ +/******************************************************************************/ + +#ifndef ARC_SUPPORT_H +#define ARC_SUPPORT_H + + +#define ARC_DEBUG 1 + +#ifdef ARC_DEBUG +#define DEBUG(...) if (arc_debug_target) fprintf_unfiltered(gdb_stdlog, __VA_ARGS__) +#define ENTERMSG DEBUG("--- entered %s:%s()\n", __FILE__, __FUNCTION__) +#define ENTERARGS(fmt, args...) DEBUG("--- entered %s:%s(" fmt ")\n", __FILE__, __FUNCTION__, args) +#define LEAVEMSG DEBUG("--- exited %s:%s()\n", __FILE__, __FUNCTION__) +#else +#define DEBUG(...) +#define ENTERMSG +#define ENTERARGS(fmt, args...) +#define LEAVEMSG +#endif + + +/* N.B. it must be possible to build some ARC modules without the rest of gdb so + that they can be exercised by stand-alone test drivers. */ +#ifdef STANDALONE_TEST +#define error(...) { printf(__VA_ARGS__); printf("\n"); } +#define warning(...) { printf(__VA_ARGS__); printf("\n"); } +#define printf_filtered(...) printf(__VA_ARGS__) +#define printf_unfiltered(...) printf(__VA_ARGS__) +#define fprintf_unfiltered(STR, ...) printf(__VA_ARGS__) +#define internal_error(...) abort() +#endif + + +/* Useful Boolean type and constants. */ +typedef int Boolean; + +#ifndef FALSE +#define FALSE 0 +#endif +#ifndef TRUE +#define TRUE 1 +#endif + + +/* Useful types for machine-related quantities. + + N.B. the type ARC_RegisterNumber does not denote gdb register numbers; + instead, it denotes ARC processor hardware numbers, which are not + the same. */ + +typedef unsigned int ARC_RegisterNumber; +typedef unsigned int ARC_RegisterContents; +typedef unsigned int ARC_Address; +typedef unsigned long long int ARC_Doubleword; +typedef unsigned int ARC_Word; +typedef unsigned short int ARC_Halfword; +typedef unsigned char ARC_Byte; + + +/* Types for machine-access functions. */ +typedef Boolean (*ReadRegisterFunction)(ARC_RegisterNumber hw_regno, + ARC_RegisterContents *contents, + Boolean warn_on_failure); + +typedef Boolean (*WriteRegisterFunction)(ARC_RegisterNumber hw_regno, + ARC_RegisterContents contents, + Boolean warn_on_failure); + + +typedef unsigned int (*MemoryTransferFunction)(ARC_Address address, + ARC_Byte *data, /* May be not word-aligned. */ + unsigned int amount); + +typedef unsigned int (*MemoryFillFunction) (ARC_Address address, + ARC_Word pattern, + unsigned int amount); + +typedef struct +{ + ReadRegisterFunction read_core_register; + WriteRegisterFunction write_core_register; + ReadRegisterFunction read_auxiliary_register; + WriteRegisterFunction write_auxiliary_register; + MemoryTransferFunction read_memory; + MemoryTransferFunction write_memory; + MemoryFillFunction fill_memory; +} TargetOperations; + + +/* Sizes of machine quantities. */ +#define BYTES_IN_WORD 4 +#define BYTES_IN_REGISTER 4 +#define BITS_IN_BYTE 8 +#define BITS_IN_WORD 32 +#define BITS_IN_ADDRESS 32 +#define BITS_IN_REGISTER 32 + + +/* Useful macros. */ +#define ELEMENTS_IN_ARRAY(arr) (unsigned int) (sizeof(arr) / sizeof(arr[0])) + +#define IS_WORD_ALIGNED(addr) ((addr) % BYTES_IN_WORD == 0) + + +#endif /* ARC_SUPPORT_H */ +/******************************************************************************/ diff --git a/gdb/arc-tdep.c b/gdb/arc-tdep.c index 8b54257..f912f89 100644 --- a/gdb/arc-tdep.c +++ b/gdb/arc-tdep.c @@ -1,1999 +1,2591 @@ -/* Target dependent code for ARC700, for GDB, the GNU debugger. +/* Target dependent code for ARC processor family, for GDB, the GNU debugger. - Copyright 2005 Free Software Foundation, Inc. + Copyright 2005, 2008, 2009 Free Software Foundation, Inc. Contributed by Codito Technologies Pvt. Ltd. (www.codito.com) - Authors: - Soam Vasani - Ramana Radhakrishnan + Authors: + Soam Vasani + Ramana Radhakrishnan + Richard Stuckey This file is part of GDB. - + 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 + the Free Software Foundation; either version 3 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. -*/ + along with this program. If not, see . */ + +/******************************************************************************/ +/* */ +/* Outline: */ +/* This module provides support for the ARC processor family's target */ +/* dependencies. In particular, it has knowledge of the processor ABI. */ +/* */ +/* See */ +/* ARCompact Instruction Set Architecture */ +/* Programmer's Reference */ +/* (5115-018) */ +/* */ +/* for a description of ARC processor architecture, and */ +/* */ +/* System V ABI Supplement */ +/* 4093-004 */ +/* */ +/* for a complete definition of the ABI. */ +/* */ +/* */ +/* Stack Frame Layout: */ +/* This shows the layout of the stack frame for the general case of a */ +/* function call; a given function might not have a variable number of */ +/* arguments or local variables, or might not save any registers, so it */ +/* would not have the corresponding frame areas. Additionally, a leaf */ +/* function (i.e. one which calls no other functions) does not need to */ +/* save the contents of the BLINK register (which holds its return */ +/* address), and a function might not have a frame pointer. */ +/* */ +/* N.B. the stack grows downward, so SP points below FP in memory; SP */ +/* always points to the last used word on the stack, not the first */ +/* one. */ +/* */ +/* | | | */ +/* | arg word N | | caller's */ +/* | : | | frame */ +/* | arg word 10 | | */ +/* | arg word 9 | | */ +/* old SP ---> |-----------------------| -- */ +/* | var arg word 8 | | */ +/* | : | | */ +/* | var arg word P+1 | | */ +/* |-----------------------| | */ +/* | | | */ +/* | callee-saved | | */ +/* | registers | | */ +/* | | | */ +/* |-----------------------| | */ +/* | saved blink (*) | | */ +/* |-----------------------| | callee's */ +/* | saved FP | | frame */ +/* FP ---> |-----------------------| | */ +/* | | | */ +/* | local | | */ +/* | variables | | */ +/* | | | */ +/* | register | | */ +/* | spill area | | */ +/* | | | */ +/* | outgoing args | | */ +/* | | | */ +/* SP ---> |-----------------------| -- */ +/* | | */ +/* | unused | */ +/* | | */ +/* | */ +/* | */ +/* V */ +/* downwards */ +/* */ +/* The list of arguments to be passed to a function is considered to be a */ +/* sequence of N words (as though all the parameters were stored in order */ +/* in memory with each parameter occupying an integral number of words). */ +/* Words 1 .. 8 are passed in registers 0 .. 7; if the function has more */ +/* than 8 words of arguments then words 9 .. N are passed on the stack in */ +/* the caller's frame. */ +/* */ +/* If the function has a variable number of arguments, e.g. it has a form */ +/* such as */ +/* function(p1, p2, ...); */ +/* */ +/* and P words are required to hold the values of the named parameters */ +/* (which are passed in registers 0 .. P-1), then the remaining 8 - P */ +/* words passed in registers P .. 7 are spilled into the top of the frame */ +/* so that the anonymous parameter words occupy a continous region. */ +/* */ +/* (*) if saved. */ +/* */ +/* Usage: */ +/* The module exports a function _initialize_arc_tdep: the call to this */ +/* function is generated by the gdb build mechanism, so this function */ +/* should not be explicitly called. */ +/* */ +/* The operations provided by this module are registered with gdb during */ +/* initialization; gdb then calls them via function pointers, rather than */ +/* by name (this allows gdb to handle multiple target architectures): */ +/* */ +/* set_gdbarch_XXX (gdbarch, ); */ +/* */ +/* */ +/* Build Configuration: */ +/* The ARC gdb may be built in two different configurations, according to */ +/* the nature of the target that it is to debug: */ +/* */ +/* 1) arc-elf32: */ +/* for debugging 'bare-metal' builds of user code (i.e. built with */ +/* newlib) */ +/* */ +/* ARC-specific modules: */ +/* arc-tdep */ +/* arc-elf32-tdep */ +/* arc-xiss */ +/* arc-jtag */ +/* arc-jtag-ops */ +/* arc-jtag-actionpoints */ +/* arc-gpio */ +/* arc-remote-fileio */ +/* arc-registers */ +/* arc-architecture */ +/* arc-board */ +/* arc-arguments */ +/* arc-memory */ +/* arc-inst-tracing */ +/* */ +/* 2) arc-linux-uclibc: */ +/* for deugging user mode Linux applications, via communication to */ +/* the remote gdbserver process, running on Linux for ARC700 */ +/* */ +/* ARC-specific modules: */ +/* arc-tdep */ +/* arc-linux-tdep */ +/* */ +/* This module provides operations which are common to both; operations */ +/* which are specific to one, or which have different variants in each */ +/* configuration, are provided by the other modules. */ +/* */ +/* */ +/* Debug Targets: */ +/* The ARC gdb supports a number of debug targets. These are: */ +/* */ +/* arc-elf32-gdb */ +/* built-in simulator 'target sim' */ +/* ARCangel 4 h/w emulator 'target arcjtag' */ +/* dynamically loaded xISS simulator 'target arcxiss' */ +/* separately executing xISS simulator 'target remote' */ +/* */ +/* arc-linux-uclibc-gdb */ +/* gdbserver running on ARC Linux 'target remote' */ +/* */ +/* It should, in theory, be possible for either debugger to connect to */ +/* any remote target which supports the gdb Remote Serial Protocol. */ +/* However, any such target MUST agree with the debugger on the register */ +/* numbering scheme that is used, as this controls the order of register */ +/* contents held in the RSP 'G' (set all registers) packet and the 'g' */ +/* (get all registers) response packet, as well as the register numbers */ +/* used in the 'P' (set one register) and 'p' (get one register) packets, */ +/* and in the 'T' stop reply packet. The schemes used by each debugger */ +/* are defined in the arc-elf32-tdep and arc-linux-tdep modules. */ +/* */ +/******************************************************************************/ + +/* system header files */ #include +#include +#include +#include +/* gdb header files */ #include "defs.h" +#include "config.h" #include "arch-utils.h" #include "dis-asm.h" -#include "gdbtypes.h" #include "frame.h" #include "frame-unwind.h" -#include "target.h" -#include "breakpoint.h" #include "inferior.h" #include "regcache.h" #include "reggroups.h" #include "trad-frame.h" #include "dwarf2-frame.h" -#include "gdbtypes.h" -#include "gdb_assert.h" #include "gdbcore.h" #include "observer.h" #include "osabi.h" +#include "gdbcmd.h" +#include "block.h" +#include "dictionary.h" +#include "language.h" +#include "demangle.h" +#include "objfiles.h" +#include "gdb_assert.h" -#include "opcode/arc.h" - -#include "arc-tdep.h" - +/* ARC header files */ -//#define ARC_DEBUG 1 +/* N.B. one and only one of ARC_ELF32_TARGET and ARC_LINUX_TARGET must be defined! */ -#if ARC_DEBUG -# define ENTERMSG printf ("--- entered %s:%s()\n", __FILE__, __FUNCTION__) -# define ENTERARGS(fmt, args...) printf ("--- entered %s:%s(" fmt ")\n", __FILE__, __FUNCTION__, args) -# define LEAVEMSG printf ("--- exited %s:%s()\n", __FILE__, __FUNCTION__) +#ifdef ARC_ELF32_TARGET +#ifdef ARC_LINUX_TARGET +#error ARC build is not correctly configured (both flags set) +#else +#include "config/arc/tm-embed.h" +#endif #else -# define ENTERMSG -# define ENTERARGS(fmt, args...) -# define LEAVEMSG +#ifdef ARC_LINUX_TARGET +#include "config/arc/tm-linux.h" +#else +#error ARC build is not correctly configured (no flag set) +#endif #endif -#define ARC_STATUS32_A1 0x8 -#define ARC_STATUS32_A2 0x10 -#define ARC_STATUS32_AE 0x20 -#define ARC_STATUS32_L 0x100 +#include "opcode/arc.h" +#include "opcodes/arc-dis.h" +#include "opcodes/arc-ext.h" +#include "opcodes/arcompact-dis.h" +#include "arc-support.h" +#include "arc-tdep.h" -static CORE_ADDR arc_frame_align (struct gdbarch *gdbarch, CORE_ADDR sp); -/* The frame unwind cache for the ARC - */ +/* -------------------------------------------------------------------------- */ +/* local types */ +/* -------------------------------------------------------------------------- */ -struct arc_unwind_cache +typedef struct { - /* blink offset in stack */ - int blink_offset ; + const char *name; + CORE_ADDR address; + Boolean is_argument; + Boolean is_callee; + Boolean is_array; + unsigned int size; + unsigned int element_size; +} LocalVariable; - /* Caller's PC */ - CORE_ADDR prev_pc; - - /* The stack pointer at the time this frame was created; i.e. the - caller's stack pointer when this function was called. It is used - to identify this frame. */ - - CORE_ADDR prev_sp; - /* The frame base */ - CORE_ADDR frame_base; - /* Frame size */ - int framesize; - - /* offset of sp from the stack frame base */ - LONGEST sp_offset; - /* offset of fp from the stack frame base */ - LONGEST fp_offset; - /* Is this a leaf function */ - int is_leaf ; - /* Is there a frame pointer */ - int uses_fp; - - - /* Offsets for each register in the stack frame */ - struct trad_frame_saved_reg *saved_regs; -}; +/* The frame unwind cache for the ARC. */ +typedef struct +{ + /* BLINK save location offset from previous SP (-ve value). */ + int blink_save_offset_from_prev_sp; + /* The stack pointer at the time this frame was created; i.e. the + caller's stack pointer when this function was called. It is used + to identify this frame. */ + CORE_ADDR prev_sp; + /* The frame base (as held in FP). + N.B. this is NOT the address of the lowest word in the frame! */ + CORE_ADDR frame_base; -/* Function Prototypes */ + /* Change in SP from previous SP (-ve value) - this is computed by scanning + the prologue of the function: initially 0, it is updated for each + instruction which changes SP (either explicitly by a subtraction from SP + or implicitly by a push operation), so at each point in the prologue it + gives the difference between the previous SP (i.e. before the function + was called) and the current SP at that point; at the end of the prologue + it holds the total change in SP, i.e. the size of the frame. */ + LONGEST delta_sp; -static CORE_ADDR arc_unwind_sp (struct gdbarch *gdbarch, - struct frame_info *next_frame); + /* Offset of old stack pointer from frame base (+ve value). */ + LONGEST old_sp_offset_from_fp; -static CORE_ADDR arc_unwind_pc (struct gdbarch *gdbarch, - struct frame_info *next_frame); + /* Is this a leaf function? */ + Boolean is_leaf; + /* Is there a frame pointer? */ + Boolean uses_fp; -static struct arc_unwind_cache * arc_frame_unwind_cache (struct frame_info *next_frame, - void ** this_prologue); + /* Offsets for each register in the stack frame. */ + struct trad_frame_saved_reg *saved_regs; + unsigned int saved_regs_mask; +} UnwindCache; -static CORE_ADDR arc_scan_prologue (CORE_ADDR pc, - struct frame_info *next_frame, - struct arc_unwind_cache *info); +/* -------------------------------------------------------------------------- */ +/* local data */ +/* -------------------------------------------------------------------------- */ -static int arc_binutils_reg_to_regnum (int reg); +#define DEBUG_COMMAND "arc-debug" +#define SHOW_FRAME_COMMAND "arc-show-frame" +#define SHOW_FRAME_COMMAND_USAGE "Usage: " SHOW_FRAME_COMMAND " [ ]\n" -extern struct arcDisState arcAnalyzeInstr ( bfd_vma address,disassemble_info* info ); -extern struct arcDisState a4AnalyzeInstr ( bfd_vma address,disassemble_info* info ); +#define NEW_LINE _("\n") -/* defined in opcodes, but there's no header file with this prototype... */ -disassembler_ftype arcompact_get_disassembler (void *); -/* Standard register type for the ARC platform . - * It would be builtin_type_uint32 until - * we consider the DSP extensions - */ +/* -------------------------------------------------------------------------- */ +/* externally visible data */ +/* -------------------------------------------------------------------------- */ -static struct type * -arc_register_type (struct gdbarch *gdbarch, int regnum) -{ - return builtin_type_uint32; -} +/* Global debug flag. */ +Boolean arc_debug_target; -void printFrameInfo(struct arc_unwind_cache * info) -{ -#ifdef ARC_DEBUG - printf("-------------------\n"); - printf("%lx \n",info ); - printf("prev_sp = %lx \n",info->prev_sp); - printf("prev_pc = %lx \n",info->prev_pc); - printf("frame_base is %lx \n",info->frame_base); - printf("framesize is %lx \n",info->framesize); - printf("Blink offset %lx \n",info->blink_offset); - printf("sp_offset = %lx \n",info->sp_offset ); - printf("fp_offset is %lx \n",info->fp_offset); - printf("is_leaf = %d, uses_fp=%d",info->is_leaf, info->uses_fp); -#endif -} +/* -------------------------------------------------------------------------- */ +/* local macros */ +/* -------------------------------------------------------------------------- */ -/* Print the instruction state returned - by the disassembler . Used for internal - debugging only -*/ +#define WORD_ALIGNED(addr) ((addr) & ~(BYTES_IN_WORD - 1)) +#define WORDS_OCCUPIED(bytes) (((bytes) + BYTES_IN_WORD - 1) / BYTES_IN_WORD) +#define ROUND_UP_TO_WORDS(bytes) (WORDS_OCCUPIED(bytes) * BYTES_IN_WORD) -void printInsnState(struct arcDisState state) -{ -#ifdef ARC_DEBUG - printf("---------------------------------\n"); - printf("Instruction Length %d\n", state.instructionLen); - printf("Opcode [0x%x] : Cond [%x]\n", state._opcode, state._cond); - printf("Words 1 [%lx] : 2 [%lx]\n", state.words[0], state.words[1]); - printf("ea present [%x] : memload [%x]\n", state._ea_present, state._mem_load); - printf("Load length [%d]:\n", state._load_len); - printf("Address writeback [%d]\n", state._addrWriteBack); - printf("ea reg1 is [%x] offset [%x] \n", state.ea_reg1, state._offset); - printf("ea reg2 is [%x] \n", state.ea_reg2); - printf("operands buffer is %s \n", state.operandBuffer); - printf("SourceType is %d \n",state.sourceType); - printf("Flow is %d\n",state.flow); - printf("Branch is %d,'%c'\n",state.isBranch, state.isBranch); -#endif -} -/* Scan the prologue and update the - * corresponding frame cache for the frame unwinder for unwinding - * frames without debug info . In such a situation GDB attempts to - * parse the prologue for this purpose . This currently would attempt - * to parse the prologue generated by our gcc 2.95 .(We should support - * Metaware generated binaries at some suitable point of time ) - * This function is called with the pc where gdb stopped , the next_frame - * to be filled in (if need be?) and the existing cached info . - - * scan_prologue is called by our unwinder as well - * as from skip_prologue in the case that it cannot detect - * the end of the prologue. next_frame is set to NULL if we are called from - * arc_skip_prologue in an attempt to discover the end of the prologue. In - * such a case we don't fill the frame info that is passed to us :-) - - * Todos. - * 1. Support 32 bit normal frames generated by GCC 2.95 . - * 2. Support 16 and 32 bit mixed frames generated by GCC 2.95 - * 3. Support 32 bit normal variadic function frames by GCC 2.95 - * 4. Support 32 bit normal frames from GCC 3.4.x with variadic args - * 5. Support 16 and 32 bit normal frames from GCC 3.4.x with variadic args - * 6. Support 16 and 32 bit mixed frames generated by GCC 3.4.x - * 7. Support Metaware generated prologues .( The difference is - * in the use of thunks to identify the saving and restoring of - * callee saves :-) May have to do some hackery even in next_pc. - * since the call is going to create its own set of problems - * with our stack setup :-( - * We attempt to use the disassembler interface from the opcodes - * library to do our disassembling . - - * The usual 32 bit normal - * gcc -O0 prologue looks like this. - - * Complete Prologue for all GCC frames (Cases #1 to #6 in Todos above) - - * sub sp, sp, limm ; space for variadic arguments. - * st.a blink, [sp,-4] ; push blink (if not a leaf function) - * sub sp, sp , limm ; (optional space creation for callee saves ) - * st r13, [sp] ; pushes of all callee saves. - * st r14, [sp,4] ; pushes of more callee saves. - * XXXX - * st.a fp , [sp,-4] ; push fp (if fp has to be saved ) - * mov fp , sp ; Set the current frame up correctly - * sub sp , sp , #immediate ; Create space for local vars on the stack. - */ +/* Macros to be used with disassembling the prologue and update the frame info. + The *FI macros are to update the frame info and the ACT macros are to + actually do the action on a corresponding match. */ +#define IS_INSTRUCTION(insn_name, search_string) !strcmp(insn_name, search_string) +#define CHECK_OPERAND_STRING_AND_ACT(target_check, search_string, action) \ + if (strstr(target_check, search_string) == target_check) \ + { \ + action; \ + return TRUE; \ + } -/* Macros to be used with disassembling the prologue - * and update the frame info.The *FI macros are to update - * the frame info and the ACT macros are to actually do the - * action on a corresponding match. - * -*/ -#define CHECKOPDSTRING(targetcheck,searchstring) \ - if(strstr(targetcheck,searchstring) == targetcheck) \ - {continue;} - -#define CHECKOPDSTRINGANDACT(targetcheck,searchstring,action) \ - if(strstr(targetcheck,searchstring) == targetcheck) \ - {\ - action;\ - continue;} - - -/* The frame info changes by changing the decrementing - the sp_offset and setting the leaf function to be NIL; - Also the offset of the blink register from the previous - value of sp is calculated. Finally this can be updated - as - info->blink_offset = info-> prev_sp + info->blink_offset ; - Also the addition below is coz the offsets are usually negative -*/ -#define PUSHBLINKACT do { \ - if(info) \ - { \ - info->sp_offset += current_instr._offset; \ - info->blink_offset = info->sp_offset ; \ - info->is_leaf = 0;\ - }}while(0); - +/* The frame info changes by changing the decrementing the delta_sp and setting + the leaf function flag to be False (if this function prologue is saving blink + then it must be going to call another function - so it can not be a leaf!); + also the offset of the blink register save location from the previous value + of sp is recorded. This will eventually used to compute the address of the + save location: -#define ISPUSHBLINK(state) CHECKOPDSTRING(state.operandBuffer,"blink") -#define ISPUSHBLINKFI(state) CHECKOPDSTRINGANDACT(state.operandBuffer,"blink",PUSHBLINKACT) + = + + The addition (+=) below is because the sp offset and the instruction offset + are negative - so incrementing the sp offset by the instruction offset is + actually making the sp offset more negative, correctly reflecting that SP + is moving further down the downwards-growing stack. */ -#define PUSHFPACT do { \ - if(info) \ - { \ - info->sp_offset += current_instr._offset ; \ - info->fp_offset = -info->sp_offset; \ - }}while(0); - -#define ISPUSHFP(state) CHECKOPDSTRING(state.operandBuffer,"fp") -#define ISPUSHFPFI(state) CHECKOPDSTRINGANDACT(state.operandBuffer,"fp",PUSHFPACT) -#define ISINSTRUCTION(insnname,searchstring) !strcmp(insnname,searchstring) +#define PUSH_BLINK(offset) \ + { \ + info->delta_sp += offset; \ + info->blink_save_offset_from_prev_sp = (int) info->delta_sp; \ + info->is_leaf = FALSE; \ + } +#define PUSH_BLINK_ACT \ + do { \ + if (info) PUSH_BLINK(instr->_offset) \ + } while (0); -#define UPDATEFPACT do {\ - if(info) {\ - info->uses_fp = 1;\ - }}while(0); +#define IS_PUSH_BLINK_FI(state) CHECK_OPERAND_STRING_AND_ACT(state->operandBuffer, "blink", PUSH_BLINK_ACT) +/* At the point that that FP is pushed onto the stack (so saving the dynamic + link chain pointer to the previous frame), at the address that will be the + base of the new frame, we know the offset of SP from the previous SP - so the + offset of the old SP from the new frame base is known (the -ve delta_sp is + negated to give the +ve old_sp_offset_from_fp). */ +#define PUSH_FP_ACT do { \ + if (info) \ + { \ + info->delta_sp += instr->_offset; \ + info->old_sp_offset_from_fp = -info->delta_sp; \ + }} while (0); -#define ISUPDATEFPFI(state) \ - if(ISINSTRUCTION(state.instrBuffer,"mov")) \ -{ \ - CHECKOPDSTRINGANDACT(state.operandBuffer,"fp,sp",UPDATEFPACT); \ -} +#define IS_PUSH_FP_FI(state) CHECK_OPERAND_STRING_AND_ACT(state->operandBuffer, "fp", PUSH_FP_ACT) +#define UPDATE_FP_ACT do { \ + if (info) \ + info->uses_fp = TRUE; \ + } while (0); -#define ISUPDATEFP(state) \ - if(ISINSTRUCTION(state.instrBuffer,"mov")) \ -{ \ - CHECKOPDSTRING(state.operandBuffer,"fp,sp") \ -} +#define IS_UPDATE_FP_FI(state) \ + if (IS_INSTRUCTION(state->instrBuffer, "mov")) \ + { \ + CHECK_OPERAND_STRING_AND_ACT(state->operandBuffer, "fp,sp", UPDATE_FP_ACT); \ + } +#define UPDATE_STACK_SPACE(state) do { \ + if (info) { \ + /* Eat up sp,sp. */ \ + int immediate = atoi(state->operandBuffer + 6); \ + info->delta_sp -= immediate; \ + }} while (0); -#define ISSUBSP(state) \ -if(ISINSTRUCTION(state.instrBuffer,"sub"))\ -{ \ - CHECKOPDSTRING(state.operandBuffer,"sp,sp") \ -} -#define UPDATESTACKSPACE(state) do { \ - if(info){ \ -/* Eat up sp,sp */ \ - int tmp = atoi(state.operandBuffer + 6); \ - info->sp_offset -= tmp; \ - }}while(0); +#define IS_SUB_SP_FI(state) \ + if (IS_INSTRUCTION(state->instrBuffer, "sub") || \ + IS_INSTRUCTION(state->instrBuffer, "sub_s")) \ + { \ + CHECK_OPERAND_STRING_AND_ACT(state->operandBuffer, "sp,sp", UPDATE_STACK_SPACE(state)) \ + } -#define ISSUBSPFI(state) \ -if(ISINSTRUCTION(state.instrBuffer,"sub") \ - || ISINSTRUCTION(state.instrBuffer,"sub_s"))\ -{ \ - CHECKOPDSTRINGANDACT(state.operandBuffer,"sp,sp",UPDATESTACKSPACE(state)) \ -} +/* -------------------------------------------------------------------------- */ +/* forward declarations */ +/* -------------------------------------------------------------------------- */ -/*Function to scan the prologue of a A4 binary - -ARCtangent-A4 Prolog - The stack back-trace data structure is a 16-byte structure which is - used to save the return register (blink, 4 bytes), the frame pointer - register (fp, 4-bytes) and 8-bytes is reserved. - - The compiler-generated prolog code does the following: - --> Allocates space for register arguments in case of variadic function - (functions with variable argument lists) - --> Saves the return address register (blink) - --> Saves the caller's frame pointer (fp), if required, and - sets the new frame pointer to this location - --> Decrements the stack pointer to account for the new stack frame - --> Saves required non-volatile general-purpose registers into the - register save area - --> Stores the arguments above the stack back-trace data structure - - - Demo Patterns: - st blink,[sp,4] ; Saves the return address - st fp,[sp] ; Saves the callers frame pointer - mov fp,sp ; Saves - sub sp,sp,24 - -0xa 538e7e20 sub sp,sp,32 ; Space for variadic args -0x2 100e3e04 st blink,[sp,4] ; Saves the return address -0x2 100e3600 st fp,[sp] ; Saves the callers frame pointer -0xc 636e3800 mov fp,sp ; Resets stack pointer to fp -0xa 538e7e18 sub sp,sp,24 ; Decrements sp to add for new - ; stack frame -0x2 100d81fc st r0,[fp,-4] ; Stores the args -0x2 100d83f8 st r1,[fp,-8] ; ----"------- - ... +static CORE_ADDR scan_prologue (CORE_ADDR entrypoint, + struct frame_info *next_frame, + UnwindCache *info); -*/ -/* FIXMEA: -called from arc_skip_prologue as - skip_pc = arc_scan_prologue(pc,NULL,NULL); - Then it is supposed to return the first valid pc - after the prologue +/* -------------------------------------------------------------------------- */ +/* local debug functions */ +/* -------------------------------------------------------------------------- */ - Prologue analysis does the rest... - Currently our scan prologue does not - support getting input for the frame unwinder +/* Print information for a frame. */ - - pc = frame_func_unwind(next_frame); - arc_scan_prologue (pc, next_frame, info); +static void +printFrameInfo (const char *message, + UnwindCache *info, + Boolean addresses_known) +{ + unsigned int i; + + DEBUG("-------------------\n"); + DEBUG("%s (info = %p)\n", message, info); + DEBUG("prev_sp = %lx\n", (long unsigned int) info->prev_sp); + DEBUG("frame_base = %lx\n", (long unsigned int) info->frame_base); + DEBUG("blink offset = %d\n", info->blink_save_offset_from_prev_sp); + DEBUG("delta_sp = %d\n", (int) info->delta_sp); + DEBUG("old_sp_offset_from_fp = %d\n", (int) info->old_sp_offset_from_fp); + DEBUG("is_leaf = %d, uses_fp = %d\n", info->is_leaf, info->uses_fp); + + for (i = ARC_ABI_FIRST_CALLEE_SAVED_REGISTER; i < ARC_ABI_LAST_CALLEE_SAVED_REGISTER; i++) + { + if (info->saved_regs_mask & (1 << i)) + DEBUG("saved register R%02d %s 0x%lx\n", + i, + (addresses_known) ? "address" : "offset", + (unsigned long) info->saved_regs[i].addr); + } + DEBUG("-------------------\n"); +} -*/ -#ifdef ARC4_JTAG -static CORE_ADDR -a4_scan_prologue (CORE_ADDR pc, struct frame_info *next_frame, - struct arc_unwind_cache *info) +static const char* +ARC_Debugger_OperandType_Image (enum ARC_Debugger_OperandType value) { - /* End of prologue */ - CORE_ADDR prologue_ends_pc = pc; - int i = 0; - struct arcDisState current_instr, instr_in_delay; - int insn_length; - - /* Initializations to use the opcodes - * library . - */ - - struct disassemble_info di; - - unsigned int saved_regs_mask = 0; - /* An arbitrary length on the length of the - prologue. If next_frame is NULL this means that there was - no debug info and we are called from arc_skip_prologue - */ - /*FIXMEANOW: pc + 64 is probably the max size of the prologue*/ - CORE_ADDR final_pc = (next_frame)?frame_pc_unwind(next_frame):pc+(16*4); - - - - - if (info) + switch (value) { - /* All functions start as leaf functions until - we identify push blink - */ - info->is_leaf = 1; + case ARC_LIMM : return "LIMM"; + case ARC_SHIMM : return "SHIMM"; + case ARC_REGISTER : return "REGISTER"; + case ARCOMPACT_REGISTER: return "COMPACT REGISTER"; + case ARC_UNDEFINED : return "UNDEFINED"; } - - - - /* Initializations to use the opcodes - * library . - */ - init_disassemble_info(&di, gdb_stderr, fprintf_unfiltered); - di.arch = gdbarch_bfd_arch_info(current_gdbarch)->arch; - di.mach = gdbarch_bfd_arch_info(current_gdbarch)->mach; - di.endian = gdbarch_byte_order(current_gdbarch); - di.read_memory_func = target_read_memory; - - - for (prologue_ends_pc= pc; - prologue_ends_pc< final_pc; - prologue_ends_pc += current_instr.instructionLen ) /*FIXMEA: This could as - well be 4 */ - { - current_instr = a4AnalyzeInstr(prologue_ends_pc, &di); - printInsnState(current_instr); -#ifdef ARC_DEBUG - printf("Prologue PC: %d\n", prologue_ends_pc); - printf("Final PC: %d\n", final_pc); -#endif + return "?"; +} - if (current_instr._opcode == 0x2) - { - // Saves the return address st blink,[sp,4] 0x100e3e04 - // Save the callers fp st fp,[sp] 0x100e3600 - // Saves the args st rX,[fp, #imm] 0x100d8xxx - if (current_instr.ea_reg1 == 28) - { - if( strstr(current_instr.operandBuffer,"blink") == current_instr.operandBuffer) - { - if(info) - { - info->sp_offset += current_instr._offset; - // info->blink_offset = info->sp_offset ; - info->blink_offset = current_instr._offset; - info->is_leaf = 0; - -#ifdef ARC_DEBUG - printf("Blink instruction:\n"); - printFrameInfo(info); -#endif - } - continue; - } - else - if(strstr(current_instr.operandBuffer,"fp") == current_instr.operandBuffer) - { - if(info) - { -/* info->sp_offset += current_instr._offset ; */ -/* info->fp_offset = info->sp_offset; */ - info->fp_offset = 0; - } - continue; - } - } - else if (current_instr.ea_reg1 == 27) - { - /* Saving of arguments onto the stack using the - frame pointer (r27). */ - if(info) - { - // Save regs offsets - } -#ifdef ARC_DEBUG - printf(" Saving registers onto stack\n%s\n",current_instr.operandBuffer); -#endif - continue; - } - // ISPUSHBLINK(current_instr); - } - else if (current_instr._opcode == 0xc) - { - // Resets stack pointer to fp - // 0x636e3800 - // 636e3800 mov fp,sp - if (current_instr.words[0] == 0x636e3800) - { - if (info) - { - info->uses_fp = 1; - } - continue; - } - } - else if (current_instr._opcode == 0xa) - { - // Decrements stackpointer to add for new stack frame - // 0x538e7e18 sub sp,sp,#imm - // 538e7e20 sub sp,sp,32 - if( current_instr.words[0] == 0x538e7e20) - { - //sub sp,sp, 32 //// variadic - if (info) - { - int tmp = atoi(current_instr.operandBuffer + 6); - info->sp_offset -= tmp; - } - continue; - } - else if((current_instr.words[0] & 0xffffff00) == 0x538e7e00) - { - // sub sp,sp,xx - if(info) - { - int tmp = atoi(current_instr.operandBuffer + 6); - info->sp_offset -= tmp; - } - continue; - } - } - - /* Found a instruction that is not in - the prologue*/ -#ifdef ARC_DEBUG - printf("End of Prologue reached \n"); -#endif - break; - } +/* Print the instruction state returned by the disassembler. + Used for internal debugging only. */ - /* Means we were called from skip_prologue */ - if((next_frame == NULL)&& (info == NULL)) - { - return prologue_ends_pc; - } +static void +printInsnState (struct arcDisState state) +{ + DEBUG("---------------------------------\n"); + DEBUG("Instruction Length %d\n", state.instructionLen); + DEBUG("Opcode [0x%x] : Cond [%x]\n", state._opcode, state._cond); + DEBUG("Words 1 [%lx] : 2 [%lx]\n", state.words[0], state.words[1]); + DEBUG("Ea present [%x] : memload [%x]\n", state._ea_present, state._mem_load); + DEBUG("Load Length [%d]:\n", state._load_len); + DEBUG("Address Writeback [%d]\n", state._addrWriteBack); + DEBUG("EA reg1 is [%x] offset [%x]\n", state.ea_reg1, state._offset); + DEBUG("EA reg2 is [%x]\n", state.ea_reg2); + DEBUG("Instr buffer is %s\n", state.instrBuffer); + DEBUG("Operand buffer is %s\n", state.operandBuffer); + DEBUG("SourceType is %s\n", ARC_Debugger_OperandType_Image(state.sourceType)); + DEBUG("Source operand is %u\n", state.source_operand.registerNum); /* All fields of the union have same type. */ + DEBUG("Flow is %d\n", state.flow); + DEBUG("Branch is %d\n", state.isBranch); + DEBUG("---------------------------------\n"); +} - info->framesize = -info->sp_offset; - /* Compute the previous frame's stack pointer (which is also the - frame's ID's stack address), and this frame's base pointer. */ - if(info->uses_fp) - { +/* -------------------------------------------------------------------------- */ +/* local functions for the disassembler */ +/* -------------------------------------------------------------------------- */ - ULONGEST this_base; - /* The SP was moved to the FP. This indicates that a new frame - was created. Get THIS frame's FP value by unwinding it from - the next frame. */ - frame_unwind_unsigned_register(next_frame, ARC_FP_REGNUM, - &this_base); - info->frame_base = this_base; - info->saved_regs[ARC_FP_REGNUM].addr = info->frame_base; - - /* The previous sp is the current frame base + the offset of the - fp in the current frame */ - info->prev_sp = info->frame_base + info->fp_offset; - for(i = 13; i < 26 ; i++ ) - { - if(saved_regs_mask & (1 << i)) - info->saved_regs[i].addr += info->frame_base ; - } - - printFrameInfo(info); - - } - else +/* Wrapper for the target_read_memory function. */ + +static int +read_memory_for_disassembler (bfd_vma memaddr, + bfd_byte *myaddr, + unsigned int length, + struct disassemble_info *info) // unused +{ + return target_read_memory((CORE_ADDR) memaddr, (gdb_byte*) myaddr, (int) length); +} + + +/* This is a callback function which gets called by gdb whenever the current + object file changes. */ + +static void +set_disassembler (struct objfile *objfile) +{ + if (objfile) { - ULONGEST this_base; - /* Assume that the FP is this frame's SP but with that pushed - stack space added back. */ - frame_unwind_unsigned_register (next_frame, ARC_SP_REGNUM, &this_base); - info->frame_base = this_base; - - /* In such a case it would be the previous SP + the size of the current frame */ - info->prev_sp = info->frame_base + info->framesize; - + /* The ARC libopcodes wants obfd so that it can find out what CPU + extensions are defined in the file. */ + set_gdbarch_print_insn(current_gdbarch, arcompact_get_disassembler(objfile->obfd)); +// dump_ARC_extmap(); } - +} - if(!info->is_leaf) - { - /* Usually blink is saved before the callee save registers and - below the space created for variadic arguments . We maintain - info->blink_offset as negative when we stored it initially - */ - info->saved_regs[ARC_BLINK_REGNUM].addr = info->prev_sp + info->blink_offset; -#ifdef ARC_DEBUG - printf("blink offset is [%x] \n",info->blink_offset); -#endif - } - - /* The PC is found in blink (the actual register or located on the stack). */ - // FIXMEA: - //info->saved_regs[ARC_STATUS_REGNUM] |= (info->saved_regs[ARC_BLINK_REGNUM] & 0xffffff)>>2; - info->saved_regs[ARC_STATUS_REGNUM] = info->saved_regs[ARC_BLINK_REGNUM]; - return prologue_ends_pc; +/* This function is supplied to gdb as the disassembler until such time as we do + have a disassembler available. */ +static int +dummy_disassembler (bfd_vma address, disassemble_info *info) +{ + error(_("No disassembly operation yet available (no executable file loaded)")); + return 0; } -#endif -static CORE_ADDR -arc_scan_prologue (CORE_ADDR pc, struct frame_info *next_frame, - struct arc_unwind_cache *info) + +/* -------------------------------------------------------------------------- */ +/* local functions for decoding call chains */ +/* -------------------------------------------------------------------------- */ + +/* Simple utility function to create a new frame cache structure. */ + +static UnwindCache* +create_cache (struct frame_info *next_frame) { -#ifdef ARC4_JTAG -#ifdef ARC_DEBUG - printf("\narc_scan_prologue called\n"); -#endif -#else - /* End of prologue */ - CORE_ADDR prologue_ends_pc = pc; - int i = 0; - struct arcDisState current_instr, instr_in_delay; - int insn_length; - - /* Initializations to use the opcodes - * library . - */ - - struct disassemble_info di; - - unsigned int saved_regs_mask = 0; - /* An arbitrary length on the length of the - prologue. If next_frame is NULL this means that there was - no debug info and we are called from arc_skip_prologue - */ - CORE_ADDR final_pc = (next_frame)?frame_pc_unwind(next_frame):pc+64; - - - - - if (info) - { - /* All functions start as leaf functions until - we identify push blink - */ - info->is_leaf = 1; - - } - - - - /* Initializations to use the opcodes - * library . - */ - init_disassemble_info(&di, gdb_stderr, fprintf_unfiltered); - di.arch = gdbarch_bfd_arch_info(current_gdbarch)->arch; - di.mach = gdbarch_bfd_arch_info(current_gdbarch)->mach; - di.endian = gdbarch_byte_order(current_gdbarch); - di.read_memory_func = target_read_memory; - - - for(prologue_ends_pc= pc; prologue_ends_pc< final_pc; - prologue_ends_pc += current_instr.instructionLen ) - { - current_instr = arcAnalyzeInstr(prologue_ends_pc, &di); - printInsnState(current_instr); - /* Might be a push or a pop */ - if(current_instr._opcode == 0x3) - { - if(current_instr._addrWriteBack) - { - /* This is a st.a */ - if((current_instr.ea_reg1 == 28) && - (current_instr._offset == -4)) - { - - /* This is a push something at sp */ - /* Is it a push of the blink */ - ISPUSHBLINKFI(current_instr); - /* Is it a push for fp */ - ISPUSHFPFI(current_instr); - - } - - } - else - { - /* Is this a store of some register onto - the stack using the stack pointer.*/ - if(current_instr.ea_reg1 == 28) - { - if(current_instr.sourceType == ARC_REGISTER ) - { - /* R13..R26 are the callee saved registers. [R27 (fp) - is also a callee saved register, but it's usually - pushed using st.a and so handled in the st.a case - above.] */ - if((current_instr.source_operand.registerNum > 12 - && current_instr.source_operand.registerNum <= 26)) - { - if(info) - { - printFrameInfo(info); - /* Save up the offsets for the correct instruction */ - info->saved_regs[current_instr.source_operand.registerNum].addr - = - info->sp_offset - current_instr._offset; - saved_regs_mask |= (1 << current_instr.source_operand.registerNum); - } - continue; - } - - } - - } - /* Is this the store of some register on the - stack using the frame pointer. We check - for argument registers getting saved and - restored. - */ - if(current_instr.ea_reg1 == 27) - if((current_instr.source_operand.registerNum <= 7)) - { - /* Saving argument registers.Don't save them in saved_regs, just skip. - */ - continue; - } - - - - } - } - - if(current_instr._opcode == 0x4) - { - /* A major opcode 0x4 instruction */ - /* We are usually interested in a - mov or a sub */ - ISUPDATEFPFI(current_instr); - ISSUBSPFI(current_instr); - } - if(current_instr._opcode == 0x18) - { - /* sub_s sp,sp,constant */ - ISSUBSPFI(current_instr); - /* push_s blink */ - if(strcmp(current_instr.instrBuffer,"push_s") == 0) - { - if(strcmp(current_instr.operandBuffer,"blink") == 0) - { - if(info) - { - info->sp_offset += 4; - info->blink_offset = info->sp_offset ; - info->is_leaf = 0; - } - continue; - } - } - } - - /* If we reach here . we have - * reached end of the prologue - */ - break; - - } - - /* Means we were called from skip_prologue */ - if((next_frame == NULL)&& (info == NULL)) - { - return prologue_ends_pc; - } - - - info->framesize = -info->sp_offset; - /* Compute the previous frame's stack pointer (which is also the - frame's ID's stack address), and this frame's base pointer. */ - if(info->uses_fp) + UnwindCache *cache = FRAME_OBSTACK_ZALLOC (UnwindCache); + + /* Zero all fields. */ + cache->blink_save_offset_from_prev_sp = 0; + cache->prev_sp = 0; + cache->frame_base = 0; + cache->delta_sp = 0; + cache->old_sp_offset_from_fp = 0; + cache->is_leaf = FALSE; + cache->uses_fp = FALSE; + + /* Allocate space for saved register info. */ + cache->saved_regs = trad_frame_alloc_saved_regs (next_frame); + + return cache; +} + + +/* Compute the previous frame's stack pointer (which is also the frame's ID's + stack address), and this frame's base pointer. */ + +static void +find_previous_stack_pointer (UnwindCache *info, + struct frame_info *next_frame) +{ + ENTERARGS("next_frame = %p", next_frame); + + /* If the frame has a frame pointer. */ + if (info->uses_fp) { + ULONGEST this_base; + unsigned int i; + + /* The SP was moved to the FP. This indicates that a new frame + was created. Get THIS frame's FP value by unwinding it from + the next frame. The old contents of FP were saved in the location + at the base of this frame, so this also gives us the address of + the FP save location. */ + this_base = frame_unwind_register_unsigned(next_frame, ARC_FP_REGNUM); + info->frame_base = (CORE_ADDR) this_base; + info->saved_regs[ARC_FP_REGNUM].addr = (long long) this_base; + + /* The previous SP is the current frame base + the difference between + that frame base and the previous SP. */ + info->prev_sp = info->frame_base + (CORE_ADDR) info->old_sp_offset_from_fp; + + for (i = ARC_ABI_FIRST_CALLEE_SAVED_REGISTER; i < ARC_ABI_LAST_CALLEE_SAVED_REGISTER; i++) + { + /* If this register has been saved, add the previous stack pointer + to the offset from the previous stack pointer at which the + register was saved, so giving the address at which it was saved. */ + if (info->saved_regs_mask & (1 << i)) + { + info->saved_regs[i].addr += info->prev_sp; + +#ifdef DUMP_SAVED_REGISTERS + /* This is a really useful debugging aid: we can debug a test + program which loads known values into the callee-saved + registers, then calls another function which uses those + registers (and hence must save them) then hits a breakpoint; + traversing the stack chain (e.g. with the 'where' command) + should then execute this code, and we should see those known + values being dumped, so showing that we have got the right + addresses for the save locations! */ + { + unsigned int contents; + + DEBUG("saved R%02d is at 0x%lx\n", i, (long unsigned int) info->saved_regs[i].addr); - ULONGEST this_base; - /* The SP was moved to the FP. This indicates that a new frame - was created. Get THIS frame's FP value by unwinding it from - the next frame. */ - frame_unwind_unsigned_register(next_frame, ARC_FP_REGNUM, - &this_base); - info->frame_base = this_base; - info->saved_regs[ARC_FP_REGNUM].addr = info->frame_base; - - /* The previous sp is the current frame base + the offset of the - fp in the current frame */ - info->prev_sp = info->frame_base + info->fp_offset; - for(i = 13; i < 26 ; i++ ) - { - if(saved_regs_mask & (1 << i)) - info->saved_regs[i].addr += info->frame_base ; - } - - printFrameInfo(info); - + if (target_read_memory((CORE_ADDR) info->saved_regs[i].addr, + (gdb_byte*) &contents, + BYTES_IN_REGISTER) == 0) + { + DEBUG("saved R%02d contents: 0x%0x\n", i, contents); + } + } +#endif + } + } } - else + else { - ULONGEST this_base; - /* Assume that the FP is this frame's SP but with that pushed - stack space added back. */ - frame_unwind_unsigned_register (next_frame, ARC_SP_REGNUM, &this_base); - info->frame_base = this_base; - - /* In such a case it would be the previous SP + the size of the current frame */ - info->prev_sp = info->frame_base + info->framesize; - + ULONGEST this_sp; + + /* Get the stack pointer for this frame by getting the saved SP + from the next frame. */ + this_sp = frame_unwind_register_unsigned (next_frame, ARC_SP_REGNUM); + + /* The previous SP is this frame's SP plus the known difference between + the previous SP and this frame's SP (the delta_sp is negated as it is + a negative quantity). */ + info->prev_sp = (CORE_ADDR) (this_sp + (ULONGEST) (-info->delta_sp)); + + /* Assume that the FP is this frame's SP. */ + info->frame_base = (CORE_ADDR) this_sp; } - - if(!info->is_leaf) + /* If the function owning this frame is not a leaf function. */ + if (!info->is_leaf) { + /* Usually blink is saved above the callee save registers and below the + space created for variable arguments. The quantity - /* Usually blink is saved before the callee save registers and - below the space created for variadic arguments . We maintain - info->blink_offset as negative when we stored it initially - */ - info->saved_regs[ARC_BLINK_REGNUM].addr = info->prev_sp + info->blink_offset; -#ifdef ARC_DEBUG - printf("blink offset is [%x] \n",info->blink_offset); -#endif + info->blink_save_offset_from_prev_sp + + is negative, so adding it to the the previous SP gives the address of + a location further down the stack from that SP. */ + info->saved_regs[ARC_BLINK_REGNUM].addr = + (LONGEST) (info->prev_sp + info->blink_save_offset_from_prev_sp); } - - /* The PC is found in blink (the actual register or located on the stack). */ - info->saved_regs[PC_REGNUM] = info->saved_regs[ARC_BLINK_REGNUM]; - /*info->saved_regs[ARC_PC_REGNUM] = info->saved_regs[ARC_BLINK_REGNUM];*/ - return prologue_ends_pc; -#endif } -/* Skip the prologue for the function at pc. - * This is done by checking from the line - * information picked up during dwarf reading - * FIXME: more stuff to be added when we - * parse the prologue. - */ +/* The workhorse : frame_unwind_cache for the ARC700 target. */ -static CORE_ADDR -arc_skip_prologue (CORE_ADDR pc) +static UnwindCache * +frame_unwind_cache (struct frame_info *next_frame, + void **this_prologue_cache) { - //#ifdef ARC4_JTAG -#ifdef ARC_DEBUG - printf ("\narc_skip_prologue called\n"); -#endif - // FIXMEA: cleanup #else - unsigned long inst; - unsigned long addend = 4; - CORE_ADDR skip_pc = pc; - CORE_ADDR func_addr, func_end = 0; - char *func_name; - struct symtab_and_line sal; + ENTERMSG; + + if ((*this_prologue_cache) == NULL) + { + CORE_ADDR entrypoint = frame_func_unwind(next_frame, NORMAL_FRAME); + UnwindCache *cache = create_cache(next_frame); + + /* Return the newly-created cache. */ + *this_prologue_cache = cache; + + /* Prologue analysis does the rest... */ + + /* Currently our scan prologue does not support getting input for the + frame unwinder. */ + (void) scan_prologue(entrypoint, next_frame, cache); + } + + return *this_prologue_cache; +} + - /* If we're in a dummy frame, don't even try to skip the prologue. */ - if (deprecated_pc_in_call_dummy (pc)) - return pc; +/* -------------------------------------------------------------------------- */ +/* local functions for decoding function prologues */ +/* -------------------------------------------------------------------------- */ - /* See what the symbol table says. */ +/* This function determines whether the given register, which is being saved + by a function prologue on the stack at a known offset from the current SP, + is a callee-saved register. If it is, the information in the frame unwind + cache is updated. */ - if (find_pc_partial_function (pc, &func_name, &func_addr, &func_end)) +static Boolean +is_callee_saved_register (unsigned int reg, + int offset, + UnwindCache * info) +{ + if (ARC_ABI_FIRST_CALLEE_SAVED_REGISTER <= reg && reg <= ARC_ABI_LAST_CALLEE_SAVED_REGISTER) { - struct symbol *sym; + DEBUG("register R%02u saved\n", reg); - /* Found a function. */ - sym = lookup_symbol (func_name, NULL, VAR_DOMAIN, NULL, NULL); - if (sym && SYMBOL_LANGUAGE (sym) != language_asm) + if (info) { - /* Don't use this trick for assembly source files. */ - sal = find_pc_line (func_addr, 0); - if ((sal.line != 0) && (sal.end < func_end)) - return sal.end; + /* We can not determine the address of the location in the stack + frame in which the register was saved, as we do not (yet) know + the frame or stack pointers for the frame; so the most we can do + is to record the offset from the old SP of that location, which + we can compute as we know the offset of SP from the old SP, and + the offset of the location from SP (which is the offset in the + store instruction). + + N.B. the stack grows downward, so the store offset is positive, + but the delta-SP is negative, so the save offset is also + negative. + + | | + old sp ------> |------------| + / | | \ + : | | : + : | | : -ve + : | | : save offset + : |------------| : + -ve : | save loc | / + delta sp : |------------| <--- store address + : / | | + : +ve : | | + : store : | | + : offset : | | + \ \ | | + sp' ---------> | | + | | + | | + |------------| <---- frame base + | | + | | + | | + | | | + | + V + downwards + + where sp' is the stack pointer at the current point in the code */ + + info->saved_regs[reg].addr = info->delta_sp + offset; + + /* We now know that this register has been saved, so set the + corresponding bit in the save mask. */ + info->saved_regs_mask |= (1 << reg); + + printFrameInfo("after callee register save", info, FALSE); + + return TRUE; } } - -#ifdef ARC4_JTAG - skip_pc = a4_scan_prologue(pc, NULL, NULL); -#else - skip_pc = arc_scan_prologue(pc,NULL,NULL); -#endif - return skip_pc; /* End of prologue */ - //#endif + return FALSE; } -/* Breakpoint from pc. Return whatever is in the tdep - * structure. The tdep structure is changed depending - * on the correct target / architecture chosen. - */ -static const unsigned char * -arc_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr) +/* This function determines whether the given disassembled instruction may be + part of a function prologue. If it is, the information in the frame unwind + cache may be updated. */ + +static Boolean +is_in_prologue (UnwindCache *info, struct arcDisState *instr) { + /* Might be a push or a pop */ + if (instr->_opcode == 0x3) + { + if (instr->_addrWriteBack != (char) 0) + { + /* This is a st.a instruction. */ + if (instr->ea_reg1 == ARC_ABI_STACK_POINTER) + { + if (instr->_offset == -4) + { + /* This is a push something at SP. */ + /* Is it a push of the blink? */ + IS_PUSH_BLINK_FI(instr); - struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch); - *lenptr = tdep->arc_breakpoint_size; - return tdep->arc_breakpoint_insn; -} + /* Is it a push for fp? */ + IS_PUSH_FP_FI(instr); + } + else + { + if (instr->sourceType == ARC_REGISTER ) + { + /* st.a , [sp,] */ + + if (is_callee_saved_register(instr->source_operand.registerNum, + instr->_offset, + info)) + { + /* This is a push onto the stack, so change delta_sp. */ + info->delta_sp += instr->_offset; + return TRUE; + } + } + } + } + } + else + { + if (instr->sourceType == ARC_REGISTER ) + { + /* Is this a store of some register onto the stack using the + stack pointer? */ + if (instr->ea_reg1 == ARC_ABI_STACK_POINTER) + { + /* st , [sp,offset] */ + if (is_callee_saved_register(instr->source_operand.registerNum, + instr->_offset, + info)) + /* This is NOT a push onto the stack, so do not change delta_sp. */ + return TRUE; + } -/* Assuming NEXT_FRAME->prev is a dummy, return the frame ID of that - dummy frame. The frame ID's base needs to match the TOS value - saved by save_dummy_frame_tos(), and the PC match the dummy frame's - breakpoint. */ + /* Is this the store of some register on the stack using the + frame pointer? We check for argument registers getting saved + and restored. */ + if (instr->ea_reg1 == ARC_ABI_FRAME_POINTER) + { + if (IS_ARGUMENT_REGISTER(instr->source_operand.registerNum)) + { + /* Saving argument registers. Don't set the bits in the + saved mask, just skip. */ + return TRUE; + } + } + } + } + } -static struct frame_id -arc_unwind_dummy_id (struct gdbarch *gdbarch, struct frame_info *next_frame) -{ - return frame_id_build (arc_unwind_sp (gdbarch, next_frame), - frame_pc_unwind (next_frame)); -} + else if (instr->_opcode == 0x4) + { + /* A major opcode 0x4 instruction. */ + /* We are usually interested in a mov or a sub. */ + IS_UPDATE_FP_FI(instr); + IS_SUB_SP_FI(instr); + } -/* The workhorse : frame_unwind_cache for the ARC700 platform . - */ -static struct arc_unwind_cache * -arc_frame_unwind_cache (struct frame_info *next_frame, - void **this_prologue_cache) -{ - //#ifdef ARC4_JTAG -#ifdef ARC_DEBUG - printf ("\narc_frame_unwind_cache called\n "); -#endif - //#else - CORE_ADDR pc; - struct arc_unwind_cache *info; - int i; - - - if ((*this_prologue_cache)) - return (*this_prologue_cache); - - info = FRAME_OBSTACK_ZALLOC (struct arc_unwind_cache); - (*this_prologue_cache) = info; - info->saved_regs = trad_frame_alloc_saved_regs (next_frame); - - /* Zero all fields. */ - info->blink_offset = 0; - info->prev_pc = 0; - info->prev_sp = 0; - info->frame_base = 0; - info->framesize = 0; - info->sp_offset = 0; - info->fp_offset = 0; - info->prev_pc = 0; - info->is_leaf = 0; - info->uses_fp = 0; - - /* Prologue analysis does the rest... */ - /* Currently our scan prologue does not - * support getting input for the frame unwinder - */ - - pc = frame_func_unwind(next_frame); -#ifdef ARC4_JTAG - a4_scan_prologue (pc, next_frame, info); -#else - arc_scan_prologue (pc, next_frame, info); -#endif + else if (instr->_opcode == 0x18) + { + /* sub_s sp,sp,constant */ + IS_SUB_SP_FI(instr); - return info; - //#endif -} + /* push_s blink */ + if (strcmp(instr->instrBuffer, "push_s") == 0) + { + if (strcmp(instr->operandBuffer, "blink") == 0) + { + if (info) + { + /* SP is decremented by the push_s instruction (before it + stores blink at the stack location addressed by SP). */ + PUSH_BLINK(-BYTES_IN_REGISTER) + } + return TRUE; + } + } + else if (strcmp(instr->instrBuffer, "st_s") == 0) + { + unsigned int reg; + int offset; + if (sscanf(instr->operandBuffer, "r%u,[sp,%d]", ®, &offset) == 2) + { + /* st_s ,[sp,] */ + if (is_callee_saved_register(reg, offset, info)) + /* This is NOT a push onto the stack, so do not change delta_sp. */ + return TRUE; + } + } + } -/* - * Construct frame id for the normal frame - */ + return FALSE; +} -static void -arc_frame_this_id (struct frame_info *next_frame, - void **this_prologue_cache, - struct frame_id *this_id) -{ - // FIXMEA: cleanup #ifdef ARC4_JTAG -#ifdef ARC_DEBUG - printf ("\n arc_frame_this_id called()\n "); -#endif - //#else - struct arc_unwind_cache *info - = arc_frame_unwind_cache (next_frame, this_prologue_cache); - CORE_ADDR base; - CORE_ADDR func; - struct frame_id id; +/* Scan the prologue and update the corresponding frame cache for the frame + unwinder for unwinding frames without debug info. In such a situation GDB + attempts to parse the prologue for this purpose. This currently would attempt + to parse the prologue generated by our gcc 2.95 compiler (we should support + Metaware generated binaries at some suitable point of time). - /* The FUNC is easy. */ - func = frame_func_unwind (next_frame); + This function is called with: + entrypoint : the address of the functon entry point + next_frame : the next frame to be filled in (if need be) + info : the existing cached info. - /* This is meant to halt the backtrace at the entry point (_start). */ - if (func <= gdbarch_tdep (current_gdbarch)->lowest_pc) - return; - - /* Hopefully the prologue analysis either correctly determined the - frame's base (which is the SP from the previous frame), or set - that base to "NULL". */ - base = info->prev_sp; - if (base == 0) - return; + Returns: the address of the first instruction after the prologue. - id = frame_id_build (base, func); + This function is called by our unwinder as well as from arc_skip_prologue + in the case that it cannot detect the end of the prologue. - (*this_id) = id; - //#endif + 'next_frame' and 'info' are NULL if this function is called from + arc_skip_prologue in an attempt to discover the end of the prologue. + In this case we don't fill in the 'info' structure that is passed in. -} + TODOs: + 1. Support 32 bit normal frames generated by GCC 2.95 + 2. Support 16 and 32 bit mixed frames generated by GCC 2.95 + 3. Support 32 bit normal variadic function frames by GCC 2.95 + 4. Support 32 bit normal frames from GCC 3.4.x with variadic args + 5. Support 16 and 32 bit normal frames from GCC 3.4.x with variadic args + 6. Support 16 and 32 bit mixed frames generated by GCC 3.4.x + 7. Support Metaware generated prologues + (The difference is in the use of thunks to identify the saving and + restoring of callee saves: may have to do some hackery even in + next_pc, since the call is going to create its own set of problems + with our stack setup). + We attempt to use the disassembler interface from the opcodes library to do + our disassembling. -/* - * Unwind and obtain the register information - */ -static void -arc_frame_prev_register (struct frame_info *next_frame, - void **this_prologue_cache, - int regnum, int *optimizedp, - enum lval_type *lvalp, CORE_ADDR *addrp, - int *realnump, void *bufferp) -{ - // FIXMEA: - //#ifdef ARC4_JTAG -#ifdef ARC_DEBUG - printf ("\n arc_frame_prev_register() called for regnum %d\n ",regnum ); -#endif - //#else - struct arc_unwind_cache *info - = arc_frame_unwind_cache (next_frame, this_prologue_cache); + The usual 32 bit normal gcc -O0 prologue looks like this: + Complete Prologue for all GCC frames (Cases #1 to #6 in TODOs above): - /* If we are asked to unwind the PC, then we need to return blink - instead. The saved value of PC points into this frame's - prologue, not the next frame's resume location. */ -#ifdef ARC4_JTAG - if (regnum == ARC_STATUS_REGNUM) -#else - if (regnum == PC_REGNUM) -#endif - regnum = ARC_BLINK_REGNUM; + sub sp, sp, limm ; space for variadic arguments + st.a blink, [sp,-4] ; push blink (if not a leaf function) - decrements sp + sub sp, sp , limm ; (optional space creation for callee saves) + st r13, [sp] ; push of first callee saved register + st r14, [sp,4] ; push of next callee saved register + ... + st.a fp , [sp,-4] ; push fp (if fp has to be saved) - decrements sp + mov fp , sp ; set the current frame up correctly + sub sp , sp , #immediate ; create space for local vars on the stack */ + +/* 3 instructions before and after callee saves, and max number of saves; assume each is 4-byte inst. */ +#define MAX_PROLOGUE_LENGTH ((6 + (ARC_ABI_LAST_CALLEE_SAVED_REGISTER - ARC_ABI_FIRST_CALLEE_SAVED_REGISTER + 1)) * 4) + +static CORE_ADDR +scan_prologue (CORE_ADDR entrypoint, + struct frame_info *next_frame, + UnwindCache *info) +{ + ENTERARGS("next_frame = %p, info = %p", next_frame, info); - /* SP is generally not saved to the stack, but this frame is - identified by NEXT_FRAME's stack pointer at the time of the call. - The value was already reconstructed into PREV_SP. */ - if (regnum == ARC_SP_REGNUM) { - *lvalp = not_lval; - if (bufferp) - store_unsigned_integer (bufferp, 4, info->prev_sp); - return; - } + /* Will be set to end of prologue. */ + CORE_ADDR prologue_ends_pc = entrypoint; + struct disassemble_info di; + + /* An arbitrary limit on the length of the prologue. If next_frame is + NULL this means that there was no debug info and we are called from + arc_skip_prologue; otherwise, if we know the frame, we can find the + pc within the function. + + N.B. that pc will usually be after the end of the prologue, but + it could actually be within the prologue (i.e. execution has + halted within the prologue, e.g. at a breakpoint); in that + case, do NOT go beyond that pc, as the instructions at the + pc and after have not been executed yet, so have had no effect! */ + CORE_ADDR final_pc = (next_frame) ? frame_pc_unwind(next_frame) + : entrypoint + MAX_PROLOGUE_LENGTH; + + if (info) + { + /* Assume that the function is a leaf function until we find out + that it is not (i.e. when we find the 'push blink' instruction + in the prologue). */ + info->is_leaf = TRUE; + /* No registers known to be saved, as yet. */ + info->saved_regs_mask = 0; + } - trad_frame_get_prev_register (next_frame, info->saved_regs, regnum, - optimizedp, lvalp, addrp, realnump, bufferp); + /* Initializations to use the opcodes library. */ + arc_initialize_disassembler(&di); + DEBUG("Prologue PC: %lx\n", (unsigned long) prologue_ends_pc); + DEBUG("Final PC: %lx\n", (unsigned long) final_pc); -#ifdef ARC_DEBUG - printf("-*-*-*\n Regnum =%d, realnump=%d,%d \n",regnum, (char *)(bufferp), *((char*)bufferp)); -#endif - //#endif -} + /* Look at each instruction in the prologue. */ + while (prologue_ends_pc < final_pc) + { + struct arcDisState current_instr = arcAnalyzeInstr(prologue_ends_pc, &di); + printInsnState(current_instr); + /* If this instruction is in the prologue, fields in the info will be updated, + and the saved registers mask may be updated. */ + if (!is_in_prologue(info, ¤t_instr)) + { + /* Found a instruction that is not in the prologue. */ + DEBUG("End of Prologue reached \n"); + break; + } + prologue_ends_pc += current_instr.instructionLen; + } -static const struct frame_unwind arc_frame_unwind = { - NORMAL_FRAME, - arc_frame_this_id, - arc_frame_prev_register -}; + /* Means we were not called from arc_skip_prologue. */ + if (!((next_frame == NULL) && (info == NULL))) + { + printFrameInfo("after prologue", info, FALSE); -const struct frame_unwind * -arc_frame_sniffer (struct frame_info *next_frame) -{ - return &arc_frame_unwind; -} + find_previous_stack_pointer(info, next_frame); + /* The PC is found in blink (the actual register or located on the stack). */ + info->saved_regs[ARC_PC_REGNUM] = info->saved_regs[ARC_BLINK_REGNUM]; -/* read-only registers */ -static int -arc_cannot_store_register (int regno) -{ - if( -#ifndef ARC4_JTAG - regno == ARC_EFA_REGNUM || - regno == ARC_ERET_REGNUM || - regno == ARC_STATUS32_L1_REGNUM || - regno == ARC_STATUS32_L2_REGNUM || - regno == ARC_ERSTATUS_REGNUM || -#endif - regno == ARC_ILINK1_REGNUM || - regno == ARC_ILINK2_REGNUM - ) - { - /* No warning should be printed. arc_cannot_store_register being - called does not imply that someone is actually writing to regnum. */ + printFrameInfo("after previous SP found", info, TRUE); + } - /*warning("writing to read-only register: %s\n", arc_register_name(regno));*/ - return 1; + return prologue_ends_pc; } - return 0; } -/* Returns true if the insn at PC is a branch. *fall_thru is the address of - the next insn. *target is the branch target. */ -static int -arc_next_pc(CORE_ADDR pc, CORE_ADDR *fall_thru, CORE_ADDR *target) -{ -#ifdef ARC4_JTAG -#ifdef ARC_DEBUG - printf ("\narc_next_pc called\n"); -#endif -#else - struct arcDisState instr, instr_d; - int insn_length; - struct disassemble_info di; - int two_targets = 0; - - init_disassemble_info(&di, NULL, NULL); - di.arch = gdbarch_bfd_arch_info(current_gdbarch)->arch; - di.mach = gdbarch_bfd_arch_info(current_gdbarch)->mach; - di.endian = gdbarch_byte_order(current_gdbarch); - di.read_memory_func = target_read_memory; - - instr = arcAnalyzeInstr(pc, &di); - - *fall_thru = pc + instr.instructionLen; - -#ifdef ARC_DEBUG - printf("--- arc_next_pc(%x) = %x, isBranch = %d, tcnt = %d [%x], flow = %s (%d), " - "reg for indirect jump = %d, nullifyMode = %s\n", - pc, *fall_thru, instr.isBranch, instr.tcnt, instr.targets[0], - (instr.flow == direct_jump || instr.flow == direct_call) ? "direct" : "indirect", - instr.flow, - instr.register_for_indirect_jump, - (instr.nullifyMode == BR_exec_always ? "delay slot" : "no delay")); -#endif - if(instr.isBranch) - { - two_targets = 1; - - if(instr.flow == direct_jump || instr.flow == direct_call) - *target = instr.targets[0]; - else - regcache_cooked_read(current_regcache, - arc_binutils_reg_to_regnum(instr.register_for_indirect_jump), - target); - } +/* -------------------------------------------------------------------------- */ +/* local functions for handling function return values */ +/* -------------------------------------------------------------------------- */ - /* for instructions with delay slots, the fall thru is not the instruction - immediately after the branch instruction, but the one after that */ - if(instr.isBranch && instr.nullifyMode == BR_exec_always) - { - instr_d = arcAnalyzeInstr(*fall_thru, &di); - *fall_thru += instr_d.instructionLen; - } +/* This function gets the return value of a function from the registers used to + return it, according to the convention used by the ABI. - /* zero-overhead loops: - if(status32[L] == 0 && next_pc == lp_end && lp_count > 1) - next_pc = lp_start; - */ - { - unsigned int lp_end, lp_start, lp_count, status32; - - regcache_cooked_read(current_regcache, ARC_LP_START_REGNUM, &lp_start); - regcache_cooked_read(current_regcache, ARC_LP_END_REGNUM, &lp_end); - regcache_cooked_read(current_regcache, ARC_LP_COUNT_REGNUM, &lp_count); -#ifndef ARC4_JTAG - regcache_cooked_read(current_regcache, ARC_STATUS32_REGNUM, &status32); -#endif + Parameters: + type : the information for the return type of the function + regcache : the register cache holding the register contents + valbuf : a buffer to be filled with the return value +*/ - if( !(status32 & ARC_STATUS32_L) && *fall_thru == lp_end && lp_count > 1) - { - two_targets = 1; - *target = lp_start; - } - } - - return two_targets; -#endif // -} +static void +extract_return_value (struct type *type, + struct regcache *regcache, + gdb_byte *valbuf) -/* this is called with insert_breakpoints_p = 1 before single-stepping and - with insert_breakpoints_p = 0 after the step */ -void -arc_software_single_step(enum target_signal ignore, int insert_breakpoints_p) { -#ifdef ARC4_JTAG -#ifdef ARC_DEBUG - printf ("\narc_software_single_step called\n" ); -#endif -#else - typedef char binsn_quantum[BREAKPOINT_MAX]; - - static CORE_ADDR fall_thru, branch_target; - static binsn_quantum break_mem[2]; - static char two_breakpoints; - CORE_ADDR pc; - - { -#ifdef ARC_DEBUG - unsigned int efa, ret; - regcache_cooked_read(current_regcache, ARC_EFA_REGNUM, &efa); - // regcache_cooked_read(current_regcache, ARC_RET_REGNUM, &ret); - - printf("--- arc_software_single_step, efa = %x, ret = %x, (%s)\n", efa, ret, - (insert_breakpoints_p ? "add" : "remove")); -#endif - } - - if (insert_breakpoints_p) + unsigned int len = TYPE_LENGTH (type); + + ENTERMSG; + + if (len <= BYTES_IN_REGISTER) { - pc = read_pc (); - two_breakpoints = arc_next_pc (pc, &fall_thru, &branch_target); - - if (two_breakpoints && branch_target == pc) - { - warning ("Cannot single-step branch-to-self or single instruction zero overhead loop,\n" - " Stepping across it."); - /* Don't insert/remove the branch-target breakpoint. */ - two_breakpoints = 0; - } - - target_insert_breakpoint (fall_thru, break_mem[0]); - if(two_breakpoints) - target_insert_breakpoint (branch_target, break_mem[1]); + ULONGEST val; + + /* Get the return value from one register. */ + regcache_cooked_read_unsigned (regcache, ARC_ABI_RETURN_REGNUM, &val); + store_unsigned_integer (valbuf, (int) len, val); + + DEBUG("returning 0x%08lX\n", (unsigned long) val); } - else + else if (len <= BYTES_IN_REGISTER * 2) { - target_remove_breakpoint (fall_thru, break_mem[0]); - if(two_breakpoints) - target_remove_breakpoint (branch_target, break_mem[1]); - } -#endif -} + ULONGEST low, high; -/* - * mapping from binutils/gcc register number to - * GDB register number ("regnum") - */ -static int -arc_binutils_reg_to_regnum (int reg) -{ -#ifdef ARC4_JTAG - if (reg >= 0 && reg <= 26) - return reg; - else if (reg == 27) /* fp */ - return ARC_FP_REGNUM; - else if (reg == 28) /* sp */ - return ARC_SP_REGNUM; - else if (reg == 29) /* ilink1 */ - return ARC_ILINK1_REGNUM; - else if (reg == 30) /* ilink2 */ - return ARC_ILINK2_REGNUM; - else if (reg == 31) /* blink */ - return ARC_BLINK_REGNUM; + /* Get the return value from two registers. */ + regcache_cooked_read_unsigned (regcache, ARC_ABI_RETURN_LOW_REGNUM, &low); + regcache_cooked_read_unsigned (regcache, ARC_ABI_RETURN_HIGH_REGNUM, &high); -#else - /* from gcc/config/arc/arc.h */ - - if (reg >= 0 && reg <= 26) - return reg; - else if (reg == 27) /* fp */ - return ARC_FP_REGNUM; - else if (reg == 28) /* sp */ - return ARC_SP_REGNUM; - else if (reg == 29) /* ilink1 */ - return ARC_ILINK1_REGNUM; - else if (reg == 30) /* ilink2 */ - return ARC_ILINK2_REGNUM; - else if (reg == 31) /* blink */ - return ARC_BLINK_REGNUM; - else if (reg >= 32 && reg <= 59) /* reserved */ - ; - else if (reg == 60) /* lp_count */ - return ARC_LP_COUNT_REGNUM; - else if (reg == 61) /* reserved */ - ; - else if (reg == 62) /* no such register */ - ; -/* else if (reg == 63) /\* PCL *\/ */ -/* return ARC_RET_REGNUM; */ + store_unsigned_integer (valbuf, BYTES_IN_REGISTER, low); + store_unsigned_integer (valbuf + BYTES_IN_REGISTER, (int) len - BYTES_IN_REGISTER, high); -#endif - warning ("Unmapped register #%d encountered\n", reg); - return -1; + DEBUG("returning 0x%08lX%08lX\n", + (unsigned long) high, (unsigned long) low); + } + else + error(_("%s: type length %u too large"), __FUNCTION__, len); } +/* This function loads the return value of a function into the registers used to + return it, according to the convention used by the ABI. + + Parameters: + type : the information for the return type of the function + regcache : the register cache holding the register contents + valbuf : a buffer holding the return value +*/ + static void -arc_add_reggroups (struct gdbarch *gdbarch) +store_return_value (struct type *type, + struct regcache *regcache, + const gdb_byte *valbuf) { - reggroup_add (gdbarch, general_reggroup); - reggroup_add (gdbarch, all_reggroup); - reggroup_add (gdbarch, system_reggroup); -} + unsigned int len = TYPE_LENGTH (type); -int -arc_register_reggroup_p (struct gdbarch *gdbarch, int regnum, - struct reggroup *group) -{ - struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch); - int tdep_answer; - - tdep_answer = tdep->register_reggroup_p (regnum, group); - if(tdep_answer != -1) - return tdep_answer; - - if (group == all_reggroup) - return 1; - else if (group == save_reggroup || group == restore_reggroup) - { - /* don't save/restore read-only registers. */ - return (!arc_cannot_store_register(regnum)); - } - else if (group == general_reggroup) + ENTERMSG; + + if (len <= BYTES_IN_REGISTER) { -#ifndef ARC4_JTAG - if (regnum == ARC_STATUS32_REGNUM) - return 0; -#endif - return 1; + ULONGEST val; + + /* Put the return value into one register. */ + val = extract_unsigned_integer (valbuf, (int) len); + regcache_cooked_write_unsigned (regcache, ARC_ABI_RETURN_REGNUM, val); + + DEBUG("storing 0x%08lX\n", (unsigned long) val); } - else + else if (len <= BYTES_IN_REGISTER * 2) { - internal_error(__FILE__, __LINE__, "bad register group"); + ULONGEST low, high; + + /* Put the return value into two registers. */ + low = extract_unsigned_integer (valbuf, BYTES_IN_REGISTER); + high = extract_unsigned_integer (valbuf + BYTES_IN_REGISTER, (int) len - BYTES_IN_REGISTER); + + regcache_cooked_write_unsigned (regcache, ARC_ABI_RETURN_LOW_REGNUM, low); + regcache_cooked_write_unsigned (regcache, ARC_ABI_RETURN_HIGH_REGNUM, high); + + DEBUG("storing 0x%08lX%08lX\n", + (unsigned long) high, (unsigned long) low); } + else + error(_("arc_store_return_value: type length too large.")); } +/* -------------------------------------------------------------------------- */ +/* local functions for handling the stack frame */ +/* -------------------------------------------------------------------------- */ -static void -arc_dwarf2_frame_init_reg (struct gdbarch *gdbarch, int regnum, - struct dwarf2_frame_state_reg *reg) +/* This is copied from file stack.c in the gdb sources. + It identifies a frame from information (such as frame number) given by the + user (in the frame_exp parameter). */ + +static struct frame_info* +parse_frame_specification_1 (const char *frame_exp, + const char *message, + int *selected_frame_p) { -#ifdef ARC4_JTAG - // FIXMEA: Clean up. if ( debug_arc_jtag_target_message) -#ifdef ARC_DEBUG - printf ("\n arc_dwarf2_frame_init_reg called.\n Regno no:%d,0x%x\n",regnum,regnum); -#endif - /* The return address column. */ - if (regnum == ARC_STATUS_REGNUM) - reg->how = DWARF2_FRAME_REG_RA; - - /* The call frame address. */ - if (regnum == ARC_SP_REGNUM) - reg->how = DWARF2_FRAME_REG_CFA; + int numargs = 0; + struct value *args[4]; + CORE_ADDR addrs[ARRAY_SIZE (args)]; -#else - /* The return address column. */ - if (regnum == PC_REGNUM) - reg->how = DWARF2_FRAME_REG_RA; - - /* The call frame address. */ - if (regnum == ARC_SP_REGNUM) - reg->how = DWARF2_FRAME_REG_CFA; -#endif -} + if (frame_exp) + { + while (TRUE) + { + char *addr_string; + struct cleanup *cleanup; + const char *p; -static CORE_ADDR -arc_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame) + /* Skip leading white space. */ + while (isspace (*frame_exp)) + frame_exp++; + + if (*frame_exp == '\0') + break; + + /* Parse the argument, extract it, save it. */ + for (p = frame_exp; (*p != '\0') && !isspace (*p); p++); + + addr_string = savestring (frame_exp, (size_t) (p - frame_exp)); + frame_exp = p; + cleanup = make_cleanup (xfree, addr_string); + + /* NOTE: Parse and evaluate expression, but do not use + functions such as parse_and_eval_long or + parse_and_eval_address to also extract the value. + Instead value_as_long and value_as_address are used. + This avoids problems with expressions that contain + side-effects. */ + if (numargs >= (int) ARRAY_SIZE (args)) + error (_("Too many args in frame specification")); + + args[numargs++] = parse_and_eval (addr_string); + + do_cleanups (cleanup); + } + } + + /* If no args, default to the selected frame. */ + if (numargs == 0) + { + if (selected_frame_p != NULL) + (*selected_frame_p) = 1; + return get_selected_frame (message); + } + + /* None of the remaining use the selected frame. */ + if (selected_frame_p != NULL) + (*selected_frame_p) = 0; + + /* Assume the single arg[0] is an integer, and try using that to + select a frame relative to current. */ + if (numargs == 1) + { + int level = (int) value_as_long (args[0]); + struct frame_info *fid = find_relative_frame (get_current_frame (), &level); + + if (level == 0) + /* find_relative_frame was successful. */ + return fid; + } + + /* Convert each value into a corresponding address. */ + { + int i; + for (i = 0; i < numargs; i++) + addrs[i] = value_as_address (args[i]); + } + + /* Assume that the single arg[0] is an address, use that to identify + a frame with a matching ID. Should this also accept stack/pc or + stack/pc/special. */ + if (numargs == 1) + { + struct frame_id id = frame_id_build_wild (addrs[0]); + struct frame_info *fid; + + /* If (s)he specifies the frame with an address, he deserves + what (s)he gets. Still, give the highest one that matches. + (NOTE: cagney/2004-10-29: Why highest, or outer-most, I don't + know). */ + for (fid = get_current_frame (); + fid != NULL; + fid = get_prev_frame (fid)) + { + if (frame_id_eq (id, get_frame_id (fid))) + { + while (frame_id_eq (id, frame_unwind_id (fid))) + fid = get_prev_frame (fid); + return fid; + } + } + } + + /* We couldn't identify the frame as an existing frame, but + perhaps we can create one with a single argument. */ + if (numargs == 1) + return create_new_frame (addrs[0], 0); + else if (numargs == 2) + return create_new_frame (addrs[0], addrs[1]); + else + error (_("Too many args in frame specification")); +} + + +/* Return an array (and count) of the local variables and parameters declared + in the function which owns the given frame. + + Parameters: + frame : the frame information for the function + variables: a pointer to an existing array of variable information (may be NULL) + count : (IN/OUT) the total number of variables found + callee : TRUE if the function is a callee of another function + + Result: + A pointer to an array containing one element for each parameter, and, if + 'callee' is FALSE, each local variable, of the function. */ + +static LocalVariable* +find_variables (struct frame_info *frame, + LocalVariable *variables, + unsigned int *count, + Boolean callee) { - ULONGEST pc; -#ifdef ARC4_JTAG - frame_unwind_unsigned_register (next_frame, ARC_STATUS_REGNUM, &pc); - pc = pc & 0x00ffffff; - pc = pc << 2; -#else - frame_unwind_unsigned_register (next_frame, PC_REGNUM, &pc); -#endif - return pc; + struct block *block = get_frame_block (frame, 0); + unsigned int vars = *count; + + while (block) + { + struct dict_iterator iter; + struct symbol *sym; + + ALL_BLOCK_SYMBOLS (block, iter, sym) + { + Boolean is_arg = (SYMBOL_CLASS(sym) == LOC_COMPUTED_ARG); + CORE_ADDR addr; + + switch (SYMBOL_CLASS (sym)) + { + case LOC_COMPUTED: + case LOC_COMPUTED_ARG: + addr = SYMBOL_OPS (sym)->get_variable_address(sym, frame); + + /* For callees, we are only interested in the arguments. */ + if ((addr != 0) && (!callee || is_arg)) + { + struct type *type = SYMBOL_TYPE (sym); + + vars++; + variables = xrealloc(variables, sizeof(LocalVariable) * vars); + + if (variables) + { + LocalVariable *var = &variables[vars - 1]; + + var->name = SYMBOL_PRINT_NAME (sym); + var->address = addr; + var->is_callee = callee; + var->is_argument = is_arg; + var->is_array = (TYPE_CODE (type) == TYPE_CODE_ARRAY); + var->size = SYMBOL_OPS (sym)->get_variable_size(sym, frame); + + if (var->is_array) + var->element_size = TYPE_LENGTH (TYPE_TARGET_TYPE (type)); + } + else + { + *count = 0; + return NULL; + } + } + break; + + default: + /* Ignore symbols which are not locals. */ + break; + } + } + + /* After handling the function's top-level block, stop. Don't continue + to its superblock, the block of per-file symbols. */ + if (BLOCK_FUNCTION (block)) + break; + block = BLOCK_SUPERBLOCK (block); + } + + *count = vars; + return variables; } -static CORE_ADDR -arc_unwind_sp (struct gdbarch *gdbarch, struct frame_info *next_frame) + +/* Return an array (and count) of the local variables declared in the function + which owns the given frame, and also those declared in the function which is + the callee (if any) of that function in the current call chain. */ + +static LocalVariable* +find_local_variables (struct frame_info *frame, unsigned int *count) +{ + struct frame_info *callee = get_next_frame(frame); + LocalVariable *variables; + + *count = 0; + + variables = find_variables(frame, NULL, count, FALSE); + + if (callee) + variables = find_variables(callee, variables, count, TRUE); + + return variables; +} + + +/* Try to add the name of a local variable or function parameter to a line of + output, if a given address lies within the range of locations occupied by + that data item. + + Parameters: + line : the line in which any output is to be placed + location : the address of a location on the stack + variables : an array of local variables and parameters + num_variables : the number of elements in the array + is_following_element : set to TRUE if the location lies within an + array element, and it is not the 0th element + elements_are_word_sized: set to TRUE if the array element is word-sized + + Returns TRUE if the given location holds a local variable or parameter + (i.e. information has been added to the line of output). */ + +static Boolean +add_local_name (char *line, + CORE_ADDR location, + LocalVariable *variables, + unsigned int num_variables, + Boolean *is_following_element, + Boolean *elements_are_word_sized) { - ULONGEST sp; - frame_unwind_unsigned_register (next_frame, SP_REGNUM, &sp); - return sp; + unsigned int i; + + *is_following_element = FALSE; + *elements_are_word_sized = FALSE; + + /* Look at each of the local variables / parameters in the array. */ + for (i = 0; i < num_variables; i++) + { + LocalVariable *var = &variables[i]; + int index = -1; + + /* is the variable an array? */ + if (var->is_array) + { + /* If we know the size of the array, and the size of its elements. */ + if (var->size > 0 && var->element_size > 0) + { + /* What is the offset of the given stack location from the start + of the array? */ + int offset = (int) ((long int) location - (long int) var->address); + + /* Does that offset actually lie within the array? */ + if (0 <= offset && offset < (int) var->size) + { + /* Compute the index of the array element which contains the + location. */ + index = offset / var->element_size; + } + + if (var->element_size == BYTES_IN_WORD) + *elements_are_word_sized = FALSE; + } + } + + /* If the variable starts in the given location, or the variable is an + array and one of its elements contains the location. */ + if (var->address == location || index >= 0) + { + int n; + + /* What is the variable? */ + if (var->is_callee) + n = sprintf(line, _("callee parameter")); + else if (var->is_argument) + n = sprintf(line, _("parameter")); + else + n = sprintf(line, _("local variable")); + + line[n] = ' '; + n++; + n += sprintf(line + n, _("'%s'"), var->name); + line[n] = ' '; + + /* If it is an array element. */ + if (index >= 0) + { + /* Add the array element index to the output. */ + (void) sprintf(line + n, _("[%u]"), index); + + /* Is it an element which follows another element? */ + *is_following_element = (index > 0); + } + else if (var->size > BYTES_IN_WORD) + { + /* It occupies more than one word. */ + (void) sprintf(line + n + 1, _("(%u words)"), + WORDS_OCCUPIED(var->size)); + } + + return TRUE; + } + } + + return FALSE; } +/* Try to identify the given frame, and output that identification. */ static void -arc_extract_return_value (struct type *type, struct regcache *regcache, - void *valbuf) +identify_frame (struct frame_info *frame) { - //#ifdef ARC4_JTAG -#ifdef ARC_DEBUG - printf ("\narc_extract_return_value called\n"); -#endif - //#else - ULONGEST val; - int len = TYPE_LENGTH (type); - - if (len <= 4) + enum language func_lang = language_unknown; + char *func_name = NULL; + char *demangled = NULL; + struct symbol *func; + struct symtab_and_line sal; + + find_frame_sal (frame, &sal); + func = get_frame_function (frame); + + /* Have we found the function owning the frame? */ + if (func) + { + func_name = DEPRECATED_SYMBOL_NAME (func); + func_lang = SYMBOL_LANGUAGE (func); + } + else { - /* Get the return value from R0. */ - regcache_cooked_read_unsigned (regcache, ARC_RETURN1_REGNUM, &val); - store_unsigned_integer (valbuf, len, val); + struct minimal_symbol *msymbol; + + /* Try to find the symbol most closely associated with the PC + corresponding to the frame. */ + msymbol = lookup_minimal_symbol_by_pc (get_frame_pc (frame)); + + if (msymbol != NULL) + { + func_name = DEPRECATED_SYMBOL_NAME (msymbol); + func_lang = SYMBOL_LANGUAGE (msymbol); + } } - else if (len <= 8) + + /* Have we found a name? */ + if (func_name) { - /* Get the return value from R0 and R1. */ - /* R0 holds the lower-order bytes */ - regcache_cooked_read_unsigned (regcache, ARC_RETURN1_REGNUM, &val); - store_unsigned_integer (valbuf, 4, val); - regcache_cooked_read_unsigned (regcache, ARC_RETURN2_REGNUM, &val); - store_unsigned_integer ((char *)valbuf + 4, len - 4, val); + /* If user wants to see raw output, no problem. + (demangle is a global flag which can be set by user command). */ + if (demangle) + { + demangled = language_demangle (language_def (func_lang), + func_name, + DMGL_ANSI | DMGL_PARAMS); + + /* If the demangler fails, try the demangled name from the symbol + table. That'll have parameters, but that's preferable to + displaying a mangled name. */ + if (demangled == NULL) + { + if (func == NULL) + func_name = _(""); + else + func_name = SYMBOL_PRINT_NAME (func); + } + else + func_name = demangled; + } } - else - error ("arc_extract_return_value: type length too large"); - //#endif + else + func_name = _(""); + + printf_filtered(_("Frame of function: %s"), func_name); + if (sal.symtab) + printf_filtered(_(" (%s:%d)"), sal.symtab->filename, sal.line); + printf_filtered(NEW_LINE); + + if (demangled != NULL) + xfree (demangled); } -static void -arc_store_return_value (struct type *type, struct regcache *regcache, - const void *valbuf) + +/* -------------------------------------------------------------------------- */ +/* local functions called from gdb */ +/* -------------------------------------------------------------------------- */ + +/* Standard register type for the ARC platform. + It would be builtin_type_uint32 until we consider the DSP extensions. */ + +static struct type * +arc_register_type (struct gdbarch *gdbarch, int regnum) { - //#ifdef ARC4_JTAG -#ifdef ARC_DEBUG - printf ("\narc_store_return_value called\n "); -#endif - //#else - ULONGEST val; - int len = TYPE_LENGTH (type); - - if (len <= 4) + return builtin_type_uint32; +} + + +/* Skip the prologue for the function at pc. + Returns the address of the first instruction after the prologue. */ + +static CORE_ADDR +arc_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc) +{ + CORE_ADDR function_addr, function_end = 0; + char *function_name; + + /* This is done by checking from the line information read from the DWARF, + if possible; otherwise, we scan the function prologue to find its end. */ + + ENTERMSG; + + /* If we're in a dummy frame, don't even try to skip the prologue. */ + if (deprecated_pc_in_call_dummy (pc)) + return pc; + + /* See what the symbol table says. */ + if (find_pc_partial_function (pc, &function_name, &function_addr, &function_end)) { - /* Put the return value in R0. */ - val = extract_unsigned_integer (valbuf, len); - regcache_cooked_write_unsigned (regcache, ARC_RETURN1_REGNUM, val); + /* Found a function. */ + struct symbol *sym = lookup_symbol (function_name, NULL, VAR_DOMAIN, NULL, NULL); + + if ((sym != NULL) && SYMBOL_LANGUAGE (sym) != language_asm) + { + /* Don't use this trick for assembly source files. */ + struct symtab_and_line sal = find_pc_line (function_addr, 0); + + if ((sal.line != 0) && (sal.end < function_end)) + return sal.end; + } } - else if (len <= 8) + + /* Find the address of the first instruction after the prologue by scanning + through it - no other information is needed, so pass NULL for the other + parameters. */ + return scan_prologue(pc, NULL, NULL); +} + + +/* Construct frame id for the normal frame. */ + +static void +arc_frame_this_id (struct frame_info *next_frame, + void **this_prologue_cache, + struct frame_id *this_id) +{ + ENTERMSG; + + /* FIXME: to what should *this_id be set if the frame base can not be found? */ + { - /* Put the return value in R10 and R11. */ - val = extract_unsigned_integer (valbuf, 4); - regcache_cooked_write_unsigned (regcache, ARC_RETURN1_REGNUM, val); - val = extract_unsigned_integer ((char *)valbuf + 4, len - 4); - regcache_cooked_write_unsigned (regcache, ARC_RETURN2_REGNUM, val); + /* Find the entry point of the function which owns the frame. */ + CORE_ADDR entrypoint = frame_func_unwind (next_frame, NORMAL_FRAME); + + /* This is meant to halt the backtrace at the entry point (_start) + (it assumes that there is no code at a lower address). */ + if (entrypoint > gdbarch_tdep (current_gdbarch)->lowest_pc) + { + UnwindCache *info = frame_unwind_cache (next_frame, this_prologue_cache); + CORE_ADDR base = info->prev_sp; + + /* Hopefully the prologue analysis either correctly determined the + frame's base (which is the SP from the previous frame), or set + that base to "NULL". */ + + if (base != 0) + { + /* Build the ID from the frame base address. */ + *this_id = frame_id_build (base, entrypoint); + +#if 0 + printf("*** Frame ID: %x ==> (%x %x %x)\n", + base, + this_id->stack_addr, + this_id->code_addr, + this_id->special_addr); +#endif + } + } } - else - error ("arc_store_return_value: type length too large."); - //#endif } -static enum return_value_convention -arc_return_value (struct gdbarch *gdbarch, struct type *valtype, - struct regcache *regcache, void *readbuf, - const void *writebuf) +/* Unwind and obtain the register information. */ + +static void +arc_frame_prev_register (struct frame_info *next_frame, + void **this_prologue_cache, + int regnum, + int *optimized, + enum lval_type *lval, + CORE_ADDR *addr, + int *realnum, + gdb_byte *buffer) { - //#ifdef ARC4_JTAG -#ifdef ARC_DEBUG - printf ("\narc_return_value called"); -#endif - //#else - /* This will change with the ABI */ - int struct_return = (TYPE_CODE (valtype) == TYPE_CODE_STRUCT || - TYPE_CODE (valtype) == TYPE_CODE_UNION || - TYPE_LENGTH (valtype) > 8); - - - if (writebuf != NULL) + ENTERARGS("regnum %d ", regnum); + { - gdb_assert (!struct_return); - arc_store_return_value (valtype, regcache, writebuf); + UnwindCache *info = frame_unwind_cache (next_frame, this_prologue_cache); + + /* If we are asked to unwind the PC, then we need to return blink + instead: the saved value of PC points into this frame's function's prologue, + not the next frame's function's resume location. */ + if (regnum == ARC_PC_REGNUM) + regnum = ARC_BLINK_REGNUM; + + /* SP is generally not saved to the stack, but this frame is identified + by next_frame's stack pointer at the time of the call. The value was + already reconstructed into prev_sp. */ + if (regnum == ARC_SP_REGNUM) + { + /* This value is not an L-value, i.e. it can not be changed, because + it is implicit in the structure of the call-chain. */ + *lval = not_lval; + + if (buffer) + store_unsigned_integer (buffer, BYTES_IN_REGISTER, info->prev_sp); + return; + } + + trad_frame_get_prev_register (next_frame, + info->saved_regs, + regnum, + optimized, + lval, + addr, + realnum, + buffer); + + DEBUG("-*-*-*\n Regnum = %d, buffer = %p\n", regnum, buffer); } +} + - if (readbuf != NULL) +/* This function is passed to gdb to enable it to unwind frames. */ + +static const struct frame_unwind * +arc_frame_sniffer (struct frame_info *next_frame) +{ + static const struct frame_unwind arc_frame_unwind = { - gdb_assert (!struct_return); - arc_extract_return_value (valtype, regcache, readbuf); - } + NORMAL_FRAME, // type + arc_frame_this_id, // this_id + arc_frame_prev_register, // prev_register + NULL, // unwind_data + NULL, // sniffer + NULL, // prev_pc + NULL // dealloc_cache + }; + + return &arc_frame_unwind; +} + - if (struct_return) - return RETURN_VALUE_STRUCT_CONVENTION; - else - return RETURN_VALUE_REGISTER_CONVENTION; - //#endif +/* Get the breakpoint which is appropriate for address at which it is to be set. + + Return whatever is in the ARC-private tdep structure (this has been set up + according to the correct target / architecture chosen). + + Fortunately, the ARC processor does not have separate instruction sets (like + the ARM's normal 32-bit and 16-bit Thumb instructions), so the bp instruction + to be used does not depend on the address (although the ARC does have both + 16- and 32-bit instructions, they may be freely intermixed). */ + +static const unsigned char * +arc_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr) +{ + struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); + int end = gdbarch_byte_order (gdbarch); + + /* Return the breakpoint instruction length. */ + *lenptr = (int) tdep->breakpoint_size; + + /* Return the breakpoint instruction code. */ + if (end == BFD_ENDIAN_LITTLE) + return tdep->le_breakpoint_instruction; + if (end == BFD_ENDIAN_BIG) + return tdep->be_breakpoint_instruction; + + internal_error (__FILE__, __LINE__, "target endianness is not known"); } -/* Signal Trampoline Frame Unwinder. These - * unwinders allow frame unwinding to happen - * from within signal handlers. - */ -static struct arc_unwind_cache * -arc_sigtramp_frame_cache (struct frame_info *next_frame, - void **this_cache) +/* Determine whether the given register is a member of the given group. + + Returns 0, 1, or -1: + 0 means the register is not in the group. + 1 means the register is in the group. + -1 means the tdep has nothing to say about this register and group. */ + +static int +arc_register_reggroup_p (struct gdbarch *gdbarch, + int regnum, + struct reggroup *group) { - // FIXMEA: cleanup#ifdef ARC4_JTAG -#ifdef ARC_DEBUG - printf ("\narc_sigtramp_frame_cache called"); -#endif - //#else - struct arc_unwind_cache *cache; - struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch); - CORE_ADDR addr; - char buf[4]; + struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); + int tdep_answer = tdep->register_reggroup_p (regnum, group); - if (*this_cache) - return *this_cache; + /* If the configuration-specific tdep knows about this register. */ + if (tdep_answer != -1) + return tdep_answer; + + if (group == all_reggroup) + return 1; + + if (group == save_reggroup || group == restore_reggroup) + { + /* Don't save/restore read-only registers. */ + return (!gdbarch_cannot_store_register(current_gdbarch, regnum)); + } - cache = FRAME_OBSTACK_ZALLOC (struct arc_unwind_cache); - (*this_cache) = cache; - cache->saved_regs = trad_frame_alloc_saved_regs (next_frame); - - /* Zero all fields. */ - cache->blink_offset = 0; - cache->prev_pc = 0; - cache->prev_sp = 0; - cache->frame_base = 0; - cache->framesize = 0; - cache->sp_offset = 0; - cache->fp_offset = 0; - cache->prev_pc = 0; - cache->is_leaf = 0; - cache->uses_fp = 0; - - - frame_unwind_register (next_frame, SP_REGNUM, buf); - cache->frame_base = extract_unsigned_integer (buf, 4); - - addr = tdep->sigcontext_addr (next_frame); - if (tdep->sc_reg_offset) + if (group == system_reggroup) { - int i; - - for (i = 0; i < tdep->sc_num_regs; i++) - if (tdep->sc_reg_offset[i] != -1) - cache->saved_regs[i].addr = addr + tdep->sc_reg_offset[i]; + if (regnum == ARC_ILINK1_REGNUM || + regnum == ARC_ILINK2_REGNUM) + return 1; + + return 0; } - return cache; - //#endif + internal_error(__FILE__, __LINE__, _("bad register group")); + return 0; } + +/* This function is used by the DWARF-2 frame sniffer. + It is the architecture-specific register state initialization function: + it tells gdb how to find certain registers in the DWARF-2 Call Frame Information. */ + static void -arc_sigtramp_frame_this_id (struct frame_info *next_frame, void **this_cache, - struct frame_id *this_id) +arc_dwarf2_frame_init_reg (struct gdbarch *gdbarch, + int regnum, + struct dwarf2_frame_state_reg *reg, + struct frame_info *info) { - //FIXMEA: cleanup #ifdef ARC4_JTAG -#ifdef ARC_DEBUG - printf ("\narc_sigtramp_frame_this_id called"); -#endif - //#else - struct arc_unwind_cache *cache = - arc_sigtramp_frame_cache (next_frame, this_cache); - - (*this_id) = frame_id_build (cache->frame_base, frame_pc_unwind (next_frame)); - //#endif +// ENTERARGS("Regno no:%d, 0x%x", regnum, (unsigned int) regnum); + + /* Make sure that we know the number of the PC! */ + arc_check_pc_defined(gdbarch); + + /* The return address column. */ + if (regnum == ARC_PC_REGNUM) + reg->how = DWARF2_FRAME_REG_RA; + + /* The call frame address. */ + if (regnum == ARC_SP_REGNUM) + reg->how = DWARF2_FRAME_REG_CFA; } -static void -arc_sigtramp_frame_prev_register (struct frame_info *next_frame, - void **this_cache, - int regnum, int *optimizedp, - enum lval_type *lvalp, CORE_ADDR *addrp, - int *realnump, void *valuep) + +/* Unwind the frame to find the previous frame's PC. */ + +static CORE_ADDR +arc_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame) { - // FIXMEA: cleanup#ifdef ARC4_JTAG -#ifdef ARC_DEBUG - printf ("\narc_sigtramp_frame_prev_register called"); -#endif - //#else - struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch); + ULONGEST pc; - /* Make sure we've initialized the cache. */ - struct arc_unwind_cache *cache = - arc_sigtramp_frame_cache (next_frame, this_cache); + /* Make sure that we know the number of the PC! */ + arc_check_pc_defined(gdbarch); - /* on a signal, the PC is in ret */ -#ifdef ARC4_JTAG - if (regnum == ARC_STATUS_REGNUM) -#else - if(regnum == PC_REGNUM) -#endif - regnum = tdep->pc_regnum_in_sigcontext; - - trad_frame_get_prev_register (next_frame, cache->saved_regs, regnum, - optimizedp, lvalp, addrp, realnump, valuep); - //#endif + pc = frame_unwind_register_unsigned (next_frame, ARC_PC_REGNUM); + + DEBUG("unwind PC: 0x%08lx\n", (unsigned long) pc); + + return (CORE_ADDR) pc; } -static const struct frame_unwind arc_sigtramp_frame_unwind = -{ - SIGTRAMP_FRAME, - arc_sigtramp_frame_this_id, - arc_sigtramp_frame_prev_register -}; +/* Unwind the frame to find the previous frame's SP. */ -const struct frame_unwind * -arc_sigtramp_frame_sniffer (struct frame_info *next_frame) +static CORE_ADDR +arc_unwind_sp (struct gdbarch *gdbarch, struct frame_info *next_frame) { - //FIXMEA: cleanup#ifdef ARC4_JTAG -#ifdef ARC_DEBUG - printf ("\narc_sigtramp_frame_sniffer called() "); -#endif - //#else - CORE_ADDR pc = frame_pc_unwind (next_frame); - struct gdbarch_tdep *tdep = gdbarch_tdep (get_frame_arch (next_frame)); + ULONGEST sp; - /* We shouldn't even bother if we don't have a sigcontext_addr - handler. */ - if (tdep->sigcontext_addr == NULL) - return NULL; + sp = frame_unwind_register_unsigned (next_frame, ARC_SP_REGNUM); - if (tdep->sigtramp_p != NULL) - { - if (tdep->sigtramp_p (next_frame)) - { - return &arc_sigtramp_frame_unwind; - } - } + DEBUG("unwind SP: 0x%08lx\n", (unsigned long) sp); - return NULL; - //#endif + return (CORE_ADDR) sp; } +/* This function returns the convention used by the ABI for returning a result + of the given type from a function; it may also be required to: -/* Allow calls to be made to functions defined in the debuggee. - a.k.a dummy calls -*/ -/* When arguments must be pushed onto the stack, they go on in reverse - order. The below implements a FILO (stack) to do this. - Copied from d10v-tdep.c. */ + a) set the return value (this is for the situation where the debugger user + has issued a "return " command to request immediate return from + the current function with the given result; or + + b) get the return value ((this is for the situation where the debugger user + has executed a "call " command to execute the specified + function in the target program, and that function has a non-void result + which must be returned to the user. + + Parameters: + gdbarch : gdbarch structure for the backend to use if needed + valtype : the information for the return type of the function + regcache: the register cache to be used for altered register values + readbuf : if non-NULL, read the return value into this buffer + writebuf: if non-NULL, write the return value from this buffer + */ -struct stack_item +static enum return_value_convention +arc_return_value (struct gdbarch *gdbarch, + struct type *valtype, + struct regcache *regcache, + gdb_byte *readbuf, + const gdb_byte *writebuf) { - int len; - struct stack_item *prev; - void *data; -}; + ENTERARGS("readbuf = %p, writebuf = %p", readbuf, writebuf); + + { + /* If the return type is a struct, or a union, or would occupy more + than two registers, the ABI uses the "struct return convention": the + calling function passes a hidden first parameter to the callee (in R0). + That parameter is the address at which the value being returned + should be stored. Otherwise, the result is returned in registers. */ + Boolean is_struct_return = (TYPE_CODE (valtype) == TYPE_CODE_STRUCT || + TYPE_CODE (valtype) == TYPE_CODE_UNION || + TYPE_LENGTH (valtype) > 2 * BYTES_IN_REGISTER); + + /* case a) */ + if (writebuf != NULL) + { + /* gdb should not ask us to set a struct return value: it should + know the struct return location and write the value there + itself. */ + gdb_assert (!is_struct_return); + store_return_value (valtype, regcache, writebuf); + } + + /* case b) */ + if (readbuf != NULL) + { + /* gdb should not ask us to get a struct return value: it should + know the struct return location and read the value from there + itself. */ + gdb_assert (!is_struct_return); + extract_return_value (valtype, regcache, readbuf); + } + + return (is_struct_return) ? RETURN_VALUE_STRUCT_CONVENTION + : RETURN_VALUE_REGISTER_CONVENTION; + } +} + -static struct stack_item * -push_stack_item (struct stack_item *prev, void *contents, int len) +/* Assuming that next_frame->prev is a dummy, return the frame ID of that dummy + frame. The frame ID's base needs to match the TOS value saved by + save_dummy_frame_tos() (!!!! WHAT IS THIS???), and the PC to match the dummy + frame's breakpoint. */ + +static struct frame_id +arc_unwind_dummy_id (struct gdbarch *gdbarch, struct frame_info *next_frame) { - struct stack_item *si; - si = xmalloc (sizeof (struct stack_item)); - si->data = xmalloc (len); - si->len = len; - si->prev = prev; - memcpy (si->data, contents, len); - return si; + return frame_id_build (arc_unwind_sp (gdbarch, next_frame), + frame_pc_unwind (next_frame)); } -static struct stack_item * -pop_stack_item (struct stack_item *si) + +/* Signal Trampoline Frame Unwinder. + These unwinders allow frame unwinding to happen from within signal handlers. */ + +static UnwindCache * +arc_sigtramp_frame_cache (struct frame_info *next_frame, + void **this_cache) { - struct stack_item *dead = si; - si = si->prev; - xfree (dead->data); - xfree (dead); - return si; + ENTERMSG; + + if (*this_cache == NULL) + { + struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch); + UnwindCache *cache = create_cache(next_frame); + gdb_byte buf[BYTES_IN_REGISTER]; + + *this_cache = cache; + + /* Get the stack pointer and use it as the frame base. */ + frame_unwind_register (next_frame, ARC_SP_REGNUM, buf); + cache->frame_base = (CORE_ADDR) extract_unsigned_integer (buf, BYTES_IN_REGISTER); + + /* If the ARC-private target-dependent info has a table of offsets of + saved register contents within a O/S signal context structure. */ + if (tdep->sc_reg_offset) + { + /* Find the address of the sigcontext structure. */ + CORE_ADDR addr = tdep->sigcontext_addr (next_frame); + unsigned int i; + + /* For each register, if its contents have been saved within the + sigcontext structure, determine the address of those contents. */ + for (i = 0; i < tdep->sc_num_regs; i++) + if (tdep->sc_reg_offset[i] != REGISTER_NOT_PRESENT) + cache->saved_regs[i].addr = (LONGEST) (addr + tdep->sc_reg_offset[i]); + } + } + + return *this_cache; } +/* Construct id for the given frame. */ + +static void +arc_sigtramp_frame_this_id (struct frame_info *next_frame, + void **this_cache, + struct frame_id *this_id) +{ + UnwindCache *cache; + + ENTERMSG; + cache = arc_sigtramp_frame_cache (next_frame, this_cache); -/* arc_push_dummy_call : - * gdbarch : gdbarch structure for the backend to use if needed. - * function : - * regcache : - * bp_addr : Return address for the breakpoint. - * sp : Current value of sp. - * struct_return: struct_return is 1 if structures are returned by - * the function. - * struct_addr: Hidden address for returning a struct. - */ + *this_id = frame_id_build (cache->frame_base, frame_pc_unwind (next_frame)); +} -static CORE_ADDR -arc_push_dummy_call(struct gdbarch *gdbarch, struct value *function, - struct regcache *regcache, CORE_ADDR bp_addr, int nargs, - struct value **args, CORE_ADDR sp, int struct_return, - CORE_ADDR struct_addr) +/* Retrieve the value of the register in the frame. */ +static void +arc_sigtramp_frame_prev_register (struct frame_info *next_frame, + void **this_cache, + int regnum, + int *optimizedp, + enum lval_type *lvalp, + CORE_ADDR *addrp, + int *realnump, + gdb_byte *valuep) { - //#ifdef ARC4_JTAG -#ifdef ARC_DEBUG - printf ("\narc_push_dummy_call called"); -#endif - // #else - int stack_alloc; - int stack_offset; - int argreg; - int argnum; - - CORE_ADDR regval; - struct stack_item *si = NULL; - - - /* Push the return address. */ -#ifdef ARC4_JTAG - CORE_ADDR modified_bp_addr; - modified_bp_addr = arc_debug_fetch_regs(ARC_STATUS_REGNUM); - regcache_raw_collect(regcache, ARC_STATUS_REGNUM, &modified_bp_addr); - modified_bp_addr = modified_bp_addr & 0xff000000; - bp_addr = bp_addr >>2; - modified_bp_addr |= bp_addr; - regcache_cooked_write_unsigned (regcache, ARC_BLINK_REGNUM, modified_bp_addr); -#else - regcache_cooked_write_unsigned (regcache, ARC_BLINK_REGNUM, bp_addr); -#endif + ENTERMSG; - /* Are we returning a value using a structure return or a normal value - return? struct_addr is the address of the reserved space for the return - structure to be written on the stack. - */ - /* FIXME:: Ramana :: What about 4 byte structures returned in r0 as - claimed by Metaware. - */ - - /* Now load as many as possible of the first arguments into registers, - and push the rest onto the stack. */ - argreg = ARC_ARG0_REGNUM; - - if (struct_return) { - regcache_cooked_write_unsigned (regcache, ARC_ARG0_REGNUM, struct_addr); - argreg++; -#ifdef ARC4_JTAG - sp = sp - 16; -#endif + struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch); + + /* Make sure we've initialized the cache. */ + UnwindCache *cache = arc_sigtramp_frame_cache (next_frame, this_cache); + + /* On a signal, the PC is in ret. */ + if (regnum == ARC_PC_REGNUM) + regnum = tdep->pc_regnum_in_sigcontext; + + trad_frame_get_prev_register (next_frame, + cache->saved_regs, + regnum, + optimizedp, + lvalp, + addrp, + realnump, + valuep); } +} - stack_offset = 0; - for (argnum = 0; argnum < nargs; argnum++) +static const struct frame_unwind * +arc_sigtramp_frame_sniffer (struct frame_info *next_frame) +{ + ENTERMSG; + { - int len; - char *val; - int reg_demand; - int i; - - len = TYPE_LENGTH (VALUE_TYPE (args[argnum])); - val = (char *) VALUE_CONTENTS (args[argnum]); - - /* How may registers worth of storage do we need for this argument? */ - reg_demand = (len / 4) + (len % 4 != 0 ? 1 : 0); - - if (argreg + reg_demand - 1 <= ARC_ARG7_REGNUM) + struct gdbarch_tdep *tdep = gdbarch_tdep (get_frame_arch (next_frame)); + + /* We don't even bother if we don't have a sigcontext_addr handler. */ + if ((tdep->sigcontext_addr != NULL) && + (tdep->is_sigtramp != NULL) && + tdep->is_sigtramp (next_frame)) { - /* Data passed by value. Fits in available register(s). */ - for (i = 0; i < reg_demand; i++) + static const struct frame_unwind arc_sigtramp_frame_unwind = { - regcache_cooked_write_unsigned (regcache, argreg, - *(unsigned long *) val); - argreg++; - val += 4; - } + SIGTRAMP_FRAME, // type + arc_sigtramp_frame_this_id, // this_id + arc_sigtramp_frame_prev_register, // prev_register + NULL, // unwind_data + NULL, // sniffer + NULL, // prev_pc + NULL // dealloc_cache + }; + + return &arc_sigtramp_frame_unwind; } - else if (argreg <= ARC_ARG7_REGNUM) + + return NULL; + } +} + + +/* Allow calls to be made to functions defined in the debuggee (A.K.A dummy calls). + + Parameters: + gdbarch : gdbarch structure for the backend to use if needed. + function : the function to be called + regcache : the register cache to be used for altered register values + bp_addr : return address for the breakpoint. + nargs : the number of arguments to the function + args : the arguments to be passed to the function + sp : current value of SP. + struct_return: 1 if structures are returned by the function. + struct_addr : hidden address for returning a struct. */ + +static CORE_ADDR +arc_push_dummy_call (struct gdbarch *gdbarch, + struct value *function, + struct regcache *regcache, + CORE_ADDR bp_addr, + int nargs, + struct value **args, + CORE_ADDR sp, + int struct_return, + CORE_ADDR struct_addr) + +{ + int arg_reg = ARC_ABI_FIRST_ARGUMENT_REGISTER; + + ENTERARGS("nargs = %d, struct_return = %d", nargs, struct_return); + + /* Push the return address. */ + regcache_cooked_write_unsigned (regcache, ARC_BLINK_REGNUM, bp_addr); + + DEBUG("set BLINK = %X\n", (unsigned int) bp_addr); + + /* Are we returning a value using a structure return instead of a normal + value return? If so, struct_addr is the address of the reserved space + for the return structure to be written on the stack, and that address + is passed to that function as a hidden first argument. */ + + if (struct_return) + { + /* Pass the return address in the first argument register. */ + regcache_cooked_write_unsigned (regcache, arg_reg, struct_addr); + + DEBUG("struct return address 0x%08lX passed in R%d", struct_addr, arg_reg); + + arg_reg++; + } + + /* If the function has arguments. */ + if (nargs > 0) + { + Boolean big_endian = gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG; + unsigned int total_space = 0; + gdb_byte *memory_image; + gdb_byte *data; + int i; + + /* How much space do the arguments occupy in total? + N.B. must round each argument's size up to an integral number of words. */ + for (i = 0; i < nargs; i++) { - /* Data passed by value. Does not fit in available register(s). - Use the register(s) first, then the stack. */ - for (i = 0; i < reg_demand; i++) - { - if (argreg <= ARC_ARG7_REGNUM) - { - regcache_cooked_write_unsigned (regcache, argreg, - *(unsigned long *) val); - argreg++; - val += 4; - } - else - { - /* Push item for later so that pushed arguments - come in the right order. */ - si = push_stack_item (si, val, 4); - val += 4; - } - } + unsigned int len = TYPE_LENGTH (value_type (args[i])); + unsigned int space = ROUND_UP_TO_WORDS(len); + + total_space += space; + + DEBUG("function arg[%d]: %d bytes -> %d\n", i, len, space); } - else if (len > (2 * 4)) + + /* Allocate a buffer to hold a memory image of the arguments. */ + memory_image = XCALLOC((size_t) total_space, gdb_byte); + if (memory_image == NULL) { - /* FIXME */ - internal_error (__FILE__, __LINE__, "We don't do this"); + /* could not do the call! */ + return 0; } - else + + /* Now copy all of the arguments into the buffer, correctly aligned. */ + data = memory_image; + for (i = 0; i < nargs; i++) { - /* Data passed by value. No available registers. Put it on - the stack. */ - si = push_stack_item (si, val, len); + unsigned int len = TYPE_LENGTH (value_type (args[i])); + unsigned int space = ROUND_UP_TO_WORDS(len); + gdb_byte* actual = data; + unsigned int w; + + /* Parameters smaller than a word are normally aligned by gcc to the + least significant byte, so if we have a big-endian target we put + the data at the end of the word rather than at the start. */ + if ((len < BYTES_IN_WORD) && big_endian) + actual += BYTES_IN_WORD - len; + + (void) memcpy(actual, value_contents (args[i]), (size_t) len); + + DEBUG("function arg[%d] =", i); + for (w = 0; w < space / BYTES_IN_WORD; w++) + DEBUG(" 0x%08X", *((int*) data + w)); + DEBUG("\n"); + + data += space; } - } - while (si) - { - /* fp_arg must be word-aligned (i.e., don't += len) to match - the function prologue. */ - sp = (sp - si->len) & ~3; -#ifdef ARC4_JTAG - write_memory (sp + 16, si->data, si->len); -#else - write_memory (sp, si->data, si->len); -#endif - si = pop_stack_item (si); + /* Now load as much as possible of the memory image into registers. */ + data = memory_image; + while (arg_reg <= ARC_ABI_LAST_ARGUMENT_REGISTER) + { + ARC_RegisterContents contents = *(ARC_RegisterContents*) data; + + DEBUG("passing 0x%08X in register R%d\n", (unsigned int) contents, arg_reg); + + /* Convert to target byte order if necessary. */ + if (HOST_AND_TARGET_ENDIANNESS_DIFFER(gdbarch)) + { + contents = __bswap_32(contents); + DEBUG("byte-swapped to 0x%08X\n", contents); + } + + regcache_cooked_write_unsigned (regcache, + arg_reg, + (ULONGEST) contents); + + data += BYTES_IN_REGISTER; + total_space -= BYTES_IN_REGISTER; + + /* If all the data is now in registers. */ + if (total_space == 0) + break; + + arg_reg++; + } + + /* If there is any data left, push it onto the stack (in a single write operation). */ + if (total_space > 0) + { + DEBUG("passing %d bytes on stack\n", total_space); + + sp -= total_space; + write_memory (sp, data, (int) total_space); + } + + xfree(memory_image); } - /* Finally, update the SP register. */ - regcache_cooked_write_unsigned (regcache, ARC_SP_REGNUM, sp); + /* Finally, update the SP register. */ + regcache_cooked_write_unsigned (regcache, ARC_SP_REGNUM, sp); + + DEBUG("set SP = %X\n", (unsigned int) sp); - return sp; - //#endif + return sp; } -/* Align Frame */ + +/* Align frame. */ + static CORE_ADDR arc_frame_align (struct gdbarch *gdbarch, CORE_ADDR sp) { - /* Align to the normal alignment on the stack). */ - return sp & ~3; + /* Align to the normal alignment on the stack). */ + return WORD_ALIGNED(sp); } /* Print interesting information about the floating point processor (if present) or emulator. */ + static void arc_print_float_info (struct gdbarch *gdbarch, struct ui_file *file, - struct frame_info *frame, const char *args) + struct frame_info *frame, const char *args) { - printf("Software FPU \n"); + printf(_("Software FPU\n")); } /* Set the main_name to "_main" if required. This is set as an observer of inferior_created. */ + static void arc_set_main_name (struct target_ops *objfile, int from_tty) { - struct minimal_symbol *umainsym, *mainsym; - - /* Old ARC toolchains prepend an underscore to symbol names. If there is - an _main but no main, then we're probably debugging a binary that was - made with the old toolchain. */ - umainsym = lookup_minimal_symbol ("_main", NULL, NULL); - mainsym = lookup_minimal_symbol ("main", NULL, NULL); - if(umainsym && !mainsym) + /* Old ARC toolchains prepend an underscore to symbol names. If there is + an _main but no main, then we're probably debugging a binary that was + made with the old toolchain. */ + struct minimal_symbol *umainsym = lookup_minimal_symbol ("_main", NULL, NULL); + struct minimal_symbol *mainsym = lookup_minimal_symbol ("main", NULL, NULL); + + if ((umainsym != NULL) && (mainsym == NULL)) { - set_main_name ("_main"); + set_main_name ("_main"); } - /* If we don't have any symbols, the default, i.e. "main", will get used. */ + /* If we don't have any symbols, the default, i.e. "main", will get used. */ } -/* The following piece of code is borrowed from d10v */ -static void -a4_address_to_pointer (struct type *type, void *buf, CORE_ADDR addr) +/* This initialization function is called by gdb. + See gdbarch.h for a description of its parameters. */ + +static struct gdbarch* +arc_gdbarch_init (struct gdbarch_info info, + struct gdbarch_list *arches) { -#ifdef ARC4_JTAG - if (TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_FUNC - || TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_METHOD) - store_unsigned_integer (buf, TYPE_LENGTH (type), (addr>>2) & 0xffffff); - else - store_unsigned_integer (buf, TYPE_LENGTH (type), addr); + /* Allocate the ARC-private target-dependent information structure, and the + gdb target-independent information structure. */ + struct gdbarch_tdep *tdep = xmalloc (sizeof (struct gdbarch_tdep)); + struct gdbarch *gdbarch = gdbarch_alloc (&info, tdep); + + memset(tdep, 0, sizeof(*tdep)); + + /* Put stuff in gdbarch. */ + + /* Breakpoint manipulation. */ + set_gdbarch_breakpoint_from_pc (gdbarch, arc_breakpoint_from_pc); + set_gdbarch_decr_pc_after_break (gdbarch, 0); + + info.osabi = CONFIG_OSABI; + gdbarch_init_osabi(info, gdbarch); + + /* Characters are unsigned by default. */ + set_gdbarch_char_signed (gdbarch, 0); + + set_gdbarch_sp_regnum (gdbarch, ARC_SP_REGNUM); + set_gdbarch_register_type (gdbarch, arc_register_type); + set_gdbarch_print_float_info (gdbarch, arc_print_float_info); + + /* Advance PC across function entry code. */ + set_gdbarch_skip_prologue (gdbarch, arc_skip_prologue); + + /* Hook in the Dwarf-2 frame sniffer. */ + dwarf2_frame_set_init_reg (gdbarch, arc_dwarf2_frame_init_reg); + frame_unwind_append_sniffer (gdbarch, dwarf2_frame_sniffer); + + /* Signal frames. */ + frame_unwind_append_sniffer (gdbarch, arc_sigtramp_frame_sniffer); + + /* The stack grows downward. */ + set_gdbarch_inner_than (gdbarch, core_addr_lessthan); + set_gdbarch_unwind_pc (gdbarch, arc_unwind_pc); + set_gdbarch_unwind_sp (gdbarch, arc_unwind_sp); + set_gdbarch_unwind_dummy_id (gdbarch, arc_unwind_dummy_id); + frame_unwind_append_sniffer (gdbarch, arc_frame_sniffer); + set_gdbarch_return_value (gdbarch, arc_return_value); + + /* Add the ARC register groups. */ + reggroup_add (gdbarch, general_reggroup); + reggroup_add (gdbarch, all_reggroup); + reggroup_add (gdbarch, system_reggroup); + + set_gdbarch_register_reggroup_p (gdbarch, arc_register_reggroup_p); + + set_gdbarch_cannot_step_breakpoint (gdbarch, 1); + set_gdbarch_frame_align(gdbarch, arc_frame_align); + + /* Dummy Frame handling. */ + set_gdbarch_push_dummy_call (gdbarch, arc_push_dummy_call); + set_gdbarch_call_dummy_location (gdbarch, AT_ENTRY_POINT); + + /* N.B. we do not want to call arcompact_get_disassembler at this point, as we do + not as yet have an executable file, so do not know whether we want + the disassembler for the A4 architecture (still supported by the + opcodes library!) or the one for the ARCompact architecture; also, + it is better to pass the arcompact_get_disassembler function a valid bfd + structure, rather than a faked one, so that it can read the ARC- + specific sections in the ELF file (for whatever reason...). + + So just set up a dummy disassembler at this point (gdb requires that + *some* disassembler is defined for an architecture), and set up a + callback which will set up the appropriate disassembler once an + executable file has been selected for debugging. */ + +#if 0 + { + /* The arc libopcodes wants abfd so that it can find out what CPU + extensions are there. */ + bfd abfd; + + abfd.sections = NULL; + + set_gdbarch_print_insn(gdbarch, arcompact_get_disassembler(&abfd)); + } #endif + set_gdbarch_print_insn(gdbarch, dummy_disassembler); + (void) observer_attach_new_objfile(set_disassembler); + + /* Set main_name to _main if necessary. Ideally we'd want a hook that + gets called when symbols are loaded, but it seems there isn't one; so + we'll use this. This will not work if the user does "target remote + ..." and then "add-symbol-file ...". */ + (void) observer_attach_inferior_created (arc_set_main_name); + + /* Initialize the target-dependent modules (if any). */ + CONFIG_INIT_TDEP + + /* Return a pointer to the new object - indicates that a new architecture + has been created. */ + return gdbarch; } -static CORE_ADDR -a4_pointer_to_address (struct type *type, const void *buf) + +static void +arc_dump_tdep (struct gdbarch *current_gdbarch, struct ui_file *file) { -#ifdef ARC4_JTAG - CORE_ADDR addr = extract_unsigned_integer (buf, TYPE_LENGTH(type)); - /* Is it a code address? */ - if (TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_FUNC - || TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_METHOD - || TYPE_CODE_SPACE (TYPE_TARGET_TYPE (type))) - return ((addr<<2) & 0x2ffffff); - else - return addr; -#endif + /* Do nothing. */ } -static struct gdbarch * -arc_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) + +/* -------------------------------------------------------------------------- */ +/* local functions implementing commands */ +/* -------------------------------------------------------------------------- */ + +/* [ ] + Display annotated stack frame. */ + +static void +arc_show_stack_frame_command (char *arg, int from_tty) { - struct gdbarch_tdep *tdep; - struct gdbarch *gdbarch; + struct frame_info *fi; + gdb_byte value[MAX_REGISTER_SIZE]; + CORE_ADDR pc, fp, sp, old_sp; + CORE_ADDR addr; + enum lval_type lval; + int optimized; + int realnum; + int frame_size; + unsigned int *frame_contents; + LocalVariable *variables; + unsigned int num_variables; + + /* Find the frame. */ + fi = parse_frame_specification_1 (arg, _("No stack."), NULL); + gdb_assert(fi != NULL); + + /* Find out PC, FP and SP for the frame. */ + pc = get_frame_pc(fi); + sp = get_frame_sp(fi); + get_frame_register(fi, ARC_FP_REGNUM, value); + fp = (CORE_ADDR) extract_unsigned_integer (value, BYTES_IN_REGISTER); + + DEBUG("*** PC = %x, FP = %x, SP = %x\n", (unsigned int) pc, (unsigned int) fp, (unsigned int) sp); + + if (pc == 0) + { + warning(_("invalid frame")); + return; + } - tdep = xmalloc (sizeof (struct gdbarch_tdep)); - gdbarch = gdbarch_alloc (&info, tdep); - - /* Fixme :: Worry about default initialization of breakpoints - for the ARC platform. In our case currently this is handled - out of arc-linux-tdep.c for default arc linux breakpoints. - */ + frame_register_unwind (fi, ARC_SP_REGNUM, &optimized, &lval, &addr, &realnum, value); + old_sp = (CORE_ADDR) extract_unsigned_integer (value, BYTES_IN_REGISTER); - info.osabi = CONFIG_OSABI; - gdbarch_init_osabi(info, gdbarch); - - /* Put stuff in gdbarch. */ + /* Find the local variables and parameters. */ + variables = find_local_variables(fi, &num_variables); - /* Characters are unsigned by default */ - set_gdbarch_char_signed (gdbarch, 0); + printf_filtered(NEW_LINE); + identify_frame(fi); - set_gdbarch_print_float_info (gdbarch, arc_print_float_info); - set_gdbarch_sp_regnum (gdbarch, ARC_SP_REGNUM); - set_gdbarch_register_type (gdbarch, arc_register_type); + DEBUG(_("\n\n*** FRAME: 0x%x .. 0x%x\n\n"), (unsigned int) sp, (unsigned int) (old_sp - 1)); - set_gdbarch_cannot_store_register (gdbarch, arc_cannot_store_register); + frame_size = (int) (old_sp - sp); + frame_contents = xmalloc((size_t) frame_size); - /* Advance PC across function entry code. */ - set_gdbarch_skip_prologue (gdbarch, arc_skip_prologue); + if (frame_contents) + { + /* Read all of the frame's contents from target memory. */ + if (target_read_memory(sp, (gdb_byte*) frame_contents, frame_size) == 0) + { + int numregs = ARC_TOTAL_REGS; + int i = frame_size / BYTES_IN_WORD - 1; + unsigned int the_same = 0; + unsigned int previous_word = 0; + Boolean first_word = TRUE; + Boolean is_following_element; + Boolean elements_are_word_sized; - - /* Hook in the Dwarf-2 frame sniffer. */ - set_gdbarch_dwarf2_reg_to_regnum (gdbarch, arc_binutils_reg_to_regnum); - dwarf2_frame_set_init_reg (gdbarch, arc_dwarf2_frame_init_reg); - frame_unwind_append_sniffer (gdbarch, dwarf2_frame_sniffer); + addr = old_sp - BYTES_IN_WORD; - /* signal frames */ - frame_unwind_append_sniffer (gdbarch, arc_sigtramp_frame_sniffer); + printf_filtered(NEW_LINE); + /* Traverse the frame from high address to low address, one word at a time. */ + while (i >= 0) + { + unsigned int this_word = frame_contents[i]; + Boolean print = first_word; /* Always print the first word. */ + char line[256]; + int n; + /* Start with a blank line. */ + (void) memset(line, (int) ' ', sizeof(line)); - /* The stack grows downward. */ - set_gdbarch_inner_than (gdbarch, core_addr_lessthan); + /* Does FP and/or SP address this particular stack location? */ + if (addr == sp && fp == sp) + { + (void) strcpy(line + 14, _("SP/FP ===> ")); + line[25] = ' '; + print = TRUE; + } + else if (addr == sp) + { + (void) strcpy(line + 17, _("SP ===> ")); + line[25] = ' '; + print = TRUE; + } + else if (addr == fp) + { + (void) strcpy(line + 17, _("FP ===> ")); + line[25] = ' '; + print = TRUE; + } - set_gdbarch_unwind_pc (gdbarch, arc_unwind_pc); - set_gdbarch_unwind_sp (gdbarch, arc_unwind_sp); - set_gdbarch_unwind_dummy_id (gdbarch, arc_unwind_dummy_id); - frame_unwind_append_sniffer (gdbarch, arc_frame_sniffer); - + /* Does this stack location hold a local variable or parameter? */ + if ((add_local_name(line + 38, + addr, + variables, + num_variables, + &is_following_element, + &elements_are_word_sized))) + { + /* Yes - so we want to print it (but this may be revised below!). */ + print = TRUE; + } + else + { + int r; + + /* Does this location hold a saved register? */ + for (r = 0; r < numregs; r++) + { + if (r != ARC_SP_REGNUM && + gdbarch_register_reggroup_p (current_gdbarch, r, all_reggroup)) + { + CORE_ADDR saved_addr; + + /* Find out the location of the saved register without + fetching the corresponding value. */ + frame_register_unwind (fi, r, &optimized, &lval, &saved_addr, &realnum, NULL); + + if (!optimized && lval == lval_memory && saved_addr == addr) + { + (void) sprintf(line + 38, _("saved register '%s'"), gdbarch_register_name(current_gdbarch, r)); + print = TRUE; + break; + } + } + } + } - set_gdbarch_return_value (gdbarch, arc_return_value); + /* Do we think we need to print out the line? */ + if (print) + { + /* If the location is a non-zeroth word-sized array element, + and this word is the same as the previous word. */ + if (is_following_element && elements_are_word_sized && (this_word == previous_word)) + { + /* No need to print it - one more word the same! */ + the_same++; + print = FALSE; + } + } + else + { + /* N.B. this will not be the first word (since print is FALSE) */ + + /* This location does not hold anything "interesting", but + if this word is not the same as the previous word, we + want to print it. */ + if (this_word == previous_word) + the_same++; + else + print = TRUE; + } - /* Add the arc register groups. */ - arc_add_reggroups (gdbarch); - set_gdbarch_register_reggroup_p (gdbarch, arc_register_reggroup_p); - - /* Breakpoint manipulation. */ - set_gdbarch_breakpoint_from_pc (gdbarch, arc_breakpoint_from_pc); - set_gdbarch_frame_align(gdbarch,arc_frame_align); + /* OK, now we really know whether we need to print out the line. */ + if (print) + { + n = sprintf(line, _("0x%08X:"), (unsigned int) addr); + line[n] = ' '; + + n = sprintf(line + 25, "%08X", this_word); + line[25 + n] = ' '; + + n = (int) sizeof(line) - 1; + while (line[n] == ' ') n--; + line[n + 1] = '\0'; + + /* If we did not print the previous word because it was the + same as the word before, but not the same as any preceding + words, print it now (there is no point in outputting a + message which says simply "... 1 words omitted" - we might + just as well print out the word! */ + if (the_same == 1) + printf_filtered(_("0x%08X: %08X\n"), (unsigned int) addr + BYTES_IN_WORD, previous_word); + else if (the_same != 0) + /* 2 or more words the same... */ + printf_filtered(_("... %u words omitted\n"), the_same); + + /* Now print out the line with the current word (and other information). */ + printf_filtered(_("%s\n"), line); + + /* No words omitted. */ + the_same = 0; + } - /* Dummy Frame handling */ - set_gdbarch_push_dummy_call (gdbarch, arc_push_dummy_call); - set_gdbarch_call_dummy_location (gdbarch,AT_ENTRY_POINT); - - /* Disassembly. */ - { - /* the arc libopcodes wants abfd so that it can find out what CPU - extensions are there */ - bfd abfd; - abfd.sections = NULL; + first_word = FALSE; + previous_word = this_word; + addr -= BYTES_IN_WORD; + i--; + } -#ifndef ARC4_JTAG - set_gdbarch_print_insn(gdbarch, arcompact_get_disassembler(&abfd)); -#else - set_gdbarch_print_insn(gdbarch, arc_get_disassembler(&abfd)); -#endif - } + printf_filtered(NEW_LINE); + } -#ifdef ARC4_JTAG - set_gdbarch_address_to_pointer (gdbarch, a4_address_to_pointer); - set_gdbarch_pointer_to_address (gdbarch, a4_pointer_to_address); -#endif - //#ifndef ARC4_JTAG - /* Set main_name to _main if necessary. Ideally we'd want a hook that - gets called when symbols are loaded, but it seems there isn't one; so - we'll use this. This will not work if the user does "target remote - ..." and then "add-symbol-file ..." */ - observer_attach_inferior_created (arc_set_main_name); - //#endif - -#ifdef ARC4_JTAG - // set_gdbarch_write_pc (gdbarch, a4_write_pc); -#endif + xfree(frame_contents); + } - CONFIG_INIT_TDEP (gdbarch); - - return gdbarch; + xfree(variables); } -static void -arc_dump_tdep (struct gdbarch *current_gdbarch, struct ui_file *file) + +/* -------------------------------------------------------------------------- */ +/* externally visible functions */ +/* -------------------------------------------------------------------------- */ + +/* Initialize the module. This function is called from the gdb core on start-up. */ + +void +_initialize_arc_tdep (void) { + /* Register the ARC processor architecture with gdb, providing an + initialization function and a dump function; 'bfd_arch_arc' is + an enumeration value specifically denoting the ARC architecture. */ + gdbarch_register(bfd_arch_arc, arc_gdbarch_init, arc_dump_tdep); + + /* Register ARC-specific commands with gdb. */ + + add_setshow_boolean_cmd(DEBUG_COMMAND, + no_class, + &arc_debug_target, + _("Set whether to print ARC debug messages.\n"), + _("Show whether to print ARC debug messages.\n"), + _("If set debug messages are printed.\n"), + NULL, + NULL, + &setlist, + &showlist); + + (void) add_cmd(SHOW_FRAME_COMMAND, + class_obscure, + arc_show_stack_frame_command, + _("Display the stack frame with annotation.\n" + SHOW_FRAME_COMMAND_USAGE + " may be the number or address of a frame.\n"), + &cmdlist); } + +/* Initialize the info structure to enable the disassembler to be used. */ + void -_initialize_arc_tdep (void) +arc_initialize_disassembler (struct disassemble_info *info) { - gdbarch_register (bfd_arch_arc, arc_gdbarch_init, arc_dump_tdep); + /* N.B. this type cast is not strictly correct: the return types differ! */ + init_disassemble_info(info, gdb_stdout, (fprintf_ftype) fprintf_filtered); + info->arch = gdbarch_bfd_arch_info(current_gdbarch)->arch; + info->mach = gdbarch_bfd_arch_info(current_gdbarch)->mach; + info->endian = gdbarch_byte_order (current_gdbarch); + info->read_memory_func = read_memory_for_disassembler; } +/******************************************************************************/ diff --git a/gdb/arc-tdep.h b/gdb/arc-tdep.h index 4251eb4..8f33072 100644 --- a/gdb/arc-tdep.h +++ b/gdb/arc-tdep.h @@ -1,109 +1,148 @@ -/* Target dependent code for ARC700, for GDB, the GNU debugger. +/* Target dependent code for ARC processor family, for GDB, the GNU debugger. - Copyright 2005 Free Software Foundation, Inc. + Copyright 2005, 2008, 2009 Free Software Foundation, Inc. Contributed by Codito Technologies Pvt. Ltd. (www.codito.com) - Authors: - Soam Vasani - Ramana Radhakrishnan + Authors: + Soam Vasani + Ramana Radhakrishnan + Richard Stuckey This file is part of GDB. - + 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 + the Free Software Foundation; either version 3 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. -*/ -enum arc700_api_regnums - { - ARC_ARG0_REGNUM = 0, - ARC_ARG1_REGNUM = 1, - ARC_ARG2_REGNUM = 2, - ARC_ARG3_REGNUM = 3, - ARC_ARG4_REGNUM = 4, - ARC_ARG5_REGNUM = 5, - ARC_ARG6_REGNUM = 6, - ARC_ARG7_REGNUM = 7, - - /* When a return value is stored in registers, is in either r0 or in - (r1,r0). Used in arc_extract_return_value */ - ARC_RETURN1_REGNUM = 0, - ARC_RETURN2_REGNUM = 1 - }; - - - -enum ARCProcessorVersion - { - UNSUPPORTED, - ARCompact, - ARC600, - ARC700, - A5, - A4, - }; - - -enum ARCExtensionsSupportedInformation - { - ARC700_MMU - }; - - - -typedef struct ARCProcessorInformation -{ - enum ARCProcessorVersion arcprocessorversion; - enum ARCExtensionsSupportedInformation extensionsSupported; + along with this program. If not, see . */ + +/******************************************************************************/ +/* */ +/* Outline: */ +/* This header file defines some target-dependent information which is */ +/* specific to the ARC gdb port. */ +/* */ +/******************************************************************************/ + +#ifndef ARC_TDEP_H +#define ARC_TDEP_H + +/* ARC header files */ +#include "arc-support.h" + + +#define ARC_PC_REGNUM (gdbarch_pc_regnum (current_gdbarch)) +#define ARC_NUM_REGS (gdbarch_num_regs (current_gdbarch)) +#define ARC_NUM_PSEUDO_REGS (gdbarch_num_pseudo_regs (current_gdbarch)) +#define ARC_TOTAL_REGS (ARC_NUM_REGS + ARC_NUM_PSEUDO_REGS) + + +#define ARC_MAX_CORE_REGS 64 +#define ARC_FIRST_EXTENSION_CORE_REGISTER 32 +#define ARC_LAST_EXTENSION_CORE_REGISTER 59 +#define ARC_NUM_EXTENSION_CORE_REGS (ARC_LAST_EXTENSION_CORE_REGISTER - ARC_FIRST_EXTENSION_CORE_REGISTER + 1) +#define ARC_NUM_STANDARD_CORE_REGS (ARC_MAX_CORE_REGS - ARC_NUM_EXTENSION_CORE_REGS) + + +#define IS_EXTENSION_CORE_REGISTER(hw_regnum) (ARC_FIRST_EXTENSION_CORE_REGISTER <= (hw_regnum) && (hw_regnum) <= ARC_LAST_EXTENSION_CORE_REGISTER) + + +/* ARC processor ABI-related registers: + R0 .. R7 are the registers used to pass arguments in function calls + R13 .. R26 are the callee-saved registers + when a return value is stored in registers it is in either R0 or in the pair (R0,R1). */ + +#define ARC_ABI_GLOBAL_POINTER 26 +#define ARC_ABI_FRAME_POINTER 27 +#define ARC_ABI_STACK_POINTER 28 -}ARCVariantsInfo; +#define ARC_ABI_FIRST_CALLEE_SAVED_REGISTER 13 +#define ARC_ABI_LAST_CALLEE_SAVED_REGISTER 26 + +#define ARC_ABI_FIRST_ARGUMENT_REGISTER 0 +#define ARC_ABI_LAST_ARGUMENT_REGISTER 7 +#define ARC_ABI_REGISTER_PARAMETER_SPACE ((ARC_ABI_LAST_ARGUMENT_REGISTER - ARC_ABI_FIRST_ARGUMENT_REGISTER + 1) * BYTES_IN_REGISTER) + +#define ARC_ABI_RETURN_REGNUM 0 +#define ARC_ABI_RETURN_LOW_REGNUM 0 +#define ARC_ABI_RETURN_HIGH_REGNUM 1 + +#define IS_ARGUMENT_REGISTER(hw_regnum) (ARC_ABI_FIRST_ARGUMENT_REGISTER <= (hw_regnum) && (hw_regnum) <= ARC_ABI_LAST_ARGUMENT_REGISTER) + + +/* This type is completed in the files arc-elf32-tdep.h and arc-linux-tdep.h, + as apppropriate for the arc-elf2 and arc-uclinux builds of gdb. */ +typedef struct arc_variant_info ARC_VariantsInfo; + + +#define REGISTER_NOT_PRESENT (-1) // special value for sc_reg_offset[reg] + + +/* N.B. this assumes that the host is little-endian! */ +#define HOST_AND_TARGET_ENDIANNESS_DIFFER(arch) (gdbarch_byte_order (arch) == BFD_ENDIAN_BIG) + + +/* This structure holds target-dependent information. + + N.B. this type is used in the target-independent gdb code, but it is treated + as an opaque (or private) type: the only use of it is by pointers to + objects of this type (passed as parameters or returned as results, or + held in other structures); it is only the ARC-specific modules that + have knowledge of the structure of this type and access its fields. */ struct gdbarch_tdep { - /* Detect sigtramp. */ - int (*sigtramp_p) (struct frame_info *); - - /* Get address of sigcontext for sigtramp. */ - CORE_ADDR (*sigcontext_addr) (struct frame_info *); - - /* Offset of registers in `struct sigcontext'. */ - int *sc_reg_offset; - int sc_num_regs; - - /* In our linux target, gdbarch_pc_regnum points to stop_pc, which is a - register that's made-up by the kernel and does not actually exist. - stop_pc is NOT saved in the sigcontext; what is saved is the ret - "register". Since ret is a linux-only register, it's regnum is visible - only in arc-linux-tdep.c; hence initialize pc_regnum_in_sigcontext in - arc-linux-tdep.c. */ - int pc_regnum_in_sigcontext; - - /* Returns false, true, or -1; -1 means the tdep has nothing to say about this - register and group. */ - int (*register_reggroup_p) (int, struct reggroup *); - - /* Breakpoint instruction to be used */ - unsigned char * arc_breakpoint_insn; - int arc_breakpoint_size; - - /* For stopping backtraces. */ - CORE_ADDR lowest_pc; - - /* ARC Processor variant information. */ - ARCVariantsInfo * arc_processor_variant_info ; - + /* Detect sigtramp. */ + Boolean (*is_sigtramp) (struct frame_info*); + + /* Get address of sigcontext for sigtramp. */ + CORE_ADDR (*sigcontext_addr) (struct frame_info*); + + /* Offset of registers in `struct sigcontext'. */ + const int *sc_reg_offset; + unsigned int sc_num_regs; + + /* In our linux target, gdbarch_pc_regnum points to stop_pc, which is a + register that is made up by the kernel and does not actually exist. + stop_pc is NOT saved in the sigcontext; what is saved is the ret + "register". Since ret is a linux-only register, its regnum is visible + only in arc-linux-tdep.c; hence initialize pc_regnum_in_sigcontext in + arc-linux-tdep.c. */ + int pc_regnum_in_sigcontext; + + /* Returns 0, 1, or -1: + 0 means the register is not in the group. + 1 means the register is in the group. + -1 means the tdep has nothing to say about this register and group. */ + int (*register_reggroup_p) (int regnum, struct reggroup *group); + + /* Breakpoint instruction to be used. */ + const unsigned char *be_breakpoint_instruction; + const unsigned char *le_breakpoint_instruction; + unsigned int breakpoint_size; + + /* For stopping backtraces. */ + CORE_ADDR lowest_pc; + + /* ARC processor variant information (may be NULL). */ + ARC_VariantsInfo *processor_variant_info; }; -void arc_software_single_step(enum target_signal ignore, int insert_breakpoints_p); +/* Utility functions used by other ARC-specific modules. */ + +void arc_initialize_disassembler (struct disassemble_info *info); + +/* A global debug flag. */ +extern Boolean arc_debug_target; +#endif /* ARC_TDEP_H */ +/******************************************************************************/ diff --git a/gdb/arc-xiss.c b/gdb/arc-xiss.c new file mode 100755 index 0000000..2319f36 --- /dev/null +++ b/gdb/arc-xiss.c @@ -0,0 +1,1787 @@ +/* Target dependent code for ARC processor family, for GDB, the GNU debugger. + + Copyright 2009 Free Software Foundation, Inc. + + Contributed by ARC International (www.arc.com) + + Authors: + Richard Stuckey + + This file is part of GDB. + + 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 3 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, see . */ + +/******************************************************************************/ +/* */ +/* Outline: */ +/* This module creates an instance of a gdb 'target_ops' structure which */ +/* contains information and operations for debugging using the ARC xISS */ +/* (Fast Instruction Set Simulator) as the target. */ +/* */ +/* Instruction Tracing: */ +/* Two different kind of instruction tracing are supported: */ +/* */ +/* 1) a minimal trace which records only the address of each instruction */ +/* which is executed; */ +/* */ +/* 2) a more detailed trace which includes the ordinal number of the */ +/* instruction in the trace, condition code settings, instruction */ +/* address, instruction disassembly, and the values of source and */ +/* destination operands. */ +/* */ +/* The minimal trace is recorded by the xISS in an internal buffer whose */ +/* size may be determined by the gdb user; this buffer wraps around, so */ +/* that only the addresses of the most recently executed instructions are */ +/* held. This data may then be saved to a file for subsequent inspection. */ +/* The trace data is written in an encoding which gives a reduction in */ +/* size of approximately 80% compared to the raw data. */ +/* */ +/* See the manual */ +/* */ +/* ARC GDB-Insight */ +/* GNU Debugger With Insight GUI */ +/* Getting Started */ +/* 6009-001 */ +/* */ +/* for full information on how to use these trace facilities. */ +/* */ +/* Usage: */ +/* The module exports a function _initialize_arc_xiss: the call to this */ +/* function is generated by the gdb build mechanism, so this function */ +/* should not be explicitly called. */ +/* */ +/******************************************************************************/ + +/* gdb configuration file */ +#include "config.h" + +/* This macro should be defined in the configuration file only if the arcint.h + file is available. */ +#ifdef HAVE_LIBXISS + +/* system header files */ +#include +#include +#include + +/* gdb header files */ +#include "defs.h" +#include "inferior.h" +#include "disasm.h" +#include "gdbcmd.h" +#include "objfiles.h" +#include "libiberty.h" +#include "completer.h" +#include "gdb_assert.h" + +/* ARC header files */ +#include "config/arc/tm-embed.h" +#include "arc-xiss.h" +#include "arc-tdep.h" +#include "arc-elf32-tdep.h" +#include "arc-architecture.h" +#include "arc-inst-tracing.h" +#include "arc-registers.h" + +/* This must be defined before arcint.h is included. */ +#define OEM_USE_OF_DEBUGGER_HEADER_FILES 1 + +/* This defines the interface by which the xISS is accessed. */ +#include "arcint.h" + + +/* -------------------------------------------------------------------------- */ +/* local types */ +/* -------------------------------------------------------------------------- */ + +typedef struct ARC* (*ARC_Interface)(void); + +typedef enum +{ + XISS_HALTED, + XISS_STEPPED, + XISS_TO_BE_RUN +} ExecutionStatus; + + +/* N.B. this is taken from arcint.cpp; there must be a better way of doing this! */ +struct ARC +{ + ARC_functab *pftp; /* Pointer to interface function table. */ +}; + +typedef void* WatchpointCookie; + +typedef struct _association +{ + WatchpointCookie cookie; + CORE_ADDR addr; + int length; + int type; +} Association; + + +/* -------------------------------------------------------------------------- */ +/* local data */ +/* -------------------------------------------------------------------------- */ + +#define ARC_TARGET_NAME "arcxiss" +#define ARC_INTERFACE "get_ARC_interface" + +#define SAVE_TRACE_TO_FILE_COMMAND "arc-xiss-save-trace" +#define EMPTY_TRACE_BUFFER_COMMAND "arc-xiss-empty-trace-buffer" +#define LIST_TRACE_COMMAND "arc-xiss-list-trace" + +#define SAVE_TRACE_TO_FILE_COMMAND_USAGE "Usage: " SAVE_TRACE_TO_FILE_COMMAND " \n" +#define EMPTY_TRACE_BUFFER_COMMAND_USAGE "Usage: " EMPTY_TRACE_BUFFER_COMMAND "\n" +#define LIST_TRACE_COMMAND_USAGE "Usage: " LIST_TRACE_COMMAND " [ FROM= ] [ TO= ] [ ]\n" + + +/* N.B. the xISS does not currently use the context parameter supplied for + memory read/write operations, so its value is irrelevant. */ +#define XISS_CONTEXT 0 + + +/* The gdb target operations structure for this target. */ +static struct target_ops xISS_target_ops; + +/* A set of pointers to operations for reading/writing registers/memory in the + xISS target. */ +static TargetOperations operations; + +/* Handles for access to the xISS target. */ +static void *xISS_DLL_handle; +static struct ARC *xiss_instance; +static ARC_functab *xISS_functions; + +/* The status of program execution on the xISS target. */ +static ExecutionStatus xISS_executionStatus; + +/* Data for handling instruction tracing. */ +static Boolean xISS_trace_instructions; +static char *xiss_trace_file; +static int xiss_trace_buffer_size; + +/* This is the table for associating watchpoint details with watchpoint cookies. */ +static Association *associations; +static unsigned int num_associations; + +/* The address of data to which access caused a watchpoint to trigger. */ +static CORE_ADDR stopped_data_address; + + +/* -------------------------------------------------------------------------- */ +/* local macros */ +/* -------------------------------------------------------------------------- */ + +#define EXTRACT(argument, type, result) \ +{ \ + struct expression *expr = parse_expression(argument); \ + struct value *val = evaluate_expression(expr); \ + struct cleanup *chain = make_cleanup(free_current_contents, &expr); \ + \ + result = *(type*) (value_contents (val)); \ + result ## _specified = TRUE; \ + do_cleanups (chain); \ +} + +/* This macro must cope with the cases: + var = value + var =value + var= value + var=value */ +#define GET_PARAMETER(var) \ + if (strncasecmp(argv[i], #var "=", sizeof(#var)) == 0) \ + { \ + if (argv[i][sizeof(#var)] == '\0') \ + { \ + i++; \ + if (argv[i] == NULL) \ + invalid = TRUE; \ + else \ + { \ + EXTRACT(argv[i], Ordinal, var) \ + i++; \ + } \ + } \ + else \ + { \ + EXTRACT(argv[i] + sizeof(#var), Ordinal, var) \ + i++; \ + } \ + } \ + else if (strcasecmp(argv[i], #var) == 0) \ + { \ + i++; \ + if (argv[i] == NULL) \ + invalid = TRUE; \ + else \ + { \ + if (argv[i][0] == '=') \ + { \ + if (argv[i][1] == '\0') \ + { \ + i++; \ + if (argv[i] == NULL) \ + invalid = TRUE; \ + else \ + { \ + EXTRACT(argv[i], Ordinal, var) \ + i++; \ + } \ + } \ + else \ + { \ + EXTRACT(argv[i] + 1, Ordinal, var) \ + i++; \ + } \ + } \ + else \ + invalid = TRUE; \ + } \ + } + + +#define CHECK_RANGE(source) \ +{ \ + if (from_specified) \ + { \ + if (from < first || from > last) \ + { \ + warning(_("%s contains instruction range %llu .. %llu - using %llu as FROM"), \ + source, first, last, first); \ + gdb_flush(gdb_stderr); \ + from = first; \ + } \ + } \ + else \ + from = first; \ + \ + if (to_specified) \ + { \ + if (to < first || to > last) \ + { \ + warning(_("%s contains instruction range %llu .. %llu - using %llu as TO"), \ + source, first, last, last); \ + gdb_flush(gdb_stderr); \ + to = last; \ + } \ + } \ + else \ + to = last; \ +} + + +#define XISS_PROPERTY(key,value) xISS_functions->process_property(xiss_instance, key, value) + +#define IS_SUPPORTED(flag) ((xISS_functions->supports_feature(xiss_instance) & (flag)) != 0) + +#define XISS_AUX_REG(hw_regno) ((ARC_REG_TYPE) hw_regno + (ARC_REG_TYPE) AUX_BASE) +#define XISS_CORE_REG(hw_regno) ((ARC_REG_TYPE) hw_regno) + + +/* -------------------------------------------------------------------------- */ +/* local functions */ +/* -------------------------------------------------------------------------- */ + +/* -------------------------------------------------------------------------- */ +/* 1) functions for watchpoint table */ +/* -------------------------------------------------------------------------- */ + +/* These functions implement a linear lookup table which associate an xISS + watchpoint cookie with the watchpoint's address, length and type; this is + not very efficient, but is quite sufficient for relatively small numbers of + watchpoints. If we should need to handle large numbers of watchpoints + efficiently, a more sophisticated data structure may be required. */ + + +/* Add an association to the table. */ + +static void +associate (WatchpointCookie cookie, CORE_ADDR addr, int length, int type) +{ + Association *new = NULL; + unsigned int i; + + for (i = 0; i < num_associations; i++) + { + Association *association = &associations[i]; + + if (association->cookie == NULL) + { + new = association; + break; + } + } + + if (new == NULL) + { + Association *new_associations = xrealloc(associations, sizeof(Association) * (num_associations + 1)); + + if (new_associations == NULL) + nomem(0); + + associations = new_associations; + new = &new_associations[num_associations]; + num_associations++; + } + + new->cookie = cookie; + new->addr = addr; + new->length = length; + new->type = type; +} + + +/* Remove an association from the table, returning the cookie. */ + +static WatchpointCookie +disassociate (CORE_ADDR addr, int length, int type) +{ + unsigned int i; + + for (i = 0; i < num_associations; i++) + { + Association *association = &associations[i]; + + if (association->addr == addr && + association->length == length && + association->type == type) + { + WatchpointCookie cookie = association->cookie; + + association->cookie = NULL; + return cookie; + } + } + + return NULL; +} + + +/* Find the address associated with a cookie. */ + +static CORE_ADDR +find (WatchpointCookie cookie) +{ + unsigned int i; + + for (i = 0; i < num_associations; i++) + { + Association *association = &associations[i]; + + if (association->cookie == cookie) + return association->addr; + } + + return 0; +} + + +/* -------------------------------------------------------------------------- */ +/* 2) functions for reading/writing registers */ +/* -------------------------------------------------------------------------- */ + +/* N.B. the register contents returned by these functions, or supplied to them, + are in host byte order - the arcint.cpp interface to the xISS requires + this. */ + +/* Read a core register on the target. + + Parameters: + hw_regno : the ARC hardware number of the register + value : set to the contents of the register + warn_on_failure: TRUE if a warning should be issued if the read fails + + Result: TRUE if the register contents are read. */ + +static Boolean +read_xiss_core_register (ARC_RegisterNumber hw_regno, + ARC_RegisterContents *contents, + Boolean warn_on_failure) +{ + unsigned long value; + int result = xISS_functions->read_reg(xiss_instance, XISS_CORE_REG(hw_regno), &value); + + if (result == 1) + { + *contents = (ARC_RegisterContents) value; + DEBUG("Read value 0x%08X from core register %d\n", *contents, hw_regno); + return TRUE; + } + + if (warn_on_failure) + arc_elf32_core_warning(ERROR_ON_READING_REGISTER, hw_regno); + return FALSE; +} + + +/* Write a core register on the target. + + Parameters: + hw_regno : the ARC hardware number of the register + value : set to the contents of the register + warn_on_failure: TRUE if a warning should be issued if the write fails + + Result: TRUE if the register contents are written. */ + +static Boolean +write_xiss_core_register (ARC_RegisterNumber hw_regno, + ARC_RegisterContents contents, + Boolean warn_on_failure) +{ + int result = xISS_functions->write_reg(xiss_instance, XISS_CORE_REG(hw_regno), (unsigned long) contents); + + if (result == 1) + { + DEBUG("Written value 0x%08X to core register %d\n", contents, hw_regno); + return TRUE; + } + + if (warn_on_failure) + arc_elf32_core_warning(ERROR_ON_WRITING_REGISTER, hw_regno); + return FALSE; +} + + +/* Read an auxiliary register on the target. + + Parameters: + hw_regno : the ARC hardware number of the register + value : set to the contents of the register + warn_on_failure: TRUE if a warning should be issued if the read fails + + Result: TRUE if the register contents are read. */ + +static Boolean +read_xiss_aux_register (ARC_RegisterNumber hw_regno, + ARC_RegisterContents *contents, + Boolean warn_on_failure) +{ + unsigned long value; + int result = xISS_functions->read_reg(xiss_instance, XISS_AUX_REG(hw_regno), &value); + + if (result == 1) + { + *contents = (ARC_RegisterContents) value; + DEBUG("Read value 0x%08X from auxiliary register %d\n", *contents, hw_regno); + return TRUE; + } + + if (warn_on_failure) + arc_elf32_aux_warning(ERROR_ON_READING_REGISTER, hw_regno); + return FALSE; +} + + +/* Write an auxiliary register on the target. + + Parameters: + hw_regno : the ARC hardware number of the register + value : the contents of the register + warn_on_failure: TRUE if a warning should be issued if the write fails + + Result: TRUE if the register contents are written. */ + +static Boolean +write_xiss_aux_register (ARC_RegisterNumber hw_regno, + ARC_RegisterContents contents, + Boolean warn_on_failure) +{ + ARC_AuxRegisterDefinition *def = arc_find_aux_register_by_hw_number(hw_regno); + int result; + + if (def) + contents = arc_write_value(def, contents); + + result = xISS_functions->write_reg(xiss_instance, XISS_AUX_REG(hw_regno), (unsigned long) contents); + + if (result == 1) + { + DEBUG("Written value 0x%08X to auxiliary register %d\n", contents, hw_regno); + return TRUE; + } + + if (warn_on_failure) + arc_elf32_aux_warning(ERROR_ON_WRITING_REGISTER, hw_regno); + return FALSE; +} + + +/* -------------------------------------------------------------------------- */ +/* 3) functions for reading/writing memory */ +/* -------------------------------------------------------------------------- */ + +/* These functions should NOT be used within this module: they are intended + purely for use by the arc-memory module for reading/writing multiple words + of data at word-aligned addresses. */ + +static unsigned int +read_words (ARC_Address address, + ARC_Byte *data, + unsigned int words) +{ + DEBUG("reading %u words from 0x%08X in xISS\n", words, address); + + gdb_assert(IS_WORD_ALIGNED(address)); + + return (unsigned int) xISS_functions->read_memory + (xiss_instance, + (unsigned long) address, + data, + (unsigned long) words * BYTES_IN_WORD, + XISS_CONTEXT); +} + + +static unsigned int +write_words (ARC_Address address, + ARC_Byte *data, + unsigned int words) +{ + gdb_assert(IS_WORD_ALIGNED(address)); + + DEBUG("writing %u words to 0x%08X in xISS\n", words, address); + + return (unsigned int) xISS_functions->write_memory + (xiss_instance, + (unsigned long) address, + data, + (unsigned long) words * BYTES_IN_WORD, + XISS_CONTEXT); +} + + +static unsigned int +write_pattern (ARC_Address address, + ARC_Word pattern, + unsigned int words) +{ + gdb_assert(IS_WORD_ALIGNED(address)); + + DEBUG("writing pattern 0x%08X repeated %u times to 0x%08X in xISS\n", pattern, words, address); + + return (unsigned int) xISS_functions->fill_memory + (xiss_instance, + (unsigned long) address, + &pattern, + BYTES_IN_WORD, + (unsigned int) words, + XISS_CONTEXT); +} + + +/* -------------------------------------------------------------------------- */ +/* 4) functions for xISS interface management */ +/* -------------------------------------------------------------------------- */ + +/* Open the interface to the debug target. + + Parameters: + systemfile: the .xis file defining the simulated target + from_tty : non-zero if the 'target' command was issued at the terminal +*/ + +static Boolean +open_xISS_interface (const char *systemfile, int from_tty) +{ + const char *xiss_home = getenv("XISS_HOME"); + char library[FILENAME_MAX]; + ARC_Interface arc_interface; + + if (xiss_home == NULL) + error(_("Environment variable XISS_HOME is not set")); + + /* Construct the path to the xISS .so file. */ + (void) snprintf(library, sizeof(library), "%s/lib/libxiss.so", xiss_home); + + /* Try to dynamically load the shared object library containing the xISS. */ + xISS_DLL_handle = dlopen(library, RTLD_LAZY); + + if (xISS_DLL_handle == NULL) + { + const char *diagnostic = dlerror(); + + if (strstr(diagnostic, library)) + error(_("Can not open xISS shared library %s"), diagnostic); + else + error(_("Can not open xISS shared library %s: %s"), library, diagnostic); + } + + /* Find the function in the library which will create an instacne of the xISS. */ + arc_interface = dlsym(xISS_DLL_handle, ARC_INTERFACE); + + if (arc_interface == NULL) + error(_("Can not find function %s in xISS shared library %s"), ARC_INTERFACE, library); + + /* Create an xISS instance. */ + xiss_instance = arc_interface(); + + if (xiss_instance == NULL) + error(_("Can not create instance of xISS")); + + /* Get a pointer to the table of functions provided by the interface. */ + xISS_functions = xiss_instance->pftp; + + DEBUG("xISS interface : %s\n", xISS_functions->id(xiss_instance)); + DEBUG("xISS interface version: %d\n", xISS_functions->version(xiss_instance)); + + /* Tell the xISS what system file to use to define the simulated target. */ + if (XISS_PROPERTY("xiss_sys", systemfile) != 1) + error(_("xISS could not process 'xiss_sys' property")); + + if (IS_SUPPORTED(ARC_FEATURE_fill_memory)) + operations.fill_memory = write_pattern; + + (void) xISS_functions->prepare_for_new_program(xiss_instance, 1); + + /* This is somewhat inelegant, but commands read from scripts in the gdb + testsuite are regarded as though they were being input interactively + (i.e. from_tty is 1), and interactive queries may be made (such as + asking the user whether the program currently being debugged should be + killed first) - and these queries hang the tests! + + So, if the environment variable is set, assume that the gdb test suite is + being run, so that no such queries will be made. + + It is not possible to make this check in the top-level command handler + loop, as the output from some other commands (e.g. 'file') depend on the + from_tty parameter passed to them, and the gdb test scripts expect to get + the interactive version of the output! */ + target_preopen(from_tty && (getenv("ARC_GDB_TEST") == NULL)); + + return TRUE; +} + + +/* Close the JTAG interface to the debug target. + + Parameter: + resume: TRUE if program execution on the target should be allowed to resume. */ + +static void +close_xISS_interface (Boolean resume) +{ + /* If we have a target connected. */ + if (xiss_instance != NULL) + { + /* It is meaningless to resume execution of the xISS. */ + arc_elf32_close(FALSE); + + /* If we are doing instruction tracing. */ + if (xiss_trace_file) + { + /* Ensure that the trace file is closed. */ + if (XISS_PROPERTY("trace_file", "") != 1) + error(_("xISS could not process 'trace_file' property")); + } + + /* Close the connection. */ + xISS_functions->destroy(xiss_instance); + + /* Close the library. */ + if (dlclose(xISS_DLL_handle) != 0) + warning(_("error on closing xISS shared library: %s"), dlerror()); + + xiss_instance = NULL; + xISS_functions = NULL; + xISS_DLL_handle = NULL; + } +} + + +/* -------------------------------------------------------------------------- */ +/* 5) functions for starting/stopping the processor */ +/* -------------------------------------------------------------------------- */ + +/* Run the xISS for whatever quantum of instructions that it executes. */ +static void +run_processor (void) +{ + int result = xISS_functions->run(xiss_instance); + + if (result == 0) + warning(_("could not run")); +} + + +/* -------------------------------------------------------------------------- */ +/* 6) local functions called from outside this module (from gdb) */ +/* -------------------------------------------------------------------------- */ + +/* Connect to the xISS target. + + Parameters: + args : user arguments to the 'target' command + from_tty: non-zero if the 'target' command was issued at the terminal + + The arguments may be: + + If the name of a system file is not specified, a file 'default.xis' is + assumed. */ + +static void +arc_xISS_open (char *args, int from_tty) +{ + char *systemfile = (args) ? args : "default.xis"; + + ENTERARGS("\"%s\" (%d)", (args) ? args : "", from_tty); + + if (access(systemfile, R_OK) != 0) + { + char *file = getenv("XISS_SYSTEM_FILE"); + + if (file == NULL) + error(_("Invalid xISS system file '%s': %s"), systemfile, strerror(errno)); + else + if (access(file, R_OK) != 0) + error(_("Invalid xISS system file '%s': %s"), file, strerror(errno)); + else + systemfile = file; + } + + arc_program_is_loaded = FALSE; + + xISS_trace_instructions = FALSE; + xiss_trace_file = NULL; + xISS_executionStatus = XISS_HALTED; + xiss_trace_buffer_size = 0; + + num_associations = 0; + associations = NULL; + + /* Find any well-known aux register numbers that we will need. */ + arc_elf32_find_register_numbers(); + + /* Just to be sure that it is not in the target stack... */ + (void) unpush_target (&xISS_target_ops); + + /* Now try to open the xISS interface. */ + if (open_xISS_interface(systemfile, from_tty)) + { + (void) push_target (&xISS_target_ops); + + if (from_tty) + printf_filtered (_("Connected to the " ARC_TARGET_NAME " target.\n")); + } + else + error(_("Can not connect to target")); +} + + +/* Close the connection to the target. */ + +static void +arc_xISS_close (int quitting) /* Ignored. */ +{ + ENTERMSG; + + close_xISS_interface(FALSE); + + xfree(associations); + associations = NULL; + num_associations = 0; +} + + +/* Cause the inferior on the debug target to resume execution, sending a signal + if necessary. + + Parameters: + ptid : the thread id of the thread to be resumed (ignored) + step : 1 means single step, 0 run freely. + signal: the number of the signal to be sent + + N.B. signals are not supported. */ + +static void +arc_xISS_resume (ptid_t ptid, int step, enum target_signal signal) +{ + ENTERARGS("%d, %d, %d", ptid.pid, step, signal); + + if (signal != TARGET_SIGNAL_0) + error(_("Signals are not supported by the " ARC_TARGET_NAME " target")); + + if (step) + { + int result = xISS_functions->step(xiss_instance); + + if (result == 0) + error(_("Can not single-step")); + else + xISS_executionStatus = XISS_STEPPED; + } + else + xISS_executionStatus = XISS_TO_BE_RUN; + + LEAVEMSG; +} + + +/* Wait for execution on the target to halt (for whatever reason). + + Parameters : + ptid : ignored + status: set to indicate status at end of the wait +*/ + +static ptid_t +arc_xISS_wait (ptid_t ptid, struct target_waitstatus *status) +{ + ENTERARGS("xISS execution status: %d", xISS_executionStatus); + + /* What was done the last time that execution was resumed? */ + switch (xISS_executionStatus) + { + case XISS_STEPPED: + DEBUG("processor has stepped\n"); + status->kind = TARGET_WAITKIND_STOPPED; + status->value.sig = TARGET_SIGNAL_TRAP; + break; + + case XISS_TO_BE_RUN: + arc_elf32_execute(status, + run_processor, + NULL, + NULL); + + if (status->kind == TARGET_WAITKIND_EXITED) + target_mark_exited (&xISS_target_ops); + break; + + case XISS_HALTED: + break; + } + + LEAVEMSG; + + return inferior_ptid; +} + + +/* This gets called just before store_regs. */ + +static void +arc_xISS_prepare_to_store (struct regcache *regcache) +{ + ENTERMSG; +} + + +static void +arc_xISS_files_info (struct target_ops *target) +{ + /* Do nothing. */ + ENTERMSG; +} + + +/* Heavy duty arsenal. Kill the process. */ + +static void +arc_xISS_kill (void) +{ + ENTERMSG; + + target_mourn_inferior (); +} + + +/* Load the program into memory via the xISS interface. */ + +static void +arc_xISS_load (char *args, int from_tty) +{ + /* The program will be downloaded to the simulator. */ + (void) xISS_functions->prepare_for_new_program(xiss_instance, 1); + + arc_elf32_load_program(args, from_tty); + + /* Tell xISS that program is fully loaded. */ + if (XISS_PROPERTY("download_complete", "1") != 1) + error(_("xISS could not process 'download_complete' property")); + + /* We now have a program ready for execution on the target. */ +} + + +/* Create the inferior that will be executed upon the target. + + Parameters : + exec_file: the executable file containing the program to be executed + args : the command line arguments to be passed to the program + env : the environment (name/value pairs) for the program + from_tty : ignored + */ + +static void +arc_xISS_create_inferior (char *exec_file, char *args, char **env, int from_tty) +{ + arc_elf32_create_inferior(exec_file, args, env, &xISS_target_ops); +} + + +/* Mourn the inferior. */ + +static void +arc_xISS_mourn_inferior (void) +{ + ENTERMSG; + +// (void) unpush_target (&xISS_target_ops); + + /* N.B. we must delete all breakpoints from the target here: the gdb core + function generic_mourn_inferior marks all breakpoints as not being + inserted on the target, with the result that subsequent calls to + remove_breakpoints will NOT remove any breakpoints that are set on + the target; this means that if target execution is re-started, gdb + will attempt to re-insert the breakpoints, which causes a problem + with software breakpoints: the target insert_breakpoint function + reads the code at the b/p address (which is the s/w b/p instruction) + and saves it as the "overwritten" code - so when the breakpoint is + subsequently removed, the b/p instruction is written back to the + b/p address again! That is not what is desired... */ + (void) remove_breakpoints(); + generic_mourn_inferior(); + current_target.to_has_execution = 0; +} + + +/* Check whether the given thread is alive. */ + +static int +arc_xISS_thread_alive (ptid_t ptid) +{ + ENTERMSG; + + /* We only have one thread. */ + return 1; +} + + +/* Check whether our debug target is runnable: return 1 if it is, 0 otherwise. */ + +static int arc_xISS_can_run (void) +{ + /* If we are connected to the xISS i/f, and a program is loaded. */ + return (xiss_instance != NULL) && arc_program_is_loaded; +} + + +/* We do not support asynchronous execution of the target program (i.e. commands + like 'run' or 'continue' or 'step' can not be executed in background mode + by appending a '&' to them) so we do not need to implement the target stop + operation (called by the 'interrupt' command); interrupting a running program + is handled by the Ctrl-C mechanism. */ + +#if 0 +static void +arc_xISS_stop (void) +{ + ENTERMSG; +} +#endif + + +/* Check if we can set a "hardware" watchpoint of type TYPE. TYPE is + one of bp_hardware_watchpoint, bp_read_watchpoint, bp_write_watchpoint, or + bp_hardware_breakpoint. COUNT is the number of such watchpoints used so far + (including this one). OTHERTYPE is the total number of "hardware" breakpoints + and watchpoints of other types that are "already" set + (0 if type == bp_hardware_breakpoint). + + Result: 0 if hardware watchpoints are not supported + -1 if there are not enough hardware watchpoints + 1 if there are enough hardware watchpoints + + N.B. this is not what is stated in target.h, but it does conform to the use + made of this function's result in breakpoint.c! */ + +static int +arc_xISS_can_use_hw_breakpoint (int type, int count, int othertype) +{ + ENTERARGS("type %d, count %d", type, count); + + switch (type) + { + case bp_hardware_watchpoint: + case bp_read_watchpoint: + case bp_watchpoint: /* This means bp_write_watchpoint. */ + return 1; + case bp_hardware_breakpoint: + return 0; + default: + return 0; + } +} + + +/* Insert a "hardware" watchpoint on the target. + + Parameters: + addr : the start address of the region of memory to be watched + length: the length in bytes of the region of memory + type : 0 => write, 1 => read, 2 => read/write + + Returns 0 for success, -1 for failure. */ + +static int +arc_xISS_insert_watchpoint (CORE_ADDR addr, int length, int type) +{ + WatchpointCookie cookie; + unsigned int options; + + ENTERARGS("0x%08X:%d %d", (unsigned int) addr, length, type); + + gdb_assert(length > 0); + + switch (type) + { + case 0: + options = ARC_WATCHPOINT_write; + break; + case 1: + options = ARC_WATCHPOINT_read; + break; + case 2: + options = ARC_WATCHPOINT_read | ARC_WATCHPOINT_write; + break; + default: + internal_error (__FILE__, __LINE__, _("invalid watchpoint type: %d"), type); + } + + if (xISS_functions->set_mem_watchpoint2(xiss_instance, (unsigned long) addr, length, options, &cookie) == 1) + { + associate(cookie, addr, length, type); + return 0; + } + + return 1; +} + + +/* Remove a "hardware" watchpoint from the target. + + Parameters: + addr : the start address of the region of memory being watched + length: the length in bytes of the region of memory + type : 0 => write, 1 => read, 2 => read/write + + Returns 0 for success, non-zero for failure. */ + +static int +arc_xISS_remove_watchpoint (CORE_ADDR addr, int length, int type) +{ + WatchpointCookie cookie = disassociate(addr, length, type); + + ENTERARGS("0x%x:%d %d", (unsigned int) addr, length, type); + + if (cookie != NULL) + return (xISS_functions->remove_watchpoint(xiss_instance, cookie) == 1) ? 0 : 1; + return 1; +} + + +/* Returns non-zero if the execution of the target program has been stopped by + the trigger of a "hardware" watchpoint (i.e. on memory read or write), zero + otherwise. */ + +static int +arc_xISS_stopped_by_watchpoint (void) +{ + WatchpointCookie cookie; + + ENTERMSG; + + if (xISS_functions->stopped_at_watchpoint2(xiss_instance, &cookie) == 1) + { + /* Regrettably, the arcint i/f does not provide a well-defined means for + finding out the address of the data which was accessed - to do this + we have had to define a special property which returns the required + address! */ + int result = XISS_PROPERTY("watchpoint", "return_hit_address"); + + if (result == 0) + { + DEBUG("xISS could not process 'watchpoint/return_hit_address' property"); + + /* The most we can do now is retrieve the start address of the + watchpoint which was triggered... + N.B. we must retrieve the watchpoint address here, rather than in + the arc_xISS_stopped_data_address function, as gdb deletes + all breakpoint and watchpoints from the target as soon as + execution is halted, which removes the cookie from the table! */ + stopped_data_address = find(cookie); + } + else + stopped_data_address = (CORE_ADDR) result; + + return 1; + } + + return 0; +} + + +/* Get the address of the data that was read/written causing a h/w watchpoint to + trigger; the address is returned in the '*addr' parameter. + Returns 0 for failure, non-zero for success. */ + +static int +arc_xISS_stopped_data_address (struct target_ops *ops, CORE_ADDR *addr) +{ + ENTERMSG; + + DEBUG("data addr: 0x%08X\n", (unsigned int) stopped_data_address); + *addr = stopped_data_address; + + return 1; +} + + +/* Can a h/w watchpoint 'length' bytes long be set at address 'addr' in target memory? */ + +static int +arc_xISS_region_ok_for_hw_watchpoint (CORE_ADDR addr, int length) +{ + /* As far as we know, we can set a h/w watchpoint anywhere. */ + return 1; +} + + +/* -------------------------------------------------------------------------- */ +/* 7) functions for instruction tracing */ +/* -------------------------------------------------------------------------- */ + +/* Display the instruction at the given address and ordinal position in the + instruction trace. */ + +static void +display_instruction (Ordinal ordinal, unsigned int address) +{ + /* N.B. must use fprintf_filtered here, rather than fprintf_unfiltered, as + gdb_print_insn calls fprintf_filtered, and if we mix the use of the + two we can get garbled output! */ + fprintf_filtered(gdb_stdout, "<0x%016llX> 0x%08X ", ordinal, address); + (void) gdb_print_insn((CORE_ADDR) address, gdb_stdout, NULL); + fprintf_filtered(gdb_stdout, "\n"); +} + + +/* Get the ordinal position of the first instruction in the trace buffer in the + sequence of executed instructions from the xISS; return 0 if this number cannot + be obtained. */ + +static Ordinal +get_instruction_trace_start (void) +{ + /* N.B. XISS_PROPERTY returns 0 if the property is not handled. */ + int start_low = XISS_PROPERTY("instruction_trace", "return_start_count_low"); + int start_high = XISS_PROPERTY("instruction_trace", "return_start_count_high"); + Ordinal start = ((Ordinal) start_high) << 32 | (Ordinal) start_low; + + DEBUG("get_instruction_trace_start : %llu\n", start); + + return start; +} + + +/* Encode the instruction trace buffer retrieved from the xISS: the buffer + 'trace' contains 'length' entries which are all PC values. The data is + recorded in the currently open trace file in a packed format. */ + +static void +encode_instruction_trace (unsigned int trace[], int length) +{ + unsigned int lastPC = trace[0]; + int i; + + /* Store the first entry in the buffer as an absolute address. */ + arc_encode_PC(ABSOLUTE_31_BITS, lastPC / 2); + + /* Look at all the remaining entries, comparing each with the previous one. */ + for (i = 1; i < length; i++) + { + unsigned int thisPC = trace[i]; + int delta = (int) thisPC - (int) lastPC; + + /* Encode the difference in the PC as a relative offset, if possible. + Offsets of 0 (branch to current address), 2, 4, 6 and 8 (instruction + sizes + optional immediate size) are handled as special cases. */ + + if (delta == 0) + arc_encode_PC(NO_CHANGE, 0); + else if (delta == 2) + arc_encode_PC(PLUS_16_BITS, 0); + else if (delta == 4) + arc_encode_PC(PLUS_32_BITS, 0); + else if (delta == 6) + arc_encode_PC(PLUS_48_BITS, 0); + else if (delta == 8) + arc_encode_PC(PLUS_64_BITS, 0); + else if (0 < delta && delta <= MAX_DELTA) + arc_encode_PC(DELTA_16_BIT_POSITIVE, ENCODE_DELTA(delta)); + else if (0 > delta && delta >= -MAX_DELTA) + arc_encode_PC(DELTA_16_BIT_NEGATIVE, ENCODE_DELTA(-delta)); + else + arc_encode_PC(ABSOLUTE_31_BITS, thisPC / 2); + + lastPC = thisPC; + } + + /* Useful tracing code: dump buffer as raw binary. */ +#if 0 + { + int binary = open("trace.binary", O_CREAT | O_WRONLY, 0666); + + if (binary == -1) + warning(_("could not open file trace.binary")); + else + { + (void) write(binary, trace, length * sizeof(unsigned int)); + (void) close(binary); + } + } +#endif +} + + +/* Decode the instruction trace buffer retrieved from a file. This is the inverse + of the encoding performed by the 'encode_instruction_trace' function. + The instruction at each PC value decoded is disassembled and displayed only if + its ordinal position in the trace is in the range given by the 'from' and 'to' + parameters. */ + +static void +decode_instruction_trace (Ordinal from, Ordinal to, Ordinal ordinal) +{ + ARC_ProgramCounterEncoding encoding; + unsigned int thisPC = 0; + unsigned int lastPC = 0; + unsigned int value; + + while (arc_decode_PC(&encoding, &value)) + { + switch (encoding) + { + case NO_CHANGE: + break; + case PLUS_16_BITS: + thisPC += 2; + break; + case PLUS_32_BITS: + thisPC += 4; + break; + case PLUS_48_BITS: + thisPC += 6; + break; + case PLUS_64_BITS: + thisPC += 8; + break; + case DELTA_16_BIT_POSITIVE: + thisPC += DECODE_DELTA(value); + break; + case DELTA_16_BIT_NEGATIVE: + thisPC -= DECODE_DELTA(value); + break; + case ABSOLUTE_31_BITS: + thisPC = value * 2; + break; + } + + if (from <= ordinal && ordinal <= to) + display_instruction(ordinal, thisPC); + + lastPC = thisPC; + ordinal++; + } +} + + +/* -------------------------------------------------------------------------- */ +/* 8) helper routines for added commands */ +/* -------------------------------------------------------------------------- */ + +/* Check that the xISS target is actually connected. */ + +static void +check_connected (void) +{ + if (xiss_instance == NULL) + error(_("Target " ARC_TARGET_NAME " is not connected")); +} + + +/* Set the size of the buffer to be used by the xISS for instruction trace data. */ + +static void +set_trace_buffer_size (int size) +{ + char sz[20]; + + (void) snprintf(sz, sizeof(sz), "%d", size); + + if (XISS_PROPERTY("trace_buffer_size", sz) != 1) + error(_("xISS could not process 'trace_buffer_size' property")); +} + + +/* Tell the xISS to switch instruction tracing on or off. */ + +static void +set_xiss_trace (char *args, + int from_tty, + struct cmd_list_element *e) +{ + check_connected(); + + if (XISS_PROPERTY("trace", (xISS_trace_instructions) ? "on" : "off") != 1) + error(_("xISS could not process 'trace' property")); +} + + +/* Show the status of xISS instruction tracing. */ + +static void +show_xiss_trace (struct ui_file *file, + int from_tty, + struct cmd_list_element *c, + const char *value) +{ + /* Value will be either "on" or "off". */ + fprintf_filtered(file, + _("xISS instruction tracing is %s.\n"), + value); +} + + +/* Tell the xISS to write the instruction trace to the file whose name is held + in the xiss_trace_file global variable. */ + +static void +set_xiss_trace_file (char *args, + int from_tty, + struct cmd_list_element *e) +{ + check_connected(); + + if (xiss_trace_file) + { + if (XISS_PROPERTY("trace_file", xiss_trace_file) != 1) + error(_("xISS could not process 'trace_file' property")); + } +} + + +/* Show the name of the trace file (if any) which is currently receiving + instruction tracing output from the xISS. */ + +static void +show_xiss_trace_file (struct ui_file *file, + int from_tty, + struct cmd_list_element *c, + const char *value) +{ + if (*value == '\0') + fprintf_filtered(file, + _("No output file is set for xISS instruction tracing.\n")); + else + fprintf_filtered(file, + _("The output file for xISS instruction tracing is '%s'.\n"), + value); +} + + +/* Set the size of the buffer used by the xISS for instruction trace data. */ + +static void +set_xiss_trace_buffer_size (char *args, + int from_tty, + struct cmd_list_element *e) +{ + check_connected(); + + if (xiss_trace_buffer_size < 0) + error(_("Trace buffer size must be non-negative")); + + set_trace_buffer_size(xiss_trace_buffer_size); +} + + +/* Show the size of the buffer used by the xISS for instruction trace data. */ + +static void +show_xiss_trace_buffer_size (struct ui_file *file, + int from_tty, + struct cmd_list_element *c, + const char *value) +{ + fprintf_filtered(file, + _("The buffer size for xISS instruction tracing is %s entries.\n"), + value); +} + + +/* -------------------------------------------------------------------------- */ +/* 9) local functions implementing commands */ +/* -------------------------------------------------------------------------- */ + +/* Command: + + Save the contents of the xISS instruction trace buffer to the named file. + + We should eventually change this to use the ui_out stuff rather than + printf_filtered. */ + +static void +arc_save_trace_to_file_command (char *arg, int from_tty) +{ + int count; + + if (!arg) + { + printf_filtered (_(SAVE_TRACE_TO_FILE_COMMAND_USAGE)); + return; + } + + check_connected(); + + count = xISS_functions->instruction_trace_count(xiss_instance); + + if (count) + { + unsigned int *buffer; + + if (access(arg, F_OK) == 0) + if (!query(_("File already exists. Do you wish to overwrite it?"))) + return; + + printf_unfiltered(_("%u instructions in trace buffer\n"), count); + + buffer = xmalloc(count * sizeof(unsigned int)); + + if (buffer) + { + Ordinal first = get_instruction_trace_start(); + + xISS_functions->get_instruction_traces(xiss_instance, buffer); + + if (arc_start_encoding(arg, first)) + { + encode_instruction_trace(buffer, count); + arc_stop_encoding(first + (Ordinal) count - 1); + } + + xfree(buffer); + } + else + warning(_("can not allocate buffer to hold instruction trace data")); + } + else + warning(_("no instruction trace data available")); +} + + + +/* Command: + + Discard the contents of the xISS instruction trace buffer. */ + +static void +arc_empty_trace_buffer (char *arg, int from_tty) +{ + if (arg) + { + printf_filtered (_(EMPTY_TRACE_BUFFER_COMMAND_USAGE)); + return; + } + + check_connected(); + + set_trace_buffer_size(0); + set_trace_buffer_size(xiss_trace_buffer_size); +} + + +/* Command: [ FROM= ] [ TO= ] [ ] + + Display some or all of the instruction trace, either from the xISS trace + buffer or from a named file. */ + +static void +arc_list_trace (char *arg, int from_tty) +{ + char *file = NULL; + Boolean from_specified = FALSE; + Boolean to_specified = FALSE; + Ordinal from = 0; + Ordinal to = 0; + Ordinal first; + Ordinal last; + + /* Do we have arguments to the command? */ + if (arg) + { + char **argv = buildargv (arg); + Boolean invalid = FALSE; + int i = 0; + + if (argv == NULL) + nomem (0); + + while (argv[i] != NULL) + { +// printf("argv[%d] = %s\n", i, argv[i]); + + GET_PARAMETER(from) + else + GET_PARAMETER(to) + else + { + /* Assume the argument is the file name. */ + file = xstrdup(argv[i]); + i++; + } + } + + freeargv(argv); + + if (invalid) + { + printf_filtered (_(LIST_TRACE_COMMAND_USAGE)); + return; + } + + DEBUG("FROM = %llu\n", from); + DEBUG("TO = %llu\n", to); + + if (from > to) + error("FROM (%lld) > TO (%lld)", from, to); + } + + /* If we must get the instruction trace from a file. */ + if (file) + { + /* Try to open the named file and start decoding its contents. */ + if (arc_start_decoding(file, &first, &last)) + { + CHECK_RANGE("file") + decode_instruction_trace(from, to, first); + arc_stop_decoding(); + } + + xfree(file); + } + else + { + unsigned int count; + + check_connected(); + + /* Get the number of entries in the xISS instruction trace buffer. */ + count = (unsigned int) xISS_functions->instruction_trace_count(xiss_instance); + + if (count > 0) + { + unsigned int *buffer = xmalloc(count * sizeof(unsigned int)); + + if (buffer) + { + Ordinal i; + + first = get_instruction_trace_start(); + last = first + (Ordinal) count - 1; + + CHECK_RANGE("trace buffer") + + /* Get the contents of the xISS instruction trace buffer. */ + xISS_functions->get_instruction_traces(xiss_instance, buffer); + + /* Display the required range of the trace. */ + for (i = from; i <= to; i++) + display_instruction(i, buffer[(int) (i - from)]); + + xfree(buffer); + } + else + warning(_("can not allocate buffer to hold instruction trace data")); + } + else + warning(_("no instruction trace data available")); + } +} + + +/* -------------------------------------------------------------------------- */ +/* 10) initialization functions */ +/* -------------------------------------------------------------------------- */ + +/* Initialize the xISS target operations. */ + +static void +initialize_xISS_target_ops (void) +{ + ENTERMSG; + + xISS_target_ops.to_data = &operations; + + xISS_target_ops.to_shortname = ARC_TARGET_NAME; + xISS_target_ops.to_longname = "xISS debug target (ARC Processors)"; + xISS_target_ops.to_doc = "xISS (Fast Instruction Set Simulator) debug target (ARC Processors)"; + + xISS_target_ops.to_open = arc_xISS_open; + xISS_target_ops.to_close = arc_xISS_close; + xISS_target_ops.to_resume = arc_xISS_resume; + xISS_target_ops.to_wait = arc_xISS_wait; + + xISS_target_ops.to_fetch_registers = arc_elf32_fetch_registers; + xISS_target_ops.to_store_registers = arc_elf32_store_registers; + xISS_target_ops.to_prepare_to_store = arc_xISS_prepare_to_store; + xISS_target_ops.to_xfer_partial = arc_elf32_xfer_partial; + xISS_target_ops.to_files_info = arc_xISS_files_info; + + xISS_target_ops.to_can_use_hw_breakpoint = arc_xISS_can_use_hw_breakpoint; +// xISS_target_ops.to_insert_hw_breakpoint = arc_xISS_insert_hw_breakpoint; +// xISS_target_ops.to_remove_hw_breakpoint = arc_xISS_remove_hw_breakpoint; + xISS_target_ops.to_insert_watchpoint = arc_xISS_insert_watchpoint; + xISS_target_ops.to_remove_watchpoint = arc_xISS_remove_watchpoint; + xISS_target_ops.to_stopped_by_watchpoint = arc_xISS_stopped_by_watchpoint; + xISS_target_ops.to_stopped_data_address = arc_xISS_stopped_data_address; + xISS_target_ops.to_region_ok_for_hw_watchpoint = arc_xISS_region_ok_for_hw_watchpoint; + + xISS_target_ops.to_insert_breakpoint = arc_elf32_insert_breakpoint; + xISS_target_ops.to_remove_breakpoint = arc_elf32_remove_breakpoint; + + xISS_target_ops.to_kill = arc_xISS_kill; + xISS_target_ops.to_load = arc_xISS_load; + + xISS_target_ops.to_create_inferior = arc_xISS_create_inferior; + xISS_target_ops.to_mourn_inferior = arc_xISS_mourn_inferior; + xISS_target_ops.to_thread_alive = arc_xISS_thread_alive; +// xISS_target_ops.to_stop = arc_xISS_stop; + xISS_target_ops.to_can_run = arc_xISS_can_run; + xISS_target_ops.to_terminal_inferior = NULL; + + xISS_target_ops.to_stratum = process_stratum; + + xISS_target_ops.to_has_all_memory = 1; + xISS_target_ops.to_has_memory = 1; + xISS_target_ops.to_has_stack = 0; /* Defer setting this until the program has been loaded. */ + xISS_target_ops.to_has_registers = 1; + xISS_target_ops.to_has_execution = 0; /* Defer setting this until the program has been started. */ + + xISS_target_ops.to_magic = OPS_MAGIC; +} +#endif /* HAVE_LIBXISS */ + + +/* -------------------------------------------------------------------------- */ +/* externally visible functions */ +/* -------------------------------------------------------------------------- */ + +/* Initialize the module. This function is called from the gdb core on start-up. */ + +/* N.B. the initialization function must be defined even if the rest of this + module is excluded, as the call to it from the gdb start-up code is + generated by the build mechanism without regard to any conditional + compilation! */ + +void +_initialize_arc_xiss (void) +{ +#ifdef HAVE_LIBXISS + struct cmd_list_element *cmnd; + + ENTERMSG; + + operations.read_core_register = read_xiss_core_register; + operations.write_core_register = write_xiss_core_register; + operations.read_auxiliary_register = read_xiss_aux_register; + operations.write_auxiliary_register = write_xiss_aux_register; + operations.read_memory = read_words; + operations.write_memory = write_words; + operations.fill_memory = NULL; + + initialize_xISS_target_ops (); + add_target (&xISS_target_ops); + + /* Register ARC-specific commands with gdb. */ + + (void) add_setshow_boolean_cmd + ("arc-xiss-trace", + class_trace, + &xISS_trace_instructions, + _("Set whether the xISS should trace instructions.\n"), + _("Show whether the xISS should trace instructions.\n"), + NULL, + set_xiss_trace, + show_xiss_trace, + &setlist, + &showlist); + + add_setshow_optional_filename_cmd + ("arc-xiss-trace-file", + class_trace, + &xiss_trace_file, + _("Set the output file for xISS instruction tracing.\n"), + _("Show the output file for xISS instruction tracing.\n"), + NULL, + set_xiss_trace_file, + show_xiss_trace_file, + &setlist, + &showlist); + + (void) add_setshow_zinteger_cmd + ("arc-xiss-trace-buffer-size", + class_trace, + &xiss_trace_buffer_size, + _("Set the size of the trace buffer for xISS instruction tracing.\n"), + _("Show the size of the trace buffer for xISS instruction tracing.\n"), + NULL, + set_xiss_trace_buffer_size, + show_xiss_trace_buffer_size, + &setlist, + &showlist); + + cmnd = add_cmd + (SAVE_TRACE_TO_FILE_COMMAND, + class_trace, + arc_save_trace_to_file_command, + _("Save the contents of the xISS instruction trace buffer to a file.\n" + SAVE_TRACE_TO_FILE_COMMAND_USAGE + " is a file to hold the xISS instruction trace buffer contents.\n"), + &cmdlist); + set_cmd_completer (cmnd, filename_completer); + + (void) add_cmd + (EMPTY_TRACE_BUFFER_COMMAND, + class_trace, + arc_empty_trace_buffer, + _("Empty xISS instruction trace buffer.\n" + EMPTY_TRACE_BUFFER_COMMAND_USAGE), + &cmdlist); + + cmnd = add_cmd + (LIST_TRACE_COMMAND, + class_trace, + arc_list_trace, + _("Display xISS instruction trace.\n" + LIST_TRACE_COMMAND_USAGE), + &cmdlist); + set_cmd_completer (cmnd, filename_completer); + +#endif /* HAVE_LIBXISS */ +} + +/******************************************************************************/ diff --git a/gdb/arc-xiss.h b/gdb/arc-xiss.h new file mode 100755 index 0000000..a79030b --- /dev/null +++ b/gdb/arc-xiss.h @@ -0,0 +1,41 @@ +/* Target dependent code for ARC processor family, for GDB, the GNU debugger. + + Copyright 2009 Free Software Foundation, Inc. + + Contributed by ARC International (www.arc.com) + + Authors: + Richard Stuckey + + This file is part of GDB. + + 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 3 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, see . */ + +/******************************************************************************/ +/* */ +/* Outline: */ +/* This header file defines some operations provided by the ARC xISS */ +/* module. */ +/* */ +/******************************************************************************/ + +#ifndef ARC_XISS_H +#define ARC_XISS_H + + +/* Currently none. */ + + +#endif /* ARC_XISS_H */ +/******************************************************************************/ diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index 019f4c8..3f5981d 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -93,6 +93,10 @@ static int can_use_hardware_watchpoint (struct value *); static void break_command_1 (char *, int, int); +// begin ARC +static void watch_range_command_1 (unsigned int, unsigned int, int, int); +// end ARC + static void mention (struct breakpoint *); struct breakpoint *set_raw_breakpoint (struct symtab_and_line, enum bptype); @@ -842,6 +846,13 @@ update_watchpoint (struct breakpoint *b, int reparse) struct bp_location *loc; bpstat bs; +// begin ARC + /* If this is a range watchpoint. */ + if (b->exp == NULL) + /* There is no need to change it. */ + return; +// end ARC + unlink_locations_from_global_list (b); for (loc = b->loc; loc;) { @@ -1017,6 +1028,9 @@ insert_bp_location (struct bp_location *bpt, /* Initialize the target-specific information. */ memset (&bpt->target_info, 0, sizeof (bpt->target_info)); bpt->target_info.placed_address = bpt->address; +// begin ARC + bpt->target_info.range = bpt->length; +// end ARC if (bpt->loc_type == bp_loc_software_breakpoint || bpt->loc_type == bp_loc_hardware_breakpoint) @@ -2103,6 +2117,30 @@ top: do_cleanups (old_chain); } +// begin ARC +static void +check_range (struct breakpoint *bp, enum async_reply_reason reason) +{ + CORE_ADDR addr; + + if (target_stopped_data_address (¤t_target, &addr)) + { + if (addr >= bp->loc->address && + addr < bp->loc->address + bp->loc->length) + { + if (ui_out_is_mi_like_p (uiout)) + ui_out_field_string + (uiout, "reason", + async_reason_lookup (reason)); + mention (bp); + ui_out_text(uiout, "triggered by access at address "); + ui_out_field_core_addr(uiout, "", addr); + ui_out_text (uiout, "\n"); + } + } +} +// end ARC + /* This is the normal print function for a bpstat. In the future, much of this logic could (should?) be moved to bpstat_stop_status, by having it set different print_it values. @@ -2221,76 +2259,103 @@ print_it_typical (bpstat bs) case bp_watchpoint: case bp_hardware_watchpoint: - if (bs->old_val != NULL) - { - annotate_watchpoint (b->number); - if (ui_out_is_mi_like_p (uiout)) - ui_out_field_string - (uiout, "reason", - async_reason_lookup (EXEC_ASYNC_WATCHPOINT_TRIGGER)); - mention (b); - ui_out_chain = make_cleanup_ui_out_tuple_begin_end (uiout, "value"); - ui_out_text (uiout, "\nOld value = "); - value_print (bs->old_val, stb->stream, 0, Val_pretty_default); - ui_out_field_stream (uiout, "old", stb); - ui_out_text (uiout, "\nNew value = "); - value_print (b->val, stb->stream, 0, Val_pretty_default); - ui_out_field_stream (uiout, "new", stb); - do_cleanups (ui_out_chain); - ui_out_text (uiout, "\n"); - value_free (bs->old_val); - bs->old_val = NULL; - } +// begin ARC + if (b->exp) + { +// end ARC + if (bs->old_val != NULL) + { + annotate_watchpoint (b->number); + if (ui_out_is_mi_like_p (uiout)) + ui_out_field_string + (uiout, "reason", + async_reason_lookup (EXEC_ASYNC_WATCHPOINT_TRIGGER)); + mention (b); + ui_out_chain = make_cleanup_ui_out_tuple_begin_end (uiout, "value"); + ui_out_text (uiout, "\nOld value = "); + value_print (bs->old_val, stb->stream, 0, Val_pretty_default); + ui_out_field_stream (uiout, "old", stb); + ui_out_text (uiout, "\nNew value = "); + value_print (b->val, stb->stream, 0, Val_pretty_default); + ui_out_field_stream (uiout, "new", stb); + do_cleanups (ui_out_chain); + ui_out_text (uiout, "\n"); + value_free (bs->old_val); + bs->old_val = NULL; + } +// begin ARC + } + else + check_range(b, EXEC_ASYNC_WATCHPOINT_TRIGGER); +// end ARC /* More than one watchpoint may have been triggered. */ return PRINT_UNKNOWN; break; case bp_read_watchpoint: - if (ui_out_is_mi_like_p (uiout)) - ui_out_field_string - (uiout, "reason", - async_reason_lookup (EXEC_ASYNC_READ_WATCHPOINT_TRIGGER)); - mention (b); - ui_out_chain = make_cleanup_ui_out_tuple_begin_end (uiout, "value"); - ui_out_text (uiout, "\nValue = "); - value_print (b->val, stb->stream, 0, Val_pretty_default); - ui_out_field_stream (uiout, "value", stb); - do_cleanups (ui_out_chain); - ui_out_text (uiout, "\n"); +// begin ARC + if (b->exp) + { +// end ARC + if (ui_out_is_mi_like_p (uiout)) + ui_out_field_string + (uiout, "reason", + async_reason_lookup (EXEC_ASYNC_READ_WATCHPOINT_TRIGGER)); + mention (b); + ui_out_chain = make_cleanup_ui_out_tuple_begin_end (uiout, "value"); + ui_out_text (uiout, "\nValue = "); + value_print (b->val, stb->stream, 0, Val_pretty_default); + ui_out_field_stream (uiout, "value", stb); + do_cleanups (ui_out_chain); + ui_out_text (uiout, "\n"); +// begin ARC + } + else + check_range(b, EXEC_ASYNC_READ_WATCHPOINT_TRIGGER); +// end ARC return PRINT_UNKNOWN; break; case bp_access_watchpoint: - if (bs->old_val != NULL) - { - annotate_watchpoint (b->number); - if (ui_out_is_mi_like_p (uiout)) - ui_out_field_string - (uiout, "reason", - async_reason_lookup (EXEC_ASYNC_ACCESS_WATCHPOINT_TRIGGER)); - mention (b); - ui_out_chain = make_cleanup_ui_out_tuple_begin_end (uiout, "value"); - ui_out_text (uiout, "\nOld value = "); - value_print (bs->old_val, stb->stream, 0, Val_pretty_default); - ui_out_field_stream (uiout, "old", stb); - value_free (bs->old_val); - bs->old_val = NULL; - ui_out_text (uiout, "\nNew value = "); - } - else - { - mention (b); - if (ui_out_is_mi_like_p (uiout)) - ui_out_field_string - (uiout, "reason", - async_reason_lookup (EXEC_ASYNC_ACCESS_WATCHPOINT_TRIGGER)); - ui_out_chain = make_cleanup_ui_out_tuple_begin_end (uiout, "value"); - ui_out_text (uiout, "\nValue = "); - } - value_print (b->val, stb->stream, 0,Val_pretty_default); - ui_out_field_stream (uiout, "new", stb); - do_cleanups (ui_out_chain); - ui_out_text (uiout, "\n"); +// begin ARC + if (b->exp) + { +// end ARC + if (bs->old_val != NULL) + { + annotate_watchpoint (b->number); + if (ui_out_is_mi_like_p (uiout)) + ui_out_field_string + (uiout, "reason", + async_reason_lookup (EXEC_ASYNC_ACCESS_WATCHPOINT_TRIGGER)); + mention (b); + ui_out_chain = make_cleanup_ui_out_tuple_begin_end (uiout, "value"); + ui_out_text (uiout, "\nOld value = "); + value_print (bs->old_val, stb->stream, 0, Val_pretty_default); + ui_out_field_stream (uiout, "old", stb); + value_free (bs->old_val); + bs->old_val = NULL; + ui_out_text (uiout, "\nNew value = "); + } + else + { + mention (b); + if (ui_out_is_mi_like_p (uiout)) + ui_out_field_string + (uiout, "reason", + async_reason_lookup (EXEC_ASYNC_ACCESS_WATCHPOINT_TRIGGER)); + ui_out_chain = make_cleanup_ui_out_tuple_begin_end (uiout, "value"); + ui_out_text (uiout, "\nValue = "); + } + value_print (b->val, stb->stream, 0,Val_pretty_default); + ui_out_field_stream (uiout, "new", stb); + do_cleanups (ui_out_chain); + ui_out_text (uiout, "\n"); +// begin ARC + } + else + check_range(b, EXEC_ASYNC_ACCESS_WATCHPOINT_TRIGGER); +// end ARC return PRINT_UNKNOWN; break; @@ -2529,6 +2594,11 @@ watchpoint_check (void *p) b = bs->breakpoint_at->owner; +// begin ARC + if (b->exp == NULL) + return WP_VALUE_CHANGED; +// end ARC + if (b->exp_valid_block == NULL) within_current_scope = 1; else @@ -2667,7 +2737,17 @@ bpstat_stop_status (CORE_ADDR bp_addr, ptid_t ptid) && b->type != bp_catch_exec) /* a non-watchpoint bp */ { if (bl->address != bp_addr) /* address doesn't match */ - continue; +// begin ARC + { + /* is the address within the b/p range? */ + if (bp_addr < b->loc->address || + bp_addr > b->loc->address + b->loc->length - 1) +// end ARC + continue; +// begin ARC + } +// end ARC + if (overlay_debugging /* unmapped overlay section */ && section_is_overlay (bl->section) && !section_is_mapped (bl->section)) @@ -2764,86 +2844,107 @@ bpstat_stop_status (CORE_ADDR bp_addr, ptid_t ptid) struct value *v; int must_check_value = 0; - if (b->type == bp_watchpoint) - /* For a software watchpoint, we must always check the - watched value. */ - must_check_value = 1; - else if (b->watchpoint_triggered == watch_triggered_yes) - /* We have a hardware watchpoint (read, write, or access) - and the target earlier reported an address watched by - this watchpoint. */ - must_check_value = 1; - else if (b->watchpoint_triggered == watch_triggered_unknown - && b->type == bp_hardware_watchpoint) - /* We were stopped by a hardware watchpoint, but the target could - not report the data address. We must check the watchpoint's - value. Access and read watchpoints are out of luck; without - a data address, we can't figure it out. */ - must_check_value = 1; - - if (must_check_value) - { - char *message = xstrprintf ("Error evaluating expression for watchpoint %d\n", - b->number); - struct cleanup *cleanups = make_cleanup (xfree, message); - int e = catch_errors (watchpoint_check, bs, message, - RETURN_MASK_ALL); - do_cleanups (cleanups); - switch (e) +// begin ARC + if (b->exp == NULL) + { + CORE_ADDR addr; + + if (!target_stopped_data_address (¤t_target, &addr)) + continue; + + if (addr >= b->loc->address && + addr < b->loc->address + b->loc->length) + { + /* Stop. */ + ++(b->hit_count); + } + } + else + { +// end ARC + if (b->type == bp_watchpoint) + /* For a software watchpoint, we must always check the + watched value. */ + must_check_value = 1; + else if (b->watchpoint_triggered == watch_triggered_yes) + /* We have a hardware watchpoint (read, write, or access) + and the target earlier reported an address watched by + this watchpoint. */ + must_check_value = 1; + else if (b->watchpoint_triggered == watch_triggered_unknown + && b->type == bp_hardware_watchpoint) + /* We were stopped by a hardware watchpoint, but the target could + not report the data address. We must check the watchpoint's + value. Access and read watchpoints are out of luck; without + a data address, we can't figure it out. */ + must_check_value = 1; + + if (must_check_value) { - case WP_DELETED: - /* We've already printed what needs to be printed. */ - bs->print_it = print_it_done; - /* Stop. */ - break; - case WP_VALUE_CHANGED: - if (b->type == bp_read_watchpoint) - { - /* Don't stop: read watchpoints shouldn't fire if - the value has changed. This is for targets - which cannot set read-only watchpoints. */ - bs->print_it = print_it_noop; - bs->stop = 0; - continue; - } - ++(b->hit_count); - break; - case WP_VALUE_NOT_CHANGED: - if (b->type == bp_hardware_watchpoint - || b->type == bp_watchpoint) - { - /* Don't stop: write watchpoints shouldn't fire if - the value hasn't changed. */ - bs->print_it = print_it_noop; - bs->stop = 0; - continue; - } - /* Stop. */ - ++(b->hit_count); - break; - default: - /* Can't happen. */ - case 0: - /* Error from catch_errors. */ - printf_filtered (_("Watchpoint %d deleted.\n"), b->number); - if (b->related_breakpoint) - b->related_breakpoint->disposition = disp_del_at_next_stop; - b->disposition = disp_del_at_next_stop; - /* We've already printed what needs to be printed. */ - bs->print_it = print_it_done; - break; + char *message = xstrprintf ("Error evaluating expression for watchpoint %d\n", + b->number); + struct cleanup *cleanups = make_cleanup (xfree, message); + int e = catch_errors (watchpoint_check, bs, message, + RETURN_MASK_ALL); + do_cleanups (cleanups); + switch (e) + { + case WP_DELETED: + /* We've already printed what needs to be printed. */ + bs->print_it = print_it_done; + /* Stop. */ + break; + case WP_VALUE_CHANGED: + if (b->type == bp_read_watchpoint) + { + /* Don't stop: read watchpoints shouldn't fire if + the value has changed. This is for targets + which cannot set read-only watchpoints. */ + bs->print_it = print_it_noop; + bs->stop = 0; + continue; + } + ++(b->hit_count); + break; + case WP_VALUE_NOT_CHANGED: + if (b->type == bp_hardware_watchpoint + || b->type == bp_watchpoint) + { + /* Don't stop: write watchpoints shouldn't fire if + the value hasn't changed. */ + bs->print_it = print_it_noop; + bs->stop = 0; + continue; + } + /* Stop. */ + ++(b->hit_count); + break; + default: + /* Can't happen. */ + case 0: + /* Error from catch_errors. */ + printf_filtered (_("Watchpoint %d deleted.\n"), b->number); + if (b->related_breakpoint) + b->related_breakpoint->disposition = disp_del_at_next_stop; + b->disposition = disp_del_at_next_stop; + /* We've already printed what needs to be printed. */ + bs->print_it = print_it_done; + break; + } } - } - else /* must_check_value == 0 */ - { - /* This is a case where some watchpoint(s) triggered, but - not at the address of this watchpoint, or else no - watchpoint triggered after all. So don't print - anything for this watchpoint. */ - bs->print_it = print_it_noop; - bs->stop = 0; - continue; - } + else /* must_check_value == 0 */ + { + /* This is a case where some watchpoint(s) triggered, but + not at the address of this watchpoint, or else no + watchpoint triggered after all. So don't print + anything for this watchpoint. */ + bs->print_it = print_it_noop; + bs->stop = 0; + continue; + } +// begin ARC + } +// end ARC } else { @@ -3464,14 +3565,31 @@ print_one_breakpoint_location (struct breakpoint *b, case bp_hardware_watchpoint: case bp_read_watchpoint: case bp_access_watchpoint: - /* Field 4, the address, is omitted (which makes the columns - not line up too nicely with the headers, but the effect - is relatively readable). */ - if (addressprint) - ui_out_field_skip (uiout, "addr"); - annotate_field (5); - print_expression (b->exp, stb->stream); - ui_out_field_stream (uiout, "what", stb); +// begin ARC + if (b->exp) + { +// end ARC + /* Field 4, the address, is omitted (which makes the columns + not line up too nicely with the headers, but the effect + is relatively readable). */ + if (addressprint) + ui_out_field_skip (uiout, "addr"); + annotate_field (5); + print_expression (b->exp, stb->stream); + ui_out_field_stream (uiout, "what", stb); +// begin ARC + } + else + { + /* exp_string has format "
:" */ + char* colon = strchr(b->exp_string, ':'); + *colon = 0; + ui_out_field_string(uiout, "addr", b->exp_string); + ui_out_field_string(uiout, "what", colon+1); + ui_out_text(uiout, "-byte range"); + *colon = ':'; + } +// end ARC break; case bp_catch_load: @@ -3546,7 +3664,18 @@ print_one_breakpoint_location (struct breakpoint *b, if (b->loc == NULL || loc->shlib_disabled) ui_out_field_string (uiout, "addr", ""); else - ui_out_field_core_addr (uiout, "addr", loc->address); +// begin ARC + { +// end ARC + ui_out_field_core_addr (uiout, "addr", loc->address); +// begin ARC + if (b->exp == NULL && b->loc->length > 0) + { + ui_out_field_int(uiout, "what", b->loc->length); + ui_out_text(uiout, "-byte range "); + } + } +// end ARC } annotate_field (5); if (!header_of_multiple) @@ -4764,7 +4893,14 @@ mention (struct breakpoint *b) ui_out_chain = make_cleanup_ui_out_tuple_begin_end (uiout, "wpt"); ui_out_field_int (uiout, "number", b->number); ui_out_text (uiout, ": "); - print_expression (b->exp, stb->stream); +// begin ARC + if (b->exp) +// end ARC + print_expression (b->exp, stb->stream); +// begin ARC + else + ui_out_text (uiout, b->exp_string); +// end ARC ui_out_field_stream (uiout, "exp", stb); do_cleanups (ui_out_chain); break; @@ -4773,7 +4909,14 @@ mention (struct breakpoint *b) ui_out_chain = make_cleanup_ui_out_tuple_begin_end (uiout, "hw-rwpt"); ui_out_field_int (uiout, "number", b->number); ui_out_text (uiout, ": "); - print_expression (b->exp, stb->stream); +// begin ARC + if (b->exp) +// end ARC + print_expression (b->exp, stb->stream); +// begin ARC + else + ui_out_text (uiout, b->exp_string); +// end ARC ui_out_field_stream (uiout, "exp", stb); do_cleanups (ui_out_chain); break; @@ -4782,7 +4925,14 @@ mention (struct breakpoint *b) ui_out_chain = make_cleanup_ui_out_tuple_begin_end (uiout, "hw-awpt"); ui_out_field_int (uiout, "number", b->number); ui_out_text (uiout, ": "); - print_expression (b->exp, stb->stream); +// begin ARC + if (b->exp) +// end ARC + print_expression (b->exp, stb->stream); +// begin ARC + else + ui_out_text (uiout, b->exp_string); +// end ARC ui_out_field_stream (uiout, "exp", stb); do_cleanups (ui_out_chain); break; @@ -4850,6 +5000,10 @@ mention (struct breakpoint *b) { printf_filtered (" at "); fputs_filtered (paddress (b->loc->address), gdb_stdout); +// begin ARC + if (b->exp == NULL && b->loc->length > 0) + printf_filtered(" covering %u bytes", b->loc->length); +// end ARC } if (b->source_file) printf_filtered (": file %s, line %d.", @@ -5536,12 +5690,28 @@ break_command (char *arg, int from_tty) break_command_1 (arg, 0, from_tty); } +// begin ARC +void +watch_range_command (unsigned int address, unsigned int bytes, int accessflag, int from_tty) +{ + watch_range_command_1 (address, bytes, accessflag, from_tty); +} +// end ARC + void tbreak_command (char *arg, int from_tty) { break_command_1 (arg, BP_TEMPFLAG, from_tty); } +// begin ARC +void +hbreak_command_wrapper (char *arg, int from_tty) +{ + hbreak_command (arg, from_tty); +} +// end ARC + static void hbreak_command (char *arg, int from_tty) { @@ -5837,6 +6007,81 @@ watch_command_1 (char *arg, int accessflag, int from_tty) mention (b); } + +// begin ARC +/* accessflag: hw_write: watch write, + hw_read: watch read, + hw_access: watch access (read or write) + hw_execute: execute access */ +static void +watch_range_command_1 (unsigned int address, unsigned int bytes, int accessflag, int from_tty) +{ + struct breakpoint *b; + struct symtab_and_line sal; + int i, other_type_used, target_resources_ok; + enum bptype bp_type; + enum target_hw_bp_type wp_type; + char exp[50]; + + (void) sprintf(exp, "0x%08X:%u", address, bytes); + + init_sal (&sal); /* initialize to zeroes */ + + if (accessflag == hw_read) + { + bp_type = bp_read_watchpoint; + wp_type = hw_read; + } + else if (accessflag == hw_access) + { + bp_type = bp_access_watchpoint; + wp_type = hw_access; + } + else if (accessflag == hw_write) + { + bp_type = bp_hardware_watchpoint; + wp_type = hw_write; + } + else + { + bp_type = bp_hardware_breakpoint; + wp_type = hw_execute; + } + + i = hw_watchpoint_used_count (bp_type, &other_type_used); + target_resources_ok = + TARGET_CAN_USE_HARDWARE_WATCHPOINT (bp_type, i, other_type_used); + if (target_resources_ok == 0 && bp_type != bp_hardware_watchpoint) + error (_("Target does not support this type of hardware watchpoint.")); + if (target_resources_ok < 0 && bp_type != bp_hardware_watchpoint) + error (_("Target can only support one kind of HW watchpoint at a time.")); + + + /* Now set up the breakpoint. */ + b = set_raw_breakpoint (sal, bp_type); + set_breakpoint_count (breakpoint_count + 1); + b->number = breakpoint_count; + b->disposition = disp_donttouch; + b->exp = NULL; + b->exp_valid_block = NULL; + b->exp_string = xstrdup(exp); + b->val = NULL; + //b->cond = NULL; 6.8 has removed this element? + b->cond_string = 0; + b->loc->address = (CORE_ADDR) address; + b->loc->requested_address = b->loc->address; + b->loc->length = bytes; + + b->loc->watchpoint_type = wp_type; + + memset (&b->watchpoint_frame, 0, sizeof (b->watchpoint_frame)); + + mention (b); +} +// end ARC + + + /* Return count of locations need to be watched and can be handled in hardware. If the watchpoint can not be handled in hardware return zero. */ @@ -7911,8 +8156,18 @@ insert_single_step_breakpoint (CORE_ADDR next_pc) *bpt_p = deprecated_insert_raw_breakpoint (next_pc); if (*bpt_p == NULL) - error (_("Could not insert single-step breakpoint at 0x%s"), - paddr_nz (next_pc)); + { + /* richards/2008/10/27 ARC bug fix: if setting the (second) + * b/p failed, we must unset the first + * + * gdb bug: 9649 + */ + if (single_step_breakpoints[0] != NULL) + remove_single_step_breakpoints (); + + error (_("Could not insert single-step breakpoint at 0x%s"), + paddr_nz (next_pc)); + } } /* Remove and delete any breakpoints used for software single step. */ diff --git a/gdb/breakpoint.h b/gdb/breakpoint.h index 41730c0..a741f86 100644 --- a/gdb/breakpoint.h +++ b/gdb/breakpoint.h @@ -175,6 +175,11 @@ enum target_hw_bp_type struct bp_target_info { +// begin ARC + /* Range breakpoints added */ + unsigned int range; +//end ARC + /* Address at which the breakpoint was placed. This is normally the same as ADDRESS from the bp_location, except when adjustment happens in gdbarch_breakpoint_from_pc. The most common form of @@ -272,8 +277,8 @@ struct bp_location is not a special value for this field. Valid for all types except bp_loc_other. */ CORE_ADDR address; - - /* For hardware watchpoints, the size of data ad ADDRESS being watches. */ + + /* For hardware watchpoints, the size of data at ADDRESS being watched. */ int length; /* Type of hardware watchpoint. */ @@ -702,6 +707,10 @@ extern void breakpoint_clear_ignore_counts (void); extern void break_command (char *, int); +// begin ARC +extern void watch_range_command (unsigned int, unsigned int, int, int); +//end ARC + extern void hbreak_command_wrapper (char *, int); extern void thbreak_command_wrapper (char *, int); extern void rbreak_command_wrapper (char *, int); diff --git a/gdb/cli/cli-script.c b/gdb/cli/cli-script.c index e6fbe3f..dac4345 100644 --- a/gdb/cli/cli-script.c +++ b/gdb/cli/cli-script.c @@ -287,8 +287,15 @@ execute_user_command (struct cmd_list_element *c, char *args) cmdlines = c->user_commands; if (cmdlines == 0) + { /* Null command */ +// begin ARC + /* If there are no user commands to be executed, execute the + callback function instead. */ + c->func(c, NULL, 0); +// end ARC return; + } if (++user_call_depth > max_user_call_depth) error (_("Max user call depth exceeded -- command aborted.")); diff --git a/gdb/config.in b/gdb/config.in index b6aba7d..f5fa97b 100644 --- a/gdb/config.in +++ b/gdb/config.in @@ -45,6 +45,12 @@ /* Define to the default OS ABI for this configuration. */ #undef GDB_OSABI_DEFAULT +/* targetfile */ +#undef GDB_TM_FILE + +/* hostfile */ +#undef GDB_XM_FILE + /* Define to 1 if you have `alloca', as a function or macro. */ #undef HAVE_ALLOCA @@ -152,6 +158,15 @@ /* Define if you have the expat library. */ #undef HAVE_LIBEXPAT +/* Define if you have the ARC xISS library. */ +#undef HAVE_LIBXISS + +/* Define if you are building the ARC bare-board debugger. */ +#undef ARC_ELF32_TARGET + +/* Define if you are building the ARC Linux debugger. */ +#undef ARC_LINUX_TARGET + /* Define to 1 if you have the `m' library (-lm). */ #undef HAVE_LIBM diff --git a/gdb/config/arc/a4-jtag.mt b/gdb/config/arc/a4-jtag.mt deleted file mode 100644 index e3907ba..0000000 --- a/gdb/config/arc/a4-jtag.mt +++ /dev/null @@ -1,3 +0,0 @@ -# Target: ARC embedded system -TDEPFILES= arc-tdep.o arc-jtag.o arc-jtag-tdep.o arc-jtag-ops.o -DEPRECATED_TM_FILE= tm-a4-jtag.h diff --git a/gdb/config/arc/arc.mt b/gdb/config/arc/arc.mt deleted file mode 100644 index cb98a49..0000000 --- a/gdb/config/arc/arc.mt +++ /dev/null @@ -1,4 +0,0 @@ -# Target: arc processor -TDEPFILES= arc-tdep.o monitor.o arc-rom.o dsrec.o remote-arc-sdi.o -SIM_OBS = remote-sim.o -SIM = ../sim/arc/libsim.a diff --git a/gdb/config/arc/embed.mt b/gdb/config/arc/embed.mt deleted file mode 100644 index a6d47a2..0000000 --- a/gdb/config/arc/embed.mt +++ /dev/null @@ -1,3 +0,0 @@ -# Target: ARC embedded system -TDEPFILES= arc-tdep.o arc-jtag.o arc-jtag-tdep.o arc-jtag-ops.o -DEPRECATED_TM_FILE= tm-embed.h diff --git a/gdb/config/arc/linux.mt b/gdb/config/arc/linux.mt deleted file mode 100644 index 0c5f000..0000000 --- a/gdb/config/arc/linux.mt +++ /dev/null @@ -1,3 +0,0 @@ -# Target: ARC based machine running GNU/Linux -DEPRECATED_TM_FILE= tm-linux.h -TDEPFILES= arc-tdep.o arc-linux-tdep.o solib.o solib-svr4.o solib-legacy.o corelow.o diff --git a/gdb/config/arc/tm-a4-jtag.h b/gdb/config/arc/tm-a4-jtag.h deleted file mode 100644 index dc5ab71..0000000 --- a/gdb/config/arc/tm-a4-jtag.h +++ /dev/null @@ -1,103 +0,0 @@ -#define ARC4_JTAG 1 -#define CONFIG_OSABI GDB_OSABI_UNKNOWN - -struct gdbarch *arc_jtag_init (struct gdbarch *gdbarch); -#define CONFIG_INIT_TDEP arc_jtag_init - -/* The core regnums here are the same as the hardware register numbers. We - cannot do that for aux registers, because the aux regs on the h/w do not - have contiguous numbers. */ -enum arc4_jtag_regnums - { - ARC_FP_REGNUM = 27, - ARC_SP_REGNUM , - ARC_ILINK1_REGNUM , - ARC_ILINK2_REGNUM , - ARC_BLINK_REGNUM , - /* Extension core regs are 32..59 inclusive. */ - ARC_LP_COUNT_REGNUM = 60, - /* 61 is reserved, 62 is not a real register. */ - ARC_PCL_REGNUM = 63, - - /* Now the aux registers. */ - - ARC_STATUS_REGNUM = 64, - ARC_SEMAPHORE_REGNUM , - ARC_LP_START_REGNUM , - ARC_LP_END_REGNUM , - ARC_IDENTITY_REGNUM , - ARC_DEBUG_REGNUM , -#ifndef ARC4_JTAG - ARC_PC_REGNUM , - ARC_STATUS32_REGNUM , - ARC_STATUS32_L1_REGNUM , - ARC_STATUS32_L2_REGNUM , - - ARC_COUNT0_REGNUM , - ARC_CONTROL0_REGNUM , - ARC_LIMIT0_REGNUM , - ARC_INT_VECTOR_BASE_REGNUM , - ARC_AUX_MACMODE_REGNUM , - ARC_AUX_IRQ_LV12_REGNUM , - - ARC_COUNT1_REGNUM , - ARC_CONTROL1_REGNUM , - ARC_LIMIT1_REGNUM , - ARC_AUX_IRQ_LEV_REGNUM , - ARC_AUX_IRQ_HINT_REGNUM , - ARC_ERET_REGNUM , - ARC_ERBTA_REGNUM , - ARC_ERSTATUS_REGNUM , - ARC_ECR_REGNUM , - ARC_EFA_REGNUM , - ARC_ICAUSE1_REGNUM , - ARC_ICAUSE2_REGNUM , - ARC_AUX_IENABLE_REGNUM , - ARC_AUX_ITRIGGER_REGNUM , - ARC_XPU_REGNUM , - ARC_BTA_REGNUM , - ARC_BTA_L1_REGNUM , - ARC_BTA_L2_REGNUM , - ARC_AUX_IRQ_PULSE_CANCEL_REGNUM , - ARC_AUX_IRQ_PENDING_REGNUM , - - /* Build configuration registers. */ - ARC_BCR_0_REGNUM , - ARC_BCR_1_REGNUM , - ARC_BCR_2_REGNUM , - ARC_BCR_3_REGNUM , - ARC_BCR_4_REGNUM , - ARC_BCR_5_REGNUM , - ARC_BCR_6_REGNUM , - ARC_BCR_7_REGNUM , - ARC_BCR_8_REGNUM , - ARC_BCR_9_REGNUM , - ARC_BCR_A_REGNUM , - ARC_BCR_B_REGNUM , - ARC_BCR_C_REGNUM , - ARC_BCR_D_REGNUM , - ARC_BCR_E_REGNUM , - ARC_BCR_F_REGNUM , - ARC_BCR_10_REGNUM , - ARC_BCR_11_REGNUM , - ARC_BCR_12_REGNUM , - - ARC_BCR_13_REGNUM , - ARC_BCR_14_REGNUM , - ARC_BCR_15_REGNUM , - ARC_BCR_16_REGNUM , - ARC_BCR_17_REGNUM , - ARC_BCR_18_REGNUM , - ARC_BCR_19_REGNUM , - ARC_BCR_1A_REGNUM , - ARC_BCR_1B_REGNUM , - ARC_BCR_1C_REGNUM , - ARC_BCR_1D_REGNUM , - ARC_BCR_1E_REGNUM , - ARC_BCR_1F_REGNUM , - -#endif - ARC_NR_REGS - - }; - diff --git a/gdb/config/arc/tm-embed.h b/gdb/config/arc/tm-embed.h index 9ac1c1a..5cd7271 100644 --- a/gdb/config/arc/tm-embed.h +++ b/gdb/config/arc/tm-embed.h @@ -1,101 +1,77 @@ +/* Target dependent code for ARC processor family, for GDB, the GNU debugger. -#define CONFIG_OSABI GDB_OSABI_UNKNOWN + Copyright 2005, 2008, 2009 Free Software Foundation, Inc. -struct gdbarch *arc_jtag_init (struct gdbarch *gdbarch); -#define CONFIG_INIT_TDEP arc_jtag_init + Contributed by ARC International (www.arc.com) -/* The core regnums here are the same as the hardware register numbers. We - cannot do that for aux registers, because the aux regs on the h/w do not - have contiguous numbers. */ + Authors: + Codito Technologies Pvt. Ltd. + Richard Stuckey + + This file is part of GDB. + + 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 3 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, see . */ + +/******************************************************************************/ +/* */ +/* Outline: */ +/* This header file defines register numbers for the arc-elf32 */ +/* configuration of the ARC gdb. */ +/* */ +/******************************************************************************/ + +#ifndef ARC_TM_EMBED_H +#define ARC_TM_EMBED_H + +#include "gdbarch.h" +#include "arc-elf32-tdep.h" +#include "arc-registers.h" + + +#define CONFIG_OSABI GDB_OSABI_UNKNOWN + +#define CONFIG_INIT_TDEP (void) arc_elf32_initialize (gdbarch, arches); + + +/* These are hardware register numbers (i.e. NOT gdb register numbers). */ enum arc700_jtag_regnums - { - ARC_FP_REGNUM = 27, - ARC_SP_REGNUM , - ARC_ILINK1_REGNUM , - ARC_ILINK2_REGNUM , - ARC_BLINK_REGNUM , - /* Extension core regs are 32..59 inclusive. */ +{ + /* Regnums 0 .. 26 are R0 .. R26 */ + + ARC_FP_REGNUM = 27, + ARC_SP_REGNUM, + ARC_ILINK1_REGNUM, + ARC_ILINK2_REGNUM, + ARC_BLINK_REGNUM, + + /* Extension core regs are R32 .. R59 inclusive. */ + ARC_LP_COUNT_REGNUM = 60, + /* 61 is reserved, 62 is not a real register. */ - ARC_PCL_REGNUM = 63, - - /* Now the aux registers. */ - - ARC_STATUS_REGNUM = 64, - ARC_SEMAPHORE_REGNUM , - ARC_LP_START_REGNUM , - ARC_LP_END_REGNUM , - ARC_IDENTITY_REGNUM , - ARC_DEBUG_REGNUM , - ARC_PC_REGNUM , - ARC_STATUS32_REGNUM , - ARC_STATUS32_L1_REGNUM , - ARC_STATUS32_L2_REGNUM , - - ARC_COUNT0_REGNUM , - ARC_CONTROL0_REGNUM , - ARC_LIMIT0_REGNUM , - ARC_INT_VECTOR_BASE_REGNUM , - ARC_AUX_MACMODE_REGNUM , - ARC_AUX_IRQ_LV12_REGNUM , - - ARC_COUNT1_REGNUM , - ARC_CONTROL1_REGNUM , - ARC_LIMIT1_REGNUM , - ARC_AUX_IRQ_LEV_REGNUM , - ARC_AUX_IRQ_HINT_REGNUM , - ARC_ERET_REGNUM , - ARC_ERBTA_REGNUM , - ARC_ERSTATUS_REGNUM , - ARC_ECR_REGNUM , - ARC_EFA_REGNUM , - ARC_ICAUSE1_REGNUM , - ARC_ICAUSE2_REGNUM , - ARC_AUX_IENABLE_REGNUM , - ARC_AUX_ITRIGGER_REGNUM , - ARC_XPU_REGNUM , - ARC_BTA_REGNUM , - ARC_BTA_L1_REGNUM , - ARC_BTA_L2_REGNUM , - ARC_AUX_IRQ_PULSE_CANCEL_REGNUM , - ARC_AUX_IRQ_PENDING_REGNUM , - - /* Build configuration registers. */ - ARC_BCR_0_REGNUM , - ARC_BCR_1_REGNUM , - ARC_BCR_2_REGNUM , - ARC_BCR_3_REGNUM , - ARC_BCR_4_REGNUM , - ARC_BCR_5_REGNUM , - ARC_BCR_6_REGNUM , - ARC_BCR_7_REGNUM , - ARC_BCR_8_REGNUM , - ARC_BCR_9_REGNUM , - ARC_BCR_A_REGNUM , - ARC_BCR_B_REGNUM , - ARC_BCR_C_REGNUM , - ARC_BCR_D_REGNUM , - ARC_BCR_E_REGNUM , - ARC_BCR_F_REGNUM , - ARC_BCR_10_REGNUM , - ARC_BCR_11_REGNUM , - ARC_BCR_12_REGNUM , - - ARC_BCR_13_REGNUM , - ARC_BCR_14_REGNUM , - ARC_BCR_15_REGNUM , - ARC_BCR_16_REGNUM , - ARC_BCR_17_REGNUM , - ARC_BCR_18_REGNUM , - ARC_BCR_19_REGNUM , - ARC_BCR_1A_REGNUM , - ARC_BCR_1B_REGNUM , - ARC_BCR_1C_REGNUM , - ARC_BCR_1D_REGNUM , - ARC_BCR_1E_REGNUM , - ARC_BCR_1F_REGNUM , - - - ARC_NR_REGS - }; + ARC_PCL_REGNUM = 63, + + /* end marker: this is not a register, but its integer value gives the number + * of registers + */ + ARC_REG_END_MARKER +}; + + +#define ARC_NR_PSEUDO_REGS 0 +#define ARC_NR_REGS (int) (arc_core_register_count(gdbarch) + \ + arc_aux_register_count (gdbarch)) +#endif /* ARC_TM_EMBED_H */ +/******************************************************************************/ diff --git a/gdb/config/arc/tm-linux.h b/gdb/config/arc/tm-linux.h index 18b1240..15b0d9e8 100644 --- a/gdb/config/arc/tm-linux.h +++ b/gdb/config/arc/tm-linux.h @@ -1,35 +1,87 @@ -#include "config/tm-linux.h" +/* Target dependent code for ARC processor family, for GDB, the GNU debugger. -#define CONFIG_OSABI GDB_OSABI_LINUX + Copyright 2005, 2008, 2009 Free Software Foundation, Inc. + + Contributed by ARC International (www.arc.com) + + Authors: + Codito Technologies Pvt. Ltd. + Richard Stuckey + + This file is part of GDB. + + 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 3 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, see . */ + +/******************************************************************************/ +/* */ +/* Outline: */ +/* This header file defines register numbers for the arc-linux-uclibc */ +/* configuration of the ARC gdb. */ +/* */ +/******************************************************************************/ + +#ifndef ARC_TM_LINUX_H +#define ARC_TM_LINUX_H + +#include "arc-linux-tdep.h" + + +#define CONFIG_OSABI GDB_OSABI_LINUX /* Do nothing. */ -#define CONFIG_INIT_TDEP {} +#define CONFIG_INIT_TDEP {} + enum arc700_linux_regnums - { - /* Regnums 0..26 are R0..R26 */ - ARC_BTA_REGNUM = 27, - ARC_LP_START_REGNUM = 28, - ARC_LP_END_REGNUM = 29, - ARC_LP_COUNT_REGNUM = 30, - ARC_STATUS32_REGNUM = 31, - ARC_BLINK_REGNUM = 32, - ARC_FP_REGNUM = 33, - ARC_SP_REGNUM = 34, - ARC_EFA_REGNUM = 35, - ARC_RET_REGNUM = 36, - ARC_ORIG_R8_REGNUM = 37, - ARC_STOP_PC_REGNUM = 38 - }; - -#define ARC_NR_REGS 39 - -/* Pseudo-regs. */ -#define ARC_ILINK1_REGNUM (NUM_REGS) -#define ARC_ILINK2_REGNUM (NUM_REGS+1) -#define ARC_ERET_REGNUM (NUM_REGS+2) -#define ARC_STATUS32_L1_REGNUM (NUM_REGS+3) -#define ARC_STATUS32_L2_REGNUM (NUM_REGS+4) -#define ARC_ERSTATUS_REGNUM (NUM_REGS+5) - -#define ARC_NR_PSEUDO_REGS 6 +{ + /* Regnums 0 .. 26 are R0 .. R26 */ + ARC_BTA_REGNUM = 27, + ARC_LP_START_REGNUM = 28, + ARC_LP_END_REGNUM = 29, + ARC_LP_COUNT_REGNUM = 30, + ARC_STATUS32_REGNUM = 31, + ARC_BLINK_REGNUM = 32, + ARC_FP_REGNUM = 33, + ARC_SP_REGNUM = 34, + ARC_EFA_REGNUM = 35, + ARC_RET_REGNUM = 36, + ARC_ORIG_R8_REGNUM = 37, + ARC_STOP_PC_REGNUM = 38, + + /* end marker: this is not a register, but its integer value gives the number + * of registers + */ + ARC_REG_END_MARKER +}; + + +/* Pseudo-registers. */ + +enum arc700_linux_pseudo_regnums +{ + ARC_ILINK1_REGNUM = (int) ARC_REG_END_MARKER, + ARC_ILINK2_REGNUM, + ARC_ERET_REGNUM, + ARC_STATUS32_L1_REGNUM, + ARC_STATUS32_L2_REGNUM, + ARC_ERSTATUS_REGNUM +}; + + +#define ARC_NR_PSEUDO_REGS 6 +#define ARC_NR_REGS (int) ARC_REG_END_MARKER + + +#endif /* ARC_TM_LINUX_H */ +/******************************************************************************/ diff --git a/gdb/configure b/gdb/configure index e0f36b2..c39040b 100755 --- a/gdb/configure +++ b/gdb/configure @@ -313,7 +313,7 @@ ac_includes_default="\ ac_subdirs_all="$ac_subdirs_all gdbtk" ac_subdirs_all="$ac_subdirs_all multi-ice" ac_subdirs_all="$ac_subdirs_all gdbserver" -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP EGREP build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os USE_NLS LIBINTL LIBINTL_DEP INCINTL XGETTEXT GMSGFMT POSUB CATALOGS DATADIRNAME INSTOBJEXT GENCAT CATOBJEXT localedir PACKAGE subdirs TARGET_OBS AWK INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA LN_S RANLIB ac_ct_RANLIB YACC AR ac_ct_AR DLLTOOL ac_ct_DLLTOOL WINDRES ac_ct_WINDRES MIG ac_ct_MIG READLINE READLINE_DEPS READLINE_CFLAGS HAVE_LIBEXPAT LIBEXPAT LTLIBEXPAT ALLOCA CONFIG_LDFLAGS TARGET_SYSTEM_ROOT TARGET_SYSTEM_ROOT_DEFINE WARN_CFLAGS WERROR_CFLAGS SER_HARDWIRE WIN32LIBS LIBGUI GUI_CFLAGS_X WIN32LDAPP TCL_VERSION TCL_MAJOR_VERSION TCL_MINOR_VERSION TCL_CC TCL_DEFS TCL_SHLIB_CFLAGS TCL_SHLIB_LD TCL_SHLIB_LD_LIBS TCL_SHLIB_SUFFIX TCL_DL_LIBS TCL_LD_FLAGS TCL_LD_SEARCH_FLAGS TCL_CC_SEARCH_FLAGS TCL_COMPAT_OBJS TCL_RANLIB TCL_BUILD_LIB_SPEC TCL_LIB_SPEC TCL_LIB_VERSIONS_OK TK_VERSION TK_DEFS TK_BUILD_INCLUDES TK_XINCLUDES TK_XLIBSW TK_BUILD_LIB_SPEC TK_LIB_SPEC TCLHDIR TKHDIR ITCLHDIR ITKHDIR ITCL_VERSION ITCL_DEFS ITCL_BUILD_INCLUDES ITCL_BUILD_LIB_SPEC ITCL_LIB_SPEC ITK_VERSION ITK_DEFS ITK_BUILD_INCLUDES ITK_BUILD_LIB_SPEC ITK_LIB_SPEC X_CFLAGS X_LDFLAGS X_LIBS TCL_DEPS TK_DEPS ITCLLIB ITCL_DEPS ITKLIB ITK_DEPS GDBTKLIBS GDBTK_CFLAGS GDBTK_SRC_DIR SIM SIM_OBS ENABLE_CFLAGS PROFILE_CFLAGS CONFIG_OBS CONFIG_DEPS CONFIG_SRCS CONFIG_ALL CONFIG_CLEAN CONFIG_INSTALL CONFIG_UNINSTALL target_subdir frags nm_h LIBICONV LIBOBJS LTLIBOBJS' +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP EGREP build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os USE_NLS LIBINTL LIBINTL_DEP INCINTL XGETTEXT GMSGFMT POSUB CATALOGS DATADIRNAME INSTOBJEXT GENCAT CATOBJEXT localedir PACKAGE subdirs TARGET_OBS AWK INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA LN_S RANLIB ac_ct_RANLIB YACC AR ac_ct_AR DLLTOOL ac_ct_DLLTOOL WINDRES ac_ct_WINDRES MIG ac_ct_MIG READLINE READLINE_DEPS READLINE_CFLAGS HAVE_LIBEXPAT LIBEXPAT LTLIBEXPAT XISS_INCLUDES ALLOCA CONFIG_LDFLAGS TARGET_SYSTEM_ROOT TARGET_SYSTEM_ROOT_DEFINE WARN_CFLAGS WERROR_CFLAGS SER_HARDWIRE WIN32LIBS LIBGUI GUI_CFLAGS_X WIN32LDAPP TCL_VERSION TCL_MAJOR_VERSION TCL_MINOR_VERSION TCL_CC TCL_DEFS TCL_SHLIB_CFLAGS TCL_SHLIB_LD TCL_SHLIB_LD_LIBS TCL_SHLIB_SUFFIX TCL_DL_LIBS TCL_LD_FLAGS TCL_LD_SEARCH_FLAGS TCL_CC_SEARCH_FLAGS TCL_COMPAT_OBJS TCL_RANLIB TCL_BUILD_LIB_SPEC TCL_LIB_SPEC TCL_LIB_VERSIONS_OK TK_VERSION TK_DEFS TK_BUILD_INCLUDES TK_XINCLUDES TK_XLIBSW TK_BUILD_LIB_SPEC TK_LIB_SPEC TCLHDIR TKHDIR ITCLHDIR ITKHDIR ITCL_VERSION ITCL_DEFS ITCL_BUILD_INCLUDES ITCL_BUILD_LIB_SPEC ITCL_LIB_SPEC ITK_VERSION ITK_DEFS ITK_BUILD_INCLUDES ITK_BUILD_LIB_SPEC ITK_LIB_SPEC X_CFLAGS X_LDFLAGS X_LIBS TCL_DEPS TK_DEPS ITCLLIB ITCL_DEPS ITKLIB ITK_DEPS GDBTKLIBS GDBTK_CFLAGS GDBTK_SRC_DIR SIM SIM_OBS ENABLE_CFLAGS PROFILE_CFLAGS CONFIG_OBS CONFIG_DEPS CONFIG_SRCS CONFIG_ALL CONFIG_CLEAN CONFIG_INSTALL CONFIG_UNINSTALL target_subdir frags nm_h LIBICONV LIBOBJS LTLIBOBJS' ac_subst_files='host_makefile_frag' # Initialize some variables set by options. @@ -884,6 +884,7 @@ Optional Packages: --with-gnu-ld assume the C compiler uses GNU ld default=no --with-libexpat-prefix[=DIR] search for libexpat in DIR/include and DIR/lib --without-libexpat-prefix don't search for libexpat in includedir and libdir + --with-xiss include xiss support (auto/yes/no) --without-included-regex don't use included regex; this is the default on systems with version 2 of the GNU C library (use with caution on other system) @@ -5573,9 +5574,179 @@ _ACEOF fi +echo "$as_me:$LINENO: checking for inflate" >&5 +echo $ECHO_N "checking for inflate... $ECHO_C" >&6 +if test "${ac_cv_func_inflate+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define inflate to an innocuous variant, in case declares inflate. + For example, HP-UX 11i declares gettimeofday. */ +#define inflate innocuous_inflate + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char inflate (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef inflate + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char inflate (); +/* 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_inflate) || defined (__stub___inflate) +choke me +#else +char (*f) () = inflate; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != inflate; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_inflate=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_func_inflate=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_func_inflate" >&5 +echo "${ECHO_T}$ac_cv_func_inflate" >&6 +if test $ac_cv_func_inflate = yes; then + : +else + +echo "$as_me:$LINENO: checking for inflate in -lz" >&5 +echo $ECHO_N "checking for inflate in -lz... $ECHO_C" >&6 +if test "${ac_cv_lib_z_inflate+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lz $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char inflate (); +int +main () +{ +inflate (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_z_inflate=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_z_inflate=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_z_inflate" >&5 +echo "${ECHO_T}$ac_cv_lib_z_inflate" >&6 +if test $ac_cv_lib_z_inflate = yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBZ 1 +_ACEOF + + LIBS="-lz $LIBS" + +fi + +fi + + # We need to link with -lw to get `wctype' on Solaris before Solaris # 2.6. Solaris 2.6 and beyond have this function in libc, and have a -# libw that some versions of the GNU linker cannot hanle (GNU ld 2.9.1 +# libw that some versions of the GNU linker cannot handle (GNU ld 2.9.1 # is known to have this problem). Therefore we avoid libw if we can. echo "$as_me:$LINENO: checking for wctype" >&5 echo $ECHO_N "checking for wctype... $ECHO_C" >&6 @@ -7228,6 +7399,52 @@ done fi fi + + +# Check whether --with-xiss or --without-xiss was given. +if test "${with_xiss+set}" = set; then + withval="$with_xiss" + +else + with_xiss=auto +fi; +echo "$as_me:$LINENO: checking whether to use xiss" >&5 +echo $ECHO_N "checking whether to use xiss... $ECHO_C" >&6 +echo "$as_me:$LINENO: result: $with_xiss" >&5 +echo "${ECHO_T}$with_xiss" >&6 + +if test "${with_xiss}" = yes; then + HAVE_LIBXISS=yes + +cat >>confdefs.h <<\_ACEOF +#define HAVE_LIBXISS 1 +_ACEOF + + XISS_INCLUDES="-I${with_xiss_prefix}/include" + +else + { echo "$as_me:$LINENO: WARNING: xiss support disabled; target arcxiss will be unavailable." >&5 +echo "$as_me: WARNING: xiss support disabled; target arcxiss will be unavailable." >&2;} + HAVE_LIBXISS=no +fi + + +if test "${target}" = "arc-unknown-elf32"; then + +cat >>confdefs.h <<\_ACEOF +#define ARC_ELF32_TARGET 1 +_ACEOF + +fi +if test "${target}" = "arc-unknown-linux-uclibc"; then + +cat >>confdefs.h <<\_ACEOF +#define ARC_LINUX_TARGET 1 +_ACEOF + +fi + + # ------------------------- # # Checks for header files. # # ------------------------- # @@ -22997,7 +23214,7 @@ OLD_LIBS=$LIBS CFLAGS="$CFLAGS -I${srcdir}/../include -I../bfd -I${srcdir}/../bfd" LDFLAGS="$LDFLAGS -L../bfd -L../libiberty" intl=`echo $LIBINTL | sed 's,${top_builddir}/,,g'` -LIBS="$LIBS -lbfd -liberty $intl" +LIBS="$LIBS -lbfd -liberty $intl -lz" echo "$as_me:$LINENO: checking for ELF support in BFD" >&5 echo $ECHO_N "checking for ELF support in BFD... $ECHO_C" >&6 if test "${gdb_cv_var_elf+set}" = set; then @@ -24235,7 +24452,7 @@ ac_x_header_dirs=' /usr/openwin/share/include' if test "$ac_x_includes" = no; then - # Guess where to find include files, by looking for Intrinsic.h. + # Guess where to find include files, by looking for Xlib.h. # First, try using that file with no special directory specified. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -24243,7 +24460,7 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include +#include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 @@ -24270,7 +24487,7 @@ else sed 's/^/| /' conftest.$ac_ext >&5 for ac_dir in $ac_x_header_dirs; do - if test -r "$ac_dir/X11/Intrinsic.h"; then + if test -r "$ac_dir/X11/Xlib.h"; then ac_x_includes=$ac_dir break fi @@ -24284,18 +24501,18 @@ if test "$ac_x_libraries" = no; then # See if we find them without any special options. # Don't add to $LIBS permanently. ac_save_LIBS=$LIBS - LIBS="-lXt $LIBS" + LIBS="-lX11 $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include +#include int main () { -XtMalloc (0) +XrmInitialize () ; return 0; } @@ -25524,6 +25741,7 @@ s,@READLINE_CFLAGS@,$READLINE_CFLAGS,;t t s,@HAVE_LIBEXPAT@,$HAVE_LIBEXPAT,;t t s,@LIBEXPAT@,$LIBEXPAT,;t t s,@LTLIBEXPAT@,$LTLIBEXPAT,;t t +s,@XISS_INCLUDES@,$XISS_INCLUDES,;t t s,@ALLOCA@,$ALLOCA,;t t s,@CONFIG_LDFLAGS@,$CONFIG_LDFLAGS,;t t s,@TARGET_SYSTEM_ROOT@,$TARGET_SYSTEM_ROOT,;t t diff --git a/gdb/configure.ac b/gdb/configure.ac index 39246aa..8380c04 100644 --- a/gdb/configure.ac +++ b/gdb/configure.ac @@ -381,9 +381,12 @@ AC_CHECK_TOOL(MIG, mig) # We might need to link with -lm; most simulators need it. AC_CHECK_LIB(m, main) +AC_CHECK_FUNC(inflate, [], + [AC_CHECK_LIB(z, inflate)]) + # We need to link with -lw to get `wctype' on Solaris before Solaris # 2.6. Solaris 2.6 and beyond have this function in libc, and have a -# libw that some versions of the GNU linker cannot hanle (GNU ld 2.9.1 +# libw that some versions of the GNU linker cannot handle (GNU ld 2.9.1 # is known to have this problem). Therefore we avoid libw if we can. AC_CHECK_FUNC(wctype, [], [AC_CHECK_LIB(w, wctype)]) @@ -477,6 +480,32 @@ else fi fi + +AC_ARG_WITH(xiss, + AS_HELP_STRING([--with-xiss], [include xiss support (auto/yes/no)]), + [], [with_xiss=auto]) +AC_MSG_CHECKING([whether to use xiss]) +AC_MSG_RESULT([$with_xiss]) + +if test "${with_xiss}" = yes; then + HAVE_LIBXISS=yes + AC_DEFINE(HAVE_LIBXISS, 1, [Define if you have the xISS library.]) + XISS_INCLUDES="-I${with_xiss_prefix}/include" + AC_SUBST(XISS_INCLUDES) +else + AC_MSG_WARN([xiss support disabled; target arcxiss will be unavailable.]) + HAVE_LIBXISS=no +fi + + +if test "${target}" = "arc-unknown-elf32"; then + AC_DEFINE(ARC_ELF32_TARGET, 1, [Define if you are building the ARC bare-board debugger.]) +fi +if test "${target}" = "arc-unknown-linux-uclibc"; then + AC_DEFINE(ARC_LINUX_TARGET, 1, [Define if you are building the ARC Linux debugger.]) +fi + + # ------------------------- # # Checks for header files. # # ------------------------- # @@ -1414,7 +1443,7 @@ OLD_LIBS=$LIBS CFLAGS="$CFLAGS -I${srcdir}/../include -I../bfd -I${srcdir}/../bfd" LDFLAGS="$LDFLAGS -L../bfd -L../libiberty" intl=`echo $LIBINTL | sed 's,${top_builddir}/,,g'` -LIBS="$LIBS -lbfd -liberty $intl" +LIBS="$LIBS -lbfd -liberty $intl -lz" AC_CACHE_CHECK([for ELF support in BFD], gdb_cv_var_elf, [AC_TRY_LINK( [#include diff --git a/gdb/configure.tgt b/gdb/configure.tgt index ccfe674..6a15d39 100644 --- a/gdb/configure.tgt +++ b/gdb/configure.tgt @@ -61,15 +61,19 @@ alpha*-*-*) ;; arc*-*-linux*) + # Target: ARC Linux based targets gdb_target_obs="arc-tdep.o arc-linux-tdep.o solib.o solib-svr4.o \ - solib-legacy.o corelow.o" + corelow.o" build_gdbserver=yes ;; -arc-a4-*) - gdb_target_obs="arc-tdep.o arc-jtag.o arc-jtag-tdep.o arc-jtag-ops.o" - ;; + arc*-*-*) - gdb_target_obs="arc-tdep.o arc-jtag.o arc-jtag-tdep.o arc-jtag-ops.o" + # Target: ARC elf32 based target + gdb_target_obs="arc-tdep.o arc-jtag.o arc-elf32-tdep.o arc-jtag-ops.o \ + arc-jtag-actionpoints.o arc-remote-fileio.o arc-xiss.o \ + arc-registers.o arc-architecture.o arc-board.o \ + arc-memory.o arc-arguments.o arc-gpio.o arc-inst-tracing.o" + gdb_sim=../sim/arc/libsim.a ;; am33_2.0*-*-linux*) diff --git a/gdb/doc/observer.texi b/gdb/doc/observer.texi index e4c99d8..f1a9de5 100644 --- a/gdb/doc/observer.texi +++ b/gdb/doc/observer.texi @@ -98,6 +98,23 @@ The inferior has stopped for real. The target's register contents have changed. @end deftypefun +@deftypefun void target_pre_connect (struct target_ops *@var{target}) +Connection to the target is about to be performed. +@end deftypefun + +@deftypefun void target_post_connect (struct target_ops *@var{target}) +Ccnnection to the target has just been performed. +@end deftypefun + +@deftypefun void target_post_disconnect (struct target_ops *@var{target}) +Disconnection from the target has just been performed. +@end deftypefun + +@deftypefun void target_updated (struct target_ops *@var{target}) +The target has been updated. +@end deftypefun + + @deftypefun void executable_changed (void *@var{unused_args}) The executable being debugged by GDB has changed: The user decided to debug a different program, or the program he was debugging has diff --git a/gdb/dwarf2-frame.c b/gdb/dwarf2-frame.c index 8db1b68..c4cd9f3 100644 --- a/gdb/dwarf2-frame.c +++ b/gdb/dwarf2-frame.c @@ -592,10 +592,6 @@ bad CFI data; mismatched DW_CFA_restore_state at 0x%s"), paddr (fs->pc)); fs->regs.reg[reg].loc.offset = -offset; break; - case DW_CFA_MWARC_info: - /* Ignored. */ - insn_ptr = read_uleb128 (insn_ptr, insn_end, &utmp); - break; default: internal_error (__FILE__, __LINE__, _("Unknown CFI encountered.")); } @@ -1719,8 +1715,6 @@ decode_frame_entry_1 (struct comp_unit *unit, gdb_byte *start, int eh_frame_p) augmentation += 2; } - if (augmentation[0] == 'H' && augmentation [1] == 'C') - augmentation += 2; cie->code_alignment_factor = read_unsigned_leb128 (unit->abfd, buf, &bytes_read); buf += bytes_read; diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c index 7deb08e..bf589a2 100644 --- a/gdb/dwarf2loc.c +++ b/gdb/dwarf2loc.c @@ -265,8 +265,89 @@ dwarf2_evaluate_loc_desc (struct symbol *var, struct frame_info *frame, return retval; } +// begin ARC +static CORE_ADDR +dwarf2_find_address (struct symbol *var, struct frame_info *frame, + gdb_byte *data, unsigned short size, + struct objfile *objfile) +{ + struct gdbarch *arch = get_frame_arch (frame); + struct value *retval; + struct dwarf_expr_baton baton; + struct dwarf_expr_context *ctx; + CORE_ADDR address; + + /* optimised out */ + if (size == 0) + return 0; + + baton.frame = frame; + baton.objfile = objfile; + + ctx = new_dwarf_expr_context (); + ctx->baton = &baton; + ctx->read_reg = dwarf_expr_read_reg; + ctx->read_mem = dwarf_expr_read_mem; + ctx->get_frame_base = dwarf_expr_frame_base; + ctx->get_tls_address = dwarf_expr_tls_address; + + dwarf_expr_eval (ctx, data, size); + if (ctx->num_pieces > 0) + { + /* what should we do here? */ + address = 0; + } + else if (ctx->in_reg) + address = 0; + else + address = dwarf_expr_fetch (ctx, 0); + + free_dwarf_expr_context (ctx); + + return address; +} +static unsigned int +dwarf2_find_size (struct symbol *var, struct frame_info *frame, + gdb_byte *data, unsigned short size, + struct objfile *objfile) +{ + struct gdbarch *arch = get_frame_arch (frame); + struct dwarf_expr_baton baton; + struct dwarf_expr_context *ctx; + unsigned int sz; + + /* optimised out */ + if (size == 0) + return 0; + + baton.frame = frame; + baton.objfile = objfile; + + ctx = new_dwarf_expr_context (); + ctx->baton = &baton; + ctx->read_reg = dwarf_expr_read_reg; + ctx->read_mem = dwarf_expr_read_mem; + ctx->get_frame_base = dwarf_expr_frame_base; + ctx->get_tls_address = dwarf_expr_tls_address; + + dwarf_expr_eval (ctx, data, size); + if (ctx->num_pieces > 0) + { + /* what should we do here? */ + sz = 0; + } + else if (ctx->in_reg) + sz = 0; + else + sz = TYPE_LENGTH (SYMBOL_TYPE (var)); + + free_dwarf_expr_context (ctx); + + return sz; +} +// end ARC /* Helper functions and baton for dwarf2_loc_desc_needs_frame. */ @@ -434,6 +515,30 @@ locexpr_read_variable (struct symbol *symbol, struct frame_info *frame) return val; } +// begin ARC +/* Return the address of SYMBOL in FRAME using the DWARF-2 expression + evaluator to calculate the location. */ +static CORE_ADDR +locexpr_get_variable_address (struct symbol *symbol, struct frame_info *frame) +{ + struct dwarf2_locexpr_baton *dlbaton = SYMBOL_LOCATION_BATON (symbol); + + return dwarf2_find_address (symbol, frame, dlbaton->data, dlbaton->size, + dlbaton->objfile); +} + +/* Return the size of SYMBOL in FRAME using the DWARF-2 expression + evaluator to calculate the location. */ +static unsigned int +locexpr_get_variable_size(struct symbol *symbol, struct frame_info *frame) +{ + struct dwarf2_locexpr_baton *dlbaton = SYMBOL_LOCATION_BATON (symbol); + + return dwarf2_find_size (symbol, frame, dlbaton->data, dlbaton->size, + dlbaton->objfile); +} +// end ARC + /* Return non-zero iff we need a frame to evaluate SYMBOL. */ static int locexpr_read_needs_frame (struct symbol *symbol) @@ -516,6 +621,10 @@ locexpr_tracepoint_var_ref (struct symbol * symbol, struct agent_expr * ax, evaluator. */ const struct symbol_ops dwarf2_locexpr_funcs = { locexpr_read_variable, +// begin ARC + locexpr_get_variable_address, + locexpr_get_variable_size, +// end ARC locexpr_read_needs_frame, locexpr_describe_location, locexpr_tracepoint_var_ref @@ -551,6 +660,46 @@ loclist_read_variable (struct symbol *symbol, struct frame_info *frame) return val; } +// begin ARC +/* Return the address of SYMBOL in FRAME using the DWARF-2 expression + evaluator to calculate the location. */ +static CORE_ADDR +loclist_get_variable_address (struct symbol *symbol, struct frame_info *frame) +{ + struct dwarf2_loclist_baton *dlbaton = SYMBOL_LOCATION_BATON (symbol); + struct value *val; + gdb_byte *data; + size_t size; + + data = find_location_expression (dlbaton, &size, + frame ? get_frame_address_in_block (frame) + : 0); + if (data == NULL) + return 0; + + return dwarf2_find_address(symbol, frame, data, size, dlbaton->objfile); +} + +/* Return the size of SYMBOL in FRAME using the DWARF-2 expression + evaluator to calculate the location. */ +static unsigned int +loclist_get_variable_size(struct symbol *symbol, struct frame_info *frame) +{ + struct dwarf2_loclist_baton *dlbaton = SYMBOL_LOCATION_BATON (symbol); + struct value *val; + gdb_byte *data; + size_t size; + + data = find_location_expression (dlbaton, &size, + frame ? get_frame_address_in_block (frame) + : 0); + if (data == NULL) + return 0; + + return dwarf2_find_size(symbol, frame, data, size, dlbaton->objfile); +} +// end ARC + /* Return non-zero iff we need a frame to evaluate SYMBOL. */ static int loclist_read_needs_frame (struct symbol *symbol) @@ -594,6 +743,10 @@ loclist_tracepoint_var_ref (struct symbol * symbol, struct agent_expr * ax, evaluator and location lists. */ const struct symbol_ops dwarf2_loclist_funcs = { loclist_read_variable, +// begin ARC + loclist_get_variable_address, + loclist_get_variable_size, +// end ARC loclist_read_needs_frame, loclist_describe_location, loclist_tracepoint_var_ref diff --git a/gdb/exec.c b/gdb/exec.c index 7648b03..2ffeba4 100644 --- a/gdb/exec.c +++ b/gdb/exec.c @@ -31,7 +31,7 @@ #include "value.h" #include "exec.h" #include "observer.h" -#include "arch-utils.c" +#include "arch-utils.h" /* richards ARC 23/9/08: change .c to .h gdb bug: 9888 */ #include #include "readline/readline.h" diff --git a/gdb/features/arc-a5-cpu.xml b/gdb/features/arc-a5-cpu.xml new file mode 100644 index 0000000..7ff602b --- /dev/null +++ b/gdb/features/arc-a5-cpu.xml @@ -0,0 +1,258 @@ + + + + +A5 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/gdb/features/arc-registers.dtd b/gdb/features/arc-registers.dtd new file mode 100644 index 0000000..b050fa0 --- /dev/null +++ b/gdb/features/arc-registers.dtd @@ -0,0 +1,71 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/gdb/features/arc600-cpu.xml b/gdb/features/arc600-cpu.xml new file mode 100644 index 0000000..1ecaee4 --- /dev/null +++ b/gdb/features/arc600-cpu.xml @@ -0,0 +1,266 @@ + + + + +ARC600 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/gdb/features/arc700-cpu.xml b/gdb/features/arc700-cpu.xml new file mode 100644 index 0000000..5fa97d2 --- /dev/null +++ b/gdb/features/arc700-cpu.xml @@ -0,0 +1,416 @@ + + + + +ARC700 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/gdb/gdb-events.c b/gdb/gdb-events.c index d688475..f24ece5 100644 --- a/gdb/gdb-events.c +++ b/gdb/gdb-events.c @@ -122,6 +122,18 @@ architecture_changed_event (void) current_event_hooks->architecture_changed (); } +// begin ARC +void +reg_architecture_changed_event (void) +{ + if (gdb_events_debug) + fprintf_unfiltered (gdb_stdlog, "reg_architecture_changed_event\n"); + if (!current_event_hooks->reg_architecture_changed) + return; + current_event_hooks->reg_architecture_changed (); +} +// end ARC + struct gdb_events * deprecated_set_gdb_event_hooks (struct gdb_events *vector) { @@ -148,6 +160,9 @@ enum gdb_event tracepoint_delete, tracepoint_modify, architecture_changed, +// begin ARC + reg_architecture_changed, +// end ARC nr_gdb_events }; @@ -271,6 +286,16 @@ queue_architecture_changed (void) append (event); } +// begin ARC +static void +queue_reg_architecture_changed (void) +{ + struct event *event = XMALLOC (struct event); + event->type = reg_architecture_changed; + append (event); +} +// end ARC + void gdb_events_deliver (struct gdb_events *vector) { @@ -319,6 +344,11 @@ gdb_events_deliver (struct gdb_events *vector) case architecture_changed: vector->architecture_changed (); break; +// begin ARC + case reg_architecture_changed: + vector->reg_architecture_changed (); + break; +// end ARC } delivering_events = event->next; xfree (event); @@ -337,6 +367,9 @@ _initialize_gdb_events (void) queue_event_hooks.tracepoint_delete = queue_tracepoint_delete; queue_event_hooks.tracepoint_modify = queue_tracepoint_modify; queue_event_hooks.architecture_changed = queue_architecture_changed; +// begin ARC + queue_event_hooks.reg_architecture_changed = queue_reg_architecture_changed; +// end ARC add_setshow_zinteger_cmd ("event", class_maintenance, &gdb_events_debug, _("\ diff --git a/gdb/gdb-events.h b/gdb/gdb-events.h index 9c38c0a..5a6dd4a 100644 --- a/gdb/gdb-events.h +++ b/gdb/gdb-events.h @@ -55,6 +55,9 @@ typedef void (gdb_events_tracepoint_create_ftype) (int number); typedef void (gdb_events_tracepoint_delete_ftype) (int number); typedef void (gdb_events_tracepoint_modify_ftype) (int number); typedef void (gdb_events_architecture_changed_ftype) (void); +// begin ARC +typedef void (gdb_events_reg_architecture_changed_ftype) (void); +// end ARC /* gdb-events: object. */ @@ -68,6 +71,9 @@ struct gdb_events gdb_events_tracepoint_delete_ftype *tracepoint_delete; gdb_events_tracepoint_modify_ftype *tracepoint_modify; gdb_events_architecture_changed_ftype *architecture_changed; +// begin ARC + gdb_events_reg_architecture_changed_ftype *reg_architecture_changed; +// end ARC }; @@ -81,6 +87,9 @@ extern void tracepoint_create_event (int number); extern void tracepoint_delete_event (int number); extern void tracepoint_modify_event (int number); extern void architecture_changed_event (void); +// begin ARC +extern void reg_architecture_changed_event (void); +// end ARC /* Install custom gdb-events hooks. */ extern struct gdb_events *deprecated_set_gdb_event_hooks (struct gdb_events *vector); diff --git a/gdb/gdbserver/Makefile.in b/gdb/gdbserver/Makefile.in index d967ff5..f7fe7d4 100644 --- a/gdb/gdbserver/Makefile.in +++ b/gdb/gdbserver/Makefile.in @@ -330,7 +330,7 @@ spu-low.o: spu-low.c $(server_h) reg-arc.o : reg-arc.c $(regdef_h) reg-arc.c : $(srcdir)/../regformats/reg-arc.dat $(regdat_sh) - sh $(regdat_sh) $(srcdir)/../regformats/reg-arc.dat reg-arc.c + $(SHELL) $(regdat_sh) $(srcdir)/../regformats/reg-arc.dat reg-arc.c reg-arm.o : reg-arm.c $(regdef_h) reg-arm.c : $(srcdir)/../regformats/reg-arm.dat $(regdat_sh) $(SHELL) $(regdat_sh) $(srcdir)/../regformats/reg-arm.dat reg-arm.c diff --git a/gdb/gdbserver/build_gdbserver.sh b/gdb/gdbserver/build_gdbserver.sh new file mode 100755 index 0000000..bdf886f --- /dev/null +++ b/gdb/gdbserver/build_gdbserver.sh @@ -0,0 +1,6 @@ +#Bash script to build gdbserver +export CFLAGS="-mA7 -static -O0" +export LDFLAGS="-mA7" +export CC=arc-linux-uclibc-gcc +./configure --host=i386-redhat-linux-gnu --target=arc-linux-uclibc +make diff --git a/gdb/gdbserver/configure.srv b/gdb/gdbserver/configure.srv index c0d246b..c3c2d56 100644 --- a/gdb/gdbserver/configure.srv +++ b/gdb/gdbserver/configure.srv @@ -26,11 +26,16 @@ srv_hostio_err_objs="hostio-errno.o" # Input is taken from the "${target}" variable. case "${target}" in - arc*-*-linux*) srv_regobj=reg-arc.o - srv_tgtobj="linux-low.o linux-arc-low.o" - srv_linux_usrregs=yes - srv_linux_thread_db=yes - ;; + arc*-*-linux*) srv_regobj=reg-arc.o + srv_tgtobj="linux-low.o linux-arc-low.o" + srv_linux_usrregs=yes + srv_linux_thread_db=yes + ;; + arc*-*) srv_regobj=reg-arc.o + srv_tgtobj="linux-low.o linux-arc-low.o" + srv_linux_usrregs=yes + srv_linux_thread_db=yes + ;; arm*-*-linux*) srv_tgtobj="linux-low.o linux-arm-low.o" srv_linux_usrregs=yes srv_linux_regsets=yes diff --git a/gdb/gdbserver/linux-arc-low.c b/gdb/gdbserver/linux-arc-low.c index 28c7ead..c5faa1d 100644 --- a/gdb/gdbserver/linux-arc-low.c +++ b/gdb/gdbserver/linux-arc-low.c @@ -113,7 +113,7 @@ arc_breakpoint_at (CORE_ADDR where) { unsigned long insn; - (*the_target->read_memory) (where, (char *) &insn, arc_breakpoint_len); + (*the_target->read_memory) (where, (unsigned char *) &insn, arc_breakpoint_len); if (insn == arc_breakpoint) return 1; @@ -141,7 +141,7 @@ struct linux_target_ops the_low_target = { arc_cannot_store_register, arc_get_pc, arc_set_pc, - (const char *) &arc_breakpoint, + (const unsigned char *) &arc_breakpoint, arc_breakpoint_len, arc_reinsert_addr, 0, diff --git a/gdb/gdbserver/proc-service.c b/gdb/gdbserver/proc-service.c index 065bfdf..fc7bc19 100644 --- a/gdb/gdbserver/proc-service.c +++ b/gdb/gdbserver/proc-service.c @@ -28,6 +28,7 @@ #include "linux-low.h" #include "gdb_proc_service.h" +typedef unsigned long paddr_t; typedef struct ps_prochandle *gdb_ps_prochandle_t; typedef void *gdb_ps_read_buf_t; @@ -61,7 +62,7 @@ gregset_info(void) ps_err_e ps_pglobal_lookup (gdb_ps_prochandle_t ph, const char *obj, - const char *name, psaddr_t *sym_addr) + const char *name, paddr_t *sym_addr) { CORE_ADDR addr; char *uscorename; @@ -89,7 +90,8 @@ ps_pglobal_lookup (gdb_ps_prochandle_t ph, const char *obj, return PS_NOSYM; } - *sym_addr = (psaddr_t) (unsigned long) addr; + *sym_addr = (paddr_t) (unsigned long) addr; + return PS_OK; } diff --git a/gdb/gdbserver/remote-utils.c b/gdb/gdbserver/remote-utils.c index 496334c..2e049ee 100644 --- a/gdb/gdbserver/remote-utils.c +++ b/gdb/gdbserver/remote-utils.c @@ -169,9 +169,7 @@ remote_open (char *name) } #endif -/* #ifdef HAVE_SGTTY */ - /* soam */ -#if 0 +#ifdef HAVE_SGTTY { struct sgttyb sg; @@ -773,8 +771,7 @@ getpkt (char *buf) c1 = fromhex (readchar ()); c2 = fromhex (readchar ()); -/* if (csum == (c1 << 4) + c2) */ - if(1) /* (soam) for testing */ + if (csum == (c1 << 4) + c2) break; fprintf (stderr, "Bad checksum, sentsum=0x%x, csum=0x%x, buf=%s\n", diff --git a/gdb/gpio.h b/gdb/gpio.h deleted file mode 100644 index 86aa4ca..0000000 --- a/gdb/gpio.h +++ /dev/null @@ -1,38 +0,0 @@ -struct GPIO_ioctl { - // This is used for general input and output in the same ioctl. - // inlen is replaced by the number of input bytes consumed. - // inlen is always even and represents a number of pairs: - // [0/1/2,value]: write value to port_base+0/1/2. - // [0x80/0x81/0x82, --]: read value from port_base+0/1/2 - // and append result to outbuf. - // Thus one can intermix read and write in the same ioctl. - unsigned inlen; char *inbuf; - // outlen is replaced by # of output bytes written. - unsigned outlen; char *outbuf; - }; - -// IO control numbers - -// Linux kernel uses 0x54XX for special purposes. Avoid such. -// We'll pick large numbers. -// We don't use the linux convention of dividing the IOC into a bunch -// of bit fields. We can always switch to this later, as the -// IOC 0 returns the driver version (which IOC value will never change). - -#define GPIO_IOC_VERSION 0 // returns version -#define GPIO_IOC_BASE 0xaa3a0000 // Intended for use on ARCangel 3! - -// Switch base address of parallel port. 0x3f8 is assumed. -// WARNING! You can write on any port whatsoever with this driver. -// BE CAREFUL! -#define GPIO_IOC_SET_PORT_BASE (GPIO_IOC_BASE+1) // cmd, arg=port base - -// General input/output ioctl. See GPIO_ioctl struct. -#define GPIO_IOC_DO_IO (GPIO_IOC_BASE+2) // cmd, arg=GPIO_ioctl * - -// For emergency purposes in case the driver is goofed up. -#define GPIO_IOC_HARDRESET (GPIO_IOC_BASE+3) // cmd, no arg - -// Do you have an antiquated parallel port? You might need to ask -// the driver to use outb_p and inb_p (_p = pause). Default is not to. -#define GPIO_IOC_SET_PAUSE (GPIO_IOC_BASE+4) // arg = 1 => use pause; o/wise not. diff --git a/gdb/infcmd.c b/gdb/infcmd.c index 972f9e2..4e76260 100644 --- a/gdb/infcmd.c +++ b/gdb/infcmd.c @@ -1603,15 +1603,25 @@ default_print_registers_info (struct gdbarch *gdbarch, continue; } - /* If the register name is empty, it is undefined for this - processor, so don't display anything. */ - if (gdbarch_register_name (gdbarch, i) == NULL - || *(gdbarch_register_name (gdbarch, i)) == '\0') - continue; - - fputs_filtered (gdbarch_register_name (gdbarch, i), file); - print_spaces_filtered (15 - strlen (gdbarch_register_name - (gdbarch, i)), file); + { + /* richards ARC 29/10/27 gdb bug: 9884 + call the gdbarch_register_name once only! + */ + const char* name = gdbarch_register_name (gdbarch, i); + + /* If the register name is empty, it is undefined for this + processor, so don't display anything. */ + if (name == NULL || *name == '\0') + continue; + + fputs_filtered (name, file); + + /* richards ARC 29/9/08 gdb bug: 9885 + Some ARC register names are longer than 15 chars! + There should be a gdbarch_max_register_name_length function + which could be called here instead of using an integer literal. */ + print_spaces_filtered (22 - strlen (name), file); + } /* Get the data in raw format. */ if (! frame_register_read (frame, i, buffer)) diff --git a/gdb/remote-fileio.c b/gdb/remote-fileio.c index e51f272..9a961f4 100644 --- a/gdb/remote-fileio.c +++ b/gdb/remote-fileio.c @@ -24,441 +24,14 @@ #include "gdbcmd.h" #include "remote.h" #include "gdb/fileio.h" -#include "gdb_wait.h" -#include "gdb_stat.h" #include "exceptions.h" #include "remote-fileio.h" +#include "target-fileio.h" -#include -#include -#ifdef __CYGWIN__ -#include /* For cygwin_conv_to_full_posix_path. */ -#endif #include -static struct { - int *fd_map; - int fd_map_size; -} remote_fio_data; - -#define FIO_FD_INVALID -1 -#define FIO_FD_CONSOLE_IN -2 -#define FIO_FD_CONSOLE_OUT -3 - -static int remote_fio_system_call_allowed = 0; - -static int -remote_fileio_init_fd_map (void) -{ - int i; - - if (!remote_fio_data.fd_map) - { - remote_fio_data.fd_map = (int *) xmalloc (10 * sizeof (int)); - remote_fio_data.fd_map_size = 10; - remote_fio_data.fd_map[0] = FIO_FD_CONSOLE_IN; - remote_fio_data.fd_map[1] = FIO_FD_CONSOLE_OUT; - remote_fio_data.fd_map[2] = FIO_FD_CONSOLE_OUT; - for (i = 3; i < 10; ++i) - remote_fio_data.fd_map[i] = FIO_FD_INVALID; - } - return 3; -} - -static int -remote_fileio_resize_fd_map (void) -{ - int i = remote_fio_data.fd_map_size; - - if (!remote_fio_data.fd_map) - return remote_fileio_init_fd_map (); - remote_fio_data.fd_map_size += 10; - remote_fio_data.fd_map = - (int *) xrealloc (remote_fio_data.fd_map, - remote_fio_data.fd_map_size * sizeof (int)); - for (; i < remote_fio_data.fd_map_size; i++) - remote_fio_data.fd_map[i] = FIO_FD_INVALID; - return remote_fio_data.fd_map_size - 10; -} - -static int -remote_fileio_next_free_fd (void) -{ - int i; - - for (i = 0; i < remote_fio_data.fd_map_size; ++i) - if (remote_fio_data.fd_map[i] == FIO_FD_INVALID) - return i; - return remote_fileio_resize_fd_map (); -} - -static int -remote_fileio_fd_to_targetfd (int fd) -{ - int target_fd = remote_fileio_next_free_fd (); - remote_fio_data.fd_map[target_fd] = fd; - return target_fd; -} - -static int -remote_fileio_map_fd (int target_fd) -{ - remote_fileio_init_fd_map (); - if (target_fd < 0 || target_fd >= remote_fio_data.fd_map_size) - return FIO_FD_INVALID; - return remote_fio_data.fd_map[target_fd]; -} - -static void -remote_fileio_close_target_fd (int target_fd) -{ - remote_fileio_init_fd_map (); - if (target_fd >= 0 && target_fd < remote_fio_data.fd_map_size) - remote_fio_data.fd_map[target_fd] = FIO_FD_INVALID; -} - -static int -remote_fileio_oflags_to_host (long flags) -{ - int hflags = 0; - - if (flags & FILEIO_O_CREAT) - hflags |= O_CREAT; - if (flags & FILEIO_O_EXCL) - hflags |= O_EXCL; - if (flags & FILEIO_O_TRUNC) - hflags |= O_TRUNC; - if (flags & FILEIO_O_APPEND) - hflags |= O_APPEND; - if (flags & FILEIO_O_RDONLY) - hflags |= O_RDONLY; - if (flags & FILEIO_O_WRONLY) - hflags |= O_WRONLY; - if (flags & FILEIO_O_RDWR) - hflags |= O_RDWR; -/* On systems supporting binary and text mode, always open files in - binary mode. */ -#ifdef O_BINARY - hflags |= O_BINARY; -#endif - return hflags; -} - -static mode_t -remote_fileio_mode_to_host (long mode, int open_call) -{ - mode_t hmode = 0; - - if (!open_call) - { - if (mode & FILEIO_S_IFREG) - hmode |= S_IFREG; - if (mode & FILEIO_S_IFDIR) - hmode |= S_IFDIR; - if (mode & FILEIO_S_IFCHR) - hmode |= S_IFCHR; - } - if (mode & FILEIO_S_IRUSR) - hmode |= S_IRUSR; - if (mode & FILEIO_S_IWUSR) - hmode |= S_IWUSR; - if (mode & FILEIO_S_IXUSR) - hmode |= S_IXUSR; -#ifdef S_IRGRP - if (mode & FILEIO_S_IRGRP) - hmode |= S_IRGRP; -#endif -#ifdef S_IWGRP - if (mode & FILEIO_S_IWGRP) - hmode |= S_IWGRP; -#endif -#ifdef S_IXGRP - if (mode & FILEIO_S_IXGRP) - hmode |= S_IXGRP; -#endif - if (mode & FILEIO_S_IROTH) - hmode |= S_IROTH; -#ifdef S_IWOTH - if (mode & FILEIO_S_IWOTH) - hmode |= S_IWOTH; -#endif -#ifdef S_IXOTH - if (mode & FILEIO_S_IXOTH) - hmode |= S_IXOTH; -#endif - return hmode; -} - -static LONGEST -remote_fileio_mode_to_target (mode_t mode) -{ - mode_t tmode = 0; - - if (S_ISREG(mode)) - tmode |= FILEIO_S_IFREG; - if (S_ISDIR(mode)) - tmode |= FILEIO_S_IFDIR; - if (S_ISCHR(mode)) - tmode |= FILEIO_S_IFCHR; - if (mode & S_IRUSR) - tmode |= FILEIO_S_IRUSR; - if (mode & S_IWUSR) - tmode |= FILEIO_S_IWUSR; - if (mode & S_IXUSR) - tmode |= FILEIO_S_IXUSR; -#ifdef S_IRGRP - if (mode & S_IRGRP) - tmode |= FILEIO_S_IRGRP; -#endif -#ifdef S_IWRGRP - if (mode & S_IWGRP) - tmode |= FILEIO_S_IWGRP; -#endif -#ifdef S_IXGRP - if (mode & S_IXGRP) - tmode |= FILEIO_S_IXGRP; -#endif - if (mode & S_IROTH) - tmode |= FILEIO_S_IROTH; -#ifdef S_IWOTH - if (mode & S_IWOTH) - tmode |= FILEIO_S_IWOTH; -#endif -#ifdef S_IXOTH - if (mode & S_IXOTH) - tmode |= FILEIO_S_IXOTH; -#endif - return tmode; -} - -static int -remote_fileio_errno_to_target (int error) -{ - switch (error) - { - case EPERM: - return FILEIO_EPERM; - case ENOENT: - return FILEIO_ENOENT; - case EINTR: - return FILEIO_EINTR; - case EIO: - return FILEIO_EIO; - case EBADF: - return FILEIO_EBADF; - case EACCES: - return FILEIO_EACCES; - case EFAULT: - return FILEIO_EFAULT; - case EBUSY: - return FILEIO_EBUSY; - case EEXIST: - return FILEIO_EEXIST; - case ENODEV: - return FILEIO_ENODEV; - case ENOTDIR: - return FILEIO_ENOTDIR; - case EISDIR: - return FILEIO_EISDIR; - case EINVAL: - return FILEIO_EINVAL; - case ENFILE: - return FILEIO_ENFILE; - case EMFILE: - return FILEIO_EMFILE; - case EFBIG: - return FILEIO_EFBIG; - case ENOSPC: - return FILEIO_ENOSPC; - case ESPIPE: - return FILEIO_ESPIPE; - case EROFS: - return FILEIO_EROFS; - case ENOSYS: - return FILEIO_ENOSYS; - case ENAMETOOLONG: - return FILEIO_ENAMETOOLONG; - } - return FILEIO_EUNKNOWN; -} - -static int -remote_fileio_seek_flag_to_host (long num, int *flag) -{ - if (!flag) - return 0; - switch (num) - { - case FILEIO_SEEK_SET: - *flag = SEEK_SET; - break; - case FILEIO_SEEK_CUR: - *flag = SEEK_CUR; - break; - case FILEIO_SEEK_END: - *flag = SEEK_END; - break; - default: - return -1; - } - return 0; -} - -static int -remote_fileio_extract_long (char **buf, LONGEST *retlong) -{ - char *c; - int sign = 1; - - if (!buf || !*buf || !**buf || !retlong) - return -1; - c = strchr (*buf, ','); - if (c) - *c++ = '\0'; - else - c = strchr (*buf, '\0'); - while (strchr ("+-", **buf)) - { - if (**buf == '-') - sign = -sign; - ++*buf; - } - for (*retlong = 0; **buf; ++*buf) - { - *retlong <<= 4; - if (**buf >= '0' && **buf <= '9') - *retlong += **buf - '0'; - else if (**buf >= 'a' && **buf <= 'f') - *retlong += **buf - 'a' + 10; - else if (**buf >= 'A' && **buf <= 'F') - *retlong += **buf - 'A' + 10; - else - return -1; - } - *retlong *= sign; - *buf = c; - return 0; -} - -static int -remote_fileio_extract_int (char **buf, long *retint) -{ - int ret; - LONGEST retlong; - - if (!retint) - return -1; - ret = remote_fileio_extract_long (buf, &retlong); - if (!ret) - *retint = (long) retlong; - return ret; -} - -static int -remote_fileio_extract_ptr_w_len (char **buf, CORE_ADDR *ptrval, int *length) -{ - char *c; - LONGEST retlong; - - if (!buf || !*buf || !**buf || !ptrval || !length) - return -1; - c = strchr (*buf, '/'); - if (!c) - return -1; - *c++ = '\0'; - if (remote_fileio_extract_long (buf, &retlong)) - return -1; - *ptrval = (CORE_ADDR) retlong; - *buf = c; - if (remote_fileio_extract_long (buf, &retlong)) - return -1; - *length = (int) retlong; - return 0; -} - -/* Convert to big endian */ -static void -remote_fileio_to_be (LONGEST num, char *buf, int bytes) -{ - int i; - - for (i = 0; i < bytes; ++i) - buf[i] = (num >> (8 * (bytes - i - 1))) & 0xff; -} - -static void -remote_fileio_to_fio_uint (long num, fio_uint_t fnum) -{ - remote_fileio_to_be ((LONGEST) num, (char *) fnum, 4); -} - -static void -remote_fileio_to_fio_mode (mode_t num, fio_mode_t fnum) -{ - remote_fileio_to_be (remote_fileio_mode_to_target(num), (char *) fnum, 4); -} - -static void -remote_fileio_to_fio_time (time_t num, fio_time_t fnum) -{ - remote_fileio_to_be ((LONGEST) num, (char *) fnum, 4); -} - -static void -remote_fileio_to_fio_long (LONGEST num, fio_long_t fnum) -{ - remote_fileio_to_be (num, (char *) fnum, 8); -} - -static void -remote_fileio_to_fio_ulong (LONGEST num, fio_ulong_t fnum) -{ - remote_fileio_to_be (num, (char *) fnum, 8); -} - -static void -remote_fileio_to_fio_stat (struct stat *st, struct fio_stat *fst) -{ - LONGEST blksize; - - /* `st_dev' is set in the calling function */ - remote_fileio_to_fio_uint ((long) st->st_ino, fst->fst_ino); - remote_fileio_to_fio_mode (st->st_mode, fst->fst_mode); - remote_fileio_to_fio_uint ((long) st->st_nlink, fst->fst_nlink); - remote_fileio_to_fio_uint ((long) st->st_uid, fst->fst_uid); - remote_fileio_to_fio_uint ((long) st->st_gid, fst->fst_gid); - remote_fileio_to_fio_uint ((long) st->st_rdev, fst->fst_rdev); - remote_fileio_to_fio_ulong ((LONGEST) st->st_size, fst->fst_size); -#ifdef HAVE_STRUCT_STAT_ST_BLKSIZE - blksize = st->st_blksize; -#else - blksize = 512; -#endif - remote_fileio_to_fio_ulong (blksize, fst->fst_blksize); -#if HAVE_STRUCT_STAT_ST_BLOCKS - remote_fileio_to_fio_ulong ((LONGEST) st->st_blocks, fst->fst_blocks); -#else - /* FIXME: This is correct for DJGPP, but other systems that don't - have st_blocks, if any, might prefer 512 instead of st_blksize. - (eliz, 30-12-2003) */ - remote_fileio_to_fio_ulong (((LONGEST) st->st_size + blksize - 1) - / blksize, - fst->fst_blocks); -#endif - remote_fileio_to_fio_time (st->st_atime, fst->fst_atime); - remote_fileio_to_fio_time (st->st_mtime, fst->fst_mtime); - remote_fileio_to_fio_time (st->st_ctime, fst->fst_ctime); -} - -static void -remote_fileio_to_fio_timeval (struct timeval *tv, struct fio_timeval *ftv) -{ - remote_fileio_to_fio_time (tv->tv_sec, ftv->ftv_sec); - remote_fileio_to_fio_long (tv->tv_usec, ftv->ftv_usec); -} static int remote_fio_ctrl_c_flag = 0; -static int remote_fio_no_longjmp = 0; #if defined (HAVE_SIGACTION) && defined (SA_RESTART) static struct sigaction remote_fio_sa; @@ -508,7 +81,7 @@ remote_fileio_ctrl_c_signal_handler (int signo) { remote_fileio_sig_set (SIG_IGN); remote_fio_ctrl_c_flag = 1; - if (!remote_fio_no_longjmp) + if (!target_fio_no_longjmp) deprecated_throw_reason (RETURN_QUIT); remote_fileio_sig_set (remote_fileio_ctrl_c_signal_handler); } @@ -543,30 +116,6 @@ remote_fileio_reply (int retcode, int error) putpkt (buf); } -static void -remote_fileio_ioerror (void) -{ - remote_fileio_reply (-1, FILEIO_EIO); -} - -static void -remote_fileio_badfd (void) -{ - remote_fileio_reply (-1, FILEIO_EBADF); -} - -static void -remote_fileio_return_errno (int retcode) -{ - remote_fileio_reply (retcode, - retcode < 0 ? remote_fileio_errno_to_target (errno) : 0); -} - -static void -remote_fileio_return_success (int retcode) -{ - remote_fileio_reply (retcode, 0); -} /* Wrapper function for remote_write_bytes() which has the disadvantage to write only one packet, regardless of the requested number of bytes to @@ -586,791 +135,11 @@ remote_fileio_write_bytes (CORE_ADDR memaddr, gdb_byte *myaddr, int len) return ret; } -static void -remote_fileio_func_open (char *buf) -{ - CORE_ADDR ptrval; - int length, retlength; - long num; - int flags, fd; - mode_t mode; - char *pathname; - struct stat st; - - /* 1. Parameter: Ptr to pathname / length incl. trailing zero */ - if (remote_fileio_extract_ptr_w_len (&buf, &ptrval, &length)) - { - remote_fileio_ioerror (); - return; - } - /* 2. Parameter: open flags */ - if (remote_fileio_extract_int (&buf, &num)) - { - remote_fileio_ioerror (); - return; - } - flags = remote_fileio_oflags_to_host (num); - /* 3. Parameter: open mode */ - if (remote_fileio_extract_int (&buf, &num)) - { - remote_fileio_ioerror (); - return; - } - mode = remote_fileio_mode_to_host (num, 1); - - /* Request pathname using 'm' packet */ - pathname = alloca (length); - retlength = remote_read_bytes (ptrval, (gdb_byte *) pathname, length); - if (retlength != length) - { - remote_fileio_ioerror (); - return; - } - - /* Check if pathname exists and is not a regular file or directory. If so, - return an appropriate error code. Same for trying to open directories - for writing. */ - if (!stat (pathname, &st)) - { - if (!S_ISREG (st.st_mode) && !S_ISDIR (st.st_mode)) - { - remote_fileio_reply (-1, FILEIO_ENODEV); - return; - } - if (S_ISDIR (st.st_mode) - && ((flags & O_WRONLY) == O_WRONLY || (flags & O_RDWR) == O_RDWR)) - { - remote_fileio_reply (-1, FILEIO_EISDIR); - return; - } - } - - remote_fio_no_longjmp = 1; - fd = open (pathname, flags, mode); - if (fd < 0) - { - remote_fileio_return_errno (-1); - return; - } - - fd = remote_fileio_fd_to_targetfd (fd); - remote_fileio_return_success (fd); -} - -static void -remote_fileio_func_close (char *buf) -{ - long num; - int fd; - - /* Parameter: file descriptor */ - if (remote_fileio_extract_int (&buf, &num)) - { - remote_fileio_ioerror (); - return; - } - fd = remote_fileio_map_fd ((int) num); - if (fd == FIO_FD_INVALID) - { - remote_fileio_badfd (); - return; - } - - remote_fio_no_longjmp = 1; - if (fd != FIO_FD_CONSOLE_IN && fd != FIO_FD_CONSOLE_OUT && close (fd)) - remote_fileio_return_errno (-1); - remote_fileio_close_target_fd ((int) num); - remote_fileio_return_success (0); -} static void -remote_fileio_func_read (char *buf) +set_ctrl_c_signal_handler(void) { - long target_fd, num; - LONGEST lnum; - CORE_ADDR ptrval; - int fd, ret, retlength; - gdb_byte *buffer; - size_t length; - off_t old_offset, new_offset; - - /* 1. Parameter: file descriptor */ - if (remote_fileio_extract_int (&buf, &target_fd)) - { - remote_fileio_ioerror (); - return; - } - fd = remote_fileio_map_fd ((int) target_fd); - if (fd == FIO_FD_INVALID) - { - remote_fileio_badfd (); - return; - } - /* 2. Parameter: buffer pointer */ - if (remote_fileio_extract_long (&buf, &lnum)) - { - remote_fileio_ioerror (); - return; - } - ptrval = (CORE_ADDR) lnum; - /* 3. Parameter: buffer length */ - if (remote_fileio_extract_int (&buf, &num)) - { - remote_fileio_ioerror (); - return; - } - length = (size_t) num; - - switch (fd) - { - case FIO_FD_CONSOLE_OUT: - remote_fileio_badfd (); - return; - case FIO_FD_CONSOLE_IN: - { - static char *remaining_buf = NULL; - static int remaining_length = 0; - - buffer = (gdb_byte *) xmalloc (32768); - if (remaining_buf) - { - remote_fio_no_longjmp = 1; - if (remaining_length > length) - { - memcpy (buffer, remaining_buf, length); - memmove (remaining_buf, remaining_buf + length, - remaining_length - length); - remaining_length -= length; - ret = length; - } - else - { - memcpy (buffer, remaining_buf, remaining_length); - xfree (remaining_buf); - remaining_buf = NULL; - ret = remaining_length; - } - } - else - { - ret = ui_file_read (gdb_stdtargin, (char *) buffer, 32767); - remote_fio_no_longjmp = 1; - if (ret > 0 && (size_t)ret > length) - { - remaining_buf = (char *) xmalloc (ret - length); - remaining_length = ret - length; - memcpy (remaining_buf, buffer + length, remaining_length); - ret = length; - } - } - } - break; - default: - buffer = (gdb_byte *) xmalloc (length); - /* POSIX defines EINTR behaviour of read in a weird way. It's allowed - for read() to return -1 even if "some" bytes have been read. It - has been corrected in SUSv2 but that doesn't help us much... - Therefore a complete solution must check how many bytes have been - read on EINTR to return a more reliable value to the target */ - old_offset = lseek (fd, 0, SEEK_CUR); - remote_fio_no_longjmp = 1; - ret = read (fd, buffer, length); - if (ret < 0 && errno == EINTR) - { - new_offset = lseek (fd, 0, SEEK_CUR); - /* If some data has been read, return the number of bytes read. - The Ctrl-C flag is set in remote_fileio_reply() anyway */ - if (old_offset != new_offset) - ret = new_offset - old_offset; - } - break; - } - - if (ret > 0) - { - retlength = remote_fileio_write_bytes (ptrval, buffer, ret); - if (retlength != ret) - ret = -1; /* errno has been set to EIO in remote_fileio_write_bytes() */ - } - - if (ret < 0) - remote_fileio_return_errno (-1); - else - remote_fileio_return_success (ret); - - xfree (buffer); -} - -static void -remote_fileio_func_write (char *buf) -{ - long target_fd, num; - LONGEST lnum; - CORE_ADDR ptrval; - int fd, ret, retlength; - gdb_byte *buffer; - size_t length; - - /* 1. Parameter: file descriptor */ - if (remote_fileio_extract_int (&buf, &target_fd)) - { - remote_fileio_ioerror (); - return; - } - fd = remote_fileio_map_fd ((int) target_fd); - if (fd == FIO_FD_INVALID) - { - remote_fileio_badfd (); - return; - } - /* 2. Parameter: buffer pointer */ - if (remote_fileio_extract_long (&buf, &lnum)) - { - remote_fileio_ioerror (); - return; - } - ptrval = (CORE_ADDR) lnum; - /* 3. Parameter: buffer length */ - if (remote_fileio_extract_int (&buf, &num)) - { - remote_fileio_ioerror (); - return; - } - length = (size_t) num; - - buffer = (gdb_byte *) xmalloc (length); - retlength = remote_read_bytes (ptrval, buffer, length); - if (retlength != length) - { - xfree (buffer); - remote_fileio_ioerror (); - return; - } - - remote_fio_no_longjmp = 1; - switch (fd) - { - case FIO_FD_CONSOLE_IN: - remote_fileio_badfd (); - xfree (buffer); - return; - case FIO_FD_CONSOLE_OUT: - ui_file_write (target_fd == 1 ? gdb_stdtarg : gdb_stdtargerr, - (char *) buffer, length); - gdb_flush (target_fd == 1 ? gdb_stdtarg : gdb_stdtargerr); - ret = length; - break; - default: - ret = write (fd, buffer, length); - if (ret < 0 && errno == EACCES) - errno = EBADF; /* Cygwin returns EACCESS when writing to a R/O file.*/ - break; - } - - if (ret < 0) - remote_fileio_return_errno (-1); - else - remote_fileio_return_success (ret); - - xfree (buffer); -} - -static void -remote_fileio_func_lseek (char *buf) -{ - long num; - LONGEST lnum; - int fd, flag; - off_t offset, ret; - - /* 1. Parameter: file descriptor */ - if (remote_fileio_extract_int (&buf, &num)) - { - remote_fileio_ioerror (); - return; - } - fd = remote_fileio_map_fd ((int) num); - if (fd == FIO_FD_INVALID) - { - remote_fileio_badfd (); - return; - } - else if (fd == FIO_FD_CONSOLE_IN || fd == FIO_FD_CONSOLE_OUT) - { - remote_fileio_reply (-1, FILEIO_ESPIPE); - return; - } - - /* 2. Parameter: offset */ - if (remote_fileio_extract_long (&buf, &lnum)) - { - remote_fileio_ioerror (); - return; - } - offset = (off_t) lnum; - /* 3. Parameter: flag */ - if (remote_fileio_extract_int (&buf, &num)) - { - remote_fileio_ioerror (); - return; - } - if (remote_fileio_seek_flag_to_host (num, &flag)) - { - remote_fileio_reply (-1, FILEIO_EINVAL); - return; - } - - remote_fio_no_longjmp = 1; - ret = lseek (fd, offset, flag); - - if (ret == (off_t) -1) - remote_fileio_return_errno (-1); - else - remote_fileio_return_success (ret); -} - -static void -remote_fileio_func_rename (char *buf) -{ - CORE_ADDR old_ptr, new_ptr; - int old_len, new_len, retlength; - char *oldpath, *newpath; - int ret, of, nf; - struct stat ost, nst; - - /* 1. Parameter: Ptr to oldpath / length incl. trailing zero */ - if (remote_fileio_extract_ptr_w_len (&buf, &old_ptr, &old_len)) - { - remote_fileio_ioerror (); - return; - } - - /* 2. Parameter: Ptr to newpath / length incl. trailing zero */ - if (remote_fileio_extract_ptr_w_len (&buf, &new_ptr, &new_len)) - { - remote_fileio_ioerror (); - return; - } - - /* Request oldpath using 'm' packet */ - oldpath = alloca (old_len); - retlength = remote_read_bytes (old_ptr, (gdb_byte *) oldpath, old_len); - if (retlength != old_len) - { - remote_fileio_ioerror (); - return; - } - - /* Request newpath using 'm' packet */ - newpath = alloca (new_len); - retlength = remote_read_bytes (new_ptr, (gdb_byte *) newpath, new_len); - if (retlength != new_len) - { - remote_fileio_ioerror (); - return; - } - - /* Only operate on regular files and directories */ - of = stat (oldpath, &ost); - nf = stat (newpath, &nst); - if ((!of && !S_ISREG (ost.st_mode) && !S_ISDIR (ost.st_mode)) - || (!nf && !S_ISREG (nst.st_mode) && !S_ISDIR (nst.st_mode))) - { - remote_fileio_reply (-1, FILEIO_EACCES); - return; - } - - remote_fio_no_longjmp = 1; - ret = rename (oldpath, newpath); - - if (ret == -1) - { - /* Special case: newpath is a non-empty directory. Some systems - return ENOTEMPTY, some return EEXIST. We coerce that to be - always EEXIST. */ - if (errno == ENOTEMPTY) - errno = EEXIST; -#ifdef __CYGWIN__ - /* Workaround some Cygwin problems with correct errnos. */ - if (errno == EACCES) - { - if (!of && !nf && S_ISDIR (nst.st_mode)) - { - if (S_ISREG (ost.st_mode)) - errno = EISDIR; - else - { - char oldfullpath[PATH_MAX + 1]; - char newfullpath[PATH_MAX + 1]; - int len; - - cygwin_conv_to_full_posix_path (oldpath, oldfullpath); - cygwin_conv_to_full_posix_path (newpath, newfullpath); - len = strlen (oldfullpath); - if (newfullpath[len] == '/' - && !strncmp (oldfullpath, newfullpath, len)) - errno = EINVAL; - else - errno = EEXIST; - } - } - } -#endif - - remote_fileio_return_errno (-1); - } - else - remote_fileio_return_success (ret); -} - -static void -remote_fileio_func_unlink (char *buf) -{ - CORE_ADDR ptrval; - int length, retlength; - char *pathname; - int ret; - struct stat st; - - /* Parameter: Ptr to pathname / length incl. trailing zero */ - if (remote_fileio_extract_ptr_w_len (&buf, &ptrval, &length)) - { - remote_fileio_ioerror (); - return; - } - /* Request pathname using 'm' packet */ - pathname = alloca (length); - retlength = remote_read_bytes (ptrval, (gdb_byte *) pathname, length); - if (retlength != length) - { - remote_fileio_ioerror (); - return; - } - - /* Only operate on regular files (and directories, which allows to return - the correct return code) */ - if (!stat (pathname, &st) && !S_ISREG (st.st_mode) && !S_ISDIR (st.st_mode)) - { - remote_fileio_reply (-1, FILEIO_ENODEV); - return; - } - - remote_fio_no_longjmp = 1; - ret = unlink (pathname); - - if (ret == -1) - remote_fileio_return_errno (-1); - else - remote_fileio_return_success (ret); -} - -static void -remote_fileio_func_stat (char *buf) -{ - CORE_ADDR statptr, nameptr; - int ret, namelength, retlength; - char *pathname; - LONGEST lnum; - struct stat st; - struct fio_stat fst; - - /* 1. Parameter: Ptr to pathname / length incl. trailing zero */ - if (remote_fileio_extract_ptr_w_len (&buf, &nameptr, &namelength)) - { - remote_fileio_ioerror (); - return; - } - - /* 2. Parameter: Ptr to struct stat */ - if (remote_fileio_extract_long (&buf, &lnum)) - { - remote_fileio_ioerror (); - return; - } - statptr = (CORE_ADDR) lnum; - - /* Request pathname using 'm' packet */ - pathname = alloca (namelength); - retlength = remote_read_bytes (nameptr, (gdb_byte *) pathname, namelength); - if (retlength != namelength) - { - remote_fileio_ioerror (); - return; - } - - remote_fio_no_longjmp = 1; - ret = stat (pathname, &st); - - if (ret == -1) - { - remote_fileio_return_errno (-1); - return; - } - /* Only operate on regular files and directories */ - if (!ret && !S_ISREG (st.st_mode) && !S_ISDIR (st.st_mode)) - { - remote_fileio_reply (-1, FILEIO_EACCES); - return; - } - if (statptr) - { - remote_fileio_to_fio_stat (&st, &fst); - remote_fileio_to_fio_uint (0, fst.fst_dev); - - retlength = remote_fileio_write_bytes (statptr, - (gdb_byte *) &fst, sizeof fst); - if (retlength != sizeof fst) - { - remote_fileio_return_errno (-1); - return; - } - } - remote_fileio_return_success (ret); -} - -static void -remote_fileio_func_fstat (char *buf) -{ - CORE_ADDR ptrval; - int fd, ret, retlength; - long target_fd; - LONGEST lnum; - struct stat st; - struct fio_stat fst; - struct timeval tv; - - /* 1. Parameter: file descriptor */ - if (remote_fileio_extract_int (&buf, &target_fd)) - { - remote_fileio_ioerror (); - return; - } - fd = remote_fileio_map_fd ((int) target_fd); - if (fd == FIO_FD_INVALID) - { - remote_fileio_badfd (); - return; - } - /* 2. Parameter: Ptr to struct stat */ - if (remote_fileio_extract_long (&buf, &lnum)) - { - remote_fileio_ioerror (); - return; - } - ptrval = (CORE_ADDR) lnum; - - remote_fio_no_longjmp = 1; - if (fd == FIO_FD_CONSOLE_IN || fd == FIO_FD_CONSOLE_OUT) - { - remote_fileio_to_fio_uint (1, fst.fst_dev); - st.st_mode = S_IFCHR | (fd == FIO_FD_CONSOLE_IN ? S_IRUSR : S_IWUSR); - st.st_nlink = 1; -#ifdef HAVE_GETUID - st.st_uid = getuid (); -#else - st.st_uid = 0; -#endif -#ifdef HAVE_GETGID - st.st_gid = getgid (); -#else - st.st_gid = 0; -#endif - st.st_rdev = 0; - st.st_size = 0; -#ifdef HAVE_STRUCT_STAT_ST_BLKSIZE - st.st_blksize = 512; -#endif -#if HAVE_STRUCT_STAT_ST_BLOCKS - st.st_blocks = 0; -#endif - if (!gettimeofday (&tv, NULL)) - st.st_atime = st.st_mtime = st.st_ctime = tv.tv_sec; - else - st.st_atime = st.st_mtime = st.st_ctime = (time_t) 0; - ret = 0; - } - else - ret = fstat (fd, &st); - - if (ret == -1) - { - remote_fileio_return_errno (-1); - return; - } - if (ptrval) - { - remote_fileio_to_fio_stat (&st, &fst); - - retlength = remote_fileio_write_bytes (ptrval, (gdb_byte *) &fst, sizeof fst); - if (retlength != sizeof fst) - { - remote_fileio_return_errno (-1); - return; - } - } - remote_fileio_return_success (ret); -} - -static void -remote_fileio_func_gettimeofday (char *buf) -{ - LONGEST lnum; - CORE_ADDR ptrval; - int ret, retlength; - struct timeval tv; - struct fio_timeval ftv; - - /* 1. Parameter: struct timeval pointer */ - if (remote_fileio_extract_long (&buf, &lnum)) - { - remote_fileio_ioerror (); - return; - } - ptrval = (CORE_ADDR) lnum; - /* 2. Parameter: some pointer value... */ - if (remote_fileio_extract_long (&buf, &lnum)) - { - remote_fileio_ioerror (); - return; - } - /* ...which has to be NULL */ - if (lnum) - { - remote_fileio_reply (-1, FILEIO_EINVAL); - return; - } - - remote_fio_no_longjmp = 1; - ret = gettimeofday (&tv, NULL); - - if (ret == -1) - { - remote_fileio_return_errno (-1); - return; - } - - if (ptrval) - { - remote_fileio_to_fio_timeval (&tv, &ftv); - - retlength = remote_fileio_write_bytes (ptrval, (gdb_byte *) &ftv, sizeof ftv); - if (retlength != sizeof ftv) - { - remote_fileio_return_errno (-1); - return; - } - } - remote_fileio_return_success (ret); -} - -static void -remote_fileio_func_isatty (char *buf) -{ - long target_fd; - int fd; - - /* Parameter: file descriptor */ - if (remote_fileio_extract_int (&buf, &target_fd)) - { - remote_fileio_ioerror (); - return; - } - remote_fio_no_longjmp = 1; - fd = remote_fileio_map_fd ((int) target_fd); - remote_fileio_return_success (fd == FIO_FD_CONSOLE_IN || - fd == FIO_FD_CONSOLE_OUT ? 1 : 0); -} - -static void -remote_fileio_func_system (char *buf) -{ - CORE_ADDR ptrval; - int ret, length, retlength; - char *cmdline = NULL; - - /* Parameter: Ptr to commandline / length incl. trailing zero */ - if (remote_fileio_extract_ptr_w_len (&buf, &ptrval, &length)) - { - remote_fileio_ioerror (); - return; - } - - if (length) - { - /* Request commandline using 'm' packet */ - cmdline = alloca (length); - retlength = remote_read_bytes (ptrval, (gdb_byte *) cmdline, length); - if (retlength != length) - { - remote_fileio_ioerror (); - return; - } - } - - /* Check if system(3) has been explicitely allowed using the - `set remote system-call-allowed 1' command. If length is 0, - indicating a NULL parameter to the system call, return zero to - indicate a shell is not available. Otherwise fail with EPERM. */ - if (!remote_fio_system_call_allowed) - { - if (!length) - remote_fileio_return_success (0); - else - remote_fileio_reply (-1, FILEIO_EPERM); - return; - } - - remote_fio_no_longjmp = 1; - ret = system (cmdline); - - if (!length) - remote_fileio_return_success (ret); - else if (ret == -1) - remote_fileio_return_errno (-1); - else - remote_fileio_return_success (WEXITSTATUS (ret)); -} - -static struct { - char *name; - void (*func)(char *); -} remote_fio_func_map[] = { - { "open", remote_fileio_func_open }, - { "close", remote_fileio_func_close }, - { "read", remote_fileio_func_read }, - { "write", remote_fileio_func_write }, - { "lseek", remote_fileio_func_lseek }, - { "rename", remote_fileio_func_rename }, - { "unlink", remote_fileio_func_unlink }, - { "stat", remote_fileio_func_stat }, - { "fstat", remote_fileio_func_fstat }, - { "gettimeofday", remote_fileio_func_gettimeofday }, - { "isatty", remote_fileio_func_isatty }, - { "system", remote_fileio_func_system }, - { NULL, NULL } -}; - -static int -do_remote_fileio_request (struct ui_out *uiout, void *buf_arg) -{ - char *buf = buf_arg; - char *c; - int idx; - remote_fileio_sig_set (remote_fileio_ctrl_c_signal_handler); - - c = strchr (++buf, ','); - if (c) - *c++ = '\0'; - else - c = strchr (buf, '\0'); - for (idx = 0; remote_fio_func_map[idx].name; ++idx) - if (!strcmp (remote_fio_func_map[idx].name, buf)) - break; - if (!remote_fio_func_map[idx].name) /* ERROR: No such function. */ - return RETURN_ERROR; - remote_fio_func_map[idx].func (c); - return 0; } /* Close any open descriptors, and reinitialize the file mapping. */ @@ -1378,85 +147,28 @@ do_remote_fileio_request (struct ui_out *uiout, void *buf_arg) void remote_fileio_reset (void) { - int ix; - - for (ix = 0; ix != remote_fio_data.fd_map_size; ix++) - { - int fd = remote_fio_data.fd_map[ix]; - - if (fd >= 0) - close (fd); - } - if (remote_fio_data.fd_map) - { - free (remote_fio_data.fd_map); - remote_fio_data.fd_map = NULL; - remote_fio_data.fd_map_size = 0; - } + target_fileio_reset(); } void remote_fileio_request (char *buf) { - int ex; + static struct file_io_operations operations = + { + remote_read_bytes, + remote_fileio_write_bytes, + remote_fileio_reply, + set_ctrl_c_signal_handler + }; remote_fileio_sig_init (); - - remote_fio_ctrl_c_flag = 0; - remote_fio_no_longjmp = 0; - - ex = catch_exceptions (uiout, do_remote_fileio_request, (void *)buf, - RETURN_MASK_ALL); - switch (ex) - { - case RETURN_ERROR: - remote_fileio_reply (-1, FILEIO_ENOSYS); - break; - case RETURN_QUIT: - remote_fileio_reply (-1, FILEIO_EINTR); - break; - default: - break; - } - + target_fileio_request(buf, &operations); remote_fileio_sig_exit (); } -static void -set_system_call_allowed (char *args, int from_tty) -{ - if (args) - { - char *arg_end; - int val = strtoul (args, &arg_end, 10); - if (*args && *arg_end == '\0') - { - remote_fio_system_call_allowed = !!val; - return; - } - } - error (_("Illegal argument for \"set remote system-call-allowed\" command")); -} - -static void -show_system_call_allowed (char *args, int from_tty) -{ - if (args) - error (_("Garbage after \"show remote system-call-allowed\" command: `%s'"), args); - printf_unfiltered ("Calling host system(3) call from target is %sallowed\n", - remote_fio_system_call_allowed ? "" : "not "); -} - void initialize_remote_fileio (struct cmd_list_element *remote_set_cmdlist, struct cmd_list_element *remote_show_cmdlist) { - add_cmd ("system-call-allowed", no_class, - set_system_call_allowed, - _("Set if the host system(3) call is allowed for the target."), - &remote_set_cmdlist); - add_cmd ("system-call-allowed", no_class, - show_system_call_allowed, - _("Show if the host system(3) call is allowed for the target."), - &remote_show_cmdlist); + initialize_target_fileio(remote_set_cmdlist, remote_show_cmdlist); } diff --git a/gdb/remote-sim.c b/gdb/remote-sim.c index 918eab8..c3a8443 100644 --- a/gdb/remote-sim.c +++ b/gdb/remote-sim.c @@ -469,13 +469,17 @@ gdbsim_create_inferior (char *exec_file, char *args, char **env, int from_tty) } else argv = NULL; - sim_create_inferior (gdbsim_desc, exec_bfd, argv, env); - inferior_ptid = pid_to_ptid (42); - target_mark_running (&gdbsim_ops); - insert_breakpoints (); /* Needed to get correct instruction in cache */ + // ARC 12/01/09 check return status + // GDB Bug #9734 + if (sim_create_inferior (gdbsim_desc, exec_bfd, argv, env) == SIM_RC_OK) + { + inferior_ptid = pid_to_ptid (42); + target_mark_running (&gdbsim_ops); + insert_breakpoints (); /* Needed to get correct instruction in cache */ - clear_proceed_status (); + clear_proceed_status (); + } } /* The open routine takes the rest of the parameters from the command, diff --git a/gdb/stack.c b/gdb/stack.c index 374848b..f151dc1 100644 --- a/gdb/stack.c +++ b/gdb/stack.c @@ -831,7 +831,8 @@ parse_frame_specification_1 (const char *frame_exp, const char *message, { int i; for (i = 0; i < numargs; i++) - addrs[i] = value_as_address (args[0]); + addrs[i] = value_as_address (args[i]); // ARC BUG FIX 29/9/08 + // see http://sourceware.org/ml/gdb-patches/2009-01/msg00476.html } /* Assume that the single arg[0] is an address, use that to identify @@ -892,8 +893,29 @@ frame_info (char *addr_exp, int from_tty) const char *pc_regname; int selected_frame_p; struct gdbarch *gdbarch; + CORE_ADDR pc; fi = parse_frame_specification_1 (addr_exp, "No stack.", &selected_frame_p); + + /* richards ARC 22/9/2008 + * Try to detect that an invalid frame has been selected (e.g. a frame + * number has been given, but there is no such frame on the stack); + * N.B. this works for the ARC gdb port, but 0 might be a valid code + * address on other processors, so this needs more investigation! + * + * We should not try to submit this fix to the FSF until we know that it + * is generally valid. + * + * gdb bug: 9458 + * ARC bug: 95315 + */ + pc = get_frame_pc (fi); + if (pc == 0) + { + warning("invalid frame"); + return; + } + gdbarch = get_frame_arch (fi); /* Name of the value returned by get_frame_pc(). Per comments, "pc" @@ -914,7 +936,7 @@ frame_info (char *addr_exp, int from_tty) func = get_frame_function (fi); /* FIXME: cagney/2002-11-28: Why bother? Won't sal.symtab contain the same value? */ - s = find_pc_symtab (get_frame_pc (fi)); + s = find_pc_symtab (pc); if (func) { /* It seems appropriate to use SYMBOL_PRINT_NAME() here, to diff --git a/gdb/symtab.h b/gdb/symtab.h index c19e741..0d751a7 100644 --- a/gdb/symtab.h +++ b/gdb/symtab.h @@ -574,6 +574,26 @@ struct symbol_ops struct value *(*read_variable) (struct symbol * symbol, struct frame_info * frame); +// begin ARC + /* Return the address of the variable SYMBOL, relative to the stack + frame FRAME. If the variable has been optimized out, return + zero. + + Iff `read_needs_frame (SYMBOL)' is zero, then FRAME may be zero. */ + + CORE_ADDR (*get_variable_address) (struct symbol * symbol, + struct frame_info * frame); + + /* Return the size of the variable SYMBOL, relative to the stack + frame FRAME. If the variable has been optimized out, return + zero. + + Iff `read_needs_frame (SYMBOL)' is zero, then FRAME may be zero. */ + + unsigned int (*get_variable_size) (struct symbol * symbol, + struct frame_info * frame); +// end ARC + /* Return non-zero if we need a frame to find the value of the SYMBOL. */ int (*read_needs_frame) (struct symbol * symbol); diff --git a/gdb/target-fileio.c b/gdb/target-fileio.c new file mode 100644 index 0000000..fdc64c9 --- /dev/null +++ b/gdb/target-fileio.c @@ -0,0 +1,1344 @@ +/* Target File-I/O communications + + Copyright (C) 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. + + This file is part of GDB. + + 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 3 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, see . */ + +#include "defs.h" +#include "gdb_string.h" +#include "gdbcmd.h" +#include "gdb/fileio.h" +#include "gdb_wait.h" +#include "gdb_stat.h" +#include "exceptions.h" +#include "target-fileio.h" + +#include +#include +#ifdef __CYGWIN__ +#include /* For cygwin_conv_to_full_posix_path. */ +#endif + +static struct { + int *fd_map; + int fd_map_size; +} target_fio_data; + +#define FIO_FD_INVALID -1 +#define FIO_FD_CONSOLE_IN -2 +#define FIO_FD_CONSOLE_OUT -3 + +static int target_fio_system_call_allowed = 0; + +static int +target_fileio_init_fd_map (void) +{ + int i; + + if (!target_fio_data.fd_map) + { + target_fio_data.fd_map = (int *) xmalloc (10 * sizeof (int)); + target_fio_data.fd_map_size = 10; + target_fio_data.fd_map[0] = FIO_FD_CONSOLE_IN; + target_fio_data.fd_map[1] = FIO_FD_CONSOLE_OUT; + target_fio_data.fd_map[2] = FIO_FD_CONSOLE_OUT; + for (i = 3; i < 10; ++i) + target_fio_data.fd_map[i] = FIO_FD_INVALID; + } + return 3; +} + +static int +target_fileio_resize_fd_map (void) +{ + int i = target_fio_data.fd_map_size; + + if (!target_fio_data.fd_map) + return target_fileio_init_fd_map (); + target_fio_data.fd_map_size += 10; + target_fio_data.fd_map = + (int *) xrealloc (target_fio_data.fd_map, + target_fio_data.fd_map_size * sizeof (int)); + for (; i < target_fio_data.fd_map_size; i++) + target_fio_data.fd_map[i] = FIO_FD_INVALID; + return target_fio_data.fd_map_size - 10; +} + +static int +target_fileio_next_free_fd (void) +{ + int i; + + for (i = 0; i < target_fio_data.fd_map_size; ++i) + if (target_fio_data.fd_map[i] == FIO_FD_INVALID) + return i; + return target_fileio_resize_fd_map (); +} + +static int +target_fileio_fd_to_targetfd (int fd) +{ + int target_fd =target_fileio_next_free_fd (); + target_fio_data.fd_map[target_fd] = fd; + return target_fd; +} + +static int +target_fileio_map_fd (int target_fd) +{ + target_fileio_init_fd_map (); + if (target_fd < 0 || target_fd >= target_fio_data.fd_map_size) + return FIO_FD_INVALID; + return target_fio_data.fd_map[target_fd]; +} + +static void +target_fileio_close_target_fd (int target_fd) +{ + target_fileio_init_fd_map (); + if (target_fd >= 0 && target_fd < target_fio_data.fd_map_size) + target_fio_data.fd_map[target_fd] = FIO_FD_INVALID; +} + +static int +target_fileio_oflags_to_host (long flags) +{ + int hflags = 0; + + if (flags & FILEIO_O_CREAT) + hflags |= O_CREAT; + if (flags & FILEIO_O_EXCL) + hflags |= O_EXCL; + if (flags & FILEIO_O_TRUNC) + hflags |= O_TRUNC; + if (flags & FILEIO_O_APPEND) + hflags |= O_APPEND; + if (flags & FILEIO_O_RDONLY) + hflags |= O_RDONLY; + if (flags & FILEIO_O_WRONLY) + hflags |= O_WRONLY; + if (flags & FILEIO_O_RDWR) + hflags |= O_RDWR; +/* On systems supporting binary and text mode, always open files in + binary mode. */ +#ifdef O_BINARY + hflags |= O_BINARY; +#endif + return hflags; +} + +static mode_t +target_fileio_mode_to_host (long mode, int open_call) +{ + mode_t hmode = 0; + + if (!open_call) + { + if (mode & FILEIO_S_IFREG) + hmode |= S_IFREG; + if (mode & FILEIO_S_IFDIR) + hmode |= S_IFDIR; + if (mode & FILEIO_S_IFCHR) + hmode |= S_IFCHR; + } + if (mode & FILEIO_S_IRUSR) + hmode |= S_IRUSR; + if (mode & FILEIO_S_IWUSR) + hmode |= S_IWUSR; + if (mode & FILEIO_S_IXUSR) + hmode |= S_IXUSR; +#ifdef S_IRGRP + if (mode & FILEIO_S_IRGRP) + hmode |= S_IRGRP; +#endif +#ifdef S_IWGRP + if (mode & FILEIO_S_IWGRP) + hmode |= S_IWGRP; +#endif +#ifdef S_IXGRP + if (mode & FILEIO_S_IXGRP) + hmode |= S_IXGRP; +#endif + if (mode & FILEIO_S_IROTH) + hmode |= S_IROTH; +#ifdef S_IWOTH + if (mode & FILEIO_S_IWOTH) + hmode |= S_IWOTH; +#endif +#ifdef S_IXOTH + if (mode & FILEIO_S_IXOTH) + hmode |= S_IXOTH; +#endif + return hmode; +} + +static LONGEST +target_fileio_mode_to_target (mode_t mode) +{ + mode_t tmode = 0; + + if (S_ISREG(mode)) + tmode |= FILEIO_S_IFREG; + if (S_ISDIR(mode)) + tmode |= FILEIO_S_IFDIR; + if (S_ISCHR(mode)) + tmode |= FILEIO_S_IFCHR; + if (mode & S_IRUSR) + tmode |= FILEIO_S_IRUSR; + if (mode & S_IWUSR) + tmode |= FILEIO_S_IWUSR; + if (mode & S_IXUSR) + tmode |= FILEIO_S_IXUSR; +#ifdef S_IRGRP + if (mode & S_IRGRP) + tmode |= FILEIO_S_IRGRP; +#endif +#ifdef S_IWRGRP + if (mode & S_IWGRP) + tmode |= FILEIO_S_IWGRP; +#endif +#ifdef S_IXGRP + if (mode & S_IXGRP) + tmode |= FILEIO_S_IXGRP; +#endif + if (mode & S_IROTH) + tmode |= FILEIO_S_IROTH; +#ifdef S_IWOTH + if (mode & S_IWOTH) + tmode |= FILEIO_S_IWOTH; +#endif +#ifdef S_IXOTH + if (mode & S_IXOTH) + tmode |= FILEIO_S_IXOTH; +#endif + return tmode; +} + +static int +target_fileio_errno_to_target (int error) +{ + switch (error) + { + case EPERM: + return FILEIO_EPERM; + case ENOENT: + return FILEIO_ENOENT; + case EINTR: + return FILEIO_EINTR; + case EIO: + return FILEIO_EIO; + case EBADF: + return FILEIO_EBADF; + case EACCES: + return FILEIO_EACCES; + case EFAULT: + return FILEIO_EFAULT; + case EBUSY: + return FILEIO_EBUSY; + case EEXIST: + return FILEIO_EEXIST; + case ENODEV: + return FILEIO_ENODEV; + case ENOTDIR: + return FILEIO_ENOTDIR; + case EISDIR: + return FILEIO_EISDIR; + case EINVAL: + return FILEIO_EINVAL; + case ENFILE: + return FILEIO_ENFILE; + case EMFILE: + return FILEIO_EMFILE; + case EFBIG: + return FILEIO_EFBIG; + case ENOSPC: + return FILEIO_ENOSPC; + case ESPIPE: + return FILEIO_ESPIPE; + case EROFS: + return FILEIO_EROFS; + case ENOSYS: + return FILEIO_ENOSYS; + case ENAMETOOLONG: + return FILEIO_ENAMETOOLONG; + } + return FILEIO_EUNKNOWN; +} + +static int +target_fileio_seek_flag_to_host (long num, int *flag) +{ + if (!flag) + return 0; + switch (num) + { + case FILEIO_SEEK_SET: + *flag = SEEK_SET; + break; + case FILEIO_SEEK_CUR: + *flag = SEEK_CUR; + break; + case FILEIO_SEEK_END: + *flag = SEEK_END; + break; + default: + return -1; + } + return 0; +} + +static int +target_fileio_extract_long (char **buf, LONGEST *retlong) +{ + char *c; + int sign = 1; + + if (!buf || !*buf || !**buf || !retlong) + return -1; + c = strchr (*buf, ','); + if (c) + *c++ = '\0'; + else + c = strchr (*buf, '\0'); + while (strchr ("+-", **buf)) + { + if (**buf == '-') + sign = -sign; + ++*buf; + } + for (*retlong = 0; **buf; ++*buf) + { + *retlong <<= 4; + if (**buf >= '0' && **buf <= '9') + *retlong += **buf - '0'; + else if (**buf >= 'a' && **buf <= 'f') + *retlong += **buf - 'a' + 10; + else if (**buf >= 'A' && **buf <= 'F') + *retlong += **buf - 'A' + 10; + else + return -1; + } + *retlong *= sign; + *buf = c; + return 0; +} + +static int +target_fileio_extract_int (char **buf, long *retint) +{ + int ret; + LONGEST retlong; + + if (!retint) + return -1; + ret =target_fileio_extract_long (buf, &retlong); + if (!ret) + *retint = (long) retlong; + return ret; +} + +static int +target_fileio_extract_ptr_w_len (char **buf, CORE_ADDR *ptrval, int *length) +{ + char *c; + LONGEST retlong; + + if (!buf || !*buf || !**buf || !ptrval || !length) + return -1; + c = strchr (*buf, '/'); + if (!c) + return -1; + *c++ = '\0'; + if (target_fileio_extract_long (buf, &retlong)) + return -1; + *ptrval = (CORE_ADDR) retlong; + *buf = c; + if (target_fileio_extract_long (buf, &retlong)) + return -1; + *length = (int) retlong; + return 0; +} + +/* Convert to big endian */ +static void +target_fileio_to_be (LONGEST num, char *buf, int bytes) +{ + int i; + + for (i = 0; i < bytes; ++i) + buf[i] = (num >> (8 * (bytes - i - 1))) & 0xff; +} + +static void +target_fileio_to_fio_uint (long num, fio_uint_t fnum) +{ + target_fileio_to_be ((LONGEST) num, (char *) fnum, 4); +} + +static void +target_fileio_to_fio_mode (mode_t num, fio_mode_t fnum) +{ + target_fileio_to_be (target_fileio_mode_to_target(num), (char *) fnum, 4); +} + +static void +target_fileio_to_fio_time (time_t num, fio_time_t fnum) +{ + target_fileio_to_be ((LONGEST) num, (char *) fnum, 4); +} + +static void +target_fileio_to_fio_long (LONGEST num, fio_long_t fnum) +{ + target_fileio_to_be (num, (char *) fnum, 8); +} + +static void +target_fileio_to_fio_ulong (LONGEST num, fio_ulong_t fnum) +{ + target_fileio_to_be (num, (char *) fnum, 8); +} + +static void +target_fileio_to_fio_stat (struct stat *st, struct fio_stat *fst) +{ + LONGEST blksize; + + /* `st_dev' is set in the calling function */ + target_fileio_to_fio_uint ((long) st->st_ino, fst->fst_ino); + target_fileio_to_fio_mode (st->st_mode, fst->fst_mode); + target_fileio_to_fio_uint ((long) st->st_nlink, fst->fst_nlink); + target_fileio_to_fio_uint ((long) st->st_uid, fst->fst_uid); + target_fileio_to_fio_uint ((long) st->st_gid, fst->fst_gid); + target_fileio_to_fio_uint ((long) st->st_rdev, fst->fst_rdev); + target_fileio_to_fio_ulong ((LONGEST) st->st_size, fst->fst_size); +#ifdef HAVE_STRUCT_STAT_ST_BLKSIZE + blksize = st->st_blksize; +#else + blksize = 512; +#endif + target_fileio_to_fio_ulong (blksize, fst->fst_blksize); +#if HAVE_STRUCT_STAT_ST_BLOCKS + target_fileio_to_fio_ulong ((LONGEST) st->st_blocks, fst->fst_blocks); +#else + /* FIXME: This is correct for DJGPP, but other systems that don't + have st_blocks, if any, might prefer 512 instead of st_blksize. + (eliz, 30-12-2003) */ + target_fileio_to_fio_ulong (((LONGEST) st->st_size + blksize - 1) + / blksize, + fst->fst_blocks); +#endif + target_fileio_to_fio_time (st->st_atime, fst->fst_atime); + target_fileio_to_fio_time (st->st_mtime, fst->fst_mtime); + target_fileio_to_fio_time (st->st_ctime, fst->fst_ctime); +} + +static void +target_fileio_to_fio_timeval (struct timeval *tv, struct fio_timeval *ftv) +{ + target_fileio_to_fio_time (tv->tv_sec, ftv->ftv_sec); + target_fileio_to_fio_long (tv->tv_usec, ftv->ftv_usec); +} + +int target_fio_no_longjmp = 0; + + +static void +target_fileio_func_open (char *buf, struct file_io_operations *operations) +{ + CORE_ADDR ptrval; + int length, retlength; + long num; + int flags, fd; + mode_t mode; + char *pathname; + struct stat st; + + /* 1. Parameter: Ptr to pathname / length incl. trailing zero */ + if (target_fileio_extract_ptr_w_len (&buf, &ptrval, &length)) + { + operations->ioerror (); + return; + } + /* 2. Parameter: open flags */ + if (target_fileio_extract_int (&buf, &num)) + { + operations->ioerror (); + return; + } + flags =target_fileio_oflags_to_host (num); + /* 3. Parameter: open mode */ + if (target_fileio_extract_int (&buf, &num)) + { + operations->ioerror (); + return; + } + mode =target_fileio_mode_to_host (num, 1); + + /* Read pathname */ + pathname = alloca (length); + retlength = operations->read_bytes (ptrval, (gdb_byte *) pathname, length); + if (retlength != length) + { + operations->ioerror (); + return; + } + + /* Check if pathname exists and is not a regular file or directory. If so, + return an appropriate error code. Same for trying to open directories + for writing. */ + if (!stat (pathname, &st)) + { + if (!S_ISREG (st.st_mode) && !S_ISDIR (st.st_mode)) + { + operations->reply (-1, FILEIO_ENODEV); + return; + } + if (S_ISDIR (st.st_mode) + && ((flags & O_WRONLY) == O_WRONLY || (flags & O_RDWR) == O_RDWR)) + { + operations->reply (-1, FILEIO_EISDIR); + return; + } + } + + target_fio_no_longjmp = 1; + fd = open (pathname, flags, mode); + if (fd < 0) + { + operations->return_errno (-1); + return; + } + + fd =target_fileio_fd_to_targetfd (fd); + operations->return_success (fd); +} + +static void +target_fileio_func_close (char *buf, struct file_io_operations *operations) +{ + long num; + int fd; + + /* Parameter: file descriptor */ + if (target_fileio_extract_int (&buf, &num)) + { + operations->ioerror (); + return; + } + fd =target_fileio_map_fd ((int) num); + if (fd == FIO_FD_INVALID) + { + operations->badfd (); + return; + } + + target_fio_no_longjmp = 1; + if (fd != FIO_FD_CONSOLE_IN && fd != FIO_FD_CONSOLE_OUT && close (fd)) + operations->return_errno (-1); + target_fileio_close_target_fd ((int) num); + operations->return_success (0); +} + +static void +target_fileio_func_read (char *buf, struct file_io_operations *operations) +{ + long target_fd, num; + LONGEST lnum; + CORE_ADDR ptrval; + int fd, ret, retlength; + gdb_byte *buffer; + size_t length; + off_t old_offset, new_offset; + + /* 1. Parameter: file descriptor */ + if (target_fileio_extract_int (&buf, &target_fd)) + { + operations->ioerror (); + return; + } + fd =target_fileio_map_fd ((int) target_fd); + if (fd == FIO_FD_INVALID) + { + operations->badfd (); + return; + } + /* 2. Parameter: buffer pointer */ + if (target_fileio_extract_long (&buf, &lnum)) + { + operations->ioerror (); + return; + } + ptrval = (CORE_ADDR) lnum; + /* 3. Parameter: buffer length */ + if (target_fileio_extract_int (&buf, &num)) + { + operations->ioerror (); + return; + } + length = (size_t) num; + + switch (fd) + { + case FIO_FD_CONSOLE_OUT: + operations->badfd (); + return; + case FIO_FD_CONSOLE_IN: + { + static char *remaining_buf = NULL; + static int remaining_length = 0; + + buffer = (gdb_byte *) xmalloc (32768); + if (remaining_buf) + { + target_fio_no_longjmp = 1; + if (remaining_length > length) + { + memcpy (buffer, remaining_buf, length); + memmove (remaining_buf, remaining_buf + length, + remaining_length - length); + remaining_length -= length; + ret = length; + } + else + { + memcpy (buffer, remaining_buf, remaining_length); + xfree (remaining_buf); + remaining_buf = NULL; + ret = remaining_length; + } + } + else + { + ret = ui_file_read (gdb_stdtargin, (char *) buffer, 32767); + target_fio_no_longjmp = 1; + if (ret > 0 && (size_t)ret > length) + { + remaining_buf = (char *) xmalloc (ret - length); + remaining_length = ret - length; + memcpy (remaining_buf, buffer + length, remaining_length); + ret = length; + } + } + } + break; + default: + buffer = (gdb_byte *) xmalloc (length); + /* POSIX defines EINTR behaviour of read in a weird way. It's allowed + for read() to return -1 even if "some" bytes have been read. It + has been corrected in SUSv2 but that doesn't help us much... + Therefore a complete solution must check how many bytes have been + read on EINTR to return a more reliable value to the target */ + old_offset = lseek (fd, 0, SEEK_CUR); + target_fio_no_longjmp = 1; + ret = read (fd, buffer, length); + if (ret < 0 && errno == EINTR) + { + new_offset = lseek (fd, 0, SEEK_CUR); + /* If some data has been read, return the number of bytes read. + The Ctrl-C flag is set in target_fileio_reply() anyway */ + if (old_offset != new_offset) + ret = new_offset - old_offset; + } + break; + } + + if (ret > 0) + { + retlength = operations->write_bytes (ptrval, buffer, ret); + if (retlength != ret) + ret = -1; /* errno has been set to EIO in remote_write_bytes() */ + } + + if (ret < 0) + operations->return_errno (-1); + else + operations->return_success (ret); + + xfree (buffer); +} + +static void +target_fileio_func_write (char *buf, struct file_io_operations *operations) +{ + long target_fd, num; + LONGEST lnum; + CORE_ADDR ptrval; + int fd, ret, retlength; + gdb_byte *buffer; + size_t length; + + /* 1. Parameter: file descriptor */ + if (target_fileio_extract_int (&buf, &target_fd)) + { + operations->ioerror (); + return; + } + fd =target_fileio_map_fd ((int) target_fd); + if (fd == FIO_FD_INVALID) + { + operations->badfd (); + return; + } + /* 2. Parameter: buffer pointer */ + if (target_fileio_extract_long (&buf, &lnum)) + { + operations->ioerror (); + return; + } + ptrval = (CORE_ADDR) lnum; + /* 3. Parameter: buffer length */ + if (target_fileio_extract_int (&buf, &num)) + { + operations->ioerror (); + return; + } + length = (size_t) num; + + buffer = (gdb_byte *) xmalloc (length); + retlength = operations->read_bytes (ptrval, buffer, length); + if (retlength != length) + { + xfree (buffer); + operations->ioerror (); + return; + } + + target_fio_no_longjmp = 1; + switch (fd) + { + case FIO_FD_CONSOLE_IN: + operations->badfd (); + xfree (buffer); + return; + case FIO_FD_CONSOLE_OUT: + ui_file_write (target_fd == 1 ? gdb_stdtarg : gdb_stdtargerr, + (char *) buffer, length); + gdb_flush (target_fd == 1 ? gdb_stdtarg : gdb_stdtargerr); + ret = length; + break; + default: + ret = write (fd, buffer, length); + if (ret < 0 && errno == EACCES) + errno = EBADF; /* Cygwin returns EACCESS when writing to a R/O file.*/ + break; + } + + if (ret < 0) + operations->return_errno (-1); + else + operations->return_success (ret); + + xfree (buffer); +} + +static void +target_fileio_func_lseek (char *buf, struct file_io_operations *operations) +{ + long num; + LONGEST lnum; + int fd, flag; + off_t offset, ret; + + /* 1. Parameter: file descriptor */ + if (target_fileio_extract_int (&buf, &num)) + { + operations->ioerror (); + return; + } + fd =target_fileio_map_fd ((int) num); + if (fd == FIO_FD_INVALID) + { + operations->badfd (); + return; + } + else if (fd == FIO_FD_CONSOLE_IN || fd == FIO_FD_CONSOLE_OUT) + { + operations->reply (-1, FILEIO_ESPIPE); + return; + } + + /* 2. Parameter: offset */ + if (target_fileio_extract_long (&buf, &lnum)) + { + operations->ioerror (); + return; + } + offset = (off_t) lnum; + /* 3. Parameter: flag */ + if (target_fileio_extract_int (&buf, &num)) + { + operations->ioerror (); + return; + } + if (target_fileio_seek_flag_to_host (num, &flag)) + { + operations->reply (-1, FILEIO_EINVAL); + return; + } + + target_fio_no_longjmp = 1; + ret = lseek (fd, offset, flag); + + if (ret == (off_t) -1) + operations->return_errno (-1); + else + operations->return_success (ret); +} + +static void +target_fileio_func_rename (char *buf, struct file_io_operations *operations) +{ + CORE_ADDR old_ptr, new_ptr; + int old_len, new_len, retlength; + char *oldpath, *newpath; + int ret, of, nf; + struct stat ost, nst; + + /* 1. Parameter: Ptr to oldpath / length incl. trailing zero */ + if (target_fileio_extract_ptr_w_len (&buf, &old_ptr, &old_len)) + { + operations->ioerror (); + return; + } + + /* 2. Parameter: Ptr to newpath / length incl. trailing zero */ + if (target_fileio_extract_ptr_w_len (&buf, &new_ptr, &new_len)) + { + operations->ioerror (); + return; + } + + /* Request oldpath */ + oldpath = alloca (old_len); + retlength = operations->read_bytes (old_ptr, (gdb_byte *) oldpath, old_len); + if (retlength != old_len) + { + operations->ioerror (); + return; + } + + /* Request newpath */ + newpath = alloca (new_len); + retlength = operations->read_bytes (new_ptr, (gdb_byte *) newpath, new_len); + if (retlength != new_len) + { + operations->ioerror (); + return; + } + + /* Only operate on regular files and directories */ + of = stat (oldpath, &ost); + nf = stat (newpath, &nst); + if ((!of && !S_ISREG (ost.st_mode) && !S_ISDIR (ost.st_mode)) + || (!nf && !S_ISREG (nst.st_mode) && !S_ISDIR (nst.st_mode))) + { + operations->reply (-1, FILEIO_EACCES); + return; + } + + target_fio_no_longjmp = 1; + ret = rename (oldpath, newpath); + + if (ret == -1) + { + /* Special case: newpath is a non-empty directory. Some systems + return ENOTEMPTY, some return EEXIST. We coerce that to be + always EEXIST. */ + if (errno == ENOTEMPTY) + errno = EEXIST; +#ifdef __CYGWIN__ + /* Workaround some Cygwin problems with correct errnos. */ + if (errno == EACCES) + { + if (!of && !nf && S_ISDIR (nst.st_mode)) + { + if (S_ISREG (ost.st_mode)) + errno = EISDIR; + else + { + char oldfullpath[PATH_MAX + 1]; + char newfullpath[PATH_MAX + 1]; + int len; + + cygwin_conv_to_full_posix_path (oldpath, oldfullpath); + cygwin_conv_to_full_posix_path (newpath, newfullpath); + len = strlen (oldfullpath); + if (newfullpath[len] == '/' + && !strncmp (oldfullpath, newfullpath, len)) + errno = EINVAL; + else + errno = EEXIST; + } + } + } +#endif + + operations->return_errno (-1); + } + else + operations->return_success (ret); +} + +static void +target_fileio_func_unlink (char *buf, struct file_io_operations *operations) +{ + CORE_ADDR ptrval; + int length, retlength; + char *pathname; + int ret; + struct stat st; + + /* Parameter: Ptr to pathname / length incl. trailing zero */ + if (target_fileio_extract_ptr_w_len (&buf, &ptrval, &length)) + { + operations->ioerror (); + return; + } + /* Request pathname */ + pathname = alloca (length); + retlength = operations->read_bytes (ptrval, (gdb_byte *) pathname, length); + if (retlength != length) + { + operations->ioerror (); + return; + } + + /* Only operate on regular files (and directories, which allows to return + the correct return code) */ + if (!stat (pathname, &st) && !S_ISREG (st.st_mode) && !S_ISDIR (st.st_mode)) + { + operations->reply (-1, FILEIO_ENODEV); + return; + } + + target_fio_no_longjmp = 1; + ret = unlink (pathname); + + if (ret == -1) + operations->return_errno (-1); + else + operations->return_success (ret); +} + +static void +target_fileio_func_stat (char *buf, struct file_io_operations *operations) +{ + CORE_ADDR statptr, nameptr; + int ret, namelength, retlength; + char *pathname; + LONGEST lnum; + struct stat st; + struct fio_stat fst; + + /* 1. Parameter: Ptr to pathname / length incl. trailing zero */ + if (target_fileio_extract_ptr_w_len (&buf, &nameptr, &namelength)) + { + operations->ioerror (); + return; + } + + /* 2. Parameter: Ptr to struct stat */ + if (target_fileio_extract_long (&buf, &lnum)) + { + operations->ioerror (); + return; + } + statptr = (CORE_ADDR) lnum; + + /* Request pathname */ + pathname = alloca (namelength); + retlength = operations->read_bytes (nameptr, (gdb_byte *) pathname, namelength); + if (retlength != namelength) + { + operations->ioerror (); + return; + } + + target_fio_no_longjmp = 1; + ret = stat (pathname, &st); + + if (ret == -1) + { + operations->return_errno (-1); + return; + } + /* Only operate on regular files and directories */ + if (!ret && !S_ISREG (st.st_mode) && !S_ISDIR (st.st_mode)) + { + operations->reply (-1, FILEIO_EACCES); + return; + } + if (statptr) + { + target_fileio_to_fio_stat (&st, &fst); + target_fileio_to_fio_uint (0, fst.fst_dev); + + retlength = operations->write_bytes (statptr, + (gdb_byte *) &fst, sizeof fst); + if (retlength != sizeof fst) + { + operations->return_errno (-1); + return; + } + } + operations->return_success (ret); +} + +static void +target_fileio_func_fstat (char *buf, struct file_io_operations *operations) +{ + CORE_ADDR ptrval; + int fd, ret, retlength; + long target_fd; + LONGEST lnum; + struct stat st; + struct fio_stat fst; + struct timeval tv; + + /* 1. Parameter: file descriptor */ + if (target_fileio_extract_int (&buf, &target_fd)) + { + operations->ioerror (); + return; + } + fd =target_fileio_map_fd ((int) target_fd); + if (fd == FIO_FD_INVALID) + { + operations->badfd (); + return; + } + /* 2. Parameter: Ptr to struct stat */ + if (target_fileio_extract_long (&buf, &lnum)) + { + operations->ioerror (); + return; + } + ptrval = (CORE_ADDR) lnum; + + // ARC bug fix 25/11/2008 + memset(&st, 0, sizeof(st)); + memset(&fst, 0, sizeof(fst)); + + target_fio_no_longjmp = 1; + if (fd == FIO_FD_CONSOLE_IN || fd == FIO_FD_CONSOLE_OUT) + { + target_fileio_to_fio_uint (1, fst.fst_dev); + st.st_mode = S_IFCHR | (fd == FIO_FD_CONSOLE_IN ? S_IRUSR : S_IWUSR); + st.st_nlink = 1; +#ifdef HAVE_GETUID + st.st_uid = getuid (); +#else + st.st_uid = 0; +#endif +#ifdef HAVE_GETGID + st.st_gid = getgid (); +#else + st.st_gid = 0; +#endif + st.st_rdev = 0; + st.st_size = 0; +#ifdef HAVE_STRUCT_STAT_ST_BLKSIZE + st.st_blksize = 512; +#endif +#if HAVE_STRUCT_STAT_ST_BLOCKS + st.st_blocks = 0; +#endif + + /* N.B. st.st_ino is not set! */ + + if (!gettimeofday (&tv, NULL)) + st.st_atime = st.st_mtime = st.st_ctime = tv.tv_sec; + else + st.st_atime = st.st_mtime = st.st_ctime = (time_t) 0; + ret = 0; + } + else { + ret = fstat (fd, &st); + target_fileio_to_fio_uint (st.st_dev, fst.fst_dev); // ARC bug fix 10/11/2008 gdb bug: 9655 + } + + if (ret == -1) + { + operations->return_errno (-1); + return; + } + if (ptrval) + { + target_fileio_to_fio_stat (&st, &fst); + + retlength = operations->write_bytes (ptrval, (gdb_byte *) &fst, sizeof fst); + if (retlength != sizeof fst) + { + operations->return_errno (-1); + return; + } + } + operations->return_success (ret); +} + +static void +target_fileio_func_gettimeofday (char *buf, struct file_io_operations *operations) +{ + LONGEST lnum; + CORE_ADDR ptrval; + int ret, retlength; + struct timeval tv; + struct fio_timeval ftv; + + /* 1. Parameter: struct timeval pointer */ + if (target_fileio_extract_long (&buf, &lnum)) + { + operations->ioerror (); + return; + } + ptrval = (CORE_ADDR) lnum; + /* 2. Parameter: some pointer value... */ + if (target_fileio_extract_long (&buf, &lnum)) + { + operations->ioerror (); + return; + } + /* ...which has to be NULL */ + if (lnum) + { + operations->reply (-1, FILEIO_EINVAL); + return; + } + + target_fio_no_longjmp = 1; + ret = gettimeofday (&tv, NULL); + + if (ret == -1) + { + operations->return_errno (-1); + return; + } + + if (ptrval) + { + target_fileio_to_fio_timeval (&tv, &ftv); + + retlength = operations->write_bytes (ptrval, (gdb_byte *) &ftv, sizeof ftv); + if (retlength != sizeof ftv) + { + operations->return_errno (-1); + return; + } + } + operations->return_success (ret); +} + +static void +target_fileio_func_isatty (char *buf, struct file_io_operations *operations) +{ + long target_fd; + int fd; + + /* Parameter: file descriptor */ + if (target_fileio_extract_int (&buf, &target_fd)) + { + operations->ioerror (); + return; + } + target_fio_no_longjmp = 1; + fd =target_fileio_map_fd ((int) target_fd); + operations->return_success (fd == FIO_FD_CONSOLE_IN || + fd == FIO_FD_CONSOLE_OUT ? 1 : 0); +} + +static void +target_fileio_func_system (char *buf, struct file_io_operations *operations) +{ + CORE_ADDR ptrval; + int ret, length, retlength; + char *cmdline = NULL; + + /* Parameter: Ptr to commandline / length incl. trailing zero */ + if (target_fileio_extract_ptr_w_len (&buf, &ptrval, &length)) + { + operations->ioerror (); + return; + } + + if (length) + { + /* Request commandline */ + cmdline = alloca (length); + retlength = operations->read_bytes (ptrval, (gdb_byte *) cmdline, length); + if (retlength != length) + { + operations->ioerror (); + return; + } + } + + /* Check if system(3) has been explicitely allowed using the + `set remote system-call-allowed 1' command. If length is 0, + indicating a NULL parameter to the system call, return zero to + indicate a shell is not available. Otherwise fail with EPERM. */ + if (!target_fio_system_call_allowed) + { + if (!length) + operations->return_success (0); + else + operations->reply (-1, FILEIO_EPERM); + return; + } + + target_fio_no_longjmp = 1; + ret = system (cmdline); + + if (!length) + operations->return_success (ret); + else if (ret == -1) + operations->return_errno (-1); + else + operations->return_success (WEXITSTATUS (ret)); +} + +static struct { + char *name; + void (*func)(char *, struct file_io_operations *); +} target_fio_func_map[] = { + { "open", target_fileio_func_open }, + { "close", target_fileio_func_close }, + { "read", target_fileio_func_read }, + { "write", target_fileio_func_write }, + { "lseek", target_fileio_func_lseek }, + { "rename", target_fileio_func_rename }, + { "unlink", target_fileio_func_unlink }, + { "stat", target_fileio_func_stat }, + { "fstat", target_fileio_func_fstat }, + { "gettimeofday", target_fileio_func_gettimeofday }, + { "isatty", target_fileio_func_isatty }, + { "system", target_fileio_func_system }, + { NULL, NULL } +}; + +struct request_args { + char *buf; + struct file_io_operations *operations; +}; + +static int +do_target_fileio_request (struct ui_out *uiout, void *args) +{ + struct request_args* request = (struct request_args*) args; + char *buf = request->buf; + char *c; + int idx; + + request->operations->set_ctrl_c_signal_handler(); + + c = strchr (++buf, ','); + if (c) + *c++ = '\0'; + else + c = strchr (buf, '\0'); + for (idx = 0; target_fio_func_map[idx].name; ++idx) + if (!strcmp (target_fio_func_map[idx].name, buf)) + break; + if (!target_fio_func_map[idx].name) /* ERROR: No such function. */ + return RETURN_ERROR; + target_fio_func_map[idx].func (c, request->operations); + return 0; +} + +/* Close any open descriptors, and reinitialize the file mapping. */ + +void +target_fileio_reset (void) +{ + int ix; + + for (ix = 0; ix != target_fio_data.fd_map_size; ix++) + { + int fd = target_fio_data.fd_map[ix]; + + if (fd >= 0) + close (fd); + } + if (target_fio_data.fd_map) + { + free (target_fio_data.fd_map); + target_fio_data.fd_map = NULL; + target_fio_data.fd_map_size = 0; + } +} + + +void +target_fileio_request (char *buf, struct file_io_operations *operations) +{ + struct request_args args = {buf, operations}; + int ex; + + target_fio_no_longjmp = 0; + + ex = catch_exceptions (uiout, do_target_fileio_request, (void *)&args, + RETURN_MASK_ALL); + switch (ex) + { + case RETURN_ERROR: + operations->reply (-1, FILEIO_ENOSYS); + break; + case RETURN_QUIT: + operations->reply (-1, FILEIO_EINTR); + break; + default: + break; + } +} + +static void +set_system_call_allowed (char *args, int from_tty) +{ + if (args) + { + char *arg_end; + int val = strtoul (args, &arg_end, 10); + if (*args && *arg_end == '\0') + { + target_fio_system_call_allowed = !!val; + return; + } + } + error (_("Illegal argument for \"set remote system-call-allowed\" command")); +} + +static void +show_system_call_allowed (char *args, int from_tty) +{ + if (args) + error (_("Garbage after \"show remote system-call-allowed\" command: `%s'"), args); + printf_unfiltered ("Calling host system(3) call from target is %sallowed\n", + target_fio_system_call_allowed ? "" : "not "); +} + +void +initialize_target_fileio (struct cmd_list_element *set_cmdlist, + struct cmd_list_element *show_cmdlist) +{ + add_cmd ("system-call-allowed", no_class, + set_system_call_allowed, + _("Set if the host system(3) call is allowed for the target."), + &set_cmdlist); + add_cmd ("system-call-allowed", no_class, + show_system_call_allowed, + _("Show if the host system(3) call is allowed for the target."), + &show_cmdlist); +} diff --git a/gdb/target-fileio.h b/gdb/target-fileio.h new file mode 100644 index 0000000..46efd90 --- /dev/null +++ b/gdb/target-fileio.h @@ -0,0 +1,53 @@ +/* Target File-I/O communications + + Copyright (C) 2003, 2007, 2008 Free Software Foundation, Inc. + + This file is part of GDB. + + 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 3 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, see . */ + + +#ifndef TARGET_FILEIO_H +#define TARGET_FILEIO_H + +struct cmd_list_element; + +struct file_io_operations { + int (*read_bytes) (CORE_ADDR memaddr, gdb_byte *myaddr, int len); + int (*write_bytes)(CORE_ADDR memaddr, gdb_byte *myaddr, int len); + void (*reply)(int retcode, int error); + void (*set_ctrl_c_signal_handler)(void); +}; + + +#define ioerror() reply(-1, FILEIO_EIO) +#define badfd() reply(-1, FILEIO_EBADF) +#define return_errno(retcode) reply(retcode, ((retcode) < 0) ? target_fileio_errno_to_target (errno) : 0) +#define return_success(retcode) reply(retcode, 0) + + +/* Unified interface to target fileio */ +extern void target_fileio_request (char *buf, struct file_io_operations *operations); + +/* Cleanup any target fileio state. */ +extern void target_fileio_reset (void); + +extern void initialize_target_fileio ( + struct cmd_list_element *set_cmdlist, + struct cmd_list_element *show_cmdlist); + + +extern int target_fio_no_longjmp; + +#endif diff --git a/gdb/target.c b/gdb/target.c index 87ddf24..3887f17 100644 --- a/gdb/target.c +++ b/gdb/target.c @@ -39,6 +39,10 @@ #include "gdbcore.h" #include "exceptions.h" #include "target-descriptions.h" +// begin ARC +#include "observer.h" +#include "cli/cli-decode.h" +// end ARC static void target_info (char *, int); @@ -228,9 +232,28 @@ target_command (char *arg, int from_tty) /* Add a possible target architecture to the list. */ +// begin ARC +static void +pre_open_notify (char *name, int from_tty) +{ + observer_notify_target_pre_connect(¤t_target); +} + +static void +post_open_notify (char *name, int from_tty) +{ + observer_notify_target_post_connect(¤t_target); +} +// end ARC + + void add_target (struct target_ops *t) { +// begin ARC + struct cmd_list_element *cmd; +// end ARC + /* Provide default values for all "must have" methods. */ if (t->to_xfer_partial == NULL) t->to_xfer_partial = default_xfer_partial; @@ -258,7 +281,16 @@ Remaining arguments are interpreted by the target protocol. For more\n\ information on the arguments for a particular protocol, type\n\ `help target ' followed by the protocol name."), &targetlist, "target ", 0, &cmdlist); + +// begin ARC + cmd = +// end ARC add_cmd (t->to_shortname, no_class, t->to_open, t->to_doc, &targetlist); + +// begin ARC + (void) add_cmd ("", no_class, pre_open_notify, "", &cmd->hook_pre); + (void) add_cmd ("", no_class, post_open_notify, "", &cmd->hook_post); +// end ARC } /* Stub functions */ @@ -389,6 +421,7 @@ update_current_target (void) INHERIT (to_shortname, t); INHERIT (to_longname, t); INHERIT (to_doc, t); + INHERIT (to_data, t); // ARC 16/02/2009 gdb bug: 9886 INHERIT (to_open, t); INHERIT (to_close, t); INHERIT (to_attach, t); @@ -645,6 +678,10 @@ update_current_target (void) if (targetdebug) setup_target_debug (); + +// begin ARC + observer_notify_target_updated(¤t_target); +// end ARC } /* Mark OPS as a running target. This reverses the effect @@ -685,7 +722,7 @@ target_mark_exited (struct target_ops *ops) break; if (t == NULL) internal_error (__FILE__, __LINE__, - "Attempted to mark unpushed target \"%s\" as running", + "Attempted to mark unpushed target \"%s\" as non-running", // ARC 17/11/08 correct message gdb bug: 9887 ops->to_shortname); ops->to_has_execution = 0; @@ -1649,6 +1686,9 @@ void target_detach (char *args, int from_tty) { (current_target.to_detach) (args, from_tty); +// begin ARC + observer_notify_target_post_disconnect(¤t_target); +// end ARC } void @@ -1760,7 +1800,13 @@ find_default_attach (char *args, int from_tty) struct target_ops *t; t = find_default_run_target ("attach"); +// begin ARC + observer_notify_target_pre_connect(t); +// end ARC (t->to_attach) (args, from_tty); +// begin ARC + observer_notify_target_post_connect(t); +// end ARC return; } @@ -2060,6 +2106,9 @@ debug_to_close (int quitting) { target_close (&debug_target, quitting); fprintf_unfiltered (gdb_stdlog, "target_close (%d)\n", quitting); +// begin ARC + observer_notify_target_post_disconnect(&debug_target); +// end ARC } void @@ -2069,6 +2118,9 @@ target_close (struct target_ops *targ, int quitting) targ->to_xclose (targ, quitting); else if (targ->to_close != NULL) targ->to_close (quitting); +// begin ARC + observer_notify_target_post_disconnect(targ); +// end ARC } static void @@ -2092,6 +2144,9 @@ static void debug_to_detach (char *args, int from_tty) { debug_target.to_detach (args, from_tty); +// begin ARC + observer_notify_target_post_disconnect(&debug_target); +// end ARC fprintf_unfiltered (gdb_stdlog, "target_detach (%s, %d)\n", args, from_tty); } diff --git a/gdb/testsuite/config/arc-jtag.exp b/gdb/testsuite/config/arc-jtag.exp deleted file mode 100644 index 1689111..0000000 --- a/gdb/testsuite/config/arc-jtag.exp +++ /dev/null @@ -1,112 +0,0 @@ -# Test Framework Driver for GDB using the arcjtag target. - -# Copyright 2005 Free Software Foundation, Inc. -# -# 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. - -load_lib gdb.exp - -# -# gdb_target_arcjtag -# Set gdb to target arcjtag. -# -proc gdb_target_arcjtag { } { - global gdb_prompt - global exit_status - - # our arcjtag target doesn't take any options (yet) - #set target_arcjtag_options "[board_info target gdb,target_sim_options]"; - - send_gdb "target arcjtag\n" - - gdb_expect 60 { - -re "A program is being debugged already.*Kill it.*y or n. $" { - send_gdb "y\n" - verbose "\t\tKilling previous program being debugged" - exp_continue - } - -re "Connected to the arcjtag target.*$gdb_prompt $" { - verbose "Set target to arcjtag" - } - -re "$gdb_prompt $" { - verbose "Retrying target arcjtag..." - send_gdb "arc-reset-board\n" - send_gdb "target arcjtag\n" - - gdb_expect 60 { - -re "A program is being debugged already.*Kill it.*y or n. $" { - send_gdb "y\n" - verbose "\t\tKilling previous program being debugged" - exp_continue - } - -re "Connected to the arcjtag target.*$gdb_prompt $" { - verbose "Set target to arcjtag" - } - timeout { - perror "Couldn't set target to arcjtag (timeout)." - return 1 - } - } - } - timeout { - perror "Couldn't set target to arcjtag (timeout)." - return 1 - } - } - - return 0 -} - -# -# gdb_load -- load a file into the debugger. -# return a -1 if anything goes wrong. -# -proc gdb_load { arg } { - global verbose - global loadpath - global loadfile - global GDB - global gdb_prompt - - if { $arg != "" } { - if [gdb_file_cmd $arg] then { return -1 } - } - - if { [gdb_target_arcjtag] != 0 } { - return -1 - } - - # gotta do something about the timeout.... - send_gdb "load\n" - - gdb_expect 180 { - -re ".*$gdb_prompt $" { - if $verbose>1 then { - send_user "Loaded $arg into $GDB\n" - } - return 0 - } - -re "$gdb_prompt $" { - if $verbose>1 then { - perror "GDB couldn't load." - } - } - timeout { - perror "Timed out trying to load $arg." - } - } - - return 1 -} diff --git a/gdb/testsuite/config/remote-gdbserver.exp b/gdb/testsuite/config/remote-gdbserver.exp deleted file mode 100644 index 60d106d..0000000 --- a/gdb/testsuite/config/remote-gdbserver.exp +++ /dev/null @@ -1,570 +0,0 @@ -# Test framework for GDB (remote protocol) using a "gdbserver", -# ie. a debug agent running as a native process on the same or -# a different host. - -# Copyright 2000, 2001, 2003 Free Software Foundation, Inc. - -# 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. - -# Please email any bugs, comments, and/or additions to this file to: -# bug-gdb@prep.ai.mit.edu - -# This file was written by Michael Snyder. (msnyder@redhat.com) - -# -# This module to be used for testing gdb with a "gdbserver" -# built either from libremote or from gdb/gdbserver. -# - -# Load the basic testing library, and the remote stuff. -load_lib ../config/monitor.exp -load_lib telnet.exp -# -# To be addressed or set in your baseboard config file: -# -# set_board_info gdb_protocol "remote" -# Unles you have a gdbserver that uses a different protocol... -# -# set_board_info use_gdb_stub 1 -# This tells the rest of the test suite not to do things -# like "run" which don't work well on remote targets. -# -# set_board_info gdb,do_reload_on_run 1 -# Unles you have a gdbserver that can handle multiple sessions. -# -# set_board_info noargs 1 -# At present there is no provision in the remote protocol -# for passing arguments. This test framework does not -# address the issue, so it's best to set this variable -# in your baseboard configuration file. -# FIXME: there's no reason why the test harness couldn't -# pass commandline args when it spawns gdbserver. -# -# set_board_info gdb,noinferiorio 1 -# Neither the traditional gdbserver nor the one in libremote -# can presently capture stdout and relay it to GDB via the -# 'O' packet. This means that tests involving printf will -# fail unles you set this varibale in your baseboard -# configuration file. -# -# set_board_info gdb,no_hardware_watchpoints 1 -# Unles you have a gdbserver that supports hardware watchpoints. -# FIXME: gdb should detect if the target doesn't support them, -# and fall back to using software watchpoints. -# -# set_board_info gdb_server_prog -# This will be the path to the gdbserver program you want to test. -# Defaults to "gdbserver". -# -# set_board_info sockethost -# The name of the host computer whose socket is being used. -# Defaults to "localhost". Note: old gdbserver requires -# that you define this, but libremote/gdbserver does not. -# -# set_board_info socketport -# Port id to use for socket connection. If not set explicitly, -# it will start at "2345" and increment for each use. -# -# set_board_info rsh_prog -# The program to use to spawn executables on the remote board. -# Default: "rsh" -# -# set_board_info rcp_prog -# The program to use to copy test executables to the remote board. -# Default: "rcp" -# -# set_board_info nfsdir -# If rcp_prog is set to "cp", specify the local directory name that -# is NFS mounted by the board. - -# -# gdb_load -- load a file into the debugger. -# return a -1 if anything goes wrong. -# - -global server_exec; -global portnum; -set portnum "2000"; - -proc gdb_load { args } { - global server_exec; - global portnum; - global verbose; - global gdb_prompt; - - # Port id -- either specified in baseboard file, or managed here. - if [target_info exists gdb,socketport] { - set portnum [target_info gdb,socketport]; - } else { - # Bump the port number to avoid conflicts with hung ports. - incr portnum; - } - - # Extract the local and remote host ids from the target board struct. - - if [target_info exists sockethost] { - set debughost [target_info sockethost]; - } else { - set debughost "localhost:"; - } - # Extract the protocol - if [target_info exists gdb_protocol] { - set protocol [target_info gdb_protocol]; - } else { - set protocol "remote"; - } - - # Extract the name of the gdbserver, if known (default 'gdbserver'). - if [target_info exists gdb_server_prog] { - set gdbserver [target_info gdb_server_prog]; - } else { - set gdbserver "gdbserver"; - } - # Extract the socket hostname - if [target_info exists sockethost] { - set sockethost [target_info sockethost]; - } else { - set sockethost "" - } - - # Get target name - if [target_info exists hostname] { - set target_address [target_info hostname]; - } else { - set target_address "localhost" - } - - # Get the username on the target - if [target_info exists "username"] { - set username [target_info username]; - } else { - set username ""; - } - - # Get download dir - if [target_info exists download_dir] { - set download_dir [target_info download_dir]; - } else { - set download_dir "/tmp" - } - - # Get tests dir - if [target_info exists tests_dir] { - set tests_dir [target_info tests_dir]; - } else { - set tests_dir $download_dir - } - - # Export the host:port pair. - set gdbport $debughost$portnum; - - if { $args == "" || $args == "{}" } { - if [info exists server_exec] { - set args $server_exec; - } else { - send_gdb "info files\n"; - gdb_expect 30 { - -re "Symbols from \"(\[^\"\]+)\"" { - set args $expect_out(1,string); - exp_continue; - } - -re "Local exec file:\[\r\n\]+\[ \t\]*`(\[^'\]+)'," { - set args $expect_out(1,string); - exp_continue; - } - -re "$gdb_prompt $" { } - } - } - } - - # remember new exec file - set server_exec $args; - - # Download the test files into the test_board - gdbserver_download $target_address $username $server_exec \ - $download_dir/a-$portnum.out - - # tell gdb what file we are debugging - if [gdb_file_cmd $args] { - return -1; - } - - if [target_info exists solib_path] { - send_gdb "set solib-absolute-prefix [target_info solib_path]\n" - gdb_expect 30 { - -re "$gdb_prompt $" { - if $verbose>1 then { - send_user "set library path\n" - } - } - default { - perror "Couldn't set library path\n" - return -1 - } - } - } - - for {set i 1} {$i <= 3} {incr i} { - # Fire off the debug agent - set server_spawn_id [gdbserver_spawn $target_address $username \ - "$gdbserver $target_address:$portnum $tests_dir/a-$portnum.out 2>&1"] - - if { $server_spawn_id <= 0 } { return -1 } - - # Wait for the server to produce at least one line and an additional - # character of output. This will wait until any TCP socket has been - # created, so that GDB can connect. - expect { - # expect output from $server_spawn_id - -i $server_spawn_id - -re ".*\n." { } - } - - # We can't just call close, because if gdbserver is local then that means - # that it will get a SIGHUP. Doing it this way could also allow us to - # get at the inferior's input or output if necessary, and means that we - # don't need to redirect output. - expect_background { - -i $server_spawn_id - -re "." { } - eof { - # The spawn ID is already closed now (but not yet waited for). - wait -nowait -i $expect_out(spawn_id) - } - } - - # attach to the "serial port" - if {[gdb_target_cmd $protocol $gdbport] == 0 } { - break - } - verbose -log "Unable to connect to target. Re-trying.." - } - - # do the real load if needed - if [target_info exists gdb_server_do_load] { - send_gdb "load\n" - set timeout 2400 - verbose "Timeout is now $timeout seconds" 2 - gdb_expect { - -re ".*$gdb_prompt $" { - if $verbose>1 then { - send_user "Loaded $arg into $GDB\n" - } - set timeout 30 - verbose "Timeout is now $timeout seconds" 2 - return 1 - } - -re "$gdb_prompt $" { - if $verbose>1 then { - perror "GDB couldn't load." - } - } - timeout { - if $verbose>1 then { - perror "Timed out trying to load $arg." - } - } - } - } - - return 0; -} - - -# Use RSH or telnet depending on the program chosen -# by the board file. -# Return spawn_id -proc gdbserver_spawn { dest username commandline } { - global board_info - if ![target_info exists rsh_prog] { - if { [which remsh] != 0 } { - set RSH remsh - } else { - set RSH rsh - } - } else { - set RSH [target_info rsh_prog]; - } - - if { $RSH == "rsh" } { - return [rsh_gdbserver_spawn $dest $username $commandline] - } else { - - if { $RSH == "telnet" } { - # Spawn the shell - return [telnet_gdbserver_spawn $dest $username $commandline] - - # expect the shell prompt obtained from - # the board description. - # Now spawn gdbserver with its parameters - # and dont expect any output from the gdbserver - # other than the shell prompt - # FIXME ?? Where do I close the telnet - # session ( could use gdb_finish for closing the telnet session) - - - - } else { - verbose "Unknown rsh program " - return -1 - } - } -} - -proc mynewtelnet_open_and_exec { dest port shell_prompt commandline } { - global board_info - - spawn "telnet-exec.exp" $dest $commandline - set board_info($dest,fileid) $spawn_id; - return $spawn_id; -} - - -proc mytelnet_open_and_exec { dest port shell_prompt commandline } { - set tries 0 - set result -1 - set need_respawn 1 - - verbose "Starting a telnet connection to $dest:$port $shell_prompt " 2 - while { $result < 0 && $tries <= 3 } { - if { $need_respawn } { - set need_respawn 0 - spawn "telnet" $dest $port - } - expect { - "Trying " { - exp_continue - } - -re "$shell_prompt.*$" { - verbose "Got prompt $shell_prompt\n" - set result 0 - exp_send $commandline - - } - -re "nt Name:|ogin:" { - if [board_info $connhost exists telnet_username] { - exp_send "[board_info $connhost telnet_username]\n" - exp_continue - } - if [board_info $connhost exists username] { - exp_send "[board_info $connhost username]\n" - exp_continue - } - perror "telnet: need to login" - break - } - "assword:" { - if [board_info $connhost exists telnet_password] { - exp_send "[board_info $connhost telnet_password]\n" - exp_continue - } - if [board_info $connhost exists password] { - exp_send "[board_info $connhost password]\n" - exp_continue - } - perror "telnet: need a password" - break - } - -re "advance.*y/n.*\\?" { - exp_send "n\n" - exp_continue - } - -re {([Aa]dvanced|[Ss]imple) or ([Ss]imple|[Aa]dvanced)} { - exp_send "simple\n" - exp_continue - } - "Connected to" { - exp_continue - } - "unknown host" { - exp_send "\003" - perror "telnet: unknown host" - break - } - "VxWorks Boot" { - exp_send "@\n" - sleep 20 - exp_continue - } - -re "Escape character is.*\\.\[\r\n\]" { - exp_continue - } - "has logged on from" { - exp_continue - } - "You have no Kerberos tickets" { - warning "telnet: no kerberos Tickets, please kinit" - break - } - -re "Connection refused.*$" { - catch "exp_send \"\003\"" foo - sleep 5 - warning "telnet: connection refused." - } - -re "Sorry, this system is engaged.*" { - exp_send "\003" - warning "telnet: already connected." - } - "Connection closed by foreign host.*$" { - warning "telnet: connection closed by foreign host." - break - } - -re "\[\r\n\]+" { - exp_continue - } - timeout { - exp_send "\n" - } - eof { - warning "telnet: got unexpected EOF from telnet." - catch close - catch wait - set need_respawn 1 - sleep 5 - } - } - incr tries - } - - - verbose "spawn id is $spawn_id" - set board_info($dest,fileid) $spawn_id; - return $spawn_id -} - -# Use telnet to spawn a session -proc telnet_gdbserver_spawn { dest username commandline } { - global board_info - set remote $dest - set telnet_prog "telnet" - set prompt [target_info shell_prompt] - set mport 23 - verbose "commandline is $commandline" - return [mynewtelnet_open_and_exec $remote $mport $prompt $commandline] -} - - -# -# Use $RSH to spawn $commandline on remote machine $dest as user $username. -# (Note $username on $dest will have to have appropriate .rhost entries.) -# -proc rsh_gdbserver_spawn { dest username commandline } { - global board_info - - if [target_info exists rsh_prog] { - set RSH [target_info rsh_prog]; - } else { - set RSH rsh - } - - if [board_info $dest exists hostname] { - set remote [board_info $dest hostname]; - } else { - set remote $dest; - } - - if { $username == "" } { - set rsh_useropts "" - } else { - set rsh_useropts "-l" - } - - verbose "spawn $RSH $rsh_useropts $username $remote $commandline"; - spawn $RSH $rsh_useropts $username $remote $commandline; - set board_info($dest,fileid) $spawn_id; - - set timeout 60 - expect { - # expect output from $spawn_id - -i $spawn_id - -re "(.*No route to host)|(poll: protocol failure in circuit setup)|(.*Unknown host)|(.*Connection refused)|(Login incorrect)|(Permission denied)" { - verbose -log "$RSH to $remote failed, output \"$expect_out(buffer)\"" - return -1 - } - -re ".*\r" { } - timeout { - verbose -log "$RSH to $remote timedout (timeout=$timeout)" - return -1 - } - eof { - verbose -log "$RSH to $remote failed" - return -1 - } - } - - return $spawn_id; -} - -# -# Download $srcfile to $destfile on $desthost as user $username using rcp. -# - -proc gdbserver_download {desthost username srcfile destfile} { - if [target_info exists rsh_prog] { - set RSH [target_info rsh_prog]; - } else { - set RSH rsh - } - - if ![target_info exists rcp_prog] { - set RCP rcp - } else { - set RCP [target_info rcp_prog]; - } - - if [board_info $desthost exists name] { - set desthost [board_info $desthost name]; - } - - if [board_info $desthost exists hostname] { - set desthost [board_info $desthost hostname]; - } - - if { $username == "" } { - set rsh_useropts "" - set rcp_dest $desthost - } else { - set rsh_useropts "-l $username" - set rcp_dest "$username@$desthost" - } - - # Delete the output file - # set status [catch "exec $RSH $rsh_useropts $desthost rm -f $destfile |& cat" output] - - if { $RCP != "cp" } { - set status [catch "exec $RCP $srcfile $rcp_dest:$destfile |& cat" output] - } else { - if [target_info exists nfsdir] { - set nfsdir [target_info nfsdir]; - verbose -log "nfsdir is $nfsdir" - set status [catch "exec cp $srcfile $nfsdir/$destfile |& cat" output] - } else { - verbose "\nnfsdir not set\n" - set status 1 - } - } - if { $status == 0 } { - if [target_info exists nfsdir] { - verbose "Copied $srcfile to $nfsdir/$destfile" 2 - return $destfile; - } else { - verbose "Copied $srcfile to $desthost:$destfile" 2 - return $destfile; - } - } else { - verbose "Download to $desthost failed, $output." - return "" - } -} diff --git a/gdb/testsuite/gdb.arch/arc-step-jtag.exp b/gdb/testsuite/gdb.arch/arc-step-jtag.exp deleted file mode 100644 index a51f00e..0000000 --- a/gdb/testsuite/gdb.arch/arc-step-jtag.exp +++ /dev/null @@ -1,88 +0,0 @@ -if $tracelevel { - strace $tracelevel -} - -# Test single-stepping zero-overhead-loops and delay slots - -if ![istarget "arc-*-*"] then { - verbose "Skipping ARC single-step tests." - return -} - -if ![istarget "*elf32*"] then { - verbose "Skipping ARC JTAG single-step tests." - return -} - -set testfile "arc-step-jtag" -set srcfile ${testfile}.s -set binfile ${objdir}/${subdir}/${testfile} -if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable ""] != "" } { - gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail." -} - -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir - -if { [ gdb_load ${binfile} ] != 0 } { - gdb_suppress_entire_file "Load failed, so all tests in this file will automatically fail." -} - -# -# Run to `main' where we begin our tests. -# - -gdb_test "adv _main" ".* in _main .*" "advance to _main" - -gdb_test "stepi" ".* Lmov .*" "step mov instruction" -gdb_test "p \$r0" ".*= 1" "r0 value after mov instruction" - -gdb_test "stepi" ".* Lmov_s .*" "step mov_s instruction" -gdb_test "p \$r0" ".*= 2" "r0 value after mov_s instruction" - -gdb_test "stepi" ".* Lb .*" "step b instruction" - -gdb_test "stepi" ".* Lb_s .*" "step b_s instruction" - -gdb_test "stepi" ".* Lbdotd_dslot .*" "step b.d branch" -gdb_test "stepi" ".* Lbdotd .*" "step b.d delay slot" -gdb_test "p \$r0" ".*= 5" "r0 value after b.d delay slot" - -gdb_test "stepi" ".* Lbl .*" "step bl instruction" - -gdb_test "stepi" ".* Lj_sdotd_dslot .*" "step j_s.d \[blink\] branch" -gdb_test "stepi" ".* Lj_sdotd .*" "step j_s.d \[blink\] delay slot" -gdb_test "p \$r0" ".*= 6" "r0 value after j_s.d \[blink\] delay slot" - -gdb_test "stepi" ".* Lj .*" "step j instruction" - -gdb_test "stepi" ".*" "step mov instruction" -gdb_test "stepi" ".* ZOLstart .*" "step lp instruction" - -gdb_test "p \$lp_count" ".*= 3" "lp_count value" -gdb_test "p \$lp_end - \$lp_start" \ - ".* = 8" "lp_end - lp_start == 8" - -gdb_test "p \$r0" ".* = 6" "r0 value before loop" - -# step thru the loop, checking the value of r0 - -# first iteration -gdb_test "stepi" ".* ZOLmiddle .*" "step add instruction (inside ZOL)" -gdb_test "p \$r0" ".* = 7" "r0 value after 1 iteration" -gdb_test "stepi" ".* ZOLstart .*" "step across end of ZOL" - -# second iteration -gdb_test "stepi" ".* ZOLmiddle .*" "step add instruction (inside ZOL)" -gdb_test "p \$r0" ".* = 8" "r0 value after 2 iterations" -gdb_test "stepi" ".* ZOLstart .*" "step across end of ZOL" - -# last iteration -gdb_test "stepi" ".* ZOLmiddle .*" "step add instruction (inside ZOL)" -gdb_test "p \$r0" ".* = 9" "r0 value after 3 iterations" -gdb_test "stepi" ".* ZOLend .*" "step out of end of ZOL" - -# exit(r0) -gdb_test "continue" ".*Program exited.*011.*" \ - "value of r0 on exit" diff --git a/gdb/testsuite/gdb.arch/arc-step-jtag.s b/gdb/testsuite/gdb.arch/arc-step-jtag.s deleted file mode 100644 index 7ad8e1f..0000000 --- a/gdb/testsuite/gdb.arch/arc-step-jtag.s +++ /dev/null @@ -1,46 +0,0 @@ -_main: - .global _main -main: - .global main - - mov r0,1 ; 32 bit instruction -Lmov: - mov_s r0,2 ; 16 bit instruction -Lmov_s: - b Lb ; 32 bit, no delay slot - mov r0,3 - nop -Lb: - b_s Lb_s ; 16 bit, no delay slot - mov r0,4 - nop -Lb_s: - b.d Lbdotd ; 32 bit, delay slot -Lbdotd_dslot: - mov r0,5 - nop -Lbdotd: - - bl Lbl -Lj_sdotd: - j Lj -Lbl: - j_s.d [blink] ; 16 bit, delay slot -Lj_sdotd_dslot: - mov r0,6 -Lj: - mov lp_count,3 ; zero-overhead loop - lp ZOLend -ZOLstart: - add r0,r0,1 -ZOLmiddle: - nop -ZOLend: - ;; r0 should be 9 - - - ;; exit(r0) - flag 1 - nop - nop - nop diff --git a/gdb/testsuite/gdb.arch/arc-step.exp b/gdb/testsuite/gdb.arch/arc-step.exp deleted file mode 100644 index e958b5f..0000000 --- a/gdb/testsuite/gdb.arch/arc-step.exp +++ /dev/null @@ -1,83 +0,0 @@ -if $tracelevel { - strace $tracelevel -} - -# Test single-stepping zero-overhead-loops and delay slots - -if ![istarget "arc-*-*"] then { - verbose "Skipping ARC single-step tests." - return -} - -if ![istarget "*linux*"] then { - verbose "Skipping ARC linux single-step tests." - return -} - -set testfile "arc-step" -set srcfile ${testfile}.s -set binfile ${objdir}/${subdir}/${testfile} -if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable ""] != "" } { - gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail." -} - -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -gdb_load ${binfile} - -# -# Run to `main' where we begin our tests. -# - -gdb_test "adv _main" ".* in _main .*" "advance to _main" - -gdb_test "stepi" ".* Lmov .*" "step mov instruction" -gdb_test "p \$r0" ".*= 1" "r0 value after mov instruction" - -gdb_test "stepi" ".* Lmov_s .*" "step mov_s instruction" -gdb_test "p \$r0" ".*= 2" "r0 value after mov_s instruction" - -gdb_test "stepi" ".* Lb .*" "step b instruction" - -gdb_test "stepi" ".* Lb_s .*" "step b_s instruction" - -gdb_test "stepi" ".* Lbdotd .*" "step b.d instruction" -gdb_test "p \$r0" ".*= 5" "r0 value after b.d instruction" - -gdb_test "stepi" ".* Lbl .*" "step bl instruction" - -gdb_test "stepi" ".* Lj_sdotd .*" "step j_s.d \[blink\] instruction" -gdb_test "p \$r0" ".*= 6" "r0 value after j_s.d \[blink\] instruction" - -gdb_test "stepi" ".* Lj .*" "step j instruction" - -gdb_test "stepi" ".*" "step mov instruction" -gdb_test "stepi" ".* ZOLstart .*" "step lp instruction" - -gdb_test "p \$lp_count" ".*= 3" "lp_count value" -gdb_test "p \$lp_end - \$lp_start" \ - ".* = 8" "lp_end - lp_start == 8" - -gdb_test "p \$r0" ".* = 6" "r0 value before loop" - -# step thru the loop, checking the value of r0 - -# first iteration -gdb_test "stepi" ".* ZOLmiddle .*" "step add instruction (inside ZOL)" -gdb_test "p \$r0" ".* = 7" "r0 value after 1 iteration" -gdb_test "stepi" ".* ZOLstart .*" "step across end of ZOL" - -# second iteration -gdb_test "stepi" ".* ZOLmiddle .*" "step add instruction (inside ZOL)" -gdb_test "p \$r0" ".* = 8" "r0 value after 1 iteration" -gdb_test "stepi" ".* ZOLstart .*" "step across end of ZOL" - -# last iteration -gdb_test "stepi" ".* ZOLmiddle .*" "step add instruction (inside ZOL)" -gdb_test "p \$r0" ".* = 9" "r0 value after 1 iteration" -gdb_test "stepi" ".* ZOLend .*" "step out of end of ZOL" - -# exit(r0) -gdb_test "continue" ".*Program exited.*011.*" \ - "value of r0 on exit" diff --git a/gdb/testsuite/gdb.arch/arc-step.s b/gdb/testsuite/gdb.arch/arc-step.s deleted file mode 100644 index 8dce39a..0000000 --- a/gdb/testsuite/gdb.arch/arc-step.s +++ /dev/null @@ -1,43 +0,0 @@ -_main: - .global _main -main: - .global main - - mov r0,1 ; 32 bit instruction -Lmov: - mov_s r0,2 ; 16 bit instruction -Lmov_s: - b Lb ; 32 bit, no delay slot - mov r0,3 - nop -Lb: - b_s Lb_s ; 16 bit, no delay slot - mov r0,4 - nop -Lb_s: - b.d Lbdotd ; 32 bit, delay slot - mov r0,5 - nop -Lbdotd: - - bl Lbl -Lj_sdotd: - j Lj -Lbl: - j_s.d [blink] ; 16 bit, delay slot - mov r0,6 -Lj: - mov lp_count,3 ; zero-overhead loop - lp ZOLend -ZOLstart: - add r0,r0,1 -ZOLmiddle: - nop -ZOLend: - ;; r0 should be 9 - - - ;; exit(r0) - ;; mov r0,0 - mov r8,1 - trap_s 0 diff --git a/gdb/testsuite/gdb.asm/arc.inc b/gdb/testsuite/gdb.asm/arc.inc deleted file mode 100644 index e22c35c..0000000 --- a/gdb/testsuite/gdb.asm/arc.inc +++ /dev/null @@ -1,55 +0,0 @@ - - comment "subroutine prologue" - .macro gdbasm_enter - st.a blink,[sp,-4] - st.a fp, [sp,-4] - mov fp,sp - .endm - - comment "subroutine epilogue" - .macro gdbasm_leave - ld.ab fp, [sp,4] - ld blink,[sp,0] - j.d [blink] - add sp,sp,4 - .endm - - .macro gdbasm_call subr - bl \subr - .endm - - .macro gdbasm_several_nops - nop - nop - nop - nop - .endm - - comment "exit (0)" - .macro gdbasm_exit0 - mov_s r0,0 - trap_s 0 - .endm - - comment "crt0 startup" - .macro gdbasm_startup - mov fp, 0 - .endm - - comment "Declare a data variable" - .macro gdbasm_datavar name value - .data -\name: - .long \value - .endm - - comment "Declare the start of a subroutine" - .macro gdbasm_declare name - .type \name, @function -\name: - .endm - - comment "End a subroutine" - .macro gdbasm_end name - .size \name, .-name - .endm diff --git a/gdb/testsuite/gdb.asm/asm-source.exp b/gdb/testsuite/gdb.asm/asm-source.exp index a94fd98..0f531a9 100644 --- a/gdb/testsuite/gdb.asm/asm-source.exp +++ b/gdb/testsuite/gdb.asm/asm-source.exp @@ -48,12 +48,6 @@ switch -glob -- [istarget] { "*arm-*-*" { set asm-arch arm } - "arc-*-*" { - set asm-arch arc - set asm-flags "-I${srcdir}/${subdir} -I${objdir}/${subdir}" - set debug-flags "-gdwarf-2" - append link-flags " -marclinux" - } "xscale-*-*" { set asm-arch arm } diff --git a/gdb/testsuite/gdb.base/callfuncs.exp b/gdb/testsuite/gdb.base/callfuncs.exp index 1a4da6e..de1f647 100644 --- a/gdb/testsuite/gdb.base/callfuncs.exp +++ b/gdb/testsuite/gdb.base/callfuncs.exp @@ -266,6 +266,15 @@ proc fetch_all_registers {test} { } exp_continue } + -re "^COUNT0\[ \t\]+\[^\r\n\]+\[\r\n\]+" { + if [istarget "arc*"] { + # Filter out COUNT0 which is an instruction counter on the simulator, + # giving spurious differences. + } else { + lappend all_registers_lines $expect_out(0,string) + } + exp_continue + } -re "^\[^ \t\]+\[ \t\]+\[^\r\n\]+\[\r\n\]+" { lappend all_registers_lines $expect_out(0,string) exp_continue diff --git a/gdb/testsuite/gdb.base/float.exp b/gdb/testsuite/gdb.base/float.exp index ca84466..e0f0d9f 100644 --- a/gdb/testsuite/gdb.base/float.exp +++ b/gdb/testsuite/gdb.base/float.exp @@ -97,8 +97,6 @@ if { [istarget "alpha*-*-*"] } then { gdb_test "info float" "fr4.*fr4R.*fr31R.*" "info float" } elseif [istarget "sparc*-*-*"] then { gdb_test "info float" "f0.*f1.*f31.*d0.*d30.*" "info float" -} elseif [istarget "arc*-*-*"] then { - gdb_test "info float" "Software FPU.*" } else { gdb_test "info float" "No floating.point info available for this processor." "info float (unknown target)" } diff --git a/gdb/testsuite/gdb.base/relocate.exp b/gdb/testsuite/gdb.base/relocate.exp index 46f7ab6..a7beba9 100644 --- a/gdb/testsuite/gdb.base/relocate.exp +++ b/gdb/testsuite/gdb.base/relocate.exp @@ -78,7 +78,7 @@ set static_bar_addr [get_var_address static_bar] # Make sure they have different addresses. if { "${static_foo_addr}" == "${static_bar_addr}" } { - fail "static variables have different addresses" + fail "static variables have same address" } else { pass "static variables have different addresses" } @@ -89,7 +89,7 @@ set global_bar_addr [get_var_address global_bar] # Make sure they have different addresses. if { "${global_foo_addr}" == "${global_bar_addr}" } { - fail "global variables have different addresses" + fail "global variables have same address" } else { pass "global variables have different addresses" } @@ -100,7 +100,7 @@ set function_bar_addr [get_var_address function_bar] # Make sure they have different addresses. if { "${function_foo_addr}" == "${function_bar_addr}" } { - fail "functions have different addresses" + fail "functions have same address" } else { pass "functions have different addresses" } @@ -126,7 +126,7 @@ set new_function_foo_addr [get_var_address function_foo] # Make sure they have different addresses. if { "${function_foo_addr}" == "${new_function_foo_addr}" } { - fail "function foo has a different address" + fail "function foo has the same address" } else { pass "function foo has a different address" } diff --git a/gdb/testsuite/lib/arc-gdbserver.exp b/gdb/testsuite/lib/arc-gdbserver.exp deleted file mode 100644 index 6674e92..0000000 --- a/gdb/testsuite/lib/arc-gdbserver.exp +++ /dev/null @@ -1,98 +0,0 @@ -# Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software -# Foundation, Inc. -# -# This file is part of DejaGnu. -# -# DejaGnu 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. -# -# DejaGnu 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 DejaGnu; if not, write to the Free Software Foundation, -# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -# gdbserver running cross - -#load the config file -load_generic_config "remote-gdbserver" - - -process_multilib_options "" - -# The default compiler for this target. -set_board_info compiler "$env(GDBTEST_CC)" -set_board_info cflags "$env(GDBTEST_CFLAGS)" -set_board_info assembler "$env(GDBTEST_AS) $env(GDBTEST_ASFLAGS)" -set_board_info linker "$env(GDBTEST_LD)" -set_board_info ldflags "$env(GDBTEST_LDFLAGS)" - -# We will be using the standard GDB remote protocol -set_board_info gdb_protocol "remote" - -set_board_info netport "$env(GDBTEST_GDBSERVER_HOST):$env(GDBTEST_GDBSERVER_PORT)" - -# Path to the gdbserver executable, if required. -set_board_info gdb_server_prog $env(GDBTEST_GDBSERVER_PATH) -# "../gdbserver/gdbserver" - -# Name of the computer whose socket will be used, if required. -set_board_info sockethost "$env(GDBTEST_GDBSERVER_HOST):" - -# Port ID to use for socket connection -set_board_info gdb,socketport $env(GDBTEST_GDBSERVER_PORT) - -# Use techniques appropriate to a stub -set_board_info use_gdb_stub 1 - -# This gdbserver can only run a process once per session. -set_board_info gdb,do_reload_on_run 1 - -# There's no support for argument-passing (yet). -set_board_info noargs 1 - -# Can't do FILE IO in current gdbserver -set_board_info gdb,nofileio 1 - -# Can't do input (or output) in the current gdbserver. -set_board_info gdb,noinferiorio 1 - -# Can't do hardware watchpoints, in general -set_board_info gdb,no_hardware_watchpoints 1 - -# Copy the testcases using cp -set_board_info rcp_prog "cp" - - -# Set nfs directory -# On my machine this is how it is mounted. - ramana -# kanika:/home/opt/share on /mnt/nfsmounts type nfs (rw,addr=192.168.100.68) -set_board_info nfsdir $env(GDBTEST_NFSDIR) - -# Set the test directory on the board. Where is this mounted -# on the board. -set_board_info tests_dir $env(GDBTEST_TESTS_DIR) - -# run on target using rsh -set_board_info rsh_prog "rsh" - -# Download directory -set_board_info download_dir $env(GDBTEST_DOWNLOAD_DIR) - -# Hostname -set_board_info hostname $env(GDBTEST_GDBSERVER_HOST) -set_board_info username "root" -set_board_info sockethost "$env(GDBTEST_GDBSERVER_HOST):" - -#Shell prompt -set_board_info shell_prompt "\[arcLinux\]$" - -#set_board_info board,connect "telnet" - -# timeout -#set_board_info gdb,timeout 300 diff --git a/gdb/testsuite/lib/arc-jtag.exp b/gdb/testsuite/lib/arc-jtag.exp deleted file mode 100644 index c613f30..0000000 --- a/gdb/testsuite/lib/arc-jtag.exp +++ /dev/null @@ -1,32 +0,0 @@ -# -# The baseboard file for the arcjtag target -# - -load_generic_config "arc-jtag" - -set_board_info compiler "$env(GDBTEST_CC)" -set_board_info cflags "$env(GDBTEST_CFLAGS)" -set_board_info assembler "$env(GDBTEST_AS) $env(GDBTEST_ASFLAGS)" -set_board_info linker "$env(GDBTEST_LD)" -set_board_info ldflags "$env(GDBTEST_LDFLAGS)" - -#Reload the file before running -set_board_info gdb,do_reload_on_run 1 - -#Arguments cannot be passed -set_board_info noargs 1 - -#File IO not supported -set_board_info gdb,nofileio 1 - -#Inferior is unable to do I/O -set_board_info gdb,noinferiorio 1 - -#Signals not supported -set_board_info gdb,nosignals 1 - -#Skip the huge.exp test -set_board_info gdb,skip_huge_test 1 - -#We use "target arcjtag" to talk to JTAG -set_board_info gdb_protocol "arcjtag" diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index cbfa253..edf52e0 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -191,7 +191,21 @@ proc delete_breakpoints {} { proc gdb_run_cmd {args} { global gdb_prompt - if [target_info exists gdb_init_command] { + + send_gdb "target sim\n" + gdb_expect 120 { + -re "Connected to the simulator.*$gdb_prompt $" { + verbose "Connected to simulator." 2 + } + } + + send_gdb "load\n" + gdb_expect 120 { + -re ".*$gdb_prompt $" { + } + } + + if [target_info exists gdb_init_command] { send_gdb "[target_info gdb_init_command]\n"; gdb_expect 30 { -re "$gdb_prompt $" { } diff --git a/gdb/testsuite/lib/gdbserver-support.exp b/gdb/testsuite/lib/gdbserver-support.exp index 73de76f..6fbaa22 100644 --- a/gdb/testsuite/lib/gdbserver-support.exp +++ b/gdb/testsuite/lib/gdbserver-support.exp @@ -250,10 +250,6 @@ proc gdbserver_start { options arguments } { proc gdbserver_spawn { child_args } { set target_exec [gdbserver_download] - if [target_info exists tests_dir] { - set tests_dir [target_info tests_dir] - set gdbserver_server_exec $tests_dir/$gdbserver_server_exec - } # Fire off the debug agent. This flavour of gdbserver takes as # arguments the port information, the name of the executable file to # be debugged, and any arguments. diff --git a/gdb/testsuite/lib/mi-support.exp b/gdb/testsuite/lib/mi-support.exp index a67b0cc..99cc80b 100644 --- a/gdb/testsuite/lib/mi-support.exp +++ b/gdb/testsuite/lib/mi-support.exp @@ -773,6 +773,19 @@ proc mi_run_cmd {args} { } global mi_gdb_prompt + send_gdb "target sim\n" + gdb_expect 120 { + -re "Connected to the simulator.*$gdb_prompt $" { + verbose "Connected to simulator." 2 + } + } + + send_gdb "load\n" + gdb_expect 120 { + -re ".*$gdb_prompt $" { + } + } + if [target_info exists gdb_init_command] { send_gdb "[target_info gdb_init_command]\n"; gdb_expect 30 { diff --git a/gdb/testsuite/lib/telnet-exec.exp b/gdb/testsuite/lib/telnet-exec.exp deleted file mode 100644 index 8bbaa8d..0000000 --- a/gdb/testsuite/lib/telnet-exec.exp +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/expect -f - -# -# -# - - -set host "192.168.100.222" -set debuggee [lindex $argv 0] - -set timeout 360 -set env(TERM) vt100; # actual value doesn't matter, just has to be set - -spawn telnet $host -sleep 1; # wait for telnet to happen -send "PS1=\\# \r" -expect "\# " -#expect "\[arcLinux\]\$" -#send_user "one\n" - - -send "cd /nfs/gdbserver-tests/ \r" -expect "\# " -#expect "\[arcLinux\]\$" -send_user "starting gdbserver...\n" -send "./gdbserver host:4004 /nfs/gdbserver-tests/ramana-tests/a-4004.out \r" - -expect "xxx" -send "exit" \ No newline at end of file diff --git a/gdb/version.in b/gdb/version.in index 99b56c2..21afad3 100644 --- a/gdb/version.in +++ b/gdb/version.in @@ -1 +1 @@ -6.8-arc-20070620 +6.8 diff --git a/include/dis-asm.h b/include/dis-asm.h index bfe95b1..adcfdf6 100644 --- a/include/dis-asm.h +++ b/include/dis-asm.h @@ -210,7 +210,6 @@ typedef struct disassemble_info typedef int (*disassembler_ftype) (bfd_vma, disassemble_info *); extern int print_insn_alpha (bfd_vma, disassemble_info *); -extern int print_insn_arc (bfd_vma, disassemble_info *); extern int print_insn_avr (bfd_vma, disassemble_info *); extern int print_insn_bfin (bfd_vma, disassemble_info *); extern int print_insn_big_arm (bfd_vma, disassemble_info *); @@ -284,7 +283,7 @@ extern int print_insn_z80 (bfd_vma, disassemble_info *); extern int print_insn_z8001 (bfd_vma, disassemble_info *); extern int print_insn_z8002 (bfd_vma, disassemble_info *); -extern disassembler_ftype arc_get_disassembler (bfd *); +extern disassembler_ftype arc_get_disassembler (void *); extern disassembler_ftype cris_get_disassembler (bfd *); extern void print_i386_disassembler_options (FILE *); diff --git a/include/elf/dwarf2.h b/include/elf/dwarf2.h index 14da6b3..371a038 100644 --- a/include/elf/dwarf2.h +++ b/include/elf/dwarf2.h @@ -757,9 +757,7 @@ enum dwarf_call_frame_info /* GNU extensions. */ DW_CFA_GNU_window_save = 0x2d, DW_CFA_GNU_args_size = 0x2e, - DW_CFA_GNU_negative_offset_extended = 0x2f, - /* Metaware High C compiler extensions. */ - DW_CFA_MWARC_info = 0x34 + DW_CFA_GNU_negative_offset_extended = 0x2f }; #define DW_CIE_ID 0xffffffff diff --git a/include/gdb/callback.h b/include/gdb/callback.h index edddc4a..5ae1d00 100644 --- a/include/gdb/callback.h +++ b/include/gdb/callback.h @@ -320,14 +320,6 @@ int cb_is_stdin PARAMS ((host_callback *, int)); int cb_is_stdout PARAMS ((host_callback *, int)); int cb_is_stderr PARAMS ((host_callback *, int)); -/* Utility of cb_syscall to fetch a path name. - The buffer is malloc'd and the address is stored in BUFP. - The result is that of get_string, but prepended with - simulator_sysroot if the string starts with '/'. - If an error occurs, no buffer is left malloc'd. */ -#define TADDR unsigned long -int get_path PARAMS ((host_callback *, CB_SYSCALL *, TADDR, char **)); - /* Perform a system call. */ CB_RC cb_syscall PARAMS ((host_callback *, CB_SYSCALL *)); diff --git a/include/opcode/arc.h b/include/opcode/arc.h index 184a081..3c3f5eb 100644 --- a/include/opcode/arc.h +++ b/include/opcode/arc.h @@ -174,8 +174,8 @@ struct arc_operand_value { struct arc_ext_operand_value { struct arc_ext_operand_value *next; - struct arc_operand_value operand; -}; + struct arc_operand_value operand; +} *arc_ext_operands; /* List of extension condition codes, core registers and auxiliary registers. Calls to gas/config/tc-arc.c:arc_extoper built up this list. */ @@ -357,14 +357,24 @@ struct arc_operand { const struct arc_operand_value **opval, int *invalid); }; -enum +enum { BR_exec_when_no_jump, BR_exec_always, BR_exec_when_jump }; +enum ARC_Debugger_OperandType +{ + ARC_UNDEFINED, + ARC_LIMM, + ARC_SHIMM, + ARC_REGISTER, + ARCOMPACT_REGISTER /* Valid only for the + registers allowed in + 16 bit mode */ +}; -enum Flow +enum Flow { noflow, direct_jump, @@ -377,7 +387,7 @@ enum Flow enum { no_reg = 99 }; enum { allOperandsSize = 256 }; -struct arcDisState +struct arcDisState { void *_this; int instructionLen; @@ -386,7 +396,7 @@ struct arcDisState const char *(*auxRegName)(void*, int); const char *(*condCodeName)(void*, int); const char *(*instName)(void*, int, int, int*); - + unsigned char* instruction; unsigned index; const char *comm[6]; /* instr name, cond, NOP, 3 operands */ @@ -462,8 +472,6 @@ extern const struct arc_operand arc_operands_a4[]; extern const struct arc_operand arc_operands_ac[]; extern const struct arc_operand *arc_operands; extern int arc_operand_count; -extern /*const*/ struct arc_opcode arc_opcodes[]; -extern const int arc_opcodes_count; extern const struct arc_operand_value arc_suffixes_a4[]; extern const struct arc_operand_value arc_suffixes_ac[]; extern const struct arc_operand_value *arc_suffixes; diff --git a/intl/aclocal.m4 b/intl/aclocal.m4 index 5dac235..06d78e3 100644 --- a/intl/aclocal.m4 +++ b/intl/aclocal.m4 @@ -1,7 +1,7 @@ -# generated automatically by aclocal 1.9.3 -*- Autoconf -*- +# generated automatically by aclocal 1.9.6 -*- Autoconf -*- -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 -# Free Software Foundation, Inc. +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, +# 2005 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. diff --git a/intl/configure b/intl/configure index 1a03102..aa20f13 100755 --- a/intl/configure +++ b/intl/configure @@ -1,25 +1,54 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.59. +# Generated by GNU Autoconf 2.61. # -# Copyright (C) 2003 Free Software Foundation, Inc. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## -# Be Bourne compatible +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' -elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then - set -o posix + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi + + + + +# PATH needs CR +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh fi -DUALCASE=1; export DUALCASE # for MKS sh # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then @@ -29,8 +58,43 @@ else fi +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +as_nl=' +' +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + { (exit 1); exit 1; } +fi + # Work around bugs in pre-3.0 UWIN ksh. -$as_unset ENV MAIL MAILPATH +for as_var in ENV MAIL MAILPATH +do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var +done PS1='$ ' PS2='> ' PS4='+ ' @@ -44,18 +108,19 @@ do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else - $as_unset $as_var + ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. -if expr a : '\(a\)' >/dev/null 2>&1; then +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi -if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false @@ -63,157 +128,388 @@ fi # Name of the executable. -as_me=`$as_basename "$0" || +as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)$' \| \ - . : '\(.\)' 2>/dev/null || + X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } - /^X\/\(\/\/\)$/{ s//\1/; q; } - /^X\/\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` +# CDPATH. +$as_unset CDPATH -# PATH needs CR, and LINENO needs CR and PATH. -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh +if test "x$CONFIG_SHELL" = x; then + if (eval ":") 2>/dev/null; then + as_have_required=yes +else + as_have_required=no fi + if test $as_have_required = yes && (eval ": +(as_func_return () { + (exit \$1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} - as_lineno_1=$LINENO - as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" || { - # Find who we are. Look in the path if we contain no path at all - # relative or not. - case $0 in - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break -done +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi - ;; - esac - # We did not find ourselves, most probably we were run as `sh COMMAND' - # in which case we are not to be found in the path. - if test "x$as_myself" = x; then - as_myself=$0 - fi - if test ! -f "$as_myself"; then - { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 - { (exit 1); exit 1; }; } - fi - case $CONFIG_SHELL in - '') +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = \"\$1\" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test \$exitcode = 0) || { (exit 1); exit 1; } + +( + as_lineno_1=\$LINENO + as_lineno_2=\$LINENO + test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && + test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } +") 2> /dev/null; then + : +else + as_candidate_shells= as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for as_base in sh bash ksh sh5; do - case $as_dir in + case $as_dir in /*) - if ("$as_dir/$as_base" -c ' + for as_base in sh bash ksh sh5; do + as_candidate_shells="$as_candidate_shells $as_dir/$as_base" + done;; + esac +done +IFS=$as_save_IFS + + + for as_shell in $as_candidate_shells $SHELL; do + # Try only shells that exist, to save several forks. + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { ("$as_shell") 2> /dev/null <<\_ASEOF +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi + + +: +_ASEOF +}; then + CONFIG_SHELL=$as_shell + as_have_required=yes + if { "$as_shell" 2> /dev/null <<\_ASEOF +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi + + +: +(as_func_return () { + (exit $1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} + +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi + +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = "$1" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test $exitcode = 0) || { (exit 1); exit 1; } + +( as_lineno_1=$LINENO as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then - $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } - $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } - CONFIG_SHELL=$as_dir/$as_base - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$0" ${1+"$@"} - fi;; - esac - done -done -;; - esac + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } + +_ASEOF +}; then + break +fi + +fi + + done + + if test "x$CONFIG_SHELL" != x; then + for as_var in BASH_ENV ENV + do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var + done + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} +fi + + + if test $as_have_required = no; then + echo This script requires a shell more modern than all the + echo shells that I found on your system. Please install a + echo modern shell, or manually run the script under such a + echo shell if you do have one. + { (exit 1); exit 1; } +fi + + +fi + +fi + + + +(eval "as_func_return () { + (exit \$1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} + +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi + +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = \"\$1\" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test \$exitcode = 0") || { + echo No shell found that supports shell functions. + echo Please tell autoconf@gnu.org about your system, + echo including any error possibly output before this + echo message +} + + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line before each line; the second 'sed' does the real - # work. The second script uses 'N' to pair each line-number line - # with the numbered line, and appends trailing '-' during - # substitution so that $LINENO is not a special case at line end. + # line-number line after each line using $LINENO; the second 'sed' + # does the real work. The second script uses 'N' to pair each + # line-number line with the line containing $LINENO, and appends + # trailing '-' during substitution so that $LINENO is not a special + # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) - sed '=' <$as_myself | + # scripts with optimization help from Paolo Bonzini. Blame Lee + # E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno N - s,$,-, - : loop - s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop - s,-$,, - s,^['$as_cr_digits']*\n,, + s/-\n.*// ' >$as_me.lineno && - chmod +x $as_me.lineno || + chmod +x "$as_me.lineno" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensible to this). - . ./$as_me.lineno + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" # Exit status is that of the last command. exit } -case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in - *c*,-n*) ECHO_N= ECHO_C=' -' ECHO_T=' ' ;; - *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; - *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in +-n*) + case `echo 'x\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + *) ECHO_C='\c';; + esac;; +*) + ECHO_N='-n';; esac -if expr a : '\(a\)' >/dev/null 2>&1; then +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir +fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then - # We could just check for DJGPP; but this test a) works b) is more generic - # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). - if test -f conf$$.exe; then - # Don't use ln at all; we don't have any links + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' - else - as_ln_s='ln -s' - fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi -rm -f conf$$ conf$$.exe conf$$.file +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p=: @@ -222,7 +518,28 @@ else as_mkdir_p=false fi -as_executable_p="test -f" +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' +else + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +fi +as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" @@ -231,39 +548,27 @@ as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" -# IFS -# We need space, tab and new line, in precisely that order. -as_nl=' -' -IFS=" $as_nl" - -# CDPATH. -$as_unset CDPATH +exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` -exec 6>&1 - # # Initializations. # ac_default_prefix=/usr/local +ac_clean_files= ac_config_libobj_dir=. +LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} -# Maximum number of lines to put in a shell here document. -# This variable seems obsolete. It should probably be removed, and -# only ac_max_sed_lines should be used. -: ${ac_max_here_lines=38} - # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= @@ -275,42 +580,141 @@ ac_unique_file="gettext.c" # Factoring default headers for most tests. ac_includes_default="\ #include -#if HAVE_SYS_TYPES_H +#ifdef HAVE_SYS_TYPES_H # include #endif -#if HAVE_SYS_STAT_H +#ifdef HAVE_SYS_STAT_H # include #endif -#if STDC_HEADERS +#ifdef STDC_HEADERS # include # include #else -# if HAVE_STDLIB_H +# ifdef HAVE_STDLIB_H # include # endif #endif -#if HAVE_STRING_H -# if !STDC_HEADERS && HAVE_MEMORY_H +#ifdef HAVE_STRING_H +# if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif -#if HAVE_STRINGS_H +#ifdef HAVE_STRINGS_H # include #endif -#if HAVE_INTTYPES_H +#ifdef HAVE_INTTYPES_H # include -#else -# if HAVE_STDINT_H -# include -# endif #endif -#if HAVE_UNISTD_H +#ifdef HAVE_STDINT_H +# include +#endif +#ifdef HAVE_UNISTD_H # include #endif" -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS SET_MAKE INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA MKINSTALLDIRS USE_NLS MSGFMT GMSGFMT XGETTEXT MSGMERGE CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT build build_cpu build_vendor build_os host host_cpu host_vendor host_os RANLIB ac_ct_RANLIB CPP EGREP ALLOCA GLIBC21 LIBICONV LTLIBICONV INTLBISON BUILD_INCLUDED_LIBINTL USE_INCLUDED_LIBINTL CATOBJEXT DATADIRNAME INSTOBJEXT GENCAT INTLOBJS INTL_LIBTOOL_SUFFIX_PREFIX INTLLIBS LIBINTL LTLIBINTL POSUB ACLOCAL AUTOCONF AUTOHEADER MAINT LIBINTL_DEP INCINTL LIBOBJS LTLIBOBJS' +ac_subst_vars='SHELL +PATH_SEPARATOR +PACKAGE_NAME +PACKAGE_TARNAME +PACKAGE_VERSION +PACKAGE_STRING +PACKAGE_BUGREPORT +exec_prefix +prefix +program_transform_name +bindir +sbindir +libexecdir +datarootdir +datadir +sysconfdir +sharedstatedir +localstatedir +includedir +oldincludedir +docdir +infodir +htmldir +dvidir +pdfdir +psdir +libdir +localedir +mandir +DEFS +ECHO_C +ECHO_N +ECHO_T +LIBS +build_alias +host_alias +target_alias +SET_MAKE +INSTALL_PROGRAM +INSTALL_SCRIPT +INSTALL_DATA +MKINSTALLDIRS +USE_NLS +MSGFMT +GMSGFMT +XGETTEXT +MSGMERGE +CC +CFLAGS +LDFLAGS +CPPFLAGS +ac_ct_CC +EXEEXT +OBJEXT +build +build_cpu +build_vendor +build_os +host +host_cpu +host_vendor +host_os +RANLIB +CPP +GREP +EGREP +ALLOCA +GLIBC21 +LIBICONV +LTLIBICONV +INTLBISON +BUILD_INCLUDED_LIBINTL +USE_INCLUDED_LIBINTL +CATOBJEXT +DATADIRNAME +INSTOBJEXT +GENCAT +INTLOBJS +INTL_LIBTOOL_SUFFIX_PREFIX +INTLLIBS +LIBINTL +LTLIBINTL +POSUB +ACLOCAL +AUTOCONF +AUTOHEADER +MAINT +LIBINTL_DEP +INCINTL +LIBOBJS +LTLIBOBJS' ac_subst_files='' + ac_precious_vars='build_alias +host_alias +target_alias +CC +CFLAGS +LDFLAGS +LIBS +CPPFLAGS +CPP' + # Initialize some variables set by options. ac_init_help= @@ -337,34 +741,48 @@ x_libraries=NONE # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. +# (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' -datadir='${prefix}/share' +datarootdir='${prefix}/share' +datadir='${datarootdir}' 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' +docdir='${datarootdir}/doc/${PACKAGE}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' ac_prev= +ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then - eval "$ac_prev=\$ac_option" + eval $ac_prev=\$ac_option ac_prev= continue fi - ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` + case $ac_option in + *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *) ac_optarg=yes ;; + esac # Accept the important Cygnus configure options, so we can diagnose typos. - case $ac_option in + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; @@ -386,33 +804,45 @@ do --config-cache | -C) cache_file=config.cache ;; - -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; - -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ - | --da=*) + -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + -disable-* | --disable-*) ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } - ac_feature=`echo $ac_feature | sed 's/-/_/g'` - eval "enable_$ac_feature=no" ;; + ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` + eval enable_$ac_feature=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } - ac_feature=`echo $ac_feature | sed 's/-/_/g'` - case $ac_option in - *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; - *) ac_optarg=yes ;; - esac - eval "enable_$ac_feature='$ac_optarg'" ;; + ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` + eval enable_$ac_feature=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ @@ -439,6 +869,12 @@ do -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$ac_optarg ;; + -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; @@ -463,13 +899,16 @@ do | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + -localstatedir | --localstatedir | --localstatedi | --localstated \ - | --localstate | --localstat | --localsta | --localst \ - | --locals | --local | --loca | --loc | --lo) + | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ - | --localstate=* | --localstat=* | --localsta=* | --localst=* \ - | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) @@ -534,6 +973,16 @@ do | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$ac_optarg ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; @@ -586,24 +1035,20 @@ do -with-* | --with-*) ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } - ac_package=`echo $ac_package| sed 's/-/_/g'` - case $ac_option in - *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; - *) ac_optarg=yes ;; - esac - eval "with_$ac_package='$ac_optarg'" ;; + ac_package=`echo $ac_package | sed 's/[-.]/_/g'` + eval with_$ac_package=\$ac_optarg ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } - ac_package=`echo $ac_package | sed 's/-/_/g'` - eval "with_$ac_package=no" ;; + ac_package=`echo $ac_package | sed 's/[-.]/_/g'` + eval with_$ac_package=no ;; --x) # Obsolete; use --with-x. @@ -634,8 +1079,7 @@ Try \`$0 --help' for more information." >&2 expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } - ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` - eval "$ac_envvar='$ac_optarg'" + eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) @@ -655,27 +1099,19 @@ if test -n "$ac_prev"; then { (exit 1); exit 1; }; } fi -# Be sure to have absolute paths. -for ac_var in exec_prefix prefix -do - eval ac_val=$`echo $ac_var` - case $ac_val in - [\\/$]* | ?:[\\/]* | NONE | '' ) ;; - *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 - { (exit 1); exit 1; }; };; - esac -done - -# Be sure to have absolute paths. -for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ - localstatedir libdir includedir oldincludedir infodir mandir +# Be sure to have absolute directory names. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir do - eval ac_val=$`echo $ac_var` + eval ac_val=\$$ac_var case $ac_val in - [\\/$]* | ?:[\\/]* ) ;; - *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 - { (exit 1); exit 1; }; };; + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac + { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; } done # There might be people who depend on the old broken behavior: `$host' @@ -702,74 +1138,76 @@ test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null -# 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_confdir=`(dirname "$0") 2>/dev/null || +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + { echo "$as_me: error: Working directory cannot be determined" >&2 + { (exit 1); exit 1; }; } +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + { echo "$as_me: error: pwd does not report name of working directory" >&2 + { (exit 1); exit 1; }; } + + +# 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 the parent directory. + ac_confdir=`$as_dirname -- "$0" || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || + X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X"$0" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` srcdir=$ac_confdir - if test ! -r $srcdir/$ac_unique_file; then + 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 "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 - { (exit 1); exit 1; }; } - else - { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 +if test ! -r "$srcdir/$ac_unique_file"; then + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } - fi fi -(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || - { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 { (exit 1); exit 1; }; } -srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` -ac_env_build_alias_set=${build_alias+set} -ac_env_build_alias_value=$build_alias -ac_cv_env_build_alias_set=${build_alias+set} -ac_cv_env_build_alias_value=$build_alias -ac_env_host_alias_set=${host_alias+set} -ac_env_host_alias_value=$host_alias -ac_cv_env_host_alias_set=${host_alias+set} -ac_cv_env_host_alias_value=$host_alias -ac_env_target_alias_set=${target_alias+set} -ac_env_target_alias_value=$target_alias -ac_cv_env_target_alias_set=${target_alias+set} -ac_cv_env_target_alias_value=$target_alias -ac_env_CC_set=${CC+set} -ac_env_CC_value=$CC -ac_cv_env_CC_set=${CC+set} -ac_cv_env_CC_value=$CC -ac_env_CFLAGS_set=${CFLAGS+set} -ac_env_CFLAGS_value=$CFLAGS -ac_cv_env_CFLAGS_set=${CFLAGS+set} -ac_cv_env_CFLAGS_value=$CFLAGS -ac_env_LDFLAGS_set=${LDFLAGS+set} -ac_env_LDFLAGS_value=$LDFLAGS -ac_cv_env_LDFLAGS_set=${LDFLAGS+set} -ac_cv_env_LDFLAGS_value=$LDFLAGS -ac_env_CPPFLAGS_set=${CPPFLAGS+set} -ac_env_CPPFLAGS_value=$CPPFLAGS -ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} -ac_cv_env_CPPFLAGS_value=$CPPFLAGS -ac_env_CPP_set=${CPP+set} -ac_env_CPP_value=$CPP -ac_cv_env_CPP_set=${CPP+set} -ac_cv_env_CPP_value=$CPP + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done # # Report the --help message. @@ -798,9 +1236,6 @@ Configuration: -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] -_ACEOF - - cat <<_ACEOF Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] @@ -818,15 +1253,22 @@ Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] - --datadir=DIR read-only architecture-independent data [PREFIX/share] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] - --infodir=DIR info documentation [PREFIX/info] - --mandir=DIR man documentation [PREFIX/man] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF @@ -863,126 +1305,95 @@ Some influential environment variables: CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory - CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have - headers in a nonstandard directory + LIBS libraries to pass to the linker, e.g. -l + CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I if + you have headers in a nonstandard directory CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. _ACEOF +ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. - ac_popdir=`pwd` for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue - test -d $ac_dir || continue + test -d "$ac_dir" || continue ac_builddir=. -if test "$ac_dir" != .; then +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A "../" for each directory in $ac_dir_suffix. - ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` -else - ac_dir_suffix= ac_top_builddir= -fi + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix case $srcdir in - .) # No --srcdir option. We are building in place. + .) # We are building in place. ac_srcdir=. - if test -z "$ac_top_builddir"; then - ac_top_srcdir=. - else - ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` - fi ;; - [\\/]* | ?:[\\/]* ) # Absolute path. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir ;; - *) # Relative path. - ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_builddir$srcdir ;; -esac - -# Do not use `cd foo && pwd` to compute absolute paths, because -# the directories may not exist. -case `pwd` in -.) ac_abs_builddir="$ac_dir";; -*) - case "$ac_dir" in - .) ac_abs_builddir=`pwd`;; - [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; - *) ac_abs_builddir=`pwd`/"$ac_dir";; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_builddir=${ac_top_builddir}.;; -*) - case ${ac_top_builddir}. in - .) ac_abs_top_builddir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; - *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_srcdir=$ac_srcdir;; -*) - case $ac_srcdir in - .) ac_abs_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; - *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_srcdir=$ac_top_srcdir;; -*) - case $ac_top_srcdir in - .) ac_abs_top_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; - *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; - esac;; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac - - cd $ac_dir - # Check for guested configure; otherwise get Cygnus style configure. - if test -f $ac_srcdir/configure.gnu; then - echo - $SHELL $ac_srcdir/configure.gnu --help=recursive - elif test -f $ac_srcdir/configure; then - echo - $SHELL $ac_srcdir/configure --help=recursive - elif test -f $ac_srcdir/configure.ac || - test -f $ac_srcdir/configure.in; then - echo - $ac_configure --help +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for guested configure. + if test -f "$ac_srcdir/configure.gnu"; then + echo && + $SHELL "$ac_srcdir/configure.gnu" --help=recursive + elif test -f "$ac_srcdir/configure"; then + echo && + $SHELL "$ac_srcdir/configure" --help=recursive else echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 - fi - cd $ac_popdir + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } done fi -test -n "$ac_init_help" && exit 0 +test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF +configure +generated by GNU Autoconf 2.61 -Copyright (C) 2003 Free Software Foundation, Inc. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF - exit 0 + exit fi -exec 5>config.log -cat >&5 <<_ACEOF +cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was -generated by GNU Autoconf 2.59. Invocation command line was +generated by GNU Autoconf 2.61. Invocation command line was $ $0 $@ _ACEOF +exec 5>>config.log { cat <<_ASUNAME ## --------- ## @@ -1001,7 +1412,7 @@ uname -v = `(uname -v) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` -hostinfo = `(hostinfo) 2>/dev/null || echo unknown` +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` @@ -1015,6 +1426,7 @@ do test -z "$as_dir" && as_dir=. echo "PATH: $as_dir" done +IFS=$as_save_IFS } >&5 @@ -1036,7 +1448,6 @@ _ACEOF ac_configure_args= ac_configure_args0= ac_configure_args1= -ac_sep= ac_must_keep_next=false for ac_pass in 1 2 do @@ -1047,7 +1458,7 @@ do -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) + *\'*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in @@ -1069,9 +1480,7 @@ do -* ) ac_must_keep_next=true ;; esac fi - ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" - # Get rid of the leading space. - ac_sep=" " + ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac done @@ -1082,8 +1491,8 @@ $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_ # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. -# WARNING: Be sure not to use single quotes in there, as some shells, -# such as our DU 5.0 friend, will then `close' the trap. +# WARNING: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { @@ -1096,20 +1505,34 @@ trap 'exit_status=$? _ASBOX echo # The following way of writing the cache mishandles newlines in values, -{ +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 +echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + *) $as_unset $ac_var ;; + esac ;; + esac + done (set) 2>&1 | - case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in - *ac_space=\ *) + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) sed -n \ - "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" - ;; + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( *) - sed -n \ - "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; - esac; -} + esac | + sort +) echo cat <<\_ASBOX @@ -1120,22 +1543,28 @@ _ASBOX echo for ac_var in $ac_subst_vars do - eval ac_val=$`echo $ac_var` - echo "$ac_var='"'"'$ac_val'"'"'" + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX -## ------------- ## -## Output files. ## -## ------------- ## +## ------------------- ## +## File substitutions. ## +## ------------------- ## _ASBOX echo for ac_var in $ac_subst_files do - eval ac_val=$`echo $ac_var` - echo "$ac_var='"'"'$ac_val'"'"'" + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + echo "$ac_var='\''$ac_val'\''" done | sort echo fi @@ -1147,26 +1576,24 @@ _ASBOX ## ----------- ## _ASBOX echo - sed "/^$/d" confdefs.h | sort + cat confdefs.h echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" echo "$as_me: exit $exit_status" } >&5 - rm -f core *.core && - rm -rf conftest* confdefs* conf$$* $ac_clean_files && + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status - ' 0 +' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal done ac_signal=0 # 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 +rm -f -r conftest* confdefs.h # Predefined preprocessor variables. @@ -1197,14 +1624,17 @@ _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. -if test -z "$CONFIG_SITE"; then - if test "x$prefix" != xNONE; then - CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" - else - CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" - fi +if test -n "$CONFIG_SITE"; then + set x "$CONFIG_SITE" +elif test "x$prefix" != xNONE; then + set x "$prefix/share/config.site" "$prefix/etc/config.site" +else + set x "$ac_default_prefix/share/config.site" \ + "$ac_default_prefix/etc/config.site" fi -for ac_site_file in $CONFIG_SITE; do +shift +for ac_site_file +do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} @@ -1220,8 +1650,8 @@ if test -r "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in - [\\/]* | ?:[\\/]* ) . $cache_file;; - *) . ./$cache_file;; + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; esac fi else @@ -1233,12 +1663,11 @@ fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false -for ac_var in `(set) 2>&1 | - sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do +for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set - eval ac_old_val="\$ac_cv_env_${ac_var}_value" - eval ac_new_val="\$ac_env_${ac_var}_value" + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 @@ -1263,8 +1692,7 @@ echo "$as_me: current value: $ac_new_val" >&2;} # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) - ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in @@ -1281,12 +1709,6 @@ echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start ov { (exit 1); exit 1; }; } fi -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - @@ -1303,76 +1725,78 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu - ac_config_headers="$ac_config_headers config.h" +ac_config_headers="$ac_config_headers config.h" -case ../config in - [\\/]* | ?:[\\/]* ) ac_macro_dir=../config ;; - *) ac_macro_dir=$srcdir/../config ;; -esac -if test -d "$ac_macro_dir"; then : -else - { { echo "$as_me:$LINENO: error: cannot find macro directory \`../config'" >&5 -echo "$as_me: error: cannot find macro directory \`../config'" >&2;} - { (exit 1); exit 1; }; } -fi -echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 -echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6 -set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'` -if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then +{ echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6; } +set x ${MAKE-make}; ac_make=`echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.make <<\_ACEOF +SHELL = /bin/sh all: - @echo 'ac_maketemp="$(MAKE)"' + @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. -eval `${MAKE-make} -f conftest.make 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 +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac rm -f conftest.make fi -if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } SET_MAKE= else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi ac_aux_dir= -for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do - if test -f $ac_dir/install-sh; then +for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; 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 + elif 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/shtool; then + elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then - { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5 -echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;} + { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5 +echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;} { (exit 1); exit 1; }; } fi -ac_config_guess="$SHELL $ac_aux_dir/config.guess" -ac_config_sub="$SHELL $ac_aux_dir/config.sub" -ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. +ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. +ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. + # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or @@ -1387,8 +1811,8 @@ ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. -echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 -echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 +echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; } if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -1410,7 +1834,7 @@ case $as_dir/ in # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then + if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. @@ -1429,21 +1853,22 @@ case $as_dir/ in ;; esac done +IFS=$as_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 + # As a last resort, use the slow shell script. Don't cache a + # value 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. + # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi -echo "$as_me:$LINENO: result: $INSTALL" >&5 -echo "${ECHO_T}$INSTALL" >&6 +{ echo "$as_me:$LINENO: result: $INSTALL" >&5 +echo "${ECHO_T}$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. @@ -1467,17 +1892,17 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' - echo "$as_me:$LINENO: checking whether NLS is requested" >&5 -echo $ECHO_N "checking whether NLS is requested... $ECHO_C" >&6 - # Check whether --enable-nls or --disable-nls was given. + { echo "$as_me:$LINENO: checking whether NLS is requested" >&5 +echo $ECHO_N "checking whether NLS is requested... $ECHO_C" >&6; } + # Check whether --enable-nls was given. if test "${enable_nls+set}" = set; then - enableval="$enable_nls" - USE_NLS=$enableval + enableval=$enable_nls; USE_NLS=$enableval else USE_NLS=yes -fi; - echo "$as_me:$LINENO: result: $USE_NLS" >&5 -echo "${ECHO_T}$USE_NLS" >&6 +fi + + { echo "$as_me:$LINENO: result: $USE_NLS" >&5 +echo "${ECHO_T}$USE_NLS" >&6; } @@ -1514,8 +1939,8 @@ rm -f conf$$.file # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_MSGFMT+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -1545,17 +1970,17 @@ esac fi MSGFMT="$ac_cv_path_MSGFMT" if test "$MSGFMT" != ":"; then - echo "$as_me:$LINENO: result: $MSGFMT" >&5 -echo "${ECHO_T}$MSGFMT" >&6 + { echo "$as_me:$LINENO: result: $MSGFMT" >&5 +echo "${ECHO_T}$MSGFMT" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_GMSGFMT+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -1570,30 +1995,31 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_GMSGFMT="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_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 "$as_me:$LINENO: result: $GMSGFMT" >&5 -echo "${ECHO_T}$GMSGFMT" >&6 + { echo "$as_me:$LINENO: result: $GMSGFMT" >&5 +echo "${ECHO_T}$GMSGFMT" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + # Prepare PATH_SEPARATOR. # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then @@ -1624,8 +2050,8 @@ rm -f conf$$.file # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_XGETTEXT+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -1655,11 +2081,11 @@ esac fi XGETTEXT="$ac_cv_path_XGETTEXT" if test "$XGETTEXT" != ":"; then - echo "$as_me:$LINENO: result: $XGETTEXT" >&5 -echo "${ECHO_T}$XGETTEXT" >&6 + { echo "$as_me:$LINENO: result: $XGETTEXT" >&5 +echo "${ECHO_T}$XGETTEXT" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi rm -f messages.po @@ -1695,8 +2121,8 @@ rm -f conf$$.file # Extract the first word of "msgmerge", so it can be a program name with args. set dummy msgmerge; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_MSGMERGE+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -1725,11 +2151,11 @@ esac fi MSGMERGE="$ac_cv_path_MSGMERGE" if test "$MSGMERGE" != ":"; then - echo "$as_me:$LINENO: result: $MSGMERGE" >&5 -echo "${ECHO_T}$MSGMERGE" >&6 + { echo "$as_me:$LINENO: result: $MSGMERGE" >&5 +echo "${ECHO_T}$MSGMERGE" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi @@ -1739,8 +2165,8 @@ fi : ; else GMSGFMT=`echo "$GMSGFMT" | sed -e 's,^.*/,,'` - echo "$as_me:$LINENO: result: found $GMSGFMT program is not GNU msgfmt; ignore it" >&5 -echo "${ECHO_T}found $GMSGFMT program is not GNU msgfmt; ignore it" >&6 + { echo "$as_me:$LINENO: result: found $GMSGFMT program is not GNU msgfmt; ignore it" >&5 +echo "${ECHO_T}found $GMSGFMT program is not GNU msgfmt; ignore it" >&6; } GMSGFMT=":" fi fi @@ -1750,14 +2176,14 @@ echo "${ECHO_T}found $GMSGFMT program is not GNU msgfmt; ignore it" >&6 (if $XGETTEXT --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then : ; else - echo "$as_me:$LINENO: result: found xgettext program is not GNU xgettext; ignore it" >&5 -echo "${ECHO_T}found xgettext program is not GNU xgettext; ignore it" >&6 + { echo "$as_me:$LINENO: result: found xgettext program is not GNU xgettext; ignore it" >&5 +echo "${ECHO_T}found xgettext program is not GNU xgettext; ignore it" >&6; } XGETTEXT=":" fi rm -f messages.po fi - ac_config_commands="$ac_config_commands default-1" + ac_config_commands="$ac_config_commands default-1" ac_ext=c @@ -1768,8 +2194,8 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -1782,32 +2208,34 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -1820,36 +2248,51 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6 + { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi - CC=$ac_ct_CC + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -1862,74 +2305,34 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - -fi -if test -z "$ac_cv_prog_CC"; then - ac_ct_CC=$CC - # Extract the first word of "cc", so it can be a program name with args. -set dummy cc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="cc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6 + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi - CC=$ac_ct_CC -else - CC="$ac_cv_prog_CC" -fi + fi 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 "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -1943,7 +2346,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue @@ -1954,6 +2357,7 @@ do fi done done +IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. @@ -1971,22 +2375,23 @@ fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then - for ac_prog in cl + for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -1999,36 +2404,38 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC - for ac_prog in cl + for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -2041,29 +2448,45 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6 + { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + test -n "$ac_ct_CC" && break done - CC=$ac_ct_CC + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi fi fi @@ -2076,21 +2499,35 @@ See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. -echo "$as_me:$LINENO:" \ - "checking for C compiler version" >&5 +echo "$as_me:$LINENO: checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` -{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 - (eval $ac_compiler --version &5) 2>&5 +{ (ac_try="$ac_compiler --version >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } -{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 - (eval $ac_compiler -v &5) 2>&5 +{ (ac_try="$ac_compiler -v >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } -{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 - (eval $ac_compiler -V &5) 2>&5 +{ (ac_try="$ac_compiler -V >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } @@ -2115,47 +2552,77 @@ ac_clean_files="$ac_clean_files a.out a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. -echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 -echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 +echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; } ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` -if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 - (eval $ac_link_default) 2>&5 +# +# List of possible output files, starting from the most likely. +# The algorithm is not robust to junk in `.', hence go to wildcards (a.*) +# only as a last resort. b.out is created by i960 compilers. +ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out' +# +# The IRIX 6 linker writes into existing files which may not be +# executable, retaining their permissions. Remove them first so a +# subsequent execution test works. +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { (ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link_default") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then - # Find the output, starting from the most likely. This scheme is -# not robust to junk in `.', hence go to wildcards (a.*) only as a last -# resort. - -# Be careful to initialize this variable, since it used to be cached. -# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. -ac_cv_exeext= -# b.out is created by i960 compilers. -for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out + # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. +# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' +# in a Makefile. We should not override ac_cv_exeext if it was cached, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) - ;; - conftest.$ac_ext ) - # This is the source file. + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) - ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - # FIXME: I believe we export ac_cv_exeext for Libtool, - # but it would be cool to find out if it's true. Does anybody - # maintain Libtool? --akim. - export ac_cv_exeext + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an `-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. break;; * ) break;; esac done +test "$ac_cv_exeext" = no && ac_cv_exeext= + else + ac_file='' +fi + +{ echo "$as_me:$LINENO: result: $ac_file" >&5 +echo "${ECHO_T}$ac_file" >&6; } +if test -z "$ac_file"; then echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -2167,19 +2634,21 @@ See \`config.log' for more details." >&2;} fi ac_exeext=$ac_cv_exeext -echo "$as_me:$LINENO: result: $ac_file" >&5 -echo "${ECHO_T}$ac_file" >&6 -# Check the compiler produces executables we can run. If not, either +# Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. -echo "$as_me:$LINENO: checking whether the C compiler works" >&5 -echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether the C compiler works" >&5 +echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; } # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -2198,22 +2667,27 @@ See \`config.log' for more details." >&2;} fi fi fi -echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 +{ echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save -# Check the compiler produces executables we can run. If not, either +# Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. -echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 -echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 -echo "$as_me:$LINENO: result: $cross_compiling" >&5 -echo "${ECHO_T}$cross_compiling" >&6 - -echo "$as_me:$LINENO: checking for suffix of executables" >&5 -echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +{ echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 +echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; } +{ echo "$as_me:$LINENO: result: $cross_compiling" >&5 +echo "${ECHO_T}$cross_compiling" >&6; } + +{ echo "$as_me:$LINENO: checking for suffix of executables" >&5 +echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; } +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then @@ -2224,9 +2698,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - export ac_cv_exeext break;; * ) break;; esac @@ -2240,14 +2713,14 @@ See \`config.log' for more details." >&2;} fi rm -f conftest$ac_cv_exeext -echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 -echo "${ECHO_T}$ac_cv_exeext" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 +echo "${ECHO_T}$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT -echo "$as_me:$LINENO: checking for suffix of object files" >&5 -echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for suffix of object files" >&5 +echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; } if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -2267,14 +2740,20 @@ main () } _ACEOF rm -f conftest.o conftest.obj -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then - for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac @@ -2292,12 +2771,12 @@ fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 -echo "${ECHO_T}$ac_cv_objext" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 +echo "${ECHO_T}$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT -echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 -echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -2320,50 +2799,49 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_compiler_gnu=no + ac_compiler_gnu=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi -echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 -echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS -CFLAGS="-g" -echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 -echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 +echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -2379,38 +2857,118 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_prog_cc_g=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + CFLAGS="" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_prog_cc_g=no + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag fi -echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then @@ -2426,12 +2984,12 @@ else CFLAGS= fi fi -echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 -echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 -if test "${ac_cv_prog_cc_stdc+set}" = set; then +{ echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 +echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } +if test "${ac_cv_prog_cc_c89+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_cv_prog_cc_stdc=no + ac_cv_prog_cc_c89=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -2465,12 +3023,17 @@ static char *f (char * (*g) (char **, int), char **p, ...) /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated - as 'x'. The following induces an error, until -std1 is added to get + as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something - that's true only with -std1. */ + that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; @@ -2485,205 +3048,57 @@ return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; return 0; } _ACEOF -# Don't try gcc -ansi; that turns off useful extensions and -# breaks some systems' header files. -# AIX -qlanglvl=ansi -# Ultrix and OSF/1 -std1 -# HP-UX 10.20 and later -Ae -# HP-UX older versions -Aa -D_HPUX_SOURCE -# SVR4 -Xc -D__EXTENSIONS__ -for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_prog_cc_stdc=$ac_arg -break + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_prog_cc_c89=$ac_arg else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest.err conftest.$ac_objext + +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break done -rm -f conftest.$ac_ext conftest.$ac_objext +rm -f conftest.$ac_ext CC=$ac_save_CC fi - -case "x$ac_cv_prog_cc_stdc" in - x|xno) - echo "$as_me:$LINENO: result: none needed" >&5 -echo "${ECHO_T}none needed" >&6 ;; +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { echo "$as_me:$LINENO: result: none needed" >&5 +echo "${ECHO_T}none needed" >&6; } ;; + xno) + { echo "$as_me:$LINENO: result: unsupported" >&5 +echo "${ECHO_T}unsupported" >&6; } ;; *) - echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 - CC="$CC $ac_cv_prog_cc_stdc" ;; + CC="$CC $ac_cv_prog_cc_c89" + { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; esac -# Some people use a C++ compiler to compile C. Since we use `exit', -# in C++ we need to declare it. In case someone uses the same compiler -# for both compiling C and C++ we need to have the C++ compiler decide -# the declaration of exit, since it's the most demanding environment. -cat >conftest.$ac_ext <<_ACEOF -#ifndef __cplusplus - choke me -#endif -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - for ac_declaration in \ - '' \ - 'extern "C" void std::exit (int) throw (); using std::exit;' \ - 'extern "C" void std::exit (int); using std::exit;' \ - 'extern "C" void exit (int) throw ();' \ - 'extern "C" void exit (int);' \ - 'void exit (int);' -do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_declaration -#include -int -main () -{ -exit (42); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -continue -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_declaration -int -main () -{ -exit (42); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -done -rm -f conftest* -if test -n "$ac_declaration"; then - echo '#ifdef __cplusplus' >>confdefs.h - echo $ac_declaration >>confdefs.h - echo '#endif' >>confdefs.h -fi - -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -2691,64 +3106,93 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu # Make sure we can run config.sub. -$ac_config_sub sun4 >/dev/null 2>&1 || - { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5 -echo "$as_me: error: cannot run $ac_config_sub" >&2;} +$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || + { { echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5 +echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;} { (exit 1); exit 1; }; } -echo "$as_me:$LINENO: checking build system type" >&5 -echo $ECHO_N "checking build system type... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking build system type" >&5 +echo $ECHO_N "checking build system type... $ECHO_C" >&6; } if test "${ac_cv_build+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_cv_build_alias=$build_alias -test -z "$ac_cv_build_alias" && - ac_cv_build_alias=`$ac_config_guess` -test -z "$ac_cv_build_alias" && + ac_build_alias=$build_alias +test "x$ac_build_alias" = x && + ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` +test "x$ac_build_alias" = x && { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 echo "$as_me: error: cannot guess build type; you must specify one" >&2;} { (exit 1); exit 1; }; } -ac_cv_build=`$ac_config_sub $ac_cv_build_alias` || - { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5 -echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;} +ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || + { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5 +echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;} { (exit 1); exit 1; }; } fi -echo "$as_me:$LINENO: result: $ac_cv_build" >&5 -echo "${ECHO_T}$ac_cv_build" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_build" >&5 +echo "${ECHO_T}$ac_cv_build" >&6; } +case $ac_cv_build in +*-*-*) ;; +*) { { echo "$as_me:$LINENO: error: invalid value of canonical build" >&5 +echo "$as_me: error: invalid value of canonical build" >&2;} + { (exit 1); exit 1; }; };; +esac build=$ac_cv_build -build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` - - -echo "$as_me:$LINENO: checking host system type" >&5 -echo $ECHO_N "checking host system type... $ECHO_C" >&6 +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_build +shift +build_cpu=$1 +build_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +build_os=$* +IFS=$ac_save_IFS +case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac + + +{ echo "$as_me:$LINENO: checking host system type" >&5 +echo $ECHO_N "checking host system type... $ECHO_C" >&6; } if test "${ac_cv_host+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_cv_host_alias=$host_alias -test -z "$ac_cv_host_alias" && - ac_cv_host_alias=$ac_cv_build_alias -ac_cv_host=`$ac_config_sub $ac_cv_host_alias` || - { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5 -echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;} + if test "x$host_alias" = x; then + ac_cv_host=$ac_cv_build +else + ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || + { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5 +echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;} { (exit 1); exit 1; }; } +fi fi -echo "$as_me:$LINENO: result: $ac_cv_host" >&5 -echo "${ECHO_T}$ac_cv_host" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_host" >&5 +echo "${ECHO_T}$ac_cv_host" >&6; } +case $ac_cv_host in +*-*-*) ;; +*) { { echo "$as_me:$LINENO: error: invalid value of canonical host" >&5 +echo "$as_me: error: invalid value of canonical host" >&2;} + { (exit 1); exit 1; }; };; +esac host=$ac_cv_host -host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_host +shift +host_cpu=$1 +host_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +host_os=$* +IFS=$ac_save_IFS +case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -2761,32 +3205,34 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then - echo "$as_me:$LINENO: result: $RANLIB" >&5 -echo "${ECHO_T}$RANLIB" >&6 + { echo "$as_me:$LINENO: result: $RANLIB" >&5 +echo "${ECHO_T}$RANLIB" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -2799,39 +3245,52 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_RANLIB="ranlib" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS - test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":" fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then - echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 -echo "${ECHO_T}$ac_ct_RANLIB" >&6 + { echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 +echo "${ECHO_T}$ac_ct_RANLIB" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi - RANLIB=$ac_ct_RANLIB + if test "x$ac_ct_RANLIB" = x; then + RANLIB=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + RANLIB=$ac_ct_RANLIB + fi else RANLIB="$ac_cv_prog_RANLIB" fi -echo "$as_me:$LINENO: checking for library containing strerror" >&5 -echo $ECHO_N "checking for library containing strerror... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for library containing strerror" >&5 +echo $ECHO_N "checking for library containing strerror... $ECHO_C" >&6; } if test "${ac_cv_search_strerror+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_func_search_save_LIBS=$LIBS -ac_cv_search_strerror=no cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -2839,115 +3298,73 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char strerror (); int main () { -strerror (); +return strerror (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +for ac_lib in '' cposix; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_search_strerror="none required" + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_search_strerror=$ac_res else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -if test "$ac_cv_search_strerror" = no; then - for ac_lib in cposix; do - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char strerror (); -int -main () -{ -strerror (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_search_strerror="-l$ac_lib" -break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +fi +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext + if test "${ac_cv_search_strerror+set}" = set; then + break fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - done +done +if test "${ac_cv_search_strerror+set}" = set; then + : +else + ac_cv_search_strerror=no fi +rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_search_strerror" >&5 -echo "${ECHO_T}$ac_cv_search_strerror" >&6 -if test "$ac_cv_search_strerror" != no; then - test "$ac_cv_search_strerror" = "none required" || LIBS="$ac_cv_search_strerror $LIBS" +{ echo "$as_me:$LINENO: result: $ac_cv_search_strerror" >&5 +echo "${ECHO_T}$ac_cv_search_strerror" >&6; } +ac_res=$ac_cv_search_strerror +if test "$ac_res" != no; then + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi @@ -2956,8 +3373,8 @@ ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 -echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 +echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -2991,24 +3408,22 @@ cat >>conftest.$ac_ext <<_ACEOF #endif Syntax error _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then : else echo "$as_me: failed program was:" >&5 @@ -3017,9 +3432,10 @@ sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi + rm -f conftest.err conftest.$ac_ext - # OK, works on sane cases. Now check whether non-existent headers + # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -3029,24 +3445,22 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then # Broken: success on invalid input. continue else @@ -3057,6 +3471,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_preproc_ok=: break fi + rm -f conftest.err conftest.$ac_ext done @@ -3074,8 +3489,8 @@ fi else ac_cv_prog_CPP=$CPP fi -echo "$as_me:$LINENO: result: $CPP" >&5 -echo "${ECHO_T}$CPP" >&6 +{ echo "$as_me:$LINENO: result: $CPP" >&5 +echo "${ECHO_T}$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do @@ -3098,24 +3513,22 @@ cat >>conftest.$ac_ext <<_ACEOF #endif Syntax error _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then : else echo "$as_me: failed program was:" >&5 @@ -3124,9 +3537,10 @@ sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi + rm -f conftest.err conftest.$ac_ext - # OK, works on sane cases. Now check whether non-existent headers + # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -3136,24 +3550,22 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then # Broken: success on invalid input. continue else @@ -3164,6 +3576,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_preproc_ok=: break fi + rm -f conftest.err conftest.$ac_ext done @@ -3186,23 +3599,170 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu -echo "$as_me:$LINENO: checking for egrep" >&5 -echo $ECHO_N "checking for egrep... $ECHO_C" >&6 -if test "${ac_cv_prog_egrep+set}" = set; then +{ echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 +echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; } +if test "${ac_cv_path_GREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # Extract the first word of "grep ggrep" to use in msg output +if test -z "$GREP"; then +set dummy grep ggrep; ac_prog_name=$2 +if test "${ac_cv_path_GREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_path_GREP_found=false +# Loop through the user's path and test for each of PROGNAME-LIST +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in grep ggrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue + # Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + echo 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + ac_count=`expr $ac_count + 1` + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + + $ac_path_GREP_found && break 3 + done +done + +done +IFS=$as_save_IFS + + +fi + +GREP="$ac_cv_path_GREP" +if test -z "$GREP"; then + { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} + { (exit 1); exit 1; }; } +fi + +else + ac_cv_path_GREP=$GREP +fi + + +fi +{ echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 +echo "${ECHO_T}$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ echo "$as_me:$LINENO: checking for egrep" >&5 +echo $ECHO_N "checking for egrep... $ECHO_C" >&6; } +if test "${ac_cv_path_EGREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + # Extract the first word of "egrep" to use in msg output +if test -z "$EGREP"; then +set dummy egrep; ac_prog_name=$2 +if test "${ac_cv_path_EGREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if echo a | (grep -E '(a|b)') >/dev/null 2>&1 - then ac_cv_prog_egrep='grep -E' - else ac_cv_prog_egrep='egrep' + ac_path_EGREP_found=false +# Loop through the user's path and test for each of PROGNAME-LIST +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue + # Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + echo 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + ac_count=`expr $ac_count + 1` + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + + $ac_path_EGREP_found && break 3 + done +done + +done +IFS=$as_save_IFS + + +fi + +EGREP="$ac_cv_path_EGREP" +if test -z "$EGREP"; then + { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} + { (exit 1); exit 1; }; } +fi + +else + ac_cv_path_EGREP=$EGREP +fi + + + fi fi -echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 -echo "${ECHO_T}$ac_cv_prog_egrep" >&6 - EGREP=$ac_cv_prog_egrep +{ echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 +echo "${ECHO_T}$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" -echo "$as_me:$LINENO: checking for ANSI C header files" >&5 -echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5 +echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; } if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -3226,35 +3786,31 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_header_stdc=no + ac_cv_header_stdc=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. @@ -3310,6 +3866,7 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include +#include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) @@ -3329,18 +3886,27 @@ main () for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) - exit(2); - exit (0); + return 2; + return 0; } _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -3353,12 +3919,14 @@ sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi + + fi fi -echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 -echo "${ECHO_T}$ac_cv_header_stdc" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 +echo "${ECHO_T}$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF @@ -3367,8 +3935,8 @@ _ACEOF fi -echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 -echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 +echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6; } if test "${ac_cv_c_const+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -3386,10 +3954,10 @@ main () #ifndef __cplusplus /* Ultrix mips cc rejects this. */ typedef int charset[2]; - const charset x; + const charset cs; /* SunOS 4.1.1 cc rejects this. */ - char const *const *ccp; - char **p; + char const *const *pcpcc; + char **ppc; /* NEC SVR4.0.2 mips cc rejects this. */ struct point {int x, y;}; static struct point const zero = {0,0}; @@ -3398,16 +3966,17 @@ main () an arm of an if-expression whose if-part is not a constant expression */ const char *g = "string"; - ccp = &g + (g ? g-g : 0); + pcpcc = &g + (g ? g-g : 0); /* HPUX 7.0 cc rejects these. */ - ++ccp; - p = (char**) ccp; - ccp = (char const *const *) p; + ++pcpcc; + ppc = (char**) pcpcc; + pcpcc = (char const *const *) ppc; { /* SCO 3.2v4 cc rejects this. */ char *t; char const *s = 0 ? (char *) 0 : (char const *) 0; *t++ = 0; + if (s) return 0; } { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ int x[] = {25, 17}; @@ -3426,7 +3995,9 @@ main () } { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ const int foo = 10; + if (!foo) return 0; } + return !cs[0] && !zero.x; #endif ; @@ -3434,38 +4005,34 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_c_const=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_c_const=no + ac_cv_c_const=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5 -echo "${ECHO_T}$ac_cv_c_const" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5 +echo "${ECHO_T}$ac_cv_c_const" >&6; } if test $ac_cv_c_const = no; then cat >>confdefs.h <<\_ACEOF @@ -3474,8 +4041,8 @@ _ACEOF fi -echo "$as_me:$LINENO: checking for inline" >&5 -echo $ECHO_N "checking for inline... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for inline" >&5 +echo $ECHO_N "checking for inline... $ECHO_C" >&6; } if test "${ac_cv_c_inline+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -3495,39 +4062,37 @@ $ac_kw foo_t foo () {return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_c_inline=$ac_kw; break + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_c_inline=$ac_kw else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + test "$ac_cv_c_inline" != no && break done fi -echo "$as_me:$LINENO: result: $ac_cv_c_inline" >&5 -echo "${ECHO_T}$ac_cv_c_inline" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_c_inline" >&5 +echo "${ECHO_T}$ac_cv_c_inline" >&6; } case $ac_cv_c_inline in @@ -3559,9 +4124,9 @@ for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -3575,38 +4140,35 @@ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_Header=no" + eval "$as_ac_Header=no" fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 @@ -3617,8 +4179,8 @@ fi done -echo "$as_me:$LINENO: checking for off_t" >&5 -echo $ECHO_N "checking for off_t... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for off_t" >&5 +echo $ECHO_N "checking for off_t... $ECHO_C" >&6; } if test "${ac_cv_type_off_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -3629,62 +4191,59 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default +typedef off_t ac__type_new_; int main () { -if ((off_t *) 0) +if ((ac__type_new_ *) 0) return 0; -if (sizeof (off_t)) +if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_type_off_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_type_off_t=no + ac_cv_type_off_t=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_type_off_t" >&5 -echo "${ECHO_T}$ac_cv_type_off_t" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_type_off_t" >&5 +echo "${ECHO_T}$ac_cv_type_off_t" >&6; } if test $ac_cv_type_off_t = yes; then : else cat >>confdefs.h <<_ACEOF -#define off_t long +#define off_t long int _ACEOF fi -echo "$as_me:$LINENO: checking for size_t" >&5 -echo $ECHO_N "checking for size_t... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for size_t" >&5 +echo $ECHO_N "checking for size_t... $ECHO_C" >&6; } if test "${ac_cv_type_size_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -3695,64 +4254,61 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default +typedef size_t ac__type_new_; int main () { -if ((size_t *) 0) +if ((ac__type_new_ *) 0) return 0; -if (sizeof (size_t)) +if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_type_size_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_type_size_t=no + ac_cv_type_size_t=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 -echo "${ECHO_T}$ac_cv_type_size_t" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 +echo "${ECHO_T}$ac_cv_type_size_t" >&6; } if test $ac_cv_type_size_t = yes; then : else cat >>confdefs.h <<_ACEOF -#define size_t unsigned +#define size_t unsigned int _ACEOF fi # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! -echo "$as_me:$LINENO: checking for working alloca.h" >&5 -echo $ECHO_N "checking for working alloca.h... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for working alloca.h" >&5 +echo $ECHO_N "checking for working alloca.h... $ECHO_C" >&6; } if test "${ac_cv_working_alloca_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -3767,44 +4323,42 @@ int main () { char *p = (char *) alloca (2 * sizeof (int)); + if (p) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_working_alloca_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_working_alloca_h=no + ac_cv_working_alloca_h=no fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_working_alloca_h" >&5 -echo "${ECHO_T}$ac_cv_working_alloca_h" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_working_alloca_h" >&5 +echo "${ECHO_T}$ac_cv_working_alloca_h" >&6; } if test $ac_cv_working_alloca_h = yes; then cat >>confdefs.h <<\_ACEOF @@ -3813,8 +4367,8 @@ _ACEOF fi -echo "$as_me:$LINENO: checking for alloca" >&5 -echo $ECHO_N "checking for alloca... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for alloca" >&5 +echo $ECHO_N "checking for alloca... $ECHO_C" >&6; } if test "${ac_cv_func_alloca_works+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -3831,7 +4385,7 @@ cat >>conftest.$ac_ext <<_ACEOF # include # define alloca _alloca # else -# if HAVE_ALLOCA_H +# ifdef HAVE_ALLOCA_H # include # else # ifdef _AIX @@ -3849,44 +4403,42 @@ int main () { char *p = (char *) alloca (1); + if (p) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_func_alloca_works=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_func_alloca_works=no + ac_cv_func_alloca_works=no fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_func_alloca_works" >&5 -echo "${ECHO_T}$ac_cv_func_alloca_works" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_func_alloca_works" >&5 +echo "${ECHO_T}$ac_cv_func_alloca_works" >&6; } if test $ac_cv_func_alloca_works = yes; then @@ -3900,15 +4452,15 @@ else # 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 +ALLOCA=\${LIBOBJDIR}alloca.$ac_objext cat >>confdefs.h <<\_ACEOF #define C_ALLOCA 1 _ACEOF -echo "$as_me:$LINENO: checking whether \`alloca.c' needs Cray hooks" >&5 -echo $ECHO_N "checking whether \`alloca.c' needs Cray hooks... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether \`alloca.c' needs Cray hooks" >&5 +echo $ECHO_N "checking whether \`alloca.c' needs Cray hooks... $ECHO_C" >&6; } if test "${ac_cv_os_cray+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -3918,7 +4470,7 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#if defined(CRAY) && ! defined(CRAY2) +#if defined CRAY && ! defined CRAY2 webecray #else wenotbecray @@ -3934,14 +4486,14 @@ fi rm -f conftest* fi -echo "$as_me:$LINENO: result: $ac_cv_os_cray" >&5 -echo "${ECHO_T}$ac_cv_os_cray" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_os_cray" >&5 +echo "${ECHO_T}$ac_cv_os_cray" >&6; } if test $ac_cv_os_cray = yes; then for ac_func in _getb67 GETB67 getb67; do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -3967,68 +4519,60 @@ cat >>conftest.$ac_ext <<_ACEOF #undef $ac_func -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" -{ #endif -/* 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 (); /* 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) +#if defined __stub_$ac_func || defined __stub___$ac_func choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} #endif int main () { -return f != $ac_func; +return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" + eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF @@ -4041,8 +4585,8 @@ fi done fi -echo "$as_me:$LINENO: checking stack direction for C alloca" >&5 -echo $ECHO_N "checking stack direction for C alloca... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking stack direction for C alloca" >&5 +echo $ECHO_N "checking stack direction for C alloca... $ECHO_C" >&6; } if test "${ac_cv_c_stack_direction+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -4055,6 +4599,7 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ +$ac_includes_default int find_stack_direction () { @@ -4072,17 +4617,26 @@ find_stack_direction () int main () { - exit (find_stack_direction () < 0); + return find_stack_direction () < 0; } _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -4095,11 +4649,13 @@ sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_c_stack_direction=-1 fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi + + fi -echo "$as_me:$LINENO: result: $ac_cv_c_stack_direction" >&5 -echo "${ECHO_T}$ac_cv_c_stack_direction" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_c_stack_direction" >&5 +echo "${ECHO_T}$ac_cv_c_stack_direction" >&6; } cat >>confdefs.h <<_ACEOF #define STACK_DIRECTION $ac_cv_c_stack_direction @@ -4113,18 +4669,19 @@ fi for ac_header in stdlib.h unistd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? -echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -4135,41 +4692,37 @@ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_header_compiler=no + ac_header_compiler=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -4178,24 +4731,22 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 @@ -4203,9 +4754,10 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi + rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in @@ -4229,25 +4781,19 @@ echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\ echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------------ ## -## Report this to the AC_PACKAGE_NAME lists. ## -## ------------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 + ;; esac -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then @@ -4263,9 +4809,9 @@ done for ac_func in getpagesize do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -4291,68 +4837,60 @@ cat >>conftest.$ac_ext <<_ACEOF #undef $ac_func -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" -{ #endif -/* 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 (); /* 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) +#if defined __stub_$ac_func || defined __stub___$ac_func choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} #endif int main () { -return f != $ac_func; +return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" + eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 @@ -4361,8 +4899,8 @@ _ACEOF fi done -echo "$as_me:$LINENO: checking for working mmap" >&5 -echo $ECHO_N "checking for working mmap... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for working mmap" >&5 +echo $ECHO_N "checking for working mmap... $ECHO_C" >&6; } if test "${ac_cv_func_mmap_fixed_mapped+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -4404,21 +4942,21 @@ $ac_includes_default #include #include -#if !STDC_HEADERS && !HAVE_STDLIB_H +#if !defined STDC_HEADERS && !defined HAVE_STDLIB_H char *malloc (); #endif /* This mess was copied from the GNU getpagesize.h. */ -#if !HAVE_GETPAGESIZE +#ifndef HAVE_GETPAGESIZE /* Assume that all systems that can run configure have sys/param.h. */ -# if !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 */ -# if HAVE_SYS_PARAM_H +# ifdef HAVE_SYS_PARAM_H # include # ifdef EXEC_PAGESIZE # define getpagesize() EXEC_PAGESIZE @@ -4457,15 +4995,15 @@ main () /* First, make a file with some known garbage in it. */ data = (char *) malloc (pagesize); if (!data) - exit (1); + return 1; for (i = 0; i < pagesize; ++i) *(data + i) = rand (); umask (0); fd = creat ("conftest.mmap", 0600); if (fd < 0) - exit (1); + return 1; if (write (fd, data, pagesize) != pagesize) - exit (1); + return 1; close (fd); /* Next, try to mmap the file at a fixed address which already has @@ -4473,17 +5011,17 @@ main () we see the same garbage. */ fd = open ("conftest.mmap", O_RDWR); if (fd < 0) - exit (1); + return 1; data2 = (char *) malloc (2 * pagesize); if (!data2) - exit (1); - data2 += (pagesize - ((long) data2 & (pagesize - 1))) & (pagesize - 1); + return 1; + data2 += (pagesize - ((long int) data2 & (pagesize - 1))) & (pagesize - 1); if (data2 != mmap (data2, pagesize, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_FIXED, fd, 0L)) - exit (1); + return 1; for (i = 0; i < pagesize; ++i) if (*(data + i) != *(data2 + i)) - exit (1); + return 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 @@ -4492,24 +5030,33 @@ main () *(data2 + i) = *(data2 + i) + 1; data3 = (char *) malloc (pagesize); if (!data3) - exit (1); + return 1; if (read (fd, data3, pagesize) != pagesize) - exit (1); + return 1; for (i = 0; i < pagesize; ++i) if (*(data + i) != *(data3 + i)) - exit (1); + return 1; close (fd); - exit (0); + return 0; } _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -4522,11 +5069,13 @@ sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_func_mmap_fixed_mapped=no fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi + + fi -echo "$as_me:$LINENO: result: $ac_cv_func_mmap_fixed_mapped" >&5 -echo "${ECHO_T}$ac_cv_func_mmap_fixed_mapped" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_func_mmap_fixed_mapped" >&5 +echo "${ECHO_T}$ac_cv_func_mmap_fixed_mapped" >&6; } if test $ac_cv_func_mmap_fixed_mapped = yes; then cat >>confdefs.h <<\_ACEOF @@ -4537,8 +5086,8 @@ fi rm -f conftest.mmap - echo "$as_me:$LINENO: checking whether we are using the GNU C Library 2.1 or newer" >&5 -echo $ECHO_N "checking whether we are using the GNU C Library 2.1 or newer... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking whether we are using the GNU C Library 2.1 or newer" >&5 +echo $ECHO_N "checking whether we are using the GNU C Library 2.1 or newer... $ECHO_C" >&6; } if test "${ac_cv_gnu_library_2_1+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -4568,16 +5117,16 @@ rm -f conftest* fi -echo "$as_me:$LINENO: result: $ac_cv_gnu_library_2_1" >&5 -echo "${ECHO_T}$ac_cv_gnu_library_2_1" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_gnu_library_2_1" >&5 +echo "${ECHO_T}$ac_cv_gnu_library_2_1" >&6; } GLIBC21="$ac_cv_gnu_library_2_1" - echo "$as_me:$LINENO: checking whether integer division by zero raises SIGFPE" >&5 -echo $ECHO_N "checking whether integer division by zero raises SIGFPE... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking whether integer division by zero raises SIGFPE" >&5 +echo $ECHO_N "checking whether integer division by zero raises SIGFPE... $ECHO_C" >&6; } if test "${gt_cv_int_divbyzero_sigfpe+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -4638,13 +5187,22 @@ int main () _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -4657,12 +5215,14 @@ sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) gt_cv_int_divbyzero_sigfpe=no fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi + + fi -echo "$as_me:$LINENO: result: $gt_cv_int_divbyzero_sigfpe" >&5 -echo "${ECHO_T}$gt_cv_int_divbyzero_sigfpe" >&6 +{ echo "$as_me:$LINENO: result: $gt_cv_int_divbyzero_sigfpe" >&5 +echo "${ECHO_T}$gt_cv_int_divbyzero_sigfpe" >&6; } case "$gt_cv_int_divbyzero_sigfpe" in *yes) value=1;; *) value=0;; @@ -4674,8 +5234,8 @@ _ACEOF - echo "$as_me:$LINENO: checking for inttypes.h" >&5 -echo $ECHO_N "checking for inttypes.h... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for inttypes.h" >&5 +echo $ECHO_N "checking for inttypes.h... $ECHO_C" >&6; } if test "${jm_ac_cv_header_inttypes_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -4696,38 +5256,34 @@ uintmax_t i = (uintmax_t) -1; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then jm_ac_cv_header_inttypes_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -jm_ac_cv_header_inttypes_h=no + jm_ac_cv_header_inttypes_h=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $jm_ac_cv_header_inttypes_h" >&5 -echo "${ECHO_T}$jm_ac_cv_header_inttypes_h" >&6 +{ echo "$as_me:$LINENO: result: $jm_ac_cv_header_inttypes_h" >&5 +echo "${ECHO_T}$jm_ac_cv_header_inttypes_h" >&6; } if test $jm_ac_cv_header_inttypes_h = yes; then cat >>confdefs.h <<_ACEOF @@ -4737,8 +5293,8 @@ _ACEOF fi - echo "$as_me:$LINENO: checking for stdint.h" >&5 -echo $ECHO_N "checking for stdint.h... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for stdint.h" >&5 +echo $ECHO_N "checking for stdint.h... $ECHO_C" >&6; } if test "${jm_ac_cv_header_stdint_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -4759,38 +5315,34 @@ uintmax_t i = (uintmax_t) -1; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then jm_ac_cv_header_stdint_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -jm_ac_cv_header_stdint_h=no + jm_ac_cv_header_stdint_h=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $jm_ac_cv_header_stdint_h" >&5 -echo "${ECHO_T}$jm_ac_cv_header_stdint_h" >&6 +{ echo "$as_me:$LINENO: result: $jm_ac_cv_header_stdint_h" >&5 +echo "${ECHO_T}$jm_ac_cv_header_stdint_h" >&6; } if test $jm_ac_cv_header_stdint_h = yes; then cat >>confdefs.h <<_ACEOF @@ -4800,8 +5352,8 @@ _ACEOF fi - echo "$as_me:$LINENO: checking for unsigned long long" >&5 -echo $ECHO_N "checking for unsigned long long... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for unsigned long long" >&5 +echo $ECHO_N "checking for unsigned long long... $ECHO_C" >&6; } if test "${ac_cv_type_unsigned_long_long+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -4822,39 +5374,36 @@ unsigned long long ullmax = (unsigned long long) -1; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_type_unsigned_long_long=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_type_unsigned_long_long=no + ac_cv_type_unsigned_long_long=no fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_type_unsigned_long_long" >&5 -echo "${ECHO_T}$ac_cv_type_unsigned_long_long" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_type_unsigned_long_long" >&5 +echo "${ECHO_T}$ac_cv_type_unsigned_long_long" >&6; } if test $ac_cv_type_unsigned_long_long = yes; then cat >>confdefs.h <<\_ACEOF @@ -4885,8 +5434,8 @@ _ACEOF fi - echo "$as_me:$LINENO: checking for inttypes.h" >&5 -echo $ECHO_N "checking for inttypes.h... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for inttypes.h" >&5 +echo $ECHO_N "checking for inttypes.h... $ECHO_C" >&6; } if test "${gt_cv_header_inttypes_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -4908,39 +5457,35 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then gt_cv_header_inttypes_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -gt_cv_header_inttypes_h=no + gt_cv_header_inttypes_h=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $gt_cv_header_inttypes_h" >&5 -echo "${ECHO_T}$gt_cv_header_inttypes_h" >&6 +{ echo "$as_me:$LINENO: result: $gt_cv_header_inttypes_h" >&5 +echo "${ECHO_T}$gt_cv_header_inttypes_h" >&6; } if test $gt_cv_header_inttypes_h = yes; then cat >>confdefs.h <<_ACEOF @@ -4952,8 +5497,8 @@ _ACEOF if test $gt_cv_header_inttypes_h = yes; then - echo "$as_me:$LINENO: checking whether the inttypes.h PRIxNN macros are broken" >&5 -echo $ECHO_N "checking whether the inttypes.h PRIxNN macros are broken... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking whether the inttypes.h PRIxNN macros are broken" >&5 +echo $ECHO_N "checking whether the inttypes.h PRIxNN macros are broken... $ECHO_C" >&6; } if test "${gt_cv_inttypes_pri_broken+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -4978,39 +5523,35 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then gt_cv_inttypes_pri_broken=no else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -gt_cv_inttypes_pri_broken=yes + gt_cv_inttypes_pri_broken=yes fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $gt_cv_inttypes_pri_broken" >&5 -echo "${ECHO_T}$gt_cv_inttypes_pri_broken" >&6 +{ echo "$as_me:$LINENO: result: $gt_cv_inttypes_pri_broken" >&5 +echo "${ECHO_T}$gt_cv_inttypes_pri_broken" >&6; } fi if test "$gt_cv_inttypes_pri_broken" = yes; then @@ -5037,13 +5578,13 @@ _ACEOF prefix="$acl_save_prefix" -# Check whether --with-gnu-ld or --without-gnu-ld was given. +# Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then - withval="$with_gnu_ld" - test "$withval" = no || with_gnu_ld=yes + withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no -fi; +fi + # Prepare PATH_SEPARATOR. # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then @@ -5060,8 +5601,8 @@ fi ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. - echo "$as_me:$LINENO: checking for ld used by GCC" >&5 -echo $ECHO_N "checking for ld used by GCC... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for ld used by GCC" >&5 +echo $ECHO_N "checking for ld used by GCC... $ECHO_C" >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw @@ -5090,11 +5631,11 @@ echo $ECHO_N "checking for ld used by GCC... $ECHO_C" >&6 ;; esac elif test "$with_gnu_ld" = yes; then - echo "$as_me:$LINENO: checking for GNU ld" >&5 -echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for GNU ld" >&5 +echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6; } else - echo "$as_me:$LINENO: checking for non-GNU ld" >&5 -echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for non-GNU ld" >&5 +echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6; } fi if test "${acl_cv_path_LD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -5123,17 +5664,17 @@ fi LD="$acl_cv_path_LD" if test -n "$LD"; then - echo "$as_me:$LINENO: result: $LD" >&5 -echo "${ECHO_T}$LD" >&6 + { echo "$as_me:$LINENO: result: $LD" >&5 +echo "${ECHO_T}$LD" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} { (exit 1); exit 1; }; } -echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 -echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 +echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6; } if test "${acl_cv_prog_gnu_ld+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -5144,14 +5685,14 @@ else acl_cv_prog_gnu_ld=no fi fi -echo "$as_me:$LINENO: result: $acl_cv_prog_gnu_ld" >&5 -echo "${ECHO_T}$acl_cv_prog_gnu_ld" >&6 +{ echo "$as_me:$LINENO: result: $acl_cv_prog_gnu_ld" >&5 +echo "${ECHO_T}$acl_cv_prog_gnu_ld" >&6; } with_gnu_ld=$acl_cv_prog_gnu_ld - echo "$as_me:$LINENO: checking for shared library run path origin" >&5 -echo $ECHO_N "checking for shared library run path origin... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for shared library run path origin" >&5 +echo $ECHO_N "checking for shared library run path origin... $ECHO_C" >&6; } if test "${acl_cv_rpath+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -5163,8 +5704,8 @@ else acl_cv_rpath=done fi -echo "$as_me:$LINENO: result: $acl_cv_rpath" >&5 -echo "${ECHO_T}$acl_cv_rpath" >&6 +{ echo "$as_me:$LINENO: result: $acl_cv_rpath" >&5 +echo "${ECHO_T}$acl_cv_rpath" >&6; } wl="$acl_cv_wl" libext="$acl_cv_libext" shlibext="$acl_cv_shlibext" @@ -5172,13 +5713,13 @@ echo "${ECHO_T}$acl_cv_rpath" >&6 hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" hardcode_direct="$acl_cv_hardcode_direct" hardcode_minus_L="$acl_cv_hardcode_minus_L" - # Check whether --enable-rpath or --disable-rpath was given. + # Check whether --enable-rpath was given. if test "${enable_rpath+set}" = set; then - enableval="$enable_rpath" - : + enableval=$enable_rpath; : else enable_rpath=yes -fi; +fi + @@ -5200,10 +5741,9 @@ fi; prefix="$acl_save_prefix" -# Check whether --with-libiconv-prefix or --without-libiconv-prefix was given. +# Check whether --with-libiconv-prefix was given. if test "${with_libiconv_prefix+set}" = set; then - withval="$with_libiconv_prefix" - + withval=$with_libiconv_prefix; if test "X$withval" = "Xno"; then use_additional=no else @@ -5226,7 +5766,8 @@ if test "${with_libiconv_prefix+set}" = set; then fi fi -fi; +fi + LIBICONV= LTLIBICONV= INCICONV= @@ -5579,18 +6120,19 @@ for ac_header in argz.h limits.h locale.h nl_types.h malloc.h stddef.h \ stdlib.h string.h unistd.h sys/param.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? -echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -5601,41 +6143,37 @@ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_header_compiler=no + ac_header_compiler=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -5644,24 +6182,22 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 @@ -5669,9 +6205,10 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi + rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in @@ -5695,25 +6232,19 @@ echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\ echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------------ ## -## Report this to the AC_PACKAGE_NAME lists. ## -## ------------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 + ;; esac -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then @@ -5753,9 +6284,9 @@ strcasecmp strdup strtoul tsearch __argz_count __argz_stringify __argz_next \ __fsetlocking do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -5781,68 +6312,60 @@ cat >>conftest.$ac_ext <<_ACEOF #undef $ac_func -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" -{ #endif -/* 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 (); /* 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) +#if defined __stub_$ac_func || defined __stub___$ac_func choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} #endif int main () { -return f != $ac_func; +return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" + eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 @@ -5882,8 +6405,8 @@ done done - echo "$as_me:$LINENO: checking for iconv" >&5 -echo $ECHO_N "checking for iconv... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for iconv" >&5 +echo $ECHO_N "checking for iconv... $ECHO_C" >&6; } if test "${am_cv_func_iconv+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -5909,34 +6432,32 @@ iconv_t cd = iconv_open("",""); } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then am_cv_func_iconv=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test "$am_cv_func_iconv" != yes; then am_save_LIBS="$LIBS" @@ -5960,42 +6481,40 @@ iconv_t cd = iconv_open("",""); } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then am_cv_lib_iconv=yes am_cv_func_iconv=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS="$am_save_LIBS" fi fi -echo "$as_me:$LINENO: result: $am_cv_func_iconv" >&5 -echo "${ECHO_T}$am_cv_func_iconv" >&6 +{ echo "$as_me:$LINENO: result: $am_cv_func_iconv" >&5 +echo "${ECHO_T}$am_cv_func_iconv" >&6; } if test "$am_cv_func_iconv" = yes; then cat >>confdefs.h <<\_ACEOF @@ -6004,10 +6523,10 @@ _ACEOF fi if test "$am_cv_lib_iconv" = yes; then - echo "$as_me:$LINENO: checking how to link with libiconv" >&5 -echo $ECHO_N "checking how to link with libiconv... $ECHO_C" >&6 - echo "$as_me:$LINENO: result: $LIBICONV" >&5 -echo "${ECHO_T}$LIBICONV" >&6 + { echo "$as_me:$LINENO: checking how to link with libiconv" >&5 +echo $ECHO_N "checking how to link with libiconv... $ECHO_C" >&6; } + { echo "$as_me:$LINENO: result: $LIBICONV" >&5 +echo "${ECHO_T}$LIBICONV" >&6; } else CPPFLAGS="$am_save_CPPFLAGS" LIBICONV= @@ -6017,8 +6536,8 @@ echo "${ECHO_T}$LIBICONV" >&6 if test "$am_cv_func_iconv" = yes; then - echo "$as_me:$LINENO: checking for iconv declaration" >&5 -echo $ECHO_N "checking for iconv declaration... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for iconv declaration" >&5 +echo $ECHO_N "checking for iconv declaration... $ECHO_C" >&6; } if test "${am_cv_proto_iconv+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -6051,43 +6570,39 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then am_cv_proto_iconv_arg1="" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -am_cv_proto_iconv_arg1="const" + am_cv_proto_iconv_arg1="const" fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);" fi am_cv_proto_iconv=`echo "$am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'` - echo "$as_me:$LINENO: result: ${ac_t:- + { echo "$as_me:$LINENO: result: ${ac_t:- }$am_cv_proto_iconv" >&5 echo "${ECHO_T}${ac_t:- - }$am_cv_proto_iconv" >&6 + }$am_cv_proto_iconv" >&6; } cat >>confdefs.h <<_ACEOF #define ICONV_CONST $am_cv_proto_iconv_arg1 @@ -6096,8 +6611,8 @@ _ACEOF fi - echo "$as_me:$LINENO: checking for nl_langinfo and CODESET" >&5 -echo $ECHO_N "checking for nl_langinfo and CODESET... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for nl_langinfo and CODESET" >&5 +echo $ECHO_N "checking for nl_langinfo and CODESET... $ECHO_C" >&6; } if test "${am_cv_langinfo_codeset+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -6117,40 +6632,37 @@ char* cs = nl_langinfo(CODESET); } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then am_cv_langinfo_codeset=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -am_cv_langinfo_codeset=no + am_cv_langinfo_codeset=no fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $am_cv_langinfo_codeset" >&5 -echo "${ECHO_T}$am_cv_langinfo_codeset" >&6 +{ echo "$as_me:$LINENO: result: $am_cv_langinfo_codeset" >&5 +echo "${ECHO_T}$am_cv_langinfo_codeset" >&6; } if test $am_cv_langinfo_codeset = yes; then cat >>confdefs.h <<\_ACEOF @@ -6161,8 +6673,8 @@ _ACEOF if test $ac_cv_header_locale_h = yes; then - echo "$as_me:$LINENO: checking for LC_MESSAGES" >&5 -echo $ECHO_N "checking for LC_MESSAGES... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for LC_MESSAGES" >&5 +echo $ECHO_N "checking for LC_MESSAGES... $ECHO_C" >&6; } if test "${am_cv_val_LC_MESSAGES+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -6182,39 +6694,36 @@ return LC_MESSAGES } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then am_cv_val_LC_MESSAGES=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -am_cv_val_LC_MESSAGES=no + am_cv_val_LC_MESSAGES=no fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $am_cv_val_LC_MESSAGES" >&5 -echo "${ECHO_T}$am_cv_val_LC_MESSAGES" >&6 +{ echo "$as_me:$LINENO: result: $am_cv_val_LC_MESSAGES" >&5 +echo "${ECHO_T}$am_cv_val_LC_MESSAGES" >&6; } if test $am_cv_val_LC_MESSAGES = yes; then cat >>confdefs.h <<\_ACEOF @@ -6229,8 +6738,8 @@ _ACEOF do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_INTLBISON+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -6243,33 +6752,35 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_INTLBISON="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi INTLBISON=$ac_cv_prog_INTLBISON if test -n "$INTLBISON"; then - echo "$as_me:$LINENO: result: $INTLBISON" >&5 -echo "${ECHO_T}$INTLBISON" >&6 + { echo "$as_me:$LINENO: result: $INTLBISON" >&5 +echo "${ECHO_T}$INTLBISON" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + test -n "$INTLBISON" && break done if test -z "$INTLBISON"; then ac_verc_fail=yes else - echo "$as_me:$LINENO: checking version of bison" >&5 -echo $ECHO_N "checking version of bison... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking version of bison" >&5 +echo $ECHO_N "checking version of bison... $ECHO_C" >&6; } ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'` case $ac_prog_version in '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;; @@ -6277,8 +6788,8 @@ echo $ECHO_N "checking version of bison... $ECHO_C" >&6 ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;; *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;; esac - echo "$as_me:$LINENO: result: $ac_prog_version" >&5 -echo "${ECHO_T}$ac_prog_version" >&6 + { echo "$as_me:$LINENO: result: $ac_prog_version" >&5 +echo "${ECHO_T}$ac_prog_version" >&6; } fi if test $ac_verc_fail = yes; then INTLBISON=: @@ -6299,17 +6810,17 @@ echo "${ECHO_T}$ac_prog_version" >&6 - echo "$as_me:$LINENO: checking whether NLS is requested" >&5 -echo $ECHO_N "checking whether NLS is requested... $ECHO_C" >&6 - # Check whether --enable-nls or --disable-nls was given. + { echo "$as_me:$LINENO: checking whether NLS is requested" >&5 +echo $ECHO_N "checking whether NLS is requested... $ECHO_C" >&6; } + # Check whether --enable-nls was given. if test "${enable_nls+set}" = set; then - enableval="$enable_nls" - USE_NLS=$enableval + enableval=$enable_nls; USE_NLS=$enableval else USE_NLS=yes -fi; - echo "$as_me:$LINENO: result: $USE_NLS" >&5 -echo "${ECHO_T}$USE_NLS" >&6 +fi + + { echo "$as_me:$LINENO: result: $USE_NLS" >&5 +echo "${ECHO_T}$USE_NLS" >&6; } @@ -6324,18 +6835,18 @@ echo "${ECHO_T}$USE_NLS" >&6 if test "$USE_NLS" = "yes"; then gt_use_preinstalled_gnugettext=no - echo "$as_me:$LINENO: checking whether included gettext is requested" >&5 -echo $ECHO_N "checking whether included gettext is requested... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking whether included gettext is requested" >&5 +echo $ECHO_N "checking whether included gettext is requested... $ECHO_C" >&6; } -# Check whether --with-included-gettext or --without-included-gettext was given. +# Check whether --with-included-gettext was given. if test "${with_included_gettext+set}" = set; then - withval="$with_included_gettext" - nls_cv_force_use_gnu_gettext=$withval + withval=$with_included_gettext; nls_cv_force_use_gnu_gettext=$withval else nls_cv_force_use_gnu_gettext=no -fi; - echo "$as_me:$LINENO: result: $nls_cv_force_use_gnu_gettext" >&5 -echo "${ECHO_T}$nls_cv_force_use_gnu_gettext" >&6 +fi + + { echo "$as_me:$LINENO: result: $nls_cv_force_use_gnu_gettext" >&5 +echo "${ECHO_T}$nls_cv_force_use_gnu_gettext" >&6; } nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext" if test "$nls_cv_force_use_gnu_gettext" != "yes"; then @@ -6345,8 +6856,8 @@ echo "${ECHO_T}$nls_cv_force_use_gnu_gettext" >&6 - echo "$as_me:$LINENO: checking for GNU gettext in libc" >&5 -echo $ECHO_N "checking for GNU gettext in libc... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for GNU gettext in libc" >&5 +echo $ECHO_N "checking for GNU gettext in libc... $ECHO_C" >&6; } if test "${gt_cv_func_gnugettext1_libc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -6369,39 +6880,36 @@ return (int) gettext ("") + _nl_msg_cat_cntr + *_nl_domain_bindings } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then gt_cv_func_gnugettext1_libc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -gt_cv_func_gnugettext1_libc=no + gt_cv_func_gnugettext1_libc=no fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $gt_cv_func_gnugettext1_libc" >&5 -echo "${ECHO_T}$gt_cv_func_gnugettext1_libc" >&6 +{ echo "$as_me:$LINENO: result: $gt_cv_func_gnugettext1_libc" >&5 +echo "${ECHO_T}$gt_cv_func_gnugettext1_libc" >&6; } if test "$gt_cv_func_gnugettext1_libc" != "yes"; then @@ -6421,10 +6929,9 @@ echo "${ECHO_T}$gt_cv_func_gnugettext1_libc" >&6 prefix="$acl_save_prefix" -# Check whether --with-libintl-prefix or --without-libintl-prefix was given. +# Check whether --with-libintl-prefix was given. if test "${with_libintl_prefix+set}" = set; then - withval="$with_libintl_prefix" - + withval=$with_libintl_prefix; if test "X$withval" = "Xno"; then use_additional=no else @@ -6447,7 +6954,8 @@ if test "${with_libintl_prefix+set}" = set; then fi fi -fi; +fi + LIBINTL= LTLIBINTL= INCINTL= @@ -6783,8 +7291,8 @@ fi; done fi - echo "$as_me:$LINENO: checking for GNU gettext in libintl" >&5 -echo $ECHO_N "checking for GNU gettext in libintl... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for GNU gettext in libintl" >&5 +echo $ECHO_N "checking for GNU gettext in libintl... $ECHO_C" >&6; } if test "${gt_cv_func_gnugettext1_libintl+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -6815,35 +7323,32 @@ return (int) gettext ("") + _nl_msg_cat_cntr + *_nl_expand_alias (0) } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then gt_cv_func_gnugettext1_libintl=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -gt_cv_func_gnugettext1_libintl=no + gt_cv_func_gnugettext1_libintl=no fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test "$gt_cv_func_gnugettext1_libintl" != yes && test -n "$LIBICONV"; then LIBS="$LIBS $LIBICONV" @@ -6870,27 +7375,23 @@ return (int) gettext ("") + _nl_msg_cat_cntr + *_nl_expand_alias (0) } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then LIBINTL="$LIBINTL $LIBICONV" LTLIBINTL="$LTLIBINTL $LTLIBICONV" gt_cv_func_gnugettext1_libintl=yes @@ -6899,15 +7400,17 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi CPPFLAGS="$gt_save_CPPFLAGS" LIBS="$gt_save_LIBS" fi -echo "$as_me:$LINENO: result: $gt_cv_func_gnugettext1_libintl" >&5 -echo "${ECHO_T}$gt_cv_func_gnugettext1_libintl" >&6 +{ echo "$as_me:$LINENO: result: $gt_cv_func_gnugettext1_libintl" >&5 +echo "${ECHO_T}$gt_cv_func_gnugettext1_libintl" >&6; } fi if test "$gt_cv_func_gnugettext1_libc" = "yes" \ @@ -6953,13 +7456,13 @@ _ACEOF fi fi - echo "$as_me:$LINENO: checking whether to use NLS" >&5 -echo $ECHO_N "checking whether to use NLS... $ECHO_C" >&6 - echo "$as_me:$LINENO: result: $USE_NLS" >&5 -echo "${ECHO_T}$USE_NLS" >&6 + { echo "$as_me:$LINENO: checking whether to use NLS" >&5 +echo $ECHO_N "checking whether to use NLS... $ECHO_C" >&6; } + { echo "$as_me:$LINENO: result: $USE_NLS" >&5 +echo "${ECHO_T}$USE_NLS" >&6; } if test "$USE_NLS" = "yes"; then - echo "$as_me:$LINENO: checking where the gettext function comes from" >&5 -echo $ECHO_N "checking where the gettext function comes from... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking where the gettext function comes from" >&5 +echo $ECHO_N "checking where the gettext function comes from... $ECHO_C" >&6; } if test "$gt_use_preinstalled_gnugettext" = "yes"; then if test "$gt_cv_func_gnugettext1_libintl" = "yes"; then gt_source="external libintl" @@ -6969,18 +7472,18 @@ echo $ECHO_N "checking where the gettext function comes from... $ECHO_C" >&6 else gt_source="included intl directory" fi - echo "$as_me:$LINENO: result: $gt_source" >&5 -echo "${ECHO_T}$gt_source" >&6 + { echo "$as_me:$LINENO: result: $gt_source" >&5 +echo "${ECHO_T}$gt_source" >&6; } fi if test "$USE_NLS" = "yes"; then if test "$gt_use_preinstalled_gnugettext" = "yes"; then if test "$gt_cv_func_gnugettext1_libintl" = "yes"; then - echo "$as_me:$LINENO: checking how to link with libintl" >&5 -echo $ECHO_N "checking how to link with libintl... $ECHO_C" >&6 - echo "$as_me:$LINENO: result: $LIBINTL" >&5 -echo "${ECHO_T}$LIBINTL" >&6 + { echo "$as_me:$LINENO: checking how to link with libintl" >&5 +echo $ECHO_N "checking how to link with libintl... $ECHO_C" >&6; } + { echo "$as_me:$LINENO: result: $LIBINTL" >&5 +echo "${ECHO_T}$LIBINTL" >&6; } for element in $INCINTL; do haveit= @@ -7101,8 +7604,8 @@ for ac_prog in aclocal do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ACLOCAL+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -7115,25 +7618,27 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ACLOCAL="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi ACLOCAL=$ac_cv_prog_ACLOCAL if test -n "$ACLOCAL"; then - echo "$as_me:$LINENO: result: $ACLOCAL" >&5 -echo "${ECHO_T}$ACLOCAL" >&6 + { echo "$as_me:$LINENO: result: $ACLOCAL" >&5 +echo "${ECHO_T}$ACLOCAL" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + test -n "$ACLOCAL" && break done test -n "$ACLOCAL" || ACLOCAL="$MISSING aclocal" @@ -7142,8 +7647,8 @@ for ac_prog in autoconf do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_AUTOCONF+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -7156,25 +7661,27 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AUTOCONF="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi AUTOCONF=$ac_cv_prog_AUTOCONF if test -n "$AUTOCONF"; then - echo "$as_me:$LINENO: result: $AUTOCONF" >&5 -echo "${ECHO_T}$AUTOCONF" >&6 + { echo "$as_me:$LINENO: result: $AUTOCONF" >&5 +echo "${ECHO_T}$AUTOCONF" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + test -n "$AUTOCONF" && break done test -n "$AUTOCONF" || AUTOCONF="$MISSING autoconf" @@ -7183,8 +7690,8 @@ for ac_prog in autoheader do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_AUTOHEADER+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -7197,37 +7704,39 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AUTOHEADER="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi AUTOHEADER=$ac_cv_prog_AUTOHEADER if test -n "$AUTOHEADER"; then - echo "$as_me:$LINENO: result: $AUTOHEADER" >&5 -echo "${ECHO_T}$AUTOHEADER" >&6 + { echo "$as_me:$LINENO: result: $AUTOHEADER" >&5 +echo "${ECHO_T}$AUTOHEADER" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + test -n "$AUTOHEADER" && break done test -n "$AUTOHEADER" || AUTOHEADER="$MISSING autoheader" -# Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. +# Check whether --enable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then - enableval="$enable_maintainer_mode" - + enableval=$enable_maintainer_mode; else enable_maintainer_mode=no -fi; +fi + if test "x$enable_maintainer_mode" = xno; then MAINT='#' else @@ -7250,7 +7759,7 @@ case $USE_INCLUDED_LIBINTL in ;; esac - ac_config_files="$ac_config_files Makefile config.intl" +ac_config_files="$ac_config_files Makefile config.intl" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure @@ -7270,39 +7779,58 @@ _ACEOF # 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. +# So, we kill variables containing newlines. # 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. -{ +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 +echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + *) $as_unset $ac_var ;; + esac ;; + esac + done + (set) 2>&1 | - case `(ac_space=' '; set | grep ac_space) 2>&1` in - *ac_space=\ *) + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" - ;; + ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n \ - "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; - esac; -} | + esac | + sort +) | sed ' + /^ac_cv_env_/b end t clear - : clear + :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end - /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ - : end' >>confcache -if diff $cache_file confcache >/dev/null 2>&1; then :; else - if test -w $cache_file; then - test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + :end' >>confcache +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else + if test -w "$cache_file"; then + test "x$cache_file" != "x/dev/null" && + { echo "$as_me:$LINENO: updating cache $cache_file" >&5 +echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else - echo "not updating unwritable cache $cache_file" + { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 +echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache @@ -7311,32 +7839,18 @@ test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' -# VPATH may cause trouble with some makes, so we remove $(srcdir), -# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and -# trailing colons and then remove the whole line if VPATH becomes empty -# (actually we leave an empty line to preserve line numbers). -if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=/{ -s/:*\$(srcdir):*/:/; -s/:*\${srcdir}:*/:/; -s/:*@srcdir@:*/:/; -s/^\([^=]*=[ ]*\):*/\1/; -s/:*$//; -s/^[^=]*=[ ]*$//; -}' -fi - DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. - ac_i=`echo "$ac_i" | - sed 's/\$U\././;s/\.o$//;s/\.obj$//'` - # 2. Add them. - ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" - ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`echo "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" + ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs @@ -7367,73 +7881,26 @@ cat >>$CONFIG_STATUS <<\_ACEOF ## M4sh Initialization. ## ## --------------------- ## -# Be Bourne compatible +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' -elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then - set -o posix -fi -DUALCASE=1; export DUALCASE # for MKS sh - -# Support unset when possible. -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - as_unset=unset + setopt NO_GLOB_SUBST else - as_unset=false + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + fi -# Work around bugs in pre-3.0 UWIN ksh. -$as_unset ENV MAIL MAILPATH -PS1='$ ' -PS2='> ' -PS4='+ ' -# NLS nuisances. -for as_var in \ - LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ - LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ - LC_TELEPHONE LC_TIME -do - if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then - eval $as_var=C; export $as_var - else - $as_unset $as_var - fi -done -# Required to use basename. -if expr a : '\(a\)' >/dev/null 2>&1; then - as_expr=expr -else - as_expr=false -fi - -if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi - - -# Name of the executable. -as_me=`$as_basename "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)$' \| \ - . : '\(.\)' 2>/dev/null || -echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } - /^X\/\(\/\/\)$/{ s//\1/; q; } - /^X\/\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - - -# PATH needs CR, and LINENO needs CR and PATH. +# PATH needs CR # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' @@ -7454,126 +7921,198 @@ if test "${PATH_SEPARATOR+set}" != set; then rm -f conf$$.sh fi +# Support unset when possible. +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + - as_lineno_1=$LINENO - as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" || { - # Find who we are. Look in the path if we contain no path at all - # relative or not. - case $0 in - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +as_nl=' +' +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done +IFS=$as_save_IFS - ;; - esac - # We did not find ourselves, most probably we were run as `sh COMMAND' - # in which case we are not to be found in the path. - if test "x$as_myself" = x; then - as_myself=$0 - fi - if test ! -f "$as_myself"; then - { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 -echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} - { (exit 1); exit 1; }; } - fi - case $CONFIG_SHELL in - '') - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + { (exit 1); exit 1; } +fi + +# Work around bugs in pre-3.0 UWIN ksh. +for as_var in ENV MAIL MAILPATH +do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for as_base in sh bash ksh sh5; do - case $as_dir in - /*) - if ("$as_dir/$as_base" -c ' + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var + fi +done + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + + +# Name of the executable. +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# CDPATH. +$as_unset CDPATH + + + as_lineno_1=$LINENO as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then - $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } - $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } - CONFIG_SHELL=$as_dir/$as_base - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$0" ${1+"$@"} - fi;; - esac - done -done -;; - esac + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line before each line; the second 'sed' does the real - # work. The second script uses 'N' to pair each line-number line - # with the numbered line, and appends trailing '-' during - # substitution so that $LINENO is not a special case at line end. + # line-number line after each line using $LINENO; the second 'sed' + # does the real work. The second script uses 'N' to pair each + # line-number line with the line containing $LINENO, and appends + # trailing '-' during substitution so that $LINENO is not a special + # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) - sed '=' <$as_myself | + # scripts with optimization help from Paolo Bonzini. Blame Lee + # E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno N - s,$,-, - : loop - s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop - s,-$,, - s,^['$as_cr_digits']*\n,, + s/-\n.*// ' >$as_me.lineno && - chmod +x $as_me.lineno || - { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 -echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} + chmod +x "$as_me.lineno" || + { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensible to this). - . ./$as_me.lineno + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" # Exit status is that of the last command. exit } -case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in - *c*,-n*) ECHO_N= ECHO_C=' -' ECHO_T=' ' ;; - *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; - *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in +-n*) + case `echo 'x\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + *) ECHO_C='\c';; + esac;; +*) + ECHO_N='-n';; esac -if expr a : '\(a\)' >/dev/null 2>&1; then +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir +fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then - # We could just check for DJGPP; but this test a) works b) is more generic - # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). - if test -f conf$$.exe; then - # Don't use ln at all; we don't have any links + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' - else - as_ln_s='ln -s' - fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi -rm -f conf$$ conf$$.exe conf$$.file +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p=: @@ -7582,7 +8121,28 @@ else as_mkdir_p=false fi -as_executable_p="test -f" +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' +else + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +fi +as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" @@ -7591,31 +8151,14 @@ as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" -# IFS -# We need space, tab and new line, in precisely that order. -as_nl=' -' -IFS=" $as_nl" - -# CDPATH. -$as_unset CDPATH - exec 6>&1 -# Open the log real soon, to keep \$[0] and so on meaningful, and to +# Save the log message, to keep $[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their -# values after options handling. Logging --version etc. is OK. -exec 5>>config.log -{ - echo - sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX -## Running $as_me. ## -_ASBOX -} >&5 -cat >&5 <<_CSEOF - +# values after options handling. +ac_log=" This file was extended by $as_me, which was -generated by GNU Autoconf 2.59. Invocation command line was +generated by GNU Autoconf 2.61. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -7623,30 +8166,20 @@ generated by GNU Autoconf 2.59. Invocation command line was CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ -_CSEOF -echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 -echo >&5 +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + _ACEOF +cat >>$CONFIG_STATUS <<_ACEOF # Files that config.status was made for. -if test -n "$ac_config_files"; then - echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS -fi +config_files="$ac_config_files" +config_headers="$ac_config_headers" +config_commands="$ac_config_commands" -if test -n "$ac_config_headers"; then - echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS -fi - -if test -n "$ac_config_links"; then - echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS -fi - -if test -n "$ac_config_commands"; then - echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS -fi +_ACEOF cat >>$CONFIG_STATUS <<\_ACEOF - ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. @@ -7654,7 +8187,7 @@ current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit - -V, --version print version number, then exit + -V, --version print version number and configuration settings, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions @@ -7673,19 +8206,21 @@ Configuration commands: $config_commands Report bugs to ." -_ACEOF +_ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ config.status -configured by $0, generated by GNU Autoconf 2.59, - with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" +configured by $0, generated by GNU Autoconf 2.61, + with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" -Copyright (C) 2003 Free Software Foundation, Inc. +Copyright (C) 2006 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." -srcdir=$srcdir -INSTALL="$INSTALL" + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +INSTALL='$INSTALL' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF @@ -7696,39 +8231,24 @@ while test $# != 0 do case $1 in --*=*) - ac_option=`expr "x$1" : 'x\([^=]*\)='` - ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; - -*) + *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; - *) # This is not an option, so the user has probably given explicit - # arguments. - ac_option=$1 - ac_need_defaults=false;; esac case $ac_option in # Handling of the options. -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; - --version | --vers* | -V ) - echo "$ac_cs_version"; exit 0 ;; - --he | --h) - # Conflict between --help and --header - { { echo "$as_me:$LINENO: error: ambiguous option: $1 -Try \`$0 --help' for more information." >&5 -echo "$as_me: error: ambiguous option: $1 -Try \`$0 --help' for more information." >&2;} - { (exit 1); exit 1; }; };; - --help | --hel | -h ) - echo "$ac_cs_usage"; exit 0 ;; - --debug | --d* | -d ) + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + echo "$ac_cs_version"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift @@ -7738,18 +8258,24 @@ Try \`$0 --help' for more information." >&2;} $ac_shift CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" ac_need_defaults=false;; + --he | --h) + # Conflict between --help and --header + { echo "$as_me: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&2 + { (exit 1); exit 1; }; };; + --help | --hel | -h ) + echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. - -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 -Try \`$0 --help' for more information." >&5 -echo "$as_me: error: unrecognized option: $1 -Try \`$0 --help' for more information." >&2;} + -*) { echo "$as_me: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; - *) ac_config_targets="$ac_config_targets $1" ;; + *) ac_config_targets="$ac_config_targets $1" + ac_need_defaults=false ;; esac shift @@ -7765,17 +8291,28 @@ fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF if \$ac_cs_recheck; then - echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 - exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 + CONFIG_SHELL=$SHELL + export CONFIG_SHELL + exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX + echo "$ac_log" +} >&5 +_ACEOF cat >>$CONFIG_STATUS <<_ACEOF # -# INIT-COMMANDS section. +# INIT-COMMANDS # - # Capture the value of obsolete ALL_LINGUAS because we need it to compute # POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES, CATALOGS. But hide it # from automake. @@ -7786,23 +8323,24 @@ cat >>$CONFIG_STATUS <<_ACEOF _ACEOF - - cat >>$CONFIG_STATUS <<\_ACEOF + +# Handling of arguments. for ac_config_target in $ac_config_targets do - case "$ac_config_target" in - # Handling of arguments. - "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; - "config.intl" ) CONFIG_FILES="$CONFIG_FILES config.intl" ;; - "default-1" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default-1" ;; - "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; + case $ac_config_target in + "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; + "default-1") CONFIG_COMMANDS="$CONFIG_COMMANDS default-1" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "config.intl") CONFIG_FILES="$CONFIG_FILES config.intl" ;; + *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done + # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely @@ -7814,338 +8352,405 @@ if $ac_need_defaults; then fi # Have a temporary directory for convenience. Make it in the build tree -# simply because there is no reason to put it here, and in addition, +# simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. -# Create a temporary directory, and hook for its removal unless debugging. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. $debug || { - trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 + tmp= + trap 'exit_status=$? + { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status +' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } - # Create a (secure) tmp directory for tmp files. { - tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { - tmp=./confstat$$-$RANDOM - (umask 077 && mkdir $tmp) + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } -_ACEOF - -cat >>$CONFIG_STATUS <<_ACEOF - # -# CONFIG_FILES section. +# Set up the sed scripts for CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h -if test -n "\$CONFIG_FILES"; then - # Protect against being on the right side of a sed subst in config.status. - sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; - s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF -s,@SHELL@,$SHELL,;t t -s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t -s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t -s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t -s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t -s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t -s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t -s,@exec_prefix@,$exec_prefix,;t t -s,@prefix@,$prefix,;t t -s,@program_transform_name@,$program_transform_name,;t t -s,@bindir@,$bindir,;t t -s,@sbindir@,$sbindir,;t t -s,@libexecdir@,$libexecdir,;t t -s,@datadir@,$datadir,;t t -s,@sysconfdir@,$sysconfdir,;t t -s,@sharedstatedir@,$sharedstatedir,;t t -s,@localstatedir@,$localstatedir,;t t -s,@libdir@,$libdir,;t t -s,@includedir@,$includedir,;t t -s,@oldincludedir@,$oldincludedir,;t t -s,@infodir@,$infodir,;t t -s,@mandir@,$mandir,;t t -s,@build_alias@,$build_alias,;t t -s,@host_alias@,$host_alias,;t t -s,@target_alias@,$target_alias,;t t -s,@DEFS@,$DEFS,;t t -s,@ECHO_C@,$ECHO_C,;t t -s,@ECHO_N@,$ECHO_N,;t t -s,@ECHO_T@,$ECHO_T,;t t -s,@LIBS@,$LIBS,;t t -s,@SET_MAKE@,$SET_MAKE,;t t -s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t -s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t -s,@INSTALL_DATA@,$INSTALL_DATA,;t t -s,@MKINSTALLDIRS@,$MKINSTALLDIRS,;t t -s,@USE_NLS@,$USE_NLS,;t t -s,@MSGFMT@,$MSGFMT,;t t -s,@GMSGFMT@,$GMSGFMT,;t t -s,@XGETTEXT@,$XGETTEXT,;t t -s,@MSGMERGE@,$MSGMERGE,;t t -s,@CC@,$CC,;t t -s,@CFLAGS@,$CFLAGS,;t t -s,@LDFLAGS@,$LDFLAGS,;t t -s,@CPPFLAGS@,$CPPFLAGS,;t t -s,@ac_ct_CC@,$ac_ct_CC,;t t -s,@EXEEXT@,$EXEEXT,;t t -s,@OBJEXT@,$OBJEXT,;t t -s,@build@,$build,;t t -s,@build_cpu@,$build_cpu,;t t -s,@build_vendor@,$build_vendor,;t t -s,@build_os@,$build_os,;t t -s,@host@,$host,;t t -s,@host_cpu@,$host_cpu,;t t -s,@host_vendor@,$host_vendor,;t t -s,@host_os@,$host_os,;t t -s,@RANLIB@,$RANLIB,;t t -s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t -s,@CPP@,$CPP,;t t -s,@EGREP@,$EGREP,;t t -s,@ALLOCA@,$ALLOCA,;t t -s,@GLIBC21@,$GLIBC21,;t t -s,@LIBICONV@,$LIBICONV,;t t -s,@LTLIBICONV@,$LTLIBICONV,;t t -s,@INTLBISON@,$INTLBISON,;t t -s,@BUILD_INCLUDED_LIBINTL@,$BUILD_INCLUDED_LIBINTL,;t t -s,@USE_INCLUDED_LIBINTL@,$USE_INCLUDED_LIBINTL,;t t -s,@CATOBJEXT@,$CATOBJEXT,;t t -s,@DATADIRNAME@,$DATADIRNAME,;t t -s,@INSTOBJEXT@,$INSTOBJEXT,;t t -s,@GENCAT@,$GENCAT,;t t -s,@INTLOBJS@,$INTLOBJS,;t t -s,@INTL_LIBTOOL_SUFFIX_PREFIX@,$INTL_LIBTOOL_SUFFIX_PREFIX,;t t -s,@INTLLIBS@,$INTLLIBS,;t t -s,@LIBINTL@,$LIBINTL,;t t -s,@LTLIBINTL@,$LTLIBINTL,;t t -s,@POSUB@,$POSUB,;t t -s,@ACLOCAL@,$ACLOCAL,;t t -s,@AUTOCONF@,$AUTOCONF,;t t -s,@AUTOHEADER@,$AUTOHEADER,;t t -s,@MAINT@,$MAINT,;t t -s,@LIBINTL_DEP@,$LIBINTL_DEP,;t t -s,@INCINTL@,$INCINTL,;t t -s,@LIBOBJS@,$LIBOBJS,;t t -s,@LTLIBOBJS@,$LTLIBOBJS,;t t -CEOF - -_ACEOF - - cat >>$CONFIG_STATUS <<\_ACEOF - # 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_lines=48 - ac_sed_frag=1 # Number of current file. - ac_beg=1 # First line for current file. - ac_end=$ac_max_sed_lines # 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" $tmp/subs.sed >$tmp/subs.frag - else - sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag - fi - if test ! -s $tmp/subs.frag; then - ac_more_lines=false - else - # The purpose of the label and of the branching condition is to - # speed up the sed processing (if there are no `@' at all, there - # is no need to browse any of the substitutions). - # These are the two extra sed commands mentioned above. - (echo ':t - /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed - if test -z "$ac_sed_cmds"; then - ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" - else - ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" - fi - ac_sed_frag=`expr $ac_sed_frag + 1` - ac_beg=$ac_end - ac_end=`expr $ac_end + $ac_max_sed_lines` - fi - done - if test -z "$ac_sed_cmds"; then - ac_sed_cmds=cat +if test -n "$CONFIG_FILES"; then + +_ACEOF + + + +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + cat >conf$$subs.sed <<_ACEOF +SHELL!$SHELL$ac_delim +PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim +PACKAGE_NAME!$PACKAGE_NAME$ac_delim +PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim +PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim +PACKAGE_STRING!$PACKAGE_STRING$ac_delim +PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim +exec_prefix!$exec_prefix$ac_delim +prefix!$prefix$ac_delim +program_transform_name!$program_transform_name$ac_delim +bindir!$bindir$ac_delim +sbindir!$sbindir$ac_delim +libexecdir!$libexecdir$ac_delim +datarootdir!$datarootdir$ac_delim +datadir!$datadir$ac_delim +sysconfdir!$sysconfdir$ac_delim +sharedstatedir!$sharedstatedir$ac_delim +localstatedir!$localstatedir$ac_delim +includedir!$includedir$ac_delim +oldincludedir!$oldincludedir$ac_delim +docdir!$docdir$ac_delim +infodir!$infodir$ac_delim +htmldir!$htmldir$ac_delim +dvidir!$dvidir$ac_delim +pdfdir!$pdfdir$ac_delim +psdir!$psdir$ac_delim +libdir!$libdir$ac_delim +localedir!$localedir$ac_delim +mandir!$mandir$ac_delim +DEFS!$DEFS$ac_delim +ECHO_C!$ECHO_C$ac_delim +ECHO_N!$ECHO_N$ac_delim +ECHO_T!$ECHO_T$ac_delim +LIBS!$LIBS$ac_delim +build_alias!$build_alias$ac_delim +host_alias!$host_alias$ac_delim +target_alias!$target_alias$ac_delim +SET_MAKE!$SET_MAKE$ac_delim +INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim +INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim +INSTALL_DATA!$INSTALL_DATA$ac_delim +MKINSTALLDIRS!$MKINSTALLDIRS$ac_delim +USE_NLS!$USE_NLS$ac_delim +MSGFMT!$MSGFMT$ac_delim +GMSGFMT!$GMSGFMT$ac_delim +XGETTEXT!$XGETTEXT$ac_delim +MSGMERGE!$MSGMERGE$ac_delim +CC!$CC$ac_delim +CFLAGS!$CFLAGS$ac_delim +LDFLAGS!$LDFLAGS$ac_delim +CPPFLAGS!$CPPFLAGS$ac_delim +ac_ct_CC!$ac_ct_CC$ac_delim +EXEEXT!$EXEEXT$ac_delim +OBJEXT!$OBJEXT$ac_delim +build!$build$ac_delim +build_cpu!$build_cpu$ac_delim +build_vendor!$build_vendor$ac_delim +build_os!$build_os$ac_delim +host!$host$ac_delim +host_cpu!$host_cpu$ac_delim +host_vendor!$host_vendor$ac_delim +host_os!$host_os$ac_delim +RANLIB!$RANLIB$ac_delim +CPP!$CPP$ac_delim +GREP!$GREP$ac_delim +EGREP!$EGREP$ac_delim +ALLOCA!$ALLOCA$ac_delim +GLIBC21!$GLIBC21$ac_delim +LIBICONV!$LIBICONV$ac_delim +LTLIBICONV!$LTLIBICONV$ac_delim +INTLBISON!$INTLBISON$ac_delim +BUILD_INCLUDED_LIBINTL!$BUILD_INCLUDED_LIBINTL$ac_delim +USE_INCLUDED_LIBINTL!$USE_INCLUDED_LIBINTL$ac_delim +CATOBJEXT!$CATOBJEXT$ac_delim +DATADIRNAME!$DATADIRNAME$ac_delim +INSTOBJEXT!$INSTOBJEXT$ac_delim +GENCAT!$GENCAT$ac_delim +INTLOBJS!$INTLOBJS$ac_delim +INTL_LIBTOOL_SUFFIX_PREFIX!$INTL_LIBTOOL_SUFFIX_PREFIX$ac_delim +INTLLIBS!$INTLLIBS$ac_delim +LIBINTL!$LIBINTL$ac_delim +LTLIBINTL!$LTLIBINTL$ac_delim +POSUB!$POSUB$ac_delim +ACLOCAL!$ACLOCAL$ac_delim +AUTOCONF!$AUTOCONF$ac_delim +AUTOHEADER!$AUTOHEADER$ac_delim +MAINT!$MAINT$ac_delim +LIBINTL_DEP!$LIBINTL_DEP$ac_delim +INCINTL!$INCINTL$ac_delim +LIBOBJS!$LIBOBJS$ac_delim +LTLIBOBJS!$LTLIBOBJS$ac_delim +_ACEOF + + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 91; then + break + elif $ac_last_try; then + { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi -fi # test -n "$CONFIG_FILES" +done +ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` +if test -n "$ac_eof"; then + ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` + ac_eof=`expr $ac_eof + 1` +fi + +cat >>$CONFIG_STATUS <<_ACEOF +cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end +_ACEOF +sed ' +s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g +s/^/s,@/; s/!/@,|#_!!_#|/ +:n +t n +s/'"$ac_delim"'$/,g/; t +s/$/\\/; p +N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n +' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF +:end +s/|#_!!_#|//g +CEOF$ac_eof _ACEOF + + +# VPATH may cause trouble with some makes, so we remove $(srcdir), +# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=/{ +s/:*\$(srcdir):*/:/ +s/:*\${srcdir}:*/:/ +s/:*@srcdir@:*/:/ +s/^\([^=]*=[ ]*\):*/\1/ +s/:*$// +s/^[^=]*=[ ]*$// +}' +fi + cat >>$CONFIG_STATUS <<\_ACEOF -for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue - # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". - case $ac_file in - - | *:- | *:-:* ) # input from stdin - cat >$tmp/stdin - ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - * ) ac_file_in=$ac_file.in ;; +fi # test -n "$CONFIG_FILES" + + +for ac_tag in :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 +echo "$as_me: error: Invalid tag $ac_tag." >&2;} + { (exit 1); exit 1; }; };; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 +echo "$as_me: error: cannot find input file: $ac_f" >&2;} + { (exit 1); exit 1; }; };; + esac + ac_file_inputs="$ac_file_inputs $ac_f" + done - # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. - ac_dir=`(dirname "$ac_file") 2>/dev/null || + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input="Generated from "`IFS=: + echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + fi + + case $ac_tag in + *:-:* | *:-) cat >"$tmp/stdin";; + esac + ;; + esac + + ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ - X"$ac_file" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || echo X"$ac_file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - { if $as_mkdir_p; then - mkdir -p "$ac_dir" - else - as_dir="$ac_dir" + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + { as_dir="$ac_dir" + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= - while test ! -d "$as_dir"; do - as_dirs="$as_dir $as_dirs" - as_dir=`(dirname "$as_dir") 2>/dev/null || + while :; do + case $as_dir in #( + *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break done - test ! -n "$as_dirs" || mkdir $as_dirs - fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 -echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 +echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } - ac_builddir=. -if test "$ac_dir" != .; then +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A "../" for each directory in $ac_dir_suffix. - ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` -else - ac_dir_suffix= ac_top_builddir= -fi + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix case $srcdir in - .) # No --srcdir option. We are building in place. + .) # We are building in place. ac_srcdir=. - if test -z "$ac_top_builddir"; then - ac_top_srcdir=. - else - ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` - fi ;; - [\\/]* | ?:[\\/]* ) # Absolute path. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir ;; - *) # Relative path. - ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_builddir$srcdir ;; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix -# Do not use `cd foo && pwd` to compute absolute paths, because -# the directories may not exist. -case `pwd` in -.) ac_abs_builddir="$ac_dir";; -*) - case "$ac_dir" in - .) ac_abs_builddir=`pwd`;; - [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; - *) ac_abs_builddir=`pwd`/"$ac_dir";; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_builddir=${ac_top_builddir}.;; -*) - case ${ac_top_builddir}. in - .) ac_abs_top_builddir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; - *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_srcdir=$ac_srcdir;; -*) - case $ac_srcdir in - .) ac_abs_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; - *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_srcdir=$ac_top_srcdir;; -*) - case $ac_top_srcdir in - .) ac_abs_top_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; - *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; - esac;; -esac + case $ac_mode in + :F) + # + # CONFIG_FILE + # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; - *) ac_INSTALL=$ac_top_builddir$INSTALL ;; + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac +_ACEOF - if test x"$ac_file" != x-; then - { echo "$as_me:$LINENO: creating $ac_file" >&5 -echo "$as_me: creating $ac_file" >&6;} - rm -f "$ac_file" - fi - # Let's still pretend it is `configure' which instantiates (i.e., don't - # use $as_me), people would be surprised to read: - # /* config.h. Generated by config.status. */ - if test x"$ac_file" = x-; then - configure_input= - else - configure_input="$ac_file. " - fi - configure_input=$configure_input"Generated from `echo $ac_file_in | - sed 's,.*/,,'` by configure." - - # First look for the input files in the build tree, otherwise in the - # src tree. - ac_file_inputs=`IFS=: - for f in $ac_file_in; do - case $f in - -) echo $tmp/stdin ;; - [\\/$]*) - # Absolute (can't be DOS-style, as IFS=:) - test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - echo "$f";; - *) # Relative - if test -f "$f"; then - # Build tree - echo "$f" - elif test -f "$srcdir/$f"; then - # Source tree - echo "$srcdir/$f" - else - # /dev/null tree - { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - fi;; - esac - done` || { (exit 1); exit 1; } +cat >>$CONFIG_STATUS <<\_ACEOF +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= + +case `sed -n '/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p +' $ac_file_inputs` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac _ACEOF + +# Neutralize VPATH when `$srcdir' = `.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF sed "$ac_vpsub $extrasub @@ -8153,365 +8758,140 @@ _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b -s,@configure_input@,$configure_input,;t t -s,@srcdir@,$ac_srcdir,;t t -s,@abs_srcdir@,$ac_abs_srcdir,;t t -s,@top_srcdir@,$ac_top_srcdir,;t t -s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t -s,@builddir@,$ac_builddir,;t t -s,@abs_builddir@,$ac_abs_builddir,;t t -s,@top_builddir@,$ac_top_builddir,;t t -s,@abs_top_builddir@,$ac_abs_top_builddir,;t t -s,@INSTALL@,$ac_INSTALL,;t t -" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out - rm -f $tmp/stdin - if test x"$ac_file" != x-; then - mv $tmp/out $ac_file - else - cat $tmp/out - rm -f $tmp/out - fi - -done -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF - -# -# CONFIG_HEADER section. -# - -# 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=' ' -ac_dD=',;t' -# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE". -ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' -ac_uB='$,\1#\2define\3' -ac_uC=' ' -ac_uD=',;t' - -for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue - # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". +s&@configure_input@&$configure_input&;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +s&@INSTALL@&$ac_INSTALL&;t t +$ac_datarootdir_hack +" $ac_file_inputs | sed -f "$tmp/subs-1.sed" >$tmp/out + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && + { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined." >&5 +echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined." >&2;} + + rm -f "$tmp/stdin" case $ac_file in - - | *:- | *:-:* ) # input from stdin - cat >$tmp/stdin - ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - * ) ac_file_in=$ac_file.in ;; + -) cat "$tmp/out"; rm -f "$tmp/out";; + *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; esac - - test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5 -echo "$as_me: creating $ac_file" >&6;} - - # First look for the input files in the build tree, otherwise in the - # src tree. - ac_file_inputs=`IFS=: - for f in $ac_file_in; do - case $f in - -) echo $tmp/stdin ;; - [\\/$]*) - # Absolute (can't be DOS-style, as IFS=:) - test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - # Do quote $f, to prevent DOS paths from being IFS'd. - echo "$f";; - *) # Relative - if test -f "$f"; then - # Build tree - echo "$f" - elif test -f "$srcdir/$f"; then - # Source tree - echo "$srcdir/$f" - else - # /dev/null tree - { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - fi;; - esac - done` || { (exit 1); exit 1; } - # Remove the trailing spaces. - sed 's/[ ]*$//' $ac_file_inputs >$tmp/in - -_ACEOF - -# Transform confdefs.h into two sed scripts, `conftest.defines' and -# `conftest.undefs', that substitutes the proper values into -# config.h.in to produce config.h. The first handles `#define' -# templates, and the second `#undef' templates. -# 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.defines conftest.undefs -# Using a here document instead of a string reduces the quoting nightmare. -# Putting comments in sed scripts is not portable. -# -# `end' is used to avoid that the second main sed command (meant for -# 0-ary CPP macros) applies to n-ary macro definitions. -# See the Autoconf documentation for `clear'. -cat >confdef2sed.sed <<\_ACEOF -s/[\\&,]/\\&/g -s,[\\$`],\\&,g -t clear -: clear -s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp -t end -s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp -: end -_ACEOF -# If some macros were called several times there might be several times -# the same #defines, which is useless. Nevertheless, we may not want to -# sort them, since we want the *last* AC-DEFINE to be honored. -uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines -sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs -rm -f confdef2sed.sed - -# This sed command replaces #undef with comments. This is necessary, for + ;; + :H) + # + # CONFIG_HEADER + # +_ACEOF + +# Transform confdefs.h into a sed script `conftest.defines', that +# substitutes the proper values into config.h.in to produce config.h. +rm -f conftest.defines conftest.tail +# First, append a space to every undef/define line, to ease matching. +echo 's/$/ /' >conftest.defines +# Then, protect against being on the right side of a sed subst, or in +# an unquoted here document, in config.status. If some macros were +# called several times there might be several #defines for the same +# symbol, which is useless. But do not sort them, since the last +# AC_DEFINE must be honored. +ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* +# These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where +# NAME is the cpp macro being defined, VALUE is the value it is being given. +# PARAMS is the parameter list in the macro definition--in most cases, it's +# just an empty string. +ac_dA='s,^\\([ #]*\\)[^ ]*\\([ ]*' +ac_dB='\\)[ (].*,\\1define\\2' +ac_dC=' ' +ac_dD=' ,' + +uniq confdefs.h | + sed -n ' + t rset + :rset + s/^[ ]*#[ ]*define[ ][ ]*// + t ok + d + :ok + s/[\\&,]/\\&/g + s/^\('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p + s/^\('"$ac_word_re"'\)[ ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p + ' >>conftest.defines + +# Remove the space that was appended to ease matching. +# Then replace #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.undefs <<\_ACEOF -s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */, -_ACEOF - -# Break up conftest.defines because some shells have a limit on the size -# of here documents, and old seds have small limits too (100 cmds). -echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS -echo ' if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS -echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS -echo ' :' >>$CONFIG_STATUS -rm -f conftest.tail -while grep . conftest.defines >/dev/null +# (The regexp can be short, since the line contains either #define or #undef.) +echo 's/ $// +s,^[ #]*u.*,/* & */,' >>conftest.defines + +# Break up conftest.defines: +ac_max_sed_lines=50 + +# First sed command is: sed -f defines.sed $ac_file_inputs >"$tmp/out1" +# Second one is: sed -f defines.sed "$tmp/out1" >"$tmp/out2" +# Third one will be: sed -f defines.sed "$tmp/out2" >"$tmp/out1" +# et cetera. +ac_in='$ac_file_inputs' +ac_out='"$tmp/out1"' +ac_nxt='"$tmp/out2"' + +while : do - # Write a limited-size here document to $tmp/defines.sed. - echo ' cat >$tmp/defines.sed <>$CONFIG_STATUS - # Speed up: don't consider the non `#define' lines. - echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS - # Work around the forget-to-reset-the-flag bug. - echo 't clr' >>$CONFIG_STATUS - echo ': clr' >>$CONFIG_STATUS - sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS + # Write a here document: + cat >>$CONFIG_STATUS <<_ACEOF + # First, check the format of the line: + cat >"\$tmp/defines.sed" <<\\CEOF +/^[ ]*#[ ]*undef[ ][ ]*$ac_word_re[ ]*\$/b def +/^[ ]*#[ ]*define[ ][ ]*$ac_word_re[( ]/b def +b +:def +_ACEOF + sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS echo 'CEOF - sed -f $tmp/defines.sed $tmp/in >$tmp/out - rm -f $tmp/in - mv $tmp/out $tmp/in -' >>$CONFIG_STATUS - sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail + sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS + ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in + sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail + grep . conftest.tail >/dev/null || break rm -f conftest.defines mv conftest.tail conftest.defines done -rm -f conftest.defines -echo ' fi # grep' >>$CONFIG_STATUS -echo >>$CONFIG_STATUS - -# Break up conftest.undefs because some shells have a limit on the size -# of here documents, and old seds have small limits too (100 cmds). -echo ' # Handle all the #undef templates' >>$CONFIG_STATUS -rm -f conftest.tail -while grep . conftest.undefs >/dev/null -do - # Write a limited-size here document to $tmp/undefs.sed. - echo ' cat >$tmp/undefs.sed <>$CONFIG_STATUS - # Speed up: don't consider the non `#undef' - echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS - # Work around the forget-to-reset-the-flag bug. - echo 't clr' >>$CONFIG_STATUS - echo ': clr' >>$CONFIG_STATUS - sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS - echo 'CEOF - sed -f $tmp/undefs.sed $tmp/in >$tmp/out - rm -f $tmp/in - mv $tmp/out $tmp/in -' >>$CONFIG_STATUS - sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail - rm -f conftest.undefs - mv conftest.tail conftest.undefs -done -rm -f conftest.undefs +rm -f conftest.defines conftest.tail +echo "ac_result=$ac_in" >>$CONFIG_STATUS cat >>$CONFIG_STATUS <<\_ACEOF - # Let's still pretend it is `configure' which instantiates (i.e., don't - # use $as_me), people would be surprised to read: - # /* config.h. Generated by config.status. */ - if test x"$ac_file" = x-; then - echo "/* Generated by configure. */" >$tmp/config.h - else - echo "/* $ac_file. Generated by configure. */" >$tmp/config.h - fi - cat $tmp/in >>$tmp/config.h - rm -f $tmp/in if test x"$ac_file" != x-; then - if diff $ac_file $tmp/config.h >/dev/null 2>&1; then + echo "/* $configure_input */" >"$tmp/config.h" + cat "$ac_result" >>"$tmp/config.h" + if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 echo "$as_me: $ac_file is unchanged" >&6;} else - ac_dir=`(dirname "$ac_file") 2>/dev/null || -$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_file" : 'X\(//\)[^/]' \| \ - X"$ac_file" : 'X\(//\)$' \| \ - X"$ac_file" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$ac_file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - { if $as_mkdir_p; then - mkdir -p "$ac_dir" - else - as_dir="$ac_dir" - as_dirs= - while test ! -d "$as_dir"; do - as_dirs="$as_dir $as_dirs" - as_dir=`(dirname "$as_dir") 2>/dev/null || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - done - test ! -n "$as_dirs" || mkdir $as_dirs - fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 -echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} - { (exit 1); exit 1; }; }; } - rm -f $ac_file - mv $tmp/config.h $ac_file + mv "$tmp/config.h" $ac_file fi else - cat $tmp/config.h - rm -f $tmp/config.h + echo "/* $configure_input */" + cat "$ac_result" fi -done -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF + rm -f "$tmp/out12" + ;; -# -# CONFIG_COMMANDS section. -# -for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue - ac_dest=`echo "$ac_file" | sed 's,:.*,,'` - ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_dir=`(dirname "$ac_dest") 2>/dev/null || -$as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_dest" : 'X\(//\)[^/]' \| \ - X"$ac_dest" : 'X\(//\)$' \| \ - X"$ac_dest" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$ac_dest" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - { if $as_mkdir_p; then - mkdir -p "$ac_dir" - else - as_dir="$ac_dir" - as_dirs= - while test ! -d "$as_dir"; do - as_dirs="$as_dir $as_dirs" - as_dir=`(dirname "$as_dir") 2>/dev/null || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - done - test ! -n "$as_dirs" || mkdir $as_dirs - fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 -echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} - { (exit 1); exit 1; }; }; } - - ac_builddir=. - -if test "$ac_dir" != .; then - ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A "../" for each directory in $ac_dir_suffix. - ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` -else - ac_dir_suffix= ac_top_builddir= -fi - -case $srcdir in - .) # No --srcdir option. We are building in place. - ac_srcdir=. - if test -z "$ac_top_builddir"; then - ac_top_srcdir=. - else - ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` - fi ;; - [\\/]* | ?:[\\/]* ) # Absolute path. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir ;; - *) # Relative path. - ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_builddir$srcdir ;; -esac - -# Do not use `cd foo && pwd` to compute absolute paths, because -# the directories may not exist. -case `pwd` in -.) ac_abs_builddir="$ac_dir";; -*) - case "$ac_dir" in - .) ac_abs_builddir=`pwd`;; - [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; - *) ac_abs_builddir=`pwd`/"$ac_dir";; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_builddir=${ac_top_builddir}.;; -*) - case ${ac_top_builddir}. in - .) ac_abs_top_builddir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; - *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_srcdir=$ac_srcdir;; -*) - case $ac_srcdir in - .) ac_abs_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; - *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_srcdir=$ac_top_srcdir;; -*) - case $ac_top_srcdir in - .) ac_abs_top_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; - *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; - esac;; -esac + :C) { echo "$as_me:$LINENO: executing $ac_file commands" >&5 +echo "$as_me: executing $ac_file commands" >&6;} + ;; + esac - { echo "$as_me:$LINENO: executing $ac_dest commands" >&5 -echo "$as_me: executing $ac_dest commands" >&6;} - case $ac_dest in - default-1 ) + case $ac_file$ac_mode in + "default-1":C) for ac_file in $CONFIG_FILES; do # Support "outfile[:infile[:infile...]]" case "$ac_file" in @@ -8612,11 +8992,10 @@ echo "$as_me: executing $ac_dest commands" >&6;} ;; esac done ;; + esac -done -_ACEOF +done # for ac_tag -cat >>$CONFIG_STATUS <<\_ACEOF { (exit 0); exit 0; } _ACEOF diff --git a/libdecnumber/configure b/libdecnumber/configure index 19ece0f..83c8e53 100755 --- a/libdecnumber/configure +++ b/libdecnumber/configure @@ -1,27 +1,56 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.59 for libdecnumber . +# Generated by GNU Autoconf 2.61 for libdecnumber . # # Report bugs to . # -# Copyright (C) 2003 Free Software Foundation, Inc. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## -# Be Bourne compatible +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' -elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then - set -o posix + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi + + + + +# PATH needs CR +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh fi -DUALCASE=1; export DUALCASE # for MKS sh # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then @@ -31,8 +60,43 @@ else fi +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +as_nl=' +' +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + { (exit 1); exit 1; } +fi + # Work around bugs in pre-3.0 UWIN ksh. -$as_unset ENV MAIL MAILPATH +for as_var in ENV MAIL MAILPATH +do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var +done PS1='$ ' PS2='> ' PS4='+ ' @@ -46,18 +110,19 @@ do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else - $as_unset $as_var + ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. -if expr a : '\(a\)' >/dev/null 2>&1; then +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi -if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false @@ -65,157 +130,388 @@ fi # Name of the executable. -as_me=`$as_basename "$0" || +as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)$' \| \ - . : '\(.\)' 2>/dev/null || + X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } - /^X\/\(\/\/\)$/{ s//\1/; q; } - /^X\/\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` +# CDPATH. +$as_unset CDPATH -# PATH needs CR, and LINENO needs CR and PATH. -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh +if test "x$CONFIG_SHELL" = x; then + if (eval ":") 2>/dev/null; then + as_have_required=yes +else + as_have_required=no fi + if test $as_have_required = yes && (eval ": +(as_func_return () { + (exit \$1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} - as_lineno_1=$LINENO - as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" || { - # Find who we are. Look in the path if we contain no path at all - # relative or not. - case $0 in - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break -done +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi - ;; - esac - # We did not find ourselves, most probably we were run as `sh COMMAND' - # in which case we are not to be found in the path. - if test "x$as_myself" = x; then - as_myself=$0 - fi - if test ! -f "$as_myself"; then - { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 - { (exit 1); exit 1; }; } - fi - case $CONFIG_SHELL in - '') +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = \"\$1\" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test \$exitcode = 0) || { (exit 1); exit 1; } + +( + as_lineno_1=\$LINENO + as_lineno_2=\$LINENO + test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && + test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } +") 2> /dev/null; then + : +else + as_candidate_shells= as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for as_base in sh bash ksh sh5; do - case $as_dir in + case $as_dir in /*) - if ("$as_dir/$as_base" -c ' + for as_base in sh bash ksh sh5; do + as_candidate_shells="$as_candidate_shells $as_dir/$as_base" + done;; + esac +done +IFS=$as_save_IFS + + + for as_shell in $as_candidate_shells $SHELL; do + # Try only shells that exist, to save several forks. + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { ("$as_shell") 2> /dev/null <<\_ASEOF +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi + + +: +_ASEOF +}; then + CONFIG_SHELL=$as_shell + as_have_required=yes + if { "$as_shell" 2> /dev/null <<\_ASEOF +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi + + +: +(as_func_return () { + (exit $1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} + +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi + +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = "$1" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test $exitcode = 0) || { (exit 1); exit 1; } + +( as_lineno_1=$LINENO as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then - $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } - $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } - CONFIG_SHELL=$as_dir/$as_base - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$0" ${1+"$@"} - fi;; - esac - done -done -;; - esac + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } + +_ASEOF +}; then + break +fi + +fi + + done + + if test "x$CONFIG_SHELL" != x; then + for as_var in BASH_ENV ENV + do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var + done + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} +fi + + + if test $as_have_required = no; then + echo This script requires a shell more modern than all the + echo shells that I found on your system. Please install a + echo modern shell, or manually run the script under such a + echo shell if you do have one. + { (exit 1); exit 1; } +fi + + +fi + +fi + + + +(eval "as_func_return () { + (exit \$1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} + +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi + +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = \"\$1\" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test \$exitcode = 0") || { + echo No shell found that supports shell functions. + echo Please tell autoconf@gnu.org about your system, + echo including any error possibly output before this + echo message +} + + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line before each line; the second 'sed' does the real - # work. The second script uses 'N' to pair each line-number line - # with the numbered line, and appends trailing '-' during - # substitution so that $LINENO is not a special case at line end. + # line-number line after each line using $LINENO; the second 'sed' + # does the real work. The second script uses 'N' to pair each + # line-number line with the line containing $LINENO, and appends + # trailing '-' during substitution so that $LINENO is not a special + # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) - sed '=' <$as_myself | + # scripts with optimization help from Paolo Bonzini. Blame Lee + # E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno N - s,$,-, - : loop - s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop - s,-$,, - s,^['$as_cr_digits']*\n,, + s/-\n.*// ' >$as_me.lineno && - chmod +x $as_me.lineno || + chmod +x "$as_me.lineno" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensible to this). - . ./$as_me.lineno + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" # Exit status is that of the last command. exit } -case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in - *c*,-n*) ECHO_N= ECHO_C=' -' ECHO_T=' ' ;; - *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; - *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in +-n*) + case `echo 'x\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + *) ECHO_C='\c';; + esac;; +*) + ECHO_N='-n';; esac -if expr a : '\(a\)' >/dev/null 2>&1; then +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir +fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then - # We could just check for DJGPP; but this test a) works b) is more generic - # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). - if test -f conf$$.exe; then - # Don't use ln at all; we don't have any links + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' - else - as_ln_s='ln -s' - fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi -rm -f conf$$ conf$$.exe conf$$.file +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p=: @@ -224,7 +520,28 @@ else as_mkdir_p=false fi -as_executable_p="test -f" +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' +else + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +fi +as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" @@ -233,39 +550,27 @@ as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" -# IFS -# We need space, tab and new line, in precisely that order. -as_nl=' -' -IFS=" $as_nl" - -# CDPATH. -$as_unset CDPATH +exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` -exec 6>&1 - # # Initializations. # ac_default_prefix=/usr/local +ac_clean_files= ac_config_libobj_dir=. +LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} -# Maximum number of lines to put in a shell here document. -# This variable seems obsolete. It should probably be removed, and -# only ac_max_sed_lines should be used. -: ${ac_max_here_lines=38} - # Identity of this package. PACKAGE_NAME='libdecnumber' PACKAGE_TARNAME='libdecnumber' @@ -277,42 +582,122 @@ ac_unique_file="decNumber.h" # Factoring default headers for most tests. ac_includes_default="\ #include -#if HAVE_SYS_TYPES_H +#ifdef HAVE_SYS_TYPES_H # include #endif -#if HAVE_SYS_STAT_H +#ifdef HAVE_SYS_STAT_H # include #endif -#if STDC_HEADERS +#ifdef STDC_HEADERS # include # include #else -# if HAVE_STDLIB_H +# ifdef HAVE_STDLIB_H # include # endif #endif -#if HAVE_STRING_H -# if !STDC_HEADERS && HAVE_MEMORY_H +#ifdef HAVE_STRING_H +# if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif -#if HAVE_STRINGS_H +#ifdef HAVE_STRINGS_H # include #endif -#if HAVE_INTTYPES_H +#ifdef HAVE_INTTYPES_H # include -#else -# if HAVE_STDINT_H -# include -# endif #endif -#if HAVE_UNISTD_H +#ifdef HAVE_STDINT_H +# include +#endif +#ifdef HAVE_UNISTD_H # include #endif" -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS SET_MAKE CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT RANLIB ac_ct_RANLIB ACLOCAL AUTOCONF AUTOHEADER WARN_CFLAGS WARN_PEDANTIC WERROR CPP EGREP MAINT build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os enable_decimal_float ADDITIONAL_OBJS LIBOBJS LTLIBOBJS' +ac_subst_vars='SHELL +PATH_SEPARATOR +PACKAGE_NAME +PACKAGE_TARNAME +PACKAGE_VERSION +PACKAGE_STRING +PACKAGE_BUGREPORT +exec_prefix +prefix +program_transform_name +bindir +sbindir +libexecdir +datarootdir +datadir +sysconfdir +sharedstatedir +localstatedir +includedir +oldincludedir +docdir +infodir +htmldir +dvidir +pdfdir +psdir +libdir +localedir +mandir +DEFS +ECHO_C +ECHO_N +ECHO_T +LIBS +build_alias +host_alias +target_alias +SET_MAKE +CC +CFLAGS +LDFLAGS +CPPFLAGS +ac_ct_CC +EXEEXT +OBJEXT +RANLIB +ACLOCAL +AUTOCONF +AUTOHEADER +WARN_CFLAGS +WARN_PEDANTIC +WERROR +CPP +GREP +EGREP +MAINT +build +build_cpu +build_vendor +build_os +host +host_cpu +host_vendor +host_os +target +target_cpu +target_vendor +target_os +enable_decimal_float +ADDITIONAL_OBJS +LIBOBJS +LTLIBOBJS' ac_subst_files='' + ac_precious_vars='build_alias +host_alias +target_alias +CC +CFLAGS +LDFLAGS +LIBS +CPPFLAGS +CPP' + # Initialize some variables set by options. ac_init_help= @@ -339,34 +724,48 @@ x_libraries=NONE # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. +# (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' -datadir='${prefix}/share' +datarootdir='${prefix}/share' +datadir='${datarootdir}' 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' +docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' ac_prev= +ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then - eval "$ac_prev=\$ac_option" + eval $ac_prev=\$ac_option ac_prev= continue fi - ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` + case $ac_option in + *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *) ac_optarg=yes ;; + esac # Accept the important Cygnus configure options, so we can diagnose typos. - case $ac_option in + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; @@ -388,33 +787,45 @@ do --config-cache | -C) cache_file=config.cache ;; - -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; - -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ - | --da=*) + -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + -disable-* | --disable-*) ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } - ac_feature=`echo $ac_feature | sed 's/-/_/g'` - eval "enable_$ac_feature=no" ;; + ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` + eval enable_$ac_feature=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } - ac_feature=`echo $ac_feature | sed 's/-/_/g'` - case $ac_option in - *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; - *) ac_optarg=yes ;; - esac - eval "enable_$ac_feature='$ac_optarg'" ;; + ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` + eval enable_$ac_feature=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ @@ -441,6 +852,12 @@ do -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$ac_optarg ;; + -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; @@ -465,13 +882,16 @@ do | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + -localstatedir | --localstatedir | --localstatedi | --localstated \ - | --localstate | --localstat | --localsta | --localst \ - | --locals | --local | --loca | --loc | --lo) + | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ - | --localstate=* | --localstat=* | --localsta=* | --localst=* \ - | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) @@ -536,6 +956,16 @@ do | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$ac_optarg ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; @@ -588,24 +1018,20 @@ do -with-* | --with-*) ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } - ac_package=`echo $ac_package| sed 's/-/_/g'` - case $ac_option in - *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; - *) ac_optarg=yes ;; - esac - eval "with_$ac_package='$ac_optarg'" ;; + ac_package=`echo $ac_package | sed 's/[-.]/_/g'` + eval with_$ac_package=\$ac_optarg ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } - ac_package=`echo $ac_package | sed 's/-/_/g'` - eval "with_$ac_package=no" ;; + ac_package=`echo $ac_package | sed 's/[-.]/_/g'` + eval with_$ac_package=no ;; --x) # Obsolete; use --with-x. @@ -636,8 +1062,7 @@ Try \`$0 --help' for more information." >&2 expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } - ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` - eval "$ac_envvar='$ac_optarg'" + eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) @@ -657,27 +1082,19 @@ if test -n "$ac_prev"; then { (exit 1); exit 1; }; } fi -# Be sure to have absolute paths. -for ac_var in exec_prefix prefix -do - eval ac_val=$`echo $ac_var` - case $ac_val in - [\\/$]* | ?:[\\/]* | NONE | '' ) ;; - *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 - { (exit 1); exit 1; }; };; - esac -done - -# Be sure to have absolute paths. -for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ - localstatedir libdir includedir oldincludedir infodir mandir +# Be sure to have absolute directory names. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir do - eval ac_val=$`echo $ac_var` + eval ac_val=\$$ac_var case $ac_val in - [\\/$]* | ?:[\\/]* ) ;; - *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 - { (exit 1); exit 1; }; };; + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac + { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; } done # There might be people who depend on the old broken behavior: `$host' @@ -704,74 +1121,76 @@ test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + { echo "$as_me: error: Working directory cannot be determined" >&2 + { (exit 1); exit 1; }; } +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + { echo "$as_me: error: pwd does not report name of working directory" >&2 + { (exit 1); exit 1; }; } + + # 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_confdir=`(dirname "$0") 2>/dev/null || + # Try the directory containing this script, then the parent directory. + ac_confdir=`$as_dirname -- "$0" || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || + X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X"$0" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` srcdir=$ac_confdir - if test ! -r $srcdir/$ac_unique_file; then + 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 "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 - { (exit 1); exit 1; }; } - else - { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 +if test ! -r "$srcdir/$ac_unique_file"; then + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } - fi fi -(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || - { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 { (exit 1); exit 1; }; } -srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` -ac_env_build_alias_set=${build_alias+set} -ac_env_build_alias_value=$build_alias -ac_cv_env_build_alias_set=${build_alias+set} -ac_cv_env_build_alias_value=$build_alias -ac_env_host_alias_set=${host_alias+set} -ac_env_host_alias_value=$host_alias -ac_cv_env_host_alias_set=${host_alias+set} -ac_cv_env_host_alias_value=$host_alias -ac_env_target_alias_set=${target_alias+set} -ac_env_target_alias_value=$target_alias -ac_cv_env_target_alias_set=${target_alias+set} -ac_cv_env_target_alias_value=$target_alias -ac_env_CC_set=${CC+set} -ac_env_CC_value=$CC -ac_cv_env_CC_set=${CC+set} -ac_cv_env_CC_value=$CC -ac_env_CFLAGS_set=${CFLAGS+set} -ac_env_CFLAGS_value=$CFLAGS -ac_cv_env_CFLAGS_set=${CFLAGS+set} -ac_cv_env_CFLAGS_value=$CFLAGS -ac_env_LDFLAGS_set=${LDFLAGS+set} -ac_env_LDFLAGS_value=$LDFLAGS -ac_cv_env_LDFLAGS_set=${LDFLAGS+set} -ac_cv_env_LDFLAGS_value=$LDFLAGS -ac_env_CPPFLAGS_set=${CPPFLAGS+set} -ac_env_CPPFLAGS_value=$CPPFLAGS -ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} -ac_cv_env_CPPFLAGS_value=$CPPFLAGS -ac_env_CPP_set=${CPP+set} -ac_env_CPP_value=$CPP -ac_cv_env_CPP_set=${CPP+set} -ac_cv_env_CPP_value=$CPP + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done # # Report the --help message. @@ -800,9 +1219,6 @@ Configuration: -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] -_ACEOF - - cat <<_ACEOF Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] @@ -820,15 +1236,22 @@ Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] - --datadir=DIR read-only architecture-independent data [PREFIX/share] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] - --infodir=DIR info documentation [PREFIX/info] - --mandir=DIR man documentation [PREFIX/man] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root [DATAROOTDIR/doc/libdecnumber] + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF @@ -861,8 +1284,9 @@ Some influential environment variables: CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory - CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have - headers in a nonstandard directory + LIBS libraries to pass to the linker, e.g. -l + CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I if + you have headers in a nonstandard directory CPP C preprocessor Use these variables to override the choices made by `configure' or to help @@ -870,120 +1294,86 @@ it to find libraries and programs with nonstandard names/locations. Report bugs to . _ACEOF +ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. - ac_popdir=`pwd` for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue - test -d $ac_dir || continue + test -d "$ac_dir" || continue ac_builddir=. -if test "$ac_dir" != .; then +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A "../" for each directory in $ac_dir_suffix. - ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` -else - ac_dir_suffix= ac_top_builddir= -fi + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix case $srcdir in - .) # No --srcdir option. We are building in place. + .) # We are building in place. ac_srcdir=. - if test -z "$ac_top_builddir"; then - ac_top_srcdir=. - else - ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` - fi ;; - [\\/]* | ?:[\\/]* ) # Absolute path. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir ;; - *) # Relative path. - ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_builddir$srcdir ;; -esac - -# Do not use `cd foo && pwd` to compute absolute paths, because -# the directories may not exist. -case `pwd` in -.) ac_abs_builddir="$ac_dir";; -*) - case "$ac_dir" in - .) ac_abs_builddir=`pwd`;; - [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; - *) ac_abs_builddir=`pwd`/"$ac_dir";; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_builddir=${ac_top_builddir}.;; -*) - case ${ac_top_builddir}. in - .) ac_abs_top_builddir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; - *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_srcdir=$ac_srcdir;; -*) - case $ac_srcdir in - .) ac_abs_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; - *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; - esac;; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac -case $ac_abs_builddir in -.) ac_abs_top_srcdir=$ac_top_srcdir;; -*) - case $ac_top_srcdir in - .) ac_abs_top_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; - *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; - esac;; -esac - - cd $ac_dir - # Check for guested configure; otherwise get Cygnus style configure. - if test -f $ac_srcdir/configure.gnu; then - echo - $SHELL $ac_srcdir/configure.gnu --help=recursive - elif test -f $ac_srcdir/configure; then - echo - $SHELL $ac_srcdir/configure --help=recursive - elif test -f $ac_srcdir/configure.ac || - test -f $ac_srcdir/configure.in; then - echo - $ac_configure --help +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for guested configure. + if test -f "$ac_srcdir/configure.gnu"; then + echo && + $SHELL "$ac_srcdir/configure.gnu" --help=recursive + elif test -f "$ac_srcdir/configure"; then + echo && + $SHELL "$ac_srcdir/configure" --help=recursive else echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 - fi - cd $ac_popdir + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } done fi -test -n "$ac_init_help" && exit 0 +test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF libdecnumber configure -generated by GNU Autoconf 2.59 +generated by GNU Autoconf 2.61 -Copyright (C) 2003 Free Software Foundation, Inc. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF - exit 0 + exit fi -exec 5>config.log -cat >&5 <<_ACEOF +cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by libdecnumber $as_me , which was -generated by GNU Autoconf 2.59. Invocation command line was +generated by GNU Autoconf 2.61. Invocation command line was $ $0 $@ _ACEOF +exec 5>>config.log { cat <<_ASUNAME ## --------- ## @@ -1002,7 +1392,7 @@ uname -v = `(uname -v) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` -hostinfo = `(hostinfo) 2>/dev/null || echo unknown` +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` @@ -1016,6 +1406,7 @@ do test -z "$as_dir" && as_dir=. echo "PATH: $as_dir" done +IFS=$as_save_IFS } >&5 @@ -1037,7 +1428,6 @@ _ACEOF ac_configure_args= ac_configure_args0= ac_configure_args1= -ac_sep= ac_must_keep_next=false for ac_pass in 1 2 do @@ -1048,7 +1438,7 @@ do -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) + *\'*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in @@ -1070,9 +1460,7 @@ do -* ) ac_must_keep_next=true ;; esac fi - ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" - # Get rid of the leading space. - ac_sep=" " + ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac done @@ -1083,8 +1471,8 @@ $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_ # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. -# WARNING: Be sure not to use single quotes in there, as some shells, -# such as our DU 5.0 friend, will then `close' the trap. +# WARNING: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { @@ -1097,20 +1485,34 @@ trap 'exit_status=$? _ASBOX echo # The following way of writing the cache mishandles newlines in values, -{ +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 +echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + *) $as_unset $ac_var ;; + esac ;; + esac + done (set) 2>&1 | - case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in - *ac_space=\ *) + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) sed -n \ - "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" - ;; + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( *) - sed -n \ - "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; - esac; -} + esac | + sort +) echo cat <<\_ASBOX @@ -1121,22 +1523,28 @@ _ASBOX echo for ac_var in $ac_subst_vars do - eval ac_val=$`echo $ac_var` - echo "$ac_var='"'"'$ac_val'"'"'" + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX -## ------------- ## -## Output files. ## -## ------------- ## +## ------------------- ## +## File substitutions. ## +## ------------------- ## _ASBOX echo for ac_var in $ac_subst_files do - eval ac_val=$`echo $ac_var` - echo "$ac_var='"'"'$ac_val'"'"'" + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + echo "$ac_var='\''$ac_val'\''" done | sort echo fi @@ -1148,26 +1556,24 @@ _ASBOX ## ----------- ## _ASBOX echo - sed "/^$/d" confdefs.h | sort + cat confdefs.h echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" echo "$as_me: exit $exit_status" } >&5 - rm -f core *.core && - rm -rf conftest* confdefs* conf$$* $ac_clean_files && + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status - ' 0 +' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal done ac_signal=0 # 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 +rm -f -r conftest* confdefs.h # Predefined preprocessor variables. @@ -1198,14 +1604,17 @@ _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. -if test -z "$CONFIG_SITE"; then - if test "x$prefix" != xNONE; then - CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" - else - CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" - fi +if test -n "$CONFIG_SITE"; then + set x "$CONFIG_SITE" +elif test "x$prefix" != xNONE; then + set x "$prefix/share/config.site" "$prefix/etc/config.site" +else + set x "$ac_default_prefix/share/config.site" \ + "$ac_default_prefix/etc/config.site" fi -for ac_site_file in $CONFIG_SITE; do +shift +for ac_site_file +do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} @@ -1221,8 +1630,8 @@ if test -r "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in - [\\/]* | ?:[\\/]* ) . $cache_file;; - *) . ./$cache_file;; + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; esac fi else @@ -1234,12 +1643,11 @@ fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false -for ac_var in `(set) 2>&1 | - sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do +for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set - eval ac_old_val="\$ac_cv_env_${ac_var}_value" - eval ac_new_val="\$ac_env_${ac_var}_value" + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 @@ -1264,8 +1672,7 @@ echo "$as_me: current value: $ac_new_val" >&2;} # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) - ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in @@ -1282,12 +1689,6 @@ echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start ov { (exit 1); exit 1; }; } fi -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - @@ -1312,48 +1713,44 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu -case ../config in - [\\/]* | ?:[\\/]* ) ac_macro_dir=../config ;; - *) ac_macro_dir=$srcdir/../config ;; -esac -if test -d "$ac_macro_dir"; then : -else - { { echo "$as_me:$LINENO: error: cannot find macro directory \`../config'" >&5 -echo "$as_me: error: cannot find macro directory \`../config'" >&2;} - { (exit 1); exit 1; }; } -fi # Checks for programs. -echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 -echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6 -set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'` -if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then +{ echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6; } +set x ${MAKE-make}; ac_make=`echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.make <<\_ACEOF +SHELL = /bin/sh all: - @echo 'ac_maketemp="$(MAKE)"' + @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. -eval `${MAKE-make} -f conftest.make 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 +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac rm -f conftest.make fi -if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } SET_MAKE= else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi @@ -1365,8 +1762,8 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -1379,32 +1776,34 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -1417,36 +1816,51 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6 + { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi - CC=$ac_ct_CC + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -1459,74 +1873,34 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - -fi -if test -z "$ac_cv_prog_CC"; then - ac_ct_CC=$CC - # Extract the first word of "cc", so it can be a program name with args. -set dummy cc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="cc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6 + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi - CC=$ac_ct_CC -else - CC="$ac_cv_prog_CC" -fi + fi 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 "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -1540,7 +1914,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue @@ -1551,6 +1925,7 @@ do fi done done +IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. @@ -1568,22 +1943,23 @@ fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then - for ac_prog in cl + for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -1596,36 +1972,38 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC - for ac_prog in cl + for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -1638,29 +2016,45 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6 + { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + test -n "$ac_ct_CC" && break done - CC=$ac_ct_CC + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi fi fi @@ -1673,21 +2067,35 @@ See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. -echo "$as_me:$LINENO:" \ - "checking for C compiler version" >&5 +echo "$as_me:$LINENO: checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` -{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 - (eval $ac_compiler --version &5) 2>&5 +{ (ac_try="$ac_compiler --version >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } -{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 - (eval $ac_compiler -v &5) 2>&5 +{ (ac_try="$ac_compiler -v >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } -{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 - (eval $ac_compiler -V &5) 2>&5 +{ (ac_try="$ac_compiler -V >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } @@ -1712,47 +2120,77 @@ ac_clean_files="$ac_clean_files a.out a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. -echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 -echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 +echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; } ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` -if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 - (eval $ac_link_default) 2>&5 +# +# List of possible output files, starting from the most likely. +# The algorithm is not robust to junk in `.', hence go to wildcards (a.*) +# only as a last resort. b.out is created by i960 compilers. +ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out' +# +# The IRIX 6 linker writes into existing files which may not be +# executable, retaining their permissions. Remove them first so a +# subsequent execution test works. +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { (ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link_default") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then - # Find the output, starting from the most likely. This scheme is -# not robust to junk in `.', hence go to wildcards (a.*) only as a last -# resort. - -# Be careful to initialize this variable, since it used to be cached. -# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. -ac_cv_exeext= -# b.out is created by i960 compilers. -for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out + # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. +# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' +# in a Makefile. We should not override ac_cv_exeext if it was cached, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) - ;; - conftest.$ac_ext ) - # This is the source file. + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) - ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - # FIXME: I believe we export ac_cv_exeext for Libtool, - # but it would be cool to find out if it's true. Does anybody - # maintain Libtool? --akim. - export ac_cv_exeext + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an `-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. break;; * ) break;; esac done +test "$ac_cv_exeext" = no && ac_cv_exeext= + else + ac_file='' +fi + +{ echo "$as_me:$LINENO: result: $ac_file" >&5 +echo "${ECHO_T}$ac_file" >&6; } +if test -z "$ac_file"; then echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -1764,19 +2202,21 @@ See \`config.log' for more details." >&2;} fi ac_exeext=$ac_cv_exeext -echo "$as_me:$LINENO: result: $ac_file" >&5 -echo "${ECHO_T}$ac_file" >&6 -# Check the compiler produces executables we can run. If not, either +# Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. -echo "$as_me:$LINENO: checking whether the C compiler works" >&5 -echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether the C compiler works" >&5 +echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; } # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -1795,22 +2235,27 @@ See \`config.log' for more details." >&2;} fi fi fi -echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 +{ echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save -# Check the compiler produces executables we can run. If not, either +# Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. -echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 -echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 -echo "$as_me:$LINENO: result: $cross_compiling" >&5 -echo "${ECHO_T}$cross_compiling" >&6 - -echo "$as_me:$LINENO: checking for suffix of executables" >&5 -echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +{ echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 +echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; } +{ echo "$as_me:$LINENO: result: $cross_compiling" >&5 +echo "${ECHO_T}$cross_compiling" >&6; } + +{ echo "$as_me:$LINENO: checking for suffix of executables" >&5 +echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; } +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then @@ -1821,9 +2266,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - export ac_cv_exeext break;; * ) break;; esac @@ -1837,18 +2281,135 @@ See \`config.log' for more details." >&2;} fi rm -f conftest$ac_cv_exeext -echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 -echo "${ECHO_T}$ac_cv_exeext" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 +echo "${ECHO_T}$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT -echo "$as_me:$LINENO: checking for suffix of object files" >&5 -echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for suffix of object files" >&5 +echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; } if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute suffix of object files: cannot compile +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 +echo "${ECHO_T}$ac_cv_objext" >&6; } +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +{ echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } +if test "${ac_cv_c_compiler_gnu+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_compiler_gnu=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_compiler_gnu=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +{ echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } +GCC=`test $ac_compiler_gnu = yes && echo yes` +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +{ echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 +echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } +if test "${ac_cv_prog_cc_g+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -1863,42 +2424,30 @@ main () return 0; } _ACEOF -rm -f conftest.o conftest.obj -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; - *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` - break;; - esac -done + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute suffix of object files: cannot compile -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -fi - -rm -f conftest.$ac_cv_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 -echo "${ECHO_T}$ac_cv_objext" >&6 -OBJEXT=$ac_cv_objext -ac_objext=$OBJEXT -echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 -echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 -if test "${ac_cv_c_compiler_gnu+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF + CFLAGS="" + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -1908,59 +2457,36 @@ cat >>conftest.$ac_ext <<_ACEOF int main () { -#ifndef __GNUC__ - choke me -#endif ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_compiler_gnu=yes + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_compiler_gnu=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -ac_cv_c_compiler_gnu=$ac_compiler_gnu - -fi -echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 -echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 -GCC=`test $ac_compiler_gnu = yes && echo yes` -ac_test_CFLAGS=${CFLAGS+set} -ac_save_CFLAGS=$CFLAGS -CFLAGS="-g" -echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 -echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 -if test "${ac_cv_prog_cc_g+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -1976,38 +2502,41 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_prog_cc_g=no + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag fi -echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then @@ -2023,12 +2552,12 @@ else CFLAGS= fi fi -echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 -echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 -if test "${ac_cv_prog_cc_stdc+set}" = set; then +{ echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 +echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } +if test "${ac_cv_prog_cc_c89+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_cv_prog_cc_stdc=no + ac_cv_prog_cc_c89=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -2062,12 +2591,17 @@ static char *f (char * (*g) (char **, int), char **p, ...) /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated - as 'x'. The following induces an error, until -std1 is added to get + as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something - that's true only with -std1. */ + that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; @@ -2082,205 +2616,57 @@ return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; return 0; } _ACEOF -# Don't try gcc -ansi; that turns off useful extensions and -# breaks some systems' header files. -# AIX -qlanglvl=ansi -# Ultrix and OSF/1 -std1 -# HP-UX 10.20 and later -Ae -# HP-UX older versions -Aa -D_HPUX_SOURCE -# SVR4 -Xc -D__EXTENSIONS__ -for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_prog_cc_stdc=$ac_arg -break + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_prog_cc_c89=$ac_arg else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest.err conftest.$ac_objext + +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break done -rm -f conftest.$ac_ext conftest.$ac_objext +rm -f conftest.$ac_ext CC=$ac_save_CC fi - -case "x$ac_cv_prog_cc_stdc" in - x|xno) - echo "$as_me:$LINENO: result: none needed" >&5 -echo "${ECHO_T}none needed" >&6 ;; +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { echo "$as_me:$LINENO: result: none needed" >&5 +echo "${ECHO_T}none needed" >&6; } ;; + xno) + { echo "$as_me:$LINENO: result: unsupported" >&5 +echo "${ECHO_T}unsupported" >&6; } ;; *) - echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 - CC="$CC $ac_cv_prog_cc_stdc" ;; + CC="$CC $ac_cv_prog_cc_c89" + { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; esac -# Some people use a C++ compiler to compile C. Since we use `exit', -# in C++ we need to declare it. In case someone uses the same compiler -# for both compiling C and C++ we need to have the C++ compiler decide -# the declaration of exit, since it's the most demanding environment. -cat >conftest.$ac_ext <<_ACEOF -#ifndef __cplusplus - choke me -#endif -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - for ac_declaration in \ - '' \ - 'extern "C" void std::exit (int) throw (); using std::exit;' \ - 'extern "C" void std::exit (int); using std::exit;' \ - 'extern "C" void exit (int) throw ();' \ - 'extern "C" void exit (int);' \ - 'void exit (int);' -do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_declaration -#include -int -main () -{ -exit (42); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -continue -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_declaration -int -main () -{ -exit (42); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -done -rm -f conftest* -if test -n "$ac_declaration"; then - echo '#ifdef __cplusplus' >>confdefs.h - echo $ac_declaration >>confdefs.h - echo '#endif' >>confdefs.h -fi - -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -2290,8 +2676,8 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -2304,32 +2690,34 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then - echo "$as_me:$LINENO: result: $RANLIB" >&5 -echo "${ECHO_T}$RANLIB" >&6 + { echo "$as_me:$LINENO: result: $RANLIB" >&5 +echo "${ECHO_T}$RANLIB" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -2342,27 +2730,41 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_RANLIB="ranlib" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS - test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":" fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then - echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 -echo "${ECHO_T}$ac_ct_RANLIB" >&6 + { echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 +echo "${ECHO_T}$ac_ct_RANLIB" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi - RANLIB=$ac_ct_RANLIB + if test "x$ac_ct_RANLIB" = x; then + RANLIB=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + RANLIB=$ac_ct_RANLIB + fi else RANLIB="$ac_cv_prog_RANLIB" fi @@ -2373,8 +2775,8 @@ for ac_prog in aclocal do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ACLOCAL+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -2387,25 +2789,27 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ACLOCAL="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi ACLOCAL=$ac_cv_prog_ACLOCAL if test -n "$ACLOCAL"; then - echo "$as_me:$LINENO: result: $ACLOCAL" >&5 -echo "${ECHO_T}$ACLOCAL" >&6 + { echo "$as_me:$LINENO: result: $ACLOCAL" >&5 +echo "${ECHO_T}$ACLOCAL" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + test -n "$ACLOCAL" && break done test -n "$ACLOCAL" || ACLOCAL="$MISSING aclocal" @@ -2414,8 +2818,8 @@ for ac_prog in autoconf do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_AUTOCONF+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -2428,25 +2832,27 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AUTOCONF="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi AUTOCONF=$ac_cv_prog_AUTOCONF if test -n "$AUTOCONF"; then - echo "$as_me:$LINENO: result: $AUTOCONF" >&5 -echo "${ECHO_T}$AUTOCONF" >&6 + { echo "$as_me:$LINENO: result: $AUTOCONF" >&5 +echo "${ECHO_T}$AUTOCONF" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + test -n "$AUTOCONF" && break done test -n "$AUTOCONF" || AUTOCONF="$MISSING autoconf" @@ -2455,8 +2861,8 @@ for ac_prog in autoheader do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_AUTOHEADER+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -2469,25 +2875,27 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AUTOHEADER="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi AUTOHEADER=$ac_cv_prog_AUTOHEADER if test -n "$AUTOHEADER"; then - echo "$as_me:$LINENO: result: $AUTOHEADER" >&5 -echo "${ECHO_T}$AUTOHEADER" >&6 + { echo "$as_me:$LINENO: result: $AUTOHEADER" >&5 +echo "${ECHO_T}$AUTOHEADER" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + test -n "$AUTOHEADER" && break done test -n "$AUTOHEADER" || AUTOHEADER="$MISSING autoheader" @@ -2504,9 +2912,9 @@ for option in -W -Wall -Wwrite-strings -Wstrict-prototypes \ -Wmissing-format-attribute -Wcast-qual; do as_acx_Woption=`echo "acx_cv_prog_cc_warning_$option" | $as_tr_sh` - echo "$as_me:$LINENO: checking whether $CC supports $option" >&5 -echo $ECHO_N "checking whether $CC supports $option... $ECHO_C" >&6 -if eval "test \"\${$as_acx_Woption+set}\" = set"; then + { echo "$as_me:$LINENO: checking whether $CC supports $option" >&5 +echo $ECHO_N "checking whether $CC supports $option... $ECHO_C" >&6; } +if { as_var=$as_acx_Woption; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else CFLAGS="$option" @@ -2526,39 +2934,36 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then eval "$as_acx_Woption=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_acx_Woption=no" + eval "$as_acx_Woption=no" fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_acx_Woption'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_acx_Woption'}'`" >&6 +ac_res=`eval echo '${'$as_acx_Woption'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_acx_Woption'}'` = yes; then WARN_CFLAGS="$WARN_CFLAGS${WARN_CFLAGS:+ }$option" fi @@ -2568,8 +2973,8 @@ CFLAGS="$save_CFLAGS" WARN_PEDANTIC= if test "$GCC" = yes; then - echo "$as_me:$LINENO: checking whether $CC supports -pedantic -Wno-long-long" >&5 -echo $ECHO_N "checking whether $CC supports -pedantic -Wno-long-long... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking whether $CC supports -pedantic -Wno-long-long" >&5 +echo $ECHO_N "checking whether $CC supports -pedantic -Wno-long-long... $ECHO_C" >&6; } if test "${acx_cv_prog_cc_pedantic__Wno_long_long+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -2591,39 +2996,35 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then acx_cv_prog_cc_pedantic__Wno_long_long=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -acx_cv_prog_cc_pedantic__Wno_long_long=no + acx_cv_prog_cc_pedantic__Wno_long_long=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS="$save_CFLAGS" fi -echo "$as_me:$LINENO: result: $acx_cv_prog_cc_pedantic__Wno_long_long" >&5 -echo "${ECHO_T}$acx_cv_prog_cc_pedantic__Wno_long_long" >&6 +{ echo "$as_me:$LINENO: result: $acx_cv_prog_cc_pedantic__Wno_long_long" >&5 +echo "${ECHO_T}$acx_cv_prog_cc_pedantic__Wno_long_long" >&6; } if test $acx_cv_prog_cc_pedantic__Wno_long_long = yes; then WARN_PEDANTIC="$WARN_PEDANTIC${WARN_PEDANTIC:+ }-pedantic -Wno-long-long" fi @@ -2636,13 +3037,13 @@ fi # Only enable with --enable-werror-always until existing warnings are # corrected. WERROR= -# Check whether --enable-werror-always or --disable-werror-always was given. +# Check whether --enable-werror-always was given. if test "${enable_werror_always+set}" = set; then - enableval="$enable_werror_always" - + enableval=$enable_werror_always; else enable_werror_always=no -fi; +fi + if test $enable_werror_always = yes; then WERROR="$WERROR${WERROR:+ }-Werror" fi @@ -2656,8 +3057,8 @@ ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 -echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 +echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -2691,24 +3092,22 @@ cat >>conftest.$ac_ext <<_ACEOF #endif Syntax error _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then : else echo "$as_me: failed program was:" >&5 @@ -2717,9 +3116,10 @@ sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi + rm -f conftest.err conftest.$ac_ext - # OK, works on sane cases. Now check whether non-existent headers + # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -2729,24 +3129,22 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then # Broken: success on invalid input. continue else @@ -2757,6 +3155,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_preproc_ok=: break fi + rm -f conftest.err conftest.$ac_ext done @@ -2774,8 +3173,8 @@ fi else ac_cv_prog_CPP=$CPP fi -echo "$as_me:$LINENO: result: $CPP" >&5 -echo "${ECHO_T}$CPP" >&6 +{ echo "$as_me:$LINENO: result: $CPP" >&5 +echo "${ECHO_T}$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do @@ -2798,24 +3197,22 @@ cat >>conftest.$ac_ext <<_ACEOF #endif Syntax error _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then : else echo "$as_me: failed program was:" >&5 @@ -2824,9 +3221,10 @@ sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi + rm -f conftest.err conftest.$ac_ext - # OK, works on sane cases. Now check whether non-existent headers + # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -2836,73 +3234,219 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + # Broken: success on invalid input. +continue +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Passes both tests. +ac_preproc_ok=: +break +fi + +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + : else - ac_cpp_err=yes + { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." >&5 +echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +{ echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 +echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; } +if test "${ac_cv_path_GREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # Extract the first word of "grep ggrep" to use in msg output +if test -z "$GREP"; then +set dummy grep ggrep; ac_prog_name=$2 +if test "${ac_cv_path_GREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_path_GREP_found=false +# Loop through the user's path and test for each of PROGNAME-LIST +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in grep ggrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue + # Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + echo 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + ac_count=`expr $ac_count + 1` + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + + $ac_path_GREP_found && break 3 + done +done + +done +IFS=$as_save_IFS + + fi -if test -z "$ac_cpp_err"; then - # Broken: success on invalid input. -continue -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - # Passes both tests. -ac_preproc_ok=: -break +GREP="$ac_cv_path_GREP" +if test -z "$GREP"; then + { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} + { (exit 1); exit 1; }; } fi -rm -f conftest.err conftest.$ac_ext -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then - : else - { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details." >&5 -echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } + ac_cv_path_GREP=$GREP fi -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu + +fi +{ echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 +echo "${ECHO_T}$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" -echo "$as_me:$LINENO: checking for egrep" >&5 -echo $ECHO_N "checking for egrep... $ECHO_C" >&6 -if test "${ac_cv_prog_egrep+set}" = set; then +{ echo "$as_me:$LINENO: checking for egrep" >&5 +echo $ECHO_N "checking for egrep... $ECHO_C" >&6; } +if test "${ac_cv_path_EGREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + # Extract the first word of "egrep" to use in msg output +if test -z "$EGREP"; then +set dummy egrep; ac_prog_name=$2 +if test "${ac_cv_path_EGREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if echo a | (grep -E '(a|b)') >/dev/null 2>&1 - then ac_cv_prog_egrep='grep -E' - else ac_cv_prog_egrep='egrep' + ac_path_EGREP_found=false +# Loop through the user's path and test for each of PROGNAME-LIST +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue + # Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + echo 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + ac_count=`expr $ac_count + 1` + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + + $ac_path_EGREP_found && break 3 + done +done + +done +IFS=$as_save_IFS + + +fi + +EGREP="$ac_cv_path_EGREP" +if test -z "$EGREP"; then + { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} + { (exit 1); exit 1; }; } +fi + +else + ac_cv_path_EGREP=$EGREP fi -echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 -echo "${ECHO_T}$ac_cv_prog_egrep" >&6 - EGREP=$ac_cv_prog_egrep -echo "$as_me:$LINENO: checking for ANSI C header files" >&5 -echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 + fi +fi +{ echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 +echo "${ECHO_T}$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + +{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5 +echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; } if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -2926,35 +3470,31 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_header_stdc=no + ac_cv_header_stdc=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. @@ -3010,6 +3550,7 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include +#include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) @@ -3029,18 +3570,27 @@ main () for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) - exit(2); - exit (0); + return 2; + return 0; } _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -3053,12 +3603,14 @@ sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi + + fi fi -echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 -echo "${ECHO_T}$ac_cv_header_stdc" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 +echo "${ECHO_T}$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF @@ -3081,9 +3633,9 @@ for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -3097,38 +3649,35 @@ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_Header=no" + eval "$as_ac_Header=no" fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 @@ -3146,18 +3695,19 @@ done for ac_header in ctype.h stddef.h string.h stdio.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? -echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -3168,41 +3718,37 @@ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_header_compiler=no + ac_header_compiler=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -3211,24 +3757,22 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 @@ -3236,9 +3780,10 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi + rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in @@ -3262,25 +3807,24 @@ echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\ echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX + ( cat <<\_ASBOX ## ----------------------------------- ## ## Report this to gcc-bugs@gcc.gnu.org ## ## ----------------------------------- ## _ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 + ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then @@ -3305,8 +3849,8 @@ for i in stdint.h $inttype_headers; do unset ac_cv_type_int_fast32_t unset ac_cv_type_uint64_t echo $ECHO_N "looking for a compliant stdint.h in $i, $ECHO_C" >&6 - echo "$as_me:$LINENO: checking for uintmax_t" >&5 -echo $ECHO_N "checking for uintmax_t... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for uintmax_t" >&5 +echo $ECHO_N "checking for uintmax_t... $ECHO_C" >&6; } if test "${ac_cv_type_uintmax_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -3319,58 +3863,55 @@ cat >>conftest.$ac_ext <<_ACEOF #include #include <$i> +typedef uintmax_t ac__type_new_; int main () { -if ((uintmax_t *) 0) +if ((ac__type_new_ *) 0) return 0; -if (sizeof (uintmax_t)) +if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_type_uintmax_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_type_uintmax_t=no + ac_cv_type_uintmax_t=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_type_uintmax_t" >&5 -echo "${ECHO_T}$ac_cv_type_uintmax_t" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_type_uintmax_t" >&5 +echo "${ECHO_T}$ac_cv_type_uintmax_t" >&6; } if test $ac_cv_type_uintmax_t = yes; then acx_cv_header_stdint=$i else continue fi - echo "$as_me:$LINENO: checking for uintptr_t" >&5 -echo $ECHO_N "checking for uintptr_t... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for uintptr_t" >&5 +echo $ECHO_N "checking for uintptr_t... $ECHO_C" >&6; } if test "${ac_cv_type_uintptr_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -3383,58 +3924,55 @@ cat >>conftest.$ac_ext <<_ACEOF #include #include <$i> +typedef uintptr_t ac__type_new_; int main () { -if ((uintptr_t *) 0) +if ((ac__type_new_ *) 0) return 0; -if (sizeof (uintptr_t)) +if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_type_uintptr_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_type_uintptr_t=no + ac_cv_type_uintptr_t=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_type_uintptr_t" >&5 -echo "${ECHO_T}$ac_cv_type_uintptr_t" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_type_uintptr_t" >&5 +echo "${ECHO_T}$ac_cv_type_uintptr_t" >&6; } if test $ac_cv_type_uintptr_t = yes; then : else acx_cv_header_stdint_kind="(mostly complete)" fi - echo "$as_me:$LINENO: checking for int_least32_t" >&5 -echo $ECHO_N "checking for int_least32_t... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for int_least32_t" >&5 +echo $ECHO_N "checking for int_least32_t... $ECHO_C" >&6; } if test "${ac_cv_type_int_least32_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -3447,58 +3985,55 @@ cat >>conftest.$ac_ext <<_ACEOF #include #include <$i> +typedef int_least32_t ac__type_new_; int main () { -if ((int_least32_t *) 0) +if ((ac__type_new_ *) 0) return 0; -if (sizeof (int_least32_t)) +if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_type_int_least32_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_type_int_least32_t=no + ac_cv_type_int_least32_t=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_type_int_least32_t" >&5 -echo "${ECHO_T}$ac_cv_type_int_least32_t" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_type_int_least32_t" >&5 +echo "${ECHO_T}$ac_cv_type_int_least32_t" >&6; } if test $ac_cv_type_int_least32_t = yes; then : else acx_cv_header_stdint_kind="(mostly complete)" fi - echo "$as_me:$LINENO: checking for int_fast32_t" >&5 -echo $ECHO_N "checking for int_fast32_t... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for int_fast32_t" >&5 +echo $ECHO_N "checking for int_fast32_t... $ECHO_C" >&6; } if test "${ac_cv_type_int_fast32_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -3511,58 +4046,55 @@ cat >>conftest.$ac_ext <<_ACEOF #include #include <$i> +typedef int_fast32_t ac__type_new_; int main () { -if ((int_fast32_t *) 0) +if ((ac__type_new_ *) 0) return 0; -if (sizeof (int_fast32_t)) +if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_type_int_fast32_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_type_int_fast32_t=no + ac_cv_type_int_fast32_t=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_type_int_fast32_t" >&5 -echo "${ECHO_T}$ac_cv_type_int_fast32_t" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_type_int_fast32_t" >&5 +echo "${ECHO_T}$ac_cv_type_int_fast32_t" >&6; } if test $ac_cv_type_int_fast32_t = yes; then : else acx_cv_header_stdint_kind="(mostly complete)" fi - echo "$as_me:$LINENO: checking for uint64_t" >&5 -echo $ECHO_N "checking for uint64_t... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for uint64_t" >&5 +echo $ECHO_N "checking for uint64_t... $ECHO_C" >&6; } if test "${ac_cv_type_uint64_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -3575,50 +4107,47 @@ cat >>conftest.$ac_ext <<_ACEOF #include #include <$i> +typedef uint64_t ac__type_new_; int main () { -if ((uint64_t *) 0) +if ((ac__type_new_ *) 0) return 0; -if (sizeof (uint64_t)) +if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_type_uint64_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_type_uint64_t=no + ac_cv_type_uint64_t=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_type_uint64_t" >&5 -echo "${ECHO_T}$ac_cv_type_uint64_t" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_type_uint64_t" >&5 +echo "${ECHO_T}$ac_cv_type_uint64_t" >&6; } if test $ac_cv_type_uint64_t = yes; then : else @@ -3634,8 +4163,8 @@ if test "$acx_cv_header_stdint" = stddef.h; then unset ac_cv_type_uint32_t unset ac_cv_type_uint64_t echo $ECHO_N "looking for an incomplete stdint.h in $i, $ECHO_C" >&6 - echo "$as_me:$LINENO: checking for uint32_t" >&5 -echo $ECHO_N "checking for uint32_t... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for uint32_t" >&5 +echo $ECHO_N "checking for uint32_t... $ECHO_C" >&6; } if test "${ac_cv_type_uint32_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -3648,58 +4177,55 @@ cat >>conftest.$ac_ext <<_ACEOF #include #include <$i> +typedef uint32_t ac__type_new_; int main () { -if ((uint32_t *) 0) +if ((ac__type_new_ *) 0) return 0; -if (sizeof (uint32_t)) +if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_type_uint32_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_type_uint32_t=no + ac_cv_type_uint32_t=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_type_uint32_t" >&5 -echo "${ECHO_T}$ac_cv_type_uint32_t" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_type_uint32_t" >&5 +echo "${ECHO_T}$ac_cv_type_uint32_t" >&6; } if test $ac_cv_type_uint32_t = yes; then acx_cv_header_stdint=$i else continue fi - echo "$as_me:$LINENO: checking for uint64_t" >&5 -echo $ECHO_N "checking for uint64_t... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for uint64_t" >&5 +echo $ECHO_N "checking for uint64_t... $ECHO_C" >&6; } if test "${ac_cv_type_uint64_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -3712,53 +4238,50 @@ cat >>conftest.$ac_ext <<_ACEOF #include #include <$i> +typedef uint64_t ac__type_new_; int main () { -if ((uint64_t *) 0) +if ((ac__type_new_ *) 0) return 0; -if (sizeof (uint64_t)) +if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_type_uint64_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_type_uint64_t=no + ac_cv_type_uint64_t=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_type_uint64_t" >&5 -echo "${ECHO_T}$ac_cv_type_uint64_t" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_type_uint64_t" >&5 +echo "${ECHO_T}$ac_cv_type_uint64_t" >&6; } - echo "$as_me:$LINENO: checking for uintptr_t" >&5 -echo $ECHO_N "checking for uintptr_t... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for uintptr_t" >&5 +echo $ECHO_N "checking for uintptr_t... $ECHO_C" >&6; } if test "${ac_cv_type_uintptr_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -3771,50 +4294,47 @@ cat >>conftest.$ac_ext <<_ACEOF #include #include <$i> +typedef uintptr_t ac__type_new_; int main () { -if ((uintptr_t *) 0) +if ((ac__type_new_ *) 0) return 0; -if (sizeof (uintptr_t)) +if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_type_uintptr_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_type_uintptr_t=no + ac_cv_type_uintptr_t=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_type_uintptr_t" >&5 -echo "${ECHO_T}$ac_cv_type_uintptr_t" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_type_uintptr_t" >&5 +echo "${ECHO_T}$ac_cv_type_uintptr_t" >&6; } break done @@ -3825,8 +4345,8 @@ if test "$acx_cv_header_stdint" = stddef.h; then unset ac_cv_type_u_int32_t unset ac_cv_type_u_int64_t echo $ECHO_N "looking for u_intXX_t types in $i, $ECHO_C" >&6 - echo "$as_me:$LINENO: checking for u_int32_t" >&5 -echo $ECHO_N "checking for u_int32_t... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for u_int32_t" >&5 +echo $ECHO_N "checking for u_int32_t... $ECHO_C" >&6; } if test "${ac_cv_type_u_int32_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -3839,58 +4359,55 @@ cat >>conftest.$ac_ext <<_ACEOF #include #include <$i> +typedef u_int32_t ac__type_new_; int main () { -if ((u_int32_t *) 0) +if ((ac__type_new_ *) 0) return 0; -if (sizeof (u_int32_t)) +if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_type_u_int32_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_type_u_int32_t=no + ac_cv_type_u_int32_t=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_type_u_int32_t" >&5 -echo "${ECHO_T}$ac_cv_type_u_int32_t" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_type_u_int32_t" >&5 +echo "${ECHO_T}$ac_cv_type_u_int32_t" >&6; } if test $ac_cv_type_u_int32_t = yes; then acx_cv_header_stdint=$i else continue fi - echo "$as_me:$LINENO: checking for u_int64_t" >&5 -echo $ECHO_N "checking for u_int64_t... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for u_int64_t" >&5 +echo $ECHO_N "checking for u_int64_t... $ECHO_C" >&6; } if test "${ac_cv_type_u_int64_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -3903,50 +4420,47 @@ cat >>conftest.$ac_ext <<_ACEOF #include #include <$i> +typedef u_int64_t ac__type_new_; int main () { -if ((u_int64_t *) 0) +if ((ac__type_new_ *) 0) return 0; -if (sizeof (u_int64_t)) +if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_type_u_int64_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_type_u_int64_t=no + ac_cv_type_u_int64_t=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_type_u_int64_t" >&5 -echo "${ECHO_T}$ac_cv_type_u_int64_t" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_type_u_int64_t" >&5 +echo "${ECHO_T}$ac_cv_type_u_int64_t" >&6; } break done @@ -3963,19 +4477,27 @@ test -z "$ac_cv_type_int_fast32_t" && ac_cv_type_int_fast32_t=no # ----------------- Summarize what we found so far -echo "$as_me:$LINENO: checking what to include in gstdint.h" >&5 -echo $ECHO_N "checking what to include in gstdint.h... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking what to include in gstdint.h" >&5 +echo $ECHO_N "checking what to include in gstdint.h... $ECHO_C" >&6; } -case `$as_basename gstdint.h || +case `$as_basename -- gstdint.h || $as_expr X/gstdint.h : '.*/\([^/][^/]*\)/*$' \| \ Xgstdint.h : 'X\(//\)$' \| \ - Xgstdint.h : 'X\(/\)$' \| \ - . : '\(.\)' 2>/dev/null || + Xgstdint.h : 'X\(/\)' \| . 2>/dev/null || echo X/gstdint.h | - sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } - /^X\/\(\/\/\)$/{ s//\1/; q; } - /^X\/\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` in + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` in stdint.h) { echo "$as_me:$LINENO: WARNING: are you sure you want it there?" >&5 echo "$as_me: WARNING: are you sure you want it there?" >&2;} ;; inttypes.h) { echo "$as_me:$LINENO: WARNING: are you sure you want it there?" >&5 @@ -3983,15 +4505,15 @@ echo "$as_me: WARNING: are you sure you want it there?" >&2;} ;; *) ;; esac -echo "$as_me:$LINENO: result: $acx_cv_header_stdint $acx_cv_header_stdint_kind" >&5 -echo "${ECHO_T}$acx_cv_header_stdint $acx_cv_header_stdint_kind" >&6 +{ echo "$as_me:$LINENO: result: $acx_cv_header_stdint $acx_cv_header_stdint_kind" >&5 +echo "${ECHO_T}$acx_cv_header_stdint $acx_cv_header_stdint_kind" >&6; } # ----------------- done included file, check C basic types -------- # Lacking an uintptr_t? Test size of void * case "$acx_cv_header_stdint:$ac_cv_type_uintptr_t" in - stddef.h:* | *:no) echo "$as_me:$LINENO: checking for void *" >&5 -echo $ECHO_N "checking for void *... $ECHO_C" >&6 + stddef.h:* | *:no) { echo "$as_me:$LINENO: checking for void *" >&5 +echo $ECHO_N "checking for void *... $ECHO_C" >&6; } if test "${ac_cv_type_void_p+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -4002,61 +4524,57 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default +typedef void * ac__type_new_; int main () { -if ((void * *) 0) +if ((ac__type_new_ *) 0) return 0; -if (sizeof (void *)) +if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_type_void_p=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_type_void_p=no + ac_cv_type_void_p=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_type_void_p" >&5 -echo "${ECHO_T}$ac_cv_type_void_p" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_type_void_p" >&5 +echo "${ECHO_T}$ac_cv_type_void_p" >&6; } -echo "$as_me:$LINENO: checking size of void *" >&5 -echo $ECHO_N "checking size of void *... $ECHO_C" >&6 +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ echo "$as_me:$LINENO: checking size of void *" >&5 +echo $ECHO_N "checking size of void *... $ECHO_C" >&6; } if test "${ac_cv_sizeof_void_p+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test "$ac_cv_type_void_p" = yes; then - # The cast to unsigned long works around a bug in the HP C Compiler - # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects - # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. - # This bug is HP SR number 8606223364. if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF @@ -4066,10 +4584,11 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef void * ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (void *))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; test_array [0] = 0 ; @@ -4077,27 +4596,22 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF @@ -4107,10 +4621,11 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef void * ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (void *))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; @@ -4118,56 +4633,53 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo=`expr $ac_mid + 1` - if test $ac_lo -le $ac_mid; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid + 1` + ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef void * ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (void *))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; test_array [0] = 0 ; @@ -4175,27 +4687,22 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF @@ -4205,10 +4712,11 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef void * ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (void *))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; test_array [0] = 0 ; @@ -4216,50 +4724,48 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_hi=`expr '(' $ac_mid ')' - 1` - if test $ac_mid -le $ac_hi; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid` + ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo= ac_hi= + ac_lo= ac_hi= fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` @@ -4270,10 +4776,11 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef void * ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (void *))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; @@ -4281,52 +4788,45 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo=`expr '(' $ac_mid ')' + 1` + ac_lo=`expr '(' $ac_mid ')' + 1` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_void_p=$ac_lo;; -'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (void *), 77 +'') if test "$ac_cv_type_void_p" = yes; then + { { echo "$as_me:$LINENO: error: cannot compute sizeof (void *) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (void *), 77 +echo "$as_me: error: cannot compute sizeof (void *) See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } ;; + { (exit 77); exit 77; }; } + else + ac_cv_sizeof_void_p=0 + fi ;; esac else - if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run test program while cross compiling -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -4334,8 +4834,9 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -long longval () { return (long) (sizeof (void *)); } -unsigned long ulongval () { return (long) (sizeof (void *)); } + typedef void * ac__type_sizeof_; +static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } +static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } #include #include int @@ -4344,35 +4845,44 @@ main () FILE *f = fopen ("conftest.val", "w"); if (! f) - exit (1); - if (((long) (sizeof (void *))) < 0) + return 1; + if (((long int) (sizeof (ac__type_sizeof_))) < 0) { - long i = longval (); - if (i != ((long) (sizeof (void *)))) - exit (1); + long int i = longval (); + if (i != ((long int) (sizeof (ac__type_sizeof_)))) + return 1; fprintf (f, "%ld\n", i); } else { - unsigned long i = ulongval (); - if (i != ((long) (sizeof (void *)))) - exit (1); + unsigned long int i = ulongval (); + if (i != ((long int) (sizeof (ac__type_sizeof_)))) + return 1; fprintf (f, "%lu\n", i); } - exit (ferror (f) || fclose (f) != 0); + return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -4383,22 +4893,25 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) -{ { echo "$as_me:$LINENO: error: cannot compute sizeof (void *), 77 +if test "$ac_cv_type_void_p" = yes; then + { { echo "$as_me:$LINENO: error: cannot compute sizeof (void *) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (void *), 77 +echo "$as_me: error: cannot compute sizeof (void *) See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext + { (exit 77); exit 77; }; } + else + ac_cv_sizeof_void_p=0 + fi fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val -else - ac_cv_sizeof_void_p=0 fi -fi -echo "$as_me:$LINENO: result: $ac_cv_sizeof_void_p" >&5 -echo "${ECHO_T}$ac_cv_sizeof_void_p" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_void_p" >&5 +echo "${ECHO_T}$ac_cv_sizeof_void_p" >&6; } + + + cat >>confdefs.h <<_ACEOF #define SIZEOF_VOID_P $ac_cv_sizeof_void_p _ACEOF @@ -4408,8 +4921,8 @@ esac # Lacking an uint64_t? Test size of long case "$acx_cv_header_stdint:$ac_cv_type_uint64_t:$ac_cv_type_u_int64_t" in - stddef.h:*:* | *:no:no) echo "$as_me:$LINENO: checking for long" >&5 -echo $ECHO_N "checking for long... $ECHO_C" >&6 + stddef.h:*:* | *:no:no) { echo "$as_me:$LINENO: checking for long" >&5 +echo $ECHO_N "checking for long... $ECHO_C" >&6; } if test "${ac_cv_type_long+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -4420,61 +4933,57 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default +typedef long ac__type_new_; int main () { -if ((long *) 0) +if ((ac__type_new_ *) 0) return 0; -if (sizeof (long)) +if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_type_long=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_type_long=no + ac_cv_type_long=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_type_long" >&5 -echo "${ECHO_T}$ac_cv_type_long" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_type_long" >&5 +echo "${ECHO_T}$ac_cv_type_long" >&6; } -echo "$as_me:$LINENO: checking size of long" >&5 -echo $ECHO_N "checking size of long... $ECHO_C" >&6 +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ echo "$as_me:$LINENO: checking size of long" >&5 +echo $ECHO_N "checking size of long... $ECHO_C" >&6; } if test "${ac_cv_sizeof_long+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test "$ac_cv_type_long" = yes; then - # The cast to unsigned long works around a bug in the HP C Compiler - # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects - # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. - # This bug is HP SR number 8606223364. if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF @@ -4484,10 +4993,11 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (long))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; test_array [0] = 0 ; @@ -4495,27 +5005,22 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF @@ -4525,10 +5030,11 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (long))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; @@ -4536,56 +5042,53 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo=`expr $ac_mid + 1` - if test $ac_lo -le $ac_mid; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid + 1` + ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (long))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; test_array [0] = 0 ; @@ -4593,27 +5096,22 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF @@ -4623,10 +5121,11 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (long))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; test_array [0] = 0 ; @@ -4634,50 +5133,48 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_hi=`expr '(' $ac_mid ')' - 1` - if test $ac_mid -le $ac_hi; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid` + ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo= ac_hi= + ac_lo= ac_hi= fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` @@ -4688,10 +5185,11 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (long))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; @@ -4699,52 +5197,45 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo=`expr '(' $ac_mid ')' + 1` + ac_lo=`expr '(' $ac_mid ')' + 1` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_long=$ac_lo;; -'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (long), 77 +'') if test "$ac_cv_type_long" = yes; then + { { echo "$as_me:$LINENO: error: cannot compute sizeof (long) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (long), 77 +echo "$as_me: error: cannot compute sizeof (long) See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } ;; + { (exit 77); exit 77; }; } + else + ac_cv_sizeof_long=0 + fi ;; esac else - if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run test program while cross compiling -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -4752,8 +5243,9 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -long longval () { return (long) (sizeof (long)); } -unsigned long ulongval () { return (long) (sizeof (long)); } + typedef long ac__type_sizeof_; +static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } +static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } #include #include int @@ -4762,35 +5254,44 @@ main () FILE *f = fopen ("conftest.val", "w"); if (! f) - exit (1); - if (((long) (sizeof (long))) < 0) + return 1; + if (((long int) (sizeof (ac__type_sizeof_))) < 0) { - long i = longval (); - if (i != ((long) (sizeof (long)))) - exit (1); + long int i = longval (); + if (i != ((long int) (sizeof (ac__type_sizeof_)))) + return 1; fprintf (f, "%ld\n", i); } else { - unsigned long i = ulongval (); - if (i != ((long) (sizeof (long)))) - exit (1); + unsigned long int i = ulongval (); + if (i != ((long int) (sizeof (ac__type_sizeof_)))) + return 1; fprintf (f, "%lu\n", i); } - exit (ferror (f) || fclose (f) != 0); + return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -4801,22 +5302,25 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) -{ { echo "$as_me:$LINENO: error: cannot compute sizeof (long), 77 +if test "$ac_cv_type_long" = yes; then + { { echo "$as_me:$LINENO: error: cannot compute sizeof (long) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (long), 77 +echo "$as_me: error: cannot compute sizeof (long) See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext + { (exit 77); exit 77; }; } + else + ac_cv_sizeof_long=0 + fi fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val -else - ac_cv_sizeof_long=0 fi -fi -echo "$as_me:$LINENO: result: $ac_cv_sizeof_long" >&5 -echo "${ECHO_T}$ac_cv_sizeof_long" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_long" >&5 +echo "${ECHO_T}$ac_cv_sizeof_long" >&6; } + + + cat >>confdefs.h <<_ACEOF #define SIZEOF_LONG $ac_cv_sizeof_long _ACEOF @@ -4826,8 +5330,8 @@ esac if test $acx_cv_header_stdint = stddef.h; then # Lacking a good header? Test size of everything and deduce all types. - echo "$as_me:$LINENO: checking for int" >&5 -echo $ECHO_N "checking for int... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for int" >&5 +echo $ECHO_N "checking for int... $ECHO_C" >&6; } if test "${ac_cv_type_int+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -4838,61 +5342,57 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default +typedef int ac__type_new_; int main () { -if ((int *) 0) +if ((ac__type_new_ *) 0) return 0; -if (sizeof (int)) +if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_type_int=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_type_int=no + ac_cv_type_int=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_type_int" >&5 -echo "${ECHO_T}$ac_cv_type_int" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_type_int" >&5 +echo "${ECHO_T}$ac_cv_type_int" >&6; } -echo "$as_me:$LINENO: checking size of int" >&5 -echo $ECHO_N "checking size of int... $ECHO_C" >&6 +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ echo "$as_me:$LINENO: checking size of int" >&5 +echo $ECHO_N "checking size of int... $ECHO_C" >&6; } if test "${ac_cv_sizeof_int+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test "$ac_cv_type_int" = yes; then - # The cast to unsigned long works around a bug in the HP C Compiler - # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects - # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. - # This bug is HP SR number 8606223364. if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF @@ -4902,10 +5402,11 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef int ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (int))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; test_array [0] = 0 ; @@ -4913,27 +5414,22 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF @@ -4943,10 +5439,11 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef int ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (int))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; @@ -4954,56 +5451,53 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo=`expr $ac_mid + 1` - if test $ac_lo -le $ac_mid; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid + 1` + ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef int ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (int))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; test_array [0] = 0 ; @@ -5011,27 +5505,22 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF @@ -5041,10 +5530,11 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef int ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (int))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; test_array [0] = 0 ; @@ -5052,50 +5542,48 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_hi=`expr '(' $ac_mid ')' - 1` - if test $ac_mid -le $ac_hi; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid` + ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo= ac_hi= + ac_lo= ac_hi= fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` @@ -5106,10 +5594,11 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef int ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (int))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; @@ -5117,52 +5606,45 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo=`expr '(' $ac_mid ')' + 1` + ac_lo=`expr '(' $ac_mid ')' + 1` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_int=$ac_lo;; -'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (int), 77 +'') if test "$ac_cv_type_int" = yes; then + { { echo "$as_me:$LINENO: error: cannot compute sizeof (int) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (int), 77 +echo "$as_me: error: cannot compute sizeof (int) See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } ;; + { (exit 77); exit 77; }; } + else + ac_cv_sizeof_int=0 + fi ;; esac else - if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run test program while cross compiling -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -5170,8 +5652,9 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -long longval () { return (long) (sizeof (int)); } -unsigned long ulongval () { return (long) (sizeof (int)); } + typedef int ac__type_sizeof_; +static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } +static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } #include #include int @@ -5180,35 +5663,44 @@ main () FILE *f = fopen ("conftest.val", "w"); if (! f) - exit (1); - if (((long) (sizeof (int))) < 0) + return 1; + if (((long int) (sizeof (ac__type_sizeof_))) < 0) { - long i = longval (); - if (i != ((long) (sizeof (int)))) - exit (1); + long int i = longval (); + if (i != ((long int) (sizeof (ac__type_sizeof_)))) + return 1; fprintf (f, "%ld\n", i); } else { - unsigned long i = ulongval (); - if (i != ((long) (sizeof (int)))) - exit (1); + unsigned long int i = ulongval (); + if (i != ((long int) (sizeof (ac__type_sizeof_)))) + return 1; fprintf (f, "%lu\n", i); } - exit (ferror (f) || fclose (f) != 0); + return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -5219,29 +5711,32 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) -{ { echo "$as_me:$LINENO: error: cannot compute sizeof (int), 77 +if test "$ac_cv_type_int" = yes; then + { { echo "$as_me:$LINENO: error: cannot compute sizeof (int) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (int), 77 +echo "$as_me: error: cannot compute sizeof (int) See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext + { (exit 77); exit 77; }; } + else + ac_cv_sizeof_int=0 + fi fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val -else - ac_cv_sizeof_int=0 fi -fi -echo "$as_me:$LINENO: result: $ac_cv_sizeof_int" >&5 -echo "${ECHO_T}$ac_cv_sizeof_int" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_int" >&5 +echo "${ECHO_T}$ac_cv_sizeof_int" >&6; } + + + cat >>confdefs.h <<_ACEOF #define SIZEOF_INT $ac_cv_sizeof_int _ACEOF - echo "$as_me:$LINENO: checking for short" >&5 -echo $ECHO_N "checking for short... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for short" >&5 +echo $ECHO_N "checking for short... $ECHO_C" >&6; } if test "${ac_cv_type_short+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -5252,61 +5747,57 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default +typedef short ac__type_new_; int main () { -if ((short *) 0) +if ((ac__type_new_ *) 0) return 0; -if (sizeof (short)) +if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_type_short=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_type_short=no + ac_cv_type_short=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_type_short" >&5 -echo "${ECHO_T}$ac_cv_type_short" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_type_short" >&5 +echo "${ECHO_T}$ac_cv_type_short" >&6; } -echo "$as_me:$LINENO: checking size of short" >&5 -echo $ECHO_N "checking size of short... $ECHO_C" >&6 +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ echo "$as_me:$LINENO: checking size of short" >&5 +echo $ECHO_N "checking size of short... $ECHO_C" >&6; } if test "${ac_cv_sizeof_short+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test "$ac_cv_type_short" = yes; then - # The cast to unsigned long works around a bug in the HP C Compiler - # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects - # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. - # This bug is HP SR number 8606223364. if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF @@ -5316,10 +5807,11 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef short ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (short))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; test_array [0] = 0 ; @@ -5327,27 +5819,22 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF @@ -5357,10 +5844,11 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef short ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (short))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; @@ -5368,56 +5856,53 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo=`expr $ac_mid + 1` - if test $ac_lo -le $ac_mid; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid + 1` + ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef short ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (short))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; test_array [0] = 0 ; @@ -5425,27 +5910,22 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF @@ -5455,10 +5935,11 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef short ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (short))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; test_array [0] = 0 ; @@ -5466,50 +5947,48 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_hi=`expr '(' $ac_mid ')' - 1` - if test $ac_mid -le $ac_hi; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid` + ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo= ac_hi= + ac_lo= ac_hi= fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` @@ -5520,10 +5999,11 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef short ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (short))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; @@ -5531,52 +6011,45 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo=`expr '(' $ac_mid ')' + 1` + ac_lo=`expr '(' $ac_mid ')' + 1` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_short=$ac_lo;; -'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (short), 77 +'') if test "$ac_cv_type_short" = yes; then + { { echo "$as_me:$LINENO: error: cannot compute sizeof (short) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (short), 77 +echo "$as_me: error: cannot compute sizeof (short) See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } ;; + { (exit 77); exit 77; }; } + else + ac_cv_sizeof_short=0 + fi ;; esac else - if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run test program while cross compiling -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -5584,8 +6057,9 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -long longval () { return (long) (sizeof (short)); } -unsigned long ulongval () { return (long) (sizeof (short)); } + typedef short ac__type_sizeof_; +static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } +static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } #include #include int @@ -5594,35 +6068,44 @@ main () FILE *f = fopen ("conftest.val", "w"); if (! f) - exit (1); - if (((long) (sizeof (short))) < 0) + return 1; + if (((long int) (sizeof (ac__type_sizeof_))) < 0) { - long i = longval (); - if (i != ((long) (sizeof (short)))) - exit (1); + long int i = longval (); + if (i != ((long int) (sizeof (ac__type_sizeof_)))) + return 1; fprintf (f, "%ld\n", i); } else { - unsigned long i = ulongval (); - if (i != ((long) (sizeof (short)))) - exit (1); + unsigned long int i = ulongval (); + if (i != ((long int) (sizeof (ac__type_sizeof_)))) + return 1; fprintf (f, "%lu\n", i); } - exit (ferror (f) || fclose (f) != 0); + return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -5633,29 +6116,32 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) -{ { echo "$as_me:$LINENO: error: cannot compute sizeof (short), 77 +if test "$ac_cv_type_short" = yes; then + { { echo "$as_me:$LINENO: error: cannot compute sizeof (short) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (short), 77 +echo "$as_me: error: cannot compute sizeof (short) See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext + { (exit 77); exit 77; }; } + else + ac_cv_sizeof_short=0 + fi fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val -else - ac_cv_sizeof_short=0 fi -fi -echo "$as_me:$LINENO: result: $ac_cv_sizeof_short" >&5 -echo "${ECHO_T}$ac_cv_sizeof_short" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_short" >&5 +echo "${ECHO_T}$ac_cv_sizeof_short" >&6; } + + + cat >>confdefs.h <<_ACEOF #define SIZEOF_SHORT $ac_cv_sizeof_short _ACEOF - echo "$as_me:$LINENO: checking for char" >&5 -echo $ECHO_N "checking for char... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for char" >&5 +echo $ECHO_N "checking for char... $ECHO_C" >&6; } if test "${ac_cv_type_char+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -5666,61 +6152,57 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default +typedef char ac__type_new_; int main () { -if ((char *) 0) +if ((ac__type_new_ *) 0) return 0; -if (sizeof (char)) +if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_type_char=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_type_char=no + ac_cv_type_char=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_type_char" >&5 -echo "${ECHO_T}$ac_cv_type_char" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_type_char" >&5 +echo "${ECHO_T}$ac_cv_type_char" >&6; } -echo "$as_me:$LINENO: checking size of char" >&5 -echo $ECHO_N "checking size of char... $ECHO_C" >&6 +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ echo "$as_me:$LINENO: checking size of char" >&5 +echo $ECHO_N "checking size of char... $ECHO_C" >&6; } if test "${ac_cv_sizeof_char+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test "$ac_cv_type_char" = yes; then - # The cast to unsigned long works around a bug in the HP C Compiler - # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects - # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. - # This bug is HP SR number 8606223364. if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF @@ -5730,10 +6212,11 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef char ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (char))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; test_array [0] = 0 ; @@ -5741,27 +6224,22 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF @@ -5771,10 +6249,11 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef char ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (char))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; @@ -5782,56 +6261,53 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo=`expr $ac_mid + 1` - if test $ac_lo -le $ac_mid; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid + 1` + ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef char ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (char))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; test_array [0] = 0 ; @@ -5839,27 +6315,22 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF @@ -5869,10 +6340,11 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef char ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (char))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; test_array [0] = 0 ; @@ -5880,50 +6352,48 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_hi=`expr '(' $ac_mid ')' - 1` - if test $ac_mid -le $ac_hi; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid` + ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo= ac_hi= + ac_lo= ac_hi= fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` @@ -5934,10 +6404,11 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef char ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (char))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; @@ -5945,52 +6416,45 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo=`expr '(' $ac_mid ')' + 1` + ac_lo=`expr '(' $ac_mid ')' + 1` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_char=$ac_lo;; -'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (char), 77 +'') if test "$ac_cv_type_char" = yes; then + { { echo "$as_me:$LINENO: error: cannot compute sizeof (char) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (char), 77 +echo "$as_me: error: cannot compute sizeof (char) See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } ;; + { (exit 77); exit 77; }; } + else + ac_cv_sizeof_char=0 + fi ;; esac else - if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run test program while cross compiling -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -5998,8 +6462,9 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -long longval () { return (long) (sizeof (char)); } -unsigned long ulongval () { return (long) (sizeof (char)); } + typedef char ac__type_sizeof_; +static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } +static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } #include #include int @@ -6008,35 +6473,44 @@ main () FILE *f = fopen ("conftest.val", "w"); if (! f) - exit (1); - if (((long) (sizeof (char))) < 0) + return 1; + if (((long int) (sizeof (ac__type_sizeof_))) < 0) { - long i = longval (); - if (i != ((long) (sizeof (char)))) - exit (1); + long int i = longval (); + if (i != ((long int) (sizeof (ac__type_sizeof_)))) + return 1; fprintf (f, "%ld\n", i); } else { - unsigned long i = ulongval (); - if (i != ((long) (sizeof (char)))) - exit (1); + unsigned long int i = ulongval (); + if (i != ((long int) (sizeof (ac__type_sizeof_)))) + return 1; fprintf (f, "%lu\n", i); } - exit (ferror (f) || fclose (f) != 0); + return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -6047,41 +6521,44 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) -{ { echo "$as_me:$LINENO: error: cannot compute sizeof (char), 77 +if test "$ac_cv_type_char" = yes; then + { { echo "$as_me:$LINENO: error: cannot compute sizeof (char) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (char), 77 +echo "$as_me: error: cannot compute sizeof (char) See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext + { (exit 77); exit 77; }; } + else + ac_cv_sizeof_char=0 + fi fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val -else - ac_cv_sizeof_char=0 fi -fi -echo "$as_me:$LINENO: result: $ac_cv_sizeof_char" >&5 -echo "${ECHO_T}$ac_cv_sizeof_char" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_char" >&5 +echo "${ECHO_T}$ac_cv_sizeof_char" >&6; } + + + cat >>confdefs.h <<_ACEOF #define SIZEOF_CHAR $ac_cv_sizeof_char _ACEOF - echo "$as_me:$LINENO: checking for type equivalent to int8_t" >&5 -echo $ECHO_N "checking for type equivalent to int8_t... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for type equivalent to int8_t" >&5 +echo $ECHO_N "checking for type equivalent to int8_t... $ECHO_C" >&6; } case "$ac_cv_sizeof_char" in 1) acx_cv_type_int8_t=char ;; *) { { echo "$as_me:$LINENO: error: no 8-bit type" >&5 echo "$as_me: error: no 8-bit type" >&2;} { (exit please report a bug); exit please report a bug; }; } esac - echo "$as_me:$LINENO: result: $acx_cv_type_int8_t" >&5 -echo "${ECHO_T}$acx_cv_type_int8_t" >&6 + { echo "$as_me:$LINENO: result: $acx_cv_type_int8_t" >&5 +echo "${ECHO_T}$acx_cv_type_int8_t" >&6; } - echo "$as_me:$LINENO: checking for type equivalent to int16_t" >&5 -echo $ECHO_N "checking for type equivalent to int16_t... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for type equivalent to int16_t" >&5 +echo $ECHO_N "checking for type equivalent to int16_t... $ECHO_C" >&6; } case "$ac_cv_sizeof_int:$ac_cv_sizeof_short" in 2:*) acx_cv_type_int16_t=int ;; *:2) acx_cv_type_int16_t=short ;; @@ -6089,11 +6566,11 @@ echo $ECHO_N "checking for type equivalent to int16_t... $ECHO_C" >&6 echo "$as_me: error: no 16-bit type" >&2;} { (exit please report a bug); exit please report a bug; }; } esac - echo "$as_me:$LINENO: result: $acx_cv_type_int16_t" >&5 -echo "${ECHO_T}$acx_cv_type_int16_t" >&6 + { echo "$as_me:$LINENO: result: $acx_cv_type_int16_t" >&5 +echo "${ECHO_T}$acx_cv_type_int16_t" >&6; } - echo "$as_me:$LINENO: checking for type equivalent to int32_t" >&5 -echo $ECHO_N "checking for type equivalent to int32_t... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for type equivalent to int32_t" >&5 +echo $ECHO_N "checking for type equivalent to int32_t... $ECHO_C" >&6; } case "$ac_cv_sizeof_int:$ac_cv_sizeof_long" in 4:*) acx_cv_type_int32_t=int ;; *:4) acx_cv_type_int32_t=long ;; @@ -6101,8 +6578,8 @@ echo $ECHO_N "checking for type equivalent to int32_t... $ECHO_C" >&6 echo "$as_me: error: no 32-bit type" >&2;} { (exit please report a bug); exit please report a bug; }; } esac - echo "$as_me:$LINENO: result: $acx_cv_type_int32_t" >&5 -echo "${ECHO_T}$acx_cv_type_int32_t" >&6 + { echo "$as_me:$LINENO: result: $acx_cv_type_int32_t" >&5 +echo "${ECHO_T}$acx_cv_type_int32_t" >&6; } fi # These tests are here to make the output prettier @@ -6111,17 +6588,17 @@ if test "$ac_cv_type_uint64_t" != yes && test "$ac_cv_type_u_int64_t" != yes; th case "$ac_cv_sizeof_long" in 8) acx_cv_type_int64_t=long ;; esac - echo "$as_me:$LINENO: checking for type equivalent to int64_t" >&5 -echo $ECHO_N "checking for type equivalent to int64_t... $ECHO_C" >&6 - echo "$as_me:$LINENO: result: ${acx_cv_type_int64_t-'using preprocessor symbols'}" >&5 -echo "${ECHO_T}${acx_cv_type_int64_t-'using preprocessor symbols'}" >&6 + { echo "$as_me:$LINENO: checking for type equivalent to int64_t" >&5 +echo $ECHO_N "checking for type equivalent to int64_t... $ECHO_C" >&6; } + { echo "$as_me:$LINENO: result: ${acx_cv_type_int64_t-'using preprocessor symbols'}" >&5 +echo "${ECHO_T}${acx_cv_type_int64_t-'using preprocessor symbols'}" >&6; } fi # Now we can use the above types if test "$ac_cv_type_uintptr_t" != yes; then - echo "$as_me:$LINENO: checking for type equivalent to intptr_t" >&5 -echo $ECHO_N "checking for type equivalent to intptr_t... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for type equivalent to intptr_t" >&5 +echo $ECHO_N "checking for type equivalent to intptr_t... $ECHO_C" >&6; } case $ac_cv_sizeof_void_p in 2) acx_cv_type_intptr_t=int16_t ;; 4) acx_cv_type_intptr_t=int32_t ;; @@ -6130,19 +6607,19 @@ echo $ECHO_N "checking for type equivalent to intptr_t... $ECHO_C" >&6 echo "$as_me: error: no equivalent for intptr_t" >&2;} { (exit please report a bug); exit please report a bug; }; } esac - echo "$as_me:$LINENO: result: $acx_cv_type_intptr_t" >&5 -echo "${ECHO_T}$acx_cv_type_intptr_t" >&6 + { echo "$as_me:$LINENO: result: $acx_cv_type_intptr_t" >&5 +echo "${ECHO_T}$acx_cv_type_intptr_t" >&6; } fi # ----------------- done all checks, emit header ------------- - ac_config_commands="$ac_config_commands gstdint.h" +ac_config_commands="$ac_config_commands gstdint.h" # Checks for typedefs, structures, and compiler characteristics. -echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 -echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 +echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6; } if test "${ac_cv_c_const+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -6160,10 +6637,10 @@ main () #ifndef __cplusplus /* Ultrix mips cc rejects this. */ typedef int charset[2]; - const charset x; + const charset cs; /* SunOS 4.1.1 cc rejects this. */ - char const *const *ccp; - char **p; + char const *const *pcpcc; + char **ppc; /* NEC SVR4.0.2 mips cc rejects this. */ struct point {int x, y;}; static struct point const zero = {0,0}; @@ -6172,16 +6649,17 @@ main () an arm of an if-expression whose if-part is not a constant expression */ const char *g = "string"; - ccp = &g + (g ? g-g : 0); + pcpcc = &g + (g ? g-g : 0); /* HPUX 7.0 cc rejects these. */ - ++ccp; - p = (char**) ccp; - ccp = (char const *const *) p; + ++pcpcc; + ppc = (char**) pcpcc; + pcpcc = (char const *const *) ppc; { /* SCO 3.2v4 cc rejects this. */ char *t; char const *s = 0 ? (char *) 0 : (char const *) 0; *t++ = 0; + if (s) return 0; } { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ int x[] = {25, 17}; @@ -6200,7 +6678,9 @@ main () } { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ const int foo = 10; + if (!foo) return 0; } + return !cs[0] && !zero.x; #endif ; @@ -6208,38 +6688,34 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_c_const=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_c_const=no + ac_cv_c_const=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5 -echo "${ECHO_T}$ac_cv_c_const" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5 +echo "${ECHO_T}$ac_cv_c_const" >&6; } if test $ac_cv_c_const = no; then cat >>confdefs.h <<\_ACEOF @@ -6248,8 +6724,8 @@ _ACEOF fi -echo "$as_me:$LINENO: checking for off_t" >&5 -echo $ECHO_N "checking for off_t... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for off_t" >&5 +echo $ECHO_N "checking for off_t... $ECHO_C" >&6; } if test "${ac_cv_type_off_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -6260,62 +6736,59 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default +typedef off_t ac__type_new_; int main () { -if ((off_t *) 0) +if ((ac__type_new_ *) 0) return 0; -if (sizeof (off_t)) +if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_type_off_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_type_off_t=no + ac_cv_type_off_t=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_type_off_t" >&5 -echo "${ECHO_T}$ac_cv_type_off_t" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_type_off_t" >&5 +echo "${ECHO_T}$ac_cv_type_off_t" >&6; } if test $ac_cv_type_off_t = yes; then : else cat >>confdefs.h <<_ACEOF -#define off_t long +#define off_t long int _ACEOF fi -echo "$as_me:$LINENO: checking for int" >&5 -echo $ECHO_N "checking for int... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for int" >&5 +echo $ECHO_N "checking for int... $ECHO_C" >&6; } if test "${ac_cv_type_int+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -6326,61 +6799,57 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default +typedef int ac__type_new_; int main () { -if ((int *) 0) +if ((ac__type_new_ *) 0) return 0; -if (sizeof (int)) +if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_type_int=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_type_int=no + ac_cv_type_int=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_type_int" >&5 -echo "${ECHO_T}$ac_cv_type_int" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_type_int" >&5 +echo "${ECHO_T}$ac_cv_type_int" >&6; } -echo "$as_me:$LINENO: checking size of int" >&5 -echo $ECHO_N "checking size of int... $ECHO_C" >&6 +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ echo "$as_me:$LINENO: checking size of int" >&5 +echo $ECHO_N "checking size of int... $ECHO_C" >&6; } if test "${ac_cv_sizeof_int+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test "$ac_cv_type_int" = yes; then - # The cast to unsigned long works around a bug in the HP C Compiler - # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects - # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. - # This bug is HP SR number 8606223364. if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF @@ -6390,10 +6859,11 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef int ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (int))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; test_array [0] = 0 ; @@ -6401,27 +6871,22 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF @@ -6431,10 +6896,11 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef int ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (int))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; @@ -6442,56 +6908,53 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo=`expr $ac_mid + 1` - if test $ac_lo -le $ac_mid; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid + 1` + ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef int ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (int))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; test_array [0] = 0 ; @@ -6499,27 +6962,22 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF @@ -6529,10 +6987,11 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef int ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (int))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; test_array [0] = 0 ; @@ -6540,50 +6999,48 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_hi=`expr '(' $ac_mid ')' - 1` - if test $ac_mid -le $ac_hi; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid` + ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo= ac_hi= + ac_lo= ac_hi= fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` @@ -6594,10 +7051,11 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef int ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (int))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; @@ -6605,52 +7063,45 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo=`expr '(' $ac_mid ')' + 1` + ac_lo=`expr '(' $ac_mid ')' + 1` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_int=$ac_lo;; -'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (int), 77 +'') if test "$ac_cv_type_int" = yes; then + { { echo "$as_me:$LINENO: error: cannot compute sizeof (int) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (int), 77 +echo "$as_me: error: cannot compute sizeof (int) See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } ;; + { (exit 77); exit 77; }; } + else + ac_cv_sizeof_int=0 + fi ;; esac else - if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run test program while cross compiling -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -6658,8 +7109,9 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -long longval () { return (long) (sizeof (int)); } -unsigned long ulongval () { return (long) (sizeof (int)); } + typedef int ac__type_sizeof_; +static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } +static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } #include #include int @@ -6668,35 +7120,44 @@ main () FILE *f = fopen ("conftest.val", "w"); if (! f) - exit (1); - if (((long) (sizeof (int))) < 0) + return 1; + if (((long int) (sizeof (ac__type_sizeof_))) < 0) { - long i = longval (); - if (i != ((long) (sizeof (int)))) - exit (1); + long int i = longval (); + if (i != ((long int) (sizeof (ac__type_sizeof_)))) + return 1; fprintf (f, "%ld\n", i); } else { - unsigned long i = ulongval (); - if (i != ((long) (sizeof (int)))) - exit (1); + unsigned long int i = ulongval (); + if (i != ((long int) (sizeof (ac__type_sizeof_)))) + return 1; fprintf (f, "%lu\n", i); } - exit (ferror (f) || fclose (f) != 0); + return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -6707,29 +7168,32 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) -{ { echo "$as_me:$LINENO: error: cannot compute sizeof (int), 77 +if test "$ac_cv_type_int" = yes; then + { { echo "$as_me:$LINENO: error: cannot compute sizeof (int) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (int), 77 +echo "$as_me: error: cannot compute sizeof (int) See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext + { (exit 77); exit 77; }; } + else + ac_cv_sizeof_int=0 + fi fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val -else - ac_cv_sizeof_int=0 fi -fi -echo "$as_me:$LINENO: result: $ac_cv_sizeof_int" >&5 -echo "${ECHO_T}$ac_cv_sizeof_int" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_int" >&5 +echo "${ECHO_T}$ac_cv_sizeof_int" >&6; } + + + cat >>confdefs.h <<_ACEOF #define SIZEOF_INT $ac_cv_sizeof_int _ACEOF -echo "$as_me:$LINENO: checking for long" >&5 -echo $ECHO_N "checking for long... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for long" >&5 +echo $ECHO_N "checking for long... $ECHO_C" >&6; } if test "${ac_cv_type_long+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -6740,61 +7204,57 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default +typedef long ac__type_new_; int main () { -if ((long *) 0) +if ((ac__type_new_ *) 0) return 0; -if (sizeof (long)) +if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_type_long=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_type_long=no + ac_cv_type_long=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_type_long" >&5 -echo "${ECHO_T}$ac_cv_type_long" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_type_long" >&5 +echo "${ECHO_T}$ac_cv_type_long" >&6; } -echo "$as_me:$LINENO: checking size of long" >&5 -echo $ECHO_N "checking size of long... $ECHO_C" >&6 +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ echo "$as_me:$LINENO: checking size of long" >&5 +echo $ECHO_N "checking size of long... $ECHO_C" >&6; } if test "${ac_cv_sizeof_long+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test "$ac_cv_type_long" = yes; then - # The cast to unsigned long works around a bug in the HP C Compiler - # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects - # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. - # This bug is HP SR number 8606223364. if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF @@ -6804,10 +7264,11 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (long))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; test_array [0] = 0 ; @@ -6815,27 +7276,22 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF @@ -6845,10 +7301,11 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (long))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; @@ -6856,56 +7313,53 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo=`expr $ac_mid + 1` - if test $ac_lo -le $ac_mid; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid + 1` + ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (long))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; test_array [0] = 0 ; @@ -6913,27 +7367,22 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF @@ -6943,10 +7392,11 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (long))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; test_array [0] = 0 ; @@ -6954,50 +7404,48 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_hi=`expr '(' $ac_mid ')' - 1` - if test $ac_mid -le $ac_hi; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid` + ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo= ac_hi= + ac_lo= ac_hi= fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` @@ -7008,10 +7456,11 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (long))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; @@ -7019,52 +7468,45 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo=`expr '(' $ac_mid ')' + 1` + ac_lo=`expr '(' $ac_mid ')' + 1` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_long=$ac_lo;; -'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (long), 77 +'') if test "$ac_cv_type_long" = yes; then + { { echo "$as_me:$LINENO: error: cannot compute sizeof (long) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (long), 77 +echo "$as_me: error: cannot compute sizeof (long) See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } ;; + { (exit 77); exit 77; }; } + else + ac_cv_sizeof_long=0 + fi ;; esac else - if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run test program while cross compiling -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -7072,8 +7514,9 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -long longval () { return (long) (sizeof (long)); } -unsigned long ulongval () { return (long) (sizeof (long)); } + typedef long ac__type_sizeof_; +static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } +static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } #include #include int @@ -7082,35 +7525,44 @@ main () FILE *f = fopen ("conftest.val", "w"); if (! f) - exit (1); - if (((long) (sizeof (long))) < 0) + return 1; + if (((long int) (sizeof (ac__type_sizeof_))) < 0) { - long i = longval (); - if (i != ((long) (sizeof (long)))) - exit (1); + long int i = longval (); + if (i != ((long int) (sizeof (ac__type_sizeof_)))) + return 1; fprintf (f, "%ld\n", i); } else { - unsigned long i = ulongval (); - if (i != ((long) (sizeof (long)))) - exit (1); + unsigned long int i = ulongval (); + if (i != ((long int) (sizeof (ac__type_sizeof_)))) + return 1; fprintf (f, "%lu\n", i); } - exit (ferror (f) || fclose (f) != 0); + return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -7121,22 +7573,25 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) -{ { echo "$as_me:$LINENO: error: cannot compute sizeof (long), 77 +if test "$ac_cv_type_long" = yes; then + { { echo "$as_me:$LINENO: error: cannot compute sizeof (long) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (long), 77 +echo "$as_me: error: cannot compute sizeof (long) See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext + { (exit 77); exit 77; }; } + else + ac_cv_sizeof_long=0 + fi fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val -else - ac_cv_sizeof_long=0 fi -fi -echo "$as_me:$LINENO: result: $ac_cv_sizeof_long" >&5 -echo "${ECHO_T}$ac_cv_sizeof_long" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_long" >&5 +echo "${ECHO_T}$ac_cv_sizeof_long" >&6; } + + + cat >>confdefs.h <<_ACEOF #define SIZEOF_LONG $ac_cv_sizeof_long _ACEOF @@ -7144,8 +7599,8 @@ _ACEOF # Checks for library functions. -echo "$as_me:$LINENO: checking for ANSI C header files" >&5 -echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5 +echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; } if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -7169,35 +7624,31 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_header_stdc=no + ac_cv_header_stdc=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. @@ -7253,6 +7704,7 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include +#include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) @@ -7272,18 +7724,27 @@ main () for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) - exit(2); - exit (0); + return 2; + return 0; } _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -7296,12 +7757,14 @@ sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi + + fi fi -echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 -echo "${ECHO_T}$ac_cv_header_stdc" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 +echo "${ECHO_T}$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF @@ -7311,13 +7774,13 @@ _ACEOF fi -# Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. +# Check whether --enable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then - enableval="$enable_maintainer_mode" - + enableval=$enable_maintainer_mode; else enable_maintainer_mode=no -fi; +fi + if test "x$enable_maintainer_mode" = xno; then MAINT='#' @@ -7327,104 +7790,154 @@ fi ac_aux_dir= -for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do - if test -f $ac_dir/install-sh; then +for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; 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 + elif 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/shtool; then + elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then - { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5 -echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;} + { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5 +echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;} { (exit 1); exit 1; }; } fi -ac_config_guess="$SHELL $ac_aux_dir/config.guess" -ac_config_sub="$SHELL $ac_aux_dir/config.sub" -ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. +ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. +ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. + # Make sure we can run config.sub. -$ac_config_sub sun4 >/dev/null 2>&1 || - { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5 -echo "$as_me: error: cannot run $ac_config_sub" >&2;} +$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || + { { echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5 +echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;} { (exit 1); exit 1; }; } -echo "$as_me:$LINENO: checking build system type" >&5 -echo $ECHO_N "checking build system type... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking build system type" >&5 +echo $ECHO_N "checking build system type... $ECHO_C" >&6; } if test "${ac_cv_build+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_cv_build_alias=$build_alias -test -z "$ac_cv_build_alias" && - ac_cv_build_alias=`$ac_config_guess` -test -z "$ac_cv_build_alias" && + ac_build_alias=$build_alias +test "x$ac_build_alias" = x && + ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` +test "x$ac_build_alias" = x && { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 echo "$as_me: error: cannot guess build type; you must specify one" >&2;} { (exit 1); exit 1; }; } -ac_cv_build=`$ac_config_sub $ac_cv_build_alias` || - { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5 -echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;} +ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || + { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5 +echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;} { (exit 1); exit 1; }; } fi -echo "$as_me:$LINENO: result: $ac_cv_build" >&5 -echo "${ECHO_T}$ac_cv_build" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_build" >&5 +echo "${ECHO_T}$ac_cv_build" >&6; } +case $ac_cv_build in +*-*-*) ;; +*) { { echo "$as_me:$LINENO: error: invalid value of canonical build" >&5 +echo "$as_me: error: invalid value of canonical build" >&2;} + { (exit 1); exit 1; }; };; +esac build=$ac_cv_build -build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` - - -echo "$as_me:$LINENO: checking host system type" >&5 -echo $ECHO_N "checking host system type... $ECHO_C" >&6 +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_build +shift +build_cpu=$1 +build_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +build_os=$* +IFS=$ac_save_IFS +case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac + + +{ echo "$as_me:$LINENO: checking host system type" >&5 +echo $ECHO_N "checking host system type... $ECHO_C" >&6; } if test "${ac_cv_host+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_cv_host_alias=$host_alias -test -z "$ac_cv_host_alias" && - ac_cv_host_alias=$ac_cv_build_alias -ac_cv_host=`$ac_config_sub $ac_cv_host_alias` || - { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5 -echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;} + if test "x$host_alias" = x; then + ac_cv_host=$ac_cv_build +else + ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || + { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5 +echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;} { (exit 1); exit 1; }; } +fi fi -echo "$as_me:$LINENO: result: $ac_cv_host" >&5 -echo "${ECHO_T}$ac_cv_host" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_host" >&5 +echo "${ECHO_T}$ac_cv_host" >&6; } +case $ac_cv_host in +*-*-*) ;; +*) { { echo "$as_me:$LINENO: error: invalid value of canonical host" >&5 +echo "$as_me: error: invalid value of canonical host" >&2;} + { (exit 1); exit 1; }; };; +esac host=$ac_cv_host -host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` - - -echo "$as_me:$LINENO: checking target system type" >&5 -echo $ECHO_N "checking target system type... $ECHO_C" >&6 +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_host +shift +host_cpu=$1 +host_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +host_os=$* +IFS=$ac_save_IFS +case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac + + +{ echo "$as_me:$LINENO: checking target system type" >&5 +echo $ECHO_N "checking target system type... $ECHO_C" >&6; } if test "${ac_cv_target+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_cv_target_alias=$target_alias -test "x$ac_cv_target_alias" = "x" && - ac_cv_target_alias=$ac_cv_host_alias -ac_cv_target=`$ac_config_sub $ac_cv_target_alias` || - { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_target_alias failed" >&5 -echo "$as_me: error: $ac_config_sub $ac_cv_target_alias failed" >&2;} + if test "x$target_alias" = x; then + ac_cv_target=$ac_cv_host +else + ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` || + { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&5 +echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&2;} { (exit 1); exit 1; }; } +fi fi -echo "$as_me:$LINENO: result: $ac_cv_target" >&5 -echo "${ECHO_T}$ac_cv_target" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_target" >&5 +echo "${ECHO_T}$ac_cv_target" >&6; } +case $ac_cv_target in +*-*-*) ;; +*) { { echo "$as_me:$LINENO: error: invalid value of canonical target" >&5 +echo "$as_me: error: invalid value of canonical target" >&2;} + { (exit 1); exit 1; }; };; +esac target=$ac_cv_target -target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -target_vendor=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -target_os=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_target +shift +target_cpu=$1 +target_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +target_os=$* +IFS=$ac_save_IFS +case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac # The aliases save the names the user supplied, while $host etc. @@ -7436,12 +7949,11 @@ test -n "$target_alias" && # Default decimal format # If you change the defaults here, be sure to change them in the GCC directory also -echo "$as_me:$LINENO: checking for decimal floating point" >&5 -echo $ECHO_N "checking for decimal floating point... $ECHO_C" >&6 -# Check whether --enable-decimal-float or --disable-decimal-float was given. +{ echo "$as_me:$LINENO: checking for decimal floating point" >&5 +echo $ECHO_N "checking for decimal floating point... $ECHO_C" >&6; } +# Check whether --enable-decimal-float was given. if test "${enable_decimal_float+set}" = set; then - enableval="$enable_decimal_float" - + enableval=$enable_decimal_float; case $enable_decimal_float in yes | no | bid | dpd) ;; *) { { echo "$as_me:$LINENO: error: '$enable_decimal_float' is an invalid value for --enable-decimal-float. @@ -7462,7 +7974,8 @@ else ;; esac -fi; +fi + # x86's use BID format instead of DPD # In theory --enable-decimal-float=no should not compile anything @@ -7485,13 +7998,13 @@ else ADDITIONAL_OBJS= fi -echo "$as_me:$LINENO: result: $enable_decimal_float" >&5 -echo "${ECHO_T}$enable_decimal_float" >&6 +{ echo "$as_me:$LINENO: result: $enable_decimal_float" >&5 +echo "${ECHO_T}$enable_decimal_float" >&6; } -echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5 -echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5 +echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6; } if test "${ac_cv_c_bigendian+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -7508,7 +8021,8 @@ cat >>conftest.$ac_ext <<_ACEOF int main () { -#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN +#if ! (defined BYTE_ORDER && defined BIG_ENDIAN && defined LITTLE_ENDIAN \ + && BYTE_ORDER && BIG_ENDIAN && LITTLE_ENDIAN) bogus endian macros #endif @@ -7517,27 +8031,22 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then # It does; now see whether it defined to BIG_ENDIAN or not. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -7560,40 +8069,36 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_c_bigendian=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_c_bigendian=no + ac_cv_c_bigendian=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -# It does not; compile a test program. + # It does not; compile a test program. if test "$cross_compiling" = yes; then # try to guess the endianness by grepping values into an object file ac_cv_c_bigendian=unknown @@ -7603,11 +8108,11 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -short ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; -short ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; +short int ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; +short int ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; void _ascii () { char *s = (char *) ascii_mm; s = (char *) ascii_ii; } -short ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; -short ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; +short int ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; +short int ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; void _ebcdic () { char *s = (char *) ebcdic_mm; s = (char *) ebcdic_ii; } int main () @@ -7618,27 +8123,22 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then if grep BIGenDianSyS conftest.$ac_objext >/dev/null ; then ac_cv_c_bigendian=yes fi @@ -7654,8 +8154,10 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -7663,27 +8165,41 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ +$ac_includes_default int main () { + /* Are we little or big endian? From Harbison&Steele. */ union { - long l; - char c[sizeof (long)]; + long int l; + char c[sizeof (long int)]; } u; u.l = 1; - exit (u.c[sizeof (long) - 1] == 1); + return u.c[sizeof (long int) - 1] == 1; + + ; + return 0; } _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -7696,13 +8212,16 @@ sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_c_bigendian=yes fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi + + fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5 -echo "${ECHO_T}$ac_cv_c_bigendian" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5 +echo "${ECHO_T}$ac_cv_c_bigendian" >&6; } case $ac_cv_c_bigendian in yes) @@ -7723,9 +8242,9 @@ esac # Output. - ac_config_headers="$ac_config_headers config.h:config.in" +ac_config_headers="$ac_config_headers config.h:config.in" - ac_config_files="$ac_config_files Makefile" +ac_config_files="$ac_config_files Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure @@ -7745,39 +8264,58 @@ _ACEOF # 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. +# So, we kill variables containing newlines. # 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. -{ +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 +echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + *) $as_unset $ac_var ;; + esac ;; + esac + done + (set) 2>&1 | - case `(ac_space=' '; set | grep ac_space) 2>&1` in - *ac_space=\ *) + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" - ;; + ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n \ - "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; - esac; -} | + esac | + sort +) | sed ' + /^ac_cv_env_/b end t clear - : clear + :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end - /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ - : end' >>confcache -if diff $cache_file confcache >/dev/null 2>&1; then :; else - if test -w $cache_file; then - test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + :end' >>confcache +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else + if test -w "$cache_file"; then + test "x$cache_file" != "x/dev/null" && + { echo "$as_me:$LINENO: updating cache $cache_file" >&5 +echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else - echo "not updating unwritable cache $cache_file" + { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 +echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache @@ -7786,32 +8324,18 @@ test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' -# VPATH may cause trouble with some makes, so we remove $(srcdir), -# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and -# trailing colons and then remove the whole line if VPATH becomes empty -# (actually we leave an empty line to preserve line numbers). -if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=/{ -s/:*\$(srcdir):*/:/; -s/:*\${srcdir}:*/:/; -s/:*@srcdir@:*/:/; -s/^\([^=]*=[ ]*\):*/\1/; -s/:*$//; -s/^[^=]*=[ ]*$//; -}' -fi - DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. - ac_i=`echo "$ac_i" | - sed 's/\$U\././;s/\.o$//;s/\.obj$//'` - # 2. Add them. - ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" - ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`echo "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" + ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs @@ -7842,17 +8366,45 @@ cat >>$CONFIG_STATUS <<\_ACEOF ## M4sh Initialization. ## ## --------------------- ## -# Be Bourne compatible +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' -elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then - set -o posix + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi + + + + +# PATH needs CR +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh fi -DUALCASE=1; export DUALCASE # for MKS sh # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then @@ -7862,8 +8414,43 @@ else fi +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +as_nl=' +' +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + { (exit 1); exit 1; } +fi + # Work around bugs in pre-3.0 UWIN ksh. -$as_unset ENV MAIL MAILPATH +for as_var in ENV MAIL MAILPATH +do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var +done PS1='$ ' PS2='> ' PS4='+ ' @@ -7877,18 +8464,19 @@ do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else - $as_unset $as_var + ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. -if expr a : '\(a\)' >/dev/null 2>&1; then +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi -if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false @@ -7896,159 +8484,120 @@ fi # Name of the executable. -as_me=`$as_basename "$0" || +as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)$' \| \ - . : '\(.\)' 2>/dev/null || + X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } - /^X\/\(\/\/\)$/{ s//\1/; q; } - /^X\/\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - - -# PATH needs CR, and LINENO needs CR and PATH. -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh -fi - - - as_lineno_1=$LINENO - as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" || { - # Find who we are. Look in the path if we contain no path at all - # relative or not. - case $0 in - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break -done + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# CDPATH. +$as_unset CDPATH + + - ;; - esac - # We did not find ourselves, most probably we were run as `sh COMMAND' - # in which case we are not to be found in the path. - if test "x$as_myself" = x; then - as_myself=$0 - fi - if test ! -f "$as_myself"; then - { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 -echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} - { (exit 1); exit 1; }; } - fi - case $CONFIG_SHELL in - '') - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for as_base in sh bash ksh sh5; do - case $as_dir in - /*) - if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then - $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } - $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } - CONFIG_SHELL=$as_dir/$as_base - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$0" ${1+"$@"} - fi;; - esac - done -done -;; - esac + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line before each line; the second 'sed' does the real - # work. The second script uses 'N' to pair each line-number line - # with the numbered line, and appends trailing '-' during - # substitution so that $LINENO is not a special case at line end. + # line-number line after each line using $LINENO; the second 'sed' + # does the real work. The second script uses 'N' to pair each + # line-number line with the line containing $LINENO, and appends + # trailing '-' during substitution so that $LINENO is not a special + # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) - sed '=' <$as_myself | + # scripts with optimization help from Paolo Bonzini. Blame Lee + # E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno N - s,$,-, - : loop - s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop - s,-$,, - s,^['$as_cr_digits']*\n,, + s/-\n.*// ' >$as_me.lineno && - chmod +x $as_me.lineno || - { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 -echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} + chmod +x "$as_me.lineno" || + { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensible to this). - . ./$as_me.lineno + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" # Exit status is that of the last command. exit } -case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in - *c*,-n*) ECHO_N= ECHO_C=' -' ECHO_T=' ' ;; - *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; - *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in +-n*) + case `echo 'x\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + *) ECHO_C='\c';; + esac;; +*) + ECHO_N='-n';; esac -if expr a : '\(a\)' >/dev/null 2>&1; then +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir +fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then - # We could just check for DJGPP; but this test a) works b) is more generic - # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). - if test -f conf$$.exe; then - # Don't use ln at all; we don't have any links + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' - else - as_ln_s='ln -s' - fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi -rm -f conf$$ conf$$.exe conf$$.file +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p=: @@ -8057,7 +8606,28 @@ else as_mkdir_p=false fi -as_executable_p="test -f" +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' +else + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +fi +as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" @@ -8066,31 +8636,14 @@ as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" -# IFS -# We need space, tab and new line, in precisely that order. -as_nl=' -' -IFS=" $as_nl" - -# CDPATH. -$as_unset CDPATH - exec 6>&1 -# Open the log real soon, to keep \$[0] and so on meaningful, and to +# Save the log message, to keep $[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their -# values after options handling. Logging --version etc. is OK. -exec 5>>config.log -{ - echo - sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX -## Running $as_me. ## -_ASBOX -} >&5 -cat >&5 <<_CSEOF - +# values after options handling. +ac_log=" This file was extended by libdecnumber $as_me , which was -generated by GNU Autoconf 2.59. Invocation command line was +generated by GNU Autoconf 2.61. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -8098,30 +8651,20 @@ generated by GNU Autoconf 2.59. Invocation command line was CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ -_CSEOF -echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 -echo >&5 +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + _ACEOF +cat >>$CONFIG_STATUS <<_ACEOF # Files that config.status was made for. -if test -n "$ac_config_files"; then - echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS -fi - -if test -n "$ac_config_headers"; then - echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS -fi - -if test -n "$ac_config_links"; then - echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS -fi +config_files="$ac_config_files" +config_headers="$ac_config_headers" +config_commands="$ac_config_commands" -if test -n "$ac_config_commands"; then - echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS -fi +_ACEOF cat >>$CONFIG_STATUS <<\_ACEOF - ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. @@ -8129,7 +8672,7 @@ current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit - -V, --version print version number, then exit + -V, --version print version number and configuration settings, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions @@ -8148,18 +8691,20 @@ Configuration commands: $config_commands Report bugs to ." -_ACEOF +_ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ libdecnumber config.status -configured by $0, generated by GNU Autoconf 2.59, - with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" +configured by $0, generated by GNU Autoconf 2.61, + with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" -Copyright (C) 2003 Free Software Foundation, Inc. +Copyright (C) 2006 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." -srcdir=$srcdir + +ac_pwd='$ac_pwd' +srcdir='$srcdir' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF @@ -8170,39 +8715,24 @@ while test $# != 0 do case $1 in --*=*) - ac_option=`expr "x$1" : 'x\([^=]*\)='` - ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; - -*) + *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; - *) # This is not an option, so the user has probably given explicit - # arguments. - ac_option=$1 - ac_need_defaults=false;; esac case $ac_option in # Handling of the options. -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; - --version | --vers* | -V ) - echo "$ac_cs_version"; exit 0 ;; - --he | --h) - # Conflict between --help and --header - { { echo "$as_me:$LINENO: error: ambiguous option: $1 -Try \`$0 --help' for more information." >&5 -echo "$as_me: error: ambiguous option: $1 -Try \`$0 --help' for more information." >&2;} - { (exit 1); exit 1; }; };; - --help | --hel | -h ) - echo "$ac_cs_usage"; exit 0 ;; - --debug | --d* | -d ) + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + echo "$ac_cs_version"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift @@ -8212,18 +8742,24 @@ Try \`$0 --help' for more information." >&2;} $ac_shift CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" ac_need_defaults=false;; + --he | --h) + # Conflict between --help and --header + { echo "$as_me: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&2 + { (exit 1); exit 1; }; };; + --help | --hel | -h ) + echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. - -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 -Try \`$0 --help' for more information." >&5 -echo "$as_me: error: unrecognized option: $1 -Try \`$0 --help' for more information." >&2;} + -*) { echo "$as_me: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; - *) ac_config_targets="$ac_config_targets $1" ;; + *) ac_config_targets="$ac_config_targets $1" + ac_need_defaults=false ;; esac shift @@ -8239,18 +8775,29 @@ fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF if \$ac_cs_recheck; then - echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 - exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 + CONFIG_SHELL=$SHELL + export CONFIG_SHELL + exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX + echo "$ac_log" +} >&5 +_ACEOF cat >>$CONFIG_STATUS <<_ACEOF # -# INIT-COMMANDS section. +# INIT-COMMANDS # - GCC="$GCC" CC="$CC" acx_cv_header_stdint="$acx_cv_header_stdint" @@ -8271,22 +8818,23 @@ ac_cv_sizeof_void_p="$ac_cv_sizeof_void_p" _ACEOF - - cat >>$CONFIG_STATUS <<\_ACEOF + +# Handling of arguments. for ac_config_target in $ac_config_targets do - case "$ac_config_target" in - # Handling of arguments. - "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; - "gstdint.h" ) CONFIG_COMMANDS="$CONFIG_COMMANDS gstdint.h" ;; - "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h:config.in" ;; + case $ac_config_target in + "gstdint.h") CONFIG_COMMANDS="$CONFIG_COMMANDS gstdint.h" ;; + "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h:config.in" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done + # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely @@ -8298,315 +8846,382 @@ if $ac_need_defaults; then fi # Have a temporary directory for convenience. Make it in the build tree -# simply because there is no reason to put it here, and in addition, +# simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. -# Create a temporary directory, and hook for its removal unless debugging. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. $debug || { - trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 + tmp= + trap 'exit_status=$? + { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status +' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } - # Create a (secure) tmp directory for tmp files. { - tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { - tmp=./confstat$$-$RANDOM - (umask 077 && mkdir $tmp) + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } -_ACEOF - -cat >>$CONFIG_STATUS <<_ACEOF - # -# CONFIG_FILES section. +# Set up the sed scripts for CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h -if test -n "\$CONFIG_FILES"; then - # Protect against being on the right side of a sed subst in config.status. - sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; - s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF -s,@SHELL@,$SHELL,;t t -s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t -s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t -s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t -s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t -s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t -s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t -s,@exec_prefix@,$exec_prefix,;t t -s,@prefix@,$prefix,;t t -s,@program_transform_name@,$program_transform_name,;t t -s,@bindir@,$bindir,;t t -s,@sbindir@,$sbindir,;t t -s,@libexecdir@,$libexecdir,;t t -s,@datadir@,$datadir,;t t -s,@sysconfdir@,$sysconfdir,;t t -s,@sharedstatedir@,$sharedstatedir,;t t -s,@localstatedir@,$localstatedir,;t t -s,@libdir@,$libdir,;t t -s,@includedir@,$includedir,;t t -s,@oldincludedir@,$oldincludedir,;t t -s,@infodir@,$infodir,;t t -s,@mandir@,$mandir,;t t -s,@build_alias@,$build_alias,;t t -s,@host_alias@,$host_alias,;t t -s,@target_alias@,$target_alias,;t t -s,@DEFS@,$DEFS,;t t -s,@ECHO_C@,$ECHO_C,;t t -s,@ECHO_N@,$ECHO_N,;t t -s,@ECHO_T@,$ECHO_T,;t t -s,@LIBS@,$LIBS,;t t -s,@SET_MAKE@,$SET_MAKE,;t t -s,@CC@,$CC,;t t -s,@CFLAGS@,$CFLAGS,;t t -s,@LDFLAGS@,$LDFLAGS,;t t -s,@CPPFLAGS@,$CPPFLAGS,;t t -s,@ac_ct_CC@,$ac_ct_CC,;t t -s,@EXEEXT@,$EXEEXT,;t t -s,@OBJEXT@,$OBJEXT,;t t -s,@RANLIB@,$RANLIB,;t t -s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t -s,@ACLOCAL@,$ACLOCAL,;t t -s,@AUTOCONF@,$AUTOCONF,;t t -s,@AUTOHEADER@,$AUTOHEADER,;t t -s,@WARN_CFLAGS@,$WARN_CFLAGS,;t t -s,@WARN_PEDANTIC@,$WARN_PEDANTIC,;t t -s,@WERROR@,$WERROR,;t t -s,@CPP@,$CPP,;t t -s,@EGREP@,$EGREP,;t t -s,@MAINT@,$MAINT,;t t -s,@build@,$build,;t t -s,@build_cpu@,$build_cpu,;t t -s,@build_vendor@,$build_vendor,;t t -s,@build_os@,$build_os,;t t -s,@host@,$host,;t t -s,@host_cpu@,$host_cpu,;t t -s,@host_vendor@,$host_vendor,;t t -s,@host_os@,$host_os,;t t -s,@target@,$target,;t t -s,@target_cpu@,$target_cpu,;t t -s,@target_vendor@,$target_vendor,;t t -s,@target_os@,$target_os,;t t -s,@enable_decimal_float@,$enable_decimal_float,;t t -s,@ADDITIONAL_OBJS@,$ADDITIONAL_OBJS,;t t -s,@LIBOBJS@,$LIBOBJS,;t t -s,@LTLIBOBJS@,$LTLIBOBJS,;t t -CEOF - -_ACEOF - - cat >>$CONFIG_STATUS <<\_ACEOF - # 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_lines=48 - ac_sed_frag=1 # Number of current file. - ac_beg=1 # First line for current file. - ac_end=$ac_max_sed_lines # 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" $tmp/subs.sed >$tmp/subs.frag - else - sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag - fi - if test ! -s $tmp/subs.frag; then - ac_more_lines=false - else - # The purpose of the label and of the branching condition is to - # speed up the sed processing (if there are no `@' at all, there - # is no need to browse any of the substitutions). - # These are the two extra sed commands mentioned above. - (echo ':t - /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed - if test -z "$ac_sed_cmds"; then - ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" - else - ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" - fi - ac_sed_frag=`expr $ac_sed_frag + 1` - ac_beg=$ac_end - ac_end=`expr $ac_end + $ac_max_sed_lines` - fi - done - if test -z "$ac_sed_cmds"; then - ac_sed_cmds=cat +if test -n "$CONFIG_FILES"; then + +_ACEOF + + + +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + cat >conf$$subs.sed <<_ACEOF +SHELL!$SHELL$ac_delim +PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim +PACKAGE_NAME!$PACKAGE_NAME$ac_delim +PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim +PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim +PACKAGE_STRING!$PACKAGE_STRING$ac_delim +PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim +exec_prefix!$exec_prefix$ac_delim +prefix!$prefix$ac_delim +program_transform_name!$program_transform_name$ac_delim +bindir!$bindir$ac_delim +sbindir!$sbindir$ac_delim +libexecdir!$libexecdir$ac_delim +datarootdir!$datarootdir$ac_delim +datadir!$datadir$ac_delim +sysconfdir!$sysconfdir$ac_delim +sharedstatedir!$sharedstatedir$ac_delim +localstatedir!$localstatedir$ac_delim +includedir!$includedir$ac_delim +oldincludedir!$oldincludedir$ac_delim +docdir!$docdir$ac_delim +infodir!$infodir$ac_delim +htmldir!$htmldir$ac_delim +dvidir!$dvidir$ac_delim +pdfdir!$pdfdir$ac_delim +psdir!$psdir$ac_delim +libdir!$libdir$ac_delim +localedir!$localedir$ac_delim +mandir!$mandir$ac_delim +DEFS!$DEFS$ac_delim +ECHO_C!$ECHO_C$ac_delim +ECHO_N!$ECHO_N$ac_delim +ECHO_T!$ECHO_T$ac_delim +LIBS!$LIBS$ac_delim +build_alias!$build_alias$ac_delim +host_alias!$host_alias$ac_delim +target_alias!$target_alias$ac_delim +SET_MAKE!$SET_MAKE$ac_delim +CC!$CC$ac_delim +CFLAGS!$CFLAGS$ac_delim +LDFLAGS!$LDFLAGS$ac_delim +CPPFLAGS!$CPPFLAGS$ac_delim +ac_ct_CC!$ac_ct_CC$ac_delim +EXEEXT!$EXEEXT$ac_delim +OBJEXT!$OBJEXT$ac_delim +RANLIB!$RANLIB$ac_delim +ACLOCAL!$ACLOCAL$ac_delim +AUTOCONF!$AUTOCONF$ac_delim +AUTOHEADER!$AUTOHEADER$ac_delim +WARN_CFLAGS!$WARN_CFLAGS$ac_delim +WARN_PEDANTIC!$WARN_PEDANTIC$ac_delim +WERROR!$WERROR$ac_delim +CPP!$CPP$ac_delim +GREP!$GREP$ac_delim +EGREP!$EGREP$ac_delim +MAINT!$MAINT$ac_delim +build!$build$ac_delim +build_cpu!$build_cpu$ac_delim +build_vendor!$build_vendor$ac_delim +build_os!$build_os$ac_delim +host!$host$ac_delim +host_cpu!$host_cpu$ac_delim +host_vendor!$host_vendor$ac_delim +host_os!$host_os$ac_delim +target!$target$ac_delim +target_cpu!$target_cpu$ac_delim +target_vendor!$target_vendor$ac_delim +target_os!$target_os$ac_delim +enable_decimal_float!$enable_decimal_float$ac_delim +ADDITIONAL_OBJS!$ADDITIONAL_OBJS$ac_delim +LIBOBJS!$LIBOBJS$ac_delim +LTLIBOBJS!$LTLIBOBJS$ac_delim +_ACEOF + + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 72; then + break + elif $ac_last_try; then + { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi -fi # test -n "$CONFIG_FILES" +done +ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` +if test -n "$ac_eof"; then + ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` + ac_eof=`expr $ac_eof + 1` +fi + +cat >>$CONFIG_STATUS <<_ACEOF +cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end +_ACEOF +sed ' +s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g +s/^/s,@/; s/!/@,|#_!!_#|/ +:n +t n +s/'"$ac_delim"'$/,g/; t +s/$/\\/; p +N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n +' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF +:end +s/|#_!!_#|//g +CEOF$ac_eof _ACEOF + + +# VPATH may cause trouble with some makes, so we remove $(srcdir), +# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=/{ +s/:*\$(srcdir):*/:/ +s/:*\${srcdir}:*/:/ +s/:*@srcdir@:*/:/ +s/^\([^=]*=[ ]*\):*/\1/ +s/:*$// +s/^[^=]*=[ ]*$// +}' +fi + cat >>$CONFIG_STATUS <<\_ACEOF -for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue - # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". - case $ac_file in - - | *:- | *:-:* ) # input from stdin - cat >$tmp/stdin - ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - * ) ac_file_in=$ac_file.in ;; +fi # test -n "$CONFIG_FILES" + + +for ac_tag in :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 +echo "$as_me: error: Invalid tag $ac_tag." >&2;} + { (exit 1); exit 1; }; };; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 +echo "$as_me: error: cannot find input file: $ac_f" >&2;} + { (exit 1); exit 1; }; };; + esac + ac_file_inputs="$ac_file_inputs $ac_f" + done + + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input="Generated from "`IFS=: + echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + fi + + case $ac_tag in + *:-:* | *:-) cat >"$tmp/stdin";; + esac + ;; esac - # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. - ac_dir=`(dirname "$ac_file") 2>/dev/null || + ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ - X"$ac_file" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || echo X"$ac_file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - { if $as_mkdir_p; then - mkdir -p "$ac_dir" - else - as_dir="$ac_dir" + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + { as_dir="$ac_dir" + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= - while test ! -d "$as_dir"; do - as_dirs="$as_dir $as_dirs" - as_dir=`(dirname "$as_dir") 2>/dev/null || + while :; do + case $as_dir in #( + *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break done - test ! -n "$as_dirs" || mkdir $as_dirs - fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 -echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 +echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } - ac_builddir=. -if test "$ac_dir" != .; then +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A "../" for each directory in $ac_dir_suffix. - ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` -else - ac_dir_suffix= ac_top_builddir= -fi + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix case $srcdir in - .) # No --srcdir option. We are building in place. + .) # We are building in place. ac_srcdir=. - if test -z "$ac_top_builddir"; then - ac_top_srcdir=. - else - ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` - fi ;; - [\\/]* | ?:[\\/]* ) # Absolute path. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir ;; - *) # Relative path. - ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_builddir$srcdir ;; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix -# Do not use `cd foo && pwd` to compute absolute paths, because -# the directories may not exist. -case `pwd` in -.) ac_abs_builddir="$ac_dir";; -*) - case "$ac_dir" in - .) ac_abs_builddir=`pwd`;; - [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; - *) ac_abs_builddir=`pwd`/"$ac_dir";; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_builddir=${ac_top_builddir}.;; -*) - case ${ac_top_builddir}. in - .) ac_abs_top_builddir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; - *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_srcdir=$ac_srcdir;; -*) - case $ac_srcdir in - .) ac_abs_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; - *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_srcdir=$ac_top_srcdir;; -*) - case $ac_top_srcdir in - .) ac_abs_top_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; - *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; - esac;; -esac + case $ac_mode in + :F) + # + # CONFIG_FILE + # +_ACEOF - if test x"$ac_file" != x-; then - { echo "$as_me:$LINENO: creating $ac_file" >&5 -echo "$as_me: creating $ac_file" >&6;} - rm -f "$ac_file" - fi - # Let's still pretend it is `configure' which instantiates (i.e., don't - # use $as_me), people would be surprised to read: - # /* config.h. Generated by config.status. */ - if test x"$ac_file" = x-; then - configure_input= - else - configure_input="$ac_file. " - fi - configure_input=$configure_input"Generated from `echo $ac_file_in | - sed 's,.*/,,'` by configure." - - # First look for the input files in the build tree, otherwise in the - # src tree. - ac_file_inputs=`IFS=: - for f in $ac_file_in; do - case $f in - -) echo $tmp/stdin ;; - [\\/$]*) - # Absolute (can't be DOS-style, as IFS=:) - test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - echo "$f";; - *) # Relative - if test -f "$f"; then - # Build tree - echo "$f" - elif test -f "$srcdir/$f"; then - # Source tree - echo "$srcdir/$f" - else - # /dev/null tree - { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - fi;; - esac - done` || { (exit 1); exit 1; } +cat >>$CONFIG_STATUS <<\_ACEOF +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= + +case `sed -n '/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p +' $ac_file_inputs` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac _ACEOF + +# Neutralize VPATH when `$srcdir' = `.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF sed "$ac_vpsub $extrasub @@ -8614,368 +9229,139 @@ _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b -s,@configure_input@,$configure_input,;t t -s,@srcdir@,$ac_srcdir,;t t -s,@abs_srcdir@,$ac_abs_srcdir,;t t -s,@top_srcdir@,$ac_top_srcdir,;t t -s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t -s,@builddir@,$ac_builddir,;t t -s,@abs_builddir@,$ac_abs_builddir,;t t -s,@top_builddir@,$ac_top_builddir,;t t -s,@abs_top_builddir@,$ac_abs_top_builddir,;t t -" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out - rm -f $tmp/stdin - if test x"$ac_file" != x-; then - mv $tmp/out $ac_file - else - cat $tmp/out - rm -f $tmp/out - fi - -done -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF - -# -# CONFIG_HEADER section. -# - -# 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=' ' -ac_dD=',;t' -# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE". -ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' -ac_uB='$,\1#\2define\3' -ac_uC=' ' -ac_uD=',;t' - -for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue - # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". +s&@configure_input@&$configure_input&;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +$ac_datarootdir_hack +" $ac_file_inputs | sed -f "$tmp/subs-1.sed" >$tmp/out + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && + { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined." >&5 +echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined." >&2;} + + rm -f "$tmp/stdin" case $ac_file in - - | *:- | *:-:* ) # input from stdin - cat >$tmp/stdin - ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - * ) ac_file_in=$ac_file.in ;; + -) cat "$tmp/out"; rm -f "$tmp/out";; + *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; esac - - test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5 -echo "$as_me: creating $ac_file" >&6;} - - # First look for the input files in the build tree, otherwise in the - # src tree. - ac_file_inputs=`IFS=: - for f in $ac_file_in; do - case $f in - -) echo $tmp/stdin ;; - [\\/$]*) - # Absolute (can't be DOS-style, as IFS=:) - test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - # Do quote $f, to prevent DOS paths from being IFS'd. - echo "$f";; - *) # Relative - if test -f "$f"; then - # Build tree - echo "$f" - elif test -f "$srcdir/$f"; then - # Source tree - echo "$srcdir/$f" - else - # /dev/null tree - { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - fi;; - esac - done` || { (exit 1); exit 1; } - # Remove the trailing spaces. - sed 's/[ ]*$//' $ac_file_inputs >$tmp/in - -_ACEOF - -# Transform confdefs.h into two sed scripts, `conftest.defines' and -# `conftest.undefs', that substitutes the proper values into -# config.h.in to produce config.h. The first handles `#define' -# templates, and the second `#undef' templates. -# 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.defines conftest.undefs -# Using a here document instead of a string reduces the quoting nightmare. -# Putting comments in sed scripts is not portable. -# -# `end' is used to avoid that the second main sed command (meant for -# 0-ary CPP macros) applies to n-ary macro definitions. -# See the Autoconf documentation for `clear'. -cat >confdef2sed.sed <<\_ACEOF -s/[\\&,]/\\&/g -s,[\\$`],\\&,g -t clear -: clear -s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp -t end -s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp -: end -_ACEOF -# If some macros were called several times there might be several times -# the same #defines, which is useless. Nevertheless, we may not want to -# sort them, since we want the *last* AC-DEFINE to be honored. -uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines -sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs -rm -f confdef2sed.sed - -# This sed command replaces #undef with comments. This is necessary, for + ;; + :H) + # + # CONFIG_HEADER + # +_ACEOF + +# Transform confdefs.h into a sed script `conftest.defines', that +# substitutes the proper values into config.h.in to produce config.h. +rm -f conftest.defines conftest.tail +# First, append a space to every undef/define line, to ease matching. +echo 's/$/ /' >conftest.defines +# Then, protect against being on the right side of a sed subst, or in +# an unquoted here document, in config.status. If some macros were +# called several times there might be several #defines for the same +# symbol, which is useless. But do not sort them, since the last +# AC_DEFINE must be honored. +ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* +# These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where +# NAME is the cpp macro being defined, VALUE is the value it is being given. +# PARAMS is the parameter list in the macro definition--in most cases, it's +# just an empty string. +ac_dA='s,^\\([ #]*\\)[^ ]*\\([ ]*' +ac_dB='\\)[ (].*,\\1define\\2' +ac_dC=' ' +ac_dD=' ,' + +uniq confdefs.h | + sed -n ' + t rset + :rset + s/^[ ]*#[ ]*define[ ][ ]*// + t ok + d + :ok + s/[\\&,]/\\&/g + s/^\('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p + s/^\('"$ac_word_re"'\)[ ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p + ' >>conftest.defines + +# Remove the space that was appended to ease matching. +# Then replace #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.undefs <<\_ACEOF -s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */, -_ACEOF - -# Break up conftest.defines because some shells have a limit on the size -# of here documents, and old seds have small limits too (100 cmds). -echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS -echo ' if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS -echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS -echo ' :' >>$CONFIG_STATUS -rm -f conftest.tail -while grep . conftest.defines >/dev/null +# (The regexp can be short, since the line contains either #define or #undef.) +echo 's/ $// +s,^[ #]*u.*,/* & */,' >>conftest.defines + +# Break up conftest.defines: +ac_max_sed_lines=50 + +# First sed command is: sed -f defines.sed $ac_file_inputs >"$tmp/out1" +# Second one is: sed -f defines.sed "$tmp/out1" >"$tmp/out2" +# Third one will be: sed -f defines.sed "$tmp/out2" >"$tmp/out1" +# et cetera. +ac_in='$ac_file_inputs' +ac_out='"$tmp/out1"' +ac_nxt='"$tmp/out2"' + +while : do - # Write a limited-size here document to $tmp/defines.sed. - echo ' cat >$tmp/defines.sed <>$CONFIG_STATUS - # Speed up: don't consider the non `#define' lines. - echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS - # Work around the forget-to-reset-the-flag bug. - echo 't clr' >>$CONFIG_STATUS - echo ': clr' >>$CONFIG_STATUS - sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS + # Write a here document: + cat >>$CONFIG_STATUS <<_ACEOF + # First, check the format of the line: + cat >"\$tmp/defines.sed" <<\\CEOF +/^[ ]*#[ ]*undef[ ][ ]*$ac_word_re[ ]*\$/b def +/^[ ]*#[ ]*define[ ][ ]*$ac_word_re[( ]/b def +b +:def +_ACEOF + sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS echo 'CEOF - sed -f $tmp/defines.sed $tmp/in >$tmp/out - rm -f $tmp/in - mv $tmp/out $tmp/in -' >>$CONFIG_STATUS - sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail + sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS + ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in + sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail + grep . conftest.tail >/dev/null || break rm -f conftest.defines mv conftest.tail conftest.defines done -rm -f conftest.defines -echo ' fi # grep' >>$CONFIG_STATUS -echo >>$CONFIG_STATUS - -# Break up conftest.undefs because some shells have a limit on the size -# of here documents, and old seds have small limits too (100 cmds). -echo ' # Handle all the #undef templates' >>$CONFIG_STATUS -rm -f conftest.tail -while grep . conftest.undefs >/dev/null -do - # Write a limited-size here document to $tmp/undefs.sed. - echo ' cat >$tmp/undefs.sed <>$CONFIG_STATUS - # Speed up: don't consider the non `#undef' - echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS - # Work around the forget-to-reset-the-flag bug. - echo 't clr' >>$CONFIG_STATUS - echo ': clr' >>$CONFIG_STATUS - sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS - echo 'CEOF - sed -f $tmp/undefs.sed $tmp/in >$tmp/out - rm -f $tmp/in - mv $tmp/out $tmp/in -' >>$CONFIG_STATUS - sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail - rm -f conftest.undefs - mv conftest.tail conftest.undefs -done -rm -f conftest.undefs +rm -f conftest.defines conftest.tail +echo "ac_result=$ac_in" >>$CONFIG_STATUS cat >>$CONFIG_STATUS <<\_ACEOF - # Let's still pretend it is `configure' which instantiates (i.e., don't - # use $as_me), people would be surprised to read: - # /* config.h. Generated by config.status. */ - if test x"$ac_file" = x-; then - echo "/* Generated by configure. */" >$tmp/config.h - else - echo "/* $ac_file. Generated by configure. */" >$tmp/config.h - fi - cat $tmp/in >>$tmp/config.h - rm -f $tmp/in if test x"$ac_file" != x-; then - if diff $ac_file $tmp/config.h >/dev/null 2>&1; then + echo "/* $configure_input */" >"$tmp/config.h" + cat "$ac_result" >>"$tmp/config.h" + if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 echo "$as_me: $ac_file is unchanged" >&6;} else - ac_dir=`(dirname "$ac_file") 2>/dev/null || -$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_file" : 'X\(//\)[^/]' \| \ - X"$ac_file" : 'X\(//\)$' \| \ - X"$ac_file" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$ac_file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - { if $as_mkdir_p; then - mkdir -p "$ac_dir" - else - as_dir="$ac_dir" - as_dirs= - while test ! -d "$as_dir"; do - as_dirs="$as_dir $as_dirs" - as_dir=`(dirname "$as_dir") 2>/dev/null || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - done - test ! -n "$as_dirs" || mkdir $as_dirs - fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 -echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} - { (exit 1); exit 1; }; }; } - rm -f $ac_file - mv $tmp/config.h $ac_file + mv "$tmp/config.h" $ac_file fi else - cat $tmp/config.h - rm -f $tmp/config.h + echo "/* $configure_input */" + cat "$ac_result" fi - # Run the commands associated with the file. - case $ac_file in - config.h ) echo timestamp > stamp-h1 ;; - esac -done -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF - -# -# CONFIG_COMMANDS section. -# -for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue - ac_dest=`echo "$ac_file" | sed 's,:.*,,'` - ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_dir=`(dirname "$ac_dest") 2>/dev/null || -$as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_dest" : 'X\(//\)[^/]' \| \ - X"$ac_dest" : 'X\(//\)$' \| \ - X"$ac_dest" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$ac_dest" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - { if $as_mkdir_p; then - mkdir -p "$ac_dir" - else - as_dir="$ac_dir" - as_dirs= - while test ! -d "$as_dir"; do - as_dirs="$as_dir $as_dirs" - as_dir=`(dirname "$as_dir") 2>/dev/null || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - done - test ! -n "$as_dirs" || mkdir $as_dirs - fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 -echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} - { (exit 1); exit 1; }; }; } - - ac_builddir=. - -if test "$ac_dir" != .; then - ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A "../" for each directory in $ac_dir_suffix. - ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` -else - ac_dir_suffix= ac_top_builddir= -fi - -case $srcdir in - .) # No --srcdir option. We are building in place. - ac_srcdir=. - if test -z "$ac_top_builddir"; then - ac_top_srcdir=. - else - ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` - fi ;; - [\\/]* | ?:[\\/]* ) # Absolute path. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir ;; - *) # Relative path. - ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_builddir$srcdir ;; -esac + rm -f "$tmp/out12" + ;; -# Do not use `cd foo && pwd` to compute absolute paths, because -# the directories may not exist. -case `pwd` in -.) ac_abs_builddir="$ac_dir";; -*) - case "$ac_dir" in - .) ac_abs_builddir=`pwd`;; - [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; - *) ac_abs_builddir=`pwd`/"$ac_dir";; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_builddir=${ac_top_builddir}.;; -*) - case ${ac_top_builddir}. in - .) ac_abs_top_builddir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; - *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_srcdir=$ac_srcdir;; -*) - case $ac_srcdir in - .) ac_abs_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; - *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_srcdir=$ac_top_srcdir;; -*) - case $ac_top_srcdir in - .) ac_abs_top_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; - *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; - esac;; -esac + :C) { echo "$as_me:$LINENO: executing $ac_file commands" >&5 +echo "$as_me: executing $ac_file commands" >&6;} + ;; + esac - { echo "$as_me:$LINENO: executing $ac_dest commands" >&5 -echo "$as_me: executing $ac_dest commands" >&6;} - case $ac_dest in - gstdint.h ) + case $ac_file$ac_mode in + "gstdint.h":C) if test "$GCC" = yes; then echo "/* generated for " `$CC --version | sed 1q` "*/" > tmp-stdint.h else @@ -9303,11 +9689,11 @@ else fi ;; + "config.h":H) echo timestamp > stamp-h1 ;; + esac -done -_ACEOF +done # for ac_tag -cat >>$CONFIG_STATUS <<\_ACEOF { (exit 0); exit 0; } _ACEOF diff --git a/opcodes/Makefile.am b/opcodes/Makefile.am index 14ae763..8c80c66 100644 --- a/opcodes/Makefile.am +++ b/opcodes/Makefile.am @@ -60,13 +60,15 @@ HFILES = \ CFILES = \ alpha-dis.c \ alpha-opc.c \ - arc-ext.c \ + arcompact-dis.c \ arc-asm.c \ arc-desc.c \ arc-dis.c \ + arc-dis-cgen.c \ arc-ibld.c \ arc-opc.c \ arc-opinst.c \ + arc-ext.c \ arm-dis.c \ avr-dis.c \ bfin-dis.c \ @@ -218,13 +220,14 @@ CFILES = \ ALL_MACHINES = \ alpha-dis.lo \ alpha-opc.lo \ - arc-ext.lo \ arc-asm.lo \ arc-desc.lo \ arc-dis.lo \ + arc-dis-cgen.lo \ arc-ibld.lo \ - arc-opc.lo \ arc-opinst.lo \ + arc-opc.lo \ + arc-ext.lo \ arm-dis.lo \ avr-dis.lo \ bfin-dis.lo \ @@ -499,7 +502,6 @@ stamp-arc: $(CGENDEPS) $(srcdir)/../cpu/arc.cpu $(srcdir)/../cpu/arc.opc $(MAKE) run-cgen arch=arc prefix=arc options=opinst \ archfile=$(srcdir)/../cpu/arc.cpu \ opcfile=$(srcdir)/../cpu/arc.opc extrafiles=opinst - $(srcdir)/ip2k-desc.h $(srcdir)/ip2k-desc.c $(srcdir)/ip2k-opc.h $(srcdir)/ip2k-opc.c $(srcdir)/ip2k-ibld.c $(srcdir)/ip2k-asm.c $(srcdir)/ip2k-dis.c: $(IP2K_DEPS) @true stamp-ip2k: $(CGENDEPS) $(CPUDIR)/ip2k.cpu $(CPUDIR)/ip2k.opc @@ -674,9 +676,6 @@ alpha-dis.lo: alpha-dis.c sysdep.h config.h $(INCDIR)/ansidecl.h \ alpha-opc.lo: alpha-opc.c sysdep.h config.h $(INCDIR)/ansidecl.h \ $(INCDIR)/opcode/alpha.h $(BFD_H) $(INCDIR)/ansidecl.h \ $(INCDIR)/symcat.h opintl.h -arc-ext.lo: arc-ext.c sysdep.h config.h $(INCDIR)/ansidecl.h \ - $(BFD_H) $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h arc-ext.h \ - $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h arc-asm.lo: arc-asm.c sysdep.h config.h $(INCDIR)/ansidecl.h \ $(BFD_H) $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/symcat.h \ arc-desc.h $(INCDIR)/opcode/cgen-bitset.h $(INCDIR)/opcode/cgen.h \ @@ -689,26 +688,38 @@ arc-desc.lo: arc-desc.c sysdep.h config.h $(INCDIR)/ansidecl.h \ $(INCDIR)/symcat.h $(INCDIR)/opcode/cgen-bitset.h arc-opc.h \ opintl.h $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \ $(INCDIR)/xregex.h $(INCDIR)/xregex2.h -arc-dis.lo: arc-dis.c sysdep.h config.h $(INCDIR)/ansidecl.h \ +arcompact-dis.lo: arcompact-dis.c $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \ + $(INCDIR)/dis-asm.h $(BFD_H) $(INCDIR)/symcat.h $(INCDIR)/opcode/arc.h \ + $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/arc.h \ + $(INCDIR)/elf/reloc-macros.h opintl.h arc-dis.h arc-ext.h +arc-dis.lo: arc-dis.c $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/dis-asm.h $(BFD_H) $(INCDIR)/ansidecl.h \ + $(INCDIR)/symcat.h $(INCDIR)/opcode/arc.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/elf/arc.h $(INCDIR)/elf/reloc-macros.h \ + opintl.h arc-dis.h arc-ext.h +arc-dis-cgen.lo: arc-dis-cgen.c sysdep.h config.h $(INCDIR)/ansidecl.h \ $(INCDIR)/dis-asm.h $(BFD_H) $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \ $(BFD_H) $(INCDIR)/symcat.h $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \ arc-desc.h $(INCDIR)/opcode/cgen-bitset.h $(INCDIR)/opcode/cgen.h \ $(INCDIR)/symcat.h $(INCDIR)/opcode/cgen-bitset.h arc-opc.h \ opintl.h +arc-opco.lo: arc-opc_codito.c sysdep.h config.h $(INCDIR)/ansidecl.h \ + $(BFD_H) $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/opcode/arc.h \ + opintl.h arc-ibld.lo: arc-ibld.c sysdep.h config.h $(INCDIR)/ansidecl.h \ $(INCDIR)/dis-asm.h $(BFD_H) $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \ $(BFD_H) $(INCDIR)/symcat.h arc-desc.h $(INCDIR)/opcode/cgen-bitset.h \ $(INCDIR)/opcode/cgen.h $(INCDIR)/symcat.h $(INCDIR)/opcode/cgen-bitset.h \ arc-opc.h opintl.h $(INCDIR)/safe-ctype.h -arc-opc.lo: arc-opc.c sysdep.h config.h $(INCDIR)/ansidecl.h \ - $(BFD_H) $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/symcat.h \ - arc-desc.h $(INCDIR)/opcode/cgen-bitset.h $(INCDIR)/opcode/cgen.h \ - $(INCDIR)/symcat.h $(INCDIR)/opcode/cgen-bitset.h arc-opc.h \ - $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h arc-opinst.lo: arc-opinst.c sysdep.h config.h $(INCDIR)/ansidecl.h \ $(BFD_H) $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/symcat.h \ arc-desc.h $(INCDIR)/opcode/cgen-bitset.h $(INCDIR)/opcode/cgen.h \ $(INCDIR)/symcat.h $(INCDIR)/opcode/cgen-bitset.h arc-opc.h +arc-ext.lo: arc-ext.c sysdep.h config.h $(INCDIR)/ansidecl.h \ + $(BFD_H) $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h arc-ext.h \ + $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h arm-dis.lo: arm-dis.c sysdep.h config.h $(INCDIR)/ansidecl.h \ $(INCDIR)/dis-asm.h $(BFD_H) $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \ $(INCDIR)/opcode/arm.h opintl.h $(INCDIR)/safe-ctype.h \ diff --git a/opcodes/Makefile.in b/opcodes/Makefile.in index b412e0c..1645320 100644 --- a/opcodes/Makefile.in +++ b/opcodes/Makefile.in @@ -289,13 +289,15 @@ HFILES = \ CFILES = \ alpha-dis.c \ alpha-opc.c \ - arc-ext.c \ + arcompact-dis.c \ arc-asm.c \ arc-desc.c \ arc-dis.c \ + arc-dis-cgen.c \ arc-ibld.c \ arc-opc.c \ arc-opinst.c \ + arc-ext.c \ arm-dis.c \ avr-dis.c \ bfin-dis.c \ @@ -447,13 +449,14 @@ CFILES = \ ALL_MACHINES = \ alpha-dis.lo \ alpha-opc.lo \ - arc-ext.lo \ arc-asm.lo \ arc-desc.lo \ arc-dis.lo \ + arc-dis-cgen.lo \ arc-ibld.lo \ - arc-opc.lo \ arc-opinst.lo \ + arc-opc.lo \ + arc-ext.lo \ arm-dis.lo \ avr-dis.lo \ bfin-dis.lo \ @@ -665,15 +668,15 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ - echo ' cd $(srcdir) && $(AUTOMAKE) --cygnus '; \ - cd $(srcdir) && $(AUTOMAKE) --cygnus \ + echo ' cd $(srcdir) && $(AUTOMAKE) --foreign '; \ + cd $(srcdir) && $(AUTOMAKE) --foreign \ && exit 0; \ exit 1;; \ esac; \ done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --cygnus Makefile'; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ cd $(top_srcdir) && \ - $(AUTOMAKE) --cygnus Makefile + $(AUTOMAKE) --foreign Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ @@ -1052,7 +1055,6 @@ stamp-arc: $(CGENDEPS) $(srcdir)/../cpu/arc.cpu $(srcdir)/../cpu/arc.opc $(MAKE) run-cgen arch=arc prefix=arc options=opinst \ archfile=$(srcdir)/../cpu/arc.cpu \ opcfile=$(srcdir)/../cpu/arc.opc extrafiles=opinst - $(srcdir)/ip2k-desc.h $(srcdir)/ip2k-desc.c $(srcdir)/ip2k-opc.h $(srcdir)/ip2k-opc.c $(srcdir)/ip2k-ibld.c $(srcdir)/ip2k-asm.c $(srcdir)/ip2k-dis.c: $(IP2K_DEPS) @true stamp-ip2k: $(CGENDEPS) $(CPUDIR)/ip2k.cpu $(CPUDIR)/ip2k.opc @@ -1226,9 +1228,6 @@ alpha-dis.lo: alpha-dis.c sysdep.h config.h $(INCDIR)/ansidecl.h \ alpha-opc.lo: alpha-opc.c sysdep.h config.h $(INCDIR)/ansidecl.h \ $(INCDIR)/opcode/alpha.h $(BFD_H) $(INCDIR)/ansidecl.h \ $(INCDIR)/symcat.h opintl.h -arc-ext.lo: arc-ext.c sysdep.h config.h $(INCDIR)/ansidecl.h \ - $(BFD_H) $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h arc-ext.h \ - $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h arc-asm.lo: arc-asm.c sysdep.h config.h $(INCDIR)/ansidecl.h \ $(BFD_H) $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/symcat.h \ arc-desc.h $(INCDIR)/opcode/cgen-bitset.h $(INCDIR)/opcode/cgen.h \ @@ -1241,26 +1240,38 @@ arc-desc.lo: arc-desc.c sysdep.h config.h $(INCDIR)/ansidecl.h \ $(INCDIR)/symcat.h $(INCDIR)/opcode/cgen-bitset.h arc-opc.h \ opintl.h $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \ $(INCDIR)/xregex.h $(INCDIR)/xregex2.h -arc-dis.lo: arc-dis.c sysdep.h config.h $(INCDIR)/ansidecl.h \ +arcompact-dis.lo: arcompact-dis.c $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \ + $(INCDIR)/dis-asm.h $(BFD_H) $(INCDIR)/symcat.h $(INCDIR)/opcode/arc.h \ + $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/arc.h \ + $(INCDIR)/elf/reloc-macros.h opintl.h arc-dis.h arc-ext.h +arc-dis.lo: arc-dis.c $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \ + $(INCDIR)/ansidecl.h $(INCDIR)/dis-asm.h $(BFD_H) $(INCDIR)/ansidecl.h \ + $(INCDIR)/symcat.h $(INCDIR)/opcode/arc.h $(BFDDIR)/elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/elf/arc.h $(INCDIR)/elf/reloc-macros.h \ + opintl.h arc-dis.h arc-ext.h +arc-dis-cgen.lo: arc-dis-cgen.c sysdep.h config.h $(INCDIR)/ansidecl.h \ $(INCDIR)/dis-asm.h $(BFD_H) $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \ $(BFD_H) $(INCDIR)/symcat.h $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \ arc-desc.h $(INCDIR)/opcode/cgen-bitset.h $(INCDIR)/opcode/cgen.h \ $(INCDIR)/symcat.h $(INCDIR)/opcode/cgen-bitset.h arc-opc.h \ opintl.h +arc-opco.lo: arc-opc_codito.c sysdep.h config.h $(INCDIR)/ansidecl.h \ + $(BFD_H) $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/opcode/arc.h \ + opintl.h arc-ibld.lo: arc-ibld.c sysdep.h config.h $(INCDIR)/ansidecl.h \ $(INCDIR)/dis-asm.h $(BFD_H) $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \ $(BFD_H) $(INCDIR)/symcat.h arc-desc.h $(INCDIR)/opcode/cgen-bitset.h \ $(INCDIR)/opcode/cgen.h $(INCDIR)/symcat.h $(INCDIR)/opcode/cgen-bitset.h \ arc-opc.h opintl.h $(INCDIR)/safe-ctype.h -arc-opc.lo: arc-opc.c sysdep.h config.h $(INCDIR)/ansidecl.h \ - $(BFD_H) $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/symcat.h \ - arc-desc.h $(INCDIR)/opcode/cgen-bitset.h $(INCDIR)/opcode/cgen.h \ - $(INCDIR)/symcat.h $(INCDIR)/opcode/cgen-bitset.h arc-opc.h \ - $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h arc-opinst.lo: arc-opinst.c sysdep.h config.h $(INCDIR)/ansidecl.h \ $(BFD_H) $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/symcat.h \ arc-desc.h $(INCDIR)/opcode/cgen-bitset.h $(INCDIR)/opcode/cgen.h \ $(INCDIR)/symcat.h $(INCDIR)/opcode/cgen-bitset.h arc-opc.h +arc-ext.lo: arc-ext.c sysdep.h config.h $(INCDIR)/ansidecl.h \ + $(BFD_H) $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h arc-ext.h \ + $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h arm-dis.lo: arm-dis.c sysdep.h config.h $(INCDIR)/ansidecl.h \ $(INCDIR)/dis-asm.h $(BFD_H) $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \ $(INCDIR)/opcode/arm.h opintl.h $(INCDIR)/safe-ctype.h \ diff --git a/opcodes/arc-dis-cgen.c b/opcodes/arc-dis-cgen.c new file mode 100644 index 0000000..3efe8b7 --- /dev/null +++ b/opcodes/arc-dis-cgen.c @@ -0,0 +1,825 @@ +/* Disassembler interface for targets using CGEN. -*- C -*- + CGEN: Cpu tools GENerator + + THIS FILE IS MACHINE GENERATED WITH CGEN. + - the resultant file is machine generated, cgen-dis.in isn't + + Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2005 + Free Software Foundation, Inc. + + This file is part of the GNU Binutils and GDB, the GNU debugger. + + 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 this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ + +/* ??? Eventually more and more of this stuff can go to cpu-independent files. + Keep that in mind. */ + +#include "sysdep.h" +#include +#include "ansidecl.h" +#include "dis-asm.h" +#include "bfd.h" +#include "symcat.h" +#include "libiberty.h" +#include "arc-desc.h" +#include "arc-opc.h" +#include "opintl.h" + +/* Prototypes */ +int print_insn_arc (bfd_vma pc, disassemble_info *info); + + +/* Default text to print if an instruction isn't recognized. */ +#define UNKNOWN_INSN_MSG _("*unknown*") + +static void print_normal + (CGEN_CPU_DESC, void *, long, unsigned int, bfd_vma, int); +static void print_address + (CGEN_CPU_DESC, void *, bfd_vma, unsigned int, bfd_vma, int) ATTRIBUTE_UNUSED; +static void print_keyword + (CGEN_CPU_DESC, void *, CGEN_KEYWORD *, long, unsigned int) ATTRIBUTE_UNUSED; +static void print_insn_normal + (CGEN_CPU_DESC, void *, const CGEN_INSN *, CGEN_FIELDS *, bfd_vma, int); +static int print_insn + (CGEN_CPU_DESC, bfd_vma, disassemble_info *, bfd_byte *, unsigned); +static int default_print_insn + (CGEN_CPU_DESC, bfd_vma, disassemble_info *) ATTRIBUTE_UNUSED; +static int read_insn + (CGEN_CPU_DESC, bfd_vma, disassemble_info *, bfd_byte *, int, CGEN_EXTRACT_INFO *, + unsigned long *); + +/* -- disassembler routines inserted here. */ + +/* -- dis.c */ +char limm_str[11] = "0x"; + +/* Read a long immediate and write it hexadecimally into limm_str. */ +static void +read_limm (CGEN_EXTRACT_INFO *ex_info, bfd_vma pc) +{ + char buf[2]; + int i; + char *limmp = limm_str + 2; + disassemble_info *dis_info = (disassemble_info *) ex_info->dis_info; + + for (i = 0; i < 2; i++, limmp +=4, pc += 2) + { + int status = (*dis_info->read_memory_func) (pc, (unsigned char*)buf, 2, dis_info); + + if (status != 0) + (*dis_info->memory_error_func) (status, pc, dis_info); + sprintf (limmp, "%.4x", + (unsigned) bfd_get_bits (buf, 16, + dis_info->endian == BFD_ENDIAN_BIG)); + } +} + +/* Return the actual instruction length, in bits, which depends on the size + of the opcode - 2 or 4 bytes - and the absence or presence of a (4 byte) + long immediate. + Also, if a long immediate is present, put its hexadecimal representation + into limm_str. + ??? cgen-opc.c:cgen_lookup_insn has a 'sanity' check of the length + that will fail if its input length differs from the result of + CGEN_EXTRACT_FN. Need to check when this could trigger. */ +int +arc_insn_length (unsigned long insn_value, const CGEN_INSN *insn, + CGEN_EXTRACT_INFO *info, bfd_vma pc) +{ + switch (CGEN_INSN_ATTR_VALUE (insn, CGEN_INSN_LIMM)) + { + case LIMM_NONE: + return CGEN_INSN_ATTR_VALUE (insn, CGEN_INSN_SHORT_P) ? 16 : 32; + case LIMM_H: + { + /* This is a short insn; extract the actual opcode. */ + unsigned high = insn_value >> 16; + + if ((high & 0xe7) != 0xc7) + return 16; + read_limm (info, pc+2); + return 48; + } + case LIMM_B: + if ((insn_value & 0x07007000) != 0x06007000) + return 32; + break; + case LIMM_BC: + if ((insn_value & 0x07007000) == 0x06007000) + break; + /* Fall through. */ + case LIMM_C: + if ((insn_value & 0x00000fc0) != 0x00000f80) + return 32; + break; + default: + abort (); + } + read_limm (info, pc+4); + return 64; +} + +/* -- */ + +void arc_cgen_print_operand + (CGEN_CPU_DESC, int, PTR, CGEN_FIELDS *, void const *, bfd_vma, int); + +/* Main entry point for printing operands. + XINFO is a `void *' and not a `disassemble_info *' to not put a requirement + of dis-asm.h on cgen.h. + + This function is basically just a big switch statement. Earlier versions + used tables to look up the function to use, but + - if the table contains both assembler and disassembler functions then + the disassembler contains much of the assembler and vice-versa, + - there's a lot of inlining possibilities as things grow, + - using a switch statement avoids the function call overhead. + + This function could be moved into `print_insn_normal', but keeping it + separate makes clear the interface between `print_insn_normal' and each of + the handlers. */ + +void +arc_cgen_print_operand (CGEN_CPU_DESC cd, + int opindex, + void * xinfo, + CGEN_FIELDS *fields, + void const *attrs ATTRIBUTE_UNUSED, + bfd_vma pc, + int length) +{ + disassemble_info *info = (disassemble_info *) xinfo; + + switch (opindex) + { + case ARC_OPERAND_EXDI : + print_keyword (cd, info, & arc_cgen_opval_h_Di, fields->f_F, 0); + break; + case ARC_OPERAND_F : + print_keyword (cd, info, & arc_cgen_opval_h_uflags, fields->f_F, 0); + break; + case ARC_OPERAND_F0 : + print_keyword (cd, info, & arc_cgen_opval_h_nil, fields->f_F, 0); + break; + case ARC_OPERAND_F1 : + print_keyword (cd, info, & arc_cgen_opval_h_auflags, fields->f_F, 0); + break; + case ARC_OPERAND_F1F : + print_keyword (cd, info, & arc_cgen_opval_h_aufflags, fields->f_F, 0); + break; + case ARC_OPERAND_GP : + print_keyword (cd, info, & arc_cgen_opval_h_gp, 0, 0); + break; + case ARC_OPERAND_LDODI : + print_keyword (cd, info, & arc_cgen_opval_h_Di, fields->f_LDODi, 0); + break; + case ARC_OPERAND_LDRDI : + print_keyword (cd, info, & arc_cgen_opval_h_Di, fields->f_LDRDi, 0); + break; + case ARC_OPERAND_NE : + print_keyword (cd, info, & arc_cgen_opval_h_ne, 0, 0); + break; + case ARC_OPERAND_PCL : + print_keyword (cd, info, & arc_cgen_opval_h_pcl, 0, 0); + break; + case ARC_OPERAND_QCONDB : + print_keyword (cd, info, & arc_cgen_opval_h_Qcondb, fields->f_cond_Q, 0); + break; + case ARC_OPERAND_QCONDI : + print_keyword (cd, info, & arc_cgen_opval_h_Qcondi, fields->f_cond_Q, 0); + break; + case ARC_OPERAND_QCONDJ : + print_keyword (cd, info, & arc_cgen_opval_h_Qcondj, fields->f_cond_Q, 0); + break; + case ARC_OPERAND_R0 : + print_keyword (cd, info, & arc_cgen_opval_h_r0, 0, 0); + break; + case ARC_OPERAND_R31 : + print_keyword (cd, info, & arc_cgen_opval_h_r31, 0, 0); + break; + case ARC_OPERAND_RA : + print_keyword (cd, info, & arc_cgen_opval_cr_names, fields->f_op_A, 0); + break; + case ARC_OPERAND_RA_0 : + print_keyword (cd, info, & arc_cgen_opval_h_nil, fields->f_op_A, 0); + break; + case ARC_OPERAND_RB : + print_keyword (cd, info, & arc_cgen_opval_cr_names, fields->f_op_B, 0|(1<f_op_B, 0|(1<f_op_C, 0); + break; + case ARC_OPERAND_RC_ILINK : + print_keyword (cd, info, & arc_cgen_opval_h_ilinkx, fields->f_op_Cj, 0); + break; + case ARC_OPERAND_RC_NOILINK : + print_keyword (cd, info, & arc_cgen_opval_h_noilink, fields->f_op_Cj, 0); + break; + case ARC_OPERAND_R_A : + print_keyword (cd, info, & arc_cgen_opval_h_cr16, fields->f_op__a, 0); + break; + case ARC_OPERAND_R_B : + print_keyword (cd, info, & arc_cgen_opval_h_cr16, fields->f_op__b, 0); + break; + case ARC_OPERAND_R_C : + print_keyword (cd, info, & arc_cgen_opval_h_cr16, fields->f_op__c, 0); + break; + case ARC_OPERAND_RCC : + print_keyword (cd, info, & arc_cgen_opval_h_Rcc, fields->f_brcond, 0); + break; + case ARC_OPERAND_RCCS : + print_keyword (cd, info, & arc_cgen_opval_h_RccS, fields->f_brscond, 0); + break; + case ARC_OPERAND_RH : + print_keyword (cd, info, & arc_cgen_opval_cr_names, fields->f_op_h, 0|(1<f_STODi, 0); + break; + case ARC_OPERAND_U6 : + print_normal (cd, info, fields->f_u6, 0, pc, length); + break; + case ARC_OPERAND_U6X2 : + print_normal (cd, info, fields->f_u6x2, 0, pc, length); + break; + case ARC_OPERAND__AW : + print_keyword (cd, info, & arc_cgen_opval_h__aw, 0, 0); + break; + case ARC_OPERAND__L : + print_keyword (cd, info, & arc_cgen_opval_h_insn32, 0, 0); + break; + case ARC_OPERAND__S : + print_keyword (cd, info, & arc_cgen_opval_h_insn16, 0, 0); + break; + case ARC_OPERAND_CBIT : + print_normal (cd, info, 0, 0, pc, length); + break; + case ARC_OPERAND_DELAY_N : + print_keyword (cd, info, & arc_cgen_opval_h_delay, fields->f_delay_N, 0); + break; + case ARC_OPERAND_DUMMY_OP : + print_normal (cd, info, fields->f_dummy, 0, pc, length); + break; + case ARC_OPERAND_I2COND : + print_keyword (cd, info, & arc_cgen_opval_h_i2cond, fields->f_cond_i2, 0); + break; + case ARC_OPERAND_I3COND : + print_keyword (cd, info, & arc_cgen_opval_h_i3cond, fields->f_cond_i3, 0); + break; + case ARC_OPERAND_LABEL10 : + print_address (cd, info, fields->f_rel10, 0|(1<f_rel13bl, 0|(1<f_rel21, 0|(1<f_rel21bl, 0|(1<f_rel25, 0|(1<f_rel25bl, 0|(1<f_rel7, 0|(1<f_rel8, 0|(1<f_rel9, 0|(1<f_s12, 0|(1<f_s12x2, 0|(1<f_s9, 0|(1<f_s9x4, 0, pc, length); + break; + case ARC_OPERAND_SC_S9_ : + print_normal (cd, info, fields->f_s9x4, 0, pc, length); + break; + case ARC_OPERAND_SC_S9B : + print_normal (cd, info, fields->f_s9x1, 0, pc, length); + break; + case ARC_OPERAND_SC_S9W : + print_normal (cd, info, fields->f_s9x2, 0, pc, length); + break; + case ARC_OPERAND_SC_U5_ : + print_normal (cd, info, fields->f_u5x4, 0, pc, length); + break; + case ARC_OPERAND_SC_U5B : + print_normal (cd, info, fields->f_u5, 0, pc, length); + break; + case ARC_OPERAND_SC_U5W : + print_normal (cd, info, fields->f_u5x2, 0, pc, length); + break; + case ARC_OPERAND_TRAPNUM : + print_normal (cd, info, fields->f_trapnum, 0, pc, length); + break; + case ARC_OPERAND_U3 : + print_normal (cd, info, fields->f_u3, 0, pc, length); + break; + case ARC_OPERAND_U5 : + print_normal (cd, info, fields->f_u5, 0, pc, length); + break; + case ARC_OPERAND_U5X4 : + print_normal (cd, info, fields->f_u5x4, 0, pc, length); + break; + case ARC_OPERAND_U7 : + print_normal (cd, info, fields->f_u7, 0, pc, length); + break; + case ARC_OPERAND_U8 : + print_normal (cd, info, fields->f_u8, 0, pc, length); + break; + case ARC_OPERAND_U8X4 : + print_normal (cd, info, fields->f_u8x4, 0, pc, length); + break; + case ARC_OPERAND_UNCONDB : + print_keyword (cd, info, & arc_cgen_opval_h_uncondb, 0, 0); + break; + case ARC_OPERAND_UNCONDI : + print_keyword (cd, info, & arc_cgen_opval_h_uncondi, 0, 0); + break; + case ARC_OPERAND_UNCONDJ : + print_keyword (cd, info, & arc_cgen_opval_h_uncondj, 0, 0); + break; + case ARC_OPERAND_VBIT : + print_normal (cd, info, 0, 0, pc, length); + break; + case ARC_OPERAND_ZBIT : + print_normal (cd, info, 0, 0, pc, length); + break; + + default : + /* xgettext:c-format */ + fprintf (stderr, _("Unrecognized field %d while printing insn.\n"), + opindex); + abort (); + } +} + +cgen_print_fn * const arc_cgen_print_handlers[] = +{ + print_insn_normal, +}; + + +void +arc_cgen_init_dis (CGEN_CPU_DESC cd) +{ + arc_cgen_init_opcode_table (cd); + arc_cgen_init_ibld_table (cd); + cd->print_handlers = & arc_cgen_print_handlers[0]; + cd->print_operand = arc_cgen_print_operand; +} + + +/* Default print handler. */ + +static void +print_normal (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED, + void *dis_info, + long value, + unsigned int attrs, + bfd_vma pc ATTRIBUTE_UNUSED, + int length ATTRIBUTE_UNUSED) +{ + disassemble_info *info = (disassemble_info *) dis_info; + +#ifdef CGEN_PRINT_NORMAL + CGEN_PRINT_NORMAL (cd, info, value, attrs, pc, length); +#endif + + /* Print the operand as directed by the attributes. */ + if (CGEN_BOOL_ATTR (attrs, CGEN_OPERAND_SEM_ONLY)) + ; /* nothing to do */ + else if (CGEN_BOOL_ATTR (attrs, CGEN_OPERAND_SIGNED)) + (*info->fprintf_func) (info->stream, "%ld", value); + else + (*info->fprintf_func) (info->stream, "0x%lx", value); +} + +/* Default address handler. */ + +static void +print_address (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED, + void *dis_info, + bfd_vma value, + unsigned int attrs, + bfd_vma pc ATTRIBUTE_UNUSED, + int length ATTRIBUTE_UNUSED) +{ + disassemble_info *info = (disassemble_info *) dis_info; + +#ifdef CGEN_PRINT_ADDRESS + CGEN_PRINT_ADDRESS (cd, info, value, attrs, pc, length); +#endif + + /* Print the operand as directed by the attributes. */ + if (CGEN_BOOL_ATTR (attrs, CGEN_OPERAND_SEM_ONLY)) + ; /* Nothing to do. */ + else if (CGEN_BOOL_ATTR (attrs, CGEN_OPERAND_PCREL_ADDR)) + (*info->print_address_func) (value, info); + else if (CGEN_BOOL_ATTR (attrs, CGEN_OPERAND_ABS_ADDR)) + (*info->print_address_func) (value, info); + else if (CGEN_BOOL_ATTR (attrs, CGEN_OPERAND_SIGNED)) + (*info->fprintf_func) (info->stream, "%ld", (long) value); + else + (*info->fprintf_func) (info->stream, "0x%lx", (long) value); +} + +/* Keyword print handler. */ + +static void +print_keyword (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED, + void *dis_info, + CGEN_KEYWORD *keyword_table, + long value, + unsigned int attrs ATTRIBUTE_UNUSED) +{ + disassemble_info *info = (disassemble_info *) dis_info; + const CGEN_KEYWORD_ENTRY *ke; + + ke = cgen_keyword_lookup_value (keyword_table, value); + if (ke != NULL) + (*info->fprintf_func) (info->stream, "%s", ke->name); + else + (*info->fprintf_func) (info->stream, "???"); +} + +/* Default insn printer. + + DIS_INFO is defined as `void *' so the disassembler needn't know anything + about disassemble_info. */ + +static void +print_insn_normal (CGEN_CPU_DESC cd, + void *dis_info, + const CGEN_INSN *insn, + CGEN_FIELDS *fields, + bfd_vma pc, + int length) +{ + const CGEN_SYNTAX *syntax = CGEN_INSN_SYNTAX (insn); + disassemble_info *info = (disassemble_info *) dis_info; + const CGEN_SYNTAX_CHAR_TYPE *syn; + + CGEN_INIT_PRINT (cd); + + for (syn = CGEN_SYNTAX_STRING (syntax); *syn; ++syn) + { + if (CGEN_SYNTAX_MNEMONIC_P (*syn)) + { + (*info->fprintf_func) (info->stream, "%s", CGEN_INSN_MNEMONIC (insn)); + continue; + } + if (CGEN_SYNTAX_CHAR_P (*syn)) + { + (*info->fprintf_func) (info->stream, "%c", CGEN_SYNTAX_CHAR (*syn)); + continue; + } + + /* We have an operand. */ + arc_cgen_print_operand (cd, CGEN_SYNTAX_FIELD (*syn), info, + fields, CGEN_INSN_ATTRS (insn), pc, length); + } +} + +/* Subroutine of print_insn. Reads an insn into the given buffers and updates + the extract info. + Returns 0 if all is well, non-zero otherwise. */ + +static int +read_insn (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED, + bfd_vma pc, + disassemble_info *info, + bfd_byte *buf, + int buflen, + CGEN_EXTRACT_INFO *ex_info, + unsigned long *insn_value) +{ + int status = (*info->read_memory_func) (pc, buf, buflen, info); + + if (status != 0) + { + (*info->memory_error_func) (status, pc, info); + return -1; + } + + ex_info->dis_info = info; + ex_info->valid = (1 << buflen) - 1; + ex_info->insn_bytes = buf; + + *insn_value = bfd_get_bits (buf, buflen * 8, info->endian == BFD_ENDIAN_BIG); + return 0; +} + +/* Utility to print an insn. + BUF is the base part of the insn, target byte order, BUFLEN bytes long. + The result is the size of the insn in bytes or zero for an unknown insn + or -1 if an error occurs fetching data (memory_error_func will have + been called). */ + +static int +print_insn (CGEN_CPU_DESC cd, + bfd_vma pc, + disassemble_info *info, + bfd_byte *buf, + unsigned int buflen) +{ + CGEN_INSN_INT insn_value; + const CGEN_INSN_LIST *insn_list; + CGEN_EXTRACT_INFO ex_info; + int basesize; + + /* Extract base part of instruction, just in case CGEN_DIS_* uses it. */ + basesize = cd->base_insn_bitsize < buflen * 8 ? + cd->base_insn_bitsize : buflen * 8; + insn_value = cgen_get_insn_value (cd, buf, basesize); + + + /* Fill in ex_info fields like read_insn would. Don't actually call + read_insn, since the incoming buffer is already read (and possibly + modified a la m32r). */ + ex_info.valid = (1 << buflen) - 1; + ex_info.dis_info = info; + ex_info.insn_bytes = buf; + + /* The instructions are stored in hash lists. + Pick the first one and keep trying until we find the right one. */ + + insn_list = CGEN_DIS_LOOKUP_INSN (cd, (char *) buf, insn_value); + while (insn_list != NULL) + { + const CGEN_INSN *insn = insn_list->insn; + CGEN_FIELDS fields; + int length; + unsigned long insn_value_cropped; + +#ifdef CGEN_VALIDATE_INSN_SUPPORTED + /* Not needed as insn shouldn't be in hash lists if not supported. */ + /* Supported by this cpu? */ + if (! arc_cgen_insn_supported (cd, insn)) + { + insn_list = CGEN_DIS_NEXT_INSN (insn_list); + continue; + } +#endif + + /* Basic bit mask must be correct. */ + /* ??? May wish to allow target to defer this check until the extract + handler. */ + + /* Base size may exceed this instruction's size. Extract the + relevant part from the buffer. */ + if ((unsigned) (CGEN_INSN_BITSIZE (insn) / 8) < buflen && + (unsigned) (CGEN_INSN_BITSIZE (insn) / 8) <= sizeof (unsigned long)) + insn_value_cropped = bfd_get_bits (buf, CGEN_INSN_BITSIZE (insn), + info->endian == BFD_ENDIAN_BIG); + else + insn_value_cropped = insn_value; + + if ((insn_value_cropped & CGEN_INSN_BASE_MASK (insn)) + == CGEN_INSN_BASE_VALUE (insn)) + { + /* Printing is handled in two passes. The first pass parses the + machine insn and extracts the fields. The second pass prints + them. */ + + /* Make sure the entire insn is loaded into insn_value, if it + can fit. */ + if (((unsigned) CGEN_INSN_BITSIZE (insn) > cd->base_insn_bitsize) && + (unsigned) (CGEN_INSN_BITSIZE (insn) / 8) <= sizeof (unsigned long)) + { + unsigned long full_insn_value; + int rc = read_insn (cd, pc, info, buf, + CGEN_INSN_BITSIZE (insn) / 8, + & ex_info, & full_insn_value); + if (rc != 0) + return rc; + length = CGEN_EXTRACT_FN (cd, insn) + (cd, insn, &ex_info, full_insn_value, &fields, pc); + } + else + length = CGEN_EXTRACT_FN (cd, insn) + (cd, insn, &ex_info, insn_value_cropped, &fields, pc); + + /* Length < 0 -> error. */ + if (length < 0) + return length; + if (length > 0) + { + CGEN_PRINT_FN (cd, insn) (cd, info, insn, &fields, pc, length); + /* Length is in bits, result is in bytes. */ + return length / 8; + } + } + + insn_list = CGEN_DIS_NEXT_INSN (insn_list); + } + + return 0; +} + +/* Default value for CGEN_PRINT_INSN. + The result is the size of the insn in bytes or zero for an unknown insn + or -1 if an error occured fetching bytes. */ + +#ifndef CGEN_PRINT_INSN +#define CGEN_PRINT_INSN default_print_insn +#endif + +static int +default_print_insn (CGEN_CPU_DESC cd, bfd_vma pc, disassemble_info *info) +{ + bfd_byte buf[CGEN_MAX_INSN_SIZE]; + int buflen; + int status; + + /* Attempt to read the base part of the insn. */ + buflen = cd->base_insn_bitsize / 8; + status = (*info->read_memory_func) (pc, buf, buflen, info); + + /* Try again with the minimum part, if min < base. */ + if (status != 0 && (cd->min_insn_bitsize < cd->base_insn_bitsize)) + { + buflen = cd->min_insn_bitsize / 8; + status = (*info->read_memory_func) (pc, buf, buflen, info); + } + + if (status != 0) + { + (*info->memory_error_func) (status, pc, info); + return -1; + } + + return print_insn (cd, pc, info, buf, buflen); +} + +/* Main entry point. + Print one instruction from PC on INFO->STREAM. + Return the size of the instruction (in bytes). */ + +typedef struct cpu_desc_list +{ + struct cpu_desc_list *next; + CGEN_BITSET *isa; + int mach; + int endian; + CGEN_CPU_DESC cd; +} cpu_desc_list; + +int +print_insn_arc (bfd_vma pc, disassemble_info *info) +{ + static cpu_desc_list *cd_list = 0; + cpu_desc_list *cl = 0; + static CGEN_CPU_DESC cd = 0; + static CGEN_BITSET *prev_isa; + static int prev_mach; + static int prev_endian; + int length; + CGEN_BITSET *isa; + int mach; + int endian = (info->endian == BFD_ENDIAN_BIG + ? CGEN_ENDIAN_BIG + : CGEN_ENDIAN_LITTLE); + enum bfd_architecture arch; + + /* ??? gdb will set mach but leave the architecture as "unknown" */ +#ifndef CGEN_BFD_ARCH +#define CGEN_BFD_ARCH bfd_arch_arc +#endif + arch = info->arch; + if (arch == bfd_arch_unknown) + arch = CGEN_BFD_ARCH; + + /* There's no standard way to compute the machine or isa number + so we leave it to the target. */ +#ifdef CGEN_COMPUTE_MACH + mach = CGEN_COMPUTE_MACH (info); +#else + mach = info->mach; +#endif + +#ifdef CGEN_COMPUTE_ISA + { + static CGEN_BITSET *permanent_isa; + + if (!permanent_isa) + permanent_isa = cgen_bitset_create (MAX_ISAS); + isa = permanent_isa; + cgen_bitset_clear (isa); + cgen_bitset_add (isa, CGEN_COMPUTE_ISA (info)); + } +#else + isa = info->insn_sets; +#endif + + /* If we've switched cpu's, try to find a handle we've used before */ + if (cd + && (cgen_bitset_compare (isa, prev_isa) != 0 + || mach != prev_mach + || endian != prev_endian)) + { + cd = 0; + for (cl = cd_list; cl; cl = cl->next) + { + if (cgen_bitset_compare (cl->isa, isa) == 0 && + cl->mach == mach && + cl->endian == endian) + { + cd = cl->cd; + prev_isa = cd->isas; + break; + } + } + } + + /* If we haven't initialized yet, initialize the opcode table. */ + if (! cd) + { + const bfd_arch_info_type *arch_type = bfd_lookup_arch (arch, mach); + const char *mach_name; + + if (!arch_type) + abort (); + mach_name = arch_type->printable_name; + + prev_isa = cgen_bitset_copy (isa); + prev_mach = mach; + prev_endian = endian; + cd = arc_cgen_cpu_open (CGEN_CPU_OPEN_ISAS, prev_isa, + CGEN_CPU_OPEN_BFDMACH, mach_name, + CGEN_CPU_OPEN_ENDIAN, prev_endian, + CGEN_CPU_OPEN_END); + if (!cd) + abort (); + + /* Save this away for future reference. */ + cl = xmalloc (sizeof (struct cpu_desc_list)); + cl->cd = cd; + cl->isa = prev_isa; + cl->mach = mach; + cl->endian = endian; + cl->next = cd_list; + cd_list = cl; + + arc_cgen_init_dis (cd); + } + + /* We try to have as much common code as possible. + But at this point some targets need to take over. */ + /* ??? Some targets may need a hook elsewhere. Try to avoid this, + but if not possible try to move this hook elsewhere rather than + have two hooks. */ + length = CGEN_PRINT_INSN (cd, pc, info); + if (length > 0) + return length; + if (length < 0) + return -1; + + (*info->fprintf_func) (info->stream, UNKNOWN_INSN_MSG); + return cd->default_insn_bitsize / 8; +} + diff --git a/opcodes/arc-dis-cgen.h b/opcodes/arc-dis-cgen.h new file mode 100644 index 0000000..9aa7b44 --- /dev/null +++ b/opcodes/arc-dis-cgen.h @@ -0,0 +1,28 @@ +/* Disassembler structures definitions for the ARC. + Copyright 1994, 1995, 1997, 1998, 2000, 2001, 2007 + Free Software Foundation, Inc. + Contributed by Doug Evans (dje@cygnus.com). + + 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., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ + +#ifndef ARCDIS_H +#define ARCDIS_H + +int ARCTangent_decodeInstr(bfd_vma address, disassemble_info* info); +int ARCompact_decodeInstr (bfd_vma address, disassemble_info* info); + +#define __TRANSLATION_REQUIRED(state) ((state).acnt != 0) + +#endif diff --git a/opcodes/arc-dis.c b/opcodes/arc-dis.c index de6e1d0..b5eb8a5 100644 --- a/opcodes/arc-dis.c +++ b/opcodes/arc-dis.c @@ -1,11 +1,7 @@ -/* Disassembler interface for targets using CGEN. -*- C -*- - CGEN: Cpu tools GENerator - - THIS FILE IS MACHINE GENERATED WITH CGEN. - - the resultant file is machine generated, cgen-dis.in isn't - - Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2005, 2007 +/* Instruction printing code for the ARC. + Copyright 1994, 1995, 1997, 1998, 2000, 2001, 2002, 2005, 2007 Free Software Foundation, Inc. + Contributed by Doug Evans (dje@cygnus.com). This file is part of libopcodes. @@ -20,801 +16,1218 @@ 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., - 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ - -/* ??? Eventually more and more of this stuff can go to cpu-independent files. - Keep that in mind. */ + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, + MA 02110-1301, USA. */ -#include "sysdep.h" -#include #include "ansidecl.h" -#include "dis-asm.h" -#include "bfd.h" -#include "symcat.h" #include "libiberty.h" -#include "arc-desc.h" -#include "arc-opc.h" +#include "dis-asm.h" +#include "opcode/arc.h" +#include "elf-bfd.h" +#include "elf/arc.h" +#include #include "opintl.h" -/* Default text to print if an instruction isn't recognized. */ -#define UNKNOWN_INSN_MSG _("*unknown*") - -static void print_normal - (CGEN_CPU_DESC, void *, long, unsigned int, bfd_vma, int); -static void print_address - (CGEN_CPU_DESC, void *, bfd_vma, unsigned int, bfd_vma, int) ATTRIBUTE_UNUSED; -static void print_keyword - (CGEN_CPU_DESC, void *, CGEN_KEYWORD *, long, unsigned int) ATTRIBUTE_UNUSED; -static void print_insn_normal - (CGEN_CPU_DESC, void *, const CGEN_INSN *, CGEN_FIELDS *, bfd_vma, int); -static int print_insn - (CGEN_CPU_DESC, bfd_vma, disassemble_info *, bfd_byte *, unsigned); -static int default_print_insn - (CGEN_CPU_DESC, bfd_vma, disassemble_info *) ATTRIBUTE_UNUSED; -static int read_insn - (CGEN_CPU_DESC, bfd_vma, disassemble_info *, bfd_byte *, int, CGEN_EXTRACT_INFO *, - unsigned long *); - -/* -- disassembler routines inserted here. */ - -/* -- dis.c */ -char limm_str[11] = "0x"; - -/* Read a long immediate and write it hexadecimally into limm_str. */ -static void -read_limm (CGEN_EXTRACT_INFO *ex_info, bfd_vma pc) +#include +#include "arc-dis.h" +#include "arc-ext.h" + +#ifndef dbg +#define dbg (0) +#endif + +/* Classification of the opcodes for the decoder to print + the instructions. */ + +typedef enum +{ + CLASS_A4_ARITH, + CLASS_A4_OP3_GENERAL, + CLASS_A4_FLAG, + /* All branches other than JC. */ + CLASS_A4_BRANCH, + CLASS_A4_JC , + /* All loads other than immediate + indexed loads. */ + CLASS_A4_LD0, + CLASS_A4_LD1, + CLASS_A4_ST, + CLASS_A4_SR, + /* All single operand instructions. */ + CLASS_A4_OP3_SUBOPC3F, + CLASS_A4_LR +} a4_decoding_class; + +#define BIT(word,n) ((word) & (1 << n)) +#define BITS(word,s,e) (((word) << (31 - e)) >> (s + (31 - e))) +#define OPCODE(word) (BITS ((word), 27, 31)) +#define FIELDA(word) (BITS ((word), 21, 26)) +#define FIELDB(word) (BITS ((word), 15, 20)) +#define FIELDC(word) (BITS ((word), 9, 14)) + +/* FIELD D is signed in all of its uses, so we make sure argument is + treated as signed for bit shifting purposes: */ +#define FIELDD(word) (BITS (((signed int)word), 0, 8)) + +#define PUT_NEXT_WORD_IN(a) \ + do \ + { \ + if (is_limm == 1 && !NEXT_WORD (1)) \ + mwerror (state, _("Illegal limm reference in last instruction!\n")); \ + a = state->words[1]; \ + } \ + while (0) + +#define CHECK_FLAG_COND_NULLIFY() \ + do \ + { \ + if (is_shimm == 0) \ + { \ + flag = BIT (state->words[0], 8); \ + state->nullifyMode = BITS (state->words[0], 5, 6); \ + cond = BITS (state->words[0], 0, 4); \ + } \ + } \ + while (0) + +#define CHECK_COND() \ + do \ + { \ + if (is_shimm == 0) \ + cond = BITS (state->words[0], 0, 4); \ + } \ + while (0) + +#define CHECK_FIELD(field) \ + do \ + { \ + if (field == 62) \ + { \ + is_limm++; \ + field##isReg = 0; \ + PUT_NEXT_WORD_IN (field); \ + limm_value = field; \ + } \ + else if (field > 60) \ + { \ + field##isReg = 0; \ + is_shimm++; \ + flag = (field == 61); \ + field = FIELDD (state->words[0]); \ + } \ + } \ + while (0) + +#define CHECK_FIELD_A() \ + do \ + { \ + fieldA = FIELDA (state->words[0]); \ + if (fieldA > 60) \ + { \ + fieldAisReg = 0; \ + fieldA = 0; \ + } \ + } \ + while (0) + +#define CHECK_FIELD_B() \ + do \ + { \ + fieldB = FIELDB (state->words[0]); \ + CHECK_FIELD (fieldB); \ + } \ + while (0) + +#define CHECK_FIELD_C() \ + do \ + { \ + fieldC = FIELDC (state->words[0]); \ + CHECK_FIELD (fieldC); \ + } \ + while (0) + +#define IS_SMALL(x) (((field##x) < 256) && ((field##x) > -257)) +#define IS_REG(x) (field##x##isReg) +#define WRITE_FORMAT_LB_Rx_RB(x) WRITE_FORMAT (x, "[","]","","") +#define WRITE_FORMAT_x_COMMA_LB(x) WRITE_FORMAT (x, "",",[","",",[") +#define WRITE_FORMAT_COMMA_x_RB(x) WRITE_FORMAT (x, ",","]",",","]") +#define WRITE_FORMAT_x_RB(x) WRITE_FORMAT (x, "","]","","]") +#define WRITE_FORMAT_COMMA_x(x) WRITE_FORMAT (x, ",","",",","") +#define WRITE_FORMAT_x_COMMA(x) WRITE_FORMAT (x, "",",","",",") +#define WRITE_FORMAT_x(x) WRITE_FORMAT (x, "","","","") +#define WRITE_FORMAT(x,cb1,ca1,cb,ca) strcat (formatString, \ + (IS_REG (x) ? cb1"%r"ca1 : \ + usesAuxReg ? cb"%a"ca : \ + IS_SMALL (x) ? cb"%d"ca : cb"%h"ca)) +#define WRITE_FORMAT_RB() strcat (formatString, "]") +#define WRITE_COMMENT(str) (state->comm[state->commNum++] = (str)) +#define WRITE_NOP_COMMENT() if (!fieldAisReg && !flag) WRITE_COMMENT ("nop"); + +#define NEXT_WORD(x) (offset += 4, state->words[x]) + +#define add_target(x) (state->targets[state->tcnt++] = (x)) + +static char comment_prefix[] = "\t; "; + +static const char * +core_reg_name (struct arcDisState * state, int val) { - unsigned char buf[2]; - int i; - char *limmp = limm_str + 2; - disassemble_info *dis_info = (disassemble_info *) ex_info->dis_info; + if (state->coreRegName) + return (*state->coreRegName)(state->_this, val); + return 0; +} - for (i = 0; i < 2; i++, limmp +=4, pc += 2) - { - int status = (*dis_info->read_memory_func) (pc, buf, 2, dis_info); +static const char * +aux_reg_name (struct arcDisState * state, int val) +{ + if (state->auxRegName) + return (*state->auxRegName)(state->_this, val); + return 0; +} - if (status != 0) - (*dis_info->memory_error_func) (status, pc, dis_info); - sprintf (limmp, "%.4x", - (unsigned) bfd_get_bits (buf, 16, - dis_info->endian == BFD_ENDIAN_BIG)); - } +static const char * +cond_code_name (struct arcDisState * state, int val) +{ + if (state->condCodeName) + return (*state->condCodeName)(state->_this, val); + return 0; } -/* Return the actual instruction length, in bits, which depends on the size - of the opcode - 2 or 4 bytes - and the absence or presence of a (4 byte) - long immediate. - Also, if a long immediate is present, put its hexadecimal representation - into limm_str. - ??? cgen-opc.c:cgen_lookup_insn has a 'sanity' check of the length - that will fail if its input length differs from the result of - CGEN_EXTRACT_FN. Need to check when this could trigger. */ -int -arc_insn_length (unsigned long insn_value, const CGEN_INSN *insn, - CGEN_EXTRACT_INFO *info, bfd_vma pc) +static const char * +instruction_name (struct arcDisState * state, + int op1, + int op2, + int * flags) { - switch (CGEN_INSN_ATTR_VALUE (insn, CGEN_INSN_LIMM)) - { - case LIMM_NONE: - return CGEN_INSN_ATTR_VALUE (insn, CGEN_INSN_SHORT_P) ? 16 : 32; - case LIMM_H: - { - /* This is a short insn; extract the actual opcode. */ - unsigned high = insn_value >> 16; + if (state->instName) + return (*state->instName)(state->_this, op1, op2, flags); + return 0; +} - if ((high & 0xe7) != 0xc7) - return 16; - read_limm (info, pc+2); - return 48; - } - case LIMM_B: - if ((insn_value & 0x07007000) != 0x06007000) - return 32; - break; - case LIMM_BC: - if ((insn_value & 0x07007000) == 0x06007000) - break; - /* Fall through. */ - case LIMM_C: - if ((insn_value & 0x00000fc0) != 0x00000f80) - return 32; - break; - default: - abort (); - } - read_limm (info, pc+4); - return 64; +static void +mwerror (struct arcDisState * state, const char * msg) +{ + if (state->err != 0) + (*state->err)(state->_this, (msg)); } -/* -- */ - -void arc_cgen_print_operand - (CGEN_CPU_DESC, int, PTR, CGEN_FIELDS *, void const *, bfd_vma, int); - -/* Main entry point for printing operands. - XINFO is a `void *' and not a `disassemble_info *' to not put a requirement - of dis-asm.h on cgen.h. - - This function is basically just a big switch statement. Earlier versions - used tables to look up the function to use, but - - if the table contains both assembler and disassembler functions then - the disassembler contains much of the assembler and vice-versa, - - there's a lot of inlining possibilities as things grow, - - using a switch statement avoids the function call overhead. - - This function could be moved into `print_insn_normal', but keeping it - separate makes clear the interface between `print_insn_normal' and each of - the handlers. */ - -void -arc_cgen_print_operand (CGEN_CPU_DESC cd, - int opindex, - void * xinfo, - CGEN_FIELDS *fields, - void const *attrs ATTRIBUTE_UNUSED, - bfd_vma pc, - int length) +static const char * +post_address (struct arcDisState * state, int addr) { - disassemble_info *info = (disassemble_info *) xinfo; + static char id[3 * ARRAY_SIZE (state->addresses)]; + int j, i = state->acnt; - switch (opindex) + if (i < ((int) ARRAY_SIZE (state->addresses))) { - case ARC_OPERAND_EXDI : - print_keyword (cd, info, & arc_cgen_opval_h_Di, fields->f_F, 0); - break; - case ARC_OPERAND_F : - print_keyword (cd, info, & arc_cgen_opval_h_uflags, fields->f_F, 0); - break; - case ARC_OPERAND_F0 : - print_keyword (cd, info, & arc_cgen_opval_h_nil, fields->f_F, 0); - break; - case ARC_OPERAND_F1 : - print_keyword (cd, info, & arc_cgen_opval_h_auflags, fields->f_F, 0); - break; - case ARC_OPERAND_F1F : - print_keyword (cd, info, & arc_cgen_opval_h_aufflags, fields->f_F, 0); - break; - case ARC_OPERAND_GP : - print_keyword (cd, info, & arc_cgen_opval_h_gp, 0, 0); - break; - case ARC_OPERAND_LDODI : - print_keyword (cd, info, & arc_cgen_opval_h_Di, fields->f_LDODi, 0); - break; - case ARC_OPERAND_LDRDI : - print_keyword (cd, info, & arc_cgen_opval_h_Di, fields->f_LDRDi, 0); - break; - case ARC_OPERAND_NE : - print_keyword (cd, info, & arc_cgen_opval_h_ne, 0, 0); - break; - case ARC_OPERAND_PCL : - print_keyword (cd, info, & arc_cgen_opval_h_pcl, 0, 0); - break; - case ARC_OPERAND_QCONDB : - print_keyword (cd, info, & arc_cgen_opval_h_Qcondb, fields->f_cond_Q, 0); - break; - case ARC_OPERAND_QCONDI : - print_keyword (cd, info, & arc_cgen_opval_h_Qcondi, fields->f_cond_Q, 0); - break; - case ARC_OPERAND_QCONDJ : - print_keyword (cd, info, & arc_cgen_opval_h_Qcondj, fields->f_cond_Q, 0); - break; - case ARC_OPERAND_R0 : - print_keyword (cd, info, & arc_cgen_opval_h_r0, 0, 0); - break; - case ARC_OPERAND_R31 : - print_keyword (cd, info, & arc_cgen_opval_h_r31, 0, 0); - break; - case ARC_OPERAND_RA : - print_keyword (cd, info, & arc_cgen_opval_cr_names, fields->f_op_A, 0); - break; - case ARC_OPERAND_RA_0 : - print_keyword (cd, info, & arc_cgen_opval_h_nil, fields->f_op_A, 0); - break; - case ARC_OPERAND_RB : - print_keyword (cd, info, & arc_cgen_opval_cr_names, fields->f_op_B, 0|(1<f_op_B, 0|(1<f_op_C, 0); - break; - case ARC_OPERAND_RC_ILINK : - print_keyword (cd, info, & arc_cgen_opval_h_ilinkx, fields->f_op_Cj, 0); - break; - case ARC_OPERAND_RC_NOILINK : - print_keyword (cd, info, & arc_cgen_opval_h_noilink, fields->f_op_Cj, 0); - break; - case ARC_OPERAND_R_A : - print_keyword (cd, info, & arc_cgen_opval_h_cr16, fields->f_op__a, 0); - break; - case ARC_OPERAND_R_B : - print_keyword (cd, info, & arc_cgen_opval_h_cr16, fields->f_op__b, 0); - break; - case ARC_OPERAND_R_C : - print_keyword (cd, info, & arc_cgen_opval_h_cr16, fields->f_op__c, 0); - break; - case ARC_OPERAND_RCC : - print_keyword (cd, info, & arc_cgen_opval_h_Rcc, fields->f_brcond, 0); - break; - case ARC_OPERAND_RCCS : - print_keyword (cd, info, & arc_cgen_opval_h_RccS, fields->f_brscond, 0); - break; - case ARC_OPERAND_RH : - print_keyword (cd, info, & arc_cgen_opval_cr_names, fields->f_op_h, 0|(1<f_STODi, 0); - break; - case ARC_OPERAND_U6 : - print_normal (cd, info, fields->f_u6, 0, pc, length); - break; - case ARC_OPERAND_U6X2 : - print_normal (cd, info, fields->f_u6x2, 0, pc, length); - break; - case ARC_OPERAND__AW : - print_keyword (cd, info, & arc_cgen_opval_h__aw, 0, 0); - break; - case ARC_OPERAND__L : - print_keyword (cd, info, & arc_cgen_opval_h_insn32, 0, 0); - break; - case ARC_OPERAND__S : - print_keyword (cd, info, & arc_cgen_opval_h_insn16, 0, 0); - break; - case ARC_OPERAND_CBIT : - print_normal (cd, info, 0, 0, pc, length); - break; - case ARC_OPERAND_DELAY_N : - print_keyword (cd, info, & arc_cgen_opval_h_delay, fields->f_delay_N, 0); - break; - case ARC_OPERAND_DUMMY_OP : - print_normal (cd, info, fields->f_dummy, 0, pc, length); - break; - case ARC_OPERAND_I2COND : - print_keyword (cd, info, & arc_cgen_opval_h_i2cond, fields->f_cond_i2, 0); - break; - case ARC_OPERAND_I3COND : - print_keyword (cd, info, & arc_cgen_opval_h_i3cond, fields->f_cond_i3, 0); - break; - case ARC_OPERAND_LABEL10 : - print_address (cd, info, fields->f_rel10, 0|(1<f_rel13bl, 0|(1<f_rel21, 0|(1<f_rel21bl, 0|(1<f_rel25, 0|(1<f_rel25bl, 0|(1<f_rel7, 0|(1<f_rel8, 0|(1<f_rel9, 0|(1<f_s12, 0|(1<f_s12x2, 0|(1<f_s9, 0|(1<f_s9x4, 0, pc, length); - break; - case ARC_OPERAND_SC_S9_ : - print_normal (cd, info, fields->f_s9x4, 0, pc, length); - break; - case ARC_OPERAND_SC_S9B : - print_normal (cd, info, fields->f_s9x1, 0, pc, length); - break; - case ARC_OPERAND_SC_S9W : - print_normal (cd, info, fields->f_s9x2, 0, pc, length); - break; - case ARC_OPERAND_SC_U5_ : - print_normal (cd, info, fields->f_u5x4, 0, pc, length); - break; - case ARC_OPERAND_SC_U5B : - print_normal (cd, info, fields->f_u5, 0, pc, length); - break; - case ARC_OPERAND_SC_U5W : - print_normal (cd, info, fields->f_u5x2, 0, pc, length); - break; - case ARC_OPERAND_TRAPNUM : - print_normal (cd, info, fields->f_trapnum, 0, pc, length); - break; - case ARC_OPERAND_U3 : - print_normal (cd, info, fields->f_u3, 0, pc, length); - break; - case ARC_OPERAND_U5 : - print_normal (cd, info, fields->f_u5, 0, pc, length); - break; - case ARC_OPERAND_U5X4 : - print_normal (cd, info, fields->f_u5x4, 0, pc, length); - break; - case ARC_OPERAND_U7 : - print_normal (cd, info, fields->f_u7, 0, pc, length); - break; - case ARC_OPERAND_U8 : - print_normal (cd, info, fields->f_u8, 0, pc, length); - break; - case ARC_OPERAND_U8X4 : - print_normal (cd, info, fields->f_u8x4, 0, pc, length); - break; - case ARC_OPERAND_UNCONDB : - print_keyword (cd, info, & arc_cgen_opval_h_uncondb, 0, 0); - break; - case ARC_OPERAND_UNCONDI : - print_keyword (cd, info, & arc_cgen_opval_h_uncondi, 0, 0); - break; - case ARC_OPERAND_UNCONDJ : - print_keyword (cd, info, & arc_cgen_opval_h_uncondj, 0, 0); - break; - case ARC_OPERAND_VBIT : - print_normal (cd, info, 0, 0, pc, length); - break; - case ARC_OPERAND_ZBIT : - print_normal (cd, info, 0, 0, pc, length); - break; - - default : - /* xgettext:c-format */ - fprintf (stderr, _("Unrecognized field %d while printing insn.\n"), - opindex); - abort (); - } + state->addresses[i] = addr; + ++state->acnt; + j = i*3; + id[j+0] = '@'; + id[j+1] = '0'+i; + id[j+2] = 0; + + return id + j; + } + return ""; } -cgen_print_fn * const arc_cgen_print_handlers[] = +static void +arc_sprintf (struct arcDisState *state, char *buf, const char *format, ...) { - print_insn_normal, -}; + char *bp; + const char *p; + int size, leading_zero, regMap[2]; + long auxNum; + va_list ap; + + va_start (ap, format); + + bp = buf; + *bp = 0; + p = format; + auxNum = -1; + regMap[0] = 0; + regMap[1] = 0; + + while (1) + switch (*p++) + { + case 0: + goto DOCOMM; /* (return) */ + default: + *bp++ = p[-1]; + break; + case '%': + size = 0; + leading_zero = 0; + RETRY: ; + switch (*p++) + { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + { + /* size. */ + size = p[-1] - '0'; + if (size == 0) + leading_zero = 1; /* e.g. %08x */ + while (*p >= '0' && *p <= '9') + { + size = size * 10 + *p - '0'; + p++; + } + goto RETRY; + } +#define inc_bp() bp = bp + strlen (bp) + case 'h': + { + unsigned u = va_arg (ap, int); + + /* Hex. We can change the format to 0x%08x in + one place, here, if we wish. + We add underscores for easy reading. */ + if (u > 65536) + sprintf (bp, "0x%x_%04x", u >> 16, u & 0xffff); + else + sprintf (bp, "0x%x", u); + inc_bp (); + } + break; + case 'X': case 'x': + { + int val = va_arg (ap, int); + + if (size != 0) + if (leading_zero) + sprintf (bp, "%0*x", size, val); + else + sprintf (bp, "%*x", size, val); + else + sprintf (bp, "%x", val); + inc_bp (); + } + break; + case 'd': + { + int val = va_arg (ap, int); -void -arc_cgen_init_dis (CGEN_CPU_DESC cd) -{ - arc_cgen_init_opcode_table (cd); - arc_cgen_init_ibld_table (cd); - cd->print_handlers = & arc_cgen_print_handlers[0]; - cd->print_operand = arc_cgen_print_operand; -} + if (size != 0) + sprintf (bp, "%*d", size, val); + else + sprintf (bp, "%d", val); + inc_bp (); + } + break; + case 'r': + { + /* Register. */ + int val = va_arg (ap, int); + +#define REG2NAME(num, name) case num: sprintf (bp, ""name); \ + regMap[(num < 32) ? 0 : 1] |= 1 << (num - ((num < 32) ? 0 : 32)); break; + + switch (val) + { + REG2NAME (26, "gp"); + REG2NAME (27, "fp"); + REG2NAME (28, "sp"); + REG2NAME (29, "ilink1"); + REG2NAME (30, "ilink2"); + REG2NAME (31, "blink"); + REG2NAME (60, "lp_count"); + default: + { + const char * ext; + + ext = core_reg_name (state, val); + if (ext) + sprintf (bp, "%s", ext); + else + sprintf (bp,"r%d",val); + } + break; + } + inc_bp (); + } break; + + case 'a': + { + /* Aux Register. */ + int val = va_arg (ap, int); + +#define AUXREG2NAME(num, name) case num: sprintf (bp,name); break; + + switch (val) + { + AUXREG2NAME (0x0, "status"); + AUXREG2NAME (0x1, "semaphore"); + AUXREG2NAME (0x2, "lp_start"); + AUXREG2NAME (0x3, "lp_end"); + AUXREG2NAME (0x4, "identity"); + AUXREG2NAME (0x5, "debug"); + default: + { + const char *ext; + + ext = aux_reg_name (state, val); + if (ext) + sprintf (bp, "%s", ext); + else + arc_sprintf (state, bp, "%h", val); + } + break; + } + inc_bp (); + } + break; - -/* Default print handler. */ + case 's': + { + sprintf (bp, "%s", va_arg (ap, char *)); + inc_bp (); + } + break; + + default: + fprintf (stderr, "?? format %c\n", p[-1]); + break; + } + } + + DOCOMM: *bp = 0; + va_end (ap); +} static void -print_normal (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED, - void *dis_info, - long value, - unsigned int attrs, - bfd_vma pc ATTRIBUTE_UNUSED, - int length ATTRIBUTE_UNUSED) +write_comments_(struct arcDisState * state, + int shimm, + int is_limm, + long limm_value) { - disassemble_info *info = (disassemble_info *) dis_info; + if (state->commentBuffer != 0) + { + int i; -#ifdef CGEN_PRINT_NORMAL - CGEN_PRINT_NORMAL (cd, info, value, attrs, pc, length); -#endif + if (is_limm) + { + const char *name = post_address (state, limm_value + shimm); - /* Print the operand as directed by the attributes. */ - if (CGEN_BOOL_ATTR (attrs, CGEN_OPERAND_SEM_ONLY)) - ; /* nothing to do */ - else if (CGEN_BOOL_ATTR (attrs, CGEN_OPERAND_SIGNED)) - (*info->fprintf_func) (info->stream, "%ld", value); - else - (*info->fprintf_func) (info->stream, "0x%lx", value); + if (*name != 0) + WRITE_COMMENT (name); + } + for (i = 0; i < state->commNum; i++) + { + if (i == 0) + strcpy (state->commentBuffer, comment_prefix); + else + strcat (state->commentBuffer, ", "); + strncat (state->commentBuffer, state->comm[i], + sizeof (state->commentBuffer)); + } + } } -/* Default address handler. */ +#define write_comments2(x) write_comments_ (state, x, is_limm, limm_value) +#define write_comments() write_comments2 (0) + +static const char *condName[] = +{ + /* 0..15. */ + "" , "z" , "nz" , "p" , "n" , "c" , "nc" , "v" , + "nv" , "gt" , "ge" , "lt" , "le" , "hi" , "ls" , "pnz" +}; static void -print_address (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED, - void *dis_info, - bfd_vma value, - unsigned int attrs, - bfd_vma pc ATTRIBUTE_UNUSED, - int length ATTRIBUTE_UNUSED) +write_instr_name_(struct arcDisState * state, + const char * instrName, + int cond, + int condCodeIsPartOfName, + int flag, + int signExtend, + int addrWriteBack, + int directMem) { - disassemble_info *info = (disassemble_info *) dis_info; + strcpy (state->instrBuffer, instrName); -#ifdef CGEN_PRINT_ADDRESS - CGEN_PRINT_ADDRESS (cd, info, value, attrs, pc, length); -#endif + if (cond > 0) + { + const char *cc = 0; - /* Print the operand as directed by the attributes. */ - if (CGEN_BOOL_ATTR (attrs, CGEN_OPERAND_SEM_ONLY)) - ; /* Nothing to do. */ - else if (CGEN_BOOL_ATTR (attrs, CGEN_OPERAND_PCREL_ADDR)) - (*info->print_address_func) (value, info); - else if (CGEN_BOOL_ATTR (attrs, CGEN_OPERAND_ABS_ADDR)) - (*info->print_address_func) (value, info); - else if (CGEN_BOOL_ATTR (attrs, CGEN_OPERAND_SIGNED)) - (*info->fprintf_func) (info->stream, "%ld", (long) value); - else - (*info->fprintf_func) (info->stream, "0x%lx", (long) value); -} + if (!condCodeIsPartOfName) + strcat (state->instrBuffer, "."); + + if (cond < 16) + cc = condName[cond]; + else + cc = cond_code_name (state, cond); -/* Keyword print handler. */ + if (!cc) + cc = "???"; -static void -print_keyword (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED, - void *dis_info, - CGEN_KEYWORD *keyword_table, - long value, - unsigned int attrs ATTRIBUTE_UNUSED) -{ - disassemble_info *info = (disassemble_info *) dis_info; - const CGEN_KEYWORD_ENTRY *ke; + strcat (state->instrBuffer, cc); + } - ke = cgen_keyword_lookup_value (keyword_table, value); - if (ke != NULL) - (*info->fprintf_func) (info->stream, "%s", ke->name); - else - (*info->fprintf_func) (info->stream, "???"); + if (flag) + strcat (state->instrBuffer, ".f"); + + switch (state->nullifyMode) + { + case BR_exec_always: + strcat (state->instrBuffer, ".d"); + break; + case BR_exec_when_jump: + strcat (state->instrBuffer, ".jd"); + break; + } + + if (signExtend) + strcat (state->instrBuffer, ".x"); + + if (addrWriteBack) + strcat (state->instrBuffer, ".a"); + + if (directMem) + strcat (state->instrBuffer, ".di"); } - -/* Default insn printer. - DIS_INFO is defined as `void *' so the disassembler needn't know anything - about disassemble_info. */ +#define write_instr_name() \ + do \ + { \ + write_instr_name_(state, instrName,cond, condCodeIsPartOfName, \ + flag, signExtend, addrWriteBack, directMem); \ + formatString[0] = '\0'; \ + } \ + while (0) -static void -print_insn_normal (CGEN_CPU_DESC cd, - void *dis_info, - const CGEN_INSN *insn, - CGEN_FIELDS *fields, - bfd_vma pc, - int length) +enum { - const CGEN_SYNTAX *syntax = CGEN_INSN_SYNTAX (insn); - disassemble_info *info = (disassemble_info *) dis_info; - const CGEN_SYNTAX_CHAR_TYPE *syn; + op_LD0 = 0, op_LD1 = 1, op_ST = 2, op_3 = 3, + op_BC = 4, op_BLC = 5, op_LPC = 6, op_JC = 7, + op_ADD = 8, op_ADC = 9, op_SUB = 10, op_SBC = 11, + op_AND = 12, op_OR = 13, op_BIC = 14, op_XOR = 15 +}; - CGEN_INIT_PRINT (cd); +extern disassemble_info tm_print_insn_info; - for (syn = CGEN_SYNTAX_STRING (syntax); *syn; ++syn) +static int +dsmOneArcInst (bfd_vma addr, struct arcDisState * state) +{ + int condCodeIsPartOfName = 0; + a4_decoding_class decodingClass; + const char * instrName; + int repeatsOp = 0; + int fieldAisReg = 1; + int fieldBisReg = 1; + int fieldCisReg = 1; + int fieldA; + int fieldB; + int fieldC = 0; + int flag = 0; + int cond = 0; + int is_shimm = 0; + int is_limm = 0; + long limm_value = 0; + int signExtend = 0; + int addrWriteBack = 0; + int directMem = 0; + int is_linked = 0; + int offset = 0; + int usesAuxReg = 0; + int flags; + int ignoreFirstOpd; + char formatString[60]; + + state->instructionLen = 4; + state->nullifyMode = BR_exec_when_no_jump; + state->opWidth = 12; + state->isBranch = 0; + + state->_mem_load = 0; + state->_ea_present = 0; + state->_load_len = 0; + state->ea_reg1 = no_reg; + state->ea_reg2 = no_reg; + state->_offset = 0; + + if (! NEXT_WORD (0)) + return 0; + + state->_opcode = OPCODE (state->words[0]); + instrName = 0; + decodingClass = CLASS_A4_ARITH; /* default! */ + repeatsOp = 0; + condCodeIsPartOfName=0; + state->commNum = 0; + state->tcnt = 0; + state->acnt = 0; + state->flow = noflow; + ignoreFirstOpd = 0; + + if (state->commentBuffer) + state->commentBuffer[0] = '\0'; + + switch (state->_opcode) { - if (CGEN_SYNTAX_MNEMONIC_P (*syn)) + case op_LD0: + switch (BITS (state->words[0],1,2)) + { + case 0: + instrName = "ld"; + state->_load_len = 4; + break; + case 1: + instrName = "ldb"; + state->_load_len = 1; + break; + case 2: + instrName = "ldw"; + state->_load_len = 2; + break; + default: + instrName = "??? (0[3])"; + state->flow = invalid_instr; + break; + } + decodingClass = CLASS_A4_LD0; + break; + + case op_LD1: + if (BIT (state->words[0],13)) + { + instrName = "lr"; + decodingClass = CLASS_A4_LR; + } + else + { + switch (BITS (state->words[0], 10, 11)) + { + case 0: + instrName = "ld"; + state->_load_len = 4; + break; + case 1: + instrName = "ldb"; + state->_load_len = 1; + break; + case 2: + instrName = "ldw"; + state->_load_len = 2; + break; + default: + instrName = "??? (1[3])"; + state->flow = invalid_instr; + break; + } + decodingClass = CLASS_A4_LD1; + } + break; + + case op_ST: + if (BIT (state->words[0], 25)) + { + instrName = "sr"; + decodingClass = CLASS_A4_SR; + } + else + { + switch (BITS (state->words[0], 22, 23)) + { + case 0: + instrName = "st"; + break; + case 1: + instrName = "stb"; + break; + case 2: + instrName = "stw"; + break; + default: + instrName = "??? (2[3])"; + state->flow = invalid_instr; + break; + } + decodingClass = CLASS_A4_ST; + } + break; + + case op_3: + decodingClass = CLASS_A4_OP3_GENERAL; /* default for opcode 3... */ + switch (FIELDC (state->words[0])) + { + case 0: + instrName = "flag"; + decodingClass = CLASS_A4_FLAG; + break; + case 1: + instrName = "asr"; + break; + case 2: + instrName = "lsr"; + break; + case 3: + instrName = "ror"; + break; + case 4: + instrName = "rrc"; + break; + case 5: + instrName = "sexb"; + break; + case 6: + instrName = "sexw"; + break; + case 7: + instrName = "extb"; + break; + case 8: + instrName = "extw"; + break; + case 0x3f: + { + decodingClass = CLASS_A4_OP3_SUBOPC3F; + switch (FIELDD (state->words[0])) + { + case 0: + instrName = "brk"; + break; + case 1: + instrName = "sleep"; + break; + case 2: + instrName = "swi"; + break; + default: + instrName = "???"; + state->flow=invalid_instr; + break; + } + } + break; + + /* ARC Extension Library Instructions + NOTE: We assume that extension codes are these instrs. */ + default: + instrName = instruction_name (state, + state->_opcode, + FIELDC (state->words[0]), + &flags); + if (!instrName) + { + instrName = "???"; + state->flow = invalid_instr; + } + if (flags & IGNORE_FIRST_OPD) + ignoreFirstOpd = 1; + break; + } + break; + + case op_BC: + instrName = "b"; + case op_BLC: + if (!instrName) + instrName = "bl"; + case op_LPC: + if (!instrName) + instrName = "lp"; + case op_JC: + if (!instrName) + { + if (BITS (state->words[0],9,9)) + { + instrName = "jl"; + is_linked = 1; + } + else + { + instrName = "j"; + is_linked = 0; + } + } + condCodeIsPartOfName = 1; + decodingClass = ((state->_opcode == op_JC) ? CLASS_A4_JC : CLASS_A4_BRANCH ); + state->isBranch = 1; + break; + + case op_ADD: + case op_ADC: + case op_AND: + repeatsOp = (FIELDC (state->words[0]) == FIELDB (state->words[0])); + + switch (state->_opcode) { - (*info->fprintf_func) (info->stream, "%s", CGEN_INSN_MNEMONIC (insn)); - continue; + case op_ADD: + instrName = (repeatsOp ? "asl" : "add"); + break; + case op_ADC: + instrName = (repeatsOp ? "rlc" : "adc"); + break; + case op_AND: + instrName = (repeatsOp ? "mov" : "and"); + break; } - if (CGEN_SYNTAX_CHAR_P (*syn)) + break; + + case op_SUB: instrName = "sub"; + break; + case op_SBC: instrName = "sbc"; + break; + case op_OR: instrName = "or"; + break; + case op_BIC: instrName = "bic"; + break; + + case op_XOR: + if (state->words[0] == 0x7fffffff) { - (*info->fprintf_func) (info->stream, "%c", CGEN_SYNTAX_CHAR (*syn)); - continue; + /* NOP encoded as xor -1, -1, -1. */ + instrName = "nop"; + decodingClass = CLASS_A4_OP3_SUBOPC3F; } + else + instrName = "xor"; + break; - /* We have an operand. */ - arc_cgen_print_operand (cd, CGEN_SYNTAX_FIELD (*syn), info, - fields, CGEN_INSN_ATTRS (insn), pc, length); + default: + instrName = instruction_name (state,state->_opcode,0,&flags); + /* if (instrName) printf("FLAGS=0x%x\n", flags); */ + if (!instrName) + { + instrName = "???"; + state->flow=invalid_instr; + } + if (flags & IGNORE_FIRST_OPD) + ignoreFirstOpd = 1; + break; } -} - -/* Subroutine of print_insn. Reads an insn into the given buffers and updates - the extract info. - Returns 0 if all is well, non-zero otherwise. */ -static int -read_insn (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED, - bfd_vma pc, - disassemble_info *info, - bfd_byte *buf, - int buflen, - CGEN_EXTRACT_INFO *ex_info, - unsigned long *insn_value) -{ - int status = (*info->read_memory_func) (pc, buf, buflen, info); + fieldAisReg = fieldBisReg = fieldCisReg = 1; /* Assume regs for now. */ + flag = cond = is_shimm = is_limm = 0; + state->nullifyMode = BR_exec_when_no_jump; /* 0 */ + signExtend = addrWriteBack = directMem = 0; + usesAuxReg = 0; - if (status != 0) + switch (decodingClass) { - (*info->memory_error_func) (status, pc, info); - return -1; - } + case CLASS_A4_ARITH: + CHECK_FIELD_A (); + CHECK_FIELD_B (); + if (!repeatsOp) + CHECK_FIELD_C (); + CHECK_FLAG_COND_NULLIFY (); + + write_instr_name (); + if (!ignoreFirstOpd) + { + WRITE_FORMAT_x (A); + WRITE_FORMAT_COMMA_x (B); + if (!repeatsOp) + WRITE_FORMAT_COMMA_x (C); + WRITE_NOP_COMMENT (); + arc_sprintf (state, state->operandBuffer, formatString, + fieldA, fieldB, fieldC); + } + else + { + WRITE_FORMAT_x (B); + if (!repeatsOp) + WRITE_FORMAT_COMMA_x (C); + arc_sprintf (state, state->operandBuffer, formatString, + fieldB, fieldC); + } + write_comments (); + break; - ex_info->dis_info = info; - ex_info->valid = (1 << buflen) - 1; - ex_info->insn_bytes = buf; + case CLASS_A4_OP3_GENERAL: + CHECK_FIELD_A (); + CHECK_FIELD_B (); + CHECK_FLAG_COND_NULLIFY (); - *insn_value = bfd_get_bits (buf, buflen * 8, info->endian == BFD_ENDIAN_BIG); - return 0; -} + write_instr_name (); + if (!ignoreFirstOpd) + { + WRITE_FORMAT_x (A); + WRITE_FORMAT_COMMA_x (B); + WRITE_NOP_COMMENT (); + arc_sprintf (state, state->operandBuffer, formatString, + fieldA, fieldB); + } + else + { + WRITE_FORMAT_x (B); + arc_sprintf (state, state->operandBuffer, formatString, fieldB); + } + write_comments (); + break; -/* Utility to print an insn. - BUF is the base part of the insn, target byte order, BUFLEN bytes long. - The result is the size of the insn in bytes or zero for an unknown insn - or -1 if an error occurs fetching data (memory_error_func will have - been called). */ + case CLASS_A4_FLAG: + CHECK_FIELD_B (); + CHECK_FLAG_COND_NULLIFY (); + flag = 0; /* This is the FLAG instruction -- it's redundant. */ -static int -print_insn (CGEN_CPU_DESC cd, - bfd_vma pc, - disassemble_info *info, - bfd_byte *buf, - unsigned int buflen) -{ - CGEN_INSN_INT insn_value; - const CGEN_INSN_LIST *insn_list; - CGEN_EXTRACT_INFO ex_info; - int basesize; + write_instr_name (); + WRITE_FORMAT_x (B); + arc_sprintf (state, state->operandBuffer, formatString, fieldB); + write_comments (); + break; - /* Extract base part of instruction, just in case CGEN_DIS_* uses it. */ - basesize = cd->base_insn_bitsize < buflen * 8 ? - cd->base_insn_bitsize : buflen * 8; - insn_value = cgen_get_insn_value (cd, buf, basesize); + case CLASS_A4_BRANCH: + fieldA = BITS (state->words[0],7,26) << 2; + fieldA = (fieldA << 10) >> 10; /* Make it signed. */ + fieldA += addr + 4; + CHECK_FLAG_COND_NULLIFY (); + flag = 0; + write_instr_name (); + /* This address could be a label we know. Convert it. */ + if (state->_opcode != op_LPC /* LP */) + { + add_target (fieldA); /* For debugger. */ + state->flow = state->_opcode == op_BLC /* BL */ + ? direct_call + : direct_jump; + /* indirect calls are achieved by "lr blink,[status]; + lr dest<- func addr; j [dest]" */ + } - /* Fill in ex_info fields like read_insn would. Don't actually call - read_insn, since the incoming buffer is already read (and possibly - modified a la m32r). */ - ex_info.valid = (1 << buflen) - 1; - ex_info.dis_info = info; - ex_info.insn_bytes = buf; + strcat (formatString, "%s"); /* Address/label name. */ + arc_sprintf (state, state->operandBuffer, formatString, + post_address (state, fieldA)); + write_comments (); + break; - /* The instructions are stored in hash lists. - Pick the first one and keep trying until we find the right one. */ + case CLASS_A4_JC: + /* For op_JC -- jump to address specified. + Also covers jump and link--bit 9 of the instr. word + selects whether linked, thus "is_linked" is set above. */ + fieldA = 0; + CHECK_FIELD_B (); + CHECK_FLAG_COND_NULLIFY (); - insn_list = CGEN_DIS_LOOKUP_INSN (cd, (char *) buf, insn_value); - while (insn_list != NULL) - { - const CGEN_INSN *insn = insn_list->insn; - CGEN_FIELDS fields; - int length; - unsigned long insn_value_cropped; - -#ifdef CGEN_VALIDATE_INSN_SUPPORTED - /* Not needed as insn shouldn't be in hash lists if not supported. */ - /* Supported by this cpu? */ - if (! arc_cgen_insn_supported (cd, insn)) - { - insn_list = CGEN_DIS_NEXT_INSN (insn_list); - continue; - } -#endif + if (!fieldBisReg) + { + fieldAisReg = 0; + fieldA = (fieldB >> 25) & 0x7F; /* Flags. */ + fieldB = (fieldB & 0xFFFFFF) << 2; + state->flow = is_linked ? direct_call : direct_jump; + add_target (fieldB); + /* Screwy JLcc requires .jd mode to execute correctly + but we pretend it is .nd (no delay slot). */ + if (is_linked && state->nullifyMode == BR_exec_when_jump) + state->nullifyMode = BR_exec_when_no_jump; + } + else + { + state->flow = is_linked ? indirect_call : indirect_jump; + /* We should also treat this as indirect call if NOT linked + but the preceding instruction was a "lr blink,[status]" + and we have a delay slot with "add blink,blink,2". + For now we can't detect such. */ + state->register_for_indirect_jump = fieldB; + } - /* Basic bit mask must be correct. */ - /* ??? May wish to allow target to defer this check until the extract - handler. */ + write_instr_name (); + strcat (formatString, + IS_REG (B) ? "[%r]" : "%s"); /* Address/label name. */ + if (fieldA != 0) + { + fieldAisReg = 0; + WRITE_FORMAT_COMMA_x (A); + } + if (IS_REG (B)) + arc_sprintf (state, state->operandBuffer, formatString, fieldB, fieldA); + else + arc_sprintf (state, state->operandBuffer, formatString, + post_address (state, fieldB), fieldA); + write_comments (); + break; + + case CLASS_A4_LD0: + /* LD instruction. + B and C can be regs, or one (both?) can be limm. */ + CHECK_FIELD_A (); + CHECK_FIELD_B (); + CHECK_FIELD_C (); + if (dbg) + printf ("5:b reg %d %d c reg %d %d \n", + fieldBisReg,fieldB,fieldCisReg,fieldC); + state->_offset = 0; + state->_ea_present = 1; + if (fieldBisReg) + state->ea_reg1 = fieldB; + else + state->_offset += fieldB; + if (fieldCisReg) + state->ea_reg2 = fieldC; + else + state->_offset += fieldC; + state->_mem_load = 1; - /* Base size may exceed this instruction's size. Extract the - relevant part from the buffer. */ - if ((unsigned) (CGEN_INSN_BITSIZE (insn) / 8) < buflen && - (unsigned) (CGEN_INSN_BITSIZE (insn) / 8) <= sizeof (unsigned long)) - insn_value_cropped = bfd_get_bits (buf, CGEN_INSN_BITSIZE (insn), - info->endian == BFD_ENDIAN_BIG); + directMem = BIT (state->words[0], 5); + addrWriteBack = BIT (state->words[0], 3); + signExtend = BIT (state->words[0], 0); + + write_instr_name (); + WRITE_FORMAT_x_COMMA_LB(A); + if (fieldBisReg || fieldB != 0) + WRITE_FORMAT_x_COMMA (B); + else + fieldB = fieldC; + + WRITE_FORMAT_x_RB (C); + arc_sprintf (state, state->operandBuffer, formatString, + fieldA, fieldB, fieldC); + write_comments (); + break; + + case CLASS_A4_LD1: + /* LD instruction. */ + CHECK_FIELD_B (); + CHECK_FIELD_A (); + fieldC = FIELDD (state->words[0]); + + if (dbg) + printf ("6:b reg %d %d c 0x%x \n", + fieldBisReg, fieldB, fieldC); + state->_ea_present = 1; + state->_offset = fieldC; + state->_mem_load = 1; + if (fieldBisReg) + state->ea_reg1 = fieldB; + /* Field B is either a shimm (same as fieldC) or limm (different!) + Say ea is not present, so only one of us will do the name lookup. */ else - insn_value_cropped = insn_value; + state->_offset += fieldB, state->_ea_present = 0; + + directMem = BIT (state->words[0],14); + addrWriteBack = BIT (state->words[0],12); + signExtend = BIT (state->words[0],9); - if ((insn_value_cropped & CGEN_INSN_BASE_MASK (insn)) - == CGEN_INSN_BASE_VALUE (insn)) + write_instr_name (); + WRITE_FORMAT_x_COMMA_LB (A); + if (!fieldBisReg) { - /* Printing is handled in two passes. The first pass parses the - machine insn and extracts the fields. The second pass prints - them. */ - - /* Make sure the entire insn is loaded into insn_value, if it - can fit. */ - if (((unsigned) CGEN_INSN_BITSIZE (insn) > cd->base_insn_bitsize) && - (unsigned) (CGEN_INSN_BITSIZE (insn) / 8) <= sizeof (unsigned long)) + fieldB = state->_offset; + WRITE_FORMAT_x_RB (B); + } + else + { + WRITE_FORMAT_x (B); + if (fieldC != 0 && !BIT (state->words[0],13)) { - unsigned long full_insn_value; - int rc = read_insn (cd, pc, info, buf, - CGEN_INSN_BITSIZE (insn) / 8, - & ex_info, & full_insn_value); - if (rc != 0) - return rc; - length = CGEN_EXTRACT_FN (cd, insn) - (cd, insn, &ex_info, full_insn_value, &fields, pc); + fieldCisReg = 0; + WRITE_FORMAT_COMMA_x_RB (C); } else - length = CGEN_EXTRACT_FN (cd, insn) - (cd, insn, &ex_info, insn_value_cropped, &fields, pc); + WRITE_FORMAT_RB (); + } + arc_sprintf (state, state->operandBuffer, formatString, + fieldA, fieldB, fieldC); + write_comments (); + break; + + case CLASS_A4_ST: + /* ST instruction. */ + CHECK_FIELD_B(); + CHECK_FIELD_C(); + fieldA = FIELDD(state->words[0]); /* shimm */ + + /* [B,A offset] */ + if (dbg) printf("7:b reg %d %x off %x\n", + fieldBisReg,fieldB,fieldA); + state->_ea_present = 1; + state->_offset = fieldA; + if (fieldBisReg) + state->ea_reg1 = fieldB; + /* Field B is either a shimm (same as fieldA) or limm (different!) + Say ea is not present, so only one of us will do the name lookup. + (for is_limm we do the name translation here). */ + else + state->_offset += fieldB, state->_ea_present = 0; + + directMem = BIT (state->words[0], 26); + addrWriteBack = BIT (state->words[0], 24); + + write_instr_name (); + WRITE_FORMAT_x_COMMA_LB(C); - /* Length < 0 -> error. */ - if (length < 0) - return length; - if (length > 0) + if (!fieldBisReg) + { + fieldB = state->_offset; + WRITE_FORMAT_x_RB (B); + } + else + { + WRITE_FORMAT_x (B); + if (fieldBisReg && fieldA != 0) { - CGEN_PRINT_FN (cd, insn) (cd, info, insn, &fields, pc, length); - /* Length is in bits, result is in bytes. */ - return length / 8; + fieldAisReg = 0; + WRITE_FORMAT_COMMA_x_RB(A); } + else + WRITE_FORMAT_RB(); } + arc_sprintf (state, state->operandBuffer, formatString, + fieldC, fieldB, fieldA); + write_comments2 (fieldA); + break; + + case CLASS_A4_SR: + /* SR instruction */ + CHECK_FIELD_B(); + CHECK_FIELD_C(); + + write_instr_name (); + WRITE_FORMAT_x_COMMA_LB(C); + /* Try to print B as an aux reg if it is not a core reg. */ + usesAuxReg = 1; + WRITE_FORMAT_x (B); + WRITE_FORMAT_RB (); + arc_sprintf (state, state->operandBuffer, formatString, fieldC, fieldB); + write_comments (); + break; + + case CLASS_A4_OP3_SUBOPC3F: + write_instr_name (); + state->operandBuffer[0] = '\0'; + break; + + case CLASS_A4_LR: + /* LR instruction */ + CHECK_FIELD_A (); + CHECK_FIELD_B (); - insn_list = CGEN_DIS_NEXT_INSN (insn_list); + write_instr_name (); + WRITE_FORMAT_x_COMMA_LB (A); + /* Try to print B as an aux reg if it is not a core reg. */ + usesAuxReg = 1; + WRITE_FORMAT_x (B); + WRITE_FORMAT_RB (); + arc_sprintf (state, state->operandBuffer, formatString, fieldA, fieldB); + write_comments (); + break; + + default: + mwerror (state, "Bad decoding class in ARC disassembler"); + break; } - return 0; + state->_cond = cond; + return state->instructionLen = offset; } -/* Default value for CGEN_PRINT_INSN. - The result is the size of the insn in bytes or zero for an unknown insn - or -1 if an error occured fetching bytes. */ -#ifndef CGEN_PRINT_INSN -#define CGEN_PRINT_INSN default_print_insn -#endif +/* Returns the name the user specified core extension register. */ -static int -default_print_insn (CGEN_CPU_DESC cd, bfd_vma pc, disassemble_info *info) +static const char * +_coreRegName(void * arg ATTRIBUTE_UNUSED, int regval) { - bfd_byte buf[CGEN_MAX_INSN_SIZE]; - int buflen; - int status; + return arcExtMap_coreRegName (regval); +} - /* Attempt to read the base part of the insn. */ - buflen = cd->base_insn_bitsize / 8; - status = (*info->read_memory_func) (pc, buf, buflen, info); +/* Returns the name the user specified AUX extension register. */ - /* Try again with the minimum part, if min < base. */ - if (status != 0 && (cd->min_insn_bitsize < cd->base_insn_bitsize)) - { - buflen = cd->min_insn_bitsize / 8; - status = (*info->read_memory_func) (pc, buf, buflen, info); - } +static const char * +_auxRegName(void *_this ATTRIBUTE_UNUSED, int regval) +{ + return arcExtMap_auxRegName(regval); +} - if (status != 0) - { - (*info->memory_error_func) (status, pc, info); - return -1; - } +/* Returns the name the user specified condition code name. */ - return print_insn (cd, pc, info, buf, buflen); +static const char * +_condCodeName(void *_this ATTRIBUTE_UNUSED, int regval) +{ + return arcExtMap_condCodeName(regval); } -/* Main entry point. - Print one instruction from PC on INFO->STREAM. - Return the size of the instruction (in bytes). */ +/* Returns the name the user specified extension instruction. */ -typedef struct cpu_desc_list +static const char * +_instName (void *_this ATTRIBUTE_UNUSED, int majop, int minop, int *flags) { - struct cpu_desc_list *next; - CGEN_BITSET *isa; - int mach; - int endian; - CGEN_CPU_DESC cd; -} cpu_desc_list; - -int -print_insn_arc (bfd_vma pc, disassemble_info *info) + return arcExtMap_instName(majop, minop, flags); +} + +/* Decode an instruction returning the size of the instruction + in bytes or zero if unrecognized. */ + +static int +decodeInstr (bfd_vma address, /* Address of this instruction. */ + disassemble_info * info) { - static cpu_desc_list *cd_list = 0; - cpu_desc_list *cl = 0; - static CGEN_CPU_DESC cd = 0; - static CGEN_BITSET *prev_isa; - static int prev_mach; - static int prev_endian; - int length; - CGEN_BITSET *isa; - int mach; - int endian = (info->endian == BFD_ENDIAN_BIG - ? CGEN_ENDIAN_BIG - : CGEN_ENDIAN_LITTLE); - enum bfd_architecture arch; - - /* ??? gdb will set mach but leave the architecture as "unknown" */ -#ifndef CGEN_BFD_ARCH -#define CGEN_BFD_ARCH bfd_arch_arc -#endif - arch = info->arch; - if (arch == bfd_arch_unknown) - arch = CGEN_BFD_ARCH; - - /* There's no standard way to compute the machine or isa number - so we leave it to the target. */ -#ifdef CGEN_COMPUTE_MACH - mach = CGEN_COMPUTE_MACH (info); -#else - mach = info->mach; -#endif + int status; + bfd_byte buffer[4]; + struct arcDisState s; /* ARC Disassembler state. */ + void *stream = info->stream; /* Output stream. */ + fprintf_ftype func = info->fprintf_func; + int bytes; -#ifdef CGEN_COMPUTE_ISA - { - static CGEN_BITSET *permanent_isa; - - if (!permanent_isa) - permanent_isa = cgen_bitset_create (MAX_ISAS); - isa = permanent_isa; - cgen_bitset_clear (isa); - cgen_bitset_add (isa, CGEN_COMPUTE_ISA (info)); - } -#else - isa = info->insn_sets; -#endif + memset (&s, 0, sizeof(struct arcDisState)); - /* If we've switched cpu's, try to find a handle we've used before */ - if (cd - && (cgen_bitset_compare (isa, prev_isa) != 0 - || mach != prev_mach - || endian != prev_endian)) + /* read first instruction */ + status = (*info->read_memory_func) (address, buffer, 4, info); + if (status != 0) { - cd = 0; - for (cl = cd_list; cl; cl = cl->next) - { - if (cgen_bitset_compare (cl->isa, isa) == 0 && - cl->mach == mach && - cl->endian == endian) - { - cd = cl->cd; - prev_isa = cd->isas; - break; - } - } - } + (*info->memory_error_func) (status, address, info); + return 0; + } + if (info->endian == BFD_ENDIAN_LITTLE) + s.words[0] = bfd_getl32(buffer); + else + s.words[0] = bfd_getb32(buffer); + /* Always read second word in case of limm. */ + + /* We ignore the result since last insn may not have a limm. */ + status = (*info->read_memory_func) (address + 4, buffer, 4, info); + if (info->endian == BFD_ENDIAN_LITTLE) + s.words[1] = bfd_getl32(buffer); + else + s.words[1] = bfd_getb32(buffer); + + s._this = &s; + s.coreRegName = _coreRegName; + s.auxRegName = _auxRegName; + s.condCodeName = _condCodeName; + s.instName = _instName; + + /* Disassemble. */ + bytes = dsmOneArcInst (address, (void *)& s); - /* If we haven't initialized yet, initialize the opcode table. */ - if (! cd) + /* Display the disassembly instruction. */ + (*func) (stream, "%08lx ", s.words[0]); + (*func) (stream, " "); + (*func) (stream, "%-10s ", s.instrBuffer); + + if (__TRANSLATION_REQUIRED (s)) { - const bfd_arch_info_type *arch_type = bfd_lookup_arch (arch, mach); - const char *mach_name; - - if (!arch_type) - abort (); - mach_name = arch_type->printable_name; - - prev_isa = cgen_bitset_copy (isa); - prev_mach = mach; - prev_endian = endian; - cd = arc_cgen_cpu_open (CGEN_CPU_OPEN_ISAS, prev_isa, - CGEN_CPU_OPEN_BFDMACH, mach_name, - CGEN_CPU_OPEN_ENDIAN, prev_endian, - CGEN_CPU_OPEN_END); - if (!cd) - abort (); - - /* Save this away for future reference. */ - cl = xmalloc (sizeof (struct cpu_desc_list)); - cl->cd = cd; - cl->isa = prev_isa; - cl->mach = mach; - cl->endian = endian; - cl->next = cd_list; - cd_list = cl; - - arc_cgen_init_dis (cd); + bfd_vma addr = s.addresses[s.operandBuffer[1] - '0']; + + (*info->print_address_func) ((bfd_vma) addr, info); + (*func) (stream, "\n"); } + else + (*func) (stream, "%s",s.operandBuffer); + + return s.instructionLen; +} - /* We try to have as much common code as possible. - But at this point some targets need to take over. */ - /* ??? Some targets may need a hook elsewhere. Try to avoid this, - but if not possible try to move this hook elsewhere rather than - have two hooks. */ - length = CGEN_PRINT_INSN (cd, pc, info); - if (length > 0) - return length; - if (length < 0) - return -1; - - (*info->fprintf_func) (info->stream, UNKNOWN_INSN_MSG); - return cd->default_insn_bitsize / 8; +/* Return the print_insn function to use. + Side effect: load (possibly empty) extension section */ + +disassembler_ftype +arc_get_disassembler (void *ptr) +{ + if (ptr) + build_ARC_extmap (ptr); + return decodeInstr; } diff --git a/opcodes/arc-ext.c b/opcodes/arc-ext.c index d2d838e..2bb1bb1 100644 --- a/opcodes/arc-ext.c +++ b/opcodes/arc-ext.c @@ -21,16 +21,269 @@ #include #include + #include "bfd.h" #include "arc-ext.h" #include "elf/arc.h" - #include "libiberty.h" #include "sysdep.h" -/* extension structure */ + +/******************************************************************************/ +/* */ +/* Outline: */ +/* This module provides support for extensions to the ARC processor */ +/* architecture. */ +/* */ +/******************************************************************************/ + + +/* -------------------------------------------------------------------------- */ +/* local constants */ +/* -------------------------------------------------------------------------- */ + +#define FIRST_EXTENSION_CORE_REGISTER 32 +#define LAST_EXTENSION_CORE_REGISTER 59 +#define FIRST_EXTENSION_CONDITION_CODE 0x10 +#define LAST_EXTENSION_CONDITION_CODE 0x1f + +#define NUM_EXT_CORE (LAST_EXTENSION_CORE_REGISTER - FIRST_EXTENSION_CORE_REGISTER + 1) +#define NUM_EXT_COND (LAST_EXTENSION_CONDITION_CODE - FIRST_EXTENSION_CONDITION_CODE + 1) +#define INST_HASH_BITS 6 +#define INST_HASH_SIZE (1 << INST_HASH_BITS) +#define INST_HASH_MASK (INST_HASH_SIZE - 1) + + +/* -------------------------------------------------------------------------- */ +/* local types */ +/* -------------------------------------------------------------------------- */ + +/* these types define the information stored in the table */ + +struct ExtInstruction +{ + char major; + char minor; + char flags; + char* name; + struct ExtInstruction* next; +}; + +struct ExtAuxRegister +{ + long address; + char* name; + struct ExtAuxRegister* next; +}; + +struct ExtCoreRegister +{ + short number; + enum ExtReadWrite rw; + char* name; +}; + +struct arcExtMap +{ + struct ExtAuxRegister* auxRegisters; + struct ExtInstruction* instructions[INST_HASH_SIZE]; + struct ExtCoreRegister coreRegisters[NUM_EXT_CORE]; + char* condCodes[NUM_EXT_COND]; +}; + + +/* -------------------------------------------------------------------------- */ +/* local data */ +/* -------------------------------------------------------------------------- */ + +/* extension table */ static struct arcExtMap arc_extension_map; + +/* -------------------------------------------------------------------------- */ +/* local macros */ +/* -------------------------------------------------------------------------- */ + +/* a hash function used to map instructions into the table */ +#define INST_HASH(MAJOR, MINOR) ((((MAJOR) << 3) ^ (MINOR)) & INST_HASH_MASK) + + +/* -------------------------------------------------------------------------- */ +/* local functions */ +/* -------------------------------------------------------------------------- */ + +static void create_map(unsigned char *block, unsigned long length) +{ + unsigned char *p = block; + +//printf("building ext map...\n"); + + while (p && p < (block + length)) + { + /* p[0] == length of record + p[1] == type of record + For instructions: + p[2] = opcode + p[3] = minor opcode (if opcode == 3) + p[4] = flags + p[5]+ = name + For core regs and condition codes: + p[2] = value + p[3]+ = name + For auxiliary regs: + p[2..5] = value + p[6]+ = name + (value is p[2]<<24|p[3]<<16|p[4]<<8|p[5]) */ + + /* the sequence of records is temrinated by an "empty" record */ + if (p[0] == 0) + break; + +// printf("%d byte type %d record\n", p[0], p[1]); + + switch (p[1]) + { /* type */ + case EXT_INSTRUCTION: + { + struct ExtInstruction *insn = XNEW (struct ExtInstruction); + int major = p[2]; + int minor = p[3]; + struct ExtInstruction **bucket = + &arc_extension_map.instructions[INST_HASH (major, minor)]; + + insn->name = xstrdup ((char *) (p+5)); + insn->major = major; + insn->minor = minor; + insn->flags = p[4]; + insn->next = *bucket; + *bucket = insn; + break; + } + + case EXT_CORE_REGISTER: + { + unsigned char number = p[2]; + char* name = (char *) p+3; + + arc_extension_map.coreRegisters[number - FIRST_EXTENSION_CORE_REGISTER].number = number; + arc_extension_map.coreRegisters[number - FIRST_EXTENSION_CORE_REGISTER].rw = REG_READWRITE; + arc_extension_map.coreRegisters[number - FIRST_EXTENSION_CORE_REGISTER].name = xstrdup (name); + break; + } + + case EXT_LONG_CORE_REGISTER: + { + unsigned char number = p[2]; + char* name = (char *) p+7; + enum ExtReadWrite rw = p[6]; + + arc_extension_map.coreRegisters[number - FIRST_EXTENSION_CORE_REGISTER].number = number; + arc_extension_map.coreRegisters[number - FIRST_EXTENSION_CORE_REGISTER].rw = rw; + arc_extension_map.coreRegisters[number - FIRST_EXTENSION_CORE_REGISTER].name = xstrdup (name); + } + + case EXT_COND_CODE: + { + char *cc_name = xstrdup ((char *) (p+3)); + + arc_extension_map.condCodes[p[2] - FIRST_EXTENSION_CONDITION_CODE] = cc_name; + break; + } + + case EXT_AUX_REGISTER: + { + /* trickier -- need to store linked list of these */ + struct ExtAuxRegister *newAuxRegister = XNEW (struct ExtAuxRegister); + char *aux_name = xstrdup ((char *) (p+6)); + + newAuxRegister->name = aux_name; + newAuxRegister->address = p[2]<<24 | p[3]<<16 | p[4]<<8 | p[5]; + newAuxRegister->next = arc_extension_map.auxRegisters; + arc_extension_map.auxRegisters = newAuxRegister; + break; + } + + default: +// printf("type %d extension record skipped\n", p[1]); + break; + } + + p += p[0]; /* move on to next record */ + } + +//printf("ext map built\n"); +} + + +/* Free memory that has been allocated for the extensions. */ +static void destroy_map(void) +{ + struct ExtAuxRegister *r; + unsigned int i; + + /* free auxiliary registers */ + r = arc_extension_map.auxRegisters; + while (r) + { + /* N.B. after r has been freed, r->next is invalid! */ + struct ExtAuxRegister* next = r->next; + + free (r->name); + free (r); + r = next; + } + + /* free instructions */ + for (i = 0; i < INST_HASH_SIZE; i++) + { + struct ExtInstruction *insn = arc_extension_map.instructions[i]; + + while (insn) + { + /* N.B. after insn has been freed, insn->next is invalid! */ + struct ExtInstruction *next = insn->next; + + free (insn->name); + free (insn); + insn = next; + } + } + + /* free core registers */ + for (i = 0; i < NUM_EXT_CORE; i++) + { + if (arc_extension_map.coreRegisters[i].name) + free (arc_extension_map.coreRegisters[i].name); + } + + /* free condition codes */ + for (i = 0; i < NUM_EXT_COND; i++) + { + if (arc_extension_map.condCodes[i]) + free (arc_extension_map.condCodes[i]); + } + + memset (&arc_extension_map, 0, sizeof (arc_extension_map)); +} + + +static const char* ExtReadWrite_image(enum ExtReadWrite val) +{ + switch (val) + { + case REG_INVALID : return "INVALID"; + case REG_READ : return "RO"; + case REG_WRITE : return "WO"; + case REG_READWRITE: return "R/W"; + default : return "???"; + } +} + + +/* -------------------------------------------------------------------------- */ +/* externally visible functions */ +/* -------------------------------------------------------------------------- */ + /* Get the name of an extension instruction. */ const char * @@ -119,237 +372,126 @@ arcExtMap_instName (int opcode, int insn, int *flags) while (temp) { if ((temp->major == opcode) && (temp->minor == minor)) - { - *flags = temp->flags; - return temp->name; - } + { + *flags = temp->flags; + return temp->name; + } temp = temp->next; } return NULL; } + /* get the name of an extension core register */ const char * -arcExtMap_coreRegName (int value) +arcExtMap_coreRegName (int regnum) { - if (value < 32) - return 0; - return arc_extension_map.coreRegisters[value-32].name; + if (regnum < FIRST_EXTENSION_CORE_REGISTER || regnum > LAST_EXTENSION_CONDITION_CODE) + return NULL; + return arc_extension_map.coreRegisters[regnum - FIRST_EXTENSION_CORE_REGISTER].name; } + +/* get the access mode of an extension core register */ enum ExtReadWrite -arcExtMap_coreReadWrite (int value) +arcExtMap_coreReadWrite (int regnum) { - if (value < 32) + if (regnum < FIRST_EXTENSION_CORE_REGISTER || regnum > LAST_EXTENSION_CONDITION_CODE) return REG_INVALID; - return arc_extension_map.coreRegisters[value-32].rw; + return arc_extension_map.coreRegisters[regnum - FIRST_EXTENSION_CORE_REGISTER].rw; } -#if 0 -struct ExtAuxRegister * -arc_ExtMap_auxRegs () -{ - return arc_extension_map.auxRegisters; -} -#endif -/* Get the name of an extension condition code. */ +/* get the name of an extension condition code */ const char * -arcExtMap_condCodeName (int value) +arcExtMap_condCodeName (int code) { - if (value < 16) - return 0; - return arc_extension_map.condCodes[value-16]; + if (code < FIRST_EXTENSION_CONDITION_CODE || code > LAST_EXTENSION_CONDITION_CODE) + return NULL; + return arc_extension_map.condCodes[code - FIRST_EXTENSION_CONDITION_CODE]; } -/* Get the name of an extension aux register. */ +/* Get the name of an extension auxiliary register. */ const char * arcExtMap_auxRegName (long address) { - /* Walk the list of aux reg names and find the name. */ + /* Walk the list of auxiliary register names and find the name. */ struct ExtAuxRegister *r; for (r = arc_extension_map.auxRegisters; r; r = r->next) { if (r->address == address) - return (const char *)r->name; + return (const char *)r->name; } - return 0; + return NULL; } -#if 0 -/* Recursively free auxilliary register strcture pointers until - the list is empty. */ -static void -clean_aux_registers (struct ExtAuxRegister *r) + +/* Load extensions described in .arcextmap and .gnu.linkonce.arcextmap.* ELF + section. */ +void +build_ARC_extmap (bfd *text_bfd) { - if (r -> next) - { - clean_aux_registers (r->next); - free (r->name); - free (r->next); - r->next = NULL; - } - else - free (r->name); + asection *sect; + + /* the map is built each time gdb loads an executable file - so free any + * existing map, as the map defined by the new file may differ from the old + */ + destroy_map(); + + for (sect = text_bfd->sections; sect != NULL; sect = sect->next) + if (!strncmp (sect->name, + ".gnu.linkonce.arcextmap.", + sizeof (".gnu.linkonce.arcextmap.") - 1) + || !strcmp (sect->name,".arcextmap")) + { + bfd_size_type count = bfd_get_section_size (sect); + unsigned char* buffer = xmalloc (count); + + if (buffer) + { + if (bfd_get_section_contents (text_bfd, sect, buffer, 0, count)) + create_map(buffer, count); + free (buffer); + } + } } -/* Free memory that has been allocated for the extensions. */ -static void -cleanup_ext_map (void) +void dump_ARC_extmap (void) { - struct ExtAuxRegister *r; - struct ExtInstruction *insn; - int i; + struct ExtAuxRegister* r; + int i; - /* Clean aux reg structure. */ - r = arc_extension_map.auxRegisters; - if (r) - { - (clean_aux_registers (r)); - free (r); - } + r = arc_extension_map.auxRegisters; - /* Clean instructions. */ - for (i = INST_HASH_SIZE - 1; i >= 0; i--) + while (r) { - for (insn = arc_extension_map.instructions[i]; insn ; insn = insn->next) - { - free (insn->name); - free (insn); - } + printf("AUX : %s %ld\n", r->name, r->address); + r = r->next; } - /* Clean core reg struct. */ - for (i = 0; i < NUM_EXT_CORE; i++) + for (i = 0; i < INST_HASH_SIZE; i++) { - if (arc_extension_map.coreRegisters[i].name) - free (arc_extension_map.coreRegisters[i].name); - } + struct ExtInstruction *insn; - for (i = 0; i < NUM_EXT_COND; i++) { - if (arc_extension_map.condCodes[i]) - free (arc_extension_map.condCodes[i]); - } - - memset (&arc_extension_map, 0, sizeof (struct arcExtMap)); -} -#endif - -int -arcExtMap_add (void *base, unsigned long length) -{ - unsigned char *block = base; - unsigned char *p = block; + for (insn = arc_extension_map.instructions[i]; insn != NULL; insn = insn->next) + printf("INST: %d %d %x %s\n", insn->major, insn->minor, insn->flags, insn->name); + } - while (p && p < (block + length)) + for (i = 0; i < NUM_EXT_CORE; i++) { - /* p[0] == length of record - p[1] == type of record - For instructions: - p[2] = opcode - p[3] = minor opcode (if opcode == 3) - p[4] = flags - p[5]+ = name - For core regs and condition codes: - p[2] = value - p[3]+ = name - For aux regs: - p[2..5] = value - p[6]+ = name - (value is p[2]<<24|p[3]<<16|p[4]<<8|p[5]) */ - if (p[0] == 0) - return -1; - - switch (p[1]) - { /* type */ - case EXT_INSTRUCTION: - { - char *insn_name = xstrdup ((char *) (p+5)); - struct ExtInstruction *insn = XNEW (struct ExtInstruction); - int major = p[2]; - int minor = p[3]; - struct ExtInstruction **bucket - = &arc_extension_map.instructions[INST_HASH (major, minor)]; - - insn->name = insn_name; - insn->major = major; - insn->minor = minor; - insn->flags = p[4]; - insn->next = *bucket; - *bucket = insn; - break; - } - case EXT_CORE_REGISTER: - { - unsigned char number = p[2]; - char *name = (char *) p+3; - - arc_extension_map.coreRegisters[number-32].number = number; - arc_extension_map.coreRegisters[number-32].rw = REG_READWRITE; - arc_extension_map.coreRegisters[number-32].name = xstrdup (name); - break; - } - case EXT_LONG_CORE_REGISTER: - { - unsigned char number = p[2]; - char *name = (char *) p+7; - enum ExtReadWrite rw = p[6]; - - arc_extension_map.coreRegisters[number-32].number = number; - arc_extension_map.coreRegisters[number-32].rw = rw; - arc_extension_map.coreRegisters[number-32].name = xstrdup (name); - } - case EXT_COND_CODE: - { - char *cc_name = xstrdup ((char *) (p+3)); - - arc_extension_map.condCodes[p[2]-16] = cc_name; - break; - } - case EXT_AUX_REGISTER: - { - /* trickier -- need to store linked list to these */ - struct ExtAuxRegister *newAuxRegister - = XNEW (struct ExtAuxRegister); - char *aux_name = xstrdup ((char *) (p+6)); + struct ExtCoreRegister reg = arc_extension_map.coreRegisters[i]; - newAuxRegister->name = aux_name; - newAuxRegister->address = p[2]<<24 | p[3]<<16 | p[4]<<8 | p[5]; - newAuxRegister->next = arc_extension_map.auxRegisters; - arc_extension_map.auxRegisters = newAuxRegister; - break; - } - default: - return -1; - } - p += p[0]; /* move to next record */ + if (reg.name) + printf("CORE: %s %d %s\n", reg.name, reg.number, ExtReadWrite_image(reg.rw)); } - return 0; -} -/* Load extensions described in .arcextmap and .gnu.linkonce.arcextmap.* ELF - section. */ -void -build_ARC_extmap (bfd *text_bfd) -{ - char *arcExtMap; - bfd_size_type count; - asection *p; - - for (p = text_bfd->sections; p != NULL; p = p->next) - if (!strncmp (p->name, - ".gnu.linkonce.arcextmap.", - sizeof (".gnu.linkonce.arcextmap.")-1) - || !strcmp (p->name,".arcextmap")) - { - count = bfd_get_section_size (p); - arcExtMap = (char *) xmalloc (count); - if (bfd_get_section_contents (text_bfd, p, (PTR) arcExtMap, 0, count)) - arcExtMap_add ((PTR) arcExtMap, count); - free ((PTR) arcExtMap); - } + for (i = 0; i < NUM_EXT_COND; i++) + if (arc_extension_map.condCodes[i]) + printf("COND: %s\n", arc_extension_map.condCodes[i]); } + +/******************************************************************************/ diff --git a/opcodes/arc-ext.h b/opcodes/arc-ext.h index 1143490..6f202bd 100644 --- a/opcodes/arc-ext.h +++ b/opcodes/arc-ext.h @@ -18,84 +18,74 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#ifndef ARCEXT_H -#define ARCEXT_H +/******************************************************************************/ +/* */ +/* Outline: */ +/* This header file defines a table of extensions to the ARC processor */ +/* architecture. These extensions are read from the '.arcextmap' or */ +/* '.gnu.linkonce.arcextmap..' sections in the ELF file which is */ +/* identified by the bfd parameter to the build_ARC_extmap function. */ +/* */ +/* These extensions may include: */ +/* core registers */ +/* auxiliary registers */ +/* instructions */ +/* condition codes */ +/* */ +/* Once the table has been constructed, accessor functions may be used to */ +/* retrieve information from it. */ +/* */ +/* The build_ARC_extmap constructor function build_ARC_extmap may be */ +/* called as many times as required; it will re-initialize the table each */ +/* time. */ +/* */ +/******************************************************************************/ + +#ifndef ARC_EXTENSIONS_H +#define ARC_EXTENSIONS_H - -enum { INST_HASH_BITS = 6 }; -enum {NUM_EXT_CORE = 59-32+1}; -enum {NUM_EXT_COND = 0x1f-0x10+1}; - -enum { INST_HASH_SIZE = 1 << INST_HASH_BITS }; -#define INST_HASH(MAJOR,MINOR) \ - ((((MAJOR) << 3) ^ (MINOR)) & ((INST_HASH_SIZE) - 1)) - -enum ExtOperType - { - EXT_INSTRUCTION, - EXT_CORE_REGISTER, - EXT_AUX_REGISTER, - EXT_COND_CODE, - EXT_AC_INSTRUCTION, - EXT_LONG_CORE_REGISTER = 0x06 - }; +#define IGNORE_FIRST_OPD 1 /* Define this if we do not want to encode instructions based on the ARCompact Programmer's Reference. */ #define UNMANGLED -struct ExtInstruction -{ - char major; - char minor; - char flags; - char *name; - struct ExtInstruction *next; -}; -struct ExtAuxRegister +/* this defines the kinds of extensions which may be read from the sections in + * the executable files + */ +enum ExtOperType { - long address; - char *name; - struct ExtAuxRegister *next; + EXT_INSTRUCTION, + EXT_CORE_REGISTER, + EXT_AUX_REGISTER, + EXT_COND_CODE, + EXT_AC_INSTRUCTION, + EXT_LONG_CORE_REGISTER = 0x06 }; -enum ExtReadWrite - { - REG_INVALID, - REG_READ, - REG_WRITE, - REG_READWRITE - }; - -struct ExtCoreRegister -{ - short number; - enum ExtReadWrite rw; - char *name; -}; -struct arcExtMap +enum ExtReadWrite { - struct ExtAuxRegister *auxRegisters; - struct ExtInstruction *instructions[INST_HASH_SIZE]; - struct ExtCoreRegister coreRegisters[NUM_EXT_CORE]; - char *condCodes[NUM_EXT_COND]; + REG_INVALID, + REG_READ, + REG_WRITE, + REG_READWRITE }; -extern int arcExtMap_add(void*, unsigned long); -extern enum ExtReadWrite arcExtMap_coreReadWrite (int); -extern const char *arcExtMap_coreRegName(int); -extern const char *arcExtMap_auxRegName(long); -extern const char *arcExtMap_condCodeName(int); -extern const char *arcExtMap_instName(int, int, int*); -/* Ravi: - warning: implicit declaration of function `build_ARC_extmap' -*/ -extern void build_ARC_extmap (bfd *); +/* constructor function */ +extern void build_ARC_extmap (bfd* text_bfd); +/* accessor functions */ +extern enum ExtReadWrite arcExtMap_coreReadWrite (int regnum); +extern const char* arcExtMap_coreRegName (int regnum); +extern const char* arcExtMap_auxRegName (long regnum); +extern const char* arcExtMap_condCodeName (int code); +extern const char* arcExtMap_instName (int opcode, int insn, int* flags); -#define IGNORE_FIRST_OPD 1 +/* dump function (for debugging) */ +extern void dump_ARC_extmap (void); -#endif /* __arcExtMap_h__ */ +#endif /* ARC_EXTENSIONS_H */ +/******************************************************************************/ diff --git a/opcodes/arc-opc.c b/opcodes/arc-opc.c index d64ebbe..67304b2 100644 --- a/opcodes/arc-opc.c +++ b/opcodes/arc-opc.c @@ -2,23 +2,23 @@ THIS FILE IS MACHINE GENERATED WITH CGEN. -Copyright 1996-2007 Free Software Foundation, Inc. +Copyright 1996-2005 Free Software Foundation, Inc. This file is part of the GNU Binutils and/or GDB, the GNU debugger. - This file 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 3, or (at your option) - any later version. +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. - It 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. +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., - 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. +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., +51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ diff --git a/opcodes/arcompact-dis.c b/opcodes/arcompact-dis.c index 545eecb..485be8b 100644 --- a/opcodes/arcompact-dis.c +++ b/opcodes/arcompact-dis.c @@ -1,5 +1,5 @@ /* Instruction printing code for the ARC. - Copyright (C) 1994, 1995, 1997, 1998 Free Software Foundation, Inc. + Copyright (C) 1994, 1995, 1997, 1998, 2009 Free Software Foundation, Inc. Contributed by Doug Evans (dje@cygnus.com). Sources derived from work done by Sankhya Technologies (www.sankhya.com) @@ -9,41 +9,45 @@ Ramana Radhakrishnan(ramana.radhakrishnan@codito.com) - 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 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. +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., 51 Franklin Street - Fifth Floor, Boston, - MA 02110-1301, USA. */ +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#include +#include #include +#include + #include "dis-asm.h" #include "opcode/arc.h" +#include "arc-ext.h" +#include "arc-dis.h" +#include "arcompact-dis.h" #include "elf-bfd.h" #include "elf/arc.h" -#include -#include -#include -#include "arc-dis.h" -#include "arc-ext.h" + +/* Prototypes */ +static bfd_vma bfd_getm32 (unsigned int data); +/*static bfd_vma bfd_getm32_ac (unsigned int data); UNUSED*/ /* + Ravi: warning: implicit declaration of function `printf_unfiltered' if dbg is 1 then this definition is required */ void printf_unfiltered (const char *,...); -static bfd_vma bfd_getm32 (unsigned int); -static bfd_vma bfd_getm32_ac (unsigned int) ATTRIBUTE_UNUSED; -struct arcDisState arcAnalyzeInstr (bfd_vma, disassemble_info*); #ifndef dbg @@ -70,28 +74,28 @@ struct arcDisState arcAnalyzeInstr (bfd_vma, disassemble_info*); #define BIT(word,n) ((word) & (1 << n)) #define BITS(word,s,e) (((word) << (31-e)) >> (s+(31-e))) -#define OPCODE(word) (BITS ((word), 27, 31)) -#define FIELDA(word) (BITS ((word), 0, 5)) -#define FIELDb(word) (BITS ((word), 24, 26)) -#define FIELDB(word) (BITS ((word), 12, 14)) -#define FIELDC(word) (BITS ((word), 6, 11)) -#define OPCODE_AC(word) (BITS ((word), 11, 15)) -#define FIELDA_AC(word) (BITS ((word), 0, 2)) -#define FIELDB_AC(word) (BITS ((word), 8, 10)) -#define FIELDC_AC(word) (BITS ((word), 5, 7)) -#define FIELDU_AC(word) (BITS ((word), 0, 4)) +#define OPCODE(word) (BITS((word),27,31)) +#define FIELDA(word) (BITS((word),0,5)) +#define FIELDb(word) (BITS((word),24,26)) +#define FIELDB(word) (BITS((word),12,14)) +#define FIELDC(word) (BITS((word),6,11)) +#define OPCODE_AC(word) (BITS((word),11,15)) +#define FIELDA_AC(word) (BITS((word),0,2)) +#define FIELDB_AC(word) (BITS((word),8,10)) +#define FIELDC_AC(word) (BITS((word),5,7)) +#define FIELDU_AC(word) (BITS((word),0,4)) /* * FIELDS_AC is the 11-bit signed immediate value used for * GP-relative instructions. */ -#define FIELDS_AC(word) (BITS (((signed int) word), 0, 8)) +#define FIELDS_AC(word) (BITS(((signed int)word),0,8)) /* * FIELDD is signed in all of its uses, so we make sure argument is * treated as signed for bit shifting purposes. */ -#define FIELDD(word) (BITS (((signed int) word), 16, 23)) +#define FIELDD(word) (BITS(((signed int)word),16,23)) /* * FIELDD9 is the 9-bit signed immediate value used for @@ -184,14 +188,6 @@ struct arcDisState arcAnalyzeInstr (bfd_vma, disassemble_info*); fieldCisReg = 0; \ } \ } -/********** Aurora SIMD ARC 8 - bit constant **********/ -#define FIELD_U8() { \ - \ - fieldC = BITS(state->words[0],15,16);\ - fieldC = fieldC <<6; \ - fieldC |= FIELDC(state->words[0]); \ - fieldCisReg = 0; \ - } #define CHECK_FIELD_B() { \ fieldB = (FIELDB(state->words[0]) << 3);\ @@ -250,9 +246,6 @@ struct arcDisState arcAnalyzeInstr (bfd_vma, disassemble_info*); #define IS_SMALL(x) (((field##x) < 256) && ((field##x) > -257)) #define IS_REG(x) (field##x##isReg) -#define IS_SIMD_128_REG(x) (usesSimdReg##x == 1) -#define IS_SIMD_16_REG(x) (usesSimdReg##x == 2) -#define IS_SIMD_DATA_REG(x) (usesSimdReg##x == 3) #define WRITE_FORMAT_LB_Rx_RB(x) WRITE_FORMAT(x,"[","]","","") #define WRITE_FORMAT_x_COMMA_LB(x) WRITE_FORMAT(x,"",",[","",",[") #define WRITE_FORMAT_COMMA_x_RB(x) WRITE_FORMAT(x,",","]",",","]") @@ -260,13 +253,10 @@ struct arcDisState arcAnalyzeInstr (bfd_vma, disassemble_info*); #define WRITE_FORMAT_COMMA_x(x) WRITE_FORMAT(x,",","",",","") #define WRITE_FORMAT_x_COMMA(x) WRITE_FORMAT(x,"",",","",",") #define WRITE_FORMAT_x(x) WRITE_FORMAT(x,"","","","") -#define WRITE_FORMAT(x,cb1,ca1,cb,ca) strcat(formatString, \ - (IS_SIMD_128_REG(x) ? cb1"%S"ca1: \ - IS_SIMD_16_REG(x) ? cb1"%I"ca1: \ - IS_SIMD_DATA_REG(x)? cb1"%D"ca1: \ - IS_REG(x) ? cb1"%r"ca1: \ - usesAuxReg ? cb"%a"ca : \ - IS_SMALL(x) ? cb"%d"ca : cb"%h"ca)) +#define WRITE_FORMAT(x,cb1,ca1,cb,ca) strcat(formatString, \ + (IS_REG(x) ? cb1"%r"ca1 : \ + usesAuxReg ? cb"%a"ca : \ + IS_SMALL(x) ? cb"%d"ca : cb"%h"ca)) #define WRITE_FORMAT_LB() strcat(formatString, "[") #define WRITE_FORMAT_RB() strcat(formatString, "]") @@ -280,7 +270,6 @@ struct arcDisState arcAnalyzeInstr (bfd_vma, disassemble_info*); #define add_target(x) (state->targets[state->tcnt++] = (x)) static char comment_prefix[] = "\t; "; -short int enable_simd = 0; static const char * core_reg_name(struct arcDisState *state, int val) @@ -325,8 +314,8 @@ static const char * post_address(struct arcDisState *state, int addr) { static char id[3*_NELEM(state->addresses)]; - unsigned int j, i = state->acnt; - if (i < _NELEM(state->addresses)) { + int j, i = state->acnt; + if ((unsigned)i < _NELEM(state->addresses)) { state->addresses[i] = addr; ++state->acnt; j = i*3; @@ -456,11 +445,14 @@ my_sprintf (struct arcDisState *state, char *buf, const char*format, ...) { /* Aux Register. */ int val = va_arg(ap,int); +// The arc_aux_reg_name fucntion does not appear to exist anywwhere! +#if 0 char *ret; ret = arc_aux_reg_name(val); if(ret) sprintf(bp,"%s",ret); else +#endif { const char *ext; ext = aux_reg_name(state, val); @@ -473,45 +465,18 @@ my_sprintf (struct arcDisState *state, char *buf, const char*format, ...) break; case 's': { - sprintf(bp,"%s",va_arg(ap,char*)); - inc_bp(); + sprintf (bp,"%s", va_arg (ap, char *)); + inc_bp (); } break; case '*': { - va_arg(ap,char*); - inc_bp(); - break; - } - - /* SIMD operands follow*/ - case 'S': - { - int val = va_arg (ap,int); - - sprintf (bp, "vr%d",val); - inc_bp (); - break; - } - case 'I': - { - int val = va_arg (ap,int); - - sprintf (bp, "i%d",val); - inc_bp (); - break; - } - case 'D': - { - int val = va_arg (ap,int); - - sprintf (bp, "dr%d",val); + (void) va_arg (ap, char *); inc_bp (); break; } - /* SIMD operands end */ default: - fprintf(stderr,"?? format %c\n",p[-1]); + fprintf (stderr, "?? format %c\n", p[-1]); break; } } @@ -579,7 +544,8 @@ write_instr_name_(struct arcDisState *state, } if (flag) strcat(state->instrBuffer, ".f"); if (state->nullifyMode) - strcat(state->instrBuffer, ".d"); + if (strstr(state->instrBuffer, ".d") == NULL) + strcat(state->instrBuffer, ".d"); if (signExtend) strcat(state->instrBuffer, ".x"); switch (addrWriteBack) { @@ -591,14 +557,14 @@ write_instr_name_(struct arcDisState *state, } #define write_instr_name() {\ - write_instr_name_(state, instrName,cond, condCodeIsPartOfName, flag, signExtend, addrWriteBack, directMem); \ + write_instr_name_(state, instrName, cond, condCodeIsPartOfName, flag, signExtend, addrWriteBack, directMem); \ formatString[0] = '\0'; \ } enum { op_BC = 0, op_BLC = 1, op_LD = 2, op_ST = 3, op_MAJOR_4 = 4, - op_MAJOR_5 = 5, op_SIMD=6, op_LD_ADD = 12, op_ADD_SUB_SHIFT = 13, + op_MAJOR_5 = 5, op_LD_ADD = 12, op_ADD_SUB_SHIFT = 13, op_ADD_MOV_CMP = 14, op_S = 15, op_LD_S = 16, op_LDB_S = 17, op_LDW_S = 18, op_LDWX_S = 19, op_ST_S = 20, op_STB_S = 21, op_STW_S = 22, op_Su5 = 23, op_SP = 24, op_GP = 25, op_Pcl = 26, @@ -611,6 +577,9 @@ extern disassemble_info tm_print_insn_info; * bfd_getm32 - To retrieve the upper 16-bits of the ARCtangent-A5 * basecase (32-bit) instruction */ + + + static bfd_vma bfd_getm32 (data) unsigned int data; @@ -626,6 +595,7 @@ bfd_getm32 (data) * bfd_getm32_ac - To retrieve the upper 8-bits of the ARCompact * 16-bit instruction */ +/* UNUSED static bfd_vma bfd_getm32_ac (data) unsigned int data; @@ -635,7 +605,7 @@ bfd_getm32_ac (data) value = ((data & 0xff) << 8 | (data & 0xff00) >> 8); return value; } - +*/ /* * sign_extend - Sign Extend the value * @@ -675,8 +645,7 @@ dsmOneArcInst (bfd_vma addr, struct arcDisState *state, disassemble_info * info) int is_linked=0; int offset=0; int usesAuxReg = 0; - int usesSimdRegA= 0, usesSimdRegB=0, usesSimdRegC=0,simd_scale_u8=-1; - int flags = !E_ARC_MACH_A4; + int flags; char formatString[60]; state->nullifyMode = BR_exec_when_no_jump; @@ -690,6 +659,8 @@ dsmOneArcInst (bfd_vma addr, struct arcDisState *state, disassemble_info * info) state->_offset = 0; state->_addrWriteBack = 0; + state->sourceType = ARC_UNDEFINED; + state->instructionLen = info->bytes_per_line; /* ARCtangent-A5 basecase instruction and little-endian mode */ @@ -733,7 +704,7 @@ dsmOneArcInst (bfd_vma addr, struct arcDisState *state, disassemble_info * info) */ switch (state->_opcode) - { + { case op_BC: /* Branch Conditionally */ instrName = "b"; @@ -813,50 +784,37 @@ dsmOneArcInst (bfd_vma addr, struct arcDisState *state, disassemble_info * info) decodingClass = 0; /* Default for 3 operand instructions */ subopcode = BITS(state->words[0],16,21); switch (subopcode) - { - case 0: instrName = "add"; break; - case 1: instrName = "adc"; break; - case 2: instrName = "sub"; break; - case 3: instrName = "sbc"; break; - case 4: instrName = "and"; break; - case 5: instrName = "or"; break; - case 6: instrName = "bic"; break; - case 7: instrName = "xor"; break; - case 8: instrName = "max"; break; - case 9: instrName = "min"; break; - case 10: - { - if(state->words[0] == 0x264a7000) - { - instrName = "nop"; - decodingClass = 26; - } - else - { - instrName = "mov"; - decodingClass = 12; - } - break; - } - case 11: instrName = "tst"; decodingClass = 2; break; - case 12: instrName = "cmp"; decodingClass = 2; break; - case 13: instrName = "rcmp"; decodingClass = 2; break; - case 14: instrName = "rsub"; break; - case 15: instrName = "bset"; break; - case 16: instrName = "bclr"; break; - case 17: instrName = "btst"; decodingClass = 2; break; - case 18: instrName = "bxor"; break; - case 19: instrName = "bmsk"; break; - case 20: instrName = "add1"; break; - case 21: instrName = "add2"; break; - case 22: instrName = "add3"; break; - case 23: instrName = "sub1"; break; - case 24: instrName = "sub2"; break; - case 25: instrName = "sub3"; break; - case 26: instrName = "mpylo"; break; - case 27: instrName = "mpyhi"; break; - case 28: instrName = "mpyhiu";break; - case 29: instrName = "mpylou";break; + { + case 0: instrName = "add"; break; + case 1: instrName = "adc"; break; + case 2: instrName = "sub"; break; + case 3: instrName = "sbc"; break; + case 4: instrName = "and"; break; + case 5: instrName = "or"; break; + case 6: instrName = "bic"; break; + case 7: instrName = "xor"; break; + case 8: instrName = "max"; break; + case 9: instrName = "min"; break; + case 10: instrName = "mov"; decodingClass = 12; break; + case 11: instrName = "tst"; decodingClass = 2; break; + case 12: instrName = "cmp"; decodingClass = 2; break; + case 13: instrName = "rcmp"; decodingClass = 2; break; + case 14: instrName = "rsub"; break; + case 15: instrName = "bset"; break; + case 16: instrName = "bclr"; break; + case 17: instrName = "btst"; decodingClass = 2; break; + case 18: instrName = "bxor"; break; + case 19: instrName = "bmsk"; break; + case 20: instrName = "add1"; break; + case 21: instrName = "add2"; break; + case 22: instrName = "add3"; break; + case 23: instrName = "sub1"; break; + case 24: instrName = "sub2"; break; + case 25: instrName = "sub3"; break; + case 26: instrName = "mpylo"; break; + case 27: instrName = "mpyhi"; break; + case 28: instrName = "mpyhiu";break; + case 29: instrName = "mpylou";break; case 32: case 33: instrName = "j"; @@ -917,11 +875,6 @@ dsmOneArcInst (bfd_vma addr, struct arcDisState *state, disassemble_info * info) break; case 4 : instrName = "rtie" ; break; case 5 : instrName = "brk"; break; - default: - - instrName = "???"; - state->flow=invalid_instr; - break; } break; } @@ -959,1018 +912,39 @@ dsmOneArcInst (bfd_vma addr, struct arcDisState *state, disassemble_info * info) case 5: instrName = "mulu64"; mul =1; decodingClass = 2; break; /* ARC A700 */ - case 6: instrName = "adds" ;break; - - case 7: instrName = "subs"; break; - case 8: instrName = "divaw"; break; - case 0xA: instrName = "asls"; break; - case 0xB: instrName = "asrs"; break; - case 0x28: instrName = "addsdw";break; - case 0x29: instrName = "subsdw"; break; - - case 47: - switch(BITS(state->words[0],0,5)) - { - case 0: instrName = "swap"; decodingClass = 1; break; - case 1: instrName = "norm"; decodingClass = 1; break; - /* ARC A700 DSP Extensions */ - case 2: instrName = "sat16"; decodingClass = 1; break; - case 3: instrName = "rnd16"; decodingClass = 1; break; - case 4: instrName = "abssw"; decodingClass = 1; break; - case 5: instrName = "abss"; decodingClass = 1; break; - case 6: instrName = "negsw"; decodingClass = 1; break; - case 7: instrName = "negs"; decodingClass = 1; break; - - - case 8: instrName = "normw"; decodingClass = 1; break; - default: - instrName = "???"; - state->flow =invalid_instr; - break; - - } - break; - default: - instrName = "??? (2[3])"; - state->flow = invalid_instr; - break; - } - break; - - - /* Aurora SIMD instruction support*/ - case op_SIMD: - - if (enable_simd) - { - decodingClass = 42; - subopcode = BITS(state->words[0], 17, 23); - - switch (subopcode) - { - - case 68: - instrName = "vld32"; - decodingClass = 37; - usesSimdRegA=1; - usesSimdRegB=2; - usesSimdRegC=0; - simd_scale_u8 = 2; - break; - - case 72: - instrName = "vld64"; - decodingClass = 37; - usesSimdRegA = 1; - usesSimdRegB = 2; - usesSimdRegC = 0; - simd_scale_u8 = 3; - break; - - case 74: - instrName = "vld64w"; - decodingClass = 37; - usesSimdRegA = 1; - usesSimdRegB = 2; - usesSimdRegC = 0; - simd_scale_u8 = 3; - break; - - case 70: - instrName = "vld32wl"; - decodingClass = 37; - usesSimdRegA = 1; - usesSimdRegB = 2; - usesSimdRegC = 0; - simd_scale_u8 = 2; - break; - - case 66: - instrName = "vld32wh"; - decodingClass = 37; - usesSimdRegA = 1; - usesSimdRegB = 2; - usesSimdRegC = 0; - simd_scale_u8 = 2; - break; - - case 76: - instrName = "vld128"; - decodingClass = 37; - usesSimdRegA = 1; - usesSimdRegB = 2; - usesSimdRegC = 0; - simd_scale_u8 = 4; - break; - - case 78: - { - short sub_subopcode = BITS(state->words[0], 15, 16); - switch (sub_subopcode) - { - case 0: - instrName = "vld128r"; - decodingClass = 38; - usesSimdRegA = 1; - usesSimdRegB = usesSimdRegC = 0; - break; - default: - instrName = "SIMD"; - state->flow = invalid_instr; - } - } - break; - case 71: - instrName = "vst16_0"; - decodingClass = 37; - usesSimdRegA = 1; - usesSimdRegB = 2; - usesSimdRegC = 0; - simd_scale_u8 = 1; - break; - - case 81: - instrName = "vst16_1"; - decodingClass = 37; - usesSimdRegA = 1; - usesSimdRegB = 2; - usesSimdRegC = 0; - simd_scale_u8 = 1; - break; - - case 67: - instrName = "vst16_2"; - decodingClass = 37; - usesSimdRegA = 1; - usesSimdRegB = 2; - usesSimdRegC = 0; - simd_scale_u8 = 1; - break; - - case 75: - instrName = "vst16_3"; - decodingClass = 37; - usesSimdRegA = 1; - usesSimdRegB = 2; - usesSimdRegC = 0; - simd_scale_u8 = 1; - break; - - case 83: - instrName = "vst16_4"; - decodingClass = 37; - usesSimdRegA = 1; - usesSimdRegB = 2; - usesSimdRegC = 0; - simd_scale_u8 = 1; - break; - - case 89: - instrName = "vst16_5"; - decodingClass = 37; - usesSimdRegA = 1; - usesSimdRegB = 2; - usesSimdRegC = 0; - simd_scale_u8 = 1; - break; - - case 91: - instrName = "vst16_6"; - decodingClass = 37; - usesSimdRegA = 1; - usesSimdRegB = 2; - usesSimdRegC = 0; - simd_scale_u8 = 1; - break; - - case 93: - instrName = "vst16_7"; - decodingClass = 37; - usesSimdRegA = 1; - usesSimdRegB = 2; - usesSimdRegC = 0; - simd_scale_u8 = 1; - break; - - case 69: - instrName = "vst32_0"; - decodingClass = 37; - usesSimdRegA = 1; - usesSimdRegB = 2; - usesSimdRegC = 0; - simd_scale_u8 = 2; - break; - - case 82: - instrName = "vst32_2"; - decodingClass = 37; - usesSimdRegA = 1; - usesSimdRegB = 2; - usesSimdRegC = 0; - simd_scale_u8 = 2; - break; - - case 86: - instrName = "vst32_4"; - decodingClass = 37; - usesSimdRegA = 1; - usesSimdRegB = 2; - usesSimdRegC = 0; - simd_scale_u8 = 2; - break; - - case 88: - instrName = "vst32_6"; - decodingClass = 37; - usesSimdRegA = 1; - usesSimdRegB = 2; - usesSimdRegC = 0; - simd_scale_u8 = 2; - break; - - case 73: - instrName = "vst64"; - decodingClass = 37 ; - usesSimdRegA = 1; - usesSimdRegB = 2; - usesSimdRegC = 0; - simd_scale_u8 = 3; - break; - - case 77: - instrName = "vst128"; - decodingClass = 37; - usesSimdRegA = 1; - usesSimdRegB = 2; - usesSimdRegC = 0; - simd_scale_u8 = 4; - break; - - case 79: - { - short sub_subopcode = BITS(state->words[0], 15, 16); - switch (sub_subopcode) - { - case 0: - instrName = "vst128r"; - decodingClass = 38; - usesSimdRegA = 1; - usesSimdRegB = usesSimdRegC = 0; - break; - - default: - instrName = "SIMD"; - state->flow = invalid_instr; - } - - } - break; - case 80: - instrName = "vmvw"; - usesSimdRegA = usesSimdRegB = 1; - usesSimdRegC = 0; - decodingClass = 39; - break; - - case 84: - instrName = "vmvzw"; - decodingClass = 39; - usesSimdRegA = usesSimdRegB = 1; - usesSimdRegC = 0; - break; - - case 90: - instrName = "vmovw"; - decodingClass = 39; - usesSimdRegA = 1; - usesSimdRegB = usesSimdRegC = 0; - break; - - case 94: - instrName = "vmovzw"; - decodingClass = 39; - usesSimdRegA = 1; - usesSimdRegB = usesSimdRegC = 0; - break; - - case 85: - instrName = "vmvaw"; - decodingClass = 39; - usesSimdRegA = usesSimdRegB = 1; - usesSimdRegC = 0; - break; - - case 95: - instrName = "vmovaw"; - decodingClass = 39; - usesSimdRegA = 1; - usesSimdRegB = usesSimdRegC = 0; - break; - - case 10: - { - short sub_subopcode = BITS(state->words[0], 15, 16); - switch (sub_subopcode) - { - case 0: - instrName = "vaddw"; decodingClass = 42; - usesSimdRegA = usesSimdRegB = usesSimdRegC =1; - break; - - case 1: - instrName = "vaddaw"; decodingClass = 42; - usesSimdRegA = usesSimdRegB = usesSimdRegC =1; - break; - - case 2: - instrName = "vbaddw"; decodingClass = 42; - usesSimdRegA = usesSimdRegB = 1; - usesSimdRegC = 0; - break; - } - break; - } - - case 11: - { - short sub_subopcode = BITS(state->words[0], 15, 16); - switch (sub_subopcode) - { - case 0: - instrName = "vsubw"; - decodingClass = 42; - usesSimdRegA = usesSimdRegB = usesSimdRegC = 1; - break; - - case 1: - instrName = "vsubaw"; - decodingClass = 42; - usesSimdRegA = usesSimdRegB = usesSimdRegC = 1; - break; - - case 2: - instrName = "vbsubw"; - decodingClass = 42; - usesSimdRegA = usesSimdRegB = 1; - usesSimdRegC = 0; - break; - } - } - break; - - case 12: - { - short sub_subopcode = BITS(state->words[0], 15, 16); - switch (sub_subopcode) - { - case 0: - instrName = "vmulw"; - decodingClass = 42; - usesSimdRegA = usesSimdRegB = usesSimdRegC = 1; - break; - - case 1: - instrName = "vmulaw"; - decodingClass = 42; - usesSimdRegA = usesSimdRegB = usesSimdRegC = 1; - break; - - case 2: - instrName = "vbmulw"; - decodingClass = 42; - usesSimdRegA = usesSimdRegB = 1; - usesSimdRegC = 0; - break; - - case 3: - instrName = "vbmulaw"; - decodingClass = 42; - usesSimdRegA = usesSimdRegB = 1; - usesSimdRegC = 0; - break; - } - } - break; - - case 13: - { - short sub_subopcode = BITS(state->words[0], 15, 16); - switch (sub_subopcode) - { - case 0: - instrName = "vmulfw"; - decodingClass = 42; - usesSimdRegA = usesSimdRegB = usesSimdRegC = 1; - break; - - case 1: - instrName = "vmulfaw"; - decodingClass = 42; - usesSimdRegA = usesSimdRegB = usesSimdRegC = 1; - break; - - case 2: - instrName = "vbmulfw"; - decodingClass = 42; - usesSimdRegA = usesSimdRegB = 1; - usesSimdRegC = 0; - break; - } - } - break; - - case 15: - { - short sub_subopcode = BITS(state->words[0], 15, 16); - switch (sub_subopcode) - { - case 0: - instrName = "vsummw"; - decodingClass = 42; - usesSimdRegA = usesSimdRegB = usesSimdRegC = 1; - break; - case 2: - instrName = "vbrsubw"; - decodingClass = 42; - usesSimdRegA = usesSimdRegB = 1; - usesSimdRegC = 0; - break; - } - } - break; - - case 23: - { - short sub_subopcode = BITS(state->words[0], 15, 16); - switch (sub_subopcode) - { - case 0: - instrName = "vmr7w"; - decodingClass = 42; - usesSimdRegA = usesSimdRegB = usesSimdRegC = 1; - break; - - case 1: - instrName = "vmr7aw"; - decodingClass = 42; - usesSimdRegA = usesSimdRegB = usesSimdRegC = 1; - break; - - - case 2: - switch (BITS(state->words[0], 0, 5)) - { - case 0: - instrName = "vaddsuw"; - decodingClass = 40; - usesSimdRegC = usesSimdRegB = 1; - usesSimdRegA = 0; - break; - - case 1: - instrName = "vabsw"; - decodingClass = 40; - usesSimdRegC = usesSimdRegB = 1; - usesSimdRegA = 0; - break; - - case 2: - instrName = "vsignw"; - decodingClass = 40; - usesSimdRegC = usesSimdRegB = 1; - usesSimdRegA = 0; - break; - - case 3: - instrName = "vupbw"; - decodingClass = 40; - usesSimdRegC = usesSimdRegB = 1; - usesSimdRegA = 0; - break; - - case 4: - instrName = "vexch1"; - decodingClass = 40; - usesSimdRegC = usesSimdRegB = 1; - usesSimdRegA = 0; - break; - - case 5: - instrName = "vexch2"; - decodingClass = 40; - usesSimdRegC = usesSimdRegB = 1; - usesSimdRegA = 0; - break; - - case 6: - instrName = "vexch4"; - decodingClass = 40; - usesSimdRegC = usesSimdRegB = 1; - usesSimdRegA = 0; - break; - - case 7: - instrName = "vupsbw"; - decodingClass = 40; - usesSimdRegC = usesSimdRegB = 1; - usesSimdRegA = 0; - break; - - case 8: - instrName = "vdirun"; - decodingClass = 40; - usesSimdRegC = usesSimdRegB = usesSimdRegA = 0; - break; - - case 9: - instrName = "vdorun"; - decodingClass = 40; - usesSimdRegC = usesSimdRegB = usesSimdRegA = 0; - break; - - case 10: - instrName = "vdiwr"; - decodingClass = 40; - usesSimdRegB = 3; - usesSimdRegA = usesSimdRegC = 0; - fieldCisReg = 1; - break; - - case 11: - instrName = "vdowr"; - decodingClass = 40; - usesSimdRegB = 3; - usesSimdRegA = usesSimdRegC = 0; - fieldCisReg = 1; - break; - - case 12: - instrName = "vdird"; - decodingClass = 40; - usesSimdRegB = 1; - usesSimdRegC = 3; - usesSimdRegA = 0; - break; - - case 13: - instrName = "vdord"; - decodingClass = 40; - usesSimdRegB = 1; - usesSimdRegC = 3; - usesSimdRegA = 0; - break; - - case 63: - { - switch (BITS(state->words[0], 24, 25)) - { - case 0: - instrName = "vrec"; - decodingClass = 43; - usesSimdRegC = 0; - usesSimdRegB = usesSimdRegA = 0; - break; - - case 1: - instrName = "vrecrun"; - decodingClass = 43; - usesSimdRegC = 0; - usesSimdRegA = usesSimdRegB = 0; - break; - - case 2: - instrName = "vrun"; - decodingClass = 43; - usesSimdRegC = 0; - usesSimdRegB = usesSimdRegA = 0; - break; - - case 3: - instrName = "vendrec"; - decodingClass = 43; - usesSimdRegC = 0; - usesSimdRegB = usesSimdRegA = 0; - break; - } - } - break; - } - break; - - case 3: - switch (BITS(state->words[0], 0, 2)) - { - case 1: - instrName = "vabsaw"; - decodingClass = 40; - usesSimdRegC = usesSimdRegB = 1; - usesSimdRegA = 0; - break; - case 3: - instrName = "vupbaw"; - decodingClass = 40; - usesSimdRegC = usesSimdRegB = 1; - usesSimdRegA = 0; - break; - case 7: - instrName = "vupsbaw"; - decodingClass = 40; - usesSimdRegC = usesSimdRegB = 1; - usesSimdRegA = 0; - break; - } - break; - } - } - break; - - case 16: - instrName = "vasrw"; - decodingClass = 42; - usesSimdRegA = usesSimdRegB = 1; - usesSimdRegC = 2; - break; - - case 48: - { - short sub_subopcode = BITS(state->words[0], 15, 16); - switch (sub_subopcode) - { - case 0: - instrName = "vasrwi"; - decodingClass = 41; - usesSimdRegA = usesSimdRegB = 1; - usesSimdRegC = 0; - break; - case 2: - instrName = "vasrrwi"; - decodingClass = 41; - usesSimdRegA = usesSimdRegB = 1; - usesSimdRegC = 0; - break; - } - } - break; - - case 59: - instrName = "vasrsrwi"; - decodingClass = 41; - usesSimdRegA = usesSimdRegB = 1; - usesSimdRegC = 0; - break; - - case 18: - { - short sub_subopcode = BITS(state->words[0], 15, 16); - switch (sub_subopcode) - { - case 0: - instrName = "vmaxw"; - usesSimdRegC = 1; - break; - case 1: - instrName = "vmaxaw"; - usesSimdRegC = 1; - break; - case 2: - instrName = "vbmaxw"; - usesSimdRegC = 0; - break; - } - decodingClass = 42; - usesSimdRegA = usesSimdRegB = 1; - break; - } - - case 19: - { - short sub_subopcode = BITS(state->words[0], 15, 16); - switch (sub_subopcode) - { - case 0: - instrName = "vminw"; - usesSimdRegC = 1; - break; - case 1: - instrName = "vminaw"; - usesSimdRegC = 0; - break; - case 2: - instrName = "vbminw"; - usesSimdRegC = 0; - break; - } - decodingClass = 42; - usesSimdRegA = usesSimdRegB = 1; - break; - } - - case 14: - { - short sub_subopcode = BITS(state->words[0], 15, 16); - switch (sub_subopcode) - { - case 0: - instrName = "vdifw"; - break; - case 1: - instrName = "vdifaw"; - break; - case 2: - instrName = "vmrb"; - break; - } - decodingClass = 42; - usesSimdRegA = usesSimdRegB = usesSimdRegC = 1; - break; - } - - case 24: - { - short sub_subopcode = BITS(state->words[0], 15, 16); - switch (sub_subopcode) - { - case 0: - instrName = "vand"; - decodingClass = 42; - usesSimdRegA = usesSimdRegB = usesSimdRegC = 1; - break; - case 1: - instrName = "vandaw"; - decodingClass = 42; - usesSimdRegA = usesSimdRegB = usesSimdRegC = 1; - break; - } - break; - } - - case 25: - { - short sub_subopcode = BITS(state->words[0], 15, 16); - switch (sub_subopcode) - { - case 0: - instrName = "vor"; - decodingClass = 42; - usesSimdRegA = usesSimdRegB = usesSimdRegC = 1; - break; - } - break; - } - - case 26: - { - short sub_subopcode = BITS(state->words[0], 15, 16); - switch (sub_subopcode) - { - case 0: - instrName = "vxor"; - break; - case 1: - instrName = "vxoraw"; - break; - } - decodingClass = 42; - usesSimdRegA = usesSimdRegB = usesSimdRegC = 1; - break; - } - - case 27: - { - short sub_subopcode = BITS(state->words[0], 15, 16); - switch (sub_subopcode) - { - case 0: - instrName = "vbic"; - break; - case 1: - instrName = "vbicaw"; - break; - } - decodingClass = 42; - usesSimdRegA = usesSimdRegB = usesSimdRegC = 1; - break; - } - - case 4: - { - short sub_subopcode = BITS(state->words[0], 15, 16); - switch (sub_subopcode) - { - case 0: - instrName = "vavb"; - break; - case 2: - instrName = "vavrb"; - break; - } - decodingClass = 42; - usesSimdRegA = usesSimdRegB = usesSimdRegC = 1; - break; - } - - case 28: - instrName = "veqw"; - decodingClass = 42; - usesSimdRegA = usesSimdRegB = usesSimdRegC = 1; - break; - - case 29: - instrName = "vnew"; - decodingClass = 42; - usesSimdRegA = usesSimdRegB = usesSimdRegC = 1; - break; - - case 30: - instrName = "vlew"; - decodingClass = 42; - usesSimdRegA = usesSimdRegB = usesSimdRegC = 1; - break; - - case 31: - instrName = "vltw"; - decodingClass = 42; - usesSimdRegA = usesSimdRegB = usesSimdRegC = 1; - break; - - case 49: - { - short sub_subopcode = BITS(state->words[0], 15, 16); - switch (sub_subopcode) - { - case 0: - instrName = "vasrpwbi"; - decodingClass = 41; - usesSimdRegA = usesSimdRegB = 1; - usesSimdRegC = 0; - break; - case 2: - instrName = "vasrrpwbi"; - decodingClass = 41; - usesSimdRegA = usesSimdRegB = 1; - usesSimdRegC = 0; - break; - } - break; - } - - case 5: - { - short sub_subopcode = BITS(state->words[0], 15, 16); - switch (sub_subopcode) - { - case 0: - instrName = "vsr8"; - decodingClass = 42; - usesSimdRegA = usesSimdRegB = 1; - usesSimdRegC = 2; - break; - - case 1: - instrName = "vsr8aw"; - decodingClass = 42; - usesSimdRegA = usesSimdRegB = 1; - usesSimdRegC = 2; - break; - } - break; - } - - case 37: - { - short sub_subopcode = BITS(state->words[0], 15, 16); - switch (sub_subopcode) - { - case 0: - instrName = "vsr8i"; - decodingClass = 41; - usesSimdRegA = usesSimdRegB = 1; - usesSimdRegC = 0; - break; - - case 1: - instrName = "vsr8awi"; - decodingClass = 41; - usesSimdRegA = usesSimdRegB = 1; - usesSimdRegC = 0; - break; - } - break; - } - - case 20: - case 21: - case 22: - { - short subopcode2 = BITS(state->words[0], 15, 18); - switch (subopcode2) - { - case 0: - instrName = "vmr1w"; - break; - - case 2: - instrName = "vmr2w"; - break; - - case 4: - instrName = "vmr3w"; - break; - - case 6: - instrName = "vmr4w"; - break; - - case 8: - instrName = "vmr5w"; - break; - - case 10: - instrName = "vmr6w"; - break; - - case 1: - instrName = "vmr1aw"; - break; - - case 3: - instrName = "vmr2aw"; - break; - - case 5: - instrName = "vmr3aw"; - break; - - case 7: - instrName = "vmr4aw"; - break; - - case 9: - instrName = "vmr5aw"; - break; - - case 11: - instrName = "vmr6aw"; - break; - - } - - decodingClass = 42; - usesSimdRegA = usesSimdRegB = usesSimdRegC = 1; - break; - } - + case 6: instrName = "adds" ;break; - case 7: - case 6: - { - switch (BITS(state->words[0], 16, 19)) - { - case 15: - instrName = "vh264ft"; - break; - case 14: - instrName = "vh264f"; - break; - case 13: - instrName = "vvc1ft"; - break; - case 12: - instrName = "vvc1f"; - break; - } - decodingClass = 42; - usesSimdRegA = usesSimdRegB = usesSimdRegC = 1; - break; + case 7: instrName = "subs"; break; + case 8: instrName = "divaw"; break; + case 0xA: instrName = "asls"; break; + case 0xB: instrName = "asrs"; break; + case 0x28: instrName = "addsdw";break; + case 0x29: instrName = "subsdw"; break; - } + case 47: + switch(BITS(state->words[0],0,5)) + { + case 0: instrName = "swap"; decodingClass = 1; break; + case 1: instrName = "norm"; decodingClass = 1; break; + /* ARC A700 DSP Extensions */ + case 2: instrName = "sat16"; decodingClass = 1; break; + case 3: instrName = "rnd16"; decodingClass = 1; break; + case 4: instrName = "abssw"; decodingClass = 1; break; + case 5: instrName = "abss"; decodingClass = 1; break; + case 6: instrName = "negsw"; decodingClass = 1; break; + case 7: instrName = "negs"; decodingClass = 1; break; - case 92: - instrName = "vd6tapf"; - decodingClass = 39; - usesSimdRegA = usesSimdRegB = 1; - usesSimdRegC = 0; - break; - case 55: - instrName = "vinti"; - decodingClass = 43; - usesSimdRegA = usesSimdRegB = usesSimdRegC = 0; - break; + case 8: instrName = "normw"; decodingClass = 1; break; - default: - instrName = "SIMD"; - state->flow = invalid_instr; - break; } - } - else - { - instrName = "???_SIMD"; + break; + default: + instrName = "??? (2[3])"; state->flow = invalid_instr; - } break; - + } + break; case op_LD_ADD: /* Load/Add resister-register */ @@ -2039,9 +1013,6 @@ dsmOneArcInst (bfd_vma addr, struct arcDisState *state, disassemble_info * info) state->isBranch = 1; state->nullifyMode = BR_exec_always; break; - case 6 : instrName = "sub_s.ne"; - decodingClass = 35; - break; case 7 : decodingClass = 26; switch(BITS(state->words[0],8,10)) @@ -2049,7 +1020,7 @@ dsmOneArcInst (bfd_vma addr, struct arcDisState *state, disassemble_info * info) case 0 : instrName = "nop_s"; break; /* Unimplemented instruction reserved in ARC700 */ - case 1: instrName = "unimp_s";break; + case 1: instrName = "unimp";break; case 4: instrName = "jeq_s [blink]"; @@ -2115,7 +1086,7 @@ dsmOneArcInst (bfd_vma addr, struct arcDisState *state, disassemble_info * info) } break; - case op_LD_S: + case op_LD_S: /* ARCompact 16-bit Load with offset, Major Opcode 0x10 */ instrName = "ld_s"; decodingClass = 28; @@ -2274,76 +1245,14 @@ dsmOneArcInst (bfd_vma addr, struct arcDisState *state, disassemble_info * info) break; default: - instrName = instruction_name (state, state->_opcode, 0, &flags); - if (!instrName) - { - instrName = "???"; - state->flow=invalid_instr; - } + instrName = instruction_name(state,state->_opcode,0,&flags); + if (!instrName) instrName = "???", state->flow=invalid_instr; break; } - /* Maybe we should be checking for extension instructions over here - * instead of all over this crazy switch case. */ - if (state->flow == invalid_instr) - { - if (!((state->_opcode == op_SIMD) && enable_simd)) - instrName = instruction_name(state,state->_opcode, - state->words[0], - &flags); - - if (state->instructionLen == 2) - { - switch (flags) - { - case AC_SYNTAX_3OP: - decodingClass = 22; - break; - case AC_SYNTAX_2OP: - decodingClass = 14; - break; - case AC_SYNTAX_1OP: - decodingClass = 36; - break; - case AC_SYNTAX_NOP: - decodingClass = 26; - break; - default: - mwerror(state, "Invalid syntax class\n"); - } - } - else - { -/* Must do the above for this one too */ - switch (flags) - { - case AC_SYNTAX_3OP: - decodingClass = 0; - break; - case AC_SYNTAX_2OP: - decodingClass = 1; - break; - case AC_SYNTAX_1OP: - decodingClass = 32; - break; - case AC_SYNTAX_NOP: - break; - case AC_SYNTAX_SIMD: - break; - default: - mwerror(state, "Invalid syntax class\n"); - } - } - - if (!instrName) - { - instrName = "???"; - state->flow=invalid_instr; - } - } - fieldAisReg = fieldBisReg = fieldCisReg = 1; /* assume regs for now */ flag = cond = is_shimm = is_limm = 0; + //state->nullifyMode = BR_exec_when_no_jump; /* 0 */ signExtend = addrWriteBack = directMem = 0; usesAuxReg = 0; @@ -2669,10 +1578,7 @@ dsmOneArcInst (bfd_vma addr, struct arcDisState *state, disassemble_info * info) state->_mem_load = 1; directMem = BIT(state->words[0],15); - /* Check if address writeback is allowed before decoding the - address writeback field of a load instruction.*/ - if (fieldBisReg && (fieldB != 62)) - addrWriteBack = BITS(state->words[0],22,23); + addrWriteBack = BITS(state->words[0],22,23); signExtend = BIT(state->words[0],16); write_instr_name(); @@ -2723,10 +1629,7 @@ dsmOneArcInst (bfd_vma addr, struct arcDisState *state, disassemble_info * info) else state->_offset += fieldB, state->_ea_present = 0; directMem = BIT(state->words[0],11); - /* Check if address writeback is allowed before decoding the - address writeback field of a load instruction.*/ - if (fieldBisReg && (fieldB != 62)) - addrWriteBack = BITS(state->words[0],9,10); + addrWriteBack = BITS(state->words[0],9,10); signExtend = BIT(state->words[0],6); write_instr_name(); @@ -2753,12 +1656,12 @@ dsmOneArcInst (bfd_vma addr, struct arcDisState *state, disassemble_info * info) case 7: /* ST instruction. */ - CHECK_FIELD_B (); - CHECK_FIELD_C (); + CHECK_FIELD_B(); + CHECK_FIELD_C(); state->source_operand.registerNum = fieldC; - state->sourceType = fieldCisReg ? ARC_REGISTER : ARC_LIMM; - fieldA = FIELDD9 (state->words[0]); /* shimm */ - fieldAisReg = 0; + state->sourceType = fieldCisReg? ARC_REGISTER : ARC_LIMM ; + fieldA = FIELDD9(state->words[0]); /* shimm */ + fieldAisReg=0; /* [B,A offset] */ if (dbg) printf_unfiltered("7:b reg %d %x off %x\n", @@ -2774,11 +1677,11 @@ dsmOneArcInst (bfd_vma addr, struct arcDisState *state, disassemble_info * info) else state->_offset += fieldB, state->_ea_present = 0; - directMem = BIT (state->words[0], 5); - addrWriteBack = BITS (state->words[0], 3, 4); + directMem = BIT(state->words[0],5); + addrWriteBack = BITS(state->words[0],3,4); state->_addrWriteBack = addrWriteBack; - write_instr_name (); - WRITE_FORMAT_x_COMMA_LB (C); + write_instr_name(); + WRITE_FORMAT_x_COMMA_LB(C); if (fieldA == 0) { WRITE_FORMAT_x_RB(B); @@ -3299,14 +2202,13 @@ dsmOneArcInst (bfd_vma addr, struct arcDisState *state, disassemble_info * info) FIELD_B_AC(); fieldC = (BITS(state->words[0],0,6)) << 1; - fieldC = sign_extend (fieldC, 8); - fieldC += (addr & ~0x3); fieldA = fieldAisReg = fieldCisReg = 0; write_instr_name(); /* This address could be a label we know. Convert it. */ add_target(fieldC); /* For debugger. */ + state->flow = direct_jump; WRITE_FORMAT_x(B); WRITE_FORMAT_COMMA_x(A); @@ -3328,11 +2230,14 @@ dsmOneArcInst (bfd_vma addr, struct arcDisState *state, disassemble_info * info) /* j_s instruction */ - FIELD_B_AC (); + FIELD_B_AC(); + + /*printf("OPCODES: j_s.d");*/ state->register_for_indirect_jump = fieldB; - write_instr_name (); - strcat (formatString,"[%r]"); - my_sprintf (state, state->operandBuffer, formatString, fieldB); + + write_instr_name(); + strcat(formatString,"[%r]"); + my_sprintf(state, state->operandBuffer, formatString, fieldB); break; case 28: @@ -3485,6 +2390,8 @@ dsmOneArcInst (bfd_vma addr, struct arcDisState *state, disassemble_info * info) if (fieldCisReg) state->ea_reg1 = fieldC; + + write_instr_name(); WRITE_FORMAT_x_COMMA_LB(B); @@ -3495,133 +2402,11 @@ dsmOneArcInst (bfd_vma addr, struct arcDisState *state, disassemble_info * info) write_comments(); break; - case 35: - - /* sub_s.ne instruction */ - - FIELD_B_AC(); - write_instr_name(); - strcat(formatString,"%r,%r,%r"); - my_sprintf(state, state->operandBuffer, formatString, fieldB, fieldB, fieldB); - break; - - case 36: - - FIELD_B_AC(); - - write_instr_name(); - - WRITE_FORMAT_x(B); - WRITE_NOP_COMMENT(); - my_sprintf(state, state->operandBuffer, formatString, fieldB); - - break; - /*******SIMD instructions decoding follows*************/ - case 37: - case 39: - case 41: - /*fieldA is vr register - fieldB is I register - fieldC is a constant - %*,[%(,%<] - or - %*,%(,%< - or - %*,%(,%u - */ - - CHECK_FIELD_A(); - - CHECK_FIELD_B(); - if (decodingClass == 41) - { - FIELD_C(); - } - else - { - FIELD_U8(); - - if (simd_scale_u8>0) - fieldC = fieldC << simd_scale_u8; - } - - fieldCisReg = 0; - - write_instr_name(); - (decodingClass == 37 ? WRITE_FORMAT_x_COMMA_LB(A) : - WRITE_FORMAT_x_COMMA(A)); - WRITE_FORMAT_x_COMMA(B); - (decodingClass == 37 ? WRITE_FORMAT_x_RB(C): - WRITE_FORMAT_x(C)); - WRITE_NOP_COMMENT(); - my_sprintf(state,state->operandBuffer, formatString, fieldA, fieldB, fieldC); - - - break; - case 38: - /* fieldA is a vr register - fieldB is a ARC700 basecase register. - %*,[%b] - */ - CHECK_FIELD_A(); - CHECK_FIELD_B(); - - write_instr_name(); - WRITE_FORMAT_x_COMMA_LB(A); - WRITE_FORMAT_x_RB(B); - WRITE_NOP_COMMENT(); - my_sprintf(state,state->operandBuffer, formatString, fieldA, fieldB); - - break; - case 40: - /* fieldB & fieldC are vr registers - %(,%) - or - %B,%C - or - %(,%C - */ - CHECK_FIELD_B(); - CHECK_FIELD_C(); - - write_instr_name(); - WRITE_FORMAT_x(B); - WRITE_FORMAT_COMMA_x(C); - my_sprintf(state, state->operandBuffer, formatString, fieldB, fieldC); - break; - - case 42: - /* fieldA, fieldB, fieldC are all vr registers - %*, %(, %) */ - CHECK_FIELD_A(); - CHECK_FIELD_B(); - FIELD_C(); - - write_instr_name(); - WRITE_FORMAT_x(A); - WRITE_FORMAT_COMMA_x(B); - WRITE_FORMAT_COMMA_x(C); - my_sprintf(state, state->operandBuffer, formatString, fieldA, fieldB, fieldC); - break; - - case 43: - /* Only fieldC is a register - %C*/ - CHECK_FIELD_C(); - - if (BITS(state->words[0], 17, 23) == 55) - fieldCisReg = 0; - - write_instr_name(); - WRITE_FORMAT_x(C); - my_sprintf(state, state->operandBuffer, formatString, fieldC); - break; - - /***************SIMD decoding ends*********************/ - default: - mwerror(state, "Bad decoding class in ARC disassembler"); break; - } + default: + mwerror(state, "Bad decoding class in ARC disassembler"); + break; + } state->_cond = cond; return state->instructionLen = offset; @@ -3632,11 +2417,14 @@ dsmOneArcInst (bfd_vma addr, struct arcDisState *state, disassemble_info * info) * _coreRegName - Returns the name the user specified core extension * register. */ + + + static const char * _coreRegName ( - void *_this ATTRIBUTE_UNUSED, /* C++ this pointer */ - int v /* Register value */ + ATTRIBUTE_UNUSED void *_this, /* C++ this pointer */ + int v /* Register value */ ) { return arcExtMap_coreRegName(v); @@ -3648,8 +2436,8 @@ _coreRegName */ static const char * _auxRegName -( void *_this ATTRIBUTE_UNUSED, /* C++ this pointer */ - int v /* Register value */ +( ATTRIBUTE_UNUSED void *_this, /* C++ this pointer */ + int v /* Register value */ ) { return arcExtMap_auxRegName(v); @@ -3663,8 +2451,8 @@ _auxRegName static const char * _condCodeName ( - void *_this ATTRIBUTE_UNUSED, /* C++ this pointer */ - int v /* Register value */ + ATTRIBUTE_UNUSED void *_this, /* C++ this pointer */ + int v /* Register value */ ) { return arcExtMap_condCodeName(v); @@ -3677,22 +2465,145 @@ _condCodeName static const char * _instName ( - void *_this ATTRIBUTE_UNUSED, /* C++ this pointer */ - int op1, /* major opcode value */ - int op2, /* minor opcode value */ - int *flags /* instruction flags */ + ATTRIBUTE_UNUSED void *_this, /* C++ this pointer */ + int op1, /* major opcode value */ + int op2, /* minor opcode value */ + int *flags /* instruction flags */ ) { return arcExtMap_instName(op1, op2, flags); } -static void -parse_disassembler_options (char *options) + +/* + * decodeInstr - Decode an instruction returning the size of the + * instruction in bytes or zero if unrecognized. + */ +static int +decodeInstr +( + bfd_vma address, /* Address of this instruction */ + disassemble_info* info + ) { - if (!strncasecmp (options, "simd",4)) + int status; + bfd_byte buffer[4]; + struct arcDisState s; /* ARC Disassembler state */ + void *stream = info->stream; /* output stream */ + fprintf_ftype func = info->fprintf_func; + int bytes; + int lowbyte, highbyte; + char buf[256]; + + lowbyte = ((info->endian == BFD_ENDIAN_LITTLE) ? 1 : 0); + highbyte = ((info->endian == BFD_ENDIAN_LITTLE) ? 0 : 1); + + memset(&s, 0, sizeof(struct arcDisState)); + + /* read first instruction */ + status = (*info->read_memory_func) (address, buffer, 2, info); + + if (status != 0) + { + (*info->memory_error_func) (status, address, info); + return -1; + } + + if ((buffer[lowbyte] & 0xf8) > 0x38) + { + info->bytes_per_line = 2; + s.words[0] = (buffer[lowbyte] << 8) | buffer[highbyte]; + status = (*info->read_memory_func) (address + 2, buffer, 4, info); + if (info->endian == BFD_ENDIAN_LITTLE) + s.words[1] = bfd_getl32(buffer); + else + s.words[1] = bfd_getb32(buffer); + } + else + { + info->bytes_per_line = 4; + status = (*info->read_memory_func) (address + 2, &buffer[2], 2, info); + if (status != 0) { - enable_simd = 1; + (*info->memory_error_func) (status, address + 2, info); + return -1; } + if (info->endian == BFD_ENDIAN_LITTLE) + s.words[0] = bfd_getl32(buffer); + else + s.words[0] = bfd_getb32(buffer); + + /* always read second word in case of limm */ + /* we ignore the result since last insn may not have a limm */ + status = (*info->read_memory_func) (address + 4, buffer, 4, info); + if (info->endian == BFD_ENDIAN_LITTLE) + s.words[1] = bfd_getl32(buffer); + else + s.words[1] = bfd_getb32(buffer); + } + + s._this = &s; + s.coreRegName = _coreRegName; + s.auxRegName = _auxRegName; + s.condCodeName = _condCodeName; + s.instName = _instName; + + /* disassemble */ + bytes = dsmOneArcInst(address, (void *)&s, info); + + /* display the disassembled instruction */ + + { + char* instr = s.instrBuffer; + char* operand = s.operandBuffer; + char* space = strchr(instr, ' '); + + if (s.instructionLen == 2) + (*func) (stream, " %04x ", (unsigned int) s.words[0]); + else + (*func) (stream, "%08x ", (unsigned int) s.words[0]); + + (*func) (stream, " "); + + /* if the operand is actually in the instruction buffer */ + if ((space != NULL) && (operand[0] == '\0')) + { + *space = '\0'; + operand = space + 1; + } + + if (__TRANSLATION_REQUIRED(s)) + { + bfd_vma addr; + int i = 1; + + (*func) (stream, "%-10s ", instr); + + if (operand[0] != '@') + { + char *tmpBuffer; + /* Branch instruction with 3 operands, Translation is required + only for the third operand. Print the first 2 operands */ + strcpy(buf, operand); + tmpBuffer = strtok(buf,"@"); + (*func) (stream, "%s", tmpBuffer); + i = strlen(tmpBuffer) + 1; + } + + addr = s.addresses[operand[i] - '0']; + (*info->print_address_func) ((bfd_vma) addr, info); + } + else + { + if (operand[0] == '\0') + (*func) (stream, "%s", instr); + else + (*func) (stream, "%-10s %s", instr, operand); + } + } + + return s.instructionLen; + } /* @@ -3711,12 +2622,16 @@ arcAnalyzeInstr int status; bfd_byte buffer[4]; struct arcDisState s; /* ARC Disassembler state */ + /* void *stream = info->stream; - unused and hence commented output stream */ + /* fprintf_ftype func = info->fprintf_func; - unused hence commented out */ + int bytes; int lowbyte, highbyte; + /*char buf[256]; - unused hence commented out*/ lowbyte = ((info->endian == BFD_ENDIAN_LITTLE) ? 1 : 0); highbyte = ((info->endian == BFD_ENDIAN_LITTLE) ? 0 : 1); - memset (&s, 0, sizeof (struct arcDisState)); + memset(&s, 0, sizeof(struct arcDisState)); /* read first instruction */ status = (*info->read_memory_func) (address, buffer, 2, info); @@ -3729,38 +2644,38 @@ arcAnalyzeInstr } if ((buffer[lowbyte] & 0xf8) > 0x38) - { - info->bytes_per_line = 2; - s.words[0] = (buffer[lowbyte] << 8) | buffer[highbyte]; - status = (*info->read_memory_func) (address + 2, buffer, 4, info); - if (info->endian == BFD_ENDIAN_LITTLE) - s.words[1] = bfd_getl32 (buffer); - else - s.words[1] = bfd_getb32 (buffer); - } + { + info->bytes_per_line = 2; + s.words[0] = (buffer[lowbyte] << 8) | buffer[highbyte]; + status = (*info->read_memory_func) (address + 2, buffer, 4, info); + if (info->endian == BFD_ENDIAN_LITTLE) + s.words[1] = bfd_getl32(buffer); + else + s.words[1] = bfd_getb32(buffer); + } else + { + info->bytes_per_line = 4; + status = (*info->read_memory_func) (address + 2, &buffer[2], 2, info); + if (status != 0) { - info->bytes_per_line = 4; - status = (*info->read_memory_func) (address + 2, &buffer[2], 2, info); - if (status != 0) - { - (*info->memory_error_func) (status, address + 2, info); - s.instructionLen = -1; - return s; - } - if (info->endian == BFD_ENDIAN_LITTLE) - s.words[0] = bfd_getl32(buffer); - else - s.words[0] = bfd_getb32(buffer); - - /* Always read second word in case of limm. */ - /* We ignore the result since the last insn may not have a limm. */ - status = (*info->read_memory_func) (address + 4, buffer, 4, info); - if (info->endian == BFD_ENDIAN_LITTLE) - s.words[1] = bfd_getl32(buffer); - else - s.words[1] = bfd_getb32(buffer); + (*info->memory_error_func) (status, address + 2, info); + s.instructionLen = -1; + return s; } + if (info->endian == BFD_ENDIAN_LITTLE) + s.words[0] = bfd_getl32(buffer); + else + s.words[0] = bfd_getb32(buffer); + + /* always read second word in case of limm */ + /* we ignore the result since last insn may not have a limm */ + status = (*info->read_memory_func) (address + 4, buffer, 4, info); + if (info->endian == BFD_ENDIAN_LITTLE) + s.words[1] = bfd_getl32(buffer); + else + s.words[1] = bfd_getb32(buffer); + } s._this = &s; s.coreRegName = _coreRegName; @@ -3769,65 +2684,20 @@ arcAnalyzeInstr s.instName = _instName; /* disassemble */ - dsmOneArcInst (address, (void *)&s, info); + bytes = dsmOneArcInst(address, (void *)&s, info); return s; } -/* ARCompact_decodeInstr - Decode an ARCompact instruction returning the - size of the instruction in bytes or zero if unrecognized. */ -int -ARCompact_decodeInstr (address, info) - bfd_vma address; /* Address of this instruction. */ - disassemble_info* info; -{ - void *stream = info->stream; /* output stream */ - fprintf_ftype func = info->fprintf_func; - char buf[256]; - - if (info->disassembler_options) - { - parse_disassembler_options (info->disassembler_options); - - /* To avoid repeated parsing of these options, we remove them here. */ - info->disassembler_options = NULL; - } - - s = arcAnalyzeInstr (address, info); - - if (!s.this) - return -1; - - /* display the disassembly instruction */ - - if (s.instructionLen == 2) - (*func) (stream, " "); - - (*func) (stream, "%08x ", s.words[0]); - (*func) (stream, " "); - (*func) (stream, "%-10s ", s.instrBuffer); +/* Return the print_insn function to use. */ - if (__TRANSLATION_REQUIRED(s)) - { - bfd_vma addr; - char *tmpBuffer; - int i = 1; - if (s.operandBuffer[0] != '@') - { - /* Branch instruction with 3 operands, Translation is required - only for the third operand. Print the first 2 operands */ - strcpy (buf, s.operandBuffer); - tmpBuffer = strtok (buf,"@"); - (*func) (stream, "%s",tmpBuffer); - i = strlen (tmpBuffer)+1; - } - addr = s.addresses[s.operandBuffer[i] - '0']; - (*info->print_address_func) ((bfd_vma) addr, info); - (*func) (stream, "\n"); - } - else - (*func) (stream, "%s",s.operandBuffer); - return s.instructionLen; +/* Side effect: */ +/* load (possibly empty) extension section */ +disassembler_ftype +arcompact_get_disassembler (void *ptr) +{ + build_ARC_extmap(ptr); + return decodeInstr; } diff --git a/opcodes/arcompact-dis.h b/opcodes/arcompact-dis.h new file mode 100644 index 0000000..f96cb71 --- /dev/null +++ b/opcodes/arcompact-dis.h @@ -0,0 +1,34 @@ +/* Disassembler structures definitions for the ARC. + Copyright 2009 + Free Software Foundation, Inc. + + 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., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ + +#ifndef ARCOMPACT_DIS_H +#define ARCOMPACT_DIS_H + + +void print_arc_disassembler_options (FILE *stream); + +disassembler_ftype arcompact_get_disassembler (void *); + +struct arcDisState +arcAnalyzeInstr(bfd_vma address, + disassemble_info* info); + +int ARCompact_decodeInstr (bfd_vma address, disassemble_info* info); + + +#endif /* ARCOMPACT_DIS_H */ diff --git a/opcodes/configure b/opcodes/configure index 90c95b9..8029156 100755 --- a/opcodes/configure +++ b/opcodes/configure @@ -1,25 +1,54 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.59. +# Generated by GNU Autoconf 2.61. # -# Copyright (C) 2003 Free Software Foundation, Inc. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## -# Be Bourne compatible +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' -elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then - set -o posix + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi + + + + +# PATH needs CR +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh fi -DUALCASE=1; export DUALCASE # for MKS sh # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then @@ -29,8 +58,43 @@ else fi +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +as_nl=' +' +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + { (exit 1); exit 1; } +fi + # Work around bugs in pre-3.0 UWIN ksh. -$as_unset ENV MAIL MAILPATH +for as_var in ENV MAIL MAILPATH +do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var +done PS1='$ ' PS2='> ' PS4='+ ' @@ -44,18 +108,19 @@ do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else - $as_unset $as_var + ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. -if expr a : '\(a\)' >/dev/null 2>&1; then +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi -if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false @@ -63,157 +128,388 @@ fi # Name of the executable. -as_me=`$as_basename "$0" || +as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)$' \| \ - . : '\(.\)' 2>/dev/null || + X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } - /^X\/\(\/\/\)$/{ s//\1/; q; } - /^X\/\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` +# CDPATH. +$as_unset CDPATH -# PATH needs CR, and LINENO needs CR and PATH. -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh +if test "x$CONFIG_SHELL" = x; then + if (eval ":") 2>/dev/null; then + as_have_required=yes +else + as_have_required=no fi + if test $as_have_required = yes && (eval ": +(as_func_return () { + (exit \$1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} - as_lineno_1=$LINENO - as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" || { - # Find who we are. Look in the path if we contain no path at all - # relative or not. - case $0 in - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break -done +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi - ;; - esac - # We did not find ourselves, most probably we were run as `sh COMMAND' - # in which case we are not to be found in the path. - if test "x$as_myself" = x; then - as_myself=$0 - fi - if test ! -f "$as_myself"; then - { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 - { (exit 1); exit 1; }; } - fi - case $CONFIG_SHELL in - '') +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = \"\$1\" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test \$exitcode = 0) || { (exit 1); exit 1; } + +( + as_lineno_1=\$LINENO + as_lineno_2=\$LINENO + test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && + test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } +") 2> /dev/null; then + : +else + as_candidate_shells= as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for as_base in sh bash ksh sh5; do - case $as_dir in + case $as_dir in /*) - if ("$as_dir/$as_base" -c ' + for as_base in sh bash ksh sh5; do + as_candidate_shells="$as_candidate_shells $as_dir/$as_base" + done;; + esac +done +IFS=$as_save_IFS + + + for as_shell in $as_candidate_shells $SHELL; do + # Try only shells that exist, to save several forks. + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { ("$as_shell") 2> /dev/null <<\_ASEOF +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi + + +: +_ASEOF +}; then + CONFIG_SHELL=$as_shell + as_have_required=yes + if { "$as_shell" 2> /dev/null <<\_ASEOF +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi + + +: +(as_func_return () { + (exit $1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} + +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi + +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = "$1" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test $exitcode = 0) || { (exit 1); exit 1; } + +( as_lineno_1=$LINENO as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then - $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } - $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } - CONFIG_SHELL=$as_dir/$as_base - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$0" ${1+"$@"} - fi;; - esac - done -done -;; - esac + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } + +_ASEOF +}; then + break +fi + +fi + + done + + if test "x$CONFIG_SHELL" != x; then + for as_var in BASH_ENV ENV + do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var + done + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} +fi + + + if test $as_have_required = no; then + echo This script requires a shell more modern than all the + echo shells that I found on your system. Please install a + echo modern shell, or manually run the script under such a + echo shell if you do have one. + { (exit 1); exit 1; } +fi + + +fi + +fi + + + +(eval "as_func_return () { + (exit \$1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} + +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi + +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = \"\$1\" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test \$exitcode = 0") || { + echo No shell found that supports shell functions. + echo Please tell autoconf@gnu.org about your system, + echo including any error possibly output before this + echo message +} + + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line before each line; the second 'sed' does the real - # work. The second script uses 'N' to pair each line-number line - # with the numbered line, and appends trailing '-' during - # substitution so that $LINENO is not a special case at line end. + # line-number line after each line using $LINENO; the second 'sed' + # does the real work. The second script uses 'N' to pair each + # line-number line with the line containing $LINENO, and appends + # trailing '-' during substitution so that $LINENO is not a special + # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) - sed '=' <$as_myself | + # scripts with optimization help from Paolo Bonzini. Blame Lee + # E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno N - s,$,-, - : loop - s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop - s,-$,, - s,^['$as_cr_digits']*\n,, + s/-\n.*// ' >$as_me.lineno && - chmod +x $as_me.lineno || + chmod +x "$as_me.lineno" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensible to this). - . ./$as_me.lineno + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" # Exit status is that of the last command. exit } -case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in - *c*,-n*) ECHO_N= ECHO_C=' -' ECHO_T=' ' ;; - *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; - *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in +-n*) + case `echo 'x\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + *) ECHO_C='\c';; + esac;; +*) + ECHO_N='-n';; esac -if expr a : '\(a\)' >/dev/null 2>&1; then +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir +fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then - # We could just check for DJGPP; but this test a) works b) is more generic - # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). - if test -f conf$$.exe; then - # Don't use ln at all; we don't have any links + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' - else - as_ln_s='ln -s' - fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi -rm -f conf$$ conf$$.exe conf$$.file +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p=: @@ -222,7 +518,28 @@ else as_mkdir_p=false fi -as_executable_p="test -f" +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' +else + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +fi +as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" @@ -231,15 +548,6 @@ as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" -# IFS -# We need space, tab and new line, in precisely that order. -as_nl=' -' -IFS=" $as_nl" - -# CDPATH. -$as_unset CDPATH - # Check that we are running under the correct shell. @@ -390,29 +698,26 @@ fi +exec 7<&0 &1 + # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` -exec 6>&1 - # # Initializations. # ac_default_prefix=/usr/local +ac_clean_files= ac_config_libobj_dir=. +LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} -# Maximum number of lines to put in a shell here document. -# This variable seems obsolete. It should probably be removed, and -# only ac_max_sed_lines should be used. -: ${ac_max_here_lines=38} - # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= @@ -424,42 +729,189 @@ ac_unique_file="z8k-dis.c" # Factoring default headers for most tests. ac_includes_default="\ #include -#if HAVE_SYS_TYPES_H +#ifdef HAVE_SYS_TYPES_H # include #endif -#if HAVE_SYS_STAT_H +#ifdef HAVE_SYS_STAT_H # include #endif -#if STDC_HEADERS +#ifdef STDC_HEADERS # include # include #else -# if HAVE_STDLIB_H +# ifdef HAVE_STDLIB_H # include # endif #endif -#if HAVE_STRING_H -# if !STDC_HEADERS && HAVE_MEMORY_H +#ifdef HAVE_STRING_H +# if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif -#if HAVE_STRINGS_H +#ifdef HAVE_STRINGS_H # include #endif -#if HAVE_INTTYPES_H +#ifdef HAVE_INTTYPES_H # include -#else -# if HAVE_STDINT_H -# include -# endif #endif -#if HAVE_UNISTD_H +#ifdef HAVE_STDINT_H +# include +#endif +#ifdef HAVE_UNISTD_H # include #endif" -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE AR ac_ct_AR RANLIB ac_ct_RANLIB LIBTOOL SED EGREP FGREP GREP LD DUMPBIN ac_ct_DUMPBIN NM LN_S lt_ECHO CPP WARN_CFLAGS NO_WERROR MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT INSTALL_LIBBFD_TRUE INSTALL_LIBBFD_FALSE host_noncanonical target_noncanonical bfdlibdir bfdincludedir USE_NLS LIBINTL LIBINTL_DEP INCINTL XGETTEXT GMSGFMT POSUB CATALOGS DATADIRNAME INSTOBJEXT GENCAT CATOBJEXT MKINSTALLDIRS MSGFMT MSGMERGE CC_FOR_BUILD EXEEXT_FOR_BUILD HDEFINES CGEN_MAINT_TRUE CGEN_MAINT_FALSE cgendir SHARED_LDFLAGS SHARED_LIBADD SHARED_DEPENDENCIES archdefs BFD_MACHINES LIBOBJS LTLIBOBJS' +ac_subst_vars='SHELL +PATH_SEPARATOR +PACKAGE_NAME +PACKAGE_TARNAME +PACKAGE_VERSION +PACKAGE_STRING +PACKAGE_BUGREPORT +exec_prefix +prefix +program_transform_name +bindir +sbindir +libexecdir +datarootdir +datadir +sysconfdir +sharedstatedir +localstatedir +includedir +oldincludedir +docdir +infodir +htmldir +dvidir +pdfdir +psdir +libdir +localedir +mandir +DEFS +ECHO_C +ECHO_N +ECHO_T +LIBS +build_alias +host_alias +target_alias +build +build_cpu +build_vendor +build_os +host +host_cpu +host_vendor +host_os +target +target_cpu +target_vendor +target_os +CC +CFLAGS +LDFLAGS +CPPFLAGS +ac_ct_CC +EXEEXT +OBJEXT +INSTALL_PROGRAM +INSTALL_SCRIPT +INSTALL_DATA +CYGPATH_W +PACKAGE +VERSION +ACLOCAL +AUTOCONF +AUTOMAKE +AUTOHEADER +MAKEINFO +install_sh +STRIP +INSTALL_STRIP_PROGRAM +mkdir_p +AWK +SET_MAKE +am__leading_dot +AMTAR +am__tar +am__untar +DEPDIR +am__include +am__quote +AMDEP_TRUE +AMDEP_FALSE +AMDEPBACKSLASH +CCDEPMODE +am__fastdepCC_TRUE +am__fastdepCC_FALSE +AR +RANLIB +LIBTOOL +SED +GREP +EGREP +FGREP +LD +DUMPBIN +ac_ct_DUMPBIN +NM +LN_S +lt_ECHO +CPP +WARN_CFLAGS +NO_WERROR +MAINTAINER_MODE_TRUE +MAINTAINER_MODE_FALSE +MAINT +INSTALL_LIBBFD_TRUE +INSTALL_LIBBFD_FALSE +host_noncanonical +target_noncanonical +bfdlibdir +bfdincludedir +USE_NLS +LIBINTL +LIBINTL_DEP +INCINTL +XGETTEXT +GMSGFMT +POSUB +CATALOGS +DATADIRNAME +INSTOBJEXT +GENCAT +CATOBJEXT +MKINSTALLDIRS +MSGFMT +MSGMERGE +CC_FOR_BUILD +EXEEXT_FOR_BUILD +HDEFINES +CGEN_MAINT_TRUE +CGEN_MAINT_FALSE +cgendir +SHARED_LDFLAGS +SHARED_LIBADD +SHARED_DEPENDENCIES +archdefs +BFD_MACHINES +LIBOBJS +LTLIBOBJS' ac_subst_files='' + ac_precious_vars='build_alias +host_alias +target_alias +CC +CFLAGS +LDFLAGS +LIBS +CPPFLAGS +CPP' + # Initialize some variables set by options. ac_init_help= @@ -486,34 +938,48 @@ x_libraries=NONE # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. +# (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' -datadir='${prefix}/share' +datarootdir='${prefix}/share' +datadir='${datarootdir}' 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' +docdir='${datarootdir}/doc/${PACKAGE}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' ac_prev= +ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then - eval "$ac_prev=\$ac_option" + eval $ac_prev=\$ac_option ac_prev= continue fi - ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` + case $ac_option in + *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *) ac_optarg=yes ;; + esac # Accept the important Cygnus configure options, so we can diagnose typos. - case $ac_option in + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; @@ -535,33 +1001,45 @@ do --config-cache | -C) cache_file=config.cache ;; - -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; - -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ - | --da=*) + -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + -disable-* | --disable-*) ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } - ac_feature=`echo $ac_feature | sed 's/-/_/g'` - eval "enable_$ac_feature=no" ;; + ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` + eval enable_$ac_feature=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } - ac_feature=`echo $ac_feature | sed 's/-/_/g'` - case $ac_option in - *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; - *) ac_optarg=yes ;; - esac - eval "enable_$ac_feature='$ac_optarg'" ;; + ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` + eval enable_$ac_feature=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ @@ -588,6 +1066,12 @@ do -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$ac_optarg ;; + -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; @@ -612,13 +1096,16 @@ do | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + -localstatedir | --localstatedir | --localstatedi | --localstated \ - | --localstate | --localstat | --localsta | --localst \ - | --locals | --local | --loca | --loc | --lo) + | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ - | --localstate=* | --localstat=* | --localsta=* | --localst=* \ - | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) @@ -683,6 +1170,16 @@ do | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$ac_optarg ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; @@ -735,24 +1232,20 @@ do -with-* | --with-*) ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } - ac_package=`echo $ac_package| sed 's/-/_/g'` - case $ac_option in - *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; - *) ac_optarg=yes ;; - esac - eval "with_$ac_package='$ac_optarg'" ;; + ac_package=`echo $ac_package | sed 's/[-.]/_/g'` + eval with_$ac_package=\$ac_optarg ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } - ac_package=`echo $ac_package | sed 's/-/_/g'` - eval "with_$ac_package=no" ;; + ac_package=`echo $ac_package | sed 's/[-.]/_/g'` + eval with_$ac_package=no ;; --x) # Obsolete; use --with-x. @@ -783,8 +1276,7 @@ Try \`$0 --help' for more information." >&2 expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } - ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` - eval "$ac_envvar='$ac_optarg'" + eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) @@ -804,27 +1296,19 @@ if test -n "$ac_prev"; then { (exit 1); exit 1; }; } fi -# Be sure to have absolute paths. -for ac_var in exec_prefix prefix +# Be sure to have absolute directory names. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir do - eval ac_val=$`echo $ac_var` + eval ac_val=\$$ac_var case $ac_val in - [\\/$]* | ?:[\\/]* | NONE | '' ) ;; - *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 - { (exit 1); exit 1; }; };; - esac -done - -# Be sure to have absolute paths. -for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ - localstatedir libdir includedir oldincludedir infodir mandir -do - eval ac_val=$`echo $ac_var` - case $ac_val in - [\\/$]* | ?:[\\/]* ) ;; - *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 - { (exit 1); exit 1; }; };; + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac + { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; } done # There might be people who depend on the old broken behavior: `$host' @@ -851,74 +1335,76 @@ test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + { echo "$as_me: error: Working directory cannot be determined" >&2 + { (exit 1); exit 1; }; } +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + { echo "$as_me: error: pwd does not report name of working directory" >&2 + { (exit 1); exit 1; }; } + + # 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_confdir=`(dirname "$0") 2>/dev/null || + # Try the directory containing this script, then the parent directory. + ac_confdir=`$as_dirname -- "$0" || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || + X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X"$0" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` srcdir=$ac_confdir - if test ! -r $srcdir/$ac_unique_file; then + 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 "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 - { (exit 1); exit 1; }; } - else - { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 +if test ! -r "$srcdir/$ac_unique_file"; then + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } - fi fi -(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || - { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 { (exit 1); exit 1; }; } -srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` -ac_env_build_alias_set=${build_alias+set} -ac_env_build_alias_value=$build_alias -ac_cv_env_build_alias_set=${build_alias+set} -ac_cv_env_build_alias_value=$build_alias -ac_env_host_alias_set=${host_alias+set} -ac_env_host_alias_value=$host_alias -ac_cv_env_host_alias_set=${host_alias+set} -ac_cv_env_host_alias_value=$host_alias -ac_env_target_alias_set=${target_alias+set} -ac_env_target_alias_value=$target_alias -ac_cv_env_target_alias_set=${target_alias+set} -ac_cv_env_target_alias_value=$target_alias -ac_env_CC_set=${CC+set} -ac_env_CC_value=$CC -ac_cv_env_CC_set=${CC+set} -ac_cv_env_CC_value=$CC -ac_env_CFLAGS_set=${CFLAGS+set} -ac_env_CFLAGS_value=$CFLAGS -ac_cv_env_CFLAGS_set=${CFLAGS+set} -ac_cv_env_CFLAGS_value=$CFLAGS -ac_env_LDFLAGS_set=${LDFLAGS+set} -ac_env_LDFLAGS_value=$LDFLAGS -ac_cv_env_LDFLAGS_set=${LDFLAGS+set} -ac_cv_env_LDFLAGS_value=$LDFLAGS -ac_env_CPPFLAGS_set=${CPPFLAGS+set} -ac_env_CPPFLAGS_value=$CPPFLAGS -ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} -ac_cv_env_CPPFLAGS_value=$CPPFLAGS -ac_env_CPP_set=${CPP+set} -ac_env_CPP_value=$CPP -ac_cv_env_CPP_set=${CPP+set} -ac_cv_env_CPP_value=$CPP + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done # # Report the --help message. @@ -947,9 +1433,6 @@ Configuration: -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] -_ACEOF - - cat <<_ACEOF Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] @@ -967,15 +1450,22 @@ Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] - --datadir=DIR read-only architecture-independent data [PREFIX/share] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] - --infodir=DIR info documentation [PREFIX/info] - --mandir=DIR man documentation [PREFIX/man] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF @@ -1001,10 +1491,8 @@ Optional Features: --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors - --enable-shared[=PKGS] - build shared libraries [default=no] - --enable-static[=PKGS] - build static libraries [default=yes] + --enable-shared[=PKGS] build shared libraries [default=no] + --enable-static[=PKGS] build static libraries [default=yes] --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --disable-libtool-lock avoid locking (might break parallel builds) @@ -1030,126 +1518,95 @@ Some influential environment variables: CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory - CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have - headers in a nonstandard directory + LIBS libraries to pass to the linker, e.g. -l + CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I if + you have headers in a nonstandard directory CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. _ACEOF +ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. - ac_popdir=`pwd` for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue - test -d $ac_dir || continue + test -d "$ac_dir" || continue ac_builddir=. -if test "$ac_dir" != .; then +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A "../" for each directory in $ac_dir_suffix. - ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` -else - ac_dir_suffix= ac_top_builddir= -fi + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix case $srcdir in - .) # No --srcdir option. We are building in place. + .) # We are building in place. ac_srcdir=. - if test -z "$ac_top_builddir"; then - ac_top_srcdir=. - else - ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` - fi ;; - [\\/]* | ?:[\\/]* ) # Absolute path. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir ;; - *) # Relative path. - ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_builddir$srcdir ;; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac - -# Do not use `cd foo && pwd` to compute absolute paths, because -# the directories may not exist. -case `pwd` in -.) ac_abs_builddir="$ac_dir";; -*) - case "$ac_dir" in - .) ac_abs_builddir=`pwd`;; - [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; - *) ac_abs_builddir=`pwd`/"$ac_dir";; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_builddir=${ac_top_builddir}.;; -*) - case ${ac_top_builddir}. in - .) ac_abs_top_builddir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; - *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_srcdir=$ac_srcdir;; -*) - case $ac_srcdir in - .) ac_abs_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; - *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_srcdir=$ac_top_srcdir;; -*) - case $ac_top_srcdir in - .) ac_abs_top_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; - *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; - esac;; -esac - - cd $ac_dir - # Check for guested configure; otherwise get Cygnus style configure. - if test -f $ac_srcdir/configure.gnu; then - echo - $SHELL $ac_srcdir/configure.gnu --help=recursive - elif test -f $ac_srcdir/configure; then - echo - $SHELL $ac_srcdir/configure --help=recursive - elif test -f $ac_srcdir/configure.ac || - test -f $ac_srcdir/configure.in; then - echo - $ac_configure --help +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for guested configure. + if test -f "$ac_srcdir/configure.gnu"; then + echo && + $SHELL "$ac_srcdir/configure.gnu" --help=recursive + elif test -f "$ac_srcdir/configure"; then + echo && + $SHELL "$ac_srcdir/configure" --help=recursive else echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 - fi - cd $ac_popdir + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } done fi -test -n "$ac_init_help" && exit 0 +test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF +configure +generated by GNU Autoconf 2.61 -Copyright (C) 2003 Free Software Foundation, Inc. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF - exit 0 + exit fi -exec 5>config.log -cat >&5 <<_ACEOF +cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was -generated by GNU Autoconf 2.59. Invocation command line was +generated by GNU Autoconf 2.61. Invocation command line was $ $0 $@ _ACEOF +exec 5>>config.log { cat <<_ASUNAME ## --------- ## @@ -1168,7 +1625,7 @@ uname -v = `(uname -v) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` -hostinfo = `(hostinfo) 2>/dev/null || echo unknown` +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` @@ -1182,6 +1639,7 @@ do test -z "$as_dir" && as_dir=. echo "PATH: $as_dir" done +IFS=$as_save_IFS } >&5 @@ -1203,7 +1661,6 @@ _ACEOF ac_configure_args= ac_configure_args0= ac_configure_args1= -ac_sep= ac_must_keep_next=false for ac_pass in 1 2 do @@ -1214,7 +1671,7 @@ do -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) + *\'*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in @@ -1236,9 +1693,7 @@ do -* ) ac_must_keep_next=true ;; esac fi - ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" - # Get rid of the leading space. - ac_sep=" " + ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac done @@ -1249,8 +1704,8 @@ $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_ # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. -# WARNING: Be sure not to use single quotes in there, as some shells, -# such as our DU 5.0 friend, will then `close' the trap. +# WARNING: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { @@ -1263,20 +1718,34 @@ trap 'exit_status=$? _ASBOX echo # The following way of writing the cache mishandles newlines in values, -{ +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 +echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + *) $as_unset $ac_var ;; + esac ;; + esac + done (set) 2>&1 | - case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in - *ac_space=\ *) + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) sed -n \ - "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" - ;; + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( *) - sed -n \ - "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; - esac; -} + esac | + sort +) echo cat <<\_ASBOX @@ -1287,22 +1756,28 @@ _ASBOX echo for ac_var in $ac_subst_vars do - eval ac_val=$`echo $ac_var` - echo "$ac_var='"'"'$ac_val'"'"'" + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX -## ------------- ## -## Output files. ## -## ------------- ## +## ------------------- ## +## File substitutions. ## +## ------------------- ## _ASBOX echo for ac_var in $ac_subst_files do - eval ac_val=$`echo $ac_var` - echo "$ac_var='"'"'$ac_val'"'"'" + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + echo "$ac_var='\''$ac_val'\''" done | sort echo fi @@ -1314,26 +1789,24 @@ _ASBOX ## ----------- ## _ASBOX echo - sed "/^$/d" confdefs.h | sort + cat confdefs.h echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" echo "$as_me: exit $exit_status" } >&5 - rm -f core *.core && - rm -rf conftest* confdefs* conf$$* $ac_clean_files && + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status - ' 0 +' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal done ac_signal=0 # 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 +rm -f -r conftest* confdefs.h # Predefined preprocessor variables. @@ -1364,14 +1837,17 @@ _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. -if test -z "$CONFIG_SITE"; then - if test "x$prefix" != xNONE; then - CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" - else - CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" - fi +if test -n "$CONFIG_SITE"; then + set x "$CONFIG_SITE" +elif test "x$prefix" != xNONE; then + set x "$prefix/share/config.site" "$prefix/etc/config.site" +else + set x "$ac_default_prefix/share/config.site" \ + "$ac_default_prefix/etc/config.site" fi -for ac_site_file in $CONFIG_SITE; do +shift +for ac_site_file +do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} @@ -1387,8 +1863,8 @@ if test -r "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in - [\\/]* | ?:[\\/]* ) . $cache_file;; - *) . ./$cache_file;; + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; esac fi else @@ -1400,12 +1876,11 @@ fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false -for ac_var in `(set) 2>&1 | - sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do +for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set - eval ac_old_val="\$ac_cv_env_${ac_var}_value" - eval ac_new_val="\$ac_env_${ac_var}_value" + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 @@ -1430,8 +1905,7 @@ echo "$as_me: current value: $ac_new_val" >&2;} # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) - ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in @@ -1448,12 +1922,6 @@ echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start ov { (exit 1); exit 1; }; } fi -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - @@ -1470,109 +1938,164 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_aux_dir= -for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do - if test -f $ac_dir/install-sh; then +for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; 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 + elif 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/shtool; then + elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then - { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5 -echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;} + { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5 +echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;} { (exit 1); exit 1; }; } fi -ac_config_guess="$SHELL $ac_aux_dir/config.guess" -ac_config_sub="$SHELL $ac_aux_dir/config.sub" -ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. +ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. +ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. + # Make sure we can run config.sub. -$ac_config_sub sun4 >/dev/null 2>&1 || - { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5 -echo "$as_me: error: cannot run $ac_config_sub" >&2;} +$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || + { { echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5 +echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;} { (exit 1); exit 1; }; } -echo "$as_me:$LINENO: checking build system type" >&5 -echo $ECHO_N "checking build system type... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking build system type" >&5 +echo $ECHO_N "checking build system type... $ECHO_C" >&6; } if test "${ac_cv_build+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_cv_build_alias=$build_alias -test -z "$ac_cv_build_alias" && - ac_cv_build_alias=`$ac_config_guess` -test -z "$ac_cv_build_alias" && + ac_build_alias=$build_alias +test "x$ac_build_alias" = x && + ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` +test "x$ac_build_alias" = x && { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 echo "$as_me: error: cannot guess build type; you must specify one" >&2;} { (exit 1); exit 1; }; } -ac_cv_build=`$ac_config_sub $ac_cv_build_alias` || - { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5 -echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;} +ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || + { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5 +echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;} { (exit 1); exit 1; }; } fi -echo "$as_me:$LINENO: result: $ac_cv_build" >&5 -echo "${ECHO_T}$ac_cv_build" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_build" >&5 +echo "${ECHO_T}$ac_cv_build" >&6; } +case $ac_cv_build in +*-*-*) ;; +*) { { echo "$as_me:$LINENO: error: invalid value of canonical build" >&5 +echo "$as_me: error: invalid value of canonical build" >&2;} + { (exit 1); exit 1; }; };; +esac build=$ac_cv_build -build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` - - -echo "$as_me:$LINENO: checking host system type" >&5 -echo $ECHO_N "checking host system type... $ECHO_C" >&6 +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_build +shift +build_cpu=$1 +build_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +build_os=$* +IFS=$ac_save_IFS +case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac + + +{ echo "$as_me:$LINENO: checking host system type" >&5 +echo $ECHO_N "checking host system type... $ECHO_C" >&6; } if test "${ac_cv_host+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_cv_host_alias=$host_alias -test -z "$ac_cv_host_alias" && - ac_cv_host_alias=$ac_cv_build_alias -ac_cv_host=`$ac_config_sub $ac_cv_host_alias` || - { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5 -echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;} + if test "x$host_alias" = x; then + ac_cv_host=$ac_cv_build +else + ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || + { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5 +echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;} { (exit 1); exit 1; }; } +fi fi -echo "$as_me:$LINENO: result: $ac_cv_host" >&5 -echo "${ECHO_T}$ac_cv_host" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_host" >&5 +echo "${ECHO_T}$ac_cv_host" >&6; } +case $ac_cv_host in +*-*-*) ;; +*) { { echo "$as_me:$LINENO: error: invalid value of canonical host" >&5 +echo "$as_me: error: invalid value of canonical host" >&2;} + { (exit 1); exit 1; }; };; +esac host=$ac_cv_host -host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` - - -echo "$as_me:$LINENO: checking target system type" >&5 -echo $ECHO_N "checking target system type... $ECHO_C" >&6 +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_host +shift +host_cpu=$1 +host_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +host_os=$* +IFS=$ac_save_IFS +case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac + + +{ echo "$as_me:$LINENO: checking target system type" >&5 +echo $ECHO_N "checking target system type... $ECHO_C" >&6; } if test "${ac_cv_target+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_cv_target_alias=$target_alias -test "x$ac_cv_target_alias" = "x" && - ac_cv_target_alias=$ac_cv_host_alias -ac_cv_target=`$ac_config_sub $ac_cv_target_alias` || - { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_target_alias failed" >&5 -echo "$as_me: error: $ac_config_sub $ac_cv_target_alias failed" >&2;} + if test "x$target_alias" = x; then + ac_cv_target=$ac_cv_host +else + ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` || + { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&5 +echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&2;} { (exit 1); exit 1; }; } +fi fi -echo "$as_me:$LINENO: result: $ac_cv_target" >&5 -echo "${ECHO_T}$ac_cv_target" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_target" >&5 +echo "${ECHO_T}$ac_cv_target" >&6; } +case $ac_cv_target in +*-*-*) ;; +*) { { echo "$as_me:$LINENO: error: invalid value of canonical target" >&5 +echo "$as_me: error: invalid value of canonical target" >&2;} + { (exit 1); exit 1; }; };; +esac target=$ac_cv_target -target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -target_vendor=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -target_os=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_target +shift +target_cpu=$1 +target_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +target_os=$* +IFS=$ac_save_IFS +case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac # The aliases save the names the user supplied, while $host etc. @@ -1589,8 +2112,8 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -1603,32 +2126,34 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -1641,36 +2166,51 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6 + { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi - CC=$ac_ct_CC + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -1683,74 +2223,34 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi -fi -if test -z "$ac_cv_prog_CC"; then - ac_ct_CC=$CC - # Extract the first word of "cc", so it can be a program name with args. -set dummy cc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="cc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - CC=$ac_ct_CC -else - CC="$ac_cv_prog_CC" -fi + fi 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 "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -1764,7 +2264,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue @@ -1775,6 +2275,7 @@ do fi done done +IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. @@ -1792,22 +2293,23 @@ fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then - for ac_prog in cl + for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -1820,36 +2322,38 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC - for ac_prog in cl + for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -1862,29 +2366,45 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6 + { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + test -n "$ac_ct_CC" && break done - CC=$ac_ct_CC + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi fi fi @@ -1897,21 +2417,35 @@ See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. -echo "$as_me:$LINENO:" \ - "checking for C compiler version" >&5 +echo "$as_me:$LINENO: checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` -{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 - (eval $ac_compiler --version &5) 2>&5 +{ (ac_try="$ac_compiler --version >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } -{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 - (eval $ac_compiler -v &5) 2>&5 +{ (ac_try="$ac_compiler -v >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } -{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 - (eval $ac_compiler -V &5) 2>&5 +{ (ac_try="$ac_compiler -V >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } @@ -1936,47 +2470,77 @@ ac_clean_files="$ac_clean_files a.out a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. -echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 -echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 +echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; } ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` -if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 - (eval $ac_link_default) 2>&5 +# +# List of possible output files, starting from the most likely. +# The algorithm is not robust to junk in `.', hence go to wildcards (a.*) +# only as a last resort. b.out is created by i960 compilers. +ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out' +# +# The IRIX 6 linker writes into existing files which may not be +# executable, retaining their permissions. Remove them first so a +# subsequent execution test works. +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { (ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link_default") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then - # Find the output, starting from the most likely. This scheme is -# not robust to junk in `.', hence go to wildcards (a.*) only as a last -# resort. - -# Be careful to initialize this variable, since it used to be cached. -# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. -ac_cv_exeext= -# b.out is created by i960 compilers. -for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out + # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. +# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' +# in a Makefile. We should not override ac_cv_exeext if it was cached, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) - ;; - conftest.$ac_ext ) - # This is the source file. + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) - ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - # FIXME: I believe we export ac_cv_exeext for Libtool, - # but it would be cool to find out if it's true. Does anybody - # maintain Libtool? --akim. - export ac_cv_exeext + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an `-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. break;; * ) break;; esac done +test "$ac_cv_exeext" = no && ac_cv_exeext= + else + ac_file='' +fi + +{ echo "$as_me:$LINENO: result: $ac_file" >&5 +echo "${ECHO_T}$ac_file" >&6; } +if test -z "$ac_file"; then echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -1988,19 +2552,21 @@ See \`config.log' for more details." >&2;} fi ac_exeext=$ac_cv_exeext -echo "$as_me:$LINENO: result: $ac_file" >&5 -echo "${ECHO_T}$ac_file" >&6 -# Check the compiler produces executables we can run. If not, either +# Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. -echo "$as_me:$LINENO: checking whether the C compiler works" >&5 -echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether the C compiler works" >&5 +echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; } # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -2019,22 +2585,27 @@ See \`config.log' for more details." >&2;} fi fi fi -echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 +{ echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save -# Check the compiler produces executables we can run. If not, either +# Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. -echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 -echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 -echo "$as_me:$LINENO: result: $cross_compiling" >&5 -echo "${ECHO_T}$cross_compiling" >&6 - -echo "$as_me:$LINENO: checking for suffix of executables" >&5 -echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +{ echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 +echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; } +{ echo "$as_me:$LINENO: result: $cross_compiling" >&5 +echo "${ECHO_T}$cross_compiling" >&6; } + +{ echo "$as_me:$LINENO: checking for suffix of executables" >&5 +echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; } +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then @@ -2045,9 +2616,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - export ac_cv_exeext break;; * ) break;; esac @@ -2061,14 +2631,14 @@ See \`config.log' for more details." >&2;} fi rm -f conftest$ac_cv_exeext -echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 -echo "${ECHO_T}$ac_cv_exeext" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 +echo "${ECHO_T}$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT -echo "$as_me:$LINENO: checking for suffix of object files" >&5 -echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for suffix of object files" >&5 +echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; } if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -2088,14 +2658,20 @@ main () } _ACEOF rm -f conftest.o conftest.obj -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then - for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac @@ -2113,12 +2689,12 @@ fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 -echo "${ECHO_T}$ac_cv_objext" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 +echo "${ECHO_T}$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT -echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 -echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -2141,50 +2717,49 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_compiler_gnu=no + ac_compiler_gnu=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi -echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 -echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS -CFLAGS="-g" -echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 -echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 +echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -2200,38 +2775,118 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_prog_cc_g=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + CFLAGS="" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_prog_cc_g=no + fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then @@ -2247,12 +2902,12 @@ else CFLAGS= fi fi -echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 -echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 -if test "${ac_cv_prog_cc_stdc+set}" = set; then +{ echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 +echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } +if test "${ac_cv_prog_cc_c89+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_cv_prog_cc_stdc=no + ac_cv_prog_cc_c89=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -2286,12 +2941,17 @@ static char *f (char * (*g) (char **, int), char **p, ...) /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated - as 'x'. The following induces an error, until -std1 is added to get + as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something - that's true only with -std1. */ + that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; @@ -2306,205 +2966,57 @@ return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; return 0; } _ACEOF -# Don't try gcc -ansi; that turns off useful extensions and -# breaks some systems' header files. -# AIX -qlanglvl=ansi -# Ultrix and OSF/1 -std1 -# HP-UX 10.20 and later -Ae -# HP-UX older versions -Aa -D_HPUX_SOURCE -# SVR4 -Xc -D__EXTENSIONS__ -for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_prog_cc_stdc=$ac_arg -break + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_prog_cc_c89=$ac_arg else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest.err conftest.$ac_objext + +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break done -rm -f conftest.$ac_ext conftest.$ac_objext +rm -f conftest.$ac_ext CC=$ac_save_CC fi - -case "x$ac_cv_prog_cc_stdc" in - x|xno) - echo "$as_me:$LINENO: result: none needed" >&5 -echo "${ECHO_T}none needed" >&6 ;; +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { echo "$as_me:$LINENO: result: none needed" >&5 +echo "${ECHO_T}none needed" >&6; } ;; + xno) + { echo "$as_me:$LINENO: result: unsupported" >&5 +echo "${ECHO_T}unsupported" >&6; } ;; *) - echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 - CC="$CC $ac_cv_prog_cc_stdc" ;; + CC="$CC $ac_cv_prog_cc_c89" + { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; esac -# Some people use a C++ compiler to compile C. Since we use `exit', -# in C++ we need to declare it. In case someone uses the same compiler -# for both compiling C and C++ we need to have the C++ compiler decide -# the declaration of exit, since it's the most demanding environment. -cat >conftest.$ac_ext <<_ACEOF -#ifndef __cplusplus - choke me -#endif -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - for ac_declaration in \ - '' \ - 'extern "C" void std::exit (int) throw (); using std::exit;' \ - 'extern "C" void std::exit (int); using std::exit;' \ - 'extern "C" void exit (int) throw ();' \ - 'extern "C" void exit (int);' \ - 'void exit (int);' -do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_declaration -#include -int -main () -{ -exit (42); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -continue -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_declaration -int -main () -{ -exit (42); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -done -rm -f conftest* -if test -n "$ac_declaration"; then - echo '#ifdef __cplusplus' >>confdefs.h - echo $ac_declaration >>confdefs.h - echo '#endif' >>confdefs.h -fi - -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -2512,129 +3024,86 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu -echo "$as_me:$LINENO: checking for library containing strerror" >&5 -echo $ECHO_N "checking for library containing strerror... $ECHO_C" >&6 -if test "${ac_cv_search_strerror+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_func_search_save_LIBS=$LIBS -ac_cv_search_strerror=no -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char strerror (); -int -main () -{ -strerror (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_search_strerror="none required" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -if test "$ac_cv_search_strerror" = no; then - for ac_lib in cposix; do - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - cat >conftest.$ac_ext <<_ACEOF +{ echo "$as_me:$LINENO: checking for library containing strerror" >&5 +echo $ECHO_N "checking for library containing strerror... $ECHO_C" >&6; } +if test "${ac_cv_search_strerror+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_func_search_save_LIBS=$LIBS +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char strerror (); int main () { -strerror (); +return strerror (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +for ac_lib in '' cposix; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_search_strerror="-l$ac_lib" -break + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_search_strerror=$ac_res else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - done + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext + if test "${ac_cv_search_strerror+set}" = set; then + break +fi +done +if test "${ac_cv_search_strerror+set}" = set; then + : +else + ac_cv_search_strerror=no fi +rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_search_strerror" >&5 -echo "${ECHO_T}$ac_cv_search_strerror" >&6 -if test "$ac_cv_search_strerror" != no; then - test "$ac_cv_search_strerror" = "none required" || LIBS="$ac_cv_search_strerror $LIBS" +{ echo "$as_me:$LINENO: result: $ac_cv_search_strerror" >&5 +echo "${ECHO_T}$ac_cv_search_strerror" >&6; } +ac_res=$ac_cv_search_strerror +if test "$ac_res" != no; then + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi @@ -2658,8 +3127,8 @@ am__api_version="1.9" # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. -echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 -echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 +echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; } if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -2681,7 +3150,7 @@ case $as_dir/ in # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then + if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. @@ -2700,21 +3169,22 @@ case $as_dir/ in ;; esac done +IFS=$as_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 + # As a last resort, use the slow shell script. Don't cache a + # value 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. + # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi -echo "$as_me:$LINENO: result: $INSTALL" >&5 -echo "${ECHO_T}$INSTALL" >&6 +{ echo "$as_me:$LINENO: result: $INSTALL" >&5 +echo "${ECHO_T}$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. @@ -2724,8 +3194,8 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' -echo "$as_me:$LINENO: checking whether build environment is sane" >&5 -echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether build environment is sane" >&5 +echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6; } # Just in case sleep 1 echo timestamp > conftest.file @@ -2767,20 +3237,20 @@ echo "$as_me: error: newly created file is older than distributed files! Check your system clock" >&2;} { (exit 1); exit 1; }; } fi -echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 +{ echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } test "$program_prefix" != NONE && - program_transform_name="s,^,$program_prefix,;$program_transform_name" + 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" + program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. echo might interpret backslashes. # By default was `s,x,x', remove it if useless. cat <<\_ACEOF >conftest.sed s/[\\$]/&&/g;s/;s,x,x,$// _ACEOF program_transform_name=`echo $program_transform_name | sed -f conftest.sed` -rm conftest.sed +rm -f conftest.sed # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` @@ -2832,8 +3302,8 @@ for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_AWK+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -2846,54 +3316,57 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AWK="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then - echo "$as_me:$LINENO: result: $AWK" >&5 -echo "${ECHO_T}$AWK" >&6 + { echo "$as_me:$LINENO: result: $AWK" >&5 +echo "${ECHO_T}$AWK" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + test -n "$AWK" && break done -echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 -echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6 -set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'` -if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then +{ echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6; } +set x ${MAKE-make}; ac_make=`echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.make <<\_ACEOF +SHELL = /bin/sh all: - @echo 'ac_maketemp="$(MAKE)"' + @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. -eval `${MAKE-make} -f conftest.make 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 +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac rm -f conftest.make fi -if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } SET_MAKE= else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi @@ -2908,7 +3381,7 @@ rmdir .tst 2>/dev/null DEPDIR="${am__leading_dot}deps" - ac_config_commands="$ac_config_commands depfiles" +ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} @@ -2918,8 +3391,8 @@ am__doit: .PHONY: am__doit END # If we don't find an include directive, just comment out the code. -echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5 -echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5 +echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6; } am__include="#" am__quote= _am_result=none @@ -2946,15 +3419,15 @@ if test "$am__include" = "#"; then fi -echo "$as_me:$LINENO: result: $_am_result" >&5 -echo "${ECHO_T}$_am_result" >&6 +{ echo "$as_me:$LINENO: result: $_am_result" >&5 +echo "${ECHO_T}$_am_result" >&6; } rm -f confinc confmf -# Check whether --enable-dependency-tracking or --disable-dependency-tracking was given. +# Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then - enableval="$enable_dependency_tracking" + enableval=$enable_dependency_tracking; +fi -fi; if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' @@ -3029,8 +3502,8 @@ if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -3043,32 +3516,34 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then - echo "$as_me:$LINENO: result: $STRIP" >&5 -echo "${ECHO_T}$STRIP" >&6 + { echo "$as_me:$LINENO: result: $STRIP" >&5 +echo "${ECHO_T}$STRIP" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -3081,27 +3556,41 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_STRIP="strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS - test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":" fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then - echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 -echo "${ECHO_T}$ac_ct_STRIP" >&6 + { echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 +echo "${ECHO_T}$ac_ct_STRIP" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi - STRIP=$ac_ct_STRIP + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi else STRIP="$ac_cv_prog_STRIP" fi @@ -3122,8 +3611,8 @@ am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' depcc="$CC" am_compiler_list= -echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 -echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 +echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6; } if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -3212,8 +3701,8 @@ else fi fi -echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 -echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6 +{ echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 +echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type @@ -3239,8 +3728,8 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -3253,32 +3742,34 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -3291,36 +3782,51 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6 + { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi - CC=$ac_ct_CC + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -3333,74 +3839,34 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - -fi -if test -z "$ac_cv_prog_CC"; then - ac_ct_CC=$CC - # Extract the first word of "cc", so it can be a program name with args. -set dummy cc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="cc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6 + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi - CC=$ac_ct_CC -else - CC="$ac_cv_prog_CC" -fi + fi 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 "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -3414,7 +3880,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue @@ -3425,6 +3891,7 @@ do fi done done +IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. @@ -3442,22 +3909,23 @@ fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then - for ac_prog in cl + for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -3470,36 +3938,38 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC - for ac_prog in cl + for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -3512,29 +3982,45 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6 + { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + test -n "$ac_ct_CC" && break done - CC=$ac_ct_CC + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi fi fi @@ -3547,27 +4033,41 @@ See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. -echo "$as_me:$LINENO:" \ - "checking for C compiler version" >&5 +echo "$as_me:$LINENO: checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` -{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 - (eval $ac_compiler --version &5) 2>&5 +{ (ac_try="$ac_compiler --version >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } -{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 - (eval $ac_compiler -v &5) 2>&5 +{ (ac_try="$ac_compiler -v >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } -{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 - (eval $ac_compiler -V &5) 2>&5 +{ (ac_try="$ac_compiler -V >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } -echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 -echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -3590,50 +4090,49 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_compiler_gnu=no + ac_compiler_gnu=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi -echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 -echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS -CFLAGS="-g" -echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 -echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 +echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -3649,38 +4148,118 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_prog_cc_g=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + CFLAGS="" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_prog_cc_g=no + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag fi -echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then @@ -3696,12 +4275,12 @@ else CFLAGS= fi fi -echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 -echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 -if test "${ac_cv_prog_cc_stdc+set}" = set; then +{ echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 +echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } +if test "${ac_cv_prog_cc_c89+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_cv_prog_cc_stdc=no + ac_cv_prog_cc_c89=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -3735,12 +4314,17 @@ static char *f (char * (*g) (char **, int), char **p, ...) /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated - as 'x'. The following induces an error, until -std1 is added to get + as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something - that's true only with -std1. */ + that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; @@ -3755,205 +4339,57 @@ return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; return 0; } _ACEOF -# Don't try gcc -ansi; that turns off useful extensions and -# breaks some systems' header files. -# AIX -qlanglvl=ansi -# Ultrix and OSF/1 -std1 -# HP-UX 10.20 and later -Ae -# HP-UX older versions -Aa -D_HPUX_SOURCE -# SVR4 -Xc -D__EXTENSIONS__ -for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_prog_cc_stdc=$ac_arg -break + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_prog_cc_c89=$ac_arg else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -fi -rm -f conftest.err conftest.$ac_objext -done -rm -f conftest.$ac_ext conftest.$ac_objext -CC=$ac_save_CC fi -case "x$ac_cv_prog_cc_stdc" in - x|xno) - echo "$as_me:$LINENO: result: none needed" >&5 -echo "${ECHO_T}none needed" >&6 ;; - *) - echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 - CC="$CC $ac_cv_prog_cc_stdc" ;; -esac - -# Some people use a C++ compiler to compile C. Since we use `exit', -# in C++ we need to declare it. In case someone uses the same compiler -# for both compiling C and C++ we need to have the C++ compiler decide -# the declaration of exit, since it's the most demanding environment. -cat >conftest.$ac_ext <<_ACEOF -#ifndef __cplusplus - choke me -#endif -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - for ac_declaration in \ - '' \ - 'extern "C" void std::exit (int) throw (); using std::exit;' \ - 'extern "C" void std::exit (int); using std::exit;' \ - 'extern "C" void exit (int) throw ();' \ - 'extern "C" void exit (int);' \ - 'void exit (int);' -do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_declaration -#include -int -main () -{ -exit (42); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -continue -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_declaration -int -main () -{ -exit (42); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -done -rm -f conftest* -if test -n "$ac_declaration"; then - echo '#ifdef __cplusplus' >>confdefs.h - echo $ac_declaration >>confdefs.h - echo '#endif' >>confdefs.h -fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { echo "$as_me:$LINENO: result: none needed" >&5 +echo "${ECHO_T}none needed" >&6; } ;; + xno) + { echo "$as_me:$LINENO: result: unsupported" >&5 +echo "${ECHO_T}unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; +esac -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -3970,8 +4406,8 @@ _ACEOF if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. set dummy ${ac_tool_prefix}ar; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_AR+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -3984,32 +4420,34 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AR="${ac_tool_prefix}ar" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then - echo "$as_me:$LINENO: result: $AR" >&5 -echo "${ECHO_T}$AR" >&6 + { echo "$as_me:$LINENO: result: $AR" >&5 +echo "${ECHO_T}$AR" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + fi if test -z "$ac_cv_prog_AR"; then ac_ct_AR=$AR # Extract the first word of "ar", so it can be a program name with args. set dummy ar; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_AR+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -4022,26 +4460,41 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_AR="ar" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then - echo "$as_me:$LINENO: result: $ac_ct_AR" >&5 -echo "${ECHO_T}$ac_ct_AR" >&6 + { echo "$as_me:$LINENO: result: $ac_ct_AR" >&5 +echo "${ECHO_T}$ac_ct_AR" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi - AR=$ac_ct_AR + if test "x$ac_ct_AR" = x; then + AR="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + AR=$ac_ct_AR + fi else AR="$ac_cv_prog_AR" fi @@ -4049,8 +4502,8 @@ fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -4063,32 +4516,34 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then - echo "$as_me:$LINENO: result: $RANLIB" >&5 -echo "${ECHO_T}$RANLIB" >&6 + { echo "$as_me:$LINENO: result: $RANLIB" >&5 +echo "${ECHO_T}$RANLIB" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -4101,36 +4556,49 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_RANLIB="ranlib" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS - test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":" fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then - echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 -echo "${ECHO_T}$ac_ct_RANLIB" >&6 + { echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 +echo "${ECHO_T}$ac_ct_RANLIB" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi - RANLIB=$ac_ct_RANLIB + if test "x$ac_ct_RANLIB" = x; then + RANLIB=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + RANLIB=$ac_ct_RANLIB + fi else RANLIB="$ac_cv_prog_RANLIB" fi -# Check whether --enable-shared or --disable-shared was given. +# Check whether --enable-shared was given. if test "${enable_shared+set}" = set; then - enableval="$enable_shared" - p=${PACKAGE-default} + enableval=$enable_shared; p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; @@ -4149,7 +4617,8 @@ if test "${enable_shared+set}" = set; then esac else enable_shared=no -fi; +fi + @@ -4186,10 +4655,9 @@ enable_win32_dll=no -# Check whether --enable-static or --disable-static was given. +# Check whether --enable-static was given. if test "${enable_static+set}" = set; then - enableval="$enable_static" - p=${PACKAGE-default} + enableval=$enable_static; p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; @@ -4208,7 +4676,7 @@ if test "${enable_static+set}" = set; then esac else enable_static=yes -fi; +fi @@ -4218,13 +4686,14 @@ fi; -# Check whether --with-pic or --without-pic was given. + +# Check whether --with-pic was given. if test "${with_pic+set}" = set; then - withval="$with_pic" - pic_mode="$withval" + withval=$with_pic; pic_mode="$withval" else pic_mode=default -fi; +fi + test -z "$pic_mode" && pic_mode=default @@ -4234,10 +4703,9 @@ test -z "$pic_mode" && pic_mode=default -# Check whether --enable-fast-install or --disable-fast-install was given. +# Check whether --enable-fast-install was given. if test "${enable_fast_install+set}" = set; then - enableval="$enable_fast_install" - p=${PACKAGE-default} + enableval=$enable_fast_install; p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; @@ -4256,7 +4724,7 @@ if test "${enable_fast_install+set}" = set; then esac else enable_fast_install=yes -fi; +fi @@ -4265,64 +4733,90 @@ fi; -echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5 -echo $ECHO_N "checking for a sed that does not truncate output... $ECHO_C" >&6 -if test "${lt_cv_path_SED+set}" = set; then + +{ echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5 +echo $ECHO_N "checking for a sed that does not truncate output... $ECHO_C" >&6; } +if test "${ac_cv_path_SED+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ + for ac_i in 1 2 3 4 5 6 7; do + ac_script="$ac_script$as_nl$ac_script" + done + echo "$ac_script" | sed 99q >conftest.sed + $as_unset ac_script || ac_script= + # Extract the first word of "sed gsed" to use in msg output +if test -z "$SED"; then +set dummy sed gsed; ac_prog_name=$2 +if test "${ac_cv_path_SED+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - # Loop through the user's path and test for sed and gsed. -# Then use that list of sed's as ones to test for truncation. + ac_path_SED_found=false +# Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for lt_ac_prog in sed gsed; do - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then - lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" - fi - done - done -done -IFS=$as_save_IFS -lt_ac_max=0 -lt_ac_count=0 -# Add /usr/xpg4/bin/sed as it is typically found on Solaris -# along with /bin/sed that truncates output. -for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do - test ! -f $lt_ac_sed && continue - cat /dev/null > conftest.in - lt_ac_count=0 - echo $ECHO_N "0123456789$ECHO_C" >conftest.in - # Check for GNU sed and select it if it is found. - if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then - lt_cv_path_SED=$lt_ac_sed - break - fi - while true; do - cat conftest.in conftest.in >conftest.tmp - mv conftest.tmp conftest.in - cp conftest.in conftest.nl - echo >>conftest.nl - $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break - cmp -s conftest.out conftest.nl || break - # 10000 chars as input seems more than enough - test $lt_ac_count -gt 10 && break - lt_ac_count=`expr $lt_ac_count + 1` - if test $lt_ac_count -gt $lt_ac_max; then - lt_ac_max=$lt_ac_count - lt_cv_path_SED=$lt_ac_sed + for ac_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue + # Check for GNU ac_path_SED and select it if it is found. + # Check for GNU $ac_path_SED +case `"$ac_path_SED" --version 2>&1` in +*GNU*) + ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; +*) + ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + echo '' >> "conftest.nl" + "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + ac_count=`expr $ac_count + 1` + if test $ac_count -gt ${ac_path_SED_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_SED="$ac_path_SED" + ac_path_SED_max=$ac_count fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + + $ac_path_SED_found && break 3 done done +done +IFS=$as_save_IFS + + +fi + +SED="$ac_cv_path_SED" +if test -z "$SED"; then + { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in \$PATH" >&5 +echo "$as_me: error: no acceptable $ac_prog_name could be found in \$PATH" >&2;} + { (exit 1); exit 1; }; } fi -SED=$lt_cv_path_SED +else + ac_cv_path_SED=$SED +fi -echo "$as_me:$LINENO: result: $SED" >&5 -echo "${ECHO_T}$SED" >&6 +fi +{ echo "$as_me:$LINENO: result: $ac_cv_path_SED" >&5 +echo "${ECHO_T}$ac_cv_path_SED" >&6; } + SED="$ac_cv_path_SED" + rm -f conftest.sed test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" @@ -4337,34 +4831,249 @@ Xsed="$SED -e 1s/^X//" -echo "$as_me:$LINENO: checking for egrep" >&5 -echo $ECHO_N "checking for egrep... $ECHO_C" >&6 -if test "${ac_cv_prog_egrep+set}" = set; then +{ echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 +echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; } +if test "${ac_cv_path_GREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # Extract the first word of "grep ggrep" to use in msg output +if test -z "$GREP"; then +set dummy grep ggrep; ac_prog_name=$2 +if test "${ac_cv_path_GREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_path_GREP_found=false +# Loop through the user's path and test for each of PROGNAME-LIST +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in grep ggrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue + # Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + echo 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + ac_count=`expr $ac_count + 1` + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + + $ac_path_GREP_found && break 3 + done +done + +done +IFS=$as_save_IFS + + +fi + +GREP="$ac_cv_path_GREP" +if test -z "$GREP"; then + { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} + { (exit 1); exit 1; }; } +fi + +else + ac_cv_path_GREP=$GREP +fi + + +fi +{ echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 +echo "${ECHO_T}$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ echo "$as_me:$LINENO: checking for egrep" >&5 +echo $ECHO_N "checking for egrep... $ECHO_C" >&6; } +if test "${ac_cv_path_EGREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + # Extract the first word of "egrep" to use in msg output +if test -z "$EGREP"; then +set dummy egrep; ac_prog_name=$2 +if test "${ac_cv_path_EGREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if echo a | (grep -E '(a|b)') >/dev/null 2>&1 - then ac_cv_prog_egrep='grep -E' - else ac_cv_prog_egrep='egrep' + ac_path_EGREP_found=false +# Loop through the user's path and test for each of PROGNAME-LIST +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue + # Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + echo 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + ac_count=`expr $ac_count + 1` + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + + $ac_path_EGREP_found && break 3 + done +done + +done +IFS=$as_save_IFS + + +fi + +EGREP="$ac_cv_path_EGREP" +if test -z "$EGREP"; then + { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} + { (exit 1); exit 1; }; } +fi + +else + ac_cv_path_EGREP=$EGREP +fi + + + fi fi -echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 -echo "${ECHO_T}$ac_cv_prog_egrep" >&6 - EGREP=$ac_cv_prog_egrep +{ echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 +echo "${ECHO_T}$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" -echo "$as_me:$LINENO: checking for fgrep" >&5 -echo $ECHO_N "checking for fgrep... $ECHO_C" >&6 -if test "${ac_cv_prog_fgrep+set}" = set; then +{ echo "$as_me:$LINENO: checking for fgrep" >&5 +echo $ECHO_N "checking for fgrep... $ECHO_C" >&6; } +if test "${ac_cv_path_FGREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 + then ac_cv_path_FGREP="$GREP -F" + else + # Extract the first word of "fgrep" to use in msg output +if test -z "$FGREP"; then +set dummy fgrep; ac_prog_name=$2 +if test "${ac_cv_path_FGREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if echo 'ab*c' | (grep -F 'ab*c') >/dev/null 2>&1 - then ac_cv_prog_fgrep='grep -F' - else ac_cv_prog_fgrep='fgrep' + ac_path_FGREP_found=false +# Loop through the user's path and test for each of PROGNAME-LIST +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in fgrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_FGREP" && $as_test_x "$ac_path_FGREP"; } || continue + # Check for GNU ac_path_FGREP and select it if it is found. + # Check for GNU $ac_path_FGREP +case `"$ac_path_FGREP" --version 2>&1` in +*GNU*) + ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; +*) + ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + echo 'FGREP' >> "conftest.nl" + "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + ac_count=`expr $ac_count + 1` + if test $ac_count -gt ${ac_path_FGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_FGREP="$ac_path_FGREP" + ac_path_FGREP_max=$ac_count fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + + $ac_path_FGREP_found && break 3 + done +done + +done +IFS=$as_save_IFS + + +fi + +FGREP="$ac_cv_path_FGREP" +if test -z "$FGREP"; then + { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} + { (exit 1); exit 1; }; } fi -echo "$as_me:$LINENO: result: $ac_cv_prog_fgrep" >&5 -echo "${ECHO_T}$ac_cv_prog_fgrep" >&6 - FGREP=$ac_cv_prog_fgrep + +else + ac_cv_path_FGREP=$FGREP +fi + + + fi +fi +{ echo "$as_me:$LINENO: result: $ac_cv_path_FGREP" >&5 +echo "${ECHO_T}$ac_cv_path_FGREP" >&6; } + FGREP="$ac_cv_path_FGREP" test -z "$GREP" && GREP=grep @@ -4387,18 +5096,18 @@ test -z "$GREP" && GREP=grep -# Check whether --with-gnu-ld or --without-gnu-ld was given. +# Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then - withval="$with_gnu_ld" - test "$withval" = no || with_gnu_ld=yes + withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no -fi; +fi + ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. - echo "$as_me:$LINENO: checking for ld used by $CC" >&5 -echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for ld used by $CC" >&5 +echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw @@ -4427,11 +5136,11 @@ echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6 ;; esac elif test "$with_gnu_ld" = yes; then - echo "$as_me:$LINENO: checking for GNU ld" >&5 -echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for GNU ld" >&5 +echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6; } else - echo "$as_me:$LINENO: checking for non-GNU ld" >&5 -echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for non-GNU ld" >&5 +echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6; } fi if test "${lt_cv_path_LD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -4464,17 +5173,17 @@ fi LD="$lt_cv_path_LD" if test -n "$LD"; then - echo "$as_me:$LINENO: result: $LD" >&5 -echo "${ECHO_T}$LD" >&6 + { echo "$as_me:$LINENO: result: $LD" >&5 +echo "${ECHO_T}$LD" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} { (exit 1); exit 1; }; } -echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 -echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 +echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6; } if test "${lt_cv_prog_gnu_ld+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -4488,8 +5197,8 @@ case `$LD -v 2>&1 &5 -echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6 +{ echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5 +echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld @@ -4501,8 +5210,8 @@ with_gnu_ld=$lt_cv_prog_gnu_ld -echo "$as_me:$LINENO: checking for BSD- or MS-compatible name lister (nm)" >&5 -echo $ECHO_N "checking for BSD- or MS-compatible name lister (nm)... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for BSD- or MS-compatible name lister (nm)" >&5 +echo $ECHO_N "checking for BSD- or MS-compatible name lister (nm)... $ECHO_C" >&6; } if test "${lt_cv_path_NM+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -4550,8 +5259,8 @@ else : ${lt_cv_path_NM=no} fi fi -echo "$as_me:$LINENO: result: $lt_cv_path_NM" >&5 -echo "${ECHO_T}$lt_cv_path_NM" >&6 +{ echo "$as_me:$LINENO: result: $lt_cv_path_NM" >&5 +echo "${ECHO_T}$lt_cv_path_NM" >&6; } if test "$lt_cv_path_NM" != "no"; then NM="$lt_cv_path_NM" else @@ -4561,8 +5270,8 @@ else do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_DUMPBIN+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -4575,25 +5284,27 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi DUMPBIN=$ac_cv_prog_DUMPBIN if test -n "$DUMPBIN"; then - echo "$as_me:$LINENO: result: $DUMPBIN" >&5 -echo "${ECHO_T}$DUMPBIN" >&6 + { echo "$as_me:$LINENO: result: $DUMPBIN" >&5 +echo "${ECHO_T}$DUMPBIN" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + test -n "$DUMPBIN" && break done fi @@ -4603,8 +5314,8 @@ if test -z "$DUMPBIN"; then do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_DUMPBIN+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -4617,30 +5328,45 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN if test -n "$ac_ct_DUMPBIN"; then - echo "$as_me:$LINENO: result: $ac_ct_DUMPBIN" >&5 -echo "${ECHO_T}$ac_ct_DUMPBIN" >&6 + { echo "$as_me:$LINENO: result: $ac_ct_DUMPBIN" >&5 +echo "${ECHO_T}$ac_ct_DUMPBIN" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + test -n "$ac_ct_DUMPBIN" && break done -test -n "$ac_ct_DUMPBIN" || ac_ct_DUMPBIN=":" - DUMPBIN=$ac_ct_DUMPBIN + if test "x$ac_ct_DUMPBIN" = x; then + DUMPBIN=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + DUMPBIN=$ac_ct_DUMPBIN + fi fi @@ -4655,43 +5381,43 @@ test -z "$NM" && NM=nm -echo "$as_me:$LINENO: checking the name lister ($NM) interface" >&5 -echo $ECHO_N "checking the name lister ($NM) interface... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking the name lister ($NM) interface" >&5 +echo $ECHO_N "checking the name lister ($NM) interface... $ECHO_C" >&6; } if test "${lt_cv_nm_interface+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext - (eval echo "\"\$as_me:4665: $ac_compile\"" >&5) + (eval echo "\"\$as_me:5391: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 - (eval echo "\"\$as_me:4668: $NM \\\"conftest.$ac_objext\\\"\"" >&5) + (eval echo "\"\$as_me:5394: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 - (eval echo "\"\$as_me:4671: output\"" >&5) + (eval echo "\"\$as_me:5397: output\"" >&5) cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest* fi -echo "$as_me:$LINENO: result: $lt_cv_nm_interface" >&5 -echo "${ECHO_T}$lt_cv_nm_interface" >&6 +{ echo "$as_me:$LINENO: result: $lt_cv_nm_interface" >&5 +echo "${ECHO_T}$lt_cv_nm_interface" >&6; } -echo "$as_me:$LINENO: checking whether ln -s works" >&5 -echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether ln -s works" >&5 +echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } else - echo "$as_me:$LINENO: result: no, using $LN_S" >&5 -echo "${ECHO_T}no, using $LN_S" >&6 + { echo "$as_me:$LINENO: result: no, using $LN_S" >&5 +echo "${ECHO_T}no, using $LN_S" >&6; } fi # find the maximum length of command line arguments -echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5 -echo $ECHO_N "checking the maximum length of command line arguments... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5 +echo $ECHO_N "checking the maximum length of command line arguments... $ECHO_C" >&6; } if test "${lt_cv_sys_max_cmd_len+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -4810,11 +5536,11 @@ else fi if test -n $lt_cv_sys_max_cmd_len ; then - echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5 -echo "${ECHO_T}$lt_cv_sys_max_cmd_len" >&6 + { echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5 +echo "${ECHO_T}$lt_cv_sys_max_cmd_len" >&6; } else - echo "$as_me:$LINENO: result: none" >&5 -echo "${ECHO_T}none" >&6 + { echo "$as_me:$LINENO: result: none" >&5 +echo "${ECHO_T}none" >&6; } fi max_cmd_len=$lt_cv_sys_max_cmd_len @@ -4828,26 +5554,26 @@ max_cmd_len=$lt_cv_sys_max_cmd_len : ${MV="mv -f"} : ${RM="rm -f"} -echo "$as_me:$LINENO: checking whether the shell understands some XSI constructs" >&5 -echo $ECHO_N "checking whether the shell understands some XSI constructs... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether the shell understands some XSI constructs" >&5 +echo $ECHO_N "checking whether the shell understands some XSI constructs... $ECHO_C" >&6; } # Try some XSI features xsi_shell=no ( _lt_dummy="a/b/c" test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \ = c,a/b,, ) >/dev/null 2>&1 \ && xsi_shell=yes -echo "$as_me:$LINENO: result: $xsi_shell" >&5 -echo "${ECHO_T}$xsi_shell" >&6 +{ echo "$as_me:$LINENO: result: $xsi_shell" >&5 +echo "${ECHO_T}$xsi_shell" >&6; } -echo "$as_me:$LINENO: checking whether the shell understands \"+=\"" >&5 -echo $ECHO_N "checking whether the shell understands \"+=\"... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether the shell understands \"+=\"" >&5 +echo $ECHO_N "checking whether the shell understands \"+=\"... $ECHO_C" >&6; } lt_shell_append=no ( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \ >/dev/null 2>&1 \ && lt_shell_append=yes -echo "$as_me:$LINENO: result: $lt_shell_append" >&5 -echo "${ECHO_T}$lt_shell_append" >&6 +{ echo "$as_me:$LINENO: result: $lt_shell_append" >&5 +echo "${ECHO_T}$lt_shell_append" >&6; } if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then @@ -4881,15 +5607,15 @@ esac -echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5 -echo $ECHO_N "checking for $LD option to reload object files... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5 +echo $ECHO_N "checking for $LD option to reload object files... $ECHO_C" >&6; } if test "${lt_cv_ld_reload_flag+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_ld_reload_flag='-r' fi -echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5 -echo "${ECHO_T}$lt_cv_ld_reload_flag" >&6 +{ echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5 +echo "${ECHO_T}$lt_cv_ld_reload_flag" >&6; } reload_flag=$lt_cv_ld_reload_flag case $reload_flag in "" | " "*) ;; @@ -4915,8 +5641,8 @@ esac -echo "$as_me:$LINENO: checking how to recognize dependent libraries" >&5 -echo $ECHO_N "checking how to recognize dependent libraries... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking how to recognize dependent libraries" >&5 +echo $ECHO_N "checking how to recognize dependent libraries... $ECHO_C" >&6; } if test "${lt_cv_deplibs_check_method+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -4935,7 +5661,7 @@ lt_cv_deplibs_check_method='unknown' # whether `pass_all' will *always* work, you probably want this one. case $host_os in -aix4* | aix5*) +aix[4-9]*) lt_cv_deplibs_check_method=pass_all ;; @@ -5105,8 +5831,8 @@ tpf*) esac fi -echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5 -echo "${ECHO_T}$lt_cv_deplibs_check_method" >&6 +{ echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5 +echo "${ECHO_T}$lt_cv_deplibs_check_method" >&6; } file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown @@ -5125,8 +5851,8 @@ test -z "$deplibs_check_method" && deplibs_check_method=unknown if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. set dummy ${ac_tool_prefix}ar; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_AR+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -5139,32 +5865,34 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AR="${ac_tool_prefix}ar" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then - echo "$as_me:$LINENO: result: $AR" >&5 -echo "${ECHO_T}$AR" >&6 + { echo "$as_me:$LINENO: result: $AR" >&5 +echo "${ECHO_T}$AR" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + fi if test -z "$ac_cv_prog_AR"; then ac_ct_AR=$AR # Extract the first word of "ar", so it can be a program name with args. set dummy ar; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_AR+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -5177,27 +5905,41 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_AR="ar" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS - test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="false" fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then - echo "$as_me:$LINENO: result: $ac_ct_AR" >&5 -echo "${ECHO_T}$ac_ct_AR" >&6 + { echo "$as_me:$LINENO: result: $ac_ct_AR" >&5 +echo "${ECHO_T}$ac_ct_AR" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi - AR=$ac_ct_AR + if test "x$ac_ct_AR" = x; then + AR="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + AR=$ac_ct_AR + fi else AR="$ac_cv_prog_AR" fi @@ -5218,8 +5960,8 @@ test -z "$AR_FLAGS" && AR_FLAGS=cru if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -5232,32 +5974,34 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then - echo "$as_me:$LINENO: result: $STRIP" >&5 -echo "${ECHO_T}$STRIP" >&6 + { echo "$as_me:$LINENO: result: $STRIP" >&5 +echo "${ECHO_T}$STRIP" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -5270,27 +6014,41 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_STRIP="strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS - test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":" fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then - echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 -echo "${ECHO_T}$ac_ct_STRIP" >&6 + { echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 +echo "${ECHO_T}$ac_ct_STRIP" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi - STRIP=$ac_ct_STRIP + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi else STRIP="$ac_cv_prog_STRIP" fi @@ -5305,8 +6063,8 @@ test -z "$STRIP" && STRIP=: if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -5319,32 +6077,34 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then - echo "$as_me:$LINENO: result: $RANLIB" >&5 -echo "${ECHO_T}$RANLIB" >&6 + { echo "$as_me:$LINENO: result: $RANLIB" >&5 +echo "${ECHO_T}$RANLIB" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -5357,27 +6117,41 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_RANLIB="ranlib" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS - test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":" fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then - echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 -echo "${ECHO_T}$ac_ct_RANLIB" >&6 + { echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 +echo "${ECHO_T}$ac_ct_RANLIB" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi - RANLIB=$ac_ct_RANLIB + if test "x$ac_ct_RANLIB" = x; then + RANLIB=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + RANLIB=$ac_ct_RANLIB + fi else RANLIB="$ac_cv_prog_RANLIB" fi @@ -5450,8 +6224,8 @@ compiler=$CC # Check for command to grab the raw symbol name followed by C symbol from nm. -echo "$as_me:$LINENO: checking command to parse $NM output from $compiler object" >&5 -echo $ECHO_N "checking command to parse $NM output from $compiler object... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking command to parse $NM output from $compiler object" >&5 +echo $ECHO_N "checking command to parse $NM output from $compiler object... $ECHO_C" >&6; } if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -5669,11 +6443,11 @@ if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then - echo "$as_me:$LINENO: result: failed" >&5 -echo "${ECHO_T}failed" >&6 + { echo "$as_me:$LINENO: result: failed" >&5 +echo "${ECHO_T}failed" >&6; } else - echo "$as_me:$LINENO: result: ok" >&5 -echo "${ECHO_T}ok" >&6 + { echo "$as_me:$LINENO: result: ok" >&5 +echo "${ECHO_T}ok" >&6; } fi @@ -5692,11 +6466,11 @@ fi -# Check whether --enable-libtool-lock or --disable-libtool-lock was given. +# Check whether --enable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then - enableval="$enable_libtool_lock" + enableval=$enable_libtool_lock; +fi -fi; test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good @@ -5723,7 +6497,7 @@ ia64-*-hpux*) ;; *-*-irix6*) # Find out which ABI we are using. - echo '#line 5726 "configure"' > conftest.$ac_ext + echo '#line 6500 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -5815,8 +6589,8 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" - echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5 -echo $ECHO_N "checking whether the C compiler needs -belf... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5 +echo $ECHO_N "checking whether the C compiler needs -belf... $ECHO_C" >&6; } if test "${lt_cv_cc_needs_belf+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -5842,35 +6616,32 @@ main () } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then lt_cv_cc_needs_belf=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -lt_cv_cc_needs_belf=no + lt_cv_cc_needs_belf=no fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' @@ -5879,8 +6650,8 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu fi -echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5 -echo "${ECHO_T}$lt_cv_cc_needs_belf" >&6 +{ echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5 +echo "${ECHO_T}$lt_cv_cc_needs_belf" >&6; } if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" @@ -5914,8 +6685,8 @@ ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 -echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 +echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -5949,24 +6720,22 @@ cat >>conftest.$ac_ext <<_ACEOF #endif Syntax error _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then : else echo "$as_me: failed program was:" >&5 @@ -5975,9 +6744,10 @@ sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi + rm -f conftest.err conftest.$ac_ext - # OK, works on sane cases. Now check whether non-existent headers + # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -5987,24 +6757,22 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then # Broken: success on invalid input. continue else @@ -6015,6 +6783,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_preproc_ok=: break fi + rm -f conftest.err conftest.$ac_ext done @@ -6032,8 +6801,8 @@ fi else ac_cv_prog_CPP=$CPP fi -echo "$as_me:$LINENO: result: $CPP" >&5 -echo "${ECHO_T}$CPP" >&6 +{ echo "$as_me:$LINENO: result: $CPP" >&5 +echo "${ECHO_T}$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do @@ -6056,24 +6825,22 @@ cat >>conftest.$ac_ext <<_ACEOF #endif Syntax error _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then : else echo "$as_me: failed program was:" >&5 @@ -6082,9 +6849,10 @@ sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi + rm -f conftest.err conftest.$ac_ext - # OK, works on sane cases. Now check whether non-existent headers + # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -6094,24 +6862,22 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then # Broken: success on invalid input. continue else @@ -6122,6 +6888,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_preproc_ok=: break fi + rm -f conftest.err conftest.$ac_ext done @@ -6144,8 +6911,8 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu -echo "$as_me:$LINENO: checking for ANSI C header files" >&5 -echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5 +echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; } if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -6169,35 +6936,31 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_header_stdc=no + ac_cv_header_stdc=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. @@ -6253,6 +7016,7 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include +#include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) @@ -6272,18 +7036,27 @@ main () for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) - exit(2); - exit (0); + return 2; + return 0; } _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -6296,12 +7069,14 @@ sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi + + fi fi -echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 -echo "${ECHO_T}$ac_cv_header_stdc" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 +echo "${ECHO_T}$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF @@ -6324,9 +7099,9 @@ for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -6340,38 +7115,35 @@ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_Header=no" + eval "$as_ac_Header=no" fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 @@ -6386,9 +7158,9 @@ done for ac_header in dlfcn.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -6402,38 +7174,35 @@ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_Header=no" + eval "$as_ac_Header=no" fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 @@ -6494,8 +7263,8 @@ if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi -echo "$as_me:$LINENO: checking for objdir" >&5 -echo $ECHO_N "checking for objdir... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for objdir" >&5 +echo $ECHO_N "checking for objdir... $ECHO_C" >&6; } if test "${lt_cv_objdir+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -6509,8 +7278,8 @@ else fi rmdir .libs 2>/dev/null fi -echo "$as_me:$LINENO: result: $lt_cv_objdir" >&5 -echo "${ECHO_T}$lt_cv_objdir" >&6 +{ echo "$as_me:$LINENO: result: $lt_cv_objdir" >&5 +echo "${ECHO_T}$lt_cv_objdir" >&6; } objdir=$lt_cv_objdir @@ -6602,8 +7371,8 @@ test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then - echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5 -echo $ECHO_N "checking for ${ac_tool_prefix}file... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5 +echo $ECHO_N "checking for ${ac_tool_prefix}file... $ECHO_C" >&6; } if test "${lt_cv_path_MAGIC_CMD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -6655,11 +7424,11 @@ fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then - echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 -echo "${ECHO_T}$MAGIC_CMD" >&6 + { echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 +echo "${ECHO_T}$MAGIC_CMD" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi @@ -6668,8 +7437,8 @@ fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then - echo "$as_me:$LINENO: checking for file" >&5 -echo $ECHO_N "checking for file... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for file" >&5 +echo $ECHO_N "checking for file... $ECHO_C" >&6; } if test "${lt_cv_path_MAGIC_CMD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -6721,11 +7490,11 @@ fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then - echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 -echo "${ECHO_T}$MAGIC_CMD" >&6 + { echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 +echo "${ECHO_T}$MAGIC_CMD" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi @@ -6805,8 +7574,8 @@ lt_prog_compiler_no_builtin_flag= if test "$GCC" = yes; then lt_prog_compiler_no_builtin_flag=' -fno-builtin' - echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 -echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 +echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6; } if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -6823,11 +7592,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:6826: $lt_compile\"" >&5) + (eval echo "\"\$as_me:7595: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:6830: \$? = $ac_status" >&5 + echo "$as_me:7599: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -6840,8 +7609,8 @@ else $RM conftest* fi -echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 -echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6 +{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6; } if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" @@ -6860,8 +7629,8 @@ fi lt_prog_compiler_pic= lt_prog_compiler_static= -echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 -echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 +echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; } if test "$GCC" = yes; then lt_prog_compiler_wl='-Wl,' @@ -7115,8 +7884,8 @@ case $host_os in lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" ;; esac -echo "$as_me:$LINENO: result: $lt_prog_compiler_pic" >&5 -echo "${ECHO_T}$lt_prog_compiler_pic" >&6 +{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic" >&6; } @@ -7127,8 +7896,8 @@ echo "${ECHO_T}$lt_prog_compiler_pic" >&6 # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic"; then - echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 -echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic works... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 +echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic works... $ECHO_C" >&6; } if test "${lt_prog_compiler_pic_works+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -7145,11 +7914,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:7148: $lt_compile\"" >&5) + (eval echo "\"\$as_me:7917: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:7152: \$? = $ac_status" >&5 + echo "$as_me:7921: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -7162,8 +7931,8 @@ else $RM conftest* fi -echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works" >&5 -echo "${ECHO_T}$lt_prog_compiler_pic_works" >&6 +{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic_works" >&6; } if test x"$lt_prog_compiler_pic_works" = xyes; then case $lt_prog_compiler_pic in @@ -7186,8 +7955,8 @@ fi # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" -echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 -echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; } if test "${lt_prog_compiler_static_works+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -7214,8 +7983,8 @@ else LDFLAGS="$save_LDFLAGS" fi -echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works" >&5 -echo "${ECHO_T}$lt_prog_compiler_static_works" >&6 +{ echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works" >&5 +echo "${ECHO_T}$lt_prog_compiler_static_works" >&6; } if test x"$lt_prog_compiler_static_works" = xyes; then : @@ -7229,8 +7998,8 @@ fi - echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 -echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 +echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; } if test "${lt_cv_prog_compiler_c_o+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -7250,11 +8019,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:7253: $lt_compile\"" >&5) + (eval echo "\"\$as_me:8022: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:7257: \$? = $ac_status" >&5 + echo "$as_me:8026: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -7276,16 +8045,16 @@ else $RM conftest* fi -echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5 -echo "${ECHO_T}$lt_cv_prog_compiler_c_o" >&6 +{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_c_o" >&6; } - echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 -echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 +echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; } if test "${lt_cv_prog_compiler_c_o+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -7305,11 +8074,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:7308: $lt_compile\"" >&5) + (eval echo "\"\$as_me:8077: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:7312: \$? = $ac_status" >&5 + echo "$as_me:8081: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -7331,8 +8100,8 @@ else $RM conftest* fi -echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5 -echo "${ECHO_T}$lt_cv_prog_compiler_c_o" >&6 +{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_c_o" >&6; } @@ -7340,16 +8109,16 @@ echo "${ECHO_T}$lt_cv_prog_compiler_c_o" >&6 hard_links="nottested" if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user - echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 -echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 +echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; } hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no - echo "$as_me:$LINENO: result: $hard_links" >&5 -echo "${ECHO_T}$hard_links" >&6 + { echo "$as_me:$LINENO: result: $hard_links" >&5 +echo "${ECHO_T}$hard_links" >&6; } if test "$hard_links" = no; then { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} @@ -7364,8 +8133,8 @@ fi - echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 -echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; } runpath_var= allow_undefined_flag= @@ -7453,7 +8222,7 @@ echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared librar # See if GNU ld supports shared libraries. case $host_os in - aix3* | aix4* | aix5*) + aix[3-9]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs=no @@ -7687,7 +8456,7 @@ _LT_EOF fi ;; - aix4* | aix5*) + aix[4-9]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. @@ -7707,7 +8476,7 @@ _LT_EOF # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. - case $host_os in aix4.[23]|aix4.[23].*|aix5*) + case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes @@ -7800,27 +8569,23 @@ main () } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then lt_aix_libpath_sed=' /Import File Strings/,/^$/ { @@ -7838,8 +8603,10 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi @@ -7869,27 +8636,23 @@ main () } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then lt_aix_libpath_sed=' /Import File Strings/,/^$/ { @@ -7907,8 +8670,10 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi @@ -8163,35 +8928,33 @@ fi int foo(void) {} _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LDFLAGS="$save_LDFLAGS" else @@ -8444,8 +9207,8 @@ rm -f conftest.err conftest.$ac_objext \ fi fi -echo "$as_me:$LINENO: result: $ld_shlibs" >&5 -echo "${ECHO_T}$ld_shlibs" >&6 +{ echo "$as_me:$LINENO: result: $ld_shlibs" >&5 +echo "${ECHO_T}$ld_shlibs" >&6; } test "$ld_shlibs" = no && can_build_shared=no with_gnu_ld=$with_gnu_ld @@ -8481,8 +9244,8 @@ x|xyes) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. - echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 -echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 +echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; } $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext @@ -8519,8 +9282,8 @@ echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >& cat conftest.err 1>&5 fi $RM conftest* - echo "$as_me:$LINENO: result: $archive_cmds_need_lc" >&5 -echo "${ECHO_T}$archive_cmds_need_lc" >&6 + { echo "$as_me:$LINENO: result: $archive_cmds_need_lc" >&5 +echo "${ECHO_T}$archive_cmds_need_lc" >&6; } ;; esac fi @@ -8683,8 +9446,8 @@ esac - echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 -echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 +echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; } withGCC=$GCC if test "$withGCC" = yes; then case $host_os in @@ -8767,7 +9530,7 @@ aix3*) soname_spec='${libname}${release}${shared_ext}$major' ;; -aix4* | aix5*) +aix[4-9]*) version_type=linux need_lib_prefix=no need_version=no @@ -9116,27 +9879,23 @@ main () } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir"; then shlibpath_overrides_runpath=yes fi @@ -9145,8 +9904,10 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir @@ -9359,8 +10120,8 @@ uts4*) dynamic_linker=no ;; esac -echo "$as_me:$LINENO: result: $dynamic_linker" >&5 -echo "${ECHO_T}$dynamic_linker" >&6 +{ echo "$as_me:$LINENO: result: $dynamic_linker" >&5 +echo "${ECHO_T}$dynamic_linker" >&6; } test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" @@ -9454,8 +10215,8 @@ fi - echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 -echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 +echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; } hardcode_action= if test -n "$hardcode_libdir_flag_spec" || test -n "$runpath_var" || @@ -9479,8 +10240,8 @@ else # directories. hardcode_action=unsupported fi -echo "$as_me:$LINENO: result: $hardcode_action" >&5 -echo "${ECHO_T}$hardcode_action" >&6 +{ echo "$as_me:$LINENO: result: $hardcode_action" >&5 +echo "${ECHO_T}$hardcode_action" >&6; } if test "$hardcode_action" = relink || test "$inherit_rpath" = yes; then @@ -9524,8 +10285,8 @@ else darwin*) # if libdl is installed we need to link against it - echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 -echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 +echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; } if test "${ac_cv_lib_dl_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -9538,56 +10299,53 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char dlopen (); int main () { -dlopen (); +return dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_lib_dl_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_dl_dlopen=no + ac_cv_lib_dl_dlopen=no fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 -echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 +echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; } if test $ac_cv_lib_dl_dlopen = yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else @@ -9601,8 +10359,8 @@ fi ;; *) - echo "$as_me:$LINENO: checking for shl_load" >&5 -echo $ECHO_N "checking for shl_load... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for shl_load" >&5 +echo $ECHO_N "checking for shl_load... $ECHO_C" >&6; } if test "${ac_cv_func_shl_load+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -9629,73 +10387,64 @@ cat >>conftest.$ac_ext <<_ACEOF #undef shl_load -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" -{ #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char shl_load (); /* 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_shl_load) || defined (__stub___shl_load) +#if defined __stub_shl_load || defined __stub___shl_load choke me -#else -char (*f) () = shl_load; -#endif -#ifdef __cplusplus -} #endif int main () { -return f != shl_load; +return shl_load (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_func_shl_load=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_func_shl_load=no + ac_cv_func_shl_load=no fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5 -echo "${ECHO_T}$ac_cv_func_shl_load" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5 +echo "${ECHO_T}$ac_cv_func_shl_load" >&6; } if test $ac_cv_func_shl_load = yes; then lt_cv_dlopen="shl_load" else - echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 -echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 +echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6; } if test "${ac_cv_lib_dld_shl_load+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -9708,61 +10457,58 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char shl_load (); int main () { -shl_load (); +return shl_load (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_lib_dld_shl_load=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_dld_shl_load=no + ac_cv_lib_dld_shl_load=no fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 -echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 +echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6; } if test $ac_cv_lib_dld_shl_load = yes; then lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld" else - echo "$as_me:$LINENO: checking for dlopen" >&5 -echo $ECHO_N "checking for dlopen... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for dlopen" >&5 +echo $ECHO_N "checking for dlopen... $ECHO_C" >&6; } if test "${ac_cv_func_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -9789,73 +10535,64 @@ cat >>conftest.$ac_ext <<_ACEOF #undef dlopen -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" -{ #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char dlopen (); /* 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_dlopen) || defined (__stub___dlopen) +#if defined __stub_dlopen || defined __stub___dlopen choke me -#else -char (*f) () = dlopen; -#endif -#ifdef __cplusplus -} #endif int main () { -return f != dlopen; +return dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_func_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_func_dlopen=no + ac_cv_func_dlopen=no fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5 -echo "${ECHO_T}$ac_cv_func_dlopen" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5 +echo "${ECHO_T}$ac_cv_func_dlopen" >&6; } if test $ac_cv_func_dlopen = yes; then lt_cv_dlopen="dlopen" else - echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 -echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 +echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; } if test "${ac_cv_lib_dl_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -9868,61 +10605,58 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char dlopen (); int main () { -dlopen (); +return dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_lib_dl_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_dl_dlopen=no + ac_cv_lib_dl_dlopen=no fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 -echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 +echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; } if test $ac_cv_lib_dl_dlopen = yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else - echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5 -echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5 +echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6; } if test "${ac_cv_lib_svld_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -9935,61 +10669,58 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char dlopen (); int main () { -dlopen (); +return dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_lib_svld_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_svld_dlopen=no + ac_cv_lib_svld_dlopen=no fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5 -echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5 +echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6; } if test $ac_cv_lib_svld_dlopen = yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" else - echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5 -echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5 +echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6; } if test "${ac_cv_lib_dld_dld_link+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -10002,56 +10733,53 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char dld_link (); int main () { -dld_link (); +return dld_link (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_lib_dld_dld_link=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_dld_dld_link=no + ac_cv_lib_dld_dld_link=no fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5 -echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5 +echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6; } if test $ac_cv_lib_dld_dld_link = yes; then lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld" fi @@ -10091,8 +10819,8 @@ fi save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" - echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5 -echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5 +echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6; } if test "${lt_cv_dlopen_self+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -10102,7 +10830,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 10105 "configure" +#line 10833 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -10186,13 +10914,13 @@ rm -fr conftest* fi -echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5 -echo "${ECHO_T}$lt_cv_dlopen_self" >&6 +{ echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5 +echo "${ECHO_T}$lt_cv_dlopen_self" >&6; } if test "x$lt_cv_dlopen_self" = xyes; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" - echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5 -echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5 +echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6; } if test "${lt_cv_dlopen_self_static+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -10202,7 +10930,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 10205 "configure" +#line 10933 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -10286,8 +11014,8 @@ rm -fr conftest* fi -echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5 -echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6 +{ echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5 +echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6; } fi CPPFLAGS="$save_CPPFLAGS" @@ -10325,13 +11053,13 @@ fi striplib= old_striplib= -echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 -echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 +echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6; } if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in @@ -10339,16 +11067,16 @@ else if test -n "$STRIP" ; then striplib="$STRIP -x" old_striplib="$STRIP -S" - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi ;; *) - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } ;; esac fi @@ -10365,13 +11093,13 @@ fi # Report which library types will actually be built - echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 -echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6 - echo "$as_me:$LINENO: result: $can_build_shared" >&5 -echo "${ECHO_T}$can_build_shared" >&6 + { echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 +echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6; } + { echo "$as_me:$LINENO: result: $can_build_shared" >&5 +echo "${ECHO_T}$can_build_shared" >&6; } - echo "$as_me:$LINENO: checking whether to build shared libraries" >&5 -echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking whether to build shared libraries" >&5 +echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6; } test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and @@ -10385,21 +11113,21 @@ echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6 fi ;; - aix4* | aix5*) + aix[4-9]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac - echo "$as_me:$LINENO: result: $enable_shared" >&5 -echo "${ECHO_T}$enable_shared" >&6 + { echo "$as_me:$LINENO: result: $enable_shared" >&5 +echo "${ECHO_T}$enable_shared" >&6; } - echo "$as_me:$LINENO: checking whether to build static libraries" >&5 -echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking whether to build static libraries" >&5 +echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6; } # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes - echo "$as_me:$LINENO: result: $enable_static" >&5 -echo "${ECHO_T}$enable_static" >&6 + { echo "$as_me:$LINENO: result: $enable_static" >&5 +echo "${ECHO_T}$enable_static" >&6; } @@ -10425,7 +11153,7 @@ CC="$lt_save_CC" - ac_config_commands="$ac_config_commands libtool" + ac_config_commands="$ac_config_commands libtool" @@ -10434,10 +11162,9 @@ CC="$lt_save_CC" -# Check whether --enable-targets or --disable-targets was given. +# Check whether --enable-targets was given. if test "${enable_targets+set}" = set; then - enableval="$enable_targets" - case "${enableval}" in + enableval=$enable_targets; case "${enableval}" in yes | "") { { echo "$as_me:$LINENO: error: enable-targets option must specify target names or 'all'" >&5 echo "$as_me: error: enable-targets option must specify target names or 'all'" >&2;} { (exit 1); exit 1; }; } @@ -10445,31 +11172,32 @@ echo "$as_me: error: enable-targets option must specify target names or 'all'" > no) enable_targets= ;; *) enable_targets=$enableval ;; esac -fi; # Check whether --enable-commonbfdlib or --disable-commonbfdlib was given. +fi +# Check whether --enable-commonbfdlib was given. if test "${enable_commonbfdlib+set}" = set; then - enableval="$enable_commonbfdlib" - case "${enableval}" in + enableval=$enable_commonbfdlib; case "${enableval}" in yes) commonbfdlib=true ;; no) commonbfdlib=false ;; *) { { echo "$as_me:$LINENO: error: bad value ${enableval} for opcodes commonbfdlib option" >&5 echo "$as_me: error: bad value ${enableval} for opcodes commonbfdlib option" >&2;} { (exit 1); exit 1; }; } ;; esac -fi; +fi + GCC_WARN_CFLAGS="-W -Wall -Wstrict-prototypes -Wmissing-prototypes" -# Check whether --enable-werror or --disable-werror was given. +# Check whether --enable-werror was given. if test "${enable_werror+set}" = set; then - enableval="$enable_werror" - case "${enableval}" in + enableval=$enable_werror; case "${enableval}" in yes | y) ERROR_ON_WARNING="yes" ;; no | n) ERROR_ON_WARNING="no" ;; *) { { echo "$as_me:$LINENO: error: bad value ${enableval} for --enable-werror" >&5 echo "$as_me: error: bad value ${enableval} for --enable-werror" >&2;} { (exit 1); exit 1; }; } ;; esac -fi; +fi + # Enable -Wno-format by default when using gcc on mingw case "${host}" in @@ -10496,10 +11224,9 @@ if test "${GCC}" = yes ; then WARN_CFLAGS="${GCC_WARN_CFLAGS}" fi -# Check whether --enable-build-warnings or --disable-build-warnings was given. +# Check whether --enable-build-warnings was given. if test "${enable_build_warnings+set}" = set; then - enableval="$enable_build_warnings" - case "${enableval}" in + enableval=$enable_build_warnings; case "${enableval}" in yes) WARN_CFLAGS="${GCC_WARN_CFLAGS}";; no) if test "${GCC}" = yes ; then WARN_CFLAGS="-w" @@ -10510,7 +11237,8 @@ if test "${enable_build_warnings+set}" = set; then WARN_CFLAGS="${t} ${GCC_WARN_CFLAGS}";; *) WARN_CFLAGS=`echo "${enableval}" | sed -e "s/,/ /g"`;; esac -fi; +fi + if test x"$silent" != x"yes" && test x"$WARN_CFLAGS" != x""; then echo "Setting warning flags = $WARN_CFLAGS" 6>&1 @@ -10520,7 +11248,7 @@ fi - ac_config_headers="$ac_config_headers config.h:config.in" +ac_config_headers="$ac_config_headers config.h:config.in" if test -z "$target" ; then @@ -10529,17 +11257,17 @@ echo "$as_me: error: Unrecognized target system type; please check config.sub." { (exit 1); exit 1; }; } fi -echo "$as_me:$LINENO: checking whether to enable maintainer-specific portions of Makefiles" >&5 -echo $ECHO_N "checking whether to enable maintainer-specific portions of Makefiles... $ECHO_C" >&6 - # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. +{ echo "$as_me:$LINENO: checking whether to enable maintainer-specific portions of Makefiles" >&5 +echo $ECHO_N "checking whether to enable maintainer-specific portions of Makefiles... $ECHO_C" >&6; } + # Check whether --enable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then - enableval="$enable_maintainer_mode" - USE_MAINTAINER_MODE=$enableval + enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval else USE_MAINTAINER_MODE=no -fi; - echo "$as_me:$LINENO: result: $USE_MAINTAINER_MODE" >&5 -echo "${ECHO_T}$USE_MAINTAINER_MODE" >&6 +fi + + { echo "$as_me:$LINENO: result: $USE_MAINTAINER_MODE" >&5 +echo "${ECHO_T}$USE_MAINTAINER_MODE" >&6; } if test $USE_MAINTAINER_MODE = yes; then @@ -10568,21 +11296,21 @@ esac *) target_noncanonical=${target_alias} ;; esac -echo "$as_me:$LINENO: checking whether to install libbfd" >&5 -echo $ECHO_N "checking whether to install libbfd... $ECHO_C" >&6 - # Check whether --enable-install-libbfd or --disable-install-libbfd was given. +{ echo "$as_me:$LINENO: checking whether to install libbfd" >&5 +echo $ECHO_N "checking whether to install libbfd... $ECHO_C" >&6; } + # Check whether --enable-install-libbfd was given. if test "${enable_install_libbfd+set}" = set; then - enableval="$enable_install_libbfd" - install_libbfd_p=$enableval + enableval=$enable_install_libbfd; install_libbfd_p=$enableval else if test "${host}" = "${target}" || test "$enable_shared" = "yes"; then install_libbfd_p=yes else install_libbfd_p=no fi -fi; - echo "$as_me:$LINENO: result: $install_libbfd_p" >&5 -echo "${ECHO_T}$install_libbfd_p" >&6 +fi + + { echo "$as_me:$LINENO: result: $install_libbfd_p" >&5 +echo "${ECHO_T}$install_libbfd_p" >&6; } if test $install_libbfd_p = yes; then @@ -10627,22 +11355,22 @@ POSUB= if test -f ../intl/config.intl; then . ../intl/config.intl fi -echo "$as_me:$LINENO: checking whether NLS is requested" >&5 -echo $ECHO_N "checking whether NLS is requested... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether NLS is requested" >&5 +echo $ECHO_N "checking whether NLS is requested... $ECHO_C" >&6; } if test x"$USE_NLS" != xyes; then - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } else - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } cat >>confdefs.h <<\_ACEOF #define ENABLE_NLS 1 _ACEOF - echo "$as_me:$LINENO: checking for catalogs to be installed" >&5 -echo $ECHO_N "checking for catalogs to be installed... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for catalogs to be installed" >&5 +echo $ECHO_N "checking for catalogs to be installed... $ECHO_C" >&6; } # Look for .po and .gmo files in the source directory. CATALOGS= XLINGUAS= @@ -10673,8 +11401,8 @@ echo $ECHO_N "checking for catalogs to be installed... $ECHO_C" >&6 fi done LINGUAS="$XLINGUAS" - echo "$as_me:$LINENO: result: $LINGUAS" >&5 -echo "${ECHO_T}$LINGUAS" >&6 + { echo "$as_me:$LINENO: result: $LINGUAS" >&5 +echo "${ECHO_T}$LINGUAS" >&6; } DATADIRNAME=share @@ -10700,17 +11428,17 @@ fi - echo "$as_me:$LINENO: checking whether NLS is requested" >&5 -echo $ECHO_N "checking whether NLS is requested... $ECHO_C" >&6 - # Check whether --enable-nls or --disable-nls was given. + { echo "$as_me:$LINENO: checking whether NLS is requested" >&5 +echo $ECHO_N "checking whether NLS is requested... $ECHO_C" >&6; } + # Check whether --enable-nls was given. if test "${enable_nls+set}" = set; then - enableval="$enable_nls" - USE_NLS=$enableval + enableval=$enable_nls; USE_NLS=$enableval else USE_NLS=yes -fi; - echo "$as_me:$LINENO: result: $USE_NLS" >&5 -echo "${ECHO_T}$USE_NLS" >&6 +fi + + { echo "$as_me:$LINENO: result: $USE_NLS" >&5 +echo "${ECHO_T}$USE_NLS" >&6; } @@ -10747,8 +11475,8 @@ rm -f conf$$.file # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_MSGFMT+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -10778,17 +11506,17 @@ esac fi MSGFMT="$ac_cv_path_MSGFMT" if test "$MSGFMT" != ":"; then - echo "$as_me:$LINENO: result: $MSGFMT" >&5 -echo "${ECHO_T}$MSGFMT" >&6 + { echo "$as_me:$LINENO: result: $MSGFMT" >&5 +echo "${ECHO_T}$MSGFMT" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_GMSGFMT+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -10803,30 +11531,31 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_GMSGFMT="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_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 "$as_me:$LINENO: result: $GMSGFMT" >&5 -echo "${ECHO_T}$GMSGFMT" >&6 + { echo "$as_me:$LINENO: result: $GMSGFMT" >&5 +echo "${ECHO_T}$GMSGFMT" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + # Prepare PATH_SEPARATOR. # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then @@ -10857,8 +11586,8 @@ rm -f conf$$.file # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_XGETTEXT+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -10888,11 +11617,11 @@ esac fi XGETTEXT="$ac_cv_path_XGETTEXT" if test "$XGETTEXT" != ":"; then - echo "$as_me:$LINENO: result: $XGETTEXT" >&5 -echo "${ECHO_T}$XGETTEXT" >&6 + { echo "$as_me:$LINENO: result: $XGETTEXT" >&5 +echo "${ECHO_T}$XGETTEXT" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi rm -f messages.po @@ -10928,8 +11657,8 @@ rm -f conf$$.file # Extract the first word of "msgmerge", so it can be a program name with args. set dummy msgmerge; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_MSGMERGE+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -10958,11 +11687,11 @@ esac fi MSGMERGE="$ac_cv_path_MSGMERGE" if test "$MSGMERGE" != ":"; then - echo "$as_me:$LINENO: result: $MSGMERGE" >&5 -echo "${ECHO_T}$MSGMERGE" >&6 + { echo "$as_me:$LINENO: result: $MSGMERGE" >&5 +echo "${ECHO_T}$MSGMERGE" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi @@ -10972,8 +11701,8 @@ fi : ; else GMSGFMT=`echo "$GMSGFMT" | sed -e 's,^.*/,,'` - echo "$as_me:$LINENO: result: found $GMSGFMT program is not GNU msgfmt; ignore it" >&5 -echo "${ECHO_T}found $GMSGFMT program is not GNU msgfmt; ignore it" >&6 + { echo "$as_me:$LINENO: result: found $GMSGFMT program is not GNU msgfmt; ignore it" >&5 +echo "${ECHO_T}found $GMSGFMT program is not GNU msgfmt; ignore it" >&6; } GMSGFMT=":" fi fi @@ -10983,14 +11712,14 @@ echo "${ECHO_T}found $GMSGFMT program is not GNU msgfmt; ignore it" >&6 (if $XGETTEXT --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then : ; else - echo "$as_me:$LINENO: result: found xgettext program is not GNU xgettext; ignore it" >&5 -echo "${ECHO_T}found xgettext program is not GNU xgettext; ignore it" >&6 + { echo "$as_me:$LINENO: result: found xgettext program is not GNU xgettext; ignore it" >&5 +echo "${ECHO_T}found xgettext program is not GNU xgettext; ignore it" >&6; } XGETTEXT=":" fi rm -f messages.po fi - ac_config_commands="$ac_config_commands default-1" + ac_config_commands="$ac_config_commands default-1" @@ -11009,8 +11738,8 @@ fi if test "x$cross_compiling" = "xno"; then EXEEXT_FOR_BUILD='$(EXEEXT)' else - echo "$as_me:$LINENO: checking for build system executable suffix" >&5 -echo $ECHO_N "checking for build system executable suffix... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for build system executable suffix" >&5 +echo $ECHO_N "checking for build system executable suffix... $ECHO_C" >&6; } if test "${bfd_cv_build_exeext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -11027,8 +11756,8 @@ else rm -f conftest* test x"${bfd_cv_build_exeext}" = x && bfd_cv_build_exeext=no fi -echo "$as_me:$LINENO: result: $bfd_cv_build_exeext" >&5 -echo "${ECHO_T}$bfd_cv_build_exeext" >&6 +{ echo "$as_me:$LINENO: result: $bfd_cv_build_exeext" >&5 +echo "${ECHO_T}$bfd_cv_build_exeext" >&6; } EXEEXT_FOR_BUILD="" test x"${bfd_cv_build_exeext}" != xno && EXEEXT_FOR_BUILD=${bfd_cv_build_exeext} fi @@ -11048,8 +11777,8 @@ fi # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. -echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 -echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 +echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; } if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -11071,7 +11800,7 @@ case $as_dir/ in # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then + if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. @@ -11090,21 +11819,22 @@ case $as_dir/ in ;; esac done +IFS=$as_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 + # As a last resort, use the slow shell script. Don't cache a + # value 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. + # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi -echo "$as_me:$LINENO: result: $INSTALL" >&5 -echo "${ECHO_T}$INSTALL" >&6 +{ echo "$as_me:$LINENO: result: $INSTALL" >&5 +echo "${ECHO_T}$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. @@ -11122,18 +11852,19 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' for ac_header in string.h strings.h stdlib.h limits.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? -echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -11144,41 +11875,37 @@ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_header_compiler=no + ac_header_compiler=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -11187,24 +11914,22 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 @@ -11212,9 +11937,10 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi + rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in @@ -11238,25 +11964,19 @@ echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\ echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------------ ## -## Report this to the AC_PACKAGE_NAME lists. ## -## ------------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 + ;; esac -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then @@ -11269,8 +11989,8 @@ fi done -echo "$as_me:$LINENO: checking whether basename is declared" >&5 -echo $ECHO_N "checking whether basename is declared... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether basename is declared" >&5 +echo $ECHO_N "checking whether basename is declared... $ECHO_C" >&6; } if test "${ac_cv_have_decl_basename+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -11285,7 +12005,7 @@ int main () { #ifndef basename - char *p = (char *) basename; + (void) basename; #endif ; @@ -11293,38 +12013,34 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_have_decl_basename=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_have_decl_basename=no + ac_cv_have_decl_basename=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_have_decl_basename" >&5 -echo "${ECHO_T}$ac_cv_have_decl_basename" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_basename" >&5 +echo "${ECHO_T}$ac_cv_have_decl_basename" >&6; } if test $ac_cv_have_decl_basename = yes; then cat >>confdefs.h <<_ACEOF @@ -11339,8 +12055,8 @@ _ACEOF fi -echo "$as_me:$LINENO: checking whether stpcpy is declared" >&5 -echo $ECHO_N "checking whether stpcpy is declared... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether stpcpy is declared" >&5 +echo $ECHO_N "checking whether stpcpy is declared... $ECHO_C" >&6; } if test "${ac_cv_have_decl_stpcpy+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -11355,7 +12071,7 @@ int main () { #ifndef stpcpy - char *p = (char *) stpcpy; + (void) stpcpy; #endif ; @@ -11363,38 +12079,34 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_have_decl_stpcpy=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_have_decl_stpcpy=no + ac_cv_have_decl_stpcpy=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_have_decl_stpcpy" >&5 -echo "${ECHO_T}$ac_cv_have_decl_stpcpy" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_stpcpy" >&5 +echo "${ECHO_T}$ac_cv_have_decl_stpcpy" >&6; } if test $ac_cv_have_decl_stpcpy = yes; then cat >>confdefs.h <<_ACEOF @@ -11415,10 +12127,9 @@ fi cgen_maint=no cgendir='$(srcdir)/../cgen' -# Check whether --enable-cgen-maint or --disable-cgen-maint was given. +# Check whether --enable-cgen-maint was given. if test "${enable_cgen_maint+set}" = set; then - enableval="$enable_cgen_maint" - case "${enableval}" in + enableval=$enable_cgen_maint; case "${enableval}" in yes) cgen_maint=yes ;; no) cgen_maint=no ;; *) @@ -11429,7 +12140,8 @@ if test "${enable_cgen_maint+set}" = set; then cgendir=${cgen_maint}/lib/cgen ;; esac -fi; +fi + if test x${cgen_maint} = xyes; then CGEN_MAINT_TRUE= @@ -11519,7 +12231,8 @@ if test x${all_targets} = xfalse ; then archdefs="$archdefs -DARCH_$ad" case "$arch" in bfd_alpha_arch) ta="$ta alpha-dis.lo alpha-opc.lo" ;; - bfd_arc_arch) ta="$ta arc-asm.lo arc-desc.lo arc-dis.lo arc-ibld.lo arc-opc.lo arc-opinst.lo arc-ext.lo" using_cgen=yes ;; + #bfd_arc_arch) ta="$ta arc-dis.lo arc-opc.lo arc-ext.lo" ;; + bfd_arc_arch) ta="$ta arc-asm.lo arcompact-dis.lo arc-ext.lo arc-desc.lo arc-dis.lo arc-dis-cgen.lo arc-ibld.lo arc-opc.lo arc-opinst.lo" using_cgen=yes ;; bfd_arm_arch) ta="$ta arm-dis.lo" ;; bfd_avr_arch) ta="$ta avr-dis.lo" ;; bfd_bfin_arch) ta="$ta bfin-dis.lo" ;; @@ -11643,7 +12356,7 @@ fi - ac_config_files="$ac_config_files Makefile po/Makefile.in:po/Make-in" +ac_config_files="$ac_config_files Makefile po/Makefile.in:po/Make-in" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure @@ -11663,39 +12376,58 @@ _ACEOF # 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. +# So, we kill variables containing newlines. # 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. -{ +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 +echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + *) $as_unset $ac_var ;; + esac ;; + esac + done + (set) 2>&1 | - case `(ac_space=' '; set | grep ac_space) 2>&1` in - *ac_space=\ *) + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" - ;; + ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n \ - "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; - esac; -} | + esac | + sort +) | sed ' + /^ac_cv_env_/b end t clear - : clear + :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end - /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ - : end' >>confcache -if diff $cache_file confcache >/dev/null 2>&1; then :; else - if test -w $cache_file; then - test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + :end' >>confcache +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else + if test -w "$cache_file"; then + test "x$cache_file" != "x/dev/null" && + { echo "$as_me:$LINENO: updating cache $cache_file" >&5 +echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else - echo "not updating unwritable cache $cache_file" + { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 +echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache @@ -11704,32 +12436,18 @@ test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' -# VPATH may cause trouble with some makes, so we remove $(srcdir), -# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and -# trailing colons and then remove the whole line if VPATH becomes empty -# (actually we leave an empty line to preserve line numbers). -if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=/{ -s/:*\$(srcdir):*/:/; -s/:*\${srcdir}:*/:/; -s/:*@srcdir@:*/:/; -s/^\([^=]*=[ ]*\):*/\1/; -s/:*$//; -s/^[^=]*=[ ]*$//; -}' -fi - DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. - ac_i=`echo "$ac_i" | - sed 's/\$U\././;s/\.o$//;s/\.obj$//'` - # 2. Add them. - ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" - ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`echo "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" + ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs @@ -11795,17 +12513,45 @@ cat >>$CONFIG_STATUS <<\_ACEOF ## M4sh Initialization. ## ## --------------------- ## -# Be Bourne compatible +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' -elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then - set -o posix + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi + + + + +# PATH needs CR +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh fi -DUALCASE=1; export DUALCASE # for MKS sh # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then @@ -11815,8 +12561,43 @@ else fi +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +as_nl=' +' +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + { (exit 1); exit 1; } +fi + # Work around bugs in pre-3.0 UWIN ksh. -$as_unset ENV MAIL MAILPATH +for as_var in ENV MAIL MAILPATH +do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var +done PS1='$ ' PS2='> ' PS4='+ ' @@ -11830,18 +12611,19 @@ do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else - $as_unset $as_var + ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. -if expr a : '\(a\)' >/dev/null 2>&1; then +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi -if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false @@ -11849,159 +12631,120 @@ fi # Name of the executable. -as_me=`$as_basename "$0" || +as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)$' \| \ - . : '\(.\)' 2>/dev/null || + X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } - /^X\/\(\/\/\)$/{ s//\1/; q; } - /^X\/\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` -# PATH needs CR, and LINENO needs CR and PATH. -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh -fi +# CDPATH. +$as_unset CDPATH - as_lineno_1=$LINENO - as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" || { - # Find who we are. Look in the path if we contain no path at all - # relative or not. - case $0 in - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break -done - ;; - esac - # We did not find ourselves, most probably we were run as `sh COMMAND' - # in which case we are not to be found in the path. - if test "x$as_myself" = x; then - as_myself=$0 - fi - if test ! -f "$as_myself"; then - { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 -echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} - { (exit 1); exit 1; }; } - fi - case $CONFIG_SHELL in - '') - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for as_base in sh bash ksh sh5; do - case $as_dir in - /*) - if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then - $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } - $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } - CONFIG_SHELL=$as_dir/$as_base - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$0" ${1+"$@"} - fi;; - esac - done -done -;; - esac + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line before each line; the second 'sed' does the real - # work. The second script uses 'N' to pair each line-number line - # with the numbered line, and appends trailing '-' during - # substitution so that $LINENO is not a special case at line end. + # line-number line after each line using $LINENO; the second 'sed' + # does the real work. The second script uses 'N' to pair each + # line-number line with the line containing $LINENO, and appends + # trailing '-' during substitution so that $LINENO is not a special + # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) - sed '=' <$as_myself | + # scripts with optimization help from Paolo Bonzini. Blame Lee + # E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno N - s,$,-, - : loop - s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop - s,-$,, - s,^['$as_cr_digits']*\n,, + s/-\n.*// ' >$as_me.lineno && - chmod +x $as_me.lineno || - { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 -echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} + chmod +x "$as_me.lineno" || + { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensible to this). - . ./$as_me.lineno + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" # Exit status is that of the last command. exit } -case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in - *c*,-n*) ECHO_N= ECHO_C=' -' ECHO_T=' ' ;; - *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; - *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in +-n*) + case `echo 'x\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + *) ECHO_C='\c';; + esac;; +*) + ECHO_N='-n';; esac -if expr a : '\(a\)' >/dev/null 2>&1; then +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir +fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then - # We could just check for DJGPP; but this test a) works b) is more generic - # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). - if test -f conf$$.exe; then - # Don't use ln at all; we don't have any links + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' - else - as_ln_s='ln -s' - fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi -rm -f conf$$ conf$$.exe conf$$.file +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p=: @@ -12009,8 +12752,29 @@ else test -d ./-p && rmdir ./-p as_mkdir_p=false fi - -as_executable_p="test -f" + +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' +else + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +fi +as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" @@ -12019,31 +12783,14 @@ as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" -# IFS -# We need space, tab and new line, in precisely that order. -as_nl=' -' -IFS=" $as_nl" - -# CDPATH. -$as_unset CDPATH - exec 6>&1 -# Open the log real soon, to keep \$[0] and so on meaningful, and to +# Save the log message, to keep $[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their -# values after options handling. Logging --version etc. is OK. -exec 5>>config.log -{ - echo - sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX -## Running $as_me. ## -_ASBOX -} >&5 -cat >&5 <<_CSEOF - +# values after options handling. +ac_log=" This file was extended by $as_me, which was -generated by GNU Autoconf 2.59. Invocation command line was +generated by GNU Autoconf 2.61. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -12051,30 +12798,20 @@ generated by GNU Autoconf 2.59. Invocation command line was CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ -_CSEOF -echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 -echo >&5 +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + _ACEOF +cat >>$CONFIG_STATUS <<_ACEOF # Files that config.status was made for. -if test -n "$ac_config_files"; then - echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS -fi - -if test -n "$ac_config_headers"; then - echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS -fi +config_files="$ac_config_files" +config_headers="$ac_config_headers" +config_commands="$ac_config_commands" -if test -n "$ac_config_links"; then - echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS -fi - -if test -n "$ac_config_commands"; then - echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS -fi +_ACEOF cat >>$CONFIG_STATUS <<\_ACEOF - ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. @@ -12082,7 +12819,7 @@ current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit - -V, --version print version number, then exit + -V, --version print version number and configuration settings, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions @@ -12101,19 +12838,21 @@ Configuration commands: $config_commands Report bugs to ." -_ACEOF +_ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ config.status -configured by $0, generated by GNU Autoconf 2.59, - with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" +configured by $0, generated by GNU Autoconf 2.61, + with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" -Copyright (C) 2003 Free Software Foundation, Inc. +Copyright (C) 2006 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." -srcdir=$srcdir -INSTALL="$INSTALL" + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +INSTALL='$INSTALL' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF @@ -12124,39 +12863,24 @@ while test $# != 0 do case $1 in --*=*) - ac_option=`expr "x$1" : 'x\([^=]*\)='` - ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; - -*) + *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; - *) # This is not an option, so the user has probably given explicit - # arguments. - ac_option=$1 - ac_need_defaults=false;; esac case $ac_option in # Handling of the options. -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; - --version | --vers* | -V ) - echo "$ac_cs_version"; exit 0 ;; - --he | --h) - # Conflict between --help and --header - { { echo "$as_me:$LINENO: error: ambiguous option: $1 -Try \`$0 --help' for more information." >&5 -echo "$as_me: error: ambiguous option: $1 -Try \`$0 --help' for more information." >&2;} - { (exit 1); exit 1; }; };; - --help | --hel | -h ) - echo "$ac_cs_usage"; exit 0 ;; - --debug | --d* | -d ) + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + echo "$ac_cs_version"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift @@ -12166,18 +12890,24 @@ Try \`$0 --help' for more information." >&2;} $ac_shift CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" ac_need_defaults=false;; + --he | --h) + # Conflict between --help and --header + { echo "$as_me: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&2 + { (exit 1); exit 1; }; };; + --help | --hel | -h ) + echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. - -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 -Try \`$0 --help' for more information." >&5 -echo "$as_me: error: unrecognized option: $1 -Try \`$0 --help' for more information." >&2;} + -*) { echo "$as_me: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; - *) ac_config_targets="$ac_config_targets $1" ;; + *) ac_config_targets="$ac_config_targets $1" + ac_need_defaults=false ;; esac shift @@ -12193,17 +12923,28 @@ fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF if \$ac_cs_recheck; then - echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 - exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 + CONFIG_SHELL=$SHELL + export CONFIG_SHELL + exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX + echo "$ac_log" +} >&5 +_ACEOF cat >>$CONFIG_STATUS <<_ACEOF # -# INIT-COMMANDS section. +# INIT-COMMANDS # - AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" @@ -12456,25 +13197,26 @@ fi _ACEOF - - cat >>$CONFIG_STATUS <<\_ACEOF + +# Handling of arguments. for ac_config_target in $ac_config_targets do - case "$ac_config_target" in - # Handling of arguments. - "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; - "po/Makefile.in" ) CONFIG_FILES="$CONFIG_FILES po/Makefile.in:po/Make-in" ;; - "depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; - "libtool" ) CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; - "default-1" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default-1" ;; - "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h:config.in" ;; + case $ac_config_target in + "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; + "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h:config.in" ;; + "default-1") CONFIG_COMMANDS="$CONFIG_COMMANDS default-1" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "po/Makefile.in") CONFIG_FILES="$CONFIG_FILES po/Makefile.in:po/Make-in" ;; + *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done + # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely @@ -12486,389 +13228,494 @@ if $ac_need_defaults; then fi # Have a temporary directory for convenience. Make it in the build tree -# simply because there is no reason to put it here, and in addition, +# simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. -# Create a temporary directory, and hook for its removal unless debugging. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. $debug || { - trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 + tmp= + trap 'exit_status=$? + { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status +' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } - # Create a (secure) tmp directory for tmp files. { - tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { - tmp=./confstat$$-$RANDOM - (umask 077 && mkdir $tmp) + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } -_ACEOF - -cat >>$CONFIG_STATUS <<_ACEOF - # -# CONFIG_FILES section. +# Set up the sed scripts for CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h -if test -n "\$CONFIG_FILES"; then - # Protect against being on the right side of a sed subst in config.status. - sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; - s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF -s,@SHELL@,$SHELL,;t t -s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t -s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t -s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t -s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t -s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t -s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t -s,@exec_prefix@,$exec_prefix,;t t -s,@prefix@,$prefix,;t t -s,@program_transform_name@,$program_transform_name,;t t -s,@bindir@,$bindir,;t t -s,@sbindir@,$sbindir,;t t -s,@libexecdir@,$libexecdir,;t t -s,@datadir@,$datadir,;t t -s,@sysconfdir@,$sysconfdir,;t t -s,@sharedstatedir@,$sharedstatedir,;t t -s,@localstatedir@,$localstatedir,;t t -s,@libdir@,$libdir,;t t -s,@includedir@,$includedir,;t t -s,@oldincludedir@,$oldincludedir,;t t -s,@infodir@,$infodir,;t t -s,@mandir@,$mandir,;t t -s,@build_alias@,$build_alias,;t t -s,@host_alias@,$host_alias,;t t -s,@target_alias@,$target_alias,;t t -s,@DEFS@,$DEFS,;t t -s,@ECHO_C@,$ECHO_C,;t t -s,@ECHO_N@,$ECHO_N,;t t -s,@ECHO_T@,$ECHO_T,;t t -s,@LIBS@,$LIBS,;t t -s,@build@,$build,;t t -s,@build_cpu@,$build_cpu,;t t -s,@build_vendor@,$build_vendor,;t t -s,@build_os@,$build_os,;t t -s,@host@,$host,;t t -s,@host_cpu@,$host_cpu,;t t -s,@host_vendor@,$host_vendor,;t t -s,@host_os@,$host_os,;t t -s,@target@,$target,;t t -s,@target_cpu@,$target_cpu,;t t -s,@target_vendor@,$target_vendor,;t t -s,@target_os@,$target_os,;t t -s,@CC@,$CC,;t t -s,@CFLAGS@,$CFLAGS,;t t -s,@LDFLAGS@,$LDFLAGS,;t t -s,@CPPFLAGS@,$CPPFLAGS,;t t -s,@ac_ct_CC@,$ac_ct_CC,;t t -s,@EXEEXT@,$EXEEXT,;t t -s,@OBJEXT@,$OBJEXT,;t t -s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t -s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t -s,@INSTALL_DATA@,$INSTALL_DATA,;t t -s,@CYGPATH_W@,$CYGPATH_W,;t t -s,@PACKAGE@,$PACKAGE,;t t -s,@VERSION@,$VERSION,;t t -s,@ACLOCAL@,$ACLOCAL,;t t -s,@AUTOCONF@,$AUTOCONF,;t t -s,@AUTOMAKE@,$AUTOMAKE,;t t -s,@AUTOHEADER@,$AUTOHEADER,;t t -s,@MAKEINFO@,$MAKEINFO,;t t -s,@install_sh@,$install_sh,;t t -s,@STRIP@,$STRIP,;t t -s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t -s,@INSTALL_STRIP_PROGRAM@,$INSTALL_STRIP_PROGRAM,;t t -s,@mkdir_p@,$mkdir_p,;t t -s,@AWK@,$AWK,;t t -s,@SET_MAKE@,$SET_MAKE,;t t -s,@am__leading_dot@,$am__leading_dot,;t t -s,@AMTAR@,$AMTAR,;t t -s,@am__tar@,$am__tar,;t t -s,@am__untar@,$am__untar,;t t -s,@DEPDIR@,$DEPDIR,;t t -s,@am__include@,$am__include,;t t -s,@am__quote@,$am__quote,;t t -s,@AMDEP_TRUE@,$AMDEP_TRUE,;t t -s,@AMDEP_FALSE@,$AMDEP_FALSE,;t t -s,@AMDEPBACKSLASH@,$AMDEPBACKSLASH,;t t -s,@CCDEPMODE@,$CCDEPMODE,;t t -s,@am__fastdepCC_TRUE@,$am__fastdepCC_TRUE,;t t -s,@am__fastdepCC_FALSE@,$am__fastdepCC_FALSE,;t t -s,@AR@,$AR,;t t -s,@ac_ct_AR@,$ac_ct_AR,;t t -s,@RANLIB@,$RANLIB,;t t -s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t -s,@LIBTOOL@,$LIBTOOL,;t t -s,@SED@,$SED,;t t -s,@EGREP@,$EGREP,;t t -s,@FGREP@,$FGREP,;t t -s,@GREP@,$GREP,;t t -s,@LD@,$LD,;t t -s,@DUMPBIN@,$DUMPBIN,;t t -s,@ac_ct_DUMPBIN@,$ac_ct_DUMPBIN,;t t -s,@NM@,$NM,;t t -s,@LN_S@,$LN_S,;t t -s,@lt_ECHO@,$lt_ECHO,;t t -s,@CPP@,$CPP,;t t -s,@WARN_CFLAGS@,$WARN_CFLAGS,;t t -s,@NO_WERROR@,$NO_WERROR,;t t -s,@MAINTAINER_MODE_TRUE@,$MAINTAINER_MODE_TRUE,;t t -s,@MAINTAINER_MODE_FALSE@,$MAINTAINER_MODE_FALSE,;t t -s,@MAINT@,$MAINT,;t t -s,@INSTALL_LIBBFD_TRUE@,$INSTALL_LIBBFD_TRUE,;t t -s,@INSTALL_LIBBFD_FALSE@,$INSTALL_LIBBFD_FALSE,;t t -s,@host_noncanonical@,$host_noncanonical,;t t -s,@target_noncanonical@,$target_noncanonical,;t t -s,@bfdlibdir@,$bfdlibdir,;t t -s,@bfdincludedir@,$bfdincludedir,;t t -s,@USE_NLS@,$USE_NLS,;t t -s,@LIBINTL@,$LIBINTL,;t t -s,@LIBINTL_DEP@,$LIBINTL_DEP,;t t -s,@INCINTL@,$INCINTL,;t t -s,@XGETTEXT@,$XGETTEXT,;t t -s,@GMSGFMT@,$GMSGFMT,;t t -s,@POSUB@,$POSUB,;t t -s,@CATALOGS@,$CATALOGS,;t t -s,@DATADIRNAME@,$DATADIRNAME,;t t -s,@INSTOBJEXT@,$INSTOBJEXT,;t t -s,@GENCAT@,$GENCAT,;t t -s,@CATOBJEXT@,$CATOBJEXT,;t t -s,@MKINSTALLDIRS@,$MKINSTALLDIRS,;t t -s,@MSGFMT@,$MSGFMT,;t t -s,@MSGMERGE@,$MSGMERGE,;t t -s,@CC_FOR_BUILD@,$CC_FOR_BUILD,;t t -s,@EXEEXT_FOR_BUILD@,$EXEEXT_FOR_BUILD,;t t -s,@HDEFINES@,$HDEFINES,;t t -s,@CGEN_MAINT_TRUE@,$CGEN_MAINT_TRUE,;t t -s,@CGEN_MAINT_FALSE@,$CGEN_MAINT_FALSE,;t t -s,@cgendir@,$cgendir,;t t -s,@SHARED_LDFLAGS@,$SHARED_LDFLAGS,;t t -s,@SHARED_LIBADD@,$SHARED_LIBADD,;t t -s,@SHARED_DEPENDENCIES@,$SHARED_DEPENDENCIES,;t t -s,@archdefs@,$archdefs,;t t -s,@BFD_MACHINES@,$BFD_MACHINES,;t t -s,@LIBOBJS@,$LIBOBJS,;t t -s,@LTLIBOBJS@,$LTLIBOBJS,;t t -CEOF +if test -n "$CONFIG_FILES"; then + +_ACEOF + + + +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + cat >conf$$subs.sed <<_ACEOF +SHELL!$SHELL$ac_delim +PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim +PACKAGE_NAME!$PACKAGE_NAME$ac_delim +PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim +PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim +PACKAGE_STRING!$PACKAGE_STRING$ac_delim +PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim +exec_prefix!$exec_prefix$ac_delim +prefix!$prefix$ac_delim +program_transform_name!$program_transform_name$ac_delim +bindir!$bindir$ac_delim +sbindir!$sbindir$ac_delim +libexecdir!$libexecdir$ac_delim +datarootdir!$datarootdir$ac_delim +datadir!$datadir$ac_delim +sysconfdir!$sysconfdir$ac_delim +sharedstatedir!$sharedstatedir$ac_delim +localstatedir!$localstatedir$ac_delim +includedir!$includedir$ac_delim +oldincludedir!$oldincludedir$ac_delim +docdir!$docdir$ac_delim +infodir!$infodir$ac_delim +htmldir!$htmldir$ac_delim +dvidir!$dvidir$ac_delim +pdfdir!$pdfdir$ac_delim +psdir!$psdir$ac_delim +libdir!$libdir$ac_delim +localedir!$localedir$ac_delim +mandir!$mandir$ac_delim +DEFS!$DEFS$ac_delim +ECHO_C!$ECHO_C$ac_delim +ECHO_N!$ECHO_N$ac_delim +ECHO_T!$ECHO_T$ac_delim +LIBS!$LIBS$ac_delim +build_alias!$build_alias$ac_delim +host_alias!$host_alias$ac_delim +target_alias!$target_alias$ac_delim +build!$build$ac_delim +build_cpu!$build_cpu$ac_delim +build_vendor!$build_vendor$ac_delim +build_os!$build_os$ac_delim +host!$host$ac_delim +host_cpu!$host_cpu$ac_delim +host_vendor!$host_vendor$ac_delim +host_os!$host_os$ac_delim +target!$target$ac_delim +target_cpu!$target_cpu$ac_delim +target_vendor!$target_vendor$ac_delim +target_os!$target_os$ac_delim +CC!$CC$ac_delim +CFLAGS!$CFLAGS$ac_delim +LDFLAGS!$LDFLAGS$ac_delim +CPPFLAGS!$CPPFLAGS$ac_delim +ac_ct_CC!$ac_ct_CC$ac_delim +EXEEXT!$EXEEXT$ac_delim +OBJEXT!$OBJEXT$ac_delim +INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim +INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim +INSTALL_DATA!$INSTALL_DATA$ac_delim +CYGPATH_W!$CYGPATH_W$ac_delim +PACKAGE!$PACKAGE$ac_delim +VERSION!$VERSION$ac_delim +ACLOCAL!$ACLOCAL$ac_delim +AUTOCONF!$AUTOCONF$ac_delim +AUTOMAKE!$AUTOMAKE$ac_delim +AUTOHEADER!$AUTOHEADER$ac_delim +MAKEINFO!$MAKEINFO$ac_delim +install_sh!$install_sh$ac_delim +STRIP!$STRIP$ac_delim +INSTALL_STRIP_PROGRAM!$INSTALL_STRIP_PROGRAM$ac_delim +mkdir_p!$mkdir_p$ac_delim +AWK!$AWK$ac_delim +SET_MAKE!$SET_MAKE$ac_delim +am__leading_dot!$am__leading_dot$ac_delim +AMTAR!$AMTAR$ac_delim +am__tar!$am__tar$ac_delim +am__untar!$am__untar$ac_delim +DEPDIR!$DEPDIR$ac_delim +am__include!$am__include$ac_delim +am__quote!$am__quote$ac_delim +AMDEP_TRUE!$AMDEP_TRUE$ac_delim +AMDEP_FALSE!$AMDEP_FALSE$ac_delim +AMDEPBACKSLASH!$AMDEPBACKSLASH$ac_delim +CCDEPMODE!$CCDEPMODE$ac_delim +am__fastdepCC_TRUE!$am__fastdepCC_TRUE$ac_delim +am__fastdepCC_FALSE!$am__fastdepCC_FALSE$ac_delim +AR!$AR$ac_delim +RANLIB!$RANLIB$ac_delim +LIBTOOL!$LIBTOOL$ac_delim +SED!$SED$ac_delim +GREP!$GREP$ac_delim +EGREP!$EGREP$ac_delim +FGREP!$FGREP$ac_delim +LD!$LD$ac_delim +DUMPBIN!$DUMPBIN$ac_delim +ac_ct_DUMPBIN!$ac_ct_DUMPBIN$ac_delim +NM!$NM$ac_delim +_ACEOF + + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then + break + elif $ac_last_try; then + { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done -_ACEOF +ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` +if test -n "$ac_eof"; then + ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` + ac_eof=`expr $ac_eof + 1` +fi - cat >>$CONFIG_STATUS <<\_ACEOF - # 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_lines=48 - ac_sed_frag=1 # Number of current file. - ac_beg=1 # First line for current file. - ac_end=$ac_max_sed_lines # 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" $tmp/subs.sed >$tmp/subs.frag - else - sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag - fi - if test ! -s $tmp/subs.frag; then - ac_more_lines=false - else - # The purpose of the label and of the branching condition is to - # speed up the sed processing (if there are no `@' at all, there - # is no need to browse any of the substitutions). - # These are the two extra sed commands mentioned above. - (echo ':t - /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed - if test -z "$ac_sed_cmds"; then - ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" - else - ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" - fi - ac_sed_frag=`expr $ac_sed_frag + 1` - ac_beg=$ac_end - ac_end=`expr $ac_end + $ac_max_sed_lines` - fi - done - if test -z "$ac_sed_cmds"; then - ac_sed_cmds=cat +cat >>$CONFIG_STATUS <<_ACEOF +cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +_ACEOF +sed ' +s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g +s/^/s,@/; s/!/@,|#_!!_#|/ +:n +t n +s/'"$ac_delim"'$/,g/; t +s/$/\\/; p +N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n +' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF +CEOF$ac_eof +_ACEOF + + +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + cat >conf$$subs.sed <<_ACEOF +LN_S!$LN_S$ac_delim +lt_ECHO!$lt_ECHO$ac_delim +CPP!$CPP$ac_delim +WARN_CFLAGS!$WARN_CFLAGS$ac_delim +NO_WERROR!$NO_WERROR$ac_delim +MAINTAINER_MODE_TRUE!$MAINTAINER_MODE_TRUE$ac_delim +MAINTAINER_MODE_FALSE!$MAINTAINER_MODE_FALSE$ac_delim +MAINT!$MAINT$ac_delim +INSTALL_LIBBFD_TRUE!$INSTALL_LIBBFD_TRUE$ac_delim +INSTALL_LIBBFD_FALSE!$INSTALL_LIBBFD_FALSE$ac_delim +host_noncanonical!$host_noncanonical$ac_delim +target_noncanonical!$target_noncanonical$ac_delim +bfdlibdir!$bfdlibdir$ac_delim +bfdincludedir!$bfdincludedir$ac_delim +USE_NLS!$USE_NLS$ac_delim +LIBINTL!$LIBINTL$ac_delim +LIBINTL_DEP!$LIBINTL_DEP$ac_delim +INCINTL!$INCINTL$ac_delim +XGETTEXT!$XGETTEXT$ac_delim +GMSGFMT!$GMSGFMT$ac_delim +POSUB!$POSUB$ac_delim +CATALOGS!$CATALOGS$ac_delim +DATADIRNAME!$DATADIRNAME$ac_delim +INSTOBJEXT!$INSTOBJEXT$ac_delim +GENCAT!$GENCAT$ac_delim +CATOBJEXT!$CATOBJEXT$ac_delim +MKINSTALLDIRS!$MKINSTALLDIRS$ac_delim +MSGFMT!$MSGFMT$ac_delim +MSGMERGE!$MSGMERGE$ac_delim +CC_FOR_BUILD!$CC_FOR_BUILD$ac_delim +EXEEXT_FOR_BUILD!$EXEEXT_FOR_BUILD$ac_delim +HDEFINES!$HDEFINES$ac_delim +CGEN_MAINT_TRUE!$CGEN_MAINT_TRUE$ac_delim +CGEN_MAINT_FALSE!$CGEN_MAINT_FALSE$ac_delim +cgendir!$cgendir$ac_delim +SHARED_LDFLAGS!$SHARED_LDFLAGS$ac_delim +SHARED_LIBADD!$SHARED_LIBADD$ac_delim +SHARED_DEPENDENCIES!$SHARED_DEPENDENCIES$ac_delim +archdefs!$archdefs$ac_delim +BFD_MACHINES!$BFD_MACHINES$ac_delim +LIBOBJS!$LIBOBJS$ac_delim +LTLIBOBJS!$LTLIBOBJS$ac_delim +_ACEOF + + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 42; then + break + elif $ac_last_try; then + { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi -fi # test -n "$CONFIG_FILES" +done +ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` +if test -n "$ac_eof"; then + ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` + ac_eof=`expr $ac_eof + 1` +fi + +cat >>$CONFIG_STATUS <<_ACEOF +cat >"\$tmp/subs-2.sed" <<\CEOF$ac_eof +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end +_ACEOF +sed ' +s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g +s/^/s,@/; s/!/@,|#_!!_#|/ +:n +t n +s/'"$ac_delim"'$/,g/; t +s/$/\\/; p +N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n +' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF +:end +s/|#_!!_#|//g +CEOF$ac_eof _ACEOF + + +# VPATH may cause trouble with some makes, so we remove $(srcdir), +# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=/{ +s/:*\$(srcdir):*/:/ +s/:*\${srcdir}:*/:/ +s/:*@srcdir@:*/:/ +s/^\([^=]*=[ ]*\):*/\1/ +s/:*$// +s/^[^=]*=[ ]*$// +}' +fi + cat >>$CONFIG_STATUS <<\_ACEOF -for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue - # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". - case $ac_file in - - | *:- | *:-:* ) # input from stdin - cat >$tmp/stdin - ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - * ) ac_file_in=$ac_file.in ;; +fi # test -n "$CONFIG_FILES" + + +for ac_tag in :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 +echo "$as_me: error: Invalid tag $ac_tag." >&2;} + { (exit 1); exit 1; }; };; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 +echo "$as_me: error: cannot find input file: $ac_f" >&2;} + { (exit 1); exit 1; }; };; + esac + ac_file_inputs="$ac_file_inputs $ac_f" + done + + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input="Generated from "`IFS=: + echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + fi + + case $ac_tag in + *:-:* | *:-) cat >"$tmp/stdin";; + esac + ;; esac - # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. - ac_dir=`(dirname "$ac_file") 2>/dev/null || + ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ - X"$ac_file" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || echo X"$ac_file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - { if $as_mkdir_p; then - mkdir -p "$ac_dir" - else - as_dir="$ac_dir" + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + { as_dir="$ac_dir" + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= - while test ! -d "$as_dir"; do - as_dirs="$as_dir $as_dirs" - as_dir=`(dirname "$as_dir") 2>/dev/null || + while :; do + case $as_dir in #( + *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break done - test ! -n "$as_dirs" || mkdir $as_dirs - fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 -echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 +echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } - ac_builddir=. -if test "$ac_dir" != .; then +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A "../" for each directory in $ac_dir_suffix. - ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` -else - ac_dir_suffix= ac_top_builddir= -fi + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix case $srcdir in - .) # No --srcdir option. We are building in place. + .) # We are building in place. ac_srcdir=. - if test -z "$ac_top_builddir"; then - ac_top_srcdir=. - else - ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` - fi ;; - [\\/]* | ?:[\\/]* ) # Absolute path. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir ;; - *) # Relative path. - ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_builddir$srcdir ;; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix -# Do not use `cd foo && pwd` to compute absolute paths, because -# the directories may not exist. -case `pwd` in -.) ac_abs_builddir="$ac_dir";; -*) - case "$ac_dir" in - .) ac_abs_builddir=`pwd`;; - [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; - *) ac_abs_builddir=`pwd`/"$ac_dir";; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_builddir=${ac_top_builddir}.;; -*) - case ${ac_top_builddir}. in - .) ac_abs_top_builddir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; - *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_srcdir=$ac_srcdir;; -*) - case $ac_srcdir in - .) ac_abs_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; - *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_srcdir=$ac_top_srcdir;; -*) - case $ac_top_srcdir in - .) ac_abs_top_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; - *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; - esac;; -esac + case $ac_mode in + :F) + # + # CONFIG_FILE + # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; - *) ac_INSTALL=$ac_top_builddir$INSTALL ;; + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac +_ACEOF - if test x"$ac_file" != x-; then - { echo "$as_me:$LINENO: creating $ac_file" >&5 -echo "$as_me: creating $ac_file" >&6;} - rm -f "$ac_file" - fi - # Let's still pretend it is `configure' which instantiates (i.e., don't - # use $as_me), people would be surprised to read: - # /* config.h. Generated by config.status. */ - if test x"$ac_file" = x-; then - configure_input= - else - configure_input="$ac_file. " - fi - configure_input=$configure_input"Generated from `echo $ac_file_in | - sed 's,.*/,,'` by configure." - - # First look for the input files in the build tree, otherwise in the - # src tree. - ac_file_inputs=`IFS=: - for f in $ac_file_in; do - case $f in - -) echo $tmp/stdin ;; - [\\/$]*) - # Absolute (can't be DOS-style, as IFS=:) - test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - echo "$f";; - *) # Relative - if test -f "$f"; then - # Build tree - echo "$f" - elif test -f "$srcdir/$f"; then - # Source tree - echo "$srcdir/$f" - else - # /dev/null tree - { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - fi;; - esac - done` || { (exit 1); exit 1; } +cat >>$CONFIG_STATUS <<\_ACEOF +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= + +case `sed -n '/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p +' $ac_file_inputs` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac _ACEOF + +# Neutralize VPATH when `$srcdir' = `.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF sed "$ac_vpsub $extrasub @@ -12876,248 +13723,130 @@ _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b -s,@configure_input@,$configure_input,;t t -s,@srcdir@,$ac_srcdir,;t t -s,@abs_srcdir@,$ac_abs_srcdir,;t t -s,@top_srcdir@,$ac_top_srcdir,;t t -s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t -s,@builddir@,$ac_builddir,;t t -s,@abs_builddir@,$ac_abs_builddir,;t t -s,@top_builddir@,$ac_top_builddir,;t t -s,@abs_top_builddir@,$ac_abs_top_builddir,;t t -s,@INSTALL@,$ac_INSTALL,;t t -" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out - rm -f $tmp/stdin - if test x"$ac_file" != x-; then - mv $tmp/out $ac_file - else - cat $tmp/out - rm -f $tmp/out - fi - -done -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF - -# -# CONFIG_HEADER section. -# - -# 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=' ' -ac_dD=',;t' -# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE". -ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' -ac_uB='$,\1#\2define\3' -ac_uC=' ' -ac_uD=',;t' - -for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue - # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". +s&@configure_input@&$configure_input&;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +s&@INSTALL@&$ac_INSTALL&;t t +$ac_datarootdir_hack +" $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed -f "$tmp/subs-2.sed" >$tmp/out + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && + { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined." >&5 +echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined." >&2;} + + rm -f "$tmp/stdin" case $ac_file in - - | *:- | *:-:* ) # input from stdin - cat >$tmp/stdin - ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - * ) ac_file_in=$ac_file.in ;; + -) cat "$tmp/out"; rm -f "$tmp/out";; + *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; esac - - test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5 -echo "$as_me: creating $ac_file" >&6;} - - # First look for the input files in the build tree, otherwise in the - # src tree. - ac_file_inputs=`IFS=: - for f in $ac_file_in; do - case $f in - -) echo $tmp/stdin ;; - [\\/$]*) - # Absolute (can't be DOS-style, as IFS=:) - test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - # Do quote $f, to prevent DOS paths from being IFS'd. - echo "$f";; - *) # Relative - if test -f "$f"; then - # Build tree - echo "$f" - elif test -f "$srcdir/$f"; then - # Source tree - echo "$srcdir/$f" - else - # /dev/null tree - { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - fi;; - esac - done` || { (exit 1); exit 1; } - # Remove the trailing spaces. - sed 's/[ ]*$//' $ac_file_inputs >$tmp/in - -_ACEOF - -# Transform confdefs.h into two sed scripts, `conftest.defines' and -# `conftest.undefs', that substitutes the proper values into -# config.h.in to produce config.h. The first handles `#define' -# templates, and the second `#undef' templates. -# 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.defines conftest.undefs -# Using a here document instead of a string reduces the quoting nightmare. -# Putting comments in sed scripts is not portable. -# -# `end' is used to avoid that the second main sed command (meant for -# 0-ary CPP macros) applies to n-ary macro definitions. -# See the Autoconf documentation for `clear'. -cat >confdef2sed.sed <<\_ACEOF -s/[\\&,]/\\&/g -s,[\\$`],\\&,g -t clear -: clear -s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp -t end -s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp -: end -_ACEOF -# If some macros were called several times there might be several times -# the same #defines, which is useless. Nevertheless, we may not want to -# sort them, since we want the *last* AC-DEFINE to be honored. -uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines -sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs -rm -f confdef2sed.sed - -# This sed command replaces #undef with comments. This is necessary, for + ;; + :H) + # + # CONFIG_HEADER + # +_ACEOF + +# Transform confdefs.h into a sed script `conftest.defines', that +# substitutes the proper values into config.h.in to produce config.h. +rm -f conftest.defines conftest.tail +# First, append a space to every undef/define line, to ease matching. +echo 's/$/ /' >conftest.defines +# Then, protect against being on the right side of a sed subst, or in +# an unquoted here document, in config.status. If some macros were +# called several times there might be several #defines for the same +# symbol, which is useless. But do not sort them, since the last +# AC_DEFINE must be honored. +ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* +# These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where +# NAME is the cpp macro being defined, VALUE is the value it is being given. +# PARAMS is the parameter list in the macro definition--in most cases, it's +# just an empty string. +ac_dA='s,^\\([ #]*\\)[^ ]*\\([ ]*' +ac_dB='\\)[ (].*,\\1define\\2' +ac_dC=' ' +ac_dD=' ,' + +uniq confdefs.h | + sed -n ' + t rset + :rset + s/^[ ]*#[ ]*define[ ][ ]*// + t ok + d + :ok + s/[\\&,]/\\&/g + s/^\('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p + s/^\('"$ac_word_re"'\)[ ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p + ' >>conftest.defines + +# Remove the space that was appended to ease matching. +# Then replace #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.undefs <<\_ACEOF -s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */, -_ACEOF - -# Break up conftest.defines because some shells have a limit on the size -# of here documents, and old seds have small limits too (100 cmds). -echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS -echo ' if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS -echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS -echo ' :' >>$CONFIG_STATUS -rm -f conftest.tail -while grep . conftest.defines >/dev/null +# (The regexp can be short, since the line contains either #define or #undef.) +echo 's/ $// +s,^[ #]*u.*,/* & */,' >>conftest.defines + +# Break up conftest.defines: +ac_max_sed_lines=50 + +# First sed command is: sed -f defines.sed $ac_file_inputs >"$tmp/out1" +# Second one is: sed -f defines.sed "$tmp/out1" >"$tmp/out2" +# Third one will be: sed -f defines.sed "$tmp/out2" >"$tmp/out1" +# et cetera. +ac_in='$ac_file_inputs' +ac_out='"$tmp/out1"' +ac_nxt='"$tmp/out2"' + +while : do - # Write a limited-size here document to $tmp/defines.sed. - echo ' cat >$tmp/defines.sed <>$CONFIG_STATUS - # Speed up: don't consider the non `#define' lines. - echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS - # Work around the forget-to-reset-the-flag bug. - echo 't clr' >>$CONFIG_STATUS - echo ': clr' >>$CONFIG_STATUS - sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS + # Write a here document: + cat >>$CONFIG_STATUS <<_ACEOF + # First, check the format of the line: + cat >"\$tmp/defines.sed" <<\\CEOF +/^[ ]*#[ ]*undef[ ][ ]*$ac_word_re[ ]*\$/b def +/^[ ]*#[ ]*define[ ][ ]*$ac_word_re[( ]/b def +b +:def +_ACEOF + sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS echo 'CEOF - sed -f $tmp/defines.sed $tmp/in >$tmp/out - rm -f $tmp/in - mv $tmp/out $tmp/in -' >>$CONFIG_STATUS - sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail + sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS + ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in + sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail + grep . conftest.tail >/dev/null || break rm -f conftest.defines mv conftest.tail conftest.defines done -rm -f conftest.defines -echo ' fi # grep' >>$CONFIG_STATUS -echo >>$CONFIG_STATUS - -# Break up conftest.undefs because some shells have a limit on the size -# of here documents, and old seds have small limits too (100 cmds). -echo ' # Handle all the #undef templates' >>$CONFIG_STATUS -rm -f conftest.tail -while grep . conftest.undefs >/dev/null -do - # Write a limited-size here document to $tmp/undefs.sed. - echo ' cat >$tmp/undefs.sed <>$CONFIG_STATUS - # Speed up: don't consider the non `#undef' - echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS - # Work around the forget-to-reset-the-flag bug. - echo 't clr' >>$CONFIG_STATUS - echo ': clr' >>$CONFIG_STATUS - sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS - echo 'CEOF - sed -f $tmp/undefs.sed $tmp/in >$tmp/out - rm -f $tmp/in - mv $tmp/out $tmp/in -' >>$CONFIG_STATUS - sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail - rm -f conftest.undefs - mv conftest.tail conftest.undefs -done -rm -f conftest.undefs +rm -f conftest.defines conftest.tail +echo "ac_result=$ac_in" >>$CONFIG_STATUS cat >>$CONFIG_STATUS <<\_ACEOF - # Let's still pretend it is `configure' which instantiates (i.e., don't - # use $as_me), people would be surprised to read: - # /* config.h. Generated by config.status. */ - if test x"$ac_file" = x-; then - echo "/* Generated by configure. */" >$tmp/config.h - else - echo "/* $ac_file. Generated by configure. */" >$tmp/config.h - fi - cat $tmp/in >>$tmp/config.h - rm -f $tmp/in if test x"$ac_file" != x-; then - if diff $ac_file $tmp/config.h >/dev/null 2>&1; then + echo "/* $configure_input */" >"$tmp/config.h" + cat "$ac_result" >>"$tmp/config.h" + if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 echo "$as_me: $ac_file is unchanged" >&6;} else - ac_dir=`(dirname "$ac_file") 2>/dev/null || -$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_file" : 'X\(//\)[^/]' \| \ - X"$ac_file" : 'X\(//\)$' \| \ - X"$ac_file" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$ac_file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - { if $as_mkdir_p; then - mkdir -p "$ac_dir" - else - as_dir="$ac_dir" - as_dirs= - while test ! -d "$as_dir"; do - as_dirs="$as_dir $as_dirs" - as_dir=`(dirname "$as_dir") 2>/dev/null || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - done - test ! -n "$as_dirs" || mkdir $as_dirs - fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 -echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} - { (exit 1); exit 1; }; }; } - rm -f $ac_file - mv $tmp/config.h $ac_file + mv "$tmp/config.h" $ac_file fi else - cat $tmp/config.h - rm -f $tmp/config.h + echo "/* $configure_input */" + cat "$ac_result" fi + rm -f "$tmp/out12" # Compute $ac_file's index in $config_headers. _am_stamp_count=1 for _am_header in $config_headers :; do @@ -13128,135 +13857,39 @@ for _am_header in $config_headers :; do _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done -echo "timestamp for $ac_file" >`(dirname $ac_file) 2>/dev/null || +echo "timestamp for $ac_file" >`$as_dirname -- $ac_file || $as_expr X$ac_file : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X$ac_file : 'X\(//\)[^/]' \| \ X$ac_file : 'X\(//\)$' \| \ - X$ac_file : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || + X$ac_file : 'X\(/\)' \| . 2>/dev/null || echo X$ac_file | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'`/stamp-h$_am_stamp_count -done -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF - -# -# CONFIG_COMMANDS section. -# -for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue - ac_dest=`echo "$ac_file" | sed 's,:.*,,'` - ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_dir=`(dirname "$ac_dest") 2>/dev/null || -$as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_dest" : 'X\(//\)[^/]' \| \ - X"$ac_dest" : 'X\(//\)$' \| \ - X"$ac_dest" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$ac_dest" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - { if $as_mkdir_p; then - mkdir -p "$ac_dir" - else - as_dir="$ac_dir" - as_dirs= - while test ! -d "$as_dir"; do - as_dirs="$as_dir $as_dirs" - as_dir=`(dirname "$as_dir") 2>/dev/null || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - done - test ! -n "$as_dirs" || mkdir $as_dirs - fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 -echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} - { (exit 1); exit 1; }; }; } - - ac_builddir=. - -if test "$ac_dir" != .; then - ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A "../" for each directory in $ac_dir_suffix. - ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` -else - ac_dir_suffix= ac_top_builddir= -fi - -case $srcdir in - .) # No --srcdir option. We are building in place. - ac_srcdir=. - if test -z "$ac_top_builddir"; then - ac_top_srcdir=. - else - ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` - fi ;; - [\\/]* | ?:[\\/]* ) # Absolute path. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir ;; - *) # Relative path. - ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_builddir$srcdir ;; -esac + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'`/stamp-h$_am_stamp_count + ;; -# Do not use `cd foo && pwd` to compute absolute paths, because -# the directories may not exist. -case `pwd` in -.) ac_abs_builddir="$ac_dir";; -*) - case "$ac_dir" in - .) ac_abs_builddir=`pwd`;; - [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; - *) ac_abs_builddir=`pwd`/"$ac_dir";; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_builddir=${ac_top_builddir}.;; -*) - case ${ac_top_builddir}. in - .) ac_abs_top_builddir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; - *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_srcdir=$ac_srcdir;; -*) - case $ac_srcdir in - .) ac_abs_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; - *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_srcdir=$ac_top_srcdir;; -*) - case $ac_top_srcdir in - .) ac_abs_top_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; - *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; - esac;; -esac + :C) { echo "$as_me:$LINENO: executing $ac_file commands" >&5 +echo "$as_me: executing $ac_file commands" >&6;} + ;; + esac - { echo "$as_me:$LINENO: executing $ac_dest commands" >&5 -echo "$as_me: executing $ac_dest commands" >&6;} - case $ac_dest in - depfiles ) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do + case $ac_file$ac_mode in + "depfiles":C) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. @@ -13266,18 +13899,29 @@ echo "$as_me: executing $ac_dest commands" >&6;} # each Makefile.in and add a new line on top of each file to say so. # So let's grep whole file. if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then - dirpart=`(dirname "$mf") 2>/dev/null || + dirpart=`$as_dirname -- "$mf" || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ - X"$mf" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || + X"$mf" : 'X\(/\)' \| . 2>/dev/null || echo X"$mf" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` else continue fi @@ -13299,49 +13943,76 @@ echo X"$mf" | sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue - fdir=`(dirname "$file") 2>/dev/null || + fdir=`$as_dirname -- "$file" || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ - X"$file" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || + X"$file" : 'X\(/\)' \| . 2>/dev/null || echo X"$file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - { if $as_mkdir_p; then - mkdir -p $dirpart/$fdir - else - as_dir=$dirpart/$fdir + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + { as_dir=$dirpart/$fdir + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= - while test ! -d "$as_dir"; do - as_dirs="$as_dir $as_dirs" - as_dir=`(dirname "$as_dir") 2>/dev/null || + while :; do + case $as_dir in #( + *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break done - test ! -n "$as_dirs" || mkdir $as_dirs - fi || { { echo "$as_me:$LINENO: error: cannot create directory $dirpart/$fdir" >&5 -echo "$as_me: error: cannot create directory $dirpart/$fdir" >&2;} + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 +echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } - # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done ;; - libtool ) + "libtool":C) # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes. @@ -13890,7 +14561,7 @@ _LT_EOF chmod +x "$ofile" ;; - default-1 ) + "default-1":C) for ac_file in $CONFIG_FILES; do # Support "outfile[:infile[:infile...]]" case "$ac_file" in @@ -13991,11 +14662,10 @@ _LT_EOF ;; esac done ;; + esac -done -_ACEOF +done # for ac_tag -cat >>$CONFIG_STATUS <<\_ACEOF { (exit 0); exit 0; } _ACEOF diff --git a/opcodes/configure.in b/opcodes/configure.in index 4c86d79..cfaa30c 100644 --- a/opcodes/configure.in +++ b/opcodes/configure.in @@ -173,7 +173,8 @@ if test x${all_targets} = xfalse ; then archdefs="$archdefs -DARCH_$ad" case "$arch" in bfd_alpha_arch) ta="$ta alpha-dis.lo alpha-opc.lo" ;; - bfd_arc_arch) ta="$ta arc-asm.lo arc-desc.lo arc-dis.lo arc-ibld.lo arc-opc.lo arc-opinst.lo arc-ext.lo" using_cgen=yes ;; + #bfd_arc_arch) ta="$ta arc-dis.lo arc-opc.lo arc-ext.lo" ;; + bfd_arc_arch) ta="$ta arc-asm.lo arcompact-dis.lo arc-ext.lo arc-desc.lo arc-dis.lo arc-dis-cgen.lo arc-ibld.lo arc-opc.lo arc-opinst.lo" using_cgen=yes ;; bfd_arm_arch) ta="$ta arm-dis.lo" ;; bfd_avr_arch) ta="$ta avr-dis.lo" ;; bfd_bfin_arch) ta="$ta bfin-dis.lo" ;; diff --git a/opcodes/po/POTFILES.in b/opcodes/po/POTFILES.in index 250ad36..42f345820 100644 --- a/opcodes/po/POTFILES.in +++ b/opcodes/po/POTFILES.in @@ -1,8 +1,16 @@ alpha-dis.c alpha-opc.c +arc-asm.c +arc-desc.c +arc-desc.h arc-dis.c +arc-dis-cgen.c arc-ext.c +arc-ibld.c +arcompact-dis.c arc-opc.c +arc-opc.h +arc-opinst.c arm-dis.c avr-dis.c bfin-dis.c diff --git a/opcodes/po/opcodes.pot b/opcodes/po/opcodes.pot index 090a97c..7ea612d 100644 --- a/opcodes/po/opcodes.pot +++ b/opcodes/po/opcodes.pot @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2007-07-05 09:17+0100\n" +"Report-Msgid-Bugs-To: bug-binutils@gnu.org\n" +"POT-Creation-Date: 2009-03-20 08:50+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -24,90 +24,162 @@ msgstr "" msgid "jump hint unaligned" msgstr "" -#: arc-dis.c:77 -msgid "Illegal limm reference in last instruction!\n" +#. -- assembler routines inserted here. +#. -- asm.c +#: arc-asm.c:54 frv-asm.c:972 iq2000-asm.c:56 m32c-asm.c:141 m32c-asm.c:237 +#: m32c-asm.c:279 m32c-asm.c:338 m32c-asm.c:360 m32r-asm.c:53 mep-asm.c:232 +#: mep-asm.c:250 mep-asm.c:265 mep-asm.c:280 mep-asm.c:292 openrisc-asm.c:54 +msgid "missing `)'" msgstr "" -#: arc-opc.c:386 -msgid "unable to fit different valued constants into instruction" +#: arc-asm.c:500 fr30-asm.c:310 frv-asm.c:1263 ip2k-asm.c:511 iq2000-asm.c:459 +#: m32c-asm.c:1589 m32r-asm.c:328 mep-asm.c:1001 mt-asm.c:595 +#: openrisc-asm.c:241 xc16x-asm.c:376 xstormy16-asm.c:276 +#, c-format +msgid "Unrecognized field %d while parsing.\n" msgstr "" -#: arc-opc.c:395 -msgid "auxiliary register not allowed here" +#: arc-asm.c:551 fr30-asm.c:361 frv-asm.c:1314 ip2k-asm.c:562 iq2000-asm.c:510 +#: m32c-asm.c:1640 m32r-asm.c:379 mep-asm.c:1052 mt-asm.c:646 +#: openrisc-asm.c:292 xc16x-asm.c:427 xstormy16-asm.c:327 +msgid "missing mnemonic in syntax string" msgstr "" -#: arc-opc.c:401 arc-opc.c:418 -msgid "attempt to set readonly register" +#. We couldn't parse it. +#: arc-asm.c:686 arc-asm.c:690 arc-asm.c:777 arc-asm.c:878 fr30-asm.c:496 +#: fr30-asm.c:500 fr30-asm.c:587 fr30-asm.c:688 frv-asm.c:1449 frv-asm.c:1453 +#: frv-asm.c:1540 frv-asm.c:1641 ip2k-asm.c:697 ip2k-asm.c:701 ip2k-asm.c:788 +#: ip2k-asm.c:889 iq2000-asm.c:645 iq2000-asm.c:649 iq2000-asm.c:736 +#: iq2000-asm.c:837 m32c-asm.c:1775 m32c-asm.c:1779 m32c-asm.c:1866 +#: m32c-asm.c:1967 m32r-asm.c:514 m32r-asm.c:518 m32r-asm.c:605 m32r-asm.c:706 +#: mep-asm.c:1187 mep-asm.c:1191 mep-asm.c:1278 mep-asm.c:1379 mt-asm.c:781 +#: mt-asm.c:785 mt-asm.c:872 mt-asm.c:973 openrisc-asm.c:427 +#: openrisc-asm.c:431 openrisc-asm.c:518 openrisc-asm.c:619 xc16x-asm.c:562 +#: xc16x-asm.c:566 xc16x-asm.c:653 xc16x-asm.c:754 xstormy16-asm.c:462 +#: xstormy16-asm.c:466 xstormy16-asm.c:553 xstormy16-asm.c:654 +msgid "unrecognized instruction" msgstr "" -#: arc-opc.c:406 arc-opc.c:423 -msgid "attempt to read writeonly register" +#: arc-asm.c:733 fr30-asm.c:543 frv-asm.c:1496 ip2k-asm.c:744 iq2000-asm.c:692 +#: m32c-asm.c:1822 m32r-asm.c:561 mep-asm.c:1234 mt-asm.c:828 +#: openrisc-asm.c:474 xc16x-asm.c:609 xstormy16-asm.c:509 +#, c-format +msgid "syntax error (expected char `%c', found `%c')" msgstr "" -#: arc-opc.c:428 +#: arc-asm.c:743 fr30-asm.c:553 frv-asm.c:1506 ip2k-asm.c:754 iq2000-asm.c:702 +#: m32c-asm.c:1832 m32r-asm.c:571 mep-asm.c:1244 mt-asm.c:838 +#: openrisc-asm.c:484 xc16x-asm.c:619 xstormy16-asm.c:519 #, c-format -msgid "invalid register number `%d'" +msgid "syntax error (expected char `%c', found end of instruction)" msgstr "" -#: arc-opc.c:594 arc-opc.c:645 arc-opc.c:673 -msgid "too many long constants" +#: arc-asm.c:771 fr30-asm.c:581 frv-asm.c:1534 ip2k-asm.c:782 iq2000-asm.c:730 +#: m32c-asm.c:1860 m32r-asm.c:599 mep-asm.c:1272 mt-asm.c:866 +#: openrisc-asm.c:512 xc16x-asm.c:647 xstormy16-asm.c:547 +msgid "junk at end of line" msgstr "" -#: arc-opc.c:668 -msgid "to many shimms in load" +#: arc-asm.c:877 fr30-asm.c:687 frv-asm.c:1640 ip2k-asm.c:888 iq2000-asm.c:836 +#: m32c-asm.c:1966 m32r-asm.c:705 mep-asm.c:1378 mt-asm.c:972 +#: openrisc-asm.c:618 xc16x-asm.c:753 xstormy16-asm.c:653 +msgid "unrecognized form of instruction" msgstr "" -#. Do we have a limm already? -#: arc-opc.c:781 -msgid "impossible store" +#: arc-asm.c:889 fr30-asm.c:699 frv-asm.c:1652 ip2k-asm.c:900 iq2000-asm.c:848 +#: m32c-asm.c:1978 m32r-asm.c:717 mep-asm.c:1390 mt-asm.c:984 +#: openrisc-asm.c:630 xc16x-asm.c:765 xstormy16-asm.c:665 +#, c-format +msgid "bad instruction `%.50s...'" msgstr "" -#: arc-opc.c:814 -msgid "st operand error" +#: arc-asm.c:892 fr30-asm.c:702 frv-asm.c:1655 ip2k-asm.c:903 iq2000-asm.c:851 +#: m32c-asm.c:1981 m32r-asm.c:720 mep-asm.c:1393 mt-asm.c:987 +#: openrisc-asm.c:633 xc16x-asm.c:768 xstormy16-asm.c:668 +#, c-format +msgid "bad instruction `%.50s'" msgstr "" -#: arc-opc.c:818 arc-opc.c:860 -msgid "address writeback not allowed" +#: arc-dis.c:77 +msgid "Illegal limm reference in last instruction!\n" msgstr "" -#: arc-opc.c:822 -msgid "store value must be zero" +#. Default text to print if an instruction isn't recognized. +#: arc-dis-cgen.c:45 fr30-dis.c:41 frv-dis.c:41 ip2k-dis.c:41 iq2000-dis.c:41 +#: m32c-dis.c:41 m32r-dis.c:41 mep-dis.c:41 mmix-dis.c:278 mt-dis.c:41 +#: openrisc-dis.c:41 xc16x-dis.c:41 xstormy16-dis.c:41 +msgid "*unknown*" msgstr "" -#: arc-opc.c:847 -msgid "invalid load/shimm insn" +#: arc-dis-cgen.c:395 fr30-dis.c:299 frv-dis.c:396 ip2k-dis.c:288 +#: iq2000-dis.c:189 m32c-dis.c:891 m32r-dis.c:256 mep-dis.c:776 mt-dis.c:290 +#: openrisc-dis.c:135 xc16x-dis.c:375 xstormy16-dis.c:168 +#, c-format +msgid "Unrecognized field %d while printing insn.\n" msgstr "" -#: arc-opc.c:856 -msgid "ld operand error" +#: arc-ibld.c:163 fr30-ibld.c:163 frv-ibld.c:163 ip2k-ibld.c:163 +#: iq2000-ibld.c:163 m32c-ibld.c:163 m32r-ibld.c:163 mep-ibld.c:163 +#: mt-ibld.c:163 openrisc-ibld.c:163 xc16x-ibld.c:163 xstormy16-ibld.c:163 +#, c-format +msgid "operand out of range (%ld not between %ld and %lu)" msgstr "" -#: arc-opc.c:943 -msgid "jump flags, but no .f seen" +#: arc-ibld.c:184 fr30-ibld.c:184 frv-ibld.c:184 ip2k-ibld.c:184 +#: iq2000-ibld.c:184 m32c-ibld.c:184 m32r-ibld.c:184 mep-ibld.c:184 +#: mt-ibld.c:184 openrisc-ibld.c:184 xc16x-ibld.c:184 xstormy16-ibld.c:184 +#, c-format +msgid "operand out of range (0x%lx not between 0 and 0x%lx)" msgstr "" -#: arc-opc.c:946 -msgid "jump flags, but no limm addr" +#: arc-ibld.c:200 cgen-asm.c:336 fr30-ibld.c:200 frv-ibld.c:200 +#: ip2k-ibld.c:200 iq2000-ibld.c:200 m32c-ibld.c:200 m32r-ibld.c:200 +#: mep-ibld.c:200 mt-ibld.c:200 openrisc-ibld.c:200 xc16x-ibld.c:200 +#: xstormy16-ibld.c:200 +#, c-format +msgid "operand out of range (%ld not between %ld and %ld)" msgstr "" -#: arc-opc.c:949 -msgid "flag bits of jump address limm lost" +#: arc-ibld.c:954 fr30-ibld.c:726 frv-ibld.c:852 ip2k-ibld.c:603 +#: iq2000-ibld.c:709 m32c-ibld.c:1727 m32r-ibld.c:661 mep-ibld.c:1024 +#: mt-ibld.c:745 openrisc-ibld.c:629 xc16x-ibld.c:748 xstormy16-ibld.c:674 +#, c-format +msgid "Unrecognized field %d while building insn.\n" msgstr "" -#: arc-opc.c:952 -msgid "attempt to set HR bits" +#: arc-ibld.c:1355 fr30-ibld.c:931 frv-ibld.c:1169 ip2k-ibld.c:678 +#: iq2000-ibld.c:884 m32c-ibld.c:2888 m32r-ibld.c:798 mep-ibld.c:1444 +#: mt-ibld.c:965 openrisc-ibld.c:729 xc16x-ibld.c:968 xstormy16-ibld.c:820 +#, c-format +msgid "Unrecognized field %d while decoding insn.\n" msgstr "" -#: arc-opc.c:955 -msgid "bad jump flags value" +#: arc-ibld.c:1618 fr30-ibld.c:1077 frv-ibld.c:1447 ip2k-ibld.c:752 +#: iq2000-ibld.c:1015 m32c-ibld.c:3505 m32r-ibld.c:911 mep-ibld.c:1737 +#: mt-ibld.c:1165 openrisc-ibld.c:806 xc16x-ibld.c:1189 xstormy16-ibld.c:930 +#, c-format +msgid "Unrecognized field %d while getting int operand.\n" msgstr "" -#: arc-opc.c:988 -msgid "branch address not on 4 byte boundary" +#: arc-ibld.c:1863 fr30-ibld.c:1205 frv-ibld.c:1707 ip2k-ibld.c:808 +#: iq2000-ibld.c:1128 m32c-ibld.c:4104 m32r-ibld.c:1006 mep-ibld.c:2012 +#: mt-ibld.c:1347 openrisc-ibld.c:865 xc16x-ibld.c:1392 xstormy16-ibld.c:1022 +#, c-format +msgid "Unrecognized field %d while getting vma operand.\n" msgstr "" -#: arc-opc.c:1024 -msgid "must specify .jd or no nullify suffix" +#: arc-ibld.c:2096 fr30-ibld.c:1336 frv-ibld.c:1974 ip2k-ibld.c:867 +#: iq2000-ibld.c:1248 m32c-ibld.c:4691 m32r-ibld.c:1107 mep-ibld.c:2271 +#: mt-ibld.c:1536 openrisc-ibld.c:931 xc16x-ibld.c:1596 xstormy16-ibld.c:1121 +#, c-format +msgid "Unrecognized field %d while setting int operand.\n" +msgstr "" + +#: arc-ibld.c:2319 fr30-ibld.c:1457 frv-ibld.c:2231 ip2k-ibld.c:916 +#: iq2000-ibld.c:1358 m32c-ibld.c:5268 m32r-ibld.c:1198 mep-ibld.c:2520 +#: mt-ibld.c:1715 openrisc-ibld.c:987 xc16x-ibld.c:1790 xstormy16-ibld.c:1210 +#, c-format +msgid "Unrecognized field %d while setting vma operand.\n" msgstr "" #: arm-dis.c:1808 @@ -126,7 +198,7 @@ msgstr "" msgid "Unrecognised disassembler option: %s\n" msgstr "" -#: arm-dis.c:4226 +#: arm-dis.c:4227 #, c-format msgid "" "\n" @@ -149,13 +221,6 @@ msgstr "" msgid "unknown constraint `%c'" msgstr "" -#: cgen-asm.c:336 fr30-ibld.c:200 frv-ibld.c:200 ip2k-ibld.c:200 -#: iq2000-ibld.c:200 m32c-ibld.c:200 m32r-ibld.c:200 mep-ibld.c:200 -#: mt-ibld.c:200 openrisc-ibld.c:200 xc16x-ibld.c:200 xstormy16-ibld.c:200 -#, c-format -msgid "operand out of range (%ld not between %ld and %ld)" -msgstr "" - #: cgen-asm.c:358 #, c-format msgid "operand out of range (%lu not between %lu and %lu)" @@ -193,144 +258,6 @@ msgstr "" msgid "Register list is not valid" msgstr "" -#: fr30-asm.c:310 frv-asm.c:1263 ip2k-asm.c:511 iq2000-asm.c:459 -#: m32c-asm.c:1589 m32r-asm.c:328 mep-asm.c:1001 mt-asm.c:595 -#: openrisc-asm.c:241 xc16x-asm.c:375 xstormy16-asm.c:276 -#, c-format -msgid "Unrecognized field %d while parsing.\n" -msgstr "" - -#: fr30-asm.c:361 frv-asm.c:1314 ip2k-asm.c:562 iq2000-asm.c:510 -#: m32c-asm.c:1640 m32r-asm.c:379 mep-asm.c:1052 mt-asm.c:646 -#: openrisc-asm.c:292 xc16x-asm.c:426 xstormy16-asm.c:327 -msgid "missing mnemonic in syntax string" -msgstr "" - -#. We couldn't parse it. -#: fr30-asm.c:496 fr30-asm.c:500 fr30-asm.c:587 fr30-asm.c:688 frv-asm.c:1449 -#: frv-asm.c:1453 frv-asm.c:1540 frv-asm.c:1641 ip2k-asm.c:697 ip2k-asm.c:701 -#: ip2k-asm.c:788 ip2k-asm.c:889 iq2000-asm.c:645 iq2000-asm.c:649 -#: iq2000-asm.c:736 iq2000-asm.c:837 m32c-asm.c:1775 m32c-asm.c:1779 -#: m32c-asm.c:1866 m32c-asm.c:1967 m32r-asm.c:514 m32r-asm.c:518 -#: m32r-asm.c:605 m32r-asm.c:706 mep-asm.c:1187 mep-asm.c:1191 mep-asm.c:1278 -#: mep-asm.c:1379 mt-asm.c:781 mt-asm.c:785 mt-asm.c:872 mt-asm.c:973 -#: openrisc-asm.c:427 openrisc-asm.c:431 openrisc-asm.c:518 openrisc-asm.c:619 -#: xc16x-asm.c:561 xc16x-asm.c:565 xc16x-asm.c:652 xc16x-asm.c:753 -#: xstormy16-asm.c:462 xstormy16-asm.c:466 xstormy16-asm.c:553 -#: xstormy16-asm.c:654 -msgid "unrecognized instruction" -msgstr "" - -#: fr30-asm.c:543 frv-asm.c:1496 ip2k-asm.c:744 iq2000-asm.c:692 -#: m32c-asm.c:1822 m32r-asm.c:561 mep-asm.c:1234 mt-asm.c:828 -#: openrisc-asm.c:474 xc16x-asm.c:608 xstormy16-asm.c:509 -#, c-format -msgid "syntax error (expected char `%c', found `%c')" -msgstr "" - -#: fr30-asm.c:553 frv-asm.c:1506 ip2k-asm.c:754 iq2000-asm.c:702 -#: m32c-asm.c:1832 m32r-asm.c:571 mep-asm.c:1244 mt-asm.c:838 -#: openrisc-asm.c:484 xc16x-asm.c:618 xstormy16-asm.c:519 -#, c-format -msgid "syntax error (expected char `%c', found end of instruction)" -msgstr "" - -#: fr30-asm.c:581 frv-asm.c:1534 ip2k-asm.c:782 iq2000-asm.c:730 -#: m32c-asm.c:1860 m32r-asm.c:599 mep-asm.c:1272 mt-asm.c:866 -#: openrisc-asm.c:512 xc16x-asm.c:646 xstormy16-asm.c:547 -msgid "junk at end of line" -msgstr "" - -#: fr30-asm.c:687 frv-asm.c:1640 ip2k-asm.c:888 iq2000-asm.c:836 -#: m32c-asm.c:1966 m32r-asm.c:705 mep-asm.c:1378 mt-asm.c:972 -#: openrisc-asm.c:618 xc16x-asm.c:752 xstormy16-asm.c:653 -msgid "unrecognized form of instruction" -msgstr "" - -#: fr30-asm.c:699 frv-asm.c:1652 ip2k-asm.c:900 iq2000-asm.c:848 -#: m32c-asm.c:1978 m32r-asm.c:717 mep-asm.c:1390 mt-asm.c:984 -#: openrisc-asm.c:630 xc16x-asm.c:764 xstormy16-asm.c:665 -#, c-format -msgid "bad instruction `%.50s...'" -msgstr "" - -#: fr30-asm.c:702 frv-asm.c:1655 ip2k-asm.c:903 iq2000-asm.c:851 -#: m32c-asm.c:1981 m32r-asm.c:720 mep-asm.c:1393 mt-asm.c:987 -#: openrisc-asm.c:633 xc16x-asm.c:767 xstormy16-asm.c:668 -#, c-format -msgid "bad instruction `%.50s'" -msgstr "" - -#. Default text to print if an instruction isn't recognized. -#: fr30-dis.c:41 frv-dis.c:41 ip2k-dis.c:41 iq2000-dis.c:41 m32c-dis.c:41 -#: m32r-dis.c:41 mep-dis.c:41 mmix-dis.c:278 mt-dis.c:41 openrisc-dis.c:41 -#: xc16x-dis.c:41 xstormy16-dis.c:41 -msgid "*unknown*" -msgstr "" - -#: fr30-dis.c:299 frv-dis.c:396 ip2k-dis.c:288 iq2000-dis.c:189 m32c-dis.c:891 -#: m32r-dis.c:256 mep-dis.c:776 mt-dis.c:290 openrisc-dis.c:135 -#: xc16x-dis.c:375 xstormy16-dis.c:168 -#, c-format -msgid "Unrecognized field %d while printing insn.\n" -msgstr "" - -#: fr30-ibld.c:163 frv-ibld.c:163 ip2k-ibld.c:163 iq2000-ibld.c:163 -#: m32c-ibld.c:163 m32r-ibld.c:163 mep-ibld.c:163 mt-ibld.c:163 -#: openrisc-ibld.c:163 xc16x-ibld.c:163 xstormy16-ibld.c:163 -#, c-format -msgid "operand out of range (%ld not between %ld and %lu)" -msgstr "" - -#: fr30-ibld.c:184 frv-ibld.c:184 ip2k-ibld.c:184 iq2000-ibld.c:184 -#: m32c-ibld.c:184 m32r-ibld.c:184 mep-ibld.c:184 mt-ibld.c:184 -#: openrisc-ibld.c:184 xc16x-ibld.c:184 xstormy16-ibld.c:184 -#, c-format -msgid "operand out of range (0x%lx not between 0 and 0x%lx)" -msgstr "" - -#: fr30-ibld.c:726 frv-ibld.c:852 ip2k-ibld.c:603 iq2000-ibld.c:709 -#: m32c-ibld.c:1727 m32r-ibld.c:661 mep-ibld.c:1024 mt-ibld.c:745 -#: openrisc-ibld.c:629 xc16x-ibld.c:748 xstormy16-ibld.c:674 -#, c-format -msgid "Unrecognized field %d while building insn.\n" -msgstr "" - -#: fr30-ibld.c:931 frv-ibld.c:1169 ip2k-ibld.c:678 iq2000-ibld.c:884 -#: m32c-ibld.c:2888 m32r-ibld.c:798 mep-ibld.c:1444 mt-ibld.c:965 -#: openrisc-ibld.c:729 xc16x-ibld.c:968 xstormy16-ibld.c:820 -#, c-format -msgid "Unrecognized field %d while decoding insn.\n" -msgstr "" - -#: fr30-ibld.c:1077 frv-ibld.c:1447 ip2k-ibld.c:752 iq2000-ibld.c:1015 -#: m32c-ibld.c:3505 m32r-ibld.c:911 mep-ibld.c:1737 mt-ibld.c:1165 -#: openrisc-ibld.c:806 xc16x-ibld.c:1189 xstormy16-ibld.c:930 -#, c-format -msgid "Unrecognized field %d while getting int operand.\n" -msgstr "" - -#: fr30-ibld.c:1205 frv-ibld.c:1707 ip2k-ibld.c:808 iq2000-ibld.c:1128 -#: m32c-ibld.c:4104 m32r-ibld.c:1006 mep-ibld.c:2012 mt-ibld.c:1347 -#: openrisc-ibld.c:865 xc16x-ibld.c:1392 xstormy16-ibld.c:1022 -#, c-format -msgid "Unrecognized field %d while getting vma operand.\n" -msgstr "" - -#: fr30-ibld.c:1336 frv-ibld.c:1974 ip2k-ibld.c:867 iq2000-ibld.c:1248 -#: m32c-ibld.c:4691 m32r-ibld.c:1107 mep-ibld.c:2271 mt-ibld.c:1536 -#: openrisc-ibld.c:931 xc16x-ibld.c:1596 xstormy16-ibld.c:1121 -#, c-format -msgid "Unrecognized field %d while setting int operand.\n" -msgstr "" - -#: fr30-ibld.c:1457 frv-ibld.c:2231 ip2k-ibld.c:916 iq2000-ibld.c:1358 -#: m32c-ibld.c:5268 m32r-ibld.c:1198 mep-ibld.c:2520 mt-ibld.c:1715 -#: openrisc-ibld.c:987 xc16x-ibld.c:1790 xstormy16-ibld.c:1210 -#, c-format -msgid "Unrecognized field %d while setting vma operand.\n" -msgstr "" - #: frv-asm.c:608 msgid "missing `]'" msgstr "" @@ -347,14 +274,6 @@ msgstr "" msgid "register number must be even" msgstr "" -#. -- assembler routines inserted here. -#. -- asm.c -#: frv-asm.c:972 iq2000-asm.c:56 m32c-asm.c:141 m32c-asm.c:237 m32c-asm.c:279 -#: m32c-asm.c:338 m32c-asm.c:360 m32r-asm.c:53 mep-asm.c:232 mep-asm.c:250 -#: mep-asm.c:265 mep-asm.c:280 mep-asm.c:292 openrisc-asm.c:54 -msgid "missing `)'" -msgstr "" - #: h8300-dis.c:327 #, c-format msgid "Hmmmm 0x%x" @@ -376,11 +295,11 @@ msgstr "" msgid "%02x\t\t*unknown*" msgstr "" -#: i386-dis.c:3196 +#: i386-dis.c:4906 msgid "" msgstr "" -#: i386-dis.c:3423 +#: i386-dis.c:5134 #, c-format msgid "" "\n" @@ -389,79 +308,120 @@ msgid "" "with the -M switch (multiple options should be separated by commas):\n" msgstr "" -#: i386-dis.c:3427 +#: i386-dis.c:5138 #, c-format msgid " x86-64 Disassemble in 64bit mode\n" msgstr "" -#: i386-dis.c:3428 +#: i386-dis.c:5139 #, c-format msgid " i386 Disassemble in 32bit mode\n" msgstr "" -#: i386-dis.c:3429 +#: i386-dis.c:5140 #, c-format msgid " i8086 Disassemble in 16bit mode\n" msgstr "" -#: i386-dis.c:3430 +#: i386-dis.c:5141 #, c-format msgid " att Display instruction in AT&T syntax\n" msgstr "" -#: i386-dis.c:3431 +#: i386-dis.c:5142 #, c-format msgid " intel Display instruction in Intel syntax\n" msgstr "" -#: i386-dis.c:3432 +#: i386-dis.c:5143 +#, c-format +msgid "" +" att-mnemonic\n" +" Display instruction in AT&T mnemonic\n" +msgstr "" + +#: i386-dis.c:5145 +#, c-format +msgid "" +" intel-mnemonic\n" +" Display instruction in Intel mnemonic\n" +msgstr "" + +#: i386-dis.c:5147 #, c-format msgid " addr64 Assume 64bit address size\n" msgstr "" -#: i386-dis.c:3433 +#: i386-dis.c:5148 #, c-format msgid " addr32 Assume 32bit address size\n" msgstr "" -#: i386-dis.c:3434 +#: i386-dis.c:5149 #, c-format msgid " addr16 Assume 16bit address size\n" msgstr "" -#: i386-dis.c:3435 +#: i386-dis.c:5150 #, c-format msgid " data32 Assume 32bit data size\n" msgstr "" -#: i386-dis.c:3436 +#: i386-dis.c:5151 #, c-format msgid " data16 Assume 16bit data size\n" msgstr "" -#: i386-dis.c:3437 +#: i386-dis.c:5152 #, c-format msgid " suffix Always display instruction suffix in AT&T syntax\n" msgstr "" -#: i386-gen.c:42 ia64-gen.c:307 +#: i386-gen.c:372 ia64-gen.c:307 #, c-format msgid "%s: Error: " msgstr "" -#: i386-gen.c:109 -msgid "can't find i386-opc.tbl for reading\n" +#: i386-gen.c:471 +#, c-format +msgid "%s: %d: Unknown bitfield: %s\n" msgstr "" -#: i386-gen.c:260 -msgid "can't find i386-reg.tbl for reading\n" +#: i386-gen.c:635 +#, c-format +msgid "can't find i386-opc.tbl for reading, errno = %s\n" msgstr "" -#: i386-gen.c:386 ia64-gen.c:2841 +#: i386-gen.c:812 +#, c-format +msgid "can't find i386-reg.tbl for reading, errno = %s\n" +msgstr "" + +#: i386-gen.c:904 +#, c-format +msgid "can't create i386-init.h, errno = %s\n" +msgstr "" + +#: i386-gen.c:993 ia64-gen.c:2848 #, c-format msgid "unable to change directory to \"%s\", errno = %s\n" msgstr "" +#: i386-gen.c:1000 +#, c-format +msgid "%d unused bits in i386_cpu_flags.\n" +msgstr "" + +#: i386-gen.c:1007 +#, c-format +msgid "%d unused bits in i386_operand_type.\n" +msgstr "" + +#: i386-gen.c:1021 +#, c-format +msgid "can't create i386-tbl.h, errno = %s\n" +msgstr "" + #: ia64-gen.c:320 #, c-format msgid "%s: Warning: " @@ -498,62 +458,67 @@ msgstr "" msgid "overwriting note %d with note %d (IC:%s)\n" msgstr "" -#: ia64-gen.c:1455 +#: ia64-gen.c:1457 #, c-format msgid "don't know how to specify %% dependency %s\n" msgstr "" -#: ia64-gen.c:1477 +#: ia64-gen.c:1479 #, c-format msgid "Don't know how to specify # dependency %s\n" msgstr "" -#: ia64-gen.c:1516 +#: ia64-gen.c:1518 #, c-format msgid "IC:%s [%s] has no terminals or sub-classes\n" msgstr "" -#: ia64-gen.c:1519 +#: ia64-gen.c:1521 #, c-format msgid "IC:%s has no terminals or sub-classes\n" msgstr "" -#: ia64-gen.c:1528 +#: ia64-gen.c:1530 #, c-format msgid "no insns mapped directly to terminal IC %s [%s]" msgstr "" -#: ia64-gen.c:1531 +#: ia64-gen.c:1533 #, c-format msgid "no insns mapped directly to terminal IC %s\n" msgstr "" -#: ia64-gen.c:1542 +#: ia64-gen.c:1544 #, c-format msgid "class %s is defined but not used\n" msgstr "" -#: ia64-gen.c:1553 +#: ia64-gen.c:1557 +#, c-format +msgid "Warning: rsrc %s (%s) has no chks\n" +msgstr "" + +#: ia64-gen.c:1560 #, c-format -msgid "Warning: rsrc %s (%s) has no chks%s\n" +msgid "Warning: rsrc %s (%s) has no chks or regs\n" msgstr "" -#: ia64-gen.c:1557 +#: ia64-gen.c:1564 #, c-format msgid "rsrc %s (%s) has no regs\n" msgstr "" -#: ia64-gen.c:2469 +#: ia64-gen.c:2476 #, c-format msgid "IC note %d in opcode %s (IC:%s) conflicts with resource %s note %d\n" msgstr "" -#: ia64-gen.c:2497 +#: ia64-gen.c:2504 #, c-format msgid "IC note %d for opcode %s (IC:%s) conflicts with resource %s note %d\n" msgstr "" -#: ia64-gen.c:2511 +#: ia64-gen.c:2518 #, c-format msgid "opcode %s has no class (ops %d %d %d)\n" msgstr "" @@ -734,26 +699,26 @@ msgstr "" msgid "invalid %function() here" msgstr "" -#: mips-dis.c:745 +#: mips-dis.c:781 msgid "# internal error, incomplete extension sequence (+)" msgstr "" -#: mips-dis.c:852 +#: mips-dis.c:888 #, c-format msgid "# internal error, undefined extension sequence (+%c)" msgstr "" -#: mips-dis.c:1211 +#: mips-dis.c:1247 #, c-format -msgid "# internal error, undefined modifier(%c)" +msgid "# internal error, undefined modifier (%c)" msgstr "" -#: mips-dis.c:1818 +#: mips-dis.c:1854 #, c-format msgid "# internal disassembler error, unrecognised modifier (%c)" msgstr "" -#: mips-dis.c:2049 +#: mips-dis.c:2085 #, c-format msgid "" "\n" @@ -761,7 +726,7 @@ msgid "" "with the -M switch (multiple options should be separated by commas):\n" msgstr "" -#: mips-dis.c:2053 +#: mips-dis.c:2089 #, c-format msgid "" "\n" @@ -769,7 +734,7 @@ msgid "" " Default: based on binary being disassembled.\n" msgstr "" -#: mips-dis.c:2057 +#: mips-dis.c:2093 #, c-format msgid "" "\n" @@ -777,7 +742,7 @@ msgid "" " Default: numeric.\n" msgstr "" -#: mips-dis.c:2061 +#: mips-dis.c:2097 #, c-format msgid "" "\n" @@ -786,7 +751,7 @@ msgid "" " Default: based on binary being disassembled.\n" msgstr "" -#: mips-dis.c:2066 +#: mips-dis.c:2102 #, c-format msgid "" "\n" @@ -795,7 +760,7 @@ msgid "" " Default: based on binary being disassembled.\n" msgstr "" -#: mips-dis.c:2071 +#: mips-dis.c:2107 #, c-format msgid "" "\n" @@ -803,7 +768,7 @@ msgid "" " specified ABI.\n" msgstr "" -#: mips-dis.c:2075 +#: mips-dis.c:2111 #, c-format msgid "" "\n" @@ -811,7 +776,7 @@ msgid "" " specified architecture.\n" msgstr "" -#: mips-dis.c:2079 +#: mips-dis.c:2115 #, c-format msgid "" "\n" @@ -819,12 +784,12 @@ msgid "" " " msgstr "" -#: mips-dis.c:2084 mips-dis.c:2092 mips-dis.c:2094 +#: mips-dis.c:2120 mips-dis.c:2128 mips-dis.c:2130 #, c-format msgid "\n" msgstr "" -#: mips-dis.c:2086 +#: mips-dis.c:2122 #, c-format msgid "" "\n" @@ -860,8 +825,7 @@ msgid "Biiiig Trouble in parse_imm16!" msgstr "" #: mt-asm.c:157 -#, c-format -msgid "%operator operand is not a symbol" +msgid "The percent-operator's operand is not a symbol" msgstr "" #: mt-asm.c:395 @@ -878,39 +842,39 @@ msgstr "" msgid "$" msgstr "" -#: ppc-opc.c:782 ppc-opc.c:810 +#: ppc-opc.c:801 ppc-opc.c:829 msgid "invalid conditional option" msgstr "" -#: ppc-opc.c:812 +#: ppc-opc.c:831 msgid "attempt to set y bit when using + or - modifier" msgstr "" -#: ppc-opc.c:844 +#: ppc-opc.c:863 msgid "invalid mask field" msgstr "" -#: ppc-opc.c:870 +#: ppc-opc.c:889 msgid "ignoring invalid mfcr mask" msgstr "" -#: ppc-opc.c:920 ppc-opc.c:955 +#: ppc-opc.c:939 ppc-opc.c:974 msgid "illegal bitmask" msgstr "" -#: ppc-opc.c:1075 +#: ppc-opc.c:1094 msgid "index register in load range" msgstr "" -#: ppc-opc.c:1091 +#: ppc-opc.c:1110 msgid "source and target register operands must be different" msgstr "" -#: ppc-opc.c:1106 +#: ppc-opc.c:1125 msgid "invalid register operand when updating" msgstr "" -#: ppc-opc.c:1188 +#: ppc-opc.c:1207 msgid "invalid sprg number" msgstr "" @@ -997,27 +961,27 @@ msgstr "" msgid "immediate value must be even" msgstr "" -#: xc16x-asm.c:65 +#: xc16x-asm.c:66 msgid "Missing '#' prefix" msgstr "" -#: xc16x-asm.c:81 +#: xc16x-asm.c:82 msgid "Missing '.' prefix" msgstr "" -#: xc16x-asm.c:97 +#: xc16x-asm.c:98 msgid "Missing 'pof:' prefix" msgstr "" -#: xc16x-asm.c:113 +#: xc16x-asm.c:114 msgid "Missing 'pag:' prefix" msgstr "" -#: xc16x-asm.c:129 +#: xc16x-asm.c:130 msgid "Missing 'sof:' prefix" msgstr "" -#: xc16x-asm.c:145 +#: xc16x-asm.c:146 msgid "Missing 'seg:' prefix" msgstr "" diff --git a/sim/arc/ChangeLog b/sim/arc/ChangeLog index a740378..f34493b 100644 --- a/sim/arc/ChangeLog +++ b/sim/arc/ChangeLog @@ -1,3 +1,10 @@ +2009-03-20 J"orn Rennecke + + * sim-if.c: Fixed some of the formatting issues. + (stack_setup): Always push environment. + (sim_create_inferior): Clear envp if PUSH_ENVIRONMENT_ONTO_STACK + is not set. + 2008-11-18 J"orn Rennecke * sem5.c, sem6.c, sem7.c: Regenerate. diff --git a/sim/arc/Makefile.in b/sim/arc/Makefile.in index cb32de2..532d57b 100644 --- a/sim/arc/Makefile.in +++ b/sim/arc/Makefile.in @@ -21,7 +21,7 @@ ## COMMON_PRE_CONFIG_FRAG -ARC5_OBJS = arc5.o cpu5.o decode5.o sem5.o model5.o mloop5.o +ARC5_OBJS = arc5.o cpu5.o decode5.o sem5.o model5.o mloop5.o arc-sim-registers.o ARC6_OBJS = arc6.o cpu6.o decode6.o sem6.o model6.o mloop6.o ARC7_OBJS = arc7.o cpu7.o decode7.o sem7.o model7.o mloop7.o TRAPS_OBJ = @traps_obj@ @@ -75,10 +75,12 @@ devices.o: devices.c $(SIM_MAIN_DEPS) ARC5_INCLUDE_DEPS = \ $(CGEN_MAIN_CPU_DEPS) \ - cpu5.h decode5.h eng5.h + cpu5.h decode5.h eng5.h arc-sim-registers.h arc5.o: arc5.c $(ARC5_INCLUDE_DEPS) +arc-sim-registers.o: arc-sim-registers.c arc-sim-registers.h arc-sim.h + # FIXME: Use of `mono' is wip. mloop5.c eng5.h: stamp-5mloop stamp-5mloop: $(srcdir)/../common/genmloop.sh mloop5.in Makefile diff --git a/sim/arc/arc-sim-registers.c b/sim/arc/arc-sim-registers.c new file mode 100644 index 0000000..516deb0 --- /dev/null +++ b/sim/arc/arc-sim-registers.c @@ -0,0 +1,149 @@ +/* Target dependent code for ARC700, for GDB, the GNU debugger. + + Contributed by ARC International (www.arc.com) + + Authors: + Richard Stuckey + + This file is part of GDB. + + 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. +*/ + +/******************************************************************************/ +/* */ +/* Outline: */ +/* This module implements an interface which the simulator can use to map */ +/* register numbers as known to gdb to hardware register numbers. */ +/* */ +/******************************************************************************/ + +#include "arc-sim-registers.h" + + +/* -------------------------------------------------------------------------- */ +/* local data */ +/* -------------------------------------------------------------------------- */ + +/* GDB register numbers */ + +/* N.B. these numbers seem very strange! + * + * If the gdb numbers for the core registers are 0 (R0) .. 63 (PCL), and + * the numbers for the aux registers follow on from that range, then surely + * we should have PC_REGNUM = 70 and STATUS32_REGNUM = 71? + * + * And where does 2111 for the last auxiliary register come from???!!! + * + * In the code below, PC is correctly recognized as AUX_FIRST_REGNUM + 6 + * (i.e. 70), and STATUS32 will be handled by the AUX_FIRST_REGNUM .. + * AUX_LAST_REGNUM range - so why are there special cases to map R61 + * (reserved) and R63 (PCL) onto STATUS32 and PC, respectively? + * + * It might be the case that PCL is being treated the same as PC (although + * the ARC documentation says that for the ARCcompact "the PCL register + * returns the current instruction address, whereas the PC register returns + * the next instruction in sequence") - but then why does the calling code + * not just use the *_h_pcl_get / *_h_pcl_set functions? + * + * In any case, PCL is read-only, so mapping it onto the PC would allow + * the debugger user to change the value of PCL, which is surely not what + * is wanted! + */ +#define STATUS32_REGNUM 61 +#define PC_REGNUM 63 /* should this be PCL_REGNUM? */ +#define AUX_FIRST_REGNUM 64 +#define AUX_LAST_REGNUM 2111 + + +static ARC_RegisterMappingFunction map = 0; +static ARC_AuxRegisterConversionFunction convert = 0; + + +/* -------------------------------------------------------------------------- */ +/* externally visible functions */ +/* -------------------------------------------------------------------------- */ + +void arc_hw_register_mapping(int gdb_regno, + int* hw_regno, + ARC_RegisterClass* reg_class) +{ + /* do we have a mapping? */ + if (map != 0) + (*map)(gdb_regno, hw_regno, reg_class); + else + { + /* OK, do it ourselves ... */ + + *hw_regno = -1; + *reg_class = ARC_UNKNOWN_REGISTER; + + if (gdb_regno < 61) + { + *hw_regno = gdb_regno; + *reg_class = ARC_CORE_REGISTER; + } + else if (gdb_regno == AUX_FIRST_REGNUM + 6) + { + *reg_class = ARC_PROGRAM_COUNTER; + } + else if (AUX_FIRST_REGNUM <= gdb_regno && gdb_regno <= AUX_LAST_REGNUM) + { + /* N.B. this assumes that the aux registers are contiguous in the + * auxiliary register space, i.e. that there are no gaps, but + * that is not the case! + */ + *hw_regno = gdb_regno - AUX_FIRST_REGNUM; + *reg_class = ARC_AUX_REGISTER; + } + else /* see comment above */ + { + switch (gdb_regno) + { + case PC_REGNUM: + *reg_class = ARC_PROGRAM_COUNTER; + break; + case STATUS32_REGNUM: + *hw_regno = 0xA; + *reg_class = ARC_AUX_REGISTER; + break; + default : + break; + } + } + } +} + + +void arc_aux_register_conversion(int gdb_regno, void *buffer) +{ + if (convert != 0) + convert(gdb_regno, buffer); +} + + +/* this function allows the debugger to provide a mapping */ +void arc_set_register_mapping(ARC_RegisterMappingFunction function) +{ + map = function; +} + + +void arc_set_aux_register_conversion(ARC_AuxRegisterConversionFunction function) +{ + convert = function; +} + +/******************************************************************************/ diff --git a/sim/arc/arc-sim-registers.h b/sim/arc/arc-sim-registers.h new file mode 100644 index 0000000..3b10f2c --- /dev/null +++ b/sim/arc/arc-sim-registers.h @@ -0,0 +1,63 @@ +/* Target dependent code for ARC700, for GDB, the GNU debugger. + + Contributed by ARC International (www.arc.com) + + Authors: + Richard Stuckey + + This file is part of GDB. + + 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. +*/ + +/******************************************************************************/ +/* */ +/* Outline: */ +/* This header file defines an interface which the simulator can use to */ +/* map register numbers as known to gdb to hardware register numbers. */ +/* */ +/******************************************************************************/ + +#ifndef ARC_SIM_REGISTERS_H +#define ARC_SIM_REGISTERS_H + + +typedef enum +{ + ARC_UNKNOWN_REGISTER, + ARC_CORE_REGISTER, + ARC_AUX_REGISTER, + ARC_PROGRAM_COUNTER +} ARC_RegisterClass; + + +typedef void (*ARC_RegisterMappingFunction)(int gdb_regno, int *hw_regno, ARC_RegisterClass *regclass); + +typedef void (*ARC_AuxRegisterConversionFunction)(int gdb_regno, void *buffer); + + +void arc_hw_register_mapping(int gdb_regno, + int *hw_regno, + ARC_RegisterClass *reg_class); + +void arc_aux_register_conversion(int gdb_regno, void *buffer); + +void arc_set_register_mapping(ARC_RegisterMappingFunction function); + +void arc_set_aux_register_conversion(ARC_AuxRegisterConversionFunction function); + + +#endif /* ARC_SIM_REGISTERS_H */ +/******************************************************************************/ diff --git a/sim/arc/arc-sim.h b/sim/arc/arc-sim.h index 0eb9bf7..ffb2364 100644 --- a/sim/arc/arc-sim.h +++ b/sim/arc/arc-sim.h @@ -21,11 +21,6 @@ #ifndef ARC_SIM_H #define ARC_SIM_H -/* GDB register numbers. */ -#define STATUS32_REGNUM 61 -#define PC_REGNUM 63 -#define AUX0_REGNUM 64 -#define AUXLAST_REGNUM 2111 extern int arc_decode_gdb_ctrl_regnum (int); diff --git a/sim/arc/arc5.c b/sim/arc/arc5.c index 8283ea5..7e7910e 100644 --- a/sim/arc/arc5.c +++ b/sim/arc/arc5.c @@ -1,5 +1,6 @@ /* arc simulator support code - Copyright (C) 1996, 1997, 1998, 2003, 2007 Free Software Foundation, Inc. + Copyright (C) 1996, 1997, 1998, 2003, 2007, 2008, 2009 + Free Software Foundation, Inc. This file is part of GDB, the GNU debugger. @@ -24,58 +25,139 @@ #include "cgen-mem.h" #include "cgen-ops.h" +#include "arc-sim-registers.h" + + +#define STATUS_REGNUM 0 +#define IDENTITY_REGNUM 4 +#define BYTES_IN_REGISTER 4 + + +/* N.B. the a5f_h_auxr_get/set functions use the GET_H_AUXR/SET_H_AUXR macros: + these have a special case for register number 0 (STATUS) which result in + an 'invalid insn' internal error being raised (see CR 95530). + + Those macros are no doubt intended to be used in the execution of the + object code running on the simulator (where access to the obsolete + STATUS register, instead of the newer STATUS32 register, would indeed be + an error), but they are also being used by this code that the debugger + uses to interact with the simulator (via the sim_fetch_register / + sim_store_register functions). + + So we wish to avoid calling a5f_h_auxr_get/set for the STATUS register. + Fortunately, the register is read-only so we can simply ignore a write; + for a read, we must "short-circuit" the access by going straight to the + default case of the GET_H_AUXR macro (which is "CPU (h_auxr[index])"). */ + + /* The contents of BUF are in target byte order. */ int -a5f_fetch_register (SIM_CPU *current_cpu, int rn, unsigned char *buf, - int len) +a5f_fetch_register (SIM_CPU *current_cpu, int rn, unsigned char *buf, int len) { - if (rn < 61) - SETTWI (buf, a5f_h_cr_get (current_cpu, rn)); - else if (rn >= AUX0_REGNUM && rn <= AUXLAST_REGNUM) - SETTWI (buf, a5f_h_auxr_get (current_cpu, rn - AUX0_REGNUM)); - else - switch (rn) + int hw_regnum; + ARC_RegisterClass reg_class; + SI contents; + +// printf("*** a5f_fetch_register %d\n", rn); + + arc_hw_register_mapping(rn, &hw_regnum, ®_class); + + switch (reg_class) + { + case ARC_UNKNOWN_REGISTER: + return 0; + + case ARC_CORE_REGISTER: + /* R61 and R62 are reserved - so just return 0. */ + if (hw_regnum == 61 || hw_regnum == 62) + return 0; + + /* N.B. the simulator does not model PCL (R63) if the instruction does + not refer to it. - so get the current + instruction address from PC and compute PCL from it. */ + contents = (hw_regnum == 63) ? a5f_h_pc_get (current_cpu) & -4 + : a5f_h_cr_get (current_cpu, hw_regnum); + break; + + case ARC_AUX_REGISTER: + if (hw_regnum == IDENTITY_REGNUM) { - case PC_REGNUM : - SETTWI (buf, a5f_h_pc_get (current_cpu)); - break; - case STATUS32_REGNUM : - SETTWI (buf, a5f_h_auxr_get (current_cpu, 10)); - break; - default : - return 0; + /* Construct a value from the target CPU architecture. */ + switch (CPU_MACH(current_cpu)->num) + { + case MACH_A5 : contents = 0x10; break; + case MACH_ARC600: contents = 0x20; break; + case MACH_ARC700: contents = 0x30; break; + default : contents = 0x00; break; + } } - - return -1; /*FIXME*/ + else + /* If it is the STATUS register, make the access directly. */ + contents = (hw_regnum == STATUS_REGNUM) ? CPU (h_auxr[STATUS_REGNUM]) + : a5f_h_auxr_get (current_cpu, hw_regnum); + break; + + case ARC_PROGRAM_COUNTER: + contents = a5f_h_pc_get (current_cpu); + break; + } + + SETTWI (buf, contents); + return BYTES_IN_REGISTER; } + /* The contents of BUF are in target byte order. */ int -a5f_store_register (SIM_CPU *current_cpu, int rn, unsigned char *buf, - int len) +a5f_store_register (SIM_CPU *current_cpu, int rn, unsigned char *buf, int len) { - if (rn < 61) - a5f_h_cr_set (current_cpu, rn, GETTWI (buf)); - else if (rn >= AUX0_REGNUM && rn <= AUXLAST_REGNUM) - a5f_h_auxr_set (current_cpu, rn - AUX0_REGNUM, GETTWI (buf)); - else - switch (rn) + int hw_regnum; + ARC_RegisterClass reg_class; + +// printf("*** a5f_store_register %d\n", rn); + + arc_hw_register_mapping(rn, &hw_regnum, ®_class); + + switch (reg_class) + { + case ARC_UNKNOWN_REGISTER: + break; + + case ARC_CORE_REGISTER: + /* R61 and R62 are reserved, and R63 is PCL which is read-only - so just + do nothing for them. */ + if (hw_regnum < 61) { - case PC_REGNUM : - a5f_h_pc_set (current_cpu, GETTWI (buf)); - break; - case STATUS32_REGNUM : - a5f_h_auxr_set (current_cpu, 10, GETTWI (buf)); - break; - default : - return 0; + a5f_h_cr_set (current_cpu, hw_regnum, GETTWI (buf)); + return BYTES_IN_REGISTER; } + break; - return -1; /*FIXME*/ + case ARC_AUX_REGISTER: + /* The STATUS aux reg is read/only, so ignore the write attempt. */ + if (hw_regnum != STATUS_REGNUM) + { + /* Do any required conversion on the given value before writing it to + the register (this ensures that bits in reserved fields have the + on-write values required by the architecture. */ + arc_aux_register_conversion(rn, buf); + + a5f_h_auxr_set (current_cpu, hw_regnum, GETTWI (buf)); + return BYTES_IN_REGISTER; + } + break; + + case ARC_PROGRAM_COUNTER: + a5f_h_pc_set (current_cpu, GETTWI (buf)); + return BYTES_IN_REGISTER; + } + + return 0; } + /* Initialize cycle counting for an insn. FIRST_P is non-zero if this is the first insn in a set of parallel insns. */ diff --git a/sim/arc/sim-if.c b/sim/arc/sim-if.c index be4d99e..4c5433d 100644 --- a/sim/arc/sim-if.c +++ b/sim/arc/sim-if.c @@ -1,6 +1,6 @@ /* Main simulator entry points specific to the ARC. - Copyright (C) 1996, 1997, 1998, 1999, 2003, 2004, 2005, 2006, 2007, 2008 - Free Software Foundation, Inc. + Copyright (C) 1996, 1997, 1998, 1999, 2003, 2004, 2005, 2006, 2007, 2008, + 2009 Free Software Foundation, Inc. This file is part of GDB, the GNU debugger. @@ -18,10 +18,144 @@ with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "sim-main.h" -#include "sim-options.h" -#include "libiberty.h" -#include "bfd.h" + +/******************************************************************************/ +/* */ +/* Outline: */ +/* This module provides operations to: */ +/* */ +/* 1) create an "instance" of the ARC simulator */ +/* 2) destroy an "instance" of the ARC simulator */ +/* 3) create an "inferior" to run on the simulator */ +/* 4) execute a simulator-related command */ +/* */ +/* N.B. there can be only one simulator instance at a time because of the */ +/* use of the current_state global variable. */ +/* */ +/* This module is also responsible for setting up the "command line" */ +/* arguments and environment (name/value pairs) to be passed to the */ +/* program that is to be debugged. This data is passed on the stack above */ +/* the top of stack as it is known to the program. */ +/* */ +/* E.g. if we are passing 4 arguments to main, we must place the data on */ +/* the stack as: */ +/* */ +/* . */ +/* . */ +/* stack[top + A3] <== */ +/* . */ +/* . */ +/* stack[top + A2] <== */ +/* . */ +/* . */ +/* stack[top + A1] <== */ +/* . */ +/* . */ +/* stack[top + A0] <== */ +/* stack[top + 28] <== 0x0 # ? NULL terminator */ +/* stack[top + 24] <== 0x0 # envp NULL terminator */ +/* stack[top + 20] <== 0x0 # argv NULL terminator */ +/* stack[top + 16] <== TOP + A3 # argv[3] */ +/* stack[top + 12] <== TOP + A2 # argv[2] */ +/* stack[top + 8] <== TOP + A1 # argv[1] */ +/* stack[top + 4] <== TOP + A0 # argv[0] */ +/* stack[top ] <== 0x4 # argc */ +/* */ +/* where TOP = &stack[top] */ +/* and A0 .. A3 are the offsets of the stored arguments from the stack */ +/* top. */ +/* */ +/* */ +/* Notes: */ +/* The interface to this module is somewhat muddled: both sim_open and */ +/* sim_create_inferior have a BFD parameter which denotes the executable */ +/* file which is to be run; but for sim_open this parameter may be NULL. */ +/* */ +/* Also, both sim_open and sim_create_inferior have an argv parameter, */ +/* but for sim_open *some* of the strings in this array parameter may be */ +/* command-line arguments to be passed to the program to be executed, */ +/* whilst the others are arguments for the simulator itself; but for */ +/* sim_create_inferior, *all* of the strings (if any) in this parameter */ +/* are such command-line arguments. */ +/* */ +/* Finally, sim_create_inferior has an envp parameter which holds a set */ +/* of name/value pairs to be passed as the environment of the executed */ +/* program, whereas sim_open does not; but this is not (currently) done. */ +/* */ +/* */ +/* This complexity arises from the variety of ways in which a simulator */ +/* instance may be created and used: */ +/* */ +/* a) the instance may be created by gdb before the executable file is */ +/* known; e.g. the user may issue the commands */ +/* */ +/* set endian big | little */ +/* target sim */ +/* file */ +/* load */ +/* run */ +/* */ +/* and in this case the BFD parameter to sim_open is NULL, and its */ +/* argv parameter does not hold the executable's arguments; */ +/* */ +/* b) the instance may be created by gdb after the executable file is */ +/* known; e.g. the user may issue the commands */ +/* */ +/* file */ +/* target sim */ +/* load */ +/* run */ +/* */ +/* and in this case the BFD parameter to sim_open is non-NULL, and */ +/* its argv parameter does not hold the executable's arguments; */ +/* */ +/* c) the instance may be created by a standalone executable; e.g. */ +/* known; e.g. the user may issue the command */ +/* */ +/* run [ .. ] */ +/* */ +/* and in this case the BFD parameter to sim_open is non-NULL, and */ +/* its argv parameter does hold the executable's arguments. */ +/* */ +/* Note that in each case, the argv parameter to sim_create_inferior */ +/* holds the command-line arguments for the executable (so, there is */ +/* apparently no need for them to be passed in the sim_open argv also!). */ +/* */ +/* The arguments to the executed program may also be specified in several */ +/* ways; e.g by use of the gdb 'set args' command, or as arguments to the */ +/* gdb 'run' command; or, in the case of a standalone executable, on the */ +/* command line. */ +/* */ +/* Note that the executable program can be run (by gdb) repeatedly with */ +/* different argument lists, i.e. there may be multiple calls of */ +/* sim_create_inferior after a call of sim_open; and each of these lists */ +/* may require a different amount of memory to hold them on the stack. */ +/* */ +/* */ +/* It is necessary to define a memory region with a particular start */ +/* address and size in the simulator memory (all accesses outside this */ +/* address range by the executed program are erroneous, thus allowing */ +/* invalid accesses to be detected); this region must include the program */ +/* text, (un)initialized data, heap and stack. This must also include */ +/* the argument/environment data which is passed above the top of the */ +/* stack. */ +/* */ +/* If the executable file is known (i.e. we have a non-NULL BFD), */ +/* the bounds of the memory region required for the program may be */ +/* extracted from the section header information in the file; if the */ +/* arguments/environment are known, the space required to hold them on */ +/* the stack may be computed. This allows the total space to be computed, */ +/* and so a memory region holding it may be defined. */ +/* */ +/* However, if a subsequent execution of the program should require a */ +/* greater total space (because its arguments have changed) it is then */ +/* necessary to define an additional memory region to provide the extra */ +/* space; it is not possible to redefine the existing region, or a new */ +/* region of the new size (as memory regions may not overlap). */ +/* */ +/******************************************************************************/ + +/* system header files */ #ifdef HAVE_STRING_H #include @@ -34,13 +168,53 @@ #include #endif -static void free_state (SIM_DESC); -static void print_arc_misc_cpu (SIM_CPU *cpu, int verbose); +/* simulator / binutils header files */ + +#include "sim-main.h" +#include "sim-options.h" +#include "libiberty.h" +#include "bfd.h" + + +/* -------------------------------------------------------------------------- */ +/* conditional compilation flags */ +/* -------------------------------------------------------------------------- */ -/* Records simulator descriptor so utilities like arc_dump_regs can be - called from gdb. */ +//#define LOGGING +//#define PUSH_ENVIRONMENT_ONTO_STACK + + +/* -------------------------------------------------------------------------- */ +/* externally visible data */ +/* -------------------------------------------------------------------------- */ + +/* Records simulator descriptor so utilities like arc_dump_regs can be called + from gdb. */ SIM_DESC current_state; - + + +/* -------------------------------------------------------------------------- */ +/* local data */ +/* -------------------------------------------------------------------------- */ + +#define DEFAULT_ENVIRONMENT_SPACE 2048 + +#define TARGET_POINTER_SIZE 4 +#define TARGET_INT_SIZE 4 + + +/* -------------------------------------------------------------------------- */ +/* local macros */ +/* -------------------------------------------------------------------------- */ + +#define IS_LITTLE_ENDIAN(abfd) (abfd) ? bfd_little_endian (abfd) \ + : (CURRENT_TARGET_BYTE_ORDER == LITTLE_ENDIAN) + + +/* -------------------------------------------------------------------------- */ +/* local functions */ +/* -------------------------------------------------------------------------- */ + /* Cover function of sim_state_free to free the cpu buffers as well. */ static void @@ -52,158 +226,334 @@ free_state (SIM_DESC sd) sim_state_free (sd); } -/* Find out heap and stack end boundaries, and return required memory - size; if this cannot be calcualted, return DEFAULT_MEMSIZE. - If INIT_P is nonzero, initialize memory above the stack with argv and envp. - If this initialization fails, return 0. */ + +/* PROFILE_CPU_CALLBACK */ + +static void +print_arc_misc_cpu (SIM_CPU *cpu, int verbose) +{ + if (CPU_PROFILE_FLAGS (cpu) [PROFILE_INSN_IDX]) + { + SIM_DESC sd = CPU_STATE (cpu); + char buf[20]; + + sim_io_printf (sd, "Miscellaneous Statistics\n\n"); + sim_io_printf (sd, " %-*s %s\n\n", + PROFILE_LABEL_WIDTH, "Fill nops:", + sim_add_commas (buf, sizeof (buf), + CPU_ARC_MISC_PROFILE (cpu)->fillnop_count)); + } +} + + +#ifdef LOGGING +static void +dump (SIM_DESC sd, char** argv, char** envp) +{ + char **cpp, **rpp; + char* tag; + int cnt; + + for (cpp = argv, tag = "argv", cnt = 2; cnt--; cpp = envp, tag = "env") + { + if (cpp) + { + int i = 0; + + for (rpp = cpp; *rpp; rpp++, i++) + sim_io_eprintf(sd, "%s[%d] = %s\n", tag, i, *rpp); + } + } +} +#endif + +/* Setup copy arguments / environment to the stack area of SD according + to argv and envp. Either or both of argv and envp may be NULL. + Return 0 on failure, nonzero on success. */ + static int -init_stack (struct bfd *abfd, char **argv, - SIM_DESC sd, int default_memsize, int init_p) +setup_stack (SIM_DESC sd, int little_endian_p, char** argv, char** envp) { - USI stack_start = 0, stack_top = 0, heap_start = 0, heap_end = 0; - USI prog_end = 0; - char *null_env = NULL; - char **envp = &null_env; - int argc; - char **cpp, **rpp, *str; - size_t len; - int cp, wpp; - int n_ptr = 0, cnt; - /* All CPUs have the same memory map, apparently. */ - SIM_CPU *cpu = STATE_CPU (sd, 0); - bfd_byte buf[4]; + SIM_CPU* cpu = STATE_CPU (sd, 0); + int wpp = sd->memory.stack_top + TARGET_INT_SIZE; + int cp = sd->memory.argument_data_start; + int count; + char** cpp; + +#ifdef LOGGING + sim_io_eprintf(sd, "setup stack (%c/E) %d args\n", + (little_endian_p) ? 'L' : 'B', + sd->memory.num_arguments); + dump(sd, argv, envp); +#endif + + if (sd->memory.stack_top <= sd->memory.stack_start) + { + host_callback *callback = STATE_CALLBACK (sd); + + (*callback->printf_filtered) (callback, "stack overflow\n"); + return 0; + } + + /* Can't use sim_core_write_unaligned_4 without everything + initialized when tracing, and then these writes would get into + the trace. */ +#define write_dword(addr, data) \ + do \ + { \ + bfd_byte buf[4]; \ + USI data_ = data; \ + USI addr_ = addr; \ + if (little_endian_p) \ + bfd_putl32 (data_, buf); \ + else \ + bfd_putb32 (data_, buf); \ + if (sim_core_write_buffer (sd, cpu, 0, buf, addr_, 4) != 4) \ + { \ + sim_io_eprintf(sd, "failed to write word to address 0x%x\n", addr);\ + return 0; \ + } \ + } \ + while (0) + + + /* Push the arguments and environment onto the stack. */ + + write_dword (sd->memory.stack_top, sd->memory.num_arguments); + for (cpp = argv, count = 2; count--; cpp = envp) + { + if (cpp) + { + char* argument; + char** rpp; + + for (rpp = cpp; (argument = *cpp); cpp++) + { + size_t len = strlen(argument) + 1; + +#ifdef LOGGING + sim_io_eprintf(sd, "pushing argument '%s' onto program stack at address 0x%x\n", argument, cp); +#endif + + if (sim_core_write_buffer (sd, cpu, 0, argument, cp, len) != len) + { + sim_io_eprintf(sd, "could not push argument '%s' onto program stack at address 0x%x\n", argument, cp); + return 0; + } + write_dword (wpp, cp); + cp += len; + wpp += TARGET_POINTER_SIZE; + } + } + + write_dword (wpp, 0); // NULL array terminator + wpp += TARGET_POINTER_SIZE; + + } + write_dword (wpp, 0); /* uClibc aux_dat NULL terminator. */ + /* success */ + return 1; +} + + +/* Find out heap and stack end boundaries, and calculate required memory size; + if this cannot be done, use the default memory size. + ABFD, ARGV and/or ENVP may be NULL. + If this calculation fails, return 0. */ + +static int +determine_memory_requirements (SIM_DESC sd, struct bfd *abfd, char **argv, + char **envp, struct sim_memory* memory) +{ + USI stack_start = 0, stack_top = 0, heap_start = 0, heap_end = 0; + USI program_end = 0; + USI memory_size; + USI data_start; + int argc = 0; + size_t total_argument_length = 0; + int num_pointers = 0; + + /* N.B. the *_end variables actually denote the next byte after the end of + the sections to which they refer; however, they are used consistently + in this way, so that is not a problem! */ + + /* If we have an executable file to look at. */ if (abfd) { - asection *s; - - for (s = abfd->sections; s; s = s->next) - if (strcmp (bfd_get_section_name (abfd, s), ".stack") == 0) - { - stack_start = bfd_get_section_vma (abfd, s); - stack_top = stack_start + bfd_section_size (abfd, s); - stack_top &= -4; /* 4 == target pointer size */ - default_memsize = stack_top; - } - else if (strcmp (bfd_get_section_name (abfd, s), ".heap") == 0) - { - heap_start = bfd_get_section_vma (abfd, s); - heap_end = heap_start + bfd_section_size (abfd, s); - } - else - { - USI s_end - = bfd_get_section_vma (abfd, s) + bfd_section_size (abfd, s); - - if (prog_end < s_end) - prog_end = s_end; - } - if (heap_end == 0) - { - if (prog_end > stack_start) - return 0; - heap_start = prog_end; - heap_end = stack_start; - } - if (!argv) - n_ptr == 1; - else + asection* section; + + /* Look at each section in the file. */ + for (section = abfd->sections; section; section = section->next) + { + if (strcmp (bfd_get_section_name (abfd, section), ".stack") == 0) + { + stack_start = bfd_get_section_vma (abfd, section); + stack_top = stack_start + bfd_section_size (abfd, section); + stack_top &= -TARGET_POINTER_SIZE; + + /* N.B. this assumes that the target memory region to be + created has the range 0 .. stack_top - 1, i.e. that there + is nothing in the program that has to be loaded at + addresses above the stack top. */ + memory_size = stack_top; + } + else if (strcmp (bfd_get_section_name (abfd, section), ".heap") == 0) + { + heap_start = bfd_get_section_vma (abfd, section); + heap_end = heap_start + bfd_section_size (abfd, section); + } + else if (bfd_get_section_flags(abfd, section) & SEC_LOAD) + { + USI section_end = bfd_get_section_vma (abfd, section) + + bfd_section_size (abfd, section); + + /* Keep track of the end address of whatever else is to be + loaded. */ + if (program_end < section_end) + program_end = section_end; + } + } + + /* If we know the start of the stack, check for an overlap. */ + if (stack_start > 0 && program_end > stack_start) { - for (cpp = envp, len = 0, cnt = 2; cnt--; cpp = argv) - { - argc = 0; - for (rpp = cpp; *rpp; rpp++) - argc++, len += strlen (*rpp) + 1; - n_ptr += argc + 1; - } + sim_io_eprintf(sd, + "program data overlaps program stack at 0x%x (0x%x)\n", + stack_start, program_end); + return 0; } - n_ptr ++; //* For uclibc aux_dat */ - if (!stack_top) - stack_top = (default_memsize + 3) & -4; /* 4 == target pointer size */ - wpp = stack_top + 4; - cp = wpp + n_ptr * 4; - default_memsize = cp + len; - /* Round up to multiple of 32. strlen expects memory to come in chunks - that are at least cache-line (32 bytes) sized. */ - default_memsize += 31; - default_memsize &= -32; + + /* No heap section found? */ + if (heap_end == 0) + { + /* Assume the heap lies between the program data and the stack. */ + heap_start = program_end; + heap_end = stack_start; + } } - if (abfd && init_p) + + + /* If we have arguments or environment variables to pass to the program. */ + + if (argv) { - int little_endian_p = bfd_little_endian (abfd); + char **rpp; - if (stack_top <= stack_start) - { - host_callback *callback = STATE_CALLBACK (sd); + for (rpp = argv; *rpp; rpp++, num_pointers++) + total_argument_length += strlen (*rpp) + 1; - (*callback->printf_filtered) (callback, "stack overflow\n"); - return 0; - } + argc = num_pointers; + } + num_pointers++; /* For NULL terminator. */ - /* Can't use sim_core_write_unaligned_4 without everything - initialized when tracing, and then these writes would get into - the trace. */ -#define write_dword(addr, data) \ - do \ - { \ - USI data_ = data; \ - USI addr_ = addr; \ - if (little_endian_p) \ - bfd_putl32 (data_, buf); \ - else \ - bfd_putb32 (data_, buf); \ - if (sim_core_write_buffer (sd, cpu, 0, buf, addr_, 4) != 4) \ - return 0; \ - } \ - while (0) + if (envp) + { + char** rpp; - write_dword (stack_top, argc); - for (cpp = argv, cnt = 2; cnt--; cpp = envp) - { - for (rpp = cpp; str = *cpp++;) - { - len = strlen (str) + 1; - if (sim_core_write_buffer (sd, cpu, 0, str, cp, len) != len) - return 0; - write_dword (wpp, cp); - cp += len; - wpp += 4; - } - write_dword (wpp, 0); - wpp += 4; - } - write_dword (wpp, 0); - sd->heap_start = heap_start; - sd->heap_end = heap_end; - sd->stack_top = stack_top; + for (rpp = envp; *rpp; rpp++, num_pointers++) + total_argument_length += strlen (*rpp) + 1; + } + num_pointers++; /* For NULL terminator. */ + + num_pointers++; /* For uclibc aux_dat. */ + + /* If we could not get the stack bounds from the executable file (and hence + do not know the memory size), use the default memory size and take the + top of the stack as being at the end of that memory range (aligned to + the size of a target pointer). */ + if (!stack_top) + stack_top = (USI) ((ARC_DEFAULT_MEM_SIZE + 3) & -TARGET_POINTER_SIZE); + + data_start = (USI) (stack_top + + TARGET_INT_SIZE + /* For argc. */ + num_pointers * TARGET_POINTER_SIZE); + + /* We need enough memory to hold the program stack, plus the data to be passed + above the top of the stack. */ + memory_size = (USI) (data_start + total_argument_length); + +#ifdef PUSH_ENVIRONMENT_ONTO_STACK + if (!envp) + memory_size += DEFAULT_ENVIRONMENT_SPACE; +#endif + + /* Round up to multiple of 32: strlen expects memory to come in chunks + that are at least cache-line (32 bytes) sized. + FIXME: is that true? */ + memory_size += 31; + memory_size &= -32; + + memory->heap_start = heap_start; + memory->heap_end = heap_end; + memory->stack_top = stack_top; + memory->stack_start = stack_start; + memory->total_size = memory_size; + memory->argument_data_start = data_start; + memory->num_arguments = (USI) argc; + +#ifdef LOGGING + sim_io_eprintf(sd, "heap start : 0x%x\n", heap_start); + sim_io_eprintf(sd, "heap end : 0x%x\n", heap_end); + sim_io_eprintf(sd, "stack start : 0x%x\n", stack_start); + sim_io_eprintf(sd, "stack top : 0x%x\n", stack_top); + sim_io_eprintf(sd, "memory size : 0x%x\n", memory_size); + sim_io_eprintf(sd, "arg data start: 0x%x\n", data_start); + sim_io_eprintf(sd, "%d args\n", argc); +#endif + + /* Success. */ + return 1; +} + + +static void +define_memory_region (SIM_DESC sd, USI start, USI size) +{ + /* Allocate core managed memory if none specified by user. */ + if (!sd->memory_regions_defined_by_user) + { +#ifdef LOGGING + sim_io_printf (sd, "memory region 0x%x,0x%x\n", start, size); +#endif + sim_do_commandf (sd, "memory region 0x%x,0x%x", start, size); } - return default_memsize; } + +/* -------------------------------------------------------------------------- */ +/* externally visible functions */ +/* -------------------------------------------------------------------------- */ + /* Create an instance of the simulator. */ SIM_DESC -sim_open (kind, callback, abfd, argv) - SIM_OPEN_KIND kind; - host_callback *callback; - struct bfd *abfd; - char **argv; +sim_open (SIM_OPEN_KIND kind, + host_callback *callback, + struct bfd *abfd, /* May be NULL. */ + char **argv) { SIM_DESC sd = sim_state_alloc (kind, callback); - char c; - int i; - int default_memsize; - char ** prog_argv; + int little_endian_p; + char** prog_argv; + char c; - /* The cpu data is kept in a separately allocated chunk of memory. */ + SIM_ASSERT (STATE_MAGIC (sd) == SIM_MAGIC_NUMBER); + +#ifdef LOGGING + sim_io_eprintf (sd, "sim_open: %p\n", abfd); + dump(sd, argv, NULL); +#endif + + /* The cpu data is kept in a separately-allocated chunk of memory. */ if (sim_cpu_alloc_all (sd, 1, cgen_cpu_max_extra_bytes ()) != SIM_RC_OK) { free_state (sd); return 0; } -#if 0 /* FIXME: pc is in mach-specific struct */ - /* FIXME: watchpoints code shouldn't need this */ +#if 0 /* FIXME: pc is in mach-specific struct. */ + /* FIXME: watchpoints code shouldn't need this. */ { SIM_CPU *current_cpu = STATE_CPU (sd, 0); STATE_WATCHPOINTS (sd)->pc = &(PC); @@ -217,7 +567,7 @@ sim_open (kind, callback, abfd, argv) return 0; } -#ifdef HAVE_DV_SOCKSER /* FIXME: was done differently before */ +#ifdef HAVE_DV_SOCKSER /* FIXME: was done differently before. */ if (dv_sockser_install (sd) != SIM_RC_OK) { free_state (sd); @@ -225,7 +575,7 @@ sim_open (kind, callback, abfd, argv) } #endif -#if 0 /* FIXME: 'twould be nice if we could do this */ +#if 0 /* FIXME: 'twould be nice if we could do this. */ /* These options override any module options. Obviously ambiguity should be avoided, however the caller may wish to augment the meaning of an option. */ @@ -242,6 +592,11 @@ sim_open (kind, callback, abfd, argv) return 0; } +#ifdef LOGGING + /* sim_parse_args may set up STATE_PROG_ARGV(sd), in the case that kind == SIM_OPEN_STANDALONE. */ + dump(sd, STATE_PROG_ARGV (sd), NULL); +#endif + /* Check for/establish the reference program image, and set arch info. */ if (sim_analyze_program (sd, (STATE_PROG_ARGV (sd) != NULL @@ -254,18 +609,17 @@ sim_open (kind, callback, abfd, argv) } prog_argv = STATE_PROG_ARGV (sd); + + /* If we have not been given an executable file. */ if (!abfd) { - char *name; - - /* FIXME: If the test below fails, we will use ARC_DEFAULT_MEMSIZE. - We should have some way to remember this, so that we can - emit an error in sim_create_inferior if the required memory - size is larger. */ + /* If the test below fails, we will use ARC_DEFAULT_MEM_SIZE. */ if (prog_argv != NULL && *prog_argv != NULL) { - name = *prog_argv; + char* name = *prog_argv; + abfd = bfd_openr (name, 0); + if (abfd == NULL || !bfd_check_format (abfd, bfd_object)) { free_state (sd); @@ -274,21 +628,47 @@ sim_open (kind, callback, abfd, argv) } } - default_memsize - = init_stack (abfd, prog_argv, sd, ARC_DEFAULT_MEM_SIZE, 0); - /* Allocate core managed memory if none specified by user. - Use address 4 here in case the user wanted address 0 unmapped. */ - if (sim_core_read_buffer (sd, NULL, read_map, &c, 4, 1) == 0) - sim_do_commandf (sd, "memory region 0,0x%x", default_memsize); + /* Establish any remaining configuration options. */ + if (sim_config (sd) != SIM_RC_OK) + { + free_state (sd); + return 0; + } + + little_endian_p = IS_LITTLE_ENDIAN(abfd); + + /* Check whether core managed memory has been specified by user. + Use address 4 here in case the user wanted address 0 unmapped. + N.B. this is really not a very good check - we want to know whether the + user has explicitly specified the target's memory regions, so that we + don't define a region ourself (which might overlap), and we try to + find that out by seeing if we can read the memory at address 0x4 !!!! */ + sd->memory_regions_defined_by_user = + sim_core_read_buffer (sd, NULL, read_map, &c, 4, 1) != 0; - if (!init_stack (abfd, prog_argv, sd, default_memsize, 1) - /* Establish any remaining configuration options. */ - || sim_config (sd) != SIM_RC_OK) + /* Calculate the memory size required without actually initializing the stack. */ + if (!determine_memory_requirements(sd, abfd, prog_argv, NULL, &sd->memory)) { free_state (sd); return 0; } + define_memory_region (sd, 0, sd->memory.total_size); + + /* If the simulator is being used stand-alone, we know that the program + arguments we have been given here are not going to change later on (when + sim_create_inferior is called) - so we can go ahead and set up the stack + with those arguments right now. */ + if (STATE_OPEN_KIND (sd) == SIM_OPEN_STANDALONE) + { + /* Now that we do know the memory size, initialize the stack. */ + if (!setup_stack (sd, little_endian_p, prog_argv, NULL)) + { + free_state (sd); + return 0; + } + } + if (sim_post_argv_init (sd) != SIM_RC_OK) { free_state (sd); @@ -297,16 +677,18 @@ sim_open (kind, callback, abfd, argv) /* Open a copy of the cpu descriptor table. */ { - CGEN_CPU_DESC cd - = arc_cgen_cpu_open_1 (STATE_ARCHITECTURE (sd)->printable_name, - (abfd && bfd_little_endian (abfd) - ? CGEN_ENDIAN_LITTLE: CGEN_ENDIAN_BIG)); + CGEN_CPU_DESC cd = arc_cgen_cpu_open_1 + (STATE_ARCHITECTURE (sd)->printable_name, + (little_endian_p ? CGEN_ENDIAN_LITTLE : CGEN_ENDIAN_BIG)); + int i; + for (i = 0; i < MAX_NR_PROCESSORS; ++i) { SIM_CPU *cpu = STATE_CPU (sd, i); CPU_CPU_DESC (cpu) = cd; CPU_DISASSEMBLER (cpu) = sim_cgen_disassemble_insn; } + arc_cgen_init_dis (cd); } @@ -314,63 +696,130 @@ sim_open (kind, callback, abfd, argv) Must be done after arc_cgen_cpu_open. */ cgen_init (sd); - for (c = 0; c < MAX_NR_PROCESSORS; ++c) + for (c = 0; c < MAX_NR_PROCESSORS; c++) { /* Only needed for profiling, but the structure member is small. */ memset (CPU_ARC_MISC_PROFILE (STATE_CPU (sd, i)), 0, sizeof (* CPU_ARC_MISC_PROFILE (STATE_CPU (sd, i)))); - /* Hook in callback for reporting these stats */ - PROFILE_INFO_CPU_CALLBACK (CPU_PROFILE_DATA (STATE_CPU (sd, i))) - = print_arc_misc_cpu; + + /* Hook in callback for reporting these stats. */ + PROFILE_INFO_CPU_CALLBACK (CPU_PROFILE_DATA (STATE_CPU (sd, i))) = + print_arc_misc_cpu; } - /* Store in a global so things like sparc32_dump_regs can be invoked + /* Store in a global so things like arc32_dump_regs can be invoked from the gdb command line. */ current_state = sd; return sd; } + void -sim_close (sd, quitting) - SIM_DESC sd; - int quitting; +sim_close (SIM_DESC sd, int quitting) { arc_cgen_cpu_close (CPU_CPU_DESC (STATE_CPU (sd, 0))); sim_module_uninstall (sd); } - + + SIM_RC -sim_create_inferior (sd, abfd, argv, envp) - SIM_DESC sd; - struct bfd *abfd; - char **argv; - char **envp; +sim_create_inferior (SIM_DESC sd, struct bfd *abfd, char **argv, char **envp) { SIM_CPU *current_cpu = STATE_CPU (sd, 0); SIM_ADDR addr; +#ifndef PUSH_ENVIRONMENT_ONTO_STACK + envp = NULL; +#endif +#ifdef LOGGING + sim_io_eprintf (sd, "sim_create_inferior: %p\n", abfd); + dump (sd, argv, envp); +#endif + if (abfd != NULL) - addr = bfd_get_start_address (abfd); + { + int little_endian_p = bfd_little_endian (abfd); + + if (little_endian_p) + { + if (CURRENT_TARGET_BYTE_ORDER == BIG_ENDIAN) + { + sim_io_eprintf (sd, "Target is big-endian but executable file %s is little-endian.\n", + bfd_get_filename (abfd)); + return SIM_RC_FAIL; + } + } + else + { + if (CURRENT_TARGET_BYTE_ORDER == LITTLE_ENDIAN) + { + sim_io_eprintf (sd, "Target is little-endian but executable file %s is big-endian.\n", + bfd_get_filename(abfd)); + return SIM_RC_FAIL; + } + } + + addr = bfd_get_start_address (abfd); + } else addr = 0; + sim_pc_set (current_cpu, addr); - /* Initialize stack pointer. */ - if (!sd->stack_top - && !init_stack (abfd, argv, sd, 1, 1)) - return 0; - current_cpu->endbrk = sd->heap_start; - - a5f_h_cr_set (current_cpu, 28, (sd)->stack_top); - /* Set r0/r1 to argc / argv */ - a5f_h_cr_set (current_cpu, 0, GETMEMSI (current_cpu, 0, sd->stack_top)); - a5f_h_cr_set (current_cpu, 1, sd->stack_top+4); - -#ifdef ARC_LINUX - m32rbf_h_cr_set (current_cpu, - arc_decode_gdb_ctrl_regnum(SPI_REGNUM), 0x1f00000); - m32rbf_h_cr_set (current_cpu, - arc_decode_gdb_ctrl_regnum(SPU_REGNUM), 0x1f00000); + + /* If the simulator is being used stand-alone, we have already set up the + stack (when sim_open was called); but if the simulator is being used by + gdb we must set up the stack each time that sim_create_inferior is + called, in case the program arguments have changed since last time. */ + if (STATE_OPEN_KIND(sd) == SIM_OPEN_DEBUG) + { + struct sim_memory memory; + + if (determine_memory_requirements (sd, abfd, argv, envp, &memory)) + { + USI current_size = sd->memory.total_size; + + if (memory.total_size > current_size) + { +#ifdef LOGGING + sim_io_eprintf (sd, "program requires memory size 0x%x bytes" + " but simulator currently has memory size 0x%x bytes\n", + memory.total_size, current_size); +#endif + + /* Define another memory region to provide the extra memory + required. */ + define_memory_region (sd, current_size, + memory.total_size - current_size); + + /* Update all the memory details. */ + sd->memory = memory; + } + else + { + /* Update all the memory details *except* the current size. */ + sd->memory = memory; + sd->memory.total_size = current_size; + } + + if (!setup_stack (sd, IS_LITTLE_ENDIAN (abfd), argv, envp)) + return SIM_RC_FAIL; + } + else + return SIM_RC_FAIL; + } + + current_cpu->endbrk = sd->memory.heap_start; + + /* Set r28 (SP) to the stack top, and set r0/r1 to argc/argv. */ + a5f_h_cr_set (current_cpu, 0, sd->memory.num_arguments); + a5f_h_cr_set (current_cpu, 1, sd->memory.stack_top + 4); + a5f_h_cr_set (current_cpu, 28, sd->memory.stack_top); + +#ifdef LOGGING + sim_io_eprintf (sd, "R0 = 0x%08X\n", sd->memory.num_arguments); + sim_io_eprintf (sd, "R1 = 0x%08X\n", sd->memory.stack_top + 4); + sim_io_eprintf (sd, "SP = 0x%08X\n", sd->memory.stack_top); #endif #if 0 @@ -381,39 +830,10 @@ sim_create_inferior (sd, abfd, argv, envp) return SIM_RC_OK; } -/* PROFILE_CPU_CALLBACK */ - -static void -print_arc_misc_cpu (SIM_CPU *cpu, int verbose) -{ - SIM_DESC sd = CPU_STATE (cpu); - char buf[20]; - - if (CPU_PROFILE_FLAGS (cpu) [PROFILE_INSN_IDX]) - { - sim_io_printf (sd, "Miscellaneous Statistics\n\n"); - sim_io_printf (sd, " %-*s %s\n\n", - PROFILE_LABEL_WIDTH, "Fill nops:", - sim_add_commas (buf, sizeof (buf), - CPU_ARC_MISC_PROFILE (cpu)->fillnop_count)); - if (STATE_ARCHITECTURE (sd)->mach == bfd_mach_m32rx) - sim_io_printf (sd, " %-*s %s\n\n", - PROFILE_LABEL_WIDTH, "Parallel insns:", - sim_add_commas (buf, sizeof (buf), - CPU_ARC_MISC_PROFILE (cpu)->parallel_count)); - if (STATE_ARCHITECTURE (sd)->mach == bfd_mach_m32r2) - sim_io_printf (sd, " %-*s %s\n\n", - PROFILE_LABEL_WIDTH, "Parallel insns:", - sim_add_commas (buf, sizeof (buf), - CPU_ARC_MISC_PROFILE (cpu)->parallel_count)); - } -} void -sim_do_command (sd, cmd) - SIM_DESC sd; - char *cmd; -{ +sim_do_command (SIM_DESC sd, char* cmd) +{ char **argv; if (cmd == NULL) @@ -421,6 +841,8 @@ sim_do_command (sd, cmd) argv = buildargv (cmd); + /* Is the command 'info reg[ister] ' ? */ + if (argv[0] != NULL && strcasecmp (argv[0], "info") == 0 && argv[1] != NULL @@ -428,24 +850,13 @@ sim_do_command (sd, cmd) { SI val; - /* We only support printing bbpsw,bbpc here as there is no equivalent - functionality in gdb. */ if (argv[2] == NULL) - sim_io_eprintf (sd, "Missing register in `%s'\n", cmd); + sim_io_eprintf (sd, "Missing register in `%s'\n", cmd); else if (argv[3] != NULL) - sim_io_eprintf (sd, "Too many arguments in `%s'\n", cmd); -#if 0 - else if (strcasecmp (argv[2], "bbpsw") == 0) - { - val = m32rbf_h_cr_get (STATE_CPU (sd, 0), H_CR_BBPSW); - sim_io_printf (sd, "bbpsw 0x%x %d\n", val, val); - } - else if (strcasecmp (argv[2], "bbpc") == 0) - { - val = m32rbf_h_cr_get (STATE_CPU (sd, 0), H_CR_BBPC); - sim_io_printf (sd, "bbpc 0x%x %d\n", val, val); - } -#endif + sim_io_eprintf (sd, "Too many arguments in `%s'\n", cmd); + + /* Should we recognize some/all of the ARC register names here? */ + else sim_io_eprintf (sd, "Printing of register `%s' not supported with `sim info'\n", argv[2]); @@ -458,3 +869,5 @@ sim_do_command (sd, cmd) freeargv (argv); } + +/******************************************************************************/ diff --git a/sim/arc/sim-main.h b/sim/arc/sim-main.h index 05c7ab3..ef4fd45 100644 --- a/sim/arc/sim-main.h +++ b/sim/arc/sim-main.h @@ -1,5 +1,6 @@ /* Main header for the arc. - Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation, Inc. */ + Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 + Free Software Foundation, Inc. */ #ifndef SIM_MAIN_H #define SIM_MAIN_H @@ -72,14 +73,25 @@ struct _sim_cpu { /* The sim_state struct. */ + +struct sim_memory { + USI heap_start; + USI heap_end; + USI stack_start; + USI stack_top; + USI total_size; + USI argument_data_start; + USI num_arguments; +}; + struct sim_state { sim_cpu *cpu; #define STATE_CPU(sd, n) (/*&*/ (sd)->cpu) CGEN_STATE cgen_state; - unsigned int heap_start; - unsigned int heap_end; - unsigned int stack_top; + + struct sim_memory memory; + int memory_regions_defined_by_user; sim_state_base base; }; diff --git a/sim/arc/syscall.h b/sim/arc/syscall.h new file mode 100755 index 0000000..3f4252a --- /dev/null +++ b/sim/arc/syscall.h @@ -0,0 +1,281 @@ +/* + * This file contains the system call numbers. + */ + +#define __NR_exit 1 +#define __NR_fork 2 +#define __NR_read 3 +#define __NR_write 4 +#define __NR_open 5 +#define __NR_close 6 +#define __NR_waitpid 7 +#define __NR_creat 8 +#define __NR_link 9 +#define __NR_unlink 10 +#define __NR_execve 11 +#define __NR_chdir 12 +#define __NR_time 13 +#define __NR_mknod 14 +#define __NR_chmod 15 +#define __NR_lchown 16 +#define __NR_break 17 +#define __NR_oldstat 18 +#define __NR_lseek 19 +#define __NR_getpid 20 +#define __NR_mount 21 +#define __NR_umount 22 +#define __NR_setuid 23 +#define __NR_getuid 24 +#define __NR_stime 25 +#define __NR_ptrace 26 +#define __NR_alarm 27 +#define __NR_oldfstat 28 +#define __NR_pause 29 +#define __NR_utime 30 +#define __NR_stty 31 +#define __NR_gtty 32 +#define __NR_access 33 +#define __NR_nice 34 +#define __NR_ftime 35 +#define __NR_sync 36 +#define __NR_kill 37 +#define __NR_rename 38 +#define __NR_mkdir 39 +#define __NR_rmdir 40 +#define __NR_dup 41 +#define __NR_pipe 42 +#define __NR_times 43 +#define __NR_prof 44 +#define __NR_brk 45 +#define __NR_setgid 46 +#define __NR_getgid 47 +#define __NR_signal 48 +#define __NR_geteuid 49 +#define __NR_getegid 50 +#define __NR_acct 51 +#define __NR_umount2 52 +#define __NR_lock 53 +#define __NR_ioctl 54 +#define __NR_fcntl 55 +#define __NR_mpx 56 +#define __NR_setpgid 57 +#define __NR_ulimit 58 +#define __NR_oldolduname 59 +#define __NR_umask 60 +#define __NR_chroot 61 +#define __NR_ustat 62 +#define __NR_dup2 63 +#define __NR_getppid 64 +#define __NR_getpgrp 65 +#define __NR_setsid 66 +#define __NR_sigaction 67 +#define __NR_sgetmask 68 +#define __NR_ssetmask 69 +#define __NR_setreuid 70 +#define __NR_setregid 71 +#define __NR_sigsuspend 72 +#define __NR_sigpending 73 +#define __NR_sethostname 74 +#define __NR_setrlimit 75 +#define __NR_getrlimit 76 +#define __NR_getrusage 77 +#define __NR_gettimeofday 78 +#define __NR_settimeofday 79 +#define __NR_getgroups 80 +#define __NR_setgroups 81 +#define __NR_select 82 +#define __NR_symlink 83 +#define __NR_oldlstat 84 +#define __NR_readlink 85 +#define __NR_uselib 86 +#define __NR_swapon 87 +#define __NR_reboot 88 +#define __NR_readdir 89 +#define __NR_mmap 90 +#define __NR_munmap 91 +#define __NR_truncate 92 +#define __NR_ftruncate 93 +#define __NR_fchmod 94 +#define __NR_fchown 95 +#define __NR_getpriority 96 +#define __NR_setpriority 97 +#define __NR_profil 98 +#define __NR_statfs 99 +#define __NR_fstatfs 100 +#define __NR_ioperm 101 +#define __NR_socketcall 102 +#define __NR_syslog 103 +#define __NR_setitimer 104 +#define __NR_getitimer 105 +#define __NR_stat 106 +#define __NR_lstat 107 +#define __NR_fstat 108 +#define __NR_olduname 109 +#define __NR_iopl 110 +#define __NR_vhangup 111 +#define __NR_idle 112 +#define __NR_vm86old 113 +#define __NR_wait4 114 +#define __NR_swapoff 115 +#define __NR_sysinfo 116 +#define __NR_ipc 117 +#define __NR_fsync 118 +#define __NR_sigreturn 119 +#define __NR_clone 120 +#define __NR_setdomainname 121 +#define __NR_uname 122 +#define __NR_modify_ldt 123 +#define __NR_adjtimex 124 +#define __NR_mprotect 125 +#define __NR_sigprocmask 126 +#define __NR_create_module 127 +#define __NR_init_module 128 +#define __NR_delete_module 129 +#define __NR_get_kernel_syms 130 +#define __NR_quotactl 131 +#define __NR_getpgid 132 +#define __NR_fchdir 133 +#define __NR_bdflush 134 +#define __NR_sysfs 135 +#define __NR_personality 136 +#define __NR_afs_syscall 137 /* Syscall for Andrew File System */ +#define __NR_setfsuid 138 +#define __NR_setfsgid 139 +#define __NR__llseek 140 +#define __NR_getdents 141 +#define __NR__newselect 142 +#define __NR_flock 143 +#define __NR_msync 144 +#define __NR_readv 145 +#define __NR_writev 146 +#define __NR_getsid 147 +#define __NR_fdatasync 148 +#define __NR__sysctl 149 +#define __NR_mlock 150 +#define __NR_munlock 151 +#define __NR_mlockall 152 +#define __NR_munlockall 153 +#define __NR_sched_setparam 154 +#define __NR_sched_getparam 155 +#define __NR_sched_setscheduler 156 +#define __NR_sched_getscheduler 157 +#define __NR_sched_yield 158 +#define __NR_sched_get_priority_max 159 +#define __NR_sched_get_priority_min 160 +#define __NR_sched_rr_get_interval 161 +#define __NR_nanosleep 162 +#define __NR_mremap 163 +#define __NR_setresuid 164 +#define __NR_getresuid 165 +#define __NR_vm86 166 +#define __NR_query_module 167 +#define __NR_poll 168 +#define __NR_nfsservctl 169 +#define __NR_setresgid 170 +#define __NR_getresgid 171 +#define __NR_prctl 172 +#define __NR_rt_sigreturn 173 +#define __NR_rt_sigaction 174 +#define __NR_rt_sigprocmask 175 +#define __NR_rt_sigpending 176 +#define __NR_rt_sigtimedwait 177 +#define __NR_rt_sigqueueinfo 178 +#define __NR_rt_sigsuspend 179 +#define __NR_pread 180 +#define __NR_pwrite 181 +#define __NR_chown 182 +#define __NR_getcwd 183 +#define __NR_capget 184 +#define __NR_capset 185 +#define __NR_sigaltstack 186 +#define __NR_sendfile 187 +#define __NR_getpmsg 188 /* some people actually want streams */ +#define __NR_putpmsg 189 /* some people actually want streams */ +#define __NR_vfork 190 + +#define __NR_pread64 180 +#define __NR_pwrite64 181 + +#define __NR_ugetrlimit 191 /* SuS compliant getrlimit */ +#define __NR_mmap2 192 +#define __NR_truncate64 193 +#define __NR_ftruncate64 194 +#define __NR_stat64 195 +#define __NR_lstat64 196 +#define __NR_fstat64 197 +#define __NR_lchown32 198 +#define __NR_getuid32 199 +#define __NR_getgid32 200 +#define __NR_geteuid32 201 +#define __NR_getegid32 202 +#define __NR_setreuid32 203 +#define __NR_setregid32 204 +#define __NR_getgroups32 205 +#define __NR_setgroups32 206 +#define __NR_fchown32 207 +#define __NR_setresuid32 208 +#define __NR_getresuid32 209 +#define __NR_setresgid32 210 +#define __NR_getresgid32 211 +#define __NR_chown32 212 +#define __NR_setuid32 213 +#define __NR_setgid32 214 +#define __NR_setfsuid32 215 +#define __NR_setfsgid32 216 +#define __NR_pivot_root 217 +#define __NR_mincore 218 +#define __NR_madvise 219 +#define __NR_madvise1 219 /* delete when C lib stub is removed */ +#define __NR_getdents64 220 +#define __NR_fcntl64 221 +/* 223 is unused */ +#define __NR_gettid 224 +#define __NR_readahead 225 +#define __NR_setxattr 226 +#define __NR_lsetxattr 227 +#define __NR_fsetxattr 228 +#define __NR_getxattr 229 +#define __NR_lgetxattr 230 +#define __NR_fgetxattr 231 +#define __NR_listxattr 232 +#define __NR_llistxattr 233 +#define __NR_flistxattr 234 +#define __NR_removexattr 235 +#define __NR_lremovexattr 236 +#define __NR_fremovexattr 237 +#define __NR_tkill 238 +#define __NR_sendfile64 239 +#define __NR_futex 240 +#define __NR_sched_setaffinity 241 +#define __NR_sched_getaffinity 242 +#define __NR_set_thread_area 243 +#define __NR_get_thread_area 244 +#define __NR_io_setup 245 +#define __NR_io_destroy 246 +#define __NR_io_getevents 247 +#define __NR_io_submit 248 +#define __NR_io_cancel 249 +#define __NR_fadvise64 250 + +#define __NR_exit_group 252 +#define __NR_lookup_dcookie 253 +#define __NR_epoll_create 254 +#define __NR_epoll_ctl 255 +#define __NR_epoll_wait 256 +#define __NR_remap_file_pages 257 +#define __NR_set_tid_address 258 +#define __NR_timer_create 259 +#define __NR_timer_settime (__NR_timer_create+1) +#define __NR_timer_gettime (__NR_timer_create+2) +#define __NR_timer_getoverrun (__NR_timer_create+3) +#define __NR_timer_delete (__NR_timer_create+4) +#define __NR_clock_settime (__NR_timer_create+5) +#define __NR_clock_gettime (__NR_timer_create+6) +#define __NR_clock_getres (__NR_timer_create+7) +#define __NR_clock_nanosleep (__NR_timer_create+8) +#define __NR_statfs64 268 +#define __NR_fstatfs64 269 +#define __NR_tgkill 270 +#define __NR_utimes 271 +#define __NR_fadvise64_64 272 +#define __NR_vserver 273 diff --git a/sim/arc/tconfig.in b/sim/arc/tconfig.in index ded104a..7f10f57 100644 --- a/sim/arc/tconfig.in +++ b/sim/arc/tconfig.in @@ -44,4 +44,6 @@ MODULE_INSTALL_FN dv_sockser_install; one of -scache/-pbb. */ #define WITH_SCACHE_PBB 1 +#define SIM_HAVE_BIENDIAN 1 + #endif /* ARC_TCONFIG_H */ diff --git a/sim/arc/traps-linux.c b/sim/arc/traps-linux.c new file mode 100755 index 0000000..4feb2c0 --- /dev/null +++ b/sim/arc/traps-linux.c @@ -0,0 +1 @@ +#include "traps.c" \ No newline at end of file diff --git a/sim/arc/traps.c b/sim/arc/traps.c index 6702523..e583a06 100644 --- a/sim/arc/traps.c +++ b/sim/arc/traps.c @@ -248,7 +248,7 @@ arc_syscall (host_callback *cb, CB_SYSCALL *s) if (s->arg1 == 0) s->result = current_cpu->endbrk; - else if (s->arg1 <= sd->heap_end) + else if (s->arg1 <= sd->memory.heap_end) current_cpu->endbrk = s->arg1; else { diff --git a/sim/common/ChangeLog.ARC b/sim/common/ChangeLog.ARC index 2b73a9f..5bf878d 100644 --- a/sim/common/ChangeLog.ARC +++ b/sim/common/ChangeLog.ARC @@ -1,3 +1,17 @@ +2007-11-13 Irfan Rafiq + + * Ingegrating CGEN simulator with gdb. + - model5.c, model6.c, model7.c : Synchronizing model strings like A7 with GDB internal DS. + +2007-11-05 Irfan Rafiq + * Ingegrating CGEN simulator with gdb. + - tconfig.in : defined SIM_HAVE_BIENDIAN 1 + +2007-10-26 Irfan Rafiq + * Ingegrating CGEN simulator with gdb. + - sim-if.c : Fix of crash + - sim-main.c : For arc-opc-cgen.h + 2007-09-17 J"orn Rennecke * gentvals.sh: Allow target-specific definitions to override @@ -8,8 +22,7 @@ 2007-08-22 J"orn Rennecke - * cgen-trace.c (sim_cgen_disassemble_insn): - Check for CGEN_INSN_DISASM_BITSIZE. + * (cgen-trace.c): Check for CGEN_INSN_DISASM_BITSIZE. 2007-08-21 J"orn Rennecke diff --git a/sim/common/callback.c b/sim/common/callback.c index c0a4407..673e6e1 100644 --- a/sim/common/callback.c +++ b/sim/common/callback.c @@ -361,13 +361,16 @@ os_read (p, fd, buf, len) return result; } +/* Descriptors 0 / 1 / 2 might have been subject to freopen, as in + 27_io/objects/char/12048-[1-4].cc , and thus correspond to a different + host file descriptor. */ static int os_read_stdin (p, buf, len) host_callback *p; char *buf; int len; { - return wrap (p, read (0, buf, len)); + os_read (p, 0, buf, len); } static int @@ -433,10 +436,10 @@ os_write (p, fd, buf, len) result = wrap (p, write (real_fd, buf, len)); break; case 1: - result = p->write_stdout (p, buf, len); + result = fwrite (buf, 1, len, stdout); break; case 2: - result = p->write_stderr (p, buf, len); + result = fwrite (buf, 1, len, stderr); break; } return result; @@ -448,7 +451,7 @@ os_write_stdout (p, buf, len) const char *buf; int len; { - return fwrite (buf, 1, len, stdout); + os_write (p, 1, buf, len); } static void @@ -464,7 +467,7 @@ os_write_stderr (p, buf, len) const char *buf; int len; { - return fwrite (buf, 1, len, stderr); + os_write (p, 2, buf, len); } static void @@ -1136,21 +1139,3 @@ sim_cb_eprintf (host_callback *p, const char *fmt, ...) p->evprintf_filtered (p, fmt, ap); va_end (ap); } - -int -cb_is_stdin (host_callback *cb, int fd) -{ - return fdbad (cb, fd) ? 0 : fdmap (cb, fd) == 0; -} - -int -cb_is_stdout (host_callback *cb, int fd) -{ - return fdbad (cb, fd) ? 0 : fdmap (cb, fd) == 1; -} - -int -cb_is_stderr (host_callback *cb, int fd) -{ - return fdbad (cb, fd) ? 0 : fdmap (cb, fd) == 2; -} diff --git a/sim/common/gennltvals.sh b/sim/common/gennltvals.sh index ec4d49a..afb733d 100644 --- a/sim/common/gennltvals.sh +++ b/sim/common/gennltvals.sh @@ -20,7 +20,7 @@ $shell ${srccom}/gentvals.sh "" signal ${srcroot}/newlib/libc/include \ "signal.h sys/signal.h" 'SIG[A-Z0-9]*' "${cpp}" $shell ${srccom}/gentvals.sh "arc" open ${srcroot}/newlib/libc/include \ - "../sys/arc/sys/fcntl.h" 'O_[A-Z0-9]*' "${cpp}" + "../sys/arc/sys/fcntl.h" 'O_[A-Z0-9]*' "${cpp}" $shell ${srccom}/gentvals.sh "" open ${srcroot}/newlib/libc/include \ "fcntl.h sys/fcntl.h" 'O_[A-Z0-9]*' "${cpp}" @@ -34,7 +34,7 @@ $shell ${srccom}/gentvals.sh "" open ${srcroot}/newlib/libc/include \ dir=libgloss/arc target=arc $shell ${srccom}/gentvals.sh $target sys ${srcroot}/$dir \ - "syscall.h" 'SYS_[_A-Za-z0-9]*' "${cpp}" + "syscall.h" 'SYS_[_A-Za-z0-9]*' "${cpp}" dir=newlib/libc/sys/d10v/sys target=d10v $shell ${srccom}/gentvals.sh $target sys ${srcroot}/$dir \ diff --git a/sim/common/syscall.c b/sim/common/syscall.c index b0b98b5..e2a1e01 100644 --- a/sim/common/syscall.c +++ b/sim/common/syscall.c @@ -291,7 +291,11 @@ cb_syscall (cb, sc) while (count > 0) { - if (cb_is_stdin (cb, fd)) + /* ??? Actually making target descriptors 0 / 1 / 2 map directly + to stdin / stdout / stderr gets the semantics of freopen + wrong. When using default callbacks, this is re-mapped + in callback.c */ + if (fd == 0) result = (int) (*cb->read_stdin) (cb, buf, (count < FILE_XFR_SIZE ? count : FILE_XFR_SIZE)); @@ -344,12 +348,20 @@ cb_syscall (cb, sc) errcode = EINVAL; goto FinishSyscall; } - if (cb_is_stdout(cb, fd)) + /* Don't treat descriptors 0 / 1 / 2 specially, as their + meaning might have been changed by freopen, as in + 27_io/objects/char/12048-[1-4].cc . */ + + /* ??? Actually making target descriptors 0 / 1 / 2 map directly + to stdin / stdout / stderr gets the semantics of freopen + wrong. When using default callbacks, this is re-mapped + in callback.c */ + if (fd == 1) { result = (int) (*cb->write_stdout) (cb, buf, bytes_read); (*cb->flush_stdout) (cb); } - else if (cb_is_stderr(cb, fd)) + else if (fd == 2) { result = (int) (*cb->write_stderr) (cb, buf, bytes_read); (*cb->flush_stderr) (cb); -- cgit v1.1