source: Sophya/trunk/SophyaLib/BuildMgr/configure@ 3840

Last change on this file since 3840 was 3840, checked in by ansari, 15 years ago

Amelioration du script configure (ajout flags -wgrdl -epip mdir1 ..., Reza 09/08/2010

  • Property svn:executable set to *
File size: 21.7 KB
RevLine 
[2720]1#!/bin/csh
2# SOPHYA configuration managment script
3# C. Magneville / R. Ansari - Mai 2005
[3357]4# Updated : 2006, Avr/Mai , Oct 2007
[2720]5# Exemple: ./configure -sbase /laltmp/ansari/sbase/ -scxx cxx -extp /exp/planck/ExtLibs/Include/ \
6# -extp /exp/planck/ExtLibs/OSF1-cxx/
7
[2724]8#----------------------------------------------------------------------
9#### liste des modules
[2910]10set SOPMODOK = ( 1 1 1 1 1 1 1 1 1 )
[2720]11set SOPMOD = ( BaseTools SysTools SUtils TArray NTools HiStats SkyMap Samba SkyT )
[2910]12set ALLSOPLIBS = ( '-lBaseTools' '-lSysTools' '-lSUtils' '-lTArray' '-lNTools' '-lHiStats' '-lSkyMap' '-lSamba' '-lSkyT' )
13
14set SOPPIOK = ( 1 1 1 )
[2720]15set SOPPI = ( PI PIext PIGcont )
[2910]16set ALLPILIBS = ( '-lPI' '-lPIext' '-lPIGcont' )
[2720]17
[3180]18set SOPEXT = ( FitsIOServer IFFTW LinAlg XAstroPack )
19set EXTCURNAME = ( fits fftw lapack astro )
20set SOPEXTOK = ( 1 1 1 1 )
21set EXTINCNAME = ( FitsIO/fitsio.h FFTW/fftw3.h PASDEINC XAstro/astro.h )
22set EXTLIBNAME = ( libcfitsio.a libfftw3.a liblapack.a libxastro.a )
23set ALLEXTLIBS = ( '-lcfitsio' '-lfftw3' '-llapack -lblas' '-lxastro' )
[2720]24
[3180]25#FFTW2: set EXTINCNAME = ( FitsIO/fitsio.h FFTW/fftw.h PASDEINC XAstro/astro.h )
26#FFTW2: set EXTLIBNAME = ( libcfitsio.a libfftw.a liblapack.a libxastro.a )
27#FFTW2: set ALLEXTLIBS = ( '-lcfitsio' '-lfftw -lrfftw' '-llapack -lblas' '-lxastro' )
[2720]28
[3001]29set defextinc = ( /usr/include /usr/local/include )
30set defextlib = ( /usr/lib /usr/local/lib )
[2724]31
[3840]32set defepiinc = ( /usr/X11R6/include )
33set defepilib = ( /usr/X11R6/lib )
[3001]34
[2724]35#----------------------------------------------------------------------
36#### Decodage arguments
[2720]37set cmdline = "$0 $*"
38set extpath
[2724]39set extpathinc
40set extpathlib
[3840]41set avecEXT
[2720]42unset incln
43unset mincname
[3818]44set compopt
45unset arch32
[3202]46unset arch64
47unset sasz64
[3753]48unset ssldble128
[3202]49unset nofpic
[3210]50unset nothsafe
[3202]51unset boundcheck
52unset sodebug
[3001]53unset usefftw2
54unset uselapack2
[3357]55unset alsofftwfloat
[3210]56unset slballinone
[3840]57## variables pour PI (librairie motif, GNU-readline ...)
58set epipath
59unset wgrdl
60set avecPI
61
62#### boucle de decodage des arguments :
[2720]63while ( $#argv > 0 )
64
65if( "$1" == "-h" ) then
[3210]66 echo 'configure [-sbase SOPHYABASE] [-scxx SOPHYACXX] [-incln] '
67 echo " [-minc mymake.inc] [-compopt 'cc/cxxOptions'] "
[3818]68 echo ' [-arch64] [-arch32] [-sasz64] [-ldble128] [-nofpic] [-nothsafe] [-boundcheck] [-sodebug]'
[2724]69 echo ' [-extp dir1 -extp dir2 ...] [-extip dir1 -extip dir2 ... ] [-extlp dir1 -extlp dir2 ... ]'
[3210]70 echo ' [-noextlib] [-noext fits] [-noext fftw] [-noext lapack] [-noext astro]'
[3357]71 echo ' [-alsofftwfloat] [-usefftw2] [-uselapack2] '
[3840]72 echo ' [-wgrdl] [-epip mdir1 -motp mdir2 ...] [-noPI] [-slballinone]'
[3210]73 echo ' (See SOPHYA manual/web pages for a detailed description of configure options)'
[2720]74 exit -1
75endif
76if( "$1" == "-sbase" ) then
77 setenv SOPHYABASE $2
78 shift
79endif
80if( "$1" == "-scxx" ) then
81 setenv SOPHYACXX $2
82 shift
83endif
84if( "$1" == "-incln" ) then
85 set incln
86endif
[2724]87if( "$1" == "-minc" ) then
88 set mincname = ( $2 )
89 shift
90endif
[3210]91if( "$1" == "-compopt" ) then
[3223]92 set compopt = ( $2 )
[3210]93 shift
94endif
[2720]95if( "$1" == "-extp" ) then
96 set extpath = ( $extpath $2 )
97 shift
98endif
[2724]99if( "$1" == "-extip" ) then
100 set extpathinc = ( $extpathinc $2 )
[2720]101 shift
102endif
[2724]103if( "$1" == "-extlp" ) then
104 set extpathlib = ( $extpathlib $2 )
105 shift
106endif
[2739]107if( "$1" == "-noextlib" ) then
108 set i = 0
109 while ( $i < $#SOPEXTOK )
110 @ i += 1
111 set SOPEXTOK[$i] = 0
112 end
[3840]113 unset avecEXT
[2739]114endif
[2724]115if( "$1" == "-noext" ) then
116 set i = 0
117 while ( $i < $#EXTCURNAME )
118 @ i += 1
119 if( "$2" == "$EXTCURNAME[$i]" ) set SOPEXTOK[$i] = 0
120 end
121 shift
122endif
[3357]123if( "$1" == "-alsofftwfloat" ) then
124# On veut la version float de FFTW, en plus de double
125 set alsofftwfloat
126 set i = 0
127 while ( $i < $#EXTCURNAME )
128 @ i += 1
129 if( "fftw" == "$EXTCURNAME[$i]" ) then
130 set ALLEXTLIBS[$i] = '-lfftw3 -lfftw3f'
131 endif
132 end
133endif
[3001]134if( "$1" == "-usefftw2" ) then
135# version FFTW 2 au lieu de V3
136 set usefftw2
137 set i = 0
138 while ( $i < $#EXTCURNAME )
139 @ i += 1
140 if( "fftw" == "$EXTCURNAME[$i]" ) then
141 set EXTINCNAME[$i] = 'FFTW/fftw.h'
142 set EXTLIBNAME[$i] = 'libfftw.a'
143 set ALLEXTLIBS[$i] = '-lfftw -lrfftw'
144 endif
145 end
146endif
147if( "$1" == "-uselapack2" ) then
148# version LAPACK 2 au lieu de V3
149 set uselapack2
150endif
[3840]151## Decodage arguments specifique PI
152if( "$1" == "-noPI" ) then
153 set SOPPIOK = ( 0 0 0 )
154 unset avecPI
155endif
156## compil piapp avec GNU-readline
157if( "$1" == "-wgrdl" ) then
158 set wgrdl
159endif
160## Chemin motif , readline ...
161if( "$1" == "-epip" ) then
162 set epipath = ( $epipath $2 )
163 shift
164endif
[3210]165if( "$1" == "-slballinone" ) then
[3001]166# Pour utiliser une seule librairie libsophyaPIext.so au lieu
167# des 3 libsophya.so libextsophya.so libPI.so
[3210]168 set slballinone
[3001]169endif
[3202]170# Decodage options pour flags de machdefs.h
[3753]171# Liste de flags : SO_ARCH64 SO_NOFPIC SO_SASIZET64 SO_LDBLE128 SO_BOUNDCHECKING SOPHYA_DEBUG
[3202]172if( "$1" == "-arch64" ) then
173 set arch64
[3818]174 unset arch32
[3202]175endif
[3818]176if( "$1" == "-arch32" ) then
177 set arch32
178 unset arch64
179 unset sasz64
180endif
[3202]181if( "$1" == "-sasz64" ) then
182 set sasz64
183endif
[3753]184if( "$1" == "-ldble128" ) then
185 set ssldble128
186endif
[3202]187if( "$1" == "-nofpic" ) then
188 set nofpic
189endif
[3210]190if( "$1" == "-nothsafe" ) then
191 set nothsafe
192endif
[3202]193if( "$1" == "-boundcheck" ) then
194 set boundcheck
195endif
196if( "$1" == "-sodebug" ) then
197 set sodebug
198endif
[2720]199
[3202]200
[2720]201shift
202end
203
[3840]204## ------ Detection linux 64 bits, AIX, IRIX ---
[3397]205unset linux64
[3398]206if ( `uname` == "Linux" ) then
[3397]207 if ( `uname -m` == "x86_64" ) then
208 echo ' ... Linux x86_64 (64 bits) ---> -arch64 '
209 set linux64
210 set arch64
211 endif
212endif
[3840]213set sname = `uname`
214if ( ( "$sname" == "IRIX64" ) || ( "$sname" == "AIX" ) ) set arch64
[2724]215
[3397]216
[2724]217#----------------------------------------------------------------------
218#### Verification generale
[2720]219if( ! $?SOPHYABASE ) then
220 echo ERROR: define SOPHYABASE or use script arguments
221 exit -2
222endif
223if( ! $?SOPHYACXX ) then
224 echo ERROR: define SOPHYACXX or use script arguments
225 echo " SOPHYACXX define the name of the C++ compiler (ex: g++ cxx ...)"
226 exit -2
227endif
228if( ! $?TMPDIR ) setenv TMPDIR /tmp
229touch $TMPDIR/tmp_test
230if( $status != 0 ) then
231 echo ERROR: no write acces in temporary directory: $TMPDIR
232 echo '----> define TMPDIR environment variable: "setenv TMPDIR ..."'
233 exit -2
234endif
[2724]235rm -f $TMPDIR/tmp_test
[2720]236if( ! $?mincname ) then
237 set mincname = `uname`_${SOPHYACXX}_make.inc
238endif
239if( ! -e $mincname ) then
240 echo ERROR: file $mincname NOT found
241 exit -2
242endif
243if( ! -e ../BaseTools/machdefs_mkmf.h ) then
244 echo ERROR: file machdefs_mkmf.h NOT found in BaseTools
245 exit -2
246endif
[2724]247echo SOPEXTOK: $SOPEXTOK
[2720]248
[2724]249#----------------------------------------------------------------------
250#### creation des variables chemins sophya core
[2720]251echo " "
252echo ">>>>>> 1/ Creating directory tree under $SOPHYABASE "
253set sinc = $SOPHYABASE/include
254set slib = $SOPHYABASE/lib
255set sslb = $SOPHYABASE/slb
256set sobj = $SOPHYABASE/obj
257set sexe = $SOPHYABASE/exe
258set sconf = $sinc/SophyaConfInfo
259foreach d ( $sinc $slib $sslb $sobj $sexe $sconf )
260 if( ! -d $d ) then
261 mkdir $d
262 if( $status ) then
263 echo ERROR: creation of $d failed
264 exit -3
265 endif
266 echo Directory $d created
267 endif
268 touch $d/tmp_test
269 if( $status ) then
270 echo ERROR: no write acces to $d
271 exit -4
272 endif
273 rm -f $d/tmp_test
274end
275
[2724]276
277#----------------------------------------------------------------------
278#### Fichier confinfo - log e configure
[2720]279set conflog = $sconf/conf.log
280rm -f $conflog ; touch $conflog
281echo ' --- Log of SOPHYA configure script - Date= ' `date` >> $conflog
282echo "$cmdline" >> $conflog
283set inclistf = $sconf/include.list
284rm -f $inclistf ; touch $inclistf
285
[2724]286
287#----------------------------------------------------------------------
288#### liens ou copie des *.h
[2720]289echo " "
[3001]290if( $?incln ) then
291 echo ">>>>>> 2/ Creating symbolic link for include files in $sinc "
292else
293 echo ">>>>>> 2/ Copying include files to $sinc "
294endif
295
[2724]296cd ../ > /dev/null
[2720]297set srcd = `pwd`
[2724]298set cpln = "cp -p "
299if( $?incln ) set cpln = "ln -s -f "
[2720]300foreach d ( $SOPMOD $SOPEXT $SOPPI )
[2724]301 if ( -d $srcd/$d ) then
[2726]302 if ( $?incln ) then
303 echo Creating link to include files for module $d
304 else
305 echo Copying include files for module $d
306 endif
307
[2724]308 cd $srcd/$d;
[2720]309 set file = ( *.h )
[2724]310 cd $sinc; if( $status == 0 ) rm -f $file
311 # on vire le .h de $file si .h dans excludeinc du module
312 cd $srcd/$d
313 if( -e excludeinc ) then
314 if( `cat excludeinc | wc -l` > 0 ) then
315 set file
316 foreach f ( *.h )
[2739]317 grep -q "$f:r\.h" excludeinc
[2724]318 if( $status != 0 ) set file = ( $file $f )
319 end
320 endif
[2720]321 endif
[2724]322 # on copie ou link dans $sinc
323 if( `echo $file | wc -w` > 0 ) then
324 foreach f ( $file )
325 $cpln $srcd/$d/$f $sinc/$f
326 end
327 endif
[2720]328 echo $file >> $inclistf
329 endif
330end
[3001]331rm -f $sinc/machdefs_ac.h $sinc/machdefs_mkmf.h
[2724]332cd $srcd/BuildMgr/.
[2720]333
334
[2724]335#----------------------------------------------------------------------
336#### lien des .h des librairies externes
[2720]337echo " "
[3840]338echo ">>>>>> 3.1/ Include files for external libraries "
[2720]339set i = 0
340while ( $i < $#SOPEXT )
341 @ i += 1
342 if( "$EXTINCNAME[$i]" == "PASDEINC" ) continue
343 if( $SOPEXTOK[$i] <= 0 ) continue
344 set nom = $EXTINCNAME[$i]:t
345 set rac = $EXTINCNAME[$i]:h
346 if( -d ../$SOPEXT[$i] ) then
347 echo "Searching include file for $SOPEXT[$i] ..."
[2724]348 foreach d ( $extpathinc $extpath $defextinc )
[2772]349 set duminc = `find $d -name $nom -print -follow | head -1 `
[2720]350 set dumrep = $duminc:h
351 if ( "$dumrep" != "" ) then
352 rm -f $sinc/$rac
353 ln -f -s $dumrep $sinc/$rac
354 echo Includes for $SOPEXT[$i] found in $dumrep
355 break
356 endif
357 end
358 if ( "$dumrep" == "" ) then
359 echo WARNING: Includes for $SOPEXT[$i] NOT found
360 echo " Compilation of module $SOPEXT[$i] disabled"
361 set SOPEXTOK[$i] = 0
362 endif
363 endif
364end
365
[3840]366### recherche des .h Motif et si besoin readline
367set piextinc
368if ( $?avecPI ) then
369 echo " "
370 echo ">>>>>> 3.2/ searching include files for Motif "
371 foreach d ( $epipath /usr/X11R6/include )
372 set duminc = `find $d -name Xm -print -follow | head -1 `
373 set dumrep = $duminc:h
374 if ( "$dumrep" != "" ) then
375 set piextinc = "-I$dumrep"
376 echo Includes for Motif found in $dumrep
377 break
378 endif
379 end
380 if ( "$dumrep" == "" ) then
381 echo WARNING: Includes for Motif NOT found
382 echo ' expect problems when compiling PI modules, check sophyamake.inc ... '
383 endif
384 endif
385 if ( $?wgrdl ) then
386 echo ">>>>>> 3.3/ searching include files for GNU readline "
387 foreach d ( $epipath /usr/local )
388 set duminc = `find $d -name readline -print -follow | head -1 `
389 set dumrep2 = $duminc:h
390 if ( "$dumrep2" != "" ) then
391 if ( "$dumrep2" != "$dumrep" ) set piextinc = "-I$dumrep2 $piextinc"
392 echo Includes for readline found in $dumrep
393 break
394 endif
395 end
396 if ( "$dumrep2" == "" ) then
397 echo WARNING: Includes for readline NOT found
398 echo ' expect problems when compiling piapp, check sophyamake.inc ... '
399 endif
400 endif
[2724]401
[3840]402 endif
403endif
404
[2724]405#----------------------------------------------------------------------
406#### liens des librairies externes
[2720]407echo " "
[2910]408echo ">>>>>> 4.1/ External libraries "
[2720]409set fpath = $TMPDIR/fpath
410rm -f $fpath; touch $fpath
411set extliblib
412set i = 0
413while ( $i < $#SOPEXT )
414 @ i += 1
415 if( "$EXTLIBNAME[$i]" == "PASDELIB" ) continue
416 if( $SOPEXTOK[$i] <= 0 ) continue
417 set nom = $EXTLIBNAME[$i]
418 if( -d ../$SOPEXT[$i] ) then
419 echo "Searching libraries path for $SOPEXT[$i] ..."
[2724]420 foreach d ( $extpathlib $extpath $defextlib )
[2772]421 set dumlib = `find $d -name $nom -print -follow | head -1 `
[2720]422 if ( "$dumlib" != "" ) then
423 echo "-L$dumlib:h" >> $fpath
424 set extliblib = ( $extliblib $ALLEXTLIBS[$i] )
425 break
426 endif
427 end
428 if ( "$dumlib" == "" ) then
429 echo WARNING: Libraries for $SOPEXT[$i] NOT found
430 echo " Check the generated make.inc file"
431 endif
432 endif
433end
434set extlibpath = `cat $fpath | sort -u`
435echo extlibpath= $extlibpath
436echo extliblib= $extliblib
[2724]437rm -f $fpath
[2720]438
[3840]439### recherche des librairies Motif et si besoin readline
440set piextlib = '-L/usr/X11R6/lib -lXm'
441if ( $?avecPI ) then
442 echo " "
443 echo ">>>>>> 4.2/ searching library Motif (libXm.a) "
444 foreach d ( $epipath /usr/X11R6/lib )
445 set dumlib = `find $d -name libXm.a -print -follow | head -1 `
446 set dumrep = $dumlib:h
447 if ( "$dumrep" != "" ) then
448 set piextlib = "-L$dumrep -lXm"
449 echo Motif library found in $dumrep
450 break
451 endif
452 end
453 if ( "$dumrep" == "" ) then
454 echo WARNING: Motif library NOT found
455 echo ' expect problems when for linking with PI, check sophyamake.inc ... '
456 endif
457 endif
458 if ( $?wgrdl ) then
459 echo ">>>>>> 4.3/ searching libraries for GNU readline "
460 foreach d ( $epipath /usr/local )
461 set dumlib = `find $d -name libreadline.a -print -follow | head -1 `
462 set dumrep2 = $dumlib:h
463 if ( "$dumrep2" != "" ) then
464 if ( "$dumrep2" != "$dumrep" ) then
465 set piextlib = "$piextlib -L$dumrep -lreadline -lhistory "
466 else
467 set piextlib = "$piextlib -lreadline -lhistory "
468 endif
469 echo Libraries for readline found in $dumrep
470 break
471 endif
472 end
473 if ( "$dumrep" == "" ) then
474 echo WARNING: libraries for readline NOT found
475 echo ' expect problems for linking piapp, check sophyamake.inc ... '
476 endif
477 endif
478 endif
479endif
[2724]480
[3840]481
[2724]482#----------------------------------------------------------------------
[2910]483#### Identification des librairies archives Sophya
484echo " "
[3840]485echo ">>>>>> 4.4/ Sophya libraries archives "
[2910]486set sopmodlib
487set i = 0
488while ( $i < $#SOPMOD )
489 @ i += 1
490 if( $SOPMODOK[$i] <= 0 ) continue
491 if( -d ../$SOPMOD[$i] ) then
492 set sopmodlib = ( $sopmodlib $ALLSOPLIBS[$i] )
493 else
494 echo "WARNING: module "$SOPMOD[$i]" not found"
495 endif
496end
497echo sopmodlib= $sopmodlib
498
499echo " "
500echo ">>>>>> 4.3/ PI-Sophya libraries archives "
501set soppilib
502set i = 0
503while ( $i < $#SOPPI )
504 @ i += 1
505 if( $SOPPIOK[$i] <= 0 ) continue
506 if( -d ../$SOPPI[$i] ) then
507 set soppilib = ( $soppilib $ALLPILIBS[$i] )
508 else
509 echo "WARNING: module "$SOPPI[$i]" not found"
510 endif
511end
512echo soppilib= $soppilib
513
514#----------------------------------------------------------------------
[2724]515#### Generation de sophyamake.inc
516# On le cree dans le repertoire temporaire d'abord
[2720]517set mfile = $sinc/sophyamake.inc
[2724]518rm -f $mfile
[2720]519echo " "
[2724]520echo ">>>>>> 5/ Creating $mfile from $mincname "
[2720]521echo "# -----------------------------------------------" > $mfile
522echo "# File make.inc - generated by SOPHYA configure" >> $mfile
523echo "# Date" `date` >> $mfile
524echo "# Seed file : $mincname " >> $mfile
525echo "# -----------------------------------------------" >> $mfile
526echo " " >> $mfile
527echo "# SOPHYA Base installation directory " >> $mfile
528echo "SOPHYABASE = $SOPHYABASE" >> $mfile
529echo " " >> $mfile
530echo 'SOPHYAINCP = $(SOPHYABASE)/include/' >> $mfile
531echo 'SOPHYAOBJP = $(SOPHYABASE)/obj/' >> $mfile
532echo 'SOPHYALIBP = $(SOPHYABASE)/lib/' >> $mfile
533echo 'SOPHYASLBP = $(SOPHYABASE)/slb/' >> $mfile
534echo 'SOPHYAEXEP = $(SOPHYABASE)/exe/' >> $mfile
535
536echo " " >> $mfile
[2910]537echo "# module libraries " >> $mfile
538echo "SOPMODLIBLIST = $sopmodlib" >> $mfile
539
540echo " " >> $mfile
[2720]541echo "# External libraries PATH " >> $mfile
542echo "SOPEXTLIBP = $extlibpath" >> $mfile
543echo "SOPEXTLIBLIST = $extliblib" >> $mfile
544
545echo " " >> $mfile
[2910]546echo "# PI libraries " >> $mfile
547echo "SOPPILIBLIST = $soppilib" >> $mfile
[3840]548echo "PIEXTINC = $piextinc" >> $mfile
549echo "PIEXTLIB = $piextlib" >> $mfile
550echo "PIEXTINC = $piextinc"
551echo "PIEXTLIB = $piextlib"
[2910]552
553echo " " >> $mfile
[3210]554cat $mincname >> $mfile
[2720]555
[3210]556# --- Gestion des flags modifiants les options de compilation et liste de librairies (par sed)
[3670]557set sprgfile = $TMPDIR/compop.scom
558rm -f $sprgfile
[3398]559echo '{' > $sprgfile
[3223]560set scmd = "/FLAGS/s/CNFPHFLF/ $compopt/g"
[3224]561if ( $?arch64 ) then
[3210]562 set a64cf = ' '
[3224]563 if ( ( "$sname" == "IRIX64" ) && ("$SOPHYACXX" == "CC" ) ) set a64cf = '-64'
[3227]564 if ( "$sname" == "AIX" ) then
565 if ( ("$SOPHYACXX" == "xlC" ) || ("$SOPHYACXX" == "xlc" ) ) set a64cf = '-q64'
[3230]566 echo "/ARFLAGS/s/-rcs/-rcs -X 64/" >> $sprgfile
[3227]567 endif
[3223]568 set scmd = "/FLAGS/s/CNFPHFLF/$a64cf $compopt/g"
[3210]569endif
[3818]570if ( $?arch32 ) then
571 set a32cf = ' '
572 if ( ( "$sname" == "Linux" ) && ("$SOPHYACXX" == "g++" ) ) set a32cf = '-m32'
573 if ( "$sname" == "AIX" ) then
574 if ( ("$SOPHYACXX" == "xlC" ) || ("$SOPHYACXX" == "xlc" ) ) set a32cf = '-q32'
575 endif
576 set scmd = "/FLAGS/s/CNFPHFLF/$a32cf $compopt/g"
577endif
578
[3398]579echo $scmd >> $sprgfile
[3210]580if ( $?nofpic ) echo "s/-fPIC/ /g" >> $sprgfile
581if( $?slballinone ) then
[3223]582 echo "/SOPHYAALLSLBLIST/s/-lPI -lextsophya -lsophya/-lAsophyaextPI/" >> $sprgfile
583 echo "/SOPHYAEXTSLBLIST/s/-lextsophya -lsophya/-lAsophyaextPI/" >> $sprgfile
[3210]584endif
[3840]585if ( ! $?avecEXT ) then
586 echo "/SOPHYAEXTSLBLIST/s/-lextsophya/ /" >> $sprgfile
587 echo "/SOPHYAALLSLBLIST/s/-lextsophya/ /" >> $sprgfile
588endif
589if ( ! $?avecPI ) then
590 echo "/SOPHYAALLSLBLIST/s/-lPI/ /" >> $sprgfile
591endif
592if ( ( $?linux64 ) && ( $?arch64) ) then
[3398]593 echo "s?-L/usr/X11R6/lib?-L/usr/X11R6/lib64?g" >> $sprgfile
[3397]594endif
[3398]595echo '}' >> $sprgfile
[3210]596set mftmp = $TMPDIR/sopmake.inc
597cp $mfile $mftmp
[3670]598rm -f $mfile
[3210]599sed -f $sprgfile $mftmp > $mfile
600rm -f $sprgfile $mftmp
601# --- FIN de gestion des flags modifiants les options de compilation (par sed)
602
[2724]603rm -f $mfile:t
[2720]604ln -s $mfile $mfile:t
605
[2724]606
607#----------------------------------------------------------------------
608#### Copie de machdefs.h
[2720]609set mdefname = $TMPDIR/machdefs.h
610echo " "
[3001]611echo ">>>>>> 6.a/ Creating machdefs.h from BaseTools/machdefs_mkmf.h"
[2720]612rm -f $mdefname; touch $mdefname
613echo "/*** machdefs.h generated by SOPHYA configure ***/" >> $mdefname
614echo "#ifndef MACHDEFS_SEEN" >> $mdefname
615echo "#define MACHDEFS_SEEN" >> $mdefname
616echo "/*------ Code generation switch ---- */" >> $mdefname
617echo "/* System selector (uname) */" >> $mdefname
[3224]618# Fait avant - set sname = `uname`
[2720]619echo "#ifndef $sname" >> $mdefname
620echo "#define $sname 1 " >> $mdefname
621echo "#endif" >> $mdefname
[3202]622
[3210]623## Definition de flags de compilation en fonction des options de configure
[3202]624if ( $?arch64 ) echo "#define SO_ARCH64 1" >> $mdefname
[3210]625if ( $?sasz64 ) echo "#define SO_SASIZET64 1" >> $mdefname
[3753]626if ( $?ssldble128 ) echo "#define SO_LDBLE128 1" >> $mdefname
[3202]627if ( $?nofpic ) echo "#define SO_NOFPIC 1" >> $mdefname
[3210]628if ( $?nothsafe ) echo "#define SO_NOTHSAFE 1" >> $mdefname
[3202]629if ( $?boundcheck ) echo "#define SO_BOUNDCHECKING 1" >> $mdefname
630if ( $?sodebug ) echo "#define SOPHYA_DEBUG 1" >> $mdefname
631
[2772]632if ( "$sname" == "IRIX64" ) then
633 if ( "$SOPHYACXX" == "CC" ) then
634# __SGICC__ : flag indiquant que c'est le compilo CC de SGI
635 echo "#define __SGICC__ 1" >> $mdefname
636 endif
637endif
[2724]638
[2720]639
[2724]640echo " " >> $mdefname
641grep -v -e '#ifndef *MACHDEFS_SEEN' -e '#define *MACHDEFS_SEEN' ../BaseTools/machdefs_mkmf.h >> $mdefname
[2720]642# On ne copie que si machdefs.h est different
643if (-e $sinc/machdefs.h ) then
644 diff $mdefname $sinc/machdefs.h >& /dev/null
645 if ($status != 0) then
646 cp -f -p $mdefname $sinc/machdefs.h
647 echo " file $sinc/machdefs.h changed -> replaced"
648 else
649 echo " file $sinc/machdefs.h has not changed -> kept"
650 endif
651else
652 cp -f -p $mdefname $sinc/machdefs.h
653 echo " file $sinc/machdefs.h created"
654endif
[2724]655rm -f $mdefname
[2720]656
657
[3001]658#### Creation de sspvflags.h
659echo " "
660echo ">>>>>> 6.b/ Creating $sinc/sspvflags.h "
661rm -f $sinc/sspvflags.h; touch $sinc/sspvflags.h
662
663echo "#ifndef SSPVFLAGS_SEEN" >> $sinc/sspvflags.h
664echo "#define SSPVFLAGS_SEEN" >> $sinc/sspvflags.h
665echo " " >> $sinc/sspvflags.h
666echo "/*------ External libraries no-use flag ---- */" >> $sinc/sspvflags.h
667set i = 0
668while ( $i < $#SOPEXTOK )
669 @ i += 1
670 if( $SOPEXTOK[$i] > 0 ) continue
671 echo "#define SOPHYA_NO_$SOPEXT[$i]" >> $sinc/sspvflags.h
672end
673
674echo " " >> $sinc/sspvflags.h
[3357]675echo "/*------ SOPOHYA/ExtLibsvVersion selection flags ---- */" >> $sinc/sspvflags.h
676echo " " >> $sinc/sspvflags.h
677if( $?alsofftwfloat ) then
678 echo "/*-- Compile ALSO float version of FFTWServer methods -- */" >> $sinc/sspvflags.h
679 echo "#define ALSO_FFTW_FLOAT_EXTSOP" >> $sinc/sspvflags.h
680endif
[3001]681if( $?usefftw2 ) then
[3357]682 echo "/*-- Use FFTW V2 instead of V3 -- */" >> $sinc/sspvflags.h
[3001]683 echo "#define FFTW_V2_EXTSOP" >> $sinc/sspvflags.h
684endif
685if( $?uselapack2 ) then
[3357]686 echo "/*-- Use LAPACK V2 instead of V3 -- */" >> $sinc/sspvflags.h
[3001]687 echo "#define LAPACK_V2_EXTSOP" >> $sinc/sspvflags.h
688endif
[3840]689if( $?wgrdl ) then
690 echo "/*-- Compile piapp with GNU-readline -- */" >> $sinc/sspvflags.h
691 echo "#define PIA_WITH_GNUREADLINE" >> $sinc/sspvflags.h
692endif
[3210]693if( $?slballinone ) then
[3357]694 echo "/*------ Use of single shared lib for SOPHYA+extlibs+PI ---- */" >> $sinc/sspvflags.h
[3210]695 echo "#define SO_SLBALLINONE " >> $sinc/sspvflags.h
[3001]696endif
697echo " " >> $sinc/sspvflags.h
698echo "#endif " >> $sinc/sspvflags.h
699
700
[2724]701#----------------------------------------------------------------------
702#### Creation des fichiers contenant les listes d'objets et d'includes
[2720]703echo " "
704echo ">>>>>> 7/ Creating object list files for shared library creation "
705set objlistname = $sconf/libsophya.objlist
706echo " 7.a/ Creating $objlistname "
[2724]707rm -f $objlistname ; touch $objlistname
[2751]708foreach d ( $SOPMOD )
709 rm -f $sconf/$d.conf
710 if ( ! -d ../$d ) continue
711 cat ../$d/objlist.list >> $objlistname
712 touch $sconf/$d.conf
[2720]713end
714
715set objlistname = $sconf/libextsophya.objlist
716echo " 7.b/ Creating $objlistname "
[2724]717rm -f $objlistname ; touch $objlistname
[2739]718set i = 0
719while ( $i < $#SOPEXT )
720 @ i += 1
[2751]721 set d = $SOPEXT[$i]
722 rm -f $sconf/$d.conf
[2739]723 if( $SOPEXTOK[$i] <= 0 ) continue
724 if ( ! -d ../$d ) continue
725 cat ../$d/objlist.list >> $objlistname
[2751]726 touch $sconf/$d.conf
[2739]727end
[2720]728
729set objlistname = $sconf/libPI.objlist
730echo " 7.c/ Creating $objlistname "
[2724]731rm -f $objlistname ; touch $objlistname
[3210]732set i = 0
733while ( $i < $#SOPPI )
734 @ i += 1
735 set d = $SOPPI[$i]
[2751]736 rm -f $sconf/$d.conf
[3210]737 if( $SOPPIOK[$i] <= 0 ) continue
[2751]738 if ( ! -d ../$d ) continue
739 cat ../$d/objlist.list >> $objlistname
740 touch $sconf/$d.conf
[2720]741end
[2724]742
743
744#----------------------------------------------------------------------
745exit 0
Note: See TracBrowser for help on using the repository browser.