From: <ale...@us...> - 2010-10-19 13:49:02
|
Revision: 51733 http://firebird.svn.sourceforge.net/firebird/?rev=51733&view=rev Author: alexpeshkoff Date: 2010-10-19 13:48:56 +0000 (Tue, 19 Oct 2010) Log Message: ----------- Changed libraries' names. Improved a bit ModLoader. Modified Paths: -------------- firebird/trunk/builds/posix/make.defaults firebird/trunk/src/common/os/mod_loader.h firebird/trunk/src/common/unicode_util.cpp firebird/trunk/src/yvalve/why.cpp Modified: firebird/trunk/builds/posix/make.defaults =================================================================== --- firebird/trunk/builds/posix/make.defaults 2010-10-19 13:28:18 UTC (rev 51732) +++ firebird/trunk/builds/posix/make.defaults 2010-10-19 13:48:56 UTC (rev 51733) @@ -211,7 +211,7 @@ # #LibraryFileName=libfbclient -LibraryFileName=libfirebird +LibraryFileName=libfbclient LibraryFullName=$(LibraryFileName).${SHRLIB_EXT}.${FirebirdVersion} LibrarySoName=$(LibraryFileName).${SHRLIB_EXT}.${MajorVer} LibraryBaseName=$(LibraryFileName).${SHRLIB_EXT} @@ -222,8 +222,8 @@ # The firebird engine library name -EngineFileName=libengine -EngineSoName=$(EngineFileName).${SHRLIB_EXT}.${OdsVersion} +EngineFileName=libengine${OdsVersion} +EngineSoName=$(EngineFileName).${SHRLIB_EXT} ENGINE_SONAME = $(LIB)/$(EngineSoName) # intl will load dynamically, and having the whole soname set with version @@ -280,7 +280,7 @@ LIB_PATH_OPTS = $(call LIB_LINK_RPATH,lib) $(call LIB_LINK_RPATH,intl) LIB_LINK_SONAME= -Wl,-soname,$(1) LIB_LINK_MAPFILE= -Wl,--version-script, -FIREBIRD_LIBRARY_LINK= -L$(LIB) -lfirebird +FIREBIRD_LIBRARY_LINK= -L$(LIB) -lfbclient LINK_OPTS= $(LDFLAGS) $(THR_FLAGS) $(UNDEF_FLAGS) $(LIB_PATH_OPTS) LIB_LINK_OPTIONS= $(LDFLAGS) $(THR_FLAGS) -shared Modified: firebird/trunk/src/common/os/mod_loader.h =================================================================== --- firebird/trunk/src/common/os/mod_loader.h 2010-10-19 13:28:18 UTC (rev 51732) +++ firebird/trunk/src/common/os/mod_loader.h 2010-10-19 13:48:56 UTC (rev 51733) @@ -97,6 +97,21 @@ **/ static void doctorModuleExtension(Firebird::PathName&); + /** Almost like loadModule(), but in case of failure invokes doctorModuleExtension() + adn retries. + **/ + static Module* fixAndLoadModule(const Firebird::PathName& modName) + { + Module* mod = loadModule(modName); + if (!mod) + { + Firebird::PathName fixed(modName); + doctorModuleExtension(fixed); + mod = loadModule(fixed); + } + return mod; + } + /** isLoadableModule checks the given file to see if it is a loadable module. This function is required because different operating systems require different checks. Modified: firebird/trunk/src/common/unicode_util.cpp =================================================================== --- firebird/trunk/src/common/unicode_util.cpp 2010-10-19 13:28:18 UTC (rev 51732) +++ firebird/trunk/src/common/unicode_util.cpp 2010-10-19 13:48:56 UTC (rev 51733) @@ -801,12 +801,7 @@ icu = FB_NEW(*getDefaultMemoryPool()) ICU(); - icu->ucModule = ModuleLoader::loadModule(filename); - if (!icu->ucModule) - { - ModuleLoader::doctorModuleExtension(filename); - icu->ucModule = ModuleLoader::loadModule(filename); - } + icu->ucModule = ModuleLoader::fixAndLoadModule(filename); if (!icu->ucModule) { @@ -816,12 +811,7 @@ filename.printf(inTemplate, majorVersion.c_str(), minorVersion.c_str()); - icu->inModule = ModuleLoader::loadModule(filename); - if (!icu->inModule) - { - ModuleLoader::doctorModuleExtension(filename); - icu->inModule = ModuleLoader::loadModule(filename); - } + icu->inModule = ModuleLoader::fixAndLoadModule(filename); if (!icu->inModule) { Modified: firebird/trunk/src/yvalve/why.cpp =================================================================== --- firebird/trunk/src/yvalve/why.cpp 2010-10-19 13:28:18 UTC (rev 51732) +++ firebird/trunk/src/yvalve/why.cpp 2010-10-19 13:48:56 UTC (rev 51733) @@ -1139,7 +1139,7 @@ // load engines // temp solution - ModuleLoader::Module* engine = ModuleLoader::loadModule("libengine.so.12"); + ModuleLoader::Module* engine = ModuleLoader::fixAndLoadModule(fb_utils::getPrefix(fb_utils::FB_DIR_LIB, "engine12")); if (engine) { if ( (plug = fb_query_plugin(Plugin::Provider, NULL)) ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |