* autoconf and cross-compiling?
@ 2001-10-18 22:30 Dan Kegel
0 siblings, 0 replies; 2+ messages in thread
From: Dan Kegel @ 2001-10-18 22:30 UTC (permalink / raw)
To: linuxppc-embedded@lists.linuxppc.org
I'm trying to document the right way to cross-compile
applications which use autoconf/automake. configure
has a --target flag, but I can't see how to get it to do anything
useful.
The goat book has what looks like a helpful section
http://sources.redhat.com/autobook/autobook/autobook_261.html#SEC261
which talks about the macros AC_CANONICAL_SYSTEM and AC_ARG_PROGRAM,
but it turns out this only affects tool names *when installing*.
It's useful when *building* cross compilers, not when using them.
My best guess at the moment is:
Before running 'configure', set the environment variables
CC, CXX, RANLIB, and AR to point to the cross-development
tools you want to use, *and* tell configure the target name,
e.g.
CC=powerpc-linux-gcc CXX=powerpc-linux-g++ RANLIB=powerpc-linux-ranlib AR=powerpc-linux-ar ./configure --target=powerpc-linux
Is this right?
If so, this is suprisingly clumsy. I would expect configure to let you set
both the target name and the tool names in one fell swoop, e.g.
./configure --with-target=powerpc-linux
but since few people do cross-development, maybe this hasn't been made easy.
- Dan
(originally posted to gnu.gcc.help, but no response there)
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: autoconf and cross-compiling?
[not found] <20011018233528.6F09E10CC5@denx.denx.de>
@ 2001-10-19 0:08 ` Dan Kegel
0 siblings, 0 replies; 2+ messages in thread
From: Dan Kegel @ 2001-10-19 0:08 UTC (permalink / raw)
To: linuxppc-embedded@lists.linuxppc.org
Someone wrote:
> This helps in some situations, but does only part of the job in
> others. In general, autoconf/automake based stuff will fail to build
> more or less completely when it comes to situations where it tries to
> get information of the (supposed target) system by trying to run some
> test programs.
>
> Either it uses the cross compiler to build the test programs - the it
> dies because these programs cannot be run on the host system; or it
> uses the native compiler and it dies later (sometimes REALLY late on
> the target) because it gathers information from the build host which
> does not apply on the target (simple case: getting information about
> endianess when building on a x86 host for a PPC target).
> ...
> There was another posting about this issue by Magnus Damm, see
> http://lists.linuxppc.org/linuxppc-embedded/200109/msg00355.html
Thanks for the link!
I believe there's a fix for the endian problem; see
http://www.gnu.org/software/ac-archive/Cross_Compilation/ac_c_bigendian_cross.html
A similar approch should work for sizeof, shouldn't it?
Don't know about the other ones, like fork etc. :-(
- Dan
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2001-10-19 0:08 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-10-18 22:30 autoconf and cross-compiling? Dan Kegel
[not found] <20011018233528.6F09E10CC5@denx.denx.de>
2001-10-19 0:08 ` Dan Kegel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).