Gentoo Archives: gentoo-embedded

From: Enrico Weigelt <weigelt@×××××.de>
To: gentoo-embedded@l.g.o
Subject: Re: [gentoo-embedded] configure: error: C++ compiler cannot create executables
Date: Sat, 05 Feb 2011 16:13:43
Message-Id: 20110205151615.GA16741@nibiru.local
In Reply to: Re: [gentoo-embedded] configure: error: C++ compiler cannot create executables by Peter Stuge
1 * Peter Stuge <peter@×××××.se> schrieb:
2
3 > I think you're missing the point then. The point is obviously to
4 > allow source packages to compile on a very wide variety of platforms.
5 > Specifically, the auto* packages should not be needed on the build
6 > system. This is why configure is included in releases, and tries to
7 > run on as many different shells as possible.
8
9 Yes, but that whole idea introduces a hell more trouble than it's
10 ever worth it. Starting with the fact that they have to use a
11 very ancient shell language or even ugly hacks to work around
12 incompatibilities between ancient shells.
13
14 If we'd at least expect quite recent a shell that is capable of
15 handling functions, the whole machinery could be written entirely
16 in shellscripts - no macro-based generation at all. When appropriate,
17 there could be different, platform specific, version of these functions,
18 which are just included by the detected host and target type. A simple
19 configure script the probably would look like this:
20
21
22 #!/bin/sh
23
24 PACKAGE="mypackage"
25 VERSION="1.2.3"
26 AUTHOR="foo@×××.de"
27
28 . cf/autoconfig.sh
29
30 autoconfig_init
31
32 declare_feature "compression" "enable compression support using zlib"
33 declare_feature "png" "png image loading support"
34
35 autoconfig_begin
36
37 if `feature_enabled compression` ; then
38 require_header zlib.h
39 fi
40
41 if `feature_enabled png` ; then
42 require_package PNG "png >= 1.4.0"
43 fi
44
45 check_header malloc.h
46
47 generate_files \
48 Makefile \
49 src/Makefile \
50 doc/Makefile \
51
52 autoconfig_finish
53
54
55 Everything else could be easily hidden behind the shell functions.
56
57 > > The best solution, IMHO, would be replacing all these dubious
58 > > macros by a bunch of carefully written shell functions.
59 >
60 > Of course you already know that in fact the macros *are* shell
61 > functions. Look in a generated configure. They may be unrolled,
62 > but still.
63
64 No, they aren't. They are just macros which are expanded to a big-fat
65 unreable shellscript w/o any functions.
66
67 > > There would be no generation phase at all.
68 >
69 > Generation would be traded for a build-time requirement to have the
70 > library of shell functions installed on the system. Such a regression
71 > is not an option.
72
73 The shell functions could simply be included in the source tree
74 (eg. in some sane subdir). And the main script could even have some
75 switching mechanism, so an already installed version can be used
76 when requested.
77
78
79 AUTOCONFIG_LIBRARY=/usr/share/autoconfig-1.2 ./configure <....>
80
81
82 > > I've started some hacking on that for zlib, a while ago. Maybe
83 > > somebody might like to join me ...
84 >
85 > It would be interesting to see what you come up with there. IIRC zlib
86 > is not using full-on autotools though?
87
88 It's not using autotools at all - everything hand-written.
89
90 > Rewriting autoconf to use sh instead of m4 is an interesting idea. I
91 > think it would make sense to phase out m4. But I also don't think it
92 > is a strong requirement.
93
94 For me it often becomes requirement as during the last decade, it's
95 macros have turned out to be so broken and hard to debug.
96
97 > > I'd rather propose (on per-package basis) directly maintain the sources
98 > > (including dist-specific changes) in an own repository, so the whole
99 > > download+unpack+patch phase is replaced by just a checkout, and things
100 > > like rebasing dist-specific changes can be done directly via vcs.
101 >
102 > Except that it creates a proper fork of every package, which is
103 > pretty stupid IMO.
104
105 No, it's not a full fork, but just a downstream branch. Essentially the
106 same as done w/ text-based patches, just now stored directly in an
107 sophisticated vcs which supports the common operations like rebase.
108
109 > Yes this happens in practise with patches too, but
110 > in my view patches are really only temporary fixes until upstream has
111 > solved the problem better.
112
113 Same with an downstream-branch. Once upstream has taken a change, it
114 will automatically disappear from the downstream own changeset line
115 (which sits ontop the upstream) on next rebase. That's one of the
116 things rebase is good for.
117
118 > The purpose of a source-based distribution is to use the upstream
119 > sources. Some upstreams have significant QA which it would be silly
120 > to not take full advantage of, by using their released archive.
121
122 In the generic case, you don't use the upstream sources, but upstream
123 plus certain patches (or even worse: esoteric manipulations v/ sed, etc).
124 Only a subset (no matter which percentage it actually makes up) of the
125 package releases can be _directly_ pulled from upstream. The more
126 generic case is the superset of releases where a variable number
127 of changes (which *might* be zero) has to be added to the release.
128
129
130 cu
131 --
132 ----------------------------------------------------------------------
133 Enrico Weigelt, metux IT service -- http://www.metux.de/
134
135 phone: +49 36207 519931 email: weigelt@×××××.de
136 mobile: +49 151 27565287 icq: 210169427 skype: nekrad666
137 ----------------------------------------------------------------------
138 Embedded-Linux / Portierung / Opensource-QM / Verteilte Systeme
139 ----------------------------------------------------------------------

Replies