From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pj1-x102d.google.com (mail-pj1-x102d.google.com [IPv6:2607:f8b0:4864:20::102d]) by sourceware.org (Postfix) with ESMTPS id 0A3553858D1E for ; Tue, 3 Jan 2023 17:41:59 +0000 (GMT) Received: by mail-pj1-x102d.google.com with SMTP id v13-20020a17090a6b0d00b00219c3be9830so31807801pjj.4 for ; Tue, 03 Jan 2023 09:41:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=EDSCxfMaHhNMdKSQW9sWsna5lDaf9iI4oFyNgOrmDHo=; b=ne+kNpJyf3jZRACFgmtItsoD59OnXqLNRPnm/Lo325YC7lgE/Me8p5MJO7oIk8Rzcl 5Ei7mzGs6kAsP/EDUPXGwjYbWtU9SXOped1cee43YAVamoaet7wl3raPaN/zJa7A3RVT NkakNY1yri7W2IE7bZVgslltttQwAF2JWDt4EdQcm0i7CmiAspTS5by2zajo8T0pgFPs /6fd8IGEf3IT95wF4yY69XHNVesaSL+C3Tp73TqCuRu5i9ABBZ3537DaJu6aECGs0QTH NyKr4EVVWIc8TWENl1P4AsbA4jofecA+LttjBNRas7NqEUu6krpg0Rqif0sZuDUs2fKU /fdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=EDSCxfMaHhNMdKSQW9sWsna5lDaf9iI4oFyNgOrmDHo=; b=ppGXwRbTLomCI+6Fk6FwFT516DbjH9uEn9HczI6z0KppXDwZlRv5zQPALklyETBmcV WNOnbc/au4iLcIQrHvZfuqudoyDk9tPomBzEtNrnd9k0i3gSNbcEw9jw3NZAaue0bznP wxnGobe98XSfeLIQBkLiUwx8fFh5En2AICeTbKfz3tfPph129iHGB8EKm02wd4FWcc2n 0W2R3RgbTFezSBOzAhSVE6LESISHfE24i1F0RVv9OjmZLACf2IO7T8m/LZWSHzBB7JLw +kJN6ZT63HbbtpFLpYPGEv20XkcVOJzIc6C9Wxyl9PQR5JejBZ6YCTvIMM0ldmBlHQWP 2lew== X-Gm-Message-State: AFqh2kr3Sog4z/wzqsbqbV1duOmrYlFWL/d1BqDLPcUR4i04ocr6+Ss6 HHXvk/y9cgM2mTtLZb/iMasZ7cSgCRQXbM66ZcA= X-Google-Smtp-Source: AMrXdXsS2xNpXQlITS4CBBWIrNuJweFPxNioROZW7viRkiycVBaBmUYOV29PuCWpDYQA3bS/l+HxL4qr/T2RrYmOvNY= X-Received: by 2002:a17:902:760e:b0:192:5838:afdd with SMTP id k14-20020a170902760e00b001925838afddmr1764741pll.119.1672767718080; Tue, 03 Jan 2023 09:41:58 -0800 (PST) MIME-Version: 1.0 References: <20230103135330.1225218-1-chigot@adacore.com> In-Reply-To: <20230103135330.1225218-1-chigot@adacore.com> From: Andrew Pinski Date: Tue, 3 Jan 2023 09:41:45 -0800 Message-ID: Subject: Re: [PATCH] configure: remove dependencies on gmp and mpfr when gdb is disabled To: =?UTF-8?Q?Cl=C3=A9ment_Chigot?= Cc: binutils@sourceware.org, nickc@redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Tue, Jan 3, 2023 at 5:53 AM Cl=C3=A9ment Chigot wro= te: > > Since 991180627851801f1999d1ebbc0e569a17e47c74, the configure checks > about GMP and MPFR for gdb builds have been moved to the toplevel > configure. > However, it doesn't take into account the --disable-gdb option. Meaning > that a build without gdb will require these libraries even if not > needed. I see the conversion of enable_gdb to noconfigdirs is not done until later or I would have suggested the patch below. Though I wonder if we should rearrange configure.ac but maybe that is post GCC 13 branching off. Thanks, Andrew Pinski diff --git a/configure.ac b/configure.ac index 3a1eb0357e5..cbfc21eb2e9 100644 --- a/configure.ac +++ b/configure.ac @@ -1585,7 +1585,9 @@ if test -d ${srcdir}/gcc ; then require_mpc=3Dyes fi if test -d ${srcdir}/gdb ; then - require_gmp=3Dyes + case "${noconfigdirs}" in + *gdb*) require_gmp=3Dyes ;; + esac fi gmplibs=3D"-lmpfr -lgmp" > > ChangeLog: > > * configure.ac: Skip GMP and MPFR errors when --disable-gdb is > provided. > * configure: Regenerate. > --- > configure | 4 +++- > configure.ac | 4 +++- > 2 files changed, 6 insertions(+), 2 deletions(-) > > diff --git a/configure b/configure > index 417fc5a970c..0fb8279cb8f 100755 > --- a/configure > +++ b/configure > @@ -8426,11 +8426,13 @@ you obtained GMP, MPFR and/or MPC from a vendor d= istribution package, > make sure that you have installed both the libraries and the header > files. They may be located in separate packages." "$LINENO" 5 > else > - as_fn_error $? "Building GDB requires GMP 4.2+, and MPFR 3.1.0+. > + if test "x$enable_gdb" !=3D xno; then > + as_fn_error $? "Building GDB requires GMP 4.2+, and MPFR 3.1.0+. > Try the --with-gmp and/or --with-mpfr options to specify > their locations. If you obtained GMP and/or MPFR from a vendor > distribution package, make sure that you have installed both the librari= es > and the header files. They may be located in separate packages." "$LINE= NO" 5 > + fi > fi > fi > fi > diff --git a/configure.ac b/configure.ac > index 3a1eb0357e5..0ec2fffcb56 100644 > --- a/configure.ac > +++ b/configure.ac > @@ -1814,11 +1814,13 @@ you obtained GMP, MPFR and/or MPC from a vendor d= istribution package, > make sure that you have installed both the libraries and the header > files. They may be located in separate packages.]) > else > - AC_MSG_ERROR([Building GDB requires GMP 4.2+, and MPFR 3.1.0+. > + if test "x$enable_gdb" !=3D xno; then > + AC_MSG_ERROR([Building GDB requires GMP 4.2+, and MPFR 3.1.0+. > Try the --with-gmp and/or --with-mpfr options to specify > their locations. If you obtained GMP and/or MPFR from a vendor > distribution package, make sure that you have installed both the librari= es > and the header files. They may be located in separate packages.]) > + fi > fi > fi > fi > -- > 2.25.1 >