diff --git a/builds/posix/make.defaults b/builds/posix/make.defaults index 81f021c11d..acf3db5025 100755 --- a/builds/posix/make.defaults +++ b/builds/posix/make.defaults @@ -211,7 +211,7 @@ BLRTABLE = $(BIN)/blrtable$(EXEC_EXT) # #LibraryFileName=libfbclient -LibraryFileName=libfirebird +LibraryFileName=libfbclient LibraryFullName=$(LibraryFileName).${SHRLIB_EXT}.${FirebirdVersion} LibrarySoName=$(LibraryFileName).${SHRLIB_EXT}.${MajorVer} LibraryBaseName=$(LibraryFileName).${SHRLIB_EXT} @@ -222,8 +222,8 @@ LIBFIREBIRD_BASENAME = $(LIB)/$(LibrarySoName) # 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 @@ endif 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 diff --git a/src/common/os/mod_loader.h b/src/common/os/mod_loader.h index 552cde06c8..cbcea2c86a 100644 --- a/src/common/os/mod_loader.h +++ b/src/common/os/mod_loader.h @@ -97,6 +97,21 @@ public: **/ 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. diff --git a/src/common/unicode_util.cpp b/src/common/unicode_util.cpp index 54b6058359..8a0feca8ee 100644 --- a/src/common/unicode_util.cpp +++ b/src/common/unicode_util.cpp @@ -801,12 +801,7 @@ UnicodeUtil::ICU* UnicodeUtil::loadICU(const Firebird::string& icuVersion, 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 @@ UnicodeUtil::ICU* UnicodeUtil::loadICU(const Firebird::string& icuVersion, 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) { diff --git a/src/yvalve/why.cpp b/src/yvalve/why.cpp index 2c142cb0b3..195b1b78d7 100644 --- a/src/yvalve/why.cpp +++ b/src/yvalve/why.cpp @@ -1139,7 +1139,7 @@ namespace // 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)) )