diff mbox

Don't use ./tmp0 for site.exp generation

Message ID alpine.LNX.2.00.1104191553150.810@zhemvz.fhfr.qr
State New
Headers show

Commit Message

Richard Biener April 19, 2011, 1:55 p.m. UTC
This patch sits in all my development trees because delta uses
tmp? named directories for storing intermediate files.  This causes
a make check to fail.

Maybe there is an even better way to create a truly temporary file
name (that is even portable), but the following patch simply avoids
using tmp0 in favor of tmpDG.

Bootstrap and regtest running on x86_64-unknown-linux-gnu (not that
I expect any problems).

Ok for trunk?

Thanks,
Richard.

2011-04-19  Richard Guenther  <rguenther@suse.de>

	* Makefile.in (site.exp): Do not use tmp0 but tmpDG as temporary
	file name.

Comments

Rainer Orth April 19, 2011, 2:03 p.m. UTC | #1
Richard Guenther <rguenther@suse.de> writes:

> This patch sits in all my development trees because delta uses
> tmp? named directories for storing intermediate files.  This causes
> a make check to fail.
>
> Maybe there is an even better way to create a truly temporary file
> name (that is even portable), but the following patch simply avoids
> using tmp0 in favor of tmpDG.

Perhaps it would be better to use site.tmp to match current git
automake?

	Rainer
Richard Biener April 19, 2011, 2:04 p.m. UTC | #2
On Tue, 19 Apr 2011, Rainer Orth wrote:

> Richard Guenther <rguenther@suse.de> writes:
> 
> > This patch sits in all my development trees because delta uses
> > tmp? named directories for storing intermediate files.  This causes
> > a make check to fail.
> >
> > Maybe there is an even better way to create a truly temporary file
> > name (that is even portable), but the following patch simply avoids
> > using tmp0 in favor of tmpDG.
> 
> Perhaps it would be better to use site.tmp to match current git
> automake?

I can certainly use any other temporary name, just the tmp0 use
is annoying ;)  It's a matter of a single search-and-replace.

Richard.
Rainer Orth April 21, 2011, 1:03 p.m. UTC | #3
Richard Guenther <rguenther@suse.de> writes:

>> Perhaps it would be better to use site.tmp to match current git
>> automake?
>
> I can certainly use any other temporary name, just the tmp0 use
> is annoying ;)  It's a matter of a single search-and-replace.

Although this isn't exactly part of the testsuite itself, given that
site.tmp is used in all automake-generated Makefile.in's, I'd say go
ahead.  gcc/Makefile.in seems to be the only (hand-written) Makefile.in
that uses something else.

Thanks.
	Rainer
Richard Biener April 21, 2011, 1:09 p.m. UTC | #4
On Thu, 21 Apr 2011, Rainer Orth wrote:

> Richard Guenther <rguenther@suse.de> writes:
> 
> >> Perhaps it would be better to use site.tmp to match current git
> >> automake?
> >
> > I can certainly use any other temporary name, just the tmp0 use
> > is annoying ;)  It's a matter of a single search-and-replace.
> 
> Although this isn't exactly part of the testsuite itself, given that
> site.tmp is used in all automake-generated Makefile.in's, I'd say go
> ahead.  gcc/Makefile.in seems to be the only (hand-written) Makefile.in
> that uses something else.

Committed using site.tmp.

Richard.
diff mbox

Patch

Index: gcc/Makefile.in
===================================================================
--- gcc/Makefile.in	(revision 172709)
+++ gcc/Makefile.in	(working copy)
@@ -4837,39 +4837,39 @@  target_subdir = @target_subdir@
 
 site.exp: ./config.status Makefile
 	@echo "Making a new config file..."
-	-@rm -f ./tmp?
+	-@rm -f ./tmpDG
 	@$(STAMP) site.exp
 	-@mv site.exp site.bak
