| 1 | #!/bin/csh | 
|---|
| 2 | #  SOPHYA configuration managment script | 
|---|
| 3 | #  C. Magneville / R. Ansari   -      Mai 2005 | 
|---|
| 4 | #     Updated : 2006, Avr/Mai 2007 | 
|---|
| 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 | 
|---|
| 10 | set SOPMODOK = ( 1 1 1 1 1 1 1 1 1 ) | 
|---|
| 11 | set SOPMOD = ( BaseTools SysTools SUtils TArray NTools HiStats SkyMap Samba SkyT ) | 
|---|
| 12 | set ALLSOPLIBS = ( '-lBaseTools' '-lSysTools' '-lSUtils' '-lTArray' '-lNTools' '-lHiStats' '-lSkyMap' '-lSamba' '-lSkyT' ) | 
|---|
| 13 |  | 
|---|
| 14 | set SOPPIOK = ( 1 1 1 ) | 
|---|
| 15 | set SOPPI = ( PI PIext PIGcont ) | 
|---|
| 16 | set ALLPILIBS = ( '-lPI' '-lPIext' '-lPIGcont' ) | 
|---|
| 17 |  | 
|---|
| 18 | set SOPEXT     = ( FitsIOServer  IFFTW  LinAlg  XAstroPack ) | 
|---|
| 19 | set EXTCURNAME = ( fits          fftw   lapack  astro      ) | 
|---|
| 20 | set SOPEXTOK   = ( 1             1      1       1          ) | 
|---|
| 21 | set EXTINCNAME = ( FitsIO/fitsio.h FFTW/fftw3.h  PASDEINC XAstro/astro.h ) | 
|---|
| 22 | set EXTLIBNAME = ( libcfitsio.a libfftw3.a liblapack.a libxastro.a ) | 
|---|
| 23 | set 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 |  | 
|---|
| 29 | set defextinc = ( /usr/include /usr/local/include ) | 
|---|
| 30 | set defextlib = ( /usr/lib /usr/local/lib ) | 
|---|
| 31 |  | 
|---|
| 32 |  | 
|---|
| 33 | #---------------------------------------------------------------------- | 
|---|
| 34 | #### Decodage arguments | 
|---|
| 35 | set cmdline = "$0 $*" | 
|---|
| 36 | set extpath | 
|---|
| 37 | set extpathinc | 
|---|
| 38 | set extpathlib | 
|---|
| 39 | unset incln | 
|---|
| 40 | unset mincname | 
|---|
| 41 | set compopt | 
|---|
| 42 | unset arch64 | 
|---|
| 43 | unset sasz64 | 
|---|
| 44 | unset nofpic | 
|---|
| 45 | unset nothsafe | 
|---|
| 46 | unset boundcheck | 
|---|
| 47 | unset sodebug | 
|---|
| 48 | unset usefftw2 | 
|---|
| 49 | unset uselapack2 | 
|---|
| 50 | unset slballinone | 
|---|
| 51 | while ( $#argv > 0 ) | 
|---|
| 52 |  | 
|---|
| 53 | if( "$1" == "-h" ) then | 
|---|
| 54 | echo 'configure [-sbase SOPHYABASE] [-scxx SOPHYACXX] [-incln] ' | 
|---|
| 55 | echo "  [-minc mymake.inc]  [-compopt 'cc/cxxOptions'] " | 
|---|
| 56 | echo '  [-arch64] [-sasz64] [-nofpic] [-nothsafe] [-boundcheck] [-sodebug]' | 
|---|
| 57 | echo '  [-extp dir1 -extp dir2 ...] [-extip dir1 -extip dir2 ... ] [-extlp dir1 -extlp dir2 ... ]' | 
|---|
| 58 | echo '  [-noextlib] [-noext fits] [-noext fftw] [-noext lapack] [-noext astro]' | 
|---|
| 59 | echo '  [-noPI] [-slballinone]' | 
|---|
| 60 | echo '  [-usefftw2 -uselapack2] ' | 
|---|
| 61 | echo '  (See SOPHYA manual/web pages for a detailed description of configure options)' | 
|---|
| 62 | exit -1 | 
|---|
| 63 | endif | 
|---|
| 64 | if( "$1" == "-sbase" ) then | 
|---|
| 65 | setenv SOPHYABASE $2 | 
|---|
| 66 | shift | 
|---|
| 67 | endif | 
|---|
| 68 | if( "$1" == "-scxx" ) then | 
|---|
| 69 | setenv SOPHYACXX $2 | 
|---|
| 70 | shift | 
|---|
| 71 | endif | 
|---|
| 72 | if( "$1" == "-incln" ) then | 
|---|
| 73 | set incln | 
|---|
| 74 | endif | 
|---|
| 75 | if( "$1" == "-minc" ) then | 
|---|
| 76 | set mincname = ( $2 ) | 
|---|
| 77 | shift | 
|---|
| 78 | endif | 
|---|
| 79 | if( "$1" == "-compopt" ) then | 
|---|
| 80 | set compopt = ( $2 ) | 
|---|
| 81 | shift | 
|---|
| 82 | endif | 
|---|
| 83 | if( "$1" == "-extp" ) then | 
|---|
| 84 | set extpath = ( $extpath $2 ) | 
|---|
| 85 | shift | 
|---|
| 86 | endif | 
|---|
| 87 | if( "$1" == "-extip" ) then | 
|---|
| 88 | set extpathinc = ( $extpathinc $2 ) | 
|---|
| 89 | shift | 
|---|
| 90 | endif | 
|---|
| 91 | if( "$1" == "-extlp" ) then | 
|---|
| 92 | set extpathlib = ( $extpathlib $2 ) | 
|---|
| 93 | shift | 
|---|
| 94 | endif | 
|---|
| 95 | if( "$1" == "-noextlib" ) then | 
|---|
| 96 | set i = 0 | 
|---|
| 97 | while ( $i < $#SOPEXTOK ) | 
|---|
| 98 | @ i += 1 | 
|---|
| 99 | set SOPEXTOK[$i] = 0 | 
|---|
| 100 | end | 
|---|
| 101 | endif | 
|---|
| 102 | if( "$1" == "-noext" ) then | 
|---|
| 103 | set i = 0 | 
|---|
| 104 | while ( $i < $#EXTCURNAME ) | 
|---|
| 105 | @ i += 1 | 
|---|
| 106 | if( "$2" == "$EXTCURNAME[$i]" ) set SOPEXTOK[$i] = 0 | 
|---|
| 107 | end | 
|---|
| 108 | shift | 
|---|
| 109 | endif | 
|---|
| 110 | if( "$1" == "-PI" ) then | 
|---|
| 111 | set SOPPIOK = ( 0 0 0 ) | 
|---|
| 112 | endif | 
|---|
| 113 | if( "$1" == "-usefftw2" ) then | 
|---|
| 114 | # version FFTW 2 au lieu de V3 | 
|---|
| 115 | set usefftw2 | 
|---|
| 116 | set i = 0 | 
|---|
| 117 | while ( $i < $#EXTCURNAME ) | 
|---|
| 118 | @ i += 1 | 
|---|
| 119 | if( "fftw" == "$EXTCURNAME[$i]" ) then | 
|---|
| 120 | set EXTINCNAME[$i] = 'FFTW/fftw.h' | 
|---|
| 121 | set EXTLIBNAME[$i] = 'libfftw.a' | 
|---|
| 122 | set ALLEXTLIBS[$i] = '-lfftw -lrfftw' | 
|---|
| 123 | endif | 
|---|
| 124 | end | 
|---|
| 125 | endif | 
|---|
| 126 | if( "$1" == "-uselapack2" ) then | 
|---|
| 127 | # version LAPACK 2 au lieu de V3 | 
|---|
| 128 | set uselapack2 | 
|---|
| 129 | endif | 
|---|
| 130 | if( "$1" == "-slballinone" ) then | 
|---|
| 131 | # Pour utiliser une seule librairie libsophyaPIext.so au lieu | 
|---|
| 132 | #   des 3 libsophya.so libextsophya.so libPI.so | 
|---|
| 133 | set slballinone | 
|---|
| 134 | endif | 
|---|
| 135 | #  Decodage options pour flags de machdefs.h | 
|---|
| 136 | #  Liste de flags : SO_ARCH64 SO_NOFPIC SO_SASIZET64 SO_BOUNDCHECKING SOPHYA_DEBUG | 
|---|
| 137 | if( "$1" == "-arch64" ) then | 
|---|
| 138 | set arch64 | 
|---|
| 139 | endif | 
|---|
| 140 | if( "$1" == "-sasz64" ) then | 
|---|
| 141 | set sasz64 | 
|---|
| 142 | endif | 
|---|
| 143 | if( "$1" == "-nofpic" ) then | 
|---|
| 144 | set nofpic | 
|---|
| 145 | endif | 
|---|
| 146 | if( "$1" == "-nothsafe" ) then | 
|---|
| 147 | set nothsafe | 
|---|
| 148 | endif | 
|---|
| 149 | if( "$1" == "-boundcheck" ) then | 
|---|
| 150 | set boundcheck | 
|---|
| 151 | endif | 
|---|
| 152 | if( "$1" == "-sodebug" ) then | 
|---|
| 153 | set sodebug | 
|---|
| 154 | endif | 
|---|
| 155 |  | 
|---|
| 156 |  | 
|---|
| 157 | shift | 
|---|
| 158 | end | 
|---|
| 159 |  | 
|---|
| 160 |  | 
|---|
| 161 | #---------------------------------------------------------------------- | 
|---|
| 162 | #### Verification generale | 
|---|
| 163 | if( ! $?SOPHYABASE ) then | 
|---|
| 164 | echo ERROR: define SOPHYABASE or use script arguments | 
|---|
| 165 | exit -2 | 
|---|
| 166 | endif | 
|---|
| 167 | if( ! $?SOPHYACXX ) then | 
|---|
| 168 | echo ERROR: define SOPHYACXX or use script arguments | 
|---|
| 169 | echo "   SOPHYACXX define the name of the C++ compiler (ex: g++ cxx ...)" | 
|---|
| 170 | exit -2 | 
|---|
| 171 | endif | 
|---|
| 172 | if( ! $?TMPDIR ) setenv TMPDIR /tmp | 
|---|
| 173 | touch $TMPDIR/tmp_test | 
|---|
| 174 | if( $status != 0 ) then | 
|---|
| 175 | echo ERROR: no write acces in temporary directory: $TMPDIR | 
|---|
| 176 | echo '----> define TMPDIR environment variable: "setenv TMPDIR ..."' | 
|---|
| 177 | exit -2 | 
|---|
| 178 | endif | 
|---|
| 179 | rm -f $TMPDIR/tmp_test | 
|---|
| 180 | if( ! $?mincname ) then | 
|---|
| 181 | set mincname = `uname`_${SOPHYACXX}_make.inc | 
|---|
| 182 | endif | 
|---|
| 183 | if( ! -e $mincname ) then | 
|---|
| 184 | echo ERROR: file $mincname NOT found | 
|---|
| 185 | exit -2 | 
|---|
| 186 | endif | 
|---|
| 187 | if( ! -e ../BaseTools/machdefs_mkmf.h ) then | 
|---|
| 188 | echo ERROR: file machdefs_mkmf.h NOT found in BaseTools | 
|---|
| 189 | exit -2 | 
|---|
| 190 | endif | 
|---|
| 191 | echo SOPEXTOK: $SOPEXTOK | 
|---|
| 192 |  | 
|---|
| 193 | #---------------------------------------------------------------------- | 
|---|
| 194 | #### creation des variables chemins sophya core | 
|---|
| 195 | echo " " | 
|---|
| 196 | echo ">>>>>> 1/ Creating directory tree under $SOPHYABASE  " | 
|---|
| 197 | set sinc = $SOPHYABASE/include | 
|---|
| 198 | set slib = $SOPHYABASE/lib | 
|---|
| 199 | set sslb = $SOPHYABASE/slb | 
|---|
| 200 | set sobj = $SOPHYABASE/obj | 
|---|
| 201 | set sexe = $SOPHYABASE/exe | 
|---|
| 202 | set sconf = $sinc/SophyaConfInfo | 
|---|
| 203 | foreach d ( $sinc $slib $sslb $sobj $sexe $sconf ) | 
|---|
| 204 | if( ! -d $d ) then | 
|---|
| 205 | mkdir $d | 
|---|
| 206 | if( $status ) then | 
|---|
| 207 | echo ERROR: creation of $d failed | 
|---|
| 208 | exit -3 | 
|---|
| 209 | endif | 
|---|
| 210 | echo Directory $d created | 
|---|
| 211 | endif | 
|---|
| 212 | touch $d/tmp_test | 
|---|
| 213 | if( $status ) then | 
|---|
| 214 | echo ERROR: no write acces to $d | 
|---|
| 215 | exit -4 | 
|---|
| 216 | endif | 
|---|
| 217 | rm -f $d/tmp_test | 
|---|
| 218 | end | 
|---|
| 219 |  | 
|---|
| 220 |  | 
|---|
| 221 | #---------------------------------------------------------------------- | 
|---|
| 222 | #### Fichier confinfo - log e configure | 
|---|
| 223 | set conflog = $sconf/conf.log | 
|---|
| 224 | rm -f $conflog ; touch $conflog | 
|---|
| 225 | echo ' --- Log of SOPHYA configure script - Date= ' `date` >> $conflog | 
|---|
| 226 | echo "$cmdline"  >> $conflog | 
|---|
| 227 | set inclistf = $sconf/include.list | 
|---|
| 228 | rm -f $inclistf ; touch $inclistf | 
|---|
| 229 |  | 
|---|
| 230 |  | 
|---|
| 231 | #---------------------------------------------------------------------- | 
|---|
| 232 | #### liens ou copie des *.h | 
|---|
| 233 | echo " " | 
|---|
| 234 | if( $?incln ) then | 
|---|
| 235 | echo ">>>>>> 2/ Creating symbolic link for include files in $sinc " | 
|---|
| 236 | else | 
|---|
| 237 | echo ">>>>>> 2/ Copying include files to $sinc " | 
|---|
| 238 | endif | 
|---|
| 239 |  | 
|---|
| 240 | cd ../  > /dev/null | 
|---|
| 241 | set srcd = `pwd` | 
|---|
| 242 | set cpln = "cp -p " | 
|---|
| 243 | if( $?incln ) set cpln = "ln -s -f  " | 
|---|
| 244 | foreach d ( $SOPMOD $SOPEXT $SOPPI ) | 
|---|
| 245 | if ( -d $srcd/$d ) then | 
|---|
| 246 | if ( $?incln ) then | 
|---|
| 247 | echo Creating link to include files for module $d | 
|---|
| 248 | else | 
|---|
| 249 | echo Copying include files for module $d | 
|---|
| 250 | endif | 
|---|
| 251 |  | 
|---|
| 252 | cd $srcd/$d; | 
|---|
| 253 | set file = ( *.h ) | 
|---|
| 254 | cd $sinc;  if( $status == 0 ) rm -f $file | 
|---|
| 255 | # on vire le .h de $file si .h dans excludeinc du module | 
|---|
| 256 | cd $srcd/$d | 
|---|
| 257 | if( -e excludeinc ) then | 
|---|
| 258 | if( `cat excludeinc | wc -l` > 0 ) then | 
|---|
| 259 | set file | 
|---|
| 260 | foreach f ( *.h ) | 
|---|
| 261 | grep -q "$f:r\.h" excludeinc | 
|---|
| 262 | if( $status != 0 ) set file = ( $file $f ) | 
|---|
| 263 | end | 
|---|
| 264 | endif | 
|---|
| 265 | endif | 
|---|
| 266 | # on copie ou link dans $sinc | 
|---|
| 267 | if( `echo $file | wc -w` > 0 ) then | 
|---|
| 268 | foreach f ( $file ) | 
|---|
| 269 | $cpln $srcd/$d/$f  $sinc/$f | 
|---|
| 270 | end | 
|---|
| 271 | endif | 
|---|
| 272 | echo $file >> $inclistf | 
|---|
| 273 | endif | 
|---|
| 274 | end | 
|---|
| 275 | rm -f $sinc/machdefs_ac.h $sinc/machdefs_mkmf.h | 
|---|
| 276 | cd $srcd/BuildMgr/. | 
|---|
| 277 |  | 
|---|
| 278 |  | 
|---|
| 279 | #---------------------------------------------------------------------- | 
|---|
| 280 | #### lien  des .h des librairies externes | 
|---|
| 281 | echo " " | 
|---|
| 282 | echo ">>>>>> 3/  Include files for external libraries " | 
|---|
| 283 | set i = 0 | 
|---|
| 284 | while ( $i < $#SOPEXT ) | 
|---|
| 285 | @ i += 1 | 
|---|
| 286 | if( "$EXTINCNAME[$i]" == "PASDEINC" ) continue | 
|---|
| 287 | if( $SOPEXTOK[$i] <= 0 ) continue | 
|---|
| 288 | set nom = $EXTINCNAME[$i]:t | 
|---|
| 289 | set rac = $EXTINCNAME[$i]:h | 
|---|
| 290 | if( -d ../$SOPEXT[$i] ) then | 
|---|
| 291 | echo "Searching include file for $SOPEXT[$i] ..." | 
|---|
| 292 | foreach d ( $extpathinc $extpath $defextinc ) | 
|---|
| 293 | set duminc = `find $d -name $nom -print -follow | head -1 ` | 
|---|
| 294 | set dumrep = $duminc:h | 
|---|
| 295 | if ( "$dumrep" != "" ) then | 
|---|
| 296 | rm -f $sinc/$rac | 
|---|
| 297 | ln -f -s $dumrep $sinc/$rac | 
|---|
| 298 | echo Includes for $SOPEXT[$i] found in $dumrep | 
|---|
| 299 | break | 
|---|
| 300 | endif | 
|---|
| 301 | end | 
|---|
| 302 | if ( "$dumrep" == "" ) then | 
|---|
| 303 | echo WARNING: Includes for $SOPEXT[$i] NOT found | 
|---|
| 304 | echo "    Compilation of module  $SOPEXT[$i] disabled" | 
|---|
| 305 | set SOPEXTOK[$i] = 0 | 
|---|
| 306 | endif | 
|---|
| 307 | endif | 
|---|
| 308 | end | 
|---|
| 309 |  | 
|---|
| 310 |  | 
|---|
| 311 | #---------------------------------------------------------------------- | 
|---|
| 312 | #### liens des librairies externes | 
|---|
| 313 | echo " " | 
|---|
| 314 | echo ">>>>>> 4.1/  External libraries " | 
|---|
| 315 | set fpath = $TMPDIR/fpath | 
|---|
| 316 | rm -f $fpath; touch $fpath | 
|---|
| 317 | set extliblib | 
|---|
| 318 | set i = 0 | 
|---|
| 319 | while ( $i < $#SOPEXT ) | 
|---|
| 320 | @ i += 1 | 
|---|
| 321 | if( "$EXTLIBNAME[$i]" == "PASDELIB" ) continue | 
|---|
| 322 | if( $SOPEXTOK[$i] <= 0 ) continue | 
|---|
| 323 | set nom = $EXTLIBNAME[$i] | 
|---|
| 324 | if( -d ../$SOPEXT[$i] ) then | 
|---|
| 325 | echo "Searching libraries path for $SOPEXT[$i] ..." | 
|---|
| 326 | foreach d ( $extpathlib $extpath $defextlib ) | 
|---|
| 327 | set dumlib = `find $d -name $nom -print -follow | head -1 ` | 
|---|
| 328 | if ( "$dumlib" != "" ) then | 
|---|
| 329 | echo "-L$dumlib:h" >> $fpath | 
|---|
| 330 | set extliblib = ( $extliblib $ALLEXTLIBS[$i] ) | 
|---|
| 331 | break | 
|---|
| 332 | endif | 
|---|
| 333 | end | 
|---|
| 334 | if ( "$dumlib" == "" ) then | 
|---|
| 335 | echo WARNING: Libraries for $SOPEXT[$i] NOT found | 
|---|
| 336 | echo "    Check the generated make.inc file" | 
|---|
| 337 | endif | 
|---|
| 338 | endif | 
|---|
| 339 | end | 
|---|
| 340 | set extlibpath = `cat $fpath | sort -u` | 
|---|
| 341 | echo extlibpath= $extlibpath | 
|---|
| 342 | echo extliblib= $extliblib | 
|---|
| 343 | rm -f $fpath | 
|---|
| 344 |  | 
|---|
| 345 |  | 
|---|
| 346 | #---------------------------------------------------------------------- | 
|---|
| 347 | #### Identification des librairies archives Sophya | 
|---|
| 348 | echo " " | 
|---|
| 349 | echo ">>>>>> 4.2/  Sophya libraries archives " | 
|---|
| 350 | set sopmodlib | 
|---|
| 351 | set i = 0 | 
|---|
| 352 | while ( $i < $#SOPMOD ) | 
|---|
| 353 | @ i += 1 | 
|---|
| 354 | if( $SOPMODOK[$i] <= 0 ) continue | 
|---|
| 355 | if( -d ../$SOPMOD[$i] ) then | 
|---|
| 356 | set sopmodlib = ( $sopmodlib $ALLSOPLIBS[$i] ) | 
|---|
| 357 | else | 
|---|
| 358 | echo "WARNING: module "$SOPMOD[$i]" not found" | 
|---|
| 359 | endif | 
|---|
| 360 | end | 
|---|
| 361 | echo sopmodlib= $sopmodlib | 
|---|
| 362 |  | 
|---|
| 363 | echo " " | 
|---|
| 364 | echo ">>>>>> 4.3/  PI-Sophya libraries archives " | 
|---|
| 365 | set soppilib | 
|---|
| 366 | set i = 0 | 
|---|
| 367 | while ( $i < $#SOPPI ) | 
|---|
| 368 | @ i += 1 | 
|---|
| 369 | if( $SOPPIOK[$i] <= 0 ) continue | 
|---|
| 370 | if( -d ../$SOPPI[$i] ) then | 
|---|
| 371 | set soppilib = ( $soppilib $ALLPILIBS[$i] ) | 
|---|
| 372 | else | 
|---|
| 373 | echo "WARNING: module "$SOPPI[$i]" not found" | 
|---|
| 374 | endif | 
|---|
| 375 | end | 
|---|
| 376 | echo soppilib= $soppilib | 
|---|
| 377 |  | 
|---|
| 378 | #---------------------------------------------------------------------- | 
|---|
| 379 | #### Generation de sophyamake.inc | 
|---|
| 380 | #  On le cree dans le repertoire temporaire d'abord | 
|---|
| 381 | set mfile = $sinc/sophyamake.inc | 
|---|
| 382 | rm -f $mfile | 
|---|
| 383 | echo " " | 
|---|
| 384 | echo ">>>>>> 5/  Creating $mfile from $mincname " | 
|---|
| 385 | echo "# -----------------------------------------------" > $mfile | 
|---|
| 386 | echo "#  File make.inc - generated by SOPHYA configure" >> $mfile | 
|---|
| 387 | echo "#  Date" `date` >> $mfile | 
|---|
| 388 | echo "#  Seed file : $mincname " >> $mfile | 
|---|
| 389 | echo "# -----------------------------------------------" >> $mfile | 
|---|
| 390 | echo " " >> $mfile | 
|---|
| 391 | echo "# SOPHYA Base installation directory " >> $mfile | 
|---|
| 392 | echo "SOPHYABASE = $SOPHYABASE" >> $mfile | 
|---|
| 393 | echo " " >> $mfile | 
|---|
| 394 | echo 'SOPHYAINCP = $(SOPHYABASE)/include/' >> $mfile | 
|---|
| 395 | echo 'SOPHYAOBJP = $(SOPHYABASE)/obj/' >> $mfile | 
|---|
| 396 | echo 'SOPHYALIBP = $(SOPHYABASE)/lib/' >> $mfile | 
|---|
| 397 | echo 'SOPHYASLBP = $(SOPHYABASE)/slb/' >> $mfile | 
|---|
| 398 | echo 'SOPHYAEXEP = $(SOPHYABASE)/exe/' >> $mfile | 
|---|
| 399 |  | 
|---|
| 400 | echo " " >> $mfile | 
|---|
| 401 | echo "# module libraries  " >> $mfile | 
|---|
| 402 | echo "SOPMODLIBLIST = $sopmodlib" >> $mfile | 
|---|
| 403 |  | 
|---|
| 404 | echo " " >> $mfile | 
|---|
| 405 | echo "# External libraries PATH  " >> $mfile | 
|---|
| 406 | echo "SOPEXTLIBP = $extlibpath"  >> $mfile | 
|---|
| 407 | echo "SOPEXTLIBLIST = $extliblib" >> $mfile | 
|---|
| 408 |  | 
|---|
| 409 | echo " " >> $mfile | 
|---|
| 410 | echo "# PI libraries  " >> $mfile | 
|---|
| 411 | echo "SOPPILIBLIST = $soppilib" >> $mfile | 
|---|
| 412 |  | 
|---|
| 413 | echo " " >> $mfile | 
|---|
| 414 | cat $mincname >> $mfile | 
|---|
| 415 |  | 
|---|
| 416 | # --- Gestion des flags modifiants les options de compilation et liste de librairies (par sed) | 
|---|
| 417 | set sname = `uname` | 
|---|
| 418 | set sprgfile = $TMPDIR/compop.scom | 
|---|
| 419 | set scmd = "/FLAGS/s/CNFPHFLF/ $compopt/g" | 
|---|
| 420 | if ( $?arch64 ) then | 
|---|
| 421 | set a64cf = ' ' | 
|---|
| 422 | if ( ( "$sname" == "IRIX64" ) && ("$SOPHYACXX" == "CC" ) ) set a64cf = '-64' | 
|---|
| 423 | if ( "$sname" == "AIX" ) then | 
|---|
| 424 | if ( ("$SOPHYACXX" == "xlC" ) || ("$SOPHYACXX" == "xlc" ) )  set a64cf = '-q64' | 
|---|
| 425 | echo "/ARFLAGS/s/-rcs/-rcs -X 64/" >>  $sprgfile | 
|---|
| 426 | endif | 
|---|
| 427 | set scmd = "/FLAGS/s/CNFPHFLF/$a64cf $compopt/g" | 
|---|
| 428 | endif | 
|---|
| 429 | echo $scmd > $sprgfile | 
|---|
| 430 | if ( $?nofpic ) echo "s/-fPIC/ /g" >>  $sprgfile | 
|---|
| 431 | if( $?slballinone ) then | 
|---|
| 432 | echo "/SOPHYAALLSLBLIST/s/-lPI -lextsophya -lsophya/-lAsophyaextPI/" >>  $sprgfile | 
|---|
| 433 | echo "/SOPHYAEXTSLBLIST/s/-lextsophya -lsophya/-lAsophyaextPI/" >>  $sprgfile | 
|---|
| 434 | endif | 
|---|
| 435 | set scmd = "sed -f $sprgfile" | 
|---|
| 436 | set mftmp = $TMPDIR/sopmake.inc | 
|---|
| 437 | cp $mfile $mftmp | 
|---|
| 438 | sed -f $sprgfile $mftmp >   $mfile | 
|---|
| 439 | rm -f $sprgfile $mftmp | 
|---|
| 440 | # --- FIN de gestion des flags modifiants les options de compilation (par sed) | 
|---|
| 441 |  | 
|---|
| 442 | rm -f $mfile:t | 
|---|
| 443 | ln -s $mfile $mfile:t | 
|---|
| 444 |  | 
|---|
| 445 |  | 
|---|
| 446 | #---------------------------------------------------------------------- | 
|---|
| 447 | #### Copie de machdefs.h | 
|---|
| 448 | set mdefname = $TMPDIR/machdefs.h | 
|---|
| 449 | echo " " | 
|---|
| 450 | echo ">>>>>> 6.a/  Creating  machdefs.h from BaseTools/machdefs_mkmf.h" | 
|---|
| 451 | rm -f $mdefname; touch $mdefname | 
|---|
| 452 | echo "/*** machdefs.h generated by SOPHYA configure ***/" >> $mdefname | 
|---|
| 453 | echo "#ifndef MACHDEFS_SEEN" >> $mdefname | 
|---|
| 454 | echo "#define MACHDEFS_SEEN" >> $mdefname | 
|---|
| 455 | echo "/*------ Code generation switch ---- */" >> $mdefname | 
|---|
| 456 | echo "/*   System selector (uname) */" >> $mdefname | 
|---|
| 457 | # Fait avant - set sname = `uname` | 
|---|
| 458 | echo "#ifndef $sname" >> $mdefname | 
|---|
| 459 | echo "#define $sname 1 "  >> $mdefname | 
|---|
| 460 | echo "#endif" >> $mdefname | 
|---|
| 461 |  | 
|---|
| 462 | ## Definition de flags de compilation en fonction des options de configure | 
|---|
| 463 | if ( $?arch64 )  echo "#define SO_ARCH64  1" >> $mdefname | 
|---|
| 464 | if ( $?sasz64 )  echo "#define SO_SASIZET64  1" >> $mdefname | 
|---|
| 465 | if ( $?nofpic )  echo "#define SO_NOFPIC  1" >> $mdefname | 
|---|
| 466 | if ( $?nothsafe )  echo "#define SO_NOTHSAFE  1" >> $mdefname | 
|---|
| 467 | if ( $?boundcheck )  echo "#define SO_BOUNDCHECKING  1" >> $mdefname | 
|---|
| 468 | if ( $?sodebug )  echo "#define SOPHYA_DEBUG  1" >> $mdefname | 
|---|
| 469 |  | 
|---|
| 470 | if ( "$sname" == "IRIX64" ) then | 
|---|
| 471 | if ( "$SOPHYACXX" == "CC" ) then | 
|---|
| 472 | #  __SGICC__ : flag indiquant que c'est le compilo CC de SGI | 
|---|
| 473 | echo "#define __SGICC__ 1" >> $mdefname | 
|---|
| 474 | endif | 
|---|
| 475 | endif | 
|---|
| 476 |  | 
|---|
| 477 |  | 
|---|
| 478 | echo " " >> $mdefname | 
|---|
| 479 | grep -v -e '#ifndef *MACHDEFS_SEEN' -e '#define *MACHDEFS_SEEN' ../BaseTools/machdefs_mkmf.h >> $mdefname | 
|---|
| 480 | #  On ne copie que si machdefs.h est different | 
|---|
| 481 | if (-e $sinc/machdefs.h ) then | 
|---|
| 482 | diff $mdefname $sinc/machdefs.h >& /dev/null | 
|---|
| 483 | if ($status != 0) then | 
|---|
| 484 | cp -f -p $mdefname $sinc/machdefs.h | 
|---|
| 485 | echo " file $sinc/machdefs.h changed -> replaced" | 
|---|
| 486 | else | 
|---|
| 487 | echo " file $sinc/machdefs.h has not changed -> kept" | 
|---|
| 488 | endif | 
|---|
| 489 | else | 
|---|
| 490 | cp -f -p $mdefname $sinc/machdefs.h | 
|---|
| 491 | echo " file $sinc/machdefs.h created" | 
|---|
| 492 | endif | 
|---|
| 493 | rm -f $mdefname | 
|---|
| 494 |  | 
|---|
| 495 |  | 
|---|
| 496 | #### Creation de sspvflags.h | 
|---|
| 497 | echo " " | 
|---|
| 498 | echo ">>>>>> 6.b/  Creating  $sinc/sspvflags.h " | 
|---|
| 499 | rm -f $sinc/sspvflags.h; touch $sinc/sspvflags.h | 
|---|
| 500 |  | 
|---|
| 501 | echo "#ifndef SSPVFLAGS_SEEN" >> $sinc/sspvflags.h | 
|---|
| 502 | echo "#define SSPVFLAGS_SEEN" >> $sinc/sspvflags.h | 
|---|
| 503 | echo " " >> $sinc/sspvflags.h | 
|---|
| 504 | echo "/*------ External libraries no-use flag ---- */" >> $sinc/sspvflags.h | 
|---|
| 505 | set i = 0 | 
|---|
| 506 | while ( $i < $#SOPEXTOK ) | 
|---|
| 507 | @ i += 1 | 
|---|
| 508 | if( $SOPEXTOK[$i] > 0 ) continue | 
|---|
| 509 | echo "#define SOPHYA_NO_$SOPEXT[$i]" >> $sinc/sspvflags.h | 
|---|
| 510 | end | 
|---|
| 511 |  | 
|---|
| 512 | echo " " >> $sinc/sspvflags.h | 
|---|
| 513 | echo "/*------ Version selection flags ---- */" >> $sinc/sspvflags.h | 
|---|
| 514 | if( $?usefftw2 ) then | 
|---|
| 515 | echo "#define FFTW_V2_EXTSOP" >> $sinc/sspvflags.h | 
|---|
| 516 | endif | 
|---|
| 517 | if( $?uselapack2 ) then | 
|---|
| 518 | echo "#define LAPACK_V2_EXTSOP" >> $sinc/sspvflags.h | 
|---|
| 519 | endif | 
|---|
| 520 | echo " " >> $sinc/sspvflags.h | 
|---|
| 521 | echo "/*------ Use of single shared lib for SOPHYA+extlibs+PI ---- */" >> $sinc/sspvflags.h | 
|---|
| 522 | if( $?slballinone ) then | 
|---|
| 523 | echo "#define SO_SLBALLINONE " >> $sinc/sspvflags.h | 
|---|
| 524 | endif | 
|---|
| 525 | echo " " >> $sinc/sspvflags.h | 
|---|
| 526 | echo "#endif " >> $sinc/sspvflags.h | 
|---|
| 527 |  | 
|---|
| 528 |  | 
|---|
| 529 | #---------------------------------------------------------------------- | 
|---|
| 530 | #### Creation des fichiers contenant les listes d'objets et d'includes | 
|---|
| 531 | echo " " | 
|---|
| 532 | echo ">>>>>> 7/  Creating object list files for shared library creation " | 
|---|
| 533 | set objlistname = $sconf/libsophya.objlist | 
|---|
| 534 | echo " 7.a/ Creating $objlistname " | 
|---|
| 535 | rm -f $objlistname ; touch $objlistname | 
|---|
| 536 | foreach d ( $SOPMOD ) | 
|---|
| 537 | rm -f $sconf/$d.conf | 
|---|
| 538 | if ( ! -d ../$d ) continue | 
|---|
| 539 | cat ../$d/objlist.list >> $objlistname | 
|---|
| 540 | touch $sconf/$d.conf | 
|---|
| 541 | end | 
|---|
| 542 |  | 
|---|
| 543 | set objlistname = $sconf/libextsophya.objlist | 
|---|
| 544 | echo " 7.b/ Creating $objlistname " | 
|---|
| 545 | rm -f $objlistname ; touch $objlistname | 
|---|
| 546 | set i = 0 | 
|---|
| 547 | while ( $i < $#SOPEXT ) | 
|---|
| 548 | @ i += 1 | 
|---|
| 549 | set d = $SOPEXT[$i] | 
|---|
| 550 | rm -f $sconf/$d.conf | 
|---|
| 551 | if( $SOPEXTOK[$i] <= 0 ) continue | 
|---|
| 552 | if ( ! -d ../$d ) continue | 
|---|
| 553 | cat ../$d/objlist.list >> $objlistname | 
|---|
| 554 | touch $sconf/$d.conf | 
|---|
| 555 | end | 
|---|
| 556 |  | 
|---|
| 557 | set objlistname = $sconf/libPI.objlist | 
|---|
| 558 | echo " 7.c/ Creating $objlistname " | 
|---|
| 559 | rm -f $objlistname ; touch $objlistname | 
|---|
| 560 | set i = 0 | 
|---|
| 561 | while ( $i < $#SOPPI ) | 
|---|
| 562 | @ i += 1 | 
|---|
| 563 | set d = $SOPPI[$i] | 
|---|
| 564 | rm -f $sconf/$d.conf | 
|---|
| 565 | if( $SOPPIOK[$i] <= 0 ) continue | 
|---|
| 566 | if ( ! -d ../$d ) continue | 
|---|
| 567 | cat ../$d/objlist.list >> $objlistname | 
|---|
| 568 | touch $sconf/$d.conf | 
|---|
| 569 | end | 
|---|
| 570 |  | 
|---|
| 571 |  | 
|---|
| 572 | #---------------------------------------------------------------------- | 
|---|
| 573 | exit 0 | 
|---|