summaryrefslogtreecommitdiffstats
path: root/external/firebird/firebird-macosx.patch.1
blob: 676f2195ad5594b6b16c0910a20840526bd67cb3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
--- firebird.org/builds/posix/Makefile.in.examples
+++ firebird/builds/posix/Makefile.in.examples
@@ -134,7 +134,7 @@
 	$(LN) $(ISQL) $(EXAMPLES_DEST)/isql$(EXEC_EXT)
 
 $(EXAMPLES_DEST)/empbuild$(EXEC_EXT): $(EMPBLD_Objects) $(COMMON_LIB)
-	$(EXE_LINK) $(EXE_LINK_OPTIONS) $^ -o $@ -L$(LIB) $(FIREBIRD_LIBRARY_LINK) $(LINK_LIBS)
+	$(EXE_LINK) $(EXE_LINK_OPTIONS) $^ -o $@ -L$(LIB) $(FIREBIRD_LIBRARY_LINK) $(LINK_LIBS) $(call LINK_DARWIN_RPATH,../$(if $(ENABLE_DEBUG),Debug,Release)/firebird)
 
 $(EXAMPLES_DEST)/empbuild.c:	$(EXAMPLES_DEST)/empbuild.fdb $(EXAMPLES_DEST)/empbuild.e
 
--- firebird.org/builds/posix/prefix.darwin_x86_64	2016-08-01 20:02:48.000000000 +0200
+++ firebird/builds/posix/prefix.darwin_x86_64	2016-08-01 21:42:45.000000000 +0200
@@ -27,9 +27,6 @@
 # configure using --with-builtin-tommath
 # or add the relevant -I, -L for an installed version of libtommath
 
-DYLD_LIBRARY_PATH=$(HOME)/icu54/icu/source/lib
-export DYLD_LIBRARY_PATH
-
 #DYLD_PRINT_ENV=1
 #export DYLD_PRINT_ENV

@@ -31,8 +31,8 @@
 MACOSX_DEPLOYMENT_TARGET=10.9
 export MACOSX_DEPLOYMENT_TARGET
 
-PROD_FLAGS=-DDARWIN -pipe -O2 -MMD -fPIC -fno-common -mmacosx-version-min=10.9
-DEV_FLAGS=-ggdb -DDARWIN -pipe -MMD -fPIC -fno-omit-frame-pointer -fno-common -Wall -fno-optimize-sibling-calls -mmacosx-version-min=10.9 -Wno-non-virtual-dtor
+PROD_FLAGS=-DDARWIN -pipe -O2 -MMD -fPIC -fno-common
+DEV_FLAGS=-ggdb -DDARWIN -pipe -MMD -fPIC -fno-omit-frame-pointer -fno-common -Wall -fno-optimize-sibling-calls -Wno-non-virtual-dtor
 CXXFLAGS:=$(CXXFLAGS) -fvisibility-inlines-hidden -fvisibility=hidden -stdlib=libc++ -msse4
 
 EXE_LINK_OPTIONS:=
--- firebird.org/src/common/unicode_util.cpp	2016-07-07 13:55:55.992234709 +0200
+++ firebird/src/common/unicode_util.cpp	2016-08-10 11:25:46.422331020 +0200
@@ -63,8 +63,8 @@
 const char* const ucTemplate = "icuuc%s.dll";
 #endif
 #elif defined(DARWIN)
-const char* const inTemplate = "lib/libicui18n.%s.dylib";
-const char* const ucTemplate = "lib/libicuuc.%s.dylib";
+const char* const inTemplate = "libicui18n.dylib.%s";
+const char* const ucTemplate = "libicuuc.dylib.%s";
 #elif defined(HPUX)
 const char* const inTemplate = "libicui18n.sl.%s";
 const char* const ucTemplate = "libicuuc.sl.%s";
@@ -354,6 +354,16 @@
 	{
 		s.printf(*p, majorVersion, minorVersion);
 		filename.printf(templateName, s.c_str());
+		const char * envpath = getenv("LIBREOFFICE_FIREBIRD_LIB");
+		if(envpath == nullptr)
+		{
+			envpath = getenv("LIBREOFFICE_ICU_LIB");
+		}
+		if(envpath != nullptr)
+		{
+			s = filename.c_str();
+			PathUtils::concatPath(filename, envpath, s.c_str());
+		}
 
 		ModuleLoader::Module* module = ModuleLoader::fixAndLoadModule(NULL, filename);
 		if (module)
--- firebird.org/src/common/utils.cpp	2016-08-16 10:11:10.000000000 +0200
+++ firebird/src/common/utils.cpp	2016-08-16 11:27:09.000000000 +0200
@@ -1027,10 +1027,18 @@
 			return s;
 		}
 
-                // Set relative path to Engine12 dynamic library
+                // Set path to Engine12 dynamic library.
                 if(prefType == Firebird::IConfigManager::DIR_PLUGINS)
                 {
-                    s = name;
+                    const char * const envpath = getenv("LIBREOFFICE_FIREBIRD_LIB");
+                    if(envpath != nullptr)
+                    {
+                        PathUtils::concatPath(s, envpath, name);
+                    }
+                    else
+                    {
+                        s = name;
+                    }
                     return s;
                 }
 	}