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

Re: [MiNT] Cross-compiler



Le Tue, 13 Apr 2004 10:04:58 +0200
Philipp Donzé <philipp.donze@epfl.ch> a écrit:

> So I have now some general questions about cross-compiling and GCC:
> I've build and installed the cross-compiler using 
> "--prefix=/usr/local/cross-tools". This gives me
> a file tree like this (in the /usr/local/cross-tools folder):
> 	bin/
> 	include/
> 	info/
> 	lib/
> 	m68k-atari-mint/
> 		bin/
> 		lib/
> 	man/
> 	share/
> 
> Can anyone explain me what are all the directories for?
> Why is there in the m68k-atari-mint/bin/ folder the same program as in 
> bin/ but the name has no "m68k-atari-mint" prefix?

This is not important.

> If I want to install/compile an atari library for use with my cross 
> compiler, do I have to put the include and lib files in include/ and 
> lib/ folder or into m68k-atari-mint/lib and  m68k-atari-mint/include 
> folder?

All m68k-atari-mint stuff (includes, libraries, config scripts) must be
installed in the m68k-atari-mint subdirectory.

> My problem is: where do I have to put the mintlib files for a proper 
> cross-compiler installation?

If you have the mintlib-devel-0.57.4 archive, move the contents of the
mintlib-devel/usr/lib directory to m68k-atari-mint/lib and the
mintlib-devel/usr/include directory to m68k-atari-mint/include

> And in the future: How should I compile applications? (Using 
> bin/m68k-atari-mint-gcc or m68k-atari-mint/bin/gcc?) What's the
> difference?

You should only have binutils programs in m68k-atari-mint/bin. To compile
GNU applications using configure, I usually run this script:

--8<--8<--8<--8<-- cut here, cross-configure.sh
#!/bin/sh

TARGET=m68k-atari-mint
HOST=`gcc -dumpmachine`
PREFIX=/home/patrice/local

export PATH=${PREFIX}/bin:${PREFIX}/${TARGET}/bin:$PATH
export CFLAGS="-m68020-60 -O2 -fomit-frame-pointer"
export CXXFLAGS=$CFLAGS

export CC=${TARGET}-gcc
export CXX=${TARGET}-g++
export RANLIB=${TARGET}-ranlib
export AR=${TARGET}-ar
export NM=${TARGET}-nm
export LD=${TARGET}-ld
export STRIP=${TARGET}-strip

./configure \
--prefix=${PREFIX}/${TARGET} \
--host=${HOST} \
--target=${TARGET} \
$*
--8<--8<--8<--8<-- cut here

Using host and target with different values tells configure it will
cross-compile. When configuration is done, I make with this script:

--8<--8<--8<--8<-- cut here, cross-make.sh
#!/bin/sh

MY_TARGET=m68k-atari-mint
MY_CROSSPATH=/home/patrice/local

export PATH=${MY_CROSSPATH}/bin:${MY_CROSSPATH}/${MY_TARGET}/bin:$PATH

make $*
--8<--8<--8<--8<-- cut here

-- 
Patrice Mandin
WWW: http://membres.lycos.fr/pmandin/
Programmeur Linux, Atari
Spécialité: Développement, jeux