fix big endian hosts
[fw/sdcc] / configure
index a828681467e461fcca0fa9fd3949615b1808a6f2..a0b6e55aa474023292445bd76ecab6aff3e78257 100755 (executable)
--- a/configure
+++ b/configure
@@ -308,7 +308,7 @@ ac_includes_default="\
 ac_subdirs_all="$ac_subdirs_all support/cpp2"
 ac_subdirs_all="$ac_subdirs_all packihx"
 ac_subdirs_all="$ac_subdirs_all sim/ucsim"
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS AWK VERSION VERSIONHI VERSIONLO VERSIONP CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CXX CXXFLAGS ac_ct_CXX CPP INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA RANLIB ac_ct_RANLIB LEX LEXLIB LEX_OUTPUT_ROOT YACC AUTOCONF STRIP AS CP LYX LATEX LATEX2HTML PDFLATEX DVIPDF EGREP M_OR_MM sdcc_datadir OPT_ENABLE_UCSIM OPT_ENABLE_DEVICE_LIB_BUILD OPT_ENABLE_PACKIHX subdirs LIBOBJS LTLIBOBJS'
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS AWK VERSION VERSIONHI VERSIONLO VERSIONP CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CXX CXXFLAGS ac_ct_CXX CPP INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA RANLIB ac_ct_RANLIB LEX LEXLIB LEX_OUTPUT_ROOT YACC AUTOCONF STRIP AS CP LYX LATEX LATEX2HTML PDFLATEX DVIPDF EGREP M_OR_MM sdccconf_h_dir_separator include_dir_suffix lib_dir_suffix docdir OPT_ENABLE_UCSIM OPT_ENABLE_DEVICE_LIB_BUILD OPT_ENABLE_PACKIHX subdirs LIBOBJS LTLIBOBJS'
 ac_subst_files=''
 
 # Initialize some variables set by options.
@@ -777,6 +777,22 @@ ac_env_CPP_set=${CPP+set}
 ac_env_CPP_value=$CPP
 ac_cv_env_CPP_set=${CPP+set}
 ac_cv_env_CPP_value=$CPP
+ac_env_sdccconf_h_dir_separator_set=${sdccconf_h_dir_separator+set}
+ac_env_sdccconf_h_dir_separator_value=$sdccconf_h_dir_separator
+ac_cv_env_sdccconf_h_dir_separator_set=${sdccconf_h_dir_separator+set}
+ac_cv_env_sdccconf_h_dir_separator_value=$sdccconf_h_dir_separator
+ac_env_include_dir_suffix_set=${include_dir_suffix+set}
+ac_env_include_dir_suffix_value=$include_dir_suffix
+ac_cv_env_include_dir_suffix_set=${include_dir_suffix+set}
+ac_cv_env_include_dir_suffix_value=$include_dir_suffix
+ac_env_lib_dir_suffix_set=${lib_dir_suffix+set}
+ac_env_lib_dir_suffix_value=$lib_dir_suffix
+ac_cv_env_lib_dir_suffix_set=${lib_dir_suffix+set}
+ac_cv_env_lib_dir_suffix_value=$lib_dir_suffix
+ac_env_docdir_set=${docdir+set}
+ac_env_docdir_value=$docdir
+ac_cv_env_docdir_set=${docdir+set}
+ac_cv_env_docdir_value=$docdir
 
 #
 # Report the --help message.
@@ -857,7 +873,9 @@ 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-pic16-port    Excludes the PIC16 port
   --disable-xa51-port     Excludes the XA51 port
   --disable-ucsim         Disables configuring and building of ucsim
   --disable-device-lib-build
@@ -876,6 +894,13 @@ Some influential environment variables:
   CXX         C++ compiler command
   CXXFLAGS    C++ compiler flags
   CPP         C preprocessor
