calling move-if-change

Marc Espie espie@tetto.liafa.jussieu.fr
Tue Aug 31 10:31:00 GMT 1999


move-if-change is about the only shell script that is not called explictly
with $(SHELL).  This may cause problems in some weird cases where it is
unpractical to set the executable flag on that script.

I believe the following patch does take care of problems, specifically
of msdos and winnt.  Mpw already kills $(SHELL) in its own sed script.


For the gcc dir:
Mon Aug 30 17:34:54 CEST 1999	Marc Espie <espie@cvs.openbsd.org>
	* Makefile.in:  Prepend $(SHELL) to move-if-change calls.
	* msdos/top.sed:  Take into account a prepended $(SHELL) to
	move-if-change.
	* winnt/config-nt.sed:  Likewise.  Kill bogus substitution.

For the libf2c, and cp dirs.

Mon Aug 30 17:34:54 CEST 1999	Marc Espie <espie@cvs.openbsd.org>
	* Makefile.in:  Prepend $(SHELL) to move-if-change calls.

For the objc dir:

Mon Aug 30 17:34:54 CEST 1999	Marc Espie <espie@cvs.openbsd.org>
	* Make-lang.in:  Prepend $(SHELL) to move-if-change calls.

--- gcc/Makefile.in.orig	Mon Aug 30 17:18:04 1999
+++ gcc/Makefile.in	Mon Aug 30 17:19:08 1999
@@ -1169,7 +1169,7 @@
 	  "$(MULTILIB_MATCHES)" \
 	  "$(MULTILIB_EXCEPTIONS)" \
 	  "$(MULTILIB_EXTRA_OPTS)" > tmp-mlib.h
-	$(srcdir)/move-if-change tmp-mlib.h multilib.h
+	$(SHELL) $(srcdir)/move-if-change tmp-mlib.h multilib.h
 	touch s-mlib
 
 # Build multiple copies of libgcc.a, one for each target switch.
@@ -1315,12 +1315,12 @@
 	sed -e "/^ifobjc$$/,/^end ifobjc$$/d" \
 	  -e "/^ifc$$/d" -e "/^end ifc$$/d" \
 	  $(srcdir)/c-parse.in >>tmp-c-parse.y
-	$(srcdir)/move-if-change tmp-c-parse.y $(srcdir)/c-parse.y
+	$(SHELL) $(srcdir)/move-if-change tmp-c-parse.y $(srcdir)/c-parse.y
 
 $(srcdir)/c-gperf.h: c-parse.gperf
 	gperf -L C -F ', 0, 0' -p -j1 -i 1 -g -o -t -G -N is_reserved_word \
 	   -k1,3,$$ $(srcdir)/c-parse.gperf >tmp-gperf.h
-	 $(srcdir)/move-if-change tmp-gperf.h $(srcdir)/c-gperf.h
+	 $(SHELL) $(srcdir)/move-if-change tmp-gperf.h $(srcdir)/c-gperf.h
 
 c-decl.o : c-decl.c $(CONFIG_H) system.h $(TREE_H) c-tree.h c-common.h \
     c-lex.h flags.h function.h output.h toplev.h defaults.h
@@ -1380,7 +1380,7 @@
 	else \
 	  echo "int prepends_underscore = 0;" >>tmp-under.c; \
 	fi
-	$(srcdir)/move-if-change tmp-under.c underscore.c
+	$(SHELL) $(srcdir)/move-if-change tmp-under.c underscore.c
 	-rm -f tmp-dum.c tmp-dum.s
 	touch s-under
 
@@ -1409,7 +1409,7 @@
 tree-check.h: s-check ; @true
 s-check : gencheck $(srcdir)/move-if-change
 	./gencheck > tmp-check.h
-	$(srcdir)/move-if-change tmp-check.h tree-check.h
+	$(SHELL) $(srcdir)/move-if-change tmp-check.h tree-check.h
 	touch s-check
 
 gencheck : gencheck.o $(lang_tree_files) $(HOST_LIBDEPS)
@@ -1640,19 +1640,19 @@
 insn-config.h: s-config ; @true
 s-config : $(md_file) genconfig $(srcdir)/move-if-change
 	./genconfig $(md_file) > tmp-config.h
-	$(srcdir)/move-if-change tmp-config.h insn-config.h
+	$(SHELL) $(srcdir)/move-if-change tmp-config.h insn-config.h
 	touch s-config
 
 insn-flags.h: s-flags ; @true
 s-flags : $(md_file) genflags $(srcdir)/move-if-change
 	./genflags $(md_file) > tmp-flags.h
-	$(srcdir)/move-if-change tmp-flags.h insn-flags.h
+	$(SHELL) $(srcdir)/move-if-change tmp-flags.h insn-flags.h
 	touch s-flags
 
 insn-codes.h: s-codes ; @true
 s-codes : $(md_file) gencodes $(srcdir)/move-if-change
 	./gencodes $(md_file) > tmp-codes.h
