]> git.saurik.com Git - wxWidgets.git/blob - wxinstall
file I forgot to commit last time (wxCritSection)
[wxWidgets.git] / wxinstall
1 #!/bin/sh
2 # N.B. make sure this really is a true Bourne-compatible shell.
3
4 # !!!! WARNING !!! THIS IS IN DEVELOPMENT AND HAS NOT BEEN
5 # TESTED. DO NOT USE YET!
6 # Use src/motif/makefile.unx directly instead, with the 'motif'
7 # target.
8
9 ###############################################################
10 # wxinstal -- wxWindows for Motif installation script. #
11 # Julian Smart, December 1998 #
12 # Usage: wxinstall [optional wxWindows target directory] #
13 # Note: this uses plain makefiles. You can also use the #
14 # configure system: see docs/motif/install.txt. #
15 ###############################################################
16
17 ########### Edit these variables for your system. #############
18 ########### ALSO edit wx/src/make.env once unarchived #########
19
20 # Editor
21 MYEDITOR=$EDITOR
22 if [ "$MYEDITOR" = "" ]
23 then
24 MYEDITOR=emacs
25 fi
26
27 # Pager
28 MYPAGER=$PAGER
29 if [ "$MYPAGER" = "" ]
30 then
31 MYPAGER=more
32 fi
33
34 # wxWindows directory to install to
35 WXDIR=`pwd`
36 if [ ! "$1" = "" ]
37 then
38 WXDIR=$1
39 fi
40
41 # Target (motif, xview)
42 GUITARGET=motif
43
44 # Archive prefix, dependent on version number
45 ARCHIVE=wx200
46
47 # Platform. 1 = generic platform
48 PLATFORM=1
49
50 # Current directory
51 CURRENTDIR=`pwd`
52
53 # PostScript viewer, if any
54 POSTSCRIPTVIEWER=ghostview
55
56 # PostScript viewer, if any
57 HTMLVIEWER=netscape
58
59 # Don't change this
60 GUISUFFIX=_motif
61
62 if [ "$GUITARGET" = "motif" ]
63 then
64 GUISUFFIX=_motif
65 fi
66
67 # If you add platforms, you just need
68 # to adjust this number, and
69 # add environment variables
70 # for a description and the filename.
71
72 PLATFORMCOUNT=12
73
74 PLATFORM1="Generic/Linux with gcc"
75 PLATFORMFILE1="linux.env"
76
77 PLATFORM2="Solaris with gcc"
78 PLATFORMFILE2="sol_gcc.env"
79
80 PLATFORM3="Solaris with Sun C++"
81 PLATFORMFILE3="sol_sun.env"
82
83 PLATFORM4="SunOS 4.x.x with gcc"
84 PLATFORMFILE4="sunosgcc.env"
85
86 PLATFORM5="FreeBSD with gcc"
87 PLATFORMFILE5="freebsd.env"
88
89 PLATFORM6="AIX with gcc"
90 PLATFORMFILE6="aixgcc.env"
91
92 PLATFORM7="AIX with CSet++"
93 PLATFORMFILE7="aixcset.env"
94
95 PLATFORM8="Data General"
96 PLATFORMFILE8="datagen.env"
97
98 PLATFORM9="HPUX"
99 PLATFORMFILE9="hp.env"
100
101 PLATFORM10="IRIX"
102 PLATFORMFILE10="irix.env"
103
104 PLATFORM11="DEC OSF"
105 PLATFORMFILE11="decosf.env"
106
107 PLATFORM12="VAX VMS"
108 PLATFORMFILE12="vms.env"
109
110 install_from_tar()
111 {
112 if [ -f $CURRENTDIR/$ARCHIVE"gen.tar" ]
113 then
114 if [ ! -d $WXDIR ]
115 then
116 echo Making directory $WXDIR
117 mkdir $WXDIR
118 fi
119 if [ ! -d $WXDIR ]
120 then
121 echo $WXDIR" cannot be created!"
122 else
123 echo Untarring $CURRENTDIR/$ARCHIVE"*.tar."
124 echo Please be patient...
125 cd $WXDIR
126 tar xf $CURRENTDIR/$ARCHIVE"gen.tar"
127 tar xf $CURRENTDIR/$ARCHIVE"mot.tar"
128 echo If you saw no errors, untarring was successful.
129 fi
130 else
131 echo $CURRENTDIR/$ARCHIVE"gen.tar" not found.
132 fi
133
134 # Unarchive HTML documentation if found
135 if [ -f $CURRENTDIR/$ARCHIVE"htm.tar" ]
136 then
137 echo Untarring HTML documentation $CURRENTDIR/$ARCHIVE"htm.tar."
138 echo Please be patient...
139 cd $WXDIR
140 tar xf $CURRENTDIR/$ARCHIVE"htm.tar"
141 fi
142
143 # Unarchive PDF documentation if found
144 if [ -f $CURRENTDIR/$ARCHIVE"pdf.tar" ]
145 then
146 echo Untarring PDF documentation $CURRENTDIR/$ARCHIVE"pdf.tar."
147 echo Please be patient...
148 cd $WXDIR
149 tar xf $CURRENTDIR/$ARCHIVE"pdf.tar"
150 fi
151
152 cd $CURRENTDIR
153 }
154
155 install_from_gzip()
156 {
157 if [ -f $CURRENTDIR/$ARCHIVE"gen.tgz" ]
158 then
159 echo Unarchiving $CURRENTDIR/$ARCHIVE"gen.tgz"
160 gzip -c -d $CURRENTDIR/$ARCHIVE"gen.tgz" | tar xf -
161 echo Unarchiving $CURRENTDIR/$ARCHIVE"mot.tgz"
162 gzip -c -d $CURRENTDIR/$ARCHIVE"mot.tgz" | tar xf -
163
164 # Optional: PDF documentation
165 if [ -f $CURRENTDIR/$ARCHIVE"pdf.tgz" ]
166 then
167 echo Unarchiving $CURRENTDIR/$ARCHIVE"ps.tgz"
168 gzip -c -d $CURRENTDIR/$ARCHIVE"pdf.tgz" | tar xf -
169 fi
170
171 # Optional: HTML documentation
172 if [ -f $CURRENTDIR/$ARCHIVE"htm.tgz" ]
173 then
174 echo Unarchiving $CURRENTDIR/$ARCHIVE"htm.tgz"
175 gzip -c -d $CURRENTDIR/$ARCHIVE"htm.tgz" | tar xf -
176 fi
177
178 else
179 echo $CURRENTDIR/$ARCHIVE"gen.tgz" not found. Please place in the current directory.
180 fi
181 cd $CURRENTDIR
182 }
183
184 install_from_zip()
185 {
186 if [ -f $CURRENTDIR/$ARCHIVE"gen.zip" ]
187 then
188 if [ ! -d $WXDIR ]
189 then
190 echo Making directory $WXDIR
191 mkdir $WXDIR
192 fi
193 if [ ! -d $WXDIR ]
194 then
195 echo $WXDIR" cannot be created!"
196 else
197 echo Untarring $CURRENTDIR/$ARCHIVE"*.zip."
198 echo Please be patient...
199 cd $WXDIR
200 unzip -a -o $CURRENTDIR/$ARCHIVE"gen.zip"
201 unzip -a -o $CURRENTDIR/$ARCHIVE"mot.zip"
202 echo If you saw no errors, unzipping was successful.
203 fi
204 else
205 echo $CURRENTDIR/$ARCHIVE"gen.zip" not found.
206 fi
207
208 # Unarchive HTML documentation if found
209 if [ -f $CURRENTDIR/$ARCHIVE"htm.zip" ]
210 then
211 echo Unzipping HTML documentation $CURRENTDIR/$ARCHIVE"htm.zip."
212 echo Please be patient...
213 cd $WXDIR
214 unzip -a -o $CURRENTDIR/$ARCHIVE"htm.zip"
215 fi
216
217 # Unarchive PDF documentation if found
218 if [ -f $CURRENTDIR/$ARCHIVE"pdf.zip" ]
219 then
220 echo Unzipping PDF documentation $CURRENTDIR/$ARCHIVE"pdf.zip."
221 echo Please be patient...
222 cd $WXDIR
223 unzip -a -o $CURRENTDIR/$ARCHIVE"pdf.zip"
224 fi
225
226 cd $CURRENTDIR
227 }
228
229 edit_make_env()
230 {
231 cd $CURRENTDIR
232
233 if [ -f $WXDIR/src/make.env ]
234 then
235 echo ""
236 echo "If the files are unarchived ok, you should edit the file"
237 echo $WXDIR"/src/make.env"
238 echo "since this sets many options for your wxWindows"
239 echo "compilation environment."
240 echo ""
241 echo "Would you like to edit the file now? (y/n)"
242 echo
243 read ans
244 if [ "$ans" = "y" ]
245 then
246 $MYEDITOR $WXDIR/src/make.env
247 echo ""
248 echo Ok, if you get compilation or link errors in the installation,
249 echo $WXDIR"/src/make.env is the first place to look."
250 echo ""
251 echo "Press return to continue."
252 read ans
253 fi
254 else
255 echo ""
256 echo "Uh-oh, cannot find "$WXDIR"/src/make.env; probably you have not unarchived"
257 echo "properly yet."
258 echo ""
259 echo "Press return to continue."
260 read ans
261 fi
262 }
263
264 install_from_archive()
265 {
266 echo
267 echo "Install from Archive"
268 echo "--------------------"
269
270 echo "1) Install from "$ARCHIVE"gen.zip, "$ARCHIVE"mot.zip"
271 echo " and "$ARCHIVE"htm.zip if present."
272 echo "2) Install from "$ARCHIVE"gen.tgz, "$ARCHIVE"mot.tgz"
273 echo " and "$ARCHIVE"htm.tgz if present."
274 echo "0) Quit."
275 echo
276 read archans
277
278 if [ "$archans" = "1" ]
279 then
280 install_from_zip
281 fi
282 if [ "$archans" = "2" ]
283 then
284 install_from_gzip
285 fi
286 }
287
288 make_main_library()
289 {
290 if [ ! -d $WXDIR/src ]
291 then
292 echo "Source directory not found: please unarchive first."
293 echo Press return to continue.
294 read ans
295 else
296 echo
297 echo Making the wxWindows main library. It will go in
298 echo $WXDIR/lib.
299 echo
300 echo Please press RETURN to continue, and then make yourself a coffee.
301 echo
302 read ans
303 if [ ! -d $WXDIR/lib ]
304 then
305 mkdir $WXDIR/lib
306 fi
307
308 cd $WXDIR/src/motif
309 make -f makefile.unx $GUITARGET 2>&1 | tee -a $CURRENTDIR/make.log
310 cd $CURRENTDIR
311
312 if [ -f $WXDIR/lib/libwx$GUISUFFIX".a" ]
313 then
314 echo
315 echo "If you saw no errors, wxWindows was compiled. See the file make.log"
316 echo "for errors and warnings."
317 else
318 echo
319 echo $WXDIR/lib/libwx$GUISUFFIX".a was not built."
320 echo "Please check make.env, and read install.txt and faq.txt/ps."
321 echo
322 echo "Press return to continue."
323 echo
324 read ans
325 fi
326 fi
327 }
328
329 ###############################################################
330 # Make peripheral components #
331 ###############################################################
332
333 make_wxtree()
334 {
335 if [ ! -d $WXDIR/utils/wxtree ]
336 then
337 echo wxTree directory does not exist.
338 echo Press return to continue.
339 read ans
340 else
341 echo
342 echo Making the wxTree library. It will go in
343 echo $WXDIR/utils/wxtree/lib.
344 echo
345 cd $WXDIR/utils/wxtree/src
346 make -f makefile.unx $GUITARGET 2>&1 | tee $CURRENTDIR/make.log
347 cd $CURRENTDIR
348 echo
349 echo "If you saw no errors, the wxTree library was compiled. See the file make.log"
350 echo "for errors and warnings."
351 fi
352 }
353
354 make_wxgraph()
355 {
356 if [ ! -d $WXDIR/utils/wxgraph ]
357 then
358 echo wxGraph directory does not exist.
359 echo Press return to continue.
360 read ans
361 else
362 echo
363 echo Making the wxGraph library. It will go in
364 echo $WXDIR/utils/wxgraph/lib.
365 echo
366 cd $WXDIR/utils/wxgraph/src
367 make -f makefile.unx $GUITARGET 2>&1 | tee $CURRENTDIR/make.log
368 cd $CURRENTDIR
369 echo
370 echo "If you saw no errors, the wxGraph library was compiled. See the file make.log"
371 echo "for errors and warnings."
372 fi
373 }
374
375 make_colour()
376 {
377 if [ ! -d $WXDIR/utils/colours ]
378 then
379 echo $WXDIR/utils/colours directory does not exist.
380 echo Press return to continue.
381 read ans
382 else
383 echo
384 echo Making the Colour sampler. It will go in
385 echo $WXDIR/utils/colours
386 echo
387 cd $WXDIR/utils/colours
388 make -f makefile.unx $GUITARGET 2>&1 | tee $CURRENTDIR/make.log
389 cd $CURRENTDIR
390 echo
391 echo "If you saw no errors, the Colour sampler was compiled. See the file make.log"
392 echo "for errors and warnings."
393 echo ""
394 if [ -f $WXDIR/utils/colours/colours$GUISUFFIX ]
395 then
396 echo "Run the Colour sampler? (y/n)"
397 echo ""
398 read ans1
399 if [ "$ans1" = "y" ]
400 then
401 $WXDIR/utils/colours/colours$GUISUFFIX
402 fi
403 fi
404 fi
405 }
406
407 make_wxhelp()
408 {
409 if [ ! -d $WXDIR/utils/wxhelp ]
410 then
411 echo wxHelp directory does not exist.
412 echo Press return to continue.
413 read ans
414 else
415 echo
416 echo Making the wxHelp program. It will go in
417 echo $WXDIR/utils/wxhelp/src.
418 echo
419 cd $WXDIR/utils/wxhelp/src
420 make -f makefile.unx $GUITARGET 2>&1 | tee $CURRENTDIR/make.log
421 cd $CURRENTDIR
422 echo
423 echo "If you saw no errors, the wxHelp program was compiled. See the file make.log"
424 echo "for errors and warnings."
425 fi
426 }
427
428 make_tex2rtf()
429 {
430 if [ ! -d $WXDIR/utils/tex2rtf ]
431 then
432 echo Tex2RTF directory does not exist.
433 echo Press return to continue.
434 read ans
435 else
436 echo
437 echo Making the Tex2RTF utility. It will go in
438 echo $WXDIR/utils/tex2rtf/src.
439 echo
440 cd $WXDIR/utils/tex2rtf/src
441 make -f makefile.unx $GUITARGET 2>&1 | tee $CURRENTDIR/make.log
442 cd $CURRENTDIR
443 echo
444 echo "If you saw no errors, the Tex2RTF program was compiled. See the file make.log"
445 echo "for errors and warnings."
446 fi
447 }
448
449 ###############################################################
450 # Make samples #
451 ###############################################################
452
453 make_controls()
454 {
455 echo
456 echo Making the Controls sample. It will be made as
457 echo $WXDIR/samples/controls/controls$GUISUFFIX
458 echo
459 cd $WXDIR/samples/constrols
460 make -f makefile.unx $GUITARGET 2>&1 | tee $CURRENTDIR/make.log
461 cd $CURRENTDIR
462 echo
463 echo "If you saw no errors, the Controls sample was compiled. See the file make.log"
464 echo "for errors and warnings."
465 }
466
467 make_minimal()
468 {
469 echo
470 echo Making the Minimal sample. It will be made as
471 echo $WXDIR/samples/minimal/minimal$GUISUFFIX
472 echo
473 cd $WXDIR/samples/minimal
474 make -f makefile.unx $GUITARGET 2>&1 | tee $CURRENTDIR/make.log
475 cd $CURRENTDIR
476 echo
477 echo "If you saw no errors, the Minimal sample was compiled. See the file make.log"
478 echo "for errors and warnings."
479 }
480
481 make_mdi()
482 {
483 echo
484 echo Making the Mdi sample. It will be made as
485 echo $WXDIR/samples/mdi/mdi$GUISUFFIX
486 echo
487 cd $WXDIR/samples/mdi
488 make -f makefile.unx $GUITARGET 2>&1 | tee $CURRENTDIR/make.log
489 cd $CURRENTDIR
490 echo
491 echo "If you saw no errors, the MDI sample was compiled. See the file make.log"
492 echo "for errors and warnings."
493 }
494
495 make_animate()
496 {
497 echo
498 echo Making the Animate sample. It will be made as
499 echo $WXDIR/samples/animate/anim$GUISUFFIX
500 echo
501 cd $WXDIR/samples/animate
502 make -f makefile.unx $GUITARGET 2>&1 | tee $CURRENTDIR/make.log
503 cd $CURRENTDIR
504 echo
505 echo "If you saw no errors, the Animate sample was compiled. See the file make.log"
506 echo "for errors and warnings."
507 }
508
509 make_fractal()
510 {
511 echo
512 echo Making the Fractal sample. It will be made as
513 echo $WXDIR/samples/fractal/fractal$GUISUFFIX
514 echo
515 cd $WXDIR/samples/fractal
516 make -f makefile.unx $GUITARGET 2>&1 | tee $CURRENTDIR/make.log
517 cd $CURRENTDIR
518 echo
519 echo "If you saw no errors, the Fractal sample was compiled. See the file make.log"
520 echo "for errors and warnings."
521 }
522
523 make_all_periph_components()
524 {
525 make_wxtree
526 # make_dialoged
527 # make_wxgraph
528 # make_wxhelp
529 # make_tex2rtf
530 }
531
532 about_periph_components()
533 {
534 clear
535 echo "About the Peripheral Components"
536 echo "-------------------------------"
537 echo
538 echo "These are libraries and programs that are considered useful"
539 echo "enough to put in the main wxWindows distribution."
540 echo
541 echo wxTree A tree-drawing library, with sample
542 echo ------
543 echo
544 # echo wxGraph A node and arc graph-drawing library, with sample
545 # echo -------
546 # echo
547 # echo "Press return to continue"
548 # read ans
549 # clear
550 # echo wxHelp The wxWindows on-line help program
551 # echo ------
552 # echo
553 # echo
554 # echo "Tex2RTF LaTeX->RTF, HTML converter"
555 # echo -------
556 # echo
557 echo "Press return to continue"
558 read ans
559 clear
560 }
561
562 make_peripheral_components()
563 {
564 compoption='none'
565 while [ "$compoption" != "0" ]
566 do
567 echo
568 echo "Peripheral Component Options"
569 echo "----------------------------"
570 echo " 1) Make wxTree layout library"
571 echo "10) Make all the above"
572 echo "----------------------------"
573 echo " ?) About these components"
574 echo "----------------------------"
575 echo " 0) Quit."
576 echo
577 read compoption
578
579 if [ "$compoption" = "1" ]
580 then
581 make_wxtree
582 fi
583 if [ "$compoption" = "10" ]
584 then
585 make_all_periph_components
586 fi
587 if [ "$compoption" = "?" ]
588 then
589 about_periph_components
590 fi
591 done
592 }
593
594 make_all_samples()
595 {
596 echo
597 echo "Note: compiling all samples is going to use up bags of disk space."
598 echo "Continue? (y/n)"
599 echo
600 read ans
601
602 if [ "$ans" = "y" ]
603 then
604 cd $WXDIR/samples
605 make -f makefile.unx all$GUISUFFIX
606 fi
607 }
608
609 make_samples()
610 {
611 compoption='none'
612 while [ "$compoption" != "0" ]
613 do
614 echo
615 echo "Sample compilation options"
616 echo "------------------------"
617 echo "1) Make Minimal sample"
618 echo "2) Make MDI sample
619 echo "3) Make all samples"
620 echo "4) Run a sample"
621 echo "------------------------"
622 echo "0) Quit."
623 echo
624 read compoption
625
626 if [ "$compoption" = "1" ]
627 then
628 make_minimal
629 fi
630 if [ "$compoption" = "2" ]
631 then
632 make_mdi
633 fi
634 if [ "$compoption" = "3" ]
635 then
636 make_all_samples
637 fi
638 if [ "$compoption" = "4" ]
639 then
640 run_samples
641 fi
642 done
643 }
644
645 # Find a platform filename, using 'arg' as input and output
646 platform_filename()
647 {
648 case "$arg" in
649 1) arg=$PLATFORMFILE1;;
650 2) arg=$PLATFORMFILE2;;
651 3) arg=$PLATFORMFILE3;;
652 4) arg=$PLATFORMFILE4;;
653 5) arg=$PLATFORMFILE5;;
654 6) arg=$PLATFORMFILE6;;
655 7) arg=$PLATFORMFILE7;;
656 8) arg=$PLATFORMFILE8;;
657 9) arg=$PLATFORMFILE9;;
658 10) arg=$PLATFORMFILE10;;
659 11) arg=$PLATFORMFILE11;;
660 12) arg=$PLATFORMFILE12;;
661 13) arg=$PLATFORMFILE13;;
662 14) arg=$PLATFORMFILE14;;
663 15) arg=$PLATFORMFILE15;;
664 16) arg=$PLATFORMFILE16;;
665 17) arg=$PLATFORMFILE17;;
666 18) arg=$PLATFORMFILE18;;
667 19) arg=$PLATFORMFILE19;;
668 20) arg=$PLATFORMFILE20;;
669 *) arg=''
670 esac
671 }
672
673 platform_description()
674 {
675 case "$arg" in
676 1) arg=$PLATFORM1;;
677 2) arg=$PLATFORM2;;
678 3) arg=$PLATFORM3;;
679 4) arg=$PLATFORM4;;
680 5) arg=$PLATFORM5;;
681 6) arg=$PLATFORM6;;
682 7) arg=$PLATFORM7;;
683 8) arg=$PLATFORM8;;
684 9) arg=$PLATFORM9;;
685 10) arg=$PLATFORM10;;
686 11) arg=$PLATFORM11;;
687 12) arg=$PLATFORM12;;
688 13) arg=$PLATFORM13;;
689 14) arg=$PLATFORM14;;
690 15) arg=$PLATFORM15;;
691 16) arg=$PLATFORM16;;
692 17) arg=$PLATFORM17;;
693 18) arg=$PLATFORM18;;
694 19) arg=$PLATFORM19;;
695 20) arg=$PLATFORM20;;
696 *) arg=''
697 esac
698 }
699
700 ###############################################################
701 # Select a platform
702 ###############################################################
703
704 select_platform()
705 {
706 echo
707 echo "Select a platform"
708 echo "----------------------------"
709 echo "Note: this copies a file from $WXDIR/src/makeenvs"
710 echo "to $WXDIR/src/make.env. If you have"
711 echo "restarted the installation, the current option listed"
712 echo "may not reflect the current make.env."
713 echo
714 echo "You may wish to edit a .env file in $WXDIR/src/makeenvs"
715 echo "instead of src/make.env, which might be overwritten in future"
716 echo "installations."
717 echo
718 echo "In any event, a backup of make.env is made (make.bak) before it is"
719 echo "overwritten."
720 echo
721 echo "Please press return to continue."
722 read dummy
723
724 compoption='none'
725 selectdone=0
726 while [ "$selectdone" = "0" ]
727 do
728 echo
729 echo "Select a platform"
730 echo "----------------------------"
731 echo
732
733 i=1
734 while [ $i -le $PLATFORMCOUNT ]
735 do
736 arg=$i
737 platform_description
738 plat=$arg
739 markit=" "
740 if [ "$PLATFORM" = "$i" ]
741 then
742 markit="*"
743 fi
744 echo " "$markit" "$i") "$plat
745 i=`expr $i + 1`
746 done
747 echo
748 echo " e) Edit the current src/make.env"
749 echo
750 echo "Enter a choice, return for default: "
751 read compoption
752
753 if [ "$compoption" = "e" ]
754 then
755 $MYEDITOR $WXDIR/src/make.env
756 else
757 if [ "$compoption" != "" ]
758 then
759 arg=$compoption
760 platform_description
761 plat=$arg
762
763 arg=$compoption
764 platform_filename
765 platfile=$arg
766
767 if [ "$platfile" != "" ]
768 then
769 if [ ! -f $WXDIR"/src/makeenvs/"$platfile ]
770 then
771 echo "Sorry, this platform is not catered for yet."
772 echo "Try using the generic settings instead."
773 echo ""
774 echo "Press return to continue."
775 read dummy
776 else
777 selectdone=1
778 PLATFORM=$compoption
779 cp -f $WXDIR/src/make.env $WXDIR/src/make.bak
780 cp -f $WXDIR/src/makeenvs/$platfile $WXDIR/src/make.env
781 fi
782 fi
783 else
784 selectdone=1
785 fi
786 fi
787 done
788 }
789
790 ###############################################################
791 # Run samples #
792 ###############################################################
793
794 run_controls()
795 {
796 if [ ! -f $WXDIR"/samples/controls/controls"$GUISUFFIX ]
797 then
798 echo The Controls sample has not been compiled yet.
799 else
800 echo
801 echo "Running "$WXDIR"/samples/controls/controls"$GUISUFFIX
802 echo
803 cd $WXDIR"/samples/controls"
804 "controls"$GUISUFFIX
805 cd $CURRENTDIR
806 fi
807 }
808
809 run_minimal()
810 {
811 if [ ! -f $WXDIR"/samples/minimal/minimal"$GUISUFFIX ]
812 then
813 echo The Minimal sample has not been compiled yet.
814 else
815 echo
816 echo "Running "$WXDIR"/samples/minimal/minimal"$GUISUFFIX
817 echo
818 cd $WXDIR"/samples/minimal"
819 "minimal"$GUISUFFIX
820 cd $CURRENTDIR
821 fi
822 }
823
824 run_form()
825 {
826 if [ ! -f $WXDIR"/samples/form/form"$GUISUFFIX ]
827 then
828 echo The Form sample has not been compiled yet.
829 else
830 echo
831 echo "Running "$WXDIR"/samples/form/form"$GUISUFFIX
832 echo
833 cd $WXDIR"/samples/form"
834 "form"$GUISUFFIX
835 cd $CURRENTDIR
836 fi
837 }
838
839 run_animate()
840 {
841 if [ ! -f $WXDIR"/samples/animate/anim"$GUISUFFIX ]
842 then
843 echo The Animate sample has not been compiled yet.
844 else
845 echo
846 echo "Running "$WXDIR"/samples/animate/anim"$GUISUFFIX
847 echo
848 cd $WXDIR"/samples/animate"
849 "anim"$GUISUFFIX
850 cd $CURRENTDIR
851 fi
852 }
853
854 run_fractal()
855 {
856 if [ ! -f $WXDIR"/samples/fractal/fractal"$GUISUFFIX ]
857 then
858 echo The Fractal sample has not been compiled yet.
859 else
860 echo
861 echo "Running "$WXDIR"/samples/fractal/fractal"$GUISUFFIX
862 echo
863 cd $WXDIR"/samples/fractal"
864 "fractal"$GUISUFFIX
865 cd $CURRENTDIR
866 fi
867 }
868
869 run_ipc()
870 {
871 if [ ! -f $WXDIR"/samples/ipc/client"$GUISUFFIX ]
872 then
873 echo The IPC samples have not been compiled yet.
874 else
875 echo
876 echo "Running "$WXDIR"/samples/ipc/client"$GUISUFFIX,
877 echo " "$WXDIR"/samples/ipc/server"$GUISUFFIX
878 echo
879 cd $WXDIR"/samples/ipc"
880 echo "Starting server..."
881 "server"$GUISUFFIX &
882 echo "Waiting 10 seconds..."
883 sleep 10
884 echo "Starting client..."
885 "client"$GUISUFFIX
886 cd $CURRENTDIR
887 fi
888 }
889
890 run_samples()
891 {
892 runoption='none'
893 while [ "$runoption" != "0" ]
894 do
895 echo
896 echo "Run a wxWindows sample"
897 echo "--------------------"
898 echo "Note: this is a small selection. For more, please"
899 echo "browse the samples subdirectory."
900 echo
901 echo "1) Run Minimal sample"
902 echo "2) Run MDI sample"
903 echo "--------------------"
904 echo "0) Quit."
905 echo
906 read runoption
907
908 if [ "$runoption" = "1" ]
909 then
910 run_minimal
911 fi
912 if [ "$runoption" = "2" ]
913 then
914 run_mdi
915 fi
916 done
917 }
918
919 make_all()
920 {
921 make_main_library
922 make_all_periph_components
923 make_all_samples
924 }
925
926 remove_component()
927 {
928 if [ -d $COMPONENT ]
929 then
930 echo "Remove "$COMPONENT": are you sure? (y/n) "
931 echo
932 read ans
933 if [ "$ans" = "y" ]
934 then
935 rm -f -r $COMPONENT
936 fi
937 fi
938 }
939
940 remove_components()
941 {
942 compoption='none'
943 while [ "$compoption" != "0" ]
944 do
945 if [ -f $WXDIR/docs/pdf/wx.pdf ]
946 then
947 PDFMANUALSOK="*"
948 else
949 PDFMANUALSOK=" "
950 fi
951
952 if [ -f $WXDIR/docs/html/wx/wx.htm ]
953 then
954 HTMLMANUALSOK="*"
955 else
956 HTMLMANUALSOK=" "
957 fi
958
959 if [ -d $WXDIR/utils/wxtree ]
960 then
961 WXTREEOK="*"
962 else
963 WXTREEOK=" "
964 fi
965
966 # if [ -d $WXDIR/utils/wxgraph ]
967 # then
968 # WXGRAPHOK="*"
969 # else
970 # WXGRAPHOK=" "
971 # fi
972 #
973 # if [ -d $WXDIR/utils/wxhelp ]
974 # then
975 # WXHELPOK="*"
976 # else
977 # WXHELPOK=" "
978 # fi
979 #
980 # if [ -d $WXDIR/utils/tex2rtf ]
981 # then
982 # TEX2RTFOK="*"
983 # else
984 # TEX2RTFOK=" "
985 # fi
986
987 if [ -d $WXDIR/utils/dialoged ]
988 then
989 DIALOGEDOK="*"
990 else
991 DIALOGEDOK=" "
992 fi
993
994 echo
995 echo "Remove a wxWindows component (* means it's installed)"
996 echo "-----------------------------------------------------"
997 echo "wxWindows currently takes up this many KB:"
998 du -s $WXDIR
999 echo "-----------------------------------------------------"
1000 echo " 1) "$PDFMANUALSOK"Remove PDF manuals"
1001 echo " 2) "$HTMLMANUALSOK"Remove HTML manuals"
1002 echo " 3) "$WXTREEOK"Remove wxTree library"
1003 # echo " 4) "$WXGRAPHOK"Remove wxGraph library"
1004 # echo " 8) "$TEX2RTFOK"Remove Tex2RTF/HTML/WinHelp/wxHelp converter"
1005 echo " 4) "$DIALOGEDOK"Remove Dialog Editor"
1006 echo "------------------------------------------------------"
1007 echo " 0) Quit."
1008 echo
1009 read compoption
1010
1011 if [ "$compoption" = "1" ]
1012 then
1013 rm -f -r $WXDIR/pdf
1014 fi
1015 if [ "$compoption" = "2" ]
1016 then
1017 rm -f -r $WXDIR/html
1018 fi
1019 if [ "$compoption" = "3" ]
1020 then
1021 COMPONENT=$WXDIR/utils/wxtree
1022 remove_component
1023 fi
1024 if [ "$compoption" = "4" ]
1025 then
1026 COMPONENT=$WXDIR/utils/dialoged
1027 remove_component
1028 fi
1029 done
1030 }
1031
1032 clean_component()
1033 {
1034 if [ -d $COMPONENT ]
1035 then
1036 cd $COMPONENT
1037 make -f makefile.unx clean$GUISUFFIX
1038 cd $CURRENTDIR
1039 fi
1040 }
1041
1042 clean_samples()
1043 {
1044 cd $WXDIR/samples
1045 make -f makefile.unx clean$GUISUFFIX
1046 cd $CURRENTDIR
1047 }
1048
1049 # -f $WXDIR/samples/pressup/pressup$GUISUFFIX -o \
1050 # -f $WXDIR/samples/bombs/bombs$GUISUFFIX -o \
1051 # -f $WXDIR/samples/fractal/fractal$GUISUFFIX -o \
1052 # -f $WXDIR/samples/animate/anim$GUISUFFIX -o \
1053 # -f $WXDIR/samples/ipc/server$GUISUFFIX -o \
1054
1055 clean_components()
1056 {
1057 compoption='none'
1058 olddu=""
1059 while [ "$compoption" != "0" ]
1060 do
1061 if [ -f $WXDIR/samples/controls/controls$GUISUFFIX -o \
1062 -f $WXDIR/samples/forty/forty$GUISUFFIX -o \
1063 -f $WXDIR/samples/splitter/splitter$GUISUFFIX -o \
1064 -f $WXDIR/samples/docview/docview$GUISUFFIX -o \
1065 -f $WXDIR/samples/wxpoem/wxpoem$GUISUFFIX -o \
1066 -f $WXDIR/samples/printing/printing$GUISUFFIX -o \
1067 -f $WXDIR/samples/resource/resource$GUISUFFIX -o \
1068 -f $WXDIR/samples/layout/layout$GUISUFFIX -o \
1069 -f $WXDIR/samples/toolbar/test$GUISUFFIX -o \
1070 -f $WXDIR/samples/dialogs/dialogs$GUISUFFIX -o \
1071 -f $WXDIR/samples/types/types$GUISUFFIX -o \
1072 -f $WXDIR/samples/mdi/mdi$GUISUFFIX -o \
1073 -f $WXDIR/samples/minimal/minimal$GUISUFFIX ]
1074 then
1075 SAMPLESOK="*"
1076 else
1077 SAMPLESOK=" "
1078 fi
1079
1080 if [ -f $WXDIR/lib/libwx$GUISUFFIX".a" ]
1081 then
1082 WXOK="*"
1083 else
1084 WXOK=" "
1085 fi
1086
1087 if [ -f $WXDIR/utils/tex2rtf/src/objects$GUISUFFIX/tex2rtf.o ]
1088 then
1089 TEX2RTFOK="*"
1090 else
1091 TEX2RTFOK=" "
1092 fi
1093
1094 if [ -f $WXDIR/utils/dialoged/src/dialoged$GUISUFFIX ]
1095 then
1096 DIALOGEDOK="*"
1097 else
1098 DIALOGEDOK=" "
1099 fi
1100
1101 echo
1102 echo "Cleanup a wxWindows component (* means objects/binaries exist, - means unknown)"
1103 echo "-----------------------------------------------------"
1104 echo "wxWindows currently takes up this many KB:"
1105 newdu=`du -s $WXDIR`
1106 if [ "$olddu" = "" ]
1107 then
1108 theline=$newdu
1109 else
1110 theline=$newdu" (previous usage was "$olddu")"
1111 fi
1112 echo $theline
1113 olddu=$newdu
1114 echo "-----------------------------------------------------"
1115 echo " 1) "$WXOK"Clean wxWindows library"
1116 echo " 2) "$SAMPLESOK"Clean all wxWindows samples"
1117 echo " 3) -Clean all utilities"
1118 echo " 4) "$TEX2RTFOK"Clean Tex2RTF/HTML/WinHelp/wxHelp converter"
1119 echo " 5) "$DIALOGEDOK"Clean Dialoged Editor tool"
1120 echo "------------------------------------------------------"
1121 echo " 0) Quit."
1122 echo
1123 read compoption
1124
1125 if [ "$compoption" = "1" ]
1126 then
1127 COMPONENT=$WXDIR/src/x
1128 clean_component
1129 fi
1130 if [ "$compoption" = "2" ]
1131 then
1132 cd $WXDIR/samples
1133 make -f makefile.unx clean$GUISUFFIX
1134 cd $CURRENTDIR
1135 fi
1136 if [ "$compoption" = "3" ]
1137 then
1138 cd $WXDIR/utils
1139 make -f makefile.unx clean$GUISUFFIX
1140 cd $CURRENTDIR
1141 fi
1142 if [ "$compoption" = "4" ]
1143 then
1144 COMPONENT=$WXDIR/utils/tex2rtf/src
1145 clean_component
1146 fi
1147 if [ "$compoption" = "5" ]
1148 then
1149 COMPONENT=$WXDIR/utils/dialoged/src
1150 clean_component
1151 fi
1152 done
1153 }
1154
1155 # Select a target
1156 select_target()
1157 {
1158 compoption='none'
1159 selectdone=0
1160 while [ "$selectdone" = "0" ]
1161 do
1162 echo
1163 echo "Select a target"
1164 echo "---------------"
1165 echo " 1) Motif"
1166 echo
1167 read compoption
1168
1169 if [ "$compoption" = "1" ]
1170 then
1171 selectdone=1
1172 GUITARGET=motif
1173 GUISUFFIX=_motif
1174 fi
1175 done
1176 }
1177
1178 # Select a target
1179 select_dir()
1180 {
1181 echo ""
1182 echo "Select wxWindows directory"
1183 echo "--------------------------"
1184 echo ""
1185 echo "Current directory: " $WXDIR
1186 echo ""
1187 echo "New directory: (return for existing value):"
1188 read inp
1189 if [ "$inp" != "" ]
1190 then
1191 WXDIR=$inp
1192 fi
1193 }
1194
1195 ### View manual ###
1196
1197 view_manual()
1198 {
1199 if [ ! -d $WXDIR ]
1200 then
1201 echo "Sorry -- you must unarchive the distribution before you can"
1202 echo "look at the manual."
1203 else
1204 manoption='none'
1205 while [ "$manoption" != "0" ]
1206 do
1207 echo
1208 echo "View wxWindows documentation"
1209 echo "----------------------------"
1210 echo "1) The installation instructions, using "$MYPAGER
1211 echo "2) readme.txt, using "$MYPAGER
1212 echo "3) The change log, using "$MYPAGER
1213 echo "4) The HTML manual hierarchy, using $HTMLVIEWER"
1214 echo "--------------------"
1215 echo "0) Quit."
1216 echo
1217 read manoption
1218
1219 if [ "$manoption" = "1" ]
1220 then
1221 if [ -f $WXDIR"/docs/motif/install.txt" ]
1222 then
1223 $MYPAGER $WXDIR/docs/motif/install.txt
1224 else
1225 if [ -f "install.txt" ]
1226 then
1227 $MYPAGER "install.txt"
1228 else
1229 if [ -f $WXDIR/"install.txt" ]
1230 then
1231 $MYPAGER $WXDIR/"install.txt"
1232 else
1233 echo
1234 echo "Sorry, cannot find install.txt. Perhaps you did not ftp"
1235 echo "it along with the archives, and/or you haven't unarchived"
1236 echo "the sources yet. Please press return to continue."
1237 echo
1238 read ans
1239 fi
1240 fi
1241 fi
1242 fi
1243 if [ "$manoption" = "2" ]
1244 then
1245 if [ -f $WXDIR"/docs/motif/readme.txt" ]
1246 then
1247 $MYPAGER $WXDIR/docs/motif/readme.txt
1248 else
1249 if [ -f "readme.txt" ]
1250 then
1251 $MYPAGER "readme.txt"
1252 else
1253 if [ -f $WXDIR/"readme.txt" ]
1254 then
1255 $MYPAGER $WXDIR/"readme.txt"
1256 else
1257 echo
1258 echo "Sorry, cannot find readme.txt. Perhaps you did not ftp"
1259 echo "it along with the archives, and/or you haven't unarchived"
1260 echo "the sources yet. Please press return to continue."
1261 echo
1262 read ans
1263 fi
1264 fi
1265 fi
1266 fi
1267 if [ "$manoption" = "3" ]
1268 then
1269 if [ -f $WXDIR"/docs/motif/changes.txt" ]
1270 then
1271 $MYPAGER $WXDIR/docs/motif/changes.txt
1272 else
1273 if [ -f "changes.txt" ]
1274 then
1275 $MYPAGER "changes.txt"
1276 else
1277 if [ -f $WXDIR/"changes.txt" ]
1278 then
1279 $MYPAGER $WXDIR/"changes.txt"
1280 else
1281 echo
1282 echo "Sorry, cannot find changes.txt. Perhaps you did not ftp"
1283 echo "it along with the archives, and/or you haven't unarchived"
1284 echo "the sources yet. Please press return to continue."
1285 echo
1286 read ans
1287 fi
1288 fi
1289 fi
1290 fi
1291 if [ "$manoption" = "4" ]
1292 then
1293 $HTMLVIEWER $WXDIR"/docs/html/index.htm"
1294 fi
1295 done
1296 fi
1297 }
1298
1299 preliminary_notes()
1300 {
1301 selectdone1=0
1302 ans="n"
1303 while [ "$ans" != "y" ]
1304 do
1305 # clear
1306 echo
1307 echo The GUI target is GUITARGET=$GUITARGET "."
1308 echo
1309 echo The directory to install to is WXDIR=$WXDIR
1310 echo
1311 arg=$PLATFORM
1312 platform_description
1313 echo The selected platform is $arg
1314 echo
1315 echo "Please check these settings carefully."
1316 echo "Are they correct for your system? (y/n)"
1317 echo
1318
1319 read ans
1320
1321 if [ "$ans" != "y" ]
1322 then
1323 select_target
1324 select_dir
1325 select_platform
1326 fi
1327 done
1328
1329 clear
1330 echo ""
1331 echo "Configuring wxWindows"
1332 echo "---------------------"
1333 echo ""
1334 echo "Most makefile settings to do with compilers, platforms and"
1335 echo "directories are kept in "$WXDIR"/src/make.env."
1336 echo ""
1337 echo "If you get a compiler error or warning, please strongly"
1338 echo "suspect this file, and if necessary edit it from the first"
1339 echo "option on the Main Menu."
1340 echo ""
1341 echo "Some suggestions for settings are contained in make.env,"
1342 echo "and further information is in "$WXDIR"/install/install.txt."
1343 echo
1344 echo wxWindows itself can be tailored to remove certain features
1345 echo "(such as PostScript support), or select library preferences, by"
1346 echo "editing the file "$WXDIR"/include/wx/motif/setup.h."
1347 echo
1348 echo The setup.h defaults are probably ok for now though.
1349 echo
1350 echo "Please press return to continue."
1351 read ans
1352 echo
1353 clear
1354 echo ""
1355 echo "Configuring wxWindows (cont'd)"
1356 echo "--------------------- --------"
1357 echo ""
1358 echo "By default (at least for GNU compiler use), debugging information"
1359 echo "is included. This will make the libraries and binaries"
1360 echo "a lot bigger than if you left debugging information out."
1361 echo
1362 echo "So you might want to set DEBUG to nothing in make.env"
1363 echo "to disable debugging information, at least for a first look at wxWindows."
1364 echo
1365 echo "Please press return to continue."
1366 read ans
1367 echo
1368 clear
1369 echo
1370 echo "You may wish to choose 'View documentation' now..."
1371 }
1372
1373 ############# MAIN BIT OF THE SCRIPT #################
1374 clear
1375 echo
1376 echo "-------------------------------------------"
1377 echo "Welcome to the wxWindows 2.0 installation."
1378 echo "-------------------------------------------"
1379 echo
1380 echo "This script will install from the archives:"
1381 echo ""
1382 echo " "$ARCHIVE"gen.zip, "$ARCHIVE"mot.zip"
1383 echo ""
1384 echo "and, if present, HTML and PDF archives."
1385 echo ""
1386 echo "This installation is best done from a new directory where"
1387 echo "wxWindows will be installed, and which contains the .zip files."
1388 echo "For example, ~/wx."
1389
1390 select_dir
1391
1392 if [ ! -f $WXDIR/src/make.env ]
1393 then
1394 install_from_archive
1395 fi
1396
1397 preliminary_notes
1398
1399 useroption='none'
1400 while [ "$useroption" != "0" ]
1401 do
1402 echo
1403 echo "wxWindows Installation Main Menu"
1404 echo "--------------------------------"
1405 echo
1406 echo " 1) Install from archive."
1407 echo " 2) Make main wxWindows library."
1408 echo " 3) Make a peripheral component."
1409 echo " 4) Make a sample."
1410 echo " 5) Make absolutely everything."
1411 echo " 6) Run a sample."
1412 echo " 7) View documentation."
1413 echo " 8) Clean objects/binaries, saving space."
1414 echo " 9) Remove wxWindows components from disk."
1415 echo "10) Edit make.env."
1416 echo "11) Change the selected target platform"
1417 echo "-----------------------------------"
1418 echo " 0) Exit from installation."
1419 echo
1420 read useroption
1421
1422 if [ "$useroption" = "1" ]
1423 then
1424 install_from_archive
1425 fi
1426 if [ "$useroption" = "2" ]
1427 then
1428 make_main_library
1429 fi
1430 if [ "$useroption" = "3" ]
1431 then
1432 make_peripheral_components
1433 fi
1434 if [ "$useroption" = "4" ]
1435 then
1436 make_samples
1437 fi
1438 if [ "$useroption" = "5" ]
1439 then
1440 make_all
1441 fi
1442 if [ "$useroption" = "6" ]
1443 then
1444 run_samples
1445 fi
1446 if [ "$useroption" = "7" ]
1447 then
1448 view_manual
1449 fi
1450 if [ "$useroption" = "8" ]
1451 then
1452 clean_components
1453 fi
1454 if [ "$useroption" = "9" ]
1455 then
1456 remove_components
1457 fi
1458 if [ "$useroption" = "10" ]
1459 then
1460 edit_make_env
1461 fi
1462 if [ "$useroption" = "11" ]
1463 then
1464 select_platform
1465 fi
1466 done
1467 clear
1468 echo ""
1469 echo "Goodbye! I hope your wxWindows installation was successful."
1470 echo ""
1471 echo "You can subscribe to the mailing list wxwin-users"
1472 echo "for further assistance from experienced users."
1473 echo ""
1474 echo "Information is also available via the World Wide Web at:"
1475 echo ""
1476 echo "http://web.ukonline.co.uk/julian.smart/wxwin"
1477 echo ""
1478 echo "If all else fails, please contact me, Julian Smart, at:"
1479 echo ""
1480 echo "julian.smart@ukonline.co.uk"
1481 echo ""
1482 echo "If you have any suggestions, bug reports or patches,"
1483 echo "please email me at the above address."
1484 echo ""
1485
1486