Index: trunk/SophyaLib/Mgr/Makefile
===================================================================
--- trunk/SophyaLib/Mgr/Makefile	(revision 755)
+++ trunk/SophyaLib/Mgr/Makefile	(revision 823)
@@ -1,24 +1,44 @@
+# include files defining compiler/linker options 
+MODULECXXREPNAME := PI
 include Mgr/Makefile.h
-LIBF =  $(LIB)libSysTools.a $(LIB)libNTools.a $(LIB)libSamba.a $(LIB)libSkyT.a $(LIB)libFitsIOServer.a
-LIBS = -L$(LIB) -lSysTools -lNTools -lSamba -lSkyT -lFitsIOServer -lm
-LIBG = -L$(GLB) -lstdc++
-ifeq ($(HOSTTYPE), powerpc)
-  LIBG = -L$(GLB)
-endif
+include Mgr/Makefile.slb
+
+LIBF =  $(LIB)libSysTools.a $(LIB)libTArray.a $(LIB)libNTools.a $(LIB)libHiStats.a $(LIB)libSkyMap.a $(LIB)libSamba.a $(LIB)libSkyT.a
+LIBS = -L$(LIB) -lSysTools -lTArray -lNTools -lHiStats -lSkyMap -lSamba -lSkyT
 
 defaut: libs
 
-all: libs PI
-
+all: libs extlibs PI
 
 libs: cxxlibs
-# Dans cet ordre pour les templates de cxx, a cause des dependances
-# pour instantiation automatique/manuels
 
-cxxlibs: FitsIOServer SkyT Samba NTools SysTools Blitz
+extlibs: cxxextlibs
 
-.PHONY:  FitsIOServer
-FitsIOServer:
-	if [ -d FitsIOServer ] ; then cd  FitsIOServer ; $(MAKE) ; fi
+cxxlibs:  SysTools TArray NTools HiStats SkyMap Samba SkyT
+ 
+cxxextlibs:  FitsIOServer IFFTW LinAlg
+.PHONY:  SysTools
+SysTools:
+	if [ -d SysTools ] ; then cd  SysTools ; $(MAKE) ; fi
+ 
+.PHONY:  TArray
+TArray:
+	if [ -d TArray ] ; then cd  TArray ; $(MAKE) ; fi
+ 
+.PHONY:  NTools
+NTools:
+	if [ -d NTools ] ; then cd  NTools ; $(MAKE) ; fi
+ 
+.PHONY:  HiStats
+HiStats:
+	if [ -d HiStats ] ; then cd  HiStats ; $(MAKE) ; fi
+ 
+.PHONY:  SkyMap
+SkyMap:
+	if [ -d SkyMap ] ; then cd  SkyMap ; $(MAKE) ; fi
+ 
+.PHONY:  Samba
+Samba:
+	if [ -d Samba ] ; then cd  Samba ; $(MAKE) ; fi
  
 .PHONY:  SkyT
@@ -26,19 +46,15 @@
 	if [ -d SkyT ] ; then cd  SkyT ; $(MAKE) ; fi
  
-.PHONY:  Samba
-Samba:
-	if [ -d Samba ] ; then cd  Samba ; $(MAKE) ; fi
+.PHONY:  FitsIOServer
+FitsIOServer:
+	if [ -d FitsIOServer ] ; then cd  FitsIOServer ; $(MAKE) ; fi
  
-.PHONY:  NTools
-NTools:
-	if [ -d NTools ] ; then cd  NTools ; $(MAKE) ; fi
+.PHONY:  IFFTW
+IFFTW:
+	if [ -d IFFTW ] ; then cd  IFFTW ; $(MAKE) ; fi
  
-.PHONY:  SysTools
-SysTools:
-	if [ -d SysTools ] ; then cd  SysTools ; $(MAKE) ; fi
- 
-.PHONY:  Blitz
-Blitz:
-	if [ -d Blitz ] ; then cd  Blitz ; $(MAKE) ; fi
+.PHONY:  LinAlg
+LinAlg:
+	if [ -d LinAlg ] ; then cd  LinAlg ; $(MAKE) ; fi
  
 .PHONY: PI
@@ -46,169 +62,71 @@
 	if [ -d PI ] ; then cd PI ; $(MAKE) ; fi
 	if [ -d PIext ] ; then cd PIext ; $(MAKE) ; fi
