Remake configure/config.h.in/etc.

Wayne Davison wayne at blorf.net
Mon May 7 21:34:06 EST 2001


Since multiple people have applied my UseLogin patch and failed to get
it to work because configure/config.h.in were not automatically rebuilt,
I decided it was time to add some rules to the Makefiles to update these
things.  The appended patch will cause a "make" to rebuild configure,
config.h.in, config.h, and both Makefiles if the appropriate source
file(s) change.  It will also run "./config.status --recheck" if
configure is rebuilt.

..wayne..
-------------- next part --------------
Index: Makefile.in
@@ -85,7 +85,7 @@
 	$(CC) $(CFLAGS) $(CPPFLAGS) -c $<
 
 LIBCOMPAT=openbsd-compat/libopenbsd-compat.a
-$(LIBCOMPAT): config.h
+$(LIBCOMPAT): config.h openbsd-compat/Makefile
 	(cd openbsd-compat; $(MAKE))
 
 libssh.a: $(LIBSSH_OBJS)
@@ -139,6 +139,30 @@
 	conffile=`echo $@ | sed 's/.out$$//'`; \
 	$(FIXPATHSCMD) $(srcdir)/$${conffile} > $@
 
+$(srcdir)/configure: $(srcdir)/configure.in $(srcdir)/aclocal.m4
+	cd $(srcdir) && autoconf
+
+config.status: $(srcdir)/configure
+	./config.status --recheck
+
+$(srcdir)/config.h.in: $(srcdir)/config.h.in-touch
+$(srcdir)/config.h.in-touch: $(srcdir)/configure $(srcdir)/acconfig.h
+	cd $(srcdir) && autoheader
+	@echo >$(srcdir)/config.h.in-touch
+
+config.h: config.h-touch
+config.h-touch: $(srcdir)/config.h.in config.status
+	CONFIG_FILES= CONFIG_HEADERS=config.h ./config.status
+	@echo >config.h-touch
+
+Makefile: Makefile.in config.status
+	CONFIG_FILES=Makefile CONFIG_HEADERS= ./config.status
+	@echo "The Makefile has changed -- please restart the make."
+	@false
+
+openbsd-compat/Makefile: openbsd-compat/Makefile.in config.status
+	CONFIG_FILES=openbsd-compat/Makefile CONFIG_HEADERS= ./config.status
+
 clean:
 	(cd openbsd-compat; $(MAKE) clean)
 	rm -f *.o *.a $(TARGETS) logintest config.cache config.log 
@@ -146,12 +170,12 @@
 
 distclean: clean
 	(cd openbsd-compat; $(MAKE) distclean)
-	rm -f Makefile config.h config.status ssh_prng_cmds *~
+	rm -f Makefile config.h config.h-touch config.status ssh_prng_cmds *~
 
 mrproper: distclean
 
 veryclean: distclean
-	rm -f configure config.h.in *.0
+	rm -f configure config.h.in config.h.in-touch *.0
 
 catman-do:
 	@for f in $(MANPAGES_IN) ; do \
Index: configure.in
@@ -1881,7 +1881,8 @@
 
 AC_EXEEXT
 
-AC_OUTPUT(Makefile openbsd-compat/Makefile ssh_prng_cmds)
+AC_OUTPUT(Makefile openbsd-compat/Makefile ssh_prng_cmds, \
+[test -z "$CONFIG_HEADERS" || echo >config.h-touch])
 
 # Print summary of options
 
Index: openbsd-compat/Makefile.in
@@ -28,7 +28,7 @@
 $(COMPAT): ../config.h
 $(OPENBSD): ../config.h
 
-libopenbsd-compat.a:  $(COMPAT) $(OPENBSD)
+libopenbsd-compat.a:  $(COMPAT) $(OPENBSD) Makefile
 	$(AR) rv $@ $(COMPAT) $(OPENBSD)
 	$(RANLIB) $@
 


More information about the openssh-unix-dev mailing list