8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-22 16:43:03 +01:00

Fixes for MacOS build.

This commit is contained in:
Adriano dos Santos Fernandes 2019-12-01 10:32:06 -03:00
parent d8f90b0aec
commit de57ae7f5e
7 changed files with 17 additions and 15 deletions

View File

@ -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

View File

@ -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

View File

@ -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*)

View File

@ -28,6 +28,7 @@
#include "firebird.h"
#include "../common/os/mod_loader.h"
#include "../common/os/os_utils.h"
#include "../../common.h"
#include <unistd.h>
#include <sys/types.h>
@ -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()

View File

@ -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)
{

View File

@ -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 = "<Firebird/ibase.h>";
#else
static const char* const GDS_INCLUDE = "<ibase.h>";
#endif
static const char* const DCL_LONG = "ISC_LONG";
static const char* const DCL_QUAD = "ISC_QUAD";

View File

@ -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 = "<Firebird/ibase.h>";
#else
static const char* const GDS_INCLUDE = "<ibase.h>";
#endif
static const char* const DCL_LONG = "ISC_LONG";
static const char* const DCL_QUAD = "ISC_QUAD";