1 |
i've found myself a few times having to implement logic like so: |
2 |
CFLAGS=${BUILD_CFLAGS:--O1 -pipe} \ |
3 |
CXXFLAGS=${BUILD_CXXFLAGS:--O1 -pipe} \ |
4 |
CPPFLAGS=${BUILD_CPPFLAGS} \ |
5 |
LDFLAGS=${BUILD_LDFLAGS} \ |
6 |
CC=$(tc-getBUILD_CC) \ |
7 |
LD=$(tc-getBUILD_LD) \ |
8 |
econf --host=${CBUILD} "$@" |
9 |
|
10 |
this is to deal with packages that build up not insignificant (let's call them |
11 |
"nificant") binaries which are then used at build time. when cross-compiling, |
12 |
you can't execute those binaries, and things fail. |
13 |
|
14 |
python is a good example. it builds up the local python interpreter (which is |
15 |
all written in C/etc...), and then uses that to parse local python scripts |
16 |
which take care of building everything else. so a while ago we added code so |
17 |
that it'd build two python binaries when cross-compiling: a local ${CBUILD} |
18 |
version which is then used to parse the python build files to compile for |
19 |
${CHOST}. using host python won't work if it's newer/older/insane/afk. |
20 |
|
21 |
ncurses compiles its local term database by first creating a tic helper and |
22 |
then parsing its local files. we can't use the build system's tic because if |
23 |
the installed ncurses is a different version, we run into fun things like |
24 |
crashes/infinite loops/etc... |
25 |
|
26 |
the latest thing i hit was elfutils where it creates a local binary to |
27 |
generate a database of headers which it then compiles into the target code. |
28 |
|
29 |
so rather than continuing to copy & paste this logic everywhere, i'm going to |
30 |
add it to toolchain-funcs.eclass as "econf_build". any feedback before i do ? |
31 |
-mike |