-	$(srcdir)/move-if-change tmp-codes.h insn-codes.h
+	$(SHELL) $(srcdir)/move-if-change tmp-codes.h insn-codes.h
 	touch s-codes
 
 insn-emit.o : insn-emit.c $(CONFIG_H) $(RTL_H) $(EXPR_H) real.h output.h \
@@ -1662,7 +1662,7 @@
 insn-emit.c: s-emit ; @true
 s-emit : $(md_file) genemit $(srcdir)/move-if-change
 	./genemit $(md_file) > tmp-emit.c
-	$(srcdir)/move-if-change tmp-emit.c insn-emit.c
+	$(SHELL) $(srcdir)/move-if-change tmp-emit.c insn-emit.c
 	touch s-emit
 
 insn-recog.o : insn-recog.c $(CONFIG_H) $(RTL_H) insn-config.h $(RECOG_H) \
@@ -1672,7 +1672,7 @@
 insn-recog.c: s-recog ; @true
 s-recog : $(md_file) genrecog $(srcdir)/move-if-change
 	./genrecog $(md_file) > tmp-recog.c
-	$(srcdir)/move-if-change tmp-recog.c insn-recog.c
+	$(SHELL) $(srcdir)/move-if-change tmp-recog.c insn-recog.c
 	touch s-recog
 
 insn-opinit.o : insn-opinit.c $(CONFIG_H) $(RTL_H) insn-codes.h insn-flags.h \
@@ -1682,7 +1682,7 @@
 insn-opinit.c: s-opinit ; @true
 s-opinit : $(md_file) genopinit $(srcdir)/move-if-change
 	./genopinit $(md_file) > tmp-opinit.c
-	$(srcdir)/move-if-change tmp-opinit.c insn-opinit.c
+	$(SHELL) $(srcdir)/move-if-change tmp-opinit.c insn-opinit.c
 	touch s-opinit
 
 insn-extract.o : insn-extract.c $(CONFIG_H) $(RTL_H) system.h toplev.h \
@@ -1692,7 +1692,7 @@
 insn-extract.c: s-extract ; @true
 s-extract : $(md_file) genextract $(srcdir)/move-if-change
 	./genextract $(md_file) > tmp-extract.c
-	$(srcdir)/move-if-change tmp-extract.c insn-extract.c
+	$(SHELL) $(srcdir)/move-if-change tmp-extract.c insn-extract.c
 	touch s-extract
 
 insn-peep.o : insn-peep.c $(CONFIG_H) $(RTL_H) $(REGS_H) output.h real.h \
@@ -1702,7 +1702,7 @@
 insn-peep.c: s-peep ; @true
 s-peep : $(md_file) genpeep $(srcdir)/move-if-change
 	./genpeep $(md_file) > tmp-peep.c
-	$(srcdir)/move-if-change tmp-peep.c insn-peep.c
+	$(SHELL) $(srcdir)/move-if-change tmp-peep.c insn-peep.c
 	touch s-peep
 
 insn-attrtab.o : insn-attrtab.c $(CONFIG_H) $(RTL_H) $(REGS_H) real.h \
@@ -1712,13 +1712,13 @@
 insn-attr.h: s-attr ; @true
 s-attr : $(md_file) genattr $(srcdir)/move-if-change
 	./genattr $(md_file) > tmp-attr.h
-	$(srcdir)/move-if-change tmp-attr.h insn-attr.h
+	$(SHELL) $(srcdir)/move-if-change tmp-attr.h insn-attr.h
 	touch s-attr
 
 insn-attrtab.c: s-attrtab ; @true
 s-attrtab : $(md_file) genattrtab $(srcdir)/move-if-change
 	./genattrtab $(md_file) > tmp-attrtab.c
-	$(srcdir)/move-if-change tmp-attrtab.c insn-attrtab.c
+	$(SHELL) $(srcdir)/move-if-change tmp-attrtab.c insn-attrtab.c
 	touch s-attrtab
 
 insn-output.o : insn-output.c $(CONFIG_H) $(RTL_H) $(REGS_H) real.h conditions.h \
@@ -1729,7 +1729,7 @@
 insn-output.c: s-output ; @true
 s-output : $(md_file) genoutput $(srcdir)/move-if-change
 	./genoutput $(md_file) > tmp-output.c
-	$(srcdir)/move-if-change tmp-output.c insn-output.c
+	$(SHELL) $(srcdir)/move-if-change tmp-output.c insn-output.c
 	touch s-output
 
 genrtl.o : genrtl.c $(CONFIG_H) $(RTL_H) system.h
@@ -1738,8 +1738,8 @@
 
 s-genrtl: gengenrtl $(srcdir)/move-if-change $(RTL_BASE_H)
 	./gengenrtl tmp-genrtl.h tmp-genrtl.c
