annotate mk-dist @ 3150:65fc638bdd8e

[MSVC] fix incompatible definition of off_t betweeb GraphicsMagick and octave.
author Michael Goffioul <michael.goffioul@gmail.com>
date Thu, 18 Jul 2013 11:34:31 -0400
parents 100e618349f7
children e7cb2340feff
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
92d86e3e9173 improve mk-dist script
John W. Eaton <jwe@octave.org>
parents: 2930
diff changeset
5 jobs=9
92d86e3e9173 improve mk-dist script
John W. Eaton <jwe@octave.org>
parents: 2930
diff changeset
6
2957
0c4eab3a7903 mk-dist: --stable option
John W. Eaton <jwe@octave.org>
parents: 2956
diff changeset
7 OCTAVE_TARGET=octave
2987
eb1643bd900c mk-dist: new argument, --no-strip
John W. Eaton <jwe@octave.org>
parents: 2965
diff changeset
8
eb1643bd900c mk-dist: new argument, --no-strip
John W. Eaton <jwe@octave.org>
parents: 2965
diff changeset
9 strip=yes
2992
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents: 2987
diff changeset
10 installer=no
2945
92d86e3e9173 improve mk-dist script
John W. Eaton <jwe@octave.org>
parents: 2930
diff changeset
11 while [ $# -gt 0 ]; do
92d86e3e9173 improve mk-dist script
John W. Eaton <jwe@octave.org>
parents: 2930
diff changeset
12 case "$1" in
92d86e3e9173 improve mk-dist script
John W. Eaton <jwe@octave.org>
parents: 2930
diff changeset
13 --jobs)
92d86e3e9173 improve mk-dist script
John W. Eaton <jwe@octave.org>
parents: 2930
diff changeset
14 shift
92d86e3e9173 improve mk-dist script
John W. Eaton <jwe@octave.org>
parents: 2930
diff changeset
15 if [ $# -gt 0 ]; then
92d86e3e9173 improve mk-dist script
John W. Eaton <jwe@octave.org>
parents: 2930
diff changeset
16 jobs=$1
92d86e3e9173 improve mk-dist script
John W. Eaton <jwe@octave.org>
parents: 2930
diff changeset
17 shift
92d86e3e9173 improve mk-dist script
John W. Eaton <jwe@octave.org>
parents: 2930
diff changeset
18 else
92d86e3e9173 improve mk-dist script
John W. Eaton <jwe@octave.org>
parents: 2930
diff changeset
19 echo "mk-dist: expecting argument for --jobs option" 1>&2
92d86e3e9173 improve mk-dist script
John W. Eaton <jwe@octave.org>
parents: 2930
diff changeset
20 exit 1
92d86e3e9173 improve mk-dist script
John W. Eaton <jwe@octave.org>
parents: 2930
diff changeset
21 fi
92d86e3e9173 improve mk-dist script
John W. Eaton <jwe@octave.org>
parents: 2930
diff changeset
22 ;;
2957
0c4eab3a7903 mk-dist: --stable option
John W. Eaton <jwe@octave.org>
parents: 2956
diff changeset
23 --stable)
0c4eab3a7903 mk-dist: --stable option
John W. Eaton <jwe@octave.org>
parents: 2956
diff changeset
24 OCTAVE_TARGET=stable-octave
0c4eab3a7903 mk-dist: --stable option
John W. Eaton <jwe@octave.org>
parents: 2956
diff changeset
25 shift
0c4eab3a7903 mk-dist: --stable option
John W. Eaton <jwe@octave.org>
parents: 2956
diff changeset
26 ;;
2987
eb1643bd900c mk-dist: new argument, --no-strip
John W. Eaton <jwe@octave.org>
parents: 2965
diff changeset
27 --no-strip)
eb1643bd900c mk-dist: new argument, --no-strip
John W. Eaton <jwe@octave.org>
parents: 2965
diff changeset
28 strip=no
eb1643bd900c mk-dist: new argument, --no-strip
John W. Eaton <jwe@octave.org>
parents: 2965
diff changeset
29 shift
eb1643bd900c mk-dist: new argument, --no-strip
John W. Eaton <jwe@octave.org>
parents: 2965
diff changeset
30 ;;
2992
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents: 2987
diff changeset
31 --installer)
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents: 2987
diff changeset
32 installer=yes
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents: 2987
diff changeset
33 echo "making installer"
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents: 2987
diff changeset
34 shift
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents: 2987
diff changeset
35 ;;
2945
92d86e3e9173 improve mk-dist script
John W. Eaton <jwe@octave.org>
parents: 2930
diff changeset
36 *)
92d86e3e9173 improve mk-dist script
John W. Eaton <jwe@octave.org>
parents: 2930
diff changeset
37 echo "mk-dist: unrecognized option: $1" 1>&2
92d86e3e9173 improve mk-dist script
John W. Eaton <jwe@octave.org>
parents: 2930
diff changeset
38 exit 1
92d86e3e9173 improve mk-dist script
John W. Eaton <jwe@octave.org>
parents: 2930
diff changeset
39 ;;
92d86e3e9173 improve mk-dist script
John W. Eaton <jwe@octave.org>
parents: 2930
diff changeset
40 esac
92d86e3e9173 improve mk-dist script
John W. Eaton <jwe@octave.org>
parents: 2930
diff changeset
41 done
92d86e3e9173 improve mk-dist script
John W. Eaton <jwe@octave.org>
parents: 2930
diff changeset
42
2921
f129bd6b8d6b script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff changeset
43 TOPDIR=$(pwd)
2945
92d86e3e9173 improve mk-dist script
John W. Eaton <jwe@octave.org>
parents: 2930
diff changeset
44 PATH=$TOPDIR/usr/bin:$PATH
2921
f129bd6b8d6b script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff changeset
45 TARGET=i686-pc-mingw32
3012
100e618349f7 Improve handling of prefix directories by defining HOST_PREFIX and
John W. Eaton <jwe@octave.org>
parents: 3010
diff changeset
46 PREFIX=/usr/$TARGET
2921
f129bd6b8d6b script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff changeset
47 STRIP=$TARGET-strip
2962
486c081fd0b5 mk-dist: create octave file with date info
John W. Eaton <jwe@octave.org>
parents: 2958
diff changeset
48 DATE=$(date +%Y-%m-%d-%H-%M)
486c081fd0b5 mk-dist: create octave file with date info
John W. Eaton <jwe@octave.org>
parents: 2958
diff changeset
49 OCTAVE_DIST_DIR=$TOPDIR/dist/$OCTAVE_TARGET-$DATE
2992
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents: 2987
diff changeset
50 INSTALLER_PKG=
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents: 2987
diff changeset
51
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents: 2987
diff changeset
52 if [ $installer = "yes" ]; then
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents: 2987
diff changeset
53 echo "Adding installer to build dependancies"
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents: 2987
diff changeset
54 INSTALLER_PKG="nsis"
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents: 2987
diff changeset
55 fi
2921
f129bd6b8d6b script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff changeset
56
f129bd6b8d6b script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff changeset
57 echo "deleting previous dist directory..."
2962
486c081fd0b5 mk-dist: create octave file with date info
John W. Eaton <jwe@octave.org>
parents: 2958
diff changeset
58 rm -rf $TOPDIR/dist
486c081fd0b5 mk-dist: create octave file with date info
John W. Eaton <jwe@octave.org>
parents: 2958
diff changeset
59 mkdir -p $OCTAVE_DIST_DIR
2921
f129bd6b8d6b script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff changeset
60
f129bd6b8d6b script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff changeset
61 echo "building octave and dependencies..."
2992
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents: 2987
diff changeset
62 make $OCTAVE_TARGET $INSTALLER_PKG msys-base native-gcc native-binutils octave-forge-packages npp JOBS=$jobs
2945
92d86e3e9173 improve mk-dist script
John W. Eaton <jwe@octave.org>
parents: 2930
diff changeset
63
2956
dfa81fbfc1f5 msys binary packages
John W. Eaton <jwe@octave.org>
parents: 2954
diff changeset
64 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
65
2956
dfa81fbfc1f5 msys binary packages
John W. Eaton <jwe@octave.org>
parents: 2954
diff changeset
66 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
67 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
68 ./$TARGET
f129bd6b8d6b script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff changeset
69 ./bin/$TARGET-*.exe
f129bd6b8d6b script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff changeset
70 EOF
f129bd6b8d6b script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff changeset
71
2956
dfa81fbfc1f5 msys binary packages
John W. Eaton <jwe@octave.org>
parents: 2954
diff changeset
72 echo " gcc cross compiler files..."
3012
100e618349f7 Improve handling of prefix directories by defining HOST_PREFIX and
John W. Eaton <jwe@octave.org>
parents: 3010
diff changeset
73 cd $TOPDIR/cross-tools/$TOPDIR/$PREFIX
2956
dfa81fbfc1f5 msys binary packages
John W. Eaton <jwe@octave.org>
parents: 2954
diff changeset
74 find . -type f -o -type l | sed "s,./,," > $TOPDIR/excluded-gcc-files
dfa81fbfc1f5 msys binary packages
John W. Eaton <jwe@octave.org>
parents: 2954
diff changeset
75
dfa81fbfc1f5 msys binary packages
John W. Eaton <jwe@octave.org>
parents: 2954
diff changeset
76 echo "copying files..."
dfa81fbfc1f5 msys binary packages
John W. Eaton <jwe@octave.org>
parents: 2954
diff changeset
77
dfa81fbfc1f5 msys binary packages
John W. Eaton <jwe@octave.org>
parents: 2954
diff changeset
78 echo " octave and dependencies..."
3012
100e618349f7 Improve handling of prefix directories by defining HOST_PREFIX and
John W. Eaton <jwe@octave.org>
parents: 3010
diff changeset
79 cd $TOPDIR/$PREFIX
2962
486c081fd0b5 mk-dist: create octave file with date info
John W. Eaton <jwe@octave.org>
parents: 2958
diff changeset
80 tar -c -h -X $TOPDIR/excluded-gcc-files -f - . | ( cd $OCTAVE_DIST_DIR ; tar xpf - )
486c081fd0b5 mk-dist: create octave file with date info
John W. Eaton <jwe@octave.org>
parents: 2958
diff changeset
81 cp $TOPDIR/build_packages.m $OCTAVE_DIST_DIR/src
2957
0c4eab3a7903 mk-dist: --stable option
John W. Eaton <jwe@octave.org>
parents: 2956
diff changeset
82
2965
d35eda9fb1f3 octaverc file
John W. Eaton <jwe@octave.org>
parents: 2964
diff changeset
83 echo " octaverc file..."
d35eda9fb1f3 octaverc file
John W. Eaton <jwe@octave.org>
parents: 2964
diff changeset
84 cp $TOPDIR/octaverc $OCTAVE_DIST_DIR/share/octave/site/m/startup/octaverc
d35eda9fb1f3 octaverc file
John W. Eaton <jwe@octave.org>
parents: 2964
diff changeset
85
2956
dfa81fbfc1f5 msys binary packages
John W. Eaton <jwe@octave.org>
parents: 2954
diff changeset
86 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
87 cd $TOPDIR/native-tools/usr
2962
486c081fd0b5 mk-dist: create octave file with date info
John W. Eaton <jwe@octave.org>
parents: 2958
diff changeset
88 tar -c -h -X $TOPDIR/excluded-native-files -f - . | ( cd $OCTAVE_DIST_DIR ; tar xpf - )
2921
f129bd6b8d6b script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff changeset
89
2956
dfa81fbfc1f5 msys binary packages
John W. Eaton <jwe@octave.org>
parents: 2954
diff changeset
90 echo " libgcc_s_dw2-1.dll to bin directory"
2962
486c081fd0b5 mk-dist: create octave file with date info
John W. Eaton <jwe@octave.org>
parents: 2958
diff changeset
91 cd $OCTAVE_DIST_DIR
2956
dfa81fbfc1f5 msys binary packages
John W. Eaton <jwe@octave.org>
parents: 2954
diff changeset
92 cp lib/gcc/i686-pc-mingw32/libgcc_s_dw2-1.dll bin
dfa81fbfc1f5 msys binary packages
John W. Eaton <jwe@octave.org>
parents: 2954
diff changeset
93
dfa81fbfc1f5 msys binary packages
John W. Eaton <jwe@octave.org>
parents: 2954
diff changeset
94 echo " msys base files..."
dfa81fbfc1f5 msys binary packages
John W. Eaton <jwe@octave.org>
parents: 2954
diff changeset
95 cd $TOPDIR/msys-base
2962
486c081fd0b5 mk-dist: create octave file with date info
John W. Eaton <jwe@octave.org>
parents: 2958
diff changeset
96 tar -c -h -f - . | ( cd $OCTAVE_DIST_DIR ; tar xpf - )
2956
dfa81fbfc1f5 msys binary packages
John W. Eaton <jwe@octave.org>
parents: 2954
diff changeset
97
2964
1955438b24dc get notepad++
John W. Eaton <jwe@octave.org>
parents: 2962
diff changeset
98 echo " notepad++..."
1955438b24dc get notepad++
John W. Eaton <jwe@octave.org>
parents: 2962
diff changeset
99 cd $TOPDIR
1955438b24dc get notepad++
John W. Eaton <jwe@octave.org>
parents: 2962
diff changeset
100 tar -c -h -f - notepad++ | ( cd $OCTAVE_DIST_DIR ; tar xpf - )
1955438b24dc get notepad++
John W. Eaton <jwe@octave.org>
parents: 2962
diff changeset
101 cp $TOPDIR/build_packages.m $OCTAVE_DIST_DIR/src
1955438b24dc get notepad++
John W. Eaton <jwe@octave.org>
parents: 2962
diff changeset
102
2930
e7bd76ab0710 mk-dist script tweaks
John W. Eaton <jwe@octave.org>
parents: 2921
diff changeset
103 echo "making all files writable by user..."
2962
486c081fd0b5 mk-dist: create octave file with date info
John W. Eaton <jwe@octave.org>
parents: 2958
diff changeset
104 chmod -R u+w $OCTAVE_DIST_DIR
2930
e7bd76ab0710 mk-dist script tweaks
John W. Eaton <jwe@octave.org>
parents: 2921
diff changeset
105
2987
eb1643bd900c mk-dist: new argument, --no-strip
John W. Eaton <jwe@octave.org>
parents: 2965
diff changeset
106 if [ $strip = "yes" ]; then
eb1643bd900c mk-dist: new argument, --no-strip
John W. Eaton <jwe@octave.org>
parents: 2965
diff changeset
107 echo "stripping files..."
eb1643bd900c mk-dist: new argument, --no-strip
John W. Eaton <jwe@octave.org>
parents: 2965
diff changeset
108 cd $OCTAVE_DIST_DIR
eb1643bd900c mk-dist: new argument, --no-strip
John W. Eaton <jwe@octave.org>
parents: 2965
diff changeset
109 for f in $(find . -name '*.dll' -o -name '*.exe'); do
eb1643bd900c mk-dist: new argument, --no-strip
John W. Eaton <jwe@octave.org>
parents: 2965
diff changeset
110 echo " $f"
eb1643bd900c mk-dist: new argument, --no-strip
John W. Eaton <jwe@octave.org>
parents: 2965
diff changeset
111 $STRIP $f
eb1643bd900c mk-dist: new argument, --no-strip
John W. Eaton <jwe@octave.org>
parents: 2965
diff changeset
112 done
eb1643bd900c mk-dist: new argument, --no-strip
John W. Eaton <jwe@octave.org>
parents: 2965
diff changeset
113 fi
2921
f129bd6b8d6b script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff changeset
114
2956
dfa81fbfc1f5 msys binary packages
John W. Eaton <jwe@octave.org>
parents: 2954
diff changeset
115 #echo "creating tar file..."
dfa81fbfc1f5 msys binary packages
John W. Eaton <jwe@octave.org>
parents: 2954
diff changeset
116 #cd $TOPDIR/dist
2962
486c081fd0b5 mk-dist: create octave file with date info
John W. Eaton <jwe@octave.org>
parents: 2958
diff changeset
117 #tar -c -j -f $OCTAVE_TARGET-$DATE.tar.bz2 $OCTAVE_TARGET-$DATE
2956
dfa81fbfc1f5 msys binary packages
John W. Eaton <jwe@octave.org>
parents: 2954
diff changeset
118
2921
f129bd6b8d6b script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff changeset
119 cd $TOPDIR/dist
2992
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents: 2987
diff changeset
120
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents: 2987
diff changeset
121 if [ $installer = "yes" ]; then
3010
8ac67219c241 Updates for nsis build and installer creation
John Donoghue <john.donoghue@ieee.org>
parents: 2992
diff changeset
122 $SHELL ../makeinst-script.sh $OCTAVE_TARGET-$DATE
2992
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents: 2987
diff changeset
123
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents: 2987
diff changeset
124 echo "Generating installer ..."
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents: 2987
diff changeset
125 $TOPDIR/usr/bin/$TARGET-makensis octave.nsi > /dev/null
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents: 2987
diff changeset
126
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents: 2987
diff changeset
127 if [ -e Octave-Installer.exe ]; then
3010
8ac67219c241 Updates for nsis build and installer creation
John Donoghue <john.donoghue@ieee.org>
parents: 2992
diff changeset
128 echo "Installer created"
2992
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents: 2987
diff changeset
129 rm octave.nsi
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents: 2987
diff changeset
130 fi
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents: 2987
diff changeset
131
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents: 2987
diff changeset
132 else
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents: 2987
diff changeset
133 echo "creating zip file..."
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents: 2987
diff changeset
134 zip -q -9 -r $OCTAVE_TARGET-$DATE.zip $OCTAVE_TARGET-$DATE
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents: 2987
diff changeset
135 fi
4b450c162e39 Add ability to create simple NSIS installer
John Donoghue <john.donoghue@ieee.org>
parents: 2987
diff changeset
136