Index: trunk/SophyaLib/BuildMgr/configure
===================================================================
--- trunk/SophyaLib/BuildMgr/configure	(revision 2910)
+++ trunk/SophyaLib/BuildMgr/configure	(revision 3001)
@@ -18,10 +18,14 @@
 set EXTCURNAME = ( fits          fftw   lapack  astro       minuit      )
 set SOPEXTOK   = ( 1             1      1       1           1           )
-set EXTINCNAME = ( FitsIO/fitsio.h FFTW/fftw.h  PASDEINC XAstro/astro.h Cern/minuit.h )
-set EXTLIBNAME = ( libcfitsio.a libfftw.a liblapack.a libxastro.a libminuit.a )
-set ALLEXTLIBS = ( '-lcfitsio' '-lfftw -lrfftw' '-llapack -lblas' '-lxastro' '-lminuit' )
-
-set defextinc = ( ~ /usr/include /usr/local/include )
-set defextlib = ( ~ /usr/lib /usr/local/lib )
+set EXTINCNAME = ( FitsIO/fitsio.h FFTW/fftw3.h  PASDEINC XAstro/astro.h Cern/minuit.h )
+set EXTLIBNAME = ( libcfitsio.a libfftw3.a liblapack.a libxastro.a libminuit.a )
+set ALLEXTLIBS = ( '-lcfitsio' '-lfftw3' '-llapack -lblas' '-lxastro' '-lminuit' )
+
+#FFTW2: set EXTINCNAME = ( FitsIO/fitsio.h FFTW/fftw.h  PASDEINC XAstro/astro.h Cern/minuit.h )
+#FFTW2: set EXTLIBNAME = ( libcfitsio.a libfftw.a liblapack.a libxastro.a libminuit.a )
+#FFTW2: set ALLEXTLIBS = ( '-lcfitsio' '-lfftw -lrfftw' '-llapack -lblas' '-lxastro' '-lminuit' )
+
+set defextinc = ( /usr/include /usr/local/include )
+set defextlib = ( /usr/lib /usr/local/lib )
 
 
@@ -34,4 +38,7 @@
 unset incln
 unset mincname
+unset usefftw2
+unset uselapack2
+unset singleslb
 while ( $#argv > 0 )
 
@@ -40,4 +47,5 @@
   echo '  [-extp dir1 -extp dir2 ...] [-extip dir1 -extip dir2 ... ] [-extlp dir1 -extlp dir2 ... ]'
   echo '  [-noextlib -noext fits -noext fftw -noext lapack -noext astro -noext minuit]'
+  echo '  [-usefftw2 -uselapack2] [-singleslb]'
   exit -1
 endif
@@ -83,4 +91,26 @@
   end
   shift
+endif
+if( "$1" == "-usefftw2" ) then
+# version FFTW 2 au lieu de V3
+  set usefftw2
+  set i = 0
+  while ( $i < $#EXTCURNAME )
+    @ i += 1
+    if( "fftw" == "$EXTCURNAME[$i]" ) then
+       set EXTINCNAME[$i] = 'FFTW/fftw.h'
+       set EXTLIBNAME[$i] = 'libfftw.a'
+       set ALLEXTLIBS[$i] = '-lfftw -lrfftw'
+    endif
+  end
+endif
+if( "$1" == "-uselapack2" ) then
+# version LAPACK 2 au lieu de V3
+  set uselapack2
+endif
+if( "$1" == "-singleslb" ) then
+# Pour utiliser une seule librairie libsophyaPIext.so au lieu 
+#   des 3 libsophya.so libextsophya.so libPI.so
+  set singleslb
 endif
 
@@ -162,5 +192,10 @@
 #### liens ou copie des *.h
 echo " "
-echo ">>>>>> 2/ Copying include files to $sinc "
+if( $?incln ) then
+  echo ">>>>>> 2/ Creating symbolic link for include files in $sinc "
+else
+  echo ">>>>>> 2/ Copying include files to $sinc "
+endif
+
 cd ../  > /dev/null
 set srcd = `pwd`
@@ -198,4 +233,5 @@
   endif
 end
+rm -f $sinc/machdefs_ac.h $sinc/machdefs_mkmf.h 
 cd $srcd/BuildMgr/.
 
@@ -346,5 +382,5 @@
 set mdefname = $TMPDIR/machdefs.h
 echo " "
-echo ">>>>>> 6/  Creating  machdefs.h from BaseTools/machdefs_mkmf.h"
+echo ">>>>>> 6.a/  Creating  machdefs.h from BaseTools/machdefs_mkmf.h"
 rm -f $mdefname; touch $mdefname
 echo "/*** machdefs.h generated by SOPHYA configure ***/" >> $mdefname
@@ -367,12 +403,4 @@
 endif
 
-echo " " >> $mdefname 
-echo "/*------ External libraries no-use flag ---- */" >> $mdefname
-set i = 0
-while ( $i < $#SOPEXTOK )
-  @ i += 1
-  if( $SOPEXTOK[$i] > 0 ) continue
-  echo "#define SOPHYA_NO_$SOPEXT[$i]" >> $mdefname
-end
 
 echo " " >> $mdefname 
@@ -394,4 +422,37 @@
 
 
+#### Creation de sspvflags.h
+echo " "
+echo ">>>>>> 6.b/  Creating  $sinc/sspvflags.h "
+rm -f $sinc/sspvflags.h; touch $sinc/sspvflags.h
+
+echo "#ifndef SSPVFLAGS_SEEN" >> $sinc/sspvflags.h
+echo "#define SSPVFLAGS_SEEN" >> $sinc/sspvflags.h
+echo " " >> $sinc/sspvflags.h 
+echo "/*------ External libraries no-use flag ---- */" >> $sinc/sspvflags.h
+set i = 0
+while ( $i < $#SOPEXTOK )
+  @ i += 1
+  if( $SOPEXTOK[$i] > 0 ) continue
+  echo "#define SOPHYA_NO_$SOPEXT[$i]" >> $sinc/sspvflags.h
+end
+
+echo " " >> $sinc/sspvflags.h 
+echo "/*------ Version selection flags ---- */" >> $sinc/sspvflags.h
+if( $?usefftw2 ) then
+  echo "#define FFTW_V2_EXTSOP" >> $sinc/sspvflags.h
+endif
+if( $?uselapack2 ) then
+  echo "#define LAPACK_V2_EXTSOP" >> $sinc/sspvflags.h
+endif
+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
+endif
+echo " " >> $sinc/sspvflags.h 
+echo "#endif " >> $sinc/sspvflags.h 
+
+
 #----------------------------------------------------------------------
 #### Creation des fichiers contenant les listes d'objets et d'includes
