Index: trunk/SophyaLib/BaseTools/Makefile
===================================================================
--- trunk/SophyaLib/BaseTools/Makefile	(revision 1274)
+++ trunk/SophyaLib/BaseTools/Makefile	(revision 1275)
@@ -3,7 +3,7 @@
 all: $(LIB)libSysTools.a
 clean:
-	rm -f $(OBJ)ctimer.o $(OBJ)datacards.o $(OBJ)datatype.o $(OBJ)dvlist.o $(OBJ)fiondblock.o $(OBJ)mutyv.o $(OBJ)ndatablock.o $(OBJ)pdlmgr.o $(OBJ)periodic.o $(OBJ)pexceptions.o $(OBJ)ppersist.o $(OBJ)psighand.o $(OBJ)sophyainit.o $(OBJ)strutilxx.o $(OBJ)utils.o $(OBJ)gnumd5.o $(OBJ)srandgen.o $(OBJ)strutil.o $(OBJ)timing.o
+	rm -f $(OBJ)ctimer.o $(OBJ)cxxcmplnk.o $(OBJ)datacards.o $(OBJ)datatype.o $(OBJ)dvlist.o $(OBJ)fiondblock.o $(OBJ)mutyv.o $(OBJ)ndatablock.o $(OBJ)pdlmgr.o $(OBJ)periodic.o $(OBJ)pexceptions.o $(OBJ)ppersist.o $(OBJ)psighand.o $(OBJ)sophyainit.o $(OBJ)strutilxx.o $(OBJ)utils.o $(OBJ)gnumd5.o $(OBJ)srandgen.o $(OBJ)strutil.o $(OBJ)timing.o
 	rm -f $(LIB)libSysTools.a
-$(LIB)libSysTools.a : $(OBJ)ctimer.o $(OBJ)datacards.o $(OBJ)datatype.o $(OBJ)dvlist.o $(OBJ)fiondblock.o $(OBJ)gnumd5.o $(OBJ)mutyv.o $(OBJ)ndatablock.o $(OBJ)pdlmgr.o $(OBJ)periodic.o $(OBJ)pexceptions.o $(OBJ)ppersist.o $(OBJ)psighand.o $(OBJ)sophyainit.o $(OBJ)srandgen.o $(OBJ)strutil.o $(OBJ)strutilxx.o $(OBJ)timing.o $(OBJ)utils.o
+$(LIB)libSysTools.a : $(OBJ)ctimer.o $(OBJ)cxxcmplnk.o $(OBJ)datacards.o $(OBJ)datatype.o $(OBJ)dvlist.o $(OBJ)fiondblock.o $(OBJ)gnumd5.o $(OBJ)mutyv.o $(OBJ)ndatablock.o $(OBJ)pdlmgr.o $(OBJ)periodic.o $(OBJ)pexceptions.o $(OBJ)ppersist.o $(OBJ)psighand.o $(OBJ)sophyainit.o $(OBJ)srandgen.o $(OBJ)strutil.o $(OBJ)strutilxx.o $(OBJ)timing.o $(OBJ)utils.o
 	$(ARCXX) $(ARCXXFLAGS) $@ $?
 ifeq ($(CXX),cxx)
@@ -12,4 +12,6 @@
  
 $(OBJ)ctimer.o: ctimer.cc $(INC)machdefs.h ctimer.h
+$(OBJ)cxxcmplnk.o: cxxcmplnk.cc pdlmgr.h \
+ $(INC)machdefs.h
 $(OBJ)datacards.o: datacards.cc $(INC)machdefs.h \
  datacards.h pexceptions.h
Index: trunk/SophyaLib/BaseTools/objlist.list
===================================================================
--- trunk/SophyaLib/BaseTools/objlist.list	(revision 1274)
+++ trunk/SophyaLib/BaseTools/objlist.list	(revision 1275)
@@ -1,3 +1,4 @@
 ctimer.o
+cxxcmplnk.o
 datacards.o
 datatype.o
