Index: trunk/SophyaLib/BuildMgr/Linux_g++_make.inc
===================================================================
--- trunk/SophyaLib/BuildMgr/Linux_g++_make.inc	(revision 2723)
+++ trunk/SophyaLib/BuildMgr/Linux_g++_make.inc	(revision 2724)
@@ -28,4 +28,5 @@
 CCOMPILE = $(CC) $(CPPFLAGS) $(CFLAGS) -c 
 CXXCOMPILE = $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c 
+FCCOMPILE = $(FC) $(FFLAGS) -c 
 
 #  Extension de nom pour les librairies partagees
@@ -38,5 +39,5 @@
 SOPBASELIBS = -lpthread -lm -lc -ldl 
 
-# --- Chemin pour l'ensemble les librairies SOPHYA , +ExtLibs, +PI
+# --- Chemin pour l ensemble les librairies SOPHYA , +ExtLibs, +PI
 SOPHYASLBLIST = -L$(SOPHYASLBP) -lsophya  $(SOPBASELIBS)
 SOPHYAEXTSLBLIST = -L$(SOPHYASLBP) -lextsophya -lsophya $(SOPEXTLIBS) $(SOPBASELIBS)
Index: trunk/SophyaLib/BuildMgr/OSF1_cxx_make.inc
===================================================================
--- trunk/SophyaLib/BuildMgr/OSF1_cxx_make.inc	(revision 2723)
+++ trunk/SophyaLib/BuildMgr/OSF1_cxx_make.inc	(revision 2724)
@@ -28,4 +28,5 @@
 CCOMPILE = $(CC) $(CPPFLAGS) $(CFLAGS) -c 
 CXXCOMPILE = $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c 
+FCCOMPILE = $(FC) $(FFLAGS) -c 
 
 #  Extension de nom pour les librairies partagees
Index: trunk/SophyaLib/BuildMgr/configure
===================================================================
--- trunk/SophyaLib/BuildMgr/configure	(revision 2723)
+++ trunk/SophyaLib/BuildMgr/configure	(revision 2724)
@@ -5,20 +5,26 @@
 #              -extp /exp/planck/ExtLibs/OSF1-cxx/
 
-# liste des modules
+#----------------------------------------------------------------------
+#### liste des modules
 set SOPMOD = ( BaseTools SysTools SUtils TArray NTools HiStats SkyMap Samba SkyT )
-set SOPEXT = ( FitsIOServer IFFTW LinAlg XAstroPack )
 set SOPPI = ( PI PIext PIGcont )
 
-set SOPEXTOK = ( 1 1 1 1 )
-set EXTINCNAME = ( FitsIO/fitsio.h FFTW/fftw.h  PASDEINC XAstro/astro.h )
-set EXTLIBNAME = ( libcfitsio.a libfftw.a liblapack.a libxastro.a )
-set ALLEXTLIBS = ( -lcfitsio '-lfftw -lrfftw' '-llapack -lblas' -lxastro )
+set SOPEXT     = ( FitsIOServer  IFFTW  LinAlg  XAstroPack  MinuitAdapt )
+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 )
 
+
+#----------------------------------------------------------------------
+#### Decodage arguments
 set cmdline = "$0 $*" 
-# Decodage arguments
 set extpath
+set extpathinc
+set extpathlib
 unset incln
 unset mincname
@@ -26,6 +32,7 @@
 
 if( "$1" == "-h" ) then
-  echo 'configure [-sbase SOPHYABASE] [-scxx SOPHYACXX] [-incln] '
-  echo '          [-extp dir1 -extp dir2 ...] [-minc mymake.inc]'
+  echo 'configure [-sbase SOPHYABASE] [-scxx SOPHYACXX] [-incln] [-minc mymake.inc] '
+  echo '  [-extp dir1 -extp dir2 ...] [-extip dir1 -extip dir2 ... ] [-extlp dir1 -extlp dir2 ... ]'
+  echo '  [-noext fits -noext fftw -noext lapack -noext astro -noext minuit]'
   exit -1
 endif
@@ -41,10 +48,26 @@
   set incln
 endif
