1 |
On Wednesday, June 02, 2010 09:17:00 Michał Górny wrote: |
2 |
> On Wed, 2 Jun 2010 03:16:12 -0400 Mike Frysinger wrote: |
3 |
> > On Monday, May 31, 2010 15:12:46 Michał Górny wrote: |
4 |
> > > There are many simple applications which come without neither a |
5 |
> > > sophisticated build system or even a tiny Makefile. In some cases, |
6 |
> > > such applications aren't even packages as tarball -- a single, |
7 |
> > > compressed source file is published instead. |
8 |
> > > |
9 |
> > > In case of these applications, ebuilds inherit |
10 |
> > > toolchain-funcs.eclass to retrieve compiler information |
11 |
> > > (tc-getCC/tc-getCXX) and call compiler manually, passing |
12 |
> > > appropriate flags. |
13 |
> > |
14 |
> > use emake then and leverage make's implicit rules. |
15 |
> |
16 |
> The implicit make rules are less universal and -- in the fact -- pretty |
17 |
> poor. They're strictly make-dependant, which reduces the amount of |
18 |
> control over their behavior. In my opinion, if we should ever use such |
19 |
> behavior, it should be rather technical implementation of the functions |
20 |
> I'm proposing instead of inline use. |
21 |
|
22 |
ebuilds requires GNU make which means the implicit rules are "universal". not |
23 |
that i really know what you're talking about. the rules are also clearly |
24 |
documented and support all the proper flags we currently support. |
25 |
|
26 |
> POSIX (man 1p make) defines only simple rule for C files: |
27 |
> $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< |
28 |
|
29 |
POSIX rules are irrelevant. read the GNU make documentation. |
30 |
|
31 |
> Namely, advantages of my solution over directly calling emake is: |
32 |
> 1) direct control over how compiler will be called == better |
33 |
> portability, |
34 |
|
35 |
irrelevant. this is like saying we should use POSIX shell code instead of |
36 |
bash because it's "better portability". we use the tools that are required by |
37 |
the ebuild system and that means GNU make. |
38 |
|
39 |
> 2) possibility of using any output filename (with emake we'd have to |
40 |
> rename), |
41 |
|
42 |
the -o location is irrelevant in the compile line, and most packages name the |
43 |
source file the same as the output, so not that big of a deal |
44 |
|
45 |
> 3) possibility of clearly using multiple input files, |
46 |
|
47 |
yep |
48 |
|
49 |
> 4) possibility of using any input file suffix, |
50 |
|
51 |
perhaps, but very few packages are stupid enough to name a file moocow.txt |
52 |
when it's really a C file |
53 |
|
54 |
> 5) clear separation between user-specified and ebuild-specified flags |
55 |
> (yes, I'm aware of '+=' GNU make extension). |
56 |
|
57 |
hard to sat it's irrelevant |
58 |
|
59 |
> And after all, starting a make jobserver for a single compiler process |
60 |
> doesn't seem really useful. |
61 |
|
62 |
and serializing multiple files is worse |
63 |
|
64 |
> > sys-apps/unscd is a pretty straight forward example. |
65 |
> |
66 |
> In my opinion it's rather a poor example. It's the simplest case |
67 |
> possible -- single file, no additional flags, no libs. |
68 |
|
69 |
and there are many like it |
70 |
|
71 |
btw, toolchain-funcs is not really the best place to add this. it's an eclass |
72 |
for querying, not compiling. better to start a new one. |
73 |
-mike |