source: trunk/Configure@ 881

Last change on this file since 881 was 872, checked in by garnier, 17 years ago

some adjustments

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