Index: trunk/SophyaLib/SysTools/cxxcmplnk.cc
===================================================================
--- trunk/SophyaLib/SysTools/cxxcmplnk.cc	(revision 1275)
+++ trunk/SophyaLib/SysTools/cxxcmplnk.cc	(revision 1275)
@@ -0,0 +1,154 @@
+// Gestionnaire de compilation-linker C++ - R. Ansari 10/2000
+// LAL (Orsay) / IN2P3-CNRS  DAPNIA/SPP (Saclay) / CEA
+
+#include "cxxcmplnk.h"
+#include <iostream.h>
+
+/*!
+  \class SOPHYA::CxxCompilerLinker
+  \ingroup SysTools
+  This classes handles the compilation of a C++ source code and 
+  building of a shared library.
+  The present version has been adapted for different compilers:
+  g++ , Compaq/Digital cxx , SGI CC , KCC .
+  \sa SOPHYA::PDynLinkMgr
+  \code
+  #include ""cxxcmplnk.h"
+  CxxCompilerLinker cxx;
+  string name = "toto.cc";
+  string oname = "toto.o";
+  string soname = "toto.so";
+  int rc;
+  // compiling file 
+  rc = cxx.Compile(name, oname);
+  // linking and building the shared object 
+  rc = cxx.BuildSO(oname, soname);
+  \endcode
+*/
+
+static char * gcxx_opt = 
+"-O -Wall -Wpointer-arith -Wmissing-prototypes -Wsynth -fdollars-in-identifiers";
+static char * KCC_opt = 
+"-O --exceptions --rtti  --auto_instantiation --one_instantiation_per_object -D__KCC__";
+static char * cxx_opt = 
+"-O -no_implicit_include ";
+static char * SGICC_opt =  "-O -prelink -D__SGICC__ ";
+
+/* --Methode-- */
+CxxCompilerLinker::CxxCompilerLinker()
+  : verbose(false)
+{
+  
+  string syscomp = "";
+
+#if defined(OSF1) 
+  cppFlags += "-DOSF1" ; 
+  syscomp = "OSF1-";
+#elif defined(Linux)
+  cppFlags += "-DLinux" ;
+  syscomp = "Linux-"; 
+#elif defined(SunOS)
+  cppFlags += "-DSunOS" ;
+  syscomp = "SunOS-";  
+#elif defined(IRIX64)
+  cppFlags += "-DIRIX64" ;
+  syscomp = "IRIX64-";  
+#elif defined(AIX)
+  cppFlags += "-DAIX" ;
+  syscomp = "AIX-";  
+#elif defined(HPUX)
+  cppFlags += "-DHPUX" ;
+  syscomp = "HPUX-";  
+#endif
+
+
+#if defined( __GNUG__ )
+  compCmd = "g++ ";
+  compOptions = gcxx_opt;
+  linkOptions = "-O -shared";
+  syscomp += "g++/"; 
+#elif defined( __DECCXX )
+  compCmd = "cxx ";
+  compOptions = cxx_opt;
+  linkOptions = cxx_opt + "-shared";
+  syscomp += "cxx/"; 
+#elif defined( __KCC__ )
+  compCmd = "KCC ";
+  compOptions = KCC_opt;
+  linkOptions = KCC_opt;
+  syscomp += "KCC/";  
+#elif defined( __SGICC__ )
+  compCmd = "CC ";
+  compOptions = SGICC_opt;
+  linkOptions = SGICC_opt;
+  syscomp += "CC/";  
+#ifdef SGI_ARCH64
+  compOptions += " -64 -DSGI_ARCH64 ";
+  linkOptions += " -64 "; 
+#endif
+#endif
+
+  cppFlags += " -I. ";
+  compOptions += " -c ";
+
+  string dpcbase;
+  char* varenv=NULL;
+  varenv=getenv("DPCBASEREP");
+  if (varenv) {
+    dpcbase = varenv; 
+    if (dpcbase[dpcbase.length()-1] != '/')  dpcbase += '/';
+    cppFlags += ( " -I" + dpcbase + "Include/ ");
+    linkOptions += " -L" + dpcbase + syscomp + "ShLibs/ "; 
+  }
+
+  string extlib;
+  varenv=getenv("EXTLIBDIR");
+  if (varenv) {
+    extlib = varenv; 
+    if (extlib[extlib.length()-1] != '/')  extlib += '/';
+    cppFlags += ( " -I" + extlib +"Include/ ");
+  }
+
+}
+
+/* --Methode-- */
+CxxCompilerLinker::~CxxCompilerLinker()
+{
+}
+
+/* --Methode-- */
+int CxxCompilerLinker::Compile(string const & name, string & objname)
+{
+  if (objname.length() < 1) {
+    // A completer
+    objname = tmpDir + "xxx.o";
+  }
+  string cmd;
+  cmd = compCmd + cppFlags + compOptions + "-o " + objname + " " + name ; 
+  if (verbose)
+    cout << "CxxCompilerLinker::Compile() - Executing \n" << cmd << endl; 
+  int rc = system(cmd.c_str());
+  if (rc != 0)   
+    cerr << "CxxCompilerLinker::Compile() Error Rc(" << cmd <<")= "<< rc << endl; 
+  
+  return(rc);
+}
+
+/* --Methode-- */
+int CxxCompilerLinker::BuildSO(string const & objname, string & soname)
+{
+  if (soname.length() < 1) {
+    // A completer
+    soname = tmpDir + "xxx.so";
+  }
+  string cmd;
+  cmd = compCmd + linkOptions + "-o " + soname + " " + objname ; 
+  if (verbose)
+    cout << "CxxCompilerLinker::BuildSO() - Executing \n" << cmd << endl; 
+  int rc = system(cmd.c_str());
+  if (rc != 0)   
+    cerr << "CxxCompilerLinker::BuildSO() Error Rc(" << cmd <<")= "<< rc << endl; 
+  
+  return(rc);
+}
+
Index: trunk/SophyaLib/SysTools/cxxcmplnk.h
===================================================================
--- trunk/SophyaLib/SysTools/cxxcmplnk.h	(revision 1275)
+++ trunk/SophyaLib/SysTools/cxxcmplnk.h	(revision 1275)
@@ -0,0 +1,57 @@
+// This may look like C code, but it is really -*- C++ -*-
+// Gestionnaire de compilation-linker C++ - R. Ansari 10/2000
+// LAL (Orsay) / IN2P3-CNRS  DAPNIA/SPP (Saclay) / CEA
+
+#ifndef CXXCOMPILERLINKER_SEEN
+#define CXXCOMPILERLINKER_SEEN
+
+#include "machdefs.h"
+#include <string>
+
+
+namespace SOPHYA {
+
+//! C++ compiler - linker
+ 
+class CxxCompilerLinker {
+public:
+			CxxCompilerLinker();  
+  virtual		~CxxCompilerLinker();
+
+  virtual int           Compile(string const & name, string & objname);
+  virtual int           BuildSO(string const & objname, string & soname);
+
+  inline void           AddCompileOptions(string const & opt)
+  { compOptions += opt; }
+  inline void           SetCompileOptions(string const & opt = "")
+  { compOptions = opt; }
+  inline string         GetCompileOptions()
+  { return compOptions; }
+
+  inline void           AddLinkOptions(string const & opt)
+  { linkOptions += opt; }
+  inline void           SetLinkOptions(string const & opt = "")
+  { linkOptions = opt; }
+  inline string         GetLinkOptions()
+  { return linkOptions; }
+
+  inline void        	SetTmpDir(string const & tmpdir)
+  { tmpDir = tmpdir; }
+  inline string        	GetTmpDir()
+  { return tmpDir; }
+
+  inline void           SetVerbose(bool fg=false)
+  { verbose = fg; }
+
+protected :
+  string  tmpDir;
+  string  compCmd;
+  string  compOptions;
+  string  linkOptions;
+  string  cppFlags;  
+  bool    verbose;
+};
+
+} // namespace SOPHYA
+
+#endif
Index: trunk/SophyaLib/SysTools/pdlmgr.cc
===================================================================
--- trunk/SophyaLib/SysTools/pdlmgr.cc	(revision 1274)
+++ trunk/SophyaLib/SysTools/pdlmgr.cc	(revision 1275)
@@ -23,5 +23,5 @@
   libraries. The present version has been adapted for different Unix 
   flavours (Linux, Compaq/Digital Unix, SGI IRIX, IBM AIX, Sun Solaris).