-	@echo "## these variables are automatically generated by make ##" > ./tmp0
-	@echo "# Do not edit here. If you wish to override these values" >> ./tmp0
-	@echo "# add them to the last section" >> ./tmp0
-	@echo "set rootme \"`${PWD_COMMAND}`\"" >> ./tmp0
-	@echo "set srcdir \"`cd ${srcdir}; ${PWD_COMMAND}`\"" >> ./tmp0
-	@echo "set host_triplet $(host)" >> ./tmp0
-	@echo "set build_triplet $(build)" >> ./tmp0
-	@echo "set target_triplet $(target)" >> ./tmp0
-	@echo "set target_alias $(target_noncanonical)" >> ./tmp0
-	@echo "set libiconv \"$(LIBICONV)\"" >> ./tmp0
+	@echo "## these variables are automatically generated by make ##" > ./tmpDG
+	@echo "# Do not edit here. If you wish to override these values" >> ./tmpDG
+	@echo "# add them to the last section" >> ./tmpDG
+	@echo "set rootme \"`${PWD_COMMAND}`\"" >> ./tmpDG
+	@echo "set srcdir \"`cd ${srcdir}; ${PWD_COMMAND}`\"" >> ./tmpDG
+	@echo "set host_triplet $(host)" >> ./tmpDG
+	@echo "set build_triplet $(build)" >> ./tmpDG
+	@echo "set target_triplet $(target)" >> ./tmpDG
+	@echo "set target_alias $(target_noncanonical)" >> ./tmpDG
+	@echo "set libiconv \"$(LIBICONV)\"" >> ./tmpDG
 # CFLAGS is set even though it's empty to show we reserve the right to set it.
-	@echo "set CFLAGS \"\"" >> ./tmp0
-	@echo "set CXXFLAGS \"\"" >> ./tmp0
-	@echo "set HOSTCC \"$(CC)\"" >> ./tmp0
-	@echo "set HOSTCFLAGS \"$(CFLAGS)\"" >> ./tmp0
+	@echo "set CFLAGS \"\"" >> ./tmpDG
+	@echo "set CXXFLAGS \"\"" >> ./tmpDG
+	@echo "set HOSTCC \"$(CC)\"" >> ./tmpDG
+	@echo "set HOSTCFLAGS \"$(CFLAGS)\"" >> ./tmpDG
 # When running the tests we set GCC_EXEC_PREFIX to the install tree so that
 # files that have already been installed there will be found.  The -B option
 # overrides it, so use of GCC_EXEC_PREFIX will not result in using GCC files
 # from the install tree.
-	@echo "set TEST_GCC_EXEC_PREFIX \"$(libdir)/gcc/\"" >> ./tmp0
-	@echo "set TESTING_IN_BUILD_TREE 1" >> ./tmp0
-	@echo "set HAVE_LIBSTDCXX_V3 1" >> ./tmp0
+	@echo "set TEST_GCC_EXEC_PREFIX \"$(libdir)/gcc/\"" >> ./tmpDG
+	@echo "set TESTING_IN_BUILD_TREE 1" >> ./tmpDG
+	@echo "set HAVE_LIBSTDCXX_V3 1" >> ./tmpDG
 	@if test "@enable_plugin@" = "yes" ; then \
-	  echo "set ENABLE_PLUGIN 1" >> ./tmp0; \
-	  echo "set PLUGINCC \"$(PLUGINCC)\"" >> ./tmp0; \
-	  echo "set PLUGINCFLAGS \"$(PLUGINCFLAGS)\"" >> ./tmp0; \
-	  echo "set GMPINC \"$(GMPINC)\"" >> ./tmp0; \
+	  echo "set ENABLE_PLUGIN 1" >> ./tmpDG; \
+	  echo "set PLUGINCC \"$(PLUGINCC)\"" >> ./tmpDG; \
+	  echo "set PLUGINCFLAGS \"$(PLUGINCFLAGS)\"" >> ./tmpDG; \
+	  echo "set GMPINC \"$(GMPINC)\"" >> ./tmpDG; \
 	fi
 	@if test "@enable_lto@" = "yes" ; then \
-	  echo "set ENABLE_LTO 1" >> ./tmp0; \
+	  echo "set ENABLE_LTO 1" >> ./tmpDG; \
 	fi
 # If newlib has been configured, we need to pass -B to gcc so it can find
 # newlib's crt0.o if it exists.  This will cause a "path prefix not used"
