Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gpPjJ-0003M3-9r for pgsql-hackers@arkaria.postgresql.org; Fri, 01 Feb 2019 03:43:02 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gpPjF-0002s6-Jj for pgsql-hackers@arkaria.postgresql.org; Fri, 01 Feb 2019 03:42:57 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gpPjD-0002ry-Qi for pgsql-hackers@lists.postgresql.org; Fri, 01 Feb 2019 03:42:57 +0000 Received: from wout2-smtp.messagingengine.com ([64.147.123.25]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gpPj4-0001xn-9s for pgsql-hackers@postgresql.org; Fri, 01 Feb 2019 03:42:54 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 2B8F72E0E; Thu, 31 Jan 2019 22:42:43 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Thu, 31 Jan 2019 22:42:43 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm3; bh=XsvUdjMsUqBZghUutjz0O9btr+D 7XmorcJSG9R3KxGk=; b=yTZ4WiL3Hop0PLYN9ykNqGQj7VJnA5SOAx90bk5AADj D3tziziWkfHD6NvzvPlZhcpsNfkCHMCtNQrWppfB1N78drNOmcfNKho1Vlrbnc8W qkEFCVGJ0qL5ZcXT6Tjw7ajQtGaaCZZWvUcE6KmZYWrxdOboOEzqRirAYTDs5MLm DoclRJWwb9rXFVoMz7He8ocCRaDjEQI5uq6nXoE1uZmF8gEPt24L3Ed286oJAdpb 81WKoZes/6ES6IocuZGwhUCWbbftHtPZ69bfhUFyrDqG1DkdOg1rXW1I17L5cPWS Ob7NuYp5GBKlBCJNFVvSRc0lonkDTY+7RRJnuf2NHdw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=XsvUdj MsUqBZghUutjz0O9btr+D7XmorcJSG9R3KxGk=; b=SQDOHQRu5dfpTCZSE5GsWr 7GyBpTTKkvg8CE5ZfO+EUVKjARRSk/SdBMAA8/3WiqNxSeJUP+tc0/O2AAi+4ubL CB+6p85D7FB30L0mPfPIvC3yhej/jgyfutZ1vmasRNJ+qLN7My4+oPuiUgnSX8X+ vatl/C2CbAm9VA1GnaPdtTM/P1YXz3l64ylX/LiV0Bv2HodRE1D7y7esHGsiFbYh khUZpKdboUnaOm5RAXpPjDjykhbkZMQJvPccy1BQ5bw0hood2CG41/9yhzoeOX7u zyY4xgMe5x7C/7NjfGf61CQ8rnrshuTLXWzoN/swXMbv63DQYei5F1plMW9TQk2Q == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedtledrjeejgdeivdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfhuthenuceurghilhhouhhtmecufedt tdenucesvcftvggtihhpihgvnhhtshculddquddttddmnegfrhhlucfvnfffucdljedtmd enucfjughrpeffhffvuffkfhggtggujgesghdtreertddtvdenucfhrhhomhepofhitghh rggvlhcurfgrqhhuihgvrhcuoehmihgthhgrvghlsehprghquhhivghrrdighiiiqeenuc fkphepiedurddvudehrddufeejrdduiedvnecurfgrrhgrmhepmhgrihhlfhhrohhmpehm ihgthhgrvghlsehprghquhhivghrrdighiiinecuvehluhhsthgvrhfuihiivgeptd X-ME-Proxy: Received: from paquier.xyz (c137162.net61215.cablenet.ne.jp [61.215.137.162]) by mail.messagingengine.com (Postfix) with ESMTPA id 510DBE409E; Thu, 31 Jan 2019 22:42:39 -0500 (EST) Date: Fri, 1 Feb 2019 12:42:36 +0900 From: Michael Paquier To: Tom Lane Cc: Christoph Berg , Andres Freund , Alvaro Herrera , Peter Eisentraut , PostgreSQL Hackers Subject: Re: [PATCH] Pass COPT and PROFILE to CXXFLAGS as well Message-ID: <20190201034236.GG2179@paquier.xyz> References: <20190122201923.3iaz7lxs3ckibzwo@alap3.anarazel.de> <201901222111.ki5n27j2e5cf@alvherre.pgsql> <20190123004722.GE3873@paquier.xyz> <20190129151846.GI9860@msg.credativ.de> <20190130015127.hciz36lpmu7prrx2@alap3.anarazel.de> <20190130134100.GD4383@msg.credativ.de> <20190131004451.GE16781@paquier.xyz> <17488.1548897511@sss.pgh.pa.us> <20190131021911.GG16781@paquier.xyz> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="Q6STzHxy03qt/hK9" Content-Disposition: inline In-Reply-To: <20190131021911.GG16781@paquier.xyz> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --Q6STzHxy03qt/hK9 Content-Type: multipart/mixed; boundary="O8XZ+2Hy8Kj8wLPZ" Content-Disposition: inline --O8XZ+2Hy8Kj8wLPZ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jan 31, 2019 at 11:19:11AM +0900, Michael Paquier wrote: > Ah yes, good point about CFLAGS and LDFLAGS. It would be better to > add a comment about that and document the difference, aka "prepend" or > "append" the flag values. >=20 > CXXFLAGS applies to compiler options like -g -O2 which you would like > to enforce for the C++ compiler, so it seems to me that like CFLAGS > the custom values should be added at the end and not at the beginning, > no? Attached is a patch doing that. Thoughts? -- Michael --O8XZ+2Hy8Kj8wLPZ Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="pgxs-add-flags-michael.patch" Content-Transfer-Encoding: quoted-printable diff --git a/doc/src/sgml/extend.sgml b/doc/src/sgml/extend.sgml index a6b77c1cfe..b5e59d542a 100644 --- a/doc/src/sgml/extend.sgml +++ b/doc/src/sgml/extend.sgml @@ -1353,7 +1353,34 @@ include $(PGXS) PG_CPPFLAGS - will be added to CPPFLAGS + will be prepended to CPPFLAGS + + + + + + PG_CFLAGS + + + will be appended to CFLAGS + + + + + + PG_CXXFLAGS + + + will be appended to CXXFLAGS + + + + + + PG_LDFLAGS + + + will be prepended to LDFLAGS diff --git a/src/makefiles/pgxs.mk b/src/makefiles/pgxs.mk index d214cb9cf2..909a49f5be 100644 --- a/src/makefiles/pgxs.mk +++ b/src/makefiles/pgxs.mk @@ -52,7 +52,10 @@ # NO_INSTALLCHECK -- don't define an installcheck target, useful e.g. if # tests require special configuration, or don't use pg_regress # EXTRA_CLEAN -- extra files to remove in 'make clean' -# PG_CPPFLAGS -- will be added to CPPFLAGS +# PG_CPPFLAGS -- will be prepended to CPPFLAGS +# PG_CFLAGS -- will be appended to CFLAGS +# PG_CXXFLAGS -- will be appended to CXXFLAGS +# PG_LDFLAGS -- will be prepended to LDFLAGS # PG_LIBS -- will be added to PROGRAM link line # PG_LIBS_INTERNAL -- same, for references to libraries within build tree # SHLIB_LINK -- will be added to MODULE_big link line @@ -119,6 +122,15 @@ endif ifdef PG_CPPFLAGS override CPPFLAGS :=3D $(PG_CPPFLAGS) $(CPPFLAGS) endif +ifdef PG_CFLAGS +override CFLAGS :=3D $(CFLAGS) $(PG_CFLAGS) +endif +ifdef PG_CXXFLAGS +override CXXFLAGS :=3D $(CXXFLAGS) $(PG_CXXFLAGS) +endif +ifdef PG_LDFLAGS +override LDFLAGS :=3D $(PG_LDFLAGS) $(LDFLAGS) +endif =20 # logic for HEADERS_* stuff =20 --O8XZ+2Hy8Kj8wLPZ-- --Q6STzHxy03qt/hK9 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAlxTwCwACgkQnvQgOdby QH1ArQ//XPxD2EhAUBnNrDmWd/7IIpzVcxM+nIsXAKx0U32AodkmceXVtt6KP5DU 7qb0X9kHyIaNkOc0JtqoJbhxblWa0euiqBxfqXgr2vZ2UlpnKej7meeLUxFgw+J5 XXgoevXcIjNq5mge6samqes1lBBdQgh/QpnMwYYomjwrs/IY61YRm6c/i7xtGo6H MFiX7q7fQY3vXUxVK+IUUJphrAanY8cPEnGBGC4x6YnF0JuMtXXl7kCE1McOJ5Er T2yTfTuEqUeITM8Nc9JK54pBzHQg8HmcEjLIHGbY/bMTr5N4H/VjOUFhhf+TF436 bAwMOtoFpqruH7PvJ05T935jt+pJc9LjwiypYSwr9S3Zbxfe7v5fJGmEbsxP3Sbr jc7XPZTxIpDmHTrb7NFgjnuUtBGjqNq1WrgHMr3oc62AXiILQqDuhUjKz6YD+Fi5 1VgjhkdcXgEOzrlcvGRdO35Rp60+JI2tXxeFKY0XH2yldfq27CfplL0KFDglP0rT tDF3PnYWeZv/HSn57Oy8fIAmyzojFF4e91e2wLeGedZIaNS7yFRmkpKxrRX5Z8XQ gNerB+we0blXHXny9ySXoZKkEbXsHk/trOiIVY9sxcO6YTRFDulurrgukEGg+ffn zt5kY//NT4WM6zK2vLZw7qXQDvEdH4zzLUQs5Fv3DmGlyOWRDSg= =DBWw -----END PGP SIGNATURE----- --Q6STzHxy03qt/hK9--