+if( "$1" == "-minc" ) then
+  set mincname = ( $2 )
+  shift
+endif
 if( "$1" == "-extp" ) then
   set extpath = ( $extpath $2 )
   shift
 endif
-if( "$1" == "-minc" ) then
-  set mincname = ( $2 )
+if( "$1" == "-extip" ) then
+  set extpathinc = ( $extpathinc $2 )
+  shift
+endif
+if( "$1" == "-extlp" ) then
+  set extpathlib = ( $extpathlib $2 )
+  shift
+endif
+if( "$1" == "-noext" ) then
+  set i = 0
+  while ( $i < $#EXTCURNAME )
+    @ i += 1
+    if( "$2" == "$EXTCURNAME[$i]" ) set SOPEXTOK[$i] = 0
+  end
   shift
 endif
@@ -53,5 +76,7 @@
 end
 
-# Verification generale
+
+#----------------------------------------------------------------------
+#### Verification generale
 if( ! $?SOPHYABASE ) then
   echo ERROR: define SOPHYABASE or use script arguments
@@ -70,4 +95,5 @@
   exit -2
 endif
+rm -f $TMPDIR/tmp_test
 if( ! $?mincname ) then
   set mincname = `uname`_${SOPHYACXX}_make.inc
@@ -81,6 +107,8 @@
   exit -2
 endif
-
-# creation des variables chemins sophya core
+echo SOPEXTOK: $SOPEXTOK
+
+#----------------------------------------------------------------------
+#### creation des variables chemins sophya core
 echo " "
 echo ">>>>>> 1/ Creating directory tree under $SOPHYABASE  "
@@ -108,5 +136,7 @@
 end
 
-# Fichier confinfo - log e configure
+
+#----------------------------------------------------------------------
+#### Fichier confinfo - log e configure
 set conflog = $sconf/conf.log
 rm -f $conflog ; touch $conflog 
@@ -116,34 +146,44 @@
 rm -f $inclistf ; touch $inclistf
 
-# liens ou copie des *.h
+
+#----------------------------------------------------------------------
+#### liens ou copie des *.h
 echo " "
 echo ">>>>>> 2/ Copying include files to $sinc "
-pushd ../  > /dev/null
+cd ../  > /dev/null
 set srcd = `pwd`
+set cpln = "cp -p "
+if( $?incln ) set cpln = "ln -s -f  "
 foreach d ( $SOPMOD $SOPEXT $SOPPI )
-  if ( -d $d ) then
+  if ( -d $srcd/$d ) then
     echo Copying include files for module $d
-    pushd $d > /dev/null
-###CMV a faire: virer le .H de $file si .h dans excludeinc du module
+    cd $srcd/$d;
     set file = ( *.h )
-    if( $?incln ) then
-      pushd $sinc > /dev/null
-####CMV-Reza Ne pas faire ???      rm -f $file
-      ln -s -f $srcd/$d/*.h ./ 
-      popd > /dev/null
-    else
-####CMV-Reza      pushd $sinc > /dev/null
-####CMV-Reza Ne pas faire ???       rm -f $file
-####CMV-Reza       popd > /dev/null
-      cp -p $file $sinc/.
+    cd $sinc;  if( $status == 0 ) rm -f $file
+    # on vire le .h de $file si .h dans excludeinc du module
+    cd $srcd/$d
+    if( -e excludeinc ) then
+      if( `cat excludeinc | wc -l` > 0 ) then
+        set file
+        foreach f ( *.h )
+          grep "$f" excludeinc > /dev/null
+          if( $status != 0 ) set file = ( $file $f )
+        end
+      endif
+    endif
+    # on copie ou link dans $sinc
+    if( `echo $file | wc -w` > 0 ) then
+      foreach f ( $file )
+        $cpln $srcd/$d/$f  $sinc/$f
+      end
     endif
     echo $file >> $inclistf
-    popd > /dev/null
-  endif
-end
-popd > /dev/null
-
-
-# lien  des .h des librairies externes
+  endif
+end
+cd $srcd/BuildMgr/.
+
+
+#----------------------------------------------------------------------
+#### lien  des .h des librairies externes
 echo " "
 echo ">>>>>> 3/  Include files for external libraries "
@@ -157,5 +197,5 @@
   if( -d ../$SOPEXT[$i] ) then
     echo "Searching include file for $SOPEXT[$i] ..."
-    foreach d ( $extpath $defextinc )
+    foreach d ( $extpathinc $extpath $defextinc )
       set duminc = `find $d -name $nom -print | head -1 `
       set dumrep = $duminc:h
@@ -175,5 +215,7 @@
 end
 
-# liens des librairies externes
+
+#----------------------------------------------------------------------
+#### liens des librairies externes
 echo " "
 echo ">>>>>> 4/  External libraries "
@@ -189,5 +231,5 @@
   if( -d ../$SOPEXT[$i] ) then
     echo "Searching libraries path for $SOPEXT[$i] ..."
-    foreach d ( $extpath $defextlib )
+    foreach d ( $extpathlib $extpath $defextlib )
       set dumlib = `find $d -name $nom -print | head -1 `
       if ( "$dumlib" != "" ) then
@@ -206,10 +248,14 @@
 echo extlibpath= $extlibpath
 echo extliblib= $extliblib
-
-# Generation de sophyamake.inc
-#  On le cree dans le repertoire temporarire d'abord 
+rm -f $fpath
+
+
+#----------------------------------------------------------------------
+#### Generation de sophyamake.inc
+#  On le cree dans le repertoire temporaire d'abord 
 set mfile = $sinc/sophyamake.inc
-echo " "
-echo ">>>>>> 5/  Creating $mfile "
+rm -f $mfile
+echo " "
+echo ">>>>>> 5/  Creating $mfile from $mincname "
 echo "# -----------------------------------------------" > $mfile
 echo "#  File make.inc - generated by SOPHYA configure" >> $mfile
@@ -235,7 +281,10 @@
 cat $mincname >> $mfile  
 
+rm -f $mfile:t
 ln -s $mfile $mfile:t
 
-# Copie de machdefs.h
+
+#----------------------------------------------------------------------
+#### Copie de machdefs.h
 set mdefname = $TMPDIR/machdefs.h
 echo " "
@@ -252,7 +301,16 @@
 echo "#endif" >> $mdefname
 echo "/* #define SO_BOUNDCHECKING 1 */" >> $mdefname
+
 echo " " >> $mdefname 
-
-grep -v MACHDEFS_SEEN ../BaseTools/machdefs_mkmf.h >> $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 
+grep -v -e '#ifndef *MACHDEFS_SEEN' -e '#define *MACHDEFS_SEEN' ../BaseTools/machdefs_mkmf.h >> $mdefname
 #  On ne copie que si machdefs.h est different 
 if (-e $sinc/machdefs.h ) then 
@@ -268,11 +326,14 @@
   echo " file $sinc/machdefs.h created"    
 endif
-
-
+rm -f $mdefname
+
+
+#----------------------------------------------------------------------
+#### Creation des fichiers contenant les listes d'objets et d'includes
 echo " "
 echo ">>>>>> 7/  Creating object list files for shared library creation "
 set objlistname = $sconf/libsophya.objlist
 echo " 7.a/ Creating $objlistname "
-rm -rf $objlistname ; touch $objlistname
+rm -f $objlistname ; touch $objlistname
 foreach d ( $SOPMOD ) 
   if ( -d ../$d ) then 
@@ -283,5 +344,5 @@
 set objlistname = $sconf/libextsophya.objlist
 echo " 7.b/ Creating $objlistname "
-rm -rf $objlistname ; touch $objlistname
+rm -f $objlistname ; touch $objlistname
 foreach d ( $SOPEXT ) 
   if ( -d ../$d ) then 
@@ -292,5 +353,5 @@
 set objlistname = $sconf/libPI.objlist
 echo " 7.c/ Creating $objlistname "
-rm -rf $objlistname ; touch $objlistname
+rm -f $objlistname ; touch $objlistname
 foreach d ($SOPPI )
   if ( -d ../$d ) then 
@@ -298,2 +359,6 @@
   endif
 end
+
+
+#----------------------------------------------------------------------
+exit 0