+#  Shared library creation part of the Makefile
+ 
+#  List of libraries (.a)
+PSLB =  $(LIB)libSysTools.a $(LIB)libTArray.a $(LIB)libNTools.a $(LIB)libHiStats.a $(LIB)libSkyMap.a $(LIB)libSamba.a $(LIB)libSkyT.a
+EXTPSLB =  $(LIB)libFitsIOServer.a $(LIB)libIFFTW.a $(LIB)libLinAlg.a
+PIPSLB =  $(LIB)libPI.a  $(LIB)libPIext.a
+#  List of external library references
+EXTLIB  = -L$(EXTLIBPATH) -lcfitsio -lfftw -lrfftw -llapack -ldxml -lfor
+EXTSLB  = -L$(EXTSLBPATH) -lcfitsio -lfftw -llapack -ldxml -lfor
+XPILIBS = $(LIBXPIPATH) $(LIBXPILIST)
 
-ifndef NOSHLIB
-
-ifdef CFITSIODIR
-PSLB = $(LIB)libSysTools.a $(LIB)libNTools.a $(LIB)libSamba.a $(LIB)libSkyT.a $(LIB)libFitsIOServer.a 
-else
-PSLB = $(LIB)libSysTools.a $(LIB)libNTools.a $(LIB)libSamba.a $(LIB)libSkyT.a
-endif
-slb : $(SLB)libtools.so
-slbpi: slb $(SLB)libPI.so
-
-#  Chemin des librairies Motifs / X11 (pour chemin non standard)
-LIBXPATH :=
-#  Commande de construction de shared-lib 
-CMDSHL := ld -partage
-#  Flag d'inclusion/fin d'inclusion de tous les points  d'entree
-FGSHLA := -tout
-FGSHLN := -rien
-#  Librairies specifiques 
-LIBLSHL := 
-#  Librairie d'instanciation des templates 
-TILSHL := 
-TILSHLPI := 
-#   Commande de construction de la librairie d'instanciation des templates 
-CMDTILSHL := echo 'Cas Non Prevu'
-CMDTILSHLPI := echo 'Cas Non Prevu'
-# Utilisation du compilo C++ comme driver pour fabrication des shared-libs
-CMDSHLCXX := $(LINK.cc) 
-FGSHLACXX :=  
-FGSHLNCXX := 
-#  S'il faut utiliser $(CMDSHLCXX) pour fabrication des shared-libs
-USECXX4SO := N
-# On utilise le compilo g++ pour la fabrication des shared libs
-ifeq ($(EROSCXX), g++)
-  override USECXX4SO := Y
-  override CMDSHLCXX := $(LINK.cc) -shared
-endif
-
-# On utilise le compilo KCC pour la fabrication des shared libs
-ifeq ($(EROSCXX), KCC)
-  override USECXX4SO := Y
-  override CMDSHLCXX := $(LINK.cc)
-endif
-
-# On utilise le compilo aCC (HP) pour la fabrication des shared libs
-ifeq ($(EROSCXX), aCC)
-  override USECXX4SO := Y
-  override CMDSHLCXX := $(LINK.cc) -b
-endif
-
-# Construction de shared-libs sous OSF1
-ifeq ($(MACHEROS),OSF1)
-  override CMDSHL := ld -shared -update_registry $(SLB)so_locations
-  override FGSHLA := -all
-  override FGSHLN := -none 
-  override LIBLSHL := -lcxxstd -lcxx -lexc -lm -lc -lrt
-  override TILSHL := $(LIB)libertcxx.a
-  override CMDTILSHL := rm -f $(LIB)libertcxx.a ; cd $(REP); $(AR) $(ARFLAGS) $(LIB)libertcxx.a *.o
-  override TILSHLPI := $(LIB)libertcxxpi.a
-  override CMDTILSHLPI := rm -f $(LIB)libertcxxpi.a ; cd $(REPPI); $(AR) $(ARFLAGS) $(LIB)libertcxxpi.a *.o
-  ifeq ($(CXX),g++)
-    override LIBLSHL := $(LIBG) -lm -lc
-    override TILSHL := 
-    override CMDTILSHL := echo 'No Template instanciation library'
-    override TILSHLPI := 
-    override CMDTILSHLPI := echo 'No Template instanciation library'
-    override USECXX4SO := N
-  endif
-#  Attention - Dangereux de mettre -expect_unresolved , enleve  Reza 17/11/99
-  override CMDSHLCXX := $(LINK.cc) -shared  
-  override FGSHLACXX := 
-  override FGSHLNCXX := 
-endif
-
-# Construction de shared-libs sous Linux
-ifeq ($(MACHEROS),Linux)
-  override CMDSHL := ld -shared 
-  override FGSHLA := --whole-archive
-  override FGSHLN := --no-whole-archiv
-  override CMDSHLCXX := $(LINK.cc) -shared 
-  ifeq ($(EROSCXX), KCC)
-    override CMDSHLCXX := $(LINK.cc)
-  endif
-  override FGSHLACXX := 
-  override FGSHLNCXX := 
-  override LIBLSHL := $(LIBG) -lm -ldl
-  override TILSHL := 
-  override CMDTILSHL := echo 'No Template instanciation library'
-  override LIBXPATH := -L/usr/X11/lib -L/usr/X11R6/lib
-endif
-
-# Construction de shared-libs sous Sun-OS
-ifeq ($(MACHEROS),SunOS)
-  override CMDSHL := ld -G
-  override FGSHLA := -z allextract
-  override FGSHLN := -z weakextract
-  override LIBLSHL := $(LIBG) -lm -lc
-  override TILSHL := 
-  override CMDTILSHL := echo 'No Template instanciation library'
-  override LIBXPATH := -L/usr/X11/lib
-  override USECXX4SO := Y
-endif
-
-# Construction de shared-libs sous SGI
-ifeq ($(MACHEROS), IRIX64)
-  override CMDSHL := ld -shared
-  override FGSHLA := -all
-  override FGSHLN := -notall
-  override LIBLSHL := $(LIBG) -lm -lc
-  override TILSHL := 
-  override CMDTILSHL := echo 'No Template instanciation library'
-  ifeq ($(EROSCXX), CC)
-    override CMDSHLCXX := CC -shared 
-    override LIBLSHL := -lm -lc
-  endif
-  override LIBXPATH := -L/usr/X11/lib
-  override USECXX4SO := Y
-endif
-
-# Liste des .o associes a une librairie
-OBJSysTools = $(shell echo `cat ./SysTools/objlist.list`)
-OBJNTools = $(shell echo `cat ./NTools/objlist.list`)
-# OBJBlitz = $(shell echo `cat ./Blitz/objlist.list`)
-OBJSamba = $(shell echo `cat ./Samba/objlist.list`)
-OBJSkyT = $(shell echo `cat ./SkyT/objlist.list`)
-OBJFitsIOServer = $(shell echo `cat ./FitsIOServer/objlist.list`)
-OBJPI         = $(shell echo `cat ./PI/objlist.list`)
-OBJPIext      = $(shell echo `cat ./PIext/objlist.list`)
-
-ifdef CFITSIODIR
-AllObjs := $(OBJSysTools) $(OBJNTools) $(OBJSamba) $(OBJSkyT) $(OBJFitsIOServer)
-else
-AllObjs := $(OBJSysTools) $(OBJNTools) $(OBJSamba) $(OBJSkyT) 
-endif
-
-# Creation des librairies partagees
-
-
-#------------------------------------------------------------
-$(SLB)libtools.so : $(PSLB) 
-	$(CMDTILSHL)
-	cd $(OBJ); \
-	$(CMDSHLCXX) -o $(SLB)libtools.so \
-	$(FGSHLACXX) $(AllObjs)  $(TILSHL) \
-	$(FGSHLNCXX) -L$(SLB) $(LIBLSHL)  $(FITSIOLIB) 
-
-
-$(SLB)libPI.so : $(LIB)libPI.a $(LIB)libPIext.a
-	$(CMDTILSHLPI)
-	cd $(OBJ); \
-	$(CMDSHLCXX) -o $(SLB)libPI.so \
-	$(FGSHLACXX) $(OBJPI) $(OBJPIext) $(TILSHLPI) \
-	$(FGSHLN) -L$(SLB) -ltools \
-	$(LIBXPATH) -lXm -lXt -lX11 $(LIBLSHL)
-
-else
-slb :
-endif
-
+#  main dependence list
+slball : slb slbext slbpi 
+slb : $(SLB)libsophya.so 
+slbext : $(SLB)libextsophya.so   
+slbpi : $(SLB)libPI.so
+ 
+# List of .o files for each module
+OBJSysTools = $(shell echo `cat ./SysTools/objlist.list `)
+OBJTArray = $(shell echo `cat ./TArray/objlist.list `)
+OBJNTools = $(shell echo `cat ./NTools/objlist.list `)
+OBJHiStats = $(shell echo `cat ./HiStats/objlist.list `)
+OBJSkyMap = $(shell echo `cat ./SkyMap/objlist.list `)
+OBJSamba = $(shell echo `cat ./Samba/objlist.list `)
+OBJSkyT = $(shell echo `cat ./SkyT/objlist.list `)
+ALLOBJS = $(OBJSysTools) $(OBJTArray) $(OBJNTools) $(OBJHiStats) $(OBJSkyMap) $(OBJSamba) $(OBJSkyT)
+ 
+# List of .o files modules with reference to external libraries
+OBJFitsIOServer = $(shell echo `cat ./FitsIOServer/objlist.list `)
+OBJIFFTW = $(shell echo `cat ./IFFTW/objlist.list `)
+OBJLinAlg = $(shell echo `cat ./LinAlg/objlist.list `)
+ALLEXTOBJS = $(OBJFitsIOServer) $(OBJIFFTW) $(OBJLinAlg)
+ 
+# List of .o files for PI modules 
+OBJPI = $(shell echo `cat ./PI/objlist.list `)
+OBJPIext = $(shell echo `cat ./PIext/objlist.list `)
+ALLPIOBJS = $(OBJPI) $(OBJPIext)
+ 
+# Building Sophya shared library
+$(SLB)libsophya.so : $(PSLB)
+	$(CMDTILSHL) 
+	cd  $(OBJ); \
+	$(CMDSHLCXX) -o $(SLB)libsophya.so  \
+	$(FGSHLACXX) $(ALLOBJS)  $(FGSHLNCXX)\
+	-L$(SLB) $(LIBLSHL)
+ 
+# Building ExtSophya shared library
+$(SLB)libextsophya.so : $(EXTPSLB)
+	$(CMDTILSHL) 
+	cd  $(OBJ); \
+	$(CMDSHLCXX) -o $(SLB)libextsophya.so  \
+	$(FGSHLACXX) $(ALLEXTOBJS)  $(FGSHLNCXX)\
+	-L$(SLB) -lsophya $(EXTLIB) $(LIBLSHL)
+ 
+# Building PI shared library
+$(SLB)libPI.so : $(PIPSLB)
+	$(CMDTILSHL) 
+	cd  $(OBJ); \
+	$(CMDSHLCXX) -o $(SLB)libPI.so  \
+	$(FGSHLACXX) $(ALLPIOBJS) $(FGSHLNCXX) \
+	-L$(SLB) -lsophya -lextsophya $(EXTLIB) $(XPILIBS) $(LIBLSHL)
+ 
 
 clean:
 	if [ -d $(LIB) ] ; then cd $(LIB)/. ; rm -f *.a  ; fi
 	if [ -d $(SLB) ] ; then cd $(SLB)/. ; rm -f *.so ; fi
