From: "Maciej W. Rozycki" <macro@wdc.com>
To: libffi-discuss@sourceware.org
Cc: Anthony Green <green@moxielogic.com>,
Mike Stump <mikestump@comcast.net>,
gcc-patches@gcc.gnu.org
Subject: [PATCH libffi 1/4] Use a template to pass $CC and $CXX to DejaGNU
Date: Fri, 3 Apr 2020 23:55:36 +0100 (BST) [thread overview]
Message-ID: <alpine.LFD.2.21.2004031343310.461@redsun52.ssa.fujisawa.hgst.com> (raw)
In-Reply-To: <alpine.LFD.2.21.2004012222200.461@redsun52.ssa.fujisawa.hgst.com>
Use an Autoconf template rather an inline piece of scriptery to set
DejaGNU's $CC_FOR_TARGET and $CXX_FOR_TARGET variables from $CC and $CXX
respectively, making it easier to maintain and making it take advantage
of Automake's dependency and rule generation. Relocate the generated
`local.exp' file to within testsuite/ so as to make its regeneration
rule to actually work, i.e. (in testsuite/Makefile.in):
EXTRA_DEJAGNU_SITE_CONFIG = local.exp
site.exp: Makefile $(EXTRA_DEJAGNU_SITE_CONFIG)
[...]
local.exp: $(top_builddir)/config.status $(srcdir)/local.exp.in
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
It wouldn't work if the regeneration rule was placed in the top-level
Makefile.in, which is what Automake would faithfully do if `local.exp'
stayed in the top level directory.
---
Hi,
I think having individual AC_CONFIG_FILES macro invocations for each
output file or group of files would make this change (and code itself)
more readable, however it hasn't been done before and I decided not to
change the style on this occasion. It may make sense as a follow-up
clean-up.
Maciej
---
Makefile.am | 3 ---
configure.ac | 7 +------
testsuite/Makefile.am | 2 +-
testsuite/local.exp.in | 2 ++
4 files changed, 4 insertions(+), 10 deletions(-)
libffi-test-cc-for-target-template.diff
Index: libffi/Makefile.am
===================================================================
--- libffi.orig/Makefile.am
+++ libffi/Makefile.am
@@ -23,9 +23,6 @@ EXTRA_DIST = LICENSE ChangeLog.old \
libtool-ldflags libtool-version configure.host README.md \
libffi.map.in LICENSE-BUILDTOOLS msvc_build make_sunver.pl
-# local.exp is generated by configure
-DISTCLEANFILES = local.exp
-
# Subdir rules rely on $(FLAGS_TO_PASS)
FLAGS_TO_PASS = $(AM_MAKEFLAGS)
Index: libffi/configure.ac
===================================================================
--- libffi.orig/configure.ac
+++ libffi/configure.ac
@@ -56,11 +56,6 @@ if test "x$GCC" = "xyes"; then
CFLAGS="$CFLAGS -fexceptions"
fi
-cat > local.exp <<EOF
-set CC_FOR_TARGET "$CC"
-set CXX_FOR_TARGET "$CXX"
-EOF
-
AM_MAINTAINER_MODE
AC_CHECK_HEADERS(sys/mman.h)
@@ -401,7 +396,7 @@ test -d src || mkdir src
test -d src/$TARGETDIR || mkdir src/$TARGETDIR
], [TARGETDIR="$TARGETDIR"])
-AC_CONFIG_FILES(include/Makefile include/ffi.h Makefile testsuite/Makefile man/Makefile doc/Makefile libffi.pc)
+AC_CONFIG_FILES(include/Makefile include/ffi.h Makefile testsuite/Makefile testsuite/local.exp man/Makefile doc/Makefile libffi.pc)
AC_OUTPUT
Index: libffi/testsuite/Makefile.am
===================================================================
--- libffi.orig/testsuite/Makefile.am
+++ libffi/testsuite/Makefile.am
@@ -2,7 +2,7 @@
AUTOMAKE_OPTIONS = foreign dejagnu
-EXTRA_DEJAGNU_SITE_CONFIG=../local.exp
+EXTRA_DEJAGNU_SITE_CONFIG = local.exp
CLEANFILES = *.exe core* *.log *.sum
Index: libffi/testsuite/local.exp.in
===================================================================
--- /dev/null
+++ libffi/testsuite/local.exp.in
@@ -0,0 +1,2 @@
+set CC_FOR_TARGET "@CC@"
+set CXX_FOR_TARGET "@CXX@"
next prev parent reply other threads:[~2020-04-03 22:55 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-03 22:55 [PATCH libffi 0/4] Robustify compiler and library path selection in the testsuite Maciej W. Rozycki
2020-04-03 22:55 ` Maciej W. Rozycki [this message]
2020-04-06 17:58 ` [PATCH libffi 1/4] Use a template to pass $CC and $CXX to DejaGNU Jeff Law
2020-04-03 22:55 ` [PATCH libffi 2/4] Use a documented way to pass $compiler_vendor " Maciej W. Rozycki
2020-04-06 18:00 ` Jeff Law
2020-04-03 22:56 ` [PATCH libffi 3/4] Make `libffi-init' use $CC_FOR_TARGET Maciej W. Rozycki
2020-04-06 18:03 ` Jeff Law
2020-04-03 22:56 ` [PATCH libffi 4/4] Correct indentation throughout `libffi-init' Maciej W. Rozycki
2020-04-06 18:01 ` Jeff Law
2020-04-14 13:59 ` [PING][PATCH libffi 0/4] Robustify compiler and library path selection in the testsuite Maciej W. Rozycki
2020-04-20 12:50 ` [PING^2][PATCH " Maciej W. Rozycki
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=alpine.LFD.2.21.2004031343310.461@redsun52.ssa.fujisawa.hgst.com \
--to=macro@wdc.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=green@moxielogic.com \
--cc=libffi-discuss@sourceware.org \
--cc=mikestump@comcast.net \
/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).