OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /or1k/tags/final_interface/gdb-5.0/sim/h8300
    from Rev 114 to Rev 1765
    Reverse comparison

Rev 114 → Rev 1765

/acconfig.h
0,0 → 1,15
 
/* Define to 1 if NLS is requested. */
#undef ENABLE_NLS
 
/* Define as 1 if you have catgets and don't want to use GNU gettext. */
#undef HAVE_CATGETS
 
/* Define as 1 if you have gettext and don't want to use GNU gettext. */
#undef HAVE_GETTEXT
 
/* Define as 1 if you have the stpcpy function. */
#undef HAVE_STPCPY
 
/* Define if your locale.h file contains LC_MESSAGES. */
#undef HAVE_LC_MESSAGES
/configure
0,0 → 1,4013
#! /bin/sh
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
sim_inline="-DDEFAULT_INLINE=0"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
# This file is derived from `gettext.m4'. The difference is that the
# included macros assume Cygnus-style source and build trees.
 
# Macro to add for using GNU gettext.
# Ulrich Drepper <drepper@cygnus.com>, 1995.
#
# This file file be copied and used freely without restrictions. It can
# be used in projects which are not available under the GNU Public License
# but which still want to provide support for the GNU gettext functionality.
# Please note that the actual code is *not* freely available.
 
# serial 3
 
 
 
 
 
# Search path for a program which passes the given test.
# Ulrich Drepper <drepper@cygnus.com>, 1996.
#
# This file file be copied and used freely without restrictions. It can
# be used in projects which are not available under the GNU Public License
# but which still want to provide support for the GNU gettext functionality.
# Please note that the actual code is *not* freely available.
 
# serial 1
 
 
 
# Check whether LC_MESSAGES is available in <locale.h>.
# Ulrich Drepper <drepper@cygnus.com>, 1995.
#
# This file file be copied and used freely without restrictions. It can
# be used in projects which are not available under the GNU Public License
# but which still want to provide support for the GNU gettext functionality.
# Please note that the actual code is *not* freely available.
 
# serial 1
 
 
 
 
 
 
# Guess values for system-dependent variables and create Makefiles.
# Generated automatically using autoconf version 2.13
# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
#
# This configure script is free software; the Free Software Foundation
# gives unlimited permission to copy, distribute and modify it.
 
# Defaults:
ac_help=
ac_default_prefix=/usr/local
# Any additions from configure.in:
ac_help="$ac_help
--disable-nls do not use Native Language Support"
ac_help="$ac_help
--with-included-gettext use the GNU gettext library included here"
ac_help="$ac_help
--enable-maintainer-mode Enable developer functionality."
ac_help="$ac_help
--enable-sim-bswap Use Host specific BSWAP instruction."
ac_help="$ac_help
--enable-sim-cflags=opts Extra CFLAGS for use in building simulator"
ac_help="$ac_help
--enable-sim-debug=opts Enable debugging flags"
ac_help="$ac_help
--enable-sim-stdio Specify whether to use stdio for console input/output."
ac_help="$ac_help
--enable-sim-trace=opts Enable tracing flags"
ac_help="$ac_help
--enable-sim-profile=opts Enable profiling flags"
 
# Initialize some variables set by options.
# The variables have the same names as the options, with
# dashes changed to underlines.
build=NONE
cache_file=./config.cache
exec_prefix=NONE
host=NONE
no_create=
nonopt=NONE
no_recursion=
prefix=NONE
program_prefix=NONE
program_suffix=NONE
program_transform_name=s,x,x,
silent=
site=
srcdir=
target=NONE
verbose=
x_includes=NONE
x_libraries=NONE
bindir='${exec_prefix}/bin'
sbindir='${exec_prefix}/sbin'
libexecdir='${exec_prefix}/libexec'
datadir='${prefix}/share'
sysconfdir='${prefix}/etc'
sharedstatedir='${prefix}/com'
localstatedir='${prefix}/var'
libdir='${exec_prefix}/lib'
includedir='${prefix}/include'
oldincludedir='/usr/include'
infodir='${prefix}/info'
mandir='${prefix}/man'
 
# Initialize some other variables.
subdirs=
MFLAGS= MAKEFLAGS=
SHELL=${CONFIG_SHELL-/bin/sh}
# Maximum number of lines to put in a shell here document.
ac_max_here_lines=12
 
ac_prev=
for ac_option
do
 
# If the previous option needs an argument, assign it.
if test -n "$ac_prev"; then
eval "$ac_prev=\$ac_option"
ac_prev=
continue
fi
 
case "$ac_option" in
-*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
*) ac_optarg= ;;
esac
 
# Accept the important Cygnus configure options, so we can diagnose typos.
 
case "$ac_option" in
 
-bindir | --bindir | --bindi | --bind | --bin | --bi)
ac_prev=bindir ;;
-bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
bindir="$ac_optarg" ;;
 
-build | --build | --buil | --bui | --bu)
ac_prev=build ;;
-build=* | --build=* | --buil=* | --bui=* | --bu=*)
build="$ac_optarg" ;;
 
-cache-file | --cache-file | --cache-fil | --cache-fi \
| --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
ac_prev=cache_file ;;
-cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
| --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
cache_file="$ac_optarg" ;;
 
-datadir | --datadir | --datadi | --datad | --data | --dat | --da)
ac_prev=datadir ;;
-datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
| --da=*)
datadir="$ac_optarg" ;;
 
-disable-* | --disable-*)
ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
# Reject names that are not valid shell variable names.
if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
{ echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
fi
ac_feature=`echo $ac_feature| sed 's/-/_/g'`
eval "enable_${ac_feature}=no" ;;
 
-enable-* | --enable-*)
ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
# Reject names that are not valid shell variable names.
if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
{ echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
fi
ac_feature=`echo $ac_feature| sed 's/-/_/g'`
case "$ac_option" in
*=*) ;;
*) ac_optarg=yes ;;
esac
eval "enable_${ac_feature}='$ac_optarg'" ;;
 
-exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
| --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
| --exec | --exe | --ex)
ac_prev=exec_prefix ;;
-exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
| --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
| --exec=* | --exe=* | --ex=*)
exec_prefix="$ac_optarg" ;;
 
-gas | --gas | --ga | --g)
# Obsolete; use --with-gas.
with_gas=yes ;;
 
-help | --help | --hel | --he)
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat << EOF
Usage: configure [options] [host]
Options: [defaults in brackets after descriptions]
Configuration:
--cache-file=FILE cache test results in FILE
--help print this message
--no-create do not create output files
--quiet, --silent do not print \`checking...' messages
--version print the version of autoconf that created configure
Directory and file names:
--prefix=PREFIX install architecture-independent files in PREFIX
[$ac_default_prefix]
--exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
[same as prefix]
--bindir=DIR user executables in DIR [EPREFIX/bin]
--sbindir=DIR system admin executables in DIR [EPREFIX/sbin]
--libexecdir=DIR program executables in DIR [EPREFIX/libexec]
--datadir=DIR read-only architecture-independent data in DIR
[PREFIX/share]
--sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc]
--sharedstatedir=DIR modifiable architecture-independent data in DIR
[PREFIX/com]
--localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var]
--libdir=DIR object code libraries in DIR [EPREFIX/lib]
--includedir=DIR C header files in DIR [PREFIX/include]
--oldincludedir=DIR C header files for non-gcc in DIR [/usr/include]
--infodir=DIR info documentation in DIR [PREFIX/info]
--mandir=DIR man documentation in DIR [PREFIX/man]
--srcdir=DIR find the sources in DIR [configure dir or ..]
--program-prefix=PREFIX prepend PREFIX to installed program names
--program-suffix=SUFFIX append SUFFIX to installed program names
--program-transform-name=PROGRAM
run sed PROGRAM on installed program names
EOF
cat << EOF
Host type:
--build=BUILD configure for building on BUILD [BUILD=HOST]
--host=HOST configure for HOST [guessed]
--target=TARGET configure for TARGET [TARGET=HOST]
Features and packages:
--disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
--x-includes=DIR X include files are in DIR
--x-libraries=DIR X library files are in DIR
EOF
if test -n "$ac_help"; then
echo "--enable and --with options recognized:$ac_help"
fi
exit 0 ;;
 
-host | --host | --hos | --ho)
ac_prev=host ;;
-host=* | --host=* | --hos=* | --ho=*)
host="$ac_optarg" ;;
 
-includedir | --includedir | --includedi | --included | --include \
| --includ | --inclu | --incl | --inc)
ac_prev=includedir ;;
-includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
| --includ=* | --inclu=* | --incl=* | --inc=*)
includedir="$ac_optarg" ;;
 
-infodir | --infodir | --infodi | --infod | --info | --inf)
ac_prev=infodir ;;
-infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
infodir="$ac_optarg" ;;
 
-libdir | --libdir | --libdi | --libd)
ac_prev=libdir ;;
-libdir=* | --libdir=* | --libdi=* | --libd=*)
libdir="$ac_optarg" ;;
 
-libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
| --libexe | --libex | --libe)
ac_prev=libexecdir ;;
-libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
| --libexe=* | --libex=* | --libe=*)
libexecdir="$ac_optarg" ;;
 
-localstatedir | --localstatedir | --localstatedi | --localstated \
| --localstate | --localstat | --localsta | --localst \
| --locals | --local | --loca | --loc | --lo)
ac_prev=localstatedir ;;
-localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
| --localstate=* | --localstat=* | --localsta=* | --localst=* \
| --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
localstatedir="$ac_optarg" ;;
 
-mandir | --mandir | --mandi | --mand | --man | --ma | --m)
ac_prev=mandir ;;
-mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
mandir="$ac_optarg" ;;
 
-nfp | --nfp | --nf)
# Obsolete; use --without-fp.
with_fp=no ;;
 
-no-create | --no-create | --no-creat | --no-crea | --no-cre \
| --no-cr | --no-c)
no_create=yes ;;
 
-no-recursion | --no-recursion | --no-recursio | --no-recursi \
| --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
no_recursion=yes ;;
 
-oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
| --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
| --oldin | --oldi | --old | --ol | --o)
ac_prev=oldincludedir ;;
-oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
| --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
| --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
oldincludedir="$ac_optarg" ;;
 
-prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
ac_prev=prefix ;;
-prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
prefix="$ac_optarg" ;;
 
-program-prefix | --program-prefix | --program-prefi | --program-pref \
| --program-pre | --program-pr | --program-p)
ac_prev=program_prefix ;;
-program-prefix=* | --program-prefix=* | --program-prefi=* \
| --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
program_prefix="$ac_optarg" ;;
 
-program-suffix | --program-suffix | --program-suffi | --program-suff \
| --program-suf | --program-su | --program-s)
ac_prev=program_suffix ;;
-program-suffix=* | --program-suffix=* | --program-suffi=* \
| --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
program_suffix="$ac_optarg" ;;
 
-program-transform-name | --program-transform-name \
| --program-transform-nam | --program-transform-na \
| --program-transform-n | --program-transform- \
| --program-transform | --program-transfor \
| --program-transfo | --program-transf \
| --program-trans | --program-tran \
| --progr-tra | --program-tr | --program-t)
ac_prev=program_transform_name ;;
-program-transform-name=* | --program-transform-name=* \
| --program-transform-nam=* | --program-transform-na=* \
| --program-transform-n=* | --program-transform-=* \
| --program-transform=* | --program-transfor=* \
| --program-transfo=* | --program-transf=* \
| --program-trans=* | --program-tran=* \
| --progr-tra=* | --program-tr=* | --program-t=*)
program_transform_name="$ac_optarg" ;;
 
-q | -quiet | --quiet | --quie | --qui | --qu | --q \
| -silent | --silent | --silen | --sile | --sil)
silent=yes ;;
 
-sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
ac_prev=sbindir ;;
-sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
| --sbi=* | --sb=*)
sbindir="$ac_optarg" ;;
 
-sharedstatedir | --sharedstatedir | --sharedstatedi \
| --sharedstated | --sharedstate | --sharedstat | --sharedsta \
| --sharedst | --shareds | --shared | --share | --shar \
| --sha | --sh)
ac_prev=sharedstatedir ;;
-sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
| --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
| --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
| --sha=* | --sh=*)
sharedstatedir="$ac_optarg" ;;
 
-site | --site | --sit)
ac_prev=site ;;
-site=* | --site=* | --sit=*)
site="$ac_optarg" ;;
 
-srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
ac_prev=srcdir ;;
-srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
srcdir="$ac_optarg" ;;
 
-sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
| --syscon | --sysco | --sysc | --sys | --sy)
ac_prev=sysconfdir ;;
-sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
| --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
sysconfdir="$ac_optarg" ;;
 
-target | --target | --targe | --targ | --tar | --ta | --t)
ac_prev=target ;;
-target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
target="$ac_optarg" ;;
 
-v | -verbose | --verbose | --verbos | --verbo | --verb)
verbose=yes ;;
 
-version | --version | --versio | --versi | --vers)
echo "configure generated by autoconf version 2.13"
exit 0 ;;
 
-with-* | --with-*)
ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
# Reject names that are not valid shell variable names.
if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
{ echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
fi
ac_package=`echo $ac_package| sed 's/-/_/g'`
case "$ac_option" in
*=*) ;;
*) ac_optarg=yes ;;
esac
eval "with_${ac_package}='$ac_optarg'" ;;
 
-without-* | --without-*)
ac_package=`echo $ac_option|sed -e 's/-*without-//'`
# Reject names that are not valid shell variable names.
if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
{ echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
fi
ac_package=`echo $ac_package| sed 's/-/_/g'`
eval "with_${ac_package}=no" ;;
 
--x)
# Obsolete; use --with-x.
with_x=yes ;;
 
-x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
| --x-incl | --x-inc | --x-in | --x-i)
ac_prev=x_includes ;;
-x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
| --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
x_includes="$ac_optarg" ;;
 
-x-libraries | --x-libraries | --x-librarie | --x-librari \
| --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
ac_prev=x_libraries ;;
-x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
| --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
x_libraries="$ac_optarg" ;;
 
-*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
;;
 
*)
if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
echo "configure: warning: $ac_option: invalid host type" 1>&2
fi
if test "x$nonopt" != xNONE; then
{ echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
fi
nonopt="$ac_option"
;;
 
esac
done
 
if test -n "$ac_prev"; then
{ echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
fi
 
trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
 
# File descriptor usage:
# 0 standard input
# 1 file creation
# 2 errors and warnings
# 3 some systems may open it to /dev/tty
# 4 used on the Kubota Titan
# 6 checking for... messages and results
# 5 compiler messages saved in config.log
if test "$silent" = yes; then
exec 6>/dev/null
else
exec 6>&1
fi
exec 5>./config.log
 
echo "\
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
" 1>&5
 
# Strip out --no-create and --no-recursion so they do not pile up.
# Also quote any args containing shell metacharacters.
ac_configure_args=
for ac_arg
do
case "$ac_arg" in
-no-create | --no-create | --no-creat | --no-crea | --no-cre \
| --no-cr | --no-c) ;;
-no-recursion | --no-recursion | --no-recursio | --no-recursi \
| --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
*" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
ac_configure_args="$ac_configure_args '$ac_arg'" ;;
*) ac_configure_args="$ac_configure_args $ac_arg" ;;
esac
done
 
# NLS nuisances.
# Only set these to C if already set. These must not be set unconditionally
# because not all systems understand e.g. LANG=C (notably SCO).
# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
# Non-C LC_CTYPE values break the ctype check.
if test "${LANG+set}" = set; then LANG=C; export LANG; fi
if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi
 
# confdefs.h avoids OS command line length limits that DEFS can exceed.
rm -rf conftest* confdefs.h
# AIX cpp loses on an empty file, so make sure it contains at least a newline.
echo > confdefs.h
 
# A filename unique to this package, relative to the directory that
# configure is in, which we can look for to find out if srcdir is correct.
ac_unique_file=Makefile.in
 
# Find the source files, if location was not specified.
if test -z "$srcdir"; then
ac_srcdir_defaulted=yes
# Try the directory containing this script, then its parent.
ac_prog=$0
ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
srcdir=$ac_confdir
if test ! -r $srcdir/$ac_unique_file; then
srcdir=..
fi
else
ac_srcdir_defaulted=no
fi
if test ! -r $srcdir/$ac_unique_file; then
if test "$ac_srcdir_defaulted" = yes; then
{ echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
else
{ echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
fi
fi
srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
 
# Prefer explicitly selected file to automatically selected ones.
if test -z "$CONFIG_SITE"; then
if test "x$prefix" != xNONE; then
CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
else
CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
fi
fi
for ac_site_file in $CONFIG_SITE; do
if test -r "$ac_site_file"; then
echo "loading site script $ac_site_file"
. "$ac_site_file"
fi
done
 
if test -r "$cache_file"; then
echo "loading cache $cache_file"
. $cache_file
else
echo "creating cache $cache_file"
> $cache_file
fi
 
ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross
 
ac_exeext=
ac_objext=o
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
# Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
ac_n= ac_c='
' ac_t=' '
else
ac_n=-n ac_c= ac_t=
fi
else
ac_n= ac_c='\c' ac_t=
fi
 
 
 
echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
echo "configure:668: checking how to run the C preprocessor" >&5
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
CPP=
fi
if test -z "$CPP"; then
if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# This must be in double quotes, not single quotes, because CPP may get
# substituted into the Makefile and "${CC-cc}" will confuse make.
CPP="${CC-cc} -E"
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp.
cat > conftest.$ac_ext <<EOF
#line 683 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:689: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
:
else
echo "$ac_err" >&5
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
CPP="${CC-cc} -E -traditional-cpp"
cat > conftest.$ac_ext <<EOF
#line 700 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:706: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
:
else
echo "$ac_err" >&5
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
CPP="${CC-cc} -nologo -E"
cat > conftest.$ac_ext <<EOF
#line 717 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:723: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
:
else
echo "$ac_err" >&5
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
CPP=/lib/cpp
fi
rm -f conftest*
fi
rm -f conftest*
fi
rm -f conftest*
ac_cv_prog_CPP="$CPP"
fi
CPP="$ac_cv_prog_CPP"
else
ac_cv_prog_CPP="$CPP"
fi
echo "$ac_t""$CPP" 1>&6
 
echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
echo "configure:748: checking whether ${MAKE-make} sets \${MAKE}" >&5
set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftestmake <<\EOF
all:
@echo 'ac_maketemp="${MAKE}"'
EOF
# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
if test -n "$ac_maketemp"; then
eval ac_cv_prog_make_${ac_make}_set=yes
else
eval ac_cv_prog_make_${ac_make}_set=no
fi
rm -f conftestmake
fi
if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
echo "$ac_t""yes" 1>&6
SET_MAKE=
else
echo "$ac_t""no" 1>&6
SET_MAKE="MAKE=${MAKE-make}"
fi
 
echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6
echo "configure:775: checking for POSIXized ISC" >&5
if test -d /etc/conf/kconfig.d &&
grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
then
echo "$ac_t""yes" 1>&6
ISC=yes # If later tests want to check for ISC.
cat >> confdefs.h <<\EOF
#define _POSIX_SOURCE 1
EOF
 
if test "$GCC" = yes; then
CC="$CC -posix"
else
CC="$CC -Xp"
fi
else
echo "$ac_t""no" 1>&6
ISC=
fi
 
echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
echo "configure:796: checking for ANSI C header files" >&5
if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 801 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <float.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:809: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
ac_cv_header_stdc=yes
else
echo "$ac_err" >&5
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
ac_cv_header_stdc=no
fi
rm -f conftest*
 
if test $ac_cv_header_stdc = yes; then
# SunOS 4.x string.h does not declare mem*, contrary to ANSI.
cat > conftest.$ac_ext <<EOF
#line 826 "configure"
#include "confdefs.h"
#include <string.h>
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
egrep "memchr" >/dev/null 2>&1; then
:
else
rm -rf conftest*
ac_cv_header_stdc=no
fi
rm -f conftest*
 
fi
 
if test $ac_cv_header_stdc = yes; then
# ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
cat > conftest.$ac_ext <<EOF
#line 844 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
egrep "free" >/dev/null 2>&1; then
:
else
rm -rf conftest*
ac_cv_header_stdc=no
fi
rm -f conftest*
 
fi
 
if test $ac_cv_header_stdc = yes; then
# /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
if test "$cross_compiling" = yes; then
:
else
cat > conftest.$ac_ext <<EOF
#line 865 "configure"
#include "confdefs.h"
#include <ctype.h>
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
int main () { int i; for (i = 0; i < 256; i++)
if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
exit (0); }
 
EOF
if { (eval echo configure:876: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
:
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -fr conftest*
ac_cv_header_stdc=no
fi
rm -fr conftest*
fi
 
fi
fi
 
echo "$ac_t""$ac_cv_header_stdc" 1>&6
if test $ac_cv_header_stdc = yes; then
cat >> confdefs.h <<\EOF
#define STDC_HEADERS 1
EOF
 
fi
 
echo $ac_n "checking for working const""... $ac_c" 1>&6
echo "configure:900: checking for working const" >&5
if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 905 "configure"
#include "confdefs.h"
 
int main() {
 
/* Ultrix mips cc rejects this. */
typedef int charset[2]; const charset x;
/* SunOS 4.1.1 cc rejects this. */
char const *const *ccp;
char **p;
/* NEC SVR4.0.2 mips cc rejects this. */
struct point {int x, y;};
static struct point const zero = {0,0};
/* AIX XL C 1.02.0.0 rejects this.
It does not let you subtract one const X* pointer from another in an arm
of an if-expression whose if-part is not a constant expression */
const char *g = "string";
ccp = &g + (g ? g-g : 0);
/* HPUX 7.0 cc rejects these. */
++ccp;
p = (char**) ccp;
ccp = (char const *const *) p;
{ /* SCO 3.2v4 cc rejects this. */
char *t;
char const *s = 0 ? (char *) 0 : (char const *) 0;
 
*t++ = 0;
}
{ /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */
int x[] = {25, 17};
const int *foo = &x[0];
++foo;
}
{ /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
typedef const int *iptr;
iptr p = 0;
++p;
}
{ /* AIX XL C 1.02.0.0 rejects this saying
"k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
struct s { int j; const int *ap[3]; };
struct s *b; b->j = 5;
}
{ /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
const int foo = 10;
}
 
; return 0; }
EOF
if { (eval echo configure:954: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_const=yes
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
ac_cv_c_const=no
fi
rm -f conftest*
fi
 
echo "$ac_t""$ac_cv_c_const" 1>&6
if test $ac_cv_c_const = no; then
cat >> confdefs.h <<\EOF
#define const
EOF
 
fi
 
echo $ac_n "checking for inline""... $ac_c" 1>&6
echo "configure:975: checking for inline" >&5
if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_cv_c_inline=no
for ac_kw in inline __inline__ __inline; do
cat > conftest.$ac_ext <<EOF
#line 982 "configure"
#include "confdefs.h"
 
int main() {
} $ac_kw foo() {
; return 0; }
EOF
if { (eval echo configure:989: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_inline=$ac_kw; break
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
fi
rm -f conftest*
done
 
fi
 
echo "$ac_t""$ac_cv_c_inline" 1>&6
case "$ac_cv_c_inline" in
inline | yes) ;;
no) cat >> confdefs.h <<\EOF
#define inline
EOF
;;
*) cat >> confdefs.h <<EOF
#define inline $ac_cv_c_inline
EOF
;;
esac
 
echo $ac_n "checking for off_t""... $ac_c" 1>&6
echo "configure:1015: checking for off_t" >&5
if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 1020 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
#include <stdlib.h>
#include <stddef.h>
#endif
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
egrep "(^|[^a-zA-Z_0-9])off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
rm -rf conftest*
ac_cv_type_off_t=yes
else
rm -rf conftest*
ac_cv_type_off_t=no
fi
rm -f conftest*
 
fi
echo "$ac_t""$ac_cv_type_off_t" 1>&6
if test $ac_cv_type_off_t = no; then
cat >> confdefs.h <<\EOF
#define off_t long
EOF
 
fi
 
echo $ac_n "checking for size_t""... $ac_c" 1>&6
echo "configure:1048: checking for size_t" >&5
if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 1053 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
#include <stdlib.h>
#include <stddef.h>
#endif
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
rm -rf conftest*
ac_cv_type_size_t=yes
else
rm -rf conftest*
ac_cv_type_size_t=no
fi
rm -f conftest*
 
fi
echo "$ac_t""$ac_cv_type_size_t" 1>&6
if test $ac_cv_type_size_t = no; then
cat >> confdefs.h <<\EOF
#define size_t unsigned
EOF
 
fi
 
# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
# for constant arguments. Useless!
echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6
echo "configure:1083: checking for working alloca.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 1088 "configure"
#include "confdefs.h"
#include <alloca.h>
int main() {
char *p = alloca(2 * sizeof(int));
; return 0; }
EOF
if { (eval echo configure:1095: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_header_alloca_h=yes
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
ac_cv_header_alloca_h=no
fi
rm -f conftest*
fi
 
echo "$ac_t""$ac_cv_header_alloca_h" 1>&6
if test $ac_cv_header_alloca_h = yes; then
cat >> confdefs.h <<\EOF
#define HAVE_ALLOCA_H 1
EOF
 
fi
 
echo $ac_n "checking for alloca""... $ac_c" 1>&6
echo "configure:1116: checking for alloca" >&5
if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 1121 "configure"
#include "confdefs.h"
 
#ifdef __GNUC__
# define alloca __builtin_alloca
#else
# ifdef _MSC_VER
# include <malloc.h>
# define alloca _alloca
# else
# if HAVE_ALLOCA_H
# include <alloca.h>
# else
# ifdef _AIX
#pragma alloca
# else
# ifndef alloca /* predefined by HP cc +Olibcalls */
char *alloca ();
# endif
# endif
# endif
# endif
#endif
 
int main() {
char *p = (char *) alloca(1);
; return 0; }
EOF
if { (eval echo configure:1149: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_func_alloca_works=yes
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
ac_cv_func_alloca_works=no
fi
rm -f conftest*
fi
 
echo "$ac_t""$ac_cv_func_alloca_works" 1>&6
if test $ac_cv_func_alloca_works = yes; then
cat >> confdefs.h <<\EOF
#define HAVE_ALLOCA 1
EOF
 
fi
 
if test $ac_cv_func_alloca_works = no; then
# The SVR3 libPW and SVR4 libucb both contain incompatible functions
# that cause trouble. Some versions do not even contain alloca or
# contain a buggy version. If you still want to use their alloca,
# use ar to extract alloca.o from them instead of compiling alloca.c.
ALLOCA=alloca.${ac_objext}
cat >> confdefs.h <<\EOF
#define C_ALLOCA 1
EOF
 
 
echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
echo "configure:1181: checking whether alloca needs Cray hooks" >&5
if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 1186 "configure"
#include "confdefs.h"
#if defined(CRAY) && ! defined(CRAY2)
webecray
#else
wenotbecray
#endif
 
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
egrep "webecray" >/dev/null 2>&1; then
rm -rf conftest*
ac_cv_os_cray=yes
else
rm -rf conftest*
ac_cv_os_cray=no
fi
rm -f conftest*
 
fi
 
echo "$ac_t""$ac_cv_os_cray" 1>&6
if test $ac_cv_os_cray = yes; then
for ac_func in _getb67 GETB67 getb67; do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:1211: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 1216 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char $ac_func();
 
int main() {
 
/* The GNU C library defines this for functions which it implements
to always fail with ENOSYS. Some functions are actually named
something starting with __ and the normal name is an alias. */
#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
choke me
#else
$ac_func();
#endif
 
; return 0; }
EOF
if { (eval echo configure:1239: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
eval "ac_cv_func_$ac_func=no"
fi
rm -f conftest*
fi
 
if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
echo "$ac_t""yes" 1>&6
cat >> confdefs.h <<EOF
#define CRAY_STACKSEG_END $ac_func
EOF
 
break
else
echo "$ac_t""no" 1>&6
fi
 
done
fi
 
echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
echo "configure:1266: checking stack direction for C alloca" >&5
if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test "$cross_compiling" = yes; then
ac_cv_c_stack_direction=0
else
cat > conftest.$ac_ext <<EOF
#line 1274 "configure"
#include "confdefs.h"
find_stack_direction ()
{
static char *addr = 0;
auto char dummy;
if (addr == 0)
{
addr = &dummy;
return find_stack_direction ();
}
else
return (&dummy > addr) ? 1 : -1;
}
main ()
{
exit (find_stack_direction() < 0);
}
EOF
if { (eval echo configure:1293: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_c_stack_direction=1
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -fr conftest*
ac_cv_c_stack_direction=-1
fi
rm -fr conftest*
fi
 
fi
 
echo "$ac_t""$ac_cv_c_stack_direction" 1>&6
cat >> confdefs.h <<EOF
#define STACK_DIRECTION $ac_cv_c_stack_direction
EOF
 
fi
 
for ac_hdr in unistd.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:1318: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 1323 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:1328: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
eval "ac_cv_header_$ac_safe=yes"
else
echo "$ac_err" >&5
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
echo "$ac_t""yes" 1>&6
ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
cat >> confdefs.h <<EOF
#define $ac_tr_hdr 1
EOF
else
echo "$ac_t""no" 1>&6
fi
done
 
for ac_func in getpagesize
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:1357: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 1362 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char $ac_func();
 
int main() {
 
/* The GNU C library defines this for functions which it implements
to always fail with ENOSYS. Some functions are actually named
something starting with __ and the normal name is an alias. */
#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
choke me
#else
$ac_func();
#endif
 
; return 0; }
EOF
if { (eval echo configure:1385: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
eval "ac_cv_func_$ac_func=no"
fi
rm -f conftest*
fi
 
if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
echo "$ac_t""yes" 1>&6
ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
cat >> confdefs.h <<EOF
#define $ac_tr_func 1
EOF
else
echo "$ac_t""no" 1>&6
fi
done
 
echo $ac_n "checking for working mmap""... $ac_c" 1>&6
echo "configure:1410: checking for working mmap" >&5
if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test "$cross_compiling" = yes; then
ac_cv_func_mmap_fixed_mapped=no
else
cat > conftest.$ac_ext <<EOF
#line 1418 "configure"
#include "confdefs.h"
 
/* Thanks to Mike Haertel and Jim Avera for this test.
Here is a matrix of mmap possibilities:
mmap private not fixed
mmap private fixed at somewhere currently unmapped
mmap private fixed at somewhere already mapped
mmap shared not fixed
mmap shared fixed at somewhere currently unmapped
mmap shared fixed at somewhere already mapped
For private mappings, we should verify that changes cannot be read()
back from the file, nor mmap's back from the file at a different
address. (There have been systems where private was not correctly
implemented like the infamous i386 svr4.0, and systems where the
VM page cache was not coherent with the filesystem buffer cache
like early versions of FreeBSD and possibly contemporary NetBSD.)
For shared mappings, we should conversely verify that changes get
propogated back to all the places they're supposed to be.
 
Grep wants private fixed already mapped.
The main things grep needs to know about mmap are:
* does it exist and is it safe to write into the mmap'd area
* how to use it (BSD variants) */
#include <sys/types.h>
#include <fcntl.h>
#include <sys/mman.h>
 
/* This mess was copied from the GNU getpagesize.h. */
#ifndef HAVE_GETPAGESIZE
# ifdef HAVE_UNISTD_H
# include <unistd.h>
# endif
 
/* Assume that all systems that can run configure have sys/param.h. */
# ifndef HAVE_SYS_PARAM_H
# define HAVE_SYS_PARAM_H 1
# endif
 
# ifdef _SC_PAGESIZE
# define getpagesize() sysconf(_SC_PAGESIZE)
# else /* no _SC_PAGESIZE */
# ifdef HAVE_SYS_PARAM_H
# include <sys/param.h>
# ifdef EXEC_PAGESIZE
# define getpagesize() EXEC_PAGESIZE
# else /* no EXEC_PAGESIZE */
# ifdef NBPG
# define getpagesize() NBPG * CLSIZE
# ifndef CLSIZE
# define CLSIZE 1
# endif /* no CLSIZE */
# else /* no NBPG */
# ifdef NBPC
# define getpagesize() NBPC
# else /* no NBPC */
# ifdef PAGESIZE
# define getpagesize() PAGESIZE
# endif /* PAGESIZE */
# endif /* no NBPC */
# endif /* no NBPG */
# endif /* no EXEC_PAGESIZE */
# else /* no HAVE_SYS_PARAM_H */
# define getpagesize() 8192 /* punt totally */
# endif /* no HAVE_SYS_PARAM_H */
# endif /* no _SC_PAGESIZE */
 
#endif /* no HAVE_GETPAGESIZE */
 
#ifdef __cplusplus
extern "C" { void *malloc(unsigned); }
#else
char *malloc();
#endif
 
int
main()
{
char *data, *data2, *data3;
int i, pagesize;
int fd;
 
pagesize = getpagesize();
 
/*
* First, make a file with some known garbage in it.
*/
data = malloc(pagesize);
if (!data)
exit(1);
for (i = 0; i < pagesize; ++i)
*(data + i) = rand();
umask(0);
fd = creat("conftestmmap", 0600);
if (fd < 0)
exit(1);
if (write(fd, data, pagesize) != pagesize)
exit(1);
close(fd);
 
/*
* Next, try to mmap the file at a fixed address which
* already has something else allocated at it. If we can,
* also make sure that we see the same garbage.
*/
fd = open("conftestmmap", O_RDWR);
if (fd < 0)
exit(1);
data2 = malloc(2 * pagesize);
if (!data2)
exit(1);
data2 += (pagesize - ((int) data2 & (pagesize - 1))) & (pagesize - 1);
if (data2 != mmap(data2, pagesize, PROT_READ | PROT_WRITE,
MAP_PRIVATE | MAP_FIXED, fd, 0L))
exit(1);
for (i = 0; i < pagesize; ++i)
if (*(data + i) != *(data2 + i))
exit(1);
 
/*
* Finally, make sure that changes to the mapped area
* do not percolate back to the file as seen by read().
* (This is a bug on some variants of i386 svr4.0.)
*/
for (i = 0; i < pagesize; ++i)
*(data2 + i) = *(data2 + i) + 1;
data3 = malloc(pagesize);
if (!data3)
exit(1);
if (read(fd, data3, pagesize) != pagesize)
exit(1);
for (i = 0; i < pagesize; ++i)
if (*(data + i) != *(data3 + i))
exit(1);
close(fd);
unlink("conftestmmap");
exit(0);
}
 
EOF
if { (eval echo configure:1558: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_func_mmap_fixed_mapped=yes
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -fr conftest*
ac_cv_func_mmap_fixed_mapped=no
fi
rm -fr conftest*
fi
 
fi
 
echo "$ac_t""$ac_cv_func_mmap_fixed_mapped" 1>&6
if test $ac_cv_func_mmap_fixed_mapped = yes; then
cat >> confdefs.h <<\EOF
#define HAVE_MMAP 1
EOF
 
fi
 
echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
echo "configure:1581: checking for Cygwin environment" >&5
if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 1586 "configure"
#include "confdefs.h"
 
int main() {
 
#ifndef __CYGWIN__
#define __CYGWIN__ __CYGWIN32__
#endif
return __CYGWIN__;
; return 0; }
EOF
if { (eval echo configure:1597: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_cygwin=yes
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
ac_cv_cygwin=no
fi
rm -f conftest*
rm -f conftest*
fi
 
echo "$ac_t""$ac_cv_cygwin" 1>&6
CYGWIN=
test "$ac_cv_cygwin" = yes && CYGWIN=yes
echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
echo "configure:1614: checking for mingw32 environment" >&5
if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 1619 "configure"
#include "confdefs.h"
 
int main() {
return __MINGW32__;
; return 0; }
EOF
if { (eval echo configure:1626: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_mingw32=yes
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
ac_cv_mingw32=no
fi
rm -f conftest*
rm -f conftest*
fi
 
echo "$ac_t""$ac_cv_mingw32" 1>&6
MINGW32=
test "$ac_cv_mingw32" = yes && MINGW32=yes
 
# autoconf.info says this should be called right after AC_INIT.
 
 
ac_aux_dir=
for ac_dir in `cd $srcdir;pwd`/../.. $srcdir/`cd $srcdir;pwd`/../..; do
if test -f $ac_dir/install-sh; then
ac_aux_dir=$ac_dir
ac_install_sh="$ac_aux_dir/install-sh -c"
break
elif test -f $ac_dir/install.sh; then
ac_aux_dir=$ac_dir
ac_install_sh="$ac_aux_dir/install.sh -c"
break
fi
done
if test -z "$ac_aux_dir"; then
{ echo "configure: error: can not find install-sh or install.sh in `cd $srcdir;pwd`/../.. $srcdir/`cd $srcdir;pwd`/../.." 1>&2; exit 1; }
fi
ac_config_guess=$ac_aux_dir/config.guess
ac_config_sub=$ac_aux_dir/config.sub
ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
 
 
# Do some error checking and defaulting for the host and target type.
# The inputs are:
# configure --host=HOST --target=TARGET --build=BUILD NONOPT
#
# The rules are:
# 1. You are not allowed to specify --host, --target, and nonopt at the
# same time.
# 2. Host defaults to nonopt.
# 3. If nonopt is not specified, then host defaults to the current host,
# as determined by config.guess.
# 4. Target and build default to nonopt.
# 5. If nonopt is not specified, then target and build default to host.
 
# The aliases save the names the user supplied, while $host etc.
# will get canonicalized.
case $host---$target---$nonopt in
NONE---*---* | *---NONE---* | *---*---NONE) ;;
*) { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ;;
esac
 
 
# Make sure we can run config.sub.
if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
fi
 
echo $ac_n "checking host system type""... $ac_c" 1>&6
echo "configure:1693: checking host system type" >&5
 
host_alias=$host
case "$host_alias" in
NONE)
case $nonopt in
NONE)
if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then :
else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
fi ;;
*) host_alias=$nonopt ;;
esac ;;
esac
 
host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
echo "$ac_t""$host" 1>&6
 
echo $ac_n "checking target system type""... $ac_c" 1>&6
echo "configure:1714: checking target system type" >&5
 
target_alias=$target
case "$target_alias" in
NONE)
case $nonopt in
NONE) target_alias=$host_alias ;;
*) target_alias=$nonopt ;;
esac ;;
esac
 
target=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $target_alias`
target_cpu=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
target_vendor=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
echo "$ac_t""$target" 1>&6
 