-	if [ -d $(OBJ) ] ; then cd $(OBJ)/. ; rm -f *.o  ; fi
-	if [ -d $(OBJ)/cxxrep ] ; then cd $(OBJ)/cxxrep/. ; rm -f *.o  ; fi
-	if [ -d PI ]     ; then cd PI/.     ; $(MAKE) clean ; fi
+	if [ -d $(OBJ) ] ; then cd $(OBJ)/. ; rm -f *.o  rm -rf cxxrep* ; fi
+#	if [ -d PI ]     ; then cd PI/.     ; $(MAKE) clean ; fi
 
Index: trunk/SophyaLib/Mgr/Makefile.slb
===================================================================
--- trunk/SophyaLib/Mgr/Makefile.slb	(revision 755)
+++ trunk/SophyaLib/Mgr/Makefile.slb	(revision 823)
@@ -11,4 +11,10 @@
 # et liste des librairies pour PI (X11, Motif) 
 LIBXPILIST := -lXm -lXt -lX11
+
+# librairie compilateur GNU (g++)
+LIBGPP := -L$(GLB) -lstdc++
+ifeq ($(HOSTTYPE), powerpc)
+  LIBGPP = -L$(GLB)
+endif
 
 #  External libraries
@@ -39,4 +45,5 @@
   override USECXX4SO := Y
   override CMDSHLCXX := $(LINK.cc) -shared
