diff --git a/src/modules/dynamic_module_makefile.in b/src/modules/dynamic_module_makefile.in
index 31564e2613d6e6a3ba29347ef52a4cbe063b38ac..4d367b0f06b34b9d2ca6991384f1c244363b9c09 100644
--- a/src/modules/dynamic_module_makefile.in
+++ b/src/modules/dynamic_module_makefile.in
@@ -1,5 +1,5 @@
 #
-# $Id: dynamic_module_makefile.in,v 1.38 1998/05/17 17:18:12 grubba Exp $
+# $Id: dynamic_module_makefile.in,v 1.39 1998/06/07 21:24:50 grubba Exp $
 #
 
 
@@ -32,12 +32,21 @@ modlist_headers: Makefile
 modlist_segment: Makefile
 	echo "" >modlist_segment
 
-Makefile: ../dynamic_module_makefile $(SRCDIR)/Makefile.in $(SRCDIR)/dependencies
+Makefile: ../dynamic_module_makefile $(SRCDIR)/Makefile.in $(SRCDIR)/dependencies config.status
 	CONFIG_FILES=Makefile CONFIG_HEADERS="" ./config.status
 	touch remake
 	@echo "Run make again"
 	@exit 1
 
+$(SRCDIR)/configure: $(SRCDIR)/configure.in $(SRCDIR)/../module_configure.in
+	cd $(SRCDIR) && autoconf
+	if [ -f $(SRCDIR)/acconfig.h ]; then
+	  cd $(SRCDIR) && autoheader
+	else :; fi
+
+config.status: $(SRCDIR)/configure
+	./config.status --recheck
+
 module.so: $(OBJS)  $(MODULE_ARCHIVES)
 	$(TMP_BINDIR)/smartlink "@LDSHARED@" -o module.@SO@ $(OBJS) $(MODULE_ARCHIVES) $(MODULE_LDFLAGS) -lc
 	if test @SO@ != so ; then mv module.@SO@ module.so ; else :; fi
diff --git a/src/modules/static_module_makefile.in b/src/modules/static_module_makefile.in
index a686a86b807e496a8f1c9b50f80677cfb3bfba53..dbcbe9595a83d50ccd0bcd8721cd474fe0e9889e 100644
--- a/src/modules/static_module_makefile.in
+++ b/src/modules/static_module_makefile.in
@@ -1,5 +1,5 @@
 #
-# $Id: static_module_makefile.in,v 1.31 1998/05/17 17:07:47 grubba Exp $
+# $Id: static_module_makefile.in,v 1.32 1998/06/07 21:24:52 grubba Exp $
 #
 
 
@@ -32,12 +32,21 @@ modlist_headers: Makefile
 modlist_segment: Makefile
 	echo >modlist_segment " ,{ \"$(MODNAME)\", pike_module_$(MODNAME)_init, pike_module_$(MODNAME)_exit } "
 
-Makefile: ../static_module_makefile $(SRCDIR)/Makefile.in $(SRCDIR)/dependencies
+Makefile: ../static_module_makefile $(SRCDIR)/Makefile.in $(SRCDIR)/dependencies config.status
 	CONFIG_FILES=Makefile CONFIG_HEADERS="" ./config.status
 	touch remake
 	@echo "Run make again"
 	@exit 1
 
+$(SRCDIR)/configure: $(SRCDIR)/configure.in $(SRCDIR)/../module_configure.in
+	cd $(SRCDIR) && autoconf
+	if [ -f $(SRCDIR)/acconfig.h ]; then
+	  cd $(SRCDIR) && autoheader
+	else :; fi
+
+config.status: $(SRCDIR)/configure
+	./config.status --recheck
+
 module.pmod: Makefile
 	if [ -f $(SRCDIR)/module.pmod.in ]; then \
 	   sed -e "s/@module@/_static_modules.$(MODNAME)/" <$(SRCDIR)/module.pmod.in >module.pmod ;\