]> git.karo-electronics.de Git - karo-tx-redboot.git/blob - packages/services/gfx/mw/v2_0/src/xconfigure
Cleanup CVS ipmorted branch
[karo-tx-redboot.git] / packages / services / gfx / mw / v2_0 / src / xconfigure
1 #!/usr/bin/wish -f
2 #
3 # Microwindows configuration interface: X11 version
4 #
5 # wish is available at http://dev.scriptics.com/software/tcltck
6 #
7 # (C) Martin Jolicoeur, 1999
8 #
9 # Thu Mar 16 14:33:08 CET 2000, Fabio Parodi, <fabio.parodi@iname.com>
10 #       added VTSWITCH button
11 #
12 #
13
14 set configfile 0;
15
16 # Configurable options
17 variable arch;
18 variable armtoolsprefix;
19 variable mipstoolsprefix;
20 variable rtemstoolsprefix;
21 variable optimize;
22 variable debug;
23 variable verbose
24 variable microwin;
25 variable nanox;
26 variable shlibs;
27 variable objframe;
28 variable nwidget;
29 variable microwindemo;
30 variable nanoxdemo;
31 variable screenpixtype;
32 variable server;
33 variable sharedmem;
34 variable havefileio;
35 variable havebmp;
36 variable havejpg;
37 variable incjpg;
38 variable libjpg;
39 variable haveft;
40 variable incft;
41 variable libft;
42 variable havet1;
43 variable inct1;
44 variable libt1;
45
46 variable havehzk;
47 variable hzkdir;
48 variable hzkfontsize;
49
50 variable updateregions;
51 variable erasemove;
52 variable havemsfonts;
53 variable graypalette;
54 variable screenlinux;
55 variable vgafb;
56 variable portraitfb;
57 variable x11e15;
58 variable x11screenwidth;
59 variable x11screenheight;
60 variable x11screendepth;
61 variable mouselinux;
62 variable keyblinux;
63 variable vtswitch;
64 variable sa1100ltlend;
65 variable rtemsbuild;
66 variable rtemsbsp;
67 variable screenelks;
68
69
70 wm title . "Microwindows configuration"
71 wm geometry . +100+100
72
73 # Create main menu
74 frame .main
75 frame .main.col1
76 frame .main.col2
77 button .main.col1.compile -text "Compiling options" -command "compileoptions;"
78 button .main.col1.platform -text "Platform" -command "platformoptions;"
79 button .main.col1.lib -text "Libraries to compile" -command "liboptions;"
80 button .main.col2.colors -text "Color options" -command "colorsoptions;"
81 button .main.col2.io -text "I/O" -command "iooptions;"
82 button .main.col2.misc -text "Miscellaneous options" -command "miscoptions;"
83 pack .main.col1.compile .main.col1.platform .main.col1.lib -side top -fill x
84 pack .main.col2.colors .main.col2.io .main.col2.misc -side top -fill x
85 pack .main.col1 .main.col2 -side left
86
87 # Create ok, cancel, help buttons
88 frame .buttons
89 pack .buttons -side bottom -fill x -pady 2m
90 button .buttons.ok -text "Save & Exit" -command "writeconfig; destroy ."
91 button .buttons.help -text "Help" -command "tk_dialog .help message TODO \"\" 0 ok"
92 button .buttons.cancel -text "Cancel" -command "destroy ."
93 pack .buttons.cancel .buttons.help .buttons.ok -side right -expand 1
94
95 pack .main .buttons -side bottom
96
97
98 ################################################################################
99 #
100 # Show the "compile" options dialog
101 #
102 ################################################################################
103 proc compileoptions {} {
104
105    toplevel .compile
106    wm title .compile "Compiling options"
107    wm geometry .compile +100+100
108
109    frame .compile.buttons
110    pack .compile.buttons -side bottom -fill x -pady 2m
111    button .compile.buttons.ok -text "Ok" -command "destroy .compile"
112    button .compile.buttons.help -text "Help" -command "tk_dialog .help message TODO \"\" 0 ok"
113    pack .compile.buttons.help .compile.buttons.ok -side right -expand 1
114
115    frame .compile.a0
116    frame .compile.a1
117    frame .compile.a2
118    checkbutton .compile.a0.b0 -text "Optimize" -variable optimize -relief flat
119    checkbutton .compile.a1.b1 -text "Debug" -variable debug -relief flat
120    checkbutton .compile.a2.b2 -text "Verbose" -variable verbose -relief flat
121    pack .compile.a0.b0 -side left
122    pack .compile.a1.b1 -side left
123    pack .compile.a2.b2 -side left
124    pack .compile.a0  -side top -pady 2 -anchor w -fill x
125    pack .compile.a1  -side top -pady 2 -anchor w -fill x
126    pack .compile.a2  -side top -pady 2 -anchor w -fill x
127    pack .compile.a0 .compile.a1 .compile.a2 -side top -anchor e
128 }
129
130
131 ################################################################################
132 #
133 # Show the "platform" options dialog
134 #
135 ################################################################################
136 proc platformoptions {} {
137
138    toplevel .platform
139    wm title .platform "Platform options"
140    wm geometry .platform +100+100
141
142    frame .platform.buttons
143    pack .platform.buttons -side bottom -fill x -pady 2m
144    button .platform.buttons.ok -text "Ok" -command "destroy .platform"
145    button .platform.buttons.help -text "Help" -command "tk_dialog .help message TODO \"\" 0 ok"
146    pack .platform.buttons.help .platform.buttons.ok -side right -expand 1
147
148    frame .platform.a0
149    frame .platform.a1
150    frame .platform.a2
151    frame .platform.a3
152    frame .platform.a4
153    frame .platform.a5
154
155    radiobutton .platform.a0.b0 -text "Linux (native)" -variable arch -relief flat -value 0 -anchor w
156    button .platform.a0.options -text "Options" -command {nativelinuxoptions;};
157    radiobutton .platform.a1.b1 -text "Linux-ARM (x-compile)" -variable arch -relief flat -value 1 -anchor w
158    button .platform.a1.options -text "Options" -command {armlinuxoptions;};
159    radiobutton .platform.a2.b2 -text "Linux-MIPS (x-compile)" -variable arch -relief flat -value 2 -anchor w
160    button .platform.a2.options -text "Options" -command {mipslinuxoptions;};
161    radiobutton .platform.a3.b3 -text "RTEMS" -variable arch -relief flat -value 3 -anchor w
162    button .platform.a3.options -text "Options" -command {rtemsoptions;};
163    radiobutton .platform.a4.b4 -text "Solaris" -variable arch -relief flat -value 4 -anchor w
164    button .platform.a4.options -text "Options" -command {nativelinuxoptions;};
165    radiobutton .platform.a5.b5 -text "ELKS" -variable arch -relief flat -value 5 -anchor w
166    button .platform.a5.options -text "Options" -command {elksoptions;};
167    pack .platform.a0.b0 .platform.a0.options -side left
168    pack .platform.a1.b1 .platform.a1.options -side left
169    pack .platform.a2.b2 .platform.a2.options -side left
170    pack .platform.a3.b3 .platform.a3.options -side left
171    pack .platform.a4.b4 .platform.a4.options -side left
172    pack .platform.a5.b5 .platform.a5.options -side left
173    pack .platform.a0  -side top -pady 2 -anchor w -fill x
174    pack .platform.a1  -side top -pady 2 -anchor w -fill x
175    pack .platform.a2  -side top -pady 2 -anchor w -fill x
176    pack .platform.a3  -side top -pady 2 -anchor w -fill x
177    pack .platform.a4  -side top -pady 2 -anchor w -fill x
178    pack .platform.a5  -side top -pady 2 -anchor w -fill x
179    pack .platform.a0.options .platform.a1.options .platform.a2.options \
180    .platform.a3.options .platform.a4.options .platform.a5.options -side top -anchor e
181 }
182
183
184 ################################################################################
185 #
186 # Show the "libraries" options dialog
187 #
188 ################################################################################
189 proc liboptions {} {
190
191    toplevel .lib
192    wm title .lib "Libraries to compile"
193    wm geometry .lib +100+100
194
195    frame .lib.buttons
196    pack .lib.buttons -side bottom -fill x -pady 2m
197    button .lib.buttons.ok -text "Ok" -command "destroy .lib"
198    button .lib.buttons.help -text "Help" -command "tk_dialog .help message TODO \"\" 0 ok"
199    pack .lib.buttons.help .lib.buttons.ok -side right -expand 1
200
201    frame .lib.a0
202    frame .lib.a1
203    frame .lib.a2
204    frame .lib.a3
205    checkbutton .lib.a0.b0 -text "NanoX" -variable nanox -relief flat
206    button .lib.a0.options -text "Options" -command {nanoxoptions;};
207    checkbutton .lib.a1.b1 -text "Microwindows" -variable microwin -relief flat
208    button .lib.a1.options -text "Options" -command {mwinoptions;};
209    checkbutton .lib.a2.b2 -text "Shared libs" -variable shlibs -relief flat
210    checkbutton .lib.a3.b3 -text "C++ obj framework" -variable objframe -relief flat
211
212    pack .lib.a0.b0 .lib.a0.options -side left
213    pack .lib.a1.b1 .lib.a1.options -side left
214    pack .lib.a2.b2 -side left
215    pack .lib.a3.b3 -side left
216    pack .lib.a0  -side top -pady 2 -anchor w -fill x
217    pack .lib.a1  -side top -pady 2 -anchor w -fill x
218    pack .lib.a2  -side top -pady 2 -anchor w -fill x
219    pack .lib.a3  -side top -pady 2 -anchor w -fill x
220    pack .lib.a0.options .lib.a1.options -side top -anchor e
221 }
222
223
224 ################################################################################
225 #
226 # Show the "colors" options dialog
227 #
228 ################################################################################
229 proc colorsoptions {} {
230    global screenpixtype;
231
232    toplevel .colors
233    wm title .colors "Colors options"
234    wm geometry .colors +100+100
235
236    frame .colors.buttons
237    pack .colors.buttons -side bottom -fill x -pady 2m
238    button .colors.buttons.ok -text "Ok" -command "colorsoptions_ok; destroy .colors"
239    button .colors.buttons.help -text "Help" -command "tk_dialog .help message TODO \"\" 0 ok"
240    pack .colors.buttons.help .colors.buttons.ok -side right -expand 1
241
242    frame .colors.a0
243    frame .colors.a1
244    label .colors.a0.label -text "ScreenPixType:" -anchor e
245    entry .colors.a0.pixtype -width 25 -relief sunken
246    checkbutton .colors.a1.b1 -text "Gray Palette (4bpp only)" -variable graypalette -relief flat
247    pack .colors.a0.label .colors.a0.pixtype -side left
248    pack .colors.a1.b1 -side left
249    pack .colors.a0  -side top -pady 2 -anchor w -fill x
250    pack .colors.a1  -side top -pady 2 -anchor w -fill x
251    pack .colors.a0 .colors.a1 -side top -anchor e
252    .colors.a0.pixtype insert 0 $screenpixtype;
253 }
254
255 proc colorsoptions_ok {} {
256    global screenpixtype;
257    set screenpixtype [.colors.a0.pixtype get];
258 }
259
260
261 ################################################################################
262 #
263 # Show the "I/O" options dialog
264 #
265 ################################################################################
266 proc iooptions {} {
267    global havebmp;
268    global havejpg;
269    global haveft;
270    global havet1;
271
272         global havehzk;
273
274    toplevel .io
275    wm title .io "I/O options"
276    wm geometry .io +100+100
277
278    frame .io.buttons
279    pack .io.buttons -side bottom -fill x -pady 2m
280    button .io.buttons.ok -text "Ok" -command "destroy .io"
281    button .io.buttons.help -text "Help" -command "tk_dialog .help message TODO \"\" 0 ok"
282    pack .io.buttons.help .io.buttons.ok -side right -expand 1
283
284    frame .io.a0
285    frame .io.a1
286    frame .io.a2
287    frame .io.a3
288    frame .io.a4
289
290    frame .io.a5
291
292    checkbutton .io.a0.b0 -text "Have File I/O" -variable havefileio -relief flat
293    label .io.a0.label -text "(If the above is disabled, this will disable all the features below)" -anchor e
294    checkbutton .io.a1.b0 -text "Have bmp support" -variable havebmp -relief flat
295    checkbutton .io.a2.b0 -text "Have jpeg support" -variable havejpg -relief flat
296    button .io.a2.options -text "Options" -command {jpegoptions;};
297    checkbutton .io.a3.b0 -text "Have freetype support (truetype fonts)" -variable haveft -relief flat
298    button .io.a3.options -text "Options" -command {ftoptions;};
299    checkbutton .io.a4.b0 -text "Have t1lib support (type 1 fonts)" -variable havet1 -relief flat
300    button .io.a4.options -text "Options" -command {t1options;};
301
302    checkbutton .io.a5.b0 -text "Have HZK support (Bitmap(Metrix) fonts)" -variable havehzk -relief flat
303    button .io.a5.options -text "Options" -command {hzkoptions;};
304
305    pack .io.a0.b0  .io.a0.label -side top -pady 2 -anchor w
306    pack .io.a1.b0  -side top -pady 2 -anchor w
307    pack .io.a2.b0 .io.a2.options -side left
308    pack .io.a3.b0 .io.a3.options -side left
309    pack .io.a4.b0 .io.a4.options -side left
310    pack .io.a5.b0 .io.a5.options -side left
311
312    pack .io.a0  -side top -pady 2 -anchor w -fill x
313    pack .io.a1  -side top -pady 2 -anchor w -fill x
314    pack .io.a2  -side top -pady 2 -anchor w -fill x
315    pack .io.a3  -side top -pady 2 -anchor w -fill x
316    pack .io.a4  -side top -pady 2 -anchor w -fill x
317    pack .io.a5  -side top -pady 2 -anchor w -fill x
318
319    pack .io.a2.options .io.a3.options .io.a4.options .io.a5.options -side top -anchor e
320 }
321
322
323 ################################################################################
324 #
325 # Show the "Miscellaneous" options dialog
326 #
327 ################################################################################
328 proc miscoptions {} {
329
330    toplevel .misc
331    wm title .misc "Miscellaneous options"
332    wm geometry .misc +100+100
333
334    frame .misc.buttons
335    pack .misc.buttons -side bottom -fill x -pady 2m
336    button .misc.buttons.ok -text "Ok" -command "destroy .misc"
337    button .misc.buttons.help -text "Help" -command "tk_dialog .help message TODO \"\" 0 ok"
338    pack .misc.buttons.help .misc.buttons.ok -side right -expand 1
339
340    checkbutton .misc.b0 -text "Have MS fonts" -variable havemsfonts -relief flat
341    pack .misc.b0  -side top -pady 2 -anchor w
342 }
343
344
345 ################################################################################
346 #
347 # Show nanox options dialog
348 #
349 ################################################################################
350 proc nanoxoptions {} {
351
352    toplevel .optnanox
353    wm title .optnanox "NanoX options"
354    wm geometry .optnanox +100+100
355
356    frame .optnanox.buttons
357    pack .optnanox.buttons -side bottom -fill x -pady 2m
358    button .optnanox.buttons.ok -text "Ok" -command "destroy .optnanox"
359    button .optnanox.buttons.help -text "Help" -command "tk_dialog .help message TODO \"\" 0 ok"
360    pack .optnanox.buttons.help .optnanox.buttons.ok -side right -expand 1
361
362    frame .optnanox.a0
363    checkbutton .optnanox.a0.server -text "Link app into server" -variable server -relief flat
364    checkbutton .optnanox.a0.sharedmem -text "Enable shared mem support (app/server only)" -variable sharedmem -relief flat
365    checkbutton .optnanox.a0.nwidget -text "Compile Nwidget library" -variable nwidget -relief flat
366    checkbutton .optnanox.a0.demo -text "Compile demos" -variable nanoxdemo -relief flat
367    pack .optnanox.a0.server  -side top -pady 2 -anchor w
368    pack .optnanox.a0.sharedmem  -side top -pady 2 -anchor w
369    pack .optnanox.a0.nwidget  -side top -pady 2 -anchor w
370    pack .optnanox.a0.demo  -side top -pady 2 -anchor w
371    pack .optnanox.a0  -side top -pady 2 -anchor w -fill x
372 }
373
374
375 ################################################################################
376 #
377 # Show microwindows options dialog
378 #
379 ################################################################################
380 proc mwinoptions {} {
381
382    toplevel .optmwin
383    wm title .optmwin "MicroWindows options"
384    wm geometry .optmwin +100+100
385
386    frame .optmwin.buttons
387    pack .optmwin.buttons -side bottom -fill x -pady 2m
388    button .optmwin.buttons.ok -text "Ok" -command "destroy .optmwin"
389    button .optmwin.buttons.help -text "Help" -command "tk_dialog .help message TODO \"\" 0 ok"
390    pack .optmwin.buttons.help .optmwin.buttons.ok -side right -expand 1
391
392    frame .optmwin.algo -borderwidth 1 -relief solid
393    frame .optmwin.demo -borderwidth 1 -relief solid
394    pack .optmwin.algo .optmwin.demo -side top -fill x -pady .5c -padx .5c
395
396    frame .optmwin.algo.a0
397    frame .optmwin.algo.a1
398    label .optmwin.algo.label -text "Window move agorithm options"
399    pack .optmwin.algo.label -side top
400    checkbutton .optmwin.algo.a0.b0 -text "Update regions" -variable updateregions -relief flat
401    checkbutton .optmwin.algo.a1.b1 -text "Erase Move" -variable erasemove -relief flat
402    pack .optmwin.algo.a0.b0  -side top -pady 2 -anchor w
403    pack .optmwin.algo.a1.b1  -side top -pady 2 -anchor w
404    pack .optmwin.algo.a0  -side top -pady 2 -anchor w -fill x
405    pack .optmwin.algo.a1  -side top -pady 2 -anchor w -fill x
406
407    frame .optmwin.demo.a0
408    label .optmwin.demo.label -text "Other options"
409    pack .optmwin.demo.label -side top
410    checkbutton .optmwin.demo.a0.b0 -text "Compile demos" -variable microwindemo -relief flat
411    pack .optmwin.demo.a0.b0  -side top -pady 2 -anchor w
412    pack .optmwin.demo.a0  -side top -pady 2 -anchor w -fill x
413 }
414
415
416 ################################################################################
417 #
418 # Show native linux/Solaris options dialog
419 #
420 ################################################################################
421 proc nativelinuxoptions {} {
422
423    toplevel .optnatlinux
424    wm title .optnatlinux "Native Linux/Solaris options"
425    wm geometry .optnatlinux +100+100
426
427    frame .optnatlinux.buttons
428    pack .optnatlinux.buttons -side bottom -fill x -pady 2m
429    button .optnatlinux.buttons.ok -text "Ok" -command "destroy .optnatlinux"
430    button .optnatlinux.buttons.help -text "Help" -command "tk_dialog .help message TODO \"\" 0 ok"
431    pack .optnatlinux.buttons.help .optnatlinux.buttons.ok -side right -expand 1
432
433    button .optnatlinux.screen -text "Screen driver" -command "screenoptions;"
434    button .optnatlinux.mouse -text "Mouse driver" -command "mouseoptions;"
435    button .optnatlinux.kbd -text "Keyboard driver" -command "kbdoptions;"
436    pack .optnatlinux.screen .optnatlinux.mouse .optnatlinux.kbd -side top -fill x
437 }
438
439
440 ################################################################################
441 #
442 # Show arm linux options dialog
443 #
444 ################################################################################
445 proc armlinuxoptions {} {
446    global screenlinux;
447    global armtoolsprefix;
448
449    toplevel .optarmlinux
450    wm title .optarmlinux "ARM Linux options"
451    wm geometry .optarmlinux +100+100
452
453    frame .optarmlinux.buttons
454    pack .optarmlinux.buttons -side bottom -fill x -pady 2m
455    button .optarmlinux.buttons.ok -text "Ok" -command "armlinuxoptions_ok; destroy .optarmlinux"
456    button .optarmlinux.buttons.help -text "Help" -command "tk_dialog .help message TODO \"\" 0 ok"
457    pack .optarmlinux.buttons.help .optarmlinux.buttons.ok -side right -expand 1
458
459    frame .optarmlinux.comp -borderwidth 1 -relief solid
460    pack .optarmlinux.comp -side top -fill x -pady .5c -padx .5c
461
462    frame .optarmlinux.comp.a0
463    label .optarmlinux.comp.label -text "Compiler options"
464    pack .optarmlinux.comp.label -side top
465    label .optarmlinux.comp.a0.label -text "Tools Prefix:" -anchor e
466    entry .optarmlinux.comp.a0.prefix -width 25 -relief sunken
467    checkbutton .optarmlinux.comp.a0.sa1100ltlend \
468 -text "SA1100 Little endian option (for 4 bpp only)" -variable sa1100ltlend -relief flat
469    pack .optarmlinux.comp.a0.label  -side top -pady 2 -anchor w
470    pack .optarmlinux.comp.a0.prefix  -side top -pady 2 -anchor c
471    pack .optarmlinux.comp.a0.sa1100ltlend  -side top -pady 2 -anchor c
472    pack .optarmlinux.comp.a0  -side top -pady 2 -anchor w -fill x
473    .optarmlinux.comp.a0.prefix insert 0 $armtoolsprefix;
474
475    button .optarmlinux.screen -text "Screen driver" -command "screenoptions;"
476    button .optarmlinux.mouse -text "Mouse driver" -command "mouseoptions;"
477    button .optarmlinux.kbd -text "Keyboard driver" -command "kbdoptions;"
478    pack .optarmlinux.comp .optarmlinux.screen .optarmlinux.mouse .optarmlinux.kbd -side top -fill x
479 }
480
481 proc armlinuxoptions_ok {} {
482    global armtoolsprefix;
483    set armtoolsprefix [.optarmlinux.comp.a0.prefix get];
484 }
485
486
487 ################################################################################
488 #
489 # Show mips linux options dialog
490 #
491 ################################################################################
492 proc mipslinuxoptions {} {
493    global screenlinux;
494    global mipstoolsprefix;
495
496    toplevel .optmipslinux
497    wm title .optmipslinux "MIPS Linux options"
498    wm geometry .optmipslinux +100+100
499
500    frame .optmipslinux.buttons
501    pack .optmipslinux.buttons -side bottom -fill x -pady 2m
502    button .optmipslinux.buttons.ok -text "Ok" -command "mipslinuxoptions_ok; destroy .optmipslinux"
503    button .optmipslinux.buttons.help -text "Help" -command "tk_dialog .help message TODO \"\" 0 ok"
504    pack .optmipslinux.buttons.help .optmipslinux.buttons.ok -side right -expand 1
505
506    frame .optmipslinux.comp -borderwidth 1 -relief solid
507    pack .optmipslinux.comp -side top -fill x -pady .5c -padx .5c
508
509    frame .optmipslinux.comp.a0
510    label .optmipslinux.comp.label -text "Compiler options"
511    pack .optmipslinux.comp.label -side top
512    label .optmipslinux.comp.a0.label -text "Tools Prefix:" -anchor e
513    entry .optmipslinux.comp.a0.prefix -width 25 -relief sunken
514    pack .optmipslinux.comp.a0.label  -side top -pady 2 -anchor w
515    pack .optmipslinux.comp.a0.prefix  -side top -pady 2 -anchor c
516    pack .optmipslinux.comp.a0  -side top -pady 2 -anchor w -fill x
517    .optmipslinux.comp.a0.prefix insert 0 $mipstoolsprefix;
518
519    button .optmipslinux.screen -text "Screen driver" -command "screenoptions;"
520    button .optmipslinux.mouse -text "Mouse driver" -command "mouseoptions;"
521    button .optmipslinux.kbd -text "Keyboard driver" -command "kbdoptions;"
522    pack .optmipslinux.comp .optmipslinux.screen .optmipslinux.mouse .optmipslinux.kbd -side top -fill x
523 }
524
525 proc mipslinuxoptions_ok {} {
526    global mipstoolsprefix;
527    set mipstoolsprefix [.optmipslinux.comp.a0.prefix get];
528 }
529
530
531 ################################################################################
532 #
533 # Show rtems options dialog
534 #
535 ################################################################################
536 proc rtemsoptions {} {
537    global rtemstoolsprefix;
538    global rtemsbuild;
539    global rtemsbsp;
540
541    toplevel .optrtems
542    wm title .optrtems "RTEMS options"
543    wm geometry .optrtems +100+100
544
545    frame .optrtems.buttons
546    pack .optrtems.buttons -side bottom -fill x -pady 2m
547    button .optrtems.buttons.ok -text "Ok" -command "rtemsoptions_ok; destroy .optrtems"
548    button .optrtems.buttons.help -text "Help" -command "tk_dialog .help message TODO \"\" 0 ok"
549    pack .optrtems.buttons.help .optrtems.buttons.ok -side right -expand 1
550
551    frame .optrtems.comp -borderwidth 1 -relief solid
552    pack .optrtems.comp -side top -fill x -pady .5c -padx .5c
553
554    frame .optrtems.comp.a0
555    frame .optrtems.comp.a1
556    frame .optrtems.comp.a2
557    label .optrtems.comp.label -text "Compiler options"
558    pack .optrtems.comp.label -side top
559    label .optrtems.comp.a0.label -text "Tools Prefix:" -anchor e
560    entry .optrtems.comp.a0.prefix -width 25 -relief sunken
561    label .optrtems.comp.a1.label -text "Build:" -anchor e
562    entry .optrtems.comp.a1.build -width 25 -relief sunken
563    label .optrtems.comp.a2.label -text "BSP:" -anchor e
564    entry .optrtems.comp.a2.bsp -width 25 -relief sunken
565    pack .optrtems.comp.a0.label  -side top -pady 2 -anchor w
566    pack .optrtems.comp.a0.prefix  -side top -pady 2 -anchor c
567    pack .optrtems.comp.a1.label .optrtems.comp.a1.build -side top -pady 2 -anchor w
568    pack .optrtems.comp.a2.label .optrtems.comp.a2.bsp -side top -pady 2 -anchor w
569    pack .optrtems.comp.a0  -side top -pady 2 -anchor w -fill x
570    pack .optrtems.comp.a1  -side top -pady 2 -anchor w -fill x
571    pack .optrtems.comp.a2  -side top -pady 2 -anchor w -fill x
572    pack .optrtems.comp.a0.prefix .optrtems.comp.a1.build .optrtems.comp.a2.bsp  -side top -anchor e
573    .optrtems.comp.a0.prefix insert 0 $rtemstoolsprefix;
574    .optrtems.comp.a1.build insert 0 $rtemsbuild;
575    .optrtems.comp.a2.bsp insert 0 $rtemsbsp;
576
577    button .optrtems.screen -text "Screen driver" -command "screenoptions;"
578    button .optrtems.mouse -text "Mouse driver" -command "mouseoptions;"
579    button .optrtems.kbd -text "Keyboard driver" -command "kbdoptions;"
580    pack .optrtems.comp .optrtems.screen .optrtems.mouse .optrtems.kbd -side top -fill x
581 }
582
583 proc rtemsoptions_ok {} {
584    global rtemstoolsprefix;
585    global rtemsbuild;
586    global rtemsbsp;
587    set rtemstoolsprefix [.optrtems.comp.a0.prefix get];
588    set rtemsbuild [.optrtems.comp.a1.build get];
589    set rtemsbsp [.optrtems.comp.a2.bsp get];
590 }
591
592
593 ################################################################################
594 #
595 # Show jpeg options dialog
596 #
597 ################################################################################
598 proc jpegoptions {} {
599    global incjpg;
600    global libjpg;
601
602    toplevel .optjpeg
603    wm title .optjpeg "JPEG support options"
604    wm geometry .optjpeg +100+100
605
606    frame .optjpeg.buttons
607    pack .optjpeg.buttons -side bottom -fill x -pady 2m
608    button .optjpeg.buttons.ok -text "Ok" -command "jpegoptions_ok; destroy .optjpeg"
609    button .optjpeg.buttons.help -text "Help" -command "tk_dialog .help message TODO \"\" 0 ok"
610    pack .optjpeg.buttons.help .optjpeg.buttons.ok -side right -expand 1
611
612    frame .optjpeg.a0
613    frame .optjpeg.a1
614    label .optjpeg.a0.label -text "Libjpeg include dir:" -anchor e
615    entry .optjpeg.a0.incjpg -width 40 -relief sunken
616    label .optjpeg.a1.label -text "Libjpeg path:" -anchor e
617    entry .optjpeg.a1.libjpg -width 40 -relief sunken
618    pack .optjpeg.a0.label  -side top -pady 2 -anchor w
619    pack .optjpeg.a0.incjpg  -side top -pady 2 -anchor w
620    pack .optjpeg.a1.label  -side top -pady 2 -anchor w
621    pack .optjpeg.a1.libjpg  -side top -pady 2 -anchor w
622    pack .optjpeg.a0  -side top -pady 2 -anchor w -fill x
623    pack .optjpeg.a1  -side top -pady 2 -anchor w -fill x
624
625    pack .optjpeg.a0.incjpg .optjpeg.a1.libjpg  -side top -anchor e
626
627    .optjpeg.a0.incjpg insert 0 $incjpg;
628    .optjpeg.a1.libjpg insert 0 $libjpg;
629 }
630
631
632 proc jpegoptions_ok {} {
633    global incjpg;
634    global libjpg;
635    set incjpg [.optjpeg.a0.incjpg get];
636    set libjpg [.optjpeg.a1.libjpg get];
637 }
638
639
640 ################################################################################
641 #
642 # Show freetype options dialog
643 #
644 ################################################################################
645 proc ftoptions {} {
646    global incft;
647    global libft;
648
649    toplevel .optft
650    wm title .optft "Freetype support options"
651    wm geometry .optft +100+100
652
653    frame .optft.buttons
654    pack .optft.buttons -side bottom -fill x -pady 2m
655    button .optft.buttons.ok -text "Ok" -command "ftoptions_ok; destroy .optft"
656    button .optft.buttons.help -text "Help" -command "tk_dialog .help message TODO \"\" 0 ok"
657    pack .optft.buttons.help .optft.buttons.ok -side right -expand 1
658
659    frame .optft.a0
660    frame .optft.a1
661    label .optft.a0.label -text "Freetype include dir:" -anchor e
662    entry .optft.a0.incft -width 40 -relief sunken
663    label .optft.a1.label -text "Freetype lib path:" -anchor e
664    entry .optft.a1.libft -width 40 -relief sunken
665    pack .optft.a0.label  -side top -pady 2 -anchor w
666    pack .optft.a0.incft  -side top -pady 2 -anchor w
667    pack .optft.a1.label  -side top -pady 2 -anchor w
668    pack .optft.a1.libft  -side top -pady 2 -anchor w
669    pack .optft.a0  -side top -pady 2 -anchor w -fill x
670    pack .optft.a1  -side top -pady 2 -anchor w -fill x
671
672    pack .optft.a0.incft .optft.a1.libft  -side top -anchor e
673
674    .optft.a0.incft insert 0 $incft;
675    .optft.a1.libft insert 0 $libft;
676 }
677
678
679 proc ftoptions_ok {} {
680    global incft;
681    global libft;
682    set incft [.optft.a0.incft get];
683    set libft [.optft.a1.libft get];
684 }
685
686
687 ################################################################################
688 #
689 # Show t1lib options dialog
690 #
691 ################################################################################
692 proc t1options {} {
693    global inct1;
694    global libt1;
695
696    toplevel .optt1
697    wm title .optt1 "T1Lib support options"
698    wm geometry .optt1 +100+100
699
700    frame .optt1.buttons
701    pack .optt1.buttons -side bottom -fill x -pady 2m
702    button .optt1.buttons.ok -text "Ok" -command "t1options_ok; destroy .optt1"
703    button .optt1.buttons.help -text "Help" -command "tk_dialog .help message TODO \"\" 0 ok"
704    pack .optt1.buttons.help .optt1.buttons.ok -side right -expand 1
705
706    frame .optt1.a0
707    frame .optt1.a1
708    label .optt1.a0.label -text "T1lib include dir:" -anchor e
709    entry .optt1.a0.inct1 -width 40 -relief sunken
710    label .optt1.a1.label -text "T1lib path:" -anchor e
711    entry .optt1.a1.libt1 -width 40 -relief sunken
712    pack .optt1.a0.label  -side top -pady 2 -anchor w
713    pack .optt1.a0.inct1  -side top -pady 2 -anchor w
714    pack .optt1.a1.label  -side top -pady 2 -anchor w
715    pack .optt1.a1.libt1  -side top -pady 2 -anchor w
716    pack .optt1.a0  -side top -pady 2 -anchor w -fill x
717    pack .optt1.a1  -side top -pady 2 -anchor w -fill x
718
719    pack .optt1.a0.inct1 .optt1.a1.libt1  -side top -anchor e
720
721    .optt1.a0.inct1 insert 0 $inct1;
722    .optt1.a1.libt1 insert 0 $libt1;
723 }
724
725
726 proc t1options_ok {} {
727    global inct1;
728    global libt1;
729    set inct1 [.optt1.a0.inct1 get];
730    set libt1 [.optt1.a1.libt1 get];
731 }
732
733 ################################################################################
734 #
735 # Show hzk dir options dialog
736 #
737 ################################################################################
738 proc hzkoptions {} {
739    global hzkdir;
740          global hzkfontsize;
741
742    toplevel .opthzk
743    wm title .opthzk "HZK support options"
744    wm geometry .opthzk +100+100
745
746    frame .opthzk.buttons
747    pack .opthzk.buttons -side bottom -fill x -pady 2m
748    button .opthzk.buttons.ok -text "Ok" -command "hzkoptions_ok; destroy .opthzk"
749    button .opthzk.buttons.help -text "Help" -command "tk_dialog .help message TODO \"\" 0 ok"
750    pack .opthzk.buttons.help .opthzk.buttons.ok -side right -expand 1
751
752    frame .opthzk.a0
753    frame .opthzk.a1
754    label .opthzk.a0.label -text "HZK fonts dir:" -anchor e
755    entry .opthzk.a0.hzkdir -width 40 -relief sunken
756    label .opthzk.a1.label -text "HZK fonts Size:(16 or 12 ,now)" -anchor e
757    entry .opthzk.a1.hzksize -width 40 -relief sunken
758    pack .opthzk.a0.label  -side top -pady 2 -anchor w
759    pack .opthzk.a0.hzkdir -side top -pady 2 -anchor w
760    pack .opthzk.a1.label  -side top -pady 2 -anchor w
761    pack .opthzk.a1.hzksize -side top -pady 2 -anchor w
762    pack .opthzk.a0  -side top -pady 2 -anchor w -fill x
763    pack .opthzk.a1  -side top -pady 2 -anchor w -fill x
764
765          pack .opthzk.a0.hzkdir .opthzk.a1.hzksize -side top -anchor e
766
767    .opthzk.a0.hzkdir insert 0 $hzkdir;
768    .opthzk.a1.hzksize insert 0 $hzkfontsize;
769 }
770
771
772 proc hzkoptions_ok {} {
773    global hzkdir;
774    global hzkfontsize;
775    set hzkdir [.opthzk.a0.hzkdir get];
776    set hzkfontsize [.opthzk.a1.hzksize get];
777
778 }
779
780
781 ################################################################################
782 #
783 # Show screen driver options dialog
784 #
785 ################################################################################
786 proc screenoptions {} {
787
788    toplevel .optscreen
789    wm title .optscreen "Screen driver options"
790    wm geometry .optscreen +100+100
791
792    frame .optscreen.buttons
793    pack .optscreen.buttons -side bottom -fill x -pady 2m
794    button .optscreen.buttons.ok -text "Ok" -command "destroy .optscreen"
795    button .optscreen.buttons.help -text "Help" -command "tk_dialog .help message TODO \"\" 0 ok"
796    pack .optscreen.buttons.help .optscreen.buttons.ok -side right -expand 1
797
798    frame .optscreen.a0
799    frame .optscreen.a1
800    frame .optscreen.a2
801    frame .optscreen.a3
802    radiobutton .optscreen.a0.b0 -text "Framebuffer" -variable screenlinux -relief flat -value 0 -anchor w
803    button .optscreen.a0.options -text "Options" -command {fboptions;};
804    radiobutton .optscreen.a1.b1 -text "X11" -variable screenlinux -relief flat -value 1 -anchor w
805    button .optscreen.a1.options -text "Options" -command {x11options;};
806    radiobutton .optscreen.a2.b2 -text "VgaLib" -variable screenlinux -relief flat -value 2 -anchor w
807    radiobutton .optscreen.a3.b3 -text "HW Vga" -variable screenlinux -relief flat -value 3 -anchor w
808    pack .optscreen.a0.b0 .optscreen.a0.options -side left
809    pack .optscreen.a1.b1  .optscreen.a1.options -side left
810    pack .optscreen.a2.b2  -side top -pady 2 -anchor w
811    pack .optscreen.a3.b3  -side top -pady 2 -anchor w
812    pack .optscreen.a0  -side top -pady 2 -anchor w -fill x
813    pack .optscreen.a1  -side top -pady 2 -anchor w -fill x
814    pack .optscreen.a2  -side top -pady 2 -anchor w -fill x
815    pack .optscreen.a3  -side top -pady 2 -anchor w -fill x
816    pack .optscreen.a0.options .optscreen.a1.options  -side top -anchor e
817 }
818
819
820 ################################################################################
821 #
822 # Show mouse options dialog
823 #
824 ################################################################################
825 proc mouseoptions {} {
826
827    toplevel .optmouse
828    wm title .optmouse "Mouse driver options"
829    wm geometry .optmouse +100+100
830
831    frame .optmouse.buttons
832    pack .optmouse.buttons -side bottom -fill x -pady 2m
833    button .optmouse.buttons.ok -text "Ok" -command "destroy .optmouse"
834    button .optmouse.buttons.help -text "Help" -command "tk_dialog .help message TODO \"\" 0 ok"
835    pack .optmouse.buttons.help .optmouse.buttons.ok -side right -expand 1
836
837    frame .optmouse.a0
838    frame .optmouse.a1
839    frame .optmouse.a2
840    frame .optmouse.a3
841    frame .optmouse.a4
842    radiobutton .optmouse.a0.b0 -text "GPM mouse" -variable mouselinux -relief flat -value 0 -anchor w
843    radiobutton .optmouse.a1.b1 -text "Serial mouse" -variable mouselinux -relief flat -value 1 -anchor w
844    radiobutton .optmouse.a2.b2 -text "Touch Pad" -variable mouselinux -relief flat -value 2 -anchor w
845    radiobutton .optmouse.a3.b3 -text "Touch screen" -variable mouselinux -relief flat -value 3 -anchor w
846    radiobutton .optmouse.a4.b4 -text "No Mouse" -variable mouselinux -relief flat -value 4 -anchor w
847    pack .optmouse.a0.b0  -side top -pady 2 -anchor w
848    pack .optmouse.a1.b1  -side top -pady 2 -anchor w
849    pack .optmouse.a2.b2  -side top -pady 2 -anchor w
850    pack .optmouse.a3.b3  -side top -pady 2 -anchor w
851    pack .optmouse.a4.b4  -side top -pady 2 -anchor w
852    pack .optmouse.a0  -side top -pady 2 -anchor w -fill x
853    pack .optmouse.a1  -side top -pady 2 -anchor w -fill x
854    pack .optmouse.a2  -side top -pady 2 -anchor w -fill x
855    pack .optmouse.a3  -side top -pady 2 -anchor w -fill x
856    pack .optmouse.a4  -side top -pady 2 -anchor w -fill x
857 }
858
859
860 ################################################################################
861 #
862 # Show keyboard options dialog
863 #
864 ################################################################################
865 proc kbdoptions {} {
866
867    toplevel .optkbd
868    wm title .optkbd "Keyboard driver options"
869    wm geometry .optkbd +100+100
870
871    frame .optkbd.buttons
872    pack .optkbd.buttons -side bottom -fill x -pady 2m
873    button .optkbd.buttons.ok -text "Ok" -command "destroy .optkbd"
874    button .optkbd.buttons.help -text "Help" -command "tk_dialog .help message TODO \"\" 0 ok"
875    pack .optkbd.buttons.help .optkbd.buttons.ok -side right -expand 1
876
877    frame .optkbd.a0
878    frame .optkbd.a1
879    radiobutton .optkbd.a0.b0 -text "TTY" -variable keyblinux -relief flat -value 0 -anchor w
880    radiobutton .optkbd.a1.b0 -text "No keyboard" -variable keyblinux -relief flat -value 1 -anchor w
881    pack .optkbd.a0.b0  -side top -pady 2 -anchor w
882    pack .optkbd.a1.b0  -side top -pady 2 -anchor w
883    pack .optkbd.a0  -side top -pady 2 -anchor w -fill x
884    pack .optkbd.a1  -side top -pady 2 -anchor w -fill x
885 }
886
887
888 ################################################################################
889 #
890 # Show framebuffer options dialog
891 #
892 ################################################################################
893 proc fboptions {} {
894
895    toplevel .optfb
896    wm title .optfb "Framebuffer options"
897    wm geometry .optfb +100+100
898
899    frame .optfb.buttons
900    pack .optfb.buttons -side bottom -fill x -pady 2m
901    button .optfb.buttons.ok -text "Ok" -command "destroy .optfb"
902    button .optfb.buttons.help -text "Help" -command "tk_dialog .help message TODO \"\" 0 ok"
903    pack .optfb.buttons.help .optfb.buttons.ok -side right -expand 1
904
905    frame .optfb.a0
906    frame .optfb.a1
907    frame .optfb.a2
908    checkbutton .optfb.a0.vgafb -text "VGA fb" -variable vgafb -relief flat
909    checkbutton .optfb.a1.portrait -text "Portrait mode" -variable portraitfb -relief flat
910    checkbutton .optfb.a2.vt -text "VTerm Switch code included" -variable vtswitch -relief flat
911    pack .optfb.a0.vgafb  -side top -pady 2 -anchor w
912    pack .optfb.a1.portrait  -side top -pady 2 -anchor w
913    pack .optfb.a2.vt  -side top -pady 2 -anchor w
914    pack .optfb.a0 .optfb.a1 .optfb.a2 -side top -pady 2 -anchor w -fill x
915 }
916
917
918 ################################################################################
919 #
920 # Show X11 options dialog
921 #
922 ################################################################################
923 proc x11options {} {
924    global x11screenwidth;
925    global x11screenheight;
926    global x11screendepth;
927    global x11e15;
928
929    toplevel .optx11
930    wm title .optx11 "X11 options"
931    wm geometry .optx11 +100+100
932
933    frame .optx11.buttons
934    pack .optx11.buttons -side bottom -fill x -pady 2m
935    button .optx11.buttons.ok -text "Ok" -command "x11options_ok; destroy .optx11"
936    button .optx11.buttons.help -text "Help" -command "tk_dialog .help message TODO \"\" 0 ok"
937    pack .optx11.buttons.help .optx11.buttons.ok -side right -expand 1
938
939    frame .optx11.a0
940    frame .optx11.a1
941    frame .optx11.a2
942    frame .optx11.a3
943    label .optx11.a0.label -text "Screen width:" -anchor e
944    entry .optx11.a0.width -width 5 -relief sunken
945    label .optx11.a1.label -text "Screen height:" -anchor e
946    entry .optx11.a1.height -width 5 -relief sunken
947    label .optx11.a2.label -text "Screen depth:" -anchor e
948    entry .optx11.a2.depth -width 5 -relief sunken
949    checkbutton .optx11.a3.x11e15 -text "Use predefined model E15" -variable x11e15 -relief flat
950    pack .optx11.a0.label .optx11.a0.width  -side left
951    pack .optx11.a1.label .optx11.a1.height -side left
952    pack .optx11.a2.label .optx11.a2.depth -side left
953    pack .optx11.a3.x11e15  -side top -pady 2 -anchor w
954    pack .optx11.a0  -side top -pady 2 -anchor w -fill x
955    pack .optx11.a1  -side top -pady 2 -anchor w -fill x
956    pack .optx11.a2  -side top -pady 2 -anchor w -fill x
957    pack .optx11.a3  -side top -pady 2 -anchor w -fill x
958    pack .optx11.a0.width .optx11.a1.height .optx11.a2.depth -side top -anchor e
959    .optx11.a0.width insert 0 $x11screenwidth;
960    .optx11.a1.height insert 0 $x11screenheight;
961    .optx11.a2.depth insert 0 $x11screendepth;
962 }
963
964 proc x11options_ok {} {
965    global x11screenwidth;
966    global x11screenheight;
967    global x11screendepth;
968    set x11screenwidth [.optx11.a0.width get];
969    set x11screenheight [.optx11.a1.height get];
970    set x11screendepth [.optx11.a2.depth get];
971 }
972
973
974 ################################################################################
975 #
976 # Show elks options dialog
977 #
978 ################################################################################
979 proc elksoptions {} {
980    global screenelks;
981
982    toplevel .optelks
983    wm title .optelks "ELKS options"
984    wm geometry .optelks +100+100
985
986    frame .optelks.buttons
987    pack .optelks.buttons -side bottom -fill x -pady 2m
988    button .optelks.buttons.ok -text "Ok" -command "destroy .optelks"
989    button .optelks.buttons.help -text "Help" -command "tk_dialog .help message TODO \"\" 0 ok"
990    pack .optelks.buttons.help .optelks.buttons.ok -side right -expand 1
991
992    frame .optelks.sd -borderwidth 1 -relief solid
993    pack .optelks.sd -side top -fill x -pady .5c -padx .5c
994
995    frame .optelks.sd.a0
996    frame .optelks.sd.a1
997    frame .optelks.sd.a2
998    label .optelks.sd.label -text "Screen driver"
999    pack .optelks.sd.label -side top
1000    radiobutton .optelks.sd.a0.b0 -text "ASM VGA (faster)" -variable screenelks -relief flat -value 0 -anchor w
1001    radiobutton .optelks.sd.a1.b1 -text "C VGA " -variable screenelks -relief flat -value 1 -anchor w
1002    radiobutton .optelks.sd.a2.b2 -text "Hercule" -variable screenelks -relief flat -value 2 -anchor w
1003    pack .optelks.sd.a0.b0  -side top -pady 2 -anchor w
1004    pack .optelks.sd.a1.b1  -side top -pady 2 -anchor w
1005    pack .optelks.sd.a2.b2  -side top -pady 2 -anchor w
1006    pack .optelks.sd.a0  -side top -pady 2 -anchor w -fill x
1007    pack .optelks.sd.a1  -side top -pady 2 -anchor w -fill x
1008    pack .optelks.sd.a2  -side top -pady 2 -anchor w -fill x
1009 }
1010
1011
1012 ################################################################################
1013 #
1014 # Read data from the configuration file
1015 #
1016 ################################################################################
1017 proc readconfig {} {
1018    global configfile;
1019
1020    global arch;
1021    global armtoolsprefix;
1022    global mipstoolsprefix;
1023    global rtemstoolsprefix;
1024    global optimize;
1025    global debug;
1026    global verbose
1027    global microwin;
1028    global nanox;
1029    global shlibs;
1030    global objframe;
1031    global nwidget;
1032    global microwindemo;
1033    global nanoxdemo;
1034    global screenpixtype;
1035    global server;
1036    global sharedmem;
1037    global havefileio;
1038    global havebmp;
1039    global havejpg;
1040    global incjpg;
1041    global libjpg;
1042    global haveft;
1043    global incft;
1044    global libft;
1045    global havet1;
1046    global inct1;
1047    global libt1;
1048    global havehzk;
1049    global hzkdir;       
1050    global hzkfontsize;
1051    global updateregions;
1052    global erasemove;
1053    global havemsfonts;
1054    global graypalette;
1055    global screenlinux;
1056    global vgafb;
1057    global portraitfb;
1058    global x11e15;
1059    global x11screenwidth;
1060    global x11screenheight;
1061    global x11screendepth;
1062    global mouselinux;
1063    global keyblinux;
1064    global vtswitch;
1065    global sa1100ltlend;
1066    global rtemsbuild;
1067    global rtemsbsp;
1068    global screenelks;
1069
1070    set configfile [open "config" r+]
1071
1072    set armtoolsprefix [getvalue "ARMTOOLSPREFIX" 0];
1073    set mipstoolsprefix [getvalue "MIPSTOOLSPREFIX" 0];
1074    set rtemstoolsprefix [getvalue "RTEMSTOOLSPREFIX" 0];
1075
1076    set arch [getvalue "ARCH" 0];
1077    switch -exact $arch {
1078         LINUX-NATIVE {set arch 0;}
1079         LINUX-ARM {set arch 1;}
1080         LINUX-MIPS {set arch 2;}
1081         RTEMS {set arch 3;}
1082         SOLARIS {set arch 4;}
1083         ELKS {set arch 5;}
1084         default {set arch 0}
1085    }
1086
1087    set optimize [getvalue "OPTIMIZE" 1];
1088    set debug [getvalue "DEBUG" 1];
1089    set verbose [getvalue "VERBOSE" 1];
1090    
1091    set vtswitch [getvalue "VTSWITCH" 1];
1092
1093    set microwin [getvalue "MICROWIN" 1];
1094    set nanox [getvalue "NANOX" 1];
1095    set shlibs [getvalue "SHAREDLIBS" 1];
1096    set objframe [getvalue "OBJFRAMEWORK" 1];
1097    set nwidget [getvalue "NWIDGET" 1];
1098
1099    set microwindemo [getvalue "MICROWINDEMO" 1]
1100    set nanoxdemo [getvalue "NANOXDEMO" 1];
1101
1102    set screenpixtype [getvalue "SCREEN_PIXTYPE" 0]
1103    set server [getvalue "LINK_APP_INTO_SERVER" 1];
1104    set sharedmem [getvalue "HAVE_SHAREDMEM_SUPPORT" 1];
1105
1106    set havefileio [getvalue "HAVE_FILEIO" 1];
1107    set havebmp [getvalue "HAVE_BMP_SUPPORT" 1];
1108    set havejpg [getvalue "HAVE_JPEG_SUPPORT" 1];
1109    set incjpg [getvalue "INCJPEG" 0];
1110    set libjpg [getvalue "LIBJPEG" 0];
1111    set haveft [getvalue "HAVE_FREETYPE_SUPPORT" 1];
1112    set incft [getvalue "INCFTLIB" 0];
1113    set libft [getvalue "LIBFTLIB" 0];
1114    set havet1 [getvalue "HAVE_T1LIB_SUPPORT" 1];
1115    set inct1 [getvalue "INCT1LIB" 0];
1116    set libt1 [getvalue "LIBT1LIB" 0];
1117
1118    set havehzk [getvalue "HAVE_HZK_SUPPORT" 1];
1119    set hzkdir           [getvalue "HZK_FONT_DIR" 0];    
1120    set hzkfontsize [getvalue "HZK_FONT_SIZE" 0];
1121
1122    set updateregions [getvalue "UPDATEREGIONS" 1]
1123    set erasemove [getvalue "ERASEMOVE" 1]
1124
1125    set havemsfonts [getvalue "HAVEMSFONTS" 1];
1126
1127    set graypalette [getvalue "GRAYPALETTE" 1];
1128
1129    set vgafb [getvalue "FBVGA" 1]
1130    set portraitfb [getvalue "PORTRAIT_MODE" 1]
1131
1132    set x11e15 [getvalue "SCREEN_E15 1" 1]
1133    set x11screenwidth [getvalue "SCREEN_WIDTH" 0]
1134    set x11screenheight [getvalue "SCREEN_HEIGHT" 0]
1135    set x11screendepth [getvalue "SCREEN_DEPTH" 0]
1136
1137    set sa1100ltlend [getvalue "SA1100_LCD_LTLEND" 1]
1138    set rtemsbuild [getvalue "RTEMS_BUILD" 0]
1139    set rtemsbsp [getvalue "RTEMS_BSP" 0]
1140
1141    if {[getvalue "FRAMEBUFFER" 1] == 1} {set screenlinux 0;}
1142    if {[getvalue "X11" 1] == 1} {set screenlinux 1}
1143    if {[getvalue "VGALIB" 1] == 1} {set screenlinux 2}
1144    if {[getvalue "HWVGA" 1] == 1} {set screenlinux 3}
1145
1146    if {[getvalue "GPMMOUSE" 1] == 1} {set mouselinux 0;}
1147    if {[getvalue "SERMOUSE" 1] == 1} {set mouselinux 1}
1148    if {[getvalue "TPMOUSE" 1] == 1} {set mouselinux 2}
1149    if {[getvalue "TSMOUSE" 1] == 1} {set mouselinux 3}
1150    if {[getvalue "NOMOUSE" 1] == 1} {set mouselinux 4}
1151
1152    if {[getvalue "TTYKBD" 1] == 1} {set keyblinux 0;}
1153    if {[getvalue "NOKBD" 1] == 1} {set keyblinux 1;}
1154
1155    if {[getvalue "ASMVGADRIVER" 1] == 1} {set screenelks 0;}
1156    if {[getvalue "CVGADRIVER" 1] == 1} {set screenelks 1}
1157    if {[getvalue "HERCDRIVER" 1] == 1} {set screenelks 2}
1158
1159    close $configfile;
1160 }
1161
1162
1163 ################################################################################
1164 #
1165 # Get a value from the config file
1166 #
1167 ################################################################################
1168 proc getvalue {name isyesorno} {
1169    global configfile;
1170
1171    set line 0;
1172
1173    seek $configfile 0 start;
1174
1175    while {[eof $configfile] == 0} {
1176       set line [gets $configfile];
1177
1178       if {[regexp ($name)(\ |\t)*(=)(\ |\t)*(.*) $line all a b c d e] == 1} {
1179          set $e [string trim $e]
1180
1181          if {$isyesorno == 1} {
1182             switch -exact $e {
1183             N {return 0;}
1184             Y {return 1;}
1185             default {return 0}
1186             }
1187          }
1188
1189          return $e
1190       }
1191    }
1192 }
1193
1194
1195 ################################################################################
1196 #
1197 # Write data to the configuration file
1198 #
1199 ################################################################################
1200 proc writeconfig {} {
1201    global arch;
1202    global armtoolsprefix;
1203    global mipstoolsprefix;
1204    global rtemstoolsprefix;
1205    global optimize;
1206    global debug;
1207    global verbose
1208    global microwin;
1209    global nanox;
1210    global shlibs;
1211    global objframe;
1212    global nwidget;
1213    global microwindemo;
1214    global nanoxdemo;
1215    global screenpixtype;
1216    global server;
1217    global sharedmem;
1218    global havefileio;
1219    global havebmp;
1220    global havejpg;
1221    global incjpg;
1222    global libjpg;
1223    global haveft;
1224    global incft;
1225    global libft;
1226    global havet1;
1227    global inct1;
1228    global libt1;
1229    global havehzk;
1230    global hzkdir;
1231    global hzkfontsize;
1232    global updateregions;
1233    global erasemove;
1234    global havemsfonts;
1235    global graypalette;
1236    global screenlinux;
1237    global vgafb;
1238    global portraitfb;
1239    global x11e15;
1240    global x11screenwidth;
1241    global x11screenheight;
1242    global x11screendepth;
1243    global mouselinux;
1244    global keyblinux;
1245    global vtswitch;
1246    global sa1100ltlend;
1247    global rtemsbuild;
1248    global rtemsbsp;
1249    global screenelks;
1250
1251    if {$arch == 0} {putvalue "ARCH" "LINUX-NATIVE"
1252    } elseif {$arch == 1} {putvalue "ARCH" "LINUX-ARM"
1253    } elseif {$arch == 2} {putvalue "ARCH" "LINUX-MIPS"
1254    } elseif {$arch == 3} {putvalue "ARCH" "RTEMS"
1255    } elseif {$arch == 4} {putvalue "ARCH" "SOLARIS"
1256    } elseif {$arch == 5} {putvalue "ARCH" "ELKS"}
1257
1258    putvalue "ARMTOOLSPREFIX" $armtoolsprefix;
1259    putvalue "MIPSTOOLSPREFIX" $mipstoolsprefix;
1260    putvalue "RTEMSTOOLSPREFIX" $rtemstoolsprefix;
1261    putvalue "OPTIMIZE" $optimize;
1262    putvalue "DEBUG" $debug;
1263    putvalue "VERBOSE" $verbose;
1264    putvalue "MICROWIN" $microwin
1265    putvalue "NANOX" $nanox;
1266    putvalue "SHAREDLIBS" $shlibs;
1267    putvalue "OBJFRAMEWORK" $objframe;
1268    putvalue "NWIDGET" $nwidget;
1269    putvalue "MICROWINDEMO" $microwindemo;
1270    putvalue "NANOXDEMO" $nanoxdemo;
1271    putvalue "SCREEN_PIXTYPE" $screenpixtype;
1272    putvalue "LINK_APP_INTO_SERVER" $server;
1273    putvalue "HAVE_SHAREDMEM_SUPPORT" $sharedmem;
1274    putvalue "HAVE_FILEIO" $havefileio;
1275    putvalue "HAVE_BMP_SUPPORT" $havebmp;
1276    putvalue "HAVE_JPEG_SUPPORT" $havejpg;
1277    putvalue "INCJPEG" $incjpg;
1278    putvalue "LIBJPEG" $libjpg;
1279    putvalue "HAVE_FREETYPE_SUPPORT" $haveft;
1280    putvalue "INCFTLIB" $incft;
1281    putvalue "LIBFTLIB" $libft;
1282    putvalue "HAVE_T1LIB_SUPPORT" $havet1;
1283    putvalue "INCT1LIB" $inct1;
1284    putvalue "LIBT1LIB" $libt1;
1285    putvalue "HAVE_HZK_SUPPORT" $havehzk;
1286    putvalue "HZK_FONT_DIR"              $hzkdir;
1287    putvalue "HZK_FONT_SIZE"             $hzkfontsize;
1288
1289    putvalue "UPDATEREGIONS" $updateregions;
1290    putvalue "ERASEMOVE" $erasemove;
1291    putvalue "HAVEMSFONTS" $havemsfonts;
1292    putvalue "GRAYPALETTE" $graypalette;
1293    putvalue "PORTRAIT_MODE" $portraitfb;
1294    putvalue "FBVGA" $vgafb;
1295    putvalue "SCREEN_E15" $x11e15;
1296    putvalue "SCREEN_WIDTH" $x11screenwidth;
1297    putvalue "SCREEN_HEIGHT" $x11screenheight;
1298    putvalue "SCREEN_DEPTH" $x11screendepth;
1299    putvalue "RTEMS_BUILD" $rtemsbuild;
1300    putvalue "RTEMS_BSP" $rtemsbsp;
1301    putvalue "SA1100_LCD_LTLEND" $sa1100ltlend;
1302
1303    if {$screenlinux == 0} {
1304       putvalue "FRAMEBUFFER" 1;
1305       putvalue "X11" 0;
1306       putvalue "VGALIB" 0;
1307       putvalue "HWVGA" 0;
1308    } elseif {$screenlinux == 1} {
1309       putvalue "FRAMEBUFFER" 0;
1310       putvalue "X11" 1;
1311       putvalue "VGALIB" 0;
1312       putvalue "HWVGA" 0;
1313    } elseif {$screenlinux == 2} {
1314       putvalue "FRAMEBUFFER" 0;
1315       putvalue "X11" 0;
1316       putvalue "VGALIB" 1;
1317       putvalue "HWVGA" 0;
1318    } elseif {$screenlinux == 2} {
1319       putvalue "FRAMEBUFFER" 0;
1320       putvalue "X11" 0;
1321       putvalue "VGALIB" 0;
1322       putvalue "HWVGA" 1;
1323    }
1324
1325    if {$mouselinux == 0} {
1326       putvalue "GPMMOUSE" 1;
1327       putvalue "SERMOUSE" 0;
1328       putvalue "TPMOUSE" 0;
1329       putvalue "TSMOUSE" 0;
1330       putvalue "NOMOUSE" 0;
1331    } elseif {$mouselinux == 1} {
1332       putvalue "GPMMOUSE" 0;
1333       putvalue "SERMOUSE" 1;
1334       putvalue "TPMOUSE" 0;
1335       putvalue "TSMOUSE" 0;
1336       putvalue "NOMOUSE" 0;
1337    } elseif {$mouselinux == 2} {
1338       putvalue "GPMMOUSE" 0;
1339       putvalue "SERMOUSE" 0;
1340       putvalue "TPMOUSE" 1;
1341       putvalue "TSMOUSE" 0;
1342       putvalue "NOMOUSE" 0;
1343    } elseif {$mouselinux == 3} {
1344       putvalue "GPMMOUSE" 0;
1345       putvalue "SERMOUSE" 0;
1346       putvalue "TPMOUSE" 0;
1347       putvalue "TSMOUSE" 1;
1348       putvalue "NOMOUSE" 0;
1349    } elseif {$mouselinux == 4} {
1350       putvalue "GPMMOUSE" 0;
1351       putvalue "SERMOUSE" 0;
1352       putvalue "TPMOUSE" 0;
1353       putvalue "TSMOUSE" 0;
1354       putvalue "NOMOUSE" 1;
1355    }
1356
1357    if {$keyblinux == 0} {
1358       putvalue "TTYKBD" 1;
1359       putvalue "NOKBD" 0;
1360    } elseif {$keyblinux == 1} {
1361       putvalue "TTYKBD" 0;
1362       putvalue "NOKBD" 1;
1363    }
1364
1365    putvalue "VTSWITCH" $vtswitch;
1366
1367    if {$screenelks == 0} {
1368       putvalue "ASMVGADRIVER" 1;
1369       putvalue "CVGADRIVER" 0;
1370       putvalue "HERCDRIVER" 0;
1371    } elseif {$screenelks == 1} {
1372       putvalue "ASMVGADRIVER" 0;
1373       putvalue "CVGADRIVER" 1;
1374       putvalue "HERCDRIVER" 0;
1375    } elseif {$screenelks == 2} {
1376       putvalue "ASMVGADRIVER" 0;
1377       putvalue "CVGADRIVER" 0;
1378       putvalue "HERCDRIVER" 1;
1379    }
1380
1381    puts "Now type `make` ... Enjoy"
1382 }
1383
1384
1385 ################################################################################
1386 #
1387 # Write a value to the configuration file
1388 #
1389 ################################################################################
1390 proc putvalue {name value} {
1391    global configfile;
1392
1393    set found 0;
1394    set configfile [open "config" r+]
1395    set tempconfigfile [open "config~" w+]
1396
1397    if {$value == "0"} {set value "N"} elseif {$value == "1"} {set value "Y"}
1398
1399    seek $configfile 0 start;
1400    seek $tempconfigfile 0 start;
1401
1402    while {[eof $configfile] == 0} {
1403       set linelength [gets $configfile line];
1404
1405       if {[regexp ($name)(\ |\t)*(=)(\ |\t)*(.*) $line all a b c d e] == 1 && $found == 0} {
1406          set $e [string trim $e]
1407
1408          puts -nonewline $tempconfigfile $name
1409
1410          set padding [expr 25 - [string length $name]]
1411
1412          for {set i 0} {$i < $padding} {incr i} {
1413             puts  -nonewline $tempconfigfile " "
1414          }
1415
1416          puts $tempconfigfile "= $value"
1417
1418          set found 1;
1419       } else {
1420          if {[eof $configfile] == 0} {
1421             puts $tempconfigfile $line
1422          } else {
1423             puts -nonewline $tempconfigfile $line
1424          }
1425       }
1426    }
1427
1428
1429    close $tempconfigfile;
1430    close $configfile;
1431
1432    file rename -force "config~" "config"  
1433 }
1434
1435 # Initialization ...
1436 readconfig;