echo $ac_n "checking build system type""... $ac_c" 1>&6
echo "configure:1732: checking build system type" >&5
 
build_alias=$build
case "$build_alias" in
NONE)
case $nonopt in
NONE) build_alias=$host_alias ;;
*) build_alias=$nonopt ;;
esac ;;
esac
 
build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias`
build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
echo "$ac_t""$build" 1>&6
 
test "$host_alias" != "$target_alias" &&
test "$program_prefix$program_suffix$program_transform_name" = \
NONENONEs,x,x, &&
program_prefix=${target_alias}-
 
if test "$program_transform_name" = s,x,x,; then
program_transform_name=
else
# Double any \ or $. echo might interpret backslashes.
cat <<\EOF_SED > conftestsed
s,\\,\\\\,g; s,\$,$$,g
EOF_SED
program_transform_name="`echo $program_transform_name|sed -f conftestsed`"
rm -f conftestsed
fi
test "$program_prefix" != NONE &&
program_transform_name="s,^,${program_prefix},; $program_transform_name"
# Use a double $ so make ignores it.
test "$program_suffix" != NONE &&
program_transform_name="s,\$\$,${program_suffix},; $program_transform_name"
 
# sed with no file args requires a program.
test "$program_transform_name" = "" && program_transform_name="s,x,x,"
 
# Extract the first word of "gcc", so it can be a program name with args.
set dummy gcc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:1776: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test -n "$CC"; then
ac_cv_prog_CC="$CC" # Let the user override the test.
else
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
ac_dummy="$PATH"
for ac_dir in $ac_dummy; do
test -z "$ac_dir" && ac_dir=.
if test -f $ac_dir/$ac_word; then
ac_cv_prog_CC="gcc"
break
fi
done
IFS="$ac_save_ifs"
fi
fi
CC="$ac_cv_prog_CC"
if test -n "$CC"; then
echo "$ac_t""$CC" 1>&6
else
echo "$ac_t""no" 1>&6
fi
 
if test -z "$CC"; then
# Extract the first word of "cc", so it can be a program name with args.
set dummy cc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:1806: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test -n "$CC"; then
ac_cv_prog_CC="$CC" # Let the user override the test.
else
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
ac_prog_rejected=no
ac_dummy="$PATH"
for ac_dir in $ac_dummy; do
test -z "$ac_dir" && ac_dir=.
if test -f $ac_dir/$ac_word; then
if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
ac_prog_rejected=yes
continue
fi
ac_cv_prog_CC="cc"
break
fi
done
IFS="$ac_save_ifs"
if test $ac_prog_rejected = yes; then
# We found a bogon in the path, so make sure we never use it.
set dummy $ac_cv_prog_CC
shift
if test $# -gt 0; then
# We chose a different compiler from the bogus one.
# However, it has the same basename, so the bogon will be chosen
# first if we set CC to just the basename; use the full file name.
shift
set dummy "$ac_dir/$ac_word" "$@"
shift
ac_cv_prog_CC="$@"
fi
fi
fi
fi
CC="$ac_cv_prog_CC"
if test -n "$CC"; then
echo "$ac_t""$CC" 1>&6
else
echo "$ac_t""no" 1>&6
fi
 
if test -z "$CC"; then
case "`uname -s`" in
*win32* | *WIN32*)
# Extract the first word of "cl", so it can be a program name with args.
set dummy cl; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:1857: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test -n "$CC"; then
ac_cv_prog_CC="$CC" # Let the user override the test.
else
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
ac_dummy="$PATH"
for ac_dir in $ac_dummy; do
test -z "$ac_dir" && ac_dir=.
if test -f $ac_dir/$ac_word; then
ac_cv_prog_CC="cl"
break
fi
done
IFS="$ac_save_ifs"
fi
fi
CC="$ac_cv_prog_CC"
if test -n "$CC"; then
echo "$ac_t""$CC" 1>&6
else
echo "$ac_t""no" 1>&6
fi
;;
esac
fi
test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
fi
 
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
echo "configure:1889: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
 
ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross
 
cat > conftest.$ac_ext << EOF
 
#line 1900 "configure"
#include "confdefs.h"
 
main(){return(0);}
EOF
if { (eval echo configure:1905: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
ac_cv_prog_cc_works=yes
# If we can't run a trivial program, we are probably using a cross compiler.
if (./conftest; exit) 2>/dev/null; then
ac_cv_prog_cc_cross=no
else
ac_cv_prog_cc_cross=yes
fi
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
ac_cv_prog_cc_works=no
fi
rm -fr conftest*
ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross
 
echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
if test $ac_cv_prog_cc_works = no; then
{ echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
echo "configure:1931: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
cross_compiling=$ac_cv_prog_cc_cross
 
echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
echo "configure:1936: checking whether we are using GNU C" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.c <<EOF
#ifdef __GNUC__
yes;
#endif
EOF
if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1945: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
ac_cv_prog_gcc=yes
else
ac_cv_prog_gcc=no
fi
fi
 
echo "$ac_t""$ac_cv_prog_gcc" 1>&6
 
if test $ac_cv_prog_gcc = yes; then
GCC=yes
else
GCC=
fi
 
ac_test_CFLAGS="${CFLAGS+set}"
ac_save_CFLAGS="$CFLAGS"
CFLAGS=
echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
echo "configure:1964: checking whether ${CC-cc} accepts -g" >&5
if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
echo 'void f(){}' > conftest.c
if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
ac_cv_prog_cc_g=yes
else
ac_cv_prog_cc_g=no
fi
rm -f conftest*
 
fi
 
echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
if test "$ac_test_CFLAGS" = set; then
CFLAGS="$ac_save_CFLAGS"
elif test $ac_cv_prog_cc_g = yes; then
if test "$GCC" = yes; then
CFLAGS="-g -O2"
else
CFLAGS="-g"
fi
else
if test "$GCC" = yes; then
CFLAGS="-O2"
else
CFLAGS=
fi
fi
 
# Find a good install program. We prefer a C program (faster),
# so one script is as good as another. But avoid the broken or
# incompatible versions:
# SysV /etc/install, /usr/sbin/install
# SunOS /usr/etc/install
# IRIX /sbin/install
# AIX /bin/install
# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
# AFS /usr/afsws/bin/install, which mishandles nonexistent args
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
# ./install, which can be erroneously created by make from ./install.sh.
echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
echo "configure:2007: checking for a BSD compatible install" >&5
if test -z "$INSTALL"; then
if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":"
for ac_dir in $PATH; do
# Account for people who put trailing slashes in PATH elements.
case "$ac_dir/" in
/|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
*)
# OSF1 and SCO ODT 3.0 have their own names for install.
# Don't use installbsd from OSF since it installs stuff as root
# by default.
for ac_prog in ginstall scoinst install; do
if test -f $ac_dir/$ac_prog; then
if test $ac_prog = install &&
grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
# AIX install. It has an incompatible calling convention.
:
else
ac_cv_path_install="$ac_dir/$ac_prog -c"
break 2
fi
fi
done
;;
esac
done
IFS="$ac_save_IFS"
 
fi
if test "${ac_cv_path_install+set}" = set; then
INSTALL="$ac_cv_path_install"
else
# As a last resort, use the slow shell script. We don't cache a
# path for INSTALL within a source directory, because that will
# break other packages using the cache if that directory is
# removed, or if the path is relative.
INSTALL="$ac_install_sh"
fi
fi
echo "$ac_t""$INSTALL" 1>&6
 
# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
# It thinks the first close brace ends the variable substitution.
test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
 
test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
 
test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
 
 
# Put a plausible default for CC_FOR_BUILD in Makefile.
if test "x$cross_compiling" = "xno"; then
CC_FOR_BUILD='$(CC)'
else
CC_FOR_BUILD=gcc
fi
 
 
 
 
AR=${AR-ar}
 
# Extract the first word of "ranlib", so it can be a program name with args.
set dummy ranlib; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:2075: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test -n "$RANLIB"; then
ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
else
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
ac_dummy="$PATH"
for ac_dir in $ac_dummy; do
test -z "$ac_dir" && ac_dir=.
if test -f $ac_dir/$ac_word; then
ac_cv_prog_RANLIB="ranlib"
break
fi
done
IFS="$ac_save_ifs"
test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
fi
fi
RANLIB="$ac_cv_prog_RANLIB"
if test -n "$RANLIB"; then
echo "$ac_t""$RANLIB" 1>&6
else
echo "$ac_t""no" 1>&6
fi
 
 
ALL_LINGUAS=
for ac_hdr in argz.h limits.h locale.h nl_types.h malloc.h string.h \
unistd.h values.h sys/param.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:2110: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 2115 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:2120: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
eval "ac_cv_header_$ac_safe=yes"
else
echo "$ac_err" >&5
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
echo "$ac_t""yes" 1>&6
ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
cat >> confdefs.h <<EOF
#define $ac_tr_hdr 1
EOF
else
echo "$ac_t""no" 1>&6
fi
done
 
for ac_func in getcwd munmap putenv setenv setlocale strchr strcasecmp \
__argz_count __argz_stringify __argz_next
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:2150: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 2155 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char $ac_func();
 
int main() {
 
/* The GNU C library defines this for functions which it implements
to always fail with ENOSYS. Some functions are actually named
something starting with __ and the normal name is an alias. */
#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
choke me
#else
$ac_func();
#endif
 
; return 0; }
EOF
if { (eval echo configure:2178: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
eval "ac_cv_func_$ac_func=no"
fi
rm -f conftest*
fi
 
if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
echo "$ac_t""yes" 1>&6
ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
cat >> confdefs.h <<EOF
#define $ac_tr_func 1
EOF
else
echo "$ac_t""no" 1>&6
fi
done
 
 
if test "${ac_cv_func_stpcpy+set}" != "set"; then
for ac_func in stpcpy
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:2207: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 2212 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char $ac_func();
 
int main() {
 
/* The GNU C library defines this for functions which it implements
to always fail with ENOSYS. Some functions are actually named
something starting with __ and the normal name is an alias. */
#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
choke me
#else
$ac_func();
#endif
 
; return 0; }
EOF
if { (eval echo configure:2235: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
eval "ac_cv_func_$ac_func=no"
fi
rm -f conftest*
fi
 
if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
echo "$ac_t""yes" 1>&6
ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
cat >> confdefs.h <<EOF
#define $ac_tr_func 1
EOF
else
echo "$ac_t""no" 1>&6
fi
done
 
fi
if test "${ac_cv_func_stpcpy}" = "yes"; then
cat >> confdefs.h <<\EOF
#define HAVE_STPCPY 1
EOF
 
fi
 
if test $ac_cv_header_locale_h = yes; then
echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6
echo "configure:2269: checking for LC_MESSAGES" >&5
if eval "test \"`echo '$''{'am_cv_val_LC_MESSAGES'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 2274 "configure"
#include "confdefs.h"
#include <locale.h>
int main() {
return LC_MESSAGES
; return 0; }
EOF
if { (eval echo configure:2281: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
am_cv_val_LC_MESSAGES=yes
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
am_cv_val_LC_MESSAGES=no
fi
rm -f conftest*
fi
 
echo "$ac_t""$am_cv_val_LC_MESSAGES" 1>&6
if test $am_cv_val_LC_MESSAGES = yes; then
cat >> confdefs.h <<\EOF
#define HAVE_LC_MESSAGES 1
EOF
 
fi
fi
echo $ac_n "checking whether NLS is requested""... $ac_c" 1>&6
echo "configure:2302: checking whether NLS is requested" >&5
# Check whether --enable-nls or --disable-nls was given.
if test "${enable_nls+set}" = set; then
enableval="$enable_nls"
USE_NLS=$enableval
else
USE_NLS=yes
fi
 
echo "$ac_t""$USE_NLS" 1>&6
 
USE_INCLUDED_LIBINTL=no
 
if test "$USE_NLS" = "yes"; then
cat >> confdefs.h <<\EOF
#define ENABLE_NLS 1
EOF
 
echo $ac_n "checking whether included gettext is requested""... $ac_c" 1>&6
echo "configure:2322: checking whether included gettext is requested" >&5
# Check whether --with-included-gettext or --without-included-gettext was given.
if test "${with_included_gettext+set}" = set; then
withval="$with_included_gettext"
nls_cv_force_use_gnu_gettext=$withval
else
nls_cv_force_use_gnu_gettext=no
fi
 
echo "$ac_t""$nls_cv_force_use_gnu_gettext" 1>&6
 
nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
nls_cv_header_intl=
nls_cv_header_libgt=
CATOBJEXT=NONE
 
ac_safe=`echo "libintl.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for libintl.h""... $ac_c" 1>&6
echo "configure:2341: checking for libintl.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 2346 "configure"
#include "confdefs.h"
#include <libintl.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:2351: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
eval "ac_cv_header_$ac_safe=yes"
else
echo "$ac_err" >&5
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
echo "$ac_t""yes" 1>&6
echo $ac_n "checking for gettext in libc""... $ac_c" 1>&6
echo "configure:2368: checking for gettext in libc" >&5
if eval "test \"`echo '$''{'gt_cv_func_gettext_libc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 2373 "configure"
#include "confdefs.h"
#include <libintl.h>
int main() {
return (int) gettext ("")
; return 0; }
EOF
if { (eval echo configure:2380: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
gt_cv_func_gettext_libc=yes
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
gt_cv_func_gettext_libc=no
fi
rm -f conftest*
fi
 
echo "$ac_t""$gt_cv_func_gettext_libc" 1>&6
 
if test "$gt_cv_func_gettext_libc" != "yes"; then
echo $ac_n "checking for bindtextdomain in -lintl""... $ac_c" 1>&6
echo "configure:2396: checking for bindtextdomain in -lintl" >&5
ac_lib_var=`echo intl'_'bindtextdomain | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_save_LIBS="$LIBS"
LIBS="-lintl $LIBS"
cat > conftest.$ac_ext <<EOF
#line 2404 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char bindtextdomain();
 
int main() {
bindtextdomain()
; return 0; }
EOF
if { (eval echo configure:2415: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"
 
fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
echo "$ac_t""yes" 1>&6
echo $ac_n "checking for gettext in libintl""... $ac_c" 1>&6
echo "configure:2431: checking for gettext in libintl" >&5
if eval "test \"`echo '$''{'gt_cv_func_gettext_libintl'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 2436 "configure"
#include "confdefs.h"
 
int main() {
return (int) gettext ("")
; return 0; }
EOF
if { (eval echo configure:2443: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
gt_cv_func_gettext_libintl=yes
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
gt_cv_func_gettext_libintl=no
fi
rm -f conftest*
fi
 
echo "$ac_t""$gt_cv_func_gettext_libintl" 1>&6
else
echo "$ac_t""no" 1>&6
fi
 
fi
 
if test "$gt_cv_func_gettext_libc" = "yes" \
|| test "$gt_cv_func_gettext_libintl" = "yes"; then
cat >> confdefs.h <<\EOF
#define HAVE_GETTEXT 1
EOF
 
# Extract the first word of "msgfmt", so it can be a program name with args.
set dummy msgfmt; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:2471: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
case "$MSGFMT" in
/*)
ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path.
;;
*)
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
for ac_dir in $PATH; do
test -z "$ac_dir" && ac_dir=.
if test -f $ac_dir/$ac_word; then
if test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"; then
ac_cv_path_MSGFMT="$ac_dir/$ac_word"
break
fi
fi
done
IFS="$ac_save_ifs"
test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT="no"
;;
esac
fi
MSGFMT="$ac_cv_path_MSGFMT"
if test -n "$MSGFMT"; then
echo "$ac_t""$MSGFMT" 1>&6
else
echo "$ac_t""no" 1>&6
fi
if test "$MSGFMT" != "no"; then
for ac_func in dcgettext
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:2505: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 2510 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char $ac_func();
 
int main() {
 
/* The GNU C library defines this for functions which it implements
to always fail with ENOSYS. Some functions are actually named
something starting with __ and the normal name is an alias. */
#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
choke me
#else
$ac_func();
#endif
 
; return 0; }
EOF
if { (eval echo configure:2533: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
eval "ac_cv_func_$ac_func=no"
fi
rm -f conftest*
fi
 
if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
echo "$ac_t""yes" 1>&6
ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
cat >> confdefs.h <<EOF
#define $ac_tr_func 1
EOF
else
echo "$ac_t""no" 1>&6
fi
done
 
# Extract the first word of "gmsgfmt", so it can be a program name with args.
set dummy gmsgfmt; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:2560: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
case "$GMSGFMT" in
/*)
ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path.
;;
?:/*)
ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a dos path.
;;
*)
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
ac_dummy="$PATH"
for ac_dir in $ac_dummy; do
test -z "$ac_dir" && ac_dir=.
if test -f $ac_dir/$ac_word; then
ac_cv_path_GMSGFMT="$ac_dir/$ac_word"
break
fi
done
IFS="$ac_save_ifs"
test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT"
;;
esac
fi
GMSGFMT="$ac_cv_path_GMSGFMT"
if test -n "$GMSGFMT"; then
echo "$ac_t""$GMSGFMT" 1>&6
else
echo "$ac_t""no" 1>&6
fi
 
# Extract the first word of "xgettext", so it can be a program name with args.
set dummy xgettext; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:2596: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
case "$XGETTEXT" in
/*)
ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path.
;;
*)
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
for ac_dir in $PATH; do
test -z "$ac_dir" && ac_dir=.
if test -f $ac_dir/$ac_word; then
if test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"; then
ac_cv_path_XGETTEXT="$ac_dir/$ac_word"
break
fi
fi
done
IFS="$ac_save_ifs"
test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":"
;;
esac
fi
XGETTEXT="$ac_cv_path_XGETTEXT"
if test -n "$XGETTEXT"; then
echo "$ac_t""$XGETTEXT" 1>&6
else
echo "$ac_t""no" 1>&6
fi
 
cat > conftest.$ac_ext <<EOF
#line 2628 "configure"
#include "confdefs.h"
 
int main() {
extern int _nl_msg_cat_cntr;
return _nl_msg_cat_cntr
; return 0; }
EOF
if { (eval echo configure:2636: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
CATOBJEXT=.gmo
DATADIRNAME=share
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
CATOBJEXT=.mo
DATADIRNAME=lib
fi
rm -f conftest*
INSTOBJEXT=.mo
fi
fi
else
echo "$ac_t""no" 1>&6
fi
 
 
if test "$CATOBJEXT" = "NONE"; then
nls_cv_use_gnu_gettext=yes
fi
fi
 
if test "$nls_cv_use_gnu_gettext" = "yes"; then
INTLOBJS="\$(GETTOBJS)"
# Extract the first word of "msgfmt", so it can be a program name with args.
set dummy msgfmt; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:2668: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
case "$MSGFMT" in
/*)
ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path.
;;
*)
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
for ac_dir in $PATH; do
test -z "$ac_dir" && ac_dir=.
if test -f $ac_dir/$ac_word; then
if test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"; then
ac_cv_path_MSGFMT="$ac_dir/$ac_word"
break
fi
fi
done
IFS="$ac_save_ifs"
test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT="msgfmt"
;;
esac
fi
MSGFMT="$ac_cv_path_MSGFMT"
if test -n "$MSGFMT"; then
echo "$ac_t""$MSGFMT" 1>&6
else
echo "$ac_t""no" 1>&6
fi
 
# Extract the first word of "gmsgfmt", so it can be a program name with args.
set dummy gmsgfmt; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:2702: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
case "$GMSGFMT" in
/*)
ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path.
;;
?:/*)
ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a dos path.
;;
*)
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
ac_dummy="$PATH"
for ac_dir in $ac_dummy; do
test -z "$ac_dir" && ac_dir=.
if test -f $ac_dir/$ac_word; then
ac_cv_path_GMSGFMT="$ac_dir/$ac_word"
break
fi
done
IFS="$ac_save_ifs"
test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT"
;;
esac
fi
GMSGFMT="$ac_cv_path_GMSGFMT"
if test -n "$GMSGFMT"; then
echo "$ac_t""$GMSGFMT" 1>&6
else
echo "$ac_t""no" 1>&6
fi
 
# Extract the first word of "xgettext", so it can be a program name with args.
set dummy xgettext; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:2738: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
case "$XGETTEXT" in
/*)
ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path.
;;
*)
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
for ac_dir in $PATH; do
test -z "$ac_dir" && ac_dir=.
if test -f $ac_dir/$ac_word; then
if test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"; then
ac_cv_path_XGETTEXT="$ac_dir/$ac_word"
break
fi
fi
done
IFS="$ac_save_ifs"
test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":"
;;
esac
fi
XGETTEXT="$ac_cv_path_XGETTEXT"
if test -n "$XGETTEXT"; then
echo "$ac_t""$XGETTEXT" 1>&6
else
echo "$ac_t""no" 1>&6
fi
 
USE_INCLUDED_LIBINTL=yes
CATOBJEXT=.gmo
INSTOBJEXT=.mo
DATADIRNAME=share
INTLDEPS='$(top_builddir)/../intl/libintl.a'
INTLLIBS=$INTLDEPS
LIBS=`echo $LIBS | sed -e 's/-lintl//'`
nls_cv_header_intl=libintl.h
nls_cv_header_libgt=libgettext.h
fi
 
if test "$XGETTEXT" != ":"; then
if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
: ;
else
echo "$ac_t""found xgettext programs is not GNU xgettext; ignore it" 1>&6
XGETTEXT=":"
fi
fi
 
# We need to process the po/ directory.
POSUB=po
else
DATADIRNAME=share
nls_cv_header_intl=libintl.h
nls_cv_header_libgt=libgettext.h
fi
 
# If this is used in GNU gettext we have to set USE_NLS to `yes'
# because some of the sources are only built for this goal.
if test "$PACKAGE" = gettext; then
USE_NLS=yes
USE_INCLUDED_LIBINTL=yes
fi
 
for lang in $ALL_LINGUAS; do
GMOFILES="$GMOFILES $lang.gmo"
POFILES="$POFILES $lang.po"
done
 
 
if test "x$CATOBJEXT" != "x"; then
if test "x$ALL_LINGUAS" = "x"; then
LINGUAS=
else
echo $ac_n "checking for catalogs to be installed""... $ac_c" 1>&6
echo "configure:2828: checking for catalogs to be installed" >&5
NEW_LINGUAS=
for lang in ${LINGUAS=$ALL_LINGUAS}; do
case "$ALL_LINGUAS" in
*$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
esac
done
LINGUAS=$NEW_LINGUAS
echo "$ac_t""$LINGUAS" 1>&6
fi
 
if test -n "$LINGUAS"; then
for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
fi
fi
 
if test $ac_cv_header_locale_h = yes; then
INCLUDE_LOCALE_H="#include <locale.h>"
else
INCLUDE_LOCALE_H="\
/* The system does not provide the header <locale.h>. Take care yourself. */"
fi
 
if test -f $srcdir/po2tbl.sed.in; then
if test "$CATOBJEXT" = ".cat"; then
ac_safe=`echo "linux/version.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for linux/version.h""... $ac_c" 1>&6
echo "configure:2856: checking for linux/version.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 2861 "configure"
#include "confdefs.h"
#include <linux/version.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:2866: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
eval "ac_cv_header_$ac_safe=yes"
else
echo "$ac_err" >&5
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
echo "$ac_t""yes" 1>&6
msgformat=linux
else
echo "$ac_t""no" 1>&6
msgformat=xopen
fi
 
 
sed -e '/^#/d' $srcdir/$msgformat-msg.sed > po2msg.sed
fi
sed -e '/^#.*[^\\]$/d' -e '/^#$/d' \
$srcdir/po2tbl.sed.in > po2tbl.sed
fi
 
if test "$PACKAGE" = "gettext"; then
GT_NO="#NO#"
GT_YES=
else
GT_NO=
GT_YES="#YES#"
fi
 
MKINSTALLDIRS="\$(srcdir)/../../mkinstalldirs"
 
l=
 
if test -d $srcdir/po; then
test -d po || mkdir po
if test "x$srcdir" != "x."; then
if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
posrcprefix="$srcdir/"
else
posrcprefix="../$srcdir/"
fi
else
posrcprefix="../"
fi
rm -f po/POTFILES
sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
< $srcdir/po/POTFILES.in > po/POTFILES
fi
 
# Check for common headers.
# FIXME: Seems to me this can cause problems for i386-windows hosts.
# At one point there were hardcoded AC_DEFINE's if ${host} = i386-*-windows*.
for ac_hdr in stdlib.h string.h strings.h unistd.h time.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:2935: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 2940 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:2945: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
eval "ac_cv_header_$ac_safe=yes"
else
echo "$ac_err" >&5
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
echo "$ac_t""yes" 1>&6
ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
cat >> confdefs.h <<EOF
#define $ac_tr_hdr 1
EOF
else
echo "$ac_t""no" 1>&6
fi
done
 
for ac_hdr in sys/time.h sys/resource.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:2975: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 2980 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:2985: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
eval "ac_cv_header_$ac_safe=yes"
else
echo "$ac_err" >&5
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
echo "$ac_t""yes" 1>&6
ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
cat >> confdefs.h <<EOF
#define $ac_tr_hdr 1
EOF
else
echo "$ac_t""no" 1>&6
fi
done
 
for ac_hdr in fcntl.h fpu_control.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:3015: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 3020 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:3025: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
eval "ac_cv_header_$ac_safe=yes"
else
echo "$ac_err" >&5
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
echo "$ac_t""yes" 1>&6
ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
cat >> confdefs.h <<EOF
#define $ac_tr_hdr 1
EOF
else
echo "$ac_t""no" 1>&6
fi
done
 
for ac_hdr in dlfcn.h errno.h sys/stat.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:3055: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 3060 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:3065: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
eval "ac_cv_header_$ac_safe=yes"
else
echo "$ac_err" >&5
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
echo "$ac_t""yes" 1>&6
ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
cat >> confdefs.h <<EOF
#define $ac_tr_hdr 1
EOF
else
echo "$ac_t""no" 1>&6
fi
done
 
for ac_func in getrusage time sigaction __setfpucw
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:3094: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 3099 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char $ac_func();
 
int main() {
 
/* The GNU C library defines this for functions which it implements
to always fail with ENOSYS. Some functions are actually named
something starting with __ and the normal name is an alias. */
#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
choke me
#else
$ac_func();
#endif
 
; return 0; }
EOF
if { (eval echo configure:3122: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
eval "ac_cv_func_$ac_func=no"
fi
rm -f conftest*
fi
 
if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
echo "$ac_t""yes" 1>&6
ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
cat >> confdefs.h <<EOF
#define $ac_tr_func 1
EOF
else
echo "$ac_t""no" 1>&6
fi
done
 
 
# Check for socket libraries
echo $ac_n "checking for bind in -lsocket""... $ac_c" 1>&6
echo "configure:3149: checking for bind in -lsocket" >&5
ac_lib_var=`echo socket'_'bind | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_save_LIBS="$LIBS"
LIBS="-lsocket $LIBS"
cat > conftest.$ac_ext <<EOF
#line 3157 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char bind();
 
int main() {
bind()
; return 0; }
EOF
if { (eval echo configure:3168: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"
 
fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
echo "$ac_t""yes" 1>&6
ac_tr_lib=HAVE_LIB`echo socket | sed -e 's/[^a-zA-Z0-9_]/_/g' \
-e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
cat >> confdefs.h <<EOF
#define $ac_tr_lib 1
EOF
 
LIBS="-lsocket $LIBS"
 
else
echo "$ac_t""no" 1>&6
fi
 
echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6
echo "configure:3196: checking for gethostbyname in -lnsl" >&5
ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_save_LIBS="$LIBS"
LIBS="-lnsl $LIBS"
cat > conftest.$ac_ext <<EOF
#line 3204 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char gethostbyname();
 
int main() {
gethostbyname()
; return 0; }
EOF
if { (eval echo configure:3215: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"
 
fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
echo "$ac_t""yes" 1>&6
ac_tr_lib=HAVE_LIB`echo nsl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
-e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
cat >> confdefs.h <<EOF
#define $ac_tr_lib 1
EOF
 
LIBS="-lnsl $LIBS"
 
else
echo "$ac_t""no" 1>&6
fi
 
 
. ${srcdir}/../../bfd/configure.host
 
 
 
USE_MAINTAINER_MODE=no
# Check whether --enable-maintainer-mode or --disable-maintainer-mode was given.
if test "${enable_maintainer_mode+set}" = set; then
enableval="$enable_maintainer_mode"
case "${enableval}" in
yes) MAINT="" USE_MAINTAINER_MODE=yes ;;
no) MAINT="#" ;;
*) { echo "configure: error: "--enable-maintainer-mode does not take a value"" 1>&2; exit 1; }; MAINT="#" ;;
esac
if test x"$silent" != x"yes" && test x"$MAINT" = x""; then
echo "Setting maintainer mode" 6>&1
fi
else
MAINT="#"
fi
 
 
 
# Check whether --enable-sim-bswap or --disable-sim-bswap was given.
if test "${enable_sim_bswap+set}" = set; then
enableval="$enable_sim_bswap"
case "${enableval}" in
yes) sim_bswap="-DWITH_BSWAP=1 -DUSE_BSWAP=1";;
no) sim_bswap="-DWITH_BSWAP=0";;
*) { echo "configure: error: "--enable-sim-bswap does not take a value"" 1>&2; exit 1; }; sim_bswap="";;
esac
if test x"$silent" != x"yes" && test x"$sim_bswap" != x""; then
echo "Setting bswap flags = $sim_bswap" 6>&1
fi
else
sim_bswap=""
fi
 
 
 
# Check whether --enable-sim-cflags or --disable-sim-cflags was given.
if test "${enable_sim_cflags+set}" = set; then
enableval="$enable_sim_cflags"
case "${enableval}" in
yes) sim_cflags="-O2 -fomit-frame-pointer";;
trace) { echo "configure: error: "Please use --enable-sim-debug instead."" 1>&2; exit 1; }; sim_cflags="";;
no) sim_cflags="";;
*) sim_cflags=`echo "${enableval}" | sed -e "s/,/ /g"`;;
esac
if test x"$silent" != x"yes" && test x"$sim_cflags" != x""; then
echo "Setting sim cflags = $sim_cflags" 6>&1
fi
else
sim_cflags=""
fi
 
 
 
