public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Eric Gallager <egall@gwmail.gwu.edu>
To: gcc-patches <gcc-patches@gcc.gnu.org>
Cc: Paolo Bonzini <bonzini@gnu.org>,
	neroden@gcc.gnu.org, aoliva@gcc.gnu.org,  Ralf.Wildenhues@gmx.de
Subject: [PING][PATCH][WIP] have configure probe prefix for gmp/mpfr/mpc [PR44425]
Date: Thu, 9 Jun 2022 16:04:50 -0400	[thread overview]
Message-ID: <CAMfHzOsv-sT3a77CVm7pY+ehjANKH6vry2irKzXRTUQtTbznqw@mail.gmail.com> (raw)
In-Reply-To: <CAMfHzOspWtDXNQVK5yY9AukUckeCf1p0iy9C_Vuxic72r-XWvA@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 753 bytes --]

Hi, I'd like to ping this patch:
https://gcc.gnu.org/pipermail/gcc-patches/2022-June/596126.html
(cc-ing the build machinery maintainers listed in MAINTAINERS this time)

On Thu, Jun 2, 2022 at 11:53 AM Eric Gallager <egall@gwmail.gwu.edu> wrote:
>
> So, I'm working on fixing PR bootstrap/44425, and have this patch to
> have the top-level configure script check in the value passed to
> `--prefix=` when looking for gmp/mpfr/mpc. It "works" (in that
> configuring with just `--prefix=` and none of
> `--with-gmp=`/`--with-mpfr=`/`--with-mpc=` now works where it failed
> before), but unfortunately it results in a bunch of duplicated
> `-I`/`-L` flags stuck in ${gmplibs} and ${gmpinc}... is that
> acceptable or should I try another approach?
> Eric

