public inbox for cygwin-patches@cygwin.com
 help / color / mirror / Atom feed
From: Jon Turney <jon.turney@dronecode.org.uk>
To: cygwin-patches@cygwin.com
Cc: Jon Turney <jon.turney@dronecode.org.uk>
Subject: [PATCH 07/11] Detect and use MinGW compilers for testsuite wrappers
Date: Thu,  5 Nov 2020 19:47:44 +0000	[thread overview]
Message-ID: <20201105194748.31282-8-jon.turney@dronecode.org.uk> (raw)
In-Reply-To: <20201105194748.31282-1-jon.turney@dronecode.org.uk>

Drop MINGW_FE, which I can't find any trace of, and instead detect and
use MinGW compilers.

This requires adding AC_CANONICAL_TARGET, to set $target_cpu.
---
 winsup/testsuite/Makefile.in            | 8 +++++---
 winsup/testsuite/configure.ac           | 5 +++++
 winsup/testsuite/winsup.api/cygload.exp | 2 +-
 3 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/winsup/testsuite/Makefile.in b/winsup/testsuite/Makefile.in
index 2a44fec07..53eb67308 100644
--- a/winsup/testsuite/Makefile.in
+++ b/winsup/testsuite/Makefile.in
@@ -56,7 +56,8 @@ endif
 
 AR:=@AR@
 AR_FLAGS:=qv
-MINGW_FE:=$(dir ${srcdir})/utils/mingw
+MINGW_CC:= @MINGW_CC@
+MINGW_CXX:= @MINGW_CXX@
 
 #
 # Include common definitions for winsup directory
@@ -140,6 +141,7 @@ site.exp: ./config.status Makefile
 	@echo "set CC \"$(CC)\"" >> ./tmp0
 # CFLAGS is set even though it's empty to show we reserve the right to set it.
 	@echo "set CFLAGS \"$(ALL_CFLAGS)\"" >> ./tmp0
+	@echo "set MINGW_CXX \"$(MINGW_CXX)\"" >> ./tmp0
 	echo "set tmpdir $(objdir)/testsuite" >> ./tmp0
 	@echo "set ltp_includes \"$(libltp_srcdir)/include\"" >> ./tmp0
 	@echo "## All variables above are generated by configure. Do Not Edit ##" >> ./tmp0
@@ -163,10 +165,10 @@ check: $(TESTSUP_LIB_NAME) $(RUNTIME) cygrun.exe testsuite/site.exp
 	cd testsuite; runtest --tool winsup $(RUNTESTFLAGS)
 
 cygrun.o: cygrun.c
-	${MINGW_FE} $(CC) $(MINGW_CFLAGS) -o $@ -c $<
+	$(MINGW_CC) $(MINGW_CFLAGS) -o $@ -c $<
 
 cygrun.exe : cygrun.o
-	${MINGW_FE} $(CC) ${MINGW_LDFLAGS} -o $@ $<
+	$(MINGW_CC) $(MINGW_LDFLAGS) -o $@ $<
 
 Makefile: Makefile.in $(srcdir)/configure config.status
 	$(SHELL) config.status
diff --git a/winsup/testsuite/configure.ac b/winsup/testsuite/configure.ac
index effea48c9..b82ec7f60 100755
--- a/winsup/testsuite/configure.ac
+++ b/winsup/testsuite/configure.ac
@@ -14,10 +14,15 @@ AC_CONFIG_SRCDIR(Makefile.in)
 
 . ${srcdir}/../configure.cygwin
 
+AC_CANONICAL_TARGET
+
 AC_PROG_CC
 AC_PROG_CPP
 AC_CHECK_TOOL(AR,ar)
 
 AC_SUBST(target_builddir)
 
+AC_CHECK_PROGS(MINGW_CXX, ${target_cpu}-w64-mingw32-g++)
+AC_CHECK_PROGS(MINGW_CC, ${target_cpu}-w64-mingw32-gcc)
+
 AC_OUTPUT(Makefile)
diff --git a/winsup/testsuite/winsup.api/cygload.exp b/winsup/testsuite/winsup.api/cygload.exp
index a07a549f9..e7b439512 100644
--- a/winsup/testsuite/winsup.api/cygload.exp
+++ b/winsup/testsuite/winsup.api/cygload.exp
@@ -14,7 +14,7 @@ proc ws_spawn {cmd args} {
     verbose send "catchCode = $rv\n"
 }
 
-ws_spawn "gcc -mno-cygwin $srcdir/$subdir/cygload.cc -o mingw-cygload.exe -lstdc++ -Wl,-e,_cygloadCRTStartup@0"
+ws_spawn "$MINGW_CXX $srcdir/$subdir/cygload.cc -o mingw-cygload.exe -lstdc++ -Wl,-e,_cygloadCRTStartup@0"
 
 if { $rv != {0 {}} } {
     verbose -log "$rv"
-- 
2.29.0


  parent reply	other threads:[~2020-11-05 19:48 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-05 19:47 [PATCH 00/11] testsuite refurbishment Jon Turney
2020-11-05 19:47 ` [PATCH 01/11] Add testsuite directory to autogen.sh Jon Turney
2020-11-05 19:47 ` [PATCH 02/11] Always configure in testsuite subdirectory Jon Turney
2020-11-05 19:47 ` [PATCH 03/11] Add rule to testsuite Makefile to regenerate it when needed Jon Turney
2020-11-05 19:47 ` [PATCH 04/11] Avoid 'Makefile.in seems to ignore the --datarootdir setting' warning Jon Turney
2020-11-05 19:47 ` [PATCH 05/11] Move adding libltp to VPATH after Makefile.common Jon Turney
2020-11-05 19:47 ` [PATCH 06/11] Define target_builddir autoconf and Makefile variables Jon Turney
2020-11-05 19:47 ` Jon Turney [this message]
2020-11-05 19:47 ` [PATCH 08/11] Use absolute path to libltp includes Jon Turney
2020-11-05 19:47 ` [PATCH 09/11] Check exit code of a test, rather than stdout Jon Turney
2020-11-05 19:47 ` [PATCH 10/11] Set PATH for tests to pick up cygwin0.dll Jon Turney
2020-11-05 19:47 ` [PATCH 11/11] Ensure temporary directory used by tests exists Jon Turney
2020-11-08 18:19   ` Ken Brown
2020-11-08 18:52     ` Jon Turney
2020-11-08 19:27       ` Ken Brown
2020-11-08 23:38         ` Brian Inglis
2020-11-09 16:25         ` Jon Turney
2020-11-09 17:48           ` Ken Brown
2020-11-09 21:01             ` Jon Turney
2020-11-06  9:44 ` [PATCH 00/11] testsuite refurbishment Corinna Vinschen

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=20201105194748.31282-8-jon.turney@dronecode.org.uk \
    --to=jon.turney@dronecode.org.uk \
    --cc=cygwin-patches@cygwin.com \
    /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).