From 339bf716b650ad0f0e14dc0084167bc99e0bf6e5 Mon Sep 17 00:00:00 2001 From: kvigor Date: Tue, 29 Apr 2003 22:47:39 +0000 Subject: [PATCH] DS80C400 support, the beginning git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@2574 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- ChangeLog | 5 + configure | 973 +++++++----------------- configure.in | 12 + device/examples/ds400/hello400/Makefile | 20 + device/examples/ds400/hello400/Readme | 2 + device/examples/ds400/hello400/hello.c | 37 + device/include/stdarg.h | 2 +- device/lib/Makefile.in | 10 +- device/lib/ds400/Makefile | 42 + device/lib/ds400/memcpyx.c | 78 ++ device/lib/ds400/tinibios.c | 229 ++++++ sdcc_vc_in.h | 1 + sdccconf_in.h | 2 + src/SDCCglue.c | 13 +- src/SDCCmain.c | 35 +- src/SDCCsymt.c | 3 +- src/ds390/gen.c | 101 ++- src/ds390/main.c | 190 ++++- src/ds390/peeph.def | 277 +++++++ src/ds400/Makefile | 2 + src/ds400/main.c | 14 + src/ds400/main.h | 6 + src/port.h | 5 + 23 files changed, 1310 insertions(+), 749 deletions(-) create mode 100644 device/examples/ds400/hello400/Makefile create mode 100644 device/examples/ds400/hello400/Readme create mode 100644 device/examples/ds400/hello400/hello.c create mode 100755 device/lib/ds400/Makefile create mode 100644 device/lib/ds400/memcpyx.c create mode 100755 device/lib/ds400/tinibios.c create mode 100644 src/ds400/Makefile create mode 100644 src/ds400/main.c create mode 100644 src/ds400/main.h diff --git a/ChangeLog b/ChangeLog index 65b2ab8c..00d3bb53 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2003-04-29 Kevin Vigor + + Initial support for DS80C400. "Hello world" runs on TINIm400 + (with polled I/O). + 2003-04-28 Karl Bongers(apply patches for Martin Helmling) * debugger/mcs51/sdcdb.c,simi.c,cmd.c,symtab.c and .h files. diff --git a/configure b/configure index e01cd7f4..904ebf36 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.57. +# Generated by GNU Autoconf 2.54. # # Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 # Free Software Foundation, Inc. @@ -36,10 +36,7 @@ PS2='> ' PS4='+ ' # NLS nuisances. -for as_var in \ - LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ - LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ - LC_TELEPHONE LC_TIME +for as_var in LANG LANGUAGE LC_ALL LC_COLLATE LC_CTYPE LC_NUMERIC LC_MESSAGES LC_TIME do if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var @@ -85,15 +82,15 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + echo "#! /bin/sh" >conftest.sh + echo "exit 0" >>conftest.sh + chmod +x conftest.sh + if (PATH="/nonexistent;."; conftest.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi - rm -f conf$$.sh + rm -f conftest.sh fi @@ -876,6 +873,7 @@ Optional Features: --disable-z80-port Excludes the z80 port --disable-avr-port Excludes the AVR port --disable-ds390-port Excludes the DS390 port + --disable-ds400-port Excludes the DS400 port --disable-pic-port Excludes the PIC port --disable-xa51-port Excludes the XA51 port --disable-ucsim Disables configuring and building of ucsim @@ -982,7 +980,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was -generated by GNU Autoconf 2.57. Invocation command line was +generated by GNU Autoconf 2.54. Invocation command line was $ $0 $@ @@ -1034,54 +1032,24 @@ _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. -# Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. -# Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= -ac_configure_args0= -ac_configure_args1= ac_sep= -ac_must_keep_next=false -for ac_pass in 1 2 +for ac_arg do - for ac_arg - do - case $ac_arg in - -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - continue ;; - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) - ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - case $ac_pass in - 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; - 2) - ac_configure_args1="$ac_configure_args1 '$ac_arg'" - if test $ac_must_keep_next = true; then - ac_must_keep_next=false # Got value, back to normal. - else - case $ac_arg in - *=* | --config-cache | -C | -disable-* | --disable-* \ - | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ - | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ - | -with-* | --with-* | -without-* | --without-* | --x) - case "$ac_configure_args0 " in - "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; - esac - ;; - -* ) ac_must_keep_next=true ;; - esac - fi - ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" - # Get rid of the leading space. - ac_sep=" " - ;; - esac - done + case $ac_arg in + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c | -n ) continue ;; + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + continue ;; + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) + ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" + # Get rid of the leading space. + ac_sep=" " done -$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } -$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there @@ -1719,10 +1687,8 @@ fi fi -test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH -See \`config.log' for more details." >&5 -echo "$as_me: error: no acceptable C compiler found in \$PATH -See \`config.log' for more details." >&2;} +test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH" >&5 +echo "$as_me: error: no acceptable C compiler found in \$PATH" >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. @@ -1747,11 +1713,7 @@ ac_compiler=`set X $ac_compile; echo $2` cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#include "confdefs.h" int main () @@ -1762,7 +1724,7 @@ main () } _ACEOF ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files a.out a.exe b.out" +ac_clean_files="$ac_clean_files a.out a.exe" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. @@ -1781,39 +1743,27 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 # Be careful to initialize this variable, since it used to be cached. # Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. ac_cv_exeext= -# b.out is created by i960 compilers. -for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out -do +for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.*; do test -f "$ac_file" || continue case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) - ;; - conftest.$ac_ext ) - # This is the source file. - ;; - [ab].out ) - # We found the default executable, but exeext='' is most - # certainly right. - break;; - *.* ) - ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - # FIXME: I believe we export ac_cv_exeext for Libtool, - # but it would be cool to find out if it's true. Does anybody - # maintain Libtool? --akim. - export ac_cv_exeext - break;; - * ) - break;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; + a.out ) # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + # FIXME: I believe we export ac_cv_exeext for Libtool --akim. + export ac_cv_exeext + break;; + * ) break;; esac done else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: C compiler cannot create executables -See \`config.log' for more details." >&5 +check \`config.log' for details." >&5 echo "$as_me: error: C compiler cannot create executables -See \`config.log' for more details." >&2;} +check \`config.log' for details." >&2;} { (exit 77); exit 77; }; } fi @@ -1840,11 +1790,9 @@ if test "$cross_compiling" != yes; then cross_compiling=yes else { { echo "$as_me:$LINENO: error: cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details." >&5 +If you meant to cross compile, use \`--host'." >&5 echo "$as_me: error: cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details." >&2;} +If you meant to cross compile, use \`--host'." >&2;} { (exit 1); exit 1; }; } fi fi @@ -1852,7 +1800,7 @@ fi echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 -rm -f a.out a.exe conftest$ac_cv_exeext b.out +rm -f a.out a.exe conftest$ac_cv_exeext ac_clean_files=$ac_clean_files_save # Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. @@ -1883,10 +1831,8 @@ for ac_file in conftest.exe conftest conftest.*; do esac done else - { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details." >&2;} + { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link" >&5 +echo "$as_me: error: cannot compute suffix of executables: cannot compile and link" >&2;} { (exit 1); exit 1; }; } fi @@ -1904,11 +1850,7 @@ if test "${ac_cv_objext+set}" = set; then else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#include "confdefs.h" int main () @@ -1933,12 +1875,9 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 done else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute suffix of object files: cannot compile -See \`config.log' for more details." >&2;} +cat conftest.$ac_ext >&5 +{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile" >&5 +echo "$as_me: error: cannot compute suffix of object files: cannot compile" >&2;} { (exit 1); exit 1; }; } fi @@ -1955,11 +1894,7 @@ if test "${ac_cv_c_compiler_gnu+set}" = set; then else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#include "confdefs.h" int main () @@ -1987,8 +1922,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f conftest.$ac_objext conftest.$ac_ext @@ -2008,11 +1942,7 @@ if test "${ac_cv_prog_cc_g+set}" = set; then else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#include "confdefs.h" int main () @@ -2037,8 +1967,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 ac_cv_prog_cc_g=no fi rm -f conftest.$ac_objext conftest.$ac_ext @@ -2069,11 +1998,7 @@ else ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#include "confdefs.h" #include #include #include @@ -2136,8 +2061,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 break else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext done @@ -2188,11 +2112,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 do cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#include "confdefs.h" #include $ac_declaration int @@ -2218,18 +2138,13 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 : else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 continue fi rm -f conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#include "confdefs.h" $ac_declaration int main () @@ -2254,8 +2169,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 break else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext done @@ -2268,8 +2182,7 @@ fi else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext ac_ext=c @@ -2398,11 +2311,7 @@ if test "${ac_cv_cxx_compiler_gnu+set}" = set; then else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#include "confdefs.h" int main () @@ -2430,8 +2339,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f conftest.$ac_objext conftest.$ac_ext @@ -2451,11 +2359,7 @@ if test "${ac_cv_prog_cxx_g+set}" = set; then else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#include "confdefs.h" int main () @@ -2480,8 +2384,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_cv_prog_cxx_g=yes else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 ac_cv_prog_cxx_g=no fi rm -f conftest.$ac_objext conftest.$ac_ext @@ -2514,11 +2417,7 @@ for ac_declaration in \ do cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#include "confdefs.h" #include $ac_declaration int @@ -2544,18 +2443,13 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 : else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 continue fi rm -f conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#include "confdefs.h" $ac_declaration int main () @@ -2580,8 +2474,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 break else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext done @@ -2621,22 +2514,12 @@ for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif +#include "confdefs.h" +#include Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 @@ -2659,8 +2542,7 @@ if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - + cat conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi @@ -2670,11 +2552,7 @@ rm -f conftest.err conftest.$ac_ext # can be detected and how. cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#include "confdefs.h" #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 @@ -2698,8 +2576,7 @@ if test -z "$ac_cpp_err"; then continue else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - + cat conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break @@ -2728,22 +2605,12 @@ for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif +#include "confdefs.h" +#include Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 @@ -2766,8 +2633,7 @@ if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - + cat conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi @@ -2777,11 +2643,7 @@ rm -f conftest.err conftest.$ac_ext # can be detected and how. cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#include "confdefs.h" #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 @@ -2805,8 +2667,7 @@ if test -z "$ac_cpp_err"; then continue else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - + cat conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break @@ -2819,10 +2680,8 @@ rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else - { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details." >&5 -echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details." >&2;} + { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check" >&5 +echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;} { (exit 1); exit 1; }; } fi @@ -3067,11 +2926,7 @@ else LIBS="-lfl $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus @@ -3103,8 +2958,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 ac_cv_lib_fl_yywrap=yes else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 ac_cv_lib_fl_yywrap=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext @@ -3124,11 +2978,7 @@ else LIBS="-ll $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus @@ -3160,8 +3010,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 ac_cv_lib_l_yywrap=yes else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 ac_cv_lib_l_yywrap=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext @@ -3239,8 +3088,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 ac_cv_prog_lex_yytext_pointer=yes else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_save_LIBS @@ -3673,54 +3521,43 @@ if test "${ac_cv_header_stdc+set}" = set; then else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#include "confdefs.h" #include #include #include #include -int -main () -{ - - ; - return 0; -} _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_header_stdc=no + cat conftest.$ac_ext >&5 + ac_cv_header_stdc=no fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#include "confdefs.h" #include _ACEOF @@ -3738,11 +3575,7 @@ 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 <<_ACEOF #line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#include "confdefs.h" #include _ACEOF @@ -3763,18 +3596,13 @@ if test $ac_cv_header_stdc = yes; then else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#include "confdefs.h" #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else -# define ISLOWER(c) \ - (('a' <= (c) && (c) <= 'i') \ +# define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) @@ -3807,8 +3635,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi @@ -3847,11 +3674,7 @@ if eval "test \"\${$as_ac_Header+set}\" = set"; then else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#include "confdefs.h" $ac_includes_default #include <$ac_header> @@ -3871,8 +3694,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f conftest.$ac_objext conftest.$ac_ext @@ -3907,11 +3729,7 @@ echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#include "confdefs.h" $ac_includes_default #include <$ac_header> _ACEOF @@ -3930,8 +3748,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.$ac_objext conftest.$ac_ext @@ -3943,11 +3760,7 @@ echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#include "confdefs.h" #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 @@ -3970,8 +3783,7 @@ if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - + cat conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext @@ -3984,32 +3796,14 @@ case $ac_header_compiler:$ac_header_preproc in { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};; no:yes ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 @@ -4046,44 +3840,31 @@ if eval "test \"\${$as_ac_var+set}\" = set"; then else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ -#ifdef __STDC__ -# include -#else -# include -#endif + which can conflict with char $ac_func (); below. */ +#include /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" -{ #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); +char (*f) (); + +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 -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} +f = $ac_func; #endif -int -main () -{ -return f != $ac_func; ; return 0; } @@ -4103,8 +3884,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext @@ -4133,44 +3913,31 @@ if eval "test \"\${$as_ac_var+set}\" = set"; then else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ -#ifdef __STDC__ -# include -#else -# include -#endif + which can conflict with char $ac_func (); below. */ +#include /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" -{ #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); +char (*f) (); + +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 -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} +f = $ac_func; #endif -int -main () -{ -return f != $ac_func; ; return 0; } @@ -4190,8 +3957,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext @@ -4363,11 +4129,7 @@ if test "${ac_cv_type_signal+set}" = set; then else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#include "confdefs.h" #include #include #ifdef signal @@ -4402,8 +4164,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_cv_type_signal=void else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 ac_cv_type_signal=int fi rm -f conftest.$ac_objext conftest.$ac_ext @@ -4424,11 +4185,7 @@ if test "${ac_cv_type_char+set}" = set; then else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#include "confdefs.h" $ac_includes_default int main () @@ -4456,8 +4213,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_cv_type_char=yes else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 ac_cv_type_char=no fi rm -f conftest.$ac_objext conftest.$ac_ext @@ -4479,11 +4235,7 @@ else # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#include "confdefs.h" $ac_includes_default int main () @@ -4511,11 +4263,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 while :; do cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#include "confdefs.h" $ac_includes_default int main () @@ -4542,8 +4290,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= @@ -4555,15 +4302,10 @@ rm -f conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#include "confdefs.h" $ac_includes_default int main () @@ -4591,11 +4333,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 while :; do cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#include "confdefs.h" $ac_includes_default int main () @@ -4622,8 +4360,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= @@ -4635,8 +4372,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 ac_lo= ac_hi= fi rm -f conftest.$ac_objext conftest.$ac_ext @@ -4647,11 +4383,7 @@ while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#include "confdefs.h" $ac_includes_default int main () @@ -4678,35 +4410,26 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_char=$ac_lo;; -'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (char), 77 -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (char), 77 -See \`config.log' for more details." >&2;} +'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (char), 77" >&5 +echo "$as_me: error: cannot compute sizeof (char), 77" >&2;} { (exit 1); exit 1; }; } ;; esac else if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run test program while cross compiling -See \`config.log' for more details." >&2;} + { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling" >&5 +echo "$as_me: error: cannot run test program while cross compiling" >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#include "confdefs.h" $ac_includes_default long longval () { return (long) (sizeof (char)); } unsigned long ulongval () { return (long) (sizeof (char)); } @@ -4754,13 +4477,10 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 ( exit $ac_status ) -{ { echo "$as_me:$LINENO: error: cannot compute sizeof (char), 77 -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (char), 77 -See \`config.log' for more details." >&2;} +{ { echo "$as_me:$LINENO: error: cannot compute sizeof (char), 77" >&5 +echo "$as_me: error: cannot compute sizeof (char), 77" >&2;} { (exit 1); exit 1; }; } fi rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext @@ -4785,11 +4505,7 @@ if test "${ac_cv_type_short+set}" = set; then else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#include "confdefs.h" $ac_includes_default int main () @@ -4817,8 +4533,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_cv_type_short=yes else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 ac_cv_type_short=no fi rm -f conftest.$ac_objext conftest.$ac_ext @@ -4840,11 +4555,7 @@ else # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#include "confdefs.h" $ac_includes_default int main () @@ -4872,11 +4583,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 while :; do cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#include "confdefs.h" $ac_includes_default int main () @@ -4903,8 +4610,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= @@ -4916,15 +4622,10 @@ rm -f conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#include "confdefs.h" $ac_includes_default int main () @@ -4952,11 +4653,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 while :; do cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#include "confdefs.h" $ac_includes_default int main () @@ -4983,8 +4680,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= @@ -4996,8 +4692,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 ac_lo= ac_hi= fi rm -f conftest.$ac_objext conftest.$ac_ext @@ -5008,11 +4703,7 @@ while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#include "confdefs.h" $ac_includes_default int main () @@ -5039,35 +4730,26 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_short=$ac_lo;; -'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (short), 77 -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (short), 77 -See \`config.log' for more details." >&2;} +'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (short), 77" >&5 +echo "$as_me: error: cannot compute sizeof (short), 77" >&2;} { (exit 1); exit 1; }; } ;; esac else if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run test program while cross compiling -See \`config.log' for more details." >&2;} + { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling" >&5 +echo "$as_me: error: cannot run test program while cross compiling" >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#include "confdefs.h" $ac_includes_default long longval () { return (long) (sizeof (short)); } unsigned long ulongval () { return (long) (sizeof (short)); } @@ -5115,13 +4797,10 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 ( exit $ac_status ) -{ { echo "$as_me:$LINENO: error: cannot compute sizeof (short), 77 -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (short), 77 -See \`config.log' for more details." >&2;} +{ { echo "$as_me:$LINENO: error: cannot compute sizeof (short), 77" >&5 +echo "$as_me: error: cannot compute sizeof (short), 77" >&2;} { (exit 1); exit 1; }; } fi rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext @@ -5146,11 +4825,7 @@ if test "${ac_cv_type_int+set}" = set; then else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#include "confdefs.h" $ac_includes_default int main () @@ -5178,8 +4853,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_cv_type_int=yes else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 ac_cv_type_int=no fi rm -f conftest.$ac_objext conftest.$ac_ext @@ -5201,11 +4875,7 @@ else # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#include "confdefs.h" $ac_includes_default int main () @@ -5233,11 +4903,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 while :; do cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#include "confdefs.h" $ac_includes_default int main () @@ -5264,8 +4930,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= @@ -5277,15 +4942,10 @@ rm -f conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#include "confdefs.h" $ac_includes_default int main () @@ -5313,11 +4973,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 while :; do cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#include "confdefs.h" $ac_includes_default int main () @@ -5344,8 +5000,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= @@ -5357,8 +5012,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 ac_lo= ac_hi= fi rm -f conftest.$ac_objext conftest.$ac_ext @@ -5369,11 +5023,7 @@ while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#include "confdefs.h" $ac_includes_default int main () @@ -5400,35 +5050,26 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_int=$ac_lo;; -'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (int), 77 -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (int), 77 -See \`config.log' for more details." >&2;} +'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (int), 77" >&5 +echo "$as_me: error: cannot compute sizeof (int), 77" >&2;} { (exit 1); exit 1; }; } ;; esac else if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run test program while cross compiling -See \`config.log' for more details." >&2;} + { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling" >&5 +echo "$as_me: error: cannot run test program while cross compiling" >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#include "confdefs.h" $ac_includes_default long longval () { return (long) (sizeof (int)); } unsigned long ulongval () { return (long) (sizeof (int)); } @@ -5476,13 +5117,10 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 ( exit $ac_status ) -{ { echo "$as_me:$LINENO: error: cannot compute sizeof (int), 77 -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (int), 77 -See \`config.log' for more details." >&2;} +{ { echo "$as_me:$LINENO: error: cannot compute sizeof (int), 77" >&5 +echo "$as_me: error: cannot compute sizeof (int), 77" >&2;} { (exit 1); exit 1; }; } fi rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext @@ -5507,11 +5145,7 @@ if test "${ac_cv_type_long+set}" = set; then else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#include "confdefs.h" $ac_includes_default int main () @@ -5539,8 +5173,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_cv_type_long=yes else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 ac_cv_type_long=no fi rm -f conftest.$ac_objext conftest.$ac_ext @@ -5562,11 +5195,7 @@ else # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#include "confdefs.h" $ac_includes_default int main () @@ -5594,11 +5223,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 while :; do cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#include "confdefs.h" $ac_includes_default int main () @@ -5625,8 +5250,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= @@ -5638,15 +5262,10 @@ rm -f conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#include "confdefs.h" $ac_includes_default int main () @@ -5674,11 +5293,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 while :; do cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#include "confdefs.h" $ac_includes_default int main () @@ -5705,8 +5320,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= @@ -5718,8 +5332,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 ac_lo= ac_hi= fi rm -f conftest.$ac_objext conftest.$ac_ext @@ -5730,11 +5343,7 @@ while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#include "confdefs.h" $ac_includes_default int main () @@ -5761,35 +5370,26 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_long=$ac_lo;; -'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (long), 77 -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (long), 77 -See \`config.log' for more details." >&2;} +'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (long), 77" >&5 +echo "$as_me: error: cannot compute sizeof (long), 77" >&2;} { (exit 1); exit 1; }; } ;; esac else if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run test program while cross compiling -See \`config.log' for more details." >&2;} + { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling" >&5 +echo "$as_me: error: cannot run test program while cross compiling" >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#include "confdefs.h" $ac_includes_default long longval () { return (long) (sizeof (long)); } unsigned long ulongval () { return (long) (sizeof (long)); } @@ -5837,13 +5437,10 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 ( exit $ac_status ) -{ { echo "$as_me:$LINENO: error: cannot compute sizeof (long), 77 -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (long), 77 -See \`config.log' for more details." >&2;} +{ { echo "$as_me:$LINENO: error: cannot compute sizeof (long), 77" >&5 +echo "$as_me: error: cannot compute sizeof (long), 77" >&2;} { (exit 1); exit 1; }; } fi rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext @@ -5919,11 +5516,7 @@ else # See if sys/param.h defines the BYTE_ORDER macro. cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#include "confdefs.h" #include #include @@ -5953,11 +5546,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 # It does; now see whether it defined to BIG_ENDIAN or not. cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#include "confdefs.h" #include #include @@ -5987,26 +5576,20 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_cv_c_bigendian=yes else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 ac_cv_c_bigendian=no fi rm -f conftest.$ac_objext conftest.$ac_ext else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 # It does not; compile a test program. if test "$cross_compiling" = yes; then # try to guess the endianness by grepping values into an object file ac_cv_c_bigendian=unknown cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#include "confdefs.h" short ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; short ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; void _ascii () { char *s = (char *) ascii_mm; s = (char *) ascii_ii; } @@ -6046,18 +5629,13 @@ if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then fi else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#include "confdefs.h" int main () { @@ -6086,8 +5664,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_c_bigendian=yes fi @@ -6833,6 +6410,10 @@ cat >>confdefs.h <<_ACEOF #define STD_DS390_LIB "libds390" _ACEOF +cat >>confdefs.h <<_ACEOF +#define STD_DS400_LIB "libds400" +_ACEOF + cat >>confdefs.h <<_ACEOF #define STD_XA51_LIB "libxa51" _ACEOF @@ -6963,6 +6544,25 @@ _ACEOF fi +# Check whether --enable-ds400-port or --disable-ds400-port was given. +if test "${enable_ds400_port+set}" = set; then + enableval="$enable_ds400_port" + +fi; +echo ds400 >>ports.all +if test "$enable_ds400_port" = "no"; then + cat >>confdefs.h <<_ACEOF +#define OPT_DISABLE_DS300 1 +_ACEOF + +else + echo ds400 >>ports.build + cat >>confdefs.h <<_ACEOF +#define OPT_DISABLE_DS400 0 +_ACEOF + +fi + # Check whether --enable-pic-port or --disable-pic-port was given. if test "${enable_pic_port+set}" = set; then enableval="$enable_pic_port" @@ -7041,11 +6641,7 @@ else LIBS="-lgc $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus @@ -7077,8 +6673,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 ac_cv_lib_gc_GC_malloc=yes else echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +cat conftest.$ac_ext >&5 ac_cv_lib_gc_GC_malloc=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext @@ -7171,7 +6766,7 @@ _ACEOF t end /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ : end' >>confcache -if diff $cache_file confcache >/dev/null 2>&1; then :; else +if cmp -s $cache_file confcache; then :; else if test -w $cache_file; then test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" cat confcache >$cache_file @@ -7231,8 +6826,6 @@ cat >$CONFIG_STATUS <<_ACEOF # configure, is in config.log if it exists. debug=false -ac_cs_recheck=false -ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} _ACEOF @@ -7267,10 +6860,7 @@ PS2='> ' PS4='+ ' # NLS nuisances. -for as_var in \ - LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ - LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ - LC_TELEPHONE LC_TIME +for as_var in LANG LANGUAGE LC_ALL LC_COLLATE LC_CTYPE LC_NUMERIC LC_MESSAGES LC_TIME do if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var @@ -7316,15 +6906,15 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + echo "#! /bin/sh" >conftest.sh + echo "exit 0" >>conftest.sh + chmod +x conftest.sh + if (PATH="/nonexistent;."; conftest.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi - rm -f conf$$.sh + rm -f conftest.sh fi @@ -7487,7 +7077,7 @@ _ASBOX cat >&5 <<_CSEOF This file was extended by $as_me, which was -generated by GNU Autoconf 2.57. Invocation command line was +generated by GNU Autoconf 2.54. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -7527,7 +7117,6 @@ Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number, then exit - -q, --quiet do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] @@ -7547,7 +7136,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ config.status -configured by $0, generated by GNU Autoconf 2.57, +configured by $0, generated by GNU Autoconf 2.54, with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 @@ -7584,9 +7173,12 @@ do case $ac_option in # Handling of the options. _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) - ac_cs_recheck=: ;; + echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion" + exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;; +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF --version | --vers* | -V ) echo "$ac_cs_version"; exit 0 ;; --he | --h) @@ -7608,9 +7200,6 @@ Try \`$0 --help' for more information." >&2;} $ac_shift CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" ac_need_defaults=false;; - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil | --si | --s) - ac_cs_silent=: ;; # This is an error. -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 @@ -7625,20 +7214,6 @@ Try \`$0 --help' for more information." >&2;} shift done -ac_configure_extra_args= - -if $ac_cs_silent; then - exec 6>/dev/null - ac_configure_extra_args="$ac_configure_extra_args --silent" -fi - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF -if \$ac_cs_recheck; then - echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 - exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion -fi - _ACEOF @@ -7673,9 +7248,6 @@ if $ac_need_defaults; then test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers fi -# Have a temporary directory for convenience. Make it in the build tree -# simply because there is no reason to put it here, and in addition, -# creating and moving files from /tmp can sometimes cause problems. # Create a temporary directory, and hook for its removal unless debugging. $debug || { @@ -7684,17 +7256,17 @@ $debug || } # Create a (secure) tmp directory for tmp files. - +: ${TMPDIR=/tmp} { - tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && + tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { - tmp=./confstat$$-$RANDOM + tmp=$TMPDIR/cs$$-$RANDOM (umask 077 && mkdir $tmp) } || { - echo "$me: cannot create a temporary directory in ." >&2 + echo "$me: cannot create a temporary directory in $TMPDIR" >&2 { (exit 1); exit 1; } } @@ -8165,7 +7737,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF cat $tmp/in >>$tmp/config.h rm -f $tmp/in if test x"$ac_file" != x-; then - if diff $ac_file $tmp/config.h >/dev/null 2>&1; then + if cmp -s $ac_file $tmp/config.h 2>/dev/null; then { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 echo "$as_me: $ac_file is unchanged" >&6;} else @@ -8234,11 +7806,8 @@ ac_clean_files=$ac_clean_files_save # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: - ac_config_status_args= - test "$silent" = yes && - ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null - $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + $SHELL $CONFIG_STATUS || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. diff --git a/configure.in b/configure.in index 8b26d953..ca9c157f 100755 --- a/configure.in +++ b/configure.in @@ -482,6 +482,7 @@ AC_DEFINE_UNQUOTED(STD_INT_LIB, "libint") AC_DEFINE_UNQUOTED(STD_LONG_LIB, "liblong") AC_DEFINE_UNQUOTED(STD_FP_LIB, "libfloat") AC_DEFINE_UNQUOTED(STD_DS390_LIB, "libds390") +AC_DEFINE_UNQUOTED(STD_DS400_LIB, "libds400") AC_DEFINE_UNQUOTED(STD_XA51_LIB, "libxa51") # SDCC runtime environment variables @@ -554,6 +555,17 @@ else AC_DEFINE_UNQUOTED(OPT_DISABLE_TININative, 0) fi +AC_ARG_ENABLE(ds400-port, + AC_HELP_STRING([--disable-ds400-port], + [Excludes the DS400 port])) +echo ds400 >>ports.all +if test "$enable_ds400_port" = "no"; then + AC_DEFINE_UNQUOTED(OPT_DISABLE_DS300, 1) +else + echo ds400 >>ports.build + AC_DEFINE_UNQUOTED(OPT_DISABLE_DS400, 0) +fi + AC_ARG_ENABLE(pic-port, AC_HELP_STRING([--disable-pic-port], [Excludes the PIC port])) diff --git a/device/examples/ds400/hello400/Makefile b/device/examples/ds400/hello400/Makefile new file mode 100644 index 00000000..ac1ea7bb --- /dev/null +++ b/device/examples/ds400/hello400/Makefile @@ -0,0 +1,20 @@ +CC = ../../../../bin/sdcc + +MFLAGS = -mds400 +LFLAGS = --xram-loc 0x10000 --code-loc 0x400000 -Wl-r + +OBJECTS = hello.rel + +all: hello.hex + +clean: + rm -f *~ \#* *.asm *.cdb *.rel *.hex *.ihx *.lst *.map *.rst *.sym *.lnk + +hello.hex: hello.ihx + packihx hello.ihx >hello.hex + +hello.ihx: $(OBJECTS) + $(CC) $(MFLAGS) $(LFLAGS) $(OBJECTS) + +%.rel: %.c + $(CC) -c $(MFLAGS) $< diff --git a/device/examples/ds400/hello400/Readme b/device/examples/ds400/hello400/Readme new file mode 100644 index 00000000..16591752 --- /dev/null +++ b/device/examples/ds400/hello400/Readme @@ -0,0 +1,2 @@ +This works on a TINIm400. The resulting "hello.hex" can be loaded uaing +JavaKit's 'Load hex as TBIN' option. diff --git a/device/examples/ds400/hello400/hello.c b/device/examples/ds400/hello400/hello.c new file mode 100644 index 00000000..7c692282 --- /dev/null +++ b/device/examples/ds400/hello400/hello.c @@ -0,0 +1,37 @@ +#include +#include + +void main(void) +{ + int i, j; + + printf("Hello world!\n"); + j = 0; + + while (1) + { + printf("Loop %d\n", j++); + + + /* Make LED go blink. */ + P5 |= 4; + for (i = 0; i < 32767; i++) + { + + ; + } + for (i = 0; i < 32767; i++) + { + + ; + } + + P5 &= ~4; + for (i = 0; i < 32767; i++) + { + + ; + } + } + +} diff --git a/device/include/stdarg.h b/device/include/stdarg.h index cbedce87..c421a3bc 100644 --- a/device/include/stdarg.h +++ b/device/include/stdarg.h @@ -11,7 +11,7 @@ typedef unsigned char * va_list; #define va_start(list, last) list = (unsigned char *)&last + sizeof(last) #define va_arg(list, type) *((type *)((list += sizeof(type)) - sizeof(type))) -#elif defined(__ds390) +#elif defined(__ds390) || defined(__ds400) typedef unsigned char * va_list ; #define va_arg(marker,type) *((type *)(marker -= sizeof(type))) diff --git a/device/lib/Makefile.in b/device/lib/Makefile.in index 055e58cb..749a573c 100644 --- a/device/lib/Makefile.in +++ b/device/lib/Makefile.in @@ -125,7 +125,7 @@ include incl.mk # Compiling entire program or any subproject # ------------------------------------------ -all: checkconf models model-ds390 model-z80 model-gbz80 +all: checkconf models model-ds390 model-ds400 model-z80 model-gbz80 objects: build-dir $(OBJECTS) port-specific-objects lib-files clean_intermediate @@ -140,6 +140,11 @@ model-ds390: if [ "`grep ds390 ../../ports.build`" = ds390 ]; then \ $(MAKE) MODELFLAGS="-mds390" PORT=ds390 objects; \ fi + +model-ds400: + if [ "`grep ds400 ../../ports.build`" = ds400 ]; then \ + $(MAKE) MODELFLAGS="-mds400" PORT=ds400 objects; \ + fi model-xa51: if [ "`grep xa51 ../../ports.build`" = xa51 ]; then \ @@ -183,7 +188,7 @@ clean_intermediate: # --------------------------------------------------- install: all installdirs cp -r $(BUILDDIR)/* $(sdcc_libdir) - cp -r ds390 gbz80 z80 *.c $(sdcc_libdir)/src + cp -r ds390 ds400 gbz80 z80 *.c $(sdcc_libdir)/src rm `find $(sdcc_libdir)/src -name '*.rel' -or -name '*.dump*' -or -name '*.sym' -or -name '*.o' -or -name '*.lst' -or -name '*.asm'` # Deleting all the installed files @@ -210,6 +215,7 @@ installdirs: mkdir -p $(sdcc_libdir)/$$model; \ done [ -d $(sdcc_libdir)/ds390 ] || mkdir -p $(sdcc_libdir)/ds390 + [ -d $(sdcc_libdir)/ds400 ] || mkdir -p $(sdcc_libdir)/ds400 mkdir -p $(sdcc_libdir)/src # Creating dependencies diff --git a/device/lib/ds400/Makefile b/device/lib/ds400/Makefile new file mode 100755 index 00000000..3bf3bfcc --- /dev/null +++ b/device/lib/ds400/Makefile @@ -0,0 +1,42 @@ +CC = ../../../bin/sdcc + +#VERBOSE = --verbose + +OBJECTS = tinibios.rel memcpyx.rel + +SOURCES = $(patsubst %.rel,%.c,$(OBJECTS)) + +CPPFLAGS = -I../../include +CFLAGS = -mds400 $(CPPFLAGS) $(VERBOSE) + +all: $(OBJECTS) libds400.lib + +clean: + rm -f *.lst *.rel *.sym *.cdb *.asm \#* *~ *.rst *.hex + rm -f *.ihx temp.lnk *.map *.lib + +superclean: + make clean ; rm Makefile.dep + +libds400.lib: $(OBJECTS) + rm -f $@; \ + for libfile in $(OBJECTS); do \ + echo $$libfile >>$@; \ + done; + +%.rel: %.c + $(CC) -c $(CFLAGS) $< + +# Creating dependencies +# --------------------- +depend: Makefile.dep + +Makefile.dep: $(SOURCES) + rm -f Makefile.dep + for i in $(SOURCES); do \ + $(CC) -M $(CPPFLAGS) $$i >$${i}.dep; \ + cat $${i}.dep >>Makefile.dep; \ + rm $${i}.dep; \ + done + +include Makefile.dep diff --git a/device/lib/ds400/memcpyx.c b/device/lib/ds400/memcpyx.c new file mode 100644 index 00000000..fb9e2991 --- /dev/null +++ b/device/lib/ds400/memcpyx.c @@ -0,0 +1,78 @@ +#include + +// FIXME: can optimize even further on '400 with auto-increment/auto-toggle. + +void xdata * memcpyx ( + void xdata * dst, + void xdata * src, + int count + ) _naked +{ + /* Shut compiler up about unused parameters. */ + dst; src; count; + +_asm + ; Destination is in DPTR. Save it on stack so we can return it at end. + + push dpx + push dph + push dpl + + mov dps, #0x1 ; Alternate DPTR. + + ; count is in _memcpyx_PARM_3 + mov dptr, #_memcpyx_PARM_3 + movx a, @dptr + inc dptr + mov r2, a + movx a, @dptr + mov r3, a + + ; src is in _memcpyx_PARM_2 + mov dptr, #_memcpyx_PARM_2 + movx a, @dptr + inc dptr + push acc + movx a, @dptr + inc dptr + push acc + movx a, @dptr + mov dpx1, a + pop dph1 + pop dpl1 + + mov dps, #0x21 ; Current DPTR is alt DPTR, toggle after each op. + + ; src is in alt DPTR, dst is in normal DPTR, count is in r2/r3. + + ; If we have zero bytes to copy, quick out. + mov a, r2 + orl a, r3 + jz _memcpy_done + + ; increment r3 if r2 != 0 (makes djnz end-of-loop sequence possible). + inc r3 + cjne r2, #0x0, _memcpyx_loopTop + dec r3 + +_memcpyx_loopTop: + + movx a, @dptr + movx @dptr, a + inc dptr + inc dptr + + djnz r2, _memcpyx_loopTop + djnz r3, _memcpyx_loopTop + +_memcpy_done: + + mov dps, #0x0 + + pop dpl + pop dph + pop dpx + ret +_endasm; + +} diff --git a/device/lib/ds400/tinibios.c b/device/lib/ds400/tinibios.c new file mode 100755 index 00000000..0623b953 --- /dev/null +++ b/device/lib/ds400/tinibios.c @@ -0,0 +1,229 @@ +/*------------------------------------------------------------------------- + tinibios.c - startup and serial routines for the DS80C400 (tested on TINIM400) + + Written By - Johan Knol, johan.knol@iduna.nl + + Further hacked by Kevin Vigor with invaluable assistance from Bob Heise. + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any + later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + In other words, you are welcome to use, share and improve this program. + You are forbidden to forbid anyone else to use, share and improve + what you give them. Help stamp out software-hoarding! +-------------------------------------------------------------------------*/ + +#include + +#define TIMED_ACCESS(sfr,value) { TA=0xaa; TA=0x55; sfr=value; } + +// FIXME: Doesn't work, maybe? +static void _installInterrupt(void (*isrPtr)(void), unsigned char offset) +{ + unsigned char xdata * vectPtr = (unsigned char xdata *) offset; + unsigned long isr = (unsigned long)isrPtr; + + *vectPtr++ = 0x02; + *vectPtr++ = (unsigned char)(isr >> 16); + *vectPtr++ = (unsigned char)(isr >> 8); + *vectPtr = (unsigned char)isr; +} + +unsigned char _sdcc_external_startup(void) +{ +#if 0 + int i, j; + + // Do some blinking of the LED. + for (j = 0; j < 10; j++) + { + P5 |= 4; + for (i = 0; i < 32767; i++) + { + ; + } + P5 &= ~4; + for (i = 0; i < 32767; i++) + { + ; + } + } +#endif + + IE = 0; // Disable all interrupts. + + _asm + ; save the 24-bit return address + pop ar2; msb + pop ar1 + pop ar0; lsb + + + mov _ESP,#0x00; reinitialize the stack + mov _SP,#0x00 + + ; restore the 24-bit return address + push ar0; lsb + push ar1 + push ar2; msb + _endasm; + + // Stub: call rom_init here, then fixup IVT. + // + + Serial0Init(1, 0); // baud argument ignored. + + IE = 0x80; // Enable interrupts. + + return 0; +} + +// now the serial0 stuff + +// just to make the code more readable +#define S0RBS SERIAL_0_RECEIVE_BUFFER_SIZE + +// this is a ring buffer and can overflow at anytime! +static volatile unsigned char receive0Buffer[S0RBS]; +static volatile int receive0BufferHead=0; +static volatile int receive0BufferTail=0; +// no buffering for transmit +static volatile char transmit0IsBusy=0; + +static data unsigned char serial0Buffered; + +/* Initialize serial0. + + Available baudrates are from 110 upto 115200 (using 16-bit timer 2) + If baud==0, the port is disabled. + + If buffered!=0, characters received are buffered using an interrupt +*/ + +void Serial0Init (unsigned long baud, unsigned char buffered) { + + ES0 = 0; // disable serial channel 0 interrupt + + // Need no port setup, done by boot rom. + + baud; + + // hack serial ISR in, no magic support for ISR routines yet. + // + // FIXME: this doesn't work, use only non-buffered mode! + + _installInterrupt(Serial0IrqHandler, 0x23); + + serial0Buffered=buffered; + + if (buffered) { + RI_0=TI_0=0; // clear "pending" interrupts + ES0 = 1; // enable serial channel 0 interrupt + } else { + RI_0=0; // receive buffer empty + TI_0=1; // transmit buffer empty + } +} + +void Serial0Baud(unsigned long baud) { + TR2=0; // stop timer + baud=-((long)OSCILLATOR/(32*baud)); + TL2=RCAP2L= baud; + TH2=RCAP2H= baud>>8; + TF2=0; // clear overflow flag + TR2=1; // start timer +} + +void Serial0IrqHandler (void) interrupt 4 { + P5 |= 4; + if (RI_0) { + receive0Buffer[receive0BufferHead]=SBUF0; + receive0BufferHead=(receive0BufferHead+1)&(S0RBS-1); + if (receive0BufferHead==receive0BufferTail) { + /* buffer overrun, sorry :) */ + receive0BufferTail=(receive0BufferTail+1)&(S0RBS-1); + } + RI_0=0; + } + if (TI_0) { + TI_0=0; + transmit0IsBusy=0; + } +} + +char Serial0CharArrived(void) { + if (serial0Buffered) { + if (receive0BufferHead!=receive0BufferTail) + return receive0Buffer[receive0BufferTail]; + } else { + if (RI_0) + return SBUF0; + } + return 0; +} + +void Serial0PutChar (char c) +{ + if (serial0Buffered) { + while (transmit0IsBusy) + ; + transmit0IsBusy=1; + SBUF0=c; + } else { + while (!TI_0) + ; + SBUF0=c; + TI_0=0; + } +} + +char Serial0GetChar (void) +{ + char c; + if (serial0Buffered) { + while (receive0BufferHead==receive0BufferTail) + ; + c=receive0Buffer[receive0BufferTail]; + ES0=0; // disable serial interrupts + receive0BufferTail=(receive0BufferTail+1)&(S0RBS-1); + ES0=1; // enable serial interrupts + } else { + while (!RI_0) + ; + c=SBUF0; + RI_0=0; + } + return c; +} + +#if 0 +// FIXME: no ClockMilliSecondsDelay yet. +void Serial0SendBreak() { + P3 &= ~0x02; + ClockMilliSecondsDelay(2); + P3 |= 0x02; +} +#endif + +void Serial0Flush() { + ES0=0; // disable interrupts + receive0BufferHead=receive0BufferTail=0; + RI_0=0; + if (serial0Buffered) { + TI_0=0; + ES0=1; // enable interrupts + } else { + TI_0=1; + } +} diff --git a/sdcc_vc_in.h b/sdcc_vc_in.h index ff235dd0..4c482f6f 100644 --- a/sdcc_vc_in.h +++ b/sdcc_vc_in.h @@ -38,6 +38,7 @@ #define STD_LONG_LIB "liblong" #define STD_FP_LIB "libfloat" #define STD_DS390_LIB "libds390" +#define STD_DS400_LIB "libds400" // #undef STD_XA51_LIB // #undef HAVE_SYS_SOCKET_H diff --git a/sdccconf_in.h b/sdccconf_in.h index 95d97173..04c60ac0 100644 --- a/sdccconf_in.h +++ b/sdccconf_in.h @@ -36,6 +36,7 @@ #undef STD_LONG_LIB #undef STD_FP_LIB #undef STD_DS390_LIB +#undef STD_DS400_LIB #undef STD_XA51_LIB #undef HAVE_SYS_SOCKET_H @@ -62,6 +63,7 @@ #undef OPT_DISABLE_Z80 #undef OPT_DISABLE_AVR #undef OPT_DISABLE_DS390 +#undef OPT_DISABLE_DS400 #undef OPT_DISABLE_TININative #undef OPT_DISABLE_PIC #undef OPT_DISABLE_XA51 diff --git a/src/SDCCglue.c b/src/SDCCglue.c index 206d1d2b..8da2373b 100644 --- a/src/SDCCglue.c +++ b/src/SDCCglue.c @@ -578,7 +578,6 @@ pointerTypeToGPByte (const int p_type, const char *iname, const char *oname) void _printPointerType (FILE * oFile, const char *name) { - /* if (TARGET_IS_DS390) */ if (options.model == MODEL_FLAT24) { fprintf (oFile, "\t.byte %s,(%s >> 8),(%s >> 16)", name, name, name); @@ -1577,7 +1576,7 @@ glue (void) /*JCF: Create the areas for the register banks*/ if(port->general.glue_up_main && - (TARGET_IS_MCS51 || TARGET_IS_DS390 || TARGET_IS_XA51)) + (TARGET_IS_MCS51 || TARGET_IS_DS390 || TARGET_IS_XA51 || TARGET_IS_DS400)) { if(RegBankUsed[0]||RegBankUsed[1]||RegBankUsed[2]||RegBankUsed[3]) { @@ -1696,8 +1695,14 @@ glue (void) (unsigned int) options.xdata_loc & 0xff); } - /* initialise the stack pointer. JCF: aslink takes care of the location */ - fprintf (asmFile, "\tmov\tsp,#__start__stack - 1\n"); /* MOF */ + // This should probably be a port option, but I'm being lazy. + // on the 400, the firmware boot loader gives us a valid stack + // (see '400 data sheet pg. 85 (TINI400 ROM Initialization code) + if (!TARGET_IS_DS400) + { + /* initialise the stack pointer. JCF: aslink takes care of the location */ + fprintf (asmFile, "\tmov\tsp,#__start__stack - 1\n"); /* MOF */ + } fprintf (asmFile, "\tlcall\t__sdcc_external_startup\n"); fprintf (asmFile, "\tmov\ta,dpl\n"); diff --git a/src/SDCCmain.c b/src/SDCCmain.c index ab0e117c..033b5afb 100644 --- a/src/SDCCmain.c +++ b/src/SDCCmain.c @@ -273,6 +273,9 @@ static PORT *_ports[] = #if !OPT_DISABLE_XA51 &xa51_port, #endif +#if !OPT_DISABLE_DS400 + &ds400_port, +#endif }; #define NUM_PORTS (sizeof(_ports)/sizeof(_ports[0])) @@ -1357,7 +1360,21 @@ linkEdit (char **envp) break; case MODEL_FLAT24: /* c = "flat24"; */ - c = "ds390"; + if (TARGET_IS_DS390) + { + c = "ds390"; + } + else if (TARGET_IS_DS400) + { + c = "ds400"; + } + else + { + fprintf(stderr, + "Add support for your FLAT24 target in %s @ line %d\n", + __FILE__, __LINE__); + exit(-1); + } break; case MODEL_PAGE0: c = "xa51"; @@ -1373,7 +1390,21 @@ linkEdit (char **envp) #if !OPT_DISABLE_DS390 if (options.model == MODEL_FLAT24) { - fprintf (lnkfile, "-l %s\n", STD_DS390_LIB); + if (TARGET_IS_DS390) + { + fprintf (lnkfile, "-l %s\n", STD_DS390_LIB); + } + else if (TARGET_IS_DS400) + { + fprintf (lnkfile, "-l %s\n", STD_DS400_LIB); + } + else + { + fprintf(stderr, + "Add support for your FLAT24 target in %s @ line %d\n", + __FILE__, __LINE__); + exit(-1); + } } #endif diff --git a/src/SDCCsymt.c b/src/SDCCsymt.c index 2b782464..80ccfc5a 100644 --- a/src/SDCCsymt.c +++ b/src/SDCCsymt.c @@ -1262,7 +1262,8 @@ checkSClass (symbol * sym, int isProto) * control this allcoation, but the code was originally that way, and * changing it for non-390 ports breaks the compiler badly. */ - bool useXdata = TARGET_IS_DS390 ? 1 : options.useXstack; + bool useXdata = (TARGET_IS_DS390 || TARGET_IS_DS400) ? + 1 : options.useXstack; SPEC_SCLS (sym->etype) = (useXdata ? S_XDATA : S_FIXED); } diff --git a/src/ds390/gen.c b/src/ds390/gen.c index d4a79b53..b9457193 100644 --- a/src/ds390/gen.c +++ b/src/ds390/gen.c @@ -518,14 +518,20 @@ aopForSym (iCode * ic, symbol * sym, bool result, bool useDP2) if (stack_val < 0 && stack_val > -5) { /* between -5 & -1 */ if (useDP2) { if (options.model == MODEL_FLAT24) - emitcode ("mov", "dpx1,#!constbyte", (options.stack_loc >> 16) & 0xff); - TR_DPTR("#2"); + { + emitcode ("mov", "dpx1,#!constbyte", + (options.stack_loc >> 16) & 0xff); + } emitcode ("mov", "dph1,_bpx+1"); + emitcode ("mov", "dpl1,_bpx"); emitcode ("mov","dps,#1"); } else { if (options.model == MODEL_FLAT24) - emitcode ("mov", "dpx,#!constbyte", (options.stack_loc >> 16) & 0xff); + { + emitcode ("mov", "dpx,#!constbyte", + (options.stack_loc >> 16) & 0xff); + } emitcode ("mov", "dph,_bpx+1"); emitcode ("mov", "dpl,_bpx"); } @@ -551,13 +557,18 @@ aopForSym (iCode * ic, symbol * sym, bool result, bool useDP2) emitcode ("subb","a,#!constbyte",(stack_val >> 8) & 0xff); if (useDP2) { if (options.model == MODEL_FLAT24) - emitcode ("mov", "dpx1,#!constbyte", (options.stack_loc >> 16) & 0xff); - TR_DPTR("#2"); + { + emitcode ("mov", "dpx1,#!constbyte", + (options.stack_loc >> 16) & 0xff); + } emitcode ("mov", "dph1,a"); emitcode ("mov", "dpl1,b"); } else { if (options.model == MODEL_FLAT24) - emitcode ("mov", "dpx,#!constbyte", (options.stack_loc >> 16) & 0xff); + { + emitcode ("mov", "dpx,#!constbyte", + (options.stack_loc >> 16) & 0xff); + } emitcode ("mov", "dph,a"); emitcode ("mov", "dpl,b"); } @@ -2510,6 +2521,18 @@ static void genSend(set *sendSet) } } +static void +adjustEsp(const char *reg) +{ + emitcode ("anl","%s,#3", reg); + if (TARGET_IS_DS400) + { + emitcode ("orl","%s,#!constbyte", + reg, + (options.stack_loc >> 8) & 0xff); + } +} + /*-----------------------------------------------------------------*/ /* genCall - generates a call statement */ /*-----------------------------------------------------------------*/ @@ -2635,7 +2658,7 @@ genCall (iCode * ic) emitcode ("subb","a,#!constbyte",ic->parmBytes & 0xff); emitcode ("mov","sp,a"); emitcode ("mov","a,esp"); - emitcode ("anl","a,#3"); + adjustEsp("a"); emitcode ("subb","a,#!constbyte",(ic->parmBytes >> 8) & 0xff); emitcode ("mov","esp,a"); UNPROTECT_SP; @@ -2753,7 +2776,7 @@ genPcall (iCode * ic) emitcode ("subb","a,#!constbyte",ic->parmBytes & 0xff); emitcode ("mov","sp,a"); emitcode ("mov","a,esp"); - emitcode ("anl","a,#3"); + adjustEsp("a"); emitcode ("subb","a,#!constbyte",(ic->parmBytes >> 8) & 0xff); emitcode ("mov","esp,a"); UNPROTECT_SP; @@ -3080,7 +3103,7 @@ genFunction (iCode * ic) emitcode ("push","_bpx+1"); emitcode ("mov","_bpx,%s",spname); emitcode ("mov","_bpx+1,esp"); - emitcode ("anl","_bpx+1,#3"); + adjustEsp("_bpx+1"); } else { if (options.useXstack) { emitcode ("mov", "r0,%s", spname); @@ -3109,7 +3132,7 @@ genFunction (iCode * ic) emitcode ("add","a,#!constbyte", ((short) sym->stack & 0xff)); emitcode ("mov","sp,a"); emitcode ("mov","a,esp"); - emitcode ("anl","a,#3"); + adjustEsp("a"); emitcode ("addc","a,#!constbyte", (((short) sym->stack) >> 8) & 0xff); emitcode ("mov","esp,a"); UNPROTECT_SP; @@ -7906,8 +7929,6 @@ shiftR2Left2Result (operand * left, int offl, } #endif -#if 0 -//REMOVE ME!!! /*-----------------------------------------------------------------*/ /* shiftLLeftOrResult - shift left one byte from left, or to result */ /*-----------------------------------------------------------------*/ @@ -7924,7 +7945,6 @@ shiftLLeftOrResult (operand * left, int offl, /* back to result */ aopPut (AOP (result), "a", offr); } -#endif #if 0 //REMOVE ME!!! @@ -8459,8 +8479,6 @@ genrshTwo (operand * result, operand * left, } #endif -#if 0 -//REMOVE ME!!! /*-----------------------------------------------------------------*/ /* shiftRLong - shift right one long from left to result */ /* offl = LSB or MSB16 */ @@ -8476,7 +8494,7 @@ shiftRLong (operand * left, int offl, werror(E_INTERNAL_ERROR, __FILE__, __LINE__); } - MOVA (aopGet (AOP (left), MSB32, FALSE, NULL)); + MOVA (aopGet (AOP (left), MSB32, FALSE, FALSE, NULL)); if (offl==MSB16) { // shift is > 8 @@ -8484,7 +8502,7 @@ shiftRLong (operand * left, int offl, emitcode ("rlc", "a"); emitcode ("subb", "a,acc"); emitcode ("xch", "a,%s", - aopGet(AOP(left), MSB32, FALSE, DP2_RESULT_REG)); + aopGet(AOP(left), MSB32, FALSE, FALSE, DP2_RESULT_REG)); } else { aopPut (AOP(result), zero, MSB32); } @@ -8500,34 +8518,31 @@ shiftRLong (operand * left, int offl, if (isSameRegs && offl==MSB16) { emitcode ("xch", - "a,%s",aopGet (AOP (left), MSB24, FALSE, DP2_RESULT_REG)); + "a,%s",aopGet (AOP (left), MSB24, FALSE, FALSE, DP2_RESULT_REG)); } else { aopPut (AOP (result), "a", MSB32); - MOVA (aopGet (AOP (left), MSB24, FALSE, NULL)); + MOVA (aopGet (AOP (left), MSB24, FALSE, FALSE, NULL)); } emitcode ("rrc", "a"); if (isSameRegs && offl==1) { emitcode ("xch", "a,%s", - aopGet (AOP (left), MSB16, FALSE, DP2_RESULT_REG)); + aopGet (AOP (left), MSB16, FALSE, FALSE, DP2_RESULT_REG)); } else { aopPut (AOP (result), "a", MSB24); - MOVA (aopGet (AOP (left), MSB16, FALSE, NULL)); + MOVA (aopGet (AOP (left), MSB16, FALSE, FALSE, NULL)); } emitcode ("rrc", "a"); aopPut (AOP (result), "a", MSB16 - offl); if (offl == LSB) { - MOVA (aopGet (AOP (left), LSB, FALSE, NULL)); + MOVA (aopGet (AOP (left), LSB, FALSE, FALSE, NULL)); emitcode ("rrc", "a"); aopPut (AOP (result), "a", LSB); } } -#endif -#if 0 -//REMOVE ME!!! /*-----------------------------------------------------------------*/ /* genrshFour - shift four byte by a known amount != 0 */ /*-----------------------------------------------------------------*/ @@ -8535,22 +8550,24 @@ static void genrshFour (operand * result, operand * left, int shCount, int sign) { - D (emitcode (";", "genrshFour"); - ); + D (emitcode (";", "genrshFour");); /* if shifting more that 3 bytes */ if (shCount >= 24) { shCount -= 24; + _startLazyDPSEvaluation(); if (shCount) shiftR1Left2Result (left, MSB32, result, LSB, shCount, sign); else movLeft2Result (left, MSB32, result, LSB, sign); addSign (result, MSB16, sign); + _endLazyDPSEvaluation(); } else if (shCount >= 16) { shCount -= 16; + _startLazyDPSEvaluation(); if (shCount) shiftR2Left2Result (left, MSB24, result, LSB, shCount, sign); else @@ -8559,12 +8576,16 @@ genrshFour (operand * result, operand * left, movLeft2Result (left, MSB32, result, MSB16, sign); } addSign (result, MSB24, sign); + _endLazyDPSEvaluation(); } else if (shCount >= 8) { shCount -= 8; + _startLazyDPSEvaluation(); if (shCount == 1) - shiftRLong (left, MSB16, result, sign); + { + shiftRLong (left, MSB16, result, sign); + } else if (shCount == 0) { movLeft2Result (left, MSB16, result, LSB, 0); @@ -8580,9 +8601,11 @@ genrshFour (operand * result, operand * left, shiftR1Left2Result (left, MSB32, result, MSB24, shCount, sign); addSign (result, MSB32, sign); } + _endLazyDPSEvaluation(); } else - { /* 1 <= shCount <= 7 */ + { + /* 1 <= shCount <= 7 */ if (shCount <= 2) { shiftRLong (left, LSB, result, sign); @@ -8597,7 +8620,6 @@ genrshFour (operand * result, operand * left, } } } -#endif #ifdef BETTER_LITERAL_SHIFT /*-----------------------------------------------------------------*/ @@ -8621,7 +8643,8 @@ genRightShiftLiteral (operand * left, if ((shCount != 0) && (shCount < (size * 8)) && (size != 1) - && (size != 2)) + && (size != 2) + /* && (size != 4) in a minute... */) { D(emitcode (";", "genRightShiftLiteral wimping out");); return FALSE; @@ -8670,7 +8693,7 @@ genRightShiftLiteral (operand * left, case 2: genrshTwo (result, left, shCount, sign); break; -#if 0 +#if 1 case 4: genrshFour (result, left, shCount, sign); break; @@ -10509,6 +10532,8 @@ genAddrOf (iCode * ic) /* if 10 bit stack */ if (options.stack10bit) { char buff[10]; + int offset; + tsprintf(buff, sizeof(buff), "#!constbyte",(options.stack_loc >> 16) & 0xff); /* if it has an offset then we need to compute it */ @@ -10527,9 +10552,13 @@ genAddrOf (iCode * ic) ((char) sym->stack )) & 0xff); emitcode ("mov", "b,a"); emitcode ("mov", "a,_bpx+1"); - emitcode ("addc","a,#!constbyte", (((sym->stack < 0) ? - ((short) (sym->stack - _G.nRegsSaved)) : - ((short) sym->stack )) >> 8) & 0xff); + + offset = (((sym->stack < 0) ? + ((short) (sym->stack - _G.nRegsSaved)) : + ((short) sym->stack )) >> 8) & 0xff; + + emitcode ("addc","a,#!constbyte", offset); + aopPut (AOP (IC_RESULT (ic)), "b", 0); aopPut (AOP (IC_RESULT (ic)), "a", 1); aopPut (AOP (IC_RESULT (ic)), buff, 2); @@ -11160,7 +11189,7 @@ genCast (iCode * ic) /* also, if the source is a bit, we don't need to sign extend, because * it can't possibly have set the sign bit. */ - if (SPEC_USIGN (rtype) || !IS_SPEC (rtype) || AOP_TYPE (right) == AOP_CRY) + if (!IS_SPEC (rtype) || SPEC_USIGN (rtype) || AOP_TYPE (right) == AOP_CRY) { while (size--) { diff --git a/src/ds390/main.c b/src/ds390/main.c index 2f2822ee..2d5b4717 100644 --- a/src/ds390/main.c +++ b/src/ds390/main.c @@ -308,6 +308,13 @@ static bool cseCostEstimation (iCode *ic, iCode *pdic) /* for others it is cheaper to do the cse */ return 1; } + +bool _ds390_nativeMulCheck(iCode *ic, sym_link *left, sym_link *right) +{ + return FALSE; // #STUB +} + + /** $1 is always the basename. $2 is always the output file. $3 varies @@ -401,7 +408,7 @@ PORT ds390_port = _ds390_regparm, NULL, NULL, - NULL, + _ds390_nativeMulCheck, FALSE, 0, /* leave lt */ 0, /* leave gt */ @@ -702,3 +709,184 @@ PORT tininative_port = 0, /* globals & local static NOT allowed */ PORT_MAGIC }; + +static int +_ds400_genIVT (FILE * of, symbol ** interrupts, int maxInterrupts) +{ + /* We can't generate a static IVT, since the boot rom creates one + * for us in rom_init. + * + * we must patch it as part of the C startup. + */ + fprintf (of, ";\tDS80C400 IVT must be generated at runtime.\n"); + fprintf (of, "\tsjmp\t__sdcc_400boot\n"); + fprintf (of, "\t.ascii\t'TINI'\t; required signature for 400 boot loader.\n"); + fprintf (of, "\t.db\t0\t; selected bank: zero *should* work...\n"); + fprintf (of, "\t__sdcc_400boot:\tljmp\t__sdcc_gsinit_startup\n"); + return TRUE; +} + + + +static void +_ds400_finaliseOptions (void) +{ + if (options.noXinitOpt) { + port->genXINIT=0; + } + + // hackhack: we're a superset of the 390. + addToList (preArgv, "-DSDCC_ds390"); + addToList (preArgv, "-D__ds390"); + + /* Hack-o-matic: if we are using the flat24 model, + * adjust pointer sizes. + */ + if (options.model != MODEL_FLAT24) { + fprintf (stderr, + "*** warning: ds400 port small and large model experimental.\n"); + if (options.model == MODEL_LARGE) + { + port->mem.default_local_map = xdata; + port->mem.default_globl_map = xdata; + } + else + { + port->mem.default_local_map = data; + port->mem.default_globl_map = data; + } + } + else { + port->s.fptr_size = 3; + port->s.gptr_size = 4; + + port->stack.isr_overhead += 2; /* Will save dpx on ISR entry. */ + + port->stack.call_overhead += 2; /* This acounts for the extra byte + * of return addres on the stack. + * but is ugly. There must be a + * better way. + */ + + port->mem.default_local_map = xdata; + port->mem.default_globl_map = xdata; + + if (!options.stack10bit) + { + fprintf (stderr, + "*** error: ds400 port only supports the 10 bit stack mode.\n"); + } else { + if (!options.stack_loc) options.stack_loc = 0xffdc00; + // assumes IDM1:0 = 1:0, CMA = 1. + } + + /* generate native code 16*16 mul/div */ + if (options.useAccelerator) + port->support.muldiv=2; + else + port->support.muldiv=1; + + /* Fixup the memory map for the stack; it is now in + * far space and requires a FPOINTER to access it. + */ + istack->fmap = 1; + istack->ptrType = FPOINTER; + + if (options.parms_in_bank1) { + addToList (preArgv, "-DSDCC_PARMS_IN_BANK1"); + } + } /* MODEL_FLAT24 */ +} + +PORT ds400_port = +{ + TARGET_ID_DS400, + "ds400", + "DS80C400", /* Target name */ + NULL, + { + TRUE, /* Emit glue around main */ + MODEL_SMALL | MODEL_LARGE | MODEL_FLAT24, + MODEL_SMALL + }, + { + _asmCmd, + NULL, + "-plosgffc", /* Options with debug */ + "-plosgff", /* Options without debug */ + 0, + ".asm", + NULL /* no do_assemble function */ + }, + { + _linkCmd, + NULL, + NULL, + ".rel" + }, + { + _defaultRules + }, + { + /* Sizes: char, short, int, long, ptr, fptr, gptr, bit, float, max */ + 1, 2, 2, 4, 1, 2, 3, 1, 4, 4 + }, + { + "XSEG (XDATA)", + "STACK (DATA)", + "CSEG (CODE)", + "DSEG (DATA)", + "ISEG (DATA)", + "XSEG (XDATA)", + "BSEG (BIT)", + "RSEG (DATA)", + "GSINIT (CODE)", + "OSEG (OVR,DATA)", + "GSFINAL (CODE)", + "HOME (CODE)", + "XISEG (XDATA)", // initialized xdata + "XINIT (CODE)", // a code copy of xiseg + NULL, + NULL, + 1 + }, + { + +1, 1, 4, 1, 1, 0 + }, + /* ds390 has an 16 bit mul & div */ + { + 2, -1 + }, + "_", + _ds390_init, + _ds390_parseOptions, + NULL, + _ds400_finaliseOptions, + _ds390_setDefaultOptions, + ds390_assignRegisters, + _ds390_getRegName, + _ds390_keywords, + _ds390_genAssemblerPreamble, + NULL, /* no genAssemblerEnd */ + _ds400_genIVT, + _ds390_genXINIT, + _ds390_reset_regparm, + _ds390_regparm, + NULL, + NULL, + _ds390_nativeMulCheck, + FALSE, + 0, /* leave lt */ + 0, /* leave gt */ + 1, /* transform <= to ! > */ + 1, /* transform >= to ! < */ + 1, /* transform != to !(a == b) */ + 0, /* leave == */ + TRUE, /* we support array initializers. */ + cseCostEstimation, + __ds390_builtins, /* table of builtin functions */ + GPOINTER, /* treat unqualified pointers as "generic" pointers */ + 1, /* reset labelKey to 1 */ + 1, /* globals & local static allowed */ + PORT_MAGIC +}; diff --git a/src/ds390/peeph.def b/src/ds390/peeph.def index 11f42204..be3ff93a 100644 --- a/src/ds390/peeph.def +++ b/src/ds390/peeph.def @@ -2416,3 +2416,280 @@ replace { %1: ret } + +// applies to f.e. device/lib/log10f.c +replace { + mov %1,%9 + mov %2,%10 + mov %3,%11 + mov %4,%12 + + mov %5,%13 + mov %6,%14 + mov %7,%15 + mov %8,%16 + + mov %9,%1 + mov %10,%2 + mov %11,%3 + mov %12,%4 +} by { + mov %1,%9 + mov %2,%10 + mov %3,%11 + mov %4,%12 + + mov %5,%13 + mov %6,%14 + mov %7,%15 + mov %8,%16 + ; Peephole 238.a removed 4 redundant moves +} if operandsNotSame8 %1 %2 %3 %4 %5 %6 %7 %8 + +// applies to device/lib/log10f.c +replace { + mov %1,%5 + mov %2,%6 + mov %3,%7 + mov %4,%8 + + mov %5,%1 + mov %6,%2 + mov %7,%3 +} by { + mov %1,%5 + mov %2,%6 + mov %3,%7 + mov %4,%8 + ; Peephole 238.b removed 3 redundant moves +} if operandsNotSame7 %1 %2 %3 %4 %5 %6 %7 + +// applies to f.e. device/lib/time.c +replace { + mov %1,%5 + mov %2,%6 + + mov %3,%7 + mov %4,%8 + + mov %5,%1 + mov %6,%2 +} by { + mov %1,%5 + mov %2,%6 + + mov %3,%7 + mov %4,%8 + ; Peephole 238.c removed 2 redundant moves +} if operandsNotSame4 %1 %2 %3 %4 + +// applies to f.e. support/regression/tests/bug-524209.c +replace { + mov %1,%4 + mov %2,%5 + mov %3,%6 + + mov %4,%1 + mov %5,%2 + mov %6,%3 +} by { + mov %1,%4 + mov %2,%5 + mov %3,%6 + ; Peephole 238.d removed 3 redundant moves +} if operandsNotSame6 %1 %2 %3 %4 %5 %6 + +// applies to f.e. ser_ir.asm +replace { + mov r%1,acc +} by { + ; Peephole 239 used a instead of acc + mov r%1,a +} + +replace restart { + mov a,%1 + addc a,#0x00 +} by { + ; Peephole 240 use clr instead of addc a,#0 + clr a + addc a,%1 +} + +// peepholes 241.a to 241.c and 241.d to 241.f need to be in order +replace { + cjne r%1,#%2,%3 + cjne r%4,#%5,%3 + cjne r%6,#%7,%3 + cjne r%8,#%9,%3 + mov a,#0x01 + sjmp %10 +%3: + clr a +%10: +} by { + ; Peephole 241.a optimized compare + clr a + cjne r%1,#%2,%3 + cjne r%4,#%5,%3 + cjne r%6,#%7,%3 + cjne r%8,#%9,%3 + inc a +%3: +%10: +} + +// applies to f.e. time.c +replace { + cjne r%1,#%2,%3 + cjne r%4,#%5,%3 + mov a,#0x01 + sjmp %6 +%3: + clr a +%6: +} by { + ; Peephole 241.b optimized compare + clr a + cjne r%1,#%2,%3 + cjne r%4,#%5,%3 + inc a +%3: +%6: +} + +// applies to f.e. malloc.c +replace { + cjne r%1,#%2,%3 + mov a,#0x01 + sjmp %4 +%3: + clr a +%4: +} by { + ; Peephole 241.c optimized compare + clr a + cjne r%1,#%2,%3 + inc a +%3: +%4: +} + +// applies to f.e. j = (k!=0x1000); +// with volatile idata long k; +replace { + cjne @r%1,#%2,%3 + inc r%1 + cjne @r%1,#%4,%3 + inc r%1 + cjne @r%1,#%5,%3 + inc r%1 + cjne @r%1,#%6,%3 + mov a,#0x01 + sjmp %7 +%3: + clr a +%7: +} by { + ; Peephole 241.d optimized compare + clr a + cjne @r%1,#%2,%3 + inc r%1 + cjne @r%1,#%4,%3 + inc r%1 + cjne @r%1,#%5,%3 + inc r%1 + cjne @r%1,#%6,%3 + inc a +%3: +%7: +} + +// applies to f.e. j = (k!=0x1000); +// with volatile idata int k; +replace { + cjne @r%1,#%2,%3 + inc r%1 + cjne @r%1,#%4,%3 + mov a,#0x01 + sjmp %7 +%3: + clr a +%7: +} by { + ; Peephole 241.e optimized compare + clr a + cjne @r%1,#%2,%3 + inc r%1 + cjne @r%1,#%4,%3 + inc a +%3: +%7: +} + +// applies to f.e. vprintf.asm (--stack-auto) +replace { + cjne @r%1,#%2,%3 + mov a,#0x01 + sjmp %7 +%3: + clr a +%7: +} by { + ; Peephole 241.f optimized compare + clr a + cjne @r%1,#%2,%3 + inc a +%3: +%7: +} + +// applies to f.e. scott-bool1.c +replace { + jnz %1 + mov %2,%3 +%1: + jz %4 +} by { + ; Peephole 242.a avoided branch jnz to jz + jnz %1 + mov %2,%3 + jz %4 +%1: +} if labelRefCount %1 1 + +// applies to f.e. scott-bool1.c +replace { + jnz %1 + mov %2,%3 + orl a,%5 +%1: + jz %4 +} by { + ; Peephole 242.b avoided branch jnz to jz + jnz %1 + mov %2,%3 + orl a,%5 + jz %4 +%1: +} if labelRefCount %1 1 + +// applies to f.e. logic.c +replace { + jnz %1 + mov %2,%3 + orl a,%5 + orl a,%6 + orl a,%7 +%1: + jz %4 +} by { + ; Peephole 242.c avoided branch jnz to jz + jnz %1 + mov %2,%3 + orl a,%5 + orl a,%6 + orl a,%7 + jz %4 +%1: +} if labelRefCount %1 1 diff --git a/src/ds400/Makefile b/src/ds400/Makefile new file mode 100644 index 00000000..3b856364 --- /dev/null +++ b/src/ds400/Makefile @@ -0,0 +1,2 @@ +# Make all in this directory +include ../port.mk diff --git a/src/ds400/main.c b/src/ds400/main.c new file mode 100644 index 00000000..8b56e59b --- /dev/null +++ b/src/ds400/main.c @@ -0,0 +1,14 @@ +/* This is currently a stub. The guts of the '400 implementation + * still live in the ds390 directory. + */ + +#include "main.h" + +/* If we don't have at least one exported function, the Solaris + * linker freaks out. + */ + +void ds400_dummyFunc(void) +{ + ; +} diff --git a/src/ds400/main.h b/src/ds400/main.h new file mode 100644 index 00000000..977c86f6 --- /dev/null +++ b/src/ds400/main.h @@ -0,0 +1,6 @@ +#ifndef DS400_MAIN_H_ +#define DS400_MAIN_H_ + +/* This is a stub file. */ + +#endif diff --git a/src/port.h b/src/port.h index 59ff906f..cc747fd7 100644 --- a/src/port.h +++ b/src/port.h @@ -15,6 +15,7 @@ #define TARGET_ID_DS390 5 #define TARGET_ID_PIC 6 #define TARGET_ID_XA51 9 +#define TARGET_ID_DS400 10 /* Macro to test the target we are compiling for. Can only be used after SDCCmain has defined the port @@ -24,6 +25,7 @@ #define TARGET_IS_Z80 (port->id==TARGET_ID_Z80) #define TARGET_IS_AVR (port->id==TARGET_ID_AVR) #define TARGET_IS_DS390 (port->id==TARGET_ID_DS390) +#define TARGET_IS_DS400 (port->id==TARGET_ID_DS400) #define TARGET_IS_PIC (port->id==TARGET_ID_PIC) #define TARGET_IS_XA51 (port->id==TARGET_ID_XA51) @@ -284,5 +286,8 @@ extern PORT tininative_port; #if !OPT_DISABLE_XA51 extern PORT xa51_port; #endif +#if !OPT_DISABLE_DS400 +extern PORT ds400_port; +#endif #endif /* PORT_INCLUDE*/ -- 2.47.2