+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
+
+
+# SDCC runtime environment variables
+sdcc_dir_name="SDCC_HOME"
+cat >>confdefs.h <<_ACEOF
+#define SDCC_DIR_NAME "${sdcc_dir_name}"
+_ACEOF
+
+
+sdcc_include_name="SDCC_INCLUDE"
+cat >>confdefs.h <<_ACEOF
+#define SDCC_INCLUDE_NAME "${sdcc_include_name}"
+_ACEOF
+
+
+sdcc_lib_name="SDCC_LIB"
+cat >>confdefs.h <<_ACEOF
+#define SDCC_LIB_NAME "${sdcc_lib_name}"
+_ACEOF
+
+
+# Port selection helper
+# ===========================================================================
+# macro AC_DO_ENABLER()
+# $1 used to access enable_$1, e.g. enable_doc
+# $2 OPT_DISABLE_$2, normally uppercase of $1, e.g. DOC
+# $3 help string
+
+
+# macro AC_DO_DISABLER()
+# $1 used to access disable_$1, e.g. ucsim
+# $2 OPT_DISABLE_$2, normally uppercase of $1, e.g. UCSIM
+# $3 help string
+
+
+# macro AC_DO_PORT($1, $2, $3, $4)
+# $1 used to access enable_$2_port, e.g. gbz80
+# $2 port name in ports.all and ports.build, e.g. z80
+# $3 OPT_DISABLE_$3, normally uppercase of $2, e.g. GBZ80
+# $4 help string
+
+
+# Now handle the port selection
+# ===========================================================================
+rm -f ports.all ports.build
+
+ # Check whether --enable-mcs51-port was given.
+if test "${enable_mcs51_port+set}" = set; then
+ enableval=$enable_mcs51_port;
+fi
+
+
+ if test "$enable_mcs51_port" = "no"; then
+ OPT_DISABLE_MCS51=1
+ else
+ enable_mcs51_port="yes"
+ OPT_DISABLE_MCS51=0
+ fi
+
+ cat >>confdefs.h <<_ACEOF
+#define OPT_DISABLE_MCS51 $OPT_DISABLE_MCS51
+_ACEOF
+
+
+
+ echo mcs51 >>ports.all
+ if test $OPT_DISABLE_MCS51 = 0; then
+ echo mcs51 >>ports.build
+ fi
+
+
+ # Check whether --enable-gbz80-port was given.
+if test "${enable_gbz80_port+set}" = set; then
+ enableval=$enable_gbz80_port;
+fi
+
+
+ if test "$enable_gbz80_port" = "no"; then
+ OPT_DISABLE_GBZ80=1
+ else
+ enable_gbz80_port="yes"
+ OPT_DISABLE_GBZ80=0
+ fi
+
+ cat >>confdefs.h <<_ACEOF
+#define OPT_DISABLE_GBZ80 $OPT_DISABLE_GBZ80
+_ACEOF
+
+
+
+ echo z80 >>ports.all
+ if test $OPT_DISABLE_GBZ80 = 0; then
+ echo z80 >>ports.build
+ fi
+
+
+ # Check whether --enable-z80-port was given.
+if test "${enable_z80_port+set}" = set; then
+ enableval=$enable_z80_port;
+fi
+
+
+ if test "$enable_z80_port" = "no"; then
+ OPT_DISABLE_Z80=1
+ else
+ enable_z80_port="yes"
+ OPT_DISABLE_Z80=0
+ fi
+
+ cat >>confdefs.h <<_ACEOF
+#define OPT_DISABLE_Z80 $OPT_DISABLE_Z80
+_ACEOF
+
+
+
+ echo z80 >>ports.all
+ if test $OPT_DISABLE_Z80 = 0; then
+ echo z80 >>ports.build
+ fi
+
+
+ # Check whether --enable-avr-port was given.
+if test "${enable_avr_port+set}" = set; then
+ enableval=$enable_avr_port;
+fi
+
+
+ if test "$enable_avr_port" = "no"; then
+ OPT_DISABLE_AVR=1
+ else
+ enable_avr_port="yes"
+ OPT_DISABLE_AVR=0
+ fi
+
+ cat >>confdefs.h <<_ACEOF
+#define OPT_DISABLE_AVR $OPT_DISABLE_AVR
+_ACEOF
+
+
+
+ echo avr >>ports.all
+ if test $OPT_DISABLE_AVR = 0; then
+ echo avr >>ports.build
+ fi
+
+
+ # Check whether --enable-ds390-port was given.
+if test "${enable_ds390_port+set}" = set; then
+ enableval=$enable_ds390_port;
+fi
+
+
+ if test "$enable_ds390_port" = "no"; then
+ OPT_DISABLE_DS390=1
+ else
+ enable_ds390_port="yes"
+ OPT_DISABLE_DS390=0
+ fi
+
+ cat >>confdefs.h <<_ACEOF
+#define OPT_DISABLE_DS390 $OPT_DISABLE_DS390
+_ACEOF
+
+
+
+ echo ds390 >>ports.all
+ if test $OPT_DISABLE_DS390 = 0; then
+ echo ds390 >>ports.build
+ fi
+
+cat >>confdefs.h <<_ACEOF
+#define OPT_DISABLE_TININative $OPT_DISABLE_DS390
+_ACEOF
+
+
+ # Check whether --enable-ds400-port was given.
+if test "${enable_ds400_port+set}" = set; then
+ enableval=$enable_ds400_port;
+fi
+
+
+ if test "$enable_ds400_port" = "no"; then
+ OPT_DISABLE_DS400=1
+ else
+ enable_ds400_port="yes"
+ OPT_DISABLE_DS400=0
+ fi
+
+ cat >>confdefs.h <<_ACEOF
+#define OPT_DISABLE_DS400 $OPT_DISABLE_DS400
+_ACEOF
+
+
+
+ echo ds400 >>ports.all
+ if test $OPT_DISABLE_DS400 = 0; then
+ echo ds400 >>ports.build
+ fi
+
+
+ # Check whether --enable-pic-port was given.
+if test "${enable_pic_port+set}" = set; then
+ enableval=$enable_pic_port;
+fi
+
+
+ if test "$enable_pic_port" = "no"; then
+ OPT_DISABLE_PIC=1
+ else
+ enable_pic_port="yes"
+ OPT_DISABLE_PIC=0
+ fi
+
+ cat >>confdefs.h <<_ACEOF
+#define OPT_DISABLE_PIC $OPT_DISABLE_PIC
+_ACEOF
+
+
+
+ echo pic >>ports.all
+ if test $OPT_DISABLE_PIC = 0; then
+ echo pic >>ports.build
+ fi
+
+
+ # Check whether --enable-pic16-port was given.
+if test "${enable_pic16_port+set}" = set; then
+ enableval=$enable_pic16_port;
+fi
+
+
+ if test "$enable_pic16_port" = "no"; then
+ OPT_DISABLE_PIC16=1
+ else
+ enable_pic16_port="yes"
+ OPT_DISABLE_PIC16=0
+ fi
+
+ cat >>confdefs.h <<_ACEOF
+#define OPT_DISABLE_PIC16 $OPT_DISABLE_PIC16
+_ACEOF
+
+
+
+ echo pic16 >>ports.all
+ if test $OPT_DISABLE_PIC16 = 0; then
+ echo pic16 >>ports.build
+ fi
+
+
+ # Check whether --enable-xa51-port was given.
+if test "${enable_xa51_port+set}" = set; then
+ enableval=$enable_xa51_port;
+fi
+
+
+ if test "$enable_xa51_port" = "no"; then
+ OPT_DISABLE_XA51=1
+ else
+ enable_xa51_port="yes"
+ OPT_DISABLE_XA51=0
+ fi
+
+ cat >>confdefs.h <<_ACEOF
+#define OPT_DISABLE_XA51 $OPT_DISABLE_XA51
+_ACEOF
+
+
+
+ echo xa51 >>ports.all
+ if test $OPT_DISABLE_XA51 = 0; then
+ echo xa51 >>ports.build
+ fi
+
+
+ # Check whether --enable-hc08-port was given.
+if test "${enable_hc08_port+set}" = set; then
+ enableval=$enable_hc08_port;
+fi
+
+
+ if test "$enable_hc08_port" = "no"; then
+ OPT_DISABLE_HC08=1
+ else
+ enable_hc08_port="yes"
+ OPT_DISABLE_HC08=0
+ fi
+
+ cat >>confdefs.h <<_ACEOF
+#define OPT_DISABLE_HC08 $OPT_DISABLE_HC08
+_ACEOF
+
+
+
+ echo hc08 >>ports.all
+ if test $OPT_DISABLE_HC08 = 0; then
+ echo hc08 >>ports.build
+ fi
+
+
+
+ # Check whether --enable-ucsim was given.
+if test "${enable_ucsim+set}" = set; then
+ enableval=$enable_ucsim;
+fi
+
+
+ arg1=`echo ucsim | sed s/-/_/`
+
+ if test "`eval echo \\$enable_$arg1`" = "no"; then
+ OPT_DISABLE_UCSIM=1
+ else
+ OPT_DISABLE_UCSIM=0
+ fi
+
+ cat >>confdefs.h <<_ACEOF
+#define OPT_DISABLE_UCSIM $OPT_DISABLE_UCSIM
+_ACEOF
+
+
+
+
+ # Check whether --enable-device-lib was given.
+if test "${enable_device_lib+set}" = set; then
+ enableval=$enable_device_lib;
+fi
+
+
+ arg1=`echo device-lib | sed s/-/_/`
+
+ if test "`eval echo \\$enable_$arg1`" = "no"; then
+ OPT_DISABLE_DEVICE_LIB=1
+ else
+ OPT_DISABLE_DEVICE_LIB=0
+ fi
+
+ cat >>confdefs.h <<_ACEOF
+#define OPT_DISABLE_DEVICE_LIB $OPT_DISABLE_DEVICE_LIB
+_ACEOF
+
+
+
+
+ # Check whether --enable-packihx was given.
+if test "${enable_packihx+set}" = set; then
+ enableval=$enable_packihx;
+fi
+
+
+ arg1=`echo packihx | sed s/-/_/`
+
+ if test "`eval echo \\$enable_$arg1`" = "no"; then
+ OPT_DISABLE_PACKIHX=1
+ else
+ OPT_DISABLE_PACKIHX=0
+ fi
+
+ cat >>confdefs.h <<_ACEOF
+#define OPT_DISABLE_PACKIHX $OPT_DISABLE_PACKIHX
+_ACEOF
+
+
+
+
+ # Check whether --enable-sdcpp was given.
+if test "${enable_sdcpp+set}" = set; then
+ enableval=$enable_sdcpp;
+fi
+
+
+ arg1=`echo sdcpp | sed s/-/_/`
+
+ if test "`eval echo \\$enable_$arg1`" = "no"; then
+ OPT_DISABLE_SDCPP=1
+ else
+ OPT_DISABLE_SDCPP=0
+ fi
+
+ cat >>confdefs.h <<_ACEOF
+#define OPT_DISABLE_SDCPP $OPT_DISABLE_SDCPP
+_ACEOF
+
+
+
+
+ # Check whether --enable-sdcdb was given.
+if test "${enable_sdcdb+set}" = set; then
+ enableval=$enable_sdcdb;
+fi
+
+
+ arg1=`echo sdcdb | sed s/-/_/`
+
+ if test "`eval echo \\$enable_$arg1`" = "no"; then
+ OPT_DISABLE_SDCDB=1
+ else
+ OPT_DISABLE_SDCDB=0
+ fi
+
+ cat >>confdefs.h <<_ACEOF
+#define OPT_DISABLE_SDCDB $OPT_DISABLE_SDCDB
+_ACEOF
+
+
+
+
+
+ # Check whether --enable-doc was given.
+if test "${enable_doc+set}" = set; then
+ enableval=$enable_doc;
+fi
+
+
+ if test "$enable_doc" = "yes"; then
+ OPT_ENABLE_DOC=1
+ else
+ OPT_ENABLE_DOC=0
+ fi
+
+ cat >>confdefs.h <<_ACEOF
+#define OPT_ENABLE_DOC $OPT_ENABLE_DOC
+_ACEOF
+
+
+
+# Extract the first word of "lyx", so it can be a program name with args.
+set dummy lyx; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_LYX+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$LYX"; then
+ ac_cv_prog_LYX="$LYX" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_LYX="lyx"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+ test -z "$ac_cv_prog_LYX" && ac_cv_prog_LYX=":"
+fi
+fi
+LYX=$ac_cv_prog_LYX
+if test -n "$LYX"; then
+ { $as_echo "$as_me:$LINENO: result: $LYX" >&5
+$as_echo "$LYX" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+# Extract the first word of "latex2html", so it can be a program name with args.
+set dummy latex2html; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_LATEX2HTML+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$LATEX2HTML"; then
+ ac_cv_prog_LATEX2HTML="$LATEX2HTML" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_LATEX2HTML="latex2html"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+ test -z "$ac_cv_prog_LATEX2HTML" && ac_cv_prog_LATEX2HTML=":"
+fi
+fi
+LATEX2HTML=$ac_cv_prog_LATEX2HTML
+if test -n "$LATEX2HTML"; then
+ { $as_echo "$as_me:$LINENO: result: $LATEX2HTML" >&5
+$as_echo "$LATEX2HTML" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+# Extract the first word of "pdflatex", so it can be a program name with args.
+set dummy pdflatex; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_PDFLATEX+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$PDFLATEX"; then
+ ac_cv_prog_PDFLATEX="$PDFLATEX" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_PDFLATEX="pdflatex"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+ test -z "$ac_cv_prog_PDFLATEX" && ac_cv_prog_PDFLATEX=":"
+fi
+fi
+PDFLATEX=$ac_cv_prog_PDFLATEX
+if test -n "$PDFLATEX"; then
+ { $as_echo "$as_me:$LINENO: result: $PDFLATEX" >&5
+$as_echo "$PDFLATEX" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+# Extract the first word of "pdfopt", so it can be a program name with args.
+set dummy pdfopt; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_PDFOPT+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$PDFOPT"; then
+ ac_cv_prog_PDFOPT="$PDFOPT" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_PDFOPT="pdfopt"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+ test -z "$ac_cv_prog_PDFOPT" && ac_cv_prog_PDFOPT=":"
+fi
+fi
+PDFOPT=$ac_cv_prog_PDFOPT
+if test -n "$PDFOPT"; then
+ { $as_echo "$as_me:$LINENO: result: $PDFOPT" >&5
+$as_echo "$PDFOPT" >&6; }