diff --git a/builds/posix/make.shared.targets b/builds/posix/make.shared.targets index 7f3682baba..ae5ee5951d 100644 --- a/builds/posix/make.shared.targets +++ b/builds/posix/make.shared.targets @@ -48,8 +48,8 @@ $(OBJ)/dsql/parse.cpp $(SRC_ROOT)/include/gen/parse.h: $(SRC_ROOT)/dsql/parse.y ($(BTYACC) -l -d -S $(SRC_ROOT)/dsql/btyacc_fb.ske $(GEN_ROOT)/y.y; echo $$? > $(GEN_ROOT)/y.status) 2>&1 | tee $(GEN_ROOT)/y.txt (exit `cat $(GEN_ROOT)/y.status`) sed -n -e "s/.*btyacc: \(.*conflicts.*\)/\1/p" $(GEN_ROOT)/y.txt > $(SRC_ROOT)/dsql/parse-conflicts.txt - sed -i 's/#define \([A-Z].*\)/#define TOK_\1/' $(GEN_ROOT)/y_tab.h - sed -i 's/#define TOK_YY\(.*\)/#define YY\1/' $(GEN_ROOT)/y_tab.h + sed -i -e 's/#define \([A-Z].*\)/#define TOK_\1/' $(GEN_ROOT)/y_tab.h + sed -i -e 's/#define TOK_YY\(.*\)/#define YY\1/' $(GEN_ROOT)/y_tab.h $(MV) $(GEN_ROOT)/y_tab.h $(SRC_ROOT)/include/gen/parse.h $(MV) $(GEN_ROOT)/y_tab.c $(OBJ)/dsql/parse.cpp touch $(OBJ)/dsql/parse.cpp diff --git a/builds/posix/prefix.darwin_x86_64 b/builds/posix/prefix.darwin_x86_64 index c846a08ec7..04d832733f 100644 --- a/builds/posix/prefix.darwin_x86_64 +++ b/builds/posix/prefix.darwin_x86_64 @@ -28,7 +28,7 @@ export DYLD_LIBRARY_PATH DYLD_FALLBACK_LIBRARY_PATH=/opt/local/lib export DYLD_FALLBACK_LIBRARY_PATH -MACOSX_DEPLOYMENT_TARGET=10.7 +MACOSX_DEPLOYMENT_TARGET=10.9 export MACOSX_DEPLOYMENT_TARGET PROD_FLAGS=-O1 -DDARWIN -pipe -MMD -fPIC -fno-common -mmacosx-version-min=10.7 diff --git a/configure.ac b/configure.ac index 00d1070344..ac5a445f82 100644 --- a/configure.ac +++ b/configure.ac @@ -97,6 +97,7 @@ case "$build" in SHRLIB_EXT=dylib CPU_TYPE=x86_64 EXPORT_SYMBOLS_STYLE=darwin + RAW_DEVICES_FLG=N ;; i*86-*-darwin*) diff --git a/src/common/os/darwin/mod_loader.cpp b/src/common/os/darwin/mod_loader.cpp index 70f24b3507..8c0eae6d18 100644 --- a/src/common/os/darwin/mod_loader.cpp +++ b/src/common/os/darwin/mod_loader.cpp @@ -28,6 +28,7 @@ #include "firebird.h" #include "../common/os/mod_loader.h" +#include "../common/os/os_utils.h" #include "../../common.h" #include #include @@ -42,8 +43,9 @@ class DlfcnModule : public ModuleLoader::Module { public: - DlfcnModule(void* m) - : module(m) + DlfcnModule(MemoryPool& pool, const Firebird::PathName& aFileName, void* m) + : ModuleLoader::Module(pool, aFileName), + module(m) {} ~DlfcnModule(); @@ -55,7 +57,7 @@ private: bool ModuleLoader::isLoadableModule(const Firebird::PathName& module) { - struct STAT sb; + struct stat sb; if (-1 == os_utils::stat(module.c_str(), &sb)) return false; @@ -123,7 +125,7 @@ ModuleLoader::Module* ModuleLoader::loadModule(ISC_STATUS* status, const Firebir return 0; } - return FB_NEW_POOL(*getDefaultMemoryPool()) DlfcnModule(module); + return FB_NEW_POOL(*getDefaultMemoryPool()) DlfcnModule(*getDefaultMemoryPool(), modPath, module); } DlfcnModule::~DlfcnModule() diff --git a/src/common/os/os_utils.h b/src/common/os/os_utils.h index c4c70857d0..45c474552d 100644 --- a/src/common/os/os_utils.h +++ b/src/common/os/os_utils.h @@ -292,6 +292,7 @@ namespace os_utils return rc; } +#ifdef HAVE_POSIX_FADVISE inline int posix_fadvise(int fd, off_t offset, off_t len, int advice) { int rc; @@ -307,6 +308,12 @@ namespace os_utils return rc; } +#else + inline int posix_fadvise(int, off_t, off_t, int) + { + return 0; + } +#endif inline int getrlimit(int resource, struct rlimit* rlim) { diff --git a/src/gpre/c_cxx.cpp b/src/gpre/c_cxx.cpp index 6e879484d8..09da5a5471 100644 --- a/src/gpre/c_cxx.cpp +++ b/src/gpre/c_cxx.cpp @@ -138,11 +138,7 @@ static const char* const NULL_STRING = "(char*) 0"; static const char* const NULL_STATUS = "NULL"; static const char* const NULL_SQLDA = "NULL"; -#ifdef DARWIN -static const char* const GDS_INCLUDE = ""; -#else static const char* const GDS_INCLUDE = ""; -#endif static const char* const DCL_LONG = "ISC_LONG"; static const char* const DCL_QUAD = "ISC_QUAD"; diff --git a/src/gpre/obj_cxx.cpp b/src/gpre/obj_cxx.cpp index ecb6ea316c..6a41b7d449 100644 --- a/src/gpre/obj_cxx.cpp +++ b/src/gpre/obj_cxx.cpp @@ -138,11 +138,7 @@ static const char* const NULL_STRING = "NULL"; static const char* const NULL_STATUS = "NULL"; static const char* const NULL_SQLDA = "NULL"; -#ifdef DARWIN -static const char* const GDS_INCLUDE = ""; -#else static const char* const GDS_INCLUDE = ""; -#endif static const char* const DCL_LONG = "ISC_LONG"; static const char* const DCL_QUAD = "ISC_QUAD";