* src/SDCCglue.c (tempfileandname): changed un*x tmp search paths to /tmp and /var...
[fw/sdcc] / configure
index dbc1dcc8e47e29b3b2bb14165e0c4a0fd099af42..fd3d0f97a27c1f5ae06fc56378ee1c7931e46cdb 100755 (executable)
--- a/configure
+++ b/configure
@@ -310,11 +310,11 @@ ac_includes_default="\
 #endif"
 
 ac_subdirs_all="$ac_subdirs_all support/cpp2"
-ac_subdirs_all="$ac_subdirs_all packihx"
+ac_subdirs_all="$ac_subdirs_all support/packihx"
 ac_subdirs_all="$ac_subdirs_all sim/ucsim"
 ac_subdirs_all="$ac_subdirs_all device/lib/pic"
 ac_subdirs_all="$ac_subdirs_all device/lib/pic16"
-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 EGREP M_OR_MM sdccconf_h_dir_separator include_dir_suffix lib_dir_suffix docdir OPT_DISABLE_MCS51 OPT_DISABLE_GBZ80 OPT_DISABLE_Z80 OPT_DISABLE_AVR OPT_DISABLE_DS390 OPT_DISABLE_DS400 OPT_DISABLE_PIC OPT_DISABLE_PIC16 OPT_DISABLE_XA51 OPT_DISABLE_HC08 OPT_DISABLE_UCSIM OPT_DISABLE_DEVICE_LIB OPT_DISABLE_PACKIHX OPT_DISABLE_SDCPP OPT_ENABLE_DOC LYX LATEX LATEX2HTML PDFLATEX DVIPDF DVIPS MAKEINDEX OPT_ENABLE_LIBGC 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 EGREP M_OR_MM sdccconf_h_dir_separator include_dir_suffix lib_dir_suffix docdir OPT_DISABLE_MCS51 OPT_DISABLE_GBZ80 OPT_DISABLE_Z80 OPT_DISABLE_AVR OPT_DISABLE_DS390 OPT_DISABLE_DS400 OPT_DISABLE_PIC OPT_DISABLE_PIC16 OPT_DISABLE_XA51 OPT_DISABLE_HC08 OPT_DISABLE_UCSIM OPT_DISABLE_DEVICE_LIB OPT_DISABLE_PACKIHX OPT_DISABLE_SDCPP OPT_ENABLE_DOC LYX LATEX2HTML PDFLATEX PDFOPT MAKEINDEX OPT_ENABLE_LIBGC subdirs LIBOBJS LTLIBOBJS'
 ac_subst_files=''
 
 # Initialize some variables set by options.
@@ -3638,6 +3638,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 # Checking for header files.
 # ===========================================================================
+socket_type=unknown
 
 echo "$as_me:$LINENO: checking for egrep" >&5
 echo $ECHO_N "checking for egrep... $ECHO_C" >&6
