From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1OJnpW-0002Dt-Fa for garchives@archives.gentoo.org; Wed, 02 Jun 2010 13:17:58 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 24A58E0E62; Wed, 2 Jun 2010 13:17:54 +0000 (UTC) Received: from mail-fx0-f53.google.com (mail-fx0-f53.google.com [209.85.161.53]) by pigeon.gentoo.org (Postfix) with ESMTP id A946FE0B1D for ; Wed, 2 Jun 2010 13:17:38 +0000 (UTC) Received: by fxm2 with SMTP id 2so1097936fxm.40 for ; Wed, 02 Jun 2010 06:17:38 -0700 (PDT) Received: by 10.223.92.136 with SMTP id r8mr8656454fam.40.1275484649053; Wed, 02 Jun 2010 06:17:29 -0700 (PDT) Received: from pomiocik.lan (77-254-181-19.adsl.inetia.pl [77.254.181.19]) by mx.google.com with ESMTPS id z12sm52262634fah.21.2010.06.02.06.17.25 (version=SSLv3 cipher=RC4-MD5); Wed, 02 Jun 2010 06:17:26 -0700 (PDT) Sender: Spam Box Date: Wed, 2 Jun 2010 15:17:00 +0200 From: =?UTF-8?B?TWljaGHFgiBHw7Nybnk=?= To: gentoo-dev@lists.gentoo.org Subject: Re: [gentoo-dev] [RFC] toolchain-funcs.eclass: functions to call compiler Message-ID: <20100602151700.6e367219@pomiocik.lan> In-Reply-To: <201006020316.13155.vapier@gentoo.org> References: <20100531211246.64181dab@pomiocik.lan> <201006020316.13155.vapier@gentoo.org> X-Mailer: Claws Mail 3.7.5 (GTK+ 2.18.9; x86_64-pc-linux-gnu) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org Mime-Version: 1.0 Content-Type: multipart/signed; micalg=PGP-SHA1; boundary="Sig_/ZHaB1aHbIkovF8W5QS8Y7o6"; protocol="application/pgp-signature" X-Archives-Salt: f91921bc-4965-4eea-a10a-6e15c7156400 X-Archives-Hash: 70646728f04a5809cc99541323b11d6c --Sig_/ZHaB1aHbIkovF8W5QS8Y7o6 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Wed, 2 Jun 2010 03:16:12 -0400 Mike Frysinger wrote: > On Monday, May 31, 2010 15:12:46 Micha=C5=82 G=C3=B3rny wrote: > > There are many simple applications which come without neither a > > sophisticated build system or even a tiny Makefile. In some cases, > > such applications aren't even packages as tarball -- a single, > > compressed source file is published instead. > >=20 > > In case of these applications, ebuilds inherit > > toolchain-funcs.eclass to retrieve compiler information > > (tc-getCC/tc-getCXX) and call compiler manually, passing > > appropriate flags. >=20 > use emake then and leverage make's implicit rules. The implicit make rules are less universal and -- in the fact -- pretty poor. They're strictly make-dependant, which reduces the amount of control over their behavior. In my opinion, if we should ever use such behavior, it should be rather technical implementation of the functions I'm proposing instead of inline use. POSIX (man 1p make) defines only simple rule for C files: $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< I wasn't able to find a rule for C++ files. GNU Make seems a little better but it's documentation is blurry. Although it supports both C and C++, and pretty wide set of variables, it's still less than solution proposed by me. And it's only 'de-facto standard', which isn't guaranteed to be kept unchanged in the future. Namely, advantages of my solution over directly calling emake is: 1) direct control over how compiler will be called =3D=3D better portability, 2) possibility of using any output filename (with emake we'd have to rename), 3) possibility of clearly using multiple input files, 4) possibility of using any input file suffix, 5) clear separation between user-specified and ebuild-specified flags (yes, I'm aware of '+=3D' GNU make extension). And after all, starting a make jobserver for a single compiler process doesn't seem really useful. > sys-apps/unscd is a pretty straight forward example. In my opinion it's rather a poor example. It's the simplest case possible -- single file, no additional flags, no libs. --=20 Best regards, Micha=C5=82 G=C3=B3rny --Sig_/ZHaB1aHbIkovF8W5QS8Y7o6 Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.15 (GNU/Linux) iEYEARECAAYFAkwGWdAACgkQnGSe5QXeB7sBBgCgttcV7iqHLhVSMcSXXrFEa51K dAUAoIdyeChIqSLZOnlqoCLeVpIamcnc =MzyB -----END PGP SIGNATURE----- --Sig_/ZHaB1aHbIkovF8W5QS8Y7o6--