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/sh
- 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 |
/syscall.h
0,0 → 1,33
|
/* !!! DANGER !!! |
This was copied from newlib. */ |
|
|
#define SYS_exit 1 |
#define SYS_fork 2 |
#define SYS_read 3 |
#define SYS_write 4 |
#define SYS_open 5 |
#define SYS_close 6 |
#define SYS_wait4 7 |
#define SYS_creat 8 |
#define SYS_link 9 |
#define SYS_unlink 10 |
#define SYS_execv 11 |
#define SYS_chdir 12 |
#define SYS_mknod 14 |
#define SYS_chmod 15 |
#define SYS_chown 16 |
#define SYS_lseek 19 |
#define SYS_getpid 20 |
#define SYS_isatty 21 |
#define SYS_fstat 22 |
#define SYS_time 23 |
#define SYS_ARG 24 |
#define SYS_stat 38 |
#define SYS_pipe 42 |
#define SYS_execve 59 |
#define SYS_utime 201 /* not really a system call */ |
#define SYS_wait 202 /* nor is this */ |
|
|
/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 unistd.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,41 @@
+# Makefile template for Configure for the SH 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 = interp.o table.o sim-load.o
+SIM_EXTRA_LIBS = -lm
+SIM_EXTRA_CLEAN = sh-clean
+
+## COMMON_POST_CONFIG_FRAG
+
+interp.o: interp.c code.c table.c
+
+code.c: gencode
+ ./gencode -x >code.c
+# indent code.c
+
+table.c: gencode
+ ./gencode -s >table.c
+# indent table.c
+
+gencode: gencode.c
+ $(CC_FOR_BUILD) -o gencode $(srcdir)/gencode.c
+
+sh-clean:
+ rm -f gencode code.c table.c
Index: interp.c
===================================================================
--- interp.c (nonexistent)
+++ interp.c (revision 1765)
@@ -0,0 +1,1603 @@
+/* Simulator for the Hitachi SH architecture.
+
+ Written by Steve Chamberlain of Cygnus Support.
+ sac@cygnus.com
+
+ This file is part of SH 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.
+
+*/
+
+#include "config.h"
+
+#include
+#ifdef HAVE_UNISTD_H
+#include
+#endif
+
+#include "sysdep.h"
+#include "bfd.h"
+#include "callback.h"
+#include "remote-sim.h"
+
+/* This file is local - if newlib changes, then so should this. */
+#include "syscall.h"
+
+#include
+
+#ifdef _WIN32
+#include /* Needed for _isnan() */
+#define isnan _isnan
+#endif
+
+#ifndef SIGBUS
+#define SIGBUS SIGSEGV
+#endif
+
+#ifndef SIGQUIT
+#define SIGQUIT SIGTERM
+#endif
+
+#ifndef SIGTRAP
+#define SIGTRAP 5
+#endif
+
+#define O_RECOMPILE 85
+#define DEFINE_TABLE
+#define DISASSEMBLER_TABLE
+
+/* Define the rate at which the simulator should poll the host
+ for a quit. */
+#define POLL_QUIT_INTERVAL 0x60000
+
+typedef union
+{
+
+ struct
+ {
+ /* On targets like sparc-sun-solaris, fregs will be aligned on a 64 bit
+ boundary (because of the d member). To avoid padding between
+ registers - which whould make the job of sim_fetch_register harder,
+ we add padding at the start. */
+ int pad_dummy;
+ int regs[16];
+ int pc;
+ int pr;
+
+ int gbr;
+ int vbr;
+ int mach;
+ int macl;
+
+ int sr;
+
+ int fpul;
+
+ int fpscr;
+
+ /* sh3e */
+ union fregs_u
+ {
+ float f[16];
+ double d[8];
+ int i[16];
+ }
+ fregs[2];
+
+ int ssr;
+ int spc;
+ /* sh3 */
+ int bank[2][8];
+
+ int ticks;
+ int stalls;
+ int memstalls;
+ int cycles;
+ int insts;
+
+ int prevlock;
+ int thislock;
+ int exception;
+
+ int end_of_registers;
+
+ int msize;
+#define PROFILE_FREQ 1
+#define PROFILE_SHIFT 2
+ int profile;
+ unsigned short *profile_hist;
+ unsigned char *memory;
+ }
+ asregs;
+ int asints[40];
+} saved_state_type;
+
+saved_state_type saved_state;
+
+
+/* These variables are at file scope so that functions other than
+ sim_resume can use the fetch/store macros */
+
+static int target_little_endian;
+static int host_little_endian;
+
+#if 1
+static int maskl = ~0;
+static int maskw = ~0;
+#endif
+
+static SIM_OPEN_KIND sim_kind;
+static char *myname;
+
+
+/* Short hand definitions of the registers */
+
+#define SBIT(x) ((x)&sbit)
+#define R0 saved_state.asregs.regs[0]
+#define Rn saved_state.asregs.regs[n]
+#define Rm saved_state.asregs.regs[m]
+#define UR0 (unsigned int)(saved_state.asregs.regs[0])
+#define UR (unsigned int)R
+#define UR (unsigned int)R
+#define SR0 saved_state.asregs.regs[0]
+#define GBR saved_state.asregs.gbr
+#define VBR saved_state.asregs.vbr
+#define SSR saved_state.asregs.ssr
+#define SPC saved_state.asregs.spc
+#define MACH saved_state.asregs.mach
+#define MACL saved_state.asregs.macl
+#define FPUL saved_state.asregs.fpul
+
+#define PC pc
+
+
+
+/* Alternate bank of registers r0-r6 */
+
+/* Note: code controling SR handles flips between BANK0 and BANK1 */
+#define Rn_BANK(n) (saved_state.asregs.bank[!SR_RB][(n)])
+#define SET_Rn_BANK(n, EXP) do { saved_state.asregs.bank[!SR_RB][(n)] = (EXP); } while (0)
+
+
+/* Manipulate SR */
+
+#define SR_MASK_M (1 << 9)
+#define SR_MASK_Q (1 << 8)
+#define SR_MASK_I (0xf << 4)
+#define SR_MASK_S (1 << 1)
+#define SR_MASK_T (1 << 0)
+
+#define SR_MASK_BL (1 << 28)
+#define SR_MASK_RB (1 << 29)
+#define SR_MASK_MD (1 << 30)
+
+#define M ((saved_state.asregs.sr & SR_MASK_M) != 0)
+#define Q ((saved_state.asregs.sr & SR_MASK_Q) != 0)
+#define S ((saved_state.asregs.sr & SR_MASK_S) != 0)
+#define T ((saved_state.asregs.sr & SR_MASK_T) != 0)
+
+#define SR_BL ((saved_state.asregs.sr & SR_MASK_BL) != 0)
+#define SR_RB ((saved_state.asregs.sr & SR_MASK_RB) != 0)
+#define SR_MD ((saved_state.asregs.sr & SR_MASK_MD) != 0)
+
+/* Note: don't use this for privileged bits */
+#define SET_SR_BIT(EXP, BIT) \
+do { \
+ if ((EXP) & 1) \
+ saved_state.asregs.sr |= (BIT); \
+ else \
+ saved_state.asregs.sr &= ~(BIT); \
+} while (0)
+
+#define SET_SR_M(EXP) SET_SR_BIT ((EXP), SR_MASK_M)
+#define SET_SR_Q(EXP) SET_SR_BIT ((EXP), SR_MASK_Q)
+#define SET_SR_S(EXP) SET_SR_BIT ((EXP), SR_MASK_S)
+#define SET_SR_T(EXP) SET_SR_BIT ((EXP), SR_MASK_T)
+
+#define GET_SR() (saved_state.asregs.sr - 0)
+#define SET_SR(x) set_sr (x)
+static void
+set_sr (new_sr)
+ int new_sr;
+{
+ /* do we need to swap banks */
+ int old_gpr = (SR_MD ? !SR_RB : 0);
+ int new_gpr = ((new_sr & SR_MASK_MD)
+ ? (new_sr & SR_MASK_RB) == 0
+ : 0);
+ if (old_gpr != new_gpr)
+ {
+ int i;
+ for (i = 0; i < 8; i++)
+ {
+ saved_state.asregs.bank[old_gpr][i] = saved_state.asregs.regs[i];
+ saved_state.asregs.regs[i] = saved_state.asregs.bank[new_gpr][i];
+ }
+ }
+}
+
+
+/* Manipulate FPSCR */
+
+#define FPSCR_MASK_FR (1 << 21)
+#define FPSCR_MASK_SZ (1 << 20)
+#define FPSCR_MASK_PR (1 << 19)
+
+#define FPSCR_FR ((GET_FPSCR() & FPSCR_MASK_FR) != 0)
+#define FPSCR_SZ ((GET_FPSCR() & FPSCR_MASK_SZ) != 0)
+#define FPSCR_PR ((GET_FPSCR() & FPSCR_MASK_PR) != 0)
+
+static void
+set_fpscr1 (x)
+ int x;
+{
+ int old = saved_state.asregs.fpscr;
+ saved_state.asregs.fpscr = (x);
+ /* swap the floating point register banks */
+ if ((saved_state.asregs.fpscr ^ old) & FPSCR_MASK_FR)
+ {
+ union fregs_u tmpf = saved_state.asregs.fregs[0];
+ saved_state.asregs.fregs[0] = saved_state.asregs.fregs[1];
+ saved_state.asregs.fregs[1] = tmpf;
+ }
+}
+
+#define GET_FPSCR() (saved_state.asregs.fpscr)
+#define SET_FPSCR(x) \
+do { \
+ set_fpscr1 (x); \
+} while (0)
+
+
+int
+fail ()
+{
+ abort ();
+}
+
+int
+special_address (addr, bits_written, data)
+ void *addr;
+ int bits_written, data;
+{
+ if ((unsigned) addr >> 24 == 0xf0 && bits_written == 32 && (data & 1) == 0)
+ /* This invalidates (if not associative) or might invalidate
+ (if associative) an instruction cache line. This is used for
+ trampolines. Since we don't simulate the cache, this is a no-op
+ as far as the simulator is concerned. */
+ return 1;
+ /* We can't do anything useful with the other stuff, so fail. */
+ return 0;
+}
+
+/* This function exists solely for the purpose of setting a breakpoint to
+ catch simulated bus errors when running the simulator under GDB. */
+
+void
+bp_holder ()
+{
+}
+
+/* FIXME: sim_resume should be renamed to sim_engine_run. sim_resume
+ being implemented by ../common/sim_resume.c and the below should
+ make a call to sim_engine_halt */
+
+#define BUSERROR(addr, mask, bits_written, data) \
+ if (addr & ~mask) \
+ { \
+ if (special_address (addr, bits_written, data)) \
+ return; \
+ saved_state.asregs.exception = SIGBUS; \
+ bp_holder (); \
+ }
+
+/* Define this to enable register lifetime checking.
+ The compiler generates "add #0,rn" insns to mark registers as invalid,
+ the simulator uses this info to call fail if it finds a ref to an invalid
+ register before a def
+
+ #define PARANOID
+*/
+
+#ifdef PARANOID
+int valid[16];
+#define CREF(x) if(!valid[x]) fail();
+#define CDEF(x) valid[x] = 1;
+#define UNDEF(x) valid[x] = 0;
+#else
+#define CREF(x)
+#define CDEF(x)
+#define UNDEF(x)
+#endif
+
+static void parse_and_set_memory_size PARAMS ((char *str));
+
+static int IOMEM PARAMS ((int addr, int write, int value));
+
+static host_callback *callback;
+
+
+
+/* Floating point registers */
+
+#define DR(n) (get_dr (n))
+static double
+get_dr (n)
+ int n;
+{
+ n = (n & ~1);
+ if (host_little_endian)
+ {
+ union
+ {
+ int i[2];
+ double d;
+ } dr;
+ dr.i[1] = saved_state.asregs.fregs[0].i[n + 0];
+ dr.i[0] = saved_state.asregs.fregs[0].i[n + 1];
+ return dr.d;
+ }
+ else
+ return (saved_state.asregs.fregs[0].d[n >> 1]);
+}
+
+#define SET_DR(n, EXP) set_dr ((n), (EXP))
+static void
+set_dr (n, exp)
+ int n;
+ double exp;
+{
+ n = (n & ~1);
+ if (host_little_endian)
+ {
+ union
+ {
+ int i[2];
+ double d;
+ } dr;
+ dr.d = exp;
+ saved_state.asregs.fregs[0].i[n + 0] = dr.i[1];
+ saved_state.asregs.fregs[0].i[n + 1] = dr.i[0];
+ }
+ else
+ saved_state.asregs.fregs[0].d[n >> 1] = exp;
+}
+
+#define SET_FI(n,EXP) (saved_state.asregs.fregs[0].i[(n)] = (EXP))
+#define FI(n) (saved_state.asregs.fregs[0].i[(n)])
+
+#define FR(n) (saved_state.asregs.fregs[0].f[(n)])
+#define SET_FR(n,EXP) (saved_state.asregs.fregs[0].f[(n)] = (EXP))
+
+#define XD_TO_XF(n) ((((n) & 1) << 5) | ((n) & 0x1e))
+#define XF(n) (saved_state.asregs.fregs[(n) >> 5].i[(n) & 0x1f])
+#define SET_XF(n,EXP) (saved_state.asregs.fregs[(n) >> 5].i[(n) & 0x1f] = (EXP))
+
+
+#define FP_OP(n, OP, m) \
+{ \
+ if (FPSCR_PR) \
+ { \
+ if (((n) & 1) || ((m) & 1)) \
+ saved_state.asregs.exception = SIGILL; \
+ else \
+ SET_DR(n, (DR(n) OP DR(m))); \
+ } \
+ else \
+ SET_FR(n, (FR(n) OP FR(m))); \
+} while (0)
+
+#define FP_UNARY(n, OP) \
+{ \
+ if (FPSCR_PR) \
+ { \
+ if ((n) & 1) \
+ saved_state.asregs.exception = SIGILL; \
+ else \
+ SET_DR(n, (OP (DR(n)))); \
+ } \
+ else \
+ SET_FR(n, (OP (FR(n)))); \
+} while (0)
+
+#define FP_CMP(n, OP, m) \
+{ \
+ if (FPSCR_PR) \
+ { \
+ if (((n) & 1) || ((m) & 1)) \
+ saved_state.asregs.exception = SIGILL; \
+ else \
+ SET_SR_T (DR(n) OP DR(m)); \
+ } \
+ else \
+ SET_SR_T (FR(n) OP FR(m)); \
+} while (0)
+
+
+
+static void INLINE
+wlat_little (memory, x, value, maskl)
+ unsigned char *memory;
+{
+ int v = value;
+ unsigned char *p = memory + ((x) & maskl);
+ BUSERROR(x, maskl, 32, v);
+ p[3] = v >> 24;
+ p[2] = v >> 16;
+ p[1] = v >> 8;
+ p[0] = v;
+}
+
+static void INLINE
+wwat_little (memory, x, value, maskw)
+ unsigned char *memory;
+{
+ int v = value;
+ unsigned char *p = memory + ((x) & maskw);
+ BUSERROR(x, maskw, 16, v);
+
+ p[1] = v >> 8;
+ p[0] = v;
+}
+
+static void INLINE
+wbat_any (memory, x, value, maskb)
+ unsigned char *memory;
+{
+ unsigned char *p = memory + (x & maskb);
+ if (x > 0x5000000)
+ IOMEM (x, 1, value);
+ BUSERROR(x, maskb, 8, value);
+
+ p[0] = value;
+}
+
+static void INLINE
+wlat_big (memory, x, value, maskl)
+ unsigned char *memory;
+{
+ int v = value;
+ unsigned char *p = memory + ((x) & maskl);
+ BUSERROR(x, maskl, 32, v);
+
+ p[0] = v >> 24;
+ p[1] = v >> 16;
+ p[2] = v >> 8;
+ p[3] = v;
+}
+
+static void INLINE
+wwat_big (memory, x, value, maskw)
+ unsigned char *memory;
+{
+ int v = value;
+ unsigned char *p = memory + ((x) & maskw);
+ BUSERROR(x, maskw, 16, v);
+
+ p[0] = v >> 8;
+ p[1] = v;
+}
+
+static void INLINE
+wbat_big (memory, x, value, maskb)
+ unsigned char *memory;
+{
+ unsigned char *p = memory + (x & maskb);
+ BUSERROR(x, maskb, 8, value);
+
+ if (x > 0x5000000)
+ IOMEM (x, 1, value);
+ p[0] = value;
+}
+
+/* Read functions */
+
+static int INLINE
+rlat_little (memory, x, maskl)
+ unsigned char *memory;
+{
+ unsigned char *p = memory + ((x) & maskl);
+ BUSERROR(x, maskl, -32, -1);
+
+ return (p[3] << 24) | (p[2] << 16) | (p[1] << 8) | p[0];
+}
+
+static int INLINE
+rwat_little (memory, x, maskw)
+ unsigned char *memory;
+{
+ unsigned char *p = memory + ((x) & maskw);
+ BUSERROR(x, maskw, -16, -1);
+
+ return (p[1] << 8) | p[0];
+}
+
+static int INLINE
+rbat_any (memory, x, maskb)
+ unsigned char *memory;
+{
+ unsigned char *p = memory + ((x) & maskb);
+ BUSERROR(x, maskb, -8, -1);
+
+ return p[0];
+}
+
+static int INLINE
+rlat_big (memory, x, maskl)
+ unsigned char *memory;
+{
+ unsigned char *p = memory + ((x) & maskl);
+ BUSERROR(x, maskl, -32, -1);
+
+ return (p[0] << 24) | (p[1] << 16) | (p[2] << 8) | p[3];
+}
+
+static int INLINE
+rwat_big (memory, x, maskw)
+ unsigned char *memory;
+{
+ unsigned char *p = memory + ((x) & maskw);
+ BUSERROR(x, maskw, -16, -1);
+
+ return (p[0] << 8) | p[1];
+}
+
+#define RWAT(x) (little_endian ? rwat_little(memory, x, maskw): rwat_big(memory, x, maskw))
+#define RLAT(x) (little_endian ? rlat_little(memory, x, maskl): rlat_big(memory, x, maskl))
+#define RBAT(x) (rbat_any (memory, x, maskb))
+#define WWAT(x,v) (little_endian ? wwat_little(memory, x, v, maskw): wwat_big(memory, x, v, maskw))
+#define WLAT(x,v) (little_endian ? wlat_little(memory, x, v, maskl): wlat_big(memory, x, v, maskl))
+#define WBAT(x,v) (wbat_any (memory, x, v, maskb))
+
+#define RUWAT(x) (RWAT(x) & 0xffff)
+#define RSWAT(x) ((short)(RWAT(x)))
+#define RSBAT(x) (SEXT(RBAT(x)))
+
+#define RDAT(x, n) (do_rdat (memory, (x), (n), (little_endian)))
+static int
+do_rdat (memory, x, n, little_endian)
+ char *memory;
+ int x;
+ int n;
+ int little_endian;
+{
+ int f0;
+ int f1;
+ int i = (n & 1);
+ int j = (n & ~1);
+ if (little_endian)
+ {
+ f0 = rlat_little (memory, x + 0, maskl);
+ f1 = rlat_little (memory, x + 4, maskl);
+ }
+ else
+ {
+ f0 = rlat_big (memory, x + 0, maskl);
+ f1 = rlat_big (memory, x + 4, maskl);
+ }
+ saved_state.asregs.fregs[i].i[(j + 0)] = f0;
+ saved_state.asregs.fregs[i].i[(j + 1)] = f1;
+ return 0;
+}
+
+#define WDAT(x, n) (do_wdat (memory, (x), (n), (little_endian)))
+static int
+do_wdat (memory, x, n, little_endian)
+ char *memory;
+ int x;
+ int n;
+ int little_endian;
+{
+ int f0;
+ int f1;
+ int i = (n & 1);
+ int j = (n & ~1);
+ f0 = saved_state.asregs.fregs[i].i[(j + 0)];
+ f1 = saved_state.asregs.fregs[i].i[(j + 1)];
+ if (little_endian)
+ {
+ wlat_little (memory, (x + 0), f0, maskl);
+ wlat_little (memory, (x + 4), f1, maskl);
+ }
+ else
+ {
+ wlat_big (memory, (x + 0), f0, maskl);
+ wlat_big (memory, (x + 4), f1, maskl);
+ }
+ return 0;
+}
+
+
+#define MA(n) do { memstalls += (((pc & 3) != 0) ? (n) : ((n) - 1)); } while (0)
+
+#define SEXT(x) (((x & 0xff) ^ (~0x7f))+0x80)
+#define SEXT12(x) (((x & 0xfff) ^ 0x800) - 0x800)
+#define SEXTW(y) ((int)((short)y))
+
+#define Delay_Slot(TEMPPC) iword = RUWAT(TEMPPC); goto top;
+
+int empty[16];
+
+#define L(x) thislock = x;
+#define TL(x) if ((x) == prevlock) stalls++;
+#define TB(x,y) if ((x) == prevlock || (y)==prevlock) stalls++;
+
+#if defined(__GO32__) || defined(_WIN32)
+int sim_memory_size = 19;
+#else
+int sim_memory_size = 24;
+#endif
+
+static int sim_profile_size = 17;
+static int nsamples;
+
+#undef TB
+#define TB(x,y)
+
+#define SMR1 (0x05FFFEC8) /* Channel 1 serial mode register */
+#define BRR1 (0x05FFFEC9) /* Channel 1 bit rate register */
+#define SCR1 (0x05FFFECA) /* Channel 1 serial control register */
+#define TDR1 (0x05FFFECB) /* Channel 1 transmit data register */
+#define SSR1 (0x05FFFECC) /* Channel 1 serial status register */
+#define RDR1 (0x05FFFECD) /* Channel 1 receive data register */
+
+#define SCI_RDRF 0x40 /* Recieve data register full */
+#define SCI_TDRE 0x80 /* Transmit data register empty */
+
+static int
+IOMEM (addr, write, value)
+ int addr;
+ int write;
+ int value;
+{
+ if (write)
+ {
+ switch (addr)
+ {
+ case TDR1:
+ if (value != '\r')
+ {
+ putchar (value);
+ fflush (stdout);
+ }
+ break;
+ }
+ }
+ else
+ {
+ switch (addr)
+ {
+ case RDR1:
+ return getchar ();
+ }
+ }
+ return 0;
+}
+
+static int
+get_now ()
+{
+ return time ((long *) 0);
+}
+
+static int
+now_persec ()
+{
+ return 1;
+}
+
+static FILE *profile_file;
+
+static void
+swap (memory, n)
+ unsigned char *memory;
+ int n;
+{
+ int little_endian = target_little_endian;
+ WLAT (0, n);
+}
+
+static void
+swap16 (memory, n)
+ unsigned char *memory;
+ int n;
+{
+ int little_endian = target_little_endian;
+ WWAT (0, n);
+}
+
+static void
+swapout (n)
+ int n;
+{
+ if (profile_file)
+ {
+ char b[4];
+ swap (b, n);
+ fwrite (b, 4, 1, profile_file);
+ }
+}
+
+static void
+swapout16 (n)
+ int n;
+{
+ char b[4];
+ swap16 (b, n);
+ fwrite (b, 2, 1, profile_file);
+}
+
+/* Turn a pointer in a register into a pointer into real memory. */
+
+static char *
+ptr (x)
+ int x;
+{
+ return (char *) (x + saved_state.asregs.memory);
+}
+
+/* Simulate a monitor trap, put the result into r0 and errno into r1 */
+
+static void
+trap (i, regs, memory, maskl, maskw, little_endian)
+ int i;
+ int *regs;
+ unsigned char *memory;
+{
+ switch (i)
+ {
+ case 1:
+ printf ("%c", regs[0]);
+ break;
+ case 2:
+ saved_state.asregs.exception = SIGQUIT;
+ break;
+ case 3: /* FIXME: for backwards compat, should be removed */
+ case 34:
+ {
+ extern int errno;
+ int perrno = errno;
+ errno = 0;
+
+ switch (regs[4])
+ {
+
+#if !defined(__GO32__) && !defined(_WIN32)
+ case SYS_fork:
+ regs[0] = fork ();
+ break;
+ case SYS_execve:
+ regs[0] = execve (ptr (regs[5]), (char **)ptr (regs[6]), (char **)ptr (regs[7]));
+ break;
+ case SYS_execv:
+ regs[0] = execve (ptr (regs[5]),(char **) ptr (regs[6]), 0);
+ break;
+ case SYS_pipe:
+ {
+ char *buf;
+ int host_fd[2];
+
+ buf = ptr (regs[5]);
+
+ regs[0] = pipe (host_fd);
+
+ WLAT (buf, host_fd[0]);
+ buf += 4;
+ WLAT (buf, host_fd[1]);
+ }
+ break;
+
+ case SYS_wait:
+ regs[0] = wait (ptr (regs[5]));
+ break;
+#endif
+
+ case SYS_read:
+ regs[0] = callback->read (callback, regs[5], ptr (regs[6]), regs[7]);
+ break;
+ case SYS_write:
+ if (regs[5] == 1)
+ regs[0] = (int)callback->write_stdout (callback, ptr(regs[6]), regs[7]);
+ else
+ regs[0] = (int)callback->write (callback, regs[5], ptr (regs[6]), regs[7]);
+ break;
+ case SYS_lseek:
+ regs[0] = callback->lseek (callback,regs[5], regs[6], regs[7]);
+ break;
+ case SYS_close:
+ regs[0] = callback->close (callback,regs[5]);
+ break;
+ case SYS_open:
+ regs[0] = callback->open (callback,ptr (regs[5]), regs[6]);
+ break;
+ case SYS_exit:
+ /* EXIT - caller can look in r5 to work out the reason */
+ saved_state.asregs.exception = SIGQUIT;
+ regs[0] = regs[5];
+ break;
+
+ case SYS_stat: /* added at hmsi */
+ /* stat system call */
+ {
+ struct stat host_stat;
+ char *buf;
+
+ regs[0] = stat (ptr (regs[5]), &host_stat);
+
+ buf = ptr (regs[6]);
+
+ WWAT (buf, host_stat.st_dev);
+ buf += 2;
+ WWAT (buf, host_stat.st_ino);
+ buf += 2;
+ WLAT (buf, host_stat.st_mode);
+ buf += 4;
+ WWAT (buf, host_stat.st_nlink);
+ buf += 2;
+ WWAT (buf, host_stat.st_uid);
+ buf += 2;
+ WWAT (buf, host_stat.st_gid);
+ buf += 2;
+ WWAT (buf, host_stat.st_rdev);
+ buf += 2;
+ WLAT (buf, host_stat.st_size);
+ buf += 4;
+ WLAT (buf, host_stat.st_atime);
+ buf += 4;
+ WLAT (buf, 0);
+ buf += 4;
+ WLAT (buf, host_stat.st_mtime);
+ buf += 4;
+ WLAT (buf, 0);
+ buf += 4;
+ WLAT (buf, host_stat.st_ctime);
+ buf += 4;
+ WLAT (buf, 0);
+ buf += 4;
+ WLAT (buf, 0);
+ buf += 4;
+ WLAT (buf, 0);
+ buf += 4;
+ }
+ break;
+
+#ifndef _WIN32
+ case SYS_chown:
+ regs[0] = chown (ptr (regs[5]), regs[6], regs[7]);
+ break;
+#endif /* _WIN32 */
+ case SYS_chmod:
+ regs[0] = chmod (ptr (regs[5]), regs[6]);
+ break;
+ case SYS_utime:
+ /* Cast the second argument to void *, to avoid type mismatch
+ if a prototype is present. */
+ regs[0] = utime (ptr (regs[5]), (void *) ptr (regs[6]));
+ break;
+ default:
+ abort ();
+ }
+ regs[1] = callback->get_errno (callback);
+ errno = perrno;
+ }
+ break;
+
+ case 0xc3:
+ case 255:
+ saved_state.asregs.exception = SIGTRAP;
+ break;
+ }
+
+}
+
+void
+control_c (sig, code, scp, addr)
+ int sig;
+ int code;
+ char *scp;
+ char *addr;
+{
+ saved_state.asregs.exception = SIGINT;
+}
+
+static int
+div1 (R, iRn2, iRn1/*, T*/)
+ int *R;
+ int iRn1;
+ int iRn2;
+ /* int T;*/
+{
+ unsigned long tmp0;
+ unsigned char old_q, tmp1;
+
+ old_q = Q;
+ SET_SR_Q ((unsigned char) ((0x80000000 & R[iRn1]) != 0));
+ R[iRn1] <<= 1;
+ R[iRn1] |= (unsigned long) T;
+
+ switch (old_q)
+ {
+ case 0:
+ switch (M)
+ {
+ case 0:
+ tmp0 = R[iRn1];
+ R[iRn1] -= R[iRn2];
+ tmp1 = (R[iRn1] > tmp0);
+ switch (Q)
+ {
+ case 0:
+ SET_SR_Q (tmp1);
+ break;
+ case 1:
+ SET_SR_Q ((unsigned char) (tmp1 == 0));
+ break;
+ }
+ break;
+ case 1:
+ tmp0 = R[iRn1];
+ R[iRn1] += R[iRn2];
+ tmp1 = (R[iRn1] < tmp0);
+ switch (Q)
+ {
+ case 0:
+ SET_SR_Q ((unsigned char) (tmp1 == 0));
+ break;
+ case 1:
+ SET_SR_Q (tmp1);
+ break;
+ }
+ break;
+ }
+ break;
+ case 1:
+ switch (M)
+ {
+ case 0:
+ tmp0 = R[iRn1];
+ R[iRn1] += R[iRn2];
+ tmp1 = (R[iRn1] < tmp0);
+ switch (Q)
+ {
+ case 0:
+ SET_SR_Q (tmp1);
+ break;
+ case 1:
+ SET_SR_Q ((unsigned char) (tmp1 == 0));
+ break;
+ }
+ break;
+ case 1:
+ tmp0 = R[iRn1];
+ R[iRn1] -= R[iRn2];
+ tmp1 = (R[iRn1] > tmp0);
+ switch (Q)
+ {
+ case 0:
+ SET_SR_Q ((unsigned char) (tmp1 == 0));
+ break;
+ case 1:
+ SET_SR_Q (tmp1);
+ break;
+ }
+ break;
+ }
+ break;
+ }
+ /*T = (Q == M);*/
+ SET_SR_T (Q == M);
+ /*return T;*/
+}
+
+static void
+dmul (sign, rm, rn)
+ int sign;
+ unsigned int rm;
+ unsigned int rn;
+{
+ unsigned long RnL, RnH;
+ unsigned long RmL, RmH;
+ unsigned long temp0, temp1, temp2, temp3;
+ unsigned long Res2, Res1, Res0;
+
+ RnL = rn & 0xffff;
+ RnH = (rn >> 16) & 0xffff;
+ RmL = rm & 0xffff;
+ RmH = (rm >> 16) & 0xffff;
+ temp0 = RmL * RnL;
+ temp1 = RmH * RnL;
+ temp2 = RmL * RnH;
+ temp3 = RmH * RnH;
+ Res2 = 0;
+ Res1 = temp1 + temp2;
+ if (Res1 < temp1)
+ Res2 += 0x00010000;
+ temp1 = (Res1 << 16) & 0xffff0000;
+ Res0 = temp0 + temp1;
+ if (Res0 < temp0)
+ Res2 += 1;
+ Res2 += ((Res1 >> 16) & 0xffff) + temp3;
+
+ if (sign)
+ {
+ if (rn & 0x80000000)
+ Res2 -= rm;
+ if (rm & 0x80000000)
+ Res2 -= rn;
+ }
+
+ MACH = Res2;
+ MACL = Res0;
+}
+
+static void
+macw (regs, memory, n, m)
+ int *regs;
+ unsigned char *memory;
+ int m, n;
+{
+ int little_endian = target_little_endian;
+ long tempm, tempn;
+ long prod, macl, sum;
+
+ tempm=RSWAT(regs[m]); regs[m]+=2;
+ tempn=RSWAT(regs[n]); regs[n]+=2;
+
+ macl = MACL;
+ prod = (long)(short) tempm * (long)(short) tempn;
+ sum = prod + macl;
+ if (S)
+ {
+ if ((~(prod ^ macl) & (sum ^ prod)) < 0)
+ {
+ /* MACH's lsb is a sticky overflow bit. */
+ MACH |= 1;
+ /* Store the smallest negative number in MACL if prod is
+ negative, and the largest positive number otherwise. */
+ sum = 0x7fffffff + (prod < 0);
+ }
+ }
+ else
+ {
+ long mach;
+ /* Add to MACH the sign extended product, and carry from low sum. */
+ mach = MACH + (-(prod < 0)) + ((unsigned long) sum < prod);
+ /* Sign extend at 10:th bit in MACH. */
+ MACH = (mach & 0x1ff) | -(mach & 0x200);
+ }
+ MACL = sum;
+}
+
+/* Set the memory size to the power of two provided. */
+
+void
+sim_size (power)
+ int power;
+
+{
+ saved_state.asregs.msize = 1 << power;
+
+ sim_memory_size = power;
+
+ if (saved_state.asregs.memory)
+ {
+ free (saved_state.asregs.memory);
+ }
+
+ saved_state.asregs.memory =
+ (unsigned char *) calloc (64, saved_state.asregs.msize / 64);
+
+ if (!saved_state.asregs.memory)
+ {
+ fprintf (stderr,
+ "Not enough VM for simulation of %d bytes of RAM\n",
+ saved_state.asregs.msize);
+
+ saved_state.asregs.msize = 1;
+ saved_state.asregs.memory = (unsigned char *) calloc (1, 1);
+ }
+}
+
+static void
+init_pointers ()
+{
+ host_little_endian = 0;
+ *(char*)&host_little_endian = 1;
+ host_little_endian &= 1;
+
+ if (saved_state.asregs.msize != 1 << sim_memory_size)
+ {
+ sim_size (sim_memory_size);
+ }
+
+ if (saved_state.asregs.profile && !profile_file)
+ {
+ profile_file = fopen ("gmon.out", "wb");
+ /* Seek to where to put the call arc data */
+ nsamples = (1 << sim_profile_size);
+
+ fseek (profile_file, nsamples * 2 + 12, 0);
+
+ if (!profile_file)
+ {
+ fprintf (stderr, "Can't open gmon.out\n");
+ }
+ else
+ {
+ saved_state.asregs.profile_hist =
+ (unsigned short *) calloc (64, (nsamples * sizeof (short) / 64));
+ }
+ }
+}
+
+static void
+dump_profile ()
+{
+ unsigned int minpc;
+ unsigned int maxpc;
+ unsigned short *p;
+ int i;
+
+ p = saved_state.asregs.profile_hist;
+ minpc = 0;
+ maxpc = (1 << sim_profile_size);
+
+ fseek (profile_file, 0L, 0);
+ swapout (minpc << PROFILE_SHIFT);
+ swapout (maxpc << PROFILE_SHIFT);
+ swapout (nsamples * 2 + 12);
+ for (i = 0; i < nsamples; i++)
+ swapout16 (saved_state.asregs.profile_hist[i]);
+
+}
+
+static void
+gotcall (from, to)
+ int from;
+ int to;
+{
+ swapout (from);
+ swapout (to);
+ swapout (1);
+}
+
+#define MMASKB ((saved_state.asregs.msize -1) & ~0)
+
+int
+sim_stop (sd)
+ SIM_DESC sd;
+{
+ saved_state.asregs.exception = SIGINT;
+ return 1;
+}
+
+void
+sim_resume (sd, step, siggnal)
+ SIM_DESC sd;
+ int step, siggnal;
+{
+ register unsigned int pc;
+ register int cycles = 0;
+ register int stalls = 0;
+ register int memstalls = 0;
+ register int insts = 0;
+ register int prevlock;
+ register int thislock;
+ register unsigned int doprofile;
+ register int pollcount = 0;
+ register int little_endian = target_little_endian;
+
+ int tick_start = get_now ();
+ void (*prev) ();
+ void (*prev_fpe) ();
+ extern unsigned char sh_jump_table0[];
+
+ register unsigned char *jump_table = sh_jump_table0;
+
+ register int *R = &(saved_state.asregs.regs[0]);
+ /*register int T;*/
+ register int PR;
+
+ register int maskb = ((saved_state.asregs.msize - 1) & ~0);
+ register int maskw = ((saved_state.asregs.msize - 1) & ~1);
+ register int maskl = ((saved_state.asregs.msize - 1) & ~3);
+ register unsigned char *memory;
+ register unsigned int sbit = ((unsigned int) 1 << 31);
+
+ prev = signal (SIGINT, control_c);
+ prev_fpe = signal (SIGFPE, SIG_IGN);
+
+ init_pointers ();
+
+ memory = saved_state.asregs.memory;
+
+ if (step)
+ {
+ saved_state.asregs.exception = SIGTRAP;
+ }
+ else
+ {
+ saved_state.asregs.exception = 0;
+ }
+
+ pc = saved_state.asregs.pc;
+ PR = saved_state.asregs.pr;
+ /*T = GET_SR () & SR_MASK_T;*/
+ prevlock = saved_state.asregs.prevlock;
+ thislock = saved_state.asregs.thislock;
+ doprofile = saved_state.asregs.profile;
+
+ /* If profiling not enabled, disable it by asking for
+ profiles infrequently. */
+ if (doprofile == 0)
+ doprofile = ~0;
+
+ do
+ {
+ register unsigned int iword = RUWAT (pc);
+ register unsigned int ult;
+ register unsigned int nia = pc + 2;
+#ifndef ACE_FAST
+ insts++;
+#endif
+ top:
+
+#include "code.c"
+
+
+ pc = nia;
+
+ if (--pollcount < 0)
+ {
+ pollcount = POLL_QUIT_INTERVAL;
+ if ((*callback->poll_quit) != NULL
+ && (*callback->poll_quit) (callback))
+ {
+ sim_stop (sd);
+ }
+ }
+
+#ifndef ACE_FAST
+ prevlock = thislock;
+ thislock = 30;
+ cycles++;
+
+ if (cycles >= doprofile)
+ {
+
+ saved_state.asregs.cycles += doprofile;
+ cycles -= doprofile;
+ if (saved_state.asregs.profile_hist)
+ {
+ int n = pc >> PROFILE_SHIFT;
+ if (n < nsamples)
+ {
+ int i = saved_state.asregs.profile_hist[n];
+ if (i < 65000)
+ saved_state.asregs.profile_hist[n] = i + 1;
+ }
+
+ }
+ }
+#endif
+ }
+ while (!saved_state.asregs.exception);
+
+ if (saved_state.asregs.exception == SIGILL
+ || saved_state.asregs.exception == SIGBUS)
+ {
+ pc -= 2;
+ }
+
+ saved_state.asregs.ticks += get_now () - tick_start;
+ saved_state.asregs.cycles += cycles;
+ saved_state.asregs.stalls += stalls;
+ saved_state.asregs.memstalls += memstalls;
+ saved_state.asregs.insts += insts;
+ saved_state.asregs.pc = pc;
+ /* restore the T and other cached SR bits */
+ SET_SR (GET_SR());
+ saved_state.asregs.pr = PR;
+
+ saved_state.asregs.prevlock = prevlock;
+ saved_state.asregs.thislock = thislock;
+
+ if (profile_file)
+ {
+ dump_profile ();
+ }
+
+ signal (SIGFPE, prev_fpe);
+ signal (SIGINT, prev);
+}
+
+int
+sim_write (sd, addr, buffer, size)
+ SIM_DESC sd;
+ SIM_ADDR addr;
+ unsigned char *buffer;
+ int size;
+{
+ int i;
+
+ init_pointers ();
+
+ for (i = 0; i < size; i++)
+ {
+ saved_state.asregs.memory[MMASKB & (addr + i)] = buffer[i];
+ }
+ return size;
+}
+
+int
+sim_read (sd, addr, buffer, size)
+ SIM_DESC sd;
+ SIM_ADDR addr;
+ unsigned char *buffer;
+ int size;
+{
+ int i;
+
+ init_pointers ();
+
+ for (i = 0; i < size; i++)
+ {
+ buffer[i] = saved_state.asregs.memory[MMASKB & (addr + i)];
+ }
+ return size;
+}
+
+/* We have to add one to RN as an index into asints because of the padding
+ added at the start of asregs. */
+int
+sim_store_register (sd, rn, memory, length)
+ SIM_DESC sd;
+ int rn;
+ unsigned char *memory;
+ int length;
+{
+ int little_endian;
+ init_pointers ();
+ little_endian = target_little_endian;
+ if (&saved_state.asints[rn+1]
+ == &saved_state.asregs.fpscr)
+ set_fpscr1 (RLAT(0));
+ else
+ saved_state.asints[rn+1] = RLAT(0);
+ return -1;
+}
+
+int
+sim_fetch_register (sd, rn, memory, length)
+ SIM_DESC sd;
+ int rn;
+ unsigned char *memory;
+ int length;
+{
+ int little_endian;
+ init_pointers ();
+ little_endian = target_little_endian;
+ WLAT (0, saved_state.asints[rn+1]);
+ return -1;
+}
+
+int
+sim_trace (sd)
+ SIM_DESC sd;
+{
+ return 0;
+}
+
+void
+sim_stop_reason (sd, reason, sigrc)
+ SIM_DESC sd;
+ enum sim_stop *reason;
+ int *sigrc;
+{
+ /* The SH simulator uses SIGQUIT to indicate that the program has
+ exited, so we must check for it here and translate it to exit. */
+ if (saved_state.asregs.exception == SIGQUIT)
+ {
+ *reason = sim_exited;
+ *sigrc = saved_state.asregs.regs[5];
+ }
+ else
+ {
+ *reason = sim_stopped;
+ *sigrc = saved_state.asregs.exception;
+ }
+}
+
+void
+sim_info (sd, verbose)
+ SIM_DESC sd;
+ int verbose;
+{
+ double timetaken = (double) saved_state.asregs.ticks / (double) now_persec ();
+ double virttime = saved_state.asregs.cycles / 36.0e6;
+
+ callback->printf_filtered (callback, "\n\n# instructions executed %10d\n",
+ saved_state.asregs.insts);
+ callback->printf_filtered (callback, "# cycles %10d\n",
+ saved_state.asregs.cycles);
+ callback->printf_filtered (callback, "# pipeline stalls %10d\n",
+ saved_state.asregs.stalls);
+ callback->printf_filtered (callback, "# misaligned load/store %10d\n",
+ saved_state.asregs.memstalls);
+ callback->printf_filtered (callback, "# real time taken %10.4f\n",
+ timetaken);
+ callback->printf_filtered (callback, "# virtual time taken %10.4f\n",
+ virttime);
+ callback->printf_filtered (callback, "# profiling size %10d\n",
+ sim_profile_size);
+ callback->printf_filtered (callback, "# profiling frequency %10d\n",
+ saved_state.asregs.profile);
+ callback->printf_filtered (callback, "# profile maxpc %10x\n",
+ (1 << sim_profile_size) << PROFILE_SHIFT);
+
+ if (timetaken != 0)
+ {
+ callback->printf_filtered (callback, "# cycles/second %10d\n",
+ (int) (saved_state.asregs.cycles / timetaken));
+ callback->printf_filtered (callback, "# simulation ratio %10.4f\n",
+ virttime / timetaken);
+ }
+}
+
+void
+sim_set_profile (n)
+ int n;
+{
+ saved_state.asregs.profile = n;
+}
+
+void
+sim_set_profile_size (n)
+ int n;
+{
+ sim_profile_size = n;
+}
+
+SIM_DESC
+sim_open (kind, cb, abfd, argv)
+ SIM_OPEN_KIND kind;
+ host_callback *cb;
+ struct _bfd *abfd;
+ char **argv;
+{
+ char **p;
+ int endian_set = 0;
+
+ sim_kind = kind;
+ myname = argv[0];
+ callback = cb;
+
+ for (p = argv + 1; *p != NULL; ++p)
+ {
+ if (strcmp (*p, "-E") == 0)
+ {
+ ++p;
+ if (*p == NULL)
+ {
+ /* FIXME: This doesn't use stderr, but then the rest of the
+ file doesn't either. */
+ callback->printf_filtered (callback, "Missing argument to `-E'.\n");
+ return 0;
+ }
+ target_little_endian = strcmp (*p, "big") != 0;
+ endian_set = 1;
+ }
+ else if (isdigit (**p))
+ parse_and_set_memory_size (*p);
+ }
+
+ if (abfd != NULL && ! endian_set)
+ target_little_endian = ! bfd_big_endian (abfd);
+
+ /* fudge our descriptor for now */
+ return (SIM_DESC) 1;
+}
+
+static void
+parse_and_set_memory_size (str)
+ char *str;
+{
+ int n;
+
+ n = strtol (str, NULL, 10);
+ if (n > 0 && n <= 24)
+ sim_memory_size = n;
+ else
+ callback->printf_filtered (callback, "Bad memory size %d; must be 1 to 24, inclusive\n", n);
+}
+
+void
+sim_close (sd, quitting)
+ SIM_DESC sd;
+ int quitting;
+{
+ /* nothing to do */
+}
+
+SIM_RC
+sim_load (sd, prog, abfd, from_tty)
+ SIM_DESC sd;
+ char *prog;
+ bfd *abfd;
+ int from_tty;
+{
+ extern bfd *sim_load_file (); /* ??? Don't know where this should live. */
+ bfd *prog_bfd;
+
+ prog_bfd = sim_load_file (sd, myname, callback, prog, abfd,
+ sim_kind == SIM_OPEN_DEBUG,
+ 0, sim_write);
+ if (prog_bfd == NULL)
+ return SIM_RC_FAIL;
+ if (abfd == NULL)
+ bfd_close (prog_bfd);
+ return SIM_RC_OK;
+}
+
+SIM_RC
+sim_create_inferior (sd, prog_bfd, argv, env)
+ SIM_DESC sd;
+ struct _bfd *prog_bfd;
+ char **argv;
+ char **env;
+{
+ /* clear the registers */
+ memset (&saved_state, 0,
+ (char*)&saved_state.asregs.end_of_registers - (char*)&saved_state);
+ /* set the PC */
+ if (prog_bfd != NULL)
+ saved_state.asregs.pc = bfd_get_start_address (prog_bfd);
+ return SIM_RC_OK;
+}
+
+void
+sim_do_command (sd, cmd)
+ SIM_DESC sd;
+ char *cmd;
+{
+ char *sms_cmd = "set-memory-size";
+ int cmdsize;
+
+ if (cmd == NULL || *cmd == '\0')
+ {
+ cmd = "help";
+ }
+
+ cmdsize = strlen (sms_cmd);
+ if (strncmp (cmd, sms_cmd, cmdsize) == 0 && strchr (" \t", cmd[cmdsize]) != NULL)
+ {
+ parse_and_set_memory_size (cmd + cmdsize + 1);
+ }
+ else if (strcmp (cmd, "help") == 0)
+ {
+ (callback->printf_filtered) (callback, "List of SH simulator commands:\n\n");
+ (callback->printf_filtered) (callback, "set-memory-size -- Set the number of address bits to use\n");
+ (callback->printf_filtered) (callback, "\n");
+ }
+ else
+ {
+ (callback->printf_filtered) (callback, "Error: \"%s\" is not a valid SH simulator command.\n", cmd);
+ }
+}
+
+void
+sim_set_callbacks (p)
+ host_callback *p;
+{
+ callback = p;
+}
Index: gencode.c
===================================================================
--- gencode.c (nonexistent)
+++ gencode.c (revision 1765)
@@ -0,0 +1,1931 @@
+/* Simulator/Opcode generator for the Hitachi Super-H architecture.
+
+ Written by Steve Chamberlain of Cygnus Support.
+ sac@cygnus.com
+
+ This file is part of SH 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 generates the opcode table for the assembler and
+ the simulator code
+
+ -t prints a pretty table for the assembler manual
+ -s generates the simulator code jump table
+ -d generates a define table
+ -x generates the simulator code switch statement
+ default generates the opcode tables
+
+*/
+
+#include
+
+#define MAX_NR_STUFF 20
+
+typedef struct
+{
+ char *defs;
+ char *refs;
+ char *name;
+ char *code;
+ char *stuff[MAX_NR_STUFF];
+ int index;
+}
+
+op;
+
+
+op tab[] =
+{
+
+ { "n", "", "add #,", "0111nnnni8*1....",
+ "R[n] += SEXT(i);",
+ "if (i == 0) {",
+ " UNDEF(n); /* see #ifdef PARANOID */",
+ " break;",
+ "}",
+ },
+ { "n", "mn", "add ,", "0011nnnnmmmm1100",
+ "R[n] += R[m];",
+ },
+
+ { "n", "mn", "addc ,", "0011nnnnmmmm1110",
+ "ult = R[n] + T;",
+ "SET_SR_T (ult < R[n]);",
+ "R[n] = ult + R[m];",
+ "SET_SR_T (T || (R[n] < ult));",
+ },
+
+ { "n", "mn", "addv ,", "0011nnnnmmmm1111",
+ "ult = R[n] + R[m];",
+ "SET_SR_T ((~(R[n] ^ R[m]) & (ult ^ R[n])) >> 31);",
+ "R[n] = ult;",
+ },
+
+ { "0", "", "and #,R0", "11001001i8*1....",
+ "R0 &= i;",
+ },
+ { "n", "nm", "and ,", "0010nnnnmmmm1001",
+ "R[n] &= R[m];",
+ },
+ { "", "0", "and.b #,@(R0,GBR)", "11001101i8*1....",
+ "MA (1);",
+ "WBAT (GBR + R0, RBAT (GBR + R0) & i);",
+ },
+
+ { "", "", "bf ", "10001011i8p1....",
+ "if (!T) {",
+ " nia = PC + 4 + (SEXT(i) * 2);",
+ " cycles += 2;",
+ "}",
+ },
+
+ { "", "", "bf.s ", "10001111i8p1....",
+ "if (!T) {",
+ " nia = PC + 4 + (SEXT (i) * 2);",
+ " cycles += 2;",
+ " Delay_Slot (PC + 2);",
+ "}",
+ },
+
+ { "", "", "bra ", "1010i12.........",
+ "nia = PC + 4 + (SEXT12 (i) * 2);",
+ "Delay_Slot (PC + 2);",
+ },
+
+ { "", "n", "braf ", "0000nnnn00100011",
+ "nia = PC + 4 + R[n];",
+ "Delay_Slot (PC + 2);",
+ },
+
+ { "", "", "bsr ", "1011i12.........",
+ "PR = PC + 4;",
+ "nia = PC + 4 + (SEXT12 (i) * 2);",
+ "Delay_Slot (PC + 2);",
+ },
+
+ { "", "n", "bsrf ", "0000nnnn00000011",
+ "PR = PC + 4;",
+ "nia = PC + 4 + R[n];",
+ "Delay_Slot (PC + 2);",
+ },
+
+ { "", "", "bt ", "10001001i8p1....",
+ "if (T) {",
+ " nia = PC + 4 + (SEXT (i) * 2);",
+ " cycles += 2;",
+ "}",
+ },
+
+ { "", "", "bt.s ", "10001101i8p1....",
+ "if (T) {",
+ " nia = PC + 4 + (SEXT (i) * 2);",
+ " cycles += 2;",
+ " Delay_Slot (PC + 2);",
+ "}",
+ },
+
+ { "", "", "clrmac", "0000000000101000",
+ "MACH = 0;",
+ "MACL = 0;",
+ },
+
+ { "", "", "clrs", "0000000001001000",
+ "SET_SR_S (0);",
+ },
+
+ { "", "", "clrt", "0000000000001000",
+ "SET_SR_T (0);",
+ },
+
+ { "", "0", "cmp/eq #,R0", "10001000i8*1....",
+ "SET_SR_T (R0 == SEXT (i));",
+ },
+ { "", "mn", "cmp/eq ,", "0011nnnnmmmm0000",
+ "SET_SR_T (R[n] == R[m]);",
+ },
+ { "", "mn", "cmp/ge ,", "0011nnnnmmmm0011",
+ "SET_SR_T (R[n] >= R[m]);",
+ },
+ { "", "mn", "cmp/gt ,", "0011nnnnmmmm0111",
+ "SET_SR_T (R[n] > R[m]);",
+ },
+ { "", "mn", "cmp/hi ,", "0011nnnnmmmm0110",
+ "SET_SR_T (UR[n] > UR[m]);",
+ },
+ { "", "mn", "cmp/hs ,", "0011nnnnmmmm0010",
+ "SET_SR_T (UR[n] >= UR[m]);",
+ },
+ { "", "n", "cmp/pl ", "0100nnnn00010101",
+ "SET_SR_T (R[n] > 0);",
+ },
+ { "", "n", "cmp/pz ", "0100nnnn00010001",
+ "SET_SR_T (R[n] >= 0);",
+ },
+ { "", "mn", "cmp/str ,", "0010nnnnmmmm1100",
+ "ult = R[n] ^ R[m];",
+ "SET_SR_T (((ult & 0xff000000) == 0)",
+ " | ((ult & 0xff0000) == 0)",
+ " | ((ult & 0xff00) == 0)",
+ " | ((ult & 0xff) == 0));",
+ },
+
+ { "", "mn", "div0s ,", "0010nnnnmmmm0111",
+ "SET_SR_Q ((R[n] & sbit) != 0);",
+ "SET_SR_M ((R[m] & sbit) != 0);",
+ "SET_SR_T (M != Q);",
+ },
+
+ { "", "", "div0u", "0000000000011001",
+ "SET_SR_M (0);",
+ "SET_SR_Q (0);",
+ "SET_SR_T (0);",
+ },
+
+ { "", "", "div1 ,", "0011nnnnmmmm0100",
+ "div1 (R, m, n/*, T*/);",
+ },
+
+ { "", "nm", "dmuls.l ,", "0011nnnnmmmm1101",
+ "dmul (1/*signed*/, R[n], R[m]);",
+ },
+
+ { "", "nm", "dmulu.l ,", "0011nnnnmmmm0101",
+ "dmul (0/*unsigned*/, R[n], R[m]);",
+ },
+
+ { "n", "n", "dt ", "0100nnnn00010000",
+ "R[n]--;",
+ "SET_SR_T (R[n] == 0);",
+ },
+
+ { "n", "m", "exts.b ,", "0110nnnnmmmm1110",
+ "R[n] = SEXT (R[m]);",
+ },
+ { "n", "m", "exts.w ,", "0110nnnnmmmm1111",
+ "R[n] = SEXTW (R[m]);",
+ },
+
+ { "n", "m", "extu.b ,", "0110nnnnmmmm1100",
+ "R[n] = (R[m] & 0xff);",
+ },
+ { "n", "m", "extu.w ,", "0110nnnnmmmm1101",
+ "R[n] = (R[m] & 0xffff);",
+ },
+
+ /* sh3e */
+ { "", "", "fabs ", "1111nnnn01011101",
+ "FP_UNARY (n, fabs);",
+ "/* FIXME: FR(n) &= 0x7fffffff; */",
+ },
+
+ /* sh3e */
+ { "", "", "fadd ,", "1111nnnnmmmm0000",
+ "FP_OP (n, +, m);",
+ },
+
+ /* sh3e */
+ { "", "", "fcmp/eq ,", "1111nnnnmmmm0100",
+ "FP_CMP (n, ==, m);",
+ },
+ /* sh3e */
+ { "", "", "fcmp/gt ,", "1111nnnnmmmm0101",
+ "FP_CMP (n, >, m);",
+ },
+
+ /* sh4 */
+ { "", "", "fcnvds ,FPUL", "1111nnnn10111101",
+ "if (! FPSCR_PR || n & 1)",
+ " saved_state.asregs.exception = SIGILL;",
+ "else",
+ "{",
+ " union",
+ " {",
+ " int i;",
+ " float f;",
+ " } u;",
+ " u.f = DR(n);",
+ " FPUL = u.i;",
+ "}",
+ },
+
+ /* sh4 */
+ { "", "", "fcnvsd FPUL,", "1111nnnn10101101",
+ "if (! FPSCR_PR || n & 1)",
+ " saved_state.asregs.exception = SIGILL;",
+ "else",
+ "{",
+ " union",
+ " {",
+ " int i;",
+ " float f;",
+ " } u;",
+ " u.i = FPUL;",
+ " SET_DR(n, u.f);",
+ "}",
+ },
+
+ /* sh3e */
+ { "", "", "fdiv ,", "1111nnnnmmmm0011",
+ "FP_OP (n, /, m);",
+ "/* FIXME: check for DP and (n & 1) == 0? */",
+ },
+
+ /* sh4 */
+ { "", "", "fipr ,", "1111nnmm11101101",
+ "/* FIXME: not implemented */",
+ "saved_state.asregs.exception = SIGILL;",
+ "/* FIXME: check for DP and (n & 1) == 0? */",
+ },
+
+ /* sh3e */
+ { "", "", "fldi0 ", "1111nnnn10001101",
+ "SET_FR (n, (float)0.0);",
+ "/* FIXME: check for DP and (n & 1) == 0? */",
+ },
+
+ /* sh3e */
+ { "", "", "fldi1 ", "1111nnnn10011101",
+ "SET_FR (n, (float)1.0);",
+ "/* FIXME: check for DP and (n & 1) == 0? */",
+ },
+
+ /* sh3e */
+ { "", "", "flds ,FPUL", "1111nnnn00011101",
+ " union",
+ " {",
+ " int i;",
+ " float f;",
+ " } u;",
+ " u.f = FR(n);",
+ " FPUL = u.i;",
+ },
+
+ /* sh3e */
+ { "", "", "float FPUL,", "1111nnnn00101101",
+ /* sh4 */
+ "if (FPSCR_PR)",
+ " SET_DR (n, (double)FPUL);",
+ "else",
+ "{",
+ " SET_FR (n, (float)FPUL);",
+ "}",
+ },
+
+ /* sh3e */
+ { "", "", "fmac ,,", "1111nnnnmmmm1110",
+ "SET_FR (n, FR(m) * FR(0) + FR(n));",
+ "/* FIXME: check for DP and (n & 1) == 0? */",
+ },
+
+ /* sh3e */
+ { "", "", "fmov ,", "1111nnnnmmmm1100",
+ /* sh4 */
+ "if (FPSCR_SZ) {",
+ " int ni = XD_TO_XF (n);",
+ " int mi = XD_TO_XF (m);",
+ " SET_XF (ni + 0, XF (mi + 0));",
+ " SET_XF (ni + 1, XF (mi + 1));",
+ "}",
+ "else",
+ "{",
+ " SET_FR (n, FR (m));",
+ "}",
+ },
+ /* sh3e */
+ { "", "", "fmov.s ,@", "1111nnnnmmmm1010",
+ /* sh4 */
+ "if (FPSCR_SZ) {",
+ " MA (2);",
+ " WDAT (R[n], m);",
+ "}",
+ "else",
+ "{",
+ " MA (1);",
+ " WLAT (R[n], FI(m));",
+ "}",
+ },
+ /* sh3e */
+ { "", "", "fmov.s @,", "1111nnnnmmmm1000",
+ /* sh4 */
+ "if (FPSCR_SZ) {",
+ " MA (2);",
+ " RDAT (R[m], n);",
+ "}",
+ "else",
+ "{",
+ " MA (1);",
+ " SET_FI(n, RLAT(R[m]));",
+ "}",
+ },
+ /* sh3e */
+ { "", "", "fmov.s @+,", "1111nnnnmmmm1001",
+ /* sh4 */
+ "if (FPSCR_SZ) {",
+ " MA (2);",
+ " RDAT (R[m], n);",
+ " R[m] += 8;",
+ "}",
+ "else",
+ "{",
+ " MA (1);",
+ " SET_FI (n, RLAT (R[m]));",
+ " R[m] += 4;",
+ "}",
+ },
+ /* sh3e */
+ { "", "", "fmov.s ,@-", "1111nnnnmmmm1011",
+ /* sh4 */
+ "if (FPSCR_SZ) {",
+ " MA (2);",
+ " R[n] -= 8;",
+ " WDAT (R[n], m);",
+ "}",
+ "else",
+ "{",
+ " MA (1);",
+ " R[n] -= 4;",
+ " WLAT (R[n], FI(m));",
+ "}",
+ },
+ /* sh3e */
+ { "", "", "fmov.s @(R0,),", "1111nnnnmmmm0110",
+ /* sh4 */
+ "if (FPSCR_SZ) {",
+ " MA (2);",
+ " RDAT (R[0]+R[m], n);",
+ "}",
+ "else",
+ "{",
+ " MA (1);",
+ " SET_FI(n, RLAT(R[0] + R[m]));",
+ "}",
+ },
+ /* sh3e */
+ { "", "", "fmov.s ,@(R0,)", "1111nnnnmmmm0111",
+ /* sh4 */
+ "if (FPSCR_SZ) {",
+ " MA (2);",
+ " WDAT (R[0]+R[n], m);",
+ "}",
+ "else",
+ "{",
+ " MA (1);",
+ " WLAT((R[0]+R[n]), FI(m));",
+ "}",
+ },
+
+ /* sh4: See fmov instructions above for move to/from extended fp registers */
+
+ /* sh3e */
+ { "", "", "fmul ,", "1111nnnnmmmm0010",
+ "FP_OP(n, *, m);",
+ },
+
+ /* sh3e */
+ { "", "", "fneg ", "1111nnnn01001101",
+ "FP_UNARY(n, -);",
+ },
+
+ /* sh4 */
+ { "", "", "frchg", "1111101111111101",
+ "SET_FPSCR (GET_FPSCR() ^ FPSCR_MASK_FR);",
+ },
+
+ /* sh4 */
+ { "", "", "fschg", "1111001111111101",
+ "SET_FPSCR (GET_FPSCR() ^ FPSCR_MASK_SZ);",
+ },
+
+ /* sh3e */
+ { "", "", "fsqrt ", "1111nnnn01101101",
+ "FP_UNARY(n, sqrt);",
+ },
+
+ /* sh3e */
+ { "", "", "fsub ,", "1111nnnnmmmm0001",
+ "FP_OP(n, -, m);",
+ },
+
+ /* sh3e */
+ { "", "", "ftrc , FPUL", "1111nnnn00111101",
+ /* sh4 */
+ "if (FPSCR_PR) {",
+ " if (DR(n) != DR(n)) /* NaN */",
+ " FPUL = 0x80000000;",
+ " else",
+ " FPUL = (int)DR(n);",
+ "}",
+ "else",
+ "if (FR(n) != FR(n)) /* NaN */",
+ " FPUL = 0x80000000;",
+ "else",
+ " FPUL = (int)FR(n);",
+ },
+
+ /* sh3e */
+ { "", "", "fsts FPUL,", "1111nnnn00001101",
+ " union",
+ " {",
+ " int i;",
+ " float f;",
+ " } u;",
+ " u.i = FPUL;",
+ " SET_FR (n, u.f);",
+ },
+
+ { "", "n", "jmp @", "0100nnnn00101011",
+ "nia = R[n];",
+ "Delay_Slot (PC + 2);",
+ },
+
+ { "", "n", "jsr @", "0100nnnn00001011",
+ "PR = PC + 4;",
+ "nia = R[n];",
+ "if (~doprofile)",
+ " gotcall (PR, nia);",
+ "Delay_Slot (PC + 2);",
+ },
+
+ { "", "n", "ldc ,GBR", "0100nnnn00011110",
+ "GBR = R[n];",
+ "/* FIXME: user mode */",
+ },
+ { "", "n", "ldc ,SR", "0100nnnn00001110",
+ "SET_SR (R[n]);",
+ "/* FIXME: user mode */",
+ },
+ { "", "n", "ldc ,VBR", "0100nnnn00101110",
+ "VBR = R[n];",
+ "/* FIXME: user mode */",
+ },
+ { "", "n", "ldc ,SSR", "0100nnnn00111110",
+ "SSR = R[n];",
+ "/* FIXME: user mode */",
+ },
+ { "", "n", "ldc ,SPC", "0100nnnn01001110",
+ "SPC = R[n];",
+ "/* FIXME: user mode */",
+ },
+#if 0
+ { "", "n", "ldc ,DBR", "0100nnnn11111010",
+ "DBR = R[n];",
+ "/* FIXME: user mode */",
+ },
+#endif
+ { "", "n", "ldc ,R0_BANK", "0100nnnn10001110",
+ "SET_Rn_BANK (0, R[n]);",
+ "/* FIXME: user mode */",
+ },
+ { "", "n", "ldc ,R1_BANK", "0100nnnn10011110",
+ "SET_Rn_BANK (1, R[n]);",
+ "/* FIXME: user mode */",
+ },
+ { "", "n", "ldc ,R2_BANK", "0100nnnn10101110",
+ "SET_Rn_BANK (2, R[n]);",
+ "/* FIXME: user mode */",
+ },
+ { "", "n", "ldc ,R3_BANK", "0100nnnn10111110",
+ "SET_Rn_BANK (3, R[n]);",
+ "/* FIXME: user mode */",
+ },
+ { "", "n", "ldc ,R4_BANK", "0100nnnn11001110",
+ "SET_Rn_BANK (4, R[n]);",
+ "/* FIXME: user mode */",
+ },
+ { "", "n", "ldc ,R5_BANK", "0100nnnn11011110",
+ "SET_Rn_BANK (5, R[n]);",
+ "/* FIXME: user mode */",
+ },
+ { "", "n", "ldc ,R6_BANK", "0100nnnn11101110",
+ "SET_Rn_BANK (6, R[n]);",
+ "/* FIXME: user mode */",
+ },
+ { "", "n", "ldc ,R7_BANK", "0100nnnn11111110",
+ "SET_Rn_BANK (7, R[n]);",
+ "/* FIXME: user mode */",
+ },
+ { "", "n", "ldc.l @+,GBR", "0100nnnn00010111",
+ "MA (1);",
+ "GBR = RLAT (R[n]);",
+ "R[n] += 4;",
+ "/* FIXME: user mode */",
+ },
+ { "", "n", "ldc.l @+,SR", "0100nnnn00000111",
+ "MA (1);",
+ "SET_SR (RLAT (R[n]));",
+ "R[n] += 4;",
+ "/* FIXME: user mode */",
+ },
+ { "", "n", "ldc.l @+,VBR", "0100nnnn00100111",
+ "MA (1);",
+ "VBR = RLAT (R[n]);",
+ "R[n] += 4;",
+ "/* FIXME: user mode */",
+ },
+ { "", "n", "ldc.l @+,SSR", "0100nnnn00110111",
+ "MA (1);",
+ "SSR = RLAT (R[n]);",
+ "R[n] += 4;",
+ "/* FIXME: user mode */",
+ },
+ { "", "n", "ldc.l @+,SPC", "0100nnnn01000111",
+ "MA (1);",
+ "SPC = RLAT (R[n]);",
+ "R[n] += 4;",
+ "/* FIXME: user mode */",
+ },
+#if 0
+ { "", "n", "ldc.l @+,DBR", "0100nnnn11110110",
+ "MA (1);",
+ "DBR = RLAT (R[n]);",
+ "R[n] += 4;",
+ "/* FIXME: user mode */",
+ },
+#endif
+ { "", "n", "ldc.l @+,R0_BANK", "0100nnnn10000111",
+ "MA (1);",
+ "SET_Rn_BANK (0, RLAT (R[n]));",
+ "R[n] += 4;",
+ "/* FIXME: user mode */",
+ },
+ { "", "n", "ldc.l @+,R1_BANK", "0100nnnn10010111",
+ "MA (1);",
+ "SET_Rn_BANK (1, RLAT (R[n]));",
+ "R[n] += 4;",
+ "/* FIXME: user mode */",
+ },
+ { "", "n", "ldc.l @+,R2_BANK", "0100nnnn10100111",
+ "MA (1);",
+ "SET_Rn_BANK (2, RLAT (R[n]));",
+ "R[n] += 4;",
+ "/* FIXME: user mode */",
+ },
+ { "", "n", "ldc.l @+,R3_BANK", "0100nnnn10110111",
+ "MA (1);",
+ "SET_Rn_BANK (3, RLAT (R[n]));",
+ "R[n] += 4;",
+ "/* FIXME: user mode */",
+ },
+ { "", "n", "ldc.l @+,R4_BANK", "0100nnnn11000111",
+ "MA (1);",
+ "SET_Rn_BANK (4, RLAT (R[n]));",
+ "R[n] += 4;",
+ "/* FIXME: user mode */",
+ },
+ { "", "n", "ldc.l @+,R5_BANK", "0100nnnn11010111",
+ "MA (1);",
+ "SET_Rn_BANK (5, RLAT (R[n]));",
+ "R[n] += 4;",
+ "/* FIXME: user mode */",
+ },
+ { "", "n", "ldc.l @+,R6_BANK", "0100nnnn11100111",
+ "MA (1);",
+ "SET_Rn_BANK (6, RLAT (R[n]));",
+ "R[n] += 4;",
+ "/* FIXME: user mode */",
+ },
+ { "", "n", "ldc.l @+,R7_BANK", "0100nnnn11110111",
+ "MA (1);",
+ "SET_Rn_BANK (7, RLAT (R[n]));",
+ "R[n] += 4;",
+ "/* FIXME: user mode */",
+ },
+
+ /* sh3e */
+ { "", "", "lds ,FPUL", "0100nnnn01011010",
+ "FPUL = R[n];",
+ },
+ /* sh3e */
+ { "", "", "lds.l @+,FPUL", "0100nnnn01010110",
+ "MA (1);",
+ "FPUL = RLAT(R[n]);",
+ "R[n] += 4;",
+ },
+ /* sh3e */
+ { "", "", "lds ,FPSCR", "0100nnnn01101010",
+ "SET_FPSCR(R[n]);",
+ },
+ /* sh3e */
+ { "", "", "lds.l @+,FPSCR", "0100nnnn01100110",
+ "MA (1);",
+ "SET_FPSCR (RLAT(R[n]));",
+ "R[n] += 4;",
+ },
+
+ { "", "n", "lds ,MACH", "0100nnnn00001010",
+ "MACH = R[n];",
+ },
+ { "", "n", "lds ,MACL", "0100nnnn00011010",
+ "MACL= R[n];",
+ },
+ { "", "n", "lds ,PR", "0100nnnn00101010",
+ "PR = R[n];",
+ },
+ { "", "n", "lds.l @+,MACH", "0100nnnn00000110",
+ "MA (1);",
+ "MACH = SEXT(RLAT(R[n]));",
+ "R[n]+=4;",
+ },
+ { "", "n", "lds.l @+,MACL", "0100nnnn00010110",
+ "MA (1);",
+ "MACL = RLAT(R[n]);",
+ "R[n]+=4;",
+ },
+ { "", "n", "lds.l @+,PR", "0100nnnn00100110",
+ "MA (1);",
+ "PR = RLAT(R[n]);",
+ "R[n]+=4;;",
+ },
+
+ { "", "", "ldtlb", "0000000000111000",
+ "/* FIXME: XXX*/ abort();",
+ },
+
+ { "", "nm", "mac.l @+,@+", "0000nnnnmmmm1111",
+ "trap (255,R0,memory,maskl,maskw,little_endian);",
+ "/* FIXME: mac.l support */",
+ },
+
+ { "", "nm", "mac.w @+,@+", "0100nnnnmmmm1111",
+ "macw(R0,memory,n,m);",
+ },
+
+ { "n", "", "mov #,", "1110nnnni8*1....",
+ "R[n] = SEXT(i);",
+ },
+ { "n", "m", "mov ,", "0110nnnnmmmm0011",
+ "R[n] = R[m];",
+ },
+
+ { "0", "", "mov.b @(,GBR),R0", "11000100i8*1....",
+ "MA (1);",
+ "R0 = RSBAT (i + GBR);",
+ "L (0);",
+ },
+ { "0", "m", "mov.b @(,),R0", "10000100mmmmi4*1",
+ "MA (1);",
+ "R0 = RSBAT (i + R[m]);",
+ "L (0);",
+ },
+ { "n", "0m", "mov.b @(R0,),", "0000nnnnmmmm1100",
+ "MA (1);",
+ "R[n] = RSBAT (R0 + R[m]);",
+ "L (n);",
+ },
+ { "n", "m", "mov.b @+,", "0110nnnnmmmm0100",
+ "MA (1);",
+ "R[n] = RSBAT (R[m]);",
+ "R[m] += 1;",
+ "L (n);",
+ },
+ { "", "mn", "mov.b ,@", "0010nnnnmmmm0000",
+ "MA (1);",
+ "WBAT (R[n], R[m]);",
+ },
+ { "", "0", "mov.b R0,@(,GBR)", "11000000i8*1....",
+ "MA (1);",
+ "WBAT (i + GBR, R0);",
+ },
+ { "", "m0", "mov.b R0,@(,)", "10000000mmmmi4*1",
+ "MA (1);",
+ "WBAT (i + R[m], R0);",
+ },
+ { "", "mn0", "mov.b ,@(R0,)", "0000nnnnmmmm0100",
+ "MA (1);",
+ "WBAT (R[n] + R0, R[m]);",
+ },
+ { "", "nm", "mov.b ,@-", "0010nnnnmmmm0100",
+ "MA (1);",
+ "R[n] -= 1;",
+ "WBAT (R[n], R[m]);",
+ },
+ { "n", "m", "mov.b @,", "0110nnnnmmmm0000",
+ "MA (1);",
+ "R[n] = RSBAT (R[m]);",
+ "L (n);",
+ },
+
+ { "0", "", "mov.l @(,GBR),R0", "11000110i8*4....",
+ "MA (1);",
+ "R0 = RLAT (i + GBR);",
+ "L (0);",
+ },
+ { "n", "", "mov.l @(,PC),", "1101nnnni8p4....",
+ "MA (1);",
+ "R[n] = RLAT((PC & ~3) + 4 + i);",
+ "L (n);",
+ },
+ { "n", "m", "mov.l @(,),", "0101nnnnmmmmi4*4",
+ "MA (1);",
+ "R[n] = RLAT (i + R[m]);",
+ "L (n);",
+ },
+ { "n", "m0", "mov.l @(R0,),", "0000nnnnmmmm1110",
+ "MA (1);",
+ "R[n] = RLAT (R0 + R[m]);",
+ "L (n);",
+ },
+ { "nm", "m", "mov.l @+,", "0110nnnnmmmm0110",
+ "MA (1);",
+ "R[n] = RLAT (R[m]);",
+ "R[m] += 4;",
+ "L (n);",
+ },
+ { "n", "m", "mov.l @,", "0110nnnnmmmm0010",
+ "MA (1);",
+ "R[n] = RLAT (R[m]);",
+ "L (n);",
+ },
+ { "", "0", "mov.l R0,@(,GBR)", "11000010i8*4....",
+ "MA (1);",
+ "WLAT (i + GBR, R0);",
+ },
+ { "", "nm", "mov.l ,@(,)", "0001nnnnmmmmi4*4",
+ "MA (1);",
+ "WLAT (i + R[n], R[m]);",
+ },
+ { "", "nm0", "mov.l ,@(R0,)", "0000nnnnmmmm0110",
+ "MA (1);",
+ "WLAT (R0 + R[n], R[m]);",
+ },
+ { "", "nm", "mov.l ,@-", "0010nnnnmmmm0110",
+ "MA (1) ;",
+ "R[n] -= 4;",
+ "WLAT (R[n], R[m]);",
+ },
+ { "", "nm", "mov.l ,@", "0010nnnnmmmm0010",
+ "MA (1);",
+ "WLAT (R[n], R[m]);",
+ },
+
+ { "0", "", "mov.w @(,GBR),R0", "11000101i8*2....",
+ "MA (1)",
+ ";R0 = RSWAT (i + GBR);",
+ "L (0);",
+ },
+ { "n", "", "mov.w @(,PC),", "1001nnnni8p2....",
+ "MA (1);",
+ "R[n] = RSWAT (PC + 4 + i);",
+ "L (n);",
+ },
+ { "0", "m", "mov.w @(,),R0", "10000101mmmmi4*2",
+ "MA (1);",
+ "R0 = RSWAT (i + R[m]);",
+ "L (0);",
+ },
+ { "n", "m0", "mov.w @(R0,),", "0000nnnnmmmm1101",
+ "MA (1);",
+ "R[n] = RSWAT (R0 + R[m]);",
+ "L (n);",
+ },
+ { "nm", "n", "mov.w @+,", "0110nnnnmmmm0101",
+ "MA (1);",
+ "R[n] = RSWAT (R[m]);",
+ "R[m] += 2;",
+ "L (n);",
+ },
+ { "n", "m", "mov.w @,", "0110nnnnmmmm0001",
+ "MA (1);",
+ "R[n] = RSWAT (R[m]);",
+ "L (n);",
+ },
+ { "", "0", "mov.w R0,@(,GBR)", "11000001i8*2....",
+ "MA (1);",
+ "WWAT (i + GBR, R0);",
+ },
+ { "", "0m", "mov.w R0,@(,)", "10000001mmmmi4*2",
+ "MA (1);",
+ "WWAT (i + R[m], R0);",
+ },
+ { "", "m0n", "mov.w ,@(R0,)", "0000nnnnmmmm0101",
+ "MA (1);",
+ "WWAT (R0 + R[n], R[m]);",
+ },
+ { "n", "mn", "mov.w ,@-", "0010nnnnmmmm0101",
+ "MA (1);",
+ "R[n] -= 2;",
+ "WWAT (R[n], R[m]);",
+ },
+ { "", "nm", "mov.w ,@", "0010nnnnmmmm0001",
+ "MA (1);",
+ "WWAT (R[n], R[m]);",
+ },
+
+ { "0", "", "mova @(,PC),R0", "11000111i8p4....",
+ "R0 = ((i + 4 + PC) & ~0x3);",
+ },
+
+ { "0", "", "movca.l @R0, ", "0000nnnn11000011",
+ "/* FIXME: Not implemented */",
+ "saved_state.asregs.exception = SIGILL;",
+ },
+
+ { "n", "", "movt ", "0000nnnn00101001",
+ "R[n] = T;",
+ },
+
+ { "", "mn", "mul.l ,", "0000nnnnmmmm0111",
+ "MACL = ((int)R[n]) * ((int)R[m]);",
+ },
+#if 0
+ { "", "nm", "mul.l ,", "0000nnnnmmmm0111",
+ "MACL = R[n] * R[m];",
+ },
+#endif
+
+ /* muls.w - see muls */
+ { "", "mn", "muls ,", "0010nnnnmmmm1111",
+ "MACL = ((int)(short)R[n]) * ((int)(short)R[m]);",
+ },
+
+ /* mulu.w - see mulu */
+ { "", "mn", "mulu ,", "0010nnnnmmmm1110",
+ "MACL = (((unsigned int)(unsigned short)R[n])",
+ " * ((unsigned int)(unsigned short)R[m]));",
+ },
+
+ { "n", "m", "neg ,", "0110nnnnmmmm1011",
+ "R[n] = - R[m];",
+ },
+
+ { "n", "m", "negc ,", "0110nnnnmmmm1010",
+ "ult = -T;",
+ "SET_SR_T (ult > 0);",
+ "R[n] = ult - R[m];",
+ "SET_SR_T (T || (R[n] > ult));",
+ },
+
+ { "", "", "nop", "0000000000001001",
+ "/* nop */",
+ },
+
+ { "n", "m", "not ,", "0110nnnnmmmm0111",
+ "R[n] = ~R[m];",
+ },
+
+ { "0", "", "ocbi @", "0000nnnn10010011",
+ "/* FIXME: Not implemented */",
+ "saved_state.asregs.exception = SIGILL;",
+ },
+
+ { "0", "", "ocbp @", "0000nnnn10100011",
+ "/* FIXME: Not implemented */",
+ "saved_state.asregs.exception = SIGILL;",
+ },
+
+ { "", "n", "ocbwb @", "0000nnnn10110011",
+ "RSBAT (R[n]); /* Take exceptions like byte load. */",
+ "/* FIXME: Cache not implemented */",
+ },
+
+ { "0", "", "or #,R0", "11001011i8*1....",
+ "R0 |= i;",
+ },
+ { "n", "m", "or ,", "0010nnnnmmmm1011",
+ "R[n] |= R[m];",
+ },
+ { "", "0", "or.b #,@(R0,GBR)", "11001111i8*1....",
+ "MA (1);",
+ "WBAT (R0 + GBR, (RBAT (R0 + GBR) | i));",
+ },
+
+ { "", "n", "pref @", "0000nnnn10000011",
+ "/* Except for the effect on the cache - which is not simulated -",
+ " this is like a nop. */",
+ },
+
+ { "n", "n", "rotcl ", "0100nnnn00100100",
+ "ult = R[n] < 0;",
+ "R[n] = (R[n] << 1) | T;",
+ "SET_SR_T (ult);",
+ },
+
+ { "n", "n", "rotcr ", "0100nnnn00100101",
+ "ult = R[n] & 1;",
+ "R[n] = (UR[n] >> 1) | (T << 31);",
+ "SET_SR_T (ult);",
+ },
+
+ { "n", "n", "rotl ", "0100nnnn00000100",
+ "SET_SR_T (R[n] < 0);",
+ "R[n] <<= 1;",
+ "R[n] |= T;",
+ },
+
+ { "n", "n", "rotr ", "0100nnnn00000101",
+ "SET_SR_T (R[n] & 1);",
+ "R[n] = UR[n] >> 1;",
+ "R[n] |= (T << 31);",
+ },
+
+ { "", "", "rte", "0000000000101011",
+#if 0
+ /* SH-[12] */
+ "int tmp = PC;",
+ "nia = RLAT (R[15]) + 2;",
+ "R[15] += 4;",
+ "SET_SR (RLAT (R[15]) & 0x3f3);",
+ "R[15] += 4;",
+ "Delay_Slot (PC + 2);",
+#else
+ "nia = SPC;",
+ "SET_SR (SSR);",
+ "Delay_Slot (PC + 2);",
+#endif
+ },
+
+ { "", "", "rts", "0000000000001011",
+ "nia = PR;",
+ "Delay_Slot (PC + 2);",
+ },
+
+ { "", "", "sets", "0000000001011000",
+ "SET_SR_S (1);",
+ },
+
+ { "", "", "sett", "0000000000011000",
+ "SET_SR_T (1);",
+ },
+
+ { "n", "mn", "shad ,", "0100nnnnmmmm1100",
+ "R[n] = (R[m] < 0) ? (R[n] >> ((-R[m])&0x1f)) : (R[n] << (R[m] & 0x1f));",
+ },
+
+ { "n", "n", "shal ", "0100nnnn00100000",
+ "SET_SR_T (R[n] < 0);",
+ "R[n] <<= 1;",
+ },
+
+ { "n", "n", "shar ", "0100nnnn00100001",
+ "SET_SR_T (R[n] & 1);",
+ "R[n] = R[n] >> 1;",
+ },
+
+ { "n", "mn", "shld ,", "0100nnnnmmmm1101",
+ "R[n] = (R[m] < 0) ? (UR[n] >> ((-R[m])&0x1f)): (R[n] << (R[m] & 0x1f));",
+ },
+
+ { "n", "n", "shll ", "0100nnnn00000000",
+ "SET_SR_T (R[n] < 0);",
+ "R[n] <<= 1;",
+ },
+
+ { "n", "n", "shll2 ", "0100nnnn00001000",
+ "R[n] <<= 2;",
+ },
+ { "n", "n", "shll8 ", "0100nnnn00011000",
+ "R[n] <<= 8;",
+ },
+ { "n", "n", "shll16 ", "0100nnnn00101000",
+ "R[n] <<= 16;",
+ },
+
+ { "n", "n", "shlr ", "0100nnnn00000001",
+ "SET_SR_T (R[n] & 1);",
+ "R[n] = UR[n] >> 1;",
+ },
+
+ { "n", "n", "shlr2 ", "0100nnnn00001001",
+ "R[n] = UR[n] >> 2;",
+ },
+ { "n", "n", "shlr8