# Check whether --enable-sim-debug or --disable-sim-debug was given.
if test "${enable_sim_debug+set}" = set; then
enableval="$enable_sim_debug"
case "${enableval}" in
yes) sim_debug="-DDEBUG=7 -DWITH_DEBUG=7";;
no) sim_debug="-DDEBUG=0 -DWITH_DEBUG=0";;
*) sim_debug="-DDEBUG='(${enableval})' -DWITH_DEBUG='(${enableval})'";;
esac
if test x"$silent" != x"yes" && test x"$sim_debug" != x""; then
echo "Setting sim debug = $sim_debug" 6>&1
fi
else
sim_debug=""
fi
 
 
 
# Check whether --enable-sim-stdio or --disable-sim-stdio was given.
if test "${enable_sim_stdio+set}" = set; then
enableval="$enable_sim_stdio"
case "${enableval}" in
yes) sim_stdio="-DWITH_STDIO=DO_USE_STDIO";;
no) sim_stdio="-DWITH_STDIO=DONT_USE_STDIO";;
*) { echo "configure: error: "Unknown value $enableval passed to --enable-sim-stdio"" 1>&2; exit 1; }; sim_stdio="";;
esac
if test x"$silent" != x"yes" && test x"$sim_stdio" != x""; then
echo "Setting stdio flags = $sim_stdio" 6>&1
fi
else
sim_stdio=""
fi
 
 
 
# Check whether --enable-sim-trace or --disable-sim-trace was given.
if test "${enable_sim_trace+set}" = set; then
enableval="$enable_sim_trace"
case "${enableval}" in
yes) sim_trace="-DTRACE=1 -DWITH_TRACE=-1";;
no) sim_trace="-DTRACE=0 -DWITH_TRACE=0";;
[-0-9]*)
sim_trace="-DTRACE='(${enableval})' -DWITH_TRACE='(${enableval})'";;
[a-z]*)
sim_trace=""
for x in `echo "$enableval" | sed -e "s/,/ /g"`; do
if test x"$sim_trace" = x; then
sim_trace="-DWITH_TRACE='(TRACE_$x"
else
sim_trace="${sim_trace}|TRACE_$x"
fi
done
sim_trace="$sim_trace)'" ;;
esac
if test x"$silent" != x"yes" && test x"$sim_trace" != x""; then
echo "Setting sim trace = $sim_trace" 6>&1
fi
else
sim_trace=""
fi
 
 
 
# Check whether --enable-sim-profile or --disable-sim-profile was given.
if test "${enable_sim_profile+set}" = set; then
enableval="$enable_sim_profile"
case "${enableval}" in
yes) sim_profile="-DPROFILE=1 -DWITH_PROFILE=-1";;
no) sim_profile="-DPROFILE=0 -DWITH_PROFILE=0";;
[-0-9]*)
sim_profile="-DPROFILE='(${enableval})' -DWITH_PROFILE='(${enableval})'";;
[a-z]*)
sim_profile=""
for x in `echo "$enableval" | sed -e "s/,/ /g"`; do
if test x"$sim_profile" = x; then
sim_profile="-DWITH_PROFILE='(PROFILE_$x"
else
sim_profile="${sim_profile}|PROFILE_$x"
fi
done
sim_profile="$sim_profile)'" ;;
esac
if test x"$silent" != x"yes" && test x"$sim_profile" != x""; then
echo "Setting sim profile = $sim_profile" 6>&1
fi
else
sim_profile=""
fi
 
 
 
echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
echo "configure:3391: checking return type of signal handlers" >&5
if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 3396 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <signal.h>
#ifdef signal
#undef signal
#endif
#ifdef __cplusplus
extern "C" void (*signal (int, void (*)(int)))(int);
#else
void (*signal ()) ();
#endif
 
int main() {
int i;
; return 0; }
EOF
if { (eval echo configure:3413: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_type_signal=void
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
ac_cv_type_signal=int
fi
rm -f conftest*
fi
 
echo "$ac_t""$ac_cv_type_signal" 1>&6
cat >> confdefs.h <<EOF
#define RETSIGTYPE $ac_cv_type_signal
EOF
 
 
 
 
 
echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
echo "configure:3435: checking for executable suffix" >&5
if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test "$CYGWIN" = yes || test "$MINGW32" = yes; then
ac_cv_exeext=.exe
else
rm -f conftest*
echo 'int main () { return 0; }' > conftest.$ac_ext
ac_cv_exeext=
if { (eval echo configure:3445: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
for file in conftest.*; do
case $file in
*.c | *.o | *.obj) ;;
*) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
esac
done
else
{ echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; }
fi
rm -f conftest*
test x"${ac_cv_exeext}" = x && ac_cv_exeext=no
fi
fi
 
EXEEXT=""
test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext}
echo "$ac_t""${ac_cv_exeext}" 1>&6
ac_exeext=$EXEEXT
 
 
sim_link_files=
sim_link_links=
 
sim_link_links=tconfig.h
if test -f ${srcdir}/tconfig.in
then
sim_link_files=tconfig.in
else
sim_link_files=../common/tconfig.in
fi
 
# targ-vals.def points to the libc macro description file.
case "${target}" in
*-*-*) TARG_VALS_DEF=../common/nltvals.def ;;
esac
sim_link_files="${sim_link_files} ${TARG_VALS_DEF}"
sim_link_links="${sim_link_links} targ-vals.def"
 
 
 
