--- configure.in.orig	2010-06-05 19:56:37 UTC
+++ configure.in
@@ -33,6 +33,7 @@ dnl POSSIBILITY OF SUCH DAMAGE.
 
 dnl Checks that we are given a good source directory.
 AC_INIT(ic/m68k/m68k-impl.h)
+AC_CONFIG_MACRO_DIR([m4])
 AC_CANONICAL_SYSTEM
 AM_INIT_AUTOMAKE(tme, 0.8)
 
@@ -599,18 +600,14 @@ i[3456789]86-* | x86_64-*) misc_hosts="x86" ;;
 esac
 changequote([, ])dnl
 AC_MSG_RESULT([${misc_hosts}])
-if test "x${misc_hosts}" = no; then
+if test "x${misc_hosts}" = xno; then
     misc_hosts=
 fi
 
 dnl Configure for libtool.
-AC_LIBLTDL_INSTALLABLE
-AC_SUBST(INCLTDL)
-AC_SUBST(LIBLTDL)
-AC_LIBTOOL_DLOPEN
-AM_PROG_LIBTOOL
-AC_SUBST(LTLIBOBJS)
-AC_CONFIG_SUBDIRS(libltdl)
+LT_CONFIG_LTDL_DIR([libltdl])
+LT_INIT([dlopen])
+LTDL_INIT
 TME_PREOPEN=
 if test $enable_shared = no; then
   TME_PREOPEN='`sort -u $(top_builddir)/tme-preopen.txt`'
@@ -683,11 +680,8 @@ if test "x$gen_tmeconfig_h" = xyes; then
 #define _TMECONFIG_H
 
 TMEEOF
-  (for word in HAVE_ TIME_ PROTO_ ALIGNOF_ SIZEOF_ WORDS_BIGENDIAN; do \
-    grep $word config.h | sed 's/#define[ 	]\{1,\}/&_TME_/' ; \
-  done) | sort | uniq >> ${outfile}-tmp
-  grep FLOAT_FORMAT config.h | \
-    sed 's/#define[ 	]\{1,\}\([A-Za-z0-9_]\{1,\}\)[ 	]\{1,\}\([A-Za-z0-9_]\{1,\}\)/#define TME_\1 TME_FLOAT_FORMAT_\2/' >> ${outfile}-tmp
+  sed -e '/FLOAT_FORMAT/ s/#[[:space:]]*define[[:space:]]\{1,\}\([A-Za-z0-9_]\{1,\}\)[[:space:]]\{1,\}\([A-Za-z0-9_]\{1,\}\)/#define TME_\1 TME_FLOAT_FORMAT_\2/' \
+      -e '/FLOAT_FORMAT/!s/#[[:space:]]*define[[:space:]]\{1,\}/&_TME_/' config.h >> ${outfile}-tmp
   echo '#define TME_BUSMAX_LOG2 TME_BUS'${bus_size_max}'_LOG2' >> ${outfile}-tmp
   echo '#define TME_HAVE_RECODE (' \
     `if test "x${recode_hosts}" = x; then echo 0; else echo 1; fi` ')' >> ${outfile}-tmp
