SDL CrossCompiling

Hi,
first of all sorry if this post may sound off topic, I hope this is the right

place for asking it. I’m trying to cross compile the latest SDL library for

using it on a embedded target mounting a xscale_le.

The folder in which my toolchain lies is /xscale_bin.

I’ve tried to manual set some parameters on ./configure file coming with the

library, but I’ve found several version in which I can do that and the configure

complains about it.

My doubt is on the use of --build, --host and --target options. I’ve found some

tutorials telling me I have to put the --host=toolchainprefix, but if I tried it

the configure tells me to use --build instead. In the same time I’ve found some

suggestions telling me to use both --host and --build in order to switch on the

cross compiler within the ./configure command.

The --target option is said to be rarely used, but I’ve found it quite used

instead.

The only clear thing is the --prefix option tells the configure the toolchain

folder in which it can find the /bin etc etc folders it needs.

May you help me please?

thank you in advance and sorry if this can sound as dumb.

Ricky

Le Mon, 15 Dec 2008 16:34:55 +0000 (UTC)
Ricky a _crit:

My doubt is on the use of --build, --host and --target options. I’ve found some
tutorials telling me I have to put the --host=toolchainprefix, but if I tried it
the configure tells me to use --build instead. In the same time I’ve found some
suggestions telling me to use both --host and --build in order to switch on the
cross compiler within the ./configure command.

When I cross-compile SDL (or any other software that use autotools) for
my target, I set parameters as follows:
–build=i686-pc-linux-gnu --host=m68k-atari-mint
’–build’ is the machine your run the cross-compiler on (that builds
the software), ‘–host’ is the machine that will execute the
cross-compiled stuff.–
Patrice Mandin
WWW: http://pmandin.atari.org/
Programmeur Linux, Atari
Sp?cialit?: D?veloppement, jeux

IIRC the --prefix option of autoconf-generated configure scripts, the
–prefix option determines where files get installed when you make install

Here is what the configure script for SDL 1.2.13 has to say about it:

Installation directories:
–prefix=PREFIX install architecture-independent files in PREFIX

I’ve also had some troubles in the past getting autotools-generated
build systems to cross compile. IIRC I believe the environment
variables CC/CXX came in hand. Again, SDL 1.2.13’s configure has this
to say:

Some influential environment variables:
CC C compiler command
CFLAGS C compiler flags
LDFLAGS linker flags, e.g. -L if you have libraries in a
nonstandard directory
LIBS libraries to pass to the linker, e.g. -l
CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I if
you have headers in a nonstandard directory
CPP C preprocessor
CXX C++ compiler command
CXXFLAGS C++ compiler flags
CXXCPP C++ preprocessor

Good luckOn Mon, Dec 15, 2008 at 11:34 AM, Ricky wrote:

The only clear thing is the --prefix option tells the configure the toolchain
folder in which it can find the /bin etc etc folders it needs.


http://codebad.com/

Patrice Mandin <mandin.patrice orange.fr> writes:

When I cross-compile SDL (or any other software that use autotools) for
my target, I set parameters as follows:
–build=i686-pc-linux-gnu --host=m68k-atari-mint
’–build’ is the machine your run the cross-compiler on (that builds
the software), ‘–host’ is the machine that will execute the
cross-compiled stuff.

Hi, this is helpful to me, many thanx. The only doubt now stays on --host
option, i.e. where may I retrieve the machine name on which my stuff will run.
Try to be more clear. I’m cross compiling for a xscale processor, and the
toolchain is under xscale_le folder. also all the bin prefix are of course
xscale_le_gcc etc. etc.
I’ve tried to put --host=xscale, but the configure tells me I have to add
this configuration on configure.in coming with the SDL sources.
Is there a repository in which I can specify this toolchain, or is there a sort
of naming convention to be used when creating these names? for example, how did
you get the 686-pc-linux-gnu or the m68k-atari-mint names from?
Thak you in advance for your patience.

Ricky

Le Mon, 15 Dec 2008 21:20:13 +0000 (UTC)
Ricky a _crit:

Patrice Mandin <mandin.patrice orange.fr> writes:

When I cross-compile SDL (or any other software that use autotools) for
my target, I set parameters as follows:
–build=i686-pc-linux-gnu --host=m68k-atari-mint
’–build’ is the machine your run the cross-compiler on (that builds
the software), ‘–host’ is the machine that will execute the
cross-compiled stuff.

Hi, this is helpful to me, many thanx. The only doubt now stays on --host
option, i.e. where may I retrieve the machine name on which my stuff will run.
Try to be more clear. I’m cross compiling for a xscale processor, and the
toolchain is under xscale_le folder. also all the bin prefix are of course
xscale_le_gcc etc. etc.
I’ve tried to put --host=xscale, but the configure tells me I have to add
this configuration on configure.in coming with the SDL sources.
Is there a repository in which I can specify this toolchain, or is there a sort
of naming convention to be used when creating these names? for example, how did
you get the 686-pc-linux-gnu or the m68k-atari-mint names from?

If your target is known by autotools, you should be able to find its
name somewhere in the config.guess shell script. If your target has a
cross-compiler, just have a look at the name -gcc for the name
of the cross-compiler.–
Patrice Mandin
WWW: http://pmandin.atari.org/
Programmeur Linux, Atari
Sp?cialit?: D?veloppement, jeux

If your target is known by autotools, you should be able to find its
name somewhere in the config.guess shell script. If your target has a
cross-compiler, just have a look at the name -gcc for the name
of the cross-compiler.

I’ve always wondered about how gcc resolves pathnames for those
binaries. Incidentally, Ricky had this to say:On Tue, Dec 16, 2008 at 2:04 AM, Patrice Mandin <mandin.patrice at orange.fr> wrote:

On Mon, Dec 15, 2008 at 11:34 AM, Ricky wrote:

The folder in which my toolchain lies is /xscale_bin.

Do you think he’ll need to reinstall them?


http://codebad.com/