]> git.saurik.com Git - wxWidgets.git/blob - distrib/msw/makedist.sh
Added distribution script
[wxWidgets.git] / distrib / msw / makedist.sh
1 #! /bin/sh
2 # makedist.sh
3 #
4 # Build wxWindows 2 for Windows distribution.
5 # This builds all required binaries and documents before calling
6 # zipdist.sh to make the archives.
7 #
8 # To use this script, you need:
9 #
10 # - CygWin installation, for bash etc.
11 # - VC++ 6 or higher, to compile the binaries
12 # - WinHelp compiler, HTML Help compiler, Tex2RTF on your path
13 # - WISE Install 5
14 #
15 # Julian Smart, October 2000
16
17 SRC=`cygpath -u $WXWIN`
18 DEST=$SRC/deliver
19 TMPDIR=`cygpath -u $TEMP`
20 OK=1
21 DOWISE=0
22 # For some reason, if we pipe output to egrep, we see output, but not otherwise.
23 WARNINGS=": decorated name|: see reference|: see declaration|C4786|VC98\\\\INCLUDE|template<>"
24
25 setup_vars() {
26 VCPATH="/c/Program Files/Microsoft Visual Studio/common/msdev98/bin:/c/Program Files/Microsoft Visual Studio/VC98/bin:DevStudio/VC/bin:/c/Program Files/Microsoft Visual Studio/common/tools:/c/Program Files/HTML Help Workshop"
27 INCLUDE="C:\Program Files\Microsoft Visual Studio\VC98\ATL\INCLUDE;C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE;C:\Program Files\Microsoft Visual Studio\VC98\MFC\INCLUDE;C:\Program Files\Tcl\include;C:\Program Files\HTML Help Workshop\include"
28 LIB="C:\Program Files\Microsoft Visual Studio\VC98\lib;C:\Program Files\Microsoft Visual Studio\VC98\MFC\lib;C:\Program Files\Tcl\lib;C:\Program Files\HTML Help Workshop\lib"
29 TCLHOME=C:/PROGRA~1/Tcl export TCLHOME
30 PATH="$PATH:$VCPATH" export PATH
31 export INCLUDE LIB
32 }
33
34 check_compile() {
35 egrep ": error C|fatal error" $TMPDIR/buildlog.txt > $TMPDIR/errorlog.txt
36 if [ -s $TMPDIR/errorlog.txt ]; then
37 echo Did not build $0 successfully.
38 OK=0
39 fi
40 }
41
42 check_files() {
43 if [ ! -d "$SRC" ]; then
44 echo "$SRC" does not exist.
45 OK=0
46 fi
47
48 if [ ! -d "$SRC/deliver" ]; then
49 mkdir "$SRC/deliver"
50 fi
51
52 if [ ! -e $SRC/include/wx/msw/setup.h ]; then
53 cp "$SRC/include/wx/msw/setup0.h" "$SRC/include/wx/msw/setup.h"
54 echo setup0.h has been copied to setup.h.
55 echo You must now edit this file to restore release settings,
56 echo then run this script again.
57 OK=0
58 notepad.exe "$SRC/include/wx/msw/setup.h"
59 fi
60 if [ ! -d "$SRC/bin" ]; then
61 mkdir "$SRC/bin"
62 fi
63 if [ ! -e "$SRC/bin/DBVIEW.EXE" ]; then
64 echo Please put DBGVIEW.EXE, DBGVIEW.CNT, DBGVIEW.HLP into $SRC/bin
65 echo and run the script again.
66 OK=0
67 fi
68 }
69
70 build_docs() {
71 cd "$SRC/src/msw"
72 echo "---------------------------------"
73 echo "Building wxWindows documents"
74 nmake -f makefile.vc cleandocs docs
75
76 cd "$SRC/utils/dialoged/src"
77 nmake -f makefile.vc html htmlhelp htb hlp pdfrtf
78
79 cd "$SRC/utils/tex2rtf/src"
80 nmake -f makefile.vc html htmlhelp htb hlp pdfrtf
81
82 cd "$SRC/contrib/src/ogl"
83 nmake -f makefile.vc html htmlhelp htb hlp pdfrtf
84
85 cd "$SRC/contrib/src/mmedia"
86 # NB: add htb target
87 nmake -f makefile.vc html htmlhelp hlp pdfrtf
88 }
89
90 # Build wxWindows
91 build_wxwin_vc() {
92 echo "---------------------------------"
93 echo "Building wxWindows using VC++"
94 cd "$SRC/src"
95 echo Building wxWindows Release library in `pwd`
96 echo Command: msdev wxvc.dsw /useenv /make "wxvc - Win32 Release" /rebuild
97 msdev wxvc.dsw /useenv /make "wxvc - Win32 Release" /rebuild | egrep -v "$WARNINGS"
98 }
99
100 build_dialog_editor() {
101 echo "---------------------------------"
102 echo "Building Dialog Editor using VC++"
103 cd "$SRC/utils/dialoged/src"
104 msdev DialogEdVC.dsw /useenv /make "DialogEdVC - Win32 Release" /rebuild | egrep -v "$WARNINGS" | tee $TMPDIR/buildlog.txt
105
106 check_compile "Dialog Editor"
107 }
108
109 build_tex2rtf() {
110 echo "---------------------------------"
111 echo "Building Tex2RTF using VC++"
112 cd "$SRC/utils/tex2rtf/src"
113 msdev Tex2RTFVC.dsw /useenv /make "Tex2RTFVC - Win32 Release" /rebuild | egrep -v "$WARNINGS" | tee $TMPDIR/buildlog.txt
114
115 check_compile "Tex2RTF"
116 }
117
118 build_life() {
119 echo "---------------------------------"
120 echo "Building Life! using VC++"
121 cd "$SRC/demos/life"
122 msdev LifeVC.dsw /useenv /make "LifeVC - Win32 Release" /rebuild | egrep -v "$WARNINGS" | tee $TMPDIR/buildlog.txt
123
124 check_compile "Life! Demo"
125 }
126
127 build_executables() {
128 build_dialog_editor
129 build_tex2rtf
130 build_life
131 }
132
133 copy_files() {
134 cp "$SRC/utils/dialoged/src/Release/dialoged.exe" "$SRC/bin"
135 cp "$SRC/docs/winhelp/dialoged.*" "$SRC/bin"
136
137 cp "$SRC/utils/tex2rtf/src/Release/tex2rtf.exe" "$SRC/bin"
138 cp "$SRC/docs/winhelp/tex2rtf.*" "$SRC/bin"
139
140 cp "$SRC/demos/life/life.exe" "$SRC/demos/life/breeder.lif" "$SRC/bin"
141 }
142
143 # Process command line options.
144 for i in "$@"; do
145 case "$i" in
146 --wise) DOWISE=1 ;;
147 *)
148 echo Usage: $0 "[ options ]"
149 echo Generates documentation and binaries for creating a distribution,
150 echo and optionally generates the zip/setup.exe distribution by
151 echo calling zipdist.sh.
152 echo
153 echo Options:
154 echo " --help Display this help message"
155 echo " --wise Build zips and setup.exe after creating docs and binaries"
156 exit 1
157 ;;
158 esac
159 done
160
161 mkdir -p $SRC/docs/pdf
162 mkdir -p $SRC/docs/html
163 mkdir -p $SRC/docs/htmlhelp
164 mkdir -p $SRC/docs/htb
165
166 setup_vars
167 check_files
168
169 if [ "$OK" = "1" ]; then
170 build_docs
171 fi
172
173 if [ "$OK" = "1" ]; then
174 build_wxwin_vc
175 fi
176
177 if [ "$OK" = "1" ]; then
178 build_executables
179 fi
180
181 if [ "$OK" = "1" ]; then
182 copy_files
183 fi
184
185 if [ "$OK" = "1" && "$DOWISE" = "1" ]; then
186 $SRC/distrib/msw/zipdist.sh --wise
187 fi
188
189 if [ "$OK" = "1" ]; then
190 echo Finished successfully.
191 else
192 echo Finished unsuccessfully. There were errors.
193 fi
194
195 echo Press return to continue.
196 read dummy
197