source: trunk/geant4/config/scripts/install.sh.SH @ 647

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

r647@mac-90108: laurentgarnier | 2007-11-15 11:32:46 +0100
Ok en Qt 4.3.0

  • Property svn:executable set to *
File size: 14.0 KB
Line 
1case $CONFIG in
2'')
3        if test -f config.sh; then TOP=.;
4        elif test -f ../config.sh; then TOP=..;
5        elif test -f ../../config.sh; then TOP=../..;
6        elif test -f ../../../config.sh; then TOP=../../..;
7        elif test -f ../../../../config.sh; then TOP=../../../..;
8        else
9                echo "Can't find config.sh."; exit 1
10        fi
11        . $TOP/config.sh
12        ;;
13esac
14: This forces SH files to create target in same directory as SH file.
15: This is so that make depend always knows where to find SH derivatives.
16case "$0" in
17*/*) cd `expr X$0 : 'X\(.*\)/'` ;;
18esac
19#echo "Extracting install.sh (with variable substitutions)"
20: This section of the file will have variable substitutions done on it.
21: Move anything that needs config subs from !NO!SUBS! section to !GROK!THIS!.
22: Protect any dollar signs and backticks that you do not want interpreted
23: by putting a backslash in front.  You may delete these comments.
24$spitshell >install.sh <<!GROK!THIS!
25######################################
26#
27# Clean all G4 envs
28unset  CLHEP_BASE_DIR
29unset  CLHEP_INCLUDE_DIR
30unset  CLHEP_LIB
31unset  CLHEP_LIB_DIR
32
33unset  G4ANALYSIS_USE
34unset  G4DEBUG
35unset  G4INCLUDE
36unset  G4INSTALL
37
38unset  G4LEDATA
39unset  G4LEVELGAMMADATA
40unset  G4NEUTRONHPDATA
41unset  G4RADIOACTIVEDATA
42unset  G4ABLADATA
43
44unset  G4LIB
45unset  G4LIB_BUILD_G3TOG4
46unset  G4LIB_BUILD_SHARED
47unset  G4LIB_BUILD_STATIC
48unset  G4LIB_BUILD_ZLIB
49unset  G4LIB_BUILD_GDML
50unset  G4LIB_USE_G3TOG4
51unset  G4LIB_USE_GRANULAR
52unset  G4LIB_USE_ZLIB
53
54unset  G4SYSTEM
55
56unset  G4UI_BUILD_WIN32_SESSION
57unset  G4UI_BUILD_XAW_SESSION
58unset  G4UI_BUILD_XM_SESSION
59unset  G4UI_USE_TCSH
60unset  G4UI_USE_WIN32
61unset  G4UI_USE_XAW
62unset  G4UI_USE_XM
63
64unset  G4VIS_BUILD_DAWN_DRIVER
65unset  G4VIS_BUILD_OIWIN32_DRIVER
66unset  G4VIS_BUILD_OIX_DRIVER
67unset  G4VIS_BUILD_OPENGLWIN32_DRIVER
68unset  G4VIS_BUILD_OPENGLXM_DRIVER
69unset  G4VIS_BUILD_OPENGLX_DRIVER
70unset  G4VIS_BUILD_RAYTRACERX_DRIVER
71unset  G4VIS_BUILD_VRML_DRIVER
72
73unset  G4VIS_USE_DAWN
74unset  G4VIS_USE_OIWIN32
75unset  G4VIS_USE_OIX
76unset  G4VIS_USE_OPENGLWIN32
77unset  G4VIS_USE_OPENGLX
78unset  G4VIS_USE_OPENGLXM
79unset  G4VIS_USE_RAYTRACERX
80unset  G4VIS_USE_VRML
81
82######################################
83#
84# g4system.U
85#
86#+
87G4SYSTEM="$g4system"
88export G4SYSTEM
89echo "On this machine the G4SYSTEM=\$G4SYSTEM"
90
91#
92# g4dirs.U
93#
94#+
95G4INSTALL="$g4install"
96export G4INSTALL
97echo "On this machine the G4INSTALL=\$G4INSTALL"
98
99#+
100if [ X$g4include != X -a X$g4include != Xn ] ; then
101G4INCLUDE="$g4include"
102export G4INCLUDE
103echo "On this machine the G4INCLUDE=\$G4INCLUDE"
104fi
105
106#+
107if [ X$g4tmp != X ] ; then
108G4TMP="$g4tmp"
109export G4TMP
110echo "On this machine the G4TMP=\$G4TMP"
111fi
112
113#+
114if [ X$g4lib != X ] ; then 
115G4LIB="$g4lib"
116export G4LIB
117echo "On this machine the G4LIB=\$G4LIB"
118fi
119
120#+
121if [ X$g4lib != X ] ; then 
122G4BIN="$g4lib/../bin"
123export G4BIN
124fi
125
126#+
127if [ X$g4levelgammadata != X ] ; then 
128G4LEVELGAMMADATA="$g4levelgammadata"
129export G4LEVELGAMMADATA
130echo "On this machine the G4LEVELGAMMADATA=\$G4LEVELGAMMADATA"
131fi
132
133#+
134if [ X$g4radioactivedata != X ] ; then 
135G4RADIOACTIVEDATA="$g4radioactivedata"
136export G4RADIOACTIVEDATA
137echo "On this machine the G4RADIOACTIVEDATA=\$G4RADIOACTIVEDATA"
138fi
139
140#+
141if [ X$g4ledata != X ] ; then 
142G4LEDATA="$g4ledata"
143export G4LEDATA
144echo "On this machine the G4LEDATA=\$G4LEDATA"
145fi
146
147#+
148if [ X$g4neutronhpcrosssections != X ] ; then 
149G4NEUTRONHPDATA="$g4neutronhpcrosssections"
150export G4NEUTRONHPDATA
151echo "On this machine the G4NEUTRONHPDATA=\$G4NEUTRONHPDATA"
152fi
153
154#+
155if [ X$g4abladata != X ] ; then 
156G4ABLADATA="$g4abladata"
157export G4ABLADATA
158echo "On this machine the G4ABLADATA=\$G4ABLADATA"
159fi
160
161
162
163
164#+
165#if [ X$g4elasticdata != X ] ; then
166#G4ELASTICDATA="$g4elasticdata"
167#export G4ELASTICDATA
168#echo "On this machine the G4ELASTICDATA=\$g4elasticdata"
169#fi
170
171#
172# g4clhep.U
173#
174if [ X$g4clhep_base_dir != X ] ; then 
175CLHEP_BASE_DIR="$g4clhep_base_dir"
176export CLHEP_BASE_DIR
177echo "On this machine the CLHEP_BASE_DIR=\$CLHEP_BASE_DIR"
178fi
179
180#if [ X$g4clhep_base_dir != X/usr -o X$g4clhep_base_dir != X/usr/local ] ; then
181#CLHEP_BASE_DIR="$g4clhep_base_dir"
182#export CLHEP_BASE_DIR
183#echo "On this machine the CLHEP_BASE_DIR=\$CLHEP_BASE_DIR"
184#fi
185
186#+
187if [ X$g4clhep_include_dir != X ] ; then 
188CLHEP_INCLUDE_DIR="$g4clhep_include_dir"
189export CLHEP_INCLUDE_DIR
190echo "On this machine the CLHEP_INCLUDE_DIR=\$CLHEP_INCLUDE_DIR"
191fi
192
193#+
194if [ X$g4clhep_lib_dir != X ] ; then 
195CLHEP_LIB_DIR="$g4clhep_lib_dir"
196export CLHEP_LIB_DIR
197echo "On this machine the CLHEP_LIB_DIR=\$CLHEP_LIB_DIR"
198fi
199
200#+
201if [ X$g4clhep_lib != X ] ; then 
202CLHEP_LIB="$g4clhep_lib"
203export CLHEP_LIB
204echo "On this machine the CLHEP_LIB=\$CLHEP_LIB"
205fi
206
207#+
208#
209# g4debug
210#
211if [ X$g4debug = Xy ] ; then 
212G4DEBUG=1
213export G4DEBUG
214echo "On this machine the G4DEBUG=\$G4DEBUG"
215fi
216
217#
218# g4analysis
219#
220#+
221if [ X$g4wanalysis_use = Xy ] ; then
222G4ANALYSIS_USE=1
223export G4ANALYSIS_USE
224echo "On this machine the G4ANALYSIS_USE=\$G4ANALYSIS_USE"
225fi 
226
227#
228# g4ui
229#
230#+
231if [ X$g4ui_build_xaw_session = Xy ] ; then
232G4UI_BUILD_XAW_SESSION=1
233export G4UI_BUILD_XAW_SESSION
234echo "On this machine the G4UI_BUILD_XAW_SESSION=\$G4UI_BUILD_XAW_SESSION"
235fi 
236
237#+
238if [ X$g4ui_use_xaw = Xy ] ; then
239G4UI_USE_XAW=1
240export G4UI_USE_XAW
241echo "On this machine the G4UI_USE_XAW=\$G4UI_USE_XAW"
242fi 
243
244#+
245if [ X$g4ui_build_xm_session = Xy ] ; then
246G4UI_BUILD_XM_SESSION=1
247export G4UI_BUILD_XM_SESSION
248echo "On this machine the G4UI_BUILD_XM_SESSION=\$G4UI_BUILD_XM_SESSION"
249fi 
250
251#+
252if [ X$g4ui_use_xm = Xy ] ; then
253G4UI_USE_XM=1
254export G4UI_USE_XM
255echo "On this machine the G4UI_USE_XM=\$G4UI_USE_XM"
256fi 
257
258#+
259if [ X$g4ui_build_win32_session = Xy ] ; then
260G4UI_BUILD_WIN32_SESSION=1
261export G4UI_BUILD_WIN32_SESSION
262echo "On this machine the G4UI_BUILD_WIN32_SESSION=\$G4UI_BUILD_WIN32_SESSION"
263fi 
264
265#+
266if [ X$g4ui_use_win32 = Xy ] ; then
267G4UI_USE_WIN32=1
268export G4UI_USE_WIN32
269echo "On this machine the G4UI_USE_WIN32=\$G4UI_USE_WIN32"
270fi 
271
272#
273# g4vis
274#
275#+
276if [ X$g4vis_build_dawn_driver = Xy ] ; then
277G4VIS_BUILD_DAWN_DRIVER=1
278export G4VIS_BUILD_DAWN_DRIVER
279echo "On this machine the G4VIS_BUILD_DAWN_DRIVER=\$G4VIS_BUILD_DAWN_DRIVER"
280fi 
281
282#+
283if [ X$g4vis_build_openglx_driver = Xy ] ; then
284G4VIS_BUILD_OPENGLX_DRIVER=1
285export G4VIS_BUILD_OPENGLX_DRIVER
286echo "On this machine the G4VIS_BUILD_OPENGLX_DRIVER=\$G4VIS_BUILD_OPENGLX_DRIVER"
287fi 
288
289#+
290if [ X$g4vis_build_openglxm_driver = Xy ] ; then
291G4VIS_BUILD_OPENGLXM_DRIVER=1
292export G4VIS_BUILD_OPENGLXM_DRIVER
293echo "On this machine the G4VIS_BUILD_OPENGLXM_DRIVER=\$G4VIS_BUILD_OPENGLXM_DRIVER"
294fi 
295
296#+
297if [ X$g4vis_build_openglwin32_driver = Xy ] ; then
298G4VIS_BUILD_OPENGLWIN32_DRIVER=1
299export G4VIS_BUILD_OPENGLWIN32_DRIVER
300echo "On this machine the G4VIS_BUILD_OPENGLWIN32_DRIVER=\$G4VIS_BUILD_OPENGLWIN32_DRIVER"
301fi 
302
303#+
304if [ X$g4vis_build_oix_driver = Xy ] ; then
305G4VIS_BUILD_OIX_DRIVER=1
306export G4VIS_BUILD_OIX_DRIVER
307echo "On this machine the G4VIS_BUILD_OIX_DRIVER=\$G4VIS_BUILD_OIX_DRIVER"
308fi 
309
310#+
311if [ X$g4vis_build_raytracerx_driver = Xy ] ; then
312G4VIS_BUILD_RAYTRACERX_DRIVER=1
313export G4VIS_BUILD_RAYTRACERX_DRIVER
314echo "On this machine the G4VIS_BUILD_RAYTRACERX_DRIVER=\$G4VIS_BUILD_RAYTRACERX_DRIVER"
315fi 
316
317#+
318if [ X$g4vis_build_oiwin32_driver = Xy ] ; then
319G4VIS_BUILD_OIWIN32_DRIVER=1
320export G4VIS_BUILD_OIWIN32_DRIVER
321echo "On this machine the G4VIS_BUILD_OIWIN32_DRIVER=\$G4VIS_BUILD_OIWIN32_DRIVER"
322fi 
323
324#+
325if [ X$g4vis_build_vrml_driver = Xy ] ; then
326G4VIS_BUILD_VRML_DRIVER=1
327export G4VIS_BUILD_VRML_DRIVER
328echo "On this machine the G4VIS_BUILD_VRML_DRIVER=\$G4VIS_BUILD_VRML_DRIVER"
329fi 
330
331#+
332if [ X$g4vis_use_dawn = Xy ] ; then
333G4VIS_USE_DAWN=1
334export G4VIS_USE_DAWN
335echo "On this machine the G4VIS_USE_DAWN=\$G4VIS_USE_DAWN"
336fi 
337
338#+
339if [ X$g4vis_use_openglx = Xy ] ; then
340G4VIS_USE_OPENGLX=1
341export G4VIS_USE_OPENGLX
342echo "On this machine the G4VIS_USE_OPENGLX=\$G4VIS_USE_OPENGLX"
343fi 
344
345#+
346if [ X$g4vis_use_openglxm = Xy ] ; then
347G4VIS_USE_OPENGLXM=1
348export G4VIS_USE_OPENGLXM
349echo "On this machine the G4VIS_USE_OPENGLXM=\$G4VIS_USE_OPENGLXM"
350fi 
351
352#+
353if [ X$g4vis_use_openglwin32 = Xy ] ; then
354G4VIS_USE_OPENGLWIN32=1
355export G4VIS_USE_OPENGLWIN32
356echo "On this machine the G4VIS_USE_OPENGLWIN32=\$G4VIS_USE_OPENGLWIN32"
357fi 
358
359#+
360if [ X$g4vis_use_oix = Xy ] ; then
361G4VIS_USE_OIX=1
362export G4VIS_USE_OIX
363echo "On this machine the G4VIS_USE_OIX=\$G4VIS_USE_OIX"
364fi 
365
366#+
367if [ X$g4vis_use_raytracerx = Xy ] ; then
368G4VIS_USE_RAYTRACERX=1
369export G4VIS_USE_RAYTRACERX
370echo "On this machine the G4VIS_USE_RAYTRACERX=\$G4VIS_USE_RAYTRACERX"
371fi 
372
373#+
374if [ X$g4vis_use_oiwin32 = Xy ] ; then
375G4VIS_USE_OIWIN32=1
376export G4VIS_USE_OIWIN32
377echo "On this machine the G4VIS_USE_OIWIN32=\$G4VIS_USE_OIWIN32"
378fi 
379
380#+
381if [ X$g4vis_use_vrml = Xy ] ; then
382G4VIS_USE_VRML=1
383export G4VIS_USE_VRML
384echo "On this machine the G4VIS_USE_VRML=\$G4VIS_USE_VRML"
385fi 
386
387#+
388if [ X$g4vis_oglhome != X ] ; then
389OGLHOME="$g4vis_oglhome"
390export OGLHOME
391echo "On this machine the OGLHOME=\$OGLHOME"
392fi 
393
394#+
395if [ X$g4vis_oivhome != X ] ; then
396OIVHOME="$g4vis_oivhome"
397export OIVHOME
398if [ X\$g4non_display = X ] ; then
399echo "On this machine the OIVHOME=\$OIVHOME"
400fi
401fi 
402
403#+
404if [ X$g4vis_build_openglxm_driver != X ] ; then
405XMFLAGS="$g4vis_xmflags"
406export XMFLAGS
407if [ X\$g4non_display = X ] ; then
408echo "On this machine the XMFLAGS=\$XMFLAGS"
409fi
410fi 
411
412#+
413if [ X$g4vis_build_openglxm_driver != X ] ; then
414XMLIBS="$g4vis_xmlibs"
415export XMLIBS
416if [ X\$g4non_display = X ] ; then
417echo "On this machine the XMLIBS=\$XMLIBS"
418fi
419fi 
420
421#+
422if [ X$g4ui_build_xm_session != X ] ; then
423XMFLAGS="$g4vis_xmflags"
424export XMFLAGS
425if [ X\$g4non_display = X ] ; then
426echo "On this machine the XMFLAGS=\$XMFLAGS"
427fi
428fi 
429
430#+
431if [ X$g4vis_build_xm_session != X ] ; then
432XMLIBS="$g4vis_xmlibs"
433export XMLIBS
434if [ X\$g4non_display = X ] ; then
435echo "On this machine the XMLIBS=\$XMLIBS"
436fi
437fi 
438
439#+
440if [ X$g4ui_build_xaw_session != X ] ; then
441XAWFLAGS="$g4ui_xawflags"
442export XAWFLAGS
443if [ X\$g4non_display = X ] ; then
444echo "On this machine the XAWFLAGS=\$XAWFLAGS"
445fi
446fi 
447
448#+
449if [ X$g4ui_build_xaw_session != X ] ; then
450XAWLIBS="$g4ui_xawlibs"
451export XAWLIBS
452if [ X\$g4non_display = X ] ; then
453echo "On this machine the XAWLIBS=\$XAWLIBS"
454fi
455fi 
456
457
458#
459# Use GDML module
460#
461#+
462if [ X$g4lib_build_gdml = Xy ] ; then
463G4LIB_BUILD_GDML=1
464export G4LIB_BUILD_GDML
465echo "On this machine the G4LIB_BUILD_GDML=\$G4LIB_BUILD_GDML"
466fi 
467
468if [ X$g4lib_build_gdml = Xy ] ; then
469XERCESCROOT=$g4gdml_xercesc_root
470export XERCESCROOT
471echo "On this machine the XERCESCROOT=\$XERCESCROOT"
472fi 
473
474
475#
476# Use G3TOG4 module
477#
478#+
479if [ X$g4wlib_build_g3tog4 = Xy ] ; then
480G4LIB_BUILD_G3TOG4=1
481export G4LIB_BUILD_G3TOG4
482echo "On this machine the G4LIB_BUILD_G3TOG4=\$G4LIB_BUILD_G3TOG4"
483fi 
484
485if [ X$g4w_use_g3tog4 = Xy ] ; then
486G4LIB_USE_G3TOG4=1
487export G4LIB_USE_G3TOG4
488echo "On this machine the G4LIB_USE_G3TOG4=\$G4LIB_USE_G3TOG4"
489fi 
490
491#
492# Use ZLIB module
493#
494#+
495if [ X$g4wlib_build_zlib = Xy ] ; then
496G4LIB_BUILD_ZLIB=1
497export G4LIB_BUILD_ZLIB
498echo "On this machine the G4LIB_BUILD_ZLIB=\$G4LIB_BUILD_ZLIB"
499fi 
500
501if [ X$g4w_use_zlib = Xy ] ; then
502G4LIB_USE_ZLIB=1
503export G4LIB_USE_ZLIB
504echo "On this machine the G4LIB_USE_ZLIB=\$G4LIB_USE_ZLIB"
505fi 
506
507#+
508#
509# g4shared
510#
511if [ X$g4lib_build_shared = Xy ] ; then
512G4LIB_BUILD_SHARED=1
513export G4LIB_BUILD_SHARED
514echo "On this machine the G4LIB_BUILD_SHARED=\$G4LIB_BUILD_SHARED"
515fi 
516
517if [ X$g4lib_build_static = Xy ] ; then
518G4LIB_BUILD_STATIC=1
519export G4LIB_BUILD_STATIC
520echo "On this machine the G4LIB_BUILD_STATIC=\$G4LIB_BUILD_STATIC"
521fi 
522
523#+
524#
525# g4granular
526#
527if [ X$g4lib_use_granular = Xy ] ; then
528G4LIB_USE_GRANULAR=1
529export G4LIB_USE_GRANULAR
530echo "On this machine the G4LIB_USE_GRANULAR=\$G4LIB_USE_GRANULAR"
531fi 
532
533#####################################################################
534
535#####################################################################
536# Create GNUmakefile.db to keep ALL GNUmakefile DB :)
537
538if test -f \$G4INSTALL/config/scripts/GNUmakefile.db ; then
539mv \$G4INSTALL/config/scripts/GNUmakefile.db \$G4LIB/\$G4SYSTEM/GNUmakefile.db.bac
540fi
541
542# Be careful: first time there is no $G4LIB!
543
544mkdir -p \$G4LIB/\$G4SYSTEM
545
546$g4make -n -p -f \$G4INSTALL/config/scripts/GNUmakefile > \$G4LIB/\$G4SYSTEM/GNUmakefile.db
547
548echo ""
549echo "Starting build..."
550echo ""
551cd $g4install/source
552#echo `pwd`
553
554# There is no env!
555if [ X$g4global = Xy ] ; then
556echo ""
557rm -rf $g4conf/g4make.log
558$g4make global 2>&1 | tee $g4conf/g4make.log
559fi
560
561# There is env for binaries - for User: should be set in env.[c]sh!
562if [ X$g4granular = Xy ] ; then
563G4LIB_USE_GRANULAR=1
564export G4LIB_USE_GRANULAR
565rm -rf $g4conf/g4make.log
566$g4make 2>&1 | tee $g4conf/g4make.log
567fi
568
569if [ X$g4lib_build_dll = Xy ] ; then
570echo ""
571rm -rf $g4conf/g4make.log
572$g4make dll 2>&1 | tee $g4conf/g4make.log
573fi
574
575if [ X$g4lib_build_dyn = Xy ] ; then
576echo ""
577rm -rf $g4conf/g4make.log
578$g4make global G4LIB_BUILD_SHARED=1 2>&1 | tee $g4conf/g4make.log
579fi
580
581# Check for errors in log file
582if test -f \$g4conf/g4make.log ; then
583
584# There are two (at least) shells 'sh' and 'bash' with
585# different arithmetic expansion...So we are doing it by 'text'
586# in two steps...
587 
588err=\`grep " Error " $g4conf/g4make.log | wc -w\` 
589int=\`grep " Interrupt " $g4conf/g4make.log | wc -w\` 
590stp=\`grep Stop\. $g4conf/g4make.log | wc -w\` 
591
592err2=\`echo \$err\`
593int2=\`echo \$int\`
594stp2=\`echo \$stp\`
595
596if [ X\$err2 = X0 -a X\$int2 = X0 ] ; then
597echo ""
598echo "####################################################"
599echo "# Your Geant4 installation seems to be successful!  "
600echo "# To be sure please have a look into the log file:  "
601echo "# $g4conf/g4make.log                                "
602echo "####################################################"
603echo ""
604else
605echo ""
606echo "############################################################"
607echo "# It looks like you had errors during Geant4 installation   "
608echo "# (or interrupted installation)!                            "
609echo "# Please check log file:                                    "
610echo "# $g4conf/g4make.log                                        "
611echo "############################################################"
612echo ""
613fi 
614else
615echo ""
616echo "############################################################"
617echo "# It looks like you had errors during Geant4 installation   "
618echo "# (or interrupted installation)!                            "
619echo "# You have no log file:                                     "
620echo "# $g4conf/g4make.log                                        "
621echo "############################################################"
622echo ""
623fi
624
625!GROK!THIS!
626
627: In the following dollars and backticks do not need the extra backslash.
628$spitshell >>install.sh <<'!NO!SUBS!'
629!NO!SUBS!
630chmod 755 install.sh
631$eunicefix install.sh
632
Note: See TracBrowser for help on using the repository browser.