Re: [autotools] gtk-doc.m4 - cross compile support



On Wed, Oct 10, 2018 at 10:18 AM <jcupitt gmail com> wrote:

On Wed, 10 Oct 2018 at 07:39, Fontana Nicola <ntd entidi it> wrote:
Il giorno mer, 10/10/2018 alle 09.20 +0300, Alon Bar-Lev ha scritto:
BTW: just a thought, if you compile on demand the scanobj, then you
can use the build CC/LD and it will compile, it can analyze the host
format, just like any toolchain tool.

Yes, and you'll also need a launcher (i.e. some kind of virtualization
environment maybe you already have in place) to execute that binary
from the build machine.

Yes, I've considered that too, but never tried to implement it.

For abstract things like the class hierarchy, you could also do a
separate native build and introspect that, but unfortunately .gir
files are not cross-platform. They include things like struct member
offsets, which really tie them to a specific binary.

John

I am not expert in this gtk-doc package, so forgive me if I am wrong.
I suggest the following...
Split the tools that are architecture specific to an autoconf
subpackage, by default the gtk-doc will also build the subpackage with
same settings, producing native binaries as done today.
These tools will be cross compile aware, they will run on build and
inspect target formats, just like arm-unknown-linux-gnueabi-objdump
tool on x86_64-pc-linux-gnu, which runs on the build
(x86_64-pc-linux-gnu) but inspect arm-unknown-linux-gnueabi objects,
no need for virtualization.
This can be achieved by including the architecture format from the
SYSROOT while building.
The name of the tool should have prefix of "${HOST}-", the native tool
can have a symlink without the prefix if it is helpful.
The gtk-doc should be target aware, and execute the "${TARGET}-" tool
to inspect objects.

Sequence for example:
cd gtk-doc
./configure
make install

at this point you will have:
/usr/bin/gtk-doc
/usr/libexec/gtk-doc/tool1 -> x864_64-pc-linux-gnut-tool1
/usr/libexec/gtk-doc/x864_64-pc-linux-gnut-tool1

cd gtk-arch-tools
./configure --target=arm-unknown-linux-gnueabi-objdump
make install

Now you will have:
/usr/bin/gtk-doc
/usr/libexec/gtk-doc/tool1 -> x864_64-pc-linux-gnut-tool1
/usr/libexec/gtk-doc/x864_64-pc-linux-gnut-tool1
/usr/libexec/gtk-doc/arm-unknown-linux-gnueabi-objdump-tool1

When invoking gtk-doc add environment variable such as target, when
available it will execute the target- tool, when not it will execute
the tool.

What do you think?
Alon


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]