Changeset 1900 in Sophya


Ignore:
Timestamp:
Feb 15, 2002, 6:35:01 PM (24 years ago)
Author:
ansari
Message:

Portage sous Mac OS X - Reza 15/02/2002

Location:
trunk/SophyaLib
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaLib/BaseTools/ppersist.cc

    r1783 r1900  
    5656ppclassNameList = new map<string, uint_8>;
    5757dobjclassNameList = new map<string, uint_8>;
     58cout << " PIOPersist::Initialize() Starting Sophya Persistence management service " << endl;
    5859}
    5960
     
    477478
    478479  // Find tag entries at end of file
    479 #if defined(Linux) &&  defined(__GNUG__)
     480#if (defined(Linux) || defined(Darwin)) &&  defined(__GNUG__)
    480481  // There seems to be a bug where seekg with ios::end under Linux  with g++
    481482  // So, we use seek with ios::beg
     483  // The bug seems to be there also with Darwin/MacOSX
    482484  s->seekg(0, ios::end);
    483485  int_8 tagpos = s->tellg() - (sizeof(int_8)+1);
  • trunk/SophyaLib/BaseTools/sophyainit.cc

    r1607 r1900  
    3333SophyaInitiator::SophyaInitiator()
    3434{
     35#if defined(Darwin)
     36  // Il semble y avoir un probleme sous MacOSX ...
     37  if (FgInit == 0)
     38    cout << " SophyaInitiator::SophyaInitiator() BaseTools Init" << endl;
     39#endif
    3540  FgInit++;
    3641  if (FgInit > 1)  return;
  • trunk/SophyaLib/Mgr/Makefile.h

    r1797 r1900  
    165165
    166166ifeq (${MACHEROS},Darwin)
    167   XLDLIBS := -L/usr/X11R6/lib
    168   XCFLAGS := -I/usr/X11R6/include -fno-coalesce -fkeep-inline-functions
     167  XLDLIBS := -L/usr/X11R6/lib -L/sw/lib -ldl
     168  XCFLAGS := -I/usr/X11R6/include -I/sw/include -fno-coalesce -fkeep-inline-functions
    169169endif
    170170
  • trunk/SophyaLib/SysTools/cxxcmplnk.cc

    r1797 r1900  
    3636
    3737/* --Methode-- */
    38 CxxCompilerLinker::CxxCompilerLinker()
     38CxxCompilerLinker::CxxCompilerLinker(bool fglibsophya, bool fglibextsophya, bool fglibpi)
    3939  : verbose(false)
    4040{
     
    9292#endif
    9393
     94#ifndef Darwin
     95  linkCmd = compCmd;
     96#else
     97  linkCmd = "cc -bundle -flat_namespace -undefined suppress ";
     98  linkOptions = "-L/usr/lib/gcc/darwin/default -lstdc++ -lcc_dynamic -lpthread -lm";
     99#endif
     100
    94101  cppFlags += " -I. ";
    95102  compOptions += " -c ";
     
    102109    if (dpcbase[dpcbase.length()-1] != '/')  dpcbase += '/';
    103110    cppFlags += ( " -I" + dpcbase + "Include/ ");
    104     linkOptions += " -L" + dpcbase + syscomp + "ShLibs/ -lextsophya -lsophya -lm ";
     111    linkOptions += " -L" + dpcbase + syscomp + "ShLibs/";
     112    if (fglibsophya) linkOptions += " -lsophya ";
     113    if (fglibextsophya) linkOptions += " -lextsophya ";
     114    if (fglibpi) linkOptions += " -lPI ";
    105115  }
    106116
     
    151161int CxxCompilerLinker::BuildSO(string const & oname, string & soname)
    152162{
     163  //  char * soext = ".dylib"; if defined(Darwin) - pas necessaire Reza 02/2002
     164  char * soext = ".so";
     165
    153166  if (soname.length() < 1) {
    154167    size_t l,p,q;
     
    158171    else p++;
    159172    q = oname.find('.');
    160     if (q < l)  soname = tmpDir + oname.substr(p, q-p) + ".so";
    161     else soname = tmpDir + oname.substr(p) + ".so";
     173    if (q < l)  soname = tmpDir + oname.substr(p, q-p) + soext;
     174    else soname = tmpDir + oname.substr(p) + soext;
    162175  }
    163176  string cmd;
    164   cmd = compCmd + linkOptions + "-o " + soname + " " + oname ;
     177  cmd = linkCmd + " " + oname + " " + linkOptions + " -o " + soname + " " ;
    165178  if (verbose)
    166179    cout << "CxxCompilerLinker::BuildSO() - Executing \n" << cmd << endl;
  • trunk/SophyaLib/SysTools/cxxcmplnk.h

    r1288 r1900  
    1616class CxxCompilerLinker {
    1717public:
    18                         CxxCompilerLinker(); 
     18  CxxCompilerLinker(bool fglibsophya=true, bool fglibextsophya=true,
     19                                          bool fglibpi=false); 
    1920  virtual               ~CxxCompilerLinker();
    2021
     
    4748  string  tmpDir;
    4849  string  compCmd;
     50  string  linkCmd;
    4951  string  compOptions;
    5052  string  linkOptions;
  • trunk/SophyaLib/SysTools/pdlmgr.cc

    r1797 r1900  
    1515static const char* sofext = ".so";
    1616static const char* sofext_HPUX = ".sl";
    17 static const char* sofext_Darwin = ".bundle";
     17// static const char* sofext_Darwin = ".dylib"; pas necessaire - Reza 02/2002
    1818
    1919// Variables et methodes static
     
    172172  cmd = "ld -b -o " + fnameso + " " + fnameobj + " -lm -lc";
    173173#elif defined(Darwin)
    174   cmd = "ld -bundle -o " + fnameso + " " + fnameobj + " -lm  -lcc_dynamic -lSystem -lbundle1.o";
     174  cmd = "cc -bundle -flat_namespace -o " + fnameso + " " + fnameobj + " -lm  -lcc_dynamic -lSystem -lbundle1.o";
    175175#else
    176176  cmd = "ld -o " + fnameso + " " + fnameobj + " -lm -lc";
     
    203203#ifdef HPUX
    204204  soname += sofext_HPUX;
    205 #elif defined(Darwin)
    206  soname += sofext_Darwin;
    207205#else
    208206  soname += sofext;
     
    230228else fnameso = soname;
    231229copy = cp;
     230 fnameso = soname;
    232231soName = fnameso;
    233232
     
    236235cerr << "PDynLinkMgr::PDynLinkMgr() Not yet available on HP-UX " << endl;
    237236return;
    238 #elif defined(Darwin)
    239  int rc = NSCreateObjectFileImageFromFile(fnameso.c_str(), &shfim);
    240  if (rc != NSObjectFileImageSuccess) {
    241    cerr << "PDynLinkMgr::PDynLinkMgr(): Error opening SO " << fnameso
    242         << " (" << soname << ")" << endl;
    243    cerr << "Loader Error (dlerror()) :" << rc << endl;
    244    return;
    245  }
    246  shmod = NSLinkModule(shfim, fnameso.c_str(), 0);
    247237#else
    248238dlhandle =  dlopen(fnameso.c_str(), RTLD_NOW);
     
    265255cerr << "PDynLinkMgr::~PDynLinkMgr() Not yet available on HP-UX " << endl;
    266256return;
    267 #elif defined(Darwin)
    268  NSUnLinkModule(shmod, 0);
    269  NSDestroyObjectFileImage(shfim);
    270257#else
    271258if (dlhandle) dlclose(dlhandle);    dlhandle = NULL;
     
    286273cerr << "PDynLinkMgr::GetFunction() Not yet available on HP-UX " << endl;
    287274return f;
    288 #elif defined(Darwin)
    289  void* sym = NSLookupSymbolInModule(shmod,funcname.c_str());
    290  f = (DlFunction) NSAddressOfSymbol(sym);
    291  return f;
    292 #else
     275#else
     276#if defined(Darwin)
     277string funame = "_" + funcname;
     278#else
     279string & funame = funcname;
     280#endif
    293281if (dlhandle != NULL) 
    294   f = (DlFunction)dlsym(dlhandle, funcname.c_str());
     282  f = (DlFunction)dlsym(dlhandle, funame.c_str());
    295283if (f == NULL) cerr << "PDynLinkMgr::GetFunction(): Error linking " << funcname << endl;
    296284return(f);
  • trunk/SophyaLib/SysTools/pdlmgr.h

    r1796 r1900  
    1313#include <dl.h>
    1414#elif defined(Darwin)
    15 #include <mach-o/dyld.h>
     15#include </sw/include/dlfcn.h>
    1616#else
    1717#include <dlfcn.h>
     
    4343#if defined(HPUX)
    4444  shl_t dlhandle;
    45 #elif defined(Darwin)
    46   NSObjectFileImage shfim;
    47   NSModule          shmod;
    4845#else
    4946  void * dlhandle;
Note: See TracChangeset for help on using the changeset viewer.