Index: trunk/SophyaLib/BuildMgr/configure
===================================================================
--- trunk/SophyaLib/BuildMgr/configure	(revision 3202)
+++ trunk/SophyaLib/BuildMgr/configure	(revision 3210)
@@ -2,4 +2,5 @@
 #  SOPHYA configuration managment script 
 #  C. Magneville / R. Ansari   -      Mai 2005
+#     Updated : 2006, Avr/Mai 2007
 # Exemple: ./configure -sbase /laltmp/ansari/sbase/ -scxx cxx -extp /exp/planck/ExtLibs/Include/ \
 #              -extp /exp/planck/ExtLibs/OSF1-cxx/
@@ -38,20 +39,25 @@
 unset incln
 unset mincname
+set compopt 
 unset arch64
 unset sasz64
 unset nofpic
+unset nothsafe
 unset boundcheck
 unset sodebug
 unset usefftw2
 unset uselapack2
-unset singleslb
+unset slballinone
 while ( $#argv > 0 )
 
 if( "$1" == "-h" ) then
-  echo 'configure [-sbase SOPHYABASE] [-scxx SOPHYACXX] [-incln] [-minc mymake.inc] '
-  echo '  [-arch64] [-sasz64] [-nofpic] [-boundcheck] [-sodebug]'
+  echo 'configure [-sbase SOPHYABASE] [-scxx SOPHYACXX] [-incln] '
+  echo "  [-minc mymake.inc]  [-compopt 'cc/cxxOptions'] "
+  echo '  [-arch64] [-sasz64] [-nofpic] [-nothsafe] [-boundcheck] [-sodebug]'
   echo '  [-extp dir1 -extp dir2 ...] [-extip dir1 -extip dir2 ... ] [-extlp dir1 -extlp dir2 ... ]'
-  echo '  [-noextlib -noext fits -noext fftw -noext lapack -noext astro]'
-  echo '  [-usefftw2 -uselapack2] [-singleslb]'
+  echo '  [-noextlib] [-noext fits] [-noext fftw] [-noext lapack] [-noext astro]'
+  echo '  [-noPI] [-slballinone]'
+  echo '  [-usefftw2 -uselapack2] '
+  echo '  (See SOPHYA manual/web pages for a detailed description of configure options)'
   exit -1
 endif
@@ -69,4 +75,8 @@
 if( "$1" == "-minc" ) then
   set mincname = ( $2 )
+  shift
+endif
+if( "$1" == "-compopt" ) then
+  set spcompopt = ( $2 )
   shift
 endif
@@ -97,4 +107,7 @@
   end
   shift
+endif
+if( "$1" == "-PI" ) then
+  set SOPPIOK = ( 0 0 0 )
 endif
 if( "$1" == "-usefftw2" ) then
@@ -115,8 +128,8 @@
   set uselapack2
 endif
-if( "$1" == "-singleslb" ) then
+if( "$1" == "-slballinone" ) then
 # Pour utiliser une seule librairie libsophyaPIext.so au lieu 
 #   des 3 libsophya.so libextsophya.so libPI.so
-  set singleslb
+  set slballinone
 endif
 #  Decodage options pour flags de machdefs.h 
@@ -130,4 +143,7 @@
 if( "$1" == "-nofpic" ) then
   set nofpic
+endif
+if( "$1" == "-nothsafe" ) then
+  set nothsafe
 endif
 if( "$1" == "-boundcheck" ) then
@@ -396,5 +412,28 @@
 
 echo " " >> $mfile 
-cat $mincname >> $mfile  
+cat $mincname >> $mfile
+
+# --- Gestion des flags modifiants les options de compilation et liste de librairies (par sed)
+set sprgfile = $TMPDIR/compop.scom  
+set scmd = "s/CNFPHFLF/ $compopt/g"
+if ($?arch64) then
+  set a64cf = ' '
+  if ( "$sname" == "IRIX64" ) &&  ("$SOPHYACXX" == "CC" ) set a64cf = '-64'
+  if ( "$sname" == "AIX" ) && ( ("$SOPHYACXX" == "xlC" ) || ("$SOPHYACXX" == "xlc" ) ) 
+    set a64cf = '-q64'
+set scmd = "s/CNFPHFLF/$a64cf $compopt/g"
+endif
+echo $scmd > $sprgfile
+if ( $?nofpic ) echo "s/-fPIC/ /g" >>  $sprgfile
+if( $?slballinone ) then 
+  echo "s/-lPI -lextsophya -lsophya/-lAsophyaextPI/" >>  $sprgfile 
+  echo "s/-lextsophya -lsophya/-lAsophyaextPI/" >>  $sprgfile 
+endif
+set scmd = "sed -f $sprgfile"
+set mftmp = $TMPDIR/sopmake.inc
+cp $mfile $mftmp
+sed -f $sprgfile $mftmp >   $mfile
+rm -f $sprgfile $mftmp
+# --- FIN de gestion des flags modifiants les options de compilation (par sed)
 
 rm -f $mfile:t
@@ -418,13 +457,13 @@
 echo "#endif" >> $mdefname
 
+## Definition de flags de compilation en fonction des options de configure 
 if ( $?arch64 )  echo "#define SO_ARCH64  1" >> $mdefname
+if ( $?sasz64 )  echo "#define SO_SASIZET64  1" >> $mdefname
 if ( $?nofpic )  echo "#define SO_NOFPIC  1" >> $mdefname
-if ( $?sasz64 )  echo "#define SO_SASIZET64  1" >> $mdefname
+if ( $?nothsafe )  echo "#define SO_NOTHSAFE  1" >> $mdefname
 if ( $?boundcheck )  echo "#define SO_BOUNDCHECKING  1" >> $mdefname
 if ( $?sodebug )  echo "#define SOPHYA_DEBUG  1" >> $mdefname
 
 if ( "$sname" == "IRIX64" ) then
-#  SGI_ARCH64 : compile avec -64 (en 64 bits)
-  echo "#define SGI_ARCH64 1 /* Compile avec -64 */" >> $mdefname
   if ( "$SOPHYACXX" == "CC" ) then
 #  __SGICC__ : flag indiquant que c'est le compilo CC de SGI 
@@ -478,6 +517,6 @@
 echo " " >> $sinc/sspvflags.h 
 echo "/*------ Use of single shared lib for SOPHYA+extlibs+PI ---- */" >> $sinc/sspvflags.h
-if( $?singleslb ) then
-  echo "#define SINGLESLB_SOPHYA_PI_EXT" >> $sinc/sspvflags.h
+if( $?slballinone ) then
+  echo "#define SO_SLBALLINONE " >> $sinc/sspvflags.h
 endif
 echo " " >> $sinc/sspvflags.h 
@@ -516,6 +555,10 @@
 echo " 7.c/ Creating $objlistname "
 rm -f $objlistname ; touch $objlistname
-foreach d ( $SOPPI )
+set i = 0
+while ( $i < $#SOPPI )
+  @ i += 1
+  set d = $SOPPI[$i]
   rm -f $sconf/$d.conf
+  if( $SOPPIOK[$i] <= 0 ) continue
   if ( ! -d ../$d ) continue
   cat ../$d/objlist.list >> $objlistname
