Index: trunk/SophyaLib/BuildMgr/AIX_xlC_make.inc
===================================================================
--- trunk/SophyaLib/BuildMgr/AIX_xlC_make.inc	(revision 3202)
+++ trunk/SophyaLib/BuildMgr/AIX_xlC_make.inc	(revision 3210)
@@ -19,5 +19,6 @@
 #  Def compilateur C et flags
 CC = xlc
-CFLAGS = -O -g
+# Replace [CNFPHFLF] by specific compilation flags below (done by configure)
+CFLAGS = -O -g  CNFPHFLF 
 #  Def compilateur C++ et flags
 CXX =  xlC
@@ -25,10 +26,10 @@
 #  -qrtti=all : generate all RTTI infomation dynamic_cast + typeinfo
 #  -qeh=v6 : Exception handling compatible with v6 
-CXXFLAGS = -qrtti=all -qeh=v6 -O -g
+CXXFLAGS = -qrtti=all -qeh=v6 -O -g CNFPHFLF 
 # flags specifiques pour templates repository...
 # CXXTEMPFLG = -qtemplateregistry=$(SOPHYAOBJP)/templateregistry -qtemplaterecompile
 CXXTEMPFLG =
 #  Compilo fortran
-FC = xlf
+FC = xlf CNFPHFLF 
 FFLAGS =  
 # Pour fabriquer les lib .a
@@ -58,9 +59,10 @@
 
 SOPHYASLBLIST = -L$(SOPHYASLBP) -lsophya  $(SOPBASELIBS)
-# SOPHYAEXTSLBLIST = -L$(SOPHYASLBP) -lextsophya -lsophya $(SOPEXTLIBS) $(SOPBASELIBS)
-# SOPHYAALLSLBLIST = -L$(SOPHYALIBP) -lPIext -lPIGcont -lPI -L$(SOPHYASLBP) -lextsophya -lsophya $(PILIBS) $(SOPEXTLIBS) $(SOPBASELIBS)
-### --- Pb sur AIX quand plusieurs shared libs sont utilisees
-SOPHYAEXTSLBLIST = -L$(SOPHYASLBP) -lAsophyaextPI  $(SOPBASELIBS) $(SOPEXTLIBS) $(SOPBASELIBS)
-SOPHYAALLSLBLIST = $(SOPHYAEXTSLBLIST)
+SOPHYAEXTSLBLIST = -L$(SOPHYASLBP) -lextsophya -lsophya $(SOPEXTLIBS) $(SOPBASELIBS)
+SOPHYAALLSLBLIST = -L$(SOPHYASLBP) -lPI -lextsophya -lsophya $(PILIBS) $(SOPEXTLIBS) $(SOPBASELIBS)
+### --- Pb sur AIX quand plusieurs shared libs sont utilisees -> remplacement par -lAsophyaextPI
+## SOPHYAEXTSLBLIST = -L$(SOPHYASLBP) -lAsophyaextPI  $(SOPBASELIBS) $(SOPEXTLIBS) $(SOPBASELIBS)
+## SOPHYAALLSLBLIST = $(SOPHYAEXTSLBLIST)
+### ---------------------
 
 #  Commande de link pour creation d'executables
Index: trunk/SophyaLib/BuildMgr/Darwin_g++_make.inc
===================================================================
--- trunk/SophyaLib/BuildMgr/Darwin_g++_make.inc	(revision 3202)
+++ trunk/SophyaLib/BuildMgr/Darwin_g++_make.inc	(revision 3210)
@@ -13,10 +13,11 @@
 #  Def compilateur C et flags
 CC = cc
-CFLAGS = -fno-common -g -fPIC
+# Replace [CNFPHFLF] by specific compilation flags below (done by configure)
+CFLAGS = -fno-common -g -fPIC CNFPHFLF 
 #  With optimization flags 
-# CFLAGS = -fno-common -g -fastf -mtune=G5 -fPIC
+#  CFLAGS = -fno-common -g -fastf -mtune=G5 -fPIC
 #  Def compilateur C++ et flags
 CXX =  c++
-CXXFLAGS = -fno-common -g -fPIC 
+CXXFLAGS = -fno-common -g -fPIC  CNFPHFLF 
 # CXXFLAGS = -fno-common -g -fastf -mtune=G5 -fPIC 
 # flags specifiques pour templates repository...
