Changeset 20338

Show
Ignore:
Timestamp:
06/26/07 16:35:16 (1 year ago)
Author:
patrick
Message:

MFT r20337: Allow user-level code to customize the shared library loader's

name extension so that users are not stuck with the compile-time
decision that vpr::LibraryLoader? would otherwise make entirely on
its own. The customization is performed using the
vpr::LibraryLoader::setDSONameExt().

Bumped version to 1.1.47.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • juggler/branches/2.2/modules/vapor/ChangeLog

    r20283 r20338  
    11DATE       AUTHOR   CHANGE 
    22---------- -------- ----------------------------------------------------------- 
     32007-06-26 patrick  Allow user-level code to customize the DSO name extension 
     4                    used to distinguish between build variants through the 
     5                    new function vpr::LibraryLoader::setDSONameExt(). 
     6                    NEW VERSION: 1.1.47 
    372007-05-23 aronb    Changed the default socket statistics collection strategy 
    48                    to NullIOStatsStrategy. 
  • juggler/branches/2.2/modules/vapor/VERSION

    r20283 r20338  
     11.1.47-0 @06/26/2007 19:35:00 UTC@ 
    121.1.46-0 @05/23/2007 16:25:00 UTC@ 
    231.1.45-0 @05/23/2007 16:00:00 UTC@ 
  • juggler/branches/2.2/modules/vapor/vpr/DynLoad/LibraryLoader.cpp

    r19729 r20338  
    5757{ 
    5858 
    59 #ifdef VPR_DEBUG 
    60 static const std::string DSO_NAME_EXT("_d"); 
     59#if defined(VPR_DEBUG) 
     60#  if defined(_DEBUG) 
     61std::string LibraryLoader::sDsoNameExt("_d"); 
     62#  else 
     63std::string LibraryLoader::sDsoNameExt("_g"); 
     64#  endif 
    6165#else 
    62 static const std::string DSO_NAME_EXT(""); 
     66std::string LibraryLoader::sDsoNameExt(""); 
    6367#endif 
    6468 
     
    232236std::string LibraryLoader::makeFullDSOName(const std::string& dsoBaseName) 
    233237{ 
    234    return dsoBaseName + DSO_NAME_EXT + DSO_FILE_EXT; 
     238   return dsoBaseName + sDsoNameExt + DSO_FILE_EXT; 
    235239} 
    236240 
  • juggler/branches/2.2/modules/vapor/vpr/DynLoad/LibraryLoader.h

    r19729 r20338  
    219219    * platform-specific extension (.so, .dll, etc) will be appended, and for 
    220220    * an instantiation of this class in debug-enabled code, the suffix "_d" 
    221     * will be appended to the DSO's base name.  For example, given the base 
    222     * name mydso, a debug build on Windows would search for the file 
    223     * mydso_d.dll.  For a release (optimized) build, it would search for 
    224     * mysdso.dll. 
     221    * or "_g" will be appended to the DSO's base name.  For example, given the 
     222    * base name mydso, a build using the Visual C++ debug runtime on Windows 
     223    * would search for the file mydso_d.dll.  For an optimized build made 
     224    * against the release runtime, it would search for mysdso.dll.  For a 
     225    * debug-enabled build made against the release runtime, it would search 
     226    * for mydso_g.dll.  The determination of which name extension to use is 
     227    * made at compile time, but it can be customized using setDSONameExt(). 
    225228    * 
    226229    * @param dsoBaseName The base name of the DSO to be loaded. 
     230    * 
     231    * @see setDSONameExt() 
    227232    */ 
    228233   static std::string makeFullDSOName(const std::string& dsoBaseName); 
     234 
     235   /** 
     236    * Changes the name extension applied when makeFullDSOName() constructs 
     237    * the name of the shared library to load. 
     238    * 
     239    * @parram nameExt The new name extension (such as "_x") that will be used 
     240    *                 by makeFullDSOName(). 
     241    * 
     242    * @since 1.1.47 
     243    * 
     244    * @see makeFullDSOName() 
     245    */ 
     246   static void setDSONameExt(const std::string& nameExt) 
     247   { 
     248      sDsoNameExt = nameExt; 
     249   } 
     250 
     251   /** 
     252    * Retrieves the current name extension applied when makeFullDSOName() 
     253    * constructs the name of the shared library to load. 
     254    * 
     255    * @since 1.1.47 
     256    * 
     257    * @see makeFullDSOName() 
     258    */ 
     259   static const std::string& getDSONameExt() 
     260   { 
     261      return sDsoNameExt; 
     262   } 
    229263 
    230264private: 
     
    232266                                 std::vector<boost::filesystem::path>& boostFsVec); 
    233267 
     268   /** 
     269    * @since 1.1.47 
     270    */ 
     271   static std::string sDsoNameExt; 
    234272}; 
    235273