[-- Attachment #2: patch-configure.diff --]
[-- Type: application/octet-stream, Size: 5127 bytes --]

diff --git a/configure b/configure
index 5dcaab14ae9..8ad9a9f8392 100755
--- a/configure
+++ b/configure
@@ -7983,12 +7983,19 @@ fi
 if test "x$with_mpc" != x; then
   gmplibs="-L$with_mpc/lib $gmplibs"
   gmpinc="-I$with_mpc/include $gmpinc"
+elif test "x${prefix}" != "x" && test -d "${prefix}"; then
+  gmplibs="-L${prefix}/lib $gmplibs"
+  gmpinc="-I${prefix}/include $gmpinc"
 fi
 if test "x$with_mpc_include" != x; then
   gmpinc="-I$with_mpc_include $gmpinc"
+elif test "x${prefix}" != "x" && test -d "${prefix}/include"; then
+  gmpinc="-I${prefix}/include $gmpinc"
 fi
 if test "x$with_mpc_lib" != x; then
   gmplibs="-L$with_mpc_lib $gmplibs"
+elif test "x${prefix}" != "x" && test -d "${prefix}/lib"; then
+  gmplibs="-L${prefix}/lib $gmplibs"
 fi
 if test "x$with_mpc$with_mpc_include$with_mpc_lib" = x && test -d ${srcdir}/mpc; then
   gmplibs='-L$$r/$(HOST_SUBDIR)/mpc/src/'"$lt_cv_objdir $gmplibs"
@@ -8024,12 +8031,19 @@ fi
 if test "x$with_mpfr" != x; then
   gmplibs="-L$with_mpfr/lib $gmplibs"
   gmpinc="-I$with_mpfr/include $gmpinc"
+elif test "x${prefix}" != "x" && test -d "${prefix}"; then
+  gmplibs="-L${prefix}/lib $gmplibs"
+  gmpinc="-I${prefix}/include $gmpinc"
 fi
 if test "x$with_mpfr_include" != x; then
   gmpinc="-I$with_mpfr_include $gmpinc"
+elif test "x${prefix}" != "x" && test -d "${prefix}/include"; then
+  gmpinc="-I${prefix}/include $gmpinc"
 fi
 if test "x$with_mpfr_lib" != x; then
   gmplibs="-L$with_mpfr_lib $gmplibs"
+elif test "x${prefix}" != "x" && test -d "${prefix}/lib"; then
+  gmplibs="-L${prefix}/lib $gmplibs"
 fi
 if test "x$with_mpfr$with_mpfr_include$with_mpfr_lib" = x && test -d ${srcdir}/mpfr; then
   # MPFR v3.1.0 moved the sources into a src sub-directory.
@@ -8070,12 +8084,19 @@ fi
 if test "x$with_gmp" != x; then
   gmplibs="-L$with_gmp/lib $gmplibs"
   gmpinc="-I$with_gmp/include $gmpinc"
+elif test "x${prefix}" != "x" && test -d "${prefix}"; then
+  gmplibs="-L${prefix}/lib $gmplibs"
+  gmpinc="-I${prefix}/include $gmpinc"
 fi
 if test "x$with_gmp_include" != x; then
   gmpinc="-I$with_gmp_include $gmpinc"
+elif test "x${prefix}" != "x" && test -d "${prefix}/include"; then
+  gmpinc="-I${prefix}/include $gmpinc"
 fi
 if test "x$with_gmp_lib" != x; then
   gmplibs="-L$with_gmp_lib $gmplibs"
+elif test "x${prefix}" != "x" && test -d "${prefix}/lib"; then
+  gmplibs="-L${prefix}/lib $gmplibs"
 fi
 if test "x$with_gmp$with_gmp_include$with_gmp_lib" = x && test -d ${srcdir}/gmp; then
   gmplibs='-L$$r/$(HOST_SUBDIR)/gmp/'"$lt_cv_objdir $gmplibs"
diff --git a/configure.ac b/configure.ac
index 85977482aee..33d4d775419 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1557,12 +1557,19 @@ AC_ARG_WITH(mpc-lib,
 if test "x$with_mpc" != x; then
   gmplibs="-L$with_mpc/lib $gmplibs"
   gmpinc="-I$with_mpc/include $gmpinc"
+elif test "x${prefix}" != "x" && test -d "${prefix}"; then
+  gmplibs="-L${prefix}/lib $gmplibs"
+  gmpinc="-I${prefix}/include $gmpinc"
 fi
 if test "x$with_mpc_include" != x; then
   gmpinc="-I$with_mpc_include $gmpinc"
+elif test "x${prefix}" != "x" && test -d "${prefix}/include"; then
+  gmpinc="-I${prefix}/include $gmpinc"
 fi
 if test "x$with_mpc_lib" != x; then
   gmplibs="-L$with_mpc_lib $gmplibs"
+elif test "x${prefix}" != "x" && test -d "${prefix}/lib"; then
+  gmplibs="-L${prefix}/lib $gmplibs"
 fi
 if test "x$with_mpc$with_mpc_include$with_mpc_lib" = x && test -d ${srcdir}/mpc; then
   gmplibs='-L$$r/$(HOST_SUBDIR)/mpc/src/'"$lt_cv_objdir $gmplibs"
@@ -1591,12 +1598,19 @@ AC_ARG_WITH(mpfr-lib,
 if test "x$with_mpfr" != x; then
   gmplibs="-L$with_mpfr/lib $gmplibs"
   gmpinc="-I$with_mpfr/include $gmpinc"
+elif test "x${prefix}" != "x" && test -d "${prefix}"; then
+  gmplibs="-L${prefix}/lib $gmplibs"
+  gmpinc="-I${prefix}/include $gmpinc"
 fi
 if test "x$with_mpfr_include" != x; then
   gmpinc="-I$with_mpfr_include $gmpinc"
+elif test "x${prefix}" != "x" && test -d "${prefix}/include"; then
+  gmpinc="-I${prefix}/include $gmpinc"
 fi
 if test "x$with_mpfr_lib" != x; then
   gmplibs="-L$with_mpfr_lib $gmplibs"
+elif test "x${prefix}" != "x" && test -d "${prefix}/lib"; then
+  gmplibs="-L${prefix}/lib $gmplibs"
 fi
 if test "x$with_mpfr$with_mpfr_include$with_mpfr_lib" = x && test -d ${srcdir}/mpfr; then
   # MPFR v3.1.0 moved the sources into a src sub-directory.
@@ -1631,12 +1645,19 @@ AC_ARG_WITH(gmp-lib,
 if test "x$with_gmp" != x; then
   gmplibs="-L$with_gmp/lib $gmplibs"
   gmpinc="-I$with_gmp/include $gmpinc"
+elif test "x${prefix}" != "x" && test -d "${prefix}"; then
+  gmplibs="-L${prefix}/lib $gmplibs"
+  gmpinc="-I${prefix}/include $gmpinc"
 fi
 if test "x$with_gmp_include" != x; then
   gmpinc="-I$with_gmp_include $gmpinc"
+elif test "x${prefix}" != "x" && test -d "${prefix}/include"; then
+  gmpinc="-I${prefix}/include $gmpinc"
 fi
 if test "x$with_gmp_lib" != x; then
   gmplibs="-L$with_gmp_lib $gmplibs"
+elif test "x${prefix}" != "x" && test -d "${prefix}/lib"; then
+  gmplibs="-L${prefix}/lib $gmplibs"
 fi
 if test "x$with_gmp$with_gmp_include$with_gmp_lib" = x && test -d ${srcdir}/gmp; then
   gmplibs='-L$$r/$(HOST_SUBDIR)/gmp/'"$lt_cv_objdir $gmplibs"

  reply	other threads:[~2022-06-09 20:05 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-02 15:53 [PATCH][WIP] " Eric Gallager
2022-06-09 20:04 ` Eric Gallager [this message]
2022-06-10 11:22   ` [PING][PATCH][WIP] " Xi Ruoyao
2022-06-11 14:23     ` Eric Gallager
2022-06-21  3:17   ` Alexandre Oliva
2022-06-13 11:02 ` [PATCH][WIP] " Richard Biener
2022-06-13 14:27   ` Eric Gallager
2022-06-14 13:14     ` Richard Biener

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=CAMfHzOsv-sT3a77CVm7pY+ehjANKH6vry2irKzXRTUQtTbznqw@mail.gmail.com \
    --to=egall@gwmail.gwu.edu \
    --cc=Ralf.Wildenhues@gmx.de \
    --cc=aoliva@gcc.gnu.org \
    --cc=bonzini@gnu.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=neroden@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).