Index: /tags/NewMgr_V0/SophyaLib/BuildMgr/Darwin_g++_make.inc
===================================================================
--- /tags/NewMgr_V0/SophyaLib/BuildMgr/Darwin_g++_make.inc	(revision 2721)
+++ /tags/NewMgr_V0/SophyaLib/BuildMgr/Darwin_g++_make.inc	(revision 2721)
@@ -0,0 +1,44 @@
+# --------- File Darwin_g++_make.inc -------- 
+
+#  Liste des librariries externes 
+SOPEXTLIBS = $(SOPEXTLIBP) $(SOPEXTLIBLIST) -framework Accelerate
+
+#  Chemin et librairie pour PI 
+PIINC = -I/usr/include/X11R6 -I/sw/include
+PILIBS = -L/sw/lib -lXm -L/usr/X11R6/lib  -lXt -lX11 
+
+
+#  Flag preprocesseur
+CPPFLAGS = -DDarwin -I$(SOPHYAINCP)  $(PIINC)
+#  Def compilateur C et flags
+CC = cc
+CFLAGS = -fno-common -g -fastf -mtune=G4 -fPIC
+#  Def compilateur C++ et flags
+CXX =  c++
+CXXFLAGS = -fno-common -g -fastf -mtune=G4 -fPIC 
+#  Compilo fortran
+FC = f77
+FFLAGS =  
+# Pour fabriquer les lib .a
+AR = libtool 
+ARFLAGS = -static -o 
+
+
+#  Ordres de compilation
+CCOMPILE = $(CC) $(CPPFLAGS) $(CFLAGS) -c 
+CXXCOMPILE = $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c 
+
+#  Fabrication de librairies partagees 
+CMDSHLCXX = $(CXX) $(CXXFLAGS) -dynamiclib 
+
+
+#  Liste de librairie de base, necessaire pour libsophya
+SOPBASELIBS = -lpthread -lm -lc -ldl 
+
+# --- Chemin pour l'ensemble les librairies SOPHYA , +ExtLibs, +PI
+SOPHYASLBLIST = -L$(SOPHYASLBP) -lsophya  $(SOPBASELIBS)
+SOPHYAEXTSLBLIST = -L$(SOPHYASLBP) -lextsophya -lsophya $(SOPEXTLIBS) $(SOPBASELIBS)
+SOPHYAALLSLBLIST = -L$(SOPHYASLBP) -lPI -lextsophya -lsophya $(PILIBS) $(SOPEXTLIBS) $(SOPBASELIBS)
+
+#  Commande de link pour creation d'executables
+CXXLINK = $(CXX) $(CXXFLAGS) -bind_at_load
Index: /tags/NewMgr_V0/SophyaLib/BuildMgr/Linux_g++_make.inc
===================================================================
--- /tags/NewMgr_V0/SophyaLib/BuildMgr/Linux_g++_make.inc	(revision 2721)
+++ /tags/NewMgr_V0/SophyaLib/BuildMgr/Linux_g++_make.inc	(revision 2721)
@@ -0,0 +1,45 @@
+# --------- File Linux_g_make.inc -------- 
+
+#  Liste des librariries externes 
+SOPEXTLIBS = $(SOPEXTLIBP) $(SOPEXTLIBLIST) -lg2c
+
+#  Chemin et librairie pour PI 
+PIINC = -I/usr/X11R6/include/
+PILIBS = -L/usr/X11R6/lib/ -lXm -lXt -lX11 
+
+
+#  Flag preprocesseur
+CPPFLAGS = -DLinux -I$(SOPHYAINCP) -I$(SOPEXTINCP) $(SOPEXTINC) $(PIINC)
+#  Def compilateur C et flags
+CC = gcc
+CFLAGS = -Wall -Wpointer-arith -Wmissing-prototypes -O -g
+#  Def compilateur C++ et flags
+CXX =  g++
+CXXFLAGS = -Wall -Wpointer-arith -Wmissing-prototypes -Wsynth -O -g
+#  Compilo fortran
+FC = g77
+FFLAGS =  
+# Pour fabriquer les lib .a
+AR = ar
+ARFLAGS = -rcs
+
+
+#  Ordres de compilation
+CCOMPILE = $(CC) $(CPPFLAGS) $(CFLAGS) -c 
+CXXCOMPILE = $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c 
+
+#  Extension de nom pour les librairies partagees
+SLEXT = so
+#  Fabrication de librairies partagees 
+CMDSHLCXX = $(CXX) -shared 
+
+
+#  Liste de librairie de base, necessaire pour libsophya
+SOPBASELIBS = -lpthread -lm -lc -ldl 
+
+# --- Chemin pour l'ensemble les librairies SOPHYA , +ExtLibs, +PI
+SOPHYASLBLIST = -L$(SOPHYASLBP) -lsophya  $(SOPBASELIBS)
+SOPHYAEXTSLBLIST = -L$(SOPHYASLBP) -lextsophya -lsophya $(SOPEXTLIBS) $(SOPBASELIBS)
+SOPHYAALLSLBLIST = -L$(SOPHYASLBP) -lPI -lextsophya -lsophya $(PILIBS) $(SOPEXTLIBS) $(SOPBASELIBS)
+
+CXXLINK = $(CXX) $(CXXFLAGS)
Index: /tags/NewMgr_V0/SophyaLib/BuildMgr/Makefile
===================================================================
--- /tags/NewMgr_V0/SophyaLib/BuildMgr/Makefile	(revision 2721)
+++ /tags/NewMgr_V0/SophyaLib/BuildMgr/Makefile	(revision 2721)
@@ -0,0 +1,84 @@
+include sophyamake.inc
+
+defaut: libs
+
+all: libs extlibs PI
+
+libs: cxxlibs
+	echo '*DBG* Building libs'
+
+extlibs : cxxextlibs
+
+
+
+cxxlibs:: 
+	if [ -d ../BaseTools ] ; then cd  ../BaseTools ; $(MAKE) ; fi
+	if [ -d ../SysTools ] ; then cd  ../SysTools ; $(MAKE) ; fi
+	if [ -d ../SUtils ] ; then cd  ../SUtils ; $(MAKE) ; fi
+	if [ -d ../TArray ] ; then cd  ../TArray ; $(MAKE) ; fi
+	if [ -d ../NTools ] ; then cd  ../NTools ; $(MAKE) ; fi
+	if [ -d ../HiStats ] ; then cd  ../HiStats ; $(MAKE) ; fi
+	if [ -d ../SkyMap ] ; then cd  ../SkyMap ; $(MAKE) ; fi
+	if [ -d ../Samba ] ; then cd  ../Samba ; $(MAKE) ; fi
+	if [ -d ../SkyT ] ; then cd  ../SkyT ; $(MAKE) ; fi
+
+cxxextlibs::  
+	if [ -d ../FitsIOServer ] ; then cd  ../FitsIOServer ; $(MAKE) ; fi
+	if [ -d ../IFFTW ] ; then cd  ../IFFTW ; $(MAKE) ; fi
+	if [ -d ../LinAlg ] ; then cd  ../LinAlg ; $(MAKE) ; fi
+	if [ -d ../XAstroPack ] ; then cd  XAstroPack ; $(MAKE) ; fi
+ 
+PI::
+	if [ -d ../PI ] ; then cd ../PI ; $(MAKE) ; fi
+	if [ -d ../PIGcont ] ; then cd ../PIGcont ; $(MAKE) ; fi
+	if [ -d ../PIext ] ; then cd ../PIext ; $(MAKE) ; fi
+
+#  Shared library creation part of the Makefile
+ 
+#  List of libraries (.a)
+PSLB =  $(SOPHYALIBP)libBaseTools.a $(SOPHYALIBP)libSysTools.a $(SOPHYALIBP)libSUtils.a $(SOPHYALIBP)libTArray.a $(SOPHYALIBP)libNTools.a $(SOPHYALIBP)libHiStats.a $(SOPHYALIBP)libSkyMap.a $(SOPHYALIBP)libSamba.a $(SOPHYALIBP)libSkyT.a
+EXTPSLB =  $(SOPHYALIBP)libFitsIOServer.a $(SOPHYALIBP)libIFFTW.a $(SOPHYALIBP)libLinAlg.a $(SOPHYALIBP)libXAstroPack.a
+EXTPSLB =  $(SOPHYALIBP)libFitsIOServer.a $(SOPHYALIBP)libIFFTW.a $(SOPHYALIBP)libLinAlg.a 
+PIPSLB =  $(SOPHYALIBP)libPI.a $(SOPHYALIBP)libPIGcont.a $(SOPHYALIBP)libPIext.a
+
+
+#  main dependence list
+slball : slb slbext slbpi 
+slb : $(SOPHYASLBP)libsophya.$(SLEXT)
+slbext : $(SOPHYASLBP)libextsophya.$(SLEXT)    
+slbpi : $(SOPHYASLBP)libPI.$(SLEXT)
+ 
+# List of .o files for SOPHYA  module
+ALLOBJSF = $(SOPHYAINCP)/SophyaConfInfo/libsophya.objlist
+ 
+# List of .o files modules with reference to external libraries
+ALLEXTOBJSF = $(SOPHYAINCP)/SophyaConfInfo/libextsophya.objlist
+
+# List of .o files for PI modules 
+ALLPIOBJSF = $(SOPHYAINCP)/SophyaConfInfo/libPI.objlist
+ 
+# Building Sophya shared library
+$(SOPHYASLBP)libsophya.$(SLEXT) : $(PSLB)
+	echo `cat $(ALLOBJSF)` ; \
+	cd  $(SOPHYAOBJP); \
+	$(CMDSHLCXX) -o $@  `cat $(ALLOBJSF) ` $(SOPBASELIBS)
+ 
+# Building ExtSophya shared library
+$(SOPHYASLBP)libextsophya.$(SLEXT) : $(EXTPSLB)
+	echo `cat $(ALLEXTOBJSF)` ; \
+	cd  $(SOPHYAOBJP); \
+	$(CMDSHLCXX) -o $@  `cat $(ALLEXTOBJSF) ` \
+	$(SOPHYASLBLIST) $(SOPEXTLIBS)
+
+# Building PI shared library
+$(SOPHYASLBP)libPI.$(SLEXT) : $(PIPSLB)
+	echo `cat $(ALLPIOBJSF)` ; \
+	cd  $(SOPHYAOBJP); \
+	$(CMDSHLCXX) -o $@ `cat $(ALLPIOBJSF) ` \
+	$(SOPHYAEXTSLBLIST) $(PILIBS)
+
+clean:
+	if [ -d $(SOPHYALIBP) ] ; then cd $(SOPHYALIBP)/. ; rm -f *.a  ; fi
+	if [ -d $(SOPHYASLBP) ] ; then cd $(SOPHYASLBP)/. ; rm -f *.so ; fi
+	if [ -d $(SOPHYAOBJP) ] ; then cd $(SOPHYAOBJP)/. ; rm -f *.o  rm -rf cxxrep* ; fi
+
Index: /tags/NewMgr_V0/SophyaLib/BuildMgr/OSF1_cxx_make.inc
===================================================================
--- /tags/NewMgr_V0/SophyaLib/BuildMgr/OSF1_cxx_make.inc	(revision 2721)
+++ /tags/NewMgr_V0/SophyaLib/BuildMgr/OSF1_cxx_make.inc	(revision 2721)
@@ -0,0 +1,45 @@
+# --------- File OSF1_cxx_make.inc -------- 
+
+#  Liste des librariries externes 
+SOPEXTLIBS = $(SOPEXTLIBP) $(SOPEXTLIBLIST) -lcxml -lfor
+
+#  Chemin et librairie pour PI 
+PIINC = 
+PILIBS = -lXm -lXt -lX11 
+
+
+#  Flag preprocesseur
+CPPFLAGS = -DOSF1 -I$(SOPHYAINCP)  $(PIINC)
+#  Def compilateur C et flags
+CC = cc
+CFLAGS = -O -pthread -g1 
+#  Def compilateur C++ et flags
+CXX =  cxx
+CXXFLAGS = -O -pthread -g1  -ptr $(SOPHYAOBJP)/cxxrep/ -no_implicit_include
+#  Compilo fortran
+FC = f77
+FFLAGS =  
+# Pour fabriquer les lib .a
+AR = ar
+ARFLAGS = -rcs
+
+
+#  Ordres de compilation
+CCOMPILE = $(CC) $(CPPFLAGS) $(CFLAGS) -c 
+CXXCOMPILE = $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c 
+
+#  Extension de nom pour les librairies partagees
+SLEXT = so
+#  Fabrication de librairies partagees 
+CMDSHLCXX = $(CXX) $(CXXFLAGS) -shared 
+
+
+#  Liste de librairie de base, necessaire pour libsophya
+SOPBASELIBS = -lpthread -lm 
+
+# --- Chemin pour l'ensemble les librairies SOPHYA , +ExtLibs, +PI
+SOPHYASLBLIST = -L$(SOPHYASLBP) -lsophya  $(SOPBASELIBS)
+SOPHYAEXTSLBLIST = -L$(SOPHYASLBP) -lextsophya -lsophya $(SOPEXTLIBS) $(SOPBASELIBS)
+SOPHYAALLSLBLIST = -L$(SOPHYASLBP) -lPI -lextsophya -lsophya $(PILIBS) $(SOPEXTLIBS) $(SOPBASELIBS)
+
+CXXLINK = $(CXX) $(CXXFLAGS)
Index: /tags/NewMgr_V0/SophyaLib/BuildMgr/README
===================================================================
--- /tags/NewMgr_V0/SophyaLib/BuildMgr/README	(revision 2721)
+++ /tags/NewMgr_V0/SophyaLib/BuildMgr/README	(revision 2721)
@@ -0,0 +1,16 @@
+### README file for SOPHYA Build scripts (BuildMgr) ####
+1/ configure : c-shell script configuration 
+   ./configure -sbase /tmp/sbase/ -scxx cxx -extp /usr/local/extlibs
+
+2/ mkmflib : c-shell script for creation of library module Makefile / smakefile
+   ./mkmflib -sbase /tmp/sbase SUtils
+
+3/ domkmf : c-shell script : calls mkmflib for all modules 
+   ./domkmf -sbase /tmp/sbase
+
+4/ Makefile : Top level makefile for library modules 
+
+5/ Configuration files :
+   - Linux_g++_make.inc : Linux with g++ compiler 
+   - OSF1_cxx_make.inc : (HP/Compaq/Digital Tru64 with native cxx compiler)
+   - Darwin_g++_make.inc : (Apple/MacOSX with the native GNU compiler) 
Index: /tags/NewMgr_V0/SophyaLib/BuildMgr/configure
===================================================================
--- /tags/NewMgr_V0/SophyaLib/BuildMgr/configure	(revision 2721)
+++ /tags/NewMgr_V0/SophyaLib/BuildMgr/configure	(revision 2721)
@@ -0,0 +1,299 @@
+#!/bin/csh
+#  SOPHYA configuration managment script 
+#  C. Magneville / R. Ansari   -      Mai 2005
+# Exemple: ./configure -sbase /laltmp/ansari/sbase/ -scxx cxx -extp /exp/planck/ExtLibs/Include/ \
+#              -extp /exp/planck/ExtLibs/OSF1-cxx/
+
+# 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 defextinc = ( ~ /usr/include /usr/local/include )
+set defextlib = ( ~ /usr/lib /usr/local/lib )
+
+set cmdline = "$0 $*" 
+# Decodage arguments
+set extpath
+unset incln
+unset mincname
+while ( $#argv > 0 )
+
+if( "$1" == "-h" ) then
+  echo 'configure [-sbase SOPHYABASE] [-scxx SOPHYACXX] [-incln] '
+  echo '          [-extp dir1 -extp dir2 ...] [-minc mymake.inc]'
+  exit -1
+endif
+if( "$1" == "-sbase" ) then
+  setenv SOPHYABASE $2
+  shift
+endif
+if( "$1" == "-scxx" ) then
+  setenv SOPHYACXX $2
+  shift
+endif
+if( "$1" == "-incln" ) then
+  set incln
+endif
+if( "$1" == "-extp" ) then
+  set extpath = ( $extpath $2 )
+  shift
+endif
+if( "$1" == "-minc" ) then
+  set mincname = ( $2 )
+  shift
+endif
+
+shift
+end
+
+# Verification generale
+if( ! $?SOPHYABASE ) then
+  echo ERROR: define SOPHYABASE or use script arguments
+  exit -2
+endif
+if( ! $?SOPHYACXX ) then
+  echo ERROR: define SOPHYACXX or use script arguments
+  echo "   SOPHYACXX define the name of the C++ compiler (ex: g++ cxx ...)"
+  exit -2
+endif
+if( ! $?TMPDIR ) setenv TMPDIR /tmp
+touch $TMPDIR/tmp_test
+if( $status != 0 ) then
+  echo ERROR: no write acces in temporary directory: $TMPDIR
+  echo '----> define TMPDIR environment variable: "setenv TMPDIR ..."'
+  exit -2
+endif
+if( ! $?mincname ) then
+  set mincname = `uname`_${SOPHYACXX}_make.inc
+endif
+if( ! -e $mincname ) then
+  echo ERROR: file $mincname NOT found
+  exit -2
+endif
+if( ! -e ../BaseTools/machdefs_mkmf.h ) then
+  echo ERROR: file machdefs_mkmf.h NOT found in BaseTools
+  exit -2
+endif
+
+# creation des variables chemins sophya core
+echo " "
+echo ">>>>>> 1/ Creating directory tree under $SOPHYABASE  "
+set sinc = $SOPHYABASE/include
+set slib = $SOPHYABASE/lib
+set sslb = $SOPHYABASE/slb
+set sobj = $SOPHYABASE/obj
+set sexe = $SOPHYABASE/exe
+set sconf = $sinc/SophyaConfInfo
+foreach d ( $sinc $slib $sslb $sobj $sexe $sconf )
+  if( ! -d $d ) then
+    mkdir $d
+    if( $status ) then
+      echo ERROR: creation of $d failed
+      exit -3
+    endif
+    echo Directory $d created
+  endif
+  touch $d/tmp_test
+  if( $status ) then
+    echo ERROR: no write acces to $d
+    exit -4
+  endif
+  rm -f $d/tmp_test
+end
+
+# Fichier confinfo - log e configure
+set conflog = $sconf/conf.log
+rm -f $conflog ; touch $conflog 
+echo ' --- Log of SOPHYA configure script - Date= ' `date` >> $conflog
+echo "$cmdline"  >> $conflog
+set inclistf = $sconf/include.list
+rm -f $inclistf ; touch $inclistf
+
+# liens ou copie des *.h
+echo " "
+echo ">>>>>> 2/ Copying include files to $sinc "
+pushd ../  > /dev/null
+set srcd = `pwd`
+foreach d ( $SOPMOD $SOPEXT $SOPPI )
+  if ( -d $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
+    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/.
+    endif
+    echo $file >> $inclistf
+    popd > /dev/null
+  endif
+end
+popd > /dev/null
+
+
+# lien  des .h des librairies externes
+echo " "
+echo ">>>>>> 3/  Include files for external libraries "
+set i = 0
+while ( $i < $#SOPEXT )
+  @ i += 1
+  if( "$EXTINCNAME[$i]" == "PASDEINC" ) continue
+  if( $SOPEXTOK[$i] <= 0 ) continue
+  set nom = $EXTINCNAME[$i]:t
+  set rac = $EXTINCNAME[$i]:h
+  if( -d ../$SOPEXT[$i] ) then
+    echo "Searching include file for $SOPEXT[$i] ..."
+    foreach d ( $extpath $defextinc )
+      set duminc = `find $d -name $nom -print | head -1 `
+      set dumrep = $duminc:h
+      if ( "$dumrep" != "" ) then
+        rm -f $sinc/$rac
+        ln -f -s $dumrep $sinc/$rac
+        echo Includes for $SOPEXT[$i] found in $dumrep
+        break
+      endif
+    end
+    if ( "$dumrep" == "" ) then
+      echo WARNING: Includes for $SOPEXT[$i] NOT found
+      echo "    Compilation of module  $SOPEXT[$i] disabled"
+      set SOPEXTOK[$i] = 0
+    endif
+  endif
+end
+
+# liens des librairies externes
+echo " "
+echo ">>>>>> 4/  External libraries "
+set fpath = $TMPDIR/fpath
+rm -f $fpath; touch $fpath
+set extliblib
+set i = 0
+while ( $i < $#SOPEXT )
+  @ i += 1
+  if( "$EXTLIBNAME[$i]" == "PASDELIB" ) continue
+  if( $SOPEXTOK[$i] <= 0 ) continue
+  set nom = $EXTLIBNAME[$i]
+  if( -d ../$SOPEXT[$i] ) then
+    echo "Searching libraries path for $SOPEXT[$i] ..."
+    foreach d ( $extpath $defextlib )
+      set dumlib = `find $d -name $nom -print | head -1 `
+      if ( "$dumlib" != "" ) then
+        echo "-L$dumlib:h" >> $fpath
+        set extliblib = ( $extliblib $ALLEXTLIBS[$i] )
+        break
+      endif
+    end
+    if ( "$dumlib" == "" ) then
+      echo WARNING: Libraries for $SOPEXT[$i] NOT found
+      echo "    Check the generated make.inc file"
+    endif
+  endif
+end
+set extlibpath = `cat $fpath | sort -u`
+echo extlibpath= $extlibpath
+echo extliblib= $extliblib
+
+# Generation de sophyamake.inc
+#  On le cree dans le repertoire temporarire d'abord 
+set mfile = $sinc/sophyamake.inc
+echo " "
+echo ">>>>>> 5/  Creating $mfile "
+echo "# -----------------------------------------------" > $mfile
+echo "#  File make.inc - generated by SOPHYA configure" >> $mfile
+echo "#  Date" `date` >> $mfile 
+echo "#  Seed file : $mincname " >> $mfile 
+echo "# -----------------------------------------------" >> $mfile
+echo " " >> $mfile 
+echo "# SOPHYA Base installation directory " >> $mfile 
+echo "SOPHYABASE = $SOPHYABASE" >> $mfile
+echo " " >> $mfile 
+echo 'SOPHYAINCP = $(SOPHYABASE)/include/' >> $mfile
+echo 'SOPHYAOBJP = $(SOPHYABASE)/obj/' >> $mfile
+echo 'SOPHYALIBP = $(SOPHYABASE)/lib/' >> $mfile
+echo 'SOPHYASLBP = $(SOPHYABASE)/slb/' >> $mfile
+echo 'SOPHYAEXEP = $(SOPHYABASE)/exe/' >> $mfile
+
+echo " " >> $mfile 
+echo "# External libraries PATH  " >> $mfile
+echo "SOPEXTLIBP = $extlibpath"  >> $mfile
+echo "SOPEXTLIBLIST = $extliblib" >> $mfile
+
+echo " " >> $mfile 
+cat $mincname >> $mfile  
+
+ln -s $mfile $mfile:t
+
+# Copie de machdefs.h
+set mdefname = $TMPDIR/machdefs.h
+echo " "
+echo ">>>>>> 6/  Creating  machdefs.h from BaseTools/machdefs_mkmf.h"
+rm -f $mdefname; touch $mdefname
+echo "/*** machdefs.h generated by SOPHYA configure ***/" >> $mdefname
+echo "#ifndef MACHDEFS_SEEN" >> $mdefname
+echo "#define MACHDEFS_SEEN" >> $mdefname
+echo "/*------ Code generation switch ---- */" >> $mdefname
+echo "/*   System selector (uname) */" >> $mdefname
+set sname = `uname`
+echo "#ifndef $sname" >> $mdefname
+echo "#define $sname 1 "  >> $mdefname
+echo "#endif" >> $mdefname
+echo "/* #define SO_BOUNDCHECKING 1 */" >> $mdefname
+echo " " >> $mdefname 
+
+grep -v MACHDEFS_SEEN ../BaseTools/machdefs_mkmf.h >> $mdefname
+#  On ne copie que si machdefs.h est different 
+if (-e $sinc/machdefs.h ) then 
+  diff $mdefname $sinc/machdefs.h >& /dev/null
+  if ($status != 0) then 
+    cp -f -p $mdefname $sinc/machdefs.h 
+    echo " file $sinc/machdefs.h changed -> replaced"    
+  else 
+    echo " file $sinc/machdefs.h has not changed -> kept"
+  endif
+else
+  cp -f -p $mdefname $sinc/machdefs.h  
+  echo " file $sinc/machdefs.h created"    
+endif
+
+
+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
+foreach d ( $SOPMOD ) 
+  if ( -d ../$d ) then 
+    cat ../$d/objlist.list >> $objlistname
+  endif
+end
+
+set objlistname = $sconf/libextsophya.objlist
+echo " 7.b/ Creating $objlistname "
+rm -rf $objlistname ; touch $objlistname
+foreach d ( $SOPEXT ) 
+  if ( -d ../$d ) then 
+    cat ../$d/objlist.list >> $objlistname
+  endif
+end
+
+set objlistname = $sconf/libPI.objlist
+echo " 7.c/ Creating $objlistname "
+rm -rf $objlistname ; touch $objlistname
+foreach d ($SOPPI )
+  if ( -d ../$d ) then 
+    cat ../$d/objlist.list >> $objlistname
+  endif
+end
Index: /tags/NewMgr_V0/SophyaLib/BuildMgr/domkmf
===================================================================
--- /tags/NewMgr_V0/SophyaLib/BuildMgr/domkmf	(revision 2721)
+++ /tags/NewMgr_V0/SophyaLib/BuildMgr/domkmf	(revision 2721)
@@ -0,0 +1,24 @@
+#!/bin/csh
+#  Script pour enchainer la fabrication des makefiles SOPHYA
+#  Mettre les options de mkmflib comme argument
+
+# ---- Pour debugger
+# set DO = 'echo'
+set DO = ''
+
+echo " ==== Creation nmakefile pour pour les modules SOPHYA ====" 
+foreach f ( BaseTools SysTools SUtils TArray NTools HiStats SkyMap Samba SkyT )
+  set cmd = "./mkmflib $* $f" 
+  $DO $cmd 
+end
+echo " ==== Creation nmakefile pour pour les modules EXTLIBS_SOPHYA ====" 
+foreach f ( FitsIOServer IFFTW LinAlg )
+  set cmd = "./mkmflib $* $f" 
+  $DO $cmd 
+end
+echo " ==== Creation nmakefile pour pour les modules PI ====" 
+foreach f ( PI PIGcont PIext )
+  set cmd = "./mkmflib $* $f" 
+  $DO $cmd 
+end
+
Index: /tags/NewMgr_V0/SophyaLib/BuildMgr/mkmflib
===================================================================
--- /tags/NewMgr_V0/SophyaLib/BuildMgr/mkmflib	(revision 2721)
+++ /tags/NewMgr_V0/SophyaLib/BuildMgr/mkmflib	(revision 2721)
@@ -0,0 +1,134 @@
+#!/bin/csh 
+#  Script de generation des Makefile/smakefile pour modules
+#  librairies SOPHYA  
+#  C. Magneville / R. Ansari - Mai 2005
+
+if ( $#argv < 1) then 
+  echo ' Usage: mkmflib [-dev] [-sbase SOPHYABASE] ModuleName '
+  exit -1
+endif
+
+#  Option controlant la generation des smakefile OU Makefile
+#  smakefile utilise pour le developpement - contient une reference 
+#  a $(SOPHYABASE)/include/sophyamake.inc
+#  les Makefile reference ../BuildMgr/sophyamake.inc
+
+set makname = "Makefile"
+unset targetdir 
+
+while ( $#argv > 0 )
+  if( "$1" == "-h" ) then
+    echo ' Usage: mkmflib [-dev] [-sbase SOPHYABASE] ModuleName '
+    exit -1
+  else if ( "$1" == "-dev" ) then 
+   set makname = "smakefile"
+  else if( "$1" == "-sbase" ) then
+    setenv SOPHYABASE $2
+    shift
+  else 
+    set targetdir = $1
+  endif
+  shift
+end
+
+if( ! $?SOPHYABASE ) then
+  echo 'ERROR: (mkmflib) define SOPHYABASE or use script arguments'
+  exit -2
+endif
+
+if( ! $?targetdir ) then
+  echo 'ERROR: (mkmflib) No target module (directory) specified'
+  exit -3
+endif
+
+cd ../$targetdir
+
+if ( ! -f exclude ) touch exclude
+if ( ! -f flags_compil ) touch flags_compil
+if ( ! -f extlib_list ) touch extlib_list
+if ( ! -f extslb_list ) touch extslb_list
+
+if ( ! $?TMPDIR ) set TMPDIR = /tmp
+if (-f exclude_dpc ) then 
+#  CHECK !!! qque chose a faire ...
+#  On utilise alors le fichier exclude_dpc
+  echo ' DBG - utilisation du fichier exclude_dpc pour ' $targetdir
+  sort exclude_dpc >! $TMPDIR/exclude.sort
+  set exclfile = 'exclude_dpc'
+else
+  sort exclude >! $TMPDIR/exclude.sort
+  set exclfile = 'exclude'
+endif
+
+echo "mkmflib: Creating $targetdir/objlist.list , $targetdir/$makname" 
+
+##############################################
+########### fichier de la liste des .o #######
+##############################################
+
+set liblist = objlist.list
+rm -f $liblist
+touch $liblist
+ls -1 *.{c,cc} | comm -3 -1 $TMPDIR/exclude.sort - | sed -e 's/\.cc/.o/' | sed -e 's/\.c/.o/' >> $liblist
+unset liblist
+
+##############################################
+########### Creation de smakefile ##########
+##############################################
+
+set libf='$(SOPHYALIBP)lib'$targetdir'.a'
+
+
+rm -f $makname
+touch $makname
+
+if ($makname == "smakefile") then 
+  echo 'include $(SOPHYABASE)/include/sophyamake.inc' >> $makname 
+else 
+  echo 'include ../BuildMgr/sophyamake.inc' >> $makname 
+endif
+
+echo " " >> $makname
+echo 'all:' $libf  >> $makname 
+echo ' ' >> $makname
+
+echo 'clean:' >> $makname
+set toto='rm -f'
+foreach f (*.cc *.c) 
+  set toto= ( $toto '$(SOPHYAOBJP)'$f:r.o )
+end
+echo '	'$toto >> $makname
+echo '	rm -f '$libf >> $makname
+echo ' ' >> $makname
+
+echo $libf ':' \
+ `ls -1 *.{c,cc} | comm -3 -1 $TMPDIR/exclude.sort - | sed -e 's/\.cc/.o/' | sed -e 's/\.c/.o/' | sed -e 's/^/$(SOPHYAOBJP)/'` >> $makname
+echo '	$(AR) $(ARFLAGS) $@ $? ' >> $makname
+rm -f $TMPDIR/exclude.sort
+
+echo " " >> $makname
+
+set inc = $SOPHYABASE/include
+set nomsys = `uname`
+
+foreach f ( *.cc )
+  grep -q '^'$f'$' $exclfile && continue
+  gcc -MM -D$nomsys -I$inc $f  \
+       | sed -e 's/.*\.o/\$(SOPHYAOBJP)&/'  \
+       | sed -e 's?'$inc/'?$(SOPHYAINCP)?g'  >> $makname
+  echo '	$(CXXCOMPILE) -o $@ $<' >> $makname
+  echo ' ' >> $makname
+end
+
+foreach f ( *.c )
+  grep -q '^'$f'$' $exclfile && continue
+  gcc -MM -D$nomsys -I$inc $f  \
+       | sed -e 's/.*\.o/\$(SOPHYAOBJP)&/'  \
+       | sed -e 's?'$inc/'?$(SOPHYAINCP)?g' >> $makname
+  echo '	$(CCOMPILE) -o $@ $<' >> $makname
+  echo ' ' >> $makname
+end 
+
+
+
+