Index: trunk/SophyaLib/BuildMgr/IRIX64_CC_make.inc
===================================================================
--- trunk/SophyaLib/BuildMgr/IRIX64_CC_make.inc	(revision 3202)
+++ trunk/SophyaLib/BuildMgr/IRIX64_CC_make.inc	(revision 3210)
@@ -15,13 +15,14 @@
 #  Def compilateur C et flags
 CC = cc 
-CFLAGS = -64 -O -g
+# Replace [CNFPHFLF] by specific compilation flags below (done by configure)
+CFLAGS = -O -g CNFPHFLF
 #  Def compilateur C++ et flags
 CXX =  CC 
-CXXFLAGS = -64 -prelink -LANG:std -O -g 
+CXXFLAGS = -prelink -LANG:std -O -g CNFPHFLF 
 # flags specifiques pour templates repository...
 CXXTEMPFLG = 
 #  Compilo fortran / commande et flags a verifier
 FC = f90 
-FFLAGS = -64 
+FFLAGS = CNFPHFLF 
 # Pour fabriquer les lib .a
 AR = /usr/bin/ar
Index: trunk/SophyaLib/BuildMgr/Linux_g++_make.inc
===================================================================
--- trunk/SophyaLib/BuildMgr/Linux_g++_make.inc	(revision 3202)
+++ trunk/SophyaLib/BuildMgr/Linux_g++_make.inc	(revision 3210)
@@ -13,8 +13,9 @@
 #  Def compilateur C et flags
 CC = gcc
-CFLAGS = -Wall -Wpointer-arith -Wmissing-prototypes -O -g
+# Replace [CNFPHFLF] by specific compilation flags below (done by configure)
+CFLAGS = -Wall -Wpointer-arith -Wmissing-prototypes -O -g -fPIC  CNFPHFLF
 #  Def compilateur C++ et flags
 CXX =  g++
-CXXFLAGS = -Wall -Wpointer-arith -Wsynth -O -g
+CXXFLAGS = -Wall -Wpointer-arith -Wsynth -O -g -fPIC  CNFPHFLF 
 # flags specifiques pour templates repository...
 CXXTEMPFLG =
Index: trunk/SophyaLib/BuildMgr/Linux_icc_make.inc
===================================================================
--- trunk/SophyaLib/BuildMgr/Linux_icc_make.inc	(revision 3202)
+++ trunk/SophyaLib/BuildMgr/Linux_icc_make.inc	(revision 3210)
@@ -13,8 +13,9 @@
 #  Def compilateur C et flags
 CC = icc
-CFLAGS = -fpic -O -g
+# Replace [CNFPHFLF] by specific compilation flags below (done by configure)
+CFLAGS = -fpic -O -g  CNFPHFLF 
 #  Def compilateur C++ et flags
 CXX =  icpc
-CXXFLAGS = -fpic -O -frtti -g
+CXXFLAGS = -fpic -O -frtti -g  CNFPHFLF 
 CXXREP =
 #  Compilo fortran
Index: trunk/SophyaLib/BuildMgr/OSF1_cxx_make.inc
===================================================================
--- trunk/SophyaLib/BuildMgr/OSF1_cxx_make.inc	(revision 3202)
+++ trunk/SophyaLib/BuildMgr/OSF1_cxx_make.inc	(revision 3210)
@@ -13,12 +13,13 @@
 #  Def compilateur C et flags
 CC = cc
-CFLAGS = -O -pthread -g1 
+# Replace [CNFPHFLF] by specific compilation flags below (done by configure)
+CFLAGS = -O -pthread -g1  CNFPHFLF 
 #  Def compilateur C++ et flags
 CXX =  cxx
-CXXFLAGS = -O -pthread -g1 -no_implicit_include
+CXXFLAGS = -O -pthread -g1 -no_implicit_include  CNFPHFLF 
 # flags specifiques pour templates repository...
 CXXTEMPFLG = -ptr $(SOPHYAOBJP)/cxxrep/
 #  Compilo fortran
-FC = f77
+FC = f77 CNFPHFLF 
 FFLAGS =  
 # Pour fabriquer les lib .a
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
