Repository navigation
Expand file tree
/
Copy pathswig.build
More file actions
99 lines (65 loc) · 2.21 KB
/
Copy pathswig.build
File metadata and controls
99 lines (65 loc) · 2.21 KB
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
89
90
91
92
93
94
95
96
97
98
99
#!/bin/sh
#
######################################################
# Build script #
# #
# See .info for details #
######################################################
######################################################
# Configure extension creation parameters #
######################################################
INITIALDIR=$PWD
wget https://cytranet-dal.dl.sourceforge.net/project/swig/swig/swig-4.4.1/swig-4.4.1.tar.gz
SRCNAM=swig-4.4.1.tar.gz
WRKDIR=swig-4.4.1
EXTNAM=swig
TMPDIR=/tmp/swig
######################################################
# Prepare extension creation #
######################################################
# Remove dirs and files left from previous creation
rm -r -f $WRKDIR
rm -r -f $TMPDIR
# Crete temporary directory
mkdir -p $TMPDIR
######################################################
# Compile extension #
######################################################
# Export variables needed for compilation
export CFLAGS="-O2 -pipe -march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp"
export CXXFLAGS="-O2 -pipe -fexceptions -fno-rtti -march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp"
# Unpack source in current directory
tar -xf $SRCNAM
# Configure it
cd $WRKDIR
./configure \
--prefix=/usr/local \
--enable-static \
--enable-shared
# Compile
make
# Install in base temp dir
make install DESTDIR=$TMPDIR
# Delete compilation work directory
cd ..
rm -r -f $WRKDIR
# Adjust directory access rigths
find $TMPDIR/ -type d | xargs chmod -v 755;
# Strip executables
find $TMPDIR | xargs file | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded
###################################################
# Create base extension in temp dir #
###################################################
cd $TMPDIR
cd ..
mksquashfs $TMPDIR $EXTNAM.tcz
cd $TMPDIR
find usr -not -type d > $EXTNAM.tcz.list
mv ../$EXTNAM.tcz .
# Create md5 file
md5sum $EXTNAM.tcz > $EXTNAM.tcz.md5.txt
# copy extension files
sudo cp -v $EXTNAM.tcz* /mnt/mmcblk0p2/tce/optional
# Cleanup temp directory
rm -r -f usr
cd $INITIALDIR