for ac_hdr in stdlib.h time.h sys/param.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:3490: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 3495 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:3500: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
eval "ac_cv_header_$ac_safe=yes"
else
echo "$ac_err" >&5
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
echo "$ac_t""yes" 1>&6
ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
cat >> confdefs.h <<EOF
#define $ac_tr_hdr 1
EOF
else
echo "$ac_t""no" 1>&6
fi
done
 
 
 
 
trap '' 1 2 15
cat > confcache <<\EOF
# This file is a shell script that caches the results of configure
# tests run on this system so they can be shared between configure
# scripts and configure runs. It is not useful on other systems.
# If it contains results you don't want to keep, you may remove or edit it.
#
# By default, configure uses ./config.cache as the cache file,
# creating it if it does not exist already. You can give configure
# the --cache-file=FILE option to use a different cache file; that is
# what configure does when it calls configure scripts in
# subdirectories, so they share the cache.
# Giving --cache-file=/dev/null disables caching, for debugging configure.
# config.status only pays attention to the cache file if you give it the
# --recheck option to rerun configure.
#
EOF
# The following way of writing the cache mishandles newlines in values,
# but we know of no workaround that is simple, portable, and efficient.
# So, don't put newlines in cache variables' values.
# Ultrix sh set writes to stderr and can't be redirected directly,
# and sets the high bit in the cache file unless we assign to the vars.
(set) 2>&1 |
case `(ac_space=' '; set | grep ac_space) 2>&1` in
*ac_space=\ *)
# `set' does not quote correctly, so add quotes (double-quote substitution
# turns \\\\ into \\, and sed turns \\ into \).
sed -n \
-e "s/'/'\\\\''/g" \
-e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
;;
*)
# `set' quotes correctly as required by POSIX, so do not add quotes.
sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
;;
esac >> confcache
if cmp -s $cache_file confcache; then
:
else
if test -w $cache_file; then
echo "updating cache $cache_file"
cat confcache > $cache_file
else
echo "not updating unwritable cache $cache_file"
fi
fi
rm -f confcache
 
trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
 
test "x$prefix" = xNONE && prefix=$ac_default_prefix
# Let make expand exec_prefix.
test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
 
# Any assignment to VPATH causes Sun make to only execute
# the first set of double-colon rules, so remove it if not needed.
# If there is a colon in the path, we need to keep it.
if test "x$srcdir" = x.; then
ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d'
fi
 
trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
 
DEFS=-DHAVE_CONFIG_H
 
# Without the "./", some shells look in PATH for config.status.
: ${CONFIG_STATUS=./config.status}
 
echo creating $CONFIG_STATUS
rm -f $CONFIG_STATUS
cat > $CONFIG_STATUS <<EOF
#! /bin/sh
# Generated automatically by configure.
# Run this file to recreate the current configuration.
# This directory was configured as follows,
# on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
#
# $0 $ac_configure_args
#
# Compiler output produced by configure, useful for debugging
# configure, is in ./config.log if it exists.
 
ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
for ac_option
do
case "\$ac_option" in
-recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
-version | --version | --versio | --versi | --vers | --ver | --ve | --v)
echo "$CONFIG_STATUS generated by autoconf version 2.13"
exit 0 ;;
-help | --help | --hel | --he | --h)
echo "\$ac_cs_usage"; exit 0 ;;
*) echo "\$ac_cs_usage"; exit 1 ;;
esac
done
 
ac_given_srcdir=$srcdir
ac_given_INSTALL="$INSTALL"
 
trap 'rm -fr `echo "Makefile.sim:Makefile.in Make-common.sim:../common/Make-common.in .gdbinit:../common/gdbinit.in config.h:config.in" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
EOF
cat >> $CONFIG_STATUS <<EOF
 
# Protect against being on the right side of a sed subst in config.status.
sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
$ac_vpsub
$extrasub
s%@sim_environment@%$sim_environment%g
s%@sim_alignment@%$sim_alignment%g
s%@sim_assert@%$sim_assert%g
s%@sim_bitsize@%$sim_bitsize%g
s%@sim_endian@%$sim_endian%g
s%@sim_hostendian@%$sim_hostendian%g
s%@sim_float@%$sim_float%g
s%@sim_scache@%$sim_scache%g
s%@sim_default_model@%$sim_default_model%g
s%@sim_hw_cflags@%$sim_hw_cflags%g
s%@sim_hw_objs@%$sim_hw_objs%g
s%@sim_hw@%$sim_hw%g
s%@sim_inline@%$sim_inline%g
s%@sim_packages@%$sim_packages%g
s%@sim_regparm@%$sim_regparm%g
s%@sim_reserved_bits@%$sim_reserved_bits%g
s%@sim_smp@%$sim_smp%g
s%@sim_stdcall@%$sim_stdcall%g
s%@sim_xor_endian@%$sim_xor_endian%g
s%@WARN_CFLAGS@%$WARN_CFLAGS%g
s%@WERROR_CFLAGS@%$WERROR_CFLAGS%g
s%@SHELL@%$SHELL%g
s%@CFLAGS@%$CFLAGS%g
s%@CPPFLAGS@%$CPPFLAGS%g
s%@CXXFLAGS@%$CXXFLAGS%g
s%@FFLAGS@%$FFLAGS%g
s%@DEFS@%$DEFS%g
s%@LDFLAGS@%$LDFLAGS%g
s%@LIBS@%$LIBS%g
s%@exec_prefix@%$exec_prefix%g
s%@prefix@%$prefix%g
s%@program_transform_name@%$program_transform_name%g
s%@bindir@%$bindir%g
s%@sbindir@%$sbindir%g
s%@libexecdir@%$libexecdir%g
s%@datadir@%$datadir%g
s%@sysconfdir@%$sysconfdir%g
s%@sharedstatedir@%$sharedstatedir%g
s%@localstatedir@%$localstatedir%g
s%@libdir@%$libdir%g
s%@includedir@%$includedir%g
s%@oldincludedir@%$oldincludedir%g
s%@infodir@%$infodir%g
s%@mandir@%$mandir%g
s%@host@%$host%g
s%@host_alias@%$host_alias%g
s%@host_cpu@%$host_cpu%g
s%@host_vendor@%$host_vendor%g
s%@host_os@%$host_os%g
s%@target@%$target%g
s%@target_alias@%$target_alias%g
s%@target_cpu@%$target_cpu%g
s%@target_vendor@%$target_vendor%g
s%@target_os@%$target_os%g
s%@build@%$build%g
s%@build_alias@%$build_alias%g
s%@build_cpu@%$build_cpu%g
s%@build_vendor@%$build_vendor%g
s%@build_os@%$build_os%g
s%@CC@%$CC%g
s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
s%@INSTALL_DATA@%$INSTALL_DATA%g
s%@CC_FOR_BUILD@%$CC_FOR_BUILD%g
s%@HDEFINES@%$HDEFINES%g
s%@AR@%$AR%g
s%@RANLIB@%$RANLIB%g
s%@SET_MAKE@%$SET_MAKE%g
s%@CPP@%$CPP%g
s%@ALLOCA@%$ALLOCA%g
s%@USE_NLS@%$USE_NLS%g
s%@MSGFMT@%$MSGFMT%g
s%@GMSGFMT@%$GMSGFMT%g
s%@XGETTEXT@%$XGETTEXT%g
s%@USE_INCLUDED_LIBINTL@%$USE_INCLUDED_LIBINTL%g
s%@CATALOGS@%$CATALOGS%g
s%@CATOBJEXT@%$CATOBJEXT%g
s%@DATADIRNAME@%$DATADIRNAME%g
s%@GMOFILES@%$GMOFILES%g
s%@INSTOBJEXT@%$INSTOBJEXT%g
s%@INTLDEPS@%$INTLDEPS%g
s%@INTLLIBS@%$INTLLIBS%g
s%@INTLOBJS@%$INTLOBJS%g
s%@POFILES@%$POFILES%g
s%@POSUB@%$POSUB%g
s%@INCLUDE_LOCALE_H@%$INCLUDE_LOCALE_H%g
s%@GT_NO@%$GT_NO%g
s%@GT_YES@%$GT_YES%g
s%@MKINSTALLDIRS@%$MKINSTALLDIRS%g
s%@l@%$l%g
s%@MAINT@%$MAINT%g
s%@sim_bswap@%$sim_bswap%g
s%@sim_cflags@%$sim_cflags%g
s%@sim_debug@%$sim_debug%g
s%@sim_stdio@%$sim_stdio%g
s%@sim_trace@%$sim_trace%g
s%@sim_profile@%$sim_profile%g
s%@EXEEXT@%$EXEEXT%g
 
CEOF
EOF
 
cat >> $CONFIG_STATUS <<\EOF
 
# Split the substitutions into bite-sized pieces for seds with
# small command number limits, like on Digital OSF/1 and HP-UX.
ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
ac_file=1 # Number of current file.
ac_beg=1 # First line for current file.
ac_end=$ac_max_sed_cmds # Line after last line for current file.
ac_more_lines=:
ac_sed_cmds=""
while $ac_more_lines; do
if test $ac_beg -gt 1; then
sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
else
sed "${ac_end}q" conftest.subs > conftest.s$ac_file
fi
if test ! -s conftest.s$ac_file; then
ac_more_lines=false
rm -f conftest.s$ac_file
else
if test -z "$ac_sed_cmds"; then
ac_sed_cmds="sed -f conftest.s$ac_file"
else
ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
fi
ac_file=`expr $ac_file + 1`
ac_beg=$ac_end
ac_end=`expr $ac_end + $ac_max_sed_cmds`
fi
done
if test -z "$ac_sed_cmds"; then
ac_sed_cmds=cat
fi
EOF
 
cat >> $CONFIG_STATUS <<EOF
 
CONFIG_FILES=\${CONFIG_FILES-"Makefile.sim:Makefile.in Make-common.sim:../common/Make-common.in .gdbinit:../common/gdbinit.in"}
EOF
cat >> $CONFIG_STATUS <<\EOF
for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
# Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
case "$ac_file" in
*:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
*) ac_file_in="${ac_file}.in" ;;
esac
 
# Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
 
# Remove last slash and all that follows it. Not all systems have dirname.
ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
# The file is in a subdirectory.
test ! -d "$ac_dir" && mkdir "$ac_dir"
ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
# A "../" for each directory in $ac_dir_suffix.
ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
else
ac_dir_suffix= ac_dots=
fi
 
case "$ac_given_srcdir" in
.) srcdir=.
if test -z "$ac_dots"; then top_srcdir=.
else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
/*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
*) # Relative path.
srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
top_srcdir="$ac_dots$ac_given_srcdir" ;;
esac
 
case "$ac_given_INSTALL" in
[/$]*) INSTALL="$ac_given_INSTALL" ;;
*) INSTALL="$ac_dots$ac_given_INSTALL" ;;
esac
 
echo creating "$ac_file"
rm -f "$ac_file"
configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
case "$ac_file" in
*Makefile*) ac_comsub="1i\\
# $configure_input" ;;
*) ac_comsub= ;;
esac
 
ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
sed -e "$ac_comsub
s%@configure_input@%$configure_input%g
s%@srcdir@%$srcdir%g
s%@top_srcdir@%$top_srcdir%g
s%@INSTALL@%$INSTALL%g
" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
fi; done
rm -f conftest.s*
 
# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
# NAME is the cpp macro being defined and VALUE is the value it is being given.
#
# ac_d sets the value in "#define NAME VALUE" lines.
ac_dA='s%^\([ ]*\)#\([ ]*define[ ][ ]*\)'
ac_dB='\([ ][ ]*\)[^ ]*%\1#\2'
ac_dC='\3'
ac_dD='%g'
# ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
ac_uA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
ac_uB='\([ ]\)%\1#\2define\3'
ac_uC=' '
ac_uD='\4%g'
# ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
ac_eA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
ac_eB='$%\1#\2define\3'
ac_eC=' '
ac_eD='%g'
 
if test "${CONFIG_HEADERS+set}" != set; then
EOF
cat >> $CONFIG_STATUS <<EOF
CONFIG_HEADERS="config.h:config.in"
EOF
cat >> $CONFIG_STATUS <<\EOF
fi
for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
# Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
case "$ac_file" in
*:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
*) ac_file_in="${ac_file}.in" ;;
esac
 
echo creating $ac_file
 
rm -f conftest.frag conftest.in conftest.out
ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
cat $ac_file_inputs > conftest.in
 
EOF
 
# Transform confdefs.h into a sed script conftest.vals that substitutes
# the proper values into config.h.in to produce config.h. And first:
# Protect against being on the right side of a sed subst in config.status.
# Protect against being in an unquoted here document in config.status.
rm -f conftest.vals
cat > conftest.hdr <<\EOF
s/[\\&%]/\\&/g
s%[\\$`]%\\&%g
s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
s%ac_d%ac_u%gp
s%ac_u%ac_e%gp
EOF
sed -n -f conftest.hdr confdefs.h > conftest.vals
rm -f conftest.hdr
 
# This sed command replaces #undef with comments. This is necessary, for
# example, in the case of _POSIX_SOURCE, which is predefined and required
# on some systems where configure will not decide to define it.
cat >> conftest.vals <<\EOF
s%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
EOF
 
# Break up conftest.vals because some shells have a limit on
# the size of here documents, and old seds have small limits too.
 
rm -f conftest.tail
while :
do
ac_lines=`grep -c . conftest.vals`
# grep -c gives empty output for an empty file on some AIX systems.
if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
# Write a limited-size here document to conftest.frag.
echo ' cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
echo 'CEOF
sed -f conftest.frag conftest.in > conftest.out
rm -f conftest.in
mv conftest.out conftest.in
' >> $CONFIG_STATUS
sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
rm -f conftest.vals
mv conftest.tail conftest.vals
done
rm -f conftest.vals
 
cat >> $CONFIG_STATUS <<\EOF
rm -f conftest.frag conftest.h
echo "/* $ac_file. Generated automatically by configure. */" > conftest.h
cat conftest.in >> conftest.h
rm -f conftest.in
if cmp -s $ac_file conftest.h 2>/dev/null; then
echo "$ac_file is unchanged"
rm -f conftest.h
else
# Remove last slash and all that follows it. Not all systems have dirname.
ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
# The file is in a subdirectory.
test ! -d "$ac_dir" && mkdir "$ac_dir"
fi
rm -f $ac_file
mv conftest.h $ac_file
fi
fi; done
 
EOF
 
cat >> $CONFIG_STATUS <<EOF
ac_sources="$sim_link_files"
ac_dests="$sim_link_links"
EOF
 
cat >> $CONFIG_STATUS <<\EOF
srcdir=$ac_given_srcdir
while test -n "$ac_sources"; do
set $ac_dests; ac_dest=$1; shift; ac_dests=$*
set $ac_sources; ac_source=$1; shift; ac_sources=$*
 
echo "linking $srcdir/$ac_source to $ac_dest"
 
if test ! -r $srcdir/$ac_source; then
{ echo "configure: error: $srcdir/$ac_source: File not found" 1>&2; exit 1; }
fi
rm -f $ac_dest
 
# Make relative symlinks.
# Remove last slash and all that follows it. Not all systems have dirname.
ac_dest_dir=`echo $ac_dest|sed 's%/[^/][^/]*$%%'`
if test "$ac_dest_dir" != "$ac_dest" && test "$ac_dest_dir" != .; then
# The dest file is in a subdirectory.
test ! -d "$ac_dest_dir" && mkdir "$ac_dest_dir"
ac_dest_dir_suffix="/`echo $ac_dest_dir|sed 's%^\./%%'`"
# A "../" for each directory in $ac_dest_dir_suffix.
ac_dots=`echo $ac_dest_dir_suffix|sed 's%/[^/]*%../%g'`
else
ac_dest_dir_suffix= ac_dots=
fi
 
case "$srcdir" in
[/$]*) ac_rel_source="$srcdir/$ac_source" ;;
*) ac_rel_source="$ac_dots$srcdir/$ac_source" ;;
esac
 
# Make a symlink if possible; otherwise try a hard link.
if ln -s $ac_rel_source $ac_dest 2>/dev/null ||
ln $srcdir/$ac_source $ac_dest; then :
else
{ echo "configure: error: can not link $ac_dest to $srcdir/$ac_source" 1>&2; exit 1; }
fi
done
EOF
cat >> $CONFIG_STATUS <<EOF
 
EOF
cat >> $CONFIG_STATUS <<\EOF
case "x$CONFIG_FILES" in
xMakefile*)
echo "Merging Makefile.sim+Make-common.sim into Makefile ..."
rm -f Makesim1.tmp Makesim2.tmp Makefile
sed -n -e '/^## COMMON_PRE_/,/^## End COMMON_PRE_/ p' <Make-common.sim >Makesim1.tmp
sed -n -e '/^## COMMON_POST_/,/^## End COMMON_POST_/ p' <Make-common.sim >Makesim2.tmp
sed -e '/^## COMMON_PRE_/ r Makesim1.tmp' \
-e '/^## COMMON_POST_/ r Makesim2.tmp' \
<Makefile.sim >Makefile
rm -f Makefile.sim Make-common.sim Makesim1.tmp Makesim2.tmp
;;
esac
case "x$CONFIG_HEADERS" in xconfig.h:config.in) echo > stamp-h ;; esac
 
