Mercurial > mxe-octave
annotate mk-dist @ 2956:dfa81fbfc1f5
msys binary packages
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Fri, 11 Jan 2013 22:33:56 -0500 |
parents | f0fe5698ee67 |
children | 0c4eab3a7903 |
rev | line source |
---|---|
2921
f129bd6b8d6b
script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
1 #! /bin/bash |
f129bd6b8d6b
script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
2 |
f129bd6b8d6b
script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
3 set -e |
f129bd6b8d6b
script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
4 |
2945 | 5 jobs=9 |
6 | |
7 while [ $# -gt 0 ]; do | |
8 case "$1" in | |
9 --jobs) | |
10 shift | |
11 if [ $# -gt 0 ]; then | |
12 jobs=$1 | |
13 shift | |
14 else | |
15 echo "mk-dist: expecting argument for --jobs option" 1>&2 | |
16 exit 1 | |
17 fi | |
18 ;; | |
19 *) | |
20 echo "mk-dist: unrecognized option: $1" 1>&2 | |
21 exit 1 | |
22 ;; | |
23 esac | |
24 done | |
25 | |
2921
f129bd6b8d6b
script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
26 TOPDIR=$(pwd) |
2945 | 27 PATH=$TOPDIR/usr/bin:$PATH |
28 PREFIX=/usr | |
2921
f129bd6b8d6b
script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
29 TARGET=i686-pc-mingw32 |
f129bd6b8d6b
script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
30 BUILD=x86_64-unwknown-linux-gnu |
f129bd6b8d6b
script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
31 STRIP=$TARGET-strip |
f129bd6b8d6b
script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
32 |
f129bd6b8d6b
script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
33 echo "deleting previous dist directory..." |
f129bd6b8d6b
script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
34 rm -rf dist |
f129bd6b8d6b
script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
35 mkdir -p dist/octave |
f129bd6b8d6b
script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
36 |
f129bd6b8d6b
script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
37 echo "building octave and dependencies..." |
2956 | 38 make octave msys-base native-gcc native-binutils JOBS=$jobs |
2945 | 39 |
2956 | 40 echo "generating lists of files to exclude..." |
2921
f129bd6b8d6b
script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
41 |
2956 | 42 echo " native files..." |
2921
f129bd6b8d6b
script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
43 cat > $TOPDIR/excluded-native-files << EOF |
f129bd6b8d6b
script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
44 ./$TARGET |
f129bd6b8d6b
script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
45 ./bin/$TARGET-*.exe |
f129bd6b8d6b
script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
46 EOF |
f129bd6b8d6b
script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
47 |
2956 | 48 echo " gcc cross compiler files..." |
49 cd $TOPDIR/cross-tools/$TOPDIR/$PREFIX/$TARGET | |
50 find . -type f -o -type l | sed "s,./,," > $TOPDIR/excluded-gcc-files | |
51 | |
52 echo "copying files..." | |
53 | |
54 echo " octave and dependencies..." | |
55 cd $TOPDIR/usr/$TARGET | |
56 tar -c -h -X $TOPDIR/excluded-gcc-files -f - . | ( cd $TOPDIR/dist/octave ; tar xpf - ) | |
57 | |
58 echo " native tools..." | |
2921
f129bd6b8d6b
script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
59 cd $TOPDIR/native-tools/usr |
f129bd6b8d6b
script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
60 tar -c -h -X $TOPDIR/excluded-native-files -f - . | ( cd $TOPDIR/dist/octave ; tar xpf - ) |
f129bd6b8d6b
script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
61 |
2956 | 62 echo " libgcc_s_dw2-1.dll to bin directory" |
63 cd $TOPDIR/dist/octave | |
64 cp lib/gcc/i686-pc-mingw32/libgcc_s_dw2-1.dll bin | |
65 | |
66 echo " msys base files..." | |
67 cd $TOPDIR/msys-base | |
68 tar -c -h -f - . | ( cd $TOPDIR/dist/octave ; tar xpf - ) | |
69 | |
2930 | 70 echo "making all files writable by user..." |
71 chmod -R u+w $TOPDIR/dist/octave | |
72 | |
73 echo "stripping files..." | |
2921
f129bd6b8d6b
script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
74 cd $TOPDIR/dist/octave |
2954 | 75 for f in $(find . -name '*.dll' -o -name '*.exe'); do |
2930 | 76 echo " $f" |
2921
f129bd6b8d6b
script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
77 $STRIP $f |
f129bd6b8d6b
script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
78 done |
f129bd6b8d6b
script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
79 |
2956 | 80 #echo "creating tar file..." |
81 #cd $TOPDIR/dist | |
82 #tar -c -j -f octave.tar.bz2 octave | |
83 | |
84 echo "creating zip file..." | |
2921
f129bd6b8d6b
script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
85 cd $TOPDIR/dist |
2954 | 86 zip -q -9 -r octave.zip octave |