+  sdccconf_h_dir_separator
+              needed in sdccconf.h: either "/" (default) or "\\"
+  include_dir_suffix
+              appended to datadir to define SDCC's include directory
+  lib_dir_suffix
+              appended to datadir to define SDCC's library root directory
+  docdir      documentation installation directory
 
 Use these variables to override the choices made by `configure' or to help
 it to find libraries and programs with nonstandard names/locations.
@@ -1310,8 +1335,6 @@ fi
 VERSIONHI=`echo $VERSION|$AWK 'BEGIN {FS="."} {print $1}'`
 VERSIONLO=`echo $VERSION|$AWK 'BEGIN {FS="."} {print $2}'`
 VERSIONP=`echo $VERSION|$AWK 'BEGIN {FS="."} {print $3}'`
-# Assume no special extension
-EXEEXT=`echo $EXEEXT`
 
 echo "$as_me:$LINENO: result: ${VERSION}" >&5
 echo "${ECHO_T}${VERSION}" >&6
@@ -3961,16 +3984,65 @@ done
 
 
 
-# This macro _AC_DEFINEs VARNAME to the expansion of the DIR variable,
-# taking care of fixing up ${prefix} and such.
+# This macro expands DIR and assigns it to RET.
+# If DIR is NONE, then it's replaced by DEFAULT.
 #
-# Note that the 3 argument form is only supported with autoconf 2.13
-# and later (i.e. only where _AC_DEFINE supports 3 arguments).
+# Based on AC_DEFINE_DIR
 #
 # Examples:
 #
-#  AC_DEFINE_DIR(DATADIR, datadir)
-#  AC_DEFINE_DIR(PROG_PATH, bindir, [Location of installed binaries])
+#  AC_EXPAND(prefix, "/usr/local", expanded_prefix)
+
+
+
+# adl_NORMALIZE_PATH
+#
+#  - empty paths are changed to '.'
+#  - trailing slashes are removed
+#  - repeated slashes are squeezed except a leading doubled slash '//'
+#    (which might indicate a networked disk on some OS).
+#
+#
+# REFERENCE_STRING is used to turn '/' into '\' and vice-versa: if
+# REFERENCE_STRING contains some backslashes, all slashes and backslashes
+# are turned into backslashes, otherwise they are all turned into slashes.
+#
+# This makes processing of DOS filenames quite easier, because you can turn a
+# filename to the Unix notation, make your processing, and turn it back to
+# original notation.
+
+
+
+
+# adl_COMPUTE_RELATIVE_PATH
+#
+# PATH_LIST is a space-separated list of colon-separated triplets of the form
+# 'FROM:TO:RESULT'. This function iterates over these triplets and set $RESULT
+# to the relative path from $FROM to $TO. Note that $FROM and $TO needs to be
+# absolute filenames for this macro to success.
+
+
+
+## Note:
+## *****
+## The following helper macros are too fragile to be used out
+## of adl_COMPUTE_RELATIVE_PATHS (mainly because they assume that
+## paths are normalized), that's why I'm keeping them in the same file.
+## Still, some of them maybe worth to reuse.
+
+
+
+
+
+
+
+
+
+
+
+
+
+# AC_NORMALIZE_DEFINE_UNQUOTED(var, DEFINE, REFERENCE_STRING)
 
 
 
@@ -4020,7 +4092,7 @@ echo "$as_me:$LINENO: result: $sdcc_cv_CCggdb" >&5
 echo "${ECHO_T}$sdcc_cv_CCggdb" >&6
 
 if test "$sdcc_cv_CCggdb" = "yes"; then
-  CFLAGS="-ggdb -O2"
+  CFLAGS="-ggdb ${CFLAGS}"
 fi
 
 
@@ -4045,9 +4117,10 @@ echo "$as_me:$LINENO: result: $sdcc_cv_CCpipe" >&5
 echo "${ECHO_T}$sdcc_cv_CCpipe" >&6
 
 if test "$sdcc_cv_CCpipe" = "yes"; then
-  CFLAGS="$CFLAGS -pipe"
+  CFLAGS="-pipe $CFLAGS"
 fi
 
+
 # Checks for typedefs, structures, and compiler characteristics.
 # ===========================================================================
 echo "$as_me:$LINENO: checking return type of signal handlers" >&5
@@ -5623,203 +5696,749 @@ esac
 
 # Set standard installation paths
 # ===========================================================================
-case $host in
-    *mingw32*)
-       MINGW32_HOST="yes"
-       ;;
-    *)
-       MINGW32_HOST="no"
-       ;;
-esac
 
-echo "$as_me:$LINENO: checking host mingw32" >&5
-echo $ECHO_N "checking host mingw32... $ECHO_C" >&6
-echo "$as_me:$LINENO: result: $MINGW32_HOST" >&5
-echo "${ECHO_T}$MINGW32_HOST" >&6
+# In the Makefiles we need paths with '/' as directory separator, even if
+# crosscompiling for Win32.
+# And we want to preserve the macros (e.g. ${prefix}) in the Makefiles.
+# The variables in the Makefiles are replaced by AC_SUBST()
+#
+# In sdccconf.h the '/' in paths can be replaced by "\\" (normalized), if
+#
+# The macros are expanded for the header.
+# The variables in the header are replaced by AC_*DEFINE*()
+# sdccconf_h_dir_separator contains a backslash.
 
-# prefix: *nix default is "NONE"
-# prefix: mingw32 default is "/sdcc"
-if test "$prefix" = NONE; then
-    if test "$MINGW32_HOST" = "no"; then
-       prefix="/usr/local"
-    else
-       prefix="/sdcc"
-    fi
+if test "${sdccconf_h_dir_separator}" = ""; then
+    sdccconf_h_dir_separator="/"
 fi
 
-# datadir: *nix default is "${prefix}/share"
-if test "$datadir" = "\${prefix}/share"; then
-    if test "$MINGW32_HOST" = "no"; then
-       datadir="\${prefix}/share/sdcc"
-    fi
-# mingw32 default is "/sdcc"
-elif test "$datadir" = "/sdcc"; then
-    if test "$MINGW32_HOST" = "yes"; then
-       datadir="\${prefix}"
-    fi
+# Makefiles
+###########
+
+# include_dir_suffix:
+# *nix default: "sdcc/include"
+
+
+if test "${include_dir_suffix}" = ""; then
+    include_dir_suffix="sdcc/include"
 fi
 
-# standard libs
-cat >>confdefs.h <<_ACEOF
-#define STD_LIB "libsdcc"
-_ACEOF
 
-cat >>confdefs.h <<_ACEOF
-#define STD_INT_LIB "libint"
-_ACEOF
+# lib_dir_suffix:
+# *nix default: "sdcc/lib"
 
-cat >>confdefs.h <<_ACEOF
-#define STD_LONG_LIB "liblong"
-_ACEOF
+if test "${lib_dir_suffix}" = ""; then
+    lib_dir_suffix="sdcc/lib"
+fi
 
-cat >>confdefs.h <<_ACEOF
-#define STD_FP_LIB "libfloat"
-_ACEOF
+
+# docdir:
+# *nix default: "${datadir}/sdcc/doc"
+
+if test "${docdir}" = ""; then
+    docdir="\${datadir}"/sdcc/doc
+fi
+
+
+
+
+# sdccconf.h
+############
 
 cat >>confdefs.h <<_ACEOF
-#define STD_DS390_LIB "libds390"
+#define DIR_SEPARATOR_STRING "${sdccconf_h_dir_separator}"
 _ACEOF
 
 cat >>confdefs.h <<_ACEOF
-#define STD_xa51_LIB "xa51"
+#define DIR_SEPARATOR_CHAR   '${sdccconf_h_dir_separator}'
 _ACEOF
 
 
+# prefix:
+# default: "NONE", ${ac_default_prefix}: "/usr/local"
 
   test "x$prefix" = xNONE && prefix="$ac_default_prefix"
   test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
-  ac_define_dir=`eval echo $"${prefix}"`
-  ac_define_dir=`eval echo $ac_define_dir`
+  ac_expand=$prefix
+  test "x$ac_expand" = xNONE && ac_expand="$ac_default_prefix"
+  ac_expand=`eval echo $ac_expand`
+  expanded_prefix=`eval echo $ac_expand`
+
+
+  ac_ndu=$expanded_prefix
+  case ":$ac_ndu:" in
+# change empty paths to '.'
+  ::) ac_ndu='.' ;;
+# strip trailing slashes
+  :*[\\/]:) ac_ndu=`echo "$ac_ndu" | sed 's,[\\/]*$,,'` ;;
+  :*:) ;;
+esac
+# squeze repeated slashes
+case $sdccconf_h_dir_separator in
+# if the path contains any backslashes, turn slashes into backslashes
+
+# Bernhard Held 2003-04-06
+# This was the original line. It doesn't:
+# - convert the first slash
+# - replace a slash with a double-backslash
+# *\\*) ac_ndu=`echo "[$]ac_ndu" | sed 's,\(.\)[[\\/]][[\\/]]*,\1\\\\,g'` ;;
+ *\\*) ac_ndu=`echo "$ac_ndu" | sed 's,\(.\)[\\/][\\/]*,\1\\\\\\\\,g' | sed 's,^[\\/],\\\\\\\\,'` ;;
+
+# if the path contains slashes, also turn backslashes into slashes
+ *) ac_ndu=`echo "$ac_ndu" | sed 's,\(.\)[\\/][\\/]*,\1/,g'` ;;
+esac
   cat >>confdefs.h <<_ACEOF
-#define PREFIX "$ac_define_dir"
+#define PREFIX "${ac_ndu}"
 _ACEOF
 
 
 
+# exec_prefix:
+# default: "${prefix}"
+
   test "x$prefix" = xNONE && prefix="$ac_default_prefix"
   test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
-  ac_define_dir=`eval echo $"$datadir"`
-  ac_define_dir=`eval echo $ac_define_dir`
+  ac_expand=$exec_prefix
+  test "x$ac_expand" = xNONE && ac_expand="$expanded_prefix"
+  ac_expand=`eval echo $ac_expand`
+  expanded_exec_prefix=`eval echo $ac_expand`
+
+
+  ac_ndu=$expanded_exec_prefix
+  case ":$ac_ndu:" in
+# change empty paths to '.'
+  ::) ac_ndu='.' ;;
+# strip trailing slashes
+  :*[\\/]:) ac_ndu=`echo "$ac_ndu" | sed 's,[\\/]*$,,'` ;;
+  :*:) ;;
+esac
+# squeze repeated slashes
+case $sdccconf_h_dir_separator in
+# if the path contains any backslashes, turn slashes into backslashes
+
+# Bernhard Held 2003-04-06
+# This was the original line. It doesn't:
+# - convert the first slash
+# - replace a slash with a double-backslash
+# *\\*) ac_ndu=`echo "[$]ac_ndu" | sed 's,\(.\)[[\\/]][[\\/]]*,\1\\\\,g'` ;;
+ *\\*) ac_ndu=`echo "$ac_ndu" | sed 's,\(.\)[\\/][\\/]*,\1\\\\\\\\,g' | sed 's,^[\\/],\\\\\\\\,'` ;;
+
+# if the path contains slashes, also turn backslashes into slashes
+ *) ac_ndu=`echo "$ac_ndu" | sed 's,\(.\)[\\/][\\/]*,\1/,g'` ;;
+esac
   cat >>confdefs.h <<_ACEOF
-#define DATADIR "$ac_define_dir"
+#define EXEC_PREFIX "${ac_ndu}"
 _ACEOF
 
 
 
-
-# search paths
-bin_dir_suffix="bin"
+# bindir:
+# default: "${exec_prefix}/bin"
 
   test "x$prefix" = xNONE && prefix="$ac_default_prefix"
   test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
-  ac_define_dir=`eval echo $"${bin_dir_suffix}"`
-  ac_define_dir=`eval echo $ac_define_dir`
+  ac_expand=$bindir
+  test "x$ac_expand" = xNONE && ac_expand="$"NONE""
+  ac_expand=`eval echo $ac_expand`
+  expanded_bindir=`eval echo $ac_expand`
+
+
+  ac_ndu=$expanded_bindir
+  case ":$ac_ndu:" in
+# change empty paths to '.'
+  ::) ac_ndu='.' ;;
+# strip trailing slashes
+  :*[\\/]:) ac_ndu=`echo "$ac_ndu" | sed 's,[\\/]*$,,'` ;;
+  :*:) ;;
+esac
+# squeze repeated slashes
+case $sdccconf_h_dir_separator in
+# if the path contains any backslashes, turn slashes into backslashes
+
+# Bernhard Held 2003-04-06
+# This was the original line. It doesn't:
+# - convert the first slash
+# - replace a slash with a double-backslash
+# *\\*) ac_ndu=`echo "[$]ac_ndu" | sed 's,\(.\)[[\\/]][[\\/]]*,\1\\\\,g'` ;;
+ *\\*) ac_ndu=`echo "$ac_ndu" | sed 's,\(.\)[\\/][\\/]*,\1\\\\\\\\,g' | sed 's,^[\\/],\\\\\\\\,'` ;;
+
+# if the path contains slashes, also turn backslashes into slashes
+ *) ac_ndu=`echo "$ac_ndu" | sed 's,\(.\)[\\/][\\/]*,\1/,g'` ;;
+esac
   cat >>confdefs.h <<_ACEOF
-#define BIN_DIR_SUFFIX "$ac_define_dir"
+#define BINDIR "${ac_ndu}"
 _ACEOF
 
 
 
-    if test "$MINGW32_HOST" = "no"; then
-       search_suffix="share/sdcc"
-    else
-       search_suffix=""
-    fi
+# datadir:
+# default: "${prefix}/share"
 
   test "x$prefix" = xNONE && prefix="$ac_default_prefix"
   test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
-  ac_define_dir=`eval echo $"${search_suffix}"`
-  ac_define_dir=`eval echo $ac_define_dir`
+  ac_expand=$datadir
+  test "x$ac_expand" = xNONE && ac_expand="$"NONE""
+  ac_expand=`eval echo $ac_expand`
+  expanded_datadir=`eval echo $ac_expand`
+
+
+  ac_ndu=$expanded_datadir
+  case ":$ac_ndu:" in
+# change empty paths to '.'
+  ::) ac_ndu='.' ;;
+# strip trailing slashes
+  :*[\\/]:) ac_ndu=`echo "$ac_ndu" | sed 's,[\\/]*$,,'` ;;
+  :*:) ;;
+esac
+# squeze repeated slashes
+case $sdccconf_h_dir_separator in
+# if the path contains any backslashes, turn slashes into backslashes
+
+# Bernhard Held 2003-04-06
+# This was the original line. It doesn't:
+# - convert the first slash
+# - replace a slash with a double-backslash
+# *\\*) ac_ndu=`echo "[$]ac_ndu" | sed 's,\(.\)[[\\/]][[\\/]]*,\1\\\\,g'` ;;
+ *\\*) ac_ndu=`echo "$ac_ndu" | sed 's,\(.\)[\\/][\\/]*,\1\\\\\\\\,g' | sed 's,^[\\/],\\\\\\\\,'` ;;
+
+# if the path contains slashes, also turn backslashes into slashes
+ *) ac_ndu=`echo "$ac_ndu" | sed 's,\(.\)[\\/][\\/]*,\1/,g'` ;;
+esac
   cat >>confdefs.h <<_ACEOF
-#define SEARCH_SUFFIX "$ac_define_dir"
+#define DATADIR "${ac_ndu}"
 _ACEOF
 
 
 
-include_dir_suffix="include"
-
-  test "x$prefix" = xNONE && prefix="$ac_default_prefix"
-  test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
-  ac_define_dir=`eval echo $"${include_dir_suffix}"`
-  ac_define_dir=`eval echo $ac_define_dir`
-  cat >>confdefs.h <<_ACEOF
-#define INCLUDE_DIR_SUFFIX "$ac_define_dir"
+# include/lib suffix
+norm_inc_dir_suffix=${include_dir_suffix}
+case ":$norm_inc_dir_suffix:" in
+# change empty paths to '.'
+  ::) norm_inc_dir_suffix='.' ;;
+# strip trailing slashes
+  :*[\\/]:) norm_inc_dir_suffix=`echo "$norm_inc_dir_suffix" | sed 's,[\\/]*$,,'` ;;
+  :*:) ;;
+esac
+# squeze repeated slashes
+case $sdccconf_h_dir_separator in
+# if the path contains any backslashes, turn slashes into backslashes
+
+# Bernhard Held 2003-04-06
+# This was the original line. It doesn't:
+# - convert the first slash
+# - replace a slash with a double-backslash
+# *\\*) norm_inc_dir_suffix=`echo "[$]norm_inc_dir_suffix" | sed 's,\(.\)[[\\/]][[\\/]]*,\1\\\\,g'` ;;
+ *\\*) norm_inc_dir_suffix=`echo "$norm_inc_dir_suffix" | sed 's,\(.\)[\\/][\\/]*,\1\\\\\\\\,g' | sed 's,^[\\/],\\\\\\\\,'` ;;
+
+# if the path contains slashes, also turn backslashes into slashes
+ *) norm_inc_dir_suffix=`echo "$norm_inc_dir_suffix" | sed 's,\(.\)[\\/][\\/]*,\1/,g'` ;;
+esac
+cat >>confdefs.h <<_ACEOF
+#define INCLUDE_DIR_SUFFIX DIR_SEPARATOR_STRING "${norm_inc_dir_suffix}"
 _ACEOF
 
-
-
-lib_dir_suffix="lib"
+norm_lib_dir_suffix=${lib_dir_suffix}
+case ":$norm_lib_dir_suffix:" in
+# change empty paths to '.'
+  ::) norm_lib_dir_suffix='.' ;;
+# strip trailing slashes
+  :*[\\/]:) norm_lib_dir_suffix=`echo "$norm_lib_dir_suffix" | sed 's,[\\/]*$,,'` ;;
+  :*:) ;;
+esac
+# squeze repeated slashes
+case $sdccconf_h_dir_separator in
+# if the path contains any backslashes, turn slashes into backslashes
+
+# Bernhard Held 2003-04-06
+# This was the original line. It doesn't:
+# - convert the first slash
+# - replace a slash with a double-backslash
+# *\\*) norm_lib_dir_suffix=`echo "[$]norm_lib_dir_suffix" | sed 's,\(.\)[[\\/]][[\\/]]*,\1\\\\,g'` ;;
+ *\\*) norm_lib_dir_suffix=`echo "$norm_lib_dir_suffix" | sed 's,\(.\)[\\/][\\/]*,\1\\\\\\\\,g' | sed 's,^[\\/],\\\\\\\\,'` ;;
+
+# if the path contains slashes, also turn backslashes into slashes
+ *) norm_lib_dir_suffix=`echo "$norm_lib_dir_suffix" | sed 's,\(.\)[\\/][\\/]*,\1/,g'` ;;
+esac
+cat >>confdefs.h <<_ACEOF
+#define LIB_DIR_SUFFIX DIR_SEPARATOR_STRING "${norm_lib_dir_suffix}"
+_ACEOF
+
+
+# relative paths
+for _lcl_i in expanded_bindir:expanded_datadir:bin2data_dir; do
+  _lcl_from=\$`echo "$_lcl_i" | sed 's,:.*$,,'`
+  _lcl_to=\$`echo "$_lcl_i" | sed 's,^[^:]*:,,' | sed 's,:[^:]*$,,'`
+  _lcl_result_var=`echo "$_lcl_i" | sed 's,^.*:,,'`
+  _lcl_receval="$_lcl_from"
+_lcl_from=`(test "x$prefix" = xNONE && prefix="$ac_default_prefix"
+     test "x$exec_prefix" = xNONE && exec_prefix="${prefix}"
+     _lcl_receval_old=''
+     while test "$_lcl_receval_old" != "$_lcl_receval"; do
+       _lcl_receval_old="$_lcl_receval"
+       eval _lcl_receval="\"$_lcl_receval\""
+     done
+     echo "$_lcl_receval")`
+  _lcl_receval="$_lcl_to"
+_lcl_to=`(test "x$prefix" = xNONE && prefix="$ac_default_prefix"
+     test "x$exec_prefix" = xNONE && exec_prefix="${prefix}"
+     _lcl_receval_old=''
+     while test "$_lcl_receval_old" != "$_lcl_receval"; do
+       _lcl_receval_old="$_lcl_receval"
+       eval _lcl_receval="\"$_lcl_receval\""
+     done
+     echo "$_lcl_receval")`
+  _lcl_notation="$_lcl_from$_lcl_to"
+  case ":$_lcl_from:" in
+# change empty paths to '.'
+  ::) _lcl_from='.' ;;
+# strip trailing slashes
+  :*[\\/]:) _lcl_from=`echo "$_lcl_from" | sed 's,[\\/]*$,,'` ;;
+  :*:) ;;
+esac
+# squeze repeated slashes
+case '/' in
+# if the path contains any backslashes, turn slashes into backslashes
+
+# Bernhard Held 2003-04-06
+# This was the original line. It doesn't:
+# - convert the first slash
+# - replace a slash with a double-backslash
+# *\\*) _lcl_from=`echo "[$]_lcl_from" | sed 's,\(.\)[[\\/]][[\\/]]*,\1\\\\,g'` ;;
+ *\\*) _lcl_from=`echo "$_lcl_from" | sed 's,\(.\)[\\/][\\/]*,\1\\\\\\\\,g' | sed 's,^[\\/],\\\\\\\\,'` ;;
+
+# if the path contains slashes, also turn backslashes into slashes
+ *) _lcl_from=`echo "$_lcl_from" | sed 's,\(.\)[\\/][\\/]*,\1/,g'` ;;
+esac
+  case ":$_lcl_to:" in
+# change empty paths to '.'
+  ::) _lcl_to='.' ;;
+# strip trailing slashes
+  :*[\\/]:) _lcl_to=`echo "$_lcl_to" | sed 's,[\\/]*$,,'` ;;
+  :*:) ;;
+esac
+# squeze repeated slashes
+case '/' in
+# if the path contains any backslashes, turn slashes into backslashes
+
+# Bernhard Held 2003-04-06
+# This was the original line. It doesn't:
+# - convert the first slash
+# - replace a slash with a double-backslash
+# *\\*) _lcl_to=`echo "[$]_lcl_to" | sed 's,\(.\)[[\\/]][[\\/]]*,\1\\\\,g'` ;;
+ *\\*) _lcl_to=`echo "$_lcl_to" | sed 's,\(.\)[\\/][\\/]*,\1\\\\\\\\,g' | sed 's,^[\\/],\\\\\\\\,'` ;;
+
+# if the path contains slashes, also turn backslashes into slashes
+ *) _lcl_to=`echo "$_lcl_to" | sed 's,\(.\)[\\/][\\/]*,\1/,g'` ;;
+esac
+  _lcl_common_prefix=''
+_lcl_second_prefix_match=''
+while test "$_lcl_second_prefix_match" != 0; do
+  _lcl_first_prefix=`expr "x$_lcl_from" : "x\($_lcl_common_prefix/*[^/]*\)"`
+  _lcl_second_prefix_match=`expr "x$_lcl_to" : "x$_lcl_first_prefix"`
+  if test "$_lcl_second_prefix_match" != 0; then
+    if test "$_lcl_first_prefix" != "$_lcl_common_prefix"; then
+      _lcl_common_prefix="$_lcl_first_prefix"
+    else
+      _lcl_second_prefix_match=0
+    fi
+  fi
+done
+_lcl_first_suffix=`expr "x$_lcl_from" : "x$_lcl_common_prefix/*\(.*\)"`
+_lcl_first_rel=''
+_lcl_tmp='xxx'
+while test "$_lcl_tmp" != ''; do
+  _lcl_tmp=`expr "x$_lcl_first_suffix" : "x[^/]*/*\(.*\)"`
+  if test "$_lcl_first_suffix" != ''; then
+     _lcl_first_suffix="$_lcl_tmp"
+     _lcl_first_rel="../$_lcl_first_rel"
+  fi
+done
+_lcl_second_suffix=`expr "x$_lcl_to" : "x$_lcl_common_prefix/*\(.*\)"`
+_lcl_result_tmp="$_lcl_first_rel$_lcl_second_suffix"
+  case ":$_lcl_result_tmp:" in
+# change empty paths to '.'
+  ::) _lcl_result_tmp='.' ;;
+# strip trailing slashes
+  :*[\\/]:) _lcl_result_tmp=`echo "$_lcl_result_tmp" | sed 's,[\\/]*$,,'` ;;
+  :*:) ;;
+esac
+# squeze repeated slashes
+case "$_lcl_notation" in
+# if the path contains any backslashes, turn slashes into backslashes
+
+# Bernhard Held 2003-04-06
+# This was the original line. It doesn't:
+# - convert the first slash
+# - replace a slash with a double-backslash
+# *\\*) _lcl_result_tmp=`echo "[$]_lcl_result_tmp" | sed 's,\(.\)[[\\/]][[\\/]]*,\1\\\\,g'` ;;
+ *\\*) _lcl_result_tmp=`echo "$_lcl_result_tmp" | sed 's,\(.\)[\\/][\\/]*,\1\\\\\\\\,g' | sed 's,^[\\/],\\\\\\\\,'` ;;
+
+# if the path contains slashes, also turn backslashes into slashes
+ *) _lcl_result_tmp=`echo "$_lcl_result_tmp" | sed 's,\(.\)[\\/][\\/]*,\1/,g'` ;;
+esac
+  eval $_lcl_result_var='$_lcl_result_tmp'
+done
+case ":$bin2data_dir:" in
+# change empty paths to '.'
+  ::) bin2data_dir='.' ;;
+# strip trailing slashes
+  :*[\\/]:) bin2data_dir=`echo "$bin2data_dir" | sed 's,[\\/]*$,,'` ;;
+  :*:) ;;
+esac
+# squeze repeated slashes
+case $sdccconf_h_dir_separator in
+# if the path contains any backslashes, turn slashes into backslashes
+
+# Bernhard Held 2003-04-06
+# This was the original line. It doesn't:
+# - convert the first slash
+# - replace a slash with a double-backslash
+# *\\*) bin2data_dir=`echo "[$]bin2data_dir" | sed 's,\(.\)[[\\/]][[\\/]]*,\1\\\\,g'` ;;
+ *\\*) bin2data_dir=`echo "$bin2data_dir" | sed 's,\(.\)[\\/][\\/]*,\1\\\\\\\\,g' | sed 's,^[\\/],\\\\\\\\,'` ;;
+
+# if the path contains slashes, also turn backslashes into slashes
+ *) bin2data_dir=`echo "$bin2data_dir" | sed 's,\(.\)[\\/][\\/]*,\1/,g'` ;;
+esac
 cat >>confdefs.h <<_ACEOF
-#define LIB_DIR_SUFFIX "${lib_dir_suffix}"
+#define BIN2DATA_DIR DIR_SEPARATOR_STRING "${bin2data_dir}"
+_ACEOF
+
+
+for _lcl_i in expanded_prefix:expanded_bindir:prefix2bin_dir; do
+  _lcl_from=\$`echo "$_lcl_i" | sed 's,:.*$,,'`
+  _lcl_to=\$`echo "$_lcl_i" | sed 's,^[^:]*:,,' | sed 's,:[^:]*$,,'`
+  _lcl_result_var=`echo "$_lcl_i" | sed 's,^.*:,,'`
+  _lcl_receval="$_lcl_from"
+_lcl_from=`(test "x$prefix" = xNONE && prefix="$ac_default_prefix"
+     test "x$exec_prefix" = xNONE && exec_prefix="${prefix}"
+     _lcl_receval_old=''
+     while test "$_lcl_receval_old" != "$_lcl_receval"; do
+       _lcl_receval_old="$_lcl_receval"
+       eval _lcl_receval="\"$_lcl_receval\""
+     done
+     echo "$_lcl_receval")`
+  _lcl_receval="$_lcl_to"
+_lcl_to=`(test "x$prefix" = xNONE && prefix="$ac_default_prefix"
+     test "x$exec_prefix" = xNONE && exec_prefix="${prefix}"
+     _lcl_receval_old=''
+     while test "$_lcl_receval_old" != "$_lcl_receval"; do
+       _lcl_receval_old="$_lcl_receval"
+       eval _lcl_receval="\"$_lcl_receval\""
+     done
+     echo "$_lcl_receval")`
+  _lcl_notation="$_lcl_from$_lcl_to"
+  case ":$_lcl_from:" in
+# change empty paths to '.'
+  ::) _lcl_from='.' ;;
+# strip trailing slashes
+  :*[\\/]:) _lcl_from=`echo "$_lcl_from" | sed 's,[\\/]*$,,'` ;;
+  :*:) ;;
+esac
+# squeze repeated slashes
+case '/' in
+# if the path contains any backslashes, turn slashes into backslashes
+
+# Bernhard Held 2003-04-06
+# This was the original line. It doesn't:
+# - convert the first slash
+# - replace a slash with a double-backslash
+# *\\*) _lcl_from=`echo "[$]_lcl_from" | sed 's,\(.\)[[\\/]][[\\/]]*,\1\\\\,g'` ;;
+ *\\*) _lcl_from=`echo "$_lcl_from" | sed 's,\(.\)[\\/][\\/]*,\1\\\\\\\\,g' | sed 's,^[\\/],\\\\\\\\,'` ;;
+
+# if the path contains slashes, also turn backslashes into slashes
+ *) _lcl_from=`echo "$_lcl_from" | sed 's,\(.\)[\\/][\\/]*,\1/,g'` ;;
+esac
+  case ":$_lcl_to:" in
+# change empty paths to '.'
+  ::) _lcl_to='.' ;;
+# strip trailing slashes
+  :*[\\/]:) _lcl_to=`echo "$_lcl_to" | sed 's,[\\/]*$,,'` ;;
+  :*:) ;;
+esac
+# squeze repeated slashes
+case '/' in
+# if the path contains any backslashes, turn slashes into backslashes
+
+# Bernhard Held 2003-04-06
+# This was the original line. It doesn't:
+# - convert the first slash
+# - replace a slash with a double-backslash
+# *\\*) _lcl_to=`echo "[$]_lcl_to" | sed 's,\(.\)[[\\/]][[\\/]]*,\1\\\\,g'` ;;
+ *\\*) _lcl_to=`echo "$_lcl_to" | sed 's,\(.\)[\\/][\\/]*,\1\\\\\\\\,g' | sed 's,^[\\/],\\\\\\\\,'` ;;
+
+# if the path contains slashes, also turn backslashes into slashes
+ *) _lcl_to=`echo "$_lcl_to" | sed 's,\(.\)[\\/][\\/]*,\1/,g'` ;;
+esac
+  _lcl_common_prefix=''
+_lcl_second_prefix_match=''
+while test "$_lcl_second_prefix_match" != 0; do
+  _lcl_first_prefix=`expr "x$_lcl_from" : "x\($_lcl_common_prefix/*[^/]*\)"`
+  _lcl_second_prefix_match=`expr "x$_lcl_to" : "x$_lcl_first_prefix"`
+  if test "$_lcl_second_prefix_match" != 0; then
+    if test "$_lcl_first_prefix" != "$_lcl_common_prefix"; then
+      _lcl_common_prefix="$_lcl_first_prefix"
+    else
+      _lcl_second_prefix_match=0
+    fi
+  fi
+done
+_lcl_first_suffix=`expr "x$_lcl_from" : "x$_lcl_common_prefix/*\(.*\)"`
+_lcl_first_rel=''
+_lcl_tmp='xxx'
+while test "$_lcl_tmp" != ''; do
+  _lcl_tmp=`expr "x$_lcl_first_suffix" : "x[^/]*/*\(.*\)"`
+  if test "$_lcl_first_suffix" != ''; then
+     _lcl_first_suffix="$_lcl_tmp"
+     _lcl_first_rel="../$_lcl_first_rel"
+  fi
+done
+_lcl_second_suffix=`expr "x$_lcl_to" : "x$_lcl_common_prefix/*\(.*\)"`
+_lcl_result_tmp="$_lcl_first_rel$_lcl_second_suffix"
+  case ":$_lcl_result_tmp:" in
+# change empty paths to '.'
+  ::) _lcl_result_tmp='.' ;;
+# strip trailing slashes
+  :*[\\/]:) _lcl_result_tmp=`echo "$_lcl_result_tmp" | sed 's,[\\/]*$,,'` ;;
+  :*:) ;;
+esac
+# squeze repeated slashes
+case "$_lcl_notation" in
+# if the path contains any backslashes, turn slashes into backslashes
+
+# Bernhard Held 2003-04-06
+# This was the original line. It doesn't:
+# - convert the first slash
+# - replace a slash with a double-backslash
+# *\\*) _lcl_result_tmp=`echo "[$]_lcl_result_tmp" | sed 's,\(.\)[[\\/]][[\\/]]*,\1\\\\,g'` ;;
+ *\\*) _lcl_result_tmp=`echo "$_lcl_result_tmp" | sed 's,\(.\)[\\/][\\/]*,\1\\\\\\\\,g' | sed 's,^[\\/],\\\\\\\\,'` ;;
+
+# if the path contains slashes, also turn backslashes into slashes
+ *) _lcl_result_tmp=`echo "$_lcl_result_tmp" | sed 's,\(.\)[\\/][\\/]*,\1/,g'` ;;
+esac
+  eval $_lcl_result_var='$_lcl_result_tmp'
+done
+case ":$prefix2bin_dir:" in
+# change empty paths to '.'
+  ::) prefix2bin_dir='.' ;;
+# strip trailing slashes
+  :*[\\/]:) prefix2bin_dir=`echo "$prefix2bin_dir" | sed 's,[\\/]*$,,'` ;;
+  :*:) ;;
+esac
+# squeze repeated slashes
+case $sdccconf_h_dir_separator in
+# if the path contains any backslashes, turn slashes into backslashes
+
+# Bernhard Held 2003-04-06
+# This was the original line. It doesn't:
+# - convert the first slash
+# - replace a slash with a double-backslash
+# *\\*) prefix2bin_dir=`echo "[$]prefix2bin_dir" | sed 's,\(.\)[[\\/]][[\\/]]*,\1\\\\,g'` ;;
+ *\\*) prefix2bin_dir=`echo "$prefix2bin_dir" | sed 's,\(.\)[\\/][\\/]*,\1\\\\\\\\,g' | sed 's,^[\\/],\\\\\\\\,'` ;;
+
+# if the path contains slashes, also turn backslashes into slashes
+ *) prefix2bin_dir=`echo "$prefix2bin_dir" | sed 's,\(.\)[\\/][\\/]*,\1/,g'` ;;
+esac
+cat >>confdefs.h <<_ACEOF
+#define PREFIX2BIN_DIR DIR_SEPARATOR_STRING "${prefix2bin_dir}"
+_ACEOF
+
+
+for _lcl_i in expanded_prefix:expanded_datadir:prefix2data_dir; do
+  _lcl_from=\$`echo "$_lcl_i" | sed 's,:.*$,,'`
+  _lcl_to=\$`echo "$_lcl_i" | sed 's,^[^:]*:,,' | sed 's,:[^:]*$,,'`
+  _lcl_result_var=`echo "$_lcl_i" | sed 's,^.*:,,'`
+  _lcl_receval="$_lcl_from"
+_lcl_from=`(test "x$prefix" = xNONE && prefix="$ac_default_prefix"
+     test "x$exec_prefix" = xNONE && exec_prefix="${prefix}"
+     _lcl_receval_old=''
+     while test "$_lcl_receval_old" != "$_lcl_receval"; do
+       _lcl_receval_old="$_lcl_receval"
+       eval _lcl_receval="\"$_lcl_receval\""
+     done
+     echo "$_lcl_receval")`
+  _lcl_receval="$_lcl_to"
+_lcl_to=`(test "x$prefix" = xNONE && prefix="$ac_default_prefix"
+     test "x$exec_prefix" = xNONE && exec_prefix="${prefix}"
+     _lcl_receval_old=''
+     while test "$_lcl_receval_old" != "$_lcl_receval"; do
+       _lcl_receval_old="$_lcl_receval"
+       eval _lcl_receval="\"$_lcl_receval\""
+     done
+     echo "$_lcl_receval")`
+  _lcl_notation="$_lcl_from$_lcl_to"
+  case ":$_lcl_from:" in
+# change empty paths to '.'
+  ::) _lcl_from='.' ;;
+# strip trailing slashes
+  :*[\\/]:) _lcl_from=`echo "$_lcl_from" | sed 's,[\\/]*$,,'` ;;
+  :*:) ;;
+esac
+# squeze repeated slashes
+case '/' in
+# if the path contains any backslashes, turn slashes into backslashes
+
+# Bernhard Held 2003-04-06
+# This was the original line. It doesn't:
+# - convert the first slash
+# - replace a slash with a double-backslash
+# *\\*) _lcl_from=`echo "[$]_lcl_from" | sed 's,\(.\)[[\\/]][[\\/]]*,\1\\\\,g'` ;;
+ *\\*) _lcl_from=`echo "$_lcl_from" | sed 's,\(.\)[\\/][\\/]*,\1\\\\\\\\,g' | sed 's,^[\\/],\\\\\\\\,'` ;;
+
+# if the path contains slashes, also turn backslashes into slashes
+ *) _lcl_from=`echo "$_lcl_from" | sed 's,\(.\)[\\/][\\/]*,\1/,g'` ;;
+esac
+  case ":$_lcl_to:" in
+# change empty paths to '.'
+  ::) _lcl_to='.' ;;
+# strip trailing slashes
+  :*[\\/]:) _lcl_to=`echo "$_lcl_to" | sed 's,[\\/]*$,,'` ;;
+  :*:) ;;
+esac
+# squeze repeated slashes
+case '/' in
+# if the path contains any backslashes, turn slashes into backslashes
+
+# Bernhard Held 2003-04-06
+# This was the original line. It doesn't:
+# - convert the first slash
+# - replace a slash with a double-backslash
+# *\\*) _lcl_to=`echo "[$]_lcl_to" | sed 's,\(.\)[[\\/]][[\\/]]*,\1\\\\,g'` ;;
+ *\\*) _lcl_to=`echo "$_lcl_to" | sed 's,\(.\)[\\/][\\/]*,\1\\\\\\\\,g' | sed 's,^[\\/],\\\\\\\\,'` ;;
+
+# if the path contains slashes, also turn backslashes into slashes
+ *) _lcl_to=`echo "$_lcl_to" | sed 's,\(.\)[\\/][\\/]*,\1/,g'` ;;
+esac
+  _lcl_common_prefix=''
+_lcl_second_prefix_match=''
+while test "$_lcl_second_prefix_match" != 0; do
+  _lcl_first_prefix=`expr "x$_lcl_from" : "x\($_lcl_common_prefix/*[^/]*\)"`
+  _lcl_second_prefix_match=`expr "x$_lcl_to" : "x$_lcl_first_prefix"`
+  if test "$_lcl_second_prefix_match" != 0; then
+    if test "$_lcl_first_prefix" != "$_lcl_common_prefix"; then
+      _lcl_common_prefix="$_lcl_first_prefix"
+    else
+      _lcl_second_prefix_match=0
+    fi
+  fi
+done
+_lcl_first_suffix=`expr "x$_lcl_from" : "x$_lcl_common_prefix/*\(.*\)"`
+_lcl_first_rel=''
+_lcl_tmp='xxx'
+while test "$_lcl_tmp" != ''; do
+  _lcl_tmp=`expr "x$_lcl_first_suffix" : "x[^/]*/*\(.*\)"`
+  if test "$_lcl_first_suffix" != ''; then
+     _lcl_first_suffix="$_lcl_tmp"
+     _lcl_first_rel="../$_lcl_first_rel"
+  fi
+done
+_lcl_second_suffix=`expr "x$_lcl_to" : "x$_lcl_common_prefix/*\(.*\)"`
+_lcl_result_tmp="$_lcl_first_rel$_lcl_second_suffix"
+  case ":$_lcl_result_tmp:" in
+# change empty paths to '.'
+  ::) _lcl_result_tmp='.' ;;
+# strip trailing slashes
+  :*[\\/]:) _lcl_result_tmp=`echo "$_lcl_result_tmp" | sed 's,[\\/]*$,,'` ;;
+  :*:) ;;
+esac
+# squeze repeated slashes
+case "$_lcl_notation" in
+# if the path contains any backslashes, turn slashes into backslashes
+
+# Bernhard Held 2003-04-06
+# This was the original line. It doesn't:
+# - convert the first slash
+# - replace a slash with a double-backslash
+# *\\*) _lcl_result_tmp=`echo "[$]_lcl_result_tmp" | sed 's,\(.\)[[\\/]][[\\/]]*,\1\\\\,g'` ;;
+ *\\*) _lcl_result_tmp=`echo "$_lcl_result_tmp" | sed 's,\(.\)[\\/][\\/]*,\1\\\\\\\\,g' | sed 's,^[\\/],\\\\\\\\,'` ;;
+
+# if the path contains slashes, also turn backslashes into slashes
+ *) _lcl_result_tmp=`echo "$_lcl_result_tmp" | sed 's,\(.\)[\\/][\\/]*,\1/,g'` ;;
+esac
+  eval $_lcl_result_var='$_lcl_result_tmp'
+done
+case ":$prefix2data_dir:" in
+# change empty paths to '.'
+  ::) prefix2data_dir='.' ;;
+# strip trailing slashes
+  :*[\\/]:) prefix2data_dir=`echo "$prefix2data_dir" | sed 's,[\\/]*$,,'` ;;
+  :*:) ;;
+esac
+# squeze repeated slashes
+case $sdccconf_h_dir_separator in
+# if the path contains any backslashes, turn slashes into backslashes
+
+# Bernhard Held 2003-04-06
+# This was the original line. It doesn't:
+# - convert the first slash
+# - replace a slash with a double-backslash
+# *\\*) prefix2data_dir=`echo "[$]prefix2data_dir" | sed 's,\(.\)[[\\/]][[\\/]]*,\1\\\\,g'` ;;
+ *\\*) prefix2data_dir=`echo "$prefix2data_dir" | sed 's,\(.\)[\\/][\\/]*,\1\\\\\\\\,g' | sed 's,^[\\/],\\\\\\\\,'` ;;
+
+# if the path contains slashes, also turn backslashes into slashes
+ *) prefix2data_dir=`echo "$prefix2data_dir" | sed 's,\(.\)[\\/][\\/]*,\1/,g'` ;;
+esac
+if test "${prefix2data_dir}" = "."; then
+    # small optimization for Mingw32; otherwise Borut will complain ;-)
+    cat >>confdefs.h <<_ACEOF
+#define PREFIX2DATA_DIR ""
 _ACEOF
 
+else
+    cat >>confdefs.h <<_ACEOF
+#define PREFIX2DATA_DIR DIR_SEPARATOR_STRING "${prefix2data_dir}"
+_ACEOF
 
-### <Obsolete>
-# sdcc_datadir is still used in [device,lib]/Makefile
-sdcc_datadir=${datadir}
+fi
 
+# standard libs
+cat >>confdefs.h <<_ACEOF
+#define STD_LIB "libsdcc"
+_ACEOF
 
-# SDCC_[INCLUDE,LIB]_DIR is still used in SDCCmain.c
-if test "${includedir}" = "\${prefix}/include"; then
-    includedir="${datadir}/include"
-fi
+cat >>confdefs.h <<_ACEOF
+#define STD_INT_LIB "libint"
+_ACEOF
 
-  test "x$prefix" = xNONE && prefix="$ac_default_prefix"
-  test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
-  ac_define_dir=`eval echo $"${includedir}"`
-  ac_define_dir=`eval echo $ac_define_dir`
-  cat >>confdefs.h <<_ACEOF
-#define SDCC_INCLUDE_DIR "$ac_define_dir"
+cat >>confdefs.h <<_ACEOF
+#define STD_LONG_LIB "liblong"
 _ACEOF
 
+cat >>confdefs.h <<_ACEOF
+#define STD_FP_LIB "libfloat"
+_ACEOF
 
+cat >>confdefs.h <<_ACEOF
+#define STD_DS390_LIB "libds390"
+_ACEOF
 
-  test "x$prefix" = xNONE && prefix="$ac_default_prefix"
-  test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
-  ac_define_dir=`eval echo $"${datadir}/lib"`
-  ac_define_dir=`eval echo $ac_define_dir`
-  cat >>confdefs.h <<_ACEOF
-#define SDCC_LIB_DIR "$ac_define_dir"
+cat >>confdefs.h <<_ACEOF
+#define STD_DS400_LIB "libds400"
 _ACEOF
 
+cat >>confdefs.h <<_ACEOF
+#define STD_XA51_LIB "libxa51"
+_ACEOF
 
-### </Obsolete>
 
-# environment variables
+# SDCC runtime environment variables
 sdcc_dir_name="SDCC_HOME"
-
-  test "x$prefix" = xNONE && prefix="$ac_default_prefix"
-  test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
-  ac_define_dir=`eval echo $"${sdcc_dir_name}"`
-  ac_define_dir=`eval echo $ac_define_dir`
-  cat >>confdefs.h <<_ACEOF
-#define SDCC_DIR_NAME "$ac_define_dir"
+cat >>confdefs.h <<_ACEOF
+#define SDCC_DIR_NAME "${sdcc_dir_name}"
 _ACEOF
 
 
 sdcc_include_name="SDCC_INCLUDE"
-
-  test "x$prefix" = xNONE && prefix="$ac_default_prefix"
-  test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
-  ac_define_dir=`eval echo $"${sdcc_include_name}"`
-  ac_define_dir=`eval echo $ac_define_dir`
-  cat >>confdefs.h <<_ACEOF
-#define SDCC_INCLUDE_NAME "$ac_define_dir"
+cat >>confdefs.h <<_ACEOF
+#define SDCC_INCLUDE_NAME "${sdcc_include_name}"
 _ACEOF
 
 
 sdcc_lib_name="SDCC_LIB"
-
-  test "x$prefix" = xNONE && prefix="$ac_default_prefix"
-  test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
-  ac_define_dir=`eval echo $"${sdcc_lib_name}"`
-  ac_define_dir=`eval echo $ac_define_dir`
-  cat >>confdefs.h <<_ACEOF
-#define SDCC_LIB_NAME "$ac_define_dir"
+cat >>confdefs.h <<_ACEOF
+#define SDCC_LIB_NAME "${sdcc_lib_name}"
 _ACEOF
 
 
-
 # Now handle the port selection
 # ===========================================================================
 rm -f ports.all ports.build
@@ -5926,6 +6545,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_DS400 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"
@@ -5945,6 +6583,25 @@ _ACEOF
 
 fi
 
+# Check whether --enable-pic16-port or --disable-pic16-port was given.
+if test "${enable_pic16_port+set}" = set; then
+  enableval="$enable_pic16_port"
+
+fi;
+echo pic16 >>ports.all
+if test "$enable_pic16_port" = "no"; then
+    cat >>confdefs.h <<_ACEOF
+#define OPT_DISABLE_PIC16 1
+_ACEOF
+
+else
+    echo pic16 >>ports.build
+    cat >>confdefs.h <<_ACEOF
+#define OPT_DISABLE_PIC16 0
+_ACEOF
+
+fi
+
 # Check whether --enable-xa51-port or --disable-xa51-port was given.
 if test "${enable_xa51_port+set}" = set; then
   enableval="$enable_xa51_port"
@@ -6063,9 +6720,9 @@ _ACEOF
 
 
 #remove duplicates
-cat ports.all | uniq >ports
+uniq ports.all ports
 mv ports ports.all
-cat ports.build | uniq >ports
+uniq ports.build ports
 mv ports ports.build
 
 # Generating output files
@@ -6713,7 +7370,10 @@ s,@PDFLATEX@,$PDFLATEX,;t t
 s,@DVIPDF@,$DVIPDF,;t t
 s,@EGREP@,$EGREP,;t t
 s,@M_OR_MM@,$M_OR_MM,;t t
-s,@sdcc_datadir@,$sdcc_datadir,;t t
+s,@sdccconf_h_dir_separator@,$sdccconf_h_dir_separator,;t t
+s,@include_dir_suffix@,$include_dir_suffix,;t t
+s,@lib_dir_suffix@,$lib_dir_suffix,;t t
+s,@docdir@,$docdir,;t t
 s,@OPT_ENABLE_UCSIM@,$OPT_ENABLE_UCSIM,;t t
 s,@OPT_ENABLE_DEVICE_LIB_BUILD@,$OPT_ENABLE_DEVICE_LIB_BUILD,;t t
 s,@OPT_ENABLE_PACKIHX@,$OPT_ENABLE_PACKIHX,;t t