Changeset 1277 in Sophya for trunk/SophyaLib


Ignore:
Timestamp:
Nov 2, 2000, 11:54:42 AM (25 years ago)
Author:
ansari
Message:

Correction dyn linker - compiler + Gestion TMPDIR , Reza 2/11/2000

Location:
trunk/SophyaLib/SysTools
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaLib/SysTools/cxxcmplnk.cc

    r1275 r1277  
    9999    if (dpcbase[dpcbase.length()-1] != '/')  dpcbase += '/';
    100100    cppFlags += ( " -I" + dpcbase + "Include/ ");
    101     linkOptions += " -L" + dpcbase + syscomp + "ShLibs/ ";
     101    linkOptions += " -L" + dpcbase + syscomp + "ShLibs/ -lextsophya -lsophya -lm ";
    102102  }
    103103
     
    110110  }
    111111
     112  if ( (varenv=getenv("TMPDIR")) != NULL )  {
     113    tmpDir = varenv;
     114    if (tmpDir[tmpDir.length()-1] != '/') tmpDir += '/';
     115  }
    112116}
    113117
     
    118122
    119123/* --Methode-- */
    120 int CxxCompilerLinker::Compile(string const & name, string & objname)
     124int CxxCompilerLinker::Compile(string const & name, string & oname)
    121125{
    122   if (objname.length() < 1) {
    123     // A completer
    124     objname = tmpDir + "xxx.o";
     126  if (oname.length() < 1) {
     127    size_t l,p,q;
     128    l = name.length();
     129    p = name.rfind('/');
     130    if (p >= l)  p = 0;
     131    else p++;
     132    q = name.find('.');
     133    if (q < l)  oname = tmpDir + name.substr(p, q-p) + ".o";
     134    else oname = tmpDir + name.substr(p) + ".o";
    125135  }
    126136  string cmd;
    127   cmd = compCmd + cppFlags + compOptions + "-o " + objname + " " + name ;
     137  cmd = compCmd + cppFlags + compOptions + "-o " + oname + " " + name ;
    128138  if (verbose)
    129139    cout << "CxxCompilerLinker::Compile() - Executing \n" << cmd << endl;
     
    136146
    137147/* --Methode-- */
    138 int CxxCompilerLinker::BuildSO(string const & objname, string & soname)
     148int CxxCompilerLinker::BuildSO(string const & oname, string & soname)
    139149{
    140150  if (soname.length() < 1) {
    141     // A completer
    142     soname = tmpDir + "xxx.so";
     151    size_t l,p,q;
     152    l = oname.length();
     153    p = oname.rfind('/');
     154    if (p >= l)  p = 0;
     155    else p++;
     156    q = oname.find('.');
     157    if (q < l)  soname = tmpDir + oname.substr(p, q-p) + ".so";
     158    else soname = tmpDir + oname.substr(p) + ".so";
    143159  }
    144160  string cmd;
    145   cmd = compCmd + linkOptions + "-o " + soname + " " + objname ;
     161  cmd = compCmd + linkOptions + "-o " + soname + " " + oname ;
    146162  if (verbose)
    147163    cout << "CxxCompilerLinker::BuildSO() - Executing \n" << cmd << endl;
  • trunk/SophyaLib/SysTools/cxxcmplnk.h

    r1275 r1277  
    1919  virtual               ~CxxCompilerLinker();
    2020
    21   virtual int           Compile(string const & name, string & objname);
    22   virtual int           BuildSO(string const & objname, string & soname);
     21  virtual int           Compile(string const & name, string & oname);
     22  virtual int           BuildSO(string const & oname, string & soname);
    2323
    2424  inline void           AddCompileOptions(string const & opt)
  • trunk/SophyaLib/SysTools/pdlmgr.cc

    r1275 r1277  
    102102  tmpDir = new string("");
    103103  char* varenv;
    104   if ( (varenv=getenv("SOPHYA_TMP")) != NULL )  *tmpDir = varenv;
    105   else if ( (varenv=getenv("TMPDIR")) != NULL )  *tmpDir = varenv;
    106   }
     104  if ( (varenv=getenv("TMPDIR")) != NULL )  {
     105    *tmpDir = varenv;
     106    if ((*tmpDir)[tmpDir->length()-1] != '/') (*tmpDir) += '/';
     107  }
     108}
    107109return(*tmpDir);
    108110}
Note: See TracChangeset for help on using the changeset viewer.