automake
[Top][All Lists]
Advanced

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

Re: Best practice for recognizing cross-compilation and adjusting Makefi


From: Simon Richter
Subject: Re: Best practice for recognizing cross-compilation and adjusting Makefile.am
Date: Fri, 20 Oct 2017 01:49:08 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0

Hi,

On 19.10.2017 22:29, Simon Sobisch wrote:

> The autoconf parts are fixed now [1], but there's one thing in the
> Makefiles where we generate a binary with the compiler we've generated
> directly beforehand. This obviously can't work and I'd  like to skip
> this and telling people to do so on the target machine.

With my Debian package maintainer hat on: if it is possible to properly
support cross compilation, please do so.

The sanest way to do that is to build a toplevel project that calls
something like

    ./configure address@hidden@ \
        address@hidden@ \
        address@hidden@

to build a compiler running on the build system,

    ./configure address@hidden@ \
        address@hidden@ \
        address@hidden@

to build a compiler to install, and

    ./configure address@hidden@ \
        address@hidden@ \
        --with-compiler=path-to-compiler

to build the runtime.

This Makefile is usually not built with automake, and will try to merge
the cases where @host@ = @build@, where the configure invocations for
both compiler builds are the same.

> The main question is: what is the best practice for doing so? I'd using
> AC_SUBST([CROSS_COMPILATION]) and checking this in the "offending"
> Makefile for simply dropping the generation completely.

You can compare the host and build triplets and use AM_CONDITIONAL to
comment out parts of the Makefile when cross-compiling.

   Simon

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]