+  override LIBLSHL := $(LIBGPP) $(LIBLSHL)
 endif
 
@@ -58,5 +65,6 @@
   override FGSHLA := -all
   override FGSHLN := -none 
-  override LIBLSHL := -lcxxstd -lcxx -lexc -lm -lc -lrt
+#  override LIBLSHL := -lcxxstd -lcxx -lexc -lm -lc -lrt
+  override LIBLSHL := $(LIBLSHL) -lrt
   override TILSHL := $(LIB)libertcxx.a
   override CMDTILSHL := rm -f $(LIB)libsotcxx.a ; cd $(REP); $(AR) $(ARFLAGS) $(LIB)libsotcxx.a *.o
@@ -64,5 +72,4 @@
   override CMDTILSHLPI := rm -f $(LIB)libsotcxxpi.a ; cd $(REPPI); $(AR) $(ARFLAGS) $(LIB)libsotcxxpi.a *.o
   ifeq ($(CXX),g++)
-    override LIBLSHL := $(LIBG) -lm -lc
     override TILSHL := 
     override TILSHLPI := 
@@ -72,4 +79,5 @@
   override FGSHLACXX := 
   override FGSHLNCXX := 
+  override USECXX4SO := Y
 endif
 
@@ -85,5 +93,5 @@
   override FGSHLACXX := 
   override FGSHLNCXX := 