@@ -4882,36 +4882,36 @@  site.exp: ./config.status Makefile
 # We also need to pass -L ../ld so that the linker can find ldscripts.
 	@if [ -d $(objdir)/../$(target_subdir)/newlib ] \
 	    && [ "${host}" != "${target}" ]; then \
-	  echo "set newlib_cflags \"-I$(objdir)/../$(target_subdir)/newlib/targ-include -I\$$srcdir/../newlib/libc/include\"" >> ./tmp0; \
-	  echo "set newlib_ldflags \"-B$(objdir)/../$(target_subdir)/newlib/\"" >> ./tmp0; \
-	  echo "append CFLAGS \" \$$newlib_cflags\"" >> ./tmp0; \
-	  echo "append CXXFLAGS \" \$$newlib_cflags\"" >> ./tmp0; \
-	  echo "append LDFLAGS \" \$$newlib_ldflags\"" >> ./tmp0; \
+	  echo "set newlib_cflags \"-I$(objdir)/../$(target_subdir)/newlib/targ-include -I\$$srcdir/../newlib/libc/include\"" >> ./tmpDG; \
+	  echo "set newlib_ldflags \"-B$(objdir)/../$(target_subdir)/newlib/\"" >> ./tmpDG; \
+	  echo "append CFLAGS \" \$$newlib_cflags\"" >> ./tmpDG; \
+	  echo "append CXXFLAGS \" \$$newlib_cflags\"" >> ./tmpDG; \
+	  echo "append LDFLAGS \" \$$newlib_ldflags\"" >> ./tmpDG; \
 	else true; \
 	fi
 	@if [ -d $(objdir)/../ld ] ; then \
-	  echo "append LDFLAGS \" -L$(objdir)/../ld\"" >> ./tmp0; \
+	  echo "append LDFLAGS \" -L$(objdir)/../ld\"" >> ./tmpDG; \
 	else true; \
 	fi
-	echo "set tmpdir $(objdir)/testsuite" >> ./tmp0
-	@echo "set srcdir \"\$${srcdir}/testsuite\"" >> ./tmp0
+	echo "set tmpdir $(objdir)/testsuite" >> ./tmpDG
+	@echo "set srcdir \"\$${srcdir}/testsuite\"" >> ./tmpDG
 	@if [ "X$(ALT_CC_UNDER_TEST)" != "X" ] ; then \
-	  echo "set ALT_CC_UNDER_TEST \"$(ALT_CC_UNDER_TEST)\"" >> ./tmp0; \
+	  echo "set ALT_CC_UNDER_TEST \"$(ALT_CC_UNDER_TEST)\"" >> ./tmpDG; \
 	else true; \
 	fi
 	@if [ "X$(ALT_CXX_UNDER_TEST)" != "X" ] ; then \
-	  echo "set ALT_CXX_UNDER_TEST \"$(ALT_CXX_UNDER_TEST)\"" >> ./tmp0; \
+	  echo "set ALT_CXX_UNDER_TEST \"$(ALT_CXX_UNDER_TEST)\"" >> ./tmpDG; \
 	else true; \
 	fi
 	@if [ "X$(COMPAT_OPTIONS)" != "X" ] ; then \
-	  echo "set COMPAT_OPTIONS \"$(COMPAT_OPTIONS)\"" >> ./tmp0; \
+	  echo "set COMPAT_OPTIONS \"$(COMPAT_OPTIONS)\"" >> ./tmpDG; \
 	else true; \
 	fi
-	@echo "## All variables above are generated by configure. Do Not Edit ##" >> ./tmp0
-	@cat ./tmp0 > site.exp
+	@echo "## All variables above are generated by configure. Do Not Edit ##" >> ./tmpDG
+	@cat ./tmpDG > site.exp
 	@cat site.bak | sed \
 		-e '1,/^## All variables above are.*##/ d' >> site.exp
-	-@rm -f ./tmp?
+	-@rm -f ./tmpDG
 
 CHECK_TARGETS = check-gcc @check_languages@