From 570289f7b6aa3c9e9b87b542766bb1848dcade62 Mon Sep 17 00:00:00 2001 From: skywalker Date: Tue, 21 Aug 2001 09:41:00 +0000 Subject: [PATCH] Changes to read /etc/firebird.conf file --- src/fbutil/FirebirdConfig.cpp | 8 ++++++++ src/fbutil/FirebirdConfig.h | 2 ++ src/fbutil/FirebirdConfigFile.cpp | 25 +++++++++++++++++++++++++ src/fbutil/FirebirdConfigFile.h | 11 ++++++----- src/jrd/jrd.cpp | 11 +++++++++-- src/make.new/Makefile.in.burp | 4 ++-- src/make.new/Makefile.in.fbutil | 18 +++++++++++++++++- src/make.new/Makefile.in.firebird | 8 +++++--- src/make.new/Makefile.in.gpre | 4 ++-- src/make.new/Makefile.in.lock | 8 ++++---- src/make.new/make.rules | 15 +++++++++------ 11 files changed, 89 insertions(+), 25 deletions(-) diff --git a/src/fbutil/FirebirdConfig.cpp b/src/fbutil/FirebirdConfig.cpp index 7d9010183a..db6c4cd1c1 100644 --- a/src/fbutil/FirebirdConfig.cpp +++ b/src/fbutil/FirebirdConfig.cpp @@ -35,6 +35,14 @@ int FirebirdConfig::getSysInt(const string& key) { return sysConfig.getInt(key); } +//----------------------------------------------------------------------------- +// +// +// + +bool FirebirdConfig::getSysBoolean(const string& key) { + return sysConfig.getBoolean(key); +} //----------------------------------------------------------------------------- // diff --git a/src/fbutil/FirebirdConfig.h b/src/fbutil/FirebirdConfig.h index 33b75d887b..9149ac5951 100644 --- a/src/fbutil/FirebirdConfig.h +++ b/src/fbutil/FirebirdConfig.h @@ -12,6 +12,7 @@ public: static string getSysString(const string& key); static int getSysInt(const string& key); + static bool getSysBoolean(const string& key); static void loadSysConfig(); static const string getSysConfigFile(); static void setSysConfigFile(const string& newFile); @@ -28,6 +29,7 @@ public: virtual void checkLoadConfig()= 0; virtual string getString(const string& key) = 0; virtual int getInt(const string& key) = 0; + virtual bool getBoolean(const string& key) = 0; virtual ~FirebirdConfig() {} diff --git a/src/fbutil/FirebirdConfigFile.cpp b/src/fbutil/FirebirdConfigFile.cpp index 282aba769a..9ef53b3144 100644 --- a/src/fbutil/FirebirdConfigFile.cpp +++ b/src/fbutil/FirebirdConfigFile.cpp @@ -17,6 +17,7 @@ FirebirdConfigFile::FirebirdConfigFile() { isLoadedFlg = false; configFile = "/etc/firebird.conf"; + cout << "Got ya" << endl; } //----------------------------------------------------------------------------- @@ -114,6 +115,30 @@ int FirebirdConfigFile::getInt(const string& key) { } +//----------------------------------------------------------------------------- +// +// +// + +bool FirebirdConfigFile::getBoolean(const string& key) { + + checkLoadConfig(); + + string data = getString(key); + + if (data.empty()) { + return false; + } + + int result = atoi(data.data()); + + if (result != 0) { + return true; + } + + return false; + +} //----------------------------------------------------------------------------- // diff --git a/src/fbutil/FirebirdConfigFile.h b/src/fbutil/FirebirdConfigFile.h index b140313f7f..d5d347878a 100644 --- a/src/fbutil/FirebirdConfigFile.h +++ b/src/fbutil/FirebirdConfigFile.h @@ -9,7 +9,7 @@ #include "FirebirdConfig.h" -class FirebirdConfigFile : FirebirdConfig { +class FirebirdConfigFile : public FirebirdConfig { public: FirebirdConfigFile(); @@ -20,10 +20,11 @@ public: bool getIsLoadedFlg() { return isLoadedFlg; } void setIsLoadedFlg(bool newFlg) { isLoadedFlg = newFlg; } - void loadConfig(); - void checkLoadConfig(); - string getString(const string& key); - int getInt(const string& key); + virtual void loadConfig(); + virtual void checkLoadConfig(); + virtual string getString(const string& key); + virtual int getInt(const string& key); + virtual bool getBoolean(const string& key); private: string configFile; diff --git a/src/jrd/jrd.cpp b/src/jrd/jrd.cpp index 02ee7b8c22..fa5f1d2743 100644 --- a/src/jrd/jrd.cpp +++ b/src/jrd/jrd.cpp @@ -115,6 +115,9 @@ #include "../jrd/event_proto.h" #include "../jrd/old_proto.h" + +#include "fbutil/FirebirdConfig.h" + #ifdef GARBAGE_THREAD #include "vio_proto.h" #endif @@ -696,8 +699,12 @@ STATUS DLL_EXPORT GDS_ATTACH_DATABASE(STATUS* user_status, { /* Check to see if the database is truly local or if it just looks that way */ - - if (ISC_check_if_remote(expanded_filename, TRUE)) + + int checkRemoteFiles = 0; + if (FirebirdConfig::getSysBoolean("DoRemoteOpenForNFSFiles")) { + checkRemoteFiles=1; + } + if (ISC_check_if_remote(expanded_filename, checkRemoteFiles)) ERR_post(gds_unavailable, 0); } diff --git a/src/make.new/Makefile.in.burp b/src/make.new/Makefile.in.burp index c82a4d1920..a60cc7c480 100644 --- a/src/make.new/Makefile.in.burp +++ b/src/make.new/Makefile.in.burp @@ -26,7 +26,7 @@ # Contributor(s): # # -# $Id: Makefile.in.burp,v 1.4 2001-08-13 08:14:38 skywalker Exp $ +# $Id: Makefile.in.burp,v 1.5 2001-08-21 09:41:00 skywalker Exp $ # ROOT=../.. @@ -63,7 +63,7 @@ all: gbak_static gbak gsplit gbak_static : $(BIN)/gbak_static $(BIN)/gbak_static : $(BURP_Objects) $(BOOT_GDSLIB_Objects) - $(CXX) $(LINK_OPTS) $^ -o $@ $(COREFOUNDATION_LINK) $(LINK_LIBS) + $(CXX) $(LINK_OPTS) $^ -o $@ $(COREFOUNDATION_LINK) $(STATICLINK_LIBS) diff --git a/src/make.new/Makefile.in.fbutil b/src/make.new/Makefile.in.fbutil index a21043c49e..1afdd0086a 100755 --- a/src/make.new/Makefile.in.fbutil +++ b/src/make.new/Makefile.in.fbutil @@ -26,7 +26,7 @@ # Contributor(s): # # -# $Id: Makefile.in.fbutil,v 1.4 2001-08-13 08:14:38 skywalker Exp $ +# $Id: Makefile.in.fbutil,v 1.5 2001-08-21 09:41:00 skywalker Exp $ # ROOT=../.. @@ -43,12 +43,28 @@ AllObjects= $(FBUTIL_Objects) Dependancies=$(AllObjects:.o=.d) + +fbutil_boot : $(LIB)/fbutil_boot.a + +$(LIB)/fbutil_boot.a: $(FBUTIL_Objects) + -$(RM) $@ + $(AR) $@ $^ + -$(RANLIB) $@ + $(CHMOD_6) $@ + + # Build all our objects that belong in the shared library. .PHONY: jrdlib_dependencies jrdlib_dependencies: $(FBUTIL_Objects) +# The following was just for testing + +testx: main.o $(FBUTIL_Objects) + g++ -o $@ $^ $(STATICLINK_LIBS) + + clean: -rm $(AllObjects) diff --git a/src/make.new/Makefile.in.firebird b/src/make.new/Makefile.in.firebird index 6d2ad743d5..fb5eb3bd50 100644 --- a/src/make.new/Makefile.in.firebird +++ b/src/make.new/Makefile.in.firebird @@ -26,7 +26,7 @@ # Contributor(s): # # -# $Id: Makefile.in.firebird,v 1.8 2001-08-20 08:15:33 skywalker Exp $ +# $Id: Makefile.in.firebird,v 1.9 2001-08-21 09:41:00 skywalker Exp $ # ROOT=.. @@ -40,7 +40,7 @@ include $(ROOT)/src/make.shared.variables ISC_USER= sysdba ISC_PASSWORD= masterkey -LD_LIBRARY_PATH=/home/odonohue/src/firebird2/gen/firebird/lib +LD_LIBRARY_PATH=/home/odonohue/src/firebird2/gen/firebird/lib:/usr/lib export ISC_USER export ISC_PASSWORD @@ -83,7 +83,7 @@ phase1: $(GPRE_STATIC) $(GPRE_STATIC): $(MAKE) phase1_build -phase1_build: jrd_boot gpre_boot build_alt_use_boot jrdlib_dependencies gpre_static +phase1_build: jrd_boot fbutil_boot gpre_boot build_alt_use_boot jrdlib_dependencies gpre_static gpre_static : jrdlib_dependencies $(MAKE) -C gpre $@ @@ -98,6 +98,8 @@ gpre_boot : jrd_boot jrd_boot : $(MAKE) -C jrd $@ +fbutil_boot : + $(MAKE) -C fbutil $@ diff --git a/src/make.new/Makefile.in.gpre b/src/make.new/Makefile.in.gpre index 65ba445f8d..067534d201 100644 --- a/src/make.new/Makefile.in.gpre +++ b/src/make.new/Makefile.in.gpre @@ -26,7 +26,7 @@ # Contributor(s): # # -# $Id: Makefile.in.gpre,v 1.6 2001-08-13 08:14:38 skywalker Exp $ +# $Id: Makefile.in.gpre,v 1.7 2001-08-21 09:41:00 skywalker Exp $ # ROOT=../.. @@ -75,7 +75,7 @@ gpre_static : $(GPRE_STATIC) gpre : $(GPRE) -$(GPRE_BOOT): $(GPRECommon_Objects) $(GPREBoot_Objects) $(LIB)/jrd_boot.a +$(GPRE_BOOT): $(GPRECommon_Objects) $(GPREBoot_Objects) $(LIB)/jrd_boot.a $(LIB)/fbutil_boot.a $(STATICEXE_LINK) -o $(GPRE_BOOT) $^ $(STATICLINK_LIBS) -$(RM) $(GPRE_CURRENT) $(LN) $(@F) $(GPRE_CURRENT) diff --git a/src/make.new/Makefile.in.lock b/src/make.new/Makefile.in.lock index 5de9e45844..082cd7cf7f 100644 --- a/src/make.new/Makefile.in.lock +++ b/src/make.new/Makefile.in.lock @@ -26,7 +26,7 @@ # Contributor(s): # # -# $Id: Makefile.in.lock,v 1.5 2001-08-13 08:14:38 skywalker Exp $ +# $Id: Makefile.in.lock,v 1.6 2001-08-21 09:41:00 skywalker Exp $ # ROOT=../.. @@ -80,7 +80,7 @@ jrdlib_dependencies: $(LOCK_Objects) gds_lock_manager : $(BIN)/gds_lock_mgr $(BIN)/gds_lock_mgr: $(LOCKMGR_Objects) $(BOOT_GDSLIB_Objects) - $(CXX) $(LINK_OPTS) $^ -o $@ $(LINK_LIBS) + $(CXX) $(LINK_OPTS) $^ -o $@ $(STATICLINK_LIBS) $(CHMOD_S7) $@ @@ -90,9 +90,9 @@ $(BIN)/gds_lock_mgr: $(LOCKMGR_Objects) $(BOOT_GDSLIB_Objects) # the "mgr" not "manager". -lock_print : $(BIN)/lock_print +lock_print : $(BIN)/gds_lock_print -$(BIN)/lock_print: $(LOCKPRINT_Objects) $(LIBGDS_DEP) +$(BIN)/gds_lock_print: $(LOCKPRINT_Objects) $(LIBGDS_DEP) $(CXX) $(LINK_OPTS) $(LIBGDS_LINK) $^ -o $@ $(LINK_LIBS) $(CHMOD_S7) $@ diff --git a/src/make.new/make.rules b/src/make.new/make.rules index 15d50b6307..6829783985 100644 --- a/src/make.new/make.rules +++ b/src/make.new/make.rules @@ -26,7 +26,7 @@ # Contributor(s): # # -# $Id: make.rules,v 1.8 2001-08-20 08:15:33 skywalker Exp $ +# $Id: make.rules,v 1.9 2001-08-21 09:41:00 skywalker Exp $ # #____________________________________________________________________________ @@ -121,20 +121,23 @@ else LIB_LINK= ld -shared STATICLIB_LINK= ar cruvs - LIB_LINK_OPTIONS = -soname libgds.so.2 -rpath /usr/lib + LIB_LINK_OPTIONS = -soname libgds.so -rpath /usr/lib +# LIB_LINK_OPTIONS = -soname libgds.so.2 -rpath /usr/lib # LIB_LINK_OPTIONS = - EXE_LINK = @CC@ - STATICEXE_LINK = @CXX@ + EXE_LINK = g++ + STATICEXE_LINK = g++ +# EXE_LINK = @CXX@ +# STATICEXE_LINK = @CXX@ endif LINK_OPTIONS= -LINK_LIBS= -lm -lstdc++ -lc -ldl -lcrypt +LINK_LIBS= -lm -lstdc++ -lgcc -lc -ldl -lcrypt #LINK_LIBS= -L$(LIB) -lgds -lm -lc -ldl -lcrypt -STATICLINK_LIBS = $(LINK_LIBS) +STATICLINK_LIBS = -lm -lstdc++ -lgcc -lc -ldl -lcrypt