source: trunk/Configure@ 870

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

big modifications in order to try to get all conf

  • Property svn:executable set to *
File size: 140.8 KB
Line 
1#! /bin/sh
2#
3# If these # comments don't work, trim them. Don't worry about any other
4# shell scripts, Configure will trim # comments from them for you.
5#
6# (If you are trying to port this package to a machine without sh,
7# I would suggest you have a look at the prototypical config_h.SH file
8# and edit it to reflect your system. Some packages may include samples
9# of config.h for certain machines, so you might look for one of those.)
10#
11# Yes, you may rip this off to use in other distribution packages. This
12# script belongs to the public domain and cannot be copyrighted.
13#
14# (Note: this Configure script was generated automatically. Rather than
15# working with this copy of Configure, you may wish to get metaconfig.
16# The dist-3.0 package (which contains metaconfig) was posted in
17# comp.sources.misc and is available on CPAN under authors/id/RAM so
18# you may fetch it yourself from your nearest archive site.)
19#
20
21# $Id: Configure,v 1.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 QTVER
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 while test "x$promptend" = "xno" ; do
4446 g4message=`cat << EOM
4447
4448Autodetection failed to locate Qt on your system.
4449Please enter the path to your Qt install (i.e. if Qt is installed
4450in PATH/include/Qt, or PATH/include $PATH/include/qt, enter PATH), or type '-' to
4451CANCEL the build of the Qt UI module.
4452Qt path:
4453EOM`
4454 dflt="/usr"
4455 g4_qtmochome="/usr"
4456 fn='d~(-)'
4457 rp=$g4message
4458 . ./getfile
4459
4460 #Check for user cancellation
4461 if test "x$ans" = "x-" ; then
4462 g4ui_build_qt_session=n
4463 g4ui_use_qt=n
4464 echo "build/use of Qt UI module cancelled..."
4465 promptend=yes
4466
4467 else
4468 #We want to probe for Qt in the user supplied directory
4469 echo " "
4470 qthomeloc=$ans
4471 g4_havegoodqt=no
4472
4473
4474 # check for moc
4475
4476 g4_qtmochome=`./loc moc no $ans/bin`
4477 if test "x$g4_qtmochome" = "xno" ; then
4478 while test "x$promptend" = "xno" ; do
4479 g4message=`cat << EOM
4480
4481Failed to locate Qt moc tool on your system.
4482Please enter the path to your Qt moc tool install or type '-' to
4483CANCEL the build of the Qt UI module.
4484Qt moc path:
4485EOM`
4486 fn='d~(-)'
4487 rp=$g4message
4488 . ./getfile
4489
4490 #Check for user cancellation
4491 if test "x$ans" = "x-" ; then
4492 g4ui_build_qt_session=n
4493 g4ui_use_qt=n
4494 echo "build/use of Qt UI module cancelled..."
4495 promptend=yes
4496
4497 else
4498 #We want to probe for Qt in the user supplied directory
4499 echo " "
4500 # check for moc
4501 g4_qtmochome=`./loc moc no $ans/bin`
4502 if test "x$g4_qtmochome" != "xno" ; then
4503 promptend=yes
4504 fi
4505 fi
4506 done
4507 fi # ASK FOR QT MOC
4508 if test "x$g4_qtmochome" != "xno" ; then
4509 echo "checking Qt moc tool in... $g4_qtmochome"
4510 fi
4511
4512 # if moc ok, then check for version
4513 if test "x$g4_qtmochome" != "xno" ; then
4514 g4_qtver=`$g4_qtmochome 2>&1 -v | $sed 's/.* .Qt \([0-9]\)\..*/\1/' `
4515 echo "checking Qt version... $g4_qtver"
4516
4517 if test "x$g4_qtver" = "x3" || test "x$g4_qtver" = "x4";then
4518
4519 # if version ok check for includes
4520 # checking includes in qt$g4_qtver, then standard
4521 incQtFiles="$qthomeloc/lib/qt$g4_qtver/include $qthomeloc/include/qt$g4_qtver/Qt $qthomeloc/include/qt$g4_qtver $qthomeloc/include $qthomeloc/include/Qt "
4522
4523 if test "X$g4osname" = "XDarwin" && test "X$g4_qtver" = "X4"; then
4524 incQtFiles="$incQtFiles /Library/Frameworks/QtCore.framework/Headers/ $qthomeloc/QtCore.framework/Headers/"
4525 g4_qtincdir=`./loc qglobal.h no $incQtFiles`
4526 if test "x$g4_qtincdir" != "xno" ; then
4527 g4_qtincdir=`dirname $g4_qtincdir`
4528 g4_qtincdir=`dirname $g4_qtincdir`
4529 fi
4530 else
4531 g4_qtincdir=`./loc qglobal.h no $incQtFiles`
4532 fi
4533 if test "x$g4_qtincdir" = "xno" ; then
4534 while test "x$promptend" = "xno" ; do
4535 g4message=`cat << EOM
4536
4537Failed to locate Qt include directory on your system.
4538Please enter the path to your Qt include directory install or type '-' to
4539CANCEL the build of the Qt UI module.
4540Qt include path:
4541EOM`
4542 fn='d~(-)'
4543 rp=$g4message
4544 . ./getfile
4545
4546 #Check for user cancellation
4547 if test "x$ans" = "x-" ; then
4548 g4ui_build_qt_session=n
4549 g4ui_use_qt=n
4550 echo "build/use of Qt UI module cancelled..."
4551 promptend=yes
4552
4553 else
4554 #We want to probe for Qt in the user supplied directory
4555 echo " "
4556 # check for include
4557 g4_qtincdir=`./loc qglobal.h no $ans`
4558 if test "x$g4_qtincdir" != "xno" ; then
4559 promptend=yes
4560 fi
4561 fi
4562 done
4563 fi # ASK FOR QT INC
4564 if test "x$g4_qtincdir" != "xno" ; then
4565 g4_qtincdir=`dirname $g4_qtincdir`
4566 echo "checking Qt inc dir in... $g4_qtincdir"
4567 fi
4568 # if qt inc ok, then check for libs
4569 if test "x$g4_qtincdir" != "xno" ; then
4570
4571 # checking libraries in qt$g4_qtver, then standard
4572 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"
4573
4574 if test "X$g4osname" = "XDarwin" && test "X$g4_qtincdir" = "X/Library/Frameworks" ; then
4575 g4_qtlibdir=`./loc QtCore no /Library/Frameworks/QtCore.framework/Versions/$g4_qtver/ $libQtFiles`
4576 g4_qtlibdir=`dirname $g4_qtlibdir`
4577 g4_qtlibdir=`dirname $g4_qtlibdir`
4578 g4_qtlibdir=`dirname $g4_qtlibdir`
4579 else
4580 g4_qtlibdir=`./loc libqt* no $libQtFiles`
4581 fi
4582 if test "x$g4_qtlibdir" = "xno" ; then
4583 while test "x$promptend" = "xno" ; do
4584 g4message=`cat << EOM
4585
4586Failed to locate Qt lib directory on your system.
4587Please enter the path to your Qt lib directory install or type '-' to
4588CANCEL the build of the Qt UI module.
4589Qt library path:
4590EOM`
4591 fn='d~(-)'
4592 rp=$g4message
4593 . ./getfile
4594
4595 #Check for user cancellation
4596 if test "x$ans" = "x-" ; then
4597 g4ui_build_qt_session=n
4598 g4ui_use_qt=n
4599 echo "build/use of Qt UI module cancelled..."
4600 promptend=yes
4601
4602 else
4603 #We want to probe for Qt in the user supplied directory
4604 echo " "
4605 # check for libraries
4606 if test "X$g4osname" = "XDarwin" && test "X$g4_qtincdir" = "X/Library/Frameworks" ; then
4607 g4_qtlibdir=`./loc QtCore* no $libQtFiles /Library/Frameworks/`
4608 else
4609 g4_qtlibdir=`./loc libqt* no $libQtFiles`
4610 fi
4611 if test "x$g4_qtlibdir" != "xno" ; then
4612 promptend=yes
4613 fi
4614 fi
4615 done
4616 fi # END OF LIB CHECK
4617 if test "x$g4_qtlibdir" != "xno" ; then
4618 g4_qtlibdir=`dirname $g4_qtlibdir`
4619 echo "checking Qt lib dir in... $g4_qtlibdir"
4620 promptend=yes
4621 g4_havegoodqt=yes
4622 fi
4623
4624 else # END OF INC CHECK
4625 g4_qtincdir=no
4626 fi
4627 else # END OF VERSION CHECK
4628 g4_qtmochome=no
4629 fi
4630 fi # END OF MOC CHECK
4631
4632 fi #END CHECK USER CANCELLATION
4633 done #END USER PROMPT FOR QT DETECTION
4634
4635 fi #END USER DIRECTED QT DETECTION
4636 #
4637 #END QT USER INPUT PROBE
4638 ####################################################################
4639
4640 fi #END CHECK OF G4UI_BUILD_QT_SESSION=Y
4641 ###########################################
4642
4643fi #END TEST G4UI_NONE=N
4644#fi #END TEST G4SYSTEM = Linux-g++ OR Darwin-g++
4645########################
4646echo " "
4647case "$g4vis_none" in
4648'')
4649 g4vis_none=n
4650 ;;
4651esac
4652
4653
4654case "$g4vis_build_openglwin32_driver" in
4655'')
4656 g4vis_build_openglwin32_driver=n
4657 ;;
4658esac
4659
4660case "$g4vis_use_openglwin32" in
4661'')
4662 g4vis_use_openglwin32=n
4663 ;;
4664esac
4665
4666case "$g4vis_build_oiwin32_driver" in
4667'')
4668 g4vis_build_oiwin32_driver=n
4669 ;;
4670esac
4671
4672case "$g4vis_use_oiwin32" in
4673'')
4674 g4vis_use_oiwin32=n
4675 ;;
4676esac
4677
4678case "$g4vis_build_dawn_driver" in
4679'')
4680 g4vis_build_dawn_driver=n
4681 ;;
4682esac
4683
4684case "$g4vis_use_dawn" in
4685'')
4686 g4vis_use_dawn=n
4687 ;;
4688esac
4689
4690# Set by default!
4691case "$g4vis_build_dawnfile_driver" in
4692'')
4693 g4vis_build_dawnfile_driver=y
4694 ;;
4695esac
4696
4697# Set by default!
4698case "$g4vis_use_dawnfile" in
4699'')
4700 g4vis_use_dawnfile=y
4701 ;;
4702esac
4703
4704case "$g4vis_build_openglx_driver" in
4705'')
4706 g4vis_build_openglx_driver=n
4707 ;;
4708esac
4709
4710case "$g4vis_use_openglx" in
4711'')
4712 g4vis_use_openglx=n
4713 ;;
4714esac
4715
4716case "$g4vis_build_openglxm_driver" in
4717'')
4718 g4vis_build_openglxm_driver=n
4719 ;;
4720esac
4721
4722case "$g4vis_use_openglxm" in
4723'')
4724 g4vis_use_openglxm=n
4725 ;;
4726esac
4727
4728case "$g4vis_build_oix_driver" in
4729'')
4730 g4vis_build_oix_driver=n
4731 ;;
4732esac
4733
4734case "$g4vis_use_oix" in
4735'')
4736 g4vis_use_oix=n
4737 ;;
4738esac
4739
4740case "$g4vis_build_raytracerx_driver" in
4741'')
4742 g4vis_build_raytracerx_driver=n
4743 ;;
4744esac
4745
4746case "$g4vis_use_raytracerx" in
4747'')
4748 g4vis_use_raytracerx=n
4749 ;;
4750esac
4751
4752# Set by default!
4753case "$g4vis_build_raytracer_driver" in
4754'')
4755 g4vis_build_raytracer_driver=y
4756 ;;
4757esac
4758
4759# Set by default!
4760case "$g4vis_use_raytracer" in
4761'')
4762 g4vis_use_raytracer=y
4763 ;;
4764esac
4765
4766case "$g4vis_build_vrml_driver" in
4767'')
4768 g4vis_build_vrml_driver=n
4769 ;;
4770esac
4771
4772case "$g4vis_use_vrml" in
4773'')
4774 g4vis_use_vrml=n
4775 ;;
4776esac
4777
4778# Set by default!
4779case "$g4vis_build_asciitree_driver" in
4780'')
4781 g4vis_build_asciitree_driver=y
4782 ;;
4783esac
4784
4785# Set by default!
4786case "$g4vis_use_asciitree" in
4787'')
4788 g4vis_use_asciitree=y
4789 ;;
4790esac
4791
4792# Set by default!
4793case "$g4vis_build_gagtree_driver" in
4794'')
4795 g4vis_build_gagtree_driver=y
4796 ;;
4797esac
4798
4799# Set by default!
4800case "$g4vis_use_gagtree" in
4801'')
4802 g4vis_use_gagtree=y
4803 ;;
4804esac
4805
4806echo ""
4807
4808g4message=`cat << EOM
4809
4810 G4VIS_NONE
4811
4812If this variable is set, no visualization drivers will be built or used.
4813Do you want to set this variable ?
4814
4815EOM`
4816
4817dflt=$g4vis_none
4818rp=$g4message
4819. ./myread
4820gans=$ans
4821
4822 case $gans in
4823
4824 n*|N*)
4825 g4vis_none=n
4826 ;;
4827 y*|Y*)
4828 g4vis_none=y
4829 ;;
4830 esac
4831
4832case $g4vis_none in
4833
4834n)
4835
4836if test "X$g4system" != "XWIN32-VC" -a "X$g4system" != "XWIN32-VC7"; then
4837
4838g4message=`cat << EOM
4839
4840 G4VIS_BUILD_OPENGLX_DRIVER
4841 G4VIS_USE_OPENGLX
4842
4843It is an interface to the de facto standard 3D graphics library,
4844OpenGL. It is well suited for real-time fast visualization
4845and prototyping. The X11 version of the OpenGL libraries is
4846required.
4847EOM`
4848
4849dflt=$g4vis_use_openglx
4850rp=$g4message
4851. ./myread
4852gans=$ans
4853
4854 case $gans in
4855
4856 n*|N*)
4857 g4vis_build_openglx_driver=n
4858 g4vis_use_openglx=n
4859 ;;
4860 y*|Y*)
4861 g4vis_build_openglx_driver=y
4862 g4vis_use_openglx=y
4863 ;;
4864 esac
4865
4866#############################################3
4867g4message=`cat << EOM
4868
4869 G4VIS_BUILD_OPENGLXM_DRIVER
4870 G4VIS_USE_OPENGLXM
4871
4872It is an interface to the de facto standard 3D graphics library,
4873OpenGL. It is well suited for real-time fast visualization
4874and prototyping. The X11 version of the OpenGL libraries and
4875the Motif Xm extension is required.
4876
4877EOM`
4878
4879dflt=$g4vis_use_openglxm
4880rp=$g4message
4881. ./myread
4882gans=$ans
4883
4884 case $gans in
4885
4886 n*|N*)
4887 g4vis_build_openglxm_driver=n
4888 g4vis_use_openglxm=n
4889 ;;
4890 y*|Y*)
4891 g4vis_build_openglxm_driver=y
4892 g4vis_use_openglxm=y
4893 ;;
4894 esac
4895
4896############################################################
4897#echo xm_dirs=$xm_dirs
4898#echo g4vis_xmhome=$g4vis_xmhome
4899#echo g4ui_build_xm_session=$g4ui_build_xm_session
4900#echo g4vis_build_openglxm_driver=$g4vis_build_openglxm_driver
4901
4902if test "X$g4ui_build_xm_session" = "Xn" ; then
4903
4904#echo PASS1
4905
4906if test "X$g4vis_build_openglxm_driver" = "Xy" ; then
4907
4908#echo PASS2
4909
4910if test "X$g4vis_xmhome" = "X" ; then
4911xm_dirs=`find $g4vis_xmhome /usr/X11R6/include /usr/local/include /usr/include /sw/include -type d -name Xm 2>/dev/null |xargs echo`
4912#echo ogl_dirs=$ogl_dirs
4913
4914if test "X$xm_dirs" != "X" ; then
4915
4916g4xm_base_dir_found=`echo $xm_dirs|cut -d" " -f1`
4917#echo g4ogl_base_dir_found=$g4ogl_base_dir_found
4918
4919# That's right: should be twice! (e.g./usr/local/lib/libGLU.so -> /usr/local)
4920g4xm_base_dir_found=`dirname $g4xm_base_dir_found`
4921g4xm_base_dir_found=`dirname $g4xm_base_dir_found`
4922
4923 g4vis_xmhome=$g4xm_base_dir_found
4924#else
4925#case "$g4vis_xmhome" in
4926#'')
4927# g4vis_xmhome=/usr/X11R6/
4928# ;;
4929#esac
4930fi
4931fi
4932
4933##########################################################################
4934
4935#if test "X$g4vis_xmhome" != "X" ; then
4936#xm_dirs=$g4vis_xmhome
4937#fi
4938
4939if test "X$g4vis_xmhome" != "X" ; then
4940
4941g4message=`cat << EOM
4942
4943You have selected to use OPENGLXM driver.
4944Specify the correct path where Xm is installed in your system.
4945It was found in $g4vis_xmhome. Press [Enter] to set this path or type the correct one.
4946
4947You can set '-' (without quotation) to CANCEL the XM flag at all:
4948
4949EOM`
4950
4951dflt=$g4vis_xmhome
4952fn='d~(-)'
4953rp=$g4message
4954. ./getfile
4955
4956cend="no"
4957while test "$cend" = "no" ; do
4958if test -e "$ans/include/Xm" || [ "X$ans" = "X-" ]; then
4959cend="yes"
4960if test "X$ans" != "X-" ; then
4961
4962g4vis_xmhome=$ans
4963
4964else
4965
4966g4vis_build_openglxm_driver=n
4967g4vis_use_openglxm=n
4968
4969fi
4970else
4971
4972g4message=`cat << EOM
4973
4974You have selected to use OPENGLXM driver.
4975But it was not found in $ans.
4976Please specify the correct path where Xm is installed in your system.
4977
4978You can set '-' (without quotation) to CANCEL the XM flag at all:
4979
4980EOM`
4981
4982dflt=""
4983fn='d~(-)'
4984rp=$g4message
4985. ./getfile
4986fi
4987done
4988
4989else
4990
4991g4message=`cat << EOM
4992
4993You have selected to use OPENGLXM driver.
4994But it was not found in expected place.
4995Please specify the correct path where Xm is installed in your system.
4996
4997You can set '-' (without quotation) to CANCEL the XM flag at all:
4998
4999EOM`
5000
5001dflt=""
5002fn='d~(-)'
5003rp=$g4message
5004. ./getfile
5005
5006cend="no"
5007while test "$cend" = "no" ; do
5008if test -e "$ans/include/Xm" || [ "X$ans" = "X-" ]; then
5009cend="yes"
5010if test "X$ans" != "X-" ; then
5011
5012g4vis_xmhome=$ans
5013
5014else
5015
5016g4vis_build_openglxm_driver=n
5017g4vis_use_openglxm=n
5018
5019fi
5020else
5021
5022g4message=`cat << EOM
5023
5024You have selected to use OPENGLXM driver.
5025But it was not found in $ans.
5026Please specify the correct path where Xm is installed in your system.
5027
5028You can set '-' (without quotation) to CANCEL the XM flag at all:
5029
5030EOM`
5031
5032dflt=""
5033fn='d~(-)'
5034rp=$g4message
5035. ./getfile
5036fi
5037done
5038fi
5039
5040if test "X$g4osname" = "XLinux"; then
5041
5042if test "X$g4vis_xmhome" = "X/usr" -o "X$g4vis_xmhome" = "X/usr/local" ; then
5043g4vis_xmhome=""
5044fi
5045fi
5046fi # g4vis_build_opheglxm_driver
5047
5048###############################################
5049# Set XMFLAGS and XMLIBS
5050#
5051
5052if test "X$g4vis_build_openglxm_driver" = "Xy" ; then
5053
5054if test "X$g4osname" = "XAIX" ; then
5055g4vis_xmflags=" -I$g4vis_xmhome/include "
5056g4vis_xmlibs=" -L$g4vis_xmhome/lib -lXm -lXt -lX11 "
5057fi
5058
5059if test "X$g4osname" = "XLinux" ; then
5060g4vis_xmflags=" -I$g4vis_xmhome/include "
5061 if test "X$g4vis_xmhome" = "X/usr/X11R6" ; then
5062 g4vis_xmlibs=" -lXm -lXpm "
5063 else
5064 g4vis_xmlibs=" -L$g4vis_xmhome/lib -lXm -lXpm "
5065 fi
5066fi
5067
5068if test "X$g4osname" = "XDarwin" ; then
5069g4vis_xmflags=" -I$g4vis_xmhome/include "
5070g4vis_xmlibs=" -L$g4vis_xmhome/lib -lXm -lXpm "
5071fi
5072
5073if test "X$g4osname" = "XDEC" ; then
5074g4vis_xmflags=" -I$g4vis_xmhome/include "
5075g4vis_xmlibs=" -L$g4vis_xmhome/lib -lXm "
5076fi
5077
5078if test "X$g4osname" = "XHP" ; then
5079g4vis_xmflags=" -I$g4vis_xmhome/include/Motif1.2 "
5080g4vis_xmlibs=" -L$g4vis_xmhome/lib/Motif1.2 -lXm "
5081fi
5082
5083if test "X$g4osname" = "XSGI" ; then
5084g4vis_xmflags=" -I$g4vis_xmhome/include "
5085g4vis_xmlibs=" -L$g4vis_xmhome/lib -lXm "
5086fi
5087
5088if test "X$g4osname" = "XSUN" ; then
5089g4vis_xmflags=" -I$g4vis_xmhome/include "
5090g4vis_xmlibs=" -L$g4vis_xmhome/lib -L/usr/openwin/lib -L/usr/dt/lib -L/usr/ucblib -R/usr/openwin/lib -lXt -lXm -lX11 "
5091fi
5092
5093fi # end of XM build
5094fi
5095###############################################
5096
5097fi # if !WIN
5098
5099######################################################################
5100if test "X$g4system" = "XWIN32-VC" -o "X$g4system" = "XWIN32-VC7"; then
5101
5102g4message=`cat << EOM
5103
5104 G4VIS_BUILD_OPENGLWIN32_DRIVER
5105 G4VIS_USE_OPENGLWIN32
5106
5107It is an interface to the de facto standard 3D graphics library,
5108OpenGL. It is well suited for real-time fast visualization
5109and prototyping. The Windows version of the OpenGL libraries is
5110required.
5111
5112EOM`
5113
5114dflt=$g4vis_use_openglwin32
5115rp=$g4message
5116. ./myread
5117gans=$ans
5118
5119 case $gans in
5120
5121 n*|N*)
5122 g4vis_build_openglwin32_driver=n
5123 g4vis_use_openglwin32=n
5124 ;;
5125 y*|Y*)
5126 g4vis_build_openglwin32_driver=y
5127 g4vis_use_openglwin32=y
5128 ;;
5129 esac
5130
5131fi # if WIN
5132###########################################
5133
5134if test "X$g4system" != "XWIN32-VC" -a "X$g4system" != "XWIN32-VC7"; then
5135
5136g4message=`cat << EOM
5137
5138 G4VIS_BUILD_DAWN_DRIVER
5139 G4VIS_USE_DAWN
5140
5141DAWN drivers are interfaces to the Fukui Renderer DAWN. DAWN is
5142a vectorized 3D PostScript processor suited to prepare technical
5143high quality outputs for presentation and/or documentation.
5144
5145EOM`
5146
5147dflt=$g4vis_use_dawn
5148rp=$g4message
5149. ./myread
5150gans=$ans
5151
5152 case $gans in
5153
5154 n*|N*)
5155 g4vis_build_dawn_driver=n
5156 g4vis_use_dawn=n
5157 ;;
5158 y*|Y*)
5159 g4vis_build_dawn_driver=y
5160 g4vis_use_dawn=y
5161 ;;
5162 esac
5163
5164
5165#######################################
5166g4message=`cat << EOM
5167
5168 G4VIS_BUILD_OIX_DRIVER
5169 G4VIS_USE_OIX
5170
5171The OpenInventor driver is based on OpenInventor technology
5172for scientific visualization.
5173The X11 version of OpenInventor is required.
5174
5175EOM`
5176
5177dflt=$g4vis_use_oix
5178rp=$g4message
5179. ./myread
5180gans=$ans
5181
5182 case $gans in
5183
5184 n*|N*)
5185 g4vis_build_oix_driver=n
5186 g4vis_use_oix=n
5187 ;;
5188 y*|Y*)
5189 g4vis_build_oix_driver=y
5190 g4vis_use_oix=y
5191 ;;
5192 esac
5193
5194############################################################
5195if test "X$g4vis_build_oix_driver" = "Xy" ; then
5196
5197oiv_dirs=`find $g4vis_oivhome /usr/X11R6/include /usr/local/include /usr/include -type d -name Inventor 2>/dev/null|xargs echo`
5198#echo ogl_dirs=$ogl_dirs
5199
5200if test "X$oiv_dirs" != "X" ; then
5201
5202g4oiv_base_dir_found=`echo $oiv_dirs|cut -d" " -f1`
5203#echo g4ogl_base_dir_found=$g4ogl_base_dir_found
5204
5205# That's right: should be twice! (e.g./usr/local/lib/libGLU.so -> /usr/local)
5206g4oiv_base_dir_found=`dirname $g4oiv_base_dir_found`
5207g4oiv_base_dir_found=`dirname $g4oiv_base_dir_found`
5208
5209 g4vis_oivhome=$g4oiv_base_dir_found
5210#else
5211#case "$g4vis_oivhome" in
5212#'')
5213# g4vis_oivhome=/usr
5214# ;;
5215#esac
5216fi
5217
5218##########################################################################
5219
5220#if test "X$g4vis_oivhome" != "X" ; then
5221#oiv_dirs=$g4vis_oivhome
5222#fi
5223
5224if test "X$g4vis_oivhome" != "X" ; then
5225
5226g4message=`cat << EOM
5227
5228 OIVHOME/include
5229 OIVHOME/lib
5230
5231You have selected to use OpenInventor driver.
5232Specify the correct path (OIVHOME) where OpenInventor is installed in your system.
5233It was found in $g4vis_oivhome. Press [Enter] to set this path or type the correct one.
5234
5235You can set '-' (without quotation) to CANCEL the OpenInventor flag at all:
5236
5237EOM`
5238
5239dflt=$g4vis_oivhome
5240fn='d~(-)'
5241rp=$g4message
5242. ./getfile
5243
5244cend="no"
5245while test "$cend" = "no" ; do
5246if test -e "$ans/include/Inventor" || [ "X$ans" = "X-" ]; then
5247cend="yes"
5248if test "X$ans" != "X-" ; then
5249
5250g4vis_oivhome=$ans
5251
5252else
5253
5254g4vis_build_oix_driver=n
5255g4vis_use_oix=n
5256
5257fi
5258else
5259
5260g4message=`cat << EOM
5261
5262 OIVHOME/include
5263 OIVHOME/lib
5264
5265You have selected to use OpenInventor driver.
5266But it was not found in $ans.
5267Please specify the correct path where OpenInventor is installed in your system.
5268
5269You can set '-' (without quotation) to CANCEL the OpenInventor flag at all:
5270
5271EOM`
5272
5273dflt=""
5274fn='d~(-)'
5275rp=$g4message
5276. ./getfile
5277fi
5278done
5279
5280else
5281
5282g4message=`cat << EOM
5283
5284 OIVHOME/include
5285 OIVHOME/lib
5286
5287You have selected to use OpenInventor driver.
5288But it was not found in expected place.
5289Please specify the correct path where OpenInventor is installed in your system.
5290
5291You can set '-' (without quotation) to CANCEL the OpenInventor flag at all:
5292
5293EOM`
5294
5295dflt=""
5296fn='d~(-)'
5297rp=$g4message
5298. ./getfile
5299
5300cend="no"
5301while test "$cend" = "no" ; do
5302if test -e "$ans/include/Inventor" || [ "X$ans" = "X-" ]; then
5303cend="yes"
5304if test "X$ans" != "X-" ; then
5305
5306g4vis_oivhome=$ans
5307
5308else
5309
5310g4vis_build_oix_driver=n
5311g4vis_use_oix=n
5312
5313fi
5314else
5315
5316g4message=`cat << EOM
5317
5318 OIVHOME/include
5319 OIVHOME/lib
5320
5321You have selected to use OpenInventor driver.
5322But it was not found in $ans.
5323Please specify the correct path where OpenInventor is installed in your system.
5324
5325You can set '-' (without quotation) to CANCEL the OpenInventor flag at all:
5326
5327EOM`
5328
5329dflt=""
5330fn='d~(-)'
5331rp=$g4message
5332. ./getfile
5333fi
5334done
5335fi
5336
5337if test "X$g4osname" = "XLinux"; then
5338
5339if test "X$g4vis_oivhome" = "X/usr" -o "X$g4vis_oivhome" = "X/usr/local"; then
5340g4vis_oivhome=""
5341fi
5342fi
5343fi # g4vis_build_oix_driver
5344
5345###############################################
5346
5347g4message=`cat << EOM
5348
5349 G4VIS_BUILD_RAYTRACERX_DRIVER
5350 G4VIS_USE_RAYTRACERX
5351
5352Allows for interactive ray-tracing graphics through X11.
5353The X11 package is required.
5354
5355EOM`
5356
5357dflt=$g4vis_use_raytracerx
5358rp=$g4message
5359. ./myread
5360gans=$ans
5361
5362 case $gans in
5363
5364 n*|N*)
5365 g4vis_build_raytracerx_driver=n
5366 g4vis_use_raytracerx=n
5367 ;;
5368 y*|Y*)
5369 g4vis_build_raytracerx_driver=y
5370 g4vis_use_raytracerx=y
5371 ;;
5372 esac
5373
5374########################################################
5375fi # if !WIN
5376
5377###############################################################
5378if test "X$g4system" = "XWIN32-VC" -o "X$g4system" = "XWIN32-VC7"; then
5379
5380g4message=`cat << EOM
5381
5382 G4VIS_BUILD_OIWIN32_DRIVER
5383 G4VIS_USE_OIWIN32
5384
5385Specifies to build and use the driver for the free X11 version of
5386OpenInventor on Windows systems.
5387The Windows version of OpenInventor is required.
5388
5389EOM`
5390
5391dflt=$g4vis_use_oiwin32
5392rp=$g4message
5393. ./myread
5394gans=$ans
5395
5396 case $gans in
5397
5398 n*|N*)
5399 g4vis_build_oiwin32_driver=n
5400 g4vis_use_oiwin32=n
5401 ;;
5402 y*|Y*)
5403 g4vis_build_oiwin32_driver=y
5404 g4vis_use_oiwin32=y
5405 ;;
5406 esac
5407
5408############################################################
5409if test "X$g4vis_build_oiwin32_driver" = "Xy" ; then
5410
5411oiv_dirs=`find $g4vis_oivhome /usr/X11R6/include /usr/local/include /usr/include -type d -name Inventor 2>/dev/null|xargs echo`
5412#echo ogl_dirs=$ogl_dirs
5413
5414if test "X$oiv_dirs" != "X" ; then
5415
5416g4oiv_base_dir_found=`echo $oiv_dirs|cut -d" " -f1`
5417#echo g4ogl_base_dir_found=$g4ogl_base_dir_found
5418
5419# That's right: should be twice! (e.g./usr/local/lib/libGLU.so -> /usr/local)
5420g4oiv_base_dir_found=`dirname $g4oiv_base_dir_found`
5421g4oiv_base_dir_found=`dirname $g4oiv_base_dir_found`
5422
5423 g4vis_oivhome=$g4oiv_base_dir_found
5424#else
5425#case "$g4vis_oivhome" in
5426#'')
5427# g4vis_oivhome=/usr
5428# ;;
5429#esac
5430fi
5431
5432##########################################################################
5433
5434#if test "X$g4vis_oivhome" != "X" ; then
5435#oiv_dirs=$g4vis_oivhome
5436#fi
5437
5438if test "X$g4vis_oivhome" != "X" ; then
5439
5440g4message=`cat << EOM
5441
5442 OIVHOME/include
5443 OIVHOME/lib
5444
5445You have selected to use OpenInventor driver.
5446Specify the correct path (OIVHOME) where OpenInventor is installed in your system.
5447It was found in $g4vis_oivhome. Press [Enter] to set this path or type the correct one.
5448
5449You can set '-' (without quotation) to CANCEL the OpenInventor flag at all:
5450
5451EOM`
5452
5453dflt=$g4vis_oivhome
5454fn='d~(-)'
5455rp=$g4message
5456. ./getfile
5457
5458cend="no"
5459while test "$cend" = "no" ; do
5460if test -e "$ans/include/Inventor" || [ "X$ans" = "X-" ]; then
5461cend="yes"
5462if test "X$ans" != "X-" ; then
5463
5464g4vis_oivhome=$ans
5465
5466else
5467
5468g4vis_build_oiwin32_driver=n
5469g4vis_use_oiwin32=n
5470
5471fi
5472else
5473
5474g4message=`cat << EOM
5475
5476 OIVHOME/include
5477 OIVHOME/lib
5478
5479You have selected to use OpenInventor driver.
5480But it was not found in $ans.
5481Please specify the correct path where OpenInventor is installed in your system.
5482
5483You can set '-' (without quotation) to CANCEL the OpenInventor flag at all:
5484
5485EOM`
5486
5487dflt=""
5488fn='d~(-)'
5489rp=$g4message
5490. ./getfile
5491fi
5492done
5493
5494else
5495
5496g4message=`cat << EOM
5497
5498 OIVHOME/include
5499 OIVHOME/lib
5500
5501You have selected to use OpenInventor driver.
5502But it was not found in expected place.
5503Please specify the correct path where OpenInventor is installed in your system.
5504
5505You can set '-' (without quotation) to CANCEL the OpenInventor flag at all:
5506
5507EOM`
5508
5509dflt=""
5510fn='d~(-)'
5511rp=$g4message
5512. ./getfile
5513
5514cend="no"
5515while test "$cend" = "no" ; do
5516if test -e "$ans/include/Inventor" || [ "X$ans" = "X-" ]; then
5517cend="yes"
5518if test "X$ans" != "X-" ; then
5519
5520g4vis_oivhome=$ans
5521
5522else
5523
5524g4vis_build_oiwin32_driver=n
5525g4vis_use_oiwin32=n
5526
5527fi
5528else
5529
5530g4message=`cat << EOM
5531
5532 OIVHOME/include
5533 OIVHOME/lib
5534
5535You have selected to use OpenInventor driver.
5536But it was not found in $ans.
5537Please specify the correct path where OpenInventor is installed in your system.
5538
5539You can set '-' (without quotation) to CANCEL the OpenInventor flag at all:
5540
5541EOM`
5542
5543dflt=""
5544fn='d~(-)'
5545rp=$g4message
5546. ./getfile
5547fi
5548done
5549fi
5550
5551if test "X$g4osname" = "XLinux"; then
5552
5553if test "X$g4vis_oivhome" = "X/usr" -o "X$g4vis_oivhome" = "X/usr/local"; then
5554g4vis_oivhome=""
5555fi
5556fi
5557fi # g4vis_build_oiwin32_driver
5558
5559###############################################
5560
5561fi # if WIN
5562################################################################
5563
5564if test "X$g4system" != "XWIN32-VC" -a "X$g4system" != "XWIN32-VC7"; then
5565
5566g4message=`cat << EOM
5567
5568 G4VIS_BUILD_DAWNFILE_DRIVER
5569 G4VIS_USE_DAWNFILE
5570
5571DAWN drivers are interfaces to Fukui Renderer DAWN. It is a vectorized 3D
5572PostScript processor, and so well suited to prepare technical high
5573quality outputs for presentation and/or documentation.
5574The DAWNFILE driver sends 3D data to DAWN via an intermediate file,
5575named g4.prim in the current directory. The file g4.prim is able to
5576be re-visualized later without the help of Geant4.
5577EOM`
5578
5579dflt=$g4vis_use_dawnfile
5580rp=$g4message
5581#. ./myread
5582#gans=$ans
5583gans=y
5584
5585 case $gans in
5586
5587 n*|N*)
5588 g4vis_build_dawnfile_driver=n
5589 g4vis_use_dawnfile=n
5590 ;;
5591 y*|Y*)
5592 g4vis_build_dawnfile_driver=y
5593 g4vis_use_dawnfile=y
5594 ;;
5595 esac
5596
5597g4message=`cat << EOM
5598
5599 G4VIS_BUILD_RAYTRACER_DRIVER
5600 G4VIS_USE_RAYTRACER
5601
5602It performs ray-tracing visualization using the tracking routines of Geant4.
5603It is, therefore, available for debugging tracking routines.
5604It is well suited for photo-realistic high quality output for
5605presentation, and for intuitive debugging of detector geometry.
5606EOM`
5607
5608dflt=$g4vis_use_raytracer
5609rp=$g4message
5610#. ./myread
5611#gans=$ans
5612gans=y
5613
5614 case $gans in
5615
5616 n*|N*)
5617 g4vis_build_raytracer_driver=n
5618 g4vis_use_raytracer=n
5619 ;;
5620 y*|Y*)
5621 g4vis_build_raytracer_driver=y
5622 g4vis_use_raytracer=y
5623 ;;
5624 esac
5625
5626g4message=`cat << EOM
5627
5628 G4VIS_BUILD_VRML_DRIVER
5629 G4VIS_USE_VRML
5630
5631These driver generate VRML files, which describe 3D scenes to be
5632visualized with a proper VRML viewer.
5633
5634EOM`
5635
5636dflt=$g4vis_use_vrml
5637rp=$g4message
5638. ./myread
5639gans=$ans
5640
5641 case $gans in
5642
5643 n*|N*)
5644 g4vis_build_vrml_driver=n
5645 g4vis_use_vrml=n
5646 ;;
5647 y*|Y*)
5648 g4vis_build_vrml_driver=y
5649 g4vis_use_vrml=y
5650 ;;
5651 esac
5652
5653g4message=`cat << EOM
5654
5655 G4VIS_BUILD_VRMLFILE_DRIVER
5656 G4VIS_USE_VRMLFILE
5657
5658This driver generates VRML files, which describe 3D scenes to be
5659visualized with a proper VRML viewer, at either a local or a remote host.
5660The VRMLFILE driver sends 3D data to your VRML viewer, which is running
5661in the same host machine as Geant4, via an intermediate file named
5662g4.wrl created in the current directory. This file is available for
5663re-visualization afterwards. In visualization, you should specify a
5664name of the VRML viewer by setting the environment variable G4VRML_VIEWER
5665beforehand.
5666EOM`
5667
5668dflt=$g4vis_use_vrmlfile
5669rp=$g4message
5670#. ./myread
5671#gans=$ans
5672gans=y
5673
5674 case $gans in
5675
5676 n*|N*)
5677 g4vis_build_vrmlfile_driver=n
5678 g4vis_use_vrmlfile=n
5679 ;;
5680 y*|Y*)
5681 g4vis_build_vrmlfile_driver=y
5682 g4vis_use_vrmlfile=y
5683 ;;
5684 esac
5685
5686fi # if !WIN
5687
5688g4message=`cat << EOM
5689
5690 G4VIS_BUILD_ASCIITREE_DRIVER
5691 G4VIS_USE_ASCIITREE
5692
5693Description????????????????????????
5694EOM`
5695
5696dflt=$g4vis_use_asciitree
5697rp=$g4message
5698# Don't ask by default and set to 'y'!
5699#. ./myread
5700#gans=$ans
5701gans=y
5702
5703 case $gans in
5704
5705 n*|N*)
5706 g4vis_build_asciitree_driver=n
5707 g4vis_use_asciitree=n
5708 ;;
5709 y*|Y*)
5710 g4vis_build_asciitree_driver=y
5711 g4vis_use_asciitree=y
5712 ;;
5713 esac
5714
5715
5716g4message=`cat << EOM
5717
5718 G4VIS_BUILD_GAGTREE_DRIVER
5719 G4VIS_USE_GAGTREE
5720
5721Description????????????????????????
5722EOM`
5723
5724dflt=$g4vis_use_gagtree
5725rp=$g4message
5726# Don't ask by default and set to 'y'!
5727#. ./myread
5728#gans=$ans
5729gans=y
5730
5731 case $gans in
5732
5733 n*|N*)
5734 g4vis_build_gagtree_driver=n
5735 g4vis_use_gagtree=n
5736 ;;
5737 y*|Y*)
5738 g4vis_build_gagtree_driver=y
5739 g4vis_use_gagtree=y
5740 ;;
5741 esac
5742
5743;;
5744esac
5745
5746if test "X$g4system" != "XWIN32-VC" -a "X$g4system" != "XWIN32-VC7" -a "X$g4system" != "XDarwin-g++"; then
5747
5748#echo PASS1
5749
5750if [ X$g4vis_build_openglx_driver = Xy ] || [ X$g4vis_build_openglxm_driver = Xy ] || [ X$g4vis_build_openglwin32_driver = Xy ] ; then
5751
5752#echo PASS2
5753
5754#####################################################################
5755ogl_dirs=`find $g4vis_oglhome /usr/X11R6/include /usr/local/include /usr/include -type d -name GL 2>/dev/null|xargs echo`
5756#echo ogl_dirs=$ogl_dirs
5757
5758if test "X$ogl_dirs" != "X" ; then
5759
5760g4ogl_base_dir_found=`echo $ogl_dirs|cut -d" " -f1`
5761#echo g4ogl_base_dir_found=$g4ogl_base_dir_found
5762
5763# That's right: should be twice! (e.g./usr/local/lib/libGLU.so -> /usr/local)
5764g4ogl_base_dir_found=`dirname $g4ogl_base_dir_found`
5765g4ogl_base_dir_found=`dirname $g4ogl_base_dir_found`
5766
5767 g4vis_oglhome=$g4ogl_base_dir_found
5768#else
5769#case "$g4vis_oglhome" in
5770#'')
5771# g4vis_oglhome=/usr
5772# ;;
5773#esac
5774fi
5775
5776##########################################################################
5777if test "X$g4vis_oglhome" != "X" ; then
5778ogl_dirs=$g4vis_oglhome
5779fi
5780
5781if test "X$ogl_dirs" != "X" ; then
5782
5783g4message=`cat << EOM
5784
5785 OGLHOME/include
5786 OGLHOME/lib
5787
5788You have selected to use OpenGL driver.
5789Specify the correct path (OGLHOME) where OpenGL is installed in your system.
5790It was found in $g4vis_oglhome. Press [Enter] to set this path or type the correct one.
5791
5792You can set '-' (without quotation) to CANCEL the OpenGL flag at all:
5793
5794EOM`
5795
5796dflt=$g4vis_oglhome
5797fn='d~(-)'
5798rp=$g4message
5799. ./getfile
5800
5801cend="no"
5802while test "$cend" = "no" ; do
5803if test -e "$ans/include/GL" || [ "X$ans" = "X-" ]; then
5804cend="yes"
5805
5806if test "X$ans" != "X-" ; then
5807
5808g4vis_oglhome=$ans
5809
5810else
5811
5812g4vis_build_openglx_driver=n
5813g4vis_use_openglx=n
5814
5815g4vis_build_openglxm_driver=n
5816g4vis_use_openglxm=n
5817
5818g4vis_build_openglwin32_driver=n
5819g4vis_use_openglwin32=n
5820
5821fi
5822else
5823
5824g4message=`cat << EOM
5825
5826 OGLHOME/include
5827 OGLHOME/lib
5828
5829You have selected to use OpenGL driver.
5830But it was not found in $ans.
5831Please specify the correct path where OpenGL is installed in your system.
5832
5833You can set '-' (without quotation) to CANCEL the OpenGL flag at all:
5834
5835EOM`
5836
5837dflt=""
5838fn='d~(-)'
5839rp=$g4message
5840. ./getfile
5841fi
5842done
5843
5844else
5845
5846g4message=`cat << EOM
5847
5848 OGLHOME/include
5849 OGLHOME/lib
5850
5851You have selected to use OpenGL driver.
5852But it was not found in expected place.
5853Please specify the correct path where OpenGL is installed in your system.
5854
5855You can set '-' (without quotation) to CANCEL the OpenGL flag at all:
5856
5857EOM`
5858
5859dflt=""
5860fn='d~(-)'
5861rp=$g4message
5862. ./getfile
5863
5864cend="no"
5865while test "$cend" = "no" ; do
5866if test -e "$ans/include/GL" || [ "X$ans" = "X-" ]; then
5867cend="yes"
5868
5869if test "X$ans" != "X-" ; then
5870
5871g4vis_oglhome=$ans
5872
5873else
5874
5875g4vis_build_openglx_driver=n
5876g4vis_use_openglx=n
5877
5878g4vis_build_openglxm_driver=n
5879g4vis_use_openglxm=n
5880
5881g4vis_build_openglwin32_driver=n
5882g4vis_use_openglwin32=n
5883
5884fi
5885else
5886
5887g4message=`cat << EOM
5888
5889 OGLHOME/include
5890 OGLHOME/lib
5891
5892You have selected to use OpenGL driver.
5893But it was not found in $ans.
5894Please specify the correct path where OpenGL is installed in your system.
5895
5896You can set '-' (without quotation) to CANCEL the OpenGL flag at all:
5897
5898EOM`
5899
5900dflt=""
5901fn='d~(-)'
5902rp=$g4message
5903. ./getfile
5904fi
5905done
5906
5907fi
5908
5909if test "X$g4osname" = "XLinux"; then
5910
5911if test "X$g4vis_oglhome" = "X/usr" -o "X$g4vis_oglhome" = "X/usr/local"; then
5912g4vis_oglhome=""
5913fi
5914
5915fi # if platform (Linux vs SUN)
5916
5917fi # if need
5918###########################################
5919fi # if platform (Unix vs Win)
5920
5921#
5922# BEGIN QTVIS/QT PROBE
5923#
5924
5925#
5926# We only run on a Linux-g++ or Darwin-g++ system
5927#
5928if test "x$g4system" = "xLinux-g++" -o "x$g4system" = "xDarwin-g++" ; then
5929
5930 # Only proceed further if g4vis_none is not set
5931 if test "x$g4vis_none" = "xn" ; then
5932 #Query the user on whether to activate the module
5933 g4message=`cat << EOM
5934
5935 G4VIS_BUILD_OPENGLQT_DRIVER
5936 G4VIS_USE_OPENGLQT
5937
5938Setting these variables will enable the building of the G4 OpenGL Qt based
5939visualisation driver and the use of this driver in your applications
5940respectively.
5941The Qt headers, libraries and binaries are required to enable the
5942building of this module.
5943Do you want to enable build and use of this module?
5944EOM`
5945
5946 #Read the user response
5947 dflt=$g4vis_build_openglqt_driver
5948 rp=$g4message
5949 . ./myread
5950 gans=$ans
5951
5952 #
5953 # Check response
5954 #
5955 case $gans in
5956 n*|N*)
5957 g4vis_build_openglqt_driver=n
5958 g4vis_use_openglqt=n
5959 ;;
5960 y*|Y*)
5961 g4vis_build_openglqt_driver=y
5962 g4vis_use_openglqt=y
5963 ;;
5964 esac
5965
5966 ###################
5967
5968
5969
5970 ####################################################################
5971 # Now, if we have selected to build the driver, we need to check for
5972 # a Qt installation, which may have been done for use by the UI
5973 # module...
5974 #
5975 if test "x$g4vis_build_openglqt_driver" = "xy" ; then
5976
5977 #Now check whether g4_qthome has been set previously - if it hasn't
5978 #proceed to probe for Qt... (assume it's unfiltered, i.e. not
5979 #set to '' by earlier probe if it was /usr or /usr/local
5980 if test "x$g4_qtmochome" != "x" && test "x$g4_qtlibdir" != "x" && test "x$g4_qtincdir" != "x" ; then
5981 echo " "
5982 echo "configure: Qt preconfigured, no recheck neccessary"
5983 else
5984 #################################################################
5985 #We repeat the search used for the UI module
5986
5987 echo " "
5988 g4_havegoodqt=no
5989
5990 # Look for qt4 moc
5991 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`
5992 if test "x$g4_qtmochome" = "xno" ; then
5993 # Look for qt3 moc
5994 g4_qtmochome=`./loc moc no /usr/lib/qt3/bin /usr/share/qt3/bin`
5995 fi
5996
5997 # if not found
5998 if test "x$g4_qtmochome" = "xno" ; then
5999 g4_havegoodqt=no
6000 else
6001 # check Qt version
6002 g4_qtver=`$g4_qtmochome 2>&1 -v | $sed 's/.* .Qt \([0-9]\)\..*/\1/' `
6003 echo "checking Qt version... $g4_qtver"
6004 if test "x$g4_qtver" = "x2";then
6005 echo "Qt $g4_qtver is too old to work with this driver"
6006 g4_havegoodqt=no
6007 fi
6008 if test "x$g4_qtver" = "x5";then
6009 echo "Qt $g4_qtver is not actually support with this driver"
6010 g4_havegoodqt=no
6011 else
6012
6013
6014 # checking includes
6015
6016 incQtFiles=" $QTDIR/include /usr/lib/qt$g4_qtver/include /usr/include/qt$g4_qtver /usr/X11R6/include /sw/include/qt /usr/include/qt$g4_qtver /usr/share/qt$g4_qtver/include /usr/X11R6/include/qt$g4_qtver /usr/lib/qt/include /usr/local/qt/include /usr/local/include /usr/include /usr/include/qt /usr/X11R6/include/qt"
6017
6018 if test "X$g4osname" = "XDarwin" ; then
6019 if test "X$g4_qtver" = "X3" ; then
6020 g4_qtincdir=`./loc qglobal.h no $incQtFiles`
6021 else
6022 g4_qtincdir=`./loc qglobal.h no /Library/Frameworks/QtCore.framework/Headers/ $incFiles`
6023 if test "x$g4_qtincdir" != "xno" ; then
6024 g4_qtincdir="/Library/Frameworks/"
6025 fi
6026 fi
6027 else
6028 g4_qtincdir=`./loc qglobal.h no $incFiles`
6029 fi #END CHECK QTLIBS
6030
6031
6032 if test "x$g4_qtincdir" != "xno" ; then
6033 if test "x$g4_qtincdir" != "x/Library/Frameworks/" ; then
6034 g4_qtincdir=`dirname $g4_qtincdir`
6035 fi
6036 echo "checking Qt includes dir in... $g4_qtincdir"
6037
6038
6039 # checking libs
6040
6041 libQtFiles="$QTDIR/lib /usr/lib/qt$g4_qtver/lib /usr/lib/qt$g4_qtver /usr/lib/qt$g4_qtver /sw/lib/qt$g4_qtver /sw/lib/qt$g4_qtver/lib /usr/share/qt$g4_qtver/lib /usr/X11R6/lib/qt /usr/X11R6/lib/qt$g4_qtver /usr/lib/qt$g4_qtver/lib64 $QTDIR/lib64 /usr/lib/qt/lib /usr/local/qt/lib /usr/local/lib /usr/lib /usr/lib/qt /usr/X11R6/lib /usr/X11R6/lib/qt $QTDIR/lib64"
6042
6043 if test "X$g4osname" = "XDarwin" ; then
6044 if test "X$g4_qtincdir" = "X/Library/Frameworks/" ; then
6045 g4_qtlibdir="/Library/Frameworks/"
6046 else
6047 g4_qtlibdir=`./loc libqt* no $libQtFiles /sw/lib /sw/lib/qt`
6048 fi
6049 else
6050 g4_qtlibdir=`./loc libqt* no $libQtFiles`
6051 fi
6052 if test "x$g4_qtlibdir" != "xno" ; then
6053 if test "x$g4_qtlibdir" != "x/Library/Frameworks/" ; then
6054 g4_qtlibdir=`dirname $g4_qtlibdir`
6055 fi
6056 echo "checking Qt lib dir in... $g4_qtlibdir"
6057 g4_havegoodqt=yes
6058 fi
6059 fi #END CHECK QTLIBS
6060 fi #END CHECK QTINC
6061 fi #END CHECK QTVER
6062 #
6063 # END QT AUTOPROBE
6064 ####################################################################
6065
6066
6067 # Based on result of Qt autoprobe, we decide if user input is
6068 # needed to locate Qt...
6069 #
6070 if test "x$g4_havegoodqt" = "xno" ; then
6071 promptend="no"
6072 qthomeloc="the standard locations"
6073
6074 while test "x$promptend" = "xno" ; do
6075 g4message=`cat << EOM
6076
6077Autodetection failed to locate Qt in $qthomeloc on your system.
6078Please enter the path to your Qt install (i.e. if Qt is installed
6079in PATH/include/Qt, or PATH/include, enter PATH), or type '-' to
6080CANCEL the build of the Qt UI module.
6081Qt path:
6082EOM`
6083 dflt="/usr"
6084 fn='d~(-)'
6085 rp=$g4message
6086 . ./getfile
6087
6088 #Check for user cancellation
6089 if test "x$ans" = "x-" ; then
6090 g4ui_build_qt_session=n
6091 g4ui_use_qt=n
6092 g4_qthome=""
6093 echo "build/use of OpenGl Qt driver cancelled..."
6094 promptend=yes
6095
6096 else
6097 #We want to probe for Qt in the user supplied directory
6098 echo " "
6099 qthomeloc=$ans
6100 g4_havegoodqt=no
6101 g4_qthome=`./loc qglobal.h no $ans/include/Qt $ans/include`
6102
6103 echo "checking for Qt installation... $g4_qthome"
6104
6105 #If we found an installation, proceed to other tests.
6106 if test "x$g4_qthome" != "xno" ; then
6107 #Set Qt installation to good at this point
6108 g4_havegoodqt=yes
6109
6110 #Check that this is Qt...
6111 g4_qtver=`$grep QT_VERSION_STR $g4_qthome | $sed 's/.* \"\([0-9]\)\..*\"/\1/'`
6112
6113 echo "checking Qt version... $g4_qtver"
6114
6115 #Now strip qthome back so we can check for moc...
6116 g4_qthome=`dirname $g4_qthome`
6117
6118 #At this point we could have include/Qt
6119 #or include
6120 if test `basename $g4_qthome` = "Qt" ; then
6121 g4_qthome=`dirname $g4_qthome`
6122 g4_qthome=`dirname $g4_qthome`
6123 else
6124 g4_qthome=`dirname $g4_qthome`
6125 fi
6126
6127 #If version is o.k, check for moc
6128 if test "x$g4_qtver" = "x4" ; then
6129 #Check for moc
6130 g4_qthavemoc=`./loc moc no $g4_qthome/bin`
6131
6132 echo "checking for moc... $g4_qthavemoc"
6133
6134 if test "x$g4_qthavemoc" = "xno" ; then
6135 g4_havegoodqt=no
6136 fi
6137 else
6138 g4_havegoodqt=no
6139 fi #END CHECK Qt VERSION
6140 fi #END CHECK QTHOME
6141
6142 #If we have a good Qt, end prompt
6143 if test "x$g4_havegoodqt" = "xyes" ; then
6144 promptend=yes
6145 fi
6146 fi #END CHECK USER CANCELLATION
6147 done #END USER PROMPT FOR QT DETECTION
6148
6149 fi #END USER DIRECTED QT DETECTION
6150 #
6151 #END QT USER INPUT PROBE
6152 #################################################################
6153 fi #END TEST G4_QTHOME IS SET
6154
6155
6156 fi #END TEST G4VIS_BUILD_OPENGLQT_DRIVER = y
6157
6158
6159 #
6160 # Put a filter in here on /usr and /usr/local as QTHOME in line
6161 # with other paths - done here as this is the last place QT is
6162 # checked for
6163 #DEACTIVATED AT PRESENT BECAUSE OF USE OF MOC
6164 #
6165 #if test "x$g4_qthome" = "x/usr" -o "x$g4_qthome" = "x/usr/local" ; then
6166 # g4_qthome=""
6167 #fi
6168
6169
6170 fi #END TEST G4VIS_NONE IS N
6171
6172fi #END TEST G4SYSTEM IS Linux-g++ OR Darwin-g++
6173
6174#
6175# END OF QTVIS/QT PROBE
6176
6177#
6178# BEGIN GDML/XERCESC PROBE
6179#
6180
6181# Set default build option to no
6182echo " "
6183case "$g4lib_build_gdml" in
6184'')
6185 g4lib_build_gdml=n
6186 ;;
6187esac
6188
6189
6190# Now query the user to see if they want to build the GDML plugin
6191echo ""
6192
6193g4message=`cat << EOM
6194
6195 G4LIB_BUILD_GDML
6196
6197Setting this variable will enable building of the GDML plugin module embedded
6198in Geant4 for detector description persistency.
6199It requires your system to have the XercesC library and headers installed.
6200Do you want to set this variable?
6201
6202EOM`
6203
6204#
6205# read in the users response
6206#
6207dflt=$g4lib_build_gdml
6208rp=$g4message
6209. ./myread
6210gans=$ans
6211
6212#
6213# Check response
6214#
6215case $gans in
6216 n*|N*)
6217 g4lib_build_gdml=n
6218 ;;
6219 y*|Y*)
6220 g4lib_build_gdml=y
6221 ;;
6222esac
6223
6224
6225#
6226# If user does want to build GDML plugin, now try to locate Xerces install
6227#
6228if test "X$g4lib_build_gdml" != "Xn"; then
6229
6230 if test "X$g4gdml_xercesc_root" = "X"; then
6231 #probe for Xerces, using example from UI and Vis
6232 xercesc_root=`find $g4gdml_xercesc_root /usr/include /usr/local/include \
6233/opt/local/include /sw/include -type d -name xercesc 2>/dev/null | xargs echo`
6234
6235 #If we got something, strip off the include/xerces part
6236 if test "X$xercesc_root" != "X"; then
6237 g4gdml_xercesc_root=`dirname $xercesc_root`
6238 g4gdml_xercesc_root=`dirname $g4gdml_xercesc_root`
6239
6240 echo " "
6241 echo "checking for XercesC install... $g4gdml_xercesc_root"
6242 else
6243 g4gdml_xercesc_root=""
6244 echo " "
6245 echo "checking for XercesC install... no"
6246 fi
6247 fi #END OF XERCES AUTOPROBE
6248
6249 #
6250 # If the autoprobe failed, prompt the user to enter the path to the Xerces
6251 # install
6252 #
6253 if test "X$g4gdml_xercesc_root" = "X"; then
6254
6255 promptend="no"
6256 xercesloc="the standard locations"
6257
6258 while test "$promptend" = "no"; do
6259 g4message=`cat << EOM
6260
6261Autodetection failed to locate XercesC in $xercesloc on your system.
6262Please enter the path to your XercesC install (i.e. if XercesC is installed
6263in PATH/include/xercesc, enter PATH), or type '-' to CANCEL the build of the
6264GDML module.
6265XercesC path:
6266EOM`
6267
6268 dflt=$g4gdml_xercesc_root
6269 fn='d~(-)'
6270 rp=$g4message
6271 . ./getfile
6272
6273 #check for user cancellation
6274 if test "X$ans" = "X-"; then
6275 g4lib_build_gdml=n
6276 g4gdml_xercesc_root=""
6277 echo "G4LIB_BUILD_GDML cancelled..."
6278 promptend=yes
6279 else
6280 if test -r "$ans/include/xercesc"; then
6281 g4gdml_xercesc_root=$ans
6282 echo "checking for XercesC install... $g4gdml_xercesc_root"
6283 promptend=yes
6284 else
6285 xercesloc=$ans
6286 echo "checking for Xercesc install... no"
6287 fi
6288 fi #END OF USER INPUT CHECKING
6289 done #END OF WHILE LOOP OVER USER INPUT
6290 fi #END OF USER INPUT SECTION
6291
6292 #
6293 # If a filter on g4gdml_xerces_root is needed to remove common system paths
6294 # then it should be put here...
6295 #
6296 if test "x$g4gdml_xercesc_root" = "x/usr" -o "x$g4gdml_xercesc_root" = "x/usr/local" ; then
6297 g4gdml_xercesc_root=""
6298 fi
6299
6300fi #END XERCES PROBE
6301
6302#END OF GDML/XERCES PROBE
6303
6304echo " "
6305
6306case "$g4make" in
6307'')
6308 g4make=gmake
6309 ;;
6310esac
6311
6312echo ""
6313
6314 g4_gmake_version=`(gmake -v) 2>/dev/null`
6315 case $g4_gmake_version in
6316 GNU*)
6317 g4_gmake=y
6318 ;;
6319 *)
6320 g4_gmake=n
6321 ;;
6322 esac
6323
6324 g4_make_version=`(make -v) 2>/dev/null`
6325 case $g4_make_version in
6326 GNU*)
6327 g4_make=y
6328 ;;
6329 *)
6330 g4_make=n
6331 ;;
6332 esac
6333
6334if [ $g4_gmake = y ] ; then
6335
6336g4make=gmake
6337
6338g4message=`cat << EOM
6339
6340 G4MAKE
6341
6342You have GNU make which could be used to build GEANT4.
6343You can select your own 'make' program if you want.
6344EOM`
6345
6346fi
6347
6348if [ $g4_gmake = n ] && [ $g4_make = y ] ; then
6349
6350g4make=make
6351
6352g4message=`cat << EOM
6353
6354 G4MAKE
6355
6356You have GNU make which could be used to build GEANT4.
6357You can select your own 'make' program if you want.
6358EOM`
6359
6360fi
6361
6362if [ $g4_gmake = n ] && [ $g4_make = n ] ; then
6363
6364g4make=none
6365
6366g4message=`cat << EOM
6367
6368 G4MAKE
6369
6370You have NO GNU make which could be used to build GEANT4.
6371Please select your own 'make' program compatible with GNU make.
6372EOM`
6373
6374dflt=$g4make
6375rp=$g4message
6376
6377
6378. ./myread
6379gans=$ans
6380
6381 case $gans in
6382
6383 '')
6384 g4make=$dflt
6385 ;;
6386 *)
6387 g4make=$gans
6388 ;;
6389 esac
6390
6391fi
6392
6393
6394
6395
6396echo " "
6397case "$g4wlib_build_g3tog4" in
6398'')
6399 g4wlib_build_g3tog4=n
6400 ;;
6401esac
6402
6403case "$g4w_use_g3tog4" in
6404'')
6405 g4w_use_g3tog4=n
6406 ;;
6407esac
6408
6409echo ""
6410
6411g4message=`cat << EOM
6412
6413 G4LIB_BUILD_G3TOG4
6414
6415The utility module 'g3tog4' will be built by setting this
6416variable. NOTE: it requires a valid FORTRAN compiler to be
6417installed on your system and the 'cernlib' command in the
6418path, in order to build the ancillary tools!
6419Do you want to build 'g3tog4' ?
6420
6421EOM`
6422
6423dflt=$g4wlib_build_g3tog4
6424rp=$g4message
6425. ./myread
6426gans=$ans
6427
6428 case $gans in
6429
6430 n*|N*)
6431 g4wlib_build_g3tog4=n
6432 g4w_use_g3tog4=n
6433 ;;
6434 y*|Y*)
6435 g4wlib_build_g3tog4=y
6436 g4w_use_g3tog4=y
6437 ;;
6438 esac
6439
6440
6441echo " "
6442case "$g4wlib_build_zlib" in
6443'')
6444 g4wlib_build_zlib=n
6445 ;;
6446esac
6447
6448case "$g4w_use_zlib" in
6449'')
6450 g4w_use_zlib=n
6451 ;;
6452esac
6453
6454echo ""
6455
6456g4message=`cat << EOM
6457
6458 G4LIB_BUILD_ZLIB
6459
6460Do you want to activate compression for output files
6461generated by the HepRep visualization driver?
6462
6463EOM`
6464
6465dflt=$g4wlib_build_zlib
6466rp=$g4message
6467. ./myread
6468gans=$ans
6469
6470 case $gans in
6471
6472 n*|N*)
6473 g4wlib_build_zlib=n
6474 g4w_use_zlib=n
6475 ;;
6476 y*|Y*)
6477 g4wlib_build_zlib=y
6478 g4w_use_zlib=y
6479 ;;
6480 esac
6481
6482
6483echo " "
6484
6485case "$g4wanalysis_use" in
6486'')
6487 g4wanalysis_use=n
6488 ;;
6489esac
6490
6491echo ""
6492
6493g4message=`cat << EOM
6494
6495 G4ANALYSIS_USE
6496
6497Activates the configuration setup for allowing plugins to
6498analysis tools based on AIDA (Astract Interfaces for Data
6499Analysis). In order to use AIDA features and compliant analysis
6500tools, the proper environment for these tools will have to be
6501set (see documentation for the specific analysis tools).
6502EOM`
6503
6504dflt=$g4wanalysis_use
6505rp=$g4message
6506. ./myread
6507gans=$ans
6508
6509 case $gans in
6510
6511 n*|N*)
6512 g4wanalysis_use=n
6513 ;;
6514 y*|Y*)
6515 g4wanalysis_use=y
6516 ;;
6517 esac
6518
6519
6520: end of configuration questions
6521echo " "
6522echo "End of configuration phase."
6523echo " "
6524
6525: back to where it started
6526if test -d ../../.config/UU; then
6527 cd ../..
6528fi
6529
6530: configuration may be patched via a 'config.over' file
6531if $test -f config.over; then
6532 echo " "
6533 dflt=y
6534 rp='A config.over file exists. Do you wish to load it?'
6535 . .config/UU/myread
6536 case "$ans" in
6537 n*) echo "OK, I'll ignore it.";;
6538 *) . ./config.over
6539 echo "Configuration settings have been loaded."
6540 ;;
6541 esac
6542fi
6543
6544: in case they want portability, strip down executable paths
6545case "$d_portable" in
6546"$define")
6547 echo " "
6548 echo "Stripping down executable paths..." >&4
6549 for file in $loclist $trylist; do
6550 eval $file="\$file"
6551 done
6552 ;;
6553esac
6554
6555: create config.sh file
6556echo " "
6557echo "Creating configuration setup file..." >&4
6558mkdir -p $g4conf
6559$spitshell <<EOT > $g4conf/config.sh
6560$startsh
6561#
6562# This file was produced by running the Configure script. It holds all the
6563# definitions figured out by Configure. Should you modify one of these values,
6564# do not forget to propagate your changes by running "Configure -der". You may
6565# instead choose to run each of the .SH files by yourself, or "Configure -S".
6566#
6567
6568# Package name : $package
6569# Source directory : $src
6570# Configuration time: $cf_time
6571# Configured by : $cf_by
6572# Target system : $myuname
6573
6574Author='$Author'
6575Date='$Date'
6576Header='$Header'
6577Id='$Id'
6578Locker='$Locker'
6579Log='$Log'
6580RCSfile='$RCSfile'
6581Revision='$Revision'
6582Source='$Source'
6583State='$State'
6584c='$c'
6585cf_by='$cf_by'
6586cf_time='$cf_time'
6587contains='$contains'
6588d_portable='$d_portable'
6589eunicefix='$eunicefix'
6590g4_gmake='$g4_gmake'
6591g4_gmake_version='$g4_gmake_version'
6592g4_make='$g4_make'
6593g4_make_version='$g4_make_version'
6594g4_qtmochome='$g4_qtmochome'
6595g4_qtincdir='$g4_qtincdir'
6596g4_qtlibdir='$g4_qtlibdir'
6597g4abladata='$g4abladata'
6598g4base='$g4base'
6599g4bin='$g4bin'
6600g4clhep_base_dir='$g4clhep_base_dir'
6601g4clhep_include_dir='$g4clhep_include_dir'
6602g4clhep_lib='$g4clhep_lib'
6603g4clhep_lib_dir='$g4clhep_lib_dir'
6604g4compiler='$g4compiler'
6605g4conf='$g4conf'
6606g4data='$g4data'
6607g4debug='$g4debug'
6608g4elasticdata='$g4elasticdata'
6609g4final_install='$g4final_install'
6610g4gdml_xercesc_root='$g4gdml_xercesc_root'
6611g4global='$g4global'
6612g4granular='$g4granular'
6613g4include='$g4include'
6614g4includes_flag='$g4includes_flag'
6615g4install='$g4install'
6616g4ledata='$g4ledata'
6617g4levelgammadata='$g4levelgammadata'
6618g4lib='$g4lib'
6619g4lib_build_gdml='$g4lib_build_gdml'
6620g4lib_build_shared='$g4lib_build_shared'
6621g4lib_build_static='$g4lib_build_static'
6622g4lib_use_dll='$g4lib_use_dll'
6623g4lib_use_dyn='$g4lib_use_dyn'
6624g4lib_use_granular='$g4lib_use_granular'
6625g4lib_use_shared='$g4lib_use_shared'
6626g4lib_use_static='$g4lib_use_static'
6627g4make='$g4make'
6628g4neutronhpcrosssections='$g4neutronhpcrosssections'
6629g4osname='$g4osname'
6630g4radioactivedata='$g4radioactivedata'
6631g4system='$g4system'
6632g4tmp='$g4tmp'
6633g4ui_build_gag_session='$g4ui_build_gag_session'
6634g4ui_build_qt_session='$g4ui_build_qt_session'
6635g4ui_build_terminal_session='$g4ui_build_terminal_session'
6636g4ui_build_win32_session='$g4ui_build_win32_session'
6637g4ui_build_xaw_session='$g4ui_build_xaw_session'
6638g4ui_build_xm_session='$g4ui_build_xm_session'
6639g4ui_none='$g4ui_none'
6640g4ui_use_gag='$g4ui_use_gag'
6641g4ui_use_qt='$g4ui_use_qt'
6642g4ui_use_tcsh='$g4ui_use_tcsh'
6643g4ui_use_terminal='$g4ui_use_terminal'
6644g4ui_use_win32='$g4ui_use_win32'
6645g4ui_use_xaw='$g4ui_use_xaw'
6646g4ui_use_xm='$g4ui_use_xm'
6647g4ui_xawflags='$g4ui_xawflags'
6648g4ui_xawhome='$g4ui_xawhome'
6649g4ui_xawlibs='$g4ui_xawlibs'
6650g4vis_build_asciitree_driver='$g4vis_build_asciitree_driver'
6651g4vis_build_dawn_driver='$g4vis_build_dawn_driver'
6652g4vis_build_dawnfile_driver='$g4vis_build_dawnfile_driver'
6653g4vis_build_oiwin32_driver='$g4vis_build_oiwin32_driver'
6654g4vis_build_oix_driver='$g4vis_build_oix_driver'
6655g4vis_build_openglqt_driver='$g4vis_build_openglqt_driver'
6656g4vis_build_openglwin32_driver='$g4vis_build_openglwin32_driver'
6657g4vis_build_openglx_driver='$g4vis_build_openglx_driver'
6658g4vis_build_openglxm_driver='$g4vis_build_openglxm_driver'
6659g4vis_build_raytracer_driver='$g4vis_build_raytracer_driver'
6660g4vis_build_raytracerx_driver='$g4vis_build_raytracerx_driver'
6661g4vis_build_vrml_driver='$g4vis_build_vrml_driver'
6662g4vis_build_vrmlfile_driver='$g4vis_build_vrmlfile_driver'
6663g4vis_oglhome='$g4vis_oglhome'
6664g4vis_oivhome='$g4vis_oivhome'
6665g4vis_use_asciitree='$g4vis_use_asciitree'
6666g4vis_use_dawn='$g4vis_use_dawn'
6667g4vis_use_dawnfile='$g4vis_use_dawnfile'
6668g4vis_use_oiwin32='$g4vis_use_oiwin32'
6669g4vis_use_oix='$g4vis_use_oix'
6670g4vis_use_openglqt='$g4vis_use_openglqt'
6671g4vis_use_openglwin32='$g4vis_use_openglwin32'
6672g4vis_use_openglx='$g4vis_use_openglx'
6673g4vis_use_openglxm='$g4vis_use_openglxm'
6674g4vis_use_raytracer='$g4vis_use_raytracer'
6675g4vis_use_raytracerx='$g4vis_use_raytracerx'
6676g4vis_use_vrml='$g4vis_use_vrml'
6677g4vis_use_vrmlfile='$g4vis_use_vrmlfile'
6678g4vis_xmflags='$g4vis_xmflags'
6679g4vis_xmflags='$g4vis_xmflags'
6680g4vis_xmhome='$g4vis_xmhome'
6681g4vis_xmhome='$g4vis_xmhome'
6682g4vis_xmlibs='$g4vis_xmlibs'
6683g4vis_xmlibs='$g4vis_xmlibs'
6684g4w_use_g3tog4='$g4w_use_g3tog4'
6685g4w_use_zlib='$g4w_use_zlib'
6686g4wanalysis_build='$g4wanalysis_build'
6687g4wanalysis_build_jas='$g4wanalysis_build_jas'
6688g4wanalysis_build_lab='$g4wanalysis_build_lab'
6689g4wanalysis_build_lizard='$g4wanalysis_build_lizard'
6690g4wanalysis_use='$g4wanalysis_use'
6691g4wanalysis_use_jas='$g4wanalysis_use_jas'
6692g4wanalysis_use_lab='$g4wanalysis_use_lab'
6693g4wanalysis_use_lizard='$g4wanalysis_use_lizard'
6694g4wlib_build_g3tog4='$g4wlib_build_g3tog4'
6695g4wlib_build_zlib='$g4wlib_build_zlib'
6696g4workdir='$g4workdir'
6697hint='$hint'
6698lns='$lns'
6699myuname='$myuname'
6700n='$n'
6701osname='$osname'
6702osvers='$osvers'
6703package='$package'
6704sh='$sh'
6705sharpbang='$sharpbang'
6706shsharp='$shsharp'
6707spackage='$spackage'
6708spitshell='$spitshell'
6709src='$src'
6710startsh='$startsh'
6711EOT
6712
6713: add special variables
6714mkdir -p $g4conf
6715$test -f $src/patchlevel.h && \
6716awk '/^#define/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >> $g4conf/config.sh
6717echo "CONFIG=true" >> $g4conf/config.sh
6718
6719: propagate old symbols
6720if $test -f .config/UU/config.sh; then
6721 <.config/UU/config.sh sort | uniq >.config/UU/oldconfig.sh
6722 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' $g4conf/config.sh $g4conf/config.sh .config/UU/oldconfig.sh |\
6723 sort | uniq -u >.config/UU/oldsyms
6724 set X `cat .config/UU/oldsyms`
6725 shift
6726 case $# in
6727 0) ;;
6728 *)
6729 cat <<EOM
6730
6731Hmm...You had some extra variables I don't know about...
6732 I'll try to keep 'em...
6733
6734EOM
6735 echo "# Variables propagated from previous config.sh file." >>.config/bin/$g4system/config.sh
6736 for sym in `cat .config/UU/oldsyms`; do
6737 echo " Propagating $hint variable "'$'"$sym..."
6738 eval 'tmp="$'"${sym}"'"'
6739 echo "$tmp" | \
6740 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>.config/bin/$g4system/config.sh
6741 done
6742 ;;
6743 esac
6744fi
6745
6746: preserve RCS keywords in files with variable substitution, grrr
6747Id='$Id'
6748
6749: Finish up by extracting the .SH files
6750case "$alldone" in
6751exit)
6752 $rm -rf .config/UU
6753 echo "Done."
6754 exit 0
6755 ;;
6756cont)
6757 ;;
6758'')
6759 dflt=''
6760 nostick=true
6761 $cat <<EOM
6762
6763WARNING: the generated configuration file
6764can be edited if necessary!
6765You can introduce any change to the configuration file
6766$g4conf/config.sh before the final installation.
6767To do so, use a shell escape now (e.g. !vi $g4conf/config.sh).
6768
6769EOM
6770 rp="Press [Enter] to start installation or use a shell escape to edit config.sh:"
6771 . .config/UU/myread
6772 nostick=''
6773 case "$ans" in
6774 '') ;;
6775 *) : in case they cannot read
6776 sh 1>&4 -c "$ans";;
6777 esac
6778 ;;
6779esac
6780
6781: if this fails, just run all the .SH files by hand
6782. $g4conf/config.sh
6783
6784echo " "
6785exec 1>&4
6786. ./.config/UU/extract
6787
6788if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
6789 dflt=y
6790 case "$silent" in
6791 true) ;;
6792 *)
6793 $cat <<EOM
6794
6795Now you need to generate make dependencies by running "make depend".
6796You might prefer to run it in background: "make depend > makedepend.out &"
6797It can take a while, so you might not want to run it right now.
6798
6799EOM
6800 ;;
6801 esac
6802 rp="Run make depend now?"
6803 . .config/UU/myread
6804 case "$ans" in
6805 y*)
6806 make depend && echo "Now you must run a make."
6807 ;;
6808 *)
6809 echo "You must run 'make depend' then 'make'."
6810 ;;
6811 esac
6812elif test -f [Mm]akefile; then
6813 echo " "
6814 echo "Now you must run a make."
6815elif [ -f $g4conf/install.sh -a X$g4build = Xyes ] ; then
6816 echo " "
6817 echo "Now starting Geant4 libraries build..."
6818 echo " "
6819 . $g4conf/install.sh
6820elif [ -f $g4conf/install.sh -a X$install = Xyes ] ; then
6821 echo " "
6822 echo "Now starting Geant4 libraries installation..."
6823 echo " "
6824 . $g4conf/move.sh
6825else
6826 echo " "
6827 echo "WARNING: Geant4 is NOT installed yet!"
6828 echo "You (or the administrator if you have not enough privileges)"
6829 echo "should start with \$G4INSTALL/Configure -install"
6830 echo "(where \$G4INSTALL is Geant4 install directory)."
6831 echo " "
6832fi
6833
6834$rm -f kit*isdone ark*isdone
6835$rm -rf .config/UU
6836
6837: End of Configure
6838
Note: See TracBrowser for help on using the repository browser.