source: trunk/Configure@ 997

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

en test pour moc

  • Property svn:executable set to *
File size: 140.3 KB
RevLine 
[869]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
[993]21# $Id: Configure,v 1.112 2009/01/22 14:26:31 bmorgan Exp $
[869]22#
[993]23# Generated on Thu Jan 22 14:06:57 GMT 2009 [metaconfig 3.0 PL70]
[869]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=''
[884]145g4_qt_cxxflags=''
146g4_qt_gl_cxxflags=''
147g4_qt_gl_libs=''
148g4_qt_libs=''
149g4_qt_moc=''
150g4_qt_version=''
[869]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'
[884]296g4_qthome=''
[869]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'
[884]304g4vis_use_openglqt='n'
[869]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
[921]1146echo
[869]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
[884]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
[921]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\`
[884]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\`
[921]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\`
[884]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
[921]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\`
[884]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"
[993]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 if test "$g4_qt_version" = "$g4_qt_moc_major_version" ; then
2383 echo "checking for moc... found \$g4_qt_moc version \$g4_qt_moc_major_version"
[884]2384
[993]2385 g4_qt_dir=\`dirname \$g4_qt_include_dir\`
2386 g4_qt_dir=\`dirname \$g4_qt_dir\`
2387
2388 g4_qt_version="4"
2389 g4_qt_cxxflags="-I\$g4_qt_dir/QtCore.framework/Headers -I\$g4_qt_dir/QtGui.framework/Headers"
2390 g4_qt_gl_cxxflags="-I\$g4_qt_dir/QtOpenGl.framework/Headers"
2391 g4_qt_libs="-F\$g4_qt_dir -framework QtCore -framework QtGui"
2392 g4_qt_gl_libs="-framework QtOpenGL"
2393 else
2394 echo "checking for moc... found \$g4_qt_moc for Qt version \$g4_qt_moc_major_version, but Qt \$g4_qt_version path is used. Please update/move \$g4_qt_moc to Qt \$g4_qt_version"
2395 g4_havegoodqt=no
2396 fi
[884]2397 else
2398 echo "checking for moc... no"
2399 g4_havegoodqt=no
2400 fi
2401 else
2402 # Probably have Unix-style installation, in which case estimated
2403 # 'QTDIR' equivalent is $with_qt_dir if supplied, or directory
2404 # one level below the 'include' directory in \$g4_qt_include_dir
2405 if test "x\$with_qt_dir" = "x" ; then
2406 # We need to strip g4_qt_include_dir, if it was found
2407 g4_qt_dir=\$g4_qt_include_dir
2408
2409 # Only do this IF there's an 'include' in the path name!
2410 if test "x\`echo \$g4_qt_dir | grep include\`" != "x" ; then
2411 while test "x\`basename \$g4_qt_dir\`" != "xinclude" ;
2412 do
2413 g4_qt_dir=\`dirname \$g4_qt_dir\`
2414 done
2415 fi
2416
2417 #Now should be one level above equivalent QTDIR
2418 g4_qt_dir=\`dirname \$g4_qt_dir\`
2419 fi
2420
2421 # At this point, we need get Qt version of detected qglobal.h because
2422 # Qt3/4 libraries MAY be installed alongside each other...
2423 qt_direct_test_header=qglobal.h
2424 g4_qt_major_ver=\`grep QT_VERSION_STR \$g4_qt_include_dir/\$qt_direct_test_header 2>/dev/null | sed 's/.* \"\([0-9]\)\..*\"/\1/'\`
2425
2426 #
2427 # We might have an odd install where our found qglobal.h #includes
2428 # the real qglobal...
2429 #
2430 if test "x\$g4_qt_major_ver" = "x" ; then
2431 # check for a #include of qglobal...
2432 possible_actual_qglobal=\`grep '#include.*qglobal' \$g4_qt_include_dir/\$qt_direct_test_header 2>/dev/null\`
2433
2434 if test "x\$possible_actual_qglobal" != "x" ; then
2435 #We did get something, and it's likely the include
2436 #will give us a relative path (but an ASSUMPTION at present)
2437 relative_path_to_qglobal=\`grep '#include.*qglobal' \$g4_qt_include_dir/\$qt_direct_test_header 2>/dev/null | sed 's/.*\"\(.*\)\"/\1/'\`
2438
2439 if test -r \$g4_qt_include_dir/\$relative_path_to_qglobal ; then
2440 g4_qt_major_ver=\`grep QT_VERSION_STR \$g4_qt_include_dir/\$relative_path_to_qglobal 2>/dev/null | sed 's/.* \"\([0-9]\)\..*\"/\1/'\`
2441 else
2442 g4_qt_major_ver=no
2443 g4_havegoodqt=no
2444 fi
2445 else
2446 g4_qt_major_ver=no
2447 g4_havegoodqt=no
2448 fi
2449 fi #END TEST odd qglobal includes qglobal behaviour
2450
2451 if test "x\$g4_qt_major_ver" = "x4" ; then
2452 g4_is_qt4=yes
2453 else
2454 g4_is_qt4=no
2455 fi
2456 echo "checking Qt major version... \$g4_qt_major_ver"
2457
2458 #
2459 # We also need to check for Qt4 installations with QtCore type
2460 # directory structures. That being the case, make sure we have
2461 # the extra headers..
2462 #
2463 if test "x\`basename \$g4_qt_include_dir\`" = "xQtCore" ; then
2464 g4_qt_extra_headers=""
2465 g4_qt_gl_headers=""
2466 g4_qt_extra_packages="QtGui"
2467 g4_qt_gl_packages="QtOpenGL"
2468
2469 for i in \$g4_qt_extra_packages ; do
2470 if test -d "\`dirname \$g4_qt_include_dir\`/\$i" ; then
2471 echo "checking for \$i headers... yes"
2472 g4_qt_extra_headers="\$g4_qt_extra_headers \`dirname \$g4_qt_include_dir\`/\$i"
2473 else
2474 echo "checking for \$i headers... no"
2475 g4_havegoodqt=no
2476 fi
2477 done
2478
2479 for i in \$g4_qt_gl_packages ; do
2480 if test -d "\`dirname \$g4_qt_include_dir\`/\$i" ; then
2481 echo "checking for \$i headers... yes"
2482 g4_qt_gl_headers="\$g4_qt_gl_headers \`dirname \$g4_qt_include_dir\`/\$i"
2483 else
2484 echo "checking for \$i headers... no"
2485 g4_havegoodqt=no
2486 fi
2487 done
2488
2489 fi #END TEST QtCore style install
2490
2491
2492 #
2493 # Now check for appropriate library...
2494 #
2495 if test -d "\$g4_qt_dir/lib64" ; then
2496 g4_qt_lib_dir=\$g4_qt_dir/lib64
2497 else
2498 g4_qt_lib_dir=\$g4_qt_dir/lib
2499 fi
2500
2501 if test "x\$g4_is_qt4" = "xyes" ; then
2502 g4_qt_lib="\`ls \$g4_qt_lib_dir/libQtCore* 2> /dev/null | sed -n 1p |
2503 sed s@\$g4_qt_lib_dir/lib@@ | sed s@[.].*@@\`"
2504
2505 if test "x\$g4_qt_lib" = "x" ; then
2506 # We might be on Windows...
2507 g4_qt_lib="\`ls \$g4_qt_lib_dir/QtCore4.lib 2> /dev/null | sed -n 1p | sed s@\$g4_qt_lib_dir/@@\`"
2508 fi
2509
2510 if test "x\$g4_qt_lib" != "x" ; then
2511 echo "checking for QtCore library... \$g4_qt_lib"
2512 else
2513 echo "checking for QtCore library... no"
2514 g4_havegoodqt=no
2515 fi
2516 else
2517 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@[.].*@@\`"
2518
2519 if test "x\$g4_qt_lib" != "x" ; then
2520 echo "checking for qt-mt or qt library... \$g4_qt_lib"
2521
2522 # On Darwin we also need libqui for Qt3
2523 if test "x\$osname" = "xdarwin" ; then
2524 g4_qt_lib_qui="\`ls \$g4_qt_lib_dir/libqui.* 2> /dev/null |
2525 sed -n 1p | sed s@\$g4_qt_lib_dir/lib@@ |
2526 sed s@[.].*@@\`"
2527 if test "x\$g4_qt_lib_qui" != "x" ; then
2528 echo "checking for qui library... yes"
2529 else
2530 echo "checking for qui library... no"
2531 g4_havegoodqt=no
2532 fi
2533 fi
2534 else
2535 echo "checking for qt-mt or qt library... no"
2536 g4_havegoodqt=no
2537 fi
2538 fi #END TEST for Qt4/3 libraries
2539
2540 #
2541 # Finally, we need to search for moc
2542 #
2543 g4_qt_bin_dir=\$g4_qt_dir/bin
2544 g4_qtmoc=no
2545 if test -x "\$g4_qt_bin_dir/moc" ; then
2546 g4_qtmoc="\$g4_qt_bin_dir/moc"
2547 elif test -x "\$g4_qt_bin_dir/moc-qt4" ; then
2548 g4_qtmoc="\$g4_qt_bin_dir/moc-qt4"
2549 elif test -x "\$g4_qt_bin_dir/qt4-moc" ; then
2550 g4_qtmoc="\$g4_qt_bin_dir/qt4-moc"
2551 else
2552 g4_havegoodqt=no
2553 fi
[993]2554 # checking moc version
2555 g4_qt_moc_major_version=\`\$g4_qtmoc -v 2>&1|sed 's/^.*(Qt \(.*\)\..*\..*)/\1/'\`
[997]2556 echo "checking for moc222... found \$g4_qtmoc version \$g4_qt_moc_major_version"
[884]2557
[996]2558 if test '$g4_qt_major_ver' = '$g4_qt_moc_major_version' ; then
2559 g4_havegoodqt=yes
2560 else
2561 echo "checking for moc... found \$g4_qt_moc for Qt version \$g4_qt_moc_major_version, but Qt \$g4_qt_major_ver path is used. Please update/move \$g4_qt_moc to Qt \$g4_qt_major_ver"
2562 g4_havegoodqt=no
2563 fi
[884]2564 ## THIS IS POINT AT WHICH TO DO FALLBACK TESTS I.E DOES
2565 ## COMPILATION OF SMALL TEST PROGRAM WORK - THEN HEADERS AND
2566 ## LIBS ARE AUTOMATICALLY FOUND BY LINKER
2567
2568 #
2569 ## Finally, set output variables, raw for now
2570 #
2571 if test "x\$g4_havegoodqt" = "xyes" ; then
2572 g4_qt_version=\$g4_qt_major_ver
2573
2574 # Take care of Qt4 style header structure...
2575 if test "x\`basename \$g4_qt_include_dir\`" = "xQtCore"; then
2576 g4_qt_cxxflags="-I\`dirname \$g4_qt_include_dir\` -I\$g4_qt_include_dir"
2577 else
2578 g4_qt_cxxflags="-I\$g4_qt_include_dir"
2579 fi
2580 if test "x\$g4_is_qt4" = "xyes" ; then
2581 for i in \$g4_qt_extra_headers ; do
2582 g4_qt_cxxflags="\$g4_qt_cxxflags -I\$i"
2583 done
2584 for i in \$g4_qt_gl_headers ; do
2585 g4_qt_gl_cxxflags="\$g4_qt_gl_cxxflags -I\$i"
2586 done
2587 fi
2588
2589 g4_qt_libs="-L\$g4_qt_lib_dir"
2590 if test "x\$g4_qt_lib" = "xQtCore4.lib" ; then
2591 #We have Windows...
2592 g4_qt_libs="\$g4_qt_libs QtCore4.lib QtGui4.lib"
2593 g4_qt_gl_libs="QtOpenGL4.lib"
2594 else
2595 g4_qt_libs="\$g4_qt_libs -l\$g4_qt_lib"
2596 if test "x\$g4_is_qt4" = "xyes" ; then
2597 g4_qt_libs="\$g4_qt_libs -lQtGui"
2598 g4_qt_gl_libs="-lQtOpenGL"
2599 fi
2600 fi
2601 if test "x\$g4_qt_lib_qui" != "x" ; then
2602 g4_qt_libs="\$g4_qt_libs -lqui"
2603 fi
2604
2605
2606 g4_qt_moc=\$g4_qtmoc
[996]2607 g4_qt_is_configured=yes
[884]2608 else
2609 g4_qt_is_configured=''
2610 fi
2611 fi #END TEST for Darwin Framework
2612
2613else
2614 #Probably also want flags here to reset variables if requested
2615 echo "configure: Qt already configured, no recheck neccessary"
2616fi #END TEST "x\$g4_qt_is_configured" = "x"
2617
2618EOSC
[869]2619: decide how portable to be
2620case "$d_portable" in
2621"$define") dflt=y;;
2622*) dflt=n;;
2623esac
2624$cat <<'EOH'
2625
2626I can set things up so that your shell scripts and binaries are more portable,
2627at what may be a noticable cost in performance. In particular, if you
2628ask to be portable, the following happens:
2629
2630 1) Shell scripts will rely on the PATH variable rather than using
2631 the paths derived above.
2632 2) ~username interpretations will be done at run time rather than
2633 by Configure.
2634
2635EOH
2636rp="Do you expect to run these scripts and binaries on multiple machines?"
2637. ./myread
2638case "$ans" in
2639 y*) d_portable="$define"
2640 ;;
2641 *) d_portable="$undef" ;;
2642esac
2643
2644: set up shell script to do ~ expansion
2645cat >filexp <<EOSS
2646$startsh
2647: expand filename
2648case "\$1" in
2649 ~/*|~)
2650 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
2651 ;;
2652 ~*)
2653 if $test -f /bin/csh; then
2654 /bin/csh -f -c "glob \$1"
2655 failed=\$?
2656 echo ""
2657 exit \$failed
2658 else
2659 name=\`$expr x\$1 : '..\([^/]*\)'\`
2660 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
2661 if $test ! -d "\$dir"; then
2662 me=\`basename \$0\`
2663 echo "\$me: can't locate home directory for: \$name" >&2
2664 exit 1
2665 fi
2666 case "\$1" in
2667 */*)
2668 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
2669 ;;
2670 *)
2671 echo \$dir
2672 ;;
2673 esac
2674 fi
2675 ;;
2676*)
2677 echo \$1
2678 ;;
2679esac
2680EOSS
2681chmod +x filexp
2682$eunicefix filexp
2683
2684: now set up to get a file name
2685cat <<EOS >getfile
2686$startsh
2687EOS
2688cat <<'EOSC' >>getfile
2689tilde=''
2690fullpath=''
2691already=''
2692skip=''
2693none_ok=''
2694exp_file=''
2695nopath_ok=''
2696orig_rp="$rp"
2697orig_dflt="$dflt"
2698
2699case "$fn" in
2700*\(*)
2701 expr $fn : '.*(\(.*\)).*' | tr ',' '\012' >getfile.ok
2702 fn=`echo $fn | sed 's/(.*)//'`
2703 ;;
2704esac
2705
2706case "$fn" in
2707*:*)
2708 loc_file=`expr $fn : '.*:\(.*\)'`
2709 fn=`expr $fn : '\(.*\):.*'`
2710 ;;
2711esac
2712
2713case "$fn" in
2714*~*) tilde=true;;
2715esac
2716case "$fn" in
2717*/*) fullpath=true;;
2718esac
2719case "$fn" in
2720*+*) skip=true;;
2721esac
2722case "$fn" in
2723*n*) none_ok=true;;
2724esac
2725case "$fn" in
2726*e*) exp_file=true;;
2727esac
2728case "$fn" in
2729*p*) nopath_ok=true;;
2730esac
2731
2732case "$fn" in
2733*f*) type='File';;
2734*d*) type='Directory';;
2735*l*) type='Locate';;
2736esac
2737
2738what="$type"
2739case "$what" in
2740Locate) what='File';;
2741esac
2742
2743case "$exp_file" in
2744'')
2745 case "$d_portable" in
2746 "$define") ;;
2747 *) exp_file=true;;
2748 esac
2749 ;;
2750esac
2751
2752cd ../..
2753while test "$type"; do
2754 redo=''
2755 rp="$orig_rp"
2756 dflt="$orig_dflt"
2757 case "$tilde" in
2758 true) rp="$rp ";;
2759 esac
2760 . .config/UU/myread
2761 if test -f .config/UU/getfile.ok && \
2762 $contains "^$ans\$" .config/UU/getfile.ok >/dev/null 2>&1
2763 then
2764 value="$ans"
2765 ansexp="$ans"
2766 break
2767 fi
2768 case "$ans" in
2769 none)
2770 value=''
2771 ansexp=''
2772 case "$none_ok" in
2773 true) type='';;
2774 esac
2775 ;;
2776 *)
2777 case "$tilde" in
2778 '') value="$ans"
2779 ansexp="$ans";;
2780 *)
2781 value=`.config/UU/filexp $ans`
2782 case $? in
2783 0)
2784 if test "$ans" != "$value"; then
2785 echo "(That expands to $value on this system.)"
2786 fi
2787 ;;
2788 *) value="$ans";;
2789 esac
2790 ansexp="$value"
2791 case "$exp_file" in
2792 '') value="$ans";;
2793 esac
2794 ;;
2795 esac
2796 case "$fullpath" in
2797 true)
2798 case "$ansexp" in
2799 /*) value="$ansexp" ;;
2800 *)
2801 redo=true
2802 case "$already" in
2803 true)
2804 echo "I shall only accept a full path name, as in /bin/ls." >&4
2805 echo "Use a ! shell escape if you wish to check pathnames." >&4
2806 ;;
2807 *)
2808 echo "Please give a full path name, starting with slash." >&4
2809 case "$tilde" in
2810 true)
2811 echo "Note that using ~username is ok provided it expands well." >&4
2812 already=true
2813 ;;
2814 esac
2815 esac
2816 ;;
2817 esac
2818 ;;
2819 esac
2820 case "$redo" in
2821 '')
2822 case "$type" in
2823 File)
2824 if test -f "$ansexp"; then
2825 type=''
2826 elif test -r "$ansexp" || (test -h "$ansexp") >/dev/null 2>&1
2827 then
2828 echo "($value is not a plain file, but that's ok.)"
2829 type=''
2830 fi
2831 ;;
2832 Directory)
2833 if test -d "$ansexp"; then
2834 type=''
2835 fi
2836 ;;
2837 Locate)
2838 if test -d "$ansexp"; then
2839 echo "(Looking for $loc_file in directory $value.)"
2840 value="$value/$loc_file"
2841 ansexp="$ansexp/$loc_file"
2842 fi
2843 if test -f "$ansexp"; then
2844 type=''
2845 fi
2846 case "$nopath_ok" in
2847 true) case "$value" in
2848 */*) ;;
2849 *) echo "Assuming $value will be in people's path."
2850 type=''
2851 ;;
2852 esac
2853 ;;
2854 esac
2855 ;;
2856 esac
2857
2858 case "$skip" in
2859 true) type='';
2860 esac
2861
2862 case "$type" in
2863 '') ;;
2864 *)
2865 if test "$fastread" = yes; then
2866 dflt=y
2867 else
2868 dflt=n
2869 fi
2870 rp="$what $value doesn't exist. Use that name anyway?"
2871 . .config/UU/myread
2872 dflt=''
2873 case "$ans" in
2874 y*) type='';;
2875 *) echo " ";;
2876 esac
2877 ;;
2878 esac
2879 ;;
2880 esac
2881 ;;
2882 esac
2883done
2884cd .config/UU
2885ans="$value"
2886
2887# Check for Windows!
2888if test "X$g4system" = "XWIN32-VC" -o "X$g4system" = "XWIN32-VC7"; then
2889
2890checkdrive=`echo $ans|cut -d"/" -f2`
2891
2892if test "X$checkdrive" = "Xcygdrive"; then
2893
2894windrive=`echo $ans|cut -d"/" -f3`
2895winpath=`echo $ans|cut -d"/" -f4-`
2896
2897fullwinpath="$windrive:/$winpath"
2898ans=$fullwinpath
2899
2900fi # if cygwin syntax is used
2901fi # if Win
2902
2903rp="$orig_rp"
2904dflt="$orig_dflt"
2905rm -f getfile.ok
2906EOSC
2907
2908echo " "
2909
2910#echo "SSS"
2911#echo `pwd`
2912#echo "SSS"
2913
2914if [ X$src = X. ] ; then
2915 cd ../..
2916 abssrc=`pwd`
2917 cd .config/UU
2918else
2919 abssrc=$src
2920fi
2921
2922case "$g4conf" in
2923'')
2924 g4conf=$abssrc/.config/bin/$g4system
2925 ;;
2926esac
2927
2928#echo "g4conf=$g4conf"
2929
2930case "$g4install" in
2931'')
2932if test $g4system = "WIN32-VC" -o $g4system = "WIN32-VC7"; then
2933# g4install="c:/geant4"
2934 g4install=$abssrc
2935else
2936# if [ X"$HOME" = X/ ] ; then
2937# HOME=""
2938# fi
2939# g4install="$HOME"/geant4
2940 g4install=$abssrc
2941
2942fi
2943
2944# Check for Windows!
2945if test $g4system = "WIN32-VC" -o $g4system = "WIN32-VC7"; then
2946
2947checkdrive=`echo $g4install|cut -d"/" -f2`
2948
2949if test $checkdrive = "cygdrive"; then
2950
2951windrive=`echo $g4install|cut -d"/" -f3`
2952winpath=`echo $g4install|cut -d"/" -f4-`
2953
2954fullwinpath="$windrive:/$winpath"
2955g4install=$fullwinpath
2956
2957fi
2958fi
2959 ;;
2960esac
2961
2962case "$g4final_install" in
2963'')
2964 g4final_install=$g4install
2965 ;;
2966esac
2967
2968case "$g4workdir" in
2969'')
2970 g4workdir=$g4install
2971 ;;
2972esac
2973
2974case "$g4includes_flag" in
2975'')
2976 g4includes_flag=n
2977 ;;
2978esac
2979
2980
2981g4message=`cat << EOM
2982
2983Where is Geant4 source installed?
2984EOM`
2985
2986#dflt="NO DEFAULT ANSWER"
2987dflt=$g4install
2988fn='d~'
2989rp=$g4message
2990. ./getfile
2991g4install=$ans
2992g4workdir=$g4install
2993#################################
2994g4message=`cat << EOM
2995
2996Specify the path where Geant4 libraries and source files should be
2997installed.
2998EOM`
2999
3000#dflt="NO DEFAULT ANSWER"
3001dflt=$g4final_install
3002fn='d~'
3003rp=$g4message
3004. ./getfile
3005g4final_install=$ans
3006#g4workdir=$g4install
3007
3008##################################
3009g4message=`cat << EOM
3010
3011Do you want to copy all Geant4 headers
3012in one directory?
3013EOM`
3014
3015#dflt="NO DEFAULT ANSWER"
3016dflt=$g4includes_flag
3017#fn='d~'
3018rp=$g4message
3019. ./myread
3020g4includes_flag=$ans
3021
3022if [ X$g4includes_flag = Xy ] ; then
3023
3024case "$g4include" in
3025'')
3026 g4include=$g4install/include
3027# g4include=''
3028 ;;
3029esac
3030
3031#g4message=`cat << EOM
3032#
3033#Where will be directory to copy all Geant4 headers?
3034#EOM`
3035#
3036##dflt="NO DEFAULT ANSWER"
3037####dflt=$g4install/include
3038#dflt=$g4include
3039#fn='d~+'
3040#rp=$g4message
3041#. ./getfile
3042#g4include=$ans
3043
3044# Set constantly!
3045if [ X$g4install != X$g4final_install ] ; then
3046g4include=$g4final_install/include/geant4
3047else
3048g4include=$g4final_install/include
3049fi
3050
3051fi
3052
3053#if test "X$g4include" = "X[NOT DEFINED]" ; then
3054#g4include=""
3055#fi
3056
3057echo " "
3058
3059case "$g4tmp" in
3060'')
3061 g4tmp=$g4workdir/tmp
3062 ;;
3063esac
3064
3065case "$g4lib" in
3066'')
3067 g4lib=$g4workdir/lib
3068 ;;
3069esac
3070
3071#case "$g4bin" in
3072#'')
3073# g4bin=$g4workdir/bin
3074# ;;
3075#esac
3076
3077while test 1 = 0 ; do
3078
3079g4message=`cat << EOM
3080
3081(OPTIONAL) You can now customise installation directories:
3082 G4TMP - tmp/ containing temporary dependency (.d) and object (.o) files;
3083 G4LIB - lib/ containing final static (.a) or shared (.so) libraries;
3084
30851) G4TMP: $g4tmp
3086
30872) G4LIB: $g4lib
3088
3089To modify default settings, select number above (e.g. 2)
3090EOM`
3091
3092#dflt="NO DEFAULT ANSWER"
3093dflt="Press [Enter] for default settings"
3094#fn='d~'
3095rp=$g4message
3096. ./myread
3097gans=$ans
3098
3099
3100 case $gans in
3101
3102 1)
3103 dflt=$g4tmp
3104 fn='d~+'
3105 rp="Where will be your Geant4 tmp directory?"
3106 . ./getfile
3107 g4tmp=$ans
3108 ;;
3109 2)
3110 dflt=$g4lib
3111 fn='d~+'
3112 rp="Where will be your Geant4 lib directory?"
3113 . ./getfile
3114 g4lib=$ans
3115 ;;
3116# 3)
3117# dflt=$g4bin
3118# fn='d~+'
3119# rp="Where will be your Geant4 bin directory?"
3120# . ./getfile
3121# g4bin=$ans
3122# ;;
3123
3124# [eE])
3125# break
3126# ;;
3127 *)
3128 break
3129# echo " "
3130 ;;
3131 esac
3132done
3133
[921]3134g4data_photonevaporation_version='PhotonEvaporation2.0'
3135g4data_radioactivedecay_version='RadioactiveDecay3.2'
3136g4data_g4emlow_version='G4EMLOW6.2'
3137g4data_g4ndl_version='G4NDL3.13'
3138g4data_g4abla_version='G4ABLA3.0'
3139#END GEANT4 DATA OPTIONS
[869]3140echo " "
3141
[921]3142
3143#
3144# Set defaults for data paths - here, because we depend on g4install
3145#
[869]3146case "$g4data" in
3147'')
3148 g4data=$g4install/data
3149 ;;
3150esac
3151
3152case "$g4levelgammadata" in
3153'')
[921]3154 g4levelgammadata=$g4data/$g4data_photonevaporation_version
[869]3155 ;;
3156esac
3157
3158case "$g4radioactivedata" in
3159'')
[921]3160 g4radioactivedata=$g4data/$g4data_radioactivedecay_version
[869]3161 ;;
3162esac
3163
3164case "$g4ledata" in
3165'')
[921]3166 g4ledata=$g4data/$g4data_g4emlow_version
[869]3167 ;;
3168esac
3169
3170case "$g4neutronhpcrosssections" in
3171'')
[921]3172 g4neutronhpcrosssections=$g4data/$g4data_g4ndl_version
[869]3173 ;;
3174esac
3175
3176case "$g4abladata" in
3177'')
[921]3178 g4abladata=$g4data/$g4data_g4abla_version
[869]3179 ;;
3180esac
3181
3182
[921]3183#
3184# Now we have defaults, prompt user to see if this is where they want to use
3185#
3186g4data_alllibs="$g4data_photonevaporation_version $g4data_radioactivedecay_version $g4data_g4emlow_version $g4data_g4ndl_version $g4data_g4abla_version"
[869]3187
[921]3188g4message=`cat <<EOM
3189Specify the path where are the Geant4 data libraries
[869]3190
[921]3191$g4data_alllibs
[869]3192
[921]3193are installed. For now, a flat directory structure is assumed, and this can
3194be customized at the next step if needed.
3195EOM`
[869]3196
[921]3197dflt=$g4data
3198rp=$g4message
3199. ./myread
3200g4data=$ans
[869]3201
[921]3202#
3203# Using this, we can now check that the libs exist, but only on a directory
3204# level
3205#
3206g4data_foundall='yes'
3207promptend="no"
3208g4data_customize="no"
[869]3209
[921]3210while test "x$promptend" = "xno" ; do
3211 ### PhotonEvaporation
3212 $echo $n "checking for $g4data_photonevaporation_version... $c"
3213 if test -d "$g4data/$g4data_photonevaporation_version" ; then
3214 $echo "yes"
3215 g4levelgammadata=$g4data/$g4data_photonevaporation_version
3216 else
3217 $echo "no"
3218 g4data_foundall="no"
3219 fi
[869]3220
[921]3221 ### RadioactiveDecay
3222 $echo $n "checking for $g4data_radioactivedecay_version... $c"
3223 if test -d "$g4data/$g4data_radioactivedecay_version" ; then
3224 $echo "yes"
3225 g4radioactivedata=$g4data/$g4data_radioactivedecay_version
3226 else
3227 $echo "no"
3228 g4data_foundall="no"
3229 fi
[869]3230
[921]3231 ### G4EMLOW
3232 $echo $n "checking for $g4data_g4emlow_version... $c"
3233 if test -d "$g4data/$g4data_g4emlow_version" ; then
3234 $echo "yes"
[993]3235 g4ledata=$g4data/$g4data_g4emlow_version
[921]3236 else
3237 $echo "no"
3238 g4data_foundall="no"
3239 fi
[869]3240
[921]3241 ### G4NDL
3242 $echo $n "checking for $g4data_g4ndl_version... $c"
3243 if test -d "$g4data/$g4data_g4ndl_version" ; then
3244 $echo "yes"
3245 g4neutronhpcrosssections=$g4data/$g4data_g4ndl_version
3246 else
3247 $echo "no"
3248 g4data_foundall="no"
3249 fi
[869]3250
[921]3251 ### G4ABLA
3252 $echo $n "checking for $g4data_g4abla_version... $c"
3253 if test -d "$g4data/$g4data_g4abla_version" ; then
3254 $echo "yes"
[993]3255 g4abladata=$g4data/$g4data_g4abla_version
[921]3256 else
3257 $echo "no"
3258 g4data_foundall="no"
3259 fi
[869]3260
[921]3261 #
3262 # If we haven't found all the data, query the user as to whether they
3263 # want to
3264 # 1) try again with a different path
3265 # 2) use the path they input
3266 # 3) customize paths
3267 #
3268 if test "x$g4data_foundall" = "xyes" ; then
3269 promptend=yes
3270 else
3271 g4message=`cat << EOM
[869]3272
[921]3273Failed to locate one or more of the Geant4 data libraries in
[869]3274
[921]3275$g4data
[869]3276
[921]3277Please enter
32781) Another path to search in
32792) 'f' to force the use of the path you entered previously (the data libraries
3280 are not needed to build Geant4, but are needed to run applications later).
32813) 'c' to customize the data paths, e.g. if you have the data libraries
3282 installed in different locations.
3283EOM`
3284 dflt="f"
3285 rp=$g4message
3286 . ./myread
3287 gans=$ans
[869]3288
[921]3289 if test "x$gans" = "xf" ; then
3290 # Force paths
3291 promptend="yes"
3292 g4levelgammadata="$g4data/$g4data_photonevaporation_version"
3293 g4radioactivedata="$g4data/$g4data_radioactivedecay_version"
3294 g4ledata="$g4data/$g4data_g4emlow_version"
3295 g4neutronhpcrosssections="$g4data/$g4data_g4ndl_version"
3296 g4abladata="$g4data/$g4data_g4abla_version"
3297
[869]3298
[921]3299 elif test "x$gans" = "xc" ; then
3300 # enable customization - we use input g4data to set
3301 # defaults
3302 promptend="yes"
3303 g4data_customize="yes"
[869]3304
[921]3305 g4levelgammadata="$g4data/$g4data_photonevaporation_version"
3306 g4radioactivedata="$g4data/$g4data_radioactivedecay_version"
3307 g4ledata="$g4data/$g4data_g4emlow_version"
3308 g4neutronhpcrosssections="$g4data/$g4data_g4ndl_version"
3309 g4abladata="$g4data/$g4data_g4abla_version"
[869]3310
3311
[921]3312 else
3313 #try again
[993]3314 g4data_foundall=yes
[921]3315 g4data=$gans
3316 fi
3317 fi
3318done
[869]3319
3320
[921]3321#
3322# Now customize paths if required
3323#
3324if test "x$g4data_customize" = "xyes" ; then
3325while test "x" = "x" ; do
[869]3326
[921]3327 g4message=`cat <<EOM
[869]3328
[921]3329You have chosen to customize the Geant4 data library paths.
[869]3330
[921]33311) $g4data_photonevaporation_version:
3332 $g4levelgammadata
33332) $g4data_radioactivedecay_version:
3334 $g4radioactivedata
33353) $g4data_g4emlow_version:
3336 $g4ledata
33374) $g4data_g4ndl_version:
3338 $g4neutronhpcrosssections
33395) $g4data_g4abla_version:
3340 $g4abladata
[869]3341
[921]3342Choose a number from the list above to customize that path (e.g. 2)
[869]3343EOM`
3344
[921]3345 dflt="Press [Enter] to exit customization with paths as above"
3346 rp=$g4message
3347 . ./myread
3348 gans=$ans
[869]3349
3350 case $gans in
3351
[921]3352 "1")
[869]3353 dflt=$g4levelgammadata
3354 fn='d~'
[921]3355 rp="Custom path to $g4data_photonevaporation_version?"
[869]3356 . ./getfile
3357 g4levelgammadata=$ans
3358 ;;
[921]3359
3360 "2")
[869]3361 dflt=$g4radioactivedata
3362 fn='d~'
[921]3363 rp="Custom path to $g4data_radioactivedecay_version?"
[869]3364 . ./getfile
3365 g4radioactivedata=$ans
3366 ;;
[921]3367
3368 "3")
[869]3369 dflt=$g4ledata
3370 fn='d~'
[921]3371 rp="Custom path to $g4data_g4emlow_version?"
[869]3372 . ./getfile
3373 g4ledata=$ans
3374 ;;
[921]3375
3376 "4")
[869]3377 dflt=$g4neutronhpcrosssections
3378 fn='d~'
[921]3379 rp="Custom path to $g4data_g4ndl_version?"
[869]3380 . ./getfile
3381 g4neutronhpcrosssections=$ans
3382 ;;
3383
[921]3384 "5")
[869]3385 dflt=$g4abladata
3386 fn='d~'
[921]3387 rp="Custom path to $g4data_g4abla_version?"
[869]3388 . ./getfile
3389 g4abladata=$ans
3390 ;;
3391
[921]3392 *)
[869]3393 break
3394 ;;
[921]3395
[869]3396 esac
[921]3397
[869]3398done
[921]3399fi
[869]3400
3401
[921]3402
3403
3404
[869]3405if test "X$g4clhep_base_dir" = "X" ; then
3406
3407clhep_dirs=`find $g4clhep_base_dir /usr/local/include /usr/include -type d -name CLHEP 2>/dev/null |xargs echo`
3408#echo clhep_dirs=$clhep_dirs
3409
3410fi
3411
3412if test "X$clhep_dirs" != "X" ; then
3413
3414g4clhep_base_dir_found=`echo $clhep_dirs|cut -d" " -f1`
3415#echo g4clhep_base_dir_found=$g4clhep_base_dir_found
3416
3417
3418#g4clhep_base_dir_n=`echo $g4clhep_base_dir_found |awk -F"/" '{print NF}'`
3419#echo g4clhep_base_dir_n=$g4clhep_base_dir_n
3420g4clhep_base_dir_found=`dirname $g4clhep_base_dir_found`
3421g4clhep_base_dir_found=`dirname $g4clhep_base_dir_found`
3422
3423 g4clhep_base_dir=$g4clhep_base_dir_found
3424
3425#else
3426#case "$g4clhep_base_dir" in
3427#'')
3428# if test "X$g4system" = "XWIN32-VC" -o "X$g4system" = "XWIN32-VC7"; then
3429# g4clhep_base_dir="c:/usr/local"
3430# else
3431# g4clhep_base_dir=/usr/local
3432# fi
3433# ;;
3434#esac
3435fi
3436
3437
3438#while test 1 = 1 ; do
3439
3440#if test "X$g4clhep_base_dir" != "X" ; then
3441#clhep_dirs=$g4clhep_base_dir
3442#echo 1 g4clhep_base_dir=$g4clhep_base_dir
3443#fi
3444
3445if test "X$g4clhep_base_dir" != "X" ; then
3446
3447g4message=`cat << EOM
3448
3449Please, specify where CLHEP is installed. It was found in:
3450
3451CLHEP_BASE_DIR: $g4clhep_base_dir
3452
3453EOM`
3454
3455dflt=$g4clhep_base_dir
3456fn='d~'
3457rp=$g4message
3458. ./getfile
3459
3460cend="no"
3461while test "$cend" = "no" ; do
3462if test -e "$ans/include/CLHEP" ; then
3463cend="yes"
3464
3465g4clhep_base_dir=$ans
3466
3467else
3468
3469g4message=`cat << EOM
3470
3471Could not find CLHEP installed in $ans!
3472Please, specify where CLHEP is installed:
3473
3474CLHEP_BASE_DIR:
3475
3476EOM`
3477
3478dflt=""
3479fn='d~'
3480rp=$g4message
3481. ./getfile
3482fi
3483done
3484
3485else
3486
3487g4message=`cat << EOM
3488
3489Could not find CLHEP installed on this system!
3490Please, specify where CLHEP is installed:
3491
3492CLHEP_BASE_DIR:
3493
3494EOM`
3495
3496dflt=""
3497fn='d~'
3498rp=$g4message
3499. ./getfile
3500
3501cend="no"
3502while test "$cend" = "no" ; do
3503if test -e "$ans/include/CLHEP" ; then
3504cend="yes"
3505
3506g4clhep_base_dir=$ans
3507
3508else
3509
3510g4message=`cat << EOM
3511
3512Could not find CLHEP installed in $ans!
3513Please, specify where CLHEP is installed:
3514
3515CLHEP_BASE_DIR:
3516
3517EOM`
3518
3519dflt=""
3520fn='d~'
3521rp=$g4message
3522. ./getfile
3523fi
3524done
3525
3526fi
3527
3528#dflt="Press [Enter] for default settings"
3529#fn='d~'
3530#####rp=$g4message
3531#. ./myread
3532#gans=$ans
3533
3534# case $gans in
3535
3536# 1)
3537## dflt=""
3538## fn='d~'
3539# rp="Where is CLHEP installed?"
3540## . ./getfile
3541## g4clhep_base_dir=$ans
3542
3543##### g4clhep_include_dir=$ans/include
3544##### g4clhep_lib_dir=$ans/lib
3545# ;;
3546# 2)
3547# dflt=$g4clhep_include_dir
3548# fn='d~'
3549# rp="Where is CLHEP include directory?"
3550# . ./getfile
3551# g4clhep_include_dir=$ans
3552# ;;
3553# 3)
3554# dflt=$g4clhep_lib_dir
3555# fn='d~'
3556# rp="Where is CLHEP lib directory?"
3557# . ./getfile
3558# g4clhep_lib_dir=$ans
3559# ;;
3560# 4)
3561# dflt=$g4clhep_lib
3562# rp="What is CLHEP lib title?"
3563# . ./myread
3564# g4clhep_lib=$ans
3565# ;;
3566## [eE])
3567## break
3568## ;;
3569# *)
3570# echo " "
3571# break
3572# ;;
3573# esac
3574#done
3575
3576case "$g4clhep_include_dir" in
3577'')
3578 g4clhep_include_dir=$g4clhep_base_dir/include
3579 ;;
3580esac
3581
3582case "$g4clhep_lib_dir" in
3583'')
3584 g4clhep_lib_dir=$g4clhep_base_dir/lib
3585 ;;
3586esac
3587
3588case "$g4clhep_lib" in
3589'')
3590 if test "X$g4system" = "XWIN32-VC" -o "X$g4system" = "XWIN32-VC7"; then
3591 g4clhep_lib="CLHEP.lib"
3592 else
3593 g4clhep_lib=CLHEP
3594 fi
3595 ;;
3596esac
3597
3598while test 1 = 1 ; do
3599
3600g4message_1=`cat << You
3601
3602You can customize paths and library name of you CLHEP installation:
3603
36041) CLHEP_INCLUDE_DIR: $g4clhep_include_dir
36052) CLHEP_LIB_DIR: $g4clhep_lib_dir
36063) CLHEP_LIB: $g4clhep_lib
3607
3608You`
3609
3610g4message_2=" need to use full library name with its extension (e.g. libCLHEP.lib)."
3611
3612g4message_3=`cat << EOM
3613
3614To modify default settings, select number above (e.g. 2)
3615EOM`
3616
3617
3618if test "X$g4system" != "XWIN32-VC" -a "X$g4system" != "XWIN32-VC7"; then
3619rp=$g4message_1$g4message_3
3620else
3621rp=$g4message_1$g4message_2$g4message_3
3622fi
3623
3624dflt="Press [Enter] for default settings"
3625#fn='d~'
3626. ./myread
3627gans=$ans
3628
3629 case $gans in
3630
3631 1)
3632 dflt=$g4clhep_include_dir
3633 fn='d~'
3634 rp="Where is CLHEP include directory?"
3635 . ./getfile
3636 g4clhep_include_dir=$ans
3637 ;;
3638 2)
3639 dflt=$g4clhep_lib_dir
3640 fn='d~'
3641 rp="Where is CLHEP lib directory?"
3642 . ./getfile
3643 g4clhep_lib_dir=$ans
3644 ;;
3645 3)
3646 dflt=$g4clhep_lib
3647 rp="What is CLHEP lib title?"
3648 . ./myread
3649 g4clhep_lib=$ans
3650 ;;
3651# [eE])
3652## break
3653## ;;
3654 *)
3655# echo " "
3656 break
3657 ;;
3658 esac
3659done
3660
3661#if test "X$g4clhep_base_dir" = "X/usr" -o "X$g4clhep_base_dir" = "X/usr/local"; then
3662#g4clhep_base_dir=""
3663#fi
3664#
3665#if test "X$g4clhep_include_dir" = "X/usr/include" -o "X$g4clhep_include_dir" = "X/usr/local/include"; then
3666#g4clhep_include_dir=""
3667#fi
3668#
3669#if test "X$g4clhep_lib_dir" = "X/usr/lib" -o "X$g4clhep_lib_dir" = "X/usr/local/lib"; then
3670#g4clhep_lib_dir=""
3671#fi
3672
3673echo " "
3674
3675case "$g4lib_build_shared" in
3676'')
3677 g4lib_build_shared=n
3678 ;;
3679esac
3680
3681echo " "
3682
3683case "$g4lib_build_static" in
3684'')
3685 g4lib_build_static=n
3686 ;;
3687esac
3688
3689echo " "
3690
3691case "$g4lib_use_shared" in
3692'')
3693 g4lib_use_shared=n
3694 ;;
3695esac
3696
3697echo " "
3698
3699case "$g4lib_use_static" in
3700'')
3701 g4lib_use_static=n
3702 ;;
3703esac
3704
3705case "$g4lib_build_dll" in
3706'')
3707 g4lib_build_dll=n
3708 ;;
3709esac
3710
3711case "$g4lib_build_dyn" in
3712'')
3713 g4lib_build_dyn=n
3714 ;;
3715esac
3716
3717#
3718# Ask about building of SHARED|STATIC libraries - default STATIC.
3719#
3720echo ""
3721
3722if test "X$g4system" = "XWIN32-VC" -o "X$g4system" = "XWIN32-VC7"; then
3723
3724while test 1 = 1 ; do
3725
3726g4message=`cat << EOM
3727
3728By default 'static' libraries are built.
3729
3730Do you want to build DLL (.dll) libraries?
3731EOM`
3732
3733dflt=$g4lib_build_dll
3734rp=$g4message
3735. ./myread
3736gans=$ans
3737
3738 case $gans in
3739
3740 n*|N*)
3741 g4lib_build_dll=n
3742 g4lib_build_shared=n
3743 g4lib_build_static=y
3744 break
3745 ;;
3746 y*|Y*)
3747 g4lib_build_dll=y
3748 g4lib_build_shared=n
3749 g4lib_build_static=n
3750
3751# g4lib_build_static=""
3752# g4lib_use_shared=1
3753# g4lib_use_static=""
3754 break
3755 ;;
3756# [eE])
3757# break
3758# ;;
3759# *)
3760# echo " "
3761# break
3762# ;;
3763 esac
3764done
3765
3766fi
3767
3768if test "X$g4system" != "XWIN32-VC" -a "X$g4system" != "XWIN32-VC7" ; then
3769
3770while test 1 = 1 ; do
3771
3772g4message=`cat << EOM
3773
3774By default 'static' (.a) libraries are built.
3775
3776Do you want to build 'shared' (.so) libraries?
3777EOM`
3778
3779dflt=$g4lib_build_shared
3780rp=$g4message
3781. ./myread
3782gans=$ans
3783
3784 case $gans in
3785
3786 n*|N*)
3787 g4lib_build_shared=n
3788 g4lib_build_static=y
3789 break
3790 ;;
3791 y*|Y*)
3792 g4lib_build_shared=y
3793# g4lib_build_static=""
3794# g4lib_use_shared=1
3795# g4lib_use_static=""
3796 break
3797 ;;
3798# [eE])
3799# break
3800# ;;
3801# *)
3802# echo " "
3803# break
3804# ;;
3805 esac
3806done
3807
3808if [ X$g4lib_build_shared = Xy ] ; then
3809#
3810# Ask about g4lib_build_static - default "n".
3811#
3812echo ""
3813
3814while test 1 = 1 ; do
3815
3816g4message=`cat << EOM
3817
3818You selected to build 'shared' (.so) libraries.
3819Do you want to build 'static' (.a) libraries too?
3820EOM`
3821
3822#dflt=$g4lib_build_static
3823dflt=n
3824rp=$g4message
3825. ./myread
3826gans=$ans
3827
3828 case $gans in
3829
3830 n*|N*)
3831 g4lib_build_static=n
3832 break
3833 ;;
3834 y*|Y*)
3835# g4lib_build_shared=1
3836 g4lib_build_static=y
3837# g4lib_use_shared=1
3838# g4lib_use_static=""
3839 break
3840 ;;
3841# [eE])
3842# break
3843# ;;
3844# *)
3845# echo " "
3846# break
3847# ;;
3848 esac
3849done
3850
3851## Comment out in waiting G4LIB_USE_STATIC and G4LIB_USE_SHARED.
3852#
3853#if [ X$g4lib_build_static = Xy ] ; then
3854##
3855## Ask about g4lib_use_static - default "n".
3856##
3857#echo ""
3858#
3859#while test 1 = 1 ; do
3860#
3861#g4message=`cat << EOM
3862#
3863#You selected to build 'shared' (.so) and 'static' (.a) libraries.
3864#Do you want to use 'static' (.a) libraries?
3865#EOM`
3866#
3867#dflt=$g4lib_use_static
3868#rp=$g4message
3869#. ./myread
3870#gans=$ans
3871#
3872# case $gans in
3873#
3874# n*|N*)
3875# break
3876# ;;
3877# y*|Y*)
3878## g4lib_build_shared=1
3879## g4lib_build_static=1
3880## g4lib_use_shared=1
3881# g4lib_use_static=y
3882# break
3883# ;;
3884## [eE])
3885## break
3886## ;;
3887## *)
3888## echo " "
3889## break
3890## ;;
3891# esac
3892#done
3893#fi
3894
3895fi
3896
3897fi # if !Win
3898
3899echo " "
3900case "$g4global" in
3901'')
3902 g4global=n
3903 ;;
3904esac
3905
3906echo " "
3907# By default it's 'grabular'!
3908case "$g4granular" in
3909'')
3910 g4granular=y
3911 ;;
3912esac
3913
3914echo " "
3915# Will be set (if needed) in GNUmakefile!
3916case "$g4lib_use_granular" in
3917'')
3918 g4lib_use_granular=y
3919 ;;
3920esac
3921
3922if 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
3923
3924 g4global=n
3925 g4granular=n
3926 g4lib_use_granular=n
3927
3928fi
3929
3930if 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
3931
3932#
3933# Ask about g4global - default "(empty)".
3934#
3935echo ""
3936
3937while test 1 = 1 ; do
3938
3939g4message=`cat << EOM
3940
3941Do you want to build 'global' compound libraries?
3942EOM`
3943
3944dflt=$g4global
3945rp=$g4message
3946. ./myread
3947gans=$ans
3948
3949 case $gans in
3950
3951 n*|N*)
3952 g4global=n
3953 g4granular=y
3954 g4lib_use_granular=y
3955 break
3956 ;;
3957 y*|Y*)
3958 g4global=y
3959# Shoud be comment out to keep settings from config.sh - not now to keep as in release
3960 g4granular=n
3961# Shoud be comment out to keep settings from config.sh - not now to keep as in release
3962 g4lib_use_granular=n
3963 break
3964 ;;
3965# [eE])
3966# break
3967# ;;
3968# *)
3969# echo " "
3970# break
3971# ;;
3972 esac
3973done
3974
3975if [ X$g4global = Xy ] ; then
3976#
3977# Ask about g4granular - default "n".
3978#
3979echo ""
3980
3981while test 1 = 1 ; do
3982
3983g4message=`cat << EOM
3984
3985Granular libraries are used by defaults, you asked to build global
3986compound libraries. Do you want to build 'granular' libraries too?
3987EOM`
3988
3989dflt=$g4granular
3990rp=$g4message
3991. ./myread
3992gans=$ans
3993
3994 case $gans in
3995
3996 n*|N*)
3997 g4granular=n
3998 break
3999 ;;
4000 y*|Y*)
4001 g4granular=y
4002 break
4003 ;;
4004# [eE])
4005# break
4006# ;;
4007# *)
4008# echo " "
4009# break
4010# ;;
4011 esac
4012done
4013
4014if [ X$g4granular = Xy ] ; then
4015#
4016# Ask about g4lib_use_granular - default "n".
4017#
4018echo ""
4019
4020while test 1 = 1 ; do
4021
4022g4message=`cat << EOM
4023
4024Global libraries are used by defaults, you asked to build global
4025compound libraries and granular libraries.
4026Do you want to use 'granular' libraries instead?
4027EOM`
4028
4029dflt=$g4lib_use_granular
4030rp=$g4message
4031. ./myread
4032gans=$ans
4033
4034 case $gans in
4035
4036 n*|N*)
4037 g4lib_use_granular=n
4038 break
4039 ;;
4040 y*|Y*)
4041 g4lib_use_granular=y
4042 break
4043 ;;
4044# [eE])
4045# break
4046# ;;
4047# *)
4048# echo " "
4049# break
4050# ;;
4051 esac
4052done
4053fi
4054fi
4055
4056fi # !Win
4057
4058### End file - without will be problem! Check in others...
4059
4060
4061echo " "
4062case "$g4debug" in
4063'')
4064 g4debug=n
4065 ;;
4066esac
4067
4068#
4069# Ask about g4debug - default "(empty)".
4070#
4071echo ""
4072
4073while test 1 = 1 ; do
4074
4075g4message=`cat << EOM
4076
4077Do you want to compile libraries in DEBUG mode (-g)?
4078EOM`
4079
4080dflt=$g4debug
4081rp=$g4message
4082. ./myread
4083gans=$ans
4084
4085 case $gans in
4086
4087 n*|N*)
4088 break
4089 ;;
4090 y*|Y*)
4091 g4debug=y
4092 break
4093 ;;
4094# [eE])
4095# break
4096# ;;
4097# *)
4098# echo " "
4099# break
4100# ;;
4101 esac
4102done
4103
4104
4105echo " "
4106
4107case "$g4ui_none" in
4108'')
4109 g4ui_none=n
4110 ;;
4111esac
4112
4113# Set by default!
4114case "$g4ui_build_terminal_session" in
4115'')
4116 g4ui_build_terminal_session=y
4117 ;;
4118esac
4119
4120# Set by default!
4121case "$g4ui_use_terminal" in
4122'')
4123 g4ui_use_terminal=y
4124 ;;
4125esac
4126
4127# Set by default!
4128case "$g4ui_build_gag_session" in
4129'')
4130 g4ui_build_gag_session=y
4131 ;;
4132esac
4133
4134# Set by default!
4135case "$g4ui_use_gag" in
4136'')
4137 g4ui_use_gag=y
4138 ;;
4139esac
4140
4141case "$g4ui_build_xm_session" in
4142'')
4143 g4ui_build_xm_session=n
4144 ;;
4145esac
4146
4147case "$g4ui_use_xm" in
4148'')
4149 g4ui_use_xm=n
4150 ;;
4151esac
4152
4153case "$g4ui_build_xaw_session" in
4154'')
4155 g4ui_build_xaw_session=n
4156 ;;
4157esac
4158
4159case "$g4ui_use_xaw" in
4160'')
4161 g4ui_use_xaw=n
4162 ;;
4163esac
4164
4165case "$g4ui_build_win32_session" in
4166'')
4167 g4ui_build_win32_session=n
4168 ;;
4169esac
4170
4171case "$g4ui_use_win32" in
4172'')
4173 g4ui_use_win32=n
4174 ;;
4175esac
4176
4177# Set by default!
4178case "$g4ui_use_tcsh" in
4179'')
4180 g4ui_use_tcsh=y
4181 ;;
4182esac
4183
4184
4185
4186
4187echo ""
4188
4189g4message=`cat << EOM
4190
4191 G4UI_NONE
4192
4193If this variable is set, no UI sessions nor any UI libraries are built.
4194This can be useful when running a pure batch job or in a user framework
4195having its own UI system.
4196Do you want to set this variable ?
4197
4198EOM`
4199
4200dflt=$g4ui_none
4201rp=$g4message
4202. ./myread
4203gans=$ans
4204
4205 case $gans in
4206
4207 n*|N*)
4208 g4ui_none=n
4209 ;;
4210 y*|Y*)
4211 g4ui_none=y
4212 ;;
4213 esac
4214
4215case $g4ui_none in
4216
4217n)
4218
4219g4message=`cat << EOM
4220
4221 G4UI_BUILD_TERMINAL_SESSION
4222 Specifies to include in kernel library a basic dumb terminal
4223 user interface (default).
4224
4225 G4UI_USE_TERMINAL
4226 Specifies to use dumb terminal interface in the application to be
4227 built (default).
4228EOM`
4229
4230dflt=$g4ui_use_terminal
4231rp=$g4message
4232#. ./myread
4233#gans=$ans
4234gans=y
4235
4236 case $gans in
4237
4238 n*|N*)
4239 g4ui_build_terminal_session=n
4240 g4ui_use_terminal=n
4241 ;;
4242 y*|Y*)
4243 g4ui_build_terminal_session=y
4244 g4ui_use_terminal=y
4245 ;;
4246 esac
4247
4248g4message=`cat << EOM
4249
4250 G4UI_BUILD_GAG_SESSION
4251 Specifies to include in kernel library the GAG based
4252 user interface.
4253
4254 G4UI_USE_GAG
4255 Specifies to use the GAG interface in the application to be
4256 built.
4257EOM`
4258
4259dflt=$g4ui_use_gag
4260rp=$g4message
4261#. ./myread
4262#gans=$ans
4263gans=y
4264
4265 case $gans in
4266
4267 n*|N*)
4268 g4ui_build_gag_session=n
4269 g4ui_use_gag=n
4270 ;;
4271 y*|Y*)
4272 g4ui_build_gag_session=y
4273 g4ui_use_gag=y
4274 ;;
4275 esac
4276
4277if test "X$g4system" != "XWIN32-VC" -a "X$g4system" != "XWIN32-VC7"; then
4278
4279g4message=`cat << EOM
4280
4281 G4UI_BUILD_XAW_SESSION
4282 G4UI_USE_XAW
4283
4284 Specifies to include and use the XAW interfaces in the
4285 application to be built.
4286 The XAW (X11 Athena Widget set) extensions are required to activate
4287 and build this driver.
4288EOM`
4289
4290dflt=$g4ui_use_xaw
4291rp=$g4message
4292. ./myread
4293gans=$ans
4294
4295 case $gans in
4296
4297 n*|N*)
4298 g4ui_build_xaw_session=n
4299 g4ui_use_xaw=n
4300 ;;
4301 y*|Y*)
4302 g4ui_build_xaw_session=y
4303 g4ui_use_xaw=y
4304 ;;
4305 esac
4306
4307############################################################
4308############################################################
4309
4310if test "X$g4ui_build_xaw_session" = "Xy" ; then
4311
4312if test "X$g4ui_xawhome" = "X" ; then
4313xaw_dirs=`find $g4ui_xawhome /usr/X11R6/include /usr/local/include /usr/include /sw/include -type d -name Xaw 2>/dev/null |xargs echo`
4314#echo ogl_dirs=$ogl_dirs
4315
4316if test "X$xaw_dirs" != "X" ; then
4317
4318g4xaw_base_dir_found=`echo $xaw_dirs|cut -d" " -f1`
4319#echo g4ogl_base_dir_found=$g4ogl_base_dir_found
4320
4321# That's right: should be 3 times! (e.g./usr/local/lib/libGLU.so -> /usr/local)
4322g4xaw_base_dir_found=`dirname $g4xaw_base_dir_found`
4323g4xaw_base_dir_found=`dirname $g4xaw_base_dir_found`
4324g4xaw_base_dir_found=`dirname $g4xaw_base_dir_found`
4325
4326 g4ui_xawhome=$g4xaw_base_dir_found
4327#else
4328#case "$g4ui_xawhome" in
4329#'')
4330# g4ui_xawhome=/usr/X11R6/
4331# ;;
4332#esac
4333fi
4334fi
4335
4336##########################################################################
4337
4338#if test "X$g4ui_xawhome" != "X" ; then
4339#xaw_dirs=$g4ui_xawhome
4340#fi
4341
4342if test "X$g4ui_xawhome" != "X" ; then
4343
4344g4message=`cat << EOM
4345
4346You have selected to use the XAW based user interfaces.
4347Specify the correct path where XAW is installed in your system.
4348It was found in $g4ui_xawhome. Press [Enter] to set this path or type the correct one.
4349
4350You can set '-' (without quotation) to CANCEL the XAW flag at all:
4351
4352EOM`
4353
4354dflt=$g4ui_xawhome
4355fn='d~(-)'
4356rp=$g4message
4357. ./getfile
4358
4359cend="no"
4360while test "$cend" = "no" ; do
4361if test -e "$ans/include/X11/Xaw" || [ "X$ans" = "X-" ]; then
4362cend="yes"
4363if test "X$ans" != "X-" ; then
4364
4365g4ui_xawhome=$ans
4366
4367else
4368
4369g4ui_build_xaw_session=n
4370g4ui_use_xaw=n
4371
4372fi
4373else
4374
4375g4message=`cat << EOM
4376
4377You have selected to use XAW based user interfaces.
4378But XAW was not found in $ans.
4379Please specify the correct path where XAW is installed in your system.
4380
4381You can set '-' (without quotation) to CANCEL the XAW flag at all:
4382
4383EOM`
4384
4385dflt=""
4386fn='d~(-)'
4387rp=$g4message
4388. ./getfile
4389fi
4390done
4391
4392else
4393
4394g4message=`cat << EOM
4395
4396You have selected to use XAW based user interfaces.
4397But XAW was not found in expected place.
4398Please specify the correct path where XAW is installed in your system.
4399
4400You can set '-' (without quotation) to CANCEL the XAW flag at all:
4401
4402EOM`
4403
4404dflt=""
4405fn='d~(-)'
4406rp=$g4message
4407. ./getfile
4408
4409cend="no"
4410while test "$cend" = "no" ; do
4411if test -e "$ans/include/X11/Xaw" || [ "X$ans" = "X-" ]; then
4412cend="yes"
4413if test "X$ans" != "X-" ; then
4414
4415g4ui_xawhome=$ans
4416
4417else
4418
4419g4ui_build_xaw_session=n
4420g4ui_use_xaw=n
4421
4422fi
4423else
4424
4425g4message=`cat << EOM
4426
4427You have selected to use XAW based user interfaces.
4428But XAW was not found in $ans.
4429Please specify the correct path where XAW is installed in your system.
4430
4431You can set '-' (without quotation) to CANCEL the XAW flag at all:
4432
4433EOM`
4434
4435dflt=""
4436fn='d~(-)'
4437rp=$g4message
4438. ./getfile
4439fi
4440done
4441fi
4442
4443if test "X$g4osname" = "XLinux"; then
4444
4445if test "X$g4ui_xawhome" = "X/usr" -o "X$g4ui_xawhome" = "X/usr/local" ; then
4446g4ui_xawhome=""
4447fi
4448fi
4449fi # g4vis_build_opheglxm_driver
4450
4451###############################################
4452# Set XMFLAGS and XMLIBS
4453#
4454
4455if test "X$g4ui_build_xaw_session" = "Xy" ; then
4456
4457if test "X$g4osname" = "XAIX" ; then
4458g4ui_xawflags=" -I$g4ui_xawhome/include "
4459g4ui_xawlibs=" -L$g4ui_xawhome/lib -lXaw -lXmu -lXt -lX11 -lXext "
4460fi
4461
4462if test "X$g4osname" = "XLinux" ; then
[921]4463 if test "X$g4ui_xawhome" = "X" ; then
4464 g4ui_xawflags=""
4465 else
4466 g4ui_xawflags=" -I$g4ui_xawhome/include "
4467 fi
4468
4469 if test "X$g4ui_xawhome" = "X/usr/X11R6" -o "X$g4ui_xawhome" = "X" ; then
[869]4470 g4ui_xawlibs=" -lXaw "
4471 else
[921]4472 if test -d "$g4ui_xawhome/lib64" ; then
4473 g4ui_xawlibs=" -L$g4ui_xawhome/lib64 -lXaw "
4474 else
4475 g4ui_xawlibs=" -L$g4ui_xawhome/lib -lXaw "
4476 fi
[869]4477 fi
4478fi
4479
4480if test "X$g4osname" = "XDarwin" ; then
4481g4ui_xawflags=" -I$g4ui_xawhome/include "
4482g4ui_xawlibs=" -L$g4ui_xawhome/lib -lXaw "
4483fi
4484
4485if test "X$g4osname" = "XDEC" ; then
4486g4ui_xawflags=" -I$g4ui_xawhome/include "
4487g4ui_xawlibs=" -L$g4ui_xawhome/lib -lXaw "
4488fi
4489
4490if test "X$g4osname" = "XHP" ; then
4491g4ui_xawflags=" -I$g4ui_xawhome/include "
4492g4ui_xawlibs=" -L$g4ui_xawhome/lib -lXaw "
4493fi
4494
4495if test "X$g4osname" = "XSGI" ; then
4496g4ui_xawflags=" -I$g4ui_xawhome/include "
4497g4ui_xawlibs=" -L$g4ui_xawhome/lib -lXaw "
4498fi
4499
4500if test "X$g4osname" = "XSUN" ; then
4501g4ui_xawflags=" -I$g4ui_xawhome/include "
4502g4ui_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 "
4503fi
4504
4505fi # end of XM build
4506
4507###############################################
4508###############################################
4509
4510g4message=`cat << EOM
4511
4512 G4UI_BUILD_XM_SESSION
4513 G4UI_USE_XM
4514
4515 Specifies to include and use the XM Motif based user interfaces.
4516 The XM Motif extensions are required to activate and build this
4517 driver.
4518
4519EOM`
4520
4521dflt=$g4ui_use_xm
4522rp=$g4message
4523. ./myread
4524gans=$ans
4525
4526 case $gans in
4527
4528 n*|N*)
4529 g4ui_build_xm_session=n
4530 g4ui_use_xm=n
4531 ;;
4532 y*|Y*)
4533 g4ui_build_xm_session=y
4534 g4ui_use_xm=y
4535 ;;
4536 esac
4537
4538
4539############################################################
4540############################################################
4541
4542if test "X$g4ui_build_xm_session" = "Xy" ; then
4543
4544if test "X$g4vis_xmhome" = "X" ; then
4545xm_dirs=`find $g4vis_xmhome /usr/X11R6/include /usr/local/include /usr/include /sw/include -type d -name Xm 2>/dev/null |xargs echo`
4546#echo ogl_dirs=$ogl_dirs
4547
4548if test "X$xm_dirs" != "X" ; then
4549
4550g4xm_base_dir_found=`echo $xm_dirs|cut -d" " -f1`
4551#echo g4ogl_base_dir_found=$g4ogl_base_dir_found
4552
4553# That's right: should be twice! (e.g./usr/local/lib/libGLU.so -> /usr/local)
4554g4xm_base_dir_found=`dirname $g4xm_base_dir_found`
4555g4xm_base_dir_found=`dirname $g4xm_base_dir_found`
4556
4557 g4vis_xmhome=$g4xm_base_dir_found
4558#else
4559#case "$g4vis_xmhome" in
4560#'')
4561# g4vis_xmhome=/usr/X11R6/
4562# ;;
4563#esac
4564fi
4565fi
4566
4567##########################################################################
4568
4569#if test "X$g4vis_xmhome" != "X" ; then
4570#xm_dirs=$g4vis_xmhome
4571#fi
4572
4573if test "X$g4vis_xmhome" != "X" ; then
4574
4575g4message=`cat << EOM
4576
4577You have selected to use the XM Motif based user interfaces.
4578Specify the correct path where Xm is installed in your system.
4579It was found in $g4vis_xmhome. Press [Enter] to set this path or type the correct one.
4580
4581You can set '-' (without quotation) to CANCEL the XM flag at all:
4582
4583EOM`
4584
4585dflt=$g4vis_xmhome
4586fn='d~(-)'
4587rp=$g4message
4588. ./getfile
4589
4590cend="no"
4591while test "$cend" = "no" ; do
4592if test -e "$ans/include/Xm" || [ "X$ans" = "X-" ]; then
4593cend="yes"
4594if test "X$ans" != "X-" ; then
4595
4596g4vis_xmhome=$ans
4597
4598else
4599
4600g4ui_build_xm_session=n
4601g4ui_use_xm=n
4602
4603fi
4604else
4605
4606g4message=`cat << EOM
4607
4608You have selected to use XM Motif based user interfaces.
4609But XM Motif was not found in $ans.
4610Please specify the correct path where Xm is installed in your system.
4611
4612You can set '-' (without quotation) to CANCEL the XM flag at all:
4613
4614EOM`
4615
4616dflt=""
4617fn='d~(-)'
4618rp=$g4message
4619. ./getfile
4620fi
4621done
4622
4623else
4624
4625g4message=`cat << EOM
4626
4627You have selected to use XM Motif based user interfaces.
4628But XM Motif was not found in expected place.
4629Please specify the correct path where Xm is installed in your system.
4630
4631You can set '-' (without quotation) to CANCEL the XM flag at all:
4632
4633EOM`
4634
4635dflt=""
4636fn='d~(-)'
4637rp=$g4message
4638. ./getfile
4639
4640cend="no"
4641while test "$cend" = "no" ; do
4642if test -e "$ans/include/Xm" || [ "X$ans" = "X-" ]; then
4643cend="yes"
4644if test "X$ans" != "X-" ; then
4645
4646g4vis_xmhome=$ans
4647
4648else
4649
4650g4ui_build_xm_session=n
4651g4ui_use_xm=n
4652
4653fi
4654else
4655
4656g4message=`cat << EOM
4657
4658You have selected to use XM Motif based user interfaces.
4659But XM Motif was not found in $ans.
4660Please specify the correct path where Xm is installed in your system.
4661
4662You can set '-' (without quotation) to CANCEL the XM flag at all:
4663
4664EOM`
4665
4666dflt=""
4667fn='d~(-)'
4668rp=$g4message
4669. ./getfile
4670fi
4671done
4672fi
4673
4674if test "X$g4osname" = "XLinux"; then
[921]4675 if test "X$g4vis_xmhome" = "X/usr" -o "X$g4vis_xmhome" = "X/usr/local" ; then
4676 g4vis_xmhome=""
4677 fi
[869]4678fi
4679fi # g4vis_build_opheglxm_driver
4680
4681###############################################
4682# Set XMFLAGS and XMLIBS
4683#
4684
4685if test "X$g4ui_build_xm_session" = "Xy" ; then
4686
4687if test "X$g4osname" = "XAIX" ; then
4688g4vis_xmflags=" -I$g4vis_xmhome/include "
4689g4vis_xmlibs=" -L$g4vis_xmhome/lib -lXm -lXt -lX11 "
4690fi
4691
4692if test "X$g4osname" = "XLinux" ; then
[921]4693 if test "X$g4vis_xmhome" = "X" ; then
4694 g4vis_xmflags=""
4695 else
4696 g4vis_xmflags=" -I$g4vis_xmhome/include "
4697 fi
4698
4699 if test "X$g4vis_xmhome" = "X/usr/X11R6" -o "X$g4vis_xmhome" = "X" ; then
[869]4700 g4vis_xmlibs=" -lXm -lXpm "
4701 else
[921]4702 if test -d "$g4vis_xmhome/lib64" ; then
4703 g4vis_xmlibs=" -L$g4vis_xmhome/lib64 -lXm -lXpm "
4704 else
4705 g4vis_xmlibs=" -L$g4vis_xmhome/lib -lXm -lXpm "
4706 fi
[869]4707 fi
4708fi
4709
4710if test "X$g4osname" = "XDarwin" ; then
4711g4vis_xmflags=" -I$g4vis_xmhome/include "
4712g4vis_xmlibs=" -L$g4vis_xmhome/lib -lXm -lXpm "
4713fi
4714
4715if test "X$g4osname" = "XDEC" ; then
4716g4vis_xmflags=" -I$g4vis_xmhome/include "
4717g4vis_xmlibs=" -L$g4vis_xmhome/lib -lXm "
4718fi
4719
4720if test "X$g4osname" = "XHP" ; then
4721g4vis_xmflags=" -I$g4vis_xmhome/include/Motif1.2 "
4722g4vis_xmlibs=" -L$g4vis_xmhome/lib/Motif1.2 -lXm "
4723fi
4724
4725if test "X$g4osname" = "XSGI" ; then
4726g4vis_xmflags=" -I$g4vis_xmhome/include "
4727g4vis_xmlibs=" -L$g4vis_xmhome/lib -lXm "
4728fi
4729
4730if test "X$g4osname" = "XSUN" ; then
4731g4vis_xmflags=" -I$g4vis_xmhome/include "
4732g4vis_xmlibs=" -L$g4vis_xmhome/lib -L/usr/openwin/lib -L/usr/dt/lib -L/usr/ucblib -R/usr/openwin/lib -lXt -lXm -lX11 "
4733fi
4734
4735fi # end of XM build
4736
4737###############################################
4738###############################################
4739
4740fi # if !WIN
4741
4742if test "X$g4system" = "XWIN32-VC" -o "X$g4system" = "XWIN32-VC7"; then
4743
4744g4message=`cat << EOM
4745
4746 G4UI_BUILD_WIN32_SESSION
4747 G4UI_USE_WIN32
4748
4749 Specifies to include and use the terminal interface for
4750 Windows systems.
4751
4752EOM`
4753
4754dflt=$g4ui_use_win32
4755rp=$g4message
4756. ./myread
4757gans=$ans
4758
4759 case $gans in
4760
4761 n*|N*)
4762 g4ui_build_win32_session=n
4763 g4ui_use_win32=n
4764 ;;
4765 y*|Y*)
4766 g4ui_build_win32_session=y
4767 g4ui_use_win32=y
4768 ;;
4769 esac
4770
4771fi # if WIN
4772
4773g4message=`cat << EOM
4774
4775 G4UI_USE_TCSH
4776 Specifies to use the tcsh-style terminal in the application
4777 to be built.
4778EOM`
4779
4780dflt=$g4ui_use_tcsh
4781rp=$g4message
4782#. ./myread
4783#gans=$ans
4784gans=y
4785
4786 case $gans in
4787
4788 n*|N*)
4789 g4ui_use_tcsh=n
4790 ;;
4791 y*|Y*)
4792 g4ui_use_tcsh=y
4793 ;;
4794 esac
4795
4796;;
4797esac
4798
4799#
4800# BEGIN QT/QTUI PROBE
4801#
4802
[884]4803# Checks applied for all systems ONLY IF g4ui_none HAS NOT BEEN SET TO y
[869]4804if test "x$g4ui_none" = "xn" ; then
[884]4805 # Query the user to see if build of Qt UI module is needed
4806 g4message=`cat <<EOM
[869]4807
[884]4808 G4UI_BUILD_QT_SESSION
4809 G4UI_USE_QT
[869]4810
4811Setting these variables will enable the building of the G4 Qt based
4812user interface module and the use of this module in your applications
4813respectively.
[884]4814The Qt3 or Qt4 headers, libraries and moc application are required to enable
4815the building of this module.
[869]4816Do you want to enable build and use of this module?
4817EOM`
4818
[884]4819 # Read in the user response
4820 dflt=$g4ui_build_qt_session
4821 rp=$g4message
4822 . ./myread
4823 gans=$ans
[869]4824
[884]4825 # Check response and take set variables as needed.
4826 case $gans in
4827 n*|N*)
4828 g4ui_build_qt_session=n
4829 g4ui_use_qt=n
4830 ;;
[869]4831 y*|Y*)
[884]4832 g4ui_build_qt_session=y
4833 g4ui_use_qt=y
4834 ;;
4835 esac
[869]4836
[884]4837 ##########
[869]4838
[884]4839 ##########
4840 # Now, if user chose to build module, we need to check for a Qt
4841 # installation
4842 #
4843 if test "x$g4ui_build_qt_session" = "xy" ; then
4844 echo " "
4845 # NB Have to supply arg to qt script, just blank in this case!
4846 qt_search_dir=""
4847 . ./qt
[869]4848
[884]4849 # If we didn't find Qt automatically, then ask user if they know
4850 # where it's installed...
4851 if test "x$g4_havegoodqt" = "xno" ; then
4852 promptend="no"
4853 user_qthome="the standard locations"
[869]4854
[884]4855 while test "x$promptend" = "xno" ; do
4856 g4message=`cat << EOM
[869]4857
[884]4858Autodetection failed to locate Qt3 or Qt4 in $qthomeloc on your system.
4859Please enter the path to your Qt3 OR Qt4 install (i.e. if Qt4 is installed
4860in PATH/include/QT, PATH/include or PATH/include/qt4, enter PATH),
4861or type '-' to CANCEL the build of the Qt UI module.
[869]4862Qt path:
4863EOM`
[884]4864 dflt=""
4865 fn='d~(-)'
4866 rp=$g4message
4867 . ./getfile
4868 user_qthome=$ans
[869]4869
[884]4870 if test "x$user_qthome" = "x-" ; then
4871 # Cancel build...
4872 g4ui_build_qt_session=n
4873 g4ui_use_qt=n
4874 echo "configure: build/use of Qt UI module cancelled"
4875 promptend=yes
4876 else
4877 # Check for installation in user directory
4878 echo " "
4879 qt_search_dir=$user_qthome
4880 . ./qt
[869]4881
[884]4882 if test "x$g4_havegoodqt" = "xyes" ; then
4883 promptend=yes
4884 fi
4885 fi #END TEST user_qthome = -
4886 done #END while promptend=no (for user input of Qt install)
4887 fi #END TEST g4_havegoodqt = no (for user prompt)
4888 fi #END TEST g4ui_build_qt_session (whether to build at all)
4889fi #END TEST g4ui_none = n
[869]4890
4891echo " "
4892case "$g4vis_none" in
4893'')
4894 g4vis_none=n
4895 ;;
4896esac
4897
4898
4899case "$g4vis_build_openglwin32_driver" in
4900'')
4901 g4vis_build_openglwin32_driver=n
4902 ;;
4903esac
4904
4905case "$g4vis_use_openglwin32" in
4906'')
4907 g4vis_use_openglwin32=n
4908 ;;
4909esac
4910
4911case "$g4vis_build_oiwin32_driver" in
4912'')
4913 g4vis_build_oiwin32_driver=n
4914 ;;
4915esac
4916
4917case "$g4vis_use_oiwin32" in
4918'')
4919 g4vis_use_oiwin32=n
4920 ;;
4921esac
4922
4923case "$g4vis_build_dawn_driver" in
4924'')
4925 g4vis_build_dawn_driver=n
4926 ;;
4927esac
4928
4929case "$g4vis_use_dawn" in
4930'')
4931 g4vis_use_dawn=n
4932 ;;
4933esac
4934
4935# Set by default!
4936case "$g4vis_build_dawnfile_driver" in
4937'')
4938 g4vis_build_dawnfile_driver=y
4939 ;;
4940esac
4941
4942# Set by default!
4943case "$g4vis_use_dawnfile" in
4944'')
4945 g4vis_use_dawnfile=y
4946 ;;
4947esac
4948
4949case "$g4vis_build_openglx_driver" in
4950'')
4951 g4vis_build_openglx_driver=n
4952 ;;
4953esac
4954
4955case "$g4vis_use_openglx" in
4956'')
4957 g4vis_use_openglx=n
4958 ;;
4959esac
4960
4961case "$g4vis_build_openglxm_driver" in
4962'')
4963 g4vis_build_openglxm_driver=n
4964 ;;
4965esac
4966
4967case "$g4vis_use_openglxm" in
4968'')
4969 g4vis_use_openglxm=n
4970 ;;
4971esac
4972
4973case "$g4vis_build_oix_driver" in
4974'')
4975 g4vis_build_oix_driver=n
4976 ;;
4977esac
4978
4979case "$g4vis_use_oix" in
4980'')
4981 g4vis_use_oix=n
4982 ;;
4983esac
4984
4985case "$g4vis_build_raytracerx_driver" in
4986'')
4987 g4vis_build_raytracerx_driver=n
4988 ;;
4989esac
4990
4991case "$g4vis_use_raytracerx" in
4992'')
4993 g4vis_use_raytracerx=n
4994 ;;
4995esac
4996
4997# Set by default!
4998case "$g4vis_build_raytracer_driver" in
4999'')
5000 g4vis_build_raytracer_driver=y
5001 ;;
5002esac
5003
5004# Set by default!
5005case "$g4vis_use_raytracer" in
5006'')
5007 g4vis_use_raytracer=y
5008 ;;
5009esac
5010
5011case "$g4vis_build_vrml_driver" in
5012'')
5013 g4vis_build_vrml_driver=n
5014 ;;
5015esac
5016
5017case "$g4vis_use_vrml" in
5018'')
5019 g4vis_use_vrml=n
5020 ;;
5021esac
5022
5023# Set by default!
5024case "$g4vis_build_asciitree_driver" in
5025'')
5026 g4vis_build_asciitree_driver=y
5027 ;;
5028esac
5029
5030# Set by default!
5031case "$g4vis_use_asciitree" in
5032'')
5033 g4vis_use_asciitree=y
5034 ;;
5035esac
5036
5037# Set by default!
5038case "$g4vis_build_gagtree_driver" in
5039'')
5040 g4vis_build_gagtree_driver=y
5041 ;;
5042esac
5043
5044# Set by default!
5045case "$g4vis_use_gagtree" in
5046'')
5047 g4vis_use_gagtree=y
5048 ;;
5049esac
5050
5051echo ""
5052
5053g4message=`cat << EOM
5054
5055 G4VIS_NONE
5056
5057If this variable is set, no visualization drivers will be built or used.
5058Do you want to set this variable ?
5059
5060EOM`
5061
5062dflt=$g4vis_none
5063rp=$g4message
5064. ./myread
5065gans=$ans
5066
5067 case $gans in
5068
5069 n*|N*)
5070 g4vis_none=n
5071 ;;
5072 y*|Y*)
5073 g4vis_none=y
5074 ;;
5075 esac
5076
5077case $g4vis_none in
5078
5079n)
5080
5081if test "X$g4system" != "XWIN32-VC" -a "X$g4system" != "XWIN32-VC7"; then
5082
5083g4message=`cat << EOM
5084
5085 G4VIS_BUILD_OPENGLX_DRIVER
5086 G4VIS_USE_OPENGLX
5087
5088It is an interface to the de facto standard 3D graphics library,
5089OpenGL. It is well suited for real-time fast visualization
5090and prototyping. The X11 version of the OpenGL libraries is
5091required.
5092EOM`
5093
5094dflt=$g4vis_use_openglx
5095rp=$g4message
5096. ./myread
5097gans=$ans
5098
5099 case $gans in
5100
5101 n*|N*)
5102 g4vis_build_openglx_driver=n
5103 g4vis_use_openglx=n
5104 ;;
5105 y*|Y*)
5106 g4vis_build_openglx_driver=y
5107 g4vis_use_openglx=y
5108 ;;
5109 esac
5110
5111#############################################3
5112g4message=`cat << EOM
5113
5114 G4VIS_BUILD_OPENGLXM_DRIVER
5115 G4VIS_USE_OPENGLXM
5116
5117It is an interface to the de facto standard 3D graphics library,
5118OpenGL. It is well suited for real-time fast visualization
5119and prototyping. The X11 version of the OpenGL libraries and
5120the Motif Xm extension is required.
5121
5122EOM`
5123
5124dflt=$g4vis_use_openglxm
5125rp=$g4message
5126. ./myread
5127gans=$ans
5128
5129 case $gans in
5130
5131 n*|N*)
5132 g4vis_build_openglxm_driver=n
5133 g4vis_use_openglxm=n
5134 ;;
5135 y*|Y*)
5136 g4vis_build_openglxm_driver=y
5137 g4vis_use_openglxm=y
5138 ;;
5139 esac
5140
5141############################################################
5142#echo xm_dirs=$xm_dirs
5143#echo g4vis_xmhome=$g4vis_xmhome
5144#echo g4ui_build_xm_session=$g4ui_build_xm_session
5145#echo g4vis_build_openglxm_driver=$g4vis_build_openglxm_driver
5146
5147if test "X$g4ui_build_xm_session" = "Xn" ; then
5148
5149#echo PASS1
5150
5151if test "X$g4vis_build_openglxm_driver" = "Xy" ; then
5152
5153#echo PASS2
5154
5155if test "X$g4vis_xmhome" = "X" ; then
5156xm_dirs=`find $g4vis_xmhome /usr/X11R6/include /usr/local/include /usr/include /sw/include -type d -name Xm 2>/dev/null |xargs echo`
5157#echo ogl_dirs=$ogl_dirs
5158
5159if test "X$xm_dirs" != "X" ; then
5160
5161g4xm_base_dir_found=`echo $xm_dirs|cut -d" " -f1`
5162#echo g4ogl_base_dir_found=$g4ogl_base_dir_found
5163
5164# That's right: should be twice! (e.g./usr/local/lib/libGLU.so -> /usr/local)
5165g4xm_base_dir_found=`dirname $g4xm_base_dir_found`
5166g4xm_base_dir_found=`dirname $g4xm_base_dir_found`
5167
5168 g4vis_xmhome=$g4xm_base_dir_found
5169#else
5170#case "$g4vis_xmhome" in
5171#'')
5172# g4vis_xmhome=/usr/X11R6/
5173# ;;
5174#esac
5175fi
5176fi
5177
5178##########################################################################
5179
5180#if test "X$g4vis_xmhome" != "X" ; then
5181#xm_dirs=$g4vis_xmhome
5182#fi
5183
5184if test "X$g4vis_xmhome" != "X" ; then
5185
5186g4message=`cat << EOM
5187
5188You have selected to use OPENGLXM driver.
5189Specify the correct path where Xm is installed in your system.
5190It was found in $g4vis_xmhome. Press [Enter] to set this path or type the correct one.
5191
5192You can set '-' (without quotation) to CANCEL the XM flag at all:
5193
5194EOM`
5195
5196dflt=$g4vis_xmhome
5197fn='d~(-)'
5198rp=$g4message
5199. ./getfile
5200
5201cend="no"
5202while test "$cend" = "no" ; do
5203if test -e "$ans/include/Xm" || [ "X$ans" = "X-" ]; then
5204cend="yes"
5205if test "X$ans" != "X-" ; then
5206
5207g4vis_xmhome=$ans
5208
5209else
5210
5211g4vis_build_openglxm_driver=n
5212g4vis_use_openglxm=n
5213
5214fi
5215else
5216
5217g4message=`cat << EOM
5218
5219You have selected to use OPENGLXM driver.
5220But it was not found in $ans.
5221Please specify the correct path where Xm is installed in your system.
5222
5223You can set '-' (without quotation) to CANCEL the XM flag at all:
5224
5225EOM`
5226
5227dflt=""
5228fn='d~(-)'
5229rp=$g4message
5230. ./getfile
5231fi
5232done
5233
5234else
5235
5236g4message=`cat << EOM
5237
5238You have selected to use OPENGLXM driver.
5239But it was not found in expected place.
5240Please specify the correct path where Xm is installed in your system.
5241
5242You can set '-' (without quotation) to CANCEL the XM flag at all:
5243
5244EOM`
5245
5246dflt=""
5247fn='d~(-)'
5248rp=$g4message
5249. ./getfile
5250
5251cend="no"
5252while test "$cend" = "no" ; do
5253if test -e "$ans/include/Xm" || [ "X$ans" = "X-" ]; then
5254cend="yes"
5255if test "X$ans" != "X-" ; then
5256
5257g4vis_xmhome=$ans
5258
5259else
5260
5261g4vis_build_openglxm_driver=n
5262g4vis_use_openglxm=n
5263
5264fi
5265else
5266
5267g4message=`cat << EOM
5268
5269You have selected to use OPENGLXM driver.
5270But it was not found in $ans.
5271Please specify the correct path where Xm is installed in your system.
5272
5273You can set '-' (without quotation) to CANCEL the XM flag at all:
5274
5275EOM`
5276
5277dflt=""
5278fn='d~(-)'
5279rp=$g4message
5280. ./getfile
5281fi
5282done
5283fi
5284
5285if test "X$g4osname" = "XLinux"; then
5286
5287if test "X$g4vis_xmhome" = "X/usr" -o "X$g4vis_xmhome" = "X/usr/local" ; then
5288g4vis_xmhome=""
5289fi
5290fi
5291fi # g4vis_build_opheglxm_driver
5292
5293###############################################
5294# Set XMFLAGS and XMLIBS
5295#
5296
5297if test "X$g4vis_build_openglxm_driver" = "Xy" ; then
5298
5299if test "X$g4osname" = "XAIX" ; then
5300g4vis_xmflags=" -I$g4vis_xmhome/include "
5301g4vis_xmlibs=" -L$g4vis_xmhome/lib -lXm -lXt -lX11 "
5302fi
5303
5304if test "X$g4osname" = "XLinux" ; then
[921]5305 if test "X$g4vis_xmhome" = "X" ; then
5306 g4vis_xmflags=""
5307 else
5308 g4vis_xmflags=" -I$g4vis_xmhome/include "
5309 fi
5310
5311 if test "X$g4vis_xmhome" = "X/usr/X11R6" -o "X$g4vis_xmhome" = "X" ; then
[869]5312 g4vis_xmlibs=" -lXm -lXpm "
5313 else
[921]5314 if test -d "$g4vis_xmhome/lib64" ; then
5315 g4vis_xmlibs=" -L$g4vis_xmhome/lib64 -lXm -lXpm "
5316 else
5317 g4vis_xmlibs=" -L$g4vis_xmhome/lib -lXm -lXpm "
5318 fi
[869]5319 fi
5320fi
5321
5322if test "X$g4osname" = "XDarwin" ; then
5323g4vis_xmflags=" -I$g4vis_xmhome/include "
5324g4vis_xmlibs=" -L$g4vis_xmhome/lib -lXm -lXpm "
5325fi
5326
5327if test "X$g4osname" = "XDEC" ; then
5328g4vis_xmflags=" -I$g4vis_xmhome/include "
5329g4vis_xmlibs=" -L$g4vis_xmhome/lib -lXm "
5330fi
5331
5332if test "X$g4osname" = "XHP" ; then
5333g4vis_xmflags=" -I$g4vis_xmhome/include/Motif1.2 "
5334g4vis_xmlibs=" -L$g4vis_xmhome/lib/Motif1.2 -lXm "
5335fi
5336
5337if test "X$g4osname" = "XSGI" ; then
5338g4vis_xmflags=" -I$g4vis_xmhome/include "
5339g4vis_xmlibs=" -L$g4vis_xmhome/lib -lXm "
5340fi
5341
5342if test "X$g4osname" = "XSUN" ; then
5343g4vis_xmflags=" -I$g4vis_xmhome/include "
5344g4vis_xmlibs=" -L$g4vis_xmhome/lib -L/usr/openwin/lib -L/usr/dt/lib -L/usr/ucblib -R/usr/openwin/lib -lXt -lXm -lX11 "
5345fi
5346
5347fi # end of XM build
5348fi
5349###############################################
5350
5351fi # if !WIN
5352
5353######################################################################
5354if test "X$g4system" = "XWIN32-VC" -o "X$g4system" = "XWIN32-VC7"; then
5355
5356g4message=`cat << EOM
5357
5358 G4VIS_BUILD_OPENGLWIN32_DRIVER
5359 G4VIS_USE_OPENGLWIN32
5360
5361It is an interface to the de facto standard 3D graphics library,
5362OpenGL. It is well suited for real-time fast visualization
5363and prototyping. The Windows version of the OpenGL libraries is
5364required.
5365
5366EOM`
5367
5368dflt=$g4vis_use_openglwin32
5369rp=$g4message
5370. ./myread
5371gans=$ans
5372
5373 case $gans in
5374
5375 n*|N*)
5376 g4vis_build_openglwin32_driver=n
5377 g4vis_use_openglwin32=n
5378 ;;
5379 y*|Y*)
5380 g4vis_build_openglwin32_driver=y
5381 g4vis_use_openglwin32=y
5382 ;;
5383 esac
5384
5385fi # if WIN
5386###########################################
5387
5388if test "X$g4system" != "XWIN32-VC" -a "X$g4system" != "XWIN32-VC7"; then
5389
5390g4message=`cat << EOM
5391
5392 G4VIS_BUILD_DAWN_DRIVER
5393 G4VIS_USE_DAWN
5394
5395DAWN drivers are interfaces to the Fukui Renderer DAWN. DAWN is
5396a vectorized 3D PostScript processor suited to prepare technical
5397high quality outputs for presentation and/or documentation.
5398
5399EOM`
5400
5401dflt=$g4vis_use_dawn
5402rp=$g4message
5403. ./myread
5404gans=$ans
5405
5406 case $gans in
5407
5408 n*|N*)
5409 g4vis_build_dawn_driver=n
5410 g4vis_use_dawn=n
5411 ;;
5412 y*|Y*)
5413 g4vis_build_dawn_driver=y
5414 g4vis_use_dawn=y
5415 ;;
5416 esac
5417
5418
5419#######################################
5420g4message=`cat << EOM
5421
5422 G4VIS_BUILD_OIX_DRIVER
5423 G4VIS_USE_OIX
5424
5425The OpenInventor driver is based on OpenInventor technology
5426for scientific visualization.
5427The X11 version of OpenInventor is required.
5428
5429EOM`
5430
5431dflt=$g4vis_use_oix
5432rp=$g4message
5433. ./myread
5434gans=$ans
5435
5436 case $gans in
5437
5438 n*|N*)
5439 g4vis_build_oix_driver=n
5440 g4vis_use_oix=n
5441 ;;
5442 y*|Y*)
5443 g4vis_build_oix_driver=y
5444 g4vis_use_oix=y
5445 ;;
5446 esac
5447
5448############################################################
5449if test "X$g4vis_build_oix_driver" = "Xy" ; then
5450
5451oiv_dirs=`find $g4vis_oivhome /usr/X11R6/include /usr/local/include /usr/include -type d -name Inventor 2>/dev/null|xargs echo`
5452#echo ogl_dirs=$ogl_dirs
5453
5454if test "X$oiv_dirs" != "X" ; then
5455
5456g4oiv_base_dir_found=`echo $oiv_dirs|cut -d" " -f1`
5457#echo g4ogl_base_dir_found=$g4ogl_base_dir_found
5458
5459# That's right: should be twice! (e.g./usr/local/lib/libGLU.so -> /usr/local)
5460g4oiv_base_dir_found=`dirname $g4oiv_base_dir_found`
5461g4oiv_base_dir_found=`dirname $g4oiv_base_dir_found`
5462
5463 g4vis_oivhome=$g4oiv_base_dir_found
5464#else
5465#case "$g4vis_oivhome" in
5466#'')
5467# g4vis_oivhome=/usr
5468# ;;
5469#esac
5470fi
5471
5472##########################################################################
5473
5474#if test "X$g4vis_oivhome" != "X" ; then
5475#oiv_dirs=$g4vis_oivhome
5476#fi
5477
5478if test "X$g4vis_oivhome" != "X" ; then
5479
5480g4message=`cat << EOM
5481
5482 OIVHOME/include
5483 OIVHOME/lib
5484
5485You have selected to use OpenInventor driver.
5486Specify the correct path (OIVHOME) where OpenInventor is installed in your system.
5487It was found in $g4vis_oivhome. Press [Enter] to set this path or type the correct one.
5488
5489You can set '-' (without quotation) to CANCEL the OpenInventor flag at all:
5490
5491EOM`
5492
5493dflt=$g4vis_oivhome
5494fn='d~(-)'
5495rp=$g4message
5496. ./getfile
5497
5498cend="no"
5499while test "$cend" = "no" ; do
5500if test -e "$ans/include/Inventor" || [ "X$ans" = "X-" ]; then
5501cend="yes"
5502if test "X$ans" != "X-" ; then
5503
5504g4vis_oivhome=$ans
5505
5506else
5507
5508g4vis_build_oix_driver=n
5509g4vis_use_oix=n
5510
5511fi
5512else
5513
5514g4message=`cat << EOM
5515
5516 OIVHOME/include
5517 OIVHOME/lib
5518
5519You have selected to use OpenInventor driver.
5520But it was not found in $ans.
5521Please specify the correct path where OpenInventor is installed in your system.
5522
5523You can set '-' (without quotation) to CANCEL the OpenInventor flag at all:
5524
5525EOM`
5526
5527dflt=""
5528fn='d~(-)'
5529rp=$g4message
5530. ./getfile
5531fi
5532done
5533
5534else
5535
5536g4message=`cat << EOM
5537
5538 OIVHOME/include
5539 OIVHOME/lib
5540
5541You have selected to use OpenInventor driver.
5542But it was not found in expected place.
5543Please specify the correct path where OpenInventor is installed in your system.
5544
5545You can set '-' (without quotation) to CANCEL the OpenInventor flag at all:
5546
5547EOM`
5548
5549dflt=""
5550fn='d~(-)'
5551rp=$g4message
5552. ./getfile
5553
5554cend="no"
5555while test "$cend" = "no" ; do
5556if test -e "$ans/include/Inventor" || [ "X$ans" = "X-" ]; then
5557cend="yes"
5558if test "X$ans" != "X-" ; then
5559
5560g4vis_oivhome=$ans
5561
5562else
5563
5564g4vis_build_oix_driver=n
5565g4vis_use_oix=n
5566
5567fi
5568else
5569
5570g4message=`cat << EOM
5571
5572 OIVHOME/include
5573 OIVHOME/lib
5574
5575You have selected to use OpenInventor driver.
5576But it was not found in $ans.
5577Please specify the correct path where OpenInventor is installed in your system.
5578
5579You can set '-' (without quotation) to CANCEL the OpenInventor flag at all:
5580
5581EOM`
5582
5583dflt=""
5584fn='d~(-)'
5585rp=$g4message
5586. ./getfile
5587fi
5588done
5589fi
5590
5591if test "X$g4osname" = "XLinux"; then
5592
5593if test "X$g4vis_oivhome" = "X/usr" -o "X$g4vis_oivhome" = "X/usr/local"; then
5594g4vis_oivhome=""
5595fi
5596fi
5597fi # g4vis_build_oix_driver
5598
5599###############################################
5600
5601g4message=`cat << EOM
5602
5603 G4VIS_BUILD_RAYTRACERX_DRIVER
5604 G4VIS_USE_RAYTRACERX
5605
5606Allows for interactive ray-tracing graphics through X11.
5607The X11 package is required.
5608
5609EOM`
5610
5611dflt=$g4vis_use_raytracerx
5612rp=$g4message
5613. ./myread
5614gans=$ans
5615
5616 case $gans in
5617
5618 n*|N*)
5619 g4vis_build_raytracerx_driver=n
5620 g4vis_use_raytracerx=n
5621 ;;
5622 y*|Y*)
5623 g4vis_build_raytracerx_driver=y
5624 g4vis_use_raytracerx=y
5625 ;;
5626 esac
5627
5628########################################################
5629fi # if !WIN
5630
5631###############################################################
5632if test "X$g4system" = "XWIN32-VC" -o "X$g4system" = "XWIN32-VC7"; then
5633
5634g4message=`cat << EOM
5635
5636 G4VIS_BUILD_OIWIN32_DRIVER
5637 G4VIS_USE_OIWIN32
5638
5639Specifies to build and use the driver for the free X11 version of
5640OpenInventor on Windows systems.
5641The Windows version of OpenInventor is required.
5642
5643EOM`
5644
5645dflt=$g4vis_use_oiwin32
5646rp=$g4message
5647. ./myread
5648gans=$ans
5649
5650 case $gans in
5651
5652 n*|N*)
5653 g4vis_build_oiwin32_driver=n
5654 g4vis_use_oiwin32=n
5655 ;;
5656 y*|Y*)
5657 g4vis_build_oiwin32_driver=y
5658 g4vis_use_oiwin32=y
5659 ;;
5660 esac
5661
5662############################################################
5663if test "X$g4vis_build_oiwin32_driver" = "Xy" ; then
5664
5665oiv_dirs=`find $g4vis_oivhome /usr/X11R6/include /usr/local/include /usr/include -type d -name Inventor 2>/dev/null|xargs echo`
5666#echo ogl_dirs=$ogl_dirs
5667
5668if test "X$oiv_dirs" != "X" ; then
5669
5670g4oiv_base_dir_found=`echo $oiv_dirs|cut -d" " -f1`
5671#echo g4ogl_base_dir_found=$g4ogl_base_dir_found
5672
5673# That's right: should be twice! (e.g./usr/local/lib/libGLU.so -> /usr/local)
5674g4oiv_base_dir_found=`dirname $g4oiv_base_dir_found`
5675g4oiv_base_dir_found=`dirname $g4oiv_base_dir_found`
5676
5677 g4vis_oivhome=$g4oiv_base_dir_found
5678#else
5679#case "$g4vis_oivhome" in
5680#'')
5681# g4vis_oivhome=/usr
5682# ;;
5683#esac
5684fi
5685
5686##########################################################################
5687
5688#if test "X$g4vis_oivhome" != "X" ; then
5689#oiv_dirs=$g4vis_oivhome
5690#fi
5691
5692if test "X$g4vis_oivhome" != "X" ; then
5693
5694g4message=`cat << EOM
5695
5696 OIVHOME/include
5697 OIVHOME/lib
5698
5699You have selected to use OpenInventor driver.
5700Specify the correct path (OIVHOME) where OpenInventor is installed in your system.
5701It was found in $g4vis_oivhome. Press [Enter] to set this path or type the correct one.
5702
5703You can set '-' (without quotation) to CANCEL the OpenInventor flag at all:
5704
5705EOM`
5706
5707dflt=$g4vis_oivhome
5708fn='d~(-)'
5709rp=$g4message
5710. ./getfile
5711
5712cend="no"
5713while test "$cend" = "no" ; do
5714if test -e "$ans/include/Inventor" || [ "X$ans" = "X-" ]; then
5715cend="yes"
5716if test "X$ans" != "X-" ; then
5717
5718g4vis_oivhome=$ans
5719
5720else
5721
5722g4vis_build_oiwin32_driver=n
5723g4vis_use_oiwin32=n
5724
5725fi
5726else
5727
5728g4message=`cat << EOM
5729
5730 OIVHOME/include
5731 OIVHOME/lib
5732
5733You have selected to use OpenInventor driver.
5734But it was not found in $ans.
5735Please specify the correct path where OpenInventor is installed in your system.
5736
5737You can set '-' (without quotation) to CANCEL the OpenInventor flag at all:
5738
5739EOM`
5740
5741dflt=""
5742fn='d~(-)'
5743rp=$g4message
5744. ./getfile
5745fi
5746done
5747
5748else
5749
5750g4message=`cat << EOM
5751
5752 OIVHOME/include
5753 OIVHOME/lib
5754
5755You have selected to use OpenInventor driver.
5756But it was not found in expected place.
5757Please specify the correct path where OpenInventor is installed in your system.
5758
5759You can set '-' (without quotation) to CANCEL the OpenInventor flag at all:
5760
5761EOM`
5762
5763dflt=""
5764fn='d~(-)'
5765rp=$g4message
5766. ./getfile
5767
5768cend="no"
5769while test "$cend" = "no" ; do
5770if test -e "$ans/include/Inventor" || [ "X$ans" = "X-" ]; then
5771cend="yes"
5772if test "X$ans" != "X-" ; then
5773
5774g4vis_oivhome=$ans
5775
5776else
5777
5778g4vis_build_oiwin32_driver=n
5779g4vis_use_oiwin32=n
5780
5781fi
5782else
5783
5784g4message=`cat << EOM
5785
5786 OIVHOME/include
5787 OIVHOME/lib
5788
5789You have selected to use OpenInventor driver.
5790But it was not found in $ans.
5791Please specify the correct path where OpenInventor is installed in your system.
5792
5793You can set '-' (without quotation) to CANCEL the OpenInventor flag at all:
5794
5795EOM`
5796
5797dflt=""
5798fn='d~(-)'
5799rp=$g4message
5800. ./getfile
5801fi
5802done
5803fi
5804
5805if test "X$g4osname" = "XLinux"; then
5806
5807if test "X$g4vis_oivhome" = "X/usr" -o "X$g4vis_oivhome" = "X/usr/local"; then
5808g4vis_oivhome=""
5809fi
5810fi
5811fi # g4vis_build_oiwin32_driver
5812
5813###############################################
5814
5815fi # if WIN
5816################################################################
5817
5818if test "X$g4system" != "XWIN32-VC" -a "X$g4system" != "XWIN32-VC7"; then
5819
5820g4message=`cat << EOM
5821
5822 G4VIS_BUILD_DAWNFILE_DRIVER
5823 G4VIS_USE_DAWNFILE
5824
5825DAWN drivers are interfaces to Fukui Renderer DAWN. It is a vectorized 3D
5826PostScript processor, and so well suited to prepare technical high
5827quality outputs for presentation and/or documentation.
5828The DAWNFILE driver sends 3D data to DAWN via an intermediate file,
5829named g4.prim in the current directory. The file g4.prim is able to
5830be re-visualized later without the help of Geant4.
5831EOM`
5832
5833dflt=$g4vis_use_dawnfile
5834rp=$g4message
5835#. ./myread
5836#gans=$ans
5837gans=y
5838
5839 case $gans in
5840
5841 n*|N*)
5842 g4vis_build_dawnfile_driver=n
5843 g4vis_use_dawnfile=n
5844 ;;
5845 y*|Y*)
5846 g4vis_build_dawnfile_driver=y
5847 g4vis_use_dawnfile=y
5848 ;;
5849 esac
5850
5851g4message=`cat << EOM
5852
5853 G4VIS_BUILD_RAYTRACER_DRIVER
5854 G4VIS_USE_RAYTRACER
5855
5856It performs ray-tracing visualization using the tracking routines of Geant4.
5857It is, therefore, available for debugging tracking routines.
5858It is well suited for photo-realistic high quality output for
5859presentation, and for intuitive debugging of detector geometry.
5860EOM`
5861
5862dflt=$g4vis_use_raytracer
5863rp=$g4message
5864#. ./myread
5865#gans=$ans
5866gans=y
5867
5868 case $gans in
5869
5870 n*|N*)
5871 g4vis_build_raytracer_driver=n
5872 g4vis_use_raytracer=n
5873 ;;
5874 y*|Y*)
5875 g4vis_build_raytracer_driver=y
5876 g4vis_use_raytracer=y
5877 ;;
5878 esac
5879
5880g4message=`cat << EOM
5881
5882 G4VIS_BUILD_VRML_DRIVER
5883 G4VIS_USE_VRML
5884
5885These driver generate VRML files, which describe 3D scenes to be
5886visualized with a proper VRML viewer.
5887
5888EOM`
5889
5890dflt=$g4vis_use_vrml
5891rp=$g4message
5892. ./myread
5893gans=$ans
5894
5895 case $gans in
5896
5897 n*|N*)
5898 g4vis_build_vrml_driver=n
5899 g4vis_use_vrml=n
5900 ;;
5901 y*|Y*)
5902 g4vis_build_vrml_driver=y
5903 g4vis_use_vrml=y
5904 ;;
5905 esac
5906
5907g4message=`cat << EOM
5908
5909 G4VIS_BUILD_VRMLFILE_DRIVER
5910 G4VIS_USE_VRMLFILE
5911
5912This driver generates VRML files, which describe 3D scenes to be
5913visualized with a proper VRML viewer, at either a local or a remote host.
5914The VRMLFILE driver sends 3D data to your VRML viewer, which is running
5915in the same host machine as Geant4, via an intermediate file named
5916g4.wrl created in the current directory. This file is available for
5917re-visualization afterwards. In visualization, you should specify a
5918name of the VRML viewer by setting the environment variable G4VRML_VIEWER
5919beforehand.
5920EOM`
5921
5922dflt=$g4vis_use_vrmlfile
5923rp=$g4message
5924#. ./myread
5925#gans=$ans
5926gans=y
5927
5928 case $gans in
5929
5930 n*|N*)
5931 g4vis_build_vrmlfile_driver=n
5932 g4vis_use_vrmlfile=n
5933 ;;
5934 y*|Y*)
5935 g4vis_build_vrmlfile_driver=y
5936 g4vis_use_vrmlfile=y
5937 ;;
5938 esac
5939
5940fi # if !WIN
5941
5942g4message=`cat << EOM
5943
5944 G4VIS_BUILD_ASCIITREE_DRIVER
5945 G4VIS_USE_ASCIITREE
5946
5947Description????????????????????????
5948EOM`
5949
5950dflt=$g4vis_use_asciitree
5951rp=$g4message
5952# Don't ask by default and set to 'y'!
5953#. ./myread
5954#gans=$ans
5955gans=y
5956
5957 case $gans in
5958
5959 n*|N*)
5960 g4vis_build_asciitree_driver=n
5961 g4vis_use_asciitree=n
5962 ;;
5963 y*|Y*)
5964 g4vis_build_asciitree_driver=y
5965 g4vis_use_asciitree=y
5966 ;;
5967 esac
5968
5969
5970g4message=`cat << EOM
5971
5972 G4VIS_BUILD_GAGTREE_DRIVER
5973 G4VIS_USE_GAGTREE
5974
5975Description????????????????????????
5976EOM`
5977
5978dflt=$g4vis_use_gagtree
5979rp=$g4message
5980# Don't ask by default and set to 'y'!
5981#. ./myread
5982#gans=$ans
5983gans=y
5984
5985 case $gans in
5986
5987 n*|N*)
5988 g4vis_build_gagtree_driver=n
5989 g4vis_use_gagtree=n
5990 ;;
5991 y*|Y*)
5992 g4vis_build_gagtree_driver=y
5993 g4vis_use_gagtree=y
5994 ;;
5995 esac
5996
5997;;
5998esac
5999
6000if test "X$g4system" != "XWIN32-VC" -a "X$g4system" != "XWIN32-VC7" -a "X$g4system" != "XDarwin-g++"; then
6001
6002#echo PASS1
6003
6004if [ X$g4vis_build_openglx_driver = Xy ] || [ X$g4vis_build_openglxm_driver = Xy ] || [ X$g4vis_build_openglwin32_driver = Xy ] ; then
6005
6006#echo PASS2
6007
6008#####################################################################
6009ogl_dirs=`find $g4vis_oglhome /usr/X11R6/include /usr/local/include /usr/include -type d -name GL 2>/dev/null|xargs echo`
6010#echo ogl_dirs=$ogl_dirs
6011
6012if test "X$ogl_dirs" != "X" ; then
6013
6014g4ogl_base_dir_found=`echo $ogl_dirs|cut -d" " -f1`
6015#echo g4ogl_base_dir_found=$g4ogl_base_dir_found
6016
6017# That's right: should be twice! (e.g./usr/local/lib/libGLU.so -> /usr/local)
6018g4ogl_base_dir_found=`dirname $g4ogl_base_dir_found`
6019g4ogl_base_dir_found=`dirname $g4ogl_base_dir_found`
6020
6021 g4vis_oglhome=$g4ogl_base_dir_found
6022#else
6023#case "$g4vis_oglhome" in
6024#'')
6025# g4vis_oglhome=/usr
6026# ;;
6027#esac
6028fi
6029
6030##########################################################################
6031if test "X$g4vis_oglhome" != "X" ; then
6032ogl_dirs=$g4vis_oglhome
6033fi
6034
6035if test "X$ogl_dirs" != "X" ; then
6036
6037g4message=`cat << EOM
6038
6039 OGLHOME/include
6040 OGLHOME/lib
6041
6042You have selected to use OpenGL driver.
6043Specify the correct path (OGLHOME) where OpenGL is installed in your system.
6044It was found in $g4vis_oglhome. Press [Enter] to set this path or type the correct one.
6045
6046You can set '-' (without quotation) to CANCEL the OpenGL flag at all:
6047
6048EOM`
6049
6050dflt=$g4vis_oglhome
6051fn='d~(-)'
6052rp=$g4message
6053. ./getfile
6054
6055cend="no"
6056while test "$cend" = "no" ; do
6057if test -e "$ans/include/GL" || [ "X$ans" = "X-" ]; then
6058cend="yes"
6059
6060if test "X$ans" != "X-" ; then
6061
6062g4vis_oglhome=$ans
6063
6064else
6065
6066g4vis_build_openglx_driver=n
6067g4vis_use_openglx=n
6068
6069g4vis_build_openglxm_driver=n
6070g4vis_use_openglxm=n
6071
6072g4vis_build_openglwin32_driver=n
6073g4vis_use_openglwin32=n
6074
6075fi
6076else
6077
6078g4message=`cat << EOM
6079
6080 OGLHOME/include
6081 OGLHOME/lib
6082
6083You have selected to use OpenGL driver.
6084But it was not found in $ans.
6085Please specify the correct path where OpenGL is installed in your system.
6086
6087You can set '-' (without quotation) to CANCEL the OpenGL flag at all:
6088
6089EOM`
6090
6091dflt=""
6092fn='d~(-)'
6093rp=$g4message
6094. ./getfile
6095fi
6096done
6097
6098else
6099
6100g4message=`cat << EOM
6101
6102 OGLHOME/include
6103 OGLHOME/lib
6104
6105You have selected to use OpenGL driver.
6106But it was not found in expected place.
6107Please specify the correct path where OpenGL is installed in your system.
6108
6109You can set '-' (without quotation) to CANCEL the OpenGL flag at all:
6110
6111EOM`
6112
6113dflt=""
6114fn='d~(-)'
6115rp=$g4message
6116. ./getfile
6117
6118cend="no"
6119while test "$cend" = "no" ; do
6120if test -e "$ans/include/GL" || [ "X$ans" = "X-" ]; then
6121cend="yes"
6122
6123if test "X$ans" != "X-" ; then
6124
6125g4vis_oglhome=$ans
6126
6127else
6128
6129g4vis_build_openglx_driver=n
6130g4vis_use_openglx=n
6131
6132g4vis_build_openglxm_driver=n
6133g4vis_use_openglxm=n
6134
6135g4vis_build_openglwin32_driver=n
6136g4vis_use_openglwin32=n
6137
6138fi
6139else
6140
6141g4message=`cat << EOM
6142
6143 OGLHOME/include
6144 OGLHOME/lib
6145
6146You have selected to use OpenGL driver.
6147But it was not found in $ans.
6148Please specify the correct path where OpenGL is installed in your system.
6149
6150You can set '-' (without quotation) to CANCEL the OpenGL flag at all:
6151
6152EOM`
6153
6154dflt=""
6155fn='d~(-)'
6156rp=$g4message
6157. ./getfile
6158fi
6159done
6160
6161fi
6162
6163if test "X$g4osname" = "XLinux"; then
6164
6165if test "X$g4vis_oglhome" = "X/usr" -o "X$g4vis_oglhome" = "X/usr/local"; then
6166g4vis_oglhome=""
6167fi
6168
6169fi # if platform (Linux vs SUN)
6170
6171fi # if need
6172###########################################
6173fi # if platform (Unix vs Win)
6174
6175#
6176# BEGIN QTVIS/QT PROBE
6177#
[884]6178# Because the vis driver only works with UI, only probe if g4ui_none is
6179# NOT set AND also that g4vis_none is NOT set
[869]6180#
[884]6181if test "x$g4ui_none" = "xn" -a "x$g4vis_none" = "xn" ; then
6182 # Query the user to see if build of Qt UI module is needed
6183 g4message=`cat <<EOM
[869]6184
[884]6185 G4UI_BUILD_OPENGLQT_DRIVER
6186 G4UI_USE_OPENGLQT
[869]6187
[884]6188Setting these variables will enable the building of the G4 OpenGL Qt based
[869]6189visualisation driver and the use of this driver in your applications
6190respectively.
[884]6191The Qt3 or Qt4 headers, libraries and moc application are required to enable
6192the building of this module.
[869]6193Do you want to enable build and use of this module?
6194EOM`
[884]6195
6196 # Read in the user response
6197 dflt=$g4vis_build_openglqt_driver
6198 rp=$g4message
6199 . ./myread
6200 gans=$ans
6201
6202 # Check response and take set variables as needed.
6203 case $gans in
6204 n*|N*)
6205 g4vis_build_openglqt_driver=n
[871]6206 g4vis_use_openglqt=n
[884]6207 ;;
6208 y*|Y*)
6209 g4vis_build_openglqt_driver=y
[871]6210 g4vis_use_openglqt=y
6211 ;;
[884]6212 esac
[869]6213
[884]6214 ##########
[869]6215
[884]6216 ##########
6217 # Now, if user chose to build module, we need to check for a Qt
6218 # installation
6219 #
6220 if test "x$g4vis_build_openglqt_driver" = "xy" ; then
6221 echo " "
6222 # NB Have to supply arg to qt script, just blank in this case!
6223 qt_search_dir=""
6224 . ./qt
[869]6225
[884]6226 # If we didn't find Qt automatically, then ask user if they know
6227 # where it's installed...
6228 if test "x$g4_havegoodqt" = "xno" ; then
6229 promptend="no"
6230 user_qthome="the standard locations"
[869]6231
[884]6232 while test "x$promptend" = "xno" ; do
6233 g4message=`cat << EOM
[869]6234
[884]6235Autodetection failed to locate Qt3 or Qt4 in $qthomeloc on your system.
6236Please enter the path to your Qt3 OR Qt4 install (i.e. if Qt4 is installed
6237in PATH/include/QT, PATH/include or PATH/include/qt4, enter PATH),
6238or type '-' to CANCEL the build of the Qt UI module.
[869]6239Qt path:
6240EOM`
[884]6241 dflt=""
[871]6242 fn='d~(-)'
[884]6243 rp=$g4message
6244 . ./getfile
6245 user_qthome=$ans
[869]6246
[884]6247 if test "x$user_qthome" = "x-" ; then
6248 # Cancel build...
6249 g4vis_build_openglqt_driver=n
6250 g4vis_use_openglqt=n
6251 echo "configure: build/use of Qt OpenGl driver cancelled"
6252 promptend=yes
6253 else
6254 # Check for installation in user directory
6255 echo " "
6256 qt_search_dir=$user_qthome
6257 . ./qt
[869]6258
[884]6259 if test "x$g4_havegoodqt" = "xyes" ; then
6260 promptend=yes
6261 fi
6262 fi #END TEST user_qthome = -
6263 done #END while promptend=no (for user input of Qt install)
6264 fi #END TEST g4_havegoodqt = no (for user prompt)
6265 fi #END TEST g4vis_build_openglqt_driver (whether to build at all)
6266fi #END TEST g4ui_none = n AND g4vis_none=n
[869]6267
6268#
[884]6269# BEGIN GDML/XERCESC PROBE
[869]6270#
6271
6272# Set default build option to no
6273echo " "
6274case "$g4lib_build_gdml" in
6275'')
6276 g4lib_build_gdml=n
6277 ;;
6278esac
6279
6280
6281# Now query the user to see if they want to build the GDML plugin
6282echo ""
6283
6284g4message=`cat << EOM
6285
6286 G4LIB_BUILD_GDML
6287
6288Setting this variable will enable building of the GDML plugin module embedded
6289in Geant4 for detector description persistency.
6290It requires your system to have the XercesC library and headers installed.
6291Do you want to set this variable?
6292
6293EOM`
6294
6295#
6296# read in the users response
6297#
6298dflt=$g4lib_build_gdml
6299rp=$g4message
6300. ./myread
6301gans=$ans
6302
6303#
6304# Check response
6305#
6306case $gans in
6307 n*|N*)
6308 g4lib_build_gdml=n
6309 ;;
6310 y*|Y*)
6311 g4lib_build_gdml=y
6312 ;;
6313esac
6314
6315
6316#
6317# If user does want to build GDML plugin, now try to locate Xerces install
6318#
6319if test "X$g4lib_build_gdml" != "Xn"; then
6320
6321 if test "X$g4gdml_xercesc_root" = "X"; then
6322 #probe for Xerces, using example from UI and Vis
6323 xercesc_root=`find $g4gdml_xercesc_root /usr/include /usr/local/include \
6324/opt/local/include /sw/include -type d -name xercesc 2>/dev/null | xargs echo`
6325
6326 #If we got something, strip off the include/xerces part
6327 if test "X$xercesc_root" != "X"; then
6328 g4gdml_xercesc_root=`dirname $xercesc_root`
6329 g4gdml_xercesc_root=`dirname $g4gdml_xercesc_root`
6330
6331 echo " "
6332 echo "checking for XercesC install... $g4gdml_xercesc_root"
6333 else
6334 g4gdml_xercesc_root=""
6335 echo " "
6336 echo "checking for XercesC install... no"
6337 fi
6338 fi #END OF XERCES AUTOPROBE
6339
6340 #
6341 # If the autoprobe failed, prompt the user to enter the path to the Xerces
6342 # install
6343 #
6344 if test "X$g4gdml_xercesc_root" = "X"; then
6345
6346 promptend="no"
6347 xercesloc="the standard locations"
6348
6349 while test "$promptend" = "no"; do
6350 g4message=`cat << EOM
6351
6352Autodetection failed to locate XercesC in $xercesloc on your system.
6353Please enter the path to your XercesC install (i.e. if XercesC is installed
6354in PATH/include/xercesc, enter PATH), or type '-' to CANCEL the build of the
6355GDML module.
6356XercesC path:
6357EOM`
6358
6359 dflt=$g4gdml_xercesc_root
6360 fn='d~(-)'
6361 rp=$g4message
6362 . ./getfile
6363
6364 #check for user cancellation
6365 if test "X$ans" = "X-"; then
6366 g4lib_build_gdml=n
6367 g4gdml_xercesc_root=""
6368 echo "G4LIB_BUILD_GDML cancelled..."
6369 promptend=yes
6370 else
6371 if test -r "$ans/include/xercesc"; then
6372 g4gdml_xercesc_root=$ans
6373 echo "checking for XercesC install... $g4gdml_xercesc_root"
6374 promptend=yes
6375 else
6376 xercesloc=$ans
6377 echo "checking for Xercesc install... no"
6378 fi
6379 fi #END OF USER INPUT CHECKING
6380 done #END OF WHILE LOOP OVER USER INPUT
6381 fi #END OF USER INPUT SECTION
6382
6383 #
6384 # If a filter on g4gdml_xerces_root is needed to remove common system paths
6385 # then it should be put here...
6386 #
6387 if test "x$g4gdml_xercesc_root" = "x/usr" -o "x$g4gdml_xercesc_root" = "x/usr/local" ; then
6388 g4gdml_xercesc_root=""
6389 fi
6390
6391fi #END XERCES PROBE
6392
6393#END OF GDML/XERCES PROBE
6394
6395echo " "
6396
6397case "$g4make" in
6398'')
6399 g4make=gmake
6400 ;;
6401esac
6402
6403echo ""
6404
6405 g4_gmake_version=`(gmake -v) 2>/dev/null`
6406 case $g4_gmake_version in
6407 GNU*)
6408 g4_gmake=y
6409 ;;
6410 *)
6411 g4_gmake=n
6412 ;;
6413 esac
6414
6415 g4_make_version=`(make -v) 2>/dev/null`
6416 case $g4_make_version in
6417 GNU*)
6418 g4_make=y
6419 ;;
6420 *)
6421 g4_make=n
6422 ;;
6423 esac
6424
6425if [ $g4_gmake = y ] ; then
6426
6427g4make=gmake
6428
6429g4message=`cat << EOM
6430
6431 G4MAKE
6432
6433You have GNU make which could be used to build GEANT4.
6434You can select your own 'make' program if you want.
6435EOM`
6436
6437fi
6438
6439if [ $g4_gmake = n ] && [ $g4_make = y ] ; then
6440
6441g4make=make
6442
6443g4message=`cat << EOM
6444
6445 G4MAKE
6446
6447You have GNU make which could be used to build GEANT4.
6448You can select your own 'make' program if you want.
6449EOM`
6450
6451fi
6452
6453if [ $g4_gmake = n ] && [ $g4_make = n ] ; then
6454
6455g4make=none
6456
6457g4message=`cat << EOM
6458
6459 G4MAKE
6460
6461You have NO GNU make which could be used to build GEANT4.
6462Please select your own 'make' program compatible with GNU make.
6463EOM`
6464
6465dflt=$g4make
6466rp=$g4message
6467
6468
6469. ./myread
6470gans=$ans
6471
6472 case $gans in
6473
6474 '')
6475 g4make=$dflt
6476 ;;
6477 *)
6478 g4make=$gans
6479 ;;
6480 esac
6481
6482fi
6483
6484
6485
6486
6487echo " "
6488case "$g4wlib_build_g3tog4" in
6489'')
6490 g4wlib_build_g3tog4=n
6491 ;;
6492esac
6493
6494case "$g4w_use_g3tog4" in
6495'')
6496 g4w_use_g3tog4=n
6497 ;;
6498esac
6499
6500echo ""
6501
6502g4message=`cat << EOM
6503
6504 G4LIB_BUILD_G3TOG4
6505
6506The utility module 'g3tog4' will be built by setting this
6507variable. NOTE: it requires a valid FORTRAN compiler to be
6508installed on your system and the 'cernlib' command in the
6509path, in order to build the ancillary tools!
6510Do you want to build 'g3tog4' ?
6511
6512EOM`
6513
6514dflt=$g4wlib_build_g3tog4
6515rp=$g4message
6516. ./myread
6517gans=$ans
6518
6519 case $gans in
6520
6521 n*|N*)
6522 g4wlib_build_g3tog4=n
6523 g4w_use_g3tog4=n
6524 ;;
6525 y*|Y*)
6526 g4wlib_build_g3tog4=y
6527 g4w_use_g3tog4=y
6528 ;;
6529 esac
6530
6531
6532echo " "
6533case "$g4wlib_build_zlib" in
6534'')
6535 g4wlib_build_zlib=n
6536 ;;
6537esac
6538
6539case "$g4w_use_zlib" in
6540'')
6541 g4w_use_zlib=n
6542 ;;
6543esac
6544
6545echo ""
6546
6547g4message=`cat << EOM
6548
6549 G4LIB_BUILD_ZLIB
6550
6551Do you want to activate compression for output files
6552generated by the HepRep visualization driver?
6553
6554EOM`
6555
6556dflt=$g4wlib_build_zlib
6557rp=$g4message
6558. ./myread
6559gans=$ans
6560
6561 case $gans in
6562
6563 n*|N*)
6564 g4wlib_build_zlib=n
6565 g4w_use_zlib=n
6566 ;;
6567 y*|Y*)
6568 g4wlib_build_zlib=y
6569 g4w_use_zlib=y
6570 ;;
6571 esac
6572
6573
6574echo " "
6575
6576case "$g4wanalysis_use" in
6577'')
6578 g4wanalysis_use=n
6579 ;;
6580esac
6581
6582echo ""
6583
6584g4message=`cat << EOM
6585
6586 G4ANALYSIS_USE
6587
6588Activates the configuration setup for allowing plugins to
6589analysis tools based on AIDA (Astract Interfaces for Data
6590Analysis). In order to use AIDA features and compliant analysis
6591tools, the proper environment for these tools will have to be
6592set (see documentation for the specific analysis tools).
6593EOM`
6594
6595dflt=$g4wanalysis_use
6596rp=$g4message
6597. ./myread
6598gans=$ans
6599
6600 case $gans in
6601
6602 n*|N*)
6603 g4wanalysis_use=n
6604 ;;
6605 y*|Y*)
6606 g4wanalysis_use=y
6607 ;;
6608 esac
6609
6610
6611: end of configuration questions
6612echo " "
6613echo "End of configuration phase."
6614echo " "
6615
6616: back to where it started
6617if test -d ../../.config/UU; then
6618 cd ../..
6619fi
6620
6621: configuration may be patched via a 'config.over' file
6622if $test -f config.over; then
6623 echo " "
6624 dflt=y
6625 rp='A config.over file exists. Do you wish to load it?'
6626 . .config/UU/myread
6627 case "$ans" in
6628 n*) echo "OK, I'll ignore it.";;
6629 *) . ./config.over
6630 echo "Configuration settings have been loaded."
6631 ;;
6632 esac
6633fi
6634
6635: in case they want portability, strip down executable paths
6636case "$d_portable" in
6637"$define")
6638 echo " "
6639 echo "Stripping down executable paths..." >&4
6640 for file in $loclist $trylist; do
6641 eval $file="\$file"
6642 done
6643 ;;
6644esac
6645
6646: create config.sh file
6647echo " "
6648echo "Creating configuration setup file..." >&4
6649mkdir -p $g4conf
6650$spitshell <<EOT > $g4conf/config.sh
6651$startsh
6652#
6653# This file was produced by running the Configure script. It holds all the
6654# definitions figured out by Configure. Should you modify one of these values,
6655# do not forget to propagate your changes by running "Configure -der". You may
6656# instead choose to run each of the .SH files by yourself, or "Configure -S".
6657#
6658
6659# Package name : $package
6660# Source directory : $src
6661# Configuration time: $cf_time
6662# Configured by : $cf_by
6663# Target system : $myuname
6664
6665Author='$Author'
6666Date='$Date'
6667Header='$Header'
6668Id='$Id'
6669Locker='$Locker'
6670Log='$Log'
6671RCSfile='$RCSfile'
6672Revision='$Revision'
6673Source='$Source'
6674State='$State'
6675c='$c'
6676cf_by='$cf_by'
6677cf_time='$cf_time'
6678contains='$contains'
6679d_portable='$d_portable'
6680eunicefix='$eunicefix'
6681g4_gmake='$g4_gmake'
6682g4_gmake_version='$g4_gmake_version'
6683g4_make='$g4_make'
6684g4_make_version='$g4_make_version'
[884]6685g4_qt_cxxflags='$g4_qt_cxxflags'
6686g4_qt_gl_cxxflags='$g4_qt_gl_cxxflags'
6687g4_qt_gl_libs='$g4_qt_gl_libs'
6688g4_qt_libs='$g4_qt_libs'
6689g4_qt_moc='$g4_qt_moc'
6690g4_qt_version='$g4_qt_version'
[869]6691g4abladata='$g4abladata'
6692g4base='$g4base'
6693g4bin='$g4bin'
6694g4clhep_base_dir='$g4clhep_base_dir'
6695g4clhep_include_dir='$g4clhep_include_dir'
6696g4clhep_lib='$g4clhep_lib'
6697g4clhep_lib_dir='$g4clhep_lib_dir'
6698g4compiler='$g4compiler'
6699g4conf='$g4conf'
6700g4data='$g4data'
6701g4debug='$g4debug'
6702g4elasticdata='$g4elasticdata'
6703g4final_install='$g4final_install'
6704g4gdml_xercesc_root='$g4gdml_xercesc_root'
6705g4global='$g4global'
6706g4granular='$g4granular'
6707g4include='$g4include'
6708g4includes_flag='$g4includes_flag'
6709g4install='$g4install'
6710g4ledata='$g4ledata'
6711g4levelgammadata='$g4levelgammadata'
6712g4lib='$g4lib'
6713g4lib_build_gdml='$g4lib_build_gdml'
6714g4lib_build_shared='$g4lib_build_shared'
6715g4lib_build_static='$g4lib_build_static'
6716g4lib_use_dll='$g4lib_use_dll'
6717g4lib_use_dyn='$g4lib_use_dyn'
6718g4lib_use_granular='$g4lib_use_granular'
6719g4lib_use_shared='$g4lib_use_shared'
6720g4lib_use_static='$g4lib_use_static'
6721g4make='$g4make'
6722g4neutronhpcrosssections='$g4neutronhpcrosssections'
6723g4osname='$g4osname'
6724g4radioactivedata='$g4radioactivedata'
6725g4system='$g4system'
6726g4tmp='$g4tmp'
6727g4ui_build_gag_session='$g4ui_build_gag_session'
6728g4ui_build_qt_session='$g4ui_build_qt_session'
6729g4ui_build_terminal_session='$g4ui_build_terminal_session'
6730g4ui_build_win32_session='$g4ui_build_win32_session'
6731g4ui_build_xaw_session='$g4ui_build_xaw_session'
6732g4ui_build_xm_session='$g4ui_build_xm_session'
6733g4ui_none='$g4ui_none'
6734g4ui_use_gag='$g4ui_use_gag'
6735g4ui_use_qt='$g4ui_use_qt'
6736g4ui_use_tcsh='$g4ui_use_tcsh'
6737g4ui_use_terminal='$g4ui_use_terminal'
6738g4ui_use_win32='$g4ui_use_win32'
6739g4ui_use_xaw='$g4ui_use_xaw'
6740g4ui_use_xm='$g4ui_use_xm'
6741g4ui_xawflags='$g4ui_xawflags'
6742g4ui_xawhome='$g4ui_xawhome'
6743g4ui_xawlibs='$g4ui_xawlibs'
6744g4vis_build_asciitree_driver='$g4vis_build_asciitree_driver'
6745g4vis_build_dawn_driver='$g4vis_build_dawn_driver'
6746g4vis_build_dawnfile_driver='$g4vis_build_dawnfile_driver'
6747g4vis_build_oiwin32_driver='$g4vis_build_oiwin32_driver'
6748g4vis_build_oix_driver='$g4vis_build_oix_driver'
6749g4vis_build_openglqt_driver='$g4vis_build_openglqt_driver'
6750g4vis_build_openglwin32_driver='$g4vis_build_openglwin32_driver'
6751g4vis_build_openglx_driver='$g4vis_build_openglx_driver'
6752g4vis_build_openglxm_driver='$g4vis_build_openglxm_driver'
6753g4vis_build_raytracer_driver='$g4vis_build_raytracer_driver'
6754g4vis_build_raytracerx_driver='$g4vis_build_raytracerx_driver'
6755g4vis_build_vrml_driver='$g4vis_build_vrml_driver'
6756g4vis_build_vrmlfile_driver='$g4vis_build_vrmlfile_driver'
6757g4vis_oglhome='$g4vis_oglhome'
6758g4vis_oivhome='$g4vis_oivhome'
6759g4vis_use_asciitree='$g4vis_use_asciitree'
6760g4vis_use_dawn='$g4vis_use_dawn'
6761g4vis_use_dawnfile='$g4vis_use_dawnfile'
6762g4vis_use_oiwin32='$g4vis_use_oiwin32'
6763g4vis_use_oix='$g4vis_use_oix'
6764g4vis_use_openglqt='$g4vis_use_openglqt'
6765g4vis_use_openglwin32='$g4vis_use_openglwin32'
6766g4vis_use_openglx='$g4vis_use_openglx'
6767g4vis_use_openglxm='$g4vis_use_openglxm'
6768g4vis_use_raytracer='$g4vis_use_raytracer'
6769g4vis_use_raytracerx='$g4vis_use_raytracerx'
6770g4vis_use_vrml='$g4vis_use_vrml'
6771g4vis_use_vrmlfile='$g4vis_use_vrmlfile'
6772g4vis_xmflags='$g4vis_xmflags'
6773g4vis_xmflags='$g4vis_xmflags'
6774g4vis_xmhome='$g4vis_xmhome'
6775g4vis_xmhome='$g4vis_xmhome'
6776g4vis_xmlibs='$g4vis_xmlibs'
6777g4vis_xmlibs='$g4vis_xmlibs'
6778g4w_use_g3tog4='$g4w_use_g3tog4'
6779g4w_use_zlib='$g4w_use_zlib'
6780g4wanalysis_build='$g4wanalysis_build'
6781g4wanalysis_build_jas='$g4wanalysis_build_jas'
6782g4wanalysis_build_lab='$g4wanalysis_build_lab'
6783g4wanalysis_build_lizard='$g4wanalysis_build_lizard'
6784g4wanalysis_use='$g4wanalysis_use'
6785g4wanalysis_use_jas='$g4wanalysis_use_jas'
6786g4wanalysis_use_lab='$g4wanalysis_use_lab'
6787g4wanalysis_use_lizard='$g4wanalysis_use_lizard'
6788g4wlib_build_g3tog4='$g4wlib_build_g3tog4'
6789g4wlib_build_zlib='$g4wlib_build_zlib'
6790g4workdir='$g4workdir'
6791hint='$hint'
6792lns='$lns'
6793myuname='$myuname'
6794n='$n'
6795osname='$osname'
6796osvers='$osvers'
6797package='$package'
6798sh='$sh'
6799sharpbang='$sharpbang'
6800shsharp='$shsharp'
6801spackage='$spackage'
6802spitshell='$spitshell'
6803src='$src'
6804startsh='$startsh'
6805EOT
6806
6807: add special variables
6808mkdir -p $g4conf
6809$test -f $src/patchlevel.h && \
6810awk '/^#define/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >> $g4conf/config.sh
6811echo "CONFIG=true" >> $g4conf/config.sh
6812
6813: propagate old symbols
6814if $test -f .config/UU/config.sh; then
6815 <.config/UU/config.sh sort | uniq >.config/UU/oldconfig.sh
6816 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' $g4conf/config.sh $g4conf/config.sh .config/UU/oldconfig.sh |\
6817 sort | uniq -u >.config/UU/oldsyms
6818 set X `cat .config/UU/oldsyms`
6819 shift
6820 case $# in
6821 0) ;;
6822 *)
6823 cat <<EOM
6824
6825Hmm...You had some extra variables I don't know about...
6826 I'll try to keep 'em...
6827
6828EOM
6829 echo "# Variables propagated from previous config.sh file." >>.config/bin/$g4system/config.sh
6830 for sym in `cat .config/UU/oldsyms`; do
6831 echo " Propagating $hint variable "'$'"$sym..."
6832 eval 'tmp="$'"${sym}"'"'
6833 echo "$tmp" | \
6834 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>.config/bin/$g4system/config.sh
6835 done
6836 ;;
6837 esac
6838fi
6839
6840: preserve RCS keywords in files with variable substitution, grrr
6841Id='$Id'
6842
6843: Finish up by extracting the .SH files
6844case "$alldone" in
6845exit)
6846 $rm -rf .config/UU
6847 echo "Done."
6848 exit 0
6849 ;;
6850cont)
6851 ;;
6852'')
6853 dflt=''
6854 nostick=true
6855 $cat <<EOM
6856
6857WARNING: the generated configuration file
6858can be edited if necessary!
6859You can introduce any change to the configuration file
6860$g4conf/config.sh before the final installation.
6861To do so, use a shell escape now (e.g. !vi $g4conf/config.sh).
6862
6863EOM
6864 rp="Press [Enter] to start installation or use a shell escape to edit config.sh:"
6865 . .config/UU/myread
6866 nostick=''
6867 case "$ans" in
6868 '') ;;
6869 *) : in case they cannot read
6870 sh 1>&4 -c "$ans";;
6871 esac
6872 ;;
6873esac
6874
6875: if this fails, just run all the .SH files by hand
6876. $g4conf/config.sh
6877
6878echo " "
6879exec 1>&4
6880. ./.config/UU/extract
6881
6882if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
6883 dflt=y
6884 case "$silent" in
6885 true) ;;
6886 *)
6887 $cat <<EOM
6888
6889Now you need to generate make dependencies by running "make depend".
6890You might prefer to run it in background: "make depend > makedepend.out &"
6891It can take a while, so you might not want to run it right now.
6892
6893EOM
6894 ;;
6895 esac
6896 rp="Run make depend now?"
6897 . .config/UU/myread
6898 case "$ans" in
6899 y*)
6900 make depend && echo "Now you must run a make."
6901 ;;
6902 *)
6903 echo "You must run 'make depend' then 'make'."
6904 ;;
6905 esac
6906elif test -f [Mm]akefile; then
6907 echo " "
6908 echo "Now you must run a make."
6909elif [ -f $g4conf/install.sh -a X$g4build = Xyes ] ; then
6910 echo " "
6911 echo "Now starting Geant4 libraries build..."
6912 echo " "
6913 . $g4conf/install.sh
6914elif [ -f $g4conf/install.sh -a X$install = Xyes ] ; then
6915 echo " "
6916 echo "Now starting Geant4 libraries installation..."
6917 echo " "
6918 . $g4conf/move.sh
6919else
6920 echo " "
6921 echo "WARNING: Geant4 is NOT installed yet!"
6922 echo "You (or the administrator if you have not enough privileges)"
6923 echo "should start with \$G4INSTALL/Configure -install"
6924 echo "(where \$G4INSTALL is Geant4 install directory)."
6925 echo " "
6926fi
6927
6928$rm -f kit*isdone ark*isdone
6929$rm -rf .config/UU
6930
6931: End of Configure
6932
Note: See TracBrowser for help on using the repository browser.