exit 0
EOF
chmod +x $CONFIG_STATUS
rm -fr confdefs* $ac_clean_files
test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
 
 
configure Property changes : Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Index: Makefile.in =================================================================== --- Makefile.in (nonexistent) +++ Makefile.in (revision 1765) @@ -0,0 +1,25 @@ +# Makefile template for Configure for the h8300 sim library. +# Copyright (C) 1990, 91, 92, 95, 96, 1997 Free Software Foundation, Inc. +# Written by Cygnus Support. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +## COMMON_PRE_CONFIG_FRAG + +SIM_OBJS = compile.o sim-load.o + +## COMMON_POST_CONFIG_FRAG + +compile.o: compile.c config.h Index: inst.h =================================================================== --- inst.h (nonexistent) +++ inst.h (revision 1765) @@ -0,0 +1,89 @@ +#define DEBUG + +/* These define the size of main memory for the simulator. + + Note the size of main memory for the H8/300H is only 256k. Keeping it + small makes the simulator run much faster and consume less memory. + + The linker knows about the limited size of the simulator's main memory + on the H8/300H (via the h8300h.sc linker script). So if you change + H8300H_MSIZE, be sure to fix the linker script too. + + Also note that there's a separate "eightbit" area aside from main + memory. For simplicity, the simulator assumes any data memory reference + outside of main memory refers to the eightbit area (in theory, this + can only happen when simulating H8/300H programs). We make no attempt + to catch overlapping addresses, wrapped addresses, etc etc. */ +#define H8300_MSIZE (1<<16) +#define H8300H_MSIZE (1<<18) + +#define CSIZE 1000 + +/* Local register names */ +typedef enum +{ + R0, R1, R2, R3, R4, R5, R6, R7, + R_ZERO, + R_PC, + R_CCR, + R_HARD_0, + R_LAST, +} reg_type; + + +/* Structure used to describe addressing */ + +typedef struct +{ + int type; + int reg; + int literal; +} ea_type; + + + +typedef struct +{ + ea_type src; + ea_type dst; + int opcode; + int next_pc; + int oldpc; + int cycles; +#ifdef DEBUG +struct h8_opcode *op; +#endif +} +decoded_inst; + +enum h8300_sim_state { + SIM_STATE_RUNNING, SIM_STATE_EXITED, SIM_STATE_SIGNALLED, SIM_STATE_STOPPED +}; + +typedef struct +{ + enum h8300_sim_state state; + int exception; + unsigned int regs[9]; + int pc; + int ccr; + + + unsigned char *memory; + unsigned char *eightbit; + unsigned short *cache_idx; + int cache_top; + int maximum; + int csize; + int mask; + + decoded_inst *cache; + int cycles; + int insts; + int ticks; + int compiles; +#ifdef ADEBUG + int stats[O_LAST]; +#endif +} +cpu_state_type; Index: configure.in =================================================================== --- configure.in (nonexistent) +++ configure.in (revision 1765) @@ -0,0 +1,10 @@ +dnl Process this file with autoconf to produce a configure script. +sinclude(../common/aclocal.m4) +AC_PREREQ(2.5)dnl +AC_INIT(Makefile.in) + +SIM_AC_COMMON + +AC_CHECK_HEADERS(stdlib.h time.h sys/param.h) + +SIM_AC_OUTPUT Index: writecode.c =================================================================== --- writecode.c (nonexistent) +++ writecode.c (revision 1765) @@ -0,0 +1,1033 @@ +/* Code generator for the Hitachi H8/300 architecture simulator. + + Written by Steve Chamberlain of Cygnus Support. + sac@cygnus.com + + This file is part of H8/300 sim + + + THIS SOFTWARE IS NOT COPYRIGHTED + + Cygnus offers the following for use in the public domain. Cygnus + makes no warranty with regard to the software or it's performance + and the user accepts the software "AS IS" with all faults. + + CYGNUS DISCLAIMS ANY WARRANTIES, EXPRESS OR IMPLIED, WITH REGARD TO + THIS SOFTWARE INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + +*/ + +/* This program reads the H8/300 opcode table and writes out + a large switch statement to understand the opcodes (with ifs if + there is more than one opcode per case) and code to do the stuff */ + +#include + +#define DEFINE_TABLE +#define INSIM +#include"opcode/h8300.h" + +#define MAXSAME 140 + +#define PTWO 256 +static struct h8_opcode *h8_opcodes_sorted[PTWO][MAXSAME]; + +char *cs = "/*"; +char *ce = "*/"; + +/* How to get at nibble n from the instruction */ +char *nibs[] = +{ + "foo", + "(b0&0xf)", + "((b1>>4)&0xf)", + "((b1)&0xf)", + "((pc[1]>>12)&0xf)", + "((pc[1]>>8)&0xf)", + "((pc[1]>>4)&0xf)", + "((pc[1])&0xf)", + 0, 0}; + +/* how to get at the 3 bit immediate in the instruction */ +char *imm3[] = +{"foo", + "foo", + "((b1>>4)&0x7)", + "foo", + "foo", + "foo", + "(pc[1]>>4)&0x7"}; + +/* How to get at a byte register from an index in the instruction at + nibble n */ +char *breg[] = +{"foo", + "*(blow[b0])", + "*(bhigh[b1])", + "*(blow[b1])", + 0, 0, + "*(bhigh[pc[1]>>8])"}; + +/* How to get at a word register from an index in the instruction at + nibble n */ + +char *wreg[] = +{"foo", + "*(wlow[b0])", + "*(whigh[b1])", + "*(wlow[b1])"}; + +#define sorted_key noperands + +/* sort the opcode table into h8_opcodes_sorted[0..255] */ +static void +init () +{ + unsigned int i; + struct h8_opcode *p; + + for (p = h8_opcodes; p->name; p++) + { + int n1 = 0; + int n2 = 0; + int j; +#if 0 + for (j = 0; p->data.nib[j] != E; j++) + { + if ((int) p->data.nib[j] == ABS16ORREL8SRC) + p->data.nib[j] = ABS16SRC; + if ((int) p->data.nib[j] == ABS16OR8SRC) + p->data.nib[j] = ABS16SRC; + if ((int) p->data.nib[j] == ABS16OR8DST) + p->data.nib[j] = ABS16DST; + } +#endif + + if ((int) p->data.nib[0] < 16) + { + n1 = (int) p->data.nib[0]; + } + else + n1 = 0; + if ((int) p->data.nib[1] < 16) + { + n2 = (int) p->data.nib[1]; + } + else + n2 = 0; + for (i = 0; i < MAXSAME; i++) + { + int j = /* ((n3 >> 3) * 512) + ((n4 >> 3) * 256) + */ n1 * 16 + n2; + + if (h8_opcodes_sorted[j][i] == (struct h8_opcode *) NULL) + { + h8_opcodes_sorted[j][i] = p; + p->sorted_key = j; + break; + } + } + + if (i == MAXSAME) + abort (); + + /* Just make sure there are an even number of nibbles in it, and + that the count is the same s the length */ + for (i = 0; p->data.nib[i] != E; i++) + /*EMPTY*/ ; + if (i & 1) + abort (); + p->length = i / 2; + } + for (i = 0; i < PTWO; i++) + { + if (h8_opcodes_sorted[i][0]) + p = h8_opcodes_sorted[i][0]; + else + h8_opcodes_sorted[i][0] = p; + } +} + +/* decode the lvalues, creating a pointer in real space to object - + remember if the thing has to be swapped out of where it is */ + + +int swap[2]; + +lval (p) + struct h8_opcode *p; +{ + int i; + + for (i = 0; p->data.nib[i] != E; i++) + { + int x = p->data.nib[i]; + int size; + int op; + op = (x & DST) ? 1 : 0; + + switch (x & SIZE) + { + case L_32: + size = 32; + break; + case L_16: + size = 16; + break; + case L_8: + size = 8; + break; + default: + size = 1234; + } + + if (x & REG) + { + printf ("ir%d = GET_LVAL_%d_REG(%d);\n", op, size, i); + } + else if (x & IMM) + { + printf ("/* Imm has no lvalue */\n"); + } + + } + + + +} + +void +decode (p, fetch, size) + struct h8_opcode *p; + int fetch; + int size; +{ + if (fetch) + { + lval (p); + } + +} + + + +static void +esleep () +{ + printf ("saved_state.exception = SIGSTOP;\n"); +} + +static void +mov (p, s, sz) + struct h8_opcode *p; + char *s; + int sz; +{ + printf ("dst = srca;\n"); +} + +static void +andc (p) + struct h8_opcode *p; +{ + printf ("SET_CCR(GET_CCR() & srca);\n"); +} + +static void +addx (p) + struct h8_opcode *p; +{ + printf ("dst = srca + srcb+ (c != 0);\n"); +} + +static void +subx (p) + struct h8_opcode *p; +{ + printf ("dst = srcb - srca - (c != 0);\n"); +} + +static void +add (p, s, sz) + struct h8_opcode *p; + char *s; + int sz; +{ + printf ("%s;\n", s); +} + +static void +adds (p, s) + struct h8_opcode *p; + char *s; +{ + printf ("%s;\n", s); +} + +static void +bra (p, a) + struct h8_opcode *p; + char *a; +{ + printf ("if (%s) npc += ((char )b1)>>1;\n", a); +} + +static void +bsr (p, a) + struct h8_opcode *p; + char *a; +{ + printf ("reg[7]-=2;\n"); + printf ("tmp = reg[7];\n"); + printf ("SET_WORD_MEM(tmp, (npc-saved_state.mem)*2);\n"); + printf ("npc += ((char)b1)>>1;\n"); +} + +static void +cmp (p, a, s) + struct h8_opcode *p; + char *a; + int s; +{ + decode (p, 1, s); + printf ("srca = -srca;\n"); + printf ("dst = srca + srcb;\n"); +} + +static +void +jsr (p, a, s) + struct h8_opcode *p; + char *a; + int s; +{ + printf ("if (b1 == 0xc4) {\n"); + printf ("printf(\"%%c\", reg[2]);\n"); + printf ("}\n"); + printf ("else {\n"); + printf ("reg[7]-=2;\n"); + printf ("tmp = reg[7];\n"); + printf ("SET_WORD_MEM(tmp, (npc-saved_state.mem)*2);\n"); + printf ("npc = (lval>>1) + saved_state.mem;\n"); + printf ("}"); +} + +static void +jmp (p, a, s) + struct h8_opcode *p; + char *a; + int s; +{ + printf ("npc = (lval>>1) + saved_state.mem;\n"); +} + +static void +rts (p, a, s) + struct h8_opcode *p; + char *a; + int s; +{ + printf ("tmp = reg[7];\n"); + printf ("reg[7]+=2;\n"); + printf ("npc = saved_state.mem + (WORD_MEM(tmp)>>1);\n"); +} + +static void +rte (p, a, s) + struct h8_opcode *p; + char *a; + int s; +{ + printf ("reg[7]+=2;\n"); + printf ("tmp = reg[7];\n"); + printf ("reg[7]+=2;\n"); + printf ("SET_CCR(tmp);\n"); + printf ("npc = saved_state.mem + (WORD_MEM(tmp)>>1);\n"); +} + +static void +setf (p, a, s) + struct h8_opcode *p; + char *a; + int s; +{ + printf ("tmp = GET_CCR();\n"); + printf ("tmp %s= srca;\n", a); +} + +static void +bpt (p, a, s) + struct h8_opcode *p; + char *a; + int s; +{ + printf ("saved_state.exception = SIGTRAP;\n"); + printf ("npc = pc;\n"); +} + +static void +log (p, a, s) + struct h8_opcode *p; + char *a; + int s; +{ + printf ("dst = srcb %s srca;\n", a); +} + +static void +ulog (p, a, s) + struct h8_opcode *p; + char *a; + int s; +{ + printf ("dst = %s srcb ;\n", a); +} + +static void +nop () +{ +} + +static void +rotl () +{ + printf ("c = srcb & 0x80;\n"); + printf ("dst = srcb << 1;\n"); + printf ("if (c) dst|=1;\n"); +} + +static void +rotr () +{ + printf ("c = srcb & 1;\n"); + printf ("dst = srcb >> 1;\n"); + printf ("if (c) dst|=0x80;\n"); +} + +static void +rotxl () +{ + printf ("tmp = srcb & 0x80;\n"); + printf ("dst = srcb << 1;\n"); + printf ("if (c) dst|=1;\n"); + printf ("c = tmp;\n"); +} + +static void +rotxr () +{ + printf ("tmp = srcb & 1;\n"); + printf ("dst = srcb >> 1;\n"); + printf ("if (c) dst|=0x80;\n"); + printf ("c = tmp;\n"); +} + +static void +shal () +{ + printf ("c = srcb&0x80;\n"); + printf ("dst = srcb << 1;\n"); +} + +static +void +shar () +{ + printf ("c = srcb&0x1;\n"); + printf ("if (srcb&0x80) dst = (srcb>>1) | 0x80;\n"); + printf ("else dst = (srcb>>1) &~ 0x80;\n"); +} + +static +void +shll () +{ + printf ("c = srcb&0x80;\n"); + printf ("dst = srcb << 1;\n"); +} + +static +void +shlr () +{ + printf ("c = srcb&0x1;\n"); + printf ("dst = (srcb>>1) &~ 0x80;\n"); +} + +static +void +divxu () +{ + printf ("srca = %s;\n", breg[2]); + printf ("srcb = %s;\n", wreg[3]); + printf ("n = srca & 0x80;\n"); + printf ("z = !srca;\n"); + printf ("if (srca) dst = srcb / srca;tmp = srcb %% srca;\n"); + printf ("%s = (dst & 0xff) | (tmp << 8);\n", wreg[3]); +} + +static +void +mulxu () +{ + printf ("srca = %s;\n", breg[2]); + printf ("srcb = %s;\n", wreg[3]); + + printf ("dst = (srcb&0xff) * srca;\n"); + printf ("%s = dst;\n", wreg[3]); +} + +static +void +inc () +{ + printf ("dst = %s;\n", breg[3]); + printf ("v = (dst==0x7f);\n"); + printf ("dst++;\n"); + printf ("%s= dst;\n", breg[3]); +} + +static +void +bit (p, a, s) + struct h8_opcode *p; + char *a; + int s; +{ + printf ("%s\n", a); +} + +static +void +dec () +{ + printf ("dst = %s;\n", breg[3]); + printf ("v = (dst==0x80);\n"); + printf ("dst--;\n"); + printf ("%s = dst;\n", breg[3]); +} + +char saf[] = "goto setflags;"; +char sf[] = "goto shiftflags;"; +char af8[] = "goto aluflags8;"; +char af16[] = "goto aluflags16;"; +char lf[] = "goto logflags;"; +char icf[] = "goto incflags;"; +char mf8[] = "goto movflags8;"; +char mf16[] = "goto movflags16;"; +char nx[] = "goto next;"; + +struct +{ + char *ftype; + int decode; + char *name; + void (*func) (); + char *arg; + int size; + +} + +table[] = +{ + { + nx, 1, "bld", bit, "dst = srcb; c = (srcb>>srca)&1;", 8 + } + , + { + nx, 1, "bild", bit, "dst = srcb; c = !((srcb>>srca)&1);", 8 + } + , + { + nx, 1, "band", bit, "dst = srcb; c = C &&((srcb>>srca)&1);", 8 + } + , + { + nx, 1, "biand", bit, "dst = srcb; c = C &&(!((srcb>>srca)&1));", 8 + } + , + { + nx, 1, "bior", bit, "dst = srcb; c = C ||(!((srcb>>srca)&1));", 8 + } + , + { + nx, 1, "bor", bit, "dst = srcb; c = C ||(((srcb>>srca)&1));", 8 + } + , + { + nx, 1, "bixor", bit, "dst = srcb; c = C ^(!((srcb>>srca)&1));", 8 + } + , + { + nx, 1, "bxor", bit, "dst = srcb; c = C ^(((srcb>>srca)&1));", 8 + } + , + { + nx, 1, "bnot", bit, "dst = srcb ^ (1<>srca)&1);", 8 + } + , + { + icf, 0, "dec", dec, 0, 0 + } + , + { + icf, 0, "inc", inc, 0, 0 + } + , + { + saf, 1, "orc", setf, "|", 0 + } + , + { + saf, 1, "xorc", setf, "^", 0 + } + , + { + saf, 1, "andc", setf, "&", 0 + } + , + { + nx, 1, "nop", nop, 0, 0 + } + , + { + nx, 1, "bra", bra, "1", 0 + } + , + { + nx, 1, "brn", bra, "0", 0 + } + , + { + nx, 1, "bhi", bra, "(C||Z)==0", 0 + } + , + { + nx, 1, "bls", bra, "(C||Z)==1", 0 + } + , + { + nx, 1, "bcs", bra, "C==1", 0 + } + , + { + nx, 1, "bcc", bra, "C==0", 0 + } + , + { + nx, 1, "bpl", bra, "N==0", 0 + } + , + { + nx, 1, "bmi", bra, "N==1", 0 + } + , + { + nx, 1, "bvs", bra, "V==1", 0 + } + , + { + nx, 1, "bvc", bra, "V==0", 0 + } + , + { + nx, 1, "bge", bra, "(N^V)==0", 0 + } + , + { + nx, 1, "bgt", bra, "(Z|(N^V))==0", 0 + } + , + { + nx, 1, "blt", bra, "(N^V)==1", 0 + } + , + { + nx, 1, "ble", bra, "(Z|(N^V))==1", 0 + } + , + { + nx, 1, "beq", bra, "Z==1", 0 + } + , + { + nx, 1, "bne", bra, "Z==0", 0 + } + , + { + nx, 1, "bsr", bsr, "", 0 + } + , + { + nx, 1, "jsr", jsr, 0, 0 + } + , + { + nx, 1, "jmp", jmp, 0, 0 + } + , + { + nx, 0, "rts", rts, 0, 0 + } + , + { + nx, 0, "rte", rte, 0, 0 + } + , + { + nx, 1, "andc", andc, 0, 0 + } + , + { + sf, 1, "shal", shal, 0, 0 + } + , + { + sf, 1, "shar", shar, 0, 0 + } + , + { + sf, 1, "shll", shll, 0, 0 + } + , + { + sf, 1, "shlr", shlr, 0, 0 + } + , + { + sf, 1, "rotxl", rotxl, 0, 0 + } + , + { + sf, 1, "rotxr", rotxr, 0, 0 + } + , + { + sf, 1, "rotl", rotl, 0, 0 + } + , + { + sf, 1, "rotr", rotr, 0, 0 + } + , + { + lf, 1, "xor", log, "^", 0 + } + , + { + lf, 1, "and", log, "&", 0 + } + , + { + lf, 1, "or", log, "|", 0 + } + , + { + lf, 1, "not", ulog, " ~", 0 + } + , + { + lf, 1, "neg", ulog, " - ", 0 + } + , + { + nx, 1, "adds", adds, "dst = srca + srcb", 0 + } + , + { + nx, 1, "subs", adds, "srca = -srca; dst = srcb + srca", 0 + } + , + { + af8, 1, "add.b", add, "dst = srca + srcb", 8 + } + , + { + af16, 1, "add.w", add, "dst = srca + srcb", 16 + } + , + { + af16, 1, "sub.w", add, "srca = -srca; dst = srcb + srca", 16 + } + , + { + af8, 1, "sub.b", add, "srca = -srca; dst = srcb + srca", 8 + } + , + { + af8, 1, "addx", addx, 0, 8 + } + , + { + af8, 1, "subx", subx, 0, 8 + } + , + { + af8, 0, "cmp.b", cmp, 0, 8 + } + , + { + af16, 0, "cmp.w", cmp, 0, 16 + } + , + { + nx, 1, "sleep", esleep, 0, 0 + } + , + { + nx, 0, "bpt", bpt, 0, 8 + } + , + { + nx, 0, "divxu", divxu, 0, 0 + } + , + { + nx, 0, "mulxu", mulxu, 0, 0 + } + , + { + mf8, 1, "mov.b", mov, 0, 8 + } + , + { + mf8, 1, "movtpe", mov, 0, 8 + } + , + { + mf8, 1, "movfpe", mov, 0, 8 + } + , + { + mf16, 1, "mov.w", mov, 0, 16 + } + , + { + 0 + } +}; + +static +void +edo (p) + struct h8_opcode *p; +{ + int i; + + printf ("%s %s %s\n", cs, p->name, ce); + + for (i = 0; table[i].name; i++) + { + if (strcmp (table[i].name, p->name) == 0) + { + printf ("{\n"); + if (table[i].decode) + decode (p, 1, table[i].size); + printf ("cycles += %d;\n", p->time); + printf ("npc = pc + %d;\n", p->length / 2); + table[i].func (p, table[i].arg, table[i].size); + if (table[i].decode) + decode (p, 0, table[i].size); + if (table[i].ftype) + printf (table[i].ftype); + else + printf ("goto next;\n"); + printf ("}\n"); + return; + } + } + printf ("%s not found %s\n", cs, ce); + printf ("saved_state.exception = SIGILL;\n"); + printf ("break;\n"); +} + +static +int +owrite (i) + int i; +{ + /* write if statements to select the right opcode */ + struct h8_opcode **p; + int needand = 1; + + p = h8_opcodes_sorted[i]; + printf ("case 0x%03x:\n", i); + + if (p[1] == 0) + { + /* See if the next few also match */ + while (h8_opcodes_sorted[i + 1][0] == *p) + { + i++; + printf ("case 0x%03x:\n", i); + } + + /* Dont need any if's this is the only one */ + edo (*p); + } + else + { + while (*p) + { + /* start two nibbles in since we know we match in the first byte */ + int c; + int nib = 2; + int byte = 1; + int mask1[5]; + int mask0[5]; + int nibshift = 4; + int any = 0; + + for (c = 0; c < 5; c++) + { + mask1[c] = 0; + mask0[c] = 0; + } + printf ("%s %x%x", cs, (*p)->data.nib[0], (*p)->data.nib[1]); + while ((c = (*p)->data.nib[nib]) != E) + { + if (c & B30) + { + /* bit 3 must be zero */ + mask0[byte] |= 0x8 << nibshift; + printf ("0"); + any = 1; + } + else if (c & B31) + { + /* bit 3 must be one */ + mask1[byte] |= 0x8 << nibshift; + printf ("8"); + any = 1; + } + else if (c <= HexF) + { + mask0[byte] |= ((~c) & 0xf) << nibshift; + mask1[byte] |= (c & 0xf) << nibshift; + printf ("%x", c); + any = 1; + } + else + { + printf ("x"); + } + nib++; + if (nibshift == 4) + { + nibshift = 0; + } + else + { + byte++; + nibshift = 4; + } + } + printf ("*/\n"); + if (any) + { + printf ("if ("); + needand = 0; + for (c = 1; c < byte; c++) + { + if (mask0[c] | mask1[c]) + { + int sh; + + if (needand) + printf ("\n&&"); + if (c & 1) + sh = 0; + else + sh = 8; + if (c / 2 == 0 && sh == 0) + printf ("((b1&0x%x)==0x%x)", mask0[c] | mask1[c], + mask1[c]); + else + { + printf ("((pc[%d]&(0x%02x<<%d))==(0x%x<<%d))", + c / 2, mask0[c] | mask1[c], sh, + mask1[c], sh); + } + + needand = 1; + } + } + printf (")\n"); + } + edo (*p); + p++; + + } + } + return i; +} + +static +void +remove_dups () +{ + struct h8_opcode *s; + struct h8_opcode *d; + + for (d = s = h8_opcodes; s->name; s++) + { + int doit = 1; + + if (strcmp (s->name, "push") == 0) + doit = 0; + if (strcmp (s->name, "bhs") == 0) + doit = 0; + if (strcmp (s->name, "blo") == 0) + doit = 0; + if (strcmp (s->name, "bt") == 0) + doit = 0; + if (strcmp (s->name, "bf") == 0) + doit = 0; + if (strcmp (s->name, "pop") == 0) + doit = 0; + if (doit) + { + *d++ = *s; + } + } + *d++ = *s++; +} + +int +main () +{ + int i; + + remove_dups (); + init (); + + printf ("%s do the operation %s\n", cs, ce); + printf ("switch (b0) \n{\n"); + for (i = 0; i < PTWO; i++) + { + i = owrite (i); + } + printf ("}\n"); + + return 0; +} Index: ChangeLog =================================================================== --- ChangeLog (nonexistent) +++ ChangeLog (revision 1765) @@ -0,0 +1,605 @@ +Thu Sep 2 18:15:53 1999 Andrew Cagney + + * configure: Regenerated to track ../common/aclocal.m4 changes. + +1999-05-08 Felix Lee + + * configure: Regenerated to track ../common/aclocal.m4 changes. + +1999-04-02 Keith Seitz + + * compile.c (POLL_QUIT_INTERVAL): Define. Used to tweak the + frequency at which the poll_quit callback is used. + (sim_resume): Use POLL_QUIT_INTERVAL instead of hard-coded value. + +Tue Apr 28 18:33:31 1998 Geoffrey Noer + + * configure: Regenerated to track ../common/aclocal.m4 changes. + +Sun Apr 26 15:31:55 1998 Tom Tromey + + * configure: Regenerated to track ../common/aclocal.m4 changes. + * config.in: Ditto. + +Sun Apr 26 15:20:14 1998 Tom Tromey + + * acconfig.h: New file. + * configure.in: Reverted change of Apr 24; use sinclude again. + +Fri Apr 24 14:16:40 1998 Tom Tromey + + * configure: Regenerated to track ../common/aclocal.m4 changes. + * config.in: Ditto. + +Fri Apr 24 11:19:46 1998 Tom Tromey + + * configure.in: Don't call sinclude. + +Sat Apr 4 20:36:25 1998 Andrew Cagney + + * configure: Regenerated to track ../common/aclocal.m4 changes. + +Fri Mar 27 16:15:52 1998 Andrew Cagney + + * configure: Regenerated to track ../common/aclocal.m4 changes. + +Wed Mar 25 12:35:29 1998 Andrew Cagney + + * configure: Regenerated to track ../common/aclocal.m4 changes. + +Wed Mar 18 12:38:12 1998 Andrew Cagney + + * configure: Regenerated to track ../common/aclocal.m4 changes. + +Tue Feb 17 12:42:18 1998 Andrew Cagney + + * compile.c (sim_store_register, sim_fetch_register): Pass in + length parameter. Return -1. + +Sun Feb 1 16:47:51 1998 Andrew Cagney + + * configure: Regenerated to track ../common/aclocal.m4 changes. + +Sat Jan 31 18:15:41 1998 Andrew Cagney + + * configure: Regenerated to track ../common/aclocal.m4 changes. + +Mon Jan 19 22:26:29 1998 Doug Evans + + * configure: Regenerated to track ../common/aclocal.m4 changes. + +Mon Dec 15 23:17:11 1997 Andrew Cagney + + * configure: Regenerated to track ../common/aclocal.m4 changes. + * config.in: Ditto. + +Thu Dec 4 09:21:05 1997 Doug Evans + + * configure: Regenerated to track ../common/aclocal.m4 changes. + +Tue Nov 11 16:52:07 1997 Angela Marie Thomas (angela@cygnus.com) + + * compile.c: #include stdio.h for definition of NULL on + some platforms. + +Wed Oct 22 14:43:00 1997 Andrew Cagney + + * compile.c (sim_load): Pass lma_p and sim_write args to + sim_load_file. + +Fri Oct 3 09:28:00 1997 Andrew Cagney + + * configure: Regenerated to track ../common/aclocal.m4 changes. + +Wed Sep 24 17:38:57 1997 Andrew Cagney + + * configure: Regenerated to track ../common/aclocal.m4 changes. + +Tue Sep 23 11:04:38 1997 Andrew Cagney + + * configure: Regenerated to track ../common/aclocal.m4 changes. + +Mon Sep 22 11:46:20 1997 Andrew Cagney + + * configure: Regenerated to track ../common/aclocal.m4 changes. + +Fri Sep 19 17:45:25 1997 Andrew Cagney + + * configure: Regenerated to track ../common/aclocal.m4 changes. + +Wed Sep 17 12:00:57 1997 Andrew Cagney + + * Makefile.in (compile.o): Depend on config.h in local directory. + +Mon Sep 15 17:36:15 1997 Andrew Cagney + + * configure: Regenerated to track ../common/aclocal.m4 changes. + +Tue Sep 9 22:17:26 1997 Felix Lee + + * inst.h (sim_state): rename to h8300_sim_state, to avoid conflict + with sim/common. + * configure.in: check for sys/param.h + * compile.c: #ifdef HAVE_SYS_PARAM_H. + #define SIGTRAP for wingdb. + (sim_resume): poll keyboard at least once per call. + (sim_resume): use host_callback instead of printf for syscall + output. + +Thu Sep 4 17:21:23 1997 Doug Evans + + * configure: Regenerated to track ../common/aclocal.m4 changes. + +Wed Aug 27 18:13:22 1997 Andrew Cagney + + * configure: Regenerated to track ../common/aclocal.m4 changes. + * config.in: Ditto. + +Tue Aug 26 10:38:43 1997 Andrew Cagney + + * compile.c (sim_kill): Delete. + (sim_create_inferior): Add ABFD argument. + (sim_load): Move setting of PC from here. + (sim_create_inferior): To here. + (sim_open, sim_load, set_h8300h): Add fixme explaining why much of + the sim_load code should be moved to sim_open. + +Mon Aug 25 17:50:22 1997 Andrew Cagney + + * configure: Regenerated to track ../common/aclocal.m4 changes. + * config.in: Ditto. + +Mon Aug 25 15:47:41 1997 Andrew Cagney + + * compile.c (sim_open): Add ABFD argument. + +Tue May 20 10:16:48 1997 Andrew Cagney + + * compile.c (sim_open): Add callback argument. + (sim_set_callbacks): Delete SIM_DESC argument. + +Wed Apr 30 10:22:29 1997 Doug Evans + + * compile.c (sim_load): Call bfd_get_mach instead of examining + bfd fields directly. + * tconfig.in (SIM_PRE_LOAD): Delete, no longer used. + +Thu Apr 24 00:39:51 1997 Doug Evans + + * configure: Regenerated to track ../common/aclocal.m4 changes. + +Fri Apr 18 14:30:09 1997 Andrew Cagney + + * compile.c (sim_resume): Use poll_quit callback. + (sim_stop): New function. + +Thu Apr 17 03:06:39 1997 Doug Evans + + * Makefile.in (SIM_OBJS): Add sim-load.o. + * compile.c (sim_kind, myname): New static locals. + (sim_open): Set sim_kind, myname. + (sim_load): Return SIM_RC. New arg abfd. Update test for h8300h. + Call sim_load_file to load file into simulator. Set start address + from bfd. + (sim_create_inferior): Return SIM_RC. Delete arg start_address. + +Mon Apr 7 15:45:02 1997 Andrew Cagney + + * configure: Regenerated to track ../common/aclocal.m4 changes. + * config.in: Ditto. + +Wed Apr 2 15:06:28 1997 Doug Evans + + * compile.c (sim_open): New arg `kind'. + + * configure: Regenerated to track ../common/aclocal.m4 changes. + +Wed Apr 2 14:34:19 1997 Andrew Cagney + + * configure: Regenerated to track ../common/aclocal.m4 changes. + +Wed Mar 19 01:14:00 1997 Andrew Cagney + + * configure: Regenerated to track ../common/aclocal.m4 changes. + +Mon Mar 17 15:10:07 1997 Andrew Cagney + + * configure: Re-generate. + +Fri Mar 14 10:34:11 1997 Michael Meissner + + * configure: Regenerate to track ../common/aclocal.m4 changes. + +Thu Mar 13 12:48:05 1997 Doug Evans + + * compile.c (sim_open): New SIM_DESC result. Argument is now in + argv form. + (other sim_*): New SIM_DESC argument. + +Tue Feb 4 13:36:29 1997 Doug Evans + + * Makefile.in (@COMMON_MAKEFILE_FRAG): Use + COMMON_{PRE,POST}_CONFIG_FRAG instead. + * configure.in: sinclude ../common/aclocal.m4. + * configure: Regenerated. + +Thu Jan 23 11:46:23 1997 Stu Grossman (grossman@critters.cygnus.com) + + * configure configure.in Makefile.in: Update to new configure + scheme which is more compatible with WinGDB builds. + * configure.in: Improve comment on how to run autoconf. + * configure: Re-run autoconf to get new ../common/aclocal.m4. + * Makefile.in: Use autoconf substitution to install common + makefile fragment. + +Wed Nov 20 01:39:12 1996 Doug Evans + + * Makefile.in: Delete stuff moved to ../common/Make-common.in. + (SIM_OBJS): Define. + * configure.in: Simplify using macros in ../common/aclocal.m4. + * configure: Regenerated. + * inst.h (enum sim_state): Define. + (cpu_state_type): New member `state'. Set it whenever `exception' + is set. + * compile.c (sim_callback): New global. + (sim_set_simcache_size): Renamed from sim_csize. + (sim_resume, case O_SLEEP): Add right way to decode r0 but #if 0 out + 'cus it can't work. Change main loop exit test to use cpu.state. + (sim_trace): New function. + (sim_stop_reason): Add right way to set results, but #if 0 out. + (sim_size): New function. + (sim_info): Redirect calls to printf_filtered through callback. + (sim_set_callbacks): Record callback. + * run.c: Deleted, using one in ../common now. + * tconfig.in: New file. + +Thu Oct 3 16:13:18 1996 Jason Molenda (crash@godzilla.cygnus.co.jp) + + * Makefile.in (mostlyclean): Don't remove config.log here. + +Fri Aug 9 22:59:11 1996 Jeffrey A Law (law@cygnus.com) + + * compile.c (sim_resume): rts, sleep, bpt and nop have + no associated "size". + +Tue Jul 9 22:15:39 1996 Jeffrey A Law (law@cygnus.com) + + * compile.c (sim_resume): Fix all rotate-by-2-bits insns. + +Tue Jul 2 23:08:45 1996 Jeffrey A Law (law@cygnus.com) + + * run.c (main): Don't "load" sections which don't have + SEC_LOAD set. + * compile.c (sim_resume, case "O_NOT"): Use ONOT instead + of OSHIFTS. + (ONOT): Define. + (sim_resume, shift/rotate cases): Add support for shift/rotate + by two bits. + (OSHIFTS): Corresponding changes. + +Tue Jul 2 01:37:27 1996 Jeffrey A Law (law@cygnus.com) + + * compile.c (sim_resume): Handle "ldm.l" and "stm.l". + +Wed Jun 26 08:58:53 1996 Jeffrey A Law (law@cygnus.com) + + * compile.c (h8300smode): Declare. + +Wed Jun 26 12:20:56 1996 Jason Molenda (crash@godzilla.cygnus.co.jp) + + * Makefile.in (bindir, libdir, datadir, mandir, infodir, includedir, + INSTALL_PROGRAM, INSTALL_DATA): Use autoconf-set values. + (docdir): Removed. + * configure.in (AC_PREREQ): autoconf 2.5 or higher. + (AC_PROG_INSTALL): Added. + * configure: Rebuilt. + +Tue Jun 18 16:31:10 1996 Jeffrey A. Law + + * compile.c (sim_load): Treat the H8/S like the H8/300H for now. + * run.c (main): Treat the H8/S like the H8/300H for now. + +Fri May 24 10:35:25 1996 Jeffrey A Law (law@cygnus.com) + + * compile.c (SEXTCHAR): Clear upper bits when sign + bit is clear. + +Wed May 22 22:23:37 1996 Jeffrey A Law (law@cygnus.com) + + * compile.c (sim_resume): Correctly handle divu. + +Tue May 7 02:13:05 1996 Jeffrey A Law (law@cygnus.com) + + * compile.c (sim_resume): Never allow the PC to have an + odd value. + +Fri Apr 12 16:50:37 1996 Jeffrey A Law (law@cygnus.com) + + * inst.h: Expand on comments regarding H8300H_MSIZE. Note + separate memory is allocate for the 8-bit area. + (struct cpu_state_type): Add new "eightbit' field. + * compile.c (GET_MEMORY_L): Handle access into the 8-bit + area. + (GET_MEMORY_W, GET_MEMORY_B): Likewise. + (SET_MEMORY_L, SET_MEMORY_W, SET_MEMORY_B): Likewise. + (init_pointers): Initialize space for the 8-bit area. + (sim_write): Handle writing into the 8-bit area. + (sim_read): Handle reading from the 8-bit area. + (sim_load): Reallocate space for the 8-bit area. + + * compile.c (sim_load): Re-allocate memory for the simulator + here. + +Fri Apr 12 09:39:56 1996 Jeffrey A Law (law@cygnus.com) + + * compile.c (sim_resume): Fix and simplify overflow and carry + handling for 32bit ALU insns. + +Mon Apr 8 23:58:49 1996 Jeffrey A Law (law@cygnus.com) + + * compile.c (sim_resume): Fix overflow checks for ALU insns. + +Fri Apr 5 17:20:59 1996 Jeffrey A Law (law@cygnus.com) + + * compile.c (decode): Use "bit" to hold L_3 immediates instead + of holding them in "abs". Handle ABS8MEM memory references aka + 8-bit area. Replace ABSMOV references with ABS8MEM. + +Wed Mar 13 17:43:56 1996 Jeffrey A Law (law@cygnus.com) + + * compile.c (fetch): Handle accesses to the exception/function + vectors. + +Mon Mar 11 09:53:25 1996 Doug Evans + + * compile.c: #include "wait.h". + (sim_resume, sleep insn): Check program exit status in r0. + (sim_resume, shift insns): Fix setting of overflow flag for shal. + * run.c: #include . + (main): Abort if program got SIGILL. + Print error message if argument is invalid. + (usage): Improve text. + +Wed Feb 21 12:15:00 1996 Ian Lance Taylor + + * configure: Regenerate with autoconf 2.7. + +Thu Jan 4 11:52:53 1996 Doug Evans + + * inst.h (MPOWER,MSIZE): Deleted. + (H8300{,H}_MSIZE): Define. + * compile.c (memory_size): New static global. + (init_pointers): Set memory size from one of H8300{,H}_MSIZE. + (sim_write,sim_read): Use memory_size. + +Fri Oct 13 15:03:19 1995 steve chamberlain + + * compile.c (sim_set_callbacks): New. + +Tue Oct 10 11:11:26 1995 Fred Fish + + * Makefile.in (BISON): Remove macro. + +Wed Sep 20 13:35:02 1995 Ian Lance Taylor + + * Makefile.in (maintainer-clean): New synonym for realclean. + +Fri Sep 8 12:18:53 1995 Ian Lance Taylor + + * Makefile.in (install): Don't install in $(tooldir). + + * configure.in: Call AC_CONFIG_HEADER. Don't try to use + bfd/hosts/*.h file or bfd/config/*.mh file. Call AC_PROG_CC and + AC_PROG_RANLIB. Substitute in values for CFLAGS, HDEFINES and AR. + Call AC_CHECK_HEADERS for stdlib.h and time.h. Touch stamp.h if + creating config.h. + * configure: Rebuild. + * config.in: New file, created by autoheader. + * Makefile.in (AR): Define as @AR@. + (CC): New variable, defined as @CC@. + (CFLAGS): Define as @CFLAGS@. + (RANLIB): Define as @RANLIB@. + (HDEFINES, TDEFINES): New variables. + (@host_makefile_frag@): Remove. + (compile.o, run.o): Depend upon config.h. + (mostlyclean): Make the same as clean, not distclean. + (clean): Remove config.log. + (distclean): Remove config.h and stamp-h. + (Makefile): Don't depend upon @frags@. Just rebuild Makefile when + invoking config.status. + (config.h, stamp-h): New targets. + * compile.c: Include "config.h". Don't include . + Include and if they exist. Don't include + "sysdep.h". + (get_now): Remove unused local b. + * run.c: Include "config.h". Include if it exists. + Don't include "sysdep.h". + * writecode.c: Don't include "bfd.h" or "sysdep.h". Include + . + +Thu Aug 3 10:45:37 1995 Fred Fish + + * Update all FSF addresses except those in COPYING* files. + +Wed Jul 5 14:32:54 1995 J.T. Conklin + + * Makefile.in (clean): Remove run. + (distclean): Remove Makefile. + + * h8300.mt: Removed. + + * Makefile.in, configure.in: converted to autoconf. + * configure: New file, generated with autconf 2.4. + +Fri Jun 30 16:50:24 1995 Stan Shebs + + * compile.c (sim_do_command): New function. + +Tue Jun 20 16:18:13 1995 Steve Chamberlain + + * compile.c (get_now): Don't do if win32. + (sim_resume): Poll in win32 too. + +Wed May 24 16:31:38 1995 Jim Wilson + + * configure.in: Fix typo in last change. + +Mon Mar 27 10:32:34 1995 J.T. Conklin + + * run.c: parse arguments with getopt(). + +Tue Feb 28 17:30:08 1995 Ian Lance Taylor + + * configure.in: Use ../../bfd/hosts/std-host.h if specific + host unavailable. + +Sun Jan 22 12:35:43 1995 Steve Chamberlain + + * compile.c (sim_resume): Initialize cpu.mask. + +Thu Sep 8 16:53:00 1994 Steve Chamberlain (sac@jonny.cygnus.com) + + * inst.h (MPOWER): Bump simulated memory size to 2^18 bytes. + +Wed May 18 13:47:58 1994 Doug Evans (dje@canuck.cygnus.com) + + * compile.c: #include "bfd.h". + (sim_*): Set result type to void where there isn't one. + (sim_resume, default case): Set cpu.exception to SIGILL. + (sim_trace): Delete. + (sim_set_pc): Delete. + (sim_info): Delete printf_fn arg, all callers changed. + Call printf_filtered. + (set_h8300h): New arg `flag', all callers changed. + (sim_close): New function. + (sim_load): New function. + (sim_create_inferior): Renamed from sim_set_args, all callers changed. + * run.c: #include , "remote-sim.h". + (printf_filtered): New function. + +Fri May 13 18:32:27 1994 Doug Evans (dje@canuck.cygnus.com) + + * compile.c (decode): Fix typo (16 bit branches). + (*): Some white space clean up. + +Fri May 6 13:44:01 1994 Steve Chamberlain (sac@jonny.cygnus.com) + + * compile.c (decode): Compile 16bit branches properly. + +Sat Dec 11 16:32:36 1993 Steve Chamberlain (sac@thepub.cygnus.com) + + * compile.c: Tidy up formatting. (sim_resume): Add orc, xorc, + andc. Poll for interrupts. + +Thu Oct 28 19:29:34 1993 Doug Evans (dje@canuck.cygnus.com) + + * compile.c: #include "ansidecl.h" for remote-sim.h. + +Tue Oct 26 09:43:36 1993 Doug Evans (dje@canuck.cygnus.com) + + * Makefile.in (CSEARCH): Add -I$(srcdir)/../../gdb + * compile.c: #include "remote-sim.h". + (sim_resume): New arg siggnal. + (sim_write): Use SIM_ADDR for type of arg addr. + Always return a value. + (sim_read): Ditto. + (sim_store_register): Result is type int. + (sim_fetch_register): Ditto. + (sim_stop_reason): Renamed from sim_stop_signal. + (sim_set_pc): Use SIM_ADDR for type of arg pc. + (sim_info): int result, new arg printf_fn. + (sim_kill): int result. + (sim_open): int result, new arg name. + * run.c (main): Use sim_set_pc to set pc. + Update call to sim_info. + +Sat Oct 23 15:01:18 1993 Doug Evans (dje@canuck.cygnus.com) + + * compile.c (sim_stop_signal): Result is now enum sim_stop. + +Fri Oct 15 23:49:27 1993 Jim Kingdon (kingdon@lioth.cygnus.com) + + * compile.c (sim_kill, sim_open, sim_set_args): New functions. + +Thu Oct 7 16:24:10 1993 Steve Chamberlain (sac@phydeaux.cygnus.com) + + * compile.c (sim_set_pc): Write to the pc direcly. + (sim_store_register): Now value is passed by reference. (sim_read, + sim_write): Return number of bytes copied. + +Tue Aug 17 07:16:15 1993 Steve Chamberlain (sac@phydeaux.cygnus.com) + + * compile.c (mop): New function to do multiplies. + +Fri Jul 16 13:53:53 1993 Doug Evans (dje@canuck.cygnus.com) + + * compile.c (sim_resume): Add support for nop insn. + +Thu Jul 15 09:59:01 1993 Doug Evans (dje@canuck.cygnus.com) + + * compile.c: Reset HMODE back to zero (accidently set it to 1). + + * run.c (main): If h8/300h binary detected, call set_h8300h. + * compile.c (sim_resume): Fix O_NEG insn. + +Fri Jul 9 14:36:48 1993 Doug Evans (dje@canuck.cygnus.com) + + * run.c (main): Add -h flag to enable h8/300h emulation. + * compile.c: Rename Hmode to HMODE (consistency with gdb). + (set_h8300h): New function. + (sim_resume): Add support for extu,exts insns. + (sim_resume): Fix logical right shifting. + (sim_resume, label alu32): Fix setting of carry flag. + +Sun Jul 4 00:35:41 1993 Doug Evans (dje@canuck.cygnus.com) + + * compile.c (sim_csize): Initialize cpu.cache. + +Fri Jul 2 17:42:59 1993 Doug Evans (dje@canuck.cygnus.com) + + * Makefile.in: Add -I../../bfd to pick up bfd.h. + +Thu Jun 24 13:40:12 1993 Doug Evans (dje@canuck.cygnus.com) + + * run.c (main): Fix parsing of args. + + * compile.c (sim_resume): Fix shll insn. + +Tue Jun 8 14:16:46 1993 Steve Chamberlain (sac@phydeaux.cygnus.com) + + * compile.c: New file, supports H8/300H. + * p1,p3, gencode.c, state.h, writecode.c All dead and obsolete. + +Tue Jun 1 11:14:59 1993 Steve Chamberlain (sac@thepub.cygnus.com) + + * run.c (main): Add -v to print info. + * p3.c (sim_info): New function. + +Mon Mar 15 15:48:31 1993 Ian Lance Taylor (ian@cygnus.com) + + * h8300.mt (DO_INSTALL): Renamed from INSTALL. + +Wed Mar 3 15:06:53 1993 Steve Chamberlain (sac@poseidon.cygnus.com) + + * Makefile.in: Don't use cb or indent + * p1.c, state.h, writecode.c: lint + +Mon Feb 1 16:44:58 1993 John Gilmore (gnu@cygnus.com) + + * Makefile.in: Make SunOS halfdone VPATH work. + * p1.c: Lint picked up by HP native compiler. + +Mon Jan 4 12:32:35 1993 Steve Chamberlain (sac@wahini.cygnus.com) + + * p1.c (sim_resume): when running on dos, any character typed to + the keyboard will cause a simulated exception. + +Sun Jan 3 14:15:07 1993 Steve Chamberlain (sac@thepub.cygnus.com) + + * p1.c, p3.c, run.c, writecode.c: all used h8/300 opcodes in and + running + +Tue Dec 22 13:56:48 1992 Steve Chamberlain (sac@thepub.cygnus.com) + + * new + Index: compile.c =================================================================== --- compile.c (nonexistent) +++ compile.c (revision 1765) @@ -0,0 +1,2173 @@ +/* + * Simulator for the Hitachi H8/300 architecture. + * + * Written by Steve Chamberlain of Cygnus Support. sac@cygnus.com + * + * This file is part of H8/300 sim + * + * + * THIS SOFTWARE IS NOT COPYRIGHTED + * + * Cygnus offers the following for use in the public domain. Cygnus makes no + * warranty with regard to the software or its performance and the user + * accepts the software "AS IS" with all faults. + * + * CYGNUS DISCLAIMS ANY WARRANTIES, EXPRESS OR IMPLIED, WITH REGARD TO THIS + * SOFTWARE INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#include "config.h" + +#include +#include +#ifdef HAVE_TIME_H +#include +#endif +#ifdef HAVE_STDLIB_H +#include +#endif +#ifdef HAVE_SYS_PARAM_H +#include +#endif +#include "wait.h" +#include "ansidecl.h" +#include "bfd.h" +#include "callback.h" +#include "remote-sim.h" + +#ifndef SIGTRAP +# define SIGTRAP 5 +#endif + +int debug; + +host_callback *sim_callback; + +static SIM_OPEN_KIND sim_kind; +static char *myname; + +/* FIXME: Needs to live in header file. + This header should also include the things in remote-sim.h. + One could move this to remote-sim.h but this function isn't needed + by gdb. */ +void sim_set_simcache_size PARAMS ((int)); + +#define X(op, size) op*4+size + +#define SP (h8300hmode ? SL:SW) +#define SB 0 +#define SW 1 +#define SL 2 +#define OP_REG 1 +#define OP_DEC 2 +#define OP_DISP 3 +#define OP_INC 4 +#define OP_PCREL 5 +#define OP_MEM 6 +#define OP_CCR 7 +#define OP_IMM 8 +#define OP_ABS 10 +#define h8_opcodes ops +#define DEFINE_TABLE +#include "opcode/h8300.h" + +#include "inst.h" + +/* The rate at which to call the host's poll_quit callback. */ + +#define POLL_QUIT_INTERVAL 0x80000 + +#define LOW_BYTE(x) ((x) & 0xff) +#define HIGH_BYTE(x) (((x)>>8) & 0xff) +#define P(X,Y) ((X<<8) | Y) + +#define BUILDSR() cpu.ccr = (N << 3) | (Z << 2) | (V<<1) | C; + +#define GETSR() \ + c = (cpu.ccr >> 0) & 1;\ + v = (cpu.ccr >> 1) & 1;\ + nz = !((cpu.ccr >> 2) & 1);\ + n = (cpu.ccr >> 3) & 1; + +#ifdef __CHAR_IS_SIGNED__ +#define SEXTCHAR(x) ((char)(x)) +#endif + +#ifndef SEXTCHAR +#define SEXTCHAR(x) ((x & 0x80) ? (x | ~0xff): x & 0xff) +#endif + +#define UEXTCHAR(x) ((x) & 0xff) +#define UEXTSHORT(x) ((x) & 0xffff) +#define SEXTSHORT(x) ((short)(x)) + +static cpu_state_type cpu; + +int h8300hmode = 0; +int h8300smode = 0; + +static int memory_size; + + +static int +get_now () +{ +#ifndef WIN32 + return time (0); +#endif + return 0; +} + +static int +now_persec () +{ + return 1; +} + + +static int +bitfrom (x) +{ + switch (x & SIZE) + { + case L_8: + return SB; + case L_16: + return SW; + case L_32: + return SL; + case L_P: + return h8300hmode ? SL : SW; + } +} + +static +unsigned int +lvalue (x, rn) +{ + switch (x / 4) + { + case OP_DISP: + if (rn == 8) + { + return X (OP_IMM, SP); + } + return X (OP_REG, SP); + + case OP_MEM: + + return X (OP_MEM, SP); + default: + abort (); + } +} + +static unsigned int +decode (addr, data, dst) + int addr; + unsigned char *data; + decoded_inst *dst; + +{ + int rs = 0; + int rd = 0; + int rdisp = 0; + int abs = 0; + int plen = 0; + int bit = 0; + + struct h8_opcode *q = h8_opcodes; + int size = 0; + dst->dst.type = -1; + dst->src.type = -1; + /* Find the exact opcode/arg combo */ + while (q->name) + { + op_type *nib; + unsigned int len = 0; + + nib = q->data.nib; + + while (1) + { + op_type looking_for = *nib; + int thisnib = data[len >> 1]; + + thisnib = (len & 1) ? (thisnib & 0xf) : ((thisnib >> 4) & 0xf); + + if (looking_for < 16 && looking_for >= 0) + { + if (looking_for != thisnib) + goto fail; + } + else + { + if ((int) looking_for & (int) B31) + { + if (!(((int) thisnib & 0x8) != 0)) + goto fail; + looking_for = (op_type) ((int) looking_for & ~(int) + B31); + thisnib &= 0x7; + } + if ((int) looking_for & (int) B30) + { + if (!(((int) thisnib & 0x8) == 0)) + goto fail; + looking_for = (op_type) ((int) looking_for & ~(int) B30); + } + if (looking_for & DBIT) + { + if ((looking_for & 5) != (thisnib & 5)) + goto fail; + abs = (thisnib & 0x8) ? 2 : 1; + } + else if (looking_for & (REG | IND | INC | DEC)) + { + if (looking_for & REG) + { + /* + * Can work out size from the + * register + */ + size = bitfrom (looking_for); + } + if (looking_for & SRC) + { + rs = thisnib; + } + else + { + rd = thisnib; + } + } + else if (looking_for & L_16) + { + abs = (data[len >> 1]) * 256 + data[(len + 2) >> 1]; + plen = 16; + if (looking_for & (PCREL | DISP)) + { + abs = (short) (abs); + } + } + else if (looking_for & ABSJMP) + { + abs = + (data[1] << 16) + | (data[2] << 8) + | (data[3]); + } + else if (looking_for & MEMIND) + { + abs = data[1]; + } + else if (looking_for & L_32) + { + int i = len >> 1; + abs = (data[i] << 24) + | (data[i + 1] << 16) + | (data[i + 2] << 8) + | (data[i + 3]); + + plen = 32; + } + else if (looking_for & L_24) + { + int i = len >> 1; + abs = (data[i] << 16) | (data[i + 1] << 8) | (data[i + 2]); + plen = 24; + } + else if (looking_for & IGNORE) + { + /* nothing to do */ + } + else if (looking_for & DISPREG) + { + rdisp = thisnib & 0x7; + } + else if (looking_for & KBIT) + { + switch (thisnib) + { + case 9: + abs = 4; + break; + case 8: + abs = 2; + break; + case 0: + abs = 1; + break; + } + } + else if (looking_for & L_8) + { + plen = 8; + + if (looking_for & PCREL) + { + abs = SEXTCHAR (data[len >> 1]); + } + else if (looking_for & ABS8MEM) + { + plen = 8; + abs = h8300hmode ? ~0xff0000ff : ~0xffff00ff; + abs |= data[len >> 1] & 0xff ; + } + else + { + abs = data[len >> 1] & 0xff; + } + } + else if (looking_for & L_3) + { + plen = 3; + + bit = thisnib; + } + else if (looking_for == E) + { + dst->op = q; + + /* Fill in the args */ + { + op_type *args = q->args.nib; + int hadone = 0; + + while (*args != E) + { + int x = *args; + int rn = (x & DST) ? rd : rs; + ea_type *p; + + if (x & DST) + { + p = &(dst->dst); + } + else + { + p = &(dst->src); + } + + if (x & (L_3)) + { + p->type = X (OP_IMM, size); + p->literal = bit; + } + else if (x & (IMM | KBIT | DBIT)) + { + p->type = X (OP_IMM, size); + p->literal = abs; + } + else if (x & REG) + { + /* Reset the size, some + ops (like mul) have two sizes */ + + size = bitfrom (x); + p->type = X (OP_REG, size); + p->reg = rn; + } + else if (x & INC) + { + p->type = X (OP_INC, size); + p->reg = rn & 0x7; + } + else if (x & DEC) + { + p->type = X (OP_DEC, size); + p->reg = rn & 0x7; + } + else if (x & IND) + { + p->type = X (OP_DISP, size); + p->reg = rn & 0x7; + p->literal = 0; + } + else if (x & (ABS | ABSJMP | ABS8MEM)) + { + p->type = X (OP_DISP, size); + p->literal = abs; + p->reg = 8; + } + else if (x & MEMIND) + { + p->type = X (OP_MEM, size); + p->literal = abs; + } + else if (x & PCREL) + { + p->type = X (OP_PCREL, size); + p->literal = abs + addr + 2; + if (x & L_16) + p->literal += 2; + } + else if (x & ABSJMP) + { + p->type = X (OP_IMM, SP); + p->literal = abs; + } + else if (x & DISP) + { + p->type = X (OP_DISP, size); + p->literal = abs; + p->reg = rdisp & 0x7; + } + else if (x & CCR) + { + p->type = OP_CCR; + } + else + printf ("Hmmmm %x", x); + + args++; + } + } + + /* + * But a jmp or a jsr gets + * automagically lvalued, since we + * branch to their address not their + * contents + */ + if (q->how == O (O_JSR, SB) + || q->how == O (O_JMP, SB)) + { + dst->src.type = lvalue (dst->src.type, dst->src.reg); + } + + if (dst->dst.type == -1) + dst->dst = dst->src; + + dst->opcode = q->how; + dst->cycles = q->time; + + /* And a jsr to 0xc4 is turned into a magic trap */ + + if (dst->opcode == O (O_JSR, SB)) + { + if (dst->src.literal == 0xc4) + { + dst->opcode = O (O_SYSCALL, SB); + } + } + + dst->next_pc = addr + len / 2; + return; + } + else + { + printf ("Dont understand %x \n", looking_for); + } + } + + len++; + nib++; + } + + fail: + q++; + } + + dst->opcode = O (O_ILL, SB); +} + + +static void +compile (pc) +{ + int idx; + + /* find the next cache entry to use */ + + idx = cpu.cache_top + 1; + cpu.compiles++; + if (idx >= cpu.csize) + { + idx = 1; + } + cpu.cache_top = idx; + + /* Throw away its old meaning */ + cpu.cache_idx[cpu.cache[idx].oldpc] = 0; + + /* set to new address */ + cpu.cache[idx].oldpc = pc; + + /* fill in instruction info */ + decode (pc, cpu.memory + pc, cpu.cache + idx); + + /* point to new cache entry */ + cpu.cache_idx[pc] = idx; +} + + +static unsigned char *breg[18]; +static unsigned short *wreg[18]; +static unsigned int *lreg[18]; + +#define GET_B_REG(x) *(breg[x]) +#define SET_B_REG(x,y) (*(breg[x])) = (y) +#define GET_W_REG(x) *(wreg[x]) +#define SET_W_REG(x,y) (*(wreg[x])) = (y) + +#define GET_L_REG(x) *(lreg[x]) +#define SET_L_REG(x,y) (*(lreg[x])) = (y) + +#define GET_MEMORY_L(x) \ + (x < memory_size \ + ? ((cpu.memory[x+0] << 24) | (cpu.memory[x+1] << 16) \ + | (cpu.memory[x+2] << 8) | cpu.memory[x+3]) \ + : ((cpu.eightbit[(x+0) & 0xff] << 24) | (cpu.eightbit[(x+1) & 0xff] << 16) \ + | (cpu.eightbit[(x+2) & 0xff] << 8) | cpu.eightbit[(x+3) & 0xff])) + +#define GET_MEMORY_W(x) \ + (x < memory_size \ + ? ((cpu.memory[x+0] << 8) | (cpu.memory[x+1] << 0)) \ + : ((cpu.eightbit[(x+0) & 0xff] << 8) | (cpu.eightbit[(x+1) & 0xff] << 0))) + + +#define GET_MEMORY_B(x) \ + (x < memory_size ? (cpu.memory[x]) : (cpu.eightbit[x & 0xff])) + +#define SET_MEMORY_L(x,y) \ +{ register unsigned char *_p; register int __y = y; \ + _p = (x < memory_size ? cpu.memory+x : cpu.eightbit + (x & 0xff)); \ + _p[0] = (__y)>>24; _p[1] = (__y)>>16; \ + _p[2] = (__y)>>8; _p[3] = (__y)>>0;} + +#define SET_MEMORY_W(x,y) \ +{ register unsigned char *_p; register int __y = y; \ + _p = (x < memory_size ? cpu.memory+x : cpu.eightbit + (x & 0xff)); \ + _p[0] = (__y)>>8; _p[1] =(__y);} + +#define SET_MEMORY_B(x,y) \ + (x < memory_size ? (cpu.memory[(x)] = y) : (cpu.eightbit[x & 0xff] = y)) + +int +fetch (arg, n) + ea_type *arg; +{ + int rn = arg->reg; + int abs = arg->literal; + int r; + int t; + + switch (arg->type) + { + case X (OP_REG, SB): + return GET_B_REG (rn); + case X (OP_REG, SW): + return GET_W_REG (rn); + case X (OP_REG, SL): + return GET_L_REG (rn); + case X (OP_IMM, SB): + case X (OP_IMM, SW): + case X (OP_IMM, SL): + return abs; + case X (OP_DEC, SB): + abort (); + + case X (OP_INC, SB): + t = GET_L_REG (rn); + t &= cpu.mask; + r = GET_MEMORY_B (t); + t++; + t = t & cpu.mask; + SET_L_REG (rn, t); + return r; + break; + case X (OP_INC, SW): + t = GET_L_REG (rn); + t &= cpu.mask; + r = GET_MEMORY_W (t); + t += 2; + t = t & cpu.mask; + SET_L_REG (rn, t); + return r; + case X (OP_INC, SL): + t = GET_L_REG (rn); + t &= cpu.mask; + r = GET_MEMORY_L (t); + + t += 4; + t = t & cpu.mask; + SET_L_REG (rn, t); + return r; + + case X (OP_DISP, SB): + t = GET_L_REG (rn) + abs; + t &= cpu.mask; + return GET_MEMORY_B (t); + + case X (OP_DISP, SW): + t = GET_L_REG (rn) + abs; + t &= cpu.mask; + return GET_MEMORY_W (t); + + case X (OP_DISP, SL): + t = GET_L_REG (rn) + abs; + t &= cpu.mask; + return GET_MEMORY_L (t); + + case X (OP_MEM, SL): + t = GET_MEMORY_L (abs); + t &= cpu.mask; + return t; + + case X (OP_MEM, SW): + t = GET_MEMORY_W (abs); + t &= cpu.mask; + return t; + + default: + abort (); + + } +} + + +static +void +store (arg, n) + ea_type *arg; + int n; +{ + int rn = arg->reg; + int abs = arg->literal; + int t; + + switch (arg->type) + { + case X (OP_REG, SB): + SET_B_REG (rn, n); + break; + case X (OP_REG, SW): + SET_W_REG (rn, n); + break; + case X (OP_REG, SL): + SET_L_REG (rn, n); + break; + + case X (OP_DEC, SB): + t = GET_L_REG (rn) - 1; + t &= cpu.mask; + SET_L_REG (rn, t); + SET_MEMORY_B (t, n); + + break; + case X (OP_DEC, SW): + t = (GET_L_REG (rn) - 2) & cpu.mask; + SET_L_REG (rn, t); + SET_MEMORY_W (t, n); + break; + + case X (OP_DEC, SL): + t = (GET_L_REG (rn) - 4) & cpu.mask; + SET_L_REG (rn, t); + SET_MEMORY_L (t, n); + break; + + case X (OP_DISP, SB): + t = GET_L_REG (rn) + abs; + t &= cpu.mask; + SET_MEMORY_B (t, n); + break; + + case X (OP_DISP, SW): + t = GET_L_REG (rn) + abs; + t &= cpu.mask; + SET_MEMORY_W (t, n); + break; + + case X (OP_DISP, SL): + t = GET_L_REG (rn) + abs; + t &= cpu.mask; + SET_MEMORY_L (t, n); + break; + default: + abort (); + } +} + + +static union +{ + short int i; + struct + { + char low; + char high; + } + u; +} + +littleendian; + +static +void +init_pointers () +{ + static int init; + + if (!init) + { + int i; + + init = 1; + littleendian.i = 1; + + if (h8300hmode) + memory_size = H8300H_MSIZE; + else + memory_size = H8300_MSIZE; + cpu.memory = (unsigned char *) calloc (sizeof (char), memory_size); + cpu.cache_idx = (unsigned short *) calloc (sizeof (short), memory_size); + cpu.eightbit = (unsigned char *) calloc (sizeof (char), 256); + + /* `msize' must be a power of two */ + if ((memory_size & (memory_size - 1)) != 0) + abort (); + cpu.mask = memory_size - 1; + + for (i = 0; i < 9; i++) + { + cpu.regs[i] = 0; + } + + for (i = 0; i < 8; i++) + { + unsigned char *p = (unsigned char *) (cpu.regs + i); + unsigned char *e = (unsigned char *) (cpu.regs + i + 1); + unsigned short *q = (unsigned short *) (cpu.regs + i); + unsigned short *u = (unsigned short *) (cpu.regs + i + 1); + cpu.regs[i] = 0x00112233; + while (p < e) + { + if (*p == 0x22) + { + breg[i] = p; + } + if (*p == 0x33) + { + breg[i + 8] = p; + } + p++; + } + while (q < u) + { + if (*q == 0x2233) + { + wreg[i] = q; + } + if (*q == 0x0011) + { + wreg[i + 8] = q; + } + q++; + } + cpu.regs[i] = 0; + lreg[i] = &cpu.regs[i]; + } + + lreg[8] = &cpu.regs[8]; + + /* initialize the seg registers */ + if (!cpu.cache) + sim_set_simcache_size (CSIZE); + } +} + +static void +control_c (sig, code, scp, addr) + int sig; + int code; + char *scp; + char *addr; +{ + cpu.state = SIM_STATE_STOPPED; + cpu.exception = SIGINT; +} + +#define C (c != 0) +#define Z (nz == 0) +#define V (v != 0) +#define N (n != 0) + +static int +mop (code, bsize, sign) + decoded_inst *code; + int bsize; + int sign; +{ + int multiplier; + int multiplicand; + int result; + int n, nz; + + if (sign) + { + multiplicand = + bsize ? SEXTCHAR (GET_W_REG (code->dst.reg)) : + SEXTSHORT (GET_W_REG (code->dst.reg)); + multiplier = + bsize ? SEXTCHAR (GET_B_REG (code->src.reg)) : + SEXTSHORT (GET_W_REG (code->src.reg)); + } + else + { + multiplicand = bsize ? UEXTCHAR (GET_W_REG (code->dst.reg)) : + UEXTSHORT (GET_W_REG (code->dst.reg)); + multiplier = + bsize ? UEXTCHAR (GET_B_REG (code->src.reg)) : + UEXTSHORT (GET_W_REG (code->src.reg)); + + } + result = multiplier * multiplicand; + + if (sign) + { + n = result & (bsize ? 0x8000 : 0x80000000); + nz = result & (bsize ? 0xffff : 0xffffffff); + } + if (bsize) + { + SET_W_REG (code->dst.reg, result); + } + else + { + SET_L_REG (code->dst.reg, result); + } +/* return ((n==1) << 1) | (nz==1); */ + +} + +#define ONOT(name, how) \ +case O(name, SB): \ +{ \ + int t; \ + int hm = 0x80; \ + rd = GET_B_REG (code->src.reg); \ + how; \ + goto shift8; \ +} \ +case O(name, SW): \ +{ \ + int t; \ + int hm = 0x8000; \ + rd = GET_W_REG (code->src.reg); \ + how; \ + goto shift16; \ +} \ +case O(name, SL): \ +{ \ + int t; \ + int hm = 0x80000000; \ + rd = GET_L_REG (code->src.reg); \ + how; \ + goto shift32; \ +} + +#define OSHIFTS(name, how1, how2) \ +case O(name, SB): \ +{ \ + int t; \ + int hm = 0x80; \ + rd = GET_B_REG (code->src.reg); \ + if ((GET_MEMORY_B (pc + 1) & 0x40) == 0) \ + { \ + how1; \ + } \ + else \ + { \ + how2; \ + } \ + goto shift8; \ +} \ +case O(name, SW): \ +{ \ + int t; \ + int hm = 0x8000; \ + rd = GET_W_REG (code->src.reg); \ + if ((GET_MEMORY_B (pc + 1) & 0x40) == 0) \ + { \ + how1; \ + } \ + else \ + { \ + how2; \ + } \ + goto shift16; \ +} \ +case O(name, SL): \ +{ \ + int t; \ + int hm = 0x80000000; \ + rd = GET_L_REG (code->src.reg); \ + if ((GET_MEMORY_B (pc + 1) & 0x40) == 0) \ + { \ + how1; \ + } \ + else \ + { \ + how2; \ + } \ + goto shift32; \ +} + +#define OBITOP(name,f, s, op) \ +case O(name, SB): \ +{ \ + int m; \ + int b; \ + if (f) ea = fetch (&code->dst); \ + m=1<< fetch(&code->src); \ + op; \ + if(s) store (&code->dst,ea); goto next; \ +} + +int +sim_stop (sd) + SIM_DESC sd; +{ + cpu.state = SIM_STATE_STOPPED; + cpu.exception = SIGINT; + return 1; +} + +void +sim_resume (sd, step, siggnal) + SIM_DESC sd; +{ + static int init1; + int cycles = 0; + int insts = 0; + int tick_start = get_now (); + void (*prev) (); + int poll_count = 0; + int res; + int tmp; + int rd; + int ea; + int bit; + int pc; + int c, nz, v, n; + int oldmask; + init_pointers (); + + prev = signal (SIGINT, control_c); + + if (step) + { + cpu.state = SIM_STATE_STOPPED; + cpu.exception = SIGTRAP; + } + else + { + cpu.state = SIM_STATE_RUNNING; + cpu.exception = 0; + } + + pc = cpu.pc; + + /* The PC should never be odd. */ + if (pc & 0x1) + abort (); + + GETSR (); + oldmask = cpu.mask; + if (!h8300hmode) + cpu.mask = 0xffff; + do + { + int cidx; + decoded_inst *code; + + top: + cidx = cpu.cache_idx[pc]; + code = cpu.cache + cidx; + + +#define ALUOP(STORE, NAME, HOW) \ + case O(NAME,SB): HOW; if(STORE)goto alu8;else goto just_flags_alu8; \ + case O(NAME, SW): HOW; if(STORE)goto alu16;else goto just_flags_alu16; \ + case O(NAME,SL): HOW; if(STORE)goto alu32;else goto just_flags_alu32; + + +#define LOGOP(NAME, HOW) \ + case O(NAME,SB): HOW; goto log8;\ + case O(NAME, SW): HOW; goto log16;\ + case O(NAME,SL): HOW; goto log32; + + + +#if ADEBUG + if (debug) + { + printf ("%x %d %s\n", pc, code->opcode, + code->op ? code->op->name : "**"); + } + cpu.stats[code->opcode]++; + +#endif + + cycles += code->cycles; + insts++; + switch (code->opcode) + { + case 0: + /* + * This opcode is a fake for when we get to an + * instruction which hasnt been compiled + */ + compile (pc); + goto top; + break; + + + case O (O_SUBX, SB): + rd = fetch (&code->dst); + ea = fetch (&code->src); + ea = -(ea + C); + res = rd + ea; + goto alu8; + + case O (O_ADDX, SB): + rd = fetch (&code->dst); + ea = fetch (&code->src); + ea = C + ea; + res = rd + ea; + goto alu8; + +#define EA ea = fetch(&code->src); +#define RD_EA ea = fetch(&code->src); rd = fetch(&code->dst); + + ALUOP (1, O_SUB, RD_EA; + ea = -ea; + res = rd + ea); + ALUOP (1, O_NEG, EA; + ea = -ea; + rd = 0; + res = rd + ea); + + case O (O_ADD, SB): + rd = GET_B_REG (code->dst.reg); + ea = fetch (&code->src); + res = rd + ea; + goto alu8; + case O (O_ADD, SW): + rd = GET_W_REG (code->dst.reg); + ea = fetch (&code->src); + res = rd + ea; + goto alu16; + case O (O_ADD, SL): + rd = GET_L_REG (code->dst.reg); + ea = fetch (&code->src); + res = rd + ea; + goto alu32; + + + LOGOP (O_AND, RD_EA; + res = rd & ea); + + LOGOP (O_OR, RD_EA; + res = rd | ea); + + LOGOP (O_XOR, RD_EA; + res = rd ^ ea); + + + case O (O_MOV_TO_MEM, SB): + res = GET_B_REG (code->src.reg); + goto log8; + case O (O_MOV_TO_MEM, SW): + res = GET_W_REG (code->src.reg); + goto log16; + case O (O_MOV_TO_MEM, SL): + res = GET_L_REG (code->src.reg); + goto log32; + + + case O (O_MOV_TO_REG, SB): + res = fetch (&code->src); + SET_B_REG (code->dst.reg, res); + goto just_flags_log8; + case O (O_MOV_TO_REG, SW): + res = fetch (&code->src); + SET_W_REG (code->dst.reg, res); + goto just_flags_log16; + case O (O_MOV_TO_REG, SL): + res = fetch (&code->src); + SET_L_REG (code->dst.reg, res); + goto just_flags_log32; + + + case O (O_ADDS, SL): + SET_L_REG (code->dst.reg, + GET_L_REG (code->dst.reg) + + code->src.literal); + + goto next; + + case O (O_SUBS, SL): + SET_L_REG (code->dst.reg, + GET_L_REG (code->dst.reg) + - code->src.literal); + goto next; + + case O (O_CMP, SB): + rd = fetch (&code->dst); + ea = fetch (&code->src); + ea = -ea; + res = rd + ea; + goto just_flags_alu8; + + case O (O_CMP, SW): + rd = fetch (&code->dst); + ea = fetch (&code->src); + ea = -ea; + res = rd + ea; + goto just_flags_alu16; + + case O (O_CMP, SL): + rd = fetch (&code->dst); + ea = fetch (&code->src); + ea = -ea; + res = rd + ea; + goto just_flags_alu32; + + + case O (O_DEC, SB): + rd = GET_B_REG (code->src.reg); + ea = -1; + res = rd + ea; + SET_B_REG (code->src.reg, res); + goto just_flags_inc8; + + case O (O_DEC, SW): + rd = GET_W_REG (code->dst.reg); + ea = -code->src.literal; + res = rd + ea; + SET_W_REG (code->dst.reg, res); + goto just_flags_inc16; + + case O (O_DEC, SL): + rd = GET_L_REG (code->dst.reg); + ea = -code->src.literal; + res = rd + ea; + SET_L_REG (code->dst.reg, res); + goto just_flags_inc32; + + + case O (O_INC, SB): + rd = GET_B_REG (code->src.reg); + ea = 1; + res = rd + ea; + SET_B_REG (code->src.reg, res); + goto just_flags_inc8; + + case O (O_INC, SW): + rd = GET_W_REG (code->dst.reg); + ea = code->src.literal; + res = rd + ea; + SET_W_REG (code->dst.reg, res); + goto just_flags_inc16; + + case O (O_INC, SL): + rd = GET_L_REG (code->dst.reg); + ea = code->src.literal; + res = rd + ea; + SET_L_REG (code->dst.reg, res); + goto just_flags_inc32; + + +#define GET_CCR(x) BUILDSR();x = cpu.ccr + + case O (O_ANDC, SB): + GET_CCR (rd); + ea = code->src.literal; + res = rd & ea; + goto setc; + + case O (O_ORC, SB): + GET_CCR (rd); + ea = code->src.literal; + res = rd | ea; + goto setc; + + case O (O_XORC, SB): + GET_CCR (rd); + ea = code->src.literal; + res = rd ^ ea; + goto setc; + + + case O (O_BRA, SB): + if (1) + goto condtrue; + goto next; + + case O (O_BRN, SB): + if (0) + goto condtrue; + goto next; + + case O (O_BHI, SB): + if ((C || Z) == 0) + goto condtrue; + goto next; + + + case O (O_BLS, SB): + if ((C || Z)) + goto condtrue; + goto next; + + case O (O_BCS, SB): + if ((C == 1)) + goto condtrue; + goto next; + + case O (O_BCC, SB): + if ((C == 0)) + goto condtrue; + goto next; + + case O (O_BEQ, SB): + if (Z) + goto condtrue; + goto next; + case O (O_BGT, SB): + if (((Z || (N ^ V)) == 0)) + goto condtrue; + goto next; + + + case O (O_BLE, SB): + if (((Z || (N ^ V)) == 1)) + goto condtrue; + goto next; + + case O (O_BGE, SB): + if ((N ^ V) == 0) + goto condtrue; + goto next; + case O (O_BLT, SB): + if ((N ^ V)) + goto condtrue; + goto next; + case O (O_BMI, SB): + if ((N)) + goto condtrue; + goto next; + case O (O_BNE, SB): + if ((Z == 0)) + goto condtrue; + goto next; + + case O (O_BPL, SB): + if (N == 0) + goto condtrue; + goto next; + case O (O_BVC, SB): + if ((V == 0)) + goto condtrue; + goto next; + case O (O_BVS, SB): + if ((V == 1)) + goto condtrue; + goto next; + + case O (O_SYSCALL, SB): + { + char c = cpu.regs[2]; + sim_callback->write_stdout (sim_callback, &c, 1); + } + goto next; + + ONOT (O_NOT, rd = ~rd; v = 0;); + OSHIFTS (O_SHLL, + c = rd & hm; v = 0; rd <<= 1, + c = rd & (hm >> 1); v = 0; rd <<= 2); + OSHIFTS (O_SHLR, + c = rd & 1; v = 0; rd = (unsigned int) rd >> 1, + c = rd & 2; v = 0; rd = (unsigned int) rd >> 2); + OSHIFTS (O_SHAL, + c = rd & hm; v = (rd & hm) != ((rd & (hm >> 1)) << 1); rd <<= 1, + c = rd & (hm >> 1); v = (rd & (hm >> 1)) != ((rd & (hm >> 2)) << 2); rd <<= 2); + OSHIFTS (O_SHAR, + t = rd & hm; c = rd & 1; v = 0; rd >>= 1; rd |= t, + t = rd & hm; c = rd & 2; v = 0; rd >>= 2; rd |= t | t >> 1 ); + OSHIFTS (O_ROTL, + c = rd & hm; v = 0; rd <<= 1; rd |= C, + c = rd & hm; v = 0; rd <<= 1; rd |= C; c = rd & hm; rd <<= 1; rd |= C); + OSHIFTS (O_ROTR, + c = rd & 1; v = 0; rd = (unsigned int) rd >> 1; if (c) rd |= hm, + c = rd & 1; v = 0; rd = (unsigned int) rd >> 1; if (c) rd |= hm; c = rd & 1; rd = (unsigned int) rd >> 1; if (c) rd |= hm); + OSHIFTS (O_ROTXL, + t = rd & hm; rd <<= 1; rd |= C; c = t; v = 0, + t = rd & hm; rd <<= 1; rd |= C; c = t; v = 0; t = rd & hm; rd <<= 1; rd |= C; c = t); + OSHIFTS (O_ROTXR, + t = rd & 1; rd = (unsigned int) rd >> 1; if (C) rd |= hm; c = t; v = 0, + t = rd & 1; rd = (unsigned int) rd >> 1; if (C) rd |= hm; c = t; v = 0; t = rd & 1; rd = (unsigned int) rd >> 1; if (C) rd |= hm; c = t); + + case O (O_JMP, SB): + { + pc = fetch (&code->src); + goto end; + + } + + case O (O_JSR, SB): + { + int tmp; + pc = fetch (&code->src); + call: + tmp = cpu.regs[7]; + + if (h8300hmode) + { + tmp -= 4; + SET_MEMORY_L (tmp, code->next_pc); + } + else + { + tmp -= 2; + SET_MEMORY_W (tmp, code->next_pc); + } + cpu.regs[7] = tmp; + + goto end; + } + case O (O_BSR, SB): + pc = code->src.literal; + goto call; + + case O (O_RTS, SN): + { + int tmp; + + tmp = cpu.regs[7]; + + if (h8300hmode) + { + pc = GET_MEMORY_L (tmp); + tmp += 4; + } + else + { + pc = GET_MEMORY_W (tmp); + tmp += 2; + } + + cpu.regs[7] = tmp; + goto end; + } + + case O (O_ILL, SB): + cpu.state = SIM_STATE_STOPPED; + cpu.exception = SIGILL; + goto end; + case O (O_SLEEP, SN): + /* The format of r0 is defined by devo/include/wait.h. */ +#if 0 /* FIXME: Ugh. A breakpoint is the sleep insn. */ + if (WIFEXITED (cpu.regs[0])) + { + cpu.state = SIM_STATE_EXITED; + cpu.exception = WEXITSTATUS (cpu.regs[0]); + } + else if (WIFSTOPPED (cpu.regs[0])) + { + cpu.state = SIM_STATE_STOPPED; + cpu.exception = WSTOPSIG (cpu.regs[0]); + } + else + { + cpu.state = SIM_STATE_SIGNALLED; + cpu.exception = WTERMSIG (cpu.regs[0]); + } +#else + /* FIXME: Doesn't this break for breakpoints when r0 + contains just the right (er, wrong) value? */ + cpu.state = SIM_STATE_STOPPED; + if (! WIFEXITED (cpu.regs[0]) && WIFSIGNALED (cpu.regs[0])) + cpu.exception = SIGILL; + else + cpu.exception = SIGTRAP; +#endif + goto end; + case O (O_BPT, SN): + cpu.state = SIM_STATE_STOPPED; + cpu.exception = SIGTRAP; + goto end; + + OBITOP (O_BNOT, 1, 1, ea ^= m); + OBITOP (O_BTST, 1, 0, nz = ea & m); + OBITOP (O_BCLR, 1, 1, ea &= ~m); + OBITOP (O_BSET, 1, 1, ea |= m); + OBITOP (O_BLD, 1, 0, c = ea & m); + OBITOP (O_BILD, 1, 0, c = !(ea & m)); + OBITOP (O_BST, 1, 1, ea &= ~m; + if (C) ea |= m); + OBITOP (O_BIST, 1, 1, ea &= ~m; + if (!C) ea |= m); + OBITOP (O_BAND, 1, 0, c = (ea & m) && C); + OBITOP (O_BIAND, 1, 0, c = !(ea & m) && C); + OBITOP (O_BOR, 1, 0, c = (ea & m) || C); + OBITOP (O_BIOR, 1, 0, c = !(ea & m) || C); + OBITOP (O_BXOR, 1, 0, c = (ea & m) != C); + OBITOP (O_BIXOR, 1, 0, c = !(ea & m) != C); + + +#define MOP(bsize, signed) mop(code, bsize,signed); goto next; + + case O (O_MULS, SB): + MOP (1, 1); + break; + case O (O_MULS, SW): + MOP (0, 1); + break; + case O (O_MULU, SB): + MOP (1, 0); + break; + case O (O_MULU, SW): + MOP (0, 0); + break; + + + case O (O_DIVU, SB): + { + rd = GET_W_REG (code->dst.reg); + ea = GET_B_REG (code->src.reg); + if (ea) + { + tmp = (unsigned)rd % ea; + rd = (unsigned)rd / ea; + } + SET_W_REG (code->dst.reg, (rd & 0xff) | (tmp << 8)); + n = ea & 0x80; + nz = ea & 0xff; + + goto next; + } + case O (O_DIVU, SW): + { + rd = GET_L_REG (code->dst.reg); + ea = GET_W_REG (code->src.reg); + n = ea & 0x8000; + nz = ea & 0xffff; + if (ea) + { + tmp = (unsigned)rd % ea; + rd = (unsigned)rd / ea; + } + SET_L_REG (code->dst.reg, (rd & 0xffff) | (tmp << 16)); + goto next; + } + + case O (O_DIVS, SB): + { + + rd = SEXTSHORT (GET_W_REG (code->dst.reg)); + ea = SEXTCHAR (GET_B_REG (code->src.reg)); + if (ea) + { + tmp = (int) rd % (int) ea; + rd = (int) rd / (int) ea; + n = rd & 0x8000; + nz = 1; + } + else + nz = 0; + SET_W_REG (code->dst.reg, (rd & 0xff) | (tmp << 8)); + goto next; + } + case O (O_DIVS, SW): + { + rd = GET_L_REG (code->dst.reg); + ea = SEXTSHORT (GET_W_REG (code->src.reg)); + if (ea) + { + tmp = (int) rd % (int) ea; + rd = (int) rd / (int) ea; + n = rd & 0x80000000; + nz = 1; + } + else + nz = 0; + SET_L_REG (code->dst.reg, (rd & 0xffff) | (tmp << 16)); + goto next; + } + case O (O_EXTS, SW): + rd = GET_B_REG (code->src.reg + 8) & 0xff; /* Yes, src, not dst. */ + ea = rd & 0x80 ? -256 : 0; + res = rd + ea; + goto log16; + case O (O_EXTS, SL): + rd = GET_W_REG (code->src.reg) & 0xffff; + ea = rd & 0x8000 ? -65536 : 0; + res = rd + ea; + goto log32; + case O (O_EXTU, SW): + rd = GET_B_REG (code->src.reg + 8) & 0xff; + ea = 0; + res = rd + ea; + goto log16; + case O (O_EXTU, SL): + rd = GET_W_REG (code->src.reg) & 0xffff; + ea = 0; + res = rd + ea; + goto log32; + + case O (O_NOP, SN): + goto next; + + case O (O_STM, SL): + { + int nregs, firstreg, i; + + nregs = GET_MEMORY_B (pc + 1); + nregs >>= 4; + nregs &= 0xf; + firstreg = GET_MEMORY_B (pc + 3); + firstreg &= 0xf; + for (i = firstreg; i <= firstreg + nregs; i++) + { + cpu.regs[7] -= 4; + SET_MEMORY_L (cpu.regs[7], cpu.regs[i]); + } + } + goto next; + + case O (O_LDM, SL): + { + int nregs, firstreg, i; + + nregs = GET_MEMORY_B (pc + 1); + nregs >>= 4; + nregs &= 0xf; + firstreg = GET_MEMORY_B (pc + 3); + firstreg &= 0xf; + for (i = firstreg; i >= firstreg - nregs; i--) + { + cpu.regs[i] = GET_MEMORY_L (cpu.regs[7]); + cpu.regs[7] += 4; + } + } + goto next; + + default: + cpu.state = SIM_STATE_STOPPED; + cpu.exception = SIGILL; + goto end; + + } + abort (); + + setc: + cpu.ccr = res; + GETSR (); + goto next; + + condtrue: + /* When a branch works */ + pc = code->src.literal; + goto end; + + /* Set the cond codes from res */ + bitop: + + /* Set the flags after an 8 bit inc/dec operation */ + just_flags_inc8: + n = res & 0x80; + nz = res & 0xff; + v = (rd & 0x7f) == 0x7f; + goto next; + + + /* Set the flags after an 16 bit inc/dec operation */ + just_flags_inc16: + n = res & 0x8000; + nz = res & 0xffff; + v = (rd & 0x7fff) == 0x7fff; + goto next; + + + /* Set the flags after an 32 bit inc/dec operation */ + just_flags_inc32: + n = res & 0x80000000; + nz = res & 0xffffffff; + v = (rd & 0x7fffffff) == 0x7fffffff; + goto next; + + + shift8: + /* Set flags after an 8 bit shift op, carry,overflow set in insn */ + n = (rd & 0x80); + nz = rd & 0xff; + SET_B_REG (code->src.reg, rd); + goto next; + + shift16: + /* Set flags after an 16 bit shift op, carry,overflow set in insn */ + n = (rd & 0x8000); + nz = rd & 0xffff; + SET_W_REG (code->src.reg, rd); + goto next; + + shift32: + /* Set flags after an 32 bit shift op, carry,overflow set in insn */ + n = (rd & 0x80000000); + nz = rd & 0xffffffff; + SET_L_REG (code->src.reg, rd); + goto next; + + log32: + store (&code->dst, res); + just_flags_log32: + /* flags after a 32bit logical operation */ + n = res & 0x80000000; + nz = res & 0xffffffff; + v = 0; + goto next; + + log16: + store (&code->dst, res); + just_flags_log16: + /* flags after a 16bit logical operation */ + n = res & 0x8000; + nz = res & 0xffff; + v = 0; + goto next; + + + log8: + store (&code->dst, res); + just_flags_log8: + n = res & 0x80; + nz = res & 0xff; + v = 0; + goto next; + + alu8: + SET_B_REG (code->dst.reg, res); + just_flags_alu8: + n = res & 0x80; + nz = res & 0xff; + c = (res & 0x100); + switch (code->opcode / 4) + { + case O_ADD: + v = ((rd & 0x80) == (ea & 0x80) + && (rd & 0x80) != (res & 0x80)); + break; + case O_SUB: + case O_CMP: + v = ((rd & 0x80) != (-ea & 0x80) + && (rd & 0x80) != (res & 0x80)); + break; + case O_NEG: + v = (rd == 0x80); + break; + } + goto next; + + alu16: + SET_W_REG (code->dst.reg, res); + just_flags_alu16: + n = res & 0x8000; + nz = res & 0xffff; + c = (res & 0x10000); + switch (code->opcode / 4) + { + case O_ADD: + v = ((rd & 0x8000) == (ea & 0x8000) + && (rd & 0x8000) != (res & 0x8000)); + break; + case O_SUB: + case O_CMP: + v = ((rd & 0x8000) != (-ea & 0x8000) + && (rd & 0x8000) != (res & 0x8000)); + break; + case O_NEG: + v = (rd == 0x8000); + break; + } + goto next; + + alu32: + SET_L_REG (code->dst.reg, res); + just_flags_alu32: + n = res & 0x80000000; + nz = res & 0xffffffff; + switch (code->opcode / 4) + { + case O_ADD: + v = ((rd & 0x80000000) == (ea & 0x80000000) + && (rd & 0x80000000) != (res & 0x80000000)); + c = ((unsigned) res < (unsigned) rd) || ((unsigned) res < (unsigned) ea); + break; + case O_SUB: + case O_CMP: + v = ((rd & 0x80000000) != (-ea & 0x80000000) + && (rd & 0x80000000) != (res & 0x80000000)); + c = (unsigned) rd < (unsigned) -ea; + break; + case O_NEG: + v = (rd == 0x80000000); + c = res != 0; + break; + } + goto next; + + next:; + pc = code->next_pc; + + end: + ; + /* if (cpu.regs[8] ) abort(); */ + + if (--poll_count < 0) + { + poll_count = POLL_QUIT_INTERVAL; + if ((*sim_callback->poll_quit) != NULL + && (*sim_callback->poll_quit) (sim_callback)) + sim_stop (sd); + } + + } + while (cpu.state == SIM_STATE_RUNNING); + cpu.ticks += get_now () - tick_start; + cpu.cycles += cycles; + cpu.insts += insts; + + cpu.pc = pc; + BUILDSR (); + cpu.mask = oldmask; + signal (SIGINT, prev); +} + +int +sim_trace (sd) + SIM_DESC sd; +{ + /* FIXME: unfinished */ + abort (); +} + +int +sim_write (sd, addr, buffer, size) + SIM_DESC sd; + SIM_ADDR addr; + unsigned char *buffer; + int size; +{ + int i; + + init_pointers (); + if (addr < 0) + return 0; + for (i = 0; i < size; i++) + { + if (addr < memory_size) + { + cpu.memory[addr + i] = buffer[i]; + cpu.cache_idx[addr + i] = 0; + } + else + cpu.eightbit[(addr + i) & 0xff] = buffer[i]; + } + return size; +} + +int +sim_read (sd, addr, buffer, size) + SIM_DESC sd; + SIM_ADDR addr; + unsigned char *buffer; + int size; +{ + init_pointers (); + if (addr < 0) + return 0; + if (addr < memory_size) + memcpy (buffer, cpu.memory + addr, size); + else + memcpy (buffer, cpu.eightbit + (addr & 0xff), size); + return size; +} + + +#define R0_REGNUM 0 +#define R1_REGNUM 1 +#define R2_REGNUM 2 +#define R3_REGNUM 3 +#define R4_REGNUM 4 +#define R5_REGNUM 5 +#define R6_REGNUM 6 +#define R7_REGNUM 7 + +#define SP_REGNUM R7_REGNUM /* Contains address of top of stack */ +#define FP_REGNUM R6_REGNUM /* Contains address of executing + * stack frame */ + +#define CCR_REGNUM 8 /* Contains processor status */ +#define PC_REGNUM 9 /* Contains program counter */ + +#define CYCLE_REGNUM 10 +#define INST_REGNUM 11 +#define TICK_REGNUM 12 + + +int +sim_store_register (sd, rn, value, length) + SIM_DESC sd; + int rn; + unsigned char *value; + int length; +{ + int longval; + int shortval; + int intval; + longval = (value[0] << 24) | (value[1] << 16) | (value[2] << 8) | value[3]; + shortval = (value[0] << 8) | (value[1]); + intval = h8300hmode ? longval : shortval; + + init_pointers (); + switch (rn) + { + case PC_REGNUM: + cpu.pc = intval; + break; + default: + abort (); + case R0_REGNUM: + case R1_REGNUM: + case R2_REGNUM: + case R3_REGNUM: + case R4_REGNUM: + case R5_REGNUM: + case R6_REGNUM: + case R7_REGNUM: + cpu.regs[rn] = intval; + break; + case CCR_REGNUM: + cpu.ccr = intval; + break; + case CYCLE_REGNUM: + cpu.cycles = longval; + break; + + case INST_REGNUM: + cpu.insts = longval; + break; + + case TICK_REGNUM: + cpu.ticks = longval; + break; + } + return -1; +} + +int +sim_fetch_register (sd, rn, buf, length) + SIM_DESC sd; + int rn; + unsigned char *buf; + int length; +{ + int v; + int longreg = 0; + + init_pointers (); + + switch (rn) + { + default: + abort (); + case 8: + v = cpu.ccr; + break; + case 9: + v = cpu.pc; + break; + case R0_REGNUM: + case R1_REGNUM: + case R2_REGNUM: + case R3_REGNUM: + case R4_REGNUM: + case R5_REGNUM: + case R6_REGNUM: + case R7_REGNUM: + v = cpu.regs[rn]; + break; + case 10: + v = cpu.cycles; + longreg = 1; + break; + case 11: + v = cpu.ticks; + longreg = 1; + break; + case 12: + v = cpu.insts; + longreg = 1; + break; + } + if (h8300hmode || longreg) + { + buf[0] = v >> 24; + buf[1] = v >> 16; + buf[2] = v >> 8; + buf[3] = v >> 0; + } + else + { + buf[0] = v >> 8; + buf[1] = v; + } + return -1; +} + +void +sim_stop_reason (sd, reason, sigrc) + SIM_DESC sd; + enum sim_stop *reason; + int *sigrc; +{ +#if 0 /* FIXME: This should work but we can't use it. + grep for SLEEP above. */ + switch (cpu.state) + { + case SIM_STATE_EXITED : *reason = sim_exited; break; + case SIM_STATE_SIGNALLED : *reason = sim_signalled; break; + case SIM_STATE_STOPPED : *reason = sim_stopped; break; + default : abort (); + } +#else + *reason = sim_stopped; +#endif + *sigrc = cpu.exception; +} + +/* FIXME: Rename to sim_set_mem_size. */ + +void +sim_size (n) + int n; +{ + /* Memory size is fixed. */ +} + +void +sim_set_simcache_size (n) +{ + if (cpu.cache) + free (cpu.cache); + if (n < 2) + n = 2; + cpu.cache = (decoded_inst *) malloc (sizeof (decoded_inst) * n); + memset (cpu.cache, 0, sizeof (decoded_inst) * n); + cpu.csize = n; +} + + +void +sim_info (sd, verbose) + SIM_DESC sd; + int verbose; +{ + double timetaken = (double) cpu.ticks / (double) now_persec (); + double virttime = cpu.cycles / 10.0e6; + + (*sim_callback->printf_filtered) (sim_callback, + "\n\n#instructions executed %10d\n", + cpu.insts); + (*sim_callback->printf_filtered) (sim_callback, + "#cycles (v approximate) %10d\n", + cpu.cycles); + (*sim_callback->printf_filtered) (sim_callback, + "#real time taken %10.4f\n", + timetaken); + (*sim_callback->printf_filtered) (sim_callback, + "#virtual time taked %10.4f\n", + virttime); + if (timetaken != 0.0) + (*sim_callback->printf_filtered) (sim_callback, + "#simulation ratio %10.4f\n", + virttime / timetaken); + (*sim_callback->printf_filtered) (sim_callback, + "#compiles %10d\n", + cpu.compiles); + (*sim_callback->printf_filtered) (sim_callback, + "#cache size %10d\n", + cpu.csize); + +#ifdef ADEBUG + /* This to be conditional on `what' (aka `verbose'), + however it was never passed as non-zero. */ + if (1) + { + int i; + for (i = 0; i < O_LAST; i++) + { + if (cpu.stats[i]) + (*sim_callback->printf_filtered) (sim_callback, + "%d: %d\n", i, cpu.stats[i]); + } + } +#endif +} + +/* Indicate whether the cpu is an h8/300 or h8/300h. + FLAG is non-zero for the h8/300h. */ + +void +set_h8300h (flag) + int flag; +{ + /* FIXME: Much of the code in sim_load can be moved to sim_open. + This function being replaced by a sim_open:ARGV configuration + option */ + h8300hmode = flag; +} + +SIM_DESC +sim_open (kind, ptr, abfd, argv) + SIM_OPEN_KIND kind; + struct host_callback_struct *ptr; + struct _bfd *abfd; + char **argv; +{ + /* FIXME: Much of the code in sim_load can be moved here */ + + sim_kind = kind; + myname = argv[0]; + sim_callback = ptr; + /* fudge our descriptor */ + return (SIM_DESC) 1; +} + +void +sim_close (sd, quitting) + SIM_DESC sd; + int quitting; +{ + /* nothing to do */ +} + +/* Called by gdb to load a program into memory. */ + +SIM_RC +sim_load (sd, prog, abfd, from_tty) + SIM_DESC sd; + char *prog; + bfd *abfd; + int from_tty; +{ + bfd *prog_bfd; + + /* FIXME: The code below that sets a specific variant of the h8/300 + being simulated should be moved to sim_open(). */ + + /* See if the file is for the h8/300 or h8/300h. */ + /* ??? This may not be the most efficient way. The z8k simulator + does this via a different mechanism (INIT_EXTRA_SYMTAB_INFO). */ + if (abfd != NULL) + prog_bfd = abfd; + else + prog_bfd = bfd_openr (prog, "coff-h8300"); + if (prog_bfd != NULL) + { + /* Set the cpu type. We ignore failure from bfd_check_format + and bfd_openr as sim_load_file checks too. */ + if (bfd_check_format (prog_bfd, bfd_object)) + { + unsigned long mach = bfd_get_mach (prog_bfd); + set_h8300h (mach == bfd_mach_h8300h + || mach == bfd_mach_h8300s); + } + } + + /* If we're using gdb attached to the simulator, then we have to + reallocate memory for the simulator. + + When gdb first starts, it calls fetch_registers (among other + functions), which in turn calls init_pointers, which allocates + simulator memory. + + The problem is when we do that, we don't know whether we're + debugging an h8/300 or h8/300h program. + + This is the first point at which we can make that determination, + so we just reallocate memory now; this will also allow us to handle + switching between h8/300 and h8/300h programs without exiting + gdb. */ + if (h8300hmode) + memory_size = H8300H_MSIZE; + else + memory_size = H8300_MSIZE; + + if (cpu.memory) + free (cpu.memory); + if (cpu.cache_idx) + free (cpu.cache_idx); + if (cpu.eightbit) + free (cpu.eightbit); + + cpu.memory = (unsigned char *) calloc (sizeof (char), memory_size); + cpu.cache_idx = (unsigned short *) calloc (sizeof (short), memory_size); + cpu.eightbit = (unsigned char *) calloc (sizeof (char), 256); + + /* `msize' must be a power of two */ + if ((memory_size & (memory_size - 1)) != 0) + abort (); + cpu.mask = memory_size - 1; + + if (sim_load_file (sd, myname, sim_callback, prog, prog_bfd, + sim_kind == SIM_OPEN_DEBUG, + 0, sim_write) + == NULL) + { + /* Close the bfd if we opened it. */ + if (abfd == NULL && prog_bfd != NULL) + bfd_close (prog_bfd); + return SIM_RC_FAIL; + } + + /* Close the bfd if we opened it. */ + if (abfd == NULL && prog_bfd != NULL) + bfd_close (prog_bfd); + return SIM_RC_OK; +} + +SIM_RC +sim_create_inferior (sd, abfd, argv, env) + SIM_DESC sd; + struct _bfd *abfd; + char **argv; + char **env; +{ + if (abfd != NULL) + cpu.pc = bfd_get_start_address (abfd); + else + cpu.pc = 0; + return SIM_RC_OK; +} + +void +sim_do_command (sd, cmd) + SIM_DESC sd; + char *cmd; +{ + (*sim_callback->printf_filtered) (sim_callback, + "This simulator does not accept any commands.\n"); +} + +void +sim_set_callbacks (ptr) + struct host_callback_struct *ptr; +{ + sim_callback = ptr; +} Index: config.in =================================================================== --- config.in (nonexistent) +++ config.in (revision 1765) @@ -0,0 +1,158 @@ +/* config.in. Generated automatically from configure.in by autoheader. */ + +/* Define if using alloca.c. */ +#undef C_ALLOCA + +/* Define to empty if the keyword does not work. */ +#undef const + +/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems. + This function is required for alloca.c support on those systems. */ +#undef CRAY_STACKSEG_END + +/* Define if you have alloca, as a function or macro. */ +#undef HAVE_ALLOCA + +/* Define if you have and it should be used (not on Ultrix). */ +#undef HAVE_ALLOCA_H + +/* Define if you have a working `mmap' system call. */ +#undef HAVE_MMAP + +/* Define as __inline if that's what the C compiler calls it. */ +#undef inline + +/* Define to `long' if doesn't define. */ +#undef off_t + +/* Define if you need to in order for stat and other things to work. */ +#undef _POSIX_SOURCE + +/* Define as the return type of signal handlers (int or void). */ +#undef RETSIGTYPE + +/* Define to `unsigned' if doesn't define. */ +#undef size_t + +/* If using the C implementation of alloca, define if you know the + direction of stack growth for your system; otherwise it will be + automatically deduced at run-time. + STACK_DIRECTION > 0 => grows toward higher addresses + STACK_DIRECTION < 0 => grows toward lower addresses + STACK_DIRECTION = 0 => direction of growth unknown + */ +#undef STACK_DIRECTION + +/* Define if you have the ANSI C header files. */ +#undef STDC_HEADERS + +/* Define to 1 if NLS is requested. */ +#undef ENABLE_NLS + +/* Define as 1 if you have gettext and don't want to use GNU gettext. */ +#undef HAVE_GETTEXT + +/* Define as 1 if you have the stpcpy function. */ +#undef HAVE_STPCPY + +/* Define if your locale.h file contains LC_MESSAGES. */ +#undef HAVE_LC_MESSAGES + +/* Define if you have the __argz_count function. */ +#undef HAVE___ARGZ_COUNT + +/* Define if you have the __argz_next function. */ +#undef HAVE___ARGZ_NEXT + +/* Define if you have the __argz_stringify function. */ +#undef HAVE___ARGZ_STRINGIFY + +/* Define if you have the __setfpucw function. */ +#undef HAVE___SETFPUCW + +/* Define if you have the dcgettext function. */ +#undef HAVE_DCGETTEXT + +/* Define if you have the getcwd function. */ +#undef HAVE_GETCWD + +/* Define if you have the getpagesize function. */ +#undef HAVE_GETPAGESIZE + +/* Define if you have the getrusage function. */ +#undef HAVE_GETRUSAGE + +/* Define if you have the munmap function. */ +#undef HAVE_MUNMAP + +/* Define if you have the putenv function. */ +#undef HAVE_PUTENV + +/* Define if you have the setenv function. */ +#undef HAVE_SETENV + +/* Define if you have the setlocale function. */ +#undef HAVE_SETLOCALE + +/* Define if you have the sigaction function. */ +#undef HAVE_SIGACTION + +/* Define if you have the stpcpy function. */ +#undef HAVE_STPCPY + +/* Define if you have the strcasecmp function. */ +#undef HAVE_STRCASECMP + +/* Define if you have the strchr function. */ +#undef HAVE_STRCHR + +/* Define if you have the time function. */ +#undef HAVE_TIME + +/* Define if you have the header file. */ +#undef HAVE_ARGZ_H + +/* Define if you have the header file. */ +#undef HAVE_FCNTL_H + +/* Define if you have the header file. */ +#undef HAVE_FPU_CONTROL_H + +/* Define if you have the header file. */ +#undef HAVE_LIMITS_H + +/* Define if you have the header file. */ +#undef HAVE_LOCALE_H + +/* Define if you have the header file. */ +#undef HAVE_MALLOC_H + +/* Define if you have the header file. */ +#undef HAVE_NL_TYPES_H + +/* Define if you have the header file. */ +#undef HAVE_STDLIB_H + +/* Define if you have the header file. */ +#undef HAVE_STRING_H + +/* Define if you have the header file. */ +#undef HAVE_STRINGS_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_PARAM_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_RESOURCE_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_TIME_H + +/* Define if you have the header file. */ +#undef HAVE_TIME_H + +/* Define if you have the header file. */ +#undef HAVE_UNISTD_H + +/* Define if you have the header file. */ +#undef HAVE_VALUES_H Index: tconfig.in =================================================================== --- tconfig.in (nonexistent) +++ tconfig.in (revision 1765) @@ -0,0 +1,17 @@ +/* h8300 target configuration file. */ + +/* Define this if the simulator supports profiling. + See the mips simulator for an example. + This enables the `-p foo' and `-s bar' options. + The target is required to provide sim_set_profile{,_size}. */ +/* #define SIM_HAVE_PROFILE */ + +/* Define this if the simulator uses an instruction cache. + See the h8/300 simulator for an example. + This enables the `-c size' option to set the size of the cache. + The target is required to provide sim_set_simcache_size. */ +#define SIM_HAVE_SIMCACHE + +/* FIXME: This is a quick hack for run.c so it can support the `-h' option. + It will eventually be replaced by a more general facility. */ +#define SIM_H8300

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.