diff --git a/ChangeLog b/ChangeLog
index 36fe321b16d54a3e7080ae93a13ee3c19ac723ee..ea7ebae6673a5cf6d3c9ff0e2f6b619df34d5f8c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -28,10 +28,14 @@ CVS code -
 	- Add SYSCONFDIR to DEFS, so we can have an /etc/nanorc.
 	- Change localedir line to 1.0's version.
 	- Moved m4/ stuff to its own m4/Makefile.am.
+- m4/aclocal_inc.m4:
+	- New macro AM_ACLOCAL_INCLUDE, tells configure.ac where to look for
+	  macros (Gergely Nagy).
 - configure.in:
 	- Renamed to configure.ac.
 - configure.ac:
 	- Moved to autoconf 2.52 (Jeff Bailey).
+	- Added call to AM_ACLOCAL_INCLUDE.
 - files.c:
   read_byte()
 	- Added check for conrol characters (indicative of a binary 
diff --git a/Makefile.am b/Makefile.am
index e07c26d52110322e621c46d1c854c6b93969d270..921a20245be17be820e98954af9832ef74454560 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,7 +1,5 @@
 ## $Id$
 AUTOMAKE_OPTIONS = gnu no-dependencies
-M4DIR = $(srcdir)/m4
-ACLOCAL_AMFLAGS = -I $(M4DIR)
 
 DEFS= -DSYSCONFDIR=\"$(sysconfdir)\"
 
diff --git a/configure.ac b/configure.ac
index 6018bea5849a3f75b4c322d20b954fe1277846a2..79bdf0a4a034cfb5d9098b63529ecd19a5d28445 100644
--- a/configure.ac
+++ b/configure.ac
@@ -5,6 +5,7 @@ AC_CONFIG_SRCDIR([nano.c])
 AC_PREREQ(2.52)
 AM_INIT_AUTOMAKE(nano, 1.1.6-cvs)
 AM_CONFIG_HEADER(config.h:config.h.in)
+AM_ACLOCAL_INCLUDE(m4)
 ALL_LINGUAS="es de fr it id fi hu ca cs gl uk ru sv nn nl da pl nb"
 
 dnl Checks for programs.
diff --git a/m4/aclocal_inc.m4 b/m4/aclocal_inc.m4
new file mode 100644
index 0000000000000000000000000000000000000000..45c46a7ce64c0df2ae72d0474e2fa886561b0a85
--- /dev/null
+++ b/m4/aclocal_inc.m4
@@ -0,0 +1,6 @@
+dnl AM_ACLOCAL_INCLUDE(macrodir)
+AC_DEFUN([AM_ACLOCAL_INCLUDE],
+[
+	test -n "$ACLOCAL_FLAGS" && ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS"
+	for k in $1 ; do ACLOCAL="$ACLOCAL -I $k" ; done
+])
diff --git a/stamp-h.in b/stamp-h.in
deleted file mode 100644
index 9788f70238c91894045d22366fa941580826c3c1..0000000000000000000000000000000000000000
--- a/stamp-h.in
+++ /dev/null
@@ -1 +0,0 @@
-timestamp