-  The example here the linking of shared library named "mylib.so" 
+  The example here shows the linking of shared library named "mylib.so" 
   containing a function \c double \c myfunction(double x). 
   \code
@@ -48,14 +48,20 @@
 void PDynLinkMgr::SetTmpDir(string const & path)
 {
-if ( (path.length() > 0) && (path[path.length()] != '/')  ) GetTmpDir() = path + '/';
+if ( (path.length() > 0) && (path[path.length()-1] != '/')  ) GetTmpDir() = path + '/';
 else GetTmpDir() = path;
-#if defined(OSF1) || defined(Linux) || defined(SunOS)
+#if defined(OSF1) || defined(Linux) || defined(SunOS) || defined(IRIX64)
+  char* varenv=NULL;
+#if !defined(IRIX64)
   string cmd = "LD_LIBRARY_PATH=";
-  char* varenv=NULL;
   varenv=getenv("LD_LIBRARY_PATH");
-#elif defined(IRIX64)
+#else
+#ifdef SGI_ARCH64
   string cmd = "LD_LIBRARYN32_PATH=";
-  char* varenv=NULL;
   varenv=getenv("LD_LIBRARYN32_PATH");
+#else
+  string cmd = "LD_LIBRARYN64_PATH=";
+  varenv=getenv("LD_LIBRARYN64_PATH");
+#endif
+#endif
 
   if (varenv == NULL) { 
