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

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

Ajout option -followlink a configure, Reza 10/08/2010

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