From: "Michał Górny" <gentoo@mgorny.alt.pl>
To: gentoo-dev@lists.gentoo.org
Subject: Re: [gentoo-dev] [RFC] toolchain-funcs.eclass: functions to call compiler
Date: Wed, 2 Jun 2010 15:17:00 +0200 [thread overview]
Message-ID: <20100602151700.6e367219@pomiocik.lan> (raw)
In-Reply-To: <201006020316.13155.vapier@gentoo.org>
[-- Attachment #1: Type: text/plain, Size: 2231 bytes --]
On Wed, 2 Jun 2010 03:16:12 -0400
Mike Frysinger <vapier@gentoo.org> wrote:
> On Monday, May 31, 2010 15:12:46 Michał Górny 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.
> >
> > 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.
>
> 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 == 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 '+=' 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.
--
Best regards,
Michał Górny
<http://mgorny.alt.pl>
<xmpp:mgorny@jabber.ru>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
next prev parent reply other threads:[~2010-06-02 13:17 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-31 19:12 [gentoo-dev] [RFC] toolchain-funcs.eclass: functions to call compiler Michał Górny
2010-06-01 2:11 ` [gentoo-dev] " Ryan Hill
2010-06-01 2:14 ` Ryan Hill
2010-06-02 7:16 ` [gentoo-dev] " Mike Frysinger
2010-06-02 13:17 ` Michał Górny [this message]
2010-06-02 21:56 ` Mike Frysinger
2010-06-05 13:16 ` Michał Górny
2010-06-06 4:17 ` Mike Frysinger
2010-06-06 7:45 ` Michał Górny
2010-06-08 22:44 ` Mike Frysinger
2010-06-09 5:34 ` Michał Górny
2010-06-09 5:41 ` Mike Frysinger
2010-06-17 4:17 ` Jeroen Roovers
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100602151700.6e367219@pomiocik.lan \
--to=gentoo@mgorny.alt.pl \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox