source: trunk/Configure @ 1056

Last change on this file since 1056 was 1056, checked in by garnier, 15 years ago

en teste

  • Property svn:executable set to *
File size: 143.8 KB
Line 
1#! /bin/sh
2#
3# If these # comments don't work, trim them. Don't worry about any other
4# shell scripts, Configure will trim # comments from them for you.
5#
6# (If you are trying to port this package to a machine without sh,
7# I would suggest you have a look at the prototypical config_h.SH file
8# and edit it to reflect your system. Some packages may include samples
9# of config.h for certain machines, so you might look for one of those.)
10#
11# Yes, you may rip this off to use in other distribution packages. This
12# script belongs to the public domain and cannot be copyrighted.
13#
14# (Note: this Configure script was generated automatically. Rather than
15# working with this copy of Configure, you may wish to get metaconfig.
16# The dist-3.0 package (which contains metaconfig) was posted in
17# comp.sources.misc and is available on CPAN under authors/id/RAM so
18# you may fetch it yourself from your nearest archive site.)
19#
20
21# $Id: Configure,v 1.116 2009/05/26 17:37:44 bmorgan Exp $
22#
23# Generated on Tue May 26 18:39:05 BST 2009 [metaconfig 3.0 PL70]
24
25cat >/tmp/c1$$ <<EOF
26WARNING!!!!!
27
28SCO csh still thinks true is false!  /bin/csh needs to be updated.
29EOF
30cat >/tmp/c2$$ <<EOF
31
32You didn't run Configure with sh!
33I'll attempt to run sh for you...
34EOF
35
36true || cat /tmp/c1$$ /tmp/c2$$
37true || exec sh $0 $argv:q
38
39(exit $?0) || cat /tmp/c2$$
40(exit $?0) || exec sh $0 $argv:q
41rm -f /tmp/c1$$ /tmp/c2$$
42
43: compute my invocation name
44me=$0
45case "$0" in
46*/*)
47        me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null`
48        test "$me" || me=$0
49        ;;
50esac
51
52: Proper PATH separator
53p_=:
54: On OS/2 this directory should exist if this is not floppy only system :-]
55#if test -d c:/.; then
56#       p_=\;
57#       PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
58#?X: That's a bug in ksh5.22
59#       OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
60#fi
61
62: Proper PATH setting
63paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
64paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
65paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
66paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
67paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
68paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /usr/ccs/bin"
69paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
70paths="$paths /sbin /usr/sbin /usr/libexec"
71
72for p in $paths
73do
74        case "$p_$PATH$p_" in
75        *$p_$p$p_*) ;;
76        *) test -d $p && PATH=$PATH$p_$p ;;
77        esac
78done
79
80PATH=.$p_$PATH
81export PATH
82
83: shall we be using ksh?
84inksh=''
85needksh=''
86avoidksh=''
87newsh=/bin/ksh
88changesh=''
89if (PATH=.; alias -x) >/dev/null 2>&1; then
90                inksh=true
91fi
92if test -f /hp-ux -a -f /bin/ksh; then
93        needksh='to avoid sh bug in "here document" expansion'
94fi
95if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
96        if test X`/usr/bin/uname -v` = X4; then
97                avoidksh="to avoid AIX 4's /bin/sh"
98                newsh=/usr/bin/bsh
99        fi
100fi
101case "$inksh/$needksh" in
102/[a-z]*)
103                unset ENV
104                changesh=true
105                reason="$needksh"
106        ;;
107esac
108case "$inksh/$avoidksh" in
109true/[a-z]*)
110        changesh=true
111        reason="$avoidksh"
112        ;;
113esac
114case "$inksh/$needksh-$avoidksh-" in
115true/--)
116                cat <<EOM
117(I see you are using the Korn shell.  In case of problems
118 try the Bourne shell instead.)
119EOM
120        ;;
121esac
122case "$changesh" in
123true)
124        echo "(Feeding myself to $newsh $reason.)"
125        case "$0" in
126        Configure|*/Configure) exec $newsh $0 "$@";;
127        *) exec $newsh Configure "$@";;
128        esac
129        ;;
130esac
131
132: Configure runs within the UU subdirectory
133test -d .config/UU || mkdir -p .config/UU
134unset CDPATH
135cd .config/UU && rm -f ./*
136
137eunicefix=''
138g4compiler=''
139g4osname=''
140g4system=''
141hint=''
142myuname=''
143osname=''
144osvers=''
145g4_qt_cxxflags=''
146g4_qt_gl_cxxflags=''
147g4_qt_gl_libs=''
148g4_qt_libs=''
149g4_qt_moc=''
150g4_qt_version=''
151Author=''
152Date=''
153Header=''
154Id=''
155Locker=''
156Log=''
157RCSfile=''
158Revision=''
159Source=''
160State=''
161cf_by=''
162cf_time=''
163contains=''
164d_portable=''
165g4base=''
166g4conf=''
167g4final_install=''
168g4include=''
169g4includes_flag=''
170g4install=''
171g4workdir=''
172g4bin=''
173g4lib=''
174g4tmp=''
175g4abladata=''
176g4data=''
177g4elasticdata=''
178g4ledata=''
179g4levelgammadata=''
180g4neutronhpcrosssections=''
181g4radioactivedata=''
182g4clhep_base_dir=''
183g4clhep_include_dir=''
184g4clhep_lib=''
185g4clhep_lib_dir=''
186g4lib_build_shared=''
187g4lib_build_static=''
188g4lib_use_dll=''
189g4lib_use_dyn=''
190g4lib_use_shared=''
191g4lib_use_static=''
192g4global=''
193g4granular=''
194g4lib_use_granular=''
195g4debug=''
196g4ui_build_gag_session=''
197g4ui_build_terminal_session=''
198g4ui_build_win32_session=''
199g4ui_build_xaw_session=''
200g4ui_build_xm_session=''
201g4ui_none=''
202g4ui_use_gag=''
203g4ui_use_tcsh=''
204g4ui_use_terminal=''
205g4ui_use_win32=''
206g4ui_use_xaw=''
207g4ui_use_xm=''
208g4ui_xawflags=''
209g4ui_xawhome=''
210g4ui_xawlibs=''
211g4vis_xmflags=''
212g4vis_xmhome=''
213g4vis_xmlibs=''
214g4ui_build_qt_session=''
215g4ui_use_qt=''
216g4vis_build_asciitree_driver=''
217g4vis_build_dawn_driver=''
218g4vis_build_dawnfile_driver=''
219g4vis_build_oiwin32_driver=''
220g4vis_build_oix_driver=''
221g4vis_build_openglwin32_driver=''
222g4vis_build_openglx_driver=''
223g4vis_build_openglxm_driver=''
224g4vis_build_raytracer_driver=''
225g4vis_build_raytracerx_driver=''
226g4vis_build_vrml_driver=''
227g4vis_build_vrmlfile_driver=''
228g4vis_oglhome=''
229g4vis_oivhome=''
230g4vis_use_asciitree=''
231g4vis_use_dawn=''
232g4vis_use_dawnfile=''
233g4vis_use_oiwin32=''
234g4vis_use_oix=''
235g4vis_use_openglwin32=''
236g4vis_use_openglx=''
237g4vis_use_openglxm=''
238g4vis_use_raytracer=''
239g4vis_use_raytracerx=''
240g4vis_use_vrml=''
241g4vis_use_vrmlfile=''
242g4vis_xmflags=''
243g4vis_xmhome=''
244g4vis_xmlibs=''
245g4vis_build_openglqt_driver=''
246g4vis_use_openglqt=''
247g4gdml_xercesc_root=''
248g4lib_build_gdml=''
249g4wanalysis_build=''
250g4wanalysis_build_jas=''
251g4wanalysis_build_lab=''
252g4wanalysis_build_lizard=''
253g4wanalysis_use=''
254g4wanalysis_use_jas=''
255g4wanalysis_use_lab=''
256g4wanalysis_use_lizard=''
257g4_gmake=''
258g4_gmake_version=''
259g4_make=''
260g4_make_version=''
261g4make=''
262g4w_use_g3tog4=''
263g4wlib_build_g3tog4=''
264g4w_use_zlib=''
265g4wlib_build_zlib=''
266lns=''
267c=''
268n=''
269package=''
270spackage=''
271sh=''
272sharpbang=''
273shsharp=''
274spitshell=''
275src=''
276startsh=''
277CONFIG=''
278
279define='define'
280undef='undef'
281smallmach='pdp11 i8086 z8000 i80286 iAPX286'
282rmlist=''
283
284: We must find out about Eunice early
285eunicefix=':'
286if test -f /etc/unixtovms; then
287        eunicefix=/etc/unixtovms
288fi
289if test -f /etc/unixtovms.exe; then
290        eunicefix=/etc/unixtovms.exe
291fi
292
293#INITIALIZE QT UI OPTIONS
294g4ui_build_qt_session='n'
295g4ui_use_qt='n'
296g4_qthome=''
297#END QT UI OPTIONS
298#INITIALIZE QT UI OPTIONS
299g4ui_build_qt_session='n'
300g4ui_use_qt='n'
301#END QT UI OPTIONS
302#INITIALIZE QT VIS DRIVER OPTIONS
303g4vis_build_openglqt_driver='n'
304g4vis_use_openglqt='n'
305#END QT VIS DRIVER OPTIONS
306#INITIALIZE G4MAKE
307g4make=""
308#END G4MAKE INITIALIZATION
309
310: Find the basic shell for Bourne shell scripts
311case "$sh" in
312'')
313        case "$SYSTYPE" in
314        *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
315        *) xxx='/bin/sh';;
316        esac
317        if test -f "$xxx"; then
318                sh="$xxx"
319        else
320                : Build up a list and do a single loop so we can 'break' out.
321                pth=`echo $PATH | sed -e "s/$p_/ /g"`
322                for xxx in sh bash ksh pdksh ash; do
323                        for p in $pth; do
324                                try="$try ${p}/${xxx}"
325                        done
326                done
327                for xxx in $try; do
328                        if test -f "$xxx"; then
329                                sh="$xxx";
330                                break
331                        elif test -f "$xxx.exe"; then
332                                sh="$xxx";
333                                break
334                        fi
335                done
336        fi
337        ;;
338esac
339
340case "$sh" in
341'')     cat <<EOM >&2
342$me:  Fatal Error:  I can't find a Bourne Shell anywhere. 
343
344Usually it's in /bin/sh.
345Please contact Serguei.Sadilov@cern.ch and
346we'll try to straighten this all out.
347EOM
348        exit 1
349        ;;
350esac
351
352: see if sh knows # comments
353if `$sh -c '#' >/dev/null 2>&1`; then
354        shsharp=true
355        spitshell=cat
356        xcat=/bin/cat
357        test -f $xcat || xcat=/usr/bin/cat
358        echo "#!$xcat" >try
359        $eunicefix try
360        chmod +x try
361#
362# $xcat is wrong on WIN32: there is no /bin/cat and /usr/bin/cat by default.
363# But we are sure that sharpbang is to be '#!' and let 'today' will be !=0.
364#
365#       ./try > today
366        echo "#!$xcat" >today
367
368        if test -s today; then
369                sharpbang='#!'
370        else
371                echo "#! $xcat" > try
372                $eunicefix try
373                chmod +x try
374#
375# $xcat is wrong on WIN32: there is no /bin/cat and /usr/bin/cat by default.
376# But we are sure that sharpbang is to be '#!' and let 'today' will be !=0.
377#
378#       ./try > today
379        echo "#!$xcat" >today
380
381                if test -s today; then
382                        sharpbang='#! '
383                else
384                        sharpbang=': use '
385                fi
386        fi
387else
388        echo " "
389        echo "Your $sh doesn't grok # comments--I will strip them later on."
390        shsharp=false
391        cd ..
392        echo "exec grep -v '^[  ]*#'" >spitshell
393        chmod +x spitshell
394        $eunicefix spitshell
395        spitshell=`pwd`/spitshell
396        cd UU
397        echo "I presume that if # doesn't work, #! won't work either!"
398        sharpbang=': use '
399fi
400rm -f try today
401
402: figure out how to guarantee sh startup
403case "$startsh" in
404'') startsh=${sharpbang}${sh} ;;
405*)
406esac
407cat >try <<EOSS
408$startsh
409set abc
410test "$?abc" != 1
411EOSS
412
413chmod +x try
414$eunicefix try
415if ./try; then
416        : echo "Yup, it does."
417else
418        echo "Hmm... '$startsh' does not guarantee sh startup..."
419        echo "You may have to fix up the shell scripts to make sure $sh runs them."
420fi
421rm -f try
422
423: produce awk script to parse command line options
424cat >options.awk <<'EOF'
425BEGIN {
426        optstr = "dD:eEf:hKOrsSU:V";    # getopt-style specification
427
428        len = length(optstr);
429        for (i = 1; i <= len; i++) {
430                c = substr(optstr, i, 1);
431                if (i < len) a = substr(optstr, i + 1, 1); else a = "";
432                if (a == ":") {
433                        arg[c] = 1;
434                        i++;
435                }
436                opt[c] = 1;
437        }
438}
439{
440        expect = 0;
441        str = $0;
442        if (substr(str, 1, 1) != "-") {
443                printf("'%s'\n", str);
444                next;
445        }
446        len = length($0);
447        for (i = 2; i <= len; i++) {
448                c = substr(str, i, 1);
449                if (!opt[c]) {
450                        printf("-%s\n", substr(str, i));
451                        next;
452                }
453                printf("-%s\n", c);
454                if (arg[c]) {
455                        if (i < len)
456                                printf("'%s'\n", substr(str, i + 1));
457                        else
458                                expect = 1;
459                        next;
460                }
461        }
462}
463END {
464        if (expect)
465                print "?";
466}
467EOF
468
469: process the command line options
470set X `for arg in "$@"; do echo "X$arg"; done |
471        sed -e s/X// | awk -f options.awk`
472eval "set $*"
473shift
474rm -f options.awk
475
476: set up default values
477fastread=''
478reuseval=false
479config_sh=''
480alldone=''
481error=''
482silent=''
483extractsh=''
484override=''
485knowitall=''
486rm -f optdef.sh
487cat >optdef.sh <<EOS
488$startsh
489EOS
490
491
492: option parsing
493while test $# -gt 0; do
494        case "$1" in
495        -d) shift; fastread=yes;;
496        -e) shift; alldone=cont;;
497        -build) shift; g4build=yes;;
498        -incflags) shift; g4incflags=yes;;
499        -install) shift; install=yes;;
500        -cppflags) shift; g4cppflags=yes;;
501        -cxxflags) shift; g4cxxflags=yes;;
502        -ldlibs) shift; g4ldlibs=yes;;
503        -ldflags) shift; g4ldflags=yes;;
504        -f)
505                shift
506                cd ../..
507                if test -r "$1"; then
508                        config_sh="$1"
509                else
510                        echo "$me: cannot read config file $1." >&2
511                        error=true
512                fi
513                cd .config/UU
514                shift;;
515        -h) shift; error=true;;
516        -r) shift; reuseval=true;;
517        -s) shift; silent=true; realsilent=true;;
518        -E) shift; alldone=exit;;
519        -K) shift; knowitall=true;;
520        -O) shift; override=true;;
521        -S) shift; silent=true; extractsh=true;;
522        -D)
523                shift
524                case "$1" in
525                *=)
526                        echo "$me: use '-U symbol=', not '-D symbol='." >&2
527                        echo "$me: ignoring -D $1" >&2
528                        ;;
529                *=*) echo "$1" | \
530                                sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
531                *) echo "$1='define'" >> optdef.sh;;
532                esac
533                shift
534                ;;
535        -U)
536                shift
537                case "$1" in
538                *=) echo "$1" >> optdef.sh;;
539                *=*)
540                        echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
541                        echo "$me: ignoring -U $1" >&2
542                        ;;
543                *) echo "$1='undef'" >> optdef.sh;;
544                esac
545                shift
546                ;;
547        -V) echo "$me generated by metaconfig 3.0 PL70." >&2
548                exit 0;;
549        --) break;;
550        -*) echo "$me: unknown option $1" >&2; shift; error=true;;
551        *) break;;
552        esac
553done
554
555case "$error" in
556true)
557        cat >&2 <<EOM
558Usage: $me [-dehrsEKOSV] [-install] [-build] [-libs] [-f config.sh] [-D symbol] [-D symbol=value]
559                 [-U symbol] [-U symbol=]
560  -d : use defaults for all answers.
561  -e : go on without questioning past the production of config.sh.
562  -build : start configuration AND build of Geant4 libraries.
563  -cppflags : retrieve the list of cppflags
564  -cxxflags : retrieve the list of cxxflags
565  -incflags : retrieve the list of incflags
566  -install : start installation of Geant4 libraries.
567  -ldflags : retrieve the list of directories where libraries are placed
568  -ldlibs : retrieve the list of libraries to link
569  -f : specify an alternate default configuration file.
570  -h : print this help message and exit (with an error status).
571  -r : reuse C symbols value if possible (skips costly nm extraction).
572  -s : silent mode, only echoes questions and essential information.
573  -D : define symbol to have some value:
574         -D symbol         symbol gets the value 'define'
575         -D symbol=value   symbol gets the value 'value'
576  -E : stop at the end of questions, after having produced config.sh.
577  -K : do not use unless you know what you are doing.
578  -O : let -D and -U override definitions from loaded configuration file.
579  -S : perform variable substitutions on all .SH files (can mix with -f)
580  -U : undefine symbol:
581         -U symbol    symbol gets the value 'undef'
582         -U symbol=   symbol gets completely empty
583  -V : print version number and exit (with a zero status).
584EOM
585        exit 1
586        ;;
587esac
588
589: Sanity checks
590case "$fastread$alldone" in
591yescont|yesexit) ;;
592*)
593        if test ! -t 0; then
594                echo "Say 'sh Configure', not 'sh <Configure'"
595                exit 1
596        fi
597        ;;
598esac
599
600exec 4>&1
601case "$silent" in
602true) exec 1>/dev/null;;
603esac
604
605: run the defines and the undefines, if any, but leave the file out there...
606touch optdef.sh
607. ./optdef.sh
608
609: set package name
610package=g4conf
611
612: Some greps do not return status, grrr.
613echo "grimblepritz" >grimble
614if grep blurfldyick grimble >/dev/null 2>&1 ; then
615        contains=contains
616elif grep grimblepritz grimble >/dev/null 2>&1 ; then
617        contains=grep
618else
619        contains=contains
620fi
621rm -f grimble
622: the following should work in any shell
623case "$contains" in
624contains*)
625        echo " "
626        echo "Grep doesn't return a status!!  Attempting remedial action."
627        cat >contains <<'EOSS'
628grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
629EOSS
630chmod +x contains
631esac
632
633: first determine how to suppress newline on echo command
634#echo " "
635#echo "Checking echo to see how to suppress newlines..."
636(echo "hi there\c" ; echo " ") >.echotmp
637if $contains c .echotmp >/dev/null 2>&1 ; then
638#       echo "...using -n."
639        n='-n'
640        c=''
641else
642#       cat <<'EOM'
643#...using \c
644#EOM
645        n=''
646        c='\c'
647fi
648#echo $n "The star should be here-->$c"
649#echo '*'
650rm -f .echotmp
651
652: compute the number of columns on the terminal for proper question formatting
653case "$COLUMNS" in
654'') COLUMNS='80';;
655esac
656
657: set up the echo used in my read
658myecho="case \"\$xxxm\" in
659'') echo $n \"\$rp $c\" >&4;;
660*) case \"\$rp\" in
661        '') echo $n \"[\$xxxm] $c\";;
662        *)
663                if test \`echo \"\$rp [\$xxxm]  \" | wc -c\` -ge $COLUMNS; then
664                        echo \"\$rp\" >&4
665                        echo $n \"[\$xxxm] $c\" >&4
666                else
667                        echo $n \"\$rp [\$xxxm] $c\" >&4
668                fi
669                ;;
670        esac;;
671esac"
672
673: now set up to do reads with possible shell escape and default assignment
674cat <<EOSC >myread
675$startsh
676xxxm=\$dflt
677$myecho
678ans='!'
679case "\$fastread" in
680yes) case "\$dflt" in
681        '') ;;
682        *) ans='';
683                case "\$silent-\$rp" in
684                true-) ;;
685                *) echo " " >&4;;
686                esac;;
687        esac;;
688*) case "\$silent" in
689        true) case "\$rp" in
690                '') ans='';;
691                esac;;
692        esac;;
693esac
694while expr "X\$ans" : "X!" >/dev/null; do
695        read answ
696        set x \$xxxm
697        shift
698        aok=''; eval "ans=\\"\$answ\\"" && aok=y
699        case  "\$answ" in
700        "!")
701                sh 1>&4
702                echo " "
703                $myecho
704                ;;
705        !*)
706                set x \`expr "X\$ans" : "X!\(.*\)\$"\`
707                shift
708                sh 1>&4 -c "\$*"
709                echo " "
710                $myecho
711                ;;
712        "\$ans")
713                case "\$ans" in
714                \\&*)
715                        set x \`expr "X\$ans" : "X&\(.*\)\$"\`
716                        shift
717                        case "\$1" in
718                        -d)
719                                fastread=yes
720                                echo "(OK, I'll run with -d after this question.)" >&4
721                                ;;
722                        -*)
723                                echo "*** Sorry, \$1 not supported yet." >&4
724                                ;;
725                        esac
726                        $myecho
727                        ans=!
728                        ;;
729                esac;;
730        *)
731                case "\$aok" in
732                y)
733                        echo "*** Substitution done -- please confirm."
734                        xxxm="\$ans"
735                        ans=\`echo $n "\$ans$c" | tr '\012' ' '\`
736                        xxxm="\$ans"
737                        ans=!
738                        ;;
739                *)
740                        echo "*** Error -- try again."
741                        ans=!
742                        ;;
743                esac
744                $myecho
745                ;;
746        esac
747        case "\$ans\$xxxm\$nostick" in
748        '')
749                ans=!
750                $myecho
751                ;;
752        esac
753done
754case "\$ans" in
755'') ans="\$xxxm";;
756esac
757EOSC
758
759: Find the path to the source tree
760case "$src" in
761'') src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
762#echo "src=$src"
763;;
764esac
765case "$src" in
766'')
767        src=.
768        rsrc=..
769        ;;
770/*) rsrc="$src/.."
771#echo "rsrc=$rsrc"
772;;
773./*)    cur_dir=`pwd`
774        cd ../../$src
775        src=`pwd`
776        cd $cur_dir
777        rsrc="$src/.."
778rsrc="$src/.."
779#echo "src=$src"
780#echo "rsrc=$rsrc"
781;;
782*) rsrc="../../$src"
783#echo "rsrc=$rsrc"
784;;
785esac
786#cur_dir=`pwd`
787#echo "cur_dir=$cur_dir"
788if test -f $src/Configure && \
789        $contains "^package=$package" $src/Configure >/dev/null 2>&1
790then
791   : found it, so we are ok.
792else
793        rsrc=''
794        for src in . .. ../.. ../../.. ../../../..; do
795                if test -f ../../$src/Configure && \
796                        $contains "^package=$package" ../../$src/Configure >/dev/null 2>&1
797                then
798                        rsrc=../../$src
799                        break
800                fi
801        done
802fi
803case "$rsrc" in
804'')
805        echo " "
806#       dflt=
807#       rp="Directory where sources for $package are located?"
808#       . ./myread
809#       src="$ans"
810        rsrc="$src"
811#echo "src=$src"
812#echo "rsrc=$rsrc"
813        if test -f $rsrc/Configure && \
814                $contains "^package=$package" $rsrc/Configure >/dev/null 2>&1
815        then
816                echo "Ok, I've found them under $src"
817        else
818                echo "Sorry, I can't seem to be able to locate $package sources." >&4
819                echo "Please, use absolute path or relative with './' to Configure." >&4
820                exit 1
821        fi
822        ;;
823../../.) ;;
824*)
825#       echo " "
826#       echo "Sources for $package found in $src" >&4
827        ;;
828esac
829
830: script used to extract .SH files with variable substitutions
831cat >extract <<'EOS'
832CONFIG=true
833#echo "Doing variable substitutions on .SH files..."
834if test -f $src/MANIFEST; then
835        set x `awk '{print $1}' <$src/MANIFEST | grep '\.SH'`
836else
837#       echo "(Looking for .SH files under the source directory.)"
838        set x `(cd $src; find ./config/scripts -name "*.SH" -print)`
839fi
840shift
841case $# in
8420) set x `(cd $src; echo *.SH)`; shift;;
843esac
844if test ! -f $src/$1; then
845        shift
846fi
847mkdir_p='
848name=$1;
849create="";
850while test $name; do
851        if test ! -d "$name"; then
852                create="$name $create";
853                name=`echo $name | sed -e "s|^[^/]*$||"`;
854                name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
855        else
856                name="";
857        fi;
858done;
859for file in $create; do
860        mkdir $file;
861done
862'
863for file in $*; do
864        case "$src" in
865        ".")
866                case "$file" in
867                */*)
868                        dir=`expr X$file : 'X\(.*\)/'`
869                        file_SH=`expr X$file : 'X.*/\(.*\)'`
870                        file_EX=`expr X$file : 'X.*/\(.*\).SH'`
871                        (cd $dir && . ./$file_SH && mkdir -p $abssrc/.config/bin/$g4system && mv $file_EX $abssrc/.config/bin/$g4system)
872#                       echo Sergei_1
873#                       echo "file_SH=$file_SH"
874#                       echo "file_EX=$file_EX"
875#                       echo "file=$file"
876#                       echo "dir=$dir"
877#                       echo "src=$src"
878#                       echo "g4system=$g4system"
879#                       echo Sergei_1
880                        ;;
881                *)
882                        file_SH=`expr X$file : 'X.*/\(.*\)'`
883                        file_EX=`expr X$file : 'X.*/\(.*\).SH'`
884                        (. ./$file && mkdir -p $abssrc/.config/bin/$g4system && mv file-SH $abssrc/.config/bin/$g4system)
885#                       echo Sergei_2
886#                       echo "file_SH=$file_SH"
887#                       echo "file_EX=$file_EX"
888#                       echo "file=$file"
889#                       echo "dir=$dir"
890#                       echo "src=$src"
891#                       echo "g4system=$g4system"
892#                       echo Sergei_2
893                        ;;
894                esac
895                ;;
896        *)
897                case "$file" in
898                */*)
899                        dir=`expr X$file : 'X\(.*\)/'`
900                        file_SH=`expr X$file : 'X.*/\(.*\)'`
901                        file_EX=`expr X$file : 'X.*/\(.*\)\.SH'`
902                        (set x $dir; shift; eval $mkdir_p)
903
904                        (sh <$src/$dir/$file_SH && mkdir -p $src/.config/bin/$g4system && mv $file_EX $src/.config/bin/$g4system)
905
906#                       echo Sergei_3
907#                       echo "dir=$dir"
908#                       echo "file=$file"
909
910#                       echo Sergei_3
911                        ;;
912                *)
913                        file_SH=`expr X$file : 'X.*/\(.*\)'`
914                        file_EX=`expr X$file : 'X.*/\(.*\)\.SH'`
915                        (sh <$src/$file && mkdir -p $src/.config/bin/$g4system && mv $file_EX $src/.config/bin/$g4system)
916                        echo Sergei_4
917                        ;;
918                esac
919                ;;
920        esac
921done
922if test -f $src/config_h.SH; then
923        if test ! -f config.h; then
924        : oops, they left it out of MANIFEST, probably, so do it anyway.
925        . $src/config_h.SH
926        fi
927fi
928EOS
929
930: extract files and exit if asked to do so
931case "$extractsh" in
932true)
933        case "$realsilent" in
934        true) ;;
935        *) exec 1>&4;;
936        esac
937        case "$config_sh" in
938        '') config_sh='$g4conf/config.sh'; config="$g4conf/config.sh";;
939        /*) config="$g4conf/$config_sh";;
940        *) config="$g4conf/$config_sh";;
941        esac
942        echo " "
943        echo "Fetching answers from $config_sh..."
944        . $config
945        test "$override" && . ./optdef.sh
946        echo " "
947        cd ../..
948        . .config/UU/extract
949        rm -rf .config/UU
950        echo "Done."
951        exit 0
952        ;;
953esac
954
955: Eunice requires " " instead of "", can you believe it
956#echo " "
957: Here we go...
958#if [ X$install = Xyes ] ; then
959#echo " "
960#echo " "
961#echo " "
962#echo "                --- Geant4 Toolkit Installation  ---"
963#echo " "
964#echo " "
965#echo " "
966#echo " "
967#else
968#echo " "
969#echo " "
970#echo " "
971#echo "                --- Geant4 Toolkit Installation  ---"
972#echo "                  (setting environments for USER )"
973#echo " "
974#echo " "
975#echo " "
976#fi
977
978trap 'echo " ";rm -rf ../../.config/UU; test -d ../../.config/UU && rm -rf X $rmlist; exit 1' 1 2 3 15
979
980: create .config dir to save info across Configure sessions
981test -d ../.config || mkdir ../.config
982cat >../.config/README <<EOF
983This directory created by Configure to save information that should
984persist across sessions for $package.
985
986You may safely delete it if you wish.
987EOF
988
989: general instructions
990needman=true
991firsttime=true
992user=`(logname) 2>/dev/null`
993case "$user" in
994'') user=`whoami 2>&1`;;
995esac
996
997#if [ X$install = Xyes ] ; then
998#
999#echo " "
1000#echo " "
1001#echo " "
1002#echo "                --- Geant4 Toolkit Installation  ---"
1003#echo " "
1004#echo " "
1005#echo " "
1006#echo " "
1007#
1008##if $contains "^$user\$" ../../.config/instruct >/dev/null 2>&1; then
1009##      firsttime=false
1010##      echo " "
1011##      rp='Would you like to see the instructions?'
1012##      dflt=n
1013##      . ./myread
1014##      case "$ans" in
1015##      [yY]*) ;;
1016##      *) needman=false;;
1017##      esac
1018##fi
1019#fi
1020
1021if [ X$g4build = Xyes ] ; then
1022
1023echo " "
1024echo " "
1025echo " "
1026echo "                --- Geant4 Toolkit Build  ---"
1027echo " "
1028echo " "
1029echo " "
1030echo " "
1031
1032if $contains "^$user\$" ../../.config/instruct >/dev/null 2>&1; then
1033        firsttime=false
1034        echo " "
1035        rp='Would you like to see the instructions?'
1036        dflt=n
1037        . ./myread
1038        case "$ans" in
1039        [yY]*) ;;
1040        *) needman=false;;
1041        esac
1042fi
1043fi
1044
1045if [ X$install = Xyes ] ; then
1046needman=false
1047fi
1048
1049if [ X$install = X -a X$g4build = X ] ; then
1050needman=false
1051fi
1052
1053if $needman; then
1054        cat <<EOH
1055 
1056This installation shell script will examine your system and ask you questions
1057to determine how the Geant4 Toolkit should be installed.  If you get stuck on
1058a question, you may use a ! shell escape to start a subshell or execute a
1059command.  Many of the questions will have default answers in square brackets;
1060typing carriage return will set the default.
1061
1062On AFS it is allowed to specify either absolute or relative
1063paths (i.e. starting with the ~username construct).
1064
1065EOH
1066        rp=''
1067        dflt='Type carriage return to continue'
1068        . ./myread
1069        cat <<'EOH'
1070
1071The prompt used in this script allows you to use shell variables and backticks
1072in your answers. You may use $1, $2, etc...  to refer to the words in the
1073default answer, as if the default line was a set of arguments given to a
1074script shell. This means you may also use $* to repeat the whole default line.
1075
1076Everytime there is a substitution, you will have to confirm.  If there is an
1077error (e.g. an unmatched backtick), the default answer will remain unchanged
1078and you will be prompted again.
1079
1080Running 'Configure -d' will bypass nearly all the questions and
1081use the computed defaults (or answers saved in a configuration
1082previously generated).
1083
1084Type 'Configure -h' for a list of options.
1085
1086You may also start interactively and then answer '& -d' at any prompt to turn
1087on the non-interactive behaviour for the rest of the execution.
1088
1089EOH
1090        . ./myread
1091        cat <<EOH
1092
1093Much effort has been spent to ensure that this shell script will run on any
1094Unix system. If despite that you can't run Configure for some reason, you'll
1095have to set the proper environment variables by hand and follow the "manual"
1096installation as specified in the Geant4 Installation Guide.
1097
1098EOH
1099        dflt='Type carriage return to continue'
1100        . ./myread
1101        case "$firsttime" in
1102        true) echo $user >>../../.config/instruct;;
1103        esac
1104fi
1105
1106: find out where common programs are
1107#echo " "
1108#echo "Locating common programs..." >&4
1109cat <<EOSC >loc
1110$startsh
1111case \$# in
11120) exit 1;;
1113esac
1114thing=\$1
1115shift
1116dflt=\$1
1117shift
1118for dir in \$*; do
1119        case "\$thing" in
1120        .)
1121        if test -d \$dir/\$thing; then
1122                echo \$dir
1123                exit 0
1124        fi
1125        ;;
1126        *)
1127        for thisthing in \$dir/\$thing; do
1128                : just loop through to pick last item
1129        done
1130        if test -f \$thisthing; then
1131                echo \$thisthing
1132                exit 0
1133        elif test -f \$dir/\$thing.exe; then
1134                : on Eunice apparently
1135                echo \$dir/\$thing
1136                exit 0
1137        fi
1138        ;;
1139        esac
1140done
1141echo \$dflt
1142exit 1
1143EOSC
1144chmod +x loc
1145$eunicefix loc
1146loclist="
1147awk
1148cat
1149echo
1150expr
1151grep
1152rm
1153sed
1154touch
1155tr
1156"
1157trylist="
1158date
1159gcc
1160ln
1161test
1162uname
1163"
1164pth=`echo $PATH | sed -e "s/$p_/ /g"`
1165pth="$pth /lib /usr/lib"
1166for file in $loclist; do
1167        eval xxx=\$$file
1168        case "$xxx" in
1169        /*|?:[\\/]*)
1170                if test -f "$xxx"; then
1171                        : ok
1172                else
1173                        echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
1174                        xxx=`./loc $file $file $pth`
1175                fi
1176                ;;
1177        '') xxx=`./loc $file $file $pth`;;
1178        *) xxx=`./loc $xxx $xxx $pth`;;
1179        esac
1180        eval $file=$xxx
1181        eval _$file=$xxx
1182        case "$xxx" in
1183        /*)
1184                echo "$file is in $xxx." > /dev/null
1185                ;;
1186        ?:[\\/]*)
1187                echo "$file is in $xxx." > /dev/null
1188                ;;
1189        *)
1190                echo "I don't know where '$file' is." >&4
1191                echo "Please, install it or fix your PATH settings!" >&4
1192                exit 1
1193                ;;
1194        esac
1195done
1196#echo " "
1197#echo "Don't worry if any of the following aren't found..."
1198say=offhand
1199for file in $trylist; do
1200        eval xxx=\$$file
1201        case "$xxx" in
1202        /*|?:[\\/]*)
1203                if test -f "$xxx"; then
1204                        : ok
1205                else
1206                        echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
1207                        xxx=`./loc $file $file $pth`
1208                fi
1209                ;;
1210        '') xxx=`./loc $file $file $pth`;;
1211        *) xxx=`./loc $xxx $xxx $pth`;;
1212        esac
1213        eval $file=$xxx
1214        eval _$file=$xxx
1215        case "$xxx" in
1216        /*)
1217                echo "$file is in $xxx." > /dev/null
1218                ;;
1219        ?:[\\/]*)
1220                echo "$file is in $xxx." > /dev/null
1221                ;;
1222        *)
1223                echo "I don't see $file out there, $say."
1224                say=either
1225                ;;
1226        esac
1227done
1228case "$egrep" in
1229egrep)
1230#       echo "Substituting grep for egrep."
1231        egrep=$grep
1232        ;;
1233esac
1234case "$ln" in
1235ln)
1236#       echo "Substituting cp for ln."
1237        ln=$cp
1238        ;;
1239esac
1240case "$test" in
1241test)
1242        echo "Hopefully test is built into your sh." > /dev/null
1243        ;;
1244*)
1245        if `sh -c "PATH= test true" >/dev/null 2>&1`; then
1246                echo "Using the test built into your sh." > /dev/null
1247                test=test
1248                _test=test
1249        fi
1250        ;;
1251esac
1252case "$echo" in
1253echo)
1254        echo "Hopefully echo is built into your sh." > /dev/null
1255        ;;
1256'') ;;
1257*)
1258#       echo " "
1259#echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
1260        $echo $n "hi there$c" >foo1
1261        echo $n "hi there$c" >foo2
1262        if cmp foo1 foo2 >/dev/null 2>&1; then
1263                echo "They are compatible.  In fact, they may be identical." > /dev/null
1264        else
1265                case "$n" in
1266                '-n') n='' c='\c';;
1267                *) n='-n' c='';;
1268                esac
1269#We suppress the following message to avoid problems where the system points
1270#sh to dash (Ubuntu). If you have problems with echo, uncomment the cat and
1271#two $echo s to see if you're warned!!
1272#               cat <<FOO
1273#They are not compatible!  You are probably running ksh on a non-USG system.
1274#I'll have to use $echo instead of the builtin, since Bourne shell doesn't
1275#have echo built in and we may have to run some Bourne shell scripts.  That
1276#means I'll have to use '$n$c' to suppress newlines now.
1277#
1278#FOO
1279#               $echo $n "The star should be here-->$c"
1280#               $echo "*"
1281        fi
1282        $rm -f foo1 foo2
1283        ;;
1284esac
1285
1286: determine whether symbolic links are supported
1287#echo " "
1288$touch blurfl
1289if $ln -s blurfl sym > /dev/null 2>&1 ; then
1290#       echo "Symbolic links are supported." >&4
1291        lns="$ln -s"
1292else
1293#       echo "Symbolic links are NOT supported." >&4
1294        lns="$ln"
1295fi
1296$rm -f blurfl sym
1297
1298: see whether [:lower:] and [:upper:] are supported character classes
1299#echo " "
1300up='[A-Z]'
1301low='[a-z]'
1302case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1303ABYZ)
1304#       echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
1305        up='[:upper:]'
1306        low='[:lower:]'
1307        ;;
1308*)
1309#       echo "Your tr only supports [a-z] and [A-Z] to convert case." >&4
1310        ;;
1311esac
1312: set up the translation script tr, must be called with ./tr of course
1313cat >tr <<EOSC
1314$startsh
1315case "\$1\$2" in
1316'[A-Z][a-z]') exec $tr '$up' '$low';;
1317'[a-z][A-Z]') exec $tr '$low' '$up';;
1318esac
1319exec $tr "\$@"
1320EOSC
1321chmod +x tr
1322$eunicefix tr
1323
1324: Try to determine whether config.sh was made on this system
1325case "$config_sh" in
1326'')
1327myuname=`( ($uname -a) 2>/dev/null || hostname) 2>&1`
1328
1329mygcc=`( ($g++ -v) 2>/dev/null) 2>&1`
1330myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
1331        ./tr '[A-Z]' '[a-z]' | tr '\012' ' '`
1332newmyuname="$myuname"
1333dflt=n
1334case "$knowitall" in
1335'')
1336        if test -f ../config.sh; then
1337                if $contains myuname= ../config.sh >/dev/null 2>&1; then
1338                        eval "`grep myuname= ../config.sh`"
1339                fi
1340                if test "X$myuname" = "X$newmyuname"; then
1341                        dflt=y
1342                fi
1343        fi
1344        ;;
1345*) dflt=y;;
1346esac
1347
1348: Get old answers from old config file if Configure was run on the
1349: same system, otherwise use the hints.
1350hint=default
1351cd ../..
1352
1353        if $test -d $src/hints ; then
1354        (cd $src/hints; ls -C *.sh 2> /dev/null) | $sed 's/\.sh/   /g' >&4
1355        fi
1356        dflt=''
1357        : Half the following guesses are probably wrong... If you have better
1358        : tests or hints, please send them to Serguei.Sadilov@cern.ch
1359        : The metaconfig authors would also appreciate a copy...
1360        $test -f /irix && osname=irix
1361        $test -f /xenix && osname=sco_xenix
1362        $test -f /dynix && osname=dynix
1363        $test -f /dnix && osname=dnix
1364        $test -f /lynx.os && osname=lynxos
1365        $test -f /unicos && osname=unicos && osvers=`$uname -r`
1366        $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
1367        $test -f /bin/mips && /bin/mips && osname=mips
1368        $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
1369                $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
1370        $test -d /usr/apollo/bin && osname=apollo
1371        $test -f /etc/saf/_sactab && osname=svr4
1372        $test -d /usr/include/minix && osname=minix
1373        if $test -d /MachTen; then
1374                osname=machten
1375                if $test -x /sbin/version; then
1376                        osvers=`/sbin/version | $awk '{print $2}' |
1377                        $sed -e 's/[A-Za-z]$//'`
1378                elif $test -x /usr/etc/version; then
1379                        osvers=`/usr/etc/version | $awk '{print $2}' |
1380                        $sed -e 's/[A-Za-z]$//'`
1381                else
1382                        osvers="$2.$3"
1383                fi
1384        fi
1385        if $test -f $uname; then
1386                set X $myuname
1387                shift
1388
1389                case "$5" in
1390                fps*) osname=fps ;;
1391                mips*)
1392                        case "$4" in
1393                        umips) osname=umips ;;
1394                        *) osname=mips ;;
1395                        esac;;
1396                [23]100) osname=mips ;;
1397                next*) osname=next ;;
1398                news*) osname=news ;;
1399                i386*)
1400                        if $test -f /etc/kconfig; then
1401                                osname=isc
1402                                if test "$lns" = "ln -s"; then
1403                                        osvers=4
1404                                elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
1405                                        osvers=3
1406                                elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
1407                                        osvers=2
1408                                fi
1409                        fi
1410                        ;;
1411                esac
1412
1413                case "$1" in
1414                aix) osname=aix
1415                        tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
1416                        case "$tmp" in
1417                        'not found') osvers="$4"."$3" ;;
1418                        '<3240'|'<>3240') osvers=3.2.0 ;;
1419                        '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
1420                        '=3250'|'>3250') osvers=3.2.5 ;;
1421                        *) osvers=$tmp;;
1422                        esac
1423                        ;;
1424                *dc.osx) osname=dcosx
1425                        osvers="$3"
1426                        ;;
1427                dnix) osname=dnix
1428                        osvers="$3"
1429                        ;;
1430                cygwin*) osname=win32
1431                        ;;
1432                darwin*) osname=darwin
1433                        ;;
1434                domainos) osname=apollo
1435                        osvers="$3"
1436                        ;;
1437                dgux) osname=dgux
1438                        osvers="$3"
1439                        ;;
1440                dynixptx*) osname=dynixptx
1441                        osvers="$3"
1442                        ;;
1443                freebsd) osname=freebsd
1444                        osvers="$3" ;;
1445                genix) osname=genix ;;
1446                hp*) osname=hpux
1447                        case "$3" in
1448                        *.08.*) osvers=9 ;;
1449                        *.09.*) osvers=9 ;;
1450                        *.10.*) osvers=10 ;;
1451                        *)      osvers="$3" ;;
1452                        esac
1453                        ;;
1454                irix*) osname=irix
1455                        case "$3" in
1456                        4*) osvers=4 ;;
1457                        5*) osvers=5 ;;
1458                        *)      osvers="$3" ;;
1459                        esac
1460                        ;;
1461                linux) osname=linux
1462                        case "$3" in
1463                        1*) osvers=1 ;;
1464                        *)      osvers="$3" ;;
1465                        esac
1466                        ;;
1467                netbsd*) osname=netbsd
1468                        osvers="$3"
1469                        ;;
1470                bsd386) osname=bsd386
1471                        osvers=`$uname -r`
1472                        ;;
1473                next*) osname=next ;;
1474                solaris) osname=solaris
1475                        case "$3" in
1476                        5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
1477                        *)      osvers="$3" ;;
1478                        esac
1479                        ;;
1480                sunos) osname=sunos
1481                        case "$3" in
1482                        5*) osname=solaris
1483                                osvers=`echo $3 | $sed 's/^5/2/g'` ;;
1484                        *)      osvers="$3" ;;
1485                        esac
1486                        ;;
1487                titanos) osname=titanos
1488                        case "$3" in
1489                        1*) osvers=1 ;;
1490                        2*) osvers=2 ;;
1491                        3*) osvers=3 ;;
1492                        4*) osvers=4 ;;
1493                        *)      osvers="$3" ;;
1494                        esac
1495                        ;;
1496                ultrix) osname=ultrix
1497                        osvers="$3"
1498                        ;;
1499                osf1|mls+)      case "$5" in
1500                                alpha)
1501                                        osname=dec_osf
1502                                        osvers=`echo "$3" | sed 's/^[vt]//'`
1503                                        ;;
1504                        hp*)    osname=hp_osf1  ;;
1505                        mips)   osname=mips_osf1 ;;
1506                        esac
1507                        ;;
1508                uts) osname=uts
1509                        osvers="$3"
1510                        ;;
1511                qnx) osname=qnx
1512                        osvers="$4"
1513                        ;;
1514                $2) case "$osname" in
1515                        *isc*) ;;
1516                        *freebsd*) ;;
1517                        svr*)
1518                                : svr4.x or possibly later
1519                                case "svr$3" in
1520                                ${osname}*)
1521                                        osname=svr$3
1522                                        osvers=$4
1523                                        ;;
1524                                esac
1525                                case "$osname" in
1526                                svr4.0)
1527                                        : Check for ESIX
1528                                        if test -f /stand/boot ; then
1529                                                eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
1530                                                if test -n "$INITPROG" -a -f "$INITPROG"; then
1531                        isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
1532                                                        if test -n "$isesix"; then
1533                                                                osname=esix4
1534                                                        fi
1535                                                fi
1536                                        fi
1537                                        ;;
1538                                esac
1539                                ;;
1540                        *)      if test -f /etc/systemid; then
1541                                        osname=sco
1542                                        set `echo $3 | $sed 's/\./ /g'` $4
1543                                        if $test -f sco_$1_$2_$3.sh; then
1544                                                osvers=$1.$2.$3
1545                                        elif $test -f sco_$1_$2.sh; then
1546                                                osvers=$1.$2
1547                                        elif $test -f sco_$1.sh; then
1548                                                osvers=$1
1549                                        fi
1550                                else
1551                                        case "$osname" in
1552                                        '') : Still unknown.  Probably a generic Sys V.
1553                                                osname="sysv"
1554                                                osvers="$3"
1555                                                ;;
1556                                        esac
1557                                fi
1558                                ;;
1559                        esac
1560                        ;;
1561                *)      case "$osname" in
1562                        '') : Still unknown.  Probably a generic BSD.
1563                                osname="$1"
1564                                osvers="$3"
1565                                ;;
1566                        esac
1567                        ;;
1568                esac
1569        else
1570                if test -f /vmunix -a -f $src/hints/news_os.sh; then
1571                        (what /vmunix | .config/UU/tr '[A-Z]' '[a-z]') > .config/UU/kernel.what 2>&1
1572                        if $contains news-os .config/UU/kernel.what >/dev/null 2>&1; then
1573                                osname=news_os
1574                        fi
1575                        $rm -f .config/UU/kernel.what
1576                elif test -d c:/.; then
1577                        set X $myuname
1578                        osname=os2
1579                        osvers="$5"
1580                fi
1581        fi
1582        : Now look for a hint file osname_osvers, unless one has been
1583        : specified already.
1584        case "$hintfile" in
1585        ''|' ')
1586                file=`echo "${osname}_${osvers}" | $sed -e 's@\.@_@g' -e 's@_$@@'`
1587                : Also try without trailing minor version numbers.
1588                xfile=`echo $file | $sed -e 's@_[^_]*$@@'`
1589                xxfile=`echo $xfile | $sed -e 's@_[^_]*$@@'`
1590                xxxfile=`echo $xxfile | $sed -e 's@_[^_]*$@@'`
1591                xxxxfile=`echo $xxxfile | $sed -e 's@_[^_]*$@@'`
1592                case "$file" in
1593                '') dflt=none ;;
1594                *)  case "$osvers" in
1595                        '') dflt=$file
1596                                ;;
1597                        *)  if $test -f $src/hints/$file.sh ; then
1598                                        dflt=$file
1599                                elif $test -f $src/hints/$xfile.sh ; then
1600                                        dflt=$xfile
1601                                elif $test -f $src/hints/$xxfile.sh ; then
1602                                        dflt=$xxfile
1603                                elif $test -f $src/hints/$xxxfile.sh ; then
1604                                        dflt=$xxxfile
1605                                elif $test -f $src/hints/$xxxxfile.sh ; then
1606                                        dflt=$xxxxfile
1607                                elif $test -f "$src/hints/${osname}.sh" ; then
1608                                        dflt="${osname}"
1609                                else
1610                                        dflt=none
1611                                fi
1612                                ;;
1613                        esac
1614                        ;;
1615                esac
1616                ;;
1617        *)
1618                dflt=`echo $hintfile | $sed 's/\.sh$//'`
1619                ;;
1620        esac
1621
1622if [ X$install = Xnever ] ; then
1623        $cat <<EOM
1624
1625You may give one or more space-separated answers, or "none" if appropriate.
1626If your OS version has no hints, DO NOT give a wrong version -- say "none".
1627
1628EOM
1629        rp="Which of these apply, if any?"
1630        . .config/UU/myread
1631        tans=$ans
1632        for file in $tans; do
1633                if $test -f $src/hints/$file.sh; then
1634                        . $src/hints/$file.sh
1635                        $cat $src/hints/$file.sh >> .config/UU/config.sh
1636                elif $test X$tans = X -o X$tans = Xnone ; then
1637                        : nothing
1638                else
1639                        : Give one chance to correct a possible typo.
1640                        echo "$file.sh does not exist"
1641                        dflt=$file
1642                        rp="hint to use instead?"
1643                        . .config/UU/myread
1644                        for file in $ans; do
1645                                if $test -f "$src/hints/$file.sh"; then
1646                                        . $src/hints/$file.sh
1647                                        $cat $src/hints/$file.sh >> .config/UU/config.sh
1648                                elif $test X$ans = X -o X$ans = Xnone ; then
1649                                        : nothing
1650                                else
1651                                        echo "$file.sh does not exist -- ignored."
1652                                fi
1653                        done
1654                fi
1655        done
1656fi
1657
1658        hint=recommended
1659        : Remember our hint file for later.
1660        if $test -f "$src/hints/$file.sh" ; then
1661                hintfile="$file"
1662        else
1663                hintfile=''
1664        fi
1665        : Sadilov: g4system.U - inserted here.
1666        : 'current' directory is where 'Configure' is started
1667#echo " "
1668case "$g4osname" in
1669
1670'')
1671        case "$osname" in
1672                'aix')          g4osname=AIX
1673                                ;;
1674                'dec_osf')      g4osname=DEC
1675                                ;;
1676                'hpux')         g4osname=HP
1677                                ;;
1678                'linux')        g4osname=Linux
1679                                ;;
1680                'irix')         g4osname=SGI
1681                                ;;
1682                'sunos')        g4osname=SUN
1683                                ;;
1684                'solaris')      g4osname=SUN
1685                                ;;
1686                'win32')        g4osname=WIN32
1687                                ;;
1688                'darwin')       g4osname=Darwin
1689                                ;;
1690        esac
1691esac
1692
1693#echo " "
1694
1695case  "$g4compiler" in
1696
1697'')     
1698        case "$g4osname" in
1699                'AIX')
1700                                g4compiler=xlC
1701                                ;;
1702                'DEC')
1703                                g4compiler=cxx
1704                                ;;
1705                'HP')
1706                                g4compiler=aCC
1707                                ;;
1708                'Linux')
1709#                               g4compiler=g++
1710# Assume if "gcc" is in place then "g++" is here
1711        gcccompiler=`( ($gcc -v) 1>/dev/null || echo "ERROR: There is no 'gcc' ('g++'?) compiler.") 2>&1`
1712                                case $gcccompiler in
1713                                *egcs*) g4compiler=egcs
1714                                ;;
1715                                *2.96*)
1716                                echo "WARNING: Found version of 'g++' (2.96.XXX) is known to be buggy!"
1717                                g4compiler="g++"
1718                                ;;
1719                                *) g4compiler="g++"
1720                                ;;
1721                                esac                           
1722
1723                                ;;
1724                'SGI')
1725                                g4compiler=CC
1726                                ;;
1727                'SUN')
1728                                g4compiler=CC
1729                                ;;
1730                'WIN32')
1731                                g4compiler=VC
1732        clcompiler=`( cl 1>/dev/null || echo "ERROR: There is no 'cl' compiler.") 2>&1`
1733                                case $clcompiler in
1734                                *"Version 12"*) g4compiler=VC6
1735                                ;;
1736                                *"Version 13"*) g4compiler=VC
1737                                ;;
1738                                *) g4compiler=VC
1739                                ;;
1740                                esac                           
1741                                ;;
1742                'Darwin')
1743                                g4compiler=g++
1744                                ;;
1745        esac
1746esac
1747
1748if [ X$g4system = X ] ; then
1749
1750if [ X$g4build = Xyes ] ; then
1751while test 1 = 1  ; do
1752
1753g4message=`cat << EOM
1754
1755Definition of G4SYSTEM variable is $g4osname-$g4compiler.
1756That stands for:
1757
17581) OS           : $g4osname
1759
17602) Compiler     : $g4compiler
1761
1762To modify default settings, select number above (e.g. 2)
1763EOM`
1764
1765dflt="Press [Enter] for default settings"
1766rp=$g4message
1767. .config/UU/myread
1768gans=$ans
1769
1770        case $gans in
1771
1772        1)
1773                case "$osname" in
1774                        'aix')
1775                                        g4osnamerec=AIX
1776                                        ;;
1777                        'dec_osf')
1778                                        g4osnamerec=DEC
1779                                        ;;
1780                        'hpux')
1781                                        g4osnamerec=HP
1782                                        ;;
1783                        'linux')
1784                                        g4osnamerec=Linux
1785                                        ;;
1786                        'irix')
1787                                        g4osnamerec=SGI
1788                                        ;;
1789                        'sunos')
1790                                        g4osnamerec=SUN
1791                                        ;;
1792                        'win32')
1793                                        g4osnamerec=WIN32
1794                                        ;;
1795                        'darwin')
1796                                        g4osnamerec=Darwin
1797                                        ;;
1798                esac
1799                dflt=$g4osname
1800                rp="What is your OS'?"
1801                . .config/UU/myread
1802                tans=$ans
1803
1804                if test X$tans != X$g4osnamerec ; then
1805                echo ""
1806
1807cat << EOM
1808
1809                You are running 'Configure' on NOT native platform!
1810                You are on your own way !!!
1811
1812EOM
1813
1814                dflt=$tans
1815                rp="Confirm your selection or set native '$g4osnamerec'!"
1816                . .config/UU/myread
1817                tans=$ans
1818                fi
1819
1820                g4osname=$tans
1821                ;;
1822        2)
1823                case "$g4osname" in
1824                        'AIX')
1825                                        g4compilerrec=xlC
1826                                        ;;
1827                        'DEC')
1828                                        g4compilerrec=cxx
1829                                        ;;
1830                        'HP')
1831                                        g4compilerrec=aCC
1832                                        ;;
1833                        'Linux')
1834                                        g4compilerrec=g++
1835                                        ;;
1836                        'SGI')
1837                                        g4compilerrec=CC
1838                                        ;;
1839                        'SUN')
1840                                        g4compilerrec=CC
1841                                        ;;
1842                        'WIN32')
1843                                        g4compilerrec=VC
1844                                        ;;
1845                        'Darwin')
1846                                        g4compilerrec=g++
1847                                        ;;
1848                esac
1849                dflt=$g4compiler
1850                rp="Which C++ compiler?"
1851                . .config/UU/myread
1852                tans=$ans
1853
1854                if test X$tans != X$g4compilerrec ; then
1855                echo ""
1856
1857cat << EOM
1858
1859                The recommmended compiler for this platform ($g4osname) is $g4compilerrec.
1860                You are on your own way !!!
1861
1862EOM
1863
1864                dflt=$tans
1865                rp="Confirm your selection or set recommended '$g4compilerrec'!"
1866                . .config/UU/myread
1867                tans=$ans
1868                fi
1869
1870                g4compiler=$tans
1871                ;;
1872#       [eE])
1873#               break
1874#               ;;
1875        *)
1876#               echo " "
1877                break
1878                ;;
1879        esac
1880done
1881
1882fi
1883
1884#
1885# Ask about compiler used.
1886#
1887g4system=$g4osname-$g4compiler
1888
1889fi
1890
1891#cat << EOM
1892#
1893#G4SYSTEM is now set to $g4system.
1894#
1895#EOM
1896
1897cd .config/UU
1898
1899myuname=`( ($uname -a) 2>/dev/null || hostname) 2>&1`
1900myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
1901        ./tr '[A-Z]' '[a-z]' | tr '\012' ' '`
1902newmyuname="$myuname"
1903dflt=n
1904
1905cd ../..
1906
1907
1908if [ X$g4build = X ] ; then
1909
1910        if test -f $src/.config/bin/$g4system/env.sh; then
1911
1912        # create not_display flag
1913
1914if [ X$g4ldlibs != X -o X$g4ldflags != X -o X$g4cxxflags != X -o X$g4cppflags != X -o X$g4incflags != X ] ; then
1915        g4non_display=yes
1916#       echo g4non_display=$g4non_display
1917fi
1918
1919        if [ X$install = Xyes ] ; then
1920
1921        $rm -rf .config/UU
1922       
1923        . $src/.config/bin/$g4system/move.sh
1924
1925        exit 1
1926
1927        fi #end of cppflags
1928
1929        if [ X$g4cppflags = Xyes ] ; then
1930
1931        . $src/.config/bin/$g4system/env.sh
1932
1933        CPPFLAGS=`grep 'CPPFLAGS_FINAL :=' $G4LIB/$G4SYSTEM/GNUmakefile.db | $sed  -e 's/^\(.*\):=//'`
1934
1935#       echo CPPFLAGS=$CPPFLAGS
1936        echo $CPPFLAGS
1937       
1938        $rm -rf .config/UU
1939        exit 1
1940
1941        fi #end of cppflags
1942
1943        if [ X$g4cxxflags = Xyes ] ; then
1944
1945        . $src/.config/bin/$g4system/env.sh
1946
1947        CXXFLAGS=`grep 'CXXFLAGS_FINAL :=' $G4LIB/$G4SYSTEM/GNUmakefile.db | $sed  -e 's/^\(.*\):=//'`
1948
1949#       echo CXXFLAGS=$CXXFLAGS
1950        echo $CXXFLAGS
1951       
1952        $rm -rf .config/UU
1953        exit 1
1954
1955        fi #end of cxxflags
1956
1957
1958
1959        g4install_lib_AAA=`echo $g4install/lib|sed -e "s/\//AAA/g"`
1960        g4final_install_lib_AAA=`echo $g4final_install/lib/geant4|sed -e "s/\//AAA/g"`
1961       
1962
1963#############################################################################
1964        if [ X$g4incflags = Xyes ] ; then
1965
1966        . $src/.config/bin/$g4system/env.sh
1967
1968### Getting G4FIRST_INSTALL
1969        G4FIRST_INSTALL_AAA=`grep 'G4INSTALL =' $G4LIB/$G4SYSTEM/GNUmakefile.db | $sed  -e 's/^\(.*\)= //'|$sed -e 's/\//AAA/g'`
1970        G4INSTALL_AAA=`echo $G4INSTALL|sed -e "s/\//AAA/g"`
1971###
1972        INCFLAGS_AAA=`grep 'INCFLAGS_FINAL :=' $G4LIB/$G4SYSTEM/GNUmakefile.db | $sed  -e 's/^\(.*\):=//'|$sed -e 's/\//AAA/g'`
1973
1974#       echo INCFLAGS_AAA=$INCFLAGS_AAA
1975#       echo G4INSTALL_AAA=$G4INSTALL_AAA
1976#       echo G4FIRST_INSTALL_AAA=$G4FIRST_INSTALL_AAA
1977
1978        INCFLAGS_AAA_NEW=`echo $INCFLAGS_AAA| $sed -e "s/$G4FIRST_INSTALL_AAA/$G4INSTALL_AAA/g"`
1979
1980#       echo INCFLAGS_AAA_NEW=$INCFLAGS_AAA_NEW
1981
1982        INCFLAGS=`echo $INCFLAGS_AAA_NEW| $sed -e "s/AAA/\//g"`
1983
1984#       echo INCFLAGS=$INCFLAGS
1985
1986        if [ X$G4INCLUDE = X ] ; then
1987        echo $INCFLAGS
1988        else
1989        echo -I$G4INCLUDE
1990        fi
1991       
1992        $rm -rf .config/UU
1993        exit 1
1994
1995        fi #end of incflags
1996#############################################################################
1997
1998
1999#############################################################################
2000        if [ X$g4ldflags = Xyes ] ; then
2001
2002        . $src/.config/bin/$g4system/env.sh
2003
2004### Getting G4FIRST_INSTALL
2005        G4FIRST_LIB_AAA=`grep 'G4LIB =' $G4LIB/$G4SYSTEM/GNUmakefile.db | $sed  -e 's/^\(.*\)= //'|$sed -e 's/\//AAA/g'`
2006        G4LIB_AAA=`echo $G4LIB|sed -e "s/\//AAA/g"`
2007###
2008#       G4FIRST_INSTALL_LIB_AAA=${G4FIRST_INSTALL_AAA}AAAlib
2009#       G4INSTALL_LIB_AAA=${G4INSTALL_AAA}AAAlibAAAgeant4
2010
2011#       echo G4FIRST_INSTALL_LIB_AAA=$G4FIRST_INSTALL_LIB_AAA
2012#       echo G4INSTALL_LIB_AAA=$G4INSTALL_LIB_AAA
2013       
2014        LDFLAGS_AAA=`grep 'LDFLAGS_FINAL :=' $G4LIB/$G4SYSTEM/GNUmakefile.db | $sed  -e 's/^\(.*\):=//'|$sed -e 's/\//AAA/g'`
2015        LDFLAGS_AAA_NEW=`echo $LDFLAGS_AAA| $sed -e "s/$G4FIRST_LIB_AAA/$G4LIB_AAA/g"`
2016        LDFLAGS=`echo $LDFLAGS_AAA_NEW| $sed -e "s/AAA/\//g"`
2017
2018#       echo LDFLAGS=$LDFLAGS
2019        echo $LDFLAGS
2020       
2021        $rm -rf .config/UU
2022        exit 1
2023
2024        fi #end of ldflags
2025#############################################################################
2026
2027        if [ X$g4ldlibs = Xyes ] ; then
2028
2029#       cat >&2 <<EOM
2030#---------------------------------------------------
2031#LibList mode :)
2032#---------------------------------------------------
2033#EOM
2034       
2035        . $src/.config/bin/$g4system/env.sh
2036
2037#       echo TEST
2038
2039#       ls -l $G4INSTALL/config/scripts/GNUmakefile
2040#       ls -l $G4LIB/$G4SYSTEM/GNUmakefile.db
2041
2042#       LDLIBS_1=`grep 'LDLIBS_FINAL :=' $G4LIB/$G4SYSTEM/GNUmakefile.db | awk -F := '{print $2}'`
2043#       LDLIBS_2=`echo $LDLIBS_1 | awk -F -lMarker '{print $2}'`
2044
2045#       echo LDLIBS_2=$LDLIBS_2
2046#       echo $LDLIBS_2
2047
2048        if [ X$G4LIB_USE_GRANULAR = X ] ; then
2049       
2050# Global libs
2051
2052###     LDLIBS_1=`grep 'LDLIBS_FINAL :=' $G4LIB/$G4SYSTEM/GNUmakefile.db | $sed  -e 's/^\(.*\):=//'`
2053###     LDLIBS_2=`echo $LDLIBS_1 | $sed  -e 's/^\(.*\)-lMarker//'`
2054###     echo "$LDLIBS_2 $c"
2055
2056        LIBLIST_LIST=`$G4LIB/$G4SYSTEM/liblist -m $G4LIB/$G4SYSTEM < $G4LIB/$G4SYSTEM/libname.map`
2057
2058        LDLIBS3=`grep 'LDLIBS3 :=' $G4LIB/$G4SYSTEM/GNUmakefile.db | $sed  -e 's/^\(.*\):=//'`
2059        LDLIBS4=`grep 'LDLIBS4 :=' $G4LIB/$G4SYSTEM/GNUmakefile.db | $sed  -e 's/^\(.*\):=//'`
2060
2061        LDLIBS=$LIBLIST_LIST $LDLIBS3 $LDLIBS4
2062
2063        echo $LDLIBS
2064
2065#       echo "-L$G4WORKDIR/lib/$G4SYSTEM -lG4persistency -lG4readout -lG4run -lG4event -lG4tracking -lG4parmodels -lG4processes -lG4digits+hits -lG4track -lG4particles -lG4geometry -lG4materials -lG4graphics_reps -lG4intercoms -lG4global $c"
2066
2067        $rm -rf .config/UU
2068        exit 1
2069
2070        else
2071
2072# Granular libs
2073
2074#       echo $n "-L$G4WORKDIR/lib/$G4SYSTEM $c" ; $G4WORKDIR/lib/$G4SYSTEM/liblist -m $G4WORKDIR/lib/$G4SYSTEM < $G4WORKDIR/lib/$G4SYSTEM/libname.map
2075
2076#       echo G4LIB=$G4LIB/$G4SYSTEM
2077
2078        LIBLIST_LIST=`$G4LIB/$G4SYSTEM/liblist -m $G4LIB/$G4SYSTEM < $G4LIB/$G4SYSTEM/libname.map`
2079
2080        LDLIBS3=`grep 'LDLIBS3 :=' $G4LIB/$G4SYSTEM/GNUmakefile.db | $sed  -e 's/^\(.*\):=//'`
2081        LDLIBS4=`grep 'LDLIBS4 :=' $G4LIB/$G4SYSTEM/GNUmakefile.db | $sed  -e 's/^\(.*\):=//'`
2082
2083        LDLIBS=$LIBLIST_LIST $LDLIBS3 $LDLIBS4 
2084
2085        echo $LDLIBS   
2086       
2087        $rm -rf .config/UU
2088
2089        exit 1
2090        fi #end of check for global/granular
2091
2092        else #if not -lib but user mode
2093
2094# header for User
2095echo " "
2096echo " "
2097echo " "
2098echo "                --- Geant4 Toolkit Installation  ---"
2099echo "                  (setting environments for USER )"
2100echo " "
2101echo " "
2102echo " "
2103
2104#cat << EOM
2105#
2106#G4SYSTEM is now set to $g4system.
2107#
2108#EOM
2109
2110        cat >&2 <<EOM
2111---------------------------------------------------
2112The Geant4 toolkit installation was found.
2113The files env.[c]sh will be copied to your current directory.
2114For setting Geant4 environments you should make:
2115
2116source env.csh
2117
2118or
2119
2120. env.sh
2121
2122It will also check G4WORKDIR setting and set it to
2123your HOME if needed.
2124You can use these files also for further modifications
2125(adding your own environments).
2126---------------------------------------------------
2127EOM
2128        $rm -rf .config/UU
2129
2130cp -i $src/.config/bin/$g4system/env.csh .
2131cp -i $src/.config/bin/$g4system/env.sh  .
2132
2133        exit 1
2134        fi #end of -lib or user
2135else #there is no env.sh
2136
2137# header for Installer
2138echo " "
2139echo " "
2140echo " "
2141echo "                --- Geant4 Toolkit Installation  ---"
2142echo " "
2143echo " "
2144echo " "
2145echo " "
2146
2147        echo " "
2148        echo "WARNING: Geant4 is NOT built yet!"
2149        echo "You (or the administrator if you have not enough privileges)"
2150        echo "should start with \$G4INSTALL/Configure -build."
2151        echo "(where \$G4INSTALL is Geant4 install directory)."
2152        echo " "
2153        $rm -rf .config/UU
2154        exit 1
2155 fi #end of check for existence of env.sh
2156fi #end of check for "not -install"
2157
2158cd .config/UU
2159
2160case "$knowitall" in
2161'')
2162        cd ../..
2163        if test -f $src/.config/bin/$g4system/config.sh; then
2164                if $contains myuname= $src/.config/bin/$g4system/config.sh >/dev/null 2>&1; then
2165                        eval "`grep myuname= $src/.config/bin/$g4system/config.sh`"
2166                fi
2167                if test "X$myuname" = "X$newmyuname"; then
2168                        dflt=y
2169                fi
2170        fi
2171        cd .config/UU
2172        ;;
2173*) dflt=y;;
2174esac
2175
2176cd ../..
2177
2178if test -f $src/.config/bin/$g4system/config.sh; then
2179        echo " "
2180        rp="There exists a config.sh file. Shall I use it to set the defaults?"
2181        . .config/UU/myread
2182        case "$ans" in
2183        n*|N*) echo "OK, I'll ignore it."; mv $src/.config/bin/$g4system/config.sh $src/.config/bin/$g4system/config.sh.old;;
2184        *)  echo "Fetching default answers from your old config.sh file..." >&4
2185                tmp_n="$n"
2186                tmp_c="$c"
2187                tmp_sh="$sh"
2188                . $src/.config/bin/$g4system/config.sh
2189                cp $src/.config/bin/$g4system/config.sh .config/UU
2190                n="$tmp_n"
2191                c="$tmp_c"
2192                : Older versions did not always set $sh.  Catch re-use of such
2193                : an old config.sh.
2194                case "$sh" in
2195                '') sh="$tmp_sh" ;;
2196                esac
2197                hint=previous
2198                ;;
2199        esac
2200fi
2201
2202cd .config/UU
2203;;
2204*)
2205        echo " "
2206        echo "Fetching default answers from $config_sh..." >&4
2207        tmp_n="$n"
2208        tmp_c="$c"
2209        cd ../..
2210        cp $config_sh config.sh 2>/dev/null
2211        chmod +w config.sh
2212        . ./config.sh
2213        cd .config/UU
2214        cp ../config.sh .
2215        n="$tmp_n"
2216        c="$tmp_c"
2217        hint=previous
2218        ;;
2219esac
2220test "$override" && . ./optdef.sh
2221myuname="$newmyuname"
2222
2223: Restore computed paths
2224for file in $loclist $trylist; do
2225        eval $file="\$_$file"
2226done
2227
2228
2229: who configured the system
2230cf_time=`$date 2>&1`
2231cf_by=`(logname) 2>/dev/null`
2232case "$cf_by" in
2233"")
2234        cf_by=`(whoami) 2>/dev/null`
2235        case "$cf_by" in
2236        "") cf_by=unknown ;;
2237        esac ;;
2238esac
2239
2240cat <<EOSC >qt
2241$startsh
2242#
2243# Autoconf(ish) style check for Qt headers, libraries and moc application
2244#
2245
2246#
2247# These are variables that the final unit generated script may use
2248#
2249with_qt_dir="\$qt_search_dir"
2250
2251#
2252# Only run if we haven't succesfully found Qt already
2253#
2254if test "x\$g4_qt_is_configured" = "x" ; then
2255    #
2256    # Flag specifying if we've configured Qt o.k.
2257    #
2258    g4_qt_is_configured="yes" # Optimism
2259
2260    # Flag to be set if any part of configuration fails
2261    g4_havegoodqt="yes" # Optimism
2262
2263    # Qt4 flag
2264    g4_is_qt4="no"
2265
2266    # Variables to be set
2267    g4_qt_include_dir=''
2268    g4_qt_lib_dir=''
2269    g4_qt_moc=''
2270
2271    g4_qt_version=''
2272    g4_qt_cxxflags=''
2273    g4_qt_gl_cxxflags=''
2274    g4_qt_libs=''
2275    g4_qt_gl_libs=''
2276
2277    #
2278    # User may supply a value for 'QTDIR' and in that case we ASSUME a
2279    # Trolltech style installation or a Mac Framework
2280    #
2281    if test "x\$with_qt_dir" != "x" ; then
2282        g4_qt_dir="\$with_qt_dir"
2283        g4_qt_possible_qt_include_dirs="\$with_qt_dir/include/QtCore
2284                                        \$with_qt_dir/include/Qt
2285                                        \`ls -dr \$with_qt_dir/include/qt*/QtCore 2>/dev/null\`
2286                                        \`ls -dr \$with_qt_dir/include/qt*/Qt 2>/dev/null\`
2287                                        \`ls -dr \$with_qt_dir/include/qt* 2>/dev/null\`
2288                                        \$with_qt_dir/include
2289                                        \$with_qt_dir/QtCore.framework/Headers"
2290
2291        # Check for qglobal.h
2292        g4_qglobal_loc=\`./loc qglobal.h no \$g4_qt_possible_qt_include_dirs\`
2293
2294        if test "x\$g4_qglobal_loc" = "xno" ; then
2295            g4_havegoodqt=no
2296            g4_qt_include_dir=no
2297        fi
2298        echo "checking for qglobal.h... \$g4_qglobal_loc"
2299
2300        if test "x\$g4_qglobal_loc" != "xno" ; then
2301            g4_qt_include_dir="\`dirname \$g4_qglobal_loc\`"
2302        fi
2303
2304    else
2305        # We use standard search paths...
2306        qt_direct_test_header="qglobal.h"
2307
2308        g4_qt_include_path_list="
2309            \`ls -dr /Library/Frameworks/QtCore.framework/Headers 2>/dev/null\`
2310            \`ls -dr /System/Library/Frameworks/QtCore.framework/Headers 2>/dev/null\`
2311            /usr/include/QtCore
2312            \`ls -dr /usr/include/qt*/QtCore 2>/dev/null\`
2313            \`ls -dr /usr/local/include/QtCore 2>/dev/null\`
2314            \`ls -dr /usr/local/include/qt*/QtCore 2>/dev/null\`
2315            \`ls -dr /usr/local/qt*/include/QtCore 2>/dev/null\`
2316            \`ls -dr /opt/qt*/include/QtCore 2>/dev/null\`
2317            \`ls -dr /usr/qt*/include/QtCore 2>/dev/null\`
2318            \`ls -dr /usr/qt/*/include/QtCore 2>/dev/null\`
2319            \`ls -dr /usr/include/qt/*/QtCore 2>/dev/null\`
2320            \`ls -dr /sw/include/QtCore 2>/dev/null\`
2321            \`ls -dr /sw/qt*/include/QtCore 2>/dev/null\`
2322            \`ls -dr /sw/qt/*/include/QtCore 2>/dev/null\`
2323            /usr/include
2324            \`ls -dr /usr/include/qt* 2>/dev/null\`
2325            \`ls -dr /usr/local/include 2>/dev/null\`
2326            \`ls -dr /usr/local/include/qt* 2>/dev/null\`
2327            \`ls -dr /usr/local/qt*/include 2>/dev/null\`
2328            \`ls -dr /opt/qt*/include 2>/dev/null\`
2329            \`ls -dr /usr/qt*/include 2>/dev/null\`
2330            \`ls -dr /usr/qt/*/include 2>/dev/null\`
2331            \`ls -dr /usr/include/qt/* 2>/dev/null\`
2332            \`ls -dr /sw/include 2>/dev/null\`
2333            \`ls -dr /sw/qt*/include 2>/dev/null\`
2334            \`ls -dr /sw/qt/*/include 2>/dev/null\`
2335            /usr/include/Qt
2336            \`ls -dr /usr/include/qt*/Qt 2>/dev/null\`
2337            \`ls -dr /usr/local/include/Qt 2>/dev/null\`
2338            \`ls -dr /usr/local/include/qt*/Qt 2>/dev/null\`
2339            \`ls -dr /opt/qt*/include/Qt 2>/dev/null\`
2340            \`ls -dr /usr/qt*/include/Qt 2>/dev/null\`
2341            \`ls -dr /usr/qt/*/include/Qt 2>/dev/null\`
2342            \`ls -dr /usr/include/qt/*/Qt 2>/dev/null\`
2343            \`ls -dr /sw/include/Qt 2>/dev/null\`
2344            \`ls -dr /sw/qt*/include/Qt 2>/dev/null\`
2345            \`ls -dr /sw/qt/*/include/Qt 2>/dev/null\`
2346        "
2347
2348        # Find ALL installed versions of qglobal.h
2349        for g4_qt_dir in \$g4_qt_include_path_list ; do
2350            if test -r "\$g4_qt_dir/\$qt_direct_test_header" ; then
2351                g4_qt_found_dirs="\$g4_qt_found_dirs \$g4_qt_dir"
2352            fi
2353        done
2354
2355        # Which one relates to the newest Qt?
2356        g4_qt_prev_ver=0
2357        for g4_qt_dir in \$g4_qt_found_dirs ; do
2358            g4_qt_this_ver=\`grep -w '#define QT_VERSION' \$g4_qt_dir/\$qt_direct_test_header | sed s/'#define QT_VERSION'//\`
2359
2360            if expr \$g4_qt_this_ver '>' \$g4_qt_prev_ver > /dev/null ; then
2361                g4_qt_include_dir=\$g4_qt_dir
2362                g4_qt_prev_ver=\$g4_qt_this_ver
2363            fi
2364        done
2365
2366        if test "x\$g4_qt_include_dir" = "x" ; then
2367            g4_qt_include_dir=no
2368            g4_havegoodqt=no
2369        fi
2370
2371        echo "checking for qglobal.h... \$g4_qt_include_dir/qglobal.h"
2372    fi # END TEST with_qt_dir is set
2373
2374    #
2375    # Result of above tests should have given us g4_qt_include_dir
2376    # We can now use this to check other things, taking care to deal with the
2377    # correct paths...
2378    #
2379
2380    # Immediate and obvious Darwin check...
2381    if test "x\`basename \$g4_qt_include_dir\`" = "xHeaders" ; then
2382        #check for moc
2383        if test -x "/usr/bin/moc" ; then
2384            g4_qt_moc="/usr/bin/moc"
2385            echo "checking for moc... \$g4_qt_moc"
2386
2387            g4_qt_dir=\`dirname \$g4_qt_include_dir\`
2388            g4_qt_dir=\`dirname \$g4_qt_dir\`
2389
2390            g4_qt_version="4"
2391            g4_qt_cxxflags="-I\$g4_qt_dir/QtCore.framework/Headers -I\$g4_qt_dir/QtGui.framework/Headers"
2392            g4_qt_gl_cxxflags="-I\$g4_qt_dir/QtOpenGl.framework/Headers"
2393            g4_qt_libs="-F\$g4_qt_dir -framework QtCore -framework QtGui"
2394            g4_qt_gl_libs="-framework QtOpenGL"
2395        else
2396            echo "checking for moc... no"
2397            g4_havegoodqt=no
2398        fi
2399    else
2400        # Probably have Unix-style installation, in which case estimated
2401        # 'QTDIR' equivalent is $with_qt_dir if supplied, or directory
2402        # one level below the 'include' directory in \$g4_qt_include_dir
2403        if test "x\$with_qt_dir" = "x" ; then
2404            # We need to strip g4_qt_include_dir, if it was found
2405            g4_qt_dir=\$g4_qt_include_dir
2406
2407            # Only do this IF there's an 'include' in the path name!
2408            if test "x\`echo \$g4_qt_dir | grep include\`" != "x" ; then
2409                while test "x\`basename \$g4_qt_dir\`" != "xinclude" ;
2410                do
2411                    g4_qt_dir=\`dirname \$g4_qt_dir\`
2412                done
2413            fi
2414
2415            #Now should be one level above equivalent QTDIR
2416            g4_qt_dir=\`dirname \$g4_qt_dir\`
2417        fi
2418
2419        # At this point, we need get Qt version of detected qglobal.h because
2420        # Qt3/4 libraries MAY be installed alongside each other...
2421        qt_direct_test_header=qglobal.h
2422        g4_qt_major_ver=\`grep QT_VERSION_STR \$g4_qt_include_dir/\$qt_direct_test_header 2>/dev/null | sed 's/.* \"\([0-9]\)\..*\"/\1/'\`
2423
2424        #
2425        # We might have an odd install where our found qglobal.h #includes
2426        # the real qglobal...
2427        #
2428        if test "x\$g4_qt_major_ver" = "x" ; then
2429            # check for a #include of qglobal...
2430            possible_actual_qglobal=\`grep '#include.*qglobal' \$g4_qt_include_dir/\$qt_direct_test_header 2>/dev/null\`
2431
2432            if test "x\$possible_actual_qglobal" != "x" ; then
2433                #We did get something, and it's likely the include
2434                #will give us a relative path (but an ASSUMPTION at present)
2435                relative_path_to_qglobal=\`grep '#include.*qglobal' \$g4_qt_include_dir/\$qt_direct_test_header 2>/dev/null | sed 's/.*\"\(.*\)\"/\1/'\`
2436
2437                if test -r \$g4_qt_include_dir/\$relative_path_to_qglobal ; then
2438                    g4_qt_major_ver=\`grep QT_VERSION_STR \$g4_qt_include_dir/\$relative_path_to_qglobal 2>/dev/null | sed 's/.* \"\([0-9]\)\..*\"/\1/'\`
2439                else
2440                    g4_qt_major_ver=no
2441                    g4_havegoodqt=no
2442                fi
2443            else
2444                g4_qt_major_ver=no
2445                g4_havegoodqt=no
2446            fi
2447        fi #END TEST odd qglobal includes qglobal behaviour
2448           
2449        if test "x\$g4_qt_major_ver" = "x4" ; then
2450            g4_is_qt4=yes
2451        else
2452            g4_is_qt4=no
2453        fi
2454        echo "checking Qt major version... \$g4_qt_major_ver"
2455
2456        #
2457        # We also need to check for Qt4 installations with QtCore type
2458        # directory structures. That being the case, make sure we have
2459        # the extra headers..
2460        #
2461        if test "x\`basename \$g4_qt_include_dir\`" = "xQtCore" ; then
2462            g4_qt_extra_headers=""
2463            g4_qt_gl_headers=""
2464            g4_qt_extra_packages="QtGui"
2465            g4_qt_gl_packages="QtOpenGL"
2466
2467            for i in \$g4_qt_extra_packages ; do
2468                if test -d "\`dirname \$g4_qt_include_dir\`/\$i" ; then
2469                    echo "checking for \$i headers... yes"
2470                    g4_qt_extra_headers="\$g4_qt_extra_headers \`dirname \$g4_qt_include_dir\`/\$i"
2471                else
2472                    echo "checking for \$i headers... no"
2473                    g4_havegoodqt=no
2474                fi
2475            done
2476
2477            for i in \$g4_qt_gl_packages ; do
2478                if test -d "\`dirname \$g4_qt_include_dir\`/\$i" ; then
2479                    echo "checking for \$i headers... yes"
2480                    g4_qt_gl_headers="\$g4_qt_gl_headers \`dirname \$g4_qt_include_dir\`/\$i"
2481                else
2482                    echo "checking for \$i headers... no"
2483                    g4_havegoodqt=no
2484                fi
2485            done
2486
2487        fi #END TEST QtCore style install
2488
2489
2490        #
2491        # Now check for appropriate library...
2492        #
2493        if test -d "\$g4_qt_dir/lib64" ; then
2494            g4_qt_lib_dir=\$g4_qt_dir/lib64
2495        else
2496            g4_qt_lib_dir=\$g4_qt_dir/lib
2497        fi
2498
2499        if test "x\$g4_is_qt4" = "xyes" ; then
2500            g4_qt_lib="\`ls \$g4_qt_lib_dir/libQtCore* 2> /dev/null | sed -n 1p |
2501                    sed s@\$g4_qt_lib_dir/lib@@ | sed s@[.].*@@\`"
2502
2503            if test "x\$g4_qt_lib" = "x" ; then
2504                # We might be on Windows...
2505                g4_qt_lib="\`ls \$g4_qt_lib_dir/QtCore4.lib 2> /dev/null | sed -n 1p | sed s@\$g4_qt_lib_dir/@@\`"
2506            fi
2507
2508            if test "x\$g4_qt_lib" != "x" ; then
2509                echo "checking for QtCore library... \$g4_qt_lib"
2510            else
2511                echo "checking for QtCore library... no"
2512                g4_havegoodqt=no
2513            fi
2514        else
2515            g4_qt_lib="\`ls \$g4_qt_lib_dir/libqt-mt.* \$g4_qt_lib_dir/libqt.* 2> /dev/null | sed -n 1p | sed s@\$g4_qt_lib_dir/lib@@ | sed s@[.].*@@\`"
2516
2517            if test "x\$g4_qt_lib" != "x" ; then
2518                echo "checking for qt-mt or qt library... \$g4_qt_lib"
2519
2520                # On Darwin we also need libqui for Qt3
2521                if test "x\$osname" = "xdarwin" ; then
2522                    g4_qt_lib_qui="\`ls \$g4_qt_lib_dir/libqui.* 2> /dev/null |
2523                                    sed -n 1p | sed s@\$g4_qt_lib_dir/lib@@ |
2524                                    sed s@[.].*@@\`"
2525                    if test "x\$g4_qt_lib_qui" != "x" ; then
2526                        echo "checking for qui library... yes"
2527                    else
2528                        echo "checking for qui library... no"
2529                        g4_havegoodqt=no
2530                    fi
2531                fi
2532            else
2533                echo "checking for qt-mt or qt library... no"
2534                g4_havegoodqt=no
2535            fi
2536        fi #END TEST for Qt4/3 libraries
2537
2538        #
2539        # Finally, we need to search for moc
2540        # We use prior knowledge of the detected Qt version to
2541        # try and grab the correct moc straight off.
2542        #
2543        g4_qt_bin_dir=\$g4_qt_dir/bin
2544        g4_qtmoc=no
2545        g4_qt_cross_check_moc=no
2546
2547        if test "x\$g4_is_qt4" = "xyes" ; then
2548            # Try the qt4 variants first...
2549            if test -x "\$g4_qt_bin_dir/moc-qt4" ; then
2550                g4_qtmoc="\$g4_qt_bin_dir/moc-qt4"
2551            elif test -x "\$g4_qt_bin_dir/qt4-moc" ; then
2552                g4_qtmoc="\$g4_qt_bin_dir/qt4-moc"
2553            elif test -x "\$g4_qt_bin_dir/moc" ; then
2554                g4_qtmoc="\$g4_qt_bin_dir/moc"
2555                g4_qt_cross_check_moc=yes
2556            else
2557                g4_havegoodqt=no
2558            fi
2559        else
2560            # We've probably got Qt3, so check for
2561            # the qt3 variants first
2562            if test -x "\$g4_qt_bin_dir/moc-qt3" ; then
2563                g4_qtmoc="\$g4_qt_bin_dir/moc-qt3"
2564            elif test -x "\$g4_qt_bin_dir/qt3-moc" ; then
2565                g4_qtmoc="\$g4_qt_bin_dir/qt3-moc"
2566            elif test -x "\$g4_qt_bin_dir/moc" ; then
2567                g4_qtmoc="\$g4_qt_bin_dir/moc"
2568                g4_qt_cross_check_moc=yes
2569            else
2570                g4_havegoodqt=no
2571            fi
2572        fi
2573        echo "checking for moc... \$g4_qtmoc"
2574
2575        #
2576        # If pure 'moc' was found, cross check its version
2577        # against previously detected Qt major version
2578        #
2579        if test "x\$g4_qt_cross_check_moc" = "xyes" ; then
2580            $echo $n "Checking \$g4_qtmoc major version is \$g4_qt_major_ver... $c"
2581            # Grab version of found moc
2582            g4_qt_found_moc_major_version=\`\$g4_qtmoc -v 2>&1 | sed -s 's/^.*(Qt \([0-9]\)\..*/\1/'\`
2583            if test "x\$g4_qt_found_moc_major_version" != "x\$g4_qt_major_ver" ; then
2584                # We need to ask the user where correct moc is
2585                $echo "no"
2586                promptend="no"
2587                user_moc="\$g4_qtmoc"
2588
2589                while test "x\$promptend" = "xno" ; do
2590                    echo " "
2591                    g4message=\`cat << EOM
2592Qt moc was found as \$user_moc and has major version \$g4_qt_found_moc_major_version.
2593This does not match the version of the detected Qt install
2594which is \$g4_qt_major_ver.
2595Please enter the full path to the moc program which matches this Qt
2596version, or type '-' to CANCEL the Qt checks.
2597EOM\`
2598                    dflt="\$user_moc"
2599                    rp=\$g4message
2600                    . ./myread
2601
2602                    # Check for user cancellation
2603                    if test "x\$ans" = "x-" ; then
2604                        g4_havegoodqt="no"
2605                        g4_qtmoc=""
2606                        promptend="yes"
2607                    else
2608                        user_moc="\$ans"
2609                        if test -x "\$user_moc" ; then
2610                            g4_qt_found_moc_major_version=\`\$user_moc -v 2>&1 | sed -s 's/^.*(Qt \([0-9]\)\..*/\1/'\`
2611                            if test "x\$g4_qt_found_moc_major_version" != "x\$g4_qt_major_ver" ; then
2612                                echo "Checking if \$user_moc version is \$g4_qt_major_ver... no"
2613                            else
2614                                echo "Checking if \$user_moc version is \$g4_qt_major_ver... yes"
2615                                g4_qtmoc=\$user_moc
2616                                promptend=yes
2617                            fi
2618                        else
2619                            echo "warning: \$user_moc is not executable."
2620                            user_moc="<null>"
2621                            g4_qt_found_moc_major_version="<null>"
2622                        fi
2623                    fi
2624                # We need to ask the user where correct moc is
2625                done
2626            else
2627                $echo "yes"
2628            fi
2629        fi
2630
2631        ## THIS IS POINT AT WHICH TO DO FALLBACK TESTS I.E DOES
2632        ## COMPILATION OF SMALL TEST PROGRAM WORK - THEN HEADERS AND
2633        ## LIBS ARE AUTOMATICALLY FOUND BY LINKER
2634
2635        #
2636        ## Finally, set output variables, raw for now
2637        #
2638        if test "x\$g4_havegoodqt" = "xyes" ; then
2639            g4_qt_version=\$g4_qt_major_ver
2640           
2641            # Take care of Qt4 style header structure...
2642            if test "x\`basename \$g4_qt_include_dir\`" = "xQtCore"; then
2643                g4_qt_cxxflags="-I\`dirname \$g4_qt_include_dir\` -I\$g4_qt_include_dir"
2644            else
2645                g4_qt_cxxflags="-I\$g4_qt_include_dir"
2646            fi
2647            if test "x\$g4_is_qt4" = "xyes" ; then
2648                for i in \$g4_qt_extra_headers ; do
2649                    g4_qt_cxxflags="\$g4_qt_cxxflags -I\$i"
2650                done
2651                for i in \$g4_qt_gl_headers ; do
2652                    g4_qt_gl_cxxflags="\$g4_qt_gl_cxxflags -I\$i"
2653                done
2654            fi
2655
2656            g4_qt_libs="-L\$g4_qt_lib_dir"
2657            if test "x\$g4_qt_lib" = "xQtCore4.lib" ; then
2658                #We have Windows...
2659                g4_qt_libs="\$g4_qt_libs QtCore4.lib QtGui4.lib"
2660                g4_qt_gl_libs="QtOpenGL4.lib"
2661            else
2662                g4_qt_libs="\$g4_qt_libs -l\$g4_qt_lib"
2663                if test "x\$g4_is_qt4" = "xyes" ; then
2664                    g4_qt_libs="\$g4_qt_libs -lQtGui"
2665                    g4_qt_gl_libs="-lQtOpenGL"
2666                fi
2667            fi
2668            if test "x\$g4_qt_lib_qui" != "x" ; then
2669                g4_qt_libs="\$g4_qt_libs -lqui"
2670            fi
2671
2672
2673            g4_qt_moc=\$g4_qtmoc
2674
2675            g4_qt_is_configured=yes
2676        else
2677            g4_qt_is_configured=''
2678        fi
2679    fi #END TEST for Darwin Framework
2680
2681else
2682    #Probably also want flags here to reset variables if requested
2683    echo "configure: Qt already configured, no recheck neccessary"
2684fi #END TEST "x\$g4_qt_is_configured" = "x"
2685
2686EOSC
2687: decide how portable to be
2688case "$d_portable" in
2689"$define") dflt=y;;
2690*)      dflt=n;;
2691esac
2692$cat <<'EOH'
2693 
2694I can set things up so that your shell scripts and binaries are more portable,
2695at what may be a noticable cost in performance.  In particular, if you
2696ask to be portable, the following happens:
2697
2698     1) Shell scripts will rely on the PATH variable rather than using
2699        the paths derived above.
2700     2) ~username interpretations will be done at run time rather than
2701        by Configure.
2702
2703EOH
2704rp="Do you expect to run these scripts and binaries on multiple machines?"
2705. ./myread
2706case "$ans" in
2707        y*) d_portable="$define"
2708        ;;
2709        *)  d_portable="$undef" ;;
2710esac
2711
2712: set up shell script to do ~ expansion
2713cat >filexp <<EOSS
2714$startsh
2715: expand filename
2716case "\$1" in
2717 ~/*|~)
2718        echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
2719        ;;
2720 ~*)
2721        if $test -f /bin/csh; then
2722                /bin/csh -f -c "glob \$1"
2723                failed=\$?
2724                echo ""
2725                exit \$failed
2726        else
2727                name=\`$expr x\$1 : '..\([^/]*\)'\`
2728                dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
2729                if $test ! -d "\$dir"; then
2730                        me=\`basename \$0\`
2731                        echo "\$me: can't locate home directory for: \$name" >&2
2732                        exit 1
2733                fi
2734                case "\$1" in
2735                */*)
2736                        echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
2737                        ;;
2738                *)
2739                        echo \$dir
2740                        ;;
2741                esac
2742        fi
2743        ;;
2744*)
2745        echo \$1
2746        ;;
2747esac
2748EOSS
2749chmod +x filexp
2750$eunicefix filexp
2751
2752: now set up to get a file name
2753cat <<EOS >getfile
2754$startsh
2755EOS
2756cat <<'EOSC' >>getfile
2757tilde=''
2758fullpath=''
2759already=''
2760skip=''
2761none_ok=''
2762exp_file=''
2763nopath_ok=''
2764orig_rp="$rp"
2765orig_dflt="$dflt"
2766
2767case "$fn" in
2768*\(*)
2769        expr $fn : '.*(\(.*\)).*' | tr ',' '\012' >getfile.ok
2770        fn=`echo $fn | sed 's/(.*)//'`
2771        ;;
2772esac
2773
2774case "$fn" in
2775*:*)
2776        loc_file=`expr $fn : '.*:\(.*\)'`
2777        fn=`expr $fn : '\(.*\):.*'`
2778        ;;
2779esac
2780
2781case "$fn" in
2782*~*) tilde=true;;
2783esac
2784case "$fn" in
2785*/*) fullpath=true;;
2786esac
2787case "$fn" in
2788*+*) skip=true;;
2789esac
2790case "$fn" in
2791*n*) none_ok=true;;
2792esac
2793case "$fn" in
2794*e*) exp_file=true;;
2795esac
2796case "$fn" in
2797*p*) nopath_ok=true;;
2798esac
2799
2800case "$fn" in
2801*f*) type='File';;
2802*d*) type='Directory';;
2803*l*) type='Locate';;
2804esac
2805
2806what="$type"
2807case "$what" in
2808Locate) what='File';;
2809esac
2810
2811case "$exp_file" in
2812'')
2813        case "$d_portable" in
2814        "$define") ;;
2815        *) exp_file=true;;
2816        esac
2817        ;;
2818esac
2819
2820cd ../..
2821while test "$type"; do
2822        redo=''
2823        rp="$orig_rp"
2824        dflt="$orig_dflt"
2825        case "$tilde" in
2826        true) rp="$rp ";;
2827        esac
2828        . .config/UU/myread
2829        if test -f .config/UU/getfile.ok && \
2830                $contains "^$ans\$" .config/UU/getfile.ok >/dev/null 2>&1
2831        then
2832                value="$ans"
2833                ansexp="$ans"
2834                break
2835        fi
2836        case "$ans" in
2837        none)
2838                value=''
2839                ansexp=''
2840                case "$none_ok" in
2841                true) type='';;
2842                esac
2843                ;;
2844        *)
2845                case "$tilde" in
2846                '') value="$ans"
2847                        ansexp="$ans";;
2848                *)
2849                        value=`.config/UU/filexp $ans`
2850                        case $? in
2851                        0)
2852                                if test "$ans" != "$value"; then
2853                                        echo "(That expands to $value on this system.)"
2854                                fi
2855                                ;;
2856                        *) value="$ans";;
2857                        esac
2858                        ansexp="$value"
2859                        case "$exp_file" in
2860                        '') value="$ans";;
2861                        esac
2862                        ;;
2863                esac
2864                case "$fullpath" in
2865                true)
2866                        case "$ansexp" in
2867                        /*) value="$ansexp" ;;
2868                        *)
2869                                redo=true
2870                                case "$already" in
2871                                true)
2872                                echo "I shall only accept a full path name, as in /bin/ls." >&4
2873                                echo "Use a ! shell escape if you wish to check pathnames." >&4
2874                                        ;;
2875                                *)
2876                                echo "Please give a full path name, starting with slash." >&4
2877                                        case "$tilde" in
2878                                        true)
2879                                echo "Note that using ~username is ok provided it expands well." >&4
2880                                                already=true
2881                                                ;;
2882                                        esac
2883                                esac
2884                                ;;
2885                        esac
2886                        ;;
2887                esac
2888                case "$redo" in
2889                '')
2890                        case "$type" in
2891                        File)
2892                                if test -f "$ansexp"; then
2893                                        type=''
2894                                elif test -r "$ansexp" || (test -h "$ansexp") >/dev/null 2>&1
2895                                then
2896                                        echo "($value is not a plain file, but that's ok.)"
2897                                        type=''
2898                                fi
2899                                ;;
2900                        Directory)
2901                                if test -d "$ansexp"; then
2902                                        type=''
2903                                fi
2904                                ;;
2905                        Locate)
2906                                if test -d "$ansexp"; then
2907                                        echo "(Looking for $loc_file in directory $value.)"
2908                                        value="$value/$loc_file"
2909                                        ansexp="$ansexp/$loc_file"
2910                                fi
2911                                if test -f "$ansexp"; then
2912                                        type=''
2913                                fi
2914                                case "$nopath_ok" in
2915                                true)   case "$value" in
2916                                        */*) ;;
2917                                        *)      echo "Assuming $value will be in people's path."
2918                                                type=''
2919                                                ;;
2920                                        esac
2921                                        ;;
2922                                esac
2923                                ;;
2924                        esac
2925
2926                        case "$skip" in
2927                        true) type='';
2928                        esac
2929
2930                        case "$type" in
2931                        '') ;;
2932                        *)
2933                                if test "$fastread" = yes; then
2934                                        dflt=y
2935                                else
2936                                        dflt=n
2937                                fi
2938                                rp="$what $value doesn't exist.  Use that name anyway?"
2939                                . .config/UU/myread
2940                                dflt=''
2941                                case "$ans" in
2942                                y*) type='';;
2943                                *) echo " ";;
2944                                esac
2945                                ;;
2946                        esac
2947                        ;;
2948                esac
2949                ;;
2950        esac
2951done
2952cd .config/UU
2953ans="$value"
2954
2955# Check for Windows!
2956if test "X$g4system" = "XWIN32-VC" -o "X$g4system" = "XWIN32-VC7"; then
2957
2958checkdrive=`echo $ans|cut -d"/" -f2`
2959
2960if test "X$checkdrive" = "Xcygdrive"; then
2961
2962windrive=`echo $ans|cut -d"/" -f3`
2963winpath=`echo $ans|cut -d"/" -f4-`
2964
2965fullwinpath="$windrive:/$winpath"
2966ans=$fullwinpath
2967
2968fi # if cygwin syntax is used
2969fi # if Win
2970
2971rp="$orig_rp"
2972dflt="$orig_dflt"
2973rm -f getfile.ok
2974EOSC
2975
2976echo " "
2977
2978#echo "SSS"
2979#echo `pwd`
2980#echo "SSS"
2981
2982if [ X$src = X. ] ; then
2983        cd ../..
2984        abssrc=`pwd`
2985        cd .config/UU
2986else
2987        abssrc=$src
2988fi
2989
2990case "$g4conf" in
2991'')
2992        g4conf=$abssrc/.config/bin/$g4system
2993        ;;
2994esac
2995
2996#echo "g4conf=$g4conf"
2997
2998case "$g4install" in
2999'')
3000if test $g4system = "WIN32-VC" -o $g4system = "WIN32-VC7"; then
3001#       g4install="c:/geant4"
3002        g4install=$abssrc
3003else
3004#       if [ X"$HOME" = X/ ] ; then
3005#       HOME=""
3006#       fi
3007#       g4install="$HOME"/geant4
3008        g4install=$abssrc
3009
3010fi
3011
3012# Check for Windows!
3013if test $g4system = "WIN32-VC" -o $g4system = "WIN32-VC7"; then
3014
3015checkdrive=`echo $g4install|cut -d"/" -f2`
3016
3017if test $checkdrive = "cygdrive"; then
3018
3019windrive=`echo $g4install|cut -d"/" -f3`
3020winpath=`echo $g4install|cut -d"/" -f4-`
3021
3022fullwinpath="$windrive:/$winpath"
3023g4install=$fullwinpath
3024
3025fi
3026fi
3027        ;;
3028esac
3029
3030case "$g4final_install" in
3031'')
3032        g4final_install=$g4install
3033        ;;
3034esac
3035
3036case "$g4workdir" in
3037'')
3038        g4workdir=$g4install
3039        ;;
3040esac
3041
3042case "$g4includes_flag" in
3043'')
3044        g4includes_flag=n
3045        ;;
3046esac
3047
3048
3049g4message=`cat << EOM
3050
3051Where is Geant4 source installed?
3052EOM`
3053
3054#dflt="NO DEFAULT ANSWER"
3055dflt=$g4install
3056fn='d~'
3057rp=$g4message
3058. ./getfile
3059g4install=$ans
3060g4workdir=$g4install
3061#################################
3062g4message=`cat << EOM
3063
3064Specify the path where Geant4 libraries and source files should be
3065installed.
3066EOM`
3067
3068#dflt="NO DEFAULT ANSWER"
3069dflt=$g4final_install
3070fn='d~'
3071rp=$g4message
3072. ./getfile
3073g4final_install=$ans
3074#g4workdir=$g4install
3075
3076##################################
3077g4message=`cat << EOM
3078
3079Do you want to copy all Geant4 headers
3080in one directory?
3081EOM`
3082
3083#dflt="NO DEFAULT ANSWER"
3084dflt=$g4includes_flag
3085#fn='d~'
3086rp=$g4message
3087. ./myread
3088g4includes_flag=$ans
3089
3090if [ X$g4includes_flag = Xy ] ; then
3091
3092case "$g4include" in
3093'')
3094        g4include=$g4install/include
3095#       g4include=''
3096        ;;
3097esac
3098
3099#g4message=`cat << EOM
3100#
3101#Where will be directory to copy all Geant4 headers?
3102#EOM`
3103#
3104##dflt="NO DEFAULT ANSWER"
3105####dflt=$g4install/include
3106#dflt=$g4include
3107#fn='d~+'
3108#rp=$g4message
3109#. ./getfile
3110#g4include=$ans
3111
3112# Set constantly!
3113if [ X$g4install != X$g4final_install ] ; then
3114g4include=$g4final_install/include/geant4
3115else
3116g4include=$g4final_install/include
3117fi
3118
3119fi
3120
3121#if test "X$g4include" = "X[NOT DEFINED]" ; then
3122#g4include=""
3123#fi
3124
3125echo " "
3126
3127case "$g4tmp" in
3128'')
3129        g4tmp=$g4workdir/tmp
3130        ;;
3131esac
3132
3133case "$g4lib" in
3134'')
3135        g4lib=$g4workdir/lib
3136        ;;
3137esac
3138
3139#case "$g4bin" in
3140#'')
3141#       g4bin=$g4workdir/bin
3142#       ;;
3143#esac
3144
3145while test 1 = 0  ; do
3146
3147g4message=`cat << EOM
3148
3149(OPTIONAL) You can now customise installation directories:
3150  G4TMP - tmp/ containing temporary dependency (.d) and object (.o) files;
3151  G4LIB - lib/ containing final static (.a) or shared (.so) libraries;
3152
31531) G4TMP:               $g4tmp
3154
31552) G4LIB:               $g4lib
3156
3157To modify default settings, select number above (e.g. 2)
3158EOM`
3159
3160#dflt="NO DEFAULT ANSWER"
3161dflt="Press [Enter] for default settings"
3162#fn='d~'
3163rp=$g4message
3164. ./myread
3165gans=$ans
3166
3167
3168        case $gans in
3169
3170        1)
3171                dflt=$g4tmp
3172                fn='d~+'
3173                rp="Where will be your Geant4 tmp directory?"
3174                . ./getfile
3175                g4tmp=$ans
3176                ;;
3177        2)
3178                dflt=$g4lib
3179                fn='d~+'
3180                rp="Where will be your Geant4 lib directory?"
3181                . ./getfile
3182                g4lib=$ans
3183                ;;
3184#       3)
3185#               dflt=$g4bin
3186#               fn='d~+'
3187#               rp="Where will be your Geant4 bin directory?"
3188#               . ./getfile
3189#               g4bin=$ans
3190#               ;;
3191
3192#       [eE])
3193#               break
3194#               ;;
3195        *)
3196                break
3197#               echo " "
3198                ;;
3199        esac
3200done
3201
3202g4data_photonevaporation_version='PhotonEvaporation2.0'
3203g4data_radioactivedecay_version='RadioactiveDecay3.2'
3204g4data_g4emlow_version='G4EMLOW6.2'
3205g4data_g4ndl_version='G4NDL3.13'
3206g4data_g4abla_version='G4ABLA3.0'
3207#END GEANT4 DATA OPTIONS
3208echo " "
3209
3210
3211#
3212# Set defaults for data paths - here, because we depend on g4install
3213#
3214case "$g4data" in
3215'')
3216        g4data=$g4install/data
3217        ;;
3218esac
3219
3220case "$g4levelgammadata" in
3221'')
3222        g4levelgammadata=$g4data/$g4data_photonevaporation_version
3223        ;;
3224esac
3225
3226case "$g4radioactivedata" in
3227'')
3228        g4radioactivedata=$g4data/$g4data_radioactivedecay_version
3229        ;;
3230esac
3231
3232case "$g4ledata" in
3233'')
3234        g4ledata=$g4data/$g4data_g4emlow_version
3235        ;;
3236esac
3237
3238case "$g4neutronhpcrosssections" in
3239'')
3240        g4neutronhpcrosssections=$g4data/$g4data_g4ndl_version
3241        ;;
3242esac
3243
3244case "$g4abladata" in
3245'')
3246        g4abladata=$g4data/$g4data_g4abla_version
3247        ;;
3248esac
3249
3250
3251#
3252# Now we have defaults, prompt user to see if this is where they want to use
3253#
3254g4data_alllibs="$g4data_photonevaporation_version $g4data_radioactivedecay_version $g4data_g4emlow_version $g4data_g4ndl_version $g4data_g4abla_version"
3255
3256g4message=`cat <<EOM
3257Specify the path where the Geant4 data libraries
3258
3259$g4data_alllibs
3260
3261are installed. For now, a flat directory structure is assumed, and this can
3262be customized at the next step if needed.
3263EOM`
3264
3265dflt=$g4data
3266rp=$g4message
3267. ./myread
3268g4data=$ans
3269
3270#
3271# Using this, we can now check that the libs exist, but only on a directory
3272# level
3273#
3274g4data_foundall='yes'
3275promptend="no"
3276g4data_customize="no"
3277
3278while test "x$promptend" = "xno" ; do
3279        ### PhotonEvaporation
3280        $echo $n "checking for $g4data_photonevaporation_version... $c"
3281        if test -d "$g4data/$g4data_photonevaporation_version" ; then
3282                $echo "yes"
3283                g4levelgammadata=$g4data/$g4data_photonevaporation_version
3284        else
3285                $echo "no"
3286                g4data_foundall="no"
3287        fi
3288
3289        ### RadioactiveDecay
3290        $echo $n "checking for $g4data_radioactivedecay_version... $c"
3291        if test -d "$g4data/$g4data_radioactivedecay_version" ; then
3292                $echo "yes"
3293                g4radioactivedata=$g4data/$g4data_radioactivedecay_version
3294        else
3295                $echo "no"
3296                g4data_foundall="no"
3297        fi
3298
3299        ### G4EMLOW
3300        $echo $n "checking for $g4data_g4emlow_version... $c"
3301        if test -d "$g4data/$g4data_g4emlow_version" ; then
3302                $echo "yes"
3303                g4ledata=$g4data/$g4data_g4emlow_version
3304        else
3305                $echo "no"
3306                g4data_foundall="no"
3307        fi
3308
3309        ### G4NDL
3310        $echo $n "checking for $g4data_g4ndl_version... $c"
3311        if test -d "$g4data/$g4data_g4ndl_version" ; then
3312                $echo "yes"
3313                g4neutronhpcrosssections=$g4data/$g4data_g4ndl_version
3314        else
3315                $echo "no"
3316                g4data_foundall="no"
3317        fi
3318
3319        ### G4ABLA
3320        $echo $n "checking for $g4data_g4abla_version... $c"
3321        if test -d "$g4data/$g4data_g4abla_version" ; then
3322                $echo "yes"
3323                g4abladata=$g4data/$g4data_g4abla_version
3324        else
3325                $echo "no"
3326                g4data_foundall="no"
3327        fi
3328
3329        #
3330        # If we haven't found all the data, query the user as to whether they
3331        # want to
3332        # 1) try again with a different path
3333        # 2) use the path they input
3334        # 3) customize paths
3335        #
3336        if test "x$g4data_foundall" = "xyes" ; then
3337                promptend=yes
3338        else
3339                g4message=`cat << EOM
3340
3341Failed to locate one or more of the Geant4 data libraries in
3342
3343$g4data
3344
3345Please enter
33461) Another path to search in
33472) 'f' to force the use of the path you entered previously (the data libraries
3348   are not needed to build Geant4, but are needed to run applications later).
33493) 'c' to customize the data paths, e.g. if you have the data libraries
3350   installed in different locations.
3351EOM`
3352                dflt="f"
3353                rp=$g4message
3354                . ./myread
3355                gans=$ans
3356
3357                if test "x$gans" = "xf" ; then
3358                        # Force paths
3359                        promptend="yes"
3360                        g4levelgammadata="$g4data/$g4data_photonevaporation_version"
3361                        g4radioactivedata="$g4data/$g4data_radioactivedecay_version"
3362                        g4ledata="$g4data/$g4data_g4emlow_version"
3363                        g4neutronhpcrosssections="$g4data/$g4data_g4ndl_version"
3364                        g4abladata="$g4data/$g4data_g4abla_version"
3365                       
3366
3367                elif test "x$gans" = "xc" ; then
3368                        # enable customization - we use input g4data to set
3369                        # defaults
3370                        promptend="yes"
3371                        g4data_customize="yes"
3372
3373                        g4levelgammadata="$g4data/$g4data_photonevaporation_version"
3374                        g4radioactivedata="$g4data/$g4data_radioactivedecay_version"
3375                        g4ledata="$g4data/$g4data_g4emlow_version"
3376                        g4neutronhpcrosssections="$g4data/$g4data_g4ndl_version"
3377                        g4abladata="$g4data/$g4data_g4abla_version"
3378
3379
3380                else
3381                        #try again
3382                        g4data_foundall=yes
3383                        g4data=$gans
3384                fi
3385        fi
3386done
3387
3388
3389#
3390# Now customize paths if required
3391#
3392if test "x$g4data_customize" = "xyes" ; then
3393while test "x" = "x" ; do
3394
3395        g4message=`cat <<EOM
3396
3397You have chosen to customize the Geant4 data library paths.
3398
33991) $g4data_photonevaporation_version:
3400        $g4levelgammadata
34012) $g4data_radioactivedecay_version:
3402        $g4radioactivedata
34033) $g4data_g4emlow_version:
3404        $g4ledata
34054) $g4data_g4ndl_version:
3406        $g4neutronhpcrosssections
34075) $g4data_g4abla_version:
3408        $g4abladata
3409
3410Choose a number from the list above to customize that path (e.g. 2)
3411EOM`
3412
3413        dflt="Press [Enter] to exit customization with paths as above"
3414        rp=$g4message
3415        . ./myread
3416        gans=$ans
3417
3418        case $gans in
3419
3420        "1")
3421                dflt=$g4levelgammadata
3422                fn='d~'
3423                rp="Custom path to $g4data_photonevaporation_version?"
3424                . ./getfile
3425                g4levelgammadata=$ans
3426                ;;
3427
3428        "2")
3429                dflt=$g4radioactivedata
3430                fn='d~'
3431                rp="Custom path to $g4data_radioactivedecay_version?"
3432                . ./getfile
3433                g4radioactivedata=$ans
3434                ;;
3435
3436        "3")
3437                dflt=$g4ledata
3438                fn='d~'
3439                rp="Custom path to $g4data_g4emlow_version?"
3440                . ./getfile
3441                g4ledata=$ans
3442                ;;
3443
3444        "4")
3445                dflt=$g4neutronhpcrosssections
3446                fn='d~'
3447                rp="Custom path to $g4data_g4ndl_version?"
3448                . ./getfile
3449                g4neutronhpcrosssections=$ans
3450                ;;
3451
3452        "5")
3453                dflt=$g4abladata
3454                fn='d~'
3455                rp="Custom path to $g4data_g4abla_version?"
3456                . ./getfile
3457                g4abladata=$ans
3458                ;;
3459
3460        *)
3461                break
3462                ;;
3463
3464        esac
3465
3466done
3467fi
3468
3469
3470
3471
3472
3473if test "X$g4clhep_base_dir" = "X" ; then
3474
3475clhep_dirs=`find $g4clhep_base_dir /usr/local/include /usr/include -type d -name CLHEP 2>/dev/null |xargs echo`
3476#echo clhep_dirs=$clhep_dirs
3477
3478fi
3479
3480if test "X$clhep_dirs" != "X" ; then
3481
3482g4clhep_base_dir_found=`echo $clhep_dirs|cut -d" " -f1`
3483#echo g4clhep_base_dir_found=$g4clhep_base_dir_found
3484
3485
3486#g4clhep_base_dir_n=`echo $g4clhep_base_dir_found |awk -F"/" '{print NF}'`
3487#echo g4clhep_base_dir_n=$g4clhep_base_dir_n
3488g4clhep_base_dir_found=`dirname $g4clhep_base_dir_found`
3489g4clhep_base_dir_found=`dirname $g4clhep_base_dir_found`
3490
3491        g4clhep_base_dir=$g4clhep_base_dir_found
3492
3493#else
3494#case "$g4clhep_base_dir" in
3495#'')
3496#       if test "X$g4system" = "XWIN32-VC" -o "X$g4system" = "XWIN32-VC7"; then
3497#       g4clhep_base_dir="c:/usr/local"
3498#       else
3499#       g4clhep_base_dir=/usr/local
3500#       fi
3501#       ;;
3502#esac
3503fi
3504
3505
3506#while test 1 = 1  ; do
3507
3508#if test "X$g4clhep_base_dir" != "X" ; then
3509#clhep_dirs=$g4clhep_base_dir
3510#echo 1 g4clhep_base_dir=$g4clhep_base_dir
3511#fi
3512
3513if test "X$g4clhep_base_dir" != "X" ; then
3514
3515g4message=`cat << EOM
3516
3517Please, specify where CLHEP is installed. It was found in:
3518
3519CLHEP_BASE_DIR:                 $g4clhep_base_dir
3520
3521EOM`
3522
3523dflt=$g4clhep_base_dir
3524fn='d~'
3525rp=$g4message
3526. ./getfile
3527
3528cend="no"
3529while test "$cend" = "no" ; do
3530if test -e "$ans/include/CLHEP" ; then
3531cend="yes"
3532
3533g4clhep_base_dir=$ans
3534
3535else
3536
3537g4message=`cat << EOM
3538
3539Could not find CLHEP installed in $ans!
3540Please, specify where CLHEP is installed:
3541
3542CLHEP_BASE_DIR:                 
3543
3544EOM`
3545
3546dflt=""
3547fn='d~'
3548rp=$g4message
3549. ./getfile
3550fi
3551done
3552
3553else
3554
3555g4message=`cat << EOM
3556
3557Could not find CLHEP installed on this system!
3558Please, specify where CLHEP is installed:
3559
3560CLHEP_BASE_DIR:                 
3561
3562EOM`
3563
3564dflt=""
3565fn='d~'
3566rp=$g4message
3567. ./getfile
3568
3569cend="no"
3570while test "$cend" = "no" ; do
3571if test -e "$ans/include/CLHEP" ; then
3572cend="yes"
3573
3574g4clhep_base_dir=$ans
3575
3576else
3577
3578g4message=`cat << EOM
3579
3580Could not find CLHEP installed in $ans!
3581Please, specify where CLHEP is installed:
3582
3583CLHEP_BASE_DIR:                 
3584
3585EOM`
3586
3587dflt=""
3588fn='d~'
3589rp=$g4message
3590. ./getfile
3591fi
3592done
3593
3594fi
3595
3596#dflt="Press [Enter] for default settings"
3597#fn='d~'
3598#####rp=$g4message
3599#. ./myread
3600#gans=$ans
3601
3602#       case $gans in
3603
3604#       1)
3605##              dflt=""
3606##              fn='d~'
3607#               rp="Where is CLHEP installed?"
3608##              . ./getfile
3609##              g4clhep_base_dir=$ans
3610
3611#####           g4clhep_include_dir=$ans/include
3612#####           g4clhep_lib_dir=$ans/lib
3613#               ;;
3614#       2)
3615#               dflt=$g4clhep_include_dir
3616#               fn='d~'
3617#               rp="Where is CLHEP include directory?"
3618#               . ./getfile
3619#               g4clhep_include_dir=$ans
3620#               ;;
3621#       3)
3622#               dflt=$g4clhep_lib_dir
3623#               fn='d~'
3624#               rp="Where is CLHEP lib directory?"
3625#               . ./getfile
3626#               g4clhep_lib_dir=$ans
3627#               ;;
3628#       4)
3629#               dflt=$g4clhep_lib
3630#               rp="What is CLHEP lib title?"
3631#               . ./myread
3632#               g4clhep_lib=$ans
3633#               ;;
3634##      [eE])
3635##              break
3636##              ;;
3637#       *)
3638#               echo " "
3639#               break
3640#               ;;
3641#       esac
3642#done
3643
3644case "$g4clhep_include_dir" in
3645'')
3646        g4clhep_include_dir=$g4clhep_base_dir/include
3647        ;;
3648esac
3649
3650case "$g4clhep_lib_dir" in
3651'')
3652        g4clhep_lib_dir=$g4clhep_base_dir/lib
3653        ;;
3654esac
3655
3656case "$g4clhep_lib" in
3657'')
3658        if test "X$g4system" = "XWIN32-VC" -o "X$g4system" = "XWIN32-VC7"; then
3659        g4clhep_lib="CLHEP.lib"
3660        else
3661        g4clhep_lib=CLHEP
3662        fi
3663        ;;
3664esac
3665
3666while test 1 = 1  ; do
3667
3668g4message_1=`cat << You
3669
3670You can customize paths and library name of you CLHEP installation:
3671
36721) CLHEP_INCLUDE_DIR:           $g4clhep_include_dir
36732) CLHEP_LIB_DIR:               $g4clhep_lib_dir
36743) CLHEP_LIB:                   $g4clhep_lib
3675
3676You`
3677
3678g4message_2=" need to use full library name with its extension (e.g. libCLHEP.lib)."
3679
3680g4message_3=`cat << EOM
3681
3682To modify default settings, select number above (e.g. 2)
3683EOM`
3684
3685
3686if test "X$g4system" != "XWIN32-VC" -a "X$g4system" != "XWIN32-VC7"; then
3687rp=$g4message_1$g4message_3
3688else
3689rp=$g4message_1$g4message_2$g4message_3
3690fi
3691
3692dflt="Press [Enter] for default settings"
3693#fn='d~'
3694. ./myread
3695gans=$ans
3696
3697        case $gans in
3698
3699        1)
3700                dflt=$g4clhep_include_dir
3701                fn='d~'
3702                rp="Where is CLHEP include directory?"
3703                . ./getfile
3704                g4clhep_include_dir=$ans
3705                ;;
3706        2)
3707                dflt=$g4clhep_lib_dir
3708                fn='d~'
3709                rp="Where is CLHEP lib directory?"
3710                . ./getfile
3711                g4clhep_lib_dir=$ans
3712                ;;
3713        3)
3714                dflt=$g4clhep_lib
3715                rp="What is CLHEP lib title?"
3716                . ./myread
3717                g4clhep_lib=$ans
3718                ;;
3719#       [eE])
3720##              break
3721##              ;;
3722        *)
3723#               echo " "
3724                break
3725                ;;
3726        esac
3727done
3728
3729#if test "X$g4clhep_base_dir" = "X/usr" -o "X$g4clhep_base_dir" = "X/usr/local"; then
3730#g4clhep_base_dir=""
3731#fi
3732#
3733#if test "X$g4clhep_include_dir" = "X/usr/include" -o "X$g4clhep_include_dir" = "X/usr/local/include"; then
3734#g4clhep_include_dir=""
3735#fi
3736#
3737#if test "X$g4clhep_lib_dir" = "X/usr/lib" -o "X$g4clhep_lib_dir" = "X/usr/local/lib"; then
3738#g4clhep_lib_dir=""
3739#fi
3740
3741echo " "
3742
3743case "$g4lib_build_shared" in
3744'')
3745        g4lib_build_shared=n
3746        ;;
3747esac
3748
3749echo " "
3750
3751case "$g4lib_build_static" in
3752'')
3753        g4lib_build_static=n
3754        ;;
3755esac
3756
3757echo " "
3758
3759case "$g4lib_use_shared" in
3760'')
3761        g4lib_use_shared=n
3762        ;;
3763esac
3764
3765echo " "
3766
3767case "$g4lib_use_static" in
3768'')
3769        g4lib_use_static=n
3770        ;;
3771esac
3772
3773case "$g4lib_build_dll" in
3774'')
3775        g4lib_build_dll=n
3776        ;;
3777esac
3778
3779case "$g4lib_build_dyn" in
3780'')
3781        g4lib_build_dyn=n
3782        ;;
3783esac
3784
3785#
3786# Ask about building of SHARED|STATIC libraries - default STATIC.
3787#
3788echo ""
3789
3790if test "X$g4system" = "XWIN32-VC" -o "X$g4system" = "XWIN32-VC7"; then
3791
3792while test 1 = 1  ; do
3793
3794g4message=`cat << EOM
3795
3796By default 'static'  libraries are built.
3797
3798Do you want to build DLL (.dll) libraries?
3799EOM`
3800
3801dflt=$g4lib_build_dll
3802rp=$g4message
3803. ./myread
3804gans=$ans
3805
3806        case $gans in
3807       
3808        n*|N*)
3809                g4lib_build_dll=n
3810                g4lib_build_shared=n
3811                g4lib_build_static=y
3812                break
3813                ;;
3814        y*|Y*)
3815                g4lib_build_dll=y
3816                g4lib_build_shared=n
3817                g4lib_build_static=n
3818
3819#               g4lib_build_static=""
3820#               g4lib_use_shared=1
3821#               g4lib_use_static=""
3822                break
3823                ;;
3824#       [eE])
3825#               break
3826#               ;;
3827#       *)
3828#               echo " "
3829#               break
3830#               ;;
3831        esac
3832done
3833
3834fi
3835
3836if test "X$g4system" != "XWIN32-VC" -a "X$g4system" != "XWIN32-VC7" ; then
3837
3838while test 1 = 1  ; do
3839
3840g4message=`cat << EOM
3841
3842By default 'static' (.a) libraries are built.
3843
3844Do you want to build 'shared' (.so) libraries?
3845EOM`
3846
3847dflt=$g4lib_build_shared
3848rp=$g4message
3849. ./myread
3850gans=$ans
3851
3852        case $gans in
3853       
3854        n*|N*)
3855                g4lib_build_shared=n
3856                g4lib_build_static=y
3857                break
3858                ;;
3859        y*|Y*)
3860                g4lib_build_shared=y
3861#               g4lib_build_static=""
3862#               g4lib_use_shared=1
3863#               g4lib_use_static=""
3864                break
3865                ;;
3866#       [eE])
3867#               break
3868#               ;;
3869#       *)
3870#               echo " "
3871#               break
3872#               ;;
3873        esac
3874done
3875
3876if [ X$g4lib_build_shared = Xy ] ; then
3877#
3878# Ask about g4lib_build_static - default "n".
3879#
3880echo ""
3881
3882while test 1 = 1  ; do
3883
3884g4message=`cat << EOM
3885
3886You selected to build 'shared' (.so) libraries.
3887Do you want to build 'static' (.a) libraries too?
3888EOM`
3889
3890#dflt=$g4lib_build_static
3891dflt=n
3892rp=$g4message
3893. ./myread
3894gans=$ans
3895
3896        case $gans in
3897       
3898        n*|N*)
3899                g4lib_build_static=n
3900                break
3901                ;;
3902        y*|Y*)
3903#               g4lib_build_shared=1
3904                g4lib_build_static=y
3905#               g4lib_use_shared=1
3906#               g4lib_use_static=""
3907                break
3908                ;;
3909#       [eE])
3910#               break
3911#               ;;
3912#       *)
3913#               echo " "
3914#               break
3915#               ;;
3916        esac
3917done
3918
3919## Comment out in waiting G4LIB_USE_STATIC and G4LIB_USE_SHARED.
3920#
3921#if [ X$g4lib_build_static = Xy ] ; then
3922##
3923## Ask about g4lib_use_static - default "n".
3924##
3925#echo ""
3926#
3927#while test 1 = 1  ; do
3928#
3929#g4message=`cat << EOM
3930#
3931#You selected to build 'shared' (.so) and 'static' (.a) libraries.
3932#Do you want to use 'static' (.a) libraries?
3933#EOM`
3934#
3935#dflt=$g4lib_use_static
3936#rp=$g4message
3937#. ./myread
3938#gans=$ans
3939#
3940#       case $gans in
3941#       
3942#       n*|N*)
3943#               break
3944#               ;;
3945#       y*|Y*)
3946##              g4lib_build_shared=1
3947##              g4lib_build_static=1
3948##              g4lib_use_shared=1
3949#               g4lib_use_static=y
3950#               break
3951#               ;;
3952##      [eE])
3953##              break
3954##              ;;
3955##      *)
3956##              echo " "
3957##              break
3958##              ;;
3959#       esac
3960#done
3961#fi
3962
3963fi
3964
3965fi # if !Win
3966
3967echo " "
3968case "$g4global" in
3969'')
3970        g4global=n
3971        ;;
3972esac
3973
3974echo " "
3975# By default it's 'grabular'!
3976case "$g4granular" in
3977'')
3978        g4granular=y
3979        ;;
3980esac
3981
3982echo " "
3983# Will be set (if needed) in GNUmakefile!
3984case "$g4lib_use_granular" in
3985'')
3986        g4lib_use_granular=y
3987        ;;
3988esac
3989
3990if test \( \( "X$g4system" = "XWIN32-VC" -o "X$g4system" = "XWIN32-VC7" \) -a "X$g4lib_build_dll" = "Xy" \) -o  \( "X$g4system" = "XDarwin-g++"  -a "X$g4lib_build_dyn" = "Xy" \) ; then
3991
3992        g4global=n
3993        g4granular=n
3994        g4lib_use_granular=n
3995
3996fi
3997
3998if test \( "X$g4system" != "XWIN32-VC" -a "X$g4system" != "XWIN32-VC7" -a "X$g4system" != "XDarwin-g++" \) -o    \( \( "X$g4system" = "XWIN32-VC" -o "X$g4system" = "XWIN32-VC7" \) -a "X$g4lib_build_dll" = "Xn" \) -o \( "X$g4system" = "XDarwin-g++" -a "X$g4lib_build_dyn" = "Xn" \) ; then
3999
4000#
4001# Ask about g4global - default "(empty)".
4002#
4003echo ""
4004
4005while test 1 = 1  ; do
4006
4007g4message=`cat << EOM
4008
4009Do you want to build 'global' compound libraries?
4010EOM`
4011
4012dflt=$g4global
4013rp=$g4message
4014. ./myread
4015gans=$ans
4016
4017        case $gans in
4018       
4019        n*|N*)
4020                g4global=n
4021                g4granular=y
4022                g4lib_use_granular=y
4023                break
4024                ;;
4025        y*|Y*)
4026                g4global=y
4027# Shoud be comment out to keep settings from config.sh - not now to keep as in release
4028                g4granular=n
4029# Shoud be comment out to keep settings from config.sh - not now to keep as in release
4030                g4lib_use_granular=n
4031                break
4032                ;;
4033#       [eE])
4034#               break
4035#               ;;
4036#       *)
4037#               echo " "
4038#               break
4039#               ;;
4040        esac
4041done
4042
4043if [ X$g4global = Xy ] ; then
4044#
4045# Ask about g4granular - default "n".
4046#
4047echo ""
4048
4049while test 1 = 1  ; do
4050
4051g4message=`cat << EOM
4052
4053Granular libraries are used by defaults, you asked to build global
4054compound libraries. Do you want to build 'granular' libraries too?
4055EOM`
4056
4057dflt=$g4granular
4058rp=$g4message
4059. ./myread
4060gans=$ans
4061
4062        case $gans in
4063       
4064        n*|N*)
4065                g4granular=n
4066                break
4067                ;;
4068        y*|Y*)
4069                g4granular=y
4070                break
4071                ;;
4072#       [eE])
4073#               break
4074#               ;;
4075#       *)
4076#               echo " "
4077#               break
4078#               ;;
4079        esac
4080done
4081
4082if [ X$g4granular = Xy ] ; then
4083#
4084# Ask about g4lib_use_granular - default "n".
4085#
4086echo ""
4087
4088while test 1 = 1  ; do
4089
4090g4message=`cat << EOM
4091
4092Global libraries are used by defaults, you asked to build global
4093compound libraries and granular libraries.
4094Do you want to use 'granular' libraries instead?
4095EOM`
4096
4097dflt=$g4lib_use_granular
4098rp=$g4message
4099. ./myread
4100gans=$ans
4101
4102        case $gans in
4103       
4104        n*|N*)
4105                g4lib_use_granular=n
4106                break
4107                ;;
4108        y*|Y*)
4109                g4lib_use_granular=y
4110                break
4111                ;;
4112#       [eE])
4113#               break
4114#               ;;
4115#       *)
4116#               echo " "
4117#               break
4118#               ;;
4119        esac
4120done
4121fi
4122fi
4123
4124fi # !Win
4125
4126### End file - without will be problem! Check in others...
4127
4128
4129echo " "
4130case "$g4debug" in
4131'')
4132        g4debug=n
4133        ;;
4134esac
4135
4136#
4137# Ask about g4debug - default "(empty)".
4138#
4139echo ""
4140
4141while test 1 = 1  ; do
4142
4143g4message=`cat << EOM
4144
4145Do you want to compile libraries in DEBUG mode (-g)?
4146EOM`
4147
4148dflt=$g4debug
4149rp=$g4message
4150. ./myread
4151gans=$ans
4152
4153        case $gans in
4154       
4155        n*|N*)
4156                break
4157                ;;
4158        y*|Y*)
4159                g4debug=y
4160                break
4161                ;;
4162#       [eE])
4163#               break
4164#               ;;
4165#       *)
4166#               echo " "
4167#               break
4168#               ;;
4169        esac
4170done
4171
4172
4173echo " "
4174
4175case "$g4ui_none" in
4176'')
4177        g4ui_none=n
4178        ;;
4179esac
4180
4181# Set by default!
4182case "$g4ui_build_terminal_session" in
4183'')
4184        g4ui_build_terminal_session=y
4185        ;;
4186esac
4187
4188# Set by default!
4189case "$g4ui_use_terminal" in
4190'')
4191        g4ui_use_terminal=y
4192        ;;
4193esac
4194
4195# Set by default!
4196case "$g4ui_build_gag_session" in
4197'')
4198        g4ui_build_gag_session=y
4199        ;;
4200esac
4201
4202# Set by default!
4203case "$g4ui_use_gag" in
4204'')
4205        g4ui_use_gag=y
4206        ;;
4207esac
4208
4209case "$g4ui_build_xm_session" in
4210'')
4211        g4ui_build_xm_session=n
4212        ;;
4213esac
4214
4215case "$g4ui_use_xm" in
4216'')
4217        g4ui_use_xm=n
4218        ;;
4219esac
4220
4221case "$g4ui_build_xaw_session" in
4222'')
4223        g4ui_build_xaw_session=n
4224        ;;
4225esac
4226
4227case "$g4ui_use_xaw" in
4228'')
4229        g4ui_use_xaw=n
4230        ;;
4231esac
4232
4233case "$g4ui_build_win32_session" in
4234'')
4235        g4ui_build_win32_session=n
4236        ;;
4237esac
4238
4239case "$g4ui_use_win32" in
4240'')
4241        g4ui_use_win32=n
4242        ;;
4243esac
4244
4245# Set by default!
4246case "$g4ui_use_tcsh" in
4247'')
4248        g4ui_use_tcsh=y
4249        ;;
4250esac
4251
4252
4253
4254
4255echo ""
4256
4257g4message=`cat << EOM
4258
4259  G4UI_NONE
4260
4261If this variable is set, no UI sessions nor any UI libraries are built.
4262This can be useful when running a pure batch job or in a user framework
4263having its own UI system.
4264Do you want to set this variable ?
4265
4266EOM`
4267
4268dflt=$g4ui_none
4269rp=$g4message
4270. ./myread
4271gans=$ans
4272
4273        case $gans in
4274       
4275        n*|N*)
4276                g4ui_none=n
4277                ;;
4278        y*|Y*)
4279                g4ui_none=y
4280                ;;
4281        esac
4282
4283case $g4ui_none in
4284
4285n)
4286
4287g4message=`cat << EOM
4288
4289  G4UI_BUILD_TERMINAL_SESSION
4290  Specifies to include in kernel library a basic dumb terminal
4291  user interface (default).
4292
4293  G4UI_USE_TERMINAL
4294  Specifies to use dumb terminal interface in the application to be
4295  built (default).
4296EOM`
4297
4298dflt=$g4ui_use_terminal
4299rp=$g4message
4300#. ./myread
4301#gans=$ans
4302gans=y
4303
4304        case $gans in
4305       
4306        n*|N*)
4307                g4ui_build_terminal_session=n
4308                g4ui_use_terminal=n
4309                ;;
4310        y*|Y*)
4311                g4ui_build_terminal_session=y
4312                g4ui_use_terminal=y
4313                ;;
4314        esac
4315
4316g4message=`cat << EOM
4317
4318  G4UI_BUILD_GAG_SESSION
4319  Specifies to include in kernel library the GAG based
4320  user interface.
4321
4322  G4UI_USE_GAG
4323  Specifies to use the GAG interface in the application to be
4324  built.
4325EOM`
4326
4327dflt=$g4ui_use_gag
4328rp=$g4message
4329#. ./myread
4330#gans=$ans
4331gans=y
4332
4333        case $gans in
4334       
4335        n*|N*)
4336                g4ui_build_gag_session=n
4337                g4ui_use_gag=n
4338                ;;
4339        y*|Y*)
4340                g4ui_build_gag_session=y
4341                g4ui_use_gag=y
4342                ;;
4343        esac
4344
4345if test "X$g4system" != "XWIN32-VC" -a "X$g4system" != "XWIN32-VC7"; then
4346
4347g4message=`cat << EOM
4348
4349  G4UI_BUILD_XAW_SESSION
4350  G4UI_USE_XAW
4351
4352  Specifies to include and use the XAW interfaces in the
4353  application to be built.
4354  The XAW (X11 Athena Widget set) extensions are required to activate
4355  and build this driver.
4356EOM`
4357
4358dflt=$g4ui_use_xaw
4359rp=$g4message
4360. ./myread
4361gans=$ans
4362
4363        case $gans in
4364       
4365        n*|N*)
4366                g4ui_build_xaw_session=n
4367                g4ui_use_xaw=n
4368                ;;
4369        y*|Y*)
4370                g4ui_build_xaw_session=y
4371                g4ui_use_xaw=y
4372                ;;
4373        esac
4374
4375############################################################
4376############################################################
4377
4378if test "X$g4ui_build_xaw_session" = "Xy" ; then
4379
4380if test "X$g4ui_xawhome" = "X" ; then
4381xaw_dirs=`find $g4ui_xawhome /usr/X11R6/include /usr/local/include /usr/include /sw/include -type d -name Xaw 2>/dev/null |xargs echo`
4382#echo ogl_dirs=$ogl_dirs
4383
4384if test "X$xaw_dirs" != "X" ; then
4385
4386g4xaw_base_dir_found=`echo $xaw_dirs|cut -d" " -f1`
4387#echo g4ogl_base_dir_found=$g4ogl_base_dir_found
4388
4389# That's right: should be 3 times! (e.g./usr/local/lib/libGLU.so -> /usr/local)
4390g4xaw_base_dir_found=`dirname $g4xaw_base_dir_found`
4391g4xaw_base_dir_found=`dirname $g4xaw_base_dir_found`
4392g4xaw_base_dir_found=`dirname $g4xaw_base_dir_found`
4393
4394        g4ui_xawhome=$g4xaw_base_dir_found
4395#else
4396#case "$g4ui_xawhome" in
4397#'')
4398#       g4ui_xawhome=/usr/X11R6/
4399#       ;;
4400#esac
4401fi
4402fi
4403
4404##########################################################################
4405
4406#if test "X$g4ui_xawhome" != "X" ; then
4407#xaw_dirs=$g4ui_xawhome
4408#fi
4409
4410if test "X$g4ui_xawhome" != "X" ; then
4411
4412g4message=`cat << EOM
4413
4414You have selected to use the XAW based user interfaces.
4415Specify the correct path where XAW is installed in your system.
4416It was found in $g4ui_xawhome. Press [Enter] to set this path or type the correct one.
4417
4418You can set '-' (without quotation) to CANCEL the XAW flag at all:
4419
4420EOM`
4421
4422dflt=$g4ui_xawhome
4423fn='d~(-)'
4424rp=$g4message
4425. ./getfile
4426
4427cend="no"
4428while test "$cend" = "no" ; do
4429if test -e "$ans/include/X11/Xaw" || [ "X$ans" = "X-"  ]; then
4430cend="yes"
4431if test "X$ans" != "X-" ; then
4432
4433g4ui_xawhome=$ans
4434
4435else
4436
4437g4ui_build_xaw_session=n
4438g4ui_use_xaw=n
4439
4440fi
4441else
4442
4443g4message=`cat << EOM
4444
4445You have selected to use XAW based user interfaces.
4446But XAW was not found in $ans.
4447Please specify the correct path where XAW is installed in your system.
4448
4449You can set '-' (without quotation) to CANCEL the XAW flag at all:
4450
4451EOM`
4452
4453dflt=""
4454fn='d~(-)'
4455rp=$g4message
4456. ./getfile
4457fi
4458done
4459
4460else
4461
4462g4message=`cat << EOM
4463
4464You have selected to use XAW based user interfaces.
4465But XAW was not found in expected place.
4466Please specify the correct path where XAW is installed in your system.
4467
4468You can set '-' (without quotation) to CANCEL the XAW flag at all:
4469
4470EOM`
4471
4472dflt=""
4473fn='d~(-)'
4474rp=$g4message
4475. ./getfile
4476
4477cend="no"
4478while test "$cend" = "no" ; do
4479if test -e "$ans/include/X11/Xaw" || [ "X$ans" = "X-"  ]; then
4480cend="yes"
4481if test "X$ans" != "X-" ; then
4482
4483g4ui_xawhome=$ans
4484
4485else
4486
4487g4ui_build_xaw_session=n
4488g4ui_use_xaw=n
4489
4490fi
4491else
4492
4493g4message=`cat << EOM
4494
4495You have selected to use XAW based user interfaces.
4496But XAW was not found in $ans.
4497Please specify the correct path where XAW is installed in your system.
4498
4499You can set '-' (without quotation) to CANCEL the XAW flag at all:
4500
4501EOM`
4502
4503dflt=""
4504fn='d~(-)'
4505rp=$g4message
4506. ./getfile
4507fi
4508done
4509fi
4510
4511if test "X$g4osname" = "XLinux"; then
4512
4513if test "X$g4ui_xawhome" = "X/usr" -o "X$g4ui_xawhome" = "X/usr/local" ; then
4514g4ui_xawhome=""
4515fi
4516fi
4517fi # g4vis_build_opheglxm_driver
4518
4519###############################################
4520# Set XMFLAGS and XMLIBS
4521#
4522
4523if test "X$g4ui_build_xaw_session" = "Xy" ; then
4524
4525if test "X$g4osname" = "XAIX" ; then
4526g4ui_xawflags=" -I$g4ui_xawhome/include "
4527g4ui_xawlibs=" -L$g4ui_xawhome/lib -lXaw -lXmu -lXt -lX11 -lXext "
4528fi
4529
4530if test "X$g4osname" = "XLinux" ; then
4531        if test "X$g4ui_xawhome" = "X" ; then
4532                g4ui_xawflags=""
4533        else
4534                g4ui_xawflags=" -I$g4ui_xawhome/include "
4535        fi
4536
4537        if test "X$g4ui_xawhome" = "X/usr/X11R6" -o "X$g4ui_xawhome" = "X" ; then
4538                g4ui_xawlibs=" -lXaw "
4539        else
4540                if test -d "$g4ui_xawhome/lib64" ; then
4541                        g4ui_xawlibs=" -L$g4ui_xawhome/lib64 -lXaw "
4542                else
4543                        g4ui_xawlibs=" -L$g4ui_xawhome/lib -lXaw "
4544                fi
4545        fi
4546fi
4547
4548if test "X$g4osname" = "XDarwin" ; then
4549g4ui_xawflags=" -I$g4ui_xawhome/include "
4550g4ui_xawlibs=" -L$g4ui_xawhome/lib -lXaw "
4551fi
4552
4553if test "X$g4osname" = "XDEC" ; then
4554g4ui_xawflags=" -I$g4ui_xawhome/include "
4555g4ui_xawlibs=" -L$g4ui_xawhome/lib -lXaw "
4556fi
4557
4558if test "X$g4osname" = "XHP" ; then
4559g4ui_xawflags=" -I$g4ui_xawhome/include "
4560g4ui_xawlibs=" -L$g4ui_xawhome/lib -lXaw "
4561fi
4562
4563if test "X$g4osname" = "XSGI" ; then
4564g4ui_xawflags=" -I$g4ui_xawhome/include "
4565g4ui_xawlibs=" -L$g4ui_xawhome/lib -lXaw "
4566fi
4567
4568if test "X$g4osname" = "XSUN" ; then
4569g4ui_xawflags=" -I$g4ui_xawhome/include "
4570g4ui_xawlibs=" -L$g4ui_xawhome/lib -L/usr/openwin/lib -L/usr/dt/lib -L/usr/ucblib -R/usr/openwin/lib -lXaw -lXmu -lXt -lX11 -lXext "
4571fi
4572
4573fi # end of XM build
4574
4575###############################################
4576###############################################
4577
4578g4message=`cat << EOM
4579
4580  G4UI_BUILD_XM_SESSION
4581  G4UI_USE_XM
4582
4583  Specifies to include and use the XM Motif based user interfaces.
4584  The XM Motif extensions are required to activate and build this
4585  driver.
4586
4587EOM`
4588
4589dflt=$g4ui_use_xm
4590rp=$g4message
4591. ./myread
4592gans=$ans
4593
4594        case $gans in
4595       
4596        n*|N*)
4597                g4ui_build_xm_session=n
4598                g4ui_use_xm=n
4599                ;;
4600        y*|Y*)
4601                g4ui_build_xm_session=y
4602                g4ui_use_xm=y
4603                ;;
4604        esac
4605
4606
4607############################################################
4608############################################################
4609
4610if test "X$g4ui_build_xm_session" = "Xy" ; then
4611
4612if test "X$g4vis_xmhome" = "X" ; then
4613xm_dirs=`find $g4vis_xmhome /usr/X11R6/include /usr/local/include /usr/include /sw/include -type d -name Xm 2>/dev/null |xargs echo`
4614#echo ogl_dirs=$ogl_dirs
4615
4616if test "X$xm_dirs" != "X" ; then
4617
4618g4xm_base_dir_found=`echo $xm_dirs|cut -d" " -f1`
4619#echo g4ogl_base_dir_found=$g4ogl_base_dir_found
4620
4621# That's right: should be twice! (e.g./usr/local/lib/libGLU.so -> /usr/local)
4622g4xm_base_dir_found=`dirname $g4xm_base_dir_found`
4623g4xm_base_dir_found=`dirname $g4xm_base_dir_found`
4624
4625        g4vis_xmhome=$g4xm_base_dir_found
4626#else
4627#case "$g4vis_xmhome" in
4628#'')
4629#       g4vis_xmhome=/usr/X11R6/
4630#       ;;
4631#esac
4632fi
4633fi
4634
4635##########################################################################
4636
4637#if test "X$g4vis_xmhome" != "X" ; then
4638#xm_dirs=$g4vis_xmhome
4639#fi
4640
4641if test "X$g4vis_xmhome" != "X" ; then
4642
4643g4message=`cat << EOM
4644
4645You have selected to use the XM Motif based user interfaces.
4646Specify the correct path where Xm is installed in your system.
4647It was found in $g4vis_xmhome. Press [Enter] to set this path or type the correct one.
4648
4649You can set '-' (without quotation) to CANCEL the XM flag at all:
4650
4651EOM`
4652
4653dflt=$g4vis_xmhome
4654fn='d~(-)'
4655rp=$g4message
4656. ./getfile
4657
4658cend="no"
4659while test "$cend" = "no" ; do
4660if test -e "$ans/include/Xm" || [ "X$ans" = "X-"  ]; then
4661cend="yes"
4662if test "X$ans" != "X-" ; then
4663
4664g4vis_xmhome=$ans
4665
4666else
4667
4668g4ui_build_xm_session=n
4669g4ui_use_xm=n
4670
4671fi
4672else
4673
4674g4message=`cat << EOM
4675
4676You have selected to use XM Motif based user interfaces.
4677But XM Motif was not found in $ans.
4678Please specify the correct path where Xm is installed in your system.
4679
4680You can set '-' (without quotation) to CANCEL the XM flag at all:
4681
4682EOM`
4683
4684dflt=""
4685fn='d~(-)'
4686rp=$g4message
4687. ./getfile
4688fi
4689done
4690
4691else
4692
4693g4message=`cat << EOM
4694
4695You have selected to use XM Motif based user interfaces.
4696But XM Motif was not found in expected place.
4697Please specify the correct path where Xm is installed in your system.
4698
4699You can set '-' (without quotation) to CANCEL the XM flag at all:
4700
4701EOM`
4702
4703dflt=""
4704fn='d~(-)'
4705rp=$g4message
4706. ./getfile
4707
4708cend="no"
4709while test "$cend" = "no" ; do
4710if test -e "$ans/include/Xm" || [ "X$ans" = "X-"  ]; then
4711cend="yes"
4712if test "X$ans" != "X-" ; then
4713
4714g4vis_xmhome=$ans
4715
4716else
4717
4718g4ui_build_xm_session=n
4719g4ui_use_xm=n
4720
4721fi
4722else
4723
4724g4message=`cat << EOM
4725
4726You have selected to use XM Motif based user interfaces.
4727But XM Motif was not found in $ans.
4728Please specify the correct path where Xm is installed in your system.
4729
4730You can set '-' (without quotation) to CANCEL the XM flag at all:
4731
4732EOM`
4733
4734dflt=""
4735fn='d~(-)'
4736rp=$g4message
4737. ./getfile
4738fi
4739done
4740fi
4741
4742if test "X$g4osname" = "XLinux"; then
4743        if test "X$g4vis_xmhome" = "X/usr" -o "X$g4vis_xmhome" = "X/usr/local" ; then
4744                g4vis_xmhome=""
4745        fi
4746fi
4747fi # g4vis_build_opheglxm_driver
4748
4749###############################################
4750# Set XMFLAGS and XMLIBS
4751#
4752
4753if test "X$g4ui_build_xm_session" = "Xy" ; then
4754
4755if test "X$g4osname" = "XAIX" ; then
4756g4vis_xmflags=" -I$g4vis_xmhome/include "
4757g4vis_xmlibs=" -L$g4vis_xmhome/lib -lXm -lXt -lX11 "
4758fi
4759
4760if test "X$g4osname" = "XLinux" ; then
4761        if test "X$g4vis_xmhome" = "X" ; then
4762                g4vis_xmflags=""
4763        else
4764                g4vis_xmflags=" -I$g4vis_xmhome/include "
4765        fi
4766
4767        if test "X$g4vis_xmhome" = "X/usr/X11R6" -o "X$g4vis_xmhome" = "X" ; then
4768                g4vis_xmlibs=" -lXm -lXpm "
4769        else
4770                if test -d "$g4vis_xmhome/lib64" ; then
4771                        g4vis_xmlibs=" -L$g4vis_xmhome/lib64 -lXm -lXpm "
4772                else
4773                        g4vis_xmlibs=" -L$g4vis_xmhome/lib -lXm -lXpm "
4774                fi
4775        fi
4776fi
4777
4778if test "X$g4osname" = "XDarwin" ; then
4779g4vis_xmflags=" -I$g4vis_xmhome/include "
4780g4vis_xmlibs=" -L$g4vis_xmhome/lib -lXm -lXpm "
4781fi
4782
4783if test "X$g4osname" = "XDEC" ; then
4784g4vis_xmflags=" -I$g4vis_xmhome/include "
4785g4vis_xmlibs=" -L$g4vis_xmhome/lib -lXm "
4786fi
4787
4788if test "X$g4osname" = "XHP" ; then
4789g4vis_xmflags=" -I$g4vis_xmhome/include/Motif1.2 "
4790g4vis_xmlibs=" -L$g4vis_xmhome/lib/Motif1.2 -lXm "
4791fi
4792
4793if test "X$g4osname" = "XSGI" ; then
4794g4vis_xmflags=" -I$g4vis_xmhome/include "
4795g4vis_xmlibs=" -L$g4vis_xmhome/lib -lXm "
4796fi
4797
4798if test "X$g4osname" = "XSUN" ; then
4799g4vis_xmflags=" -I$g4vis_xmhome/include "
4800g4vis_xmlibs=" -L$g4vis_xmhome/lib -L/usr/openwin/lib -L/usr/dt/lib -L/usr/ucblib -R/usr/openwin/lib -lXt -lXm -lX11 "
4801fi
4802
4803fi # end of XM build
4804
4805###############################################
4806###############################################
4807
4808fi # if !WIN
4809
4810if test "X$g4system" = "XWIN32-VC" -o "X$g4system" = "XWIN32-VC7"; then
4811
4812g4message=`cat << EOM
4813
4814  G4UI_BUILD_WIN32_SESSION
4815  G4UI_USE_WIN32
4816
4817  Specifies to include and use the terminal interface for
4818  Windows systems.
4819
4820EOM`
4821
4822dflt=$g4ui_use_win32
4823rp=$g4message
4824. ./myread
4825gans=$ans
4826
4827        case $gans in
4828       
4829        n*|N*)
4830                g4ui_build_win32_session=n
4831                g4ui_use_win32=n
4832                ;;
4833        y*|Y*)
4834                g4ui_build_win32_session=y
4835                g4ui_use_win32=y
4836                ;;
4837        esac
4838
4839fi # if WIN
4840
4841g4message=`cat << EOM
4842
4843  G4UI_USE_TCSH
4844  Specifies to use the tcsh-style terminal in the application
4845  to be built.
4846EOM`
4847
4848dflt=$g4ui_use_tcsh
4849rp=$g4message
4850#. ./myread
4851#gans=$ans
4852gans=y
4853
4854        case $gans in
4855       
4856        n*|N*)
4857                g4ui_use_tcsh=n
4858                ;;
4859        y*|Y*)
4860                g4ui_use_tcsh=y
4861                ;;
4862        esac
4863
4864;;
4865esac
4866
4867#
4868# BEGIN QT/QTUI PROBE
4869#
4870
4871# Checks applied for all systems ONLY IF g4ui_none HAS NOT BEEN SET TO y
4872if test "x$g4ui_none" = "xn" ; then
4873    # Query the user to see if build of Qt UI module is needed
4874    g4message=`cat <<EOM
4875
4876    G4UI_BUILD_QT_SESSION
4877    G4UI_USE_QT
4878
4879Setting these variables will enable the building of the G4 Qt based
4880user interface module and the use of this module in your applications
4881respectively.
4882The Qt3 or Qt4 headers, libraries and moc application are required to enable
4883the building of this module.
4884Do you want to enable build and use of this module?
4885EOM`
4886
4887    # Read in the user response
4888    dflt=$g4ui_build_qt_session
4889    rp=$g4message
4890    . ./myread
4891    gans=$ans
4892
4893    # Check response and take set variables as needed.
4894    case $gans in
4895        n*|N*)
4896            g4ui_build_qt_session=n
4897            g4ui_use_qt=n
4898            ;;
4899        y*|Y*)
4900            g4ui_build_qt_session=y
4901            g4ui_use_qt=y
4902            ;;
4903    esac
4904
4905    ##########
4906
4907    ##########
4908    # Now, if user chose to build module, we need to check for a Qt
4909    # installation
4910    #
4911    if test "x$g4ui_build_qt_session" = "xy" ; then
4912        echo " "
4913        # NB Have to supply arg to qt script, just blank in this case!
4914        qt_search_dir=""
4915        . ./qt
4916
4917        # If we didn't find Qt automatically, then ask user if they know
4918        # where it's installed...
4919        if test "x$g4_havegoodqt" = "xno" ; then
4920            promptend="no"
4921            user_qthome="the standard locations"
4922
4923            while test "x$promptend" = "xno" ; do
4924                g4message=`cat << EOM
4925
4926Autodetection failed to locate Qt3 or Qt4 in $qthomeloc on your system.
4927Please enter the path to your Qt3 OR Qt4 install (i.e. if Qt4 is installed
4928in PATH/include/QT, PATH/include or PATH/include/qt4, enter PATH),
4929or type '-' to CANCEL the build of the Qt UI module.
4930Qt path:
4931EOM`
4932                dflt=""
4933                fn='d~(-)'
4934                rp=$g4message
4935                . ./getfile
4936                user_qthome=$ans
4937
4938                if test "x$user_qthome" = "x-" ; then
4939                    # Cancel build...
4940                    g4ui_build_qt_session=n
4941                    g4ui_use_qt=n
4942                    echo "configure: build/use of Qt UI module cancelled"
4943                    promptend=yes
4944                else
4945                    # Check for installation in user directory
4946                    echo " "
4947                    qt_search_dir=$user_qthome
4948                    . ./qt
4949
4950                    if test "x$g4_havegoodqt" = "xyes" ; then
4951                        promptend=yes
4952                    fi
4953                fi #END TEST user_qthome = -
4954            done #END while promptend=no (for user input of Qt install)
4955        fi #END TEST g4_havegoodqt = no (for user prompt)
4956    fi #END TEST g4ui_build_qt_session (whether to build at all)
4957fi #END TEST g4ui_none = n
4958
4959echo " "
4960case "$g4vis_none" in
4961'')
4962        g4vis_none=n
4963        ;;
4964esac
4965
4966
4967case "$g4vis_build_openglwin32_driver" in
4968'')
4969        g4vis_build_openglwin32_driver=n
4970        ;;
4971esac
4972
4973case "$g4vis_use_openglwin32" in
4974'')
4975        g4vis_use_openglwin32=n
4976        ;;
4977esac
4978
4979case "$g4vis_build_oiwin32_driver" in
4980'')
4981        g4vis_build_oiwin32_driver=n
4982        ;;
4983esac
4984
4985case "$g4vis_use_oiwin32" in
4986'')
4987        g4vis_use_oiwin32=n
4988        ;;
4989esac
4990
4991case "$g4vis_build_dawn_driver" in
4992'')
4993        g4vis_build_dawn_driver=n
4994        ;;
4995esac
4996
4997case "$g4vis_use_dawn" in
4998'')
4999        g4vis_use_dawn=n
5000        ;;
5001esac
5002
5003# Set by default!
5004case "$g4vis_build_dawnfile_driver" in
5005'')
5006        g4vis_build_dawnfile_driver=y
5007        ;;
5008esac
5009
5010# Set by default!
5011case "$g4vis_use_dawnfile" in
5012'')
5013        g4vis_use_dawnfile=y
5014        ;;
5015esac
5016
5017case "$g4vis_build_openglx_driver" in
5018'')
5019        g4vis_build_openglx_driver=n
5020        ;;
5021esac
5022
5023case "$g4vis_use_openglx" in
5024'')
5025        g4vis_use_openglx=n
5026        ;;
5027esac
5028
5029case "$g4vis_build_openglxm_driver" in
5030'')
5031        g4vis_build_openglxm_driver=n
5032        ;;
5033esac
5034
5035case "$g4vis_use_openglxm" in
5036'')
5037        g4vis_use_openglxm=n
5038        ;;
5039esac
5040
5041case "$g4vis_build_oix_driver" in
5042'')
5043        g4vis_build_oix_driver=n
5044        ;;
5045esac
5046
5047case "$g4vis_use_oix" in
5048'')
5049        g4vis_use_oix=n
5050        ;;
5051esac
5052
5053case "$g4vis_build_raytracerx_driver" in
5054'')
5055        g4vis_build_raytracerx_driver=n
5056        ;;
5057esac
5058
5059case "$g4vis_use_raytracerx" in
5060'')
5061        g4vis_use_raytracerx=n
5062        ;;
5063esac
5064
5065# Set by default!
5066case "$g4vis_build_raytracer_driver" in
5067'')
5068        g4vis_build_raytracer_driver=y
5069        ;;
5070esac
5071
5072# Set by default!
5073case "$g4vis_use_raytracer" in
5074'')
5075        g4vis_use_raytracer=y
5076        ;;
5077esac
5078
5079case "$g4vis_build_vrml_driver" in
5080'')
5081        g4vis_build_vrml_driver=n
5082        ;;
5083esac
5084
5085case "$g4vis_use_vrml" in
5086'')
5087        g4vis_use_vrml=n
5088        ;;
5089esac
5090
5091# Set by default!
5092case "$g4vis_build_asciitree_driver" in
5093'')
5094        g4vis_build_asciitree_driver=y
5095        ;;
5096esac
5097
5098# Set by default!
5099case "$g4vis_use_asciitree" in
5100'')
5101        g4vis_use_asciitree=y
5102        ;;
5103esac
5104
5105# Set by default!
5106case "$g4vis_build_gagtree_driver" in
5107'')
5108        g4vis_build_gagtree_driver=y
5109        ;;
5110esac
5111
5112# Set by default!
5113case "$g4vis_use_gagtree" in
5114'')
5115        g4vis_use_gagtree=y
5116        ;;
5117esac
5118
5119echo ""
5120
5121g4message=`cat << EOM
5122
5123  G4VIS_NONE
5124
5125If this variable is set, no visualization drivers will be built or used.
5126Do you want to set this variable ?
5127
5128EOM`
5129
5130dflt=$g4vis_none
5131rp=$g4message
5132. ./myread
5133gans=$ans
5134
5135        case $gans in
5136       
5137        n*|N*)
5138                g4vis_none=n
5139                ;;
5140        y*|Y*)
5141                g4vis_none=y
5142                ;;
5143        esac
5144
5145case $g4vis_none in
5146
5147n)
5148
5149if test "X$g4system" != "XWIN32-VC" -a "X$g4system" != "XWIN32-VC7"; then
5150
5151g4message=`cat << EOM
5152
5153  G4VIS_BUILD_OPENGLX_DRIVER
5154  G4VIS_USE_OPENGLX
5155
5156It is an interface to the de facto standard 3D graphics library,
5157OpenGL. It is well suited for real-time fast visualization
5158and prototyping. The X11 version of the OpenGL libraries is
5159required.
5160EOM`
5161
5162dflt=$g4vis_use_openglx
5163rp=$g4message
5164. ./myread
5165gans=$ans
5166
5167        case $gans in
5168       
5169        n*|N*)
5170                g4vis_build_openglx_driver=n
5171                g4vis_use_openglx=n
5172                ;;
5173        y*|Y*)
5174                g4vis_build_openglx_driver=y
5175                g4vis_use_openglx=y
5176                ;;
5177        esac
5178
5179#############################################3
5180g4message=`cat << EOM
5181
5182  G4VIS_BUILD_OPENGLXM_DRIVER
5183  G4VIS_USE_OPENGLXM
5184
5185It is an interface to the de facto standard 3D graphics library,
5186OpenGL. It is well suited for real-time fast visualization
5187and prototyping. The X11 version of the OpenGL libraries and
5188the Motif Xm extension is required.
5189
5190EOM`
5191
5192dflt=$g4vis_use_openglxm
5193rp=$g4message
5194. ./myread
5195gans=$ans
5196
5197        case $gans in
5198       
5199        n*|N*)
5200                g4vis_build_openglxm_driver=n
5201                g4vis_use_openglxm=n
5202                ;;
5203        y*|Y*)
5204                g4vis_build_openglxm_driver=y
5205                g4vis_use_openglxm=y
5206                ;;
5207        esac
5208
5209############################################################
5210#echo xm_dirs=$xm_dirs
5211#echo g4vis_xmhome=$g4vis_xmhome
5212#echo g4ui_build_xm_session=$g4ui_build_xm_session
5213#echo g4vis_build_openglxm_driver=$g4vis_build_openglxm_driver
5214
5215if test "X$g4ui_build_xm_session" = "Xn" ; then
5216
5217#echo PASS1
5218
5219if test "X$g4vis_build_openglxm_driver" = "Xy" ; then
5220
5221#echo PASS2
5222
5223if test "X$g4vis_xmhome" = "X" ; then
5224xm_dirs=`find $g4vis_xmhome /usr/X11R6/include /usr/local/include /usr/include /sw/include -type d -name Xm 2>/dev/null |xargs echo`
5225#echo ogl_dirs=$ogl_dirs
5226
5227if test "X$xm_dirs" != "X" ; then
5228
5229g4xm_base_dir_found=`echo $xm_dirs|cut -d" " -f1`
5230#echo g4ogl_base_dir_found=$g4ogl_base_dir_found
5231
5232# That's right: should be twice! (e.g./usr/local/lib/libGLU.so -> /usr/local)
5233g4xm_base_dir_found=`dirname $g4xm_base_dir_found`
5234g4xm_base_dir_found=`dirname $g4xm_base_dir_found`
5235
5236        g4vis_xmhome=$g4xm_base_dir_found
5237#else
5238#case "$g4vis_xmhome" in
5239#'')
5240#       g4vis_xmhome=/usr/X11R6/
5241#       ;;
5242#esac
5243fi
5244fi
5245
5246##########################################################################
5247
5248#if test "X$g4vis_xmhome" != "X" ; then
5249#xm_dirs=$g4vis_xmhome
5250#fi
5251
5252if test "X$g4vis_xmhome" != "X" ; then
5253
5254g4message=`cat << EOM
5255
5256You have selected to use OPENGLXM driver.
5257Specify the correct path where Xm is installed in your system.
5258It was found in $g4vis_xmhome. Press [Enter] to set this path or type the correct one.
5259
5260You can set '-' (without quotation) to CANCEL the XM flag at all:
5261
5262EOM`
5263
5264dflt=$g4vis_xmhome
5265fn='d~(-)'
5266rp=$g4message
5267. ./getfile
5268
5269cend="no"
5270while test "$cend" = "no" ; do
5271if test -e "$ans/include/Xm" || [ "X$ans" = "X-"  ]; then
5272cend="yes"
5273if test "X$ans" != "X-" ; then
5274
5275g4vis_xmhome=$ans
5276
5277else
5278
5279g4vis_build_openglxm_driver=n
5280g4vis_use_openglxm=n
5281
5282fi
5283else
5284
5285g4message=`cat << EOM
5286
5287You have selected to use OPENGLXM driver.
5288But it was not found in $ans.
5289Please specify the correct path where Xm is installed in your system.
5290
5291You can set '-' (without quotation) to CANCEL the XM flag at all:
5292
5293EOM`
5294
5295dflt=""
5296fn='d~(-)'
5297rp=$g4message
5298. ./getfile
5299fi
5300done
5301
5302else
5303
5304g4message=`cat << EOM
5305
5306You have selected to use OPENGLXM driver.
5307But it was not found in expected place.
5308Please specify the correct path where Xm is installed in your system.
5309
5310You can set '-' (without quotation) to CANCEL the XM flag at all:
5311
5312EOM`
5313
5314dflt=""
5315fn='d~(-)'
5316rp=$g4message
5317. ./getfile
5318
5319cend="no"
5320while test "$cend" = "no" ; do
5321if test -e "$ans/include/Xm" || [ "X$ans" = "X-"  ]; then
5322cend="yes"
5323if test "X$ans" != "X-" ; then
5324
5325g4vis_xmhome=$ans
5326
5327else
5328
5329g4vis_build_openglxm_driver=n
5330g4vis_use_openglxm=n
5331
5332fi
5333else
5334
5335g4message=`cat << EOM
5336
5337You have selected to use OPENGLXM driver.
5338But it was not found in $ans.
5339Please specify the correct path where Xm is installed in your system.
5340
5341You can set '-' (without quotation) to CANCEL the XM flag at all:
5342
5343EOM`
5344
5345dflt=""
5346fn='d~(-)'
5347rp=$g4message
5348. ./getfile
5349fi
5350done
5351fi
5352
5353if test "X$g4osname" = "XLinux"; then
5354
5355if test "X$g4vis_xmhome" = "X/usr" -o "X$g4vis_xmhome" = "X/usr/local" ; then
5356g4vis_xmhome=""
5357fi
5358fi
5359fi # g4vis_build_opheglxm_driver
5360
5361###############################################
5362# Set XMFLAGS and XMLIBS
5363#
5364
5365if test "X$g4vis_build_openglxm_driver" = "Xy" ; then
5366
5367if test "X$g4osname" = "XAIX" ; then
5368g4vis_xmflags=" -I$g4vis_xmhome/include "
5369g4vis_xmlibs=" -L$g4vis_xmhome/lib -lXm -lXt -lX11 "
5370fi
5371
5372if test "X$g4osname" = "XLinux" ; then
5373        if test "X$g4vis_xmhome" = "X" ; then
5374                g4vis_xmflags=""
5375        else
5376                g4vis_xmflags=" -I$g4vis_xmhome/include "
5377        fi
5378
5379        if test "X$g4vis_xmhome" = "X/usr/X11R6" -o "X$g4vis_xmhome" = "X" ; then
5380                g4vis_xmlibs=" -lXm -lXpm "
5381        else
5382                if test -d "$g4vis_xmhome/lib64" ; then
5383                        g4vis_xmlibs=" -L$g4vis_xmhome/lib64 -lXm -lXpm "
5384                else
5385                        g4vis_xmlibs=" -L$g4vis_xmhome/lib -lXm -lXpm "
5386                fi
5387        fi
5388fi
5389
5390if test "X$g4osname" = "XDarwin" ; then
5391g4vis_xmflags=" -I$g4vis_xmhome/include "
5392g4vis_xmlibs=" -L$g4vis_xmhome/lib -lXm -lXpm "
5393fi
5394
5395if test "X$g4osname" = "XDEC" ; then
5396g4vis_xmflags=" -I$g4vis_xmhome/include "
5397g4vis_xmlibs=" -L$g4vis_xmhome/lib -lXm "
5398fi
5399
5400if test "X$g4osname" = "XHP" ; then
5401g4vis_xmflags=" -I$g4vis_xmhome/include/Motif1.2 "
5402g4vis_xmlibs=" -L$g4vis_xmhome/lib/Motif1.2 -lXm "
5403fi
5404
5405if test "X$g4osname" = "XSGI" ; then
5406g4vis_xmflags=" -I$g4vis_xmhome/include "
5407g4vis_xmlibs=" -L$g4vis_xmhome/lib -lXm "
5408fi
5409
5410if test "X$g4osname" = "XSUN" ; then
5411g4vis_xmflags=" -I$g4vis_xmhome/include "
5412g4vis_xmlibs=" -L$g4vis_xmhome/lib -L/usr/openwin/lib -L/usr/dt/lib -L/usr/ucblib -R/usr/openwin/lib -lXt -lXm -lX11 "
5413fi
5414
5415fi # end of XM build
5416fi
5417###############################################
5418
5419fi # if !WIN
5420
5421######################################################################
5422if test "X$g4system" = "XWIN32-VC" -o "X$g4system" = "XWIN32-VC7"; then
5423
5424g4message=`cat << EOM
5425
5426  G4VIS_BUILD_OPENGLWIN32_DRIVER
5427  G4VIS_USE_OPENGLWIN32
5428
5429It is an interface to the de facto standard 3D graphics library,
5430OpenGL. It is well suited for real-time fast visualization
5431and prototyping. The Windows version of the OpenGL libraries is
5432required.
5433
5434EOM`
5435
5436dflt=$g4vis_use_openglwin32
5437rp=$g4message
5438. ./myread
5439gans=$ans
5440
5441        case $gans in
5442       
5443        n*|N*)
5444                g4vis_build_openglwin32_driver=n
5445                g4vis_use_openglwin32=n
5446                ;;
5447        y*|Y*)
5448                g4vis_build_openglwin32_driver=y
5449                g4vis_use_openglwin32=y
5450                ;;
5451        esac
5452
5453fi # if WIN
5454###########################################
5455
5456if test "X$g4system" != "XWIN32-VC" -a "X$g4system" != "XWIN32-VC7"; then
5457
5458g4message=`cat << EOM
5459
5460  G4VIS_BUILD_DAWN_DRIVER
5461  G4VIS_USE_DAWN
5462
5463DAWN drivers are interfaces to the Fukui Renderer DAWN. DAWN is
5464a vectorized 3D PostScript processor suited to prepare technical
5465high quality outputs for presentation and/or documentation.
5466
5467EOM`
5468
5469dflt=$g4vis_use_dawn
5470rp=$g4message
5471. ./myread
5472gans=$ans
5473
5474        case $gans in
5475       
5476        n*|N*)
5477                g4vis_build_dawn_driver=n
5478                g4vis_use_dawn=n
5479                ;;
5480        y*|Y*)
5481                g4vis_build_dawn_driver=y
5482                g4vis_use_dawn=y
5483                ;;
5484        esac
5485
5486
5487#######################################
5488g4message=`cat << EOM
5489
5490  G4VIS_BUILD_OIX_DRIVER
5491  G4VIS_USE_OIX
5492
5493The OpenInventor driver is based on OpenInventor technology
5494for scientific visualization.
5495The X11 version of OpenInventor is required.
5496
5497EOM`
5498
5499dflt=$g4vis_use_oix
5500rp=$g4message
5501. ./myread
5502gans=$ans
5503
5504        case $gans in
5505       
5506        n*|N*)
5507                g4vis_build_oix_driver=n
5508                g4vis_use_oix=n
5509                ;;
5510        y*|Y*)
5511                g4vis_build_oix_driver=y
5512                g4vis_use_oix=y
5513                ;;
5514        esac
5515
5516############################################################
5517if test "X$g4vis_build_oix_driver" = "Xy" ; then
5518
5519oiv_dirs=`find $g4vis_oivhome /usr/X11R6/include /usr/local/include /usr/include  -type d -name Inventor 2>/dev/null|xargs echo`
5520#echo ogl_dirs=$ogl_dirs
5521
5522if test "X$oiv_dirs" != "X" ; then
5523
5524g4oiv_base_dir_found=`echo $oiv_dirs|cut -d" " -f1`
5525#echo g4ogl_base_dir_found=$g4ogl_base_dir_found
5526
5527# That's right: should be twice! (e.g./usr/local/lib/libGLU.so -> /usr/local)
5528g4oiv_base_dir_found=`dirname $g4oiv_base_dir_found`
5529g4oiv_base_dir_found=`dirname $g4oiv_base_dir_found`
5530
5531        g4vis_oivhome=$g4oiv_base_dir_found
5532#else
5533#case "$g4vis_oivhome" in
5534#'')
5535#       g4vis_oivhome=/usr
5536#       ;;
5537#esac
5538fi
5539
5540##########################################################################
5541
5542#if test "X$g4vis_oivhome" != "X" ; then
5543#oiv_dirs=$g4vis_oivhome
5544#fi
5545
5546if test "X$g4vis_oivhome" != "X" ; then
5547
5548g4message=`cat << EOM
5549
5550  OIVHOME/include
5551  OIVHOME/lib
5552
5553You have selected to use OpenInventor driver.
5554Specify the correct path (OIVHOME) where OpenInventor is installed in your system.
5555It was found in $g4vis_oivhome. Press [Enter] to set this path or type the correct one.
5556
5557You can set '-' (without quotation) to CANCEL the OpenInventor flag at all:
5558
5559EOM`
5560
5561dflt=$g4vis_oivhome
5562fn='d~(-)'
5563rp=$g4message
5564. ./getfile
5565
5566cend="no"
5567while test "$cend" = "no" ; do
5568if test -e "$ans/include/Inventor" || [ "X$ans" = "X-"  ]; then
5569cend="yes"
5570if test "X$ans" != "X-" ; then
5571
5572g4vis_oivhome=$ans
5573
5574else
5575
5576g4vis_build_oix_driver=n
5577g4vis_use_oix=n
5578
5579fi
5580else
5581
5582g4message=`cat << EOM
5583
5584  OIVHOME/include
5585  OIVHOME/lib
5586
5587You have selected to use OpenInventor driver.
5588But it was not found in $ans.
5589Please specify the correct path where OpenInventor is installed in your system.
5590
5591You can set '-' (without quotation) to CANCEL the OpenInventor flag at all:
5592
5593EOM`
5594
5595dflt=""
5596fn='d~(-)'
5597rp=$g4message
5598. ./getfile
5599fi
5600done
5601
5602else
5603
5604g4message=`cat << EOM
5605
5606  OIVHOME/include
5607  OIVHOME/lib
5608
5609You have selected to use OpenInventor driver.
5610But it was not found in expected place.
5611Please specify the correct path where OpenInventor is installed in your system.
5612
5613You can set '-' (without quotation) to CANCEL the OpenInventor flag at all:
5614
5615EOM`
5616
5617dflt=""
5618fn='d~(-)'
5619rp=$g4message
5620. ./getfile
5621
5622cend="no"
5623while test "$cend" = "no" ; do
5624if test -e "$ans/include/Inventor" || [ "X$ans" = "X-"  ]; then
5625cend="yes"
5626if test "X$ans" != "X-" ; then
5627
5628g4vis_oivhome=$ans
5629
5630else
5631
5632g4vis_build_oix_driver=n
5633g4vis_use_oix=n
5634
5635fi
5636else
5637
5638g4message=`cat << EOM
5639
5640  OIVHOME/include
5641  OIVHOME/lib
5642
5643You have selected to use OpenInventor driver.
5644But it was not found in $ans.
5645Please specify the correct path where OpenInventor is installed in your system.
5646
5647You can set '-' (without quotation) to CANCEL the OpenInventor flag at all:
5648
5649EOM`
5650
5651dflt=""
5652fn='d~(-)'
5653rp=$g4message
5654. ./getfile
5655fi
5656done
5657fi
5658
5659if test "X$g4osname" = "XLinux"; then
5660
5661if test "X$g4vis_oivhome" = "X/usr" -o "X$g4vis_oivhome" = "X/usr/local"; then
5662g4vis_oivhome=""
5663fi
5664fi
5665fi # g4vis_build_oix_driver
5666
5667###############################################
5668
5669g4message=`cat << EOM
5670
5671  G4VIS_BUILD_RAYTRACERX_DRIVER
5672  G4VIS_USE_RAYTRACERX
5673
5674Allows for interactive ray-tracing graphics through X11.
5675The X11 package is required.
5676
5677EOM`
5678
5679dflt=$g4vis_use_raytracerx
5680rp=$g4message
5681. ./myread
5682gans=$ans
5683
5684        case $gans in
5685       
5686        n*|N*)
5687                g4vis_build_raytracerx_driver=n
5688                g4vis_use_raytracerx=n
5689                ;;
5690        y*|Y*)
5691                g4vis_build_raytracerx_driver=y
5692                g4vis_use_raytracerx=y
5693                ;;
5694        esac
5695
5696########################################################
5697fi # if !WIN
5698
5699###############################################################
5700if test "X$g4system" = "XWIN32-VC" -o "X$g4system" = "XWIN32-VC7"; then
5701
5702g4message=`cat << EOM
5703
5704  G4VIS_BUILD_OIWIN32_DRIVER
5705  G4VIS_USE_OIWIN32
5706
5707Specifies to build and use the driver for the free X11 version of
5708OpenInventor on Windows systems.
5709The Windows version of OpenInventor is required.
5710
5711EOM`
5712
5713dflt=$g4vis_use_oiwin32
5714rp=$g4message
5715. ./myread
5716gans=$ans
5717
5718        case $gans in
5719       
5720        n*|N*)
5721                g4vis_build_oiwin32_driver=n
5722                g4vis_use_oiwin32=n
5723                ;;
5724        y*|Y*)
5725                g4vis_build_oiwin32_driver=y
5726                g4vis_use_oiwin32=y
5727                ;;
5728        esac
5729
5730############################################################
5731if test "X$g4vis_build_oiwin32_driver" = "Xy" ; then
5732
5733oiv_dirs=`find $g4vis_oivhome /usr/X11R6/include /usr/local/include /usr/include  -type d -name Inventor 2>/dev/null|xargs echo`
5734#echo ogl_dirs=$ogl_dirs
5735
5736if test "X$oiv_dirs" != "X" ; then
5737
5738g4oiv_base_dir_found=`echo $oiv_dirs|cut -d" " -f1`
5739#echo g4ogl_base_dir_found=$g4ogl_base_dir_found
5740
5741# That's right: should be twice! (e.g./usr/local/lib/libGLU.so -> /usr/local)
5742g4oiv_base_dir_found=`dirname $g4oiv_base_dir_found`
5743g4oiv_base_dir_found=`dirname $g4oiv_base_dir_found`
5744
5745        g4vis_oivhome=$g4oiv_base_dir_found
5746#else
5747#case "$g4vis_oivhome" in
5748#'')
5749#       g4vis_oivhome=/usr
5750#       ;;
5751#esac
5752fi
5753
5754##########################################################################
5755
5756#if test "X$g4vis_oivhome" != "X" ; then
5757#oiv_dirs=$g4vis_oivhome
5758#fi
5759
5760if test "X$g4vis_oivhome" != "X" ; then
5761
5762g4message=`cat << EOM
5763
5764  OIVHOME/include
5765  OIVHOME/lib
5766
5767You have selected to use OpenInventor driver.
5768Specify the correct path (OIVHOME) where OpenInventor is installed in your system.
5769It was found in $g4vis_oivhome. Press [Enter] to set this path or type the correct one.
5770
5771You can set '-' (without quotation) to CANCEL the OpenInventor flag at all:
5772
5773EOM`
5774
5775dflt=$g4vis_oivhome
5776fn='d~(-)'
5777rp=$g4message
5778. ./getfile
5779
5780cend="no"
5781while test "$cend" = "no" ; do
5782if test -e "$ans/include/Inventor" || [ "X$ans" = "X-"  ]; then
5783cend="yes"
5784if test "X$ans" != "X-" ; then
5785
5786g4vis_oivhome=$ans
5787
5788else
5789
5790g4vis_build_oiwin32_driver=n
5791g4vis_use_oiwin32=n
5792
5793fi
5794else
5795
5796g4message=`cat << EOM
5797
5798  OIVHOME/include
5799  OIVHOME/lib
5800
5801You have selected to use OpenInventor driver.
5802But it was not found in $ans.
5803Please specify the correct path where OpenInventor is installed in your system.
5804
5805You can set '-' (without quotation) to CANCEL the OpenInventor flag at all:
5806
5807EOM`
5808
5809dflt=""
5810fn='d~(-)'
5811rp=$g4message
5812. ./getfile
5813fi
5814done
5815
5816else
5817
5818g4message=`cat << EOM
5819
5820  OIVHOME/include
5821  OIVHOME/lib
5822
5823You have selected to use OpenInventor driver.
5824But it was not found in expected place.
5825Please specify the correct path where OpenInventor is installed in your system.
5826
5827You can set '-' (without quotation) to CANCEL the OpenInventor flag at all:
5828
5829EOM`
5830
5831dflt=""
5832fn='d~(-)'
5833rp=$g4message
5834. ./getfile
5835
5836cend="no"
5837while test "$cend" = "no" ; do
5838if test -e "$ans/include/Inventor" || [ "X$ans" = "X-"  ]; then
5839cend="yes"
5840if test "X$ans" != "X-" ; then
5841
5842g4vis_oivhome=$ans
5843
5844else
5845
5846g4vis_build_oiwin32_driver=n
5847g4vis_use_oiwin32=n
5848
5849fi
5850else
5851
5852g4message=`cat << EOM
5853
5854  OIVHOME/include
5855  OIVHOME/lib
5856
5857You have selected to use OpenInventor driver.
5858But it was not found in $ans.
5859Please specify the correct path where OpenInventor is installed in your system.
5860
5861You can set '-' (without quotation) to CANCEL the OpenInventor flag at all:
5862
5863EOM`
5864
5865dflt=""
5866fn='d~(-)'
5867rp=$g4message
5868. ./getfile
5869fi
5870done
5871fi
5872
5873if test "X$g4osname" = "XLinux"; then
5874
5875if test "X$g4vis_oivhome" = "X/usr" -o "X$g4vis_oivhome" = "X/usr/local"; then
5876g4vis_oivhome=""
5877fi
5878fi
5879fi # g4vis_build_oiwin32_driver
5880
5881###############################################
5882
5883fi # if WIN
5884################################################################
5885
5886if test "X$g4system" != "XWIN32-VC" -a "X$g4system" != "XWIN32-VC7"; then
5887
5888g4message=`cat << EOM
5889
5890  G4VIS_BUILD_DAWNFILE_DRIVER
5891  G4VIS_USE_DAWNFILE
5892
5893DAWN drivers are interfaces to Fukui Renderer DAWN. It is a vectorized 3D
5894PostScript processor, and so well suited to prepare technical high
5895quality outputs for presentation and/or documentation.
5896The DAWNFILE driver sends 3D data to DAWN via an intermediate file,
5897named g4.prim in the current directory. The file g4.prim is able to
5898be re-visualized later without the help of Geant4.
5899EOM`
5900
5901dflt=$g4vis_use_dawnfile
5902rp=$g4message
5903#. ./myread
5904#gans=$ans
5905gans=y
5906
5907        case $gans in
5908       
5909        n*|N*)
5910                g4vis_build_dawnfile_driver=n
5911                g4vis_use_dawnfile=n
5912                ;;
5913        y*|Y*)
5914                g4vis_build_dawnfile_driver=y
5915                g4vis_use_dawnfile=y
5916                ;;
5917        esac
5918
5919g4message=`cat << EOM
5920
5921  G4VIS_BUILD_RAYTRACER_DRIVER
5922  G4VIS_USE_RAYTRACER
5923
5924It performs ray-tracing visualization using the tracking routines of Geant4.
5925It is, therefore, available for debugging tracking routines.
5926It is well suited for photo-realistic high quality output for
5927presentation, and for intuitive debugging of detector geometry.
5928EOM`
5929
5930dflt=$g4vis_use_raytracer
5931rp=$g4message
5932#. ./myread
5933#gans=$ans
5934gans=y
5935
5936        case $gans in
5937       
5938        n*|N*)
5939                g4vis_build_raytracer_driver=n
5940                g4vis_use_raytracer=n
5941                ;;
5942        y*|Y*)
5943                g4vis_build_raytracer_driver=y
5944                g4vis_use_raytracer=y
5945                ;;
5946        esac
5947
5948g4message=`cat << EOM
5949
5950  G4VIS_BUILD_VRML_DRIVER
5951  G4VIS_USE_VRML
5952
5953These driver generate VRML files, which describe 3D scenes to be
5954visualized with a proper VRML viewer.
5955
5956EOM`
5957
5958dflt=$g4vis_use_vrml
5959rp=$g4message
5960. ./myread
5961gans=$ans
5962
5963        case $gans in
5964       
5965        n*|N*)
5966                g4vis_build_vrml_driver=n
5967                g4vis_use_vrml=n
5968                ;;
5969        y*|Y*)
5970                g4vis_build_vrml_driver=y
5971                g4vis_use_vrml=y
5972                ;;
5973        esac
5974
5975g4message=`cat << EOM
5976
5977  G4VIS_BUILD_VRMLFILE_DRIVER
5978  G4VIS_USE_VRMLFILE
5979
5980This driver generates VRML files, which describe 3D scenes to be
5981visualized with a proper VRML viewer, at either a local or a remote host.
5982The VRMLFILE driver sends 3D data to your VRML viewer, which is running
5983in the same host machine as Geant4, via an intermediate file named
5984g4.wrl created in the current directory. This file is available for
5985re-visualization afterwards. In visualization, you should specify a
5986name of the VRML viewer by setting the environment variable G4VRML_VIEWER
5987beforehand.
5988EOM`
5989
5990dflt=$g4vis_use_vrmlfile
5991rp=$g4message
5992#. ./myread
5993#gans=$ans
5994gans=y
5995
5996        case $gans in
5997       
5998        n*|N*)
5999                g4vis_build_vrmlfile_driver=n
6000                g4vis_use_vrmlfile=n
6001                ;;
6002        y*|Y*)
6003                g4vis_build_vrmlfile_driver=y
6004                g4vis_use_vrmlfile=y
6005                ;;
6006        esac
6007
6008fi # if !WIN
6009
6010g4message=`cat << EOM
6011
6012  G4VIS_BUILD_ASCIITREE_DRIVER
6013  G4VIS_USE_ASCIITREE
6014
6015Description????????????????????????
6016EOM`
6017
6018dflt=$g4vis_use_asciitree
6019rp=$g4message
6020# Don't ask by default and set to 'y'!
6021#. ./myread
6022#gans=$ans
6023gans=y
6024
6025        case $gans in
6026       
6027        n*|N*)
6028                g4vis_build_asciitree_driver=n
6029                g4vis_use_asciitree=n
6030                ;;
6031        y*|Y*)
6032                g4vis_build_asciitree_driver=y
6033                g4vis_use_asciitree=y
6034                ;;
6035        esac
6036
6037
6038g4message=`cat << EOM
6039
6040  G4VIS_BUILD_GAGTREE_DRIVER
6041  G4VIS_USE_GAGTREE
6042
6043Description????????????????????????
6044EOM`
6045
6046dflt=$g4vis_use_gagtree
6047rp=$g4message
6048# Don't ask by default and set to 'y'!
6049#. ./myread
6050#gans=$ans
6051gans=y
6052
6053        case $gans in
6054       
6055        n*|N*)
6056                g4vis_build_gagtree_driver=n
6057                g4vis_use_gagtree=n
6058                ;;
6059        y*|Y*)
6060                g4vis_build_gagtree_driver=y
6061                g4vis_use_gagtree=y
6062                ;;
6063        esac
6064
6065;;
6066esac
6067
6068if test "X$g4system" != "XWIN32-VC" -a "X$g4system" != "XWIN32-VC7" -a "X$g4system" != "XDarwin-g++"; then
6069
6070#echo PASS1
6071
6072if [ X$g4vis_build_openglx_driver = Xy ] || [ X$g4vis_build_openglxm_driver = Xy ] || [ X$g4vis_build_openglwin32_driver = Xy ] ; then
6073
6074#echo PASS2
6075
6076#####################################################################
6077ogl_dirs=`find $g4vis_oglhome /usr/X11R6/include /usr/local/include /usr/include -type d -name GL 2>/dev/null|xargs echo`
6078#echo ogl_dirs=$ogl_dirs
6079
6080if test "X$ogl_dirs" != "X" ; then
6081
6082g4ogl_base_dir_found=`echo $ogl_dirs|cut -d" " -f1`
6083#echo g4ogl_base_dir_found=$g4ogl_base_dir_found
6084
6085# That's right: should be twice! (e.g./usr/local/lib/libGLU.so -> /usr/local)
6086g4ogl_base_dir_found=`dirname $g4ogl_base_dir_found`
6087g4ogl_base_dir_found=`dirname $g4ogl_base_dir_found`
6088
6089        g4vis_oglhome=$g4ogl_base_dir_found
6090#else
6091#case "$g4vis_oglhome" in
6092#'')
6093#       g4vis_oglhome=/usr
6094#       ;;
6095#esac
6096fi
6097
6098##########################################################################
6099if test "X$g4vis_oglhome" != "X" ; then
6100ogl_dirs=$g4vis_oglhome
6101fi
6102
6103if test "X$ogl_dirs" != "X" ; then
6104
6105g4message=`cat << EOM
6106
6107  OGLHOME/include
6108  OGLHOME/lib
6109
6110You have selected to use OpenGL driver.
6111Specify the correct path (OGLHOME) where OpenGL is installed in your system.
6112It was found in $g4vis_oglhome. Press [Enter] to set this path or type the correct one.
6113
6114You can set '-' (without quotation) to CANCEL the OpenGL flag at all:
6115
6116EOM`
6117
6118dflt=$g4vis_oglhome
6119fn='d~(-)'
6120rp=$g4message
6121. ./getfile
6122
6123cend="no"
6124while test "$cend" = "no" ; do
6125if test -e "$ans/include/GL" || [ "X$ans" = "X-"  ]; then
6126cend="yes"
6127
6128if test "X$ans" != "X-" ; then
6129
6130g4vis_oglhome=$ans
6131
6132else
6133
6134g4vis_build_openglx_driver=n
6135g4vis_use_openglx=n
6136
6137g4vis_build_openglxm_driver=n
6138g4vis_use_openglxm=n
6139
6140g4vis_build_openglwin32_driver=n
6141g4vis_use_openglwin32=n
6142
6143fi
6144else
6145
6146g4message=`cat << EOM
6147
6148  OGLHOME/include
6149  OGLHOME/lib
6150
6151You have selected to use OpenGL driver.
6152But it was not found in $ans.
6153Please specify the correct path where OpenGL is installed in your system.
6154
6155You can set '-' (without quotation) to CANCEL the OpenGL flag at all:
6156
6157EOM`
6158
6159dflt=""
6160fn='d~(-)'
6161rp=$g4message
6162. ./getfile
6163fi
6164done
6165
6166else
6167
6168g4message=`cat << EOM
6169
6170  OGLHOME/include
6171  OGLHOME/lib
6172
6173You have selected to use OpenGL driver.
6174But it was not found in expected place.
6175Please specify the correct path where OpenGL is installed in your system.
6176
6177You can set '-' (without quotation) to CANCEL the OpenGL flag at all:
6178
6179EOM`
6180
6181dflt=""
6182fn='d~(-)'
6183rp=$g4message
6184. ./getfile
6185
6186cend="no"
6187while test "$cend" = "no" ; do
6188if test -e "$ans/include/GL" || [ "X$ans" = "X-"  ]; then
6189cend="yes"
6190
6191if test "X$ans" != "X-" ; then
6192
6193g4vis_oglhome=$ans
6194
6195else
6196
6197g4vis_build_openglx_driver=n
6198g4vis_use_openglx=n
6199
6200g4vis_build_openglxm_driver=n
6201g4vis_use_openglxm=n
6202
6203g4vis_build_openglwin32_driver=n
6204g4vis_use_openglwin32=n
6205
6206fi
6207else
6208
6209g4message=`cat << EOM
6210
6211  OGLHOME/include
6212  OGLHOME/lib
6213
6214You have selected to use OpenGL driver.
6215But it was not found in $ans.
6216Please specify the correct path where OpenGL is installed in your system.
6217
6218You can set '-' (without quotation) to CANCEL the OpenGL flag at all:
6219
6220EOM`
6221
6222dflt=""
6223fn='d~(-)'
6224rp=$g4message
6225. ./getfile
6226fi
6227done
6228
6229fi
6230
6231if test "X$g4osname" = "XLinux"; then
6232
6233if test "X$g4vis_oglhome" = "X/usr" -o "X$g4vis_oglhome" = "X/usr/local"; then
6234g4vis_oglhome=""
6235fi
6236
6237fi # if platform (Linux vs SUN)
6238
6239fi # if need
6240###########################################
6241fi # if platform (Unix vs Win)
6242
6243#
6244# BEGIN QTVIS/QT PROBE
6245#
6246# Because the vis driver only works with UI, only probe if g4ui_none is
6247# NOT set AND g4vis_none is NOT set.
6248# Also, Qt vis driver has dependency on Qt UI module - so only ask if
6249# build is required IF Qt UI was selected.
6250#
6251if test "x$g4ui_none" = "xn" -a "x$g4vis_none" = "xn" ; then
6252if test "x$g4ui_build_qt_session" = "xy" ; then
6253    # Query the user to see if build of Qt GL module is needed
6254    g4message=`cat <<EOM
6255
6256    G4UI_BUILD_OPENGLQT_DRIVER
6257    G4UI_USE_OPENGLQT
6258
6259Setting these variables will enable the building of the G4 OpenGL Qt based
6260visualisation driver and the use of this driver in your applications
6261respectively.
6262The Qt3 or Qt4 headers, libraries and moc application are required to enable
6263the building of this module.
6264Do you want to enable build and use of this module?
6265EOM`
6266
6267    # Read in the user response
6268    dflt=$g4vis_build_openglqt_driver
6269    rp=$g4message
6270    . ./myread
6271    gans=$ans
6272
6273    # Check response and take set variables as needed.
6274    case $gans in
6275        n*|N*)
6276            g4vis_build_openglqt_driver=n
6277            g4vis_use_openglqt=n
6278            ;;
6279        y*|Y*)
6280            g4vis_build_openglqt_driver=y
6281            g4vis_use_openglqt=y
6282            ;;
6283    esac
6284
6285    ##########
6286
6287    ##########
6288    # Now, if user chose to build module, we need to check for a Qt
6289    # installation
6290    #
6291    if test "x$g4vis_build_openglqt_driver" = "xy" ; then
6292        echo " "
6293        # NB Have to supply arg to qt script, just blank in this case!
6294        qt_search_dir=""
6295        . ./qt
6296
6297        # If we didn't find Qt automatically, then ask user if they know
6298        # where it's installed...
6299        if test "x$g4_havegoodqt" = "xno" ; then
6300            promptend="no"
6301            user_qthome="the standard locations"
6302
6303            while test "x$promptend" = "xno" ; do
6304                g4message=`cat << EOM
6305
6306Autodetection failed to locate Qt3 or Qt4 in $qthomeloc on your system.
6307Please enter the path to your Qt3 OR Qt4 install (i.e. if Qt4 is installed
6308in PATH/include/QT, PATH/include or PATH/include/qt4, enter PATH),
6309or type '-' to CANCEL the build of the Qt UI module.
6310Qt path:
6311EOM`
6312                dflt=""
6313                fn='d~(-)'
6314                rp=$g4message
6315                . ./getfile
6316                user_qthome=$ans
6317
6318                if test "x$user_qthome" = "x-" ; then
6319                    # Cancel build...
6320                    g4vis_build_openglqt_driver=n
6321                    g4vis_use_openglqt=n
6322                    echo "configure: build/use of Qt OpenGl driver cancelled"
6323                    promptend=yes
6324                else
6325                    # Check for installation in user directory
6326                    echo " "
6327                    qt_search_dir=$user_qthome
6328                    . ./qt
6329
6330                    if test "x$g4_havegoodqt" = "xyes" ; then
6331                        promptend=yes
6332                    fi
6333                fi #END TEST user_qthome = -
6334            done #END while promptend=no (for user input of Qt install)
6335        fi #END TEST g4_havegoodqt = no (for user prompt)
6336    fi #END TEST g4vis_build_openglqt_driver (whether to build at all)
6337else # TEST g4ui_build_qt_session
6338    # Because we can 'drop through' this test on repeat
6339    # running Configure, force build and use to n
6340    g4vis_build_openglqt_driver=n
6341    g4vis_use_openglqt=n
6342fi #END TEST g4ui_build_qt_session (dependency on Qt UI module)
6343fi #END TEST g4ui_none = n AND g4vis_none=n
6344
6345#
6346# BEGIN GDML/XERCESC PROBE
6347#
6348
6349# Set default build option to no
6350echo " "
6351case "$g4lib_build_gdml" in
6352'')
6353        g4lib_build_gdml=n
6354        ;;
6355esac
6356
6357
6358# Now query the user to see if they want to build the GDML plugin
6359echo ""
6360
6361g4message=`cat << EOM
6362
6363  G4LIB_BUILD_GDML
6364
6365Setting this variable will enable building of the GDML plugin module embedded
6366in Geant4 for detector description persistency.
6367It requires your system to have the XercesC library and headers installed.
6368Do you want to set this variable?
6369
6370EOM`
6371
6372#
6373# read in the users response
6374#
6375dflt=$g4lib_build_gdml
6376rp=$g4message
6377. ./myread
6378gans=$ans
6379
6380#
6381# Check response
6382#
6383case $gans in
6384     n*|N*)
6385        g4lib_build_gdml=n
6386        ;;
6387     y*|Y*)
6388        g4lib_build_gdml=y
6389        ;;
6390esac
6391
6392
6393#
6394# If user does want to build GDML plugin, now try to locate Xerces install
6395#
6396if test "X$g4lib_build_gdml" != "Xn"; then
6397
6398   if test "X$g4gdml_xercesc_root" = "X"; then
6399      #probe for Xerces, using example from UI and Vis
6400      xercesc_root=`find $g4gdml_xercesc_root /usr/include /usr/local/include \
6401/opt/local/include /sw/include -type d -name xercesc 2>/dev/null | xargs echo`
6402
6403      #If we got something, strip off the include/xerces part
6404      if test "X$xercesc_root" != "X"; then
6405         g4gdml_xercesc_root=`dirname $xercesc_root`
6406         g4gdml_xercesc_root=`dirname $g4gdml_xercesc_root`
6407
6408         echo " "
6409         echo "checking for XercesC install... $g4gdml_xercesc_root"
6410      else
6411         g4gdml_xercesc_root=""
6412         echo " "
6413         echo "checking for XercesC install... no"
6414      fi
6415   fi #END OF XERCES AUTOPROBE
6416
6417   #
6418   # If the autoprobe failed, prompt the user to enter the path to the Xerces
6419   # install
6420   #
6421   if test "X$g4gdml_xercesc_root" = "X"; then
6422
6423      promptend="no"
6424      xercesloc="the standard locations"
6425     
6426      while test "$promptend" = "no"; do
6427            g4message=`cat << EOM
6428
6429Autodetection failed to locate XercesC in $xercesloc on your system.
6430Please enter the path to your XercesC install (i.e. if XercesC is installed
6431in PATH/include/xercesc, enter PATH), or type '-' to CANCEL the build of the
6432GDML module.
6433XercesC path:
6434EOM`
6435
6436            dflt=$g4gdml_xercesc_root
6437            fn='d~(-)'
6438            rp=$g4message
6439            . ./getfile
6440
6441            #check for user cancellation
6442            if test "X$ans" = "X-"; then
6443               g4lib_build_gdml=n
6444               g4gdml_xercesc_root=""
6445               echo "G4LIB_BUILD_GDML cancelled..."
6446               promptend=yes
6447            else
6448               if test -r "$ans/include/xercesc"; then
6449                  g4gdml_xercesc_root=$ans
6450                  echo "checking for XercesC install... $g4gdml_xercesc_root"
6451                  promptend=yes
6452               else
6453                  xercesloc=$ans
6454                  echo "checking for Xercesc install... no"
6455               fi
6456            fi #END OF USER INPUT CHECKING
6457      done #END OF WHILE LOOP OVER USER INPUT
6458   fi #END OF USER INPUT SECTION
6459
6460   #
6461   # If a filter on g4gdml_xerces_root is needed to remove common system paths
6462   # then it should be put here...
6463   #
6464        if test "x$g4gdml_xercesc_root" = "x/usr" -o "x$g4gdml_xercesc_root" = "x/usr/local" ; then
6465                g4gdml_xercesc_root=""
6466        fi
6467
6468fi #END XERCES PROBE
6469
6470#END OF GDML/XERCES PROBE
6471
6472#
6473# Configure which make to use...
6474# On WIN32, we have to watch for cygwin/Matlab clash
6475# Here, cygwin supplies make, Matlab 'gmake', but we must select
6476# cygwin make.
6477#
6478# Yes, we could use Loc's built in make, but want full control
6479# for now....
6480#
6481
6482echo " "
6483
6484g4_make_loc="no"
6485g4_gmake_loc="no"
6486
6487g4_make_program=make
6488g4_gmake_program=gmake
6489
6490g4_check_make_msg="Checking for $g4_make_program..."
6491g4_check_gmake_msg="Checking for $g4_gmake_program..."
6492
6493g4_make_isgnu="no"
6494g4_gmake_isgnu="no"
6495
6496g4_make_dirs=`echo $PATH | sed 's/\:/ /g'`
6497
6498# Check for 'make' on all systems
6499g4_make_loc=`./loc $g4_make_program no $g4_make_dirs`
6500echo "$g4_check_make_msg $g4_make_loc"
6501
6502
6503# On anything but Windows, check for gmake as well
6504if test "x$g4osname" != "xWIN32" ; then
6505    g4_gmake_loc=`./loc $g4_gmake_program no $g4_make_dirs`
6506    echo "$g4_check_gmake_msg $g4_gmake_loc"
6507fi
6508 
6509
6510# Now see if make/gmake are GNU make.
6511if test "x$g4_make_loc" != "xno" ; then
6512    g4_make_version=`$g4_make_loc -v 2>/dev/null`
6513
6514    case $g4_make_version in
6515        GNU*)
6516            g4_make_isgnu=yes
6517            ;;
6518        *)
6519            g4_make_isgnu=no
6520            ;;
6521    esac
6522    echo "Checking if make is GNU make... $g4_make_isgnu"
6523fi
6524
6525if test "x$g4osname" != "xWIN32" ; then
6526    if test "x$g4_gmake_loc" != "xno" ; then
6527        g4_gmake_version=`$g4_gmake_loc -v 2>/dev/null`
6528
6529        case $g4_gmake_version in
6530            GNU*)
6531                g4_gmake_isgnu=yes
6532                ;;
6533            *)
6534                g4_gmake_isgnu=no
6535                ;;
6536        esac
6537        echo "Checking if gmake is GNU make... $g4_gmake_isgnu"
6538    fi
6539fi
6540
6541# Now perform selection on following logic
6542# 1) If we have gmake AND it's GNU make, use that
6543# 2) If we have make AND it's GNU make, use that
6544# 3) If none of the above, prompt user for path to make program
6545if test "x$g4_gmake_loc" != "xno" -a "x$g4_gmake_isgnu" = "xyes" ; then
6546    g4make=$g4_gmake_loc
6547elif test "x$g4_make_loc" != "xno" -a "x$g4_make_isgnu" = "xyes" ; then
6548    g4make=$g4_make_loc
6549else
6550    g4_got_user_make="no"
6551    while test "x$g4_got_user_make" = "xno"; do
6552        g4message=`cat << EOM
6553
6554    G4MAKE
6555
6556A GNU make program could not be located on your system.
6557Please enter the full path to the GNU make program you
6558want to use:
6559EOM`
6560        dflt=$g4make
6561        rp=$g4message
6562        . ./myread
6563        gans=$ans
6564
6565        #Check if this is GNU make...
6566        g4_user_make_version=`$gans -v 2>/dev/null`
6567
6568        case $g4_user_make_version in
6569            "GNU Make"*)
6570                echo "Checking that $gans is GNU Make... yes"
6571                g4make=$gans
6572                g4_got_user_make=yes
6573                ;;
6574            *)
6575                echo "Checking that $gans is GNU Make... no"
6576                ;;
6577        esac
6578    done
6579fi
6580
6581
6582
6583echo " "
6584case "$g4wlib_build_g3tog4" in
6585'')
6586        g4wlib_build_g3tog4=n
6587        ;;
6588esac
6589
6590case "$g4w_use_g3tog4" in
6591'')
6592        g4w_use_g3tog4=n
6593        ;;
6594esac
6595
6596echo ""
6597
6598g4message=`cat << EOM
6599
6600  G4LIB_BUILD_G3TOG4 
6601
6602The utility module 'g3tog4' will be built by setting this
6603variable. NOTE: it requires a valid FORTRAN compiler to be
6604installed on your system and the 'cernlib' command in the
6605path, in order to build the ancillary tools!
6606Do you want to build 'g3tog4' ?
6607 
6608EOM`
6609
6610dflt=$g4wlib_build_g3tog4
6611rp=$g4message
6612. ./myread
6613gans=$ans
6614
6615        case $gans in
6616       
6617        n*|N*)
6618                g4wlib_build_g3tog4=n
6619                g4w_use_g3tog4=n
6620                ;;
6621        y*|Y*)
6622                g4wlib_build_g3tog4=y
6623                g4w_use_g3tog4=y
6624                ;;
6625        esac
6626
6627
6628echo " "
6629case "$g4wlib_build_zlib" in
6630'')
6631        g4wlib_build_zlib=n
6632        ;;
6633esac
6634
6635case "$g4w_use_zlib" in
6636'')
6637        g4w_use_zlib=n
6638        ;;
6639esac
6640
6641echo ""
6642
6643g4message=`cat << EOM
6644
6645  G4LIB_BUILD_ZLIB 
6646
6647Do you want to activate compression for output files
6648generated by the HepRep visualization driver?
6649 
6650EOM`
6651
6652dflt=$g4wlib_build_zlib
6653rp=$g4message
6654. ./myread
6655gans=$ans
6656
6657        case $gans in
6658       
6659        n*|N*)
6660                g4wlib_build_zlib=n
6661                g4w_use_zlib=n
6662                ;;
6663        y*|Y*)
6664                g4wlib_build_zlib=y
6665                g4w_use_zlib=y
6666                ;;
6667        esac
6668
6669
6670echo " "
6671
6672case "$g4wanalysis_use" in
6673'')
6674        g4wanalysis_use=n
6675        ;;
6676esac
6677
6678echo ""
6679
6680g4message=`cat << EOM
6681
6682  G4ANALYSIS_USE
6683
6684Activates the configuration setup for allowing plugins to
6685analysis tools based on AIDA (Astract Interfaces for Data
6686Analysis). In order to use AIDA features and compliant analysis
6687tools, the proper environment for these tools will have to be
6688set (see documentation for the specific analysis tools).
6689EOM`
6690
6691dflt=$g4wanalysis_use
6692rp=$g4message
6693. ./myread
6694gans=$ans
6695
6696        case $gans in
6697       
6698        n*|N*)
6699                g4wanalysis_use=n
6700                ;;
6701        y*|Y*)
6702                g4wanalysis_use=y
6703                ;;
6704        esac
6705
6706
6707: end of configuration questions
6708echo " "
6709echo "End of configuration phase."
6710echo " "
6711
6712: back to where it started
6713if test -d ../../.config/UU; then
6714        cd ../..
6715fi
6716
6717: configuration may be patched via a 'config.over' file
6718if $test -f config.over; then
6719        echo " "
6720        dflt=y
6721        rp='A config.over file exists.  Do you wish to load it?'
6722        . .config/UU/myread
6723        case "$ans" in
6724        n*) echo "OK, I'll ignore it.";;
6725        *)      . ./config.over
6726                echo "Configuration settings have been loaded."
6727                ;;
6728        esac
6729fi
6730
6731: in case they want portability, strip down executable paths
6732case "$d_portable" in
6733"$define")
6734        echo " "
6735        echo "Stripping down executable paths..." >&4
6736        for file in $loclist $trylist; do
6737                eval $file="\$file"
6738        done
6739        ;;
6740esac
6741
6742: create config.sh file
6743echo " "
6744echo "Creating configuration setup file..." >&4
6745mkdir -p $g4conf
6746$spitshell <<EOT > $g4conf/config.sh
6747$startsh
6748#
6749# This file was produced by running the Configure script. It holds all the
6750# definitions figured out by Configure. Should you modify one of these values,
6751# do not forget to propagate your changes by running "Configure -der". You may
6752# instead choose to run each of the .SH files by yourself, or "Configure -S".
6753#
6754
6755# Package name      : $package
6756# Source directory  : $src
6757# Configuration time: $cf_time
6758# Configured by     : $cf_by
6759# Target system     : $myuname
6760
6761Author='$Author'
6762Date='$Date'
6763Header='$Header'
6764Id='$Id'
6765Locker='$Locker'
6766Log='$Log'
6767RCSfile='$RCSfile'
6768Revision='$Revision'
6769Source='$Source'
6770State='$State'
6771c='$c'
6772cf_by='$cf_by'
6773cf_time='$cf_time'
6774contains='$contains'
6775d_portable='$d_portable'
6776eunicefix='$eunicefix'
6777g4_gmake='$g4_gmake'
6778g4_gmake_version='$g4_gmake_version'
6779g4_make='$g4_make'
6780g4_make_version='$g4_make_version'
6781g4_qt_cxxflags='$g4_qt_cxxflags'
6782g4_qt_gl_cxxflags='$g4_qt_gl_cxxflags'
6783g4_qt_gl_libs='$g4_qt_gl_libs'
6784g4_qt_libs='$g4_qt_libs'
6785g4_qt_moc='$g4_qt_moc'
6786g4_qt_version='$g4_qt_version'
6787g4abladata='$g4abladata'
6788g4base='$g4base'
6789g4bin='$g4bin'
6790g4clhep_base_dir='$g4clhep_base_dir'
6791g4clhep_include_dir='$g4clhep_include_dir'
6792g4clhep_lib='$g4clhep_lib'
6793g4clhep_lib_dir='$g4clhep_lib_dir'
6794g4compiler='$g4compiler'
6795g4conf='$g4conf'
6796g4data='$g4data'
6797g4debug='$g4debug'
6798g4elasticdata='$g4elasticdata'
6799g4final_install='$g4final_install'
6800g4gdml_xercesc_root='$g4gdml_xercesc_root'
6801g4global='$g4global'
6802g4granular='$g4granular'
6803g4include='$g4include'
6804g4includes_flag='$g4includes_flag'
6805g4install='$g4install'
6806g4ledata='$g4ledata'
6807g4levelgammadata='$g4levelgammadata'
6808g4lib='$g4lib'
6809g4lib_build_gdml='$g4lib_build_gdml'
6810g4lib_build_shared='$g4lib_build_shared'
6811g4lib_build_static='$g4lib_build_static'
6812g4lib_use_dll='$g4lib_use_dll'
6813g4lib_use_dyn='$g4lib_use_dyn'
6814g4lib_use_granular='$g4lib_use_granular'
6815g4lib_use_shared='$g4lib_use_shared'
6816g4lib_use_static='$g4lib_use_static'
6817g4make='$g4make'
6818g4neutronhpcrosssections='$g4neutronhpcrosssections'
6819g4osname='$g4osname'
6820g4radioactivedata='$g4radioactivedata'
6821g4system='$g4system'
6822g4tmp='$g4tmp'
6823g4ui_build_gag_session='$g4ui_build_gag_session'
6824g4ui_build_qt_session='$g4ui_build_qt_session'
6825g4ui_build_terminal_session='$g4ui_build_terminal_session'
6826g4ui_build_win32_session='$g4ui_build_win32_session'
6827g4ui_build_xaw_session='$g4ui_build_xaw_session'
6828g4ui_build_xm_session='$g4ui_build_xm_session'
6829g4ui_none='$g4ui_none'
6830g4ui_use_gag='$g4ui_use_gag'
6831g4ui_use_qt='$g4ui_use_qt'
6832g4ui_use_tcsh='$g4ui_use_tcsh'
6833g4ui_use_terminal='$g4ui_use_terminal'
6834g4ui_use_win32='$g4ui_use_win32'
6835g4ui_use_xaw='$g4ui_use_xaw'
6836g4ui_use_xm='$g4ui_use_xm'
6837g4ui_xawflags='$g4ui_xawflags'
6838g4ui_xawhome='$g4ui_xawhome'
6839g4ui_xawlibs='$g4ui_xawlibs'
6840g4vis_build_asciitree_driver='$g4vis_build_asciitree_driver'
6841g4vis_build_dawn_driver='$g4vis_build_dawn_driver'
6842g4vis_build_dawnfile_driver='$g4vis_build_dawnfile_driver'
6843g4vis_build_oiwin32_driver='$g4vis_build_oiwin32_driver'
6844g4vis_build_oix_driver='$g4vis_build_oix_driver'
6845g4vis_build_openglqt_driver='$g4vis_build_openglqt_driver'
6846g4vis_build_openglwin32_driver='$g4vis_build_openglwin32_driver'
6847g4vis_build_openglx_driver='$g4vis_build_openglx_driver'
6848g4vis_build_openglxm_driver='$g4vis_build_openglxm_driver'
6849g4vis_build_raytracer_driver='$g4vis_build_raytracer_driver'
6850g4vis_build_raytracerx_driver='$g4vis_build_raytracerx_driver'
6851g4vis_build_vrml_driver='$g4vis_build_vrml_driver'
6852g4vis_build_vrmlfile_driver='$g4vis_build_vrmlfile_driver'
6853g4vis_oglhome='$g4vis_oglhome'
6854g4vis_oivhome='$g4vis_oivhome'
6855g4vis_use_asciitree='$g4vis_use_asciitree'
6856g4vis_use_dawn='$g4vis_use_dawn'
6857g4vis_use_dawnfile='$g4vis_use_dawnfile'
6858g4vis_use_oiwin32='$g4vis_use_oiwin32'
6859g4vis_use_oix='$g4vis_use_oix'
6860g4vis_use_openglqt='$g4vis_use_openglqt'
6861g4vis_use_openglwin32='$g4vis_use_openglwin32'
6862g4vis_use_openglx='$g4vis_use_openglx'
6863g4vis_use_openglxm='$g4vis_use_openglxm'
6864g4vis_use_raytracer='$g4vis_use_raytracer'
6865g4vis_use_raytracerx='$g4vis_use_raytracerx'
6866g4vis_use_vrml='$g4vis_use_vrml'
6867g4vis_use_vrmlfile='$g4vis_use_vrmlfile'
6868g4vis_xmflags='$g4vis_xmflags'
6869g4vis_xmflags='$g4vis_xmflags'
6870g4vis_xmhome='$g4vis_xmhome'
6871g4vis_xmhome='$g4vis_xmhome'
6872g4vis_xmlibs='$g4vis_xmlibs'
6873g4vis_xmlibs='$g4vis_xmlibs'
6874g4w_use_g3tog4='$g4w_use_g3tog4'
6875g4w_use_zlib='$g4w_use_zlib'
6876g4wanalysis_build='$g4wanalysis_build'
6877g4wanalysis_build_jas='$g4wanalysis_build_jas'
6878g4wanalysis_build_lab='$g4wanalysis_build_lab'
6879g4wanalysis_build_lizard='$g4wanalysis_build_lizard'
6880g4wanalysis_use='$g4wanalysis_use'
6881g4wanalysis_use_jas='$g4wanalysis_use_jas'
6882g4wanalysis_use_lab='$g4wanalysis_use_lab'
6883g4wanalysis_use_lizard='$g4wanalysis_use_lizard'
6884g4wlib_build_g3tog4='$g4wlib_build_g3tog4'
6885g4wlib_build_zlib='$g4wlib_build_zlib'
6886g4workdir='$g4workdir'
6887hint='$hint'
6888lns='$lns'
6889myuname='$myuname'
6890n='$n'
6891osname='$osname'
6892osvers='$osvers'
6893package='$package'
6894sh='$sh'
6895sharpbang='$sharpbang'
6896shsharp='$shsharp'
6897spackage='$spackage'
6898spitshell='$spitshell'
6899src='$src'
6900startsh='$startsh'
6901EOT
6902
6903: add special variables
6904mkdir -p $g4conf
6905$test -f $src/patchlevel.h && \
6906awk '/^#define/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >> $g4conf/config.sh
6907echo "CONFIG=true" >> $g4conf/config.sh
6908
6909: propagate old symbols
6910if $test -f .config/UU/config.sh; then
6911        <.config/UU/config.sh sort | uniq >.config/UU/oldconfig.sh
6912        sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' $g4conf/config.sh $g4conf/config.sh .config/UU/oldconfig.sh |\
6913        sort | uniq -u >.config/UU/oldsyms
6914        set X `cat .config/UU/oldsyms`
6915        shift
6916        case $# in
6917        0) ;;
6918        *)
6919                cat <<EOM
6920               
6921Hmm...You had some extra variables I don't know about...
6922      I'll try to keep 'em...
6923
6924EOM
6925                echo "# Variables propagated from previous config.sh file." >>.config/bin/$g4system/config.sh
6926                for sym in `cat .config/UU/oldsyms`; do
6927                        echo "    Propagating $hint variable "'$'"$sym..."
6928                        eval 'tmp="$'"${sym}"'"'
6929                        echo "$tmp" | \
6930                                sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>.config/bin/$g4system/config.sh
6931                done
6932                ;;
6933        esac
6934fi
6935
6936: preserve RCS keywords in files with variable substitution, grrr
6937Id='$Id'
6938
6939: Finish up by extracting the .SH files
6940case "$alldone" in
6941exit)
6942        $rm -rf .config/UU
6943        echo "Done."
6944        exit 0
6945        ;;
6946cont)
6947        ;;
6948'')
6949        dflt=''
6950        nostick=true
6951        $cat <<EOM
6952
6953WARNING: the generated configuration file
6954can be edited if necessary!
6955You can introduce any change to the configuration file
6956$g4conf/config.sh before the final installation.
6957To do so, use a shell escape now (e.g. !vi $g4conf/config.sh).
6958
6959EOM
6960        rp="Press [Enter] to start installation or use a shell escape to edit config.sh:"
6961        . .config/UU/myread
6962        nostick=''
6963        case "$ans" in
6964        '') ;;
6965        *) : in case they cannot read
6966                sh 1>&4 -c "$ans";;
6967        esac
6968        ;;
6969esac
6970
6971: if this fails, just run all the .SH files by hand
6972. $g4conf/config.sh
6973
6974echo " "
6975exec 1>&4
6976. ./.config/UU/extract
6977
6978if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
6979        dflt=y
6980        case "$silent" in
6981        true) ;;
6982        *)
6983                $cat <<EOM
6984
6985Now you need to generate make dependencies by running "make depend".
6986You might prefer to run it in background: "make depend > makedepend.out &"
6987It can take a while, so you might not want to run it right now.
6988
6989EOM
6990                ;;
6991        esac
6992        rp="Run make depend now?"
6993        . .config/UU/myread
6994        case "$ans" in
6995        y*)
6996                make depend && echo "Now you must run a make."
6997                ;;
6998        *)
6999                echo "You must run 'make depend' then 'make'."
7000                ;;
7001        esac
7002elif test -f [Mm]akefile; then
7003        echo " "
7004        echo "Now you must run a make."
7005elif [ -f $g4conf/install.sh -a X$g4build = Xyes ] ; then
7006        echo " "
7007        echo "Now starting Geant4 libraries build..."
7008        echo " "
7009        . $g4conf/install.sh
7010elif [ -f $g4conf/install.sh -a X$install = Xyes ] ; then
7011        echo " "
7012        echo "Now starting Geant4 libraries installation..."
7013        echo " "
7014        . $g4conf/move.sh
7015else
7016        echo " "
7017        echo "WARNING: Geant4 is NOT installed yet!"
7018        echo "You (or the administrator if you have not enough privileges)"
7019        echo "should start with \$G4INSTALL/Configure -install"
7020        echo "(where \$G4INSTALL is Geant4 install directory)."
7021        echo " "
7022fi
7023
7024$rm -f kit*isdone ark*isdone
7025$rm -rf .config/UU
7026
7027: End of Configure
7028
Note: See TracBrowser for help on using the repository browser.