-	$(srcdir)/move-if-change tmp-genrtl.h genrtl.h
-	$(srcdir)/move-if-change tmp-genrtl.c genrtl.c
+	$(SHELL) $(srcdir)/move-if-change tmp-genrtl.h genrtl.h
+	$(SHELL) $(srcdir)/move-if-change tmp-genrtl.c genrtl.c
 	touch s-genrtl
 
 #
--- libf2c/Makefile.in.orig	Mon Aug 30 17:31:33 1999
+++ libf2c/Makefile.in	Mon Aug 30 17:31:45 1999
@@ -179,7 +179,7 @@
 # lines below, since g2c.h isn't necessarily brought up to date.
 #	mv g2c.h g2c.x
 	$(SHELL) config.status
-#	$(srcdir)/../move-if-change g2c.h g2c.x && mv g2c.x g2c.h
+#	$(SHELL) $(srcdir)/../move-if-change g2c.h g2c.x && mv g2c.x g2c.h
 
 Makefile: Makefile.in config.status
 # Autoconf doc uses `./config.status'.  Is there a good reason to use $(SHELL)?
--- gcc/cp/Makefile.in.orig	Mon Aug 30 17:19:13 1999
+++ gcc/cp/Makefile.in	Mon Aug 30 17:19:24 1999
@@ -236,8 +236,8 @@
 #	@echo $(CONFLICTS)
 #	$(BISON) $(BISONFLAGS) -d $(srcdir)/parse.y
 #	grep '^#define[ 	]*YYEMPTY' y.tab.c >>y.tab.h
-#	$(srcdir)/../move-if-change y.tab.c $(PARSE_C)
-#	$(srcdir)/../move-if-change y.tab.h $(PARSE_H)
+#	$(SHELL) $(srcdir)/../move-if-change y.tab.c $(PARSE_C)
+#	$(SHELL) $(srcdir)/../move-if-change y.tab.h $(PARSE_H)
 #	cp $(PARSE_C) y.tab.c
 #	touch stamp-parse
 
--- gcc/objc/Make-lang.in.orig	Mon Aug 30 17:19:47 1999
+++ gcc/objc/Make-lang.in	Mon Aug 30 17:20:20 1999
@@ -82,7 +82,7 @@
 	sed -e "/^ifc$$/,/^end ifc$$/d" \
 	  -e "/^ifobjc$$/d" -e "/^end ifobjc$$/d" \
 	  $(srcdir)/c-parse.in >>tmp-objc-prs.y
-	$(srcdir)/move-if-change tmp-objc-prs.y $(srcdir)/objc/objc-parse.y
+	$(SHELL) $(srcdir)/move-if-change tmp-objc-prs.y $(srcdir)/objc/objc-parse.y
 
 objc-act.o : $(srcdir)/objc/objc-act.c \
    $(CONFIG_H) $(TREE_H) $(RTL_H) system.h \
--- gcc/config/msdos/top.sed.orig	Mon Aug 30 17:20:43 1999
+++ gcc/config/msdos/top.sed	Mon Aug 30 17:30:56 1999
@@ -26,6 +26,7 @@
 s/:\$/: \$/g
 s/^	\ *\.\//	/
 s/<\ *\$(srcdir)\//< $(srcdir)\\/g
+s/^	\$(SHELL) \$(srcdir)\/move-if-change/	update/
 s/^	\$(srcdir)\/move-if-change/	update/
 s/^USE_/# USE_/
 s/`echo \$(srcdir)\///g
--- gcc/config/winnt/config-nt.sed.orig	Mon Aug 30 17:21:32 1999
+++ gcc/config/winnt/config-nt.sed	Mon Aug 30 17:30:18 1999
@@ -19,6 +19,7 @@
 s/CFLAGS = -g/CFLAGS =/
 s/:\$/: \$/g
 s/<\ *\$(srcdir)\//< $(srcdir)\\/g
+s/^	\$(SHELL) \$(srcdir)\/move-if-change/	copy/
 s/^	\$(srcdir)\/move-if-change/	copy/
 s/^USE_/# USE_/
 s/`echo \$(srcdir)\///g
@@ -79,8 +80,8 @@
 s/\${HOST_CC}/\$(HOST_CC)/g
 s/ \${srcdir}\// /g
 s/\${mainversion}/\$(mainversion)/g
-s/\ $(srcdir)\/move-if-change$//
 s/\$(srcdir)\/move-if-change/copy/g
+s/\$(SHELL) \$(srcdir)\/move-if-change/copy/g
 /^# USE_HOST_OBSTACK/ i\
 USE_HOST_OBSTACK=obstack.obj
 /^# USE_ALLOCA/ i\


More information about the Gcc-patches mailing list