@@ -4037,15 +4038,170 @@ if test `eval echo '${'$as_ac_Header'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
+ socket_type=sys_socket_h
+fi
+
+done
+
+if test $socket_type = unknown; then
+
+for ac_header in winsock2.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+  # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 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); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 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
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$ac_header>
+_ACEOF
+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); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+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
 
+  ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { 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 compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  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: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&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;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+    (
+      cat <<\_ASBOX
+## ------------------------------------------ ##
+## Report this to the AC_PACKAGE_NAME lists.  ##
+## ------------------------------------------ ##
+_ASBOX
+    ) |
+      sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  eval "$as_ac_Header=\$ac_header_preproc"
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+ socket_type=winsock2_h
 fi
 
 done
 
+fi
 
 
 # Checking for functions/libs
 # ===========================================================================
+if test $socket_type = winsock2_h; then
+  LIBS="-lws2_32 $LIBS"
+else
 
 echo "$as_me:$LINENO: checking for socket in -lsocket" >&5
 echo $ECHO_N "checking for socket in -lsocket... $ECHO_C" >&6
@@ -4194,6 +4350,7 @@ _ACEOF
 
 fi
 
+fi
 
 
 # Checking for functions
@@ -6281,30 +6438,98 @@ _ACEOF
 
 
 
+echo "$as_me:$LINENO: checking whether char is unsigned" >&5
+echo $ECHO_N "checking whether char is unsigned... $ECHO_C" >&6
+if test "${ac_cv_c_char_unsigned+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+int
+main ()
+{
+static int test_array [1 - 2 * !(((char) -1) < 0)];
+test_array [0] = 0
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 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); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 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
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_c_char_unsigned=no
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_c_char_unsigned=yes
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_c_char_unsigned" >&5
+echo "${ECHO_T}$ac_cv_c_char_unsigned" >&6
+if test $ac_cv_c_char_unsigned = yes && test "$GCC" != yes; then
+  cat >>confdefs.h <<\_ACEOF
+#define __CHAR_UNSIGNED__ 1
+_ACEOF
+
+fi
+
+
 type_name()
 {
-    if expr "$ac_cv_sizeof_char" '>=' "$1" >/dev/null; then
-       echo "char"
-       exit
-    fi
-    if expr "$ac_cv_sizeof_short" '>=' "$1" >/dev/null; then
-       echo "short"
-       exit
-    fi
-    if expr "$ac_cv_sizeof_int" '>=' "$1" >/dev/null; then
-       echo "int"
-       exit
-    fi
-    if expr "$ac_cv_sizeof_long" '>=' "$1" >/dev/null; then
-       echo "long"
-       exit
-    fi
+  if expr "$ac_cv_sizeof_char" '>=' "$1" >/dev/null; then
+      echo "char"
+    exit
+  fi
+  if expr "$ac_cv_sizeof_short" '>=' "$1" >/dev/null; then
+    echo "short"
+    exit
+  fi
+  if expr "$ac_cv_sizeof_int" '>=' "$1" >/dev/null; then
+    echo "int"
+    exit
+  fi
+  if expr "$ac_cv_sizeof_long" '>=' "$1" >/dev/null; then
     echo "long"
+    exit
+  fi
+  echo "long"
 }
 
 echo "$as_me:$LINENO: checking type name for byte" >&5
 echo $ECHO_N "checking type name for byte... $ECHO_C" >&6
-TYPE_BYTE=`type_name 1`
+TYPE_CHAR=`type_name 1`
+if test "$ac_cv_c_char_unsigned" = "yes"; then
+  TYPE_BYTE="signed $TYPE_CHAR"
+else
+  TYPE_BYTE=$TYPE_CHAR
+fi
 echo "$as_me:$LINENO: result: $TYPE_BYTE" >&5
 echo "${ECHO_T}$TYPE_BYTE" >&6
 echo "$as_me:$LINENO: checking type name for word" >&5
@@ -6317,6 +6542,7 @@ echo $ECHO_N "checking type name for dword... $ECHO_C" >&6
 TYPE_DWORD=`type_name 4`
 echo "$as_me:$LINENO: result: $TYPE_DWORD" >&5
 echo "${ECHO_T}$TYPE_DWORD" >&6
+
 cat >>confdefs.h <<_ACEOF
 #define TYPE_BYTE $TYPE_BYTE
 _ACEOF
@@ -6330,6 +6556,19 @@ cat >>confdefs.h <<_ACEOF
 _ACEOF
 
 
+cat >>confdefs.h <<_ACEOF
+#define TYPE_UBYTE unsigned $TYPE_CHAR
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define TYPE_UWORD unsigned $TYPE_WORD
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define TYPE_UDWORD unsigned $TYPE_DWORD
+_ACEOF
+
+
 echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5
 echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6
 if test "${ac_cv_c_bigendian+set}" = set; then
@@ -7564,42 +7803,7 @@ else
 echo "${ECHO_T}no" >&6
 fi
 
-  # Extract the first word of "latex", so it can be a program name with args.
-set dummy latex; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_LATEX+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test -n "$LATEX"; then
-  ac_cv_prog_LATEX="$LATEX" # 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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_LATEX="latex"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-
-  test -z "$ac_cv_prog_LATEX" && ac_cv_prog_LATEX=":"
-fi
-fi
-LATEX=$ac_cv_prog_LATEX
-if test -n "$LATEX"; then
-  echo "$as_me:$LINENO: result: $LATEX" >&5
-echo "${ECHO_T}$LATEX" >&6
-else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
+#  AC_CHECK_PROG(LATEX,      latex,      latex, :)
   # Extract the first word of "latex2html", so it can be a program name with args.
 set dummy latex2html; ac_word=$2
 echo "$as_me:$LINENO: checking for $ac_word" >&5
@@ -7672,51 +7876,15 @@ else
 echo "${ECHO_T}no" >&6
 fi
 
-  # Extract the first word of "dvipdf", so it can be a program name with args.
-set dummy dvipdf; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_DVIPDF+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test -n "$DVIPDF"; then
-  ac_cv_prog_DVIPDF="$DVIPDF" # 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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_DVIPDF="dvipdf"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-
-  test -z "$ac_cv_prog_DVIPDF" && ac_cv_prog_DVIPDF=":"
-fi
-fi
-DVIPDF=$ac_cv_prog_DVIPDF
-if test -n "$DVIPDF"; then
-  echo "$as_me:$LINENO: result: $DVIPDF" >&5
-echo "${ECHO_T}$DVIPDF" >&6
-else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-  # Extract the first word of "dvips", so it can be a program name with args.
-set dummy dvips; ac_word=$2
+  # Extract the first word of "pdfopt", so it can be a program name with args.
+set dummy pdfopt; ac_word=$2
 echo "$as_me:$LINENO: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_DVIPS+set}" = set; then
+if test "${ac_cv_prog_PDFOPT+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  if test -n "$DVIPS"; then
-  ac_cv_prog_DVIPS="$DVIPS" # Let the user override the test.
+  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
@@ -7725,25 +7893,27 @@ do
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
   if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_DVIPS="dvips"
+    ac_cv_prog_PDFOPT="pdfopt"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
 
-  test -z "$ac_cv_prog_DVIPS" && ac_cv_prog_DVIPS=":"
+  test -z "$ac_cv_prog_PDFOPT" && ac_cv_prog_PDFOPT=":"
 fi
 fi
-DVIPS=$ac_cv_prog_DVIPS
-if test -n "$DVIPS"; then
-  echo "$as_me:$LINENO: result: $DVIPS" >&5
-echo "${ECHO_T}$DVIPS" >&6
+PDFOPT=$ac_cv_prog_PDFOPT
+if test -n "$PDFOPT"; then
+  echo "$as_me:$LINENO: result: $PDFOPT" >&5
+echo "${ECHO_T}$PDFOPT" >&6
 else
   echo "$as_me:$LINENO: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
+#  AC_CHECK_PROG(DVIPDF,     dvipdf,     dvipdf, :)
+#  AC_CHECK_PROG(DVIPS,      dvips,      dvips, :)
   # Extract the first word of "makeindex", so it can be a program name with args.
 set dummy makeindex; ac_word=$2
 echo "$as_me:$LINENO: checking for $ac_word" >&5
@@ -7787,12 +7957,7 @@ echo "$as_me: error: Cannot find required program lyx." >&2;}
    { (exit 1); exit 1; }; }
  fi
 
-  if test "$LATEX" = ":"; then
-  { { echo "$as_me:$LINENO: error: Cannot find required program latex." >&5
-echo "$as_me: error: Cannot find required program latex." >&2;}
-   { (exit 1); exit 1; }; }
- fi
-
+#  SDCC_REQUIRE_PROG($LATEX,      latex)
   if test "$LATEX2HTML" = ":"; then
   { { echo "$as_me:$LINENO: error: Cannot find required program latex2html." >&5
 echo "$as_me: error: Cannot find required program latex2html." >&2;}
@@ -7805,18 +7970,14 @@ echo "$as_me: error: Cannot find required program pdflatex." >&2;}
    { (exit 1); exit 1; }; }
  fi
 
-  if test "$DVIPDF" = ":"; then
-  { { echo "$as_me:$LINENO: error: Cannot find required program dvipdf." >&5
-echo "$as_me: error: Cannot find required program dvipdf." >&2;}
-   { (exit 1); exit 1; }; }
- fi
-
-  if test "$DVIPS" = ":"; then
-  { { echo "$as_me:$LINENO: error: Cannot find required program dvips." >&5
-echo "$as_me: error: Cannot find required program dvips." >&2;}
+  if test "$PDFOPT" = ":"; then
+  { { echo "$as_me:$LINENO: error: Cannot find required program pdfopt." >&5
+echo "$as_me: error: Cannot find required program pdfopt." >&2;}
    { (exit 1); exit 1; }; }
  fi
 
+#  SDCC_REQUIRE_PROG($DVIPDF,     dvipdf)
+#  SDCC_REQUIRE_PROG($DVIPS,      dvips)
   if test "$MAKEINDEX" = ":"; then
   { { echo "$as_me:$LINENO: error: Cannot find required program makeindex." >&5
 echo "$as_me: error: Cannot find required program makeindex." >&2;}
@@ -7940,7 +8101,7 @@ subdirs="$subdirs support/cpp2"
 
 test $OPT_DISABLE_PACKIHX = 0 &&
 
-subdirs="$subdirs packihx"
+subdirs="$subdirs support/packihx"
 
 test $OPT_DISABLE_UCSIM   = 0 &&
 
@@ -7974,7 +8135,7 @@ if test $OPT_DISABLE_HC08 = 0; then
 fi
 
 if test $OPT_DISABLE_MCS51 = 0; then
-                                ac_config_files="$ac_config_files src/mcs51/Makefile as/mcs51/Makefile debugger/mcs51/Makefile"
+                                          ac_config_files="$ac_config_files src/mcs51/Makefile as/mcs51/Makefile as/link/mcs51/Makefile debugger/mcs51/Makefile"
 
   test $OPT_DISABLE_DEVICE_LIB = 0 &&                                         ac_config_files="$ac_config_files device/lib/mcs51/Makefile device/lib/small/Makefile device/lib/medium/Makefile device/lib/large/Makefile"
 
@@ -8001,7 +8162,7 @@ test $OPT_DISABLE_XA51 = 0 &&           ac_config_files="$ac_config_files src/xa
 
 
 if test $OPT_DISABLE_Z80 = 0; then
-                                                    ac_config_files="$ac_config_files src/z80/Makefile as/Makefile as/z80/Makefile link/Makefile link/z80/Makefile"
+                                                    ac_config_files="$ac_config_files src/z80/Makefile as/Makefile as/z80/Makefile as/link/Makefile as/link/z80/Makefile"
 
   test $OPT_DISABLE_DEVICE_LIB = 0 &&                     ac_config_files="$ac_config_files device/lib/z80/Makefile device/lib/gbz80/Makefile"
 
@@ -8094,9 +8255,10 @@ for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
   # 1. Remove the extension, and $U if already installed.
   ac_i=`echo "$ac_i" |
         sed 's/\$U\././;s/\.o$//;s/\.obj$//'`
-  # 2. Add them.
-  ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext"
-  ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo'
+  # 2. Prepend LIBOBJDIR.  When used with automake>=1.10 LIBOBJDIR
+  #    will be set to the directory where LIBOBJS objects are built.
+  ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext"
+  ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo'
 done
 LIBOBJS=$ac_libobjs
 
@@ -8548,6 +8710,7 @@ do
   "device/lib/hc08/Makefile" ) CONFIG_FILES="$CONFIG_FILES device/lib/hc08/Makefile" ;;
   "src/mcs51/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/mcs51/Makefile" ;;
   "as/mcs51/Makefile" ) CONFIG_FILES="$CONFIG_FILES as/mcs51/Makefile" ;;
+  "as/link/mcs51/Makefile" ) CONFIG_FILES="$CONFIG_FILES as/link/mcs51/Makefile" ;;
   "debugger/mcs51/Makefile" ) CONFIG_FILES="$CONFIG_FILES debugger/mcs51/Makefile" ;;
   "device/lib/mcs51/Makefile" ) CONFIG_FILES="$CONFIG_FILES device/lib/mcs51/Makefile" ;;
   "device/lib/small/Makefile" ) CONFIG_FILES="$CONFIG_FILES device/lib/small/Makefile" ;;
@@ -8559,8 +8722,8 @@ do
   "src/z80/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/z80/Makefile" ;;
   "as/Makefile" ) CONFIG_FILES="$CONFIG_FILES as/Makefile" ;;
   "as/z80/Makefile" ) CONFIG_FILES="$CONFIG_FILES as/z80/Makefile" ;;
-  "link/Makefile" ) CONFIG_FILES="$CONFIG_FILES link/Makefile" ;;
-  "link/z80/Makefile" ) CONFIG_FILES="$CONFIG_FILES link/z80/Makefile" ;;
+  "as/link/Makefile" ) CONFIG_FILES="$CONFIG_FILES as/link/Makefile" ;;
+  "as/link/z80/Makefile" ) CONFIG_FILES="$CONFIG_FILES as/link/z80/Makefile" ;;
   "device/lib/z80/Makefile" ) CONFIG_FILES="$CONFIG_FILES device/lib/z80/Makefile" ;;
   "device/lib/gbz80/Makefile" ) CONFIG_FILES="$CONFIG_FILES device/lib/gbz80/Makefile" ;;
   "device/lib/Makefile" ) CONFIG_FILES="$CONFIG_FILES device/lib/Makefile" ;;
@@ -8709,11 +8872,9 @@ s,@OPT_DISABLE_PACKIHX@,$OPT_DISABLE_PACKIHX,;t t
 s,@OPT_DISABLE_SDCPP@,$OPT_DISABLE_SDCPP,;t t
 s,@OPT_ENABLE_DOC@,$OPT_ENABLE_DOC,;t t
 s,@LYX@,$LYX,;t t
-s,@LATEX@,$LATEX,;t t
 s,@LATEX2HTML@,$LATEX2HTML,;t t
 s,@PDFLATEX@,$PDFLATEX,;t t
-s,@DVIPDF@,$DVIPDF,;t t
-s,@DVIPS@,$DVIPS,;t t
+s,@PDFOPT@,$PDFOPT,;t t
 s,@MAKEINDEX@,$MAKEINDEX,;t t
 s,@OPT_ENABLE_LIBGC@,$OPT_ENABLE_LIBGC,;t t
 s,@subdirs@,$subdirs,;t t