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

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

r627@mac-90108: laurentgarnier | 2007-11-09 07:57:42 +0100
modif dans les includes directives

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