source: trunk/Configure@ 1010

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

ok

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