public inbox for libstdc++-cvs@sourceware.org
help / color / mirror / Atom feed
From: Aldy Hernandez <aldyh@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org
Subject: [gcc/devel/ranger] libstdc++: Simplify makefile rule for largefile-config.h (PR91947)
Date: Wed, 17 Jun 2020 18:14:11 +0000 (GMT)	[thread overview]
Message-ID: <20200617181411.E39683948449@sourceware.org> (raw)

https://gcc.gnu.org/g:04681fca936b5bca1dd374dfb0fbca7ccb028994

commit 04681fca936b5bca1dd374dfb0fbca7ccb028994
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Thu Jan 23 14:02:32 2020 +0000

    libstdc++: Simplify makefile rule for largefile-config.h (PR91947)
    
    The previous rule could leave an incomplete file if the build was
    interrupted, which would then not be remade if make was run again.
    
    This makes the rule more robust by writing to a temporary file and only
    moving it into place as the final step. It also simplifies the rule so
    that only the essential macro definitions are written to the file, not
    the explanatory comments and commented out #undef lines.
    
    Also, the macro for enabling LFS on Mac OS X 10.5 is now set
    unconditionally, which is a bug fix from upstream autoconf.
    
            PR libstdc++/91947
            * include/Makefile.am (${host_builddir}/largefile-config.h): Simplify
            rule.
            * include/Makefile.in: Regenerate.

Diff:
---
 libstdc++-v3/ChangeLog           |  7 +++++++
 libstdc++-v3/include/Makefile.am | 22 ++++++----------------
 libstdc++-v3/include/Makefile.in | 22 ++++++----------------
 3 files changed, 19 insertions(+), 32 deletions(-)

diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index 17cc0f34b55..539b0f6e593 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,10 @@
+2020-01-23  Jonathan Wakely  <jwakely@redhat.com>
+
+	PR libstdc++/91947
+	* include/Makefile.am (${host_builddir}/largefile-config.h): Simplify
+	rule.
+	* include/Makefile.in: Regenerate.
+
 2020-01-20  Jonathan Wakely  <jwakely@redhat.com>
 
 	* doc/xml/faq.xml: Fix grammar.
diff --git a/libstdc++-v3/include/Makefile.am b/libstdc++-v3/include/Makefile.am
index ad4404793be..89835759069 100644
--- a/libstdc++-v3/include/Makefile.am
+++ b/libstdc++-v3/include/Makefile.am
@@ -1245,22 +1245,12 @@ stamp-float128:
 endif
 
 # This header is not installed, it's only used to build libstdc++ itself.
-${host_builddir}/largefile-config.h: ${CONFIG_HEADER} \
-				     ${glibcxx_srcdir}/include/bits/c++config
-	@echo '#if defined _GLIBCXX_CXX_CONFIG_H || defined _FEATURES_H' > $@
-	@echo '# error "This file must be included before any others"' >> $@
-	@echo '#endif' >> $@
-	@echo >> $@
-	@echo '/* Enable large inode numbers on Mac OS X 10.5.  */' >> $@
-	@echo '#ifndef _DARWIN_USE_64_BIT_INODE' >> $@
-	@echo '# define _DARWIN_USE_64_BIT_INODE 1' >> $@
-	@echo '#endif' >> $@
-	@echo >> $@
-	@echo '/* Number of bits in a file offset, on hosts where this is settable. */' >> $@
-	@grep '_FILE_OFFSET_BITS' ${CONFIG_HEADER} >> $@
-	@echo >> $@
-	@echo '/* Define for large files, on AIX-style hosts. */' >> $@
-	@grep '_LARGE_FILES' ${CONFIG_HEADER} >> $@
+${host_builddir}/largefile-config.h: ${CONFIG_HEADER}
+	@rm -f $@.tmp
+	@-grep 'define _DARWIN_USE_64_BIT_INODE' ${CONFIG_HEADER} >> $@.tmp
+	@-grep 'define _FILE_OFFSET_BITS' ${CONFIG_HEADER} >> $@.tmp
+	@-grep 'define _LARGE_FILES' ${CONFIG_HEADER} >> $@.tmp
+	@mv $@.tmp $@
 
 # NB: The non-empty default ldbl_compat works around an AIX sed
 # oddity, see libstdc++/31957 for details.
diff --git a/libstdc++-v3/include/Makefile.in b/libstdc++-v3/include/Makefile.in
index f8b56452242..57574c307a5 100644
--- a/libstdc++-v3/include/Makefile.in
+++ b/libstdc++-v3/include/Makefile.in
@@ -1725,22 +1725,12 @@ stamp-host: ${host_headers} ${bits_host_headers} ${ext_host_headers} ${host_head
 @ENABLE_FLOAT128_FALSE@	echo 'undef _GLIBCXX_USE_FLOAT128' > stamp-float128
 
 # This header is not installed, it's only used to build libstdc++ itself.
-${host_builddir}/largefile-config.h: ${CONFIG_HEADER} \
-				     ${glibcxx_srcdir}/include/bits/c++config
-	@echo '#if defined _GLIBCXX_CXX_CONFIG_H || defined _FEATURES_H' > $@
-	@echo '# error "This file must be included before any others"' >> $@
-	@echo '#endif' >> $@
-	@echo >> $@
-	@echo '/* Enable large inode numbers on Mac OS X 10.5.  */' >> $@
-	@echo '#ifndef _DARWIN_USE_64_BIT_INODE' >> $@
-	@echo '# define _DARWIN_USE_64_BIT_INODE 1' >> $@
-	@echo '#endif' >> $@
-	@echo >> $@
-	@echo '/* Number of bits in a file offset, on hosts where this is settable. */' >> $@
-	@grep '_FILE_OFFSET_BITS' ${CONFIG_HEADER} >> $@
-	@echo >> $@
-	@echo '/* Define for large files, on AIX-style hosts. */' >> $@
-	@grep '_LARGE_FILES' ${CONFIG_HEADER} >> $@
+${host_builddir}/largefile-config.h: ${CONFIG_HEADER}
+	@rm -f $@.tmp
+	@-grep 'define _DARWIN_USE_64_BIT_INODE' ${CONFIG_HEADER} >> $@.tmp
+	@-grep 'define _FILE_OFFSET_BITS' ${CONFIG_HEADER} >> $@.tmp
+	@-grep 'define _LARGE_FILES' ${CONFIG_HEADER} >> $@.tmp
+	@mv $@.tmp $@
 
 # NB: The non-empty default ldbl_compat works around an AIX sed
 # oddity, see libstdc++/31957 for details.


                 reply	other threads:[~2020-06-17 18:14 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200617181411.E39683948449@sourceware.org \
    --to=aldyh@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    --cc=libstdc++-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).