From unknown Tue Jun 17 01:42:21 2025 X-Loop: help-debbugs@gnu.org Subject: bug#35526: misleading documentation about flag variable ordering Resent-From: Daniel Kahn Gillmor Original-Sender: "Debbugs-submit" Resent-CC: bug-automake@gnu.org Resent-Date: Wed, 01 May 2019 17:34:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 35526 X-GNU-PR-Package: automake X-GNU-PR-Keywords: To: 35526@debbugs.gnu.org X-Debbugs-Original-To: bug-automake@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.15567320179360 (code B ref -1); Wed, 01 May 2019 17:34:01 +0000 Received: (at submit) by debbugs.gnu.org; 1 May 2019 17:33:37 +0000 Received: from localhost ([127.0.0.1]:44805 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hLt6v-0002Qu-52 for submit@debbugs.gnu.org; Wed, 01 May 2019 13:33:37 -0400 Received: from eggs.gnu.org ([209.51.188.92]:51268) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hLt6s-0002Qg-I4 for submit@debbugs.gnu.org; Wed, 01 May 2019 13:33:35 -0400 Received: from lists.gnu.org ([209.51.188.17]:51891) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hLt6m-0000TX-OB for submit@debbugs.gnu.org; Wed, 01 May 2019 13:33:29 -0400 Received: from eggs.gnu.org ([209.51.188.92]:37415) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hLt6l-0002Sx-Jm for bug-automake@gnu.org; Wed, 01 May 2019 13:33:28 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=BAYES_40,URIBL_BLOCKED autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hLt6j-0000OY-N7 for bug-automake@gnu.org; Wed, 01 May 2019 13:33:27 -0400 Received: from che.mayfirst.org ([2001:470:1:116::7]:32938) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hLt6h-0000Fh-49 for bug-automake@gnu.org; Wed, 01 May 2019 13:33:23 -0400 DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/simple; d=fifthhorseman.net; i=@fifthhorseman.net; q=dns/txt; s=2019; t=1556731999; h=from : to : subject : date : message-id : mime-version : content-type : from; bh=EEadGMITB4KRBvf/Gd9rrQyWznr2anJ6EExhKaJHys8=; b=TEand1458fNMB522huPH+l6FLBBSHAAX/lnE4rSUKiHaQ5LqNVEKmKN/ rkmsmKD9mKjANxl40lynY7V0OWwFCg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=fifthhorseman.net; i=@fifthhorseman.net; q=dns/txt; s=2019rsa; t=1556731999; h=from : to : subject : date : message-id : mime-version : content-type : from; bh=EEadGMITB4KRBvf/Gd9rrQyWznr2anJ6EExhKaJHys8=; b=Fu67tQ6NtdIpORwzEABve1ce8K8SxRL91qmr1WvTSyO2kJWCd5DLgOP2 TUX5fYb9FUS+71pi08SGA3KUaK0B1I+aklJzSwLGTJrBYrn75Q3LpxUvGj McWa9JP9hFBQyAu/+B7FiuRwfJgmXzw+GZaAHZIx50ySBa0z1UgGdm4SOU byECqRUISFv3H7xbA04XrsUkR84g9abxzlvkmLZEXcYX97K521I5kczMiK OE4QoXC4hBlEu7S2XXwFySbGY09RFy5crNfs7ekK4AqFg0oyt29IVRCZPW kykHRNnx9v/uvaYKliHRG5Xc71uTC3YuhWIEYLFAzVk3UkCop5KctA== Received: from fifthhorseman.net (unknown [38.109.115.130]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by che.mayfirst.org (Postfix) with ESMTPSA id 59B74F99E for ; Wed, 1 May 2019 13:33:18 -0400 (EDT) Received: by fifthhorseman.net (Postfix, from userid 1000) id 9FB7C2058F; Wed, 1 May 2019 13:33:16 -0400 (EDT) From: Daniel Kahn Gillmor Autocrypt: addr=dkg@fifthhorseman.net; prefer-encrypt=mutual; keydata= mDMEXEK/AhYJKwYBBAHaRw8BAQdAr/gSROcn+6m8ijTN0DV9AahoHGafy52RRkhCZVwxhEe0K0Rh bmllbCBLYWhuIEdpbGxtb3IgPGRrZ0BmaWZ0aGhvcnNlbWFuLm5ldD6ImQQTFggAQQIbAQUJA8Jn AAULCQgHAgYVCgkICwIEFgIDAQIeAQIXgBYhBMS8Lds4zOlkhevpwvIGkReQOOXGBQJcQsbzAhkB AAoJEPIGkReQOOXG4fkBAO1joRxqAZY57PjdzGieXLpluk9RkWa3ufkt3YUVEpH/AP9c+pgIxtyW +FwMQRjlqljuj8amdN4zuEqaCy4hhz/1DbgzBFxCv4sWCSsGAQQB2kcPAQEHQERSZxSPmgtdw6nN u7uxY7bzb9TnPrGAOp9kClBLRwGfiPUEGBYIACYWIQTEvC3bOMzpZIXr6cLyBpEXkDjlxgUCXEK/ iwIbAgUJAeEzgACBCRDyBpEXkDjlxnYgBBkWCAAdFiEEyQ5tNiAKG5IqFQnndhgZZSmuX/gFAlxC v4sACgkQdhgZZSmuX/iVWgD/fCU4ONzgy8w8UCHGmrmIZfDvdhg512NIBfx+Mz9ls5kA/Rq97vz4 z48MFuBdCuu0W/fVqVjnY7LN5n+CQJwGC0MIA7QA/RyY7Sz2gFIOcrns0RpoHr+3WI+won3xCD8+ sVXSHZvCAP98HCjDnw/b0lGuCR7coTXKLIM44/LFWgXAdZjm1wjODbg4BFxCv50SCisGAQQBl1UB BQEBB0BG4iXnHX/fs35NWKMWQTQoRI7oiAUt0wJHFFJbomxXbAMBCAeIfgQYFggAJhYhBMS8Lds4 zOlkhevpwvIGkReQOOXGBQJcQr+dAhsMBQkB4TOAAAoJEPIGkReQOOXGe/cBAPlek5d9xzcXUn/D kY6jKmxe26CTws3ZkbK6Aa5Ey/qKAP0VuPQSCRxA7RKfcB/XrEphfUFkraL06Xn/xGwJ+D0hCw== Date: Wed, 01 May 2019 13:33:16 -0400 Message-ID: <87zho6ozab.fsf@fifthhorseman.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:470:1:116::7 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Spam-Score: -1.3 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable https://www.gnu.org/software/automake/manual/automake.html#Flag-Variables-O= rdering says: The reason =E2=80=98$(CPPFLAGS)=E2=80=99 appears after =E2=80=98$(AM_CP= PFLAGS)=E2=80=99 or =E2=80=98$(mumble_CPPFLAGS)=E2=80=99 in the compile command is that use= rs should always have the last say. The implication here is that for any of the *FLAGS variables, later options are inherently more effective than earlier options. This is not the case universally. For example -Wl,--as-needed is more effective if it shows up earlier in the command line. (see https://bugs.debian.org/347650 for a libtool-related problem for that kind of ordering/re-ordering) It would be good if the documentation could avoid implying something that isn't the case, because that dubious suggestion casts doubt on the rest of the documentation (or on the user's understanding of the rest of the buildsystem) thanks for maintaining automake! --dkg --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEARYKAB0WIQTJDm02IAobkioVCed2GBllKa5f+AUCXMnYXAAKCRB2GBllKa5f +EN/AP9qJghwHrH97nFnNrn3aZkdzdgxmWQ/jwNa6ewpGLr8cwD9GypJ+1/Jyueb nIlUkA2p/eDshKnpy9+LYj5PmdIOfQQ= =8tda -----END PGP SIGNATURE----- --=-=-=-- From unknown Tue Jun 17 01:42:21 2025 X-Loop: help-debbugs@gnu.org Subject: bug#35526: misleading documentation about flag variable ordering Resent-From: Nick Bowler Original-Sender: "Debbugs-submit" Resent-CC: bug-automake@gnu.org Resent-Date: Wed, 01 May 2019 18:29:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 35526 X-GNU-PR-Package: automake X-GNU-PR-Keywords: To: Daniel Kahn Gillmor Cc: 35526@debbugs.gnu.org Received: via spool by 35526-submit@debbugs.gnu.org id=B35526.155673529014663 (code B ref 35526); Wed, 01 May 2019 18:29:01 +0000 Received: (at 35526) by debbugs.gnu.org; 1 May 2019 18:28:10 +0000 Received: from localhost ([127.0.0.1]:44887 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hLtxi-0003oQ-G2 for submit@debbugs.gnu.org; Wed, 01 May 2019 14:28:10 -0400 Received: from mail-lj1-f195.google.com ([209.85.208.195]:41833) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hLtxg-0003oD-Dj for 35526@debbugs.gnu.org; Wed, 01 May 2019 14:28:09 -0400 Received: by mail-lj1-f195.google.com with SMTP id k8so16165074lja.8 for <35526@debbugs.gnu.org>; Wed, 01 May 2019 11:28:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=draconx-ca.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=92W+/PRUThQ0FE9IuXO27FyW+1E30zxrzMFm6Tm03Zs=; b=jTRgu8nYa8fn/G/n6RUILDFWlUAcp1PRLSt6eAxrYlVydDEsAif6cDFJLY+CX9/5S0 ewV2wW1zXGoyN+zO3lWqf07YIAMm9uZrtjWKZ9QMS/A2eY8gdaIuDxazFC9PzNJal2u/ vJrJ8zzeOWsRHfbVmmfliRGK5YjiTD6R26iryiVoH7LGPMm5OyT3iKdoOeelPCfb4Obt m7qgXKfhhQ97feMvcgSZGbSVXnCzw05oqdeCdkhbtwzGirXCeOJUQdxC5HNvTQAuKFuo SiqN8Yuh2A9SGzT8gSmTeBYZyAJdsib5nlCC/WvJDuMq3jZT43X/QBceVvcBMBNwoQaF rAbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=92W+/PRUThQ0FE9IuXO27FyW+1E30zxrzMFm6Tm03Zs=; b=bj+MhVJU1lEp2WQx1cKQtO9/LeJZ8ey1lu7sw9RAHhhVsJLinhEYvvKavTwzsJ1m6g r6ie9Styl/JSRdPAZGrx2hmJsZpz9crI8EY/5e7OVNESl1pWnlymAgtySnEVfGnAMny0 if3ycWYb0HUu/JKFWxc17jtlMEezqgHmV0Ej25YZF7ORe93gM0iHYwi3evdK00NuheLr 2ImkYXKCK8vHo+z2iGsEjRGfPXNin0a3l6WxGk/Afr083Heclm9rpZGkMW1fGUirb8zx sC8uYqxzt8XIwZSK9lB1aoPu0Qu6we7ENje5YjaIe18a8xslfXxxeUHVjrOk24tHDYRg XxHg== X-Gm-Message-State: APjAAAXduBblwkT7DjmQCpNSxbUkW7zZJtLlBrcg/DvPkBJsn/76e6Yj yDqKA6qep/JKVGMPyBug5CAsBcKpLFw9Lic6kBMtfxb/1A1QVw== X-Google-Smtp-Source: APXvYqxbWBUwSlvMTTXoSN8Ektbgw356NjK/qIod4//EGjHFNDjJYZQMt+C/pDno5u0PI8p+tGfbBFmaE/13Cys3RFs= X-Received: by 2002:a2e:7605:: with SMTP id r5mr1122595ljc.109.1556735282364; Wed, 01 May 2019 11:28:02 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a2e:455:0:0:0:0:0 with HTTP; Wed, 1 May 2019 11:28:01 -0700 (PDT) X-Originating-IP: [162.243.96.244] In-Reply-To: <87zho6ozab.fsf@fifthhorseman.net> References: <87zho6ozab.fsf@fifthhorseman.net> From: Nick Bowler Date: Wed, 1 May 2019 14:28:01 -0400 Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On 5/1/19, Daniel Kahn Gillmor wrote: > https://www.gnu.org/software/automake/manual/automake.html#Flag-Variables= -Ordering > says: > > The reason =E2=80=98$(CPPFLAGS)=E2=80=99 appears after =E2=80=98$(AM_= CPPFLAGS)=E2=80=99 or > =E2=80=98$(mumble_CPPFLAGS)=E2=80=99 in the compile command is that u= sers should > always have the last say. > > The implication here is that for any of the *FLAGS variables, later > options are inherently more effective than earlier options. > > This is not the case universally. For example -Wl,--as-needed is more > effective if it shows up earlier in the command line. (see > https://bugs.debian.org/347650 for a libtool-related problem for that > kind of ordering/re-ordering) It's still mostly true, and it really is more about turning off options that may be turned on by the package but the user does not want. Even in the case of --as-needed, if the package had AM_LDFLAGS =3D -Wl,--as-need= ed the user could (in principle) cancel it with LDFLAGS =3D -Wl,--no-as-needed= , since the user flags appear later. If these were reversed then the package option would override anything the user tried to do. But it is true that this is not universal. Not every compiler option has a way to cancel its effect later on the command line. In the case of CPPFLAGS, -I options are an example where later options are in some sense "less effective" than earlier options. But on the other hand, -D options are commonly placed in CPPFLAGS and in that case their effects can be canceled and/or changed by later options. Since all the user-provided flags are lumped together in a single variable they have to go _somewhere_ as a unit, and convention puts them after the corresponding package-set flags, so compilation commands look something like: cc \ and linking (when the C compiler is used for linking) looks like: cc \ (Note that the convention puts LDFLAGS before libraries so things like LDFLAGS=3D-Wl,--as-needed _should_ work as expected, libtool issues notwithstanding). Obviously this scheme is not perfect in every possible scenario, but the only way to handle every possible scenario is probably to have the user to write all the compiler commands manually, in which case there is no point in having a build system. > It would be good if the documentation could avoid implying something > that isn't the case, because that dubious suggestion casts doubt on the > rest of the documentation (or on the user's understanding of the rest of > the buildsystem) The manual can always be improved. Do you have a suggestion for how to write this paragraph to make it better? Cheers, Nick From unknown Tue Jun 17 01:42:21 2025 X-Loop: help-debbugs@gnu.org Subject: bug#35526: misleading documentation about flag variable ordering Resent-From: Daniel Kahn Gillmor Original-Sender: "Debbugs-submit" Resent-CC: bug-automake@gnu.org Resent-Date: Wed, 01 May 2019 18:42:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 35526 X-GNU-PR-Package: automake X-GNU-PR-Keywords: To: Nick Bowler Cc: 35526@debbugs.gnu.org Received: via spool by 35526-submit@debbugs.gnu.org id=B35526.155673610215871 (code B ref 35526); Wed, 01 May 2019 18:42:01 +0000 Received: (at 35526) by debbugs.gnu.org; 1 May 2019 18:41:42 +0000 Received: from localhost ([127.0.0.1]:44900 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hLuAn-00047v-St for submit@debbugs.gnu.org; Wed, 01 May 2019 14:41:42 -0400 Received: from che.mayfirst.org ([162.247.75.118]:56479) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hLuAm-00047n-A6 for 35526@debbugs.gnu.org; Wed, 01 May 2019 14:41:40 -0400 DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/simple; d=fifthhorseman.net; i=@fifthhorseman.net; q=dns/txt; s=2019; t=1556736099; h=from : to : cc : subject : in-reply-to : references : date : message-id : mime-version : content-type : content-transfer-encoding : from; bh=846HTacGmvQGEPlHWOTvSsd55s0+KWUYrntwuYQAmrA=; b=0/eURIn1C5SYcYEZxCOZrUFMB9Y4sLTn7DbxiTzreVJQaTDqnchVhqpD QC2EKLFn9hPQb4ueVhzZxxOGNkFhCw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=fifthhorseman.net; i=@fifthhorseman.net; q=dns/txt; s=2019rsa; t=1556736098; h=from : to : cc : subject : in-reply-to : references : date : message-id : mime-version : content-type : content-transfer-encoding : from; bh=846HTacGmvQGEPlHWOTvSsd55s0+KWUYrntwuYQAmrA=; b=rwf1JHY930T6F3zxZuCp10xisU4FPm9ETOruG6IBfnJG8I2JGT5HNO6v d+GlVsMZFvgO/GJFm3F4IVKPRibHyZldghzvnNOQuwIxRs0Kgs269UEKDn /XFx7Qj+XNBsumeyr3FIhFZzIp34I/AfYLjL/vDfmPNGZQpdjl/VfFCJGO aSzZabDuUpTFfjlExxe2s1LUA4Ks9BK5uizN3+3o/4X2IwhMSTjcAVk9q1 r/aa5KApO4TCkBloi6q50mefAbOWSTv/rSznqRJ0/x8jQ+YXkJG3icb5xr GxN/x8F1app1yQhc/RZcko0sew0EZCt9BPkogq2ZnOr9Sa/pYT1XWQ== Received: from fifthhorseman.net (unknown [38.109.115.130]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by che.mayfirst.org (Postfix) with ESMTPSA id D9D33F99E; Wed, 1 May 2019 14:41:38 -0400 (EDT) Received: by fifthhorseman.net (Postfix, from userid 1000) id 21252202A1; Wed, 1 May 2019 14:40:45 -0400 (EDT) From: Daniel Kahn Gillmor In-Reply-To: References: <87zho6ozab.fsf@fifthhorseman.net> Autocrypt: addr=dkg@fifthhorseman.net; prefer-encrypt=mutual; keydata= mDMEXEK/AhYJKwYBBAHaRw8BAQdAr/gSROcn+6m8ijTN0DV9AahoHGafy52RRkhCZVwxhEe0K0Rh bmllbCBLYWhuIEdpbGxtb3IgPGRrZ0BmaWZ0aGhvcnNlbWFuLm5ldD6ImQQTFggAQQIbAQUJA8Jn AAULCQgHAgYVCgkICwIEFgIDAQIeAQIXgBYhBMS8Lds4zOlkhevpwvIGkReQOOXGBQJcQsbzAhkB AAoJEPIGkReQOOXG4fkBAO1joRxqAZY57PjdzGieXLpluk9RkWa3ufkt3YUVEpH/AP9c+pgIxtyW +FwMQRjlqljuj8amdN4zuEqaCy4hhz/1DbgzBFxCv4sWCSsGAQQB2kcPAQEHQERSZxSPmgtdw6nN u7uxY7bzb9TnPrGAOp9kClBLRwGfiPUEGBYIACYWIQTEvC3bOMzpZIXr6cLyBpEXkDjlxgUCXEK/ iwIbAgUJAeEzgACBCRDyBpEXkDjlxnYgBBkWCAAdFiEEyQ5tNiAKG5IqFQnndhgZZSmuX/gFAlxC v4sACgkQdhgZZSmuX/iVWgD/fCU4ONzgy8w8UCHGmrmIZfDvdhg512NIBfx+Mz9ls5kA/Rq97vz4 z48MFuBdCuu0W/fVqVjnY7LN5n+CQJwGC0MIA7QA/RyY7Sz2gFIOcrns0RpoHr+3WI+won3xCD8+ sVXSHZvCAP98HCjDnw/b0lGuCR7coTXKLIM44/LFWgXAdZjm1wjODbg4BFxCv50SCisGAQQBl1UB BQEBB0BG4iXnHX/fs35NWKMWQTQoRI7oiAUt0wJHFFJbomxXbAMBCAeIfgQYFggAJhYhBMS8Lds4 zOlkhevpwvIGkReQOOXGBQJcQr+dAhsMBQkB4TOAAAoJEPIGkReQOOXGe/cBAPlek5d9xzcXUn/D kY6jKmxe26CTws3ZkbK6Aa5Ey/qKAP0VuPQSCRxA7RKfcB/XrEphfUFkraL06Xn/xGwJ+D0hCw== Date: Wed, 01 May 2019 14:40:44 -0400 Message-ID: <87o94mow5v.fsf@fifthhorseman.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On Wed 2019-05-01 14:28:01 -0400, Nick Bowler wrote: > On 5/1/19, Daniel Kahn Gillmor wrote: >> https://www.gnu.org/software/automake/manual/automake.html#Flag-Variables-Ordering >> says: >> >> The reason ‘$(CPPFLAGS)’ appears after ‘$(AM_CPPFLAGS)’ or >> ‘$(mumble_CPPFLAGS)’ in the compile command is that users should >> always have the last say. […] > The manual can always be improved. Do you have a suggestion for how to > write this paragraph to make it better? maybe replace "users should always have the last say." with: most configuration options for the standard toolchain can be overridden later on the command line, and in those circumstances the user should have the last say. (including some of the nuance you've written upthread here or elsewhere in the manual would be great too) Thanks for the prompt and thoughtful rsponse! --dg From unknown Tue Jun 17 01:42:21 2025 X-Loop: help-debbugs@gnu.org Subject: bug#35526: misleading documentation about flag variable ordering References: <87zho6ozab.fsf@fifthhorseman.net> Resent-From: Karl Berry Original-Sender: "Debbugs-submit" Resent-CC: bug-automake@gnu.org Resent-Date: Wed, 10 Feb 2021 02:24:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 35526 X-GNU-PR-Package: automake X-GNU-PR-Keywords: To: dkg@fifthhorseman.net Cc: 35526@debbugs.gnu.org Received: via spool by 35526-submit@debbugs.gnu.org id=B35526.161292380117578 (code B ref 35526); Wed, 10 Feb 2021 02:24:02 +0000 Received: (at 35526) by debbugs.gnu.org; 10 Feb 2021 02:23:21 +0000 Received: from localhost ([127.0.0.1]:55249 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l9fA0-0004ZS-P8 for submit@debbugs.gnu.org; Tue, 09 Feb 2021 21:23:21 -0500 Received: from freefriends.org ([96.88.95.60]:42056) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l9f9w-0004ZH-63 for 35526@debbugs.gnu.org; Tue, 09 Feb 2021 21:23:19 -0500 X-Envelope-From: karl@freefriends.org Received: from freefriends.org (freefriends.org [96.88.95.60]) by freefriends.org (8.14.7/8.14.7) with ESMTP id 11A2NENH029404 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 9 Feb 2021 19:23:15 -0700 Received: (from apache@localhost) by freefriends.org (8.14.7/8.14.7/Submit) id 11A2NDNa029403; Tue, 9 Feb 2021 19:23:13 -0700 Date: Tue, 9 Feb 2021 19:23:13 -0700 Message-Id: <202102100223.11A2NDNa029403@freefriends.org> From: Karl Berry In-Reply-To: <87zho6ozab.fsf@fifthhorseman.net> X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Back on this bug from May 2019 (https://bugs.gnu.org/35526). Sorry for the delay. The implication here is that for any of the *FLAGS variables, later options are inherently more effective than earlier options. This is not the case universally. Granted. After reading the messages here, here's the change to the manual I came up with. If any comments before I commit it, let me know. Thanks. --karl --- a/doc/automake.texi +++ b/doc/automake.texi @@ -12491,16 +12491,21 @@ make @end example The reason @samp{$(CPPFLAGS)} appears after @samp{$(AM_CPPFLAGS)} or -@samp{$(mumble_CPPFLAGS)} in the compile command is that users -should always have the last say. It probably makes more sense if you -think about it while looking at the @samp{CXXFLAGS=-O0} above, which -should supersede any other switch from @code{AM_CXXFLAGS} or -@code{mumble_CXXFLAGS} (and this of course replaces the previous value -of @code{CXXFLAGS}). - -You should never redefine a user variable such as @code{CPPFLAGS} in -@file{Makefile.am}. Use @samp{automake -Woverride} to diagnose such -mistakes. Even something like +@samp{$(mumble_CPPFLAGS)} in the compile command is that users should +have the last say. In the example above, the desire is for the +@samp{CXXFLAGS=-O0} to supersede any other switch from +@code{AM_CXXFLAGS} or @code{mumble_CXXFLAGS}. + +@c https://bugs.gnu.org/35526 +It's true that not all options to all programs can be overridden. So +in general, users could conceivably want to place options at arbitrary +places in the command line, but Automake does not support this. It +would be difficult to make such generality comprehensible. Being able +to specify the final options commonly suffices. + +Thus, you should never redefine a user variable such as +@code{CPPFLAGS} in @file{Makefile.am}. Use @samp{automake -Woverride} +to diagnose such mistakes. Even something like @example CPPFLAGS = -DDATADIR=\"$(datadir)\" @@CPPFLAGS@@ compile finished at Tue Feb 9 18:20:52 2021 From unknown Tue Jun 17 01:42:21 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Daniel Kahn Gillmor Subject: bug#35526: closed () Message-ID: References: <202102122228.11CMSAQF020345@freefriends.org> <87zho6ozab.fsf@fifthhorseman.net> X-Gnu-PR-Message: they-closed 35526 X-Gnu-PR-Package: automake Reply-To: 35526@debbugs.gnu.org Date: Fri, 12 Feb 2021 22:29:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1613168942-12650-1" This is a multi-part message in MIME format... ------------=_1613168942-12650-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #35526: misleading documentation about flag variable ordering which was filed against the automake package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 35526@debbugs.gnu.org. --=20 35526: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D35526 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1613168942-12650-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 35526-done) by debbugs.gnu.org; 12 Feb 2021 22:28:16 +0000 Received: from localhost ([127.0.0.1]:33180 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lAgvA-0003H1-38 for submit@debbugs.gnu.org; Fri, 12 Feb 2021 17:28:16 -0500 Received: from freefriends.org ([96.88.95.60]:34442) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lAgv6-0003Go-TF for 35526-done@debbugs.gnu.org; Fri, 12 Feb 2021 17:28:14 -0500 X-Envelope-From: karl@freefriends.org X-Envelope-To: <35526-done@debbugs.gnu.org> Received: from freefriends.org (freefriends.org [96.88.95.60]) by freefriends.org (8.14.7/8.14.7) with ESMTP id 11CMSAVf020346 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for <35526-done@debbugs.gnu.org>; Fri, 12 Feb 2021 15:28:11 -0700 Received: (from apache@localhost) by freefriends.org (8.14.7/8.14.7/Submit) id 11CMSAQF020345; Fri, 12 Feb 2021 15:28:10 -0700 Date: Fri, 12 Feb 2021 15:28:10 -0700 Message-Id: <202102122228.11CMSAQF020345@freefriends.org> From: Karl Berry To: 35526-done@debbugs.gnu.org Subject: X-Spam-Score: 3.4 (+++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Content analysis details: (3.4 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [96.88.95.60 listed in list.dnswl.org] 2.0 BLANK_SUBJECT Subject is present but empty 2.3 EMPTY_MESSAGE Message appears to have no textual parts and no Subject: text 1.4 BODY_EMPTY No body text in message X-Debbugs-Envelope-To: 35526-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 2.4 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Content analysis details: (2.4 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [96.88.95.60 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager 2.0 BLANK_SUBJECT Subject is present but empty 2.3 EMPTY_MESSAGE Message appears to have no textual parts and no Subject: text 1.4 BODY_EMPTY No body text in message ------------=_1613168942-12650-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 1 May 2019 17:33:37 +0000 Received: from localhost ([127.0.0.1]:44805 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hLt6v-0002Qu-52 for submit@debbugs.gnu.org; Wed, 01 May 2019 13:33:37 -0400 Received: from eggs.gnu.org ([209.51.188.92]:51268) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hLt6s-0002Qg-I4 for submit@debbugs.gnu.org; Wed, 01 May 2019 13:33:35 -0400 Received: from lists.gnu.org ([209.51.188.17]:51891) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hLt6m-0000TX-OB for submit@debbugs.gnu.org; Wed, 01 May 2019 13:33:29 -0400 Received: from eggs.gnu.org ([209.51.188.92]:37415) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hLt6l-0002Sx-Jm for bug-automake@gnu.org; Wed, 01 May 2019 13:33:28 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=BAYES_40,URIBL_BLOCKED autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hLt6j-0000OY-N7 for bug-automake@gnu.org; Wed, 01 May 2019 13:33:27 -0400 Received: from che.mayfirst.org ([2001:470:1:116::7]:32938) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hLt6h-0000Fh-49 for bug-automake@gnu.org; Wed, 01 May 2019 13:33:23 -0400 DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/simple; d=fifthhorseman.net; i=@fifthhorseman.net; q=dns/txt; s=2019; t=1556731999; h=from : to : subject : date : message-id : mime-version : content-type : from; bh=EEadGMITB4KRBvf/Gd9rrQyWznr2anJ6EExhKaJHys8=; b=TEand1458fNMB522huPH+l6FLBBSHAAX/lnE4rSUKiHaQ5LqNVEKmKN/ rkmsmKD9mKjANxl40lynY7V0OWwFCg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=fifthhorseman.net; i=@fifthhorseman.net; q=dns/txt; s=2019rsa; t=1556731999; h=from : to : subject : date : message-id : mime-version : content-type : from; bh=EEadGMITB4KRBvf/Gd9rrQyWznr2anJ6EExhKaJHys8=; b=Fu67tQ6NtdIpORwzEABve1ce8K8SxRL91qmr1WvTSyO2kJWCd5DLgOP2 TUX5fYb9FUS+71pi08SGA3KUaK0B1I+aklJzSwLGTJrBYrn75Q3LpxUvGj McWa9JP9hFBQyAu/+B7FiuRwfJgmXzw+GZaAHZIx50ySBa0z1UgGdm4SOU byECqRUISFv3H7xbA04XrsUkR84g9abxzlvkmLZEXcYX97K521I5kczMiK OE4QoXC4hBlEu7S2XXwFySbGY09RFy5crNfs7ekK4AqFg0oyt29IVRCZPW kykHRNnx9v/uvaYKliHRG5Xc71uTC3YuhWIEYLFAzVk3UkCop5KctA== Received: from fifthhorseman.net (unknown [38.109.115.130]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by che.mayfirst.org (Postfix) with ESMTPSA id 59B74F99E for ; Wed, 1 May 2019 13:33:18 -0400 (EDT) Received: by fifthhorseman.net (Postfix, from userid 1000) id 9FB7C2058F; Wed, 1 May 2019 13:33:16 -0400 (EDT) From: Daniel Kahn Gillmor To: bug-automake@gnu.org Subject: misleading documentation about flag variable ordering Autocrypt: addr=dkg@fifthhorseman.net; prefer-encrypt=mutual; keydata= mDMEXEK/AhYJKwYBBAHaRw8BAQdAr/gSROcn+6m8ijTN0DV9AahoHGafy52RRkhCZVwxhEe0K0Rh bmllbCBLYWhuIEdpbGxtb3IgPGRrZ0BmaWZ0aGhvcnNlbWFuLm5ldD6ImQQTFggAQQIbAQUJA8Jn AAULCQgHAgYVCgkICwIEFgIDAQIeAQIXgBYhBMS8Lds4zOlkhevpwvIGkReQOOXGBQJcQsbzAhkB AAoJEPIGkReQOOXG4fkBAO1joRxqAZY57PjdzGieXLpluk9RkWa3ufkt3YUVEpH/AP9c+pgIxtyW +FwMQRjlqljuj8amdN4zuEqaCy4hhz/1DbgzBFxCv4sWCSsGAQQB2kcPAQEHQERSZxSPmgtdw6nN u7uxY7bzb9TnPrGAOp9kClBLRwGfiPUEGBYIACYWIQTEvC3bOMzpZIXr6cLyBpEXkDjlxgUCXEK/ iwIbAgUJAeEzgACBCRDyBpEXkDjlxnYgBBkWCAAdFiEEyQ5tNiAKG5IqFQnndhgZZSmuX/gFAlxC v4sACgkQdhgZZSmuX/iVWgD/fCU4ONzgy8w8UCHGmrmIZfDvdhg512NIBfx+Mz9ls5kA/Rq97vz4 z48MFuBdCuu0W/fVqVjnY7LN5n+CQJwGC0MIA7QA/RyY7Sz2gFIOcrns0RpoHr+3WI+won3xCD8+ sVXSHZvCAP98HCjDnw/b0lGuCR7coTXKLIM44/LFWgXAdZjm1wjODbg4BFxCv50SCisGAQQBl1UB BQEBB0BG4iXnHX/fs35NWKMWQTQoRI7oiAUt0wJHFFJbomxXbAMBCAeIfgQYFggAJhYhBMS8Lds4 zOlkhevpwvIGkReQOOXGBQJcQr+dAhsMBQkB4TOAAAoJEPIGkReQOOXGe/cBAPlek5d9xzcXUn/D kY6jKmxe26CTws3ZkbK6Aa5Ey/qKAP0VuPQSCRxA7RKfcB/XrEphfUFkraL06Xn/xGwJ+D0hCw== Date: Wed, 01 May 2019 13:33:16 -0400 Message-ID: <87zho6ozab.fsf@fifthhorseman.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:470:1:116::7 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable https://www.gnu.org/software/automake/manual/automake.html#Flag-Variables-O= rdering says: The reason =E2=80=98$(CPPFLAGS)=E2=80=99 appears after =E2=80=98$(AM_CP= PFLAGS)=E2=80=99 or =E2=80=98$(mumble_CPPFLAGS)=E2=80=99 in the compile command is that use= rs should always have the last say. The implication here is that for any of the *FLAGS variables, later options are inherently more effective than earlier options. This is not the case universally. For example -Wl,--as-needed is more effective if it shows up earlier in the command line. (see https://bugs.debian.org/347650 for a libtool-related problem for that kind of ordering/re-ordering) It would be good if the documentation could avoid implying something that isn't the case, because that dubious suggestion casts doubt on the rest of the documentation (or on the user's understanding of the rest of the buildsystem) thanks for maintaining automake! --dkg --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEARYKAB0WIQTJDm02IAobkioVCed2GBllKa5f+AUCXMnYXAAKCRB2GBllKa5f +EN/AP9qJghwHrH97nFnNrn3aZkdzdgxmWQ/jwNa6ewpGLr8cwD9GypJ+1/Jyueb nIlUkA2p/eDshKnpy9+LYj5PmdIOfQQ= =8tda -----END PGP SIGNATURE----- --=-=-=-- ------------=_1613168942-12650-1--