source: trunk/Configure@ 918

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

new version from Ben

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