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

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

r549@wl-72148: laurentgarnier | 2007-05-15 10:37:42 +0200
import de geant4

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