3 # Build a range of Unix demos for uploading to the wxWidgets web site.
5 # builddemos.sh --wxmsw --verbose &> log
9 WXDESTDIR
=$WXSRCDIR/deliver
12 # Default binary subdirectory to copy sample executable from
15 # Suffix to append to each demo tarball, e.g. SuSE92 for widgets-SuSE92
18 # Determine if the binary name is .app or not
21 if [ "$PLATFORM" = "mac" ]; then
30 if [ ! -d "$WXSRCDIR" ] ; then
31 echo Cannot
find wxWidgets
source directory. Use
--wxdir option.
34 if [ ! -d "$WXDESTDIR" ] ; then
35 echo Cannot
find wxWidgets destination directory. Use
--deliver option.
38 if [ ! -d samples
] ; then
39 echo Cannot
find samples directory. Invoke this
script from the root of the build folder.
42 if [ -d include
] ; then
43 echo Do not invoke this from the
source directory
- invoke from the build directory.
47 echo wxWidgets build directory is
`pwd`
48 echo wxWidgets
source directory is
$WXSRCDIR
49 echo wxWidgets deliver directory is
$WXDESTDIR
50 echo Suffix is
$SUFFIX
52 rm -f $WXDESTDIR/*.
tar.gz
58 if [ -f dialogs
] ; then
59 determine_binary dialogs
60 cp $WXSRCDIR/samples
/dialogs
/*.cpp
$WXSRCDIR/samples
/dialogs
/*.h .
61 tar cfz
$WXDESTDIR/wxWidgets
-DialogsDemo-$SUFFIX.
tar.gz
$BINARYNAME *.cpp
*.h
64 echo "*** Warning: dialogs sample did not build"
70 pushd samples
/html
/test
73 if [ "$PLATFORM" = "mac" ]; then
74 # Don't rename app on Mac in case it messes up the bundle
78 determine_binary htmldemo
80 cp $WXSRCDIR/samples
/html
/test
/*.cpp
$WXSRCDIR/samples
/html
/test
/*.htm
* $WXSRCDIR/samples
/html
/test
/*.png
$WXSRCDIR/samples
/html
/test
/*.gif .
81 tar cfz
$WXDESTDIR/wxWidgets
-HtmlDemo-$SUFFIX.
tar.gz
$BINARYNAME *.cpp
*.png
*.gif
*.htm
*
82 rm -f *.cpp
*.gif
*.png
*.htm
*
84 echo "*** Warning: HTML sample did not build"
92 if [ -f widgets
] ; then
93 determine_binary widgets
94 cp $WXSRCDIR/samples
/widgets
/*.cpp
$WXSRCDIR/samples
/widgets
/*.h .
95 tar cfz
$WXDESTDIR/wxWidgets
-WidgetsDemo-$SUFFIX.
tar.gz
$BINARYNAME *.cpp
*.h
98 echo "*** Warning: widgets sample did not build"
106 if [ -f life
] ; then
107 determine_binary life
108 cp $WXSRCDIR/demos
/life
/*.cpp
$WXSRCDIR/demos
/life
/*.h
$WXSRCDIR/demos
/life
/*.xpm
$WXSRCDIR/demos
/life
/*.inc
$WXSRCDIR/demos
/life
/*.lif .
110 cp $WXSRCDIR/demos
/life
/bitmaps
/*.
* bitmaps
111 tar cfz
$WXDESTDIR/wxWidgets
-LifeDemo-$SUFFIX.
tar.gz
$BINARYNAME *.cpp
*.h
*.xpm
*.inc
*.lif bitmaps
/*.
*
112 rm -f *.cpp
*.h
*.xpm
*.inc
*.lif
115 echo "*** Warning: life demo did not build"
120 dobuilddemos_windows
()
122 if [ ! -d "$WXSRCDIR" ] ; then
123 echo Cannot
find wxWidgets
source directory. Use
--wxdir option.
126 if [ ! -d "$WXDESTDIR" ] ; then
127 echo Cannot
find wxWidgets destination directory. Use
--deliver option.
130 if [ ! -d samples
] ; then
131 echo Cannot
find samples directory. Invoke this
script from the root of the build folder.
135 echo wxWidgets build directory is
`pwd`
136 echo wxWidgets
source directory is
$WXSRCDIR
137 echo wxWidgets deliver directory is
$WXDESTDIR
138 echo Suffix is
$SUFFIX
140 rm -f $WXDESTDIR/*.
zip
144 pushd samples
/dialogs
145 if [ -f $WINBINDIR/dialogs.exe
] ; then
146 cp $WINBINDIR/dialogs.exe .
147 zip $WXDESTDIR/wxWidgets
-DialogsDemo-$SUFFIX.
zip dialogs.exe
*.cpp
*.h
150 echo "*** Warning: dialogs sample did not build"
156 pushd samples
/html
/test
157 if [ -f $WINBINDIR/test.exe
] ; then
158 cp $WINBINDIR/test.exe htmldemo.exe
159 zip $WXDESTDIR/wxWidgets
-HtmlDemo-$SUFFIX.
zip htmldemo.exe
*.cpp
*.png
*.gif
*.htm
*
162 echo "*** Warning: HTML sample did not build"
168 pushd samples
/widgets
169 if [ -f $WINBINDIR/widgets.exe
] ; then
170 cp $WINBINDIR/widgets.exe .
171 zip $WXDESTDIR/wxWidgets
-WidgetsDemo-$SUFFIX.
zip widgets.exe
*.cpp
*.h
173 echo "*** Warning: widgets sample did not build"
180 if [ -f $WINBINDIR/life.exe
] ; then
181 cp $WINBINDIR/life.exe .
182 zip $WXDESTDIR/wxWidgets
-LifeDemo-$SUFFIX.
zip life.exe
*.cpp
*.h
*.xpm
*.inc
*.lif bitmaps
/*.
*
184 echo "*** Warning: life demo did not build"
191 echo "Usage: $PROGNAME [ options ]" 1>&2
193 echo " --help Display this help message"
194 echo " --suffix Append suffix to each tarball"
195 echo " --wxdir wxWidgets source dir"
196 echo " --deliver Tarball destination dir"
197 echo " --mac Whether we're building on Mac"
199 echo Note that options only override settings
in $SCRIPTDIR/setup.var.
203 # Process command line options.
208 --suffix) SUFFIX
=$2; shift;;
209 --wxdir) WXSRCDIR
=$2; WXDESTDIR
=$WXSRCDIR/deliver
; shift;;
210 --deliver) WXDESTDIR
=$2; shift;;
211 --mac) PLATFORM
=mac
;;
220 if [ "$OS" = "Windows_NT" ]; then