From fnaumann@mail.cs.uni-magdeburg.de  Fri Apr 16 23:55:22 2004
Date: Fri, 16 Apr 2004 23:51:36 +0200
From: Patrice Mandin <mandin.patrice@wanadoo.fr>
To: Mint list <mint@fishpool.com>
Subject: Re: [MiNT] Cross-compiler
Message-Id: <20040416235136.4d32a0f9.mandin.patrice@wanadoo.fr>
In-Reply-To: <41F892FF-8D21-11D8-8AF0-00039357F826@epfl.ch>
References: <200404090929.p59141@ll.maus.de>
	<41F892FF-8D21-11D8-8AF0-00039357F826@epfl.ch>
Organization: Chez moi
X-Mailer: Sylpheed version 0.9.8a (GTK+ 1.2.10; i586-pc-linux-gnu)
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-15
Delivered-To: mint@fishpool.com
Delivered-To: mint@lists.fishpool.fi
X-ecartis-version: Ecartis v1.0.0
Sender: mint-bounce@lists.fishpool.fi
Errors-to: mint-bounce@lists.fishpool.fi
X-original-sender: mandin.patrice@wanadoo.fr
Precedence: bulk
List-help: <mailto:ecartis@lists.fishpool.fi?Subject=help>
List-unsubscribe: <mailto:mint-request@lists.fishpool.fi?Subject=unsubscribe>
List-ID: <mint.lists.fishpool.fi>
X-List-ID: <mint.lists.fishpool.fi>
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from quoted-printable to 8bit by prinz.cs.uni-magdeburg.de id i3GLtKO13177

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


