summaryrefslogtreecommitdiff
path: root/Cross/build-arm-n770-sh
blob: e8c9179df221cb163f8d98fd2ccfc3906fe45aa2 (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
# this is a build script for ARM-linux cross-compiling.
# it builds miniperl on HOST and then perl for TARGET
# this approach is like Perl-CE cross-compiling, and allows
# for full TARGET perl (as opposed to renamed miniperl)

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

# some trick is different, however - the file extension for objects files
# are chosen to be .${CROSS_NAME}, .armo in our case

# 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

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
# fake uudmap, which should be on HOST
# TODO - all host utilities should be clearly stated and not built for TARGET
cp generate_uudmap generate_uudmap.${CROSS_NAME}
fi

#?? cd Cross

# do the rest for TARGET
$CROSSCC --version

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

#?? . $PERL_CONFIG_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
cp Cross/Makefile-cross-$CROSS_NAME .

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

#??OBJ_EXT=.${CROSS_NAME}o
# TODO these -- AR=${CCPREF}ar LD=${CCPREF}ld
cmd="make -f Makefile-cross-$CROSS_NAME xconfig.h"
echo "running $cmd"
$cmd

echo "running $cmd"
cmd="make -f Makefile-cross-$CROSS_NAME libperl.${CROSS_NAME}a  OBJ_EXT=.${CROSS_NAME}o EXE_EXT=.$CROSS_NAME LIB_EXT=.${CROSS_NAME}a  AR=${CCPREF}ar LD=${CCPREF}ld"
$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

cmd="make -f Makefile-cross-$CROSS_NAME perl.${CROSS_NAME}"
echo "running $cmd"
$cmd