public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH][WIP] have configure probe prefix for gmp/mpfr/mpc [PR44425]
@ 2022-06-02 15:53 Eric Gallager
  2022-06-09 20:04 ` [PING][PATCH][WIP] " Eric Gallager
  2022-06-13 11:02 ` [PATCH][WIP] " Richard Biener
  0 siblings, 2 replies; 8+ messages in thread
From: Eric Gallager @ 2022-06-02 15:53 UTC (permalink / raw)
  To: gcc-patches

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

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"

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2022-06-21  3:20 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-02 15:53 [PATCH][WIP] have configure probe prefix for gmp/mpfr/mpc [PR44425] Eric Gallager
2022-06-09 20:04 ` [PING][PATCH][WIP] " Eric Gallager
2022-06-10 11:22   ` 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

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).