-  override LIBLSHL := $(LIBG) -lm -ldl
+  override LIBLSHL := $(LIBLSHL) -ldl
   override TILSHL := 
   override LIBXPIPATH := -L/usr/X11/lib 
@@ -96,5 +104,4 @@
   override FGSHLA := -z allextract
   override FGSHLN := -z weakextract
-  override LIBLSHL := $(LIBG) -lm -lc
   override TILSHL := 
   override LIBXPIPATH := -L/usr/X11/lib 
@@ -107,9 +114,7 @@
   override FGSHLA := -all
   override FGSHLN := -notall
-  override LIBLSHL := $(LIBG) -lm -lc
   override TILSHL := 
   ifeq ($(EROSCXX), CC)
     override CMDSHLCXX := CC -shared 
-    override LIBLSHL := -lm -lc
   endif
   override LIBXPIPATH := -L/usr/X11/lib 
Index: trunk/SophyaLib/Mgr/mkmf
===================================================================
--- trunk/SophyaLib/Mgr/mkmf	(revision 755)
+++ trunk/SophyaLib/Mgr/mkmf	(revision 823)
@@ -1,4 +1,4 @@
 #!/bin/csh 
-# $Id: mkmf,v 1.10 2000-03-02 10:57:51 ansari Exp $
+# $Id: mkmf,v 1.11 2000-04-06 09:50:06 ansari Exp $
 
 #  Pour debugger 
@@ -67,9 +67,10 @@
 
 echo 'LIBF = ' `sed -e 's/.*/$(LIB)lib&.a/' libdirs` >> GNUmakefile
-echo 'LIBS = -L$(LIB)' `sed -e 's/.*/-l&/' libdirs` '-lm' >> GNUmakefile
-echo 'LIBG = -L$(GLB) -lstdc++' >> GNUmakefile
-echo 'ifeq ($(HOSTTYPE), powerpc)' >> GNUmakefile
-echo '  LIBG = -L$(GLB)' >> GNUmakefile
-echo 'endif' >> GNUmakefile
+# echo 'LIBS = -L$(LIB)' `sed -e 's/.*/-l&/' libdirs` '-lm' >> GNUmakefile
+echo 'LIBS = -L$(LIB)' `sed -e 's/.*/-l&/' libdirs`  >> GNUmakefile
+# echo 'LIBG = -L$(GLB) -lstdc++' >> GNUmakefile
+# echo 'ifeq ($(HOSTTYPE), powerpc)' >> GNUmakefile
+# echo '  LIBG = -L$(GLB)' >> GNUmakefile
+# echo 'endif' >> GNUmakefile
 
 cat >> GNUmakefile <<EOF
Index: trunk/SophyaLib/Mgr/mkmflib
===================================================================
--- trunk/SophyaLib/Mgr/mkmflib	(revision 755)
+++ trunk/SophyaLib/Mgr/mkmflib	(revision 823)
@@ -1,4 +1,4 @@
 #!/bin/csh
-# $Id: mkmflib,v 1.4 2000-02-25 18:34:49 ansari Exp $
+# $Id: mkmflib,v 1.5 2000-04-06 09:50:08 ansari Exp $
 
 cd ../$1
@@ -58,5 +58,6 @@
 #  Pour faire compiler les instantiations automatique de cxx (DEC)
 echo 'ifeq ($(CXX),cxx)' >> GNUmakefile
-echo '	$(CXX) $? $(CPPFLAGS) $(CXXFLAGS)' $hfcxxlibs '-o $(OBJ)xx.x -Hf' >> GNUmakefile
+#echo '	$(CXX) $? $(CPPFLAGS) $(CXXFLAGS)' $hfcxxlibs '-o $(OBJ)xx.x -Hf' >> GNUmakefile
+echo '	$(CXX) $? $(CPPFLAGS) $(CXXFLAGS) -o $(OBJ)xx.x -Hf' >> GNUmakefile
 echo 'endif ' >> GNUmakefile
 
