-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathREADME.cross_compile
69 lines (52 loc) · 2.6 KB
/
README.cross_compile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
Cross-Compiling DTN2
====================
(This file last updated June 14, 2006)
The actual steps needed for cross compiling DTN2 will depend on the
particular toolchain in use as well as the target architecture. This
file defines steps for certain known-to-work configurations.
Cross compilation toolchain installed on Linux
----------------------------------------------
In this configuration, we assume that some cross-compilation toolchain
was installed with all toolchain executables prefixed by the name of
the target system. In this example, assume that the target system is
arm-linux, so all tools are named arm-linux-<tool>, and are installed
into a directory on the system called /opt/arm-linux-toolchain/bin.
First set the path to include the installed toolchain directory:
% export PATH=/opt/arm-linux-toolchain/bin:$PATH
Then download and unpack sources for tcl and berkeley db. The
following will compile and install them into /opt/arm-linux-libraries.
Note that BerkeleyDB is not required, so if you don't want it, you can
skip that step and pass --without-db to the DTN2 configure invocation.
(In the unpacked tcl source dir)
% cd unix
% CC=arm-linux-gcc ./configure --prefix=/opt/arm-linux-libraries
% make
% make install
If the build presents trouble, the following note from the
comp.lang.tcl archive may be helpful:
Re: multiple definition of `fixstrtod' while cross-compiling tcl
From: Eric Hassold <hassold at evolane.fr>
Date: Mon Dec 05 2005 - 22:33:38 CET
Tcl configure script makes some pessimistic assumptions when
cross-compiling (when AC_TRY_RUN can't run). One of them is guessing
libc has no strtod when small test program can't be run. Some AC_TRY_RUN
should actually be replaced by AC_TRY_LINK to provide better estimate.
Anyway, as a work-around, you may force configure detection, defining
export ac_cv_func_strtod=yes
before running ./configure. You may also have to force
export tcl_cv_strtod_buggy=1
so that Tcl will define its own fixstrtod() symbol, which will call
uclibc's strtod(). Works fine in our nightly built process, compiling
Tcl for arm-linux/uclibc.
(In the unpacked Berkeley DB source dir)
% cd build_unix
% ../dist/configure --prefix=/opt/arm-linux-libraries \
--build=`uname -m` --host=arm-linux
% make
% make install
The final step is to configure and build DTN2, again with the PATH set
to include the cross-compilation toolchain and with tcl and Berkeley
DB installed in /opt/arm-linux-libraries.
% ./configure --build=`uname -m` --host=arm-linux \
--with-db=/opt/arm-linux-libraries --with-tcl=/opt/arm-linux-libraries
% make