summaryrefslogtreecommitdiff
path: root/Cross/build-arm-n770-sh
blob: bc4dd2e47943114ef244deb89d95e8919f0fec60 (plain)
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# this is a build script for ARM-linux cross-compiling.
#
# Cross-compiling SDK could be downloaded from the URL
#   http://www.codesourcery.com/gnu_toolchains/arm
# or alternatively from
#   http://www.handhelds.org/download/projects/toolchain/
#
# SDK also could be downloaded from www.maemo.org, somehow (how - TBD)
#
# Cross-compile process similar to Perl-CE cross-compiling, and allows
# for full TARGET perl (as opposed to renamed miniperl)
#
# some trick is different, however - the file extension for objects files
# are choosen to be .${CROSS_NAME}, .armo in our case

# to skip Configure/build for HOST miniperl, pass "noconf" argument to this script

# note how invoked Makefile.PL for cross-compilation:
#   miniperl -MCross Makefile.PL

# steps are:
# - run HOST configure
# - build HOST miniperl
# given freshly-created HOST makefile and existing miniperl fix makefile
# to use 

CROSS_NAME=arm

# suppose compiler is in /opt/arm-2006q3
CCPATH=/opt/arm-2006q3
PATH=$CCPATH/bin:$PATH
CCPREF=arm-none-linux-gnueabi-

CROSSCC=${CCPREF}gcc
export CROSSCC
export CROSS_NAME

# (re-)building this config-xxxx.sh is TBD
cp config.sh-arm-linux-n770 ../config-${CROSS_NAME}.sh

# following should be done better:
cd ..

if [[ "x$1" != xnoconf* ]] ; then
# do miniperl on HOST
CROSS_NAME= ./Configure -des -D prefix=./dummy -Dusedevel
make miniperl
make uudmap.h
fi

# do the rest for TARGET
$CROSSCC --version

# call make this way so it will crosscompile...
XCOREDIR=xlib/$CROSS_NAME/CORE
PERL_CONFIG_SH=config-${CROSS_NAME}.sh

# make cflags do cross-compile work (now its hackish, will be improved!)
rm cflags-cross-$CROSS_NAME
cp Cross/cflags-cross-$CROSS_NAME .
rm Makefile-cross-$CROSS_NAME
CROSS_NAME=$CROSS_NAME sh Makefile.SH

mkdir xlib
mkdir xlib/$CROSS_NAME
mkdir ${XCOREDIR}

cmd="make -f Makefile-cross-$CROSS_NAME xconfig.h"
echo "running $cmd"
$cmd || exit


#cmd="make -f Makefile-cross-$CROSS_NAME DynaLoader.${CROSS_NAME}o  OBJ_EXT=.${CROSS_NAME}o EXE_EXT=.$CROSS_NAME LIB_EXT=.${CROSS_NAME}a  AR=${CCPREF}ar LD=${CCPREF}ld"
#echo "running $cmd"
#$cmd || exit
#

cmd="make -f Makefile-cross-$CROSS_NAME all"
echo "running $cmd"
$cmd || exit

# extensions not currently built here:
#  DB_File
#  GDBM_File
#  NDBM_File
#  ODBM_File
#  SDBM_File
#