remove firebird2-git

This commit is contained in:
مهدي شينون (Mehdi Chinoune)
2024-01-18 11:53:32 +01:00
parent 45784c4c51
commit ffaa584102
34 changed files with 0 additions and 4049 deletions

View File

@@ -1,27 +0,0 @@
From 1b88368a75d416898d19fc5459fabf7e0a93baa7 Mon Sep 17 00:00:00 2001
From: Alexpux <alexey.pawlow@gmail.com>
Date: Wed, 19 Nov 2014 07:39:37 +0300
Subject: [PATCH 01/27] Remove hardcoded march to allow 64-bit builds.
---
builds/posix/prefix.mingw | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/builds/posix/prefix.mingw b/builds/posix/prefix.mingw
index fd36abe8be..04e0978aa9 100644
--- a/builds/posix/prefix.mingw
+++ b/builds/posix/prefix.mingw
@@ -20,8 +20,8 @@
#
# -Wno-unused-variable is used due to unused gpre generated variables
-PROD_FLAGS=-O2 -march=i586 -DMINGW -Wall -Wshadow -Wundef -Wno-long-long -Wno-unused-variable -Wno-sign-compare -Wno-parentheses -Wno-switch -fmessage-length=0 -Dlint -DWIN32_LEAN_AND_MEAN -MMD -mthreads
-DEV_FLAGS=-ggdb -march=i586 -DMINGW -Wall -Wshadow -Wundef -Wno-long-long -Wno-unused-variable -Wno-sign-compare -Wno-parentheses -Wno-switch -fmessage-length=0 -Dlint -DWIN32_LEAN_AND_MEAN -MMD -mthreads
+PROD_FLAGS=-O2 -DMINGW -Wall -Wshadow -Wundef -Wno-long-long -Wno-unused-variable -Wno-sign-compare -Wno-parentheses -Wno-switch -fmessage-length=0 -Dlint -DWIN32_LEAN_AND_MEAN -MMD -mthreads
+DEV_FLAGS=-ggdb -DMINGW -Wall -Wshadow -Wundef -Wno-long-long -Wno-unused-variable -Wno-sign-compare -Wno-parentheses -Wno-switch -fmessage-length=0 -Dlint -DWIN32_LEAN_AND_MEAN -MMD -mthreads
PLATFORM_PATH=os/win32
--
2.13.0

View File

@@ -1,25 +0,0 @@
From 9345eddc1b31aef3530359809cb6b5ac6d4a4a79 Mon Sep 17 00:00:00 2001
From: Alexpux <alexey.pawlow@gmail.com>
Date: Wed, 19 Nov 2014 06:18:02 +0300
Subject: [PATCH 02/27] Always use Win32 threads for mingw.
---
src/jrd/common.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/jrd/common.h b/src/jrd/common.h
index ae54880929..49e8b607d8 100644
--- a/src/jrd/common.h
+++ b/src/jrd/common.h
@@ -65,7 +65,7 @@
#include <unistd.h>
#endif
-#if defined(_POSIX_THREADS) && _POSIX_THREADS >= 200112L
+#if defined(_POSIX_THREADS) && _POSIX_THREADS >= 200112L && !defined(WIN_NT)
// above check is generally true. However, we use pthreads on some platforms
// where _POSIX_THREADS is defined to "1" or not even defined at all!
#define USE_POSIX_THREADS
--
2.13.0

View File

@@ -1,30 +0,0 @@
From 52d9003e807dc18c460bed6b3654a97c996ccfe4 Mon Sep 17 00:00:00 2001
From: Alexpux <alexey.pawlow@gmail.com>
Date: Wed, 19 Nov 2014 08:56:28 +0300
Subject: [PATCH 03/27] Define AMD64 for 64-bit mingw.
---
configure.in | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/configure.in b/configure.in
index fe2cc11d0a..21384bf391 100644
--- a/configure.in
+++ b/configure.in
@@ -464,7 +464,12 @@ dnl CPU_TYPE=ppc64
EDITLINE_FLG=N
RAW_DEVICES_FLG=N
SHRLIB_EXT=dll
- ICU_PLATFORM=MinGW
+ ICU_PLATFORM=MinGW
+ case "$target" in
+ x86_64-*-mingw*)
+ AC_DEFINE(AMD64, 1, [Define this if CPU is amd64])
+ ;;
+ esac
;;
*)
--
2.13.0

View File

@@ -1,30 +0,0 @@
From 2980d42e1b6164dddc62e78edaac8b99ccf8f83f Mon Sep 17 00:00:00 2001
From: Alexpux <alexey.pawlow@gmail.com>
Date: Wed, 19 Nov 2014 09:20:35 +0300
Subject: [PATCH 04/27] mingw-w64 have isinf
---
src/common/classes/FpeControl.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/common/classes/FpeControl.h b/src/common/classes/FpeControl.h
index e0e36acafa..ecc334b805 100644
--- a/src/common/classes/FpeControl.h
+++ b/src/common/classes/FpeControl.h
@@ -217,11 +217,11 @@ private:
// getting a portable isinf() is harder than you would expect
-#ifdef WIN_NT
+#if defined(_MSC_VER)
inline bool isinf(double x)
{
return (!_finite (x) && !isnan(x));
}
-#endif // WIN_NT
+#endif // _MSC_VER
#endif //CLASSES_FPE_CONTROL_H
--
2.13.0

View File

@@ -1,34 +0,0 @@
From 94a88c81c24c948f163109a86aea62ad04ee1ba6 Mon Sep 17 00:00:00 2001
From: Alexpux <alexey.pawlow@gmail.com>
Date: Wed, 19 Nov 2014 09:57:27 +0300
Subject: [PATCH 05/27] Fix cast error.
---
src/remote/inet.cpp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/remote/inet.cpp b/src/remote/inet.cpp
index 2f1f63dea0..9a3e9a120a 100644
--- a/src/remote/inet.cpp
+++ b/src/remote/inet.cpp
@@ -1888,7 +1888,7 @@ static void wsaExitHandler(void*)
}
-static int fork(SOCKET old_handle, USHORT flag)
+static int fork(SOCKET old_handle, DWORD flag)
{
/**************************************
*
@@ -1945,7 +1945,7 @@ static int fork(SOCKET old_handle, USHORT flag)
THREAD_ENTRY_DECLARE forkThread(THREAD_ENTRY_PARAM arg)
{
- const USHORT flag = (USHORT) arg;
+ const DWORD flag = (uintptr_t) arg;
while (!INET_shutting_down)
{
--
2.13.0

View File

@@ -1,25 +0,0 @@
From 3111e94f0404818ac20d51f7261c195dda4301f4 Mon Sep 17 00:00:00 2001
From: Alexpux <alexey.pawlow@gmail.com>
Date: Wed, 19 Nov 2014 10:08:42 +0300
Subject: [PATCH 06/27] mingw-w64 don't need hack for SecPkgContext_AccessToken
---
src/auth/trusted/AuthSspi.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/auth/trusted/AuthSspi.cpp b/src/auth/trusted/AuthSspi.cpp
index d420041ee1..15b859c703 100644
--- a/src/auth/trusted/AuthSspi.cpp
+++ b/src/auth/trusted/AuthSspi.cpp
@@ -87,7 +87,7 @@ AuthSspi::~AuthSspi()
bool AuthSspi::checkAdminPrivilege(PCtxtHandle phContext) const
{
-#if defined (__GNUC__)
+#if defined (__GNUC__) && !defined(__MINGW64_VERSION_MAJOR)
// ASF: MinGW hack.
struct SecPkgContext_AccessToken
{
--
2.13.0

View File

@@ -1,28 +0,0 @@
From 7e8ba6ce7d71757825fec96011c29f1cd7940d89 Mon Sep 17 00:00:00 2001
From: Alexpux <alexey.pawlow@gmail.com>
Date: Wed, 19 Nov 2014 10:09:19 +0300
Subject: [PATCH 07/27] Use modern ICU libraries when link with system wide
ICU.
---
builds/posix/prefix.mingw | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/builds/posix/prefix.mingw b/builds/posix/prefix.mingw
index 04e0978aa9..7523670f6d 100644
--- a/builds/posix/prefix.mingw
+++ b/builds/posix/prefix.mingw
@@ -19,6 +19,10 @@
# 2003-Sep-27 BRS Removed IPSERVER after XNET is included
#
+ifeq ($(STD_ICU),true)
+ ICU_LIBS= -licuuc -licudt -licuin
+endif
+
# -Wno-unused-variable is used due to unused gpre generated variables
PROD_FLAGS=-O2 -DMINGW -Wall -Wshadow -Wundef -Wno-long-long -Wno-unused-variable -Wno-sign-compare -Wno-parentheses -Wno-switch -fmessage-length=0 -Dlint -DWIN32_LEAN_AND_MEAN -MMD -mthreads
DEV_FLAGS=-ggdb -DMINGW -Wall -Wshadow -Wundef -Wno-long-long -Wno-unused-variable -Wno-sign-compare -Wno-parentheses -Wno-switch -fmessage-length=0 -Dlint -DWIN32_LEAN_AND_MEAN -MMD -mthreads
--
2.13.0

View File

@@ -1,25 +0,0 @@
From 92c6963b88f38a3f14f14f510b2d803bf95e40b5 Mon Sep 17 00:00:00 2001
From: Alexpux <alexey.pawlow@gmail.com>
Date: Wed, 19 Nov 2014 13:28:03 +0300
Subject: [PATCH 08/27] mingw-w64 don't have win98 support.
---
src/common/classes/locks.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/common/classes/locks.cpp b/src/common/classes/locks.cpp
index bbb9440b32..de6b2f8e36 100644
--- a/src/common/classes/locks.cpp
+++ b/src/common/classes/locks.cpp
@@ -28,7 +28,7 @@
#include "../../include/firebird.h"
#include "../../jrd/common.h"
-#if defined(WIN_NT)
+#if defined(WIN_NT) && !defined(__MINGW64_VERSION_MAJOR)
// minimum win32 version: win98 / winnt4 SP3
#define _WIN32_WINNT 0x0403
#endif
--
2.13.0

View File

@@ -1,29 +0,0 @@
From 40736d1d9af81885b284c22d12544bc534ca9a9c Mon Sep 17 00:00:00 2001
From: Alexpux <alexey.pawlow@gmail.com>
Date: Wed, 19 Nov 2014 18:54:37 +0300
Subject: [PATCH 09/27] Fix redefinition of matherr.
---
src/extlib/ib_udf.cpp | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/extlib/ib_udf.cpp b/src/extlib/ib_udf.cpp
index c5a620d5e6..9017228002 100644
--- a/src/extlib/ib_udf.cpp
+++ b/src/extlib/ib_udf.cpp
@@ -50,10 +50,12 @@ extern "C"
#else
#define exception_type __exception
#endif
+#ifndef matherr
int MATHERR(struct exception_type*)
{
return 1;
}
+#endif
#undef exception_type
#endif /* SOLARIS */
#endif //__ICC
--
2.13.0

View File

@@ -1,26 +0,0 @@
From a3bf1d09e6957eff7583e5a1f5f7f329020aa462 Mon Sep 17 00:00:00 2001
From: Alexpux <alexey.pawlow@gmail.com>
Date: Wed, 19 Nov 2014 21:44:53 +0300
Subject: [PATCH 10/27] Don't export gds__print_pool as it not part of API
according to gds_proto.h:135
---
src/jrd/gds.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/jrd/gds.cpp b/src/jrd/gds.cpp
index 44fdbf7a30..a4ccaa9ac7 100644
--- a/src/jrd/gds.cpp
+++ b/src/jrd/gds.cpp
@@ -1226,7 +1226,7 @@ void API_ROUTINE gds__log(const TEXT* text, ...)
#endif
}
-void API_ROUTINE gds__print_pool(MemoryPool* pool, const TEXT* text, ...)
+void gds__print_pool(MemoryPool* pool, const TEXT* text, ...)
{
/**************************************
*
--
2.13.0

View File

@@ -1,34 +0,0 @@
From 95d0091b613b32a904db451147e56fdde4f5c122 Mon Sep 17 00:00:00 2001
From: Alexpux <alexey.pawlow@gmail.com>
Date: Wed, 19 Nov 2014 21:44:53 +0300
Subject: [PATCH 11/27] mingw-w64 have fenv.h
---
src/common/classes/FpeControl.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/classes/FpeControl.h b/src/common/classes/FpeControl.h
index ecc334b805..f5587ea564 100644
--- a/src/common/classes/FpeControl.h
+++ b/src/common/classes/FpeControl.h
@@ -30,7 +30,7 @@
#define CLASSES_FPE_CONTROL_H
#include <math.h>
-#if defined(WIN_NT)
+#if defined(_MSC_VER)
#include <float.h>
#else
#include <fenv.h>
@@ -78,7 +78,7 @@ public:
}
}
-#if defined(WIN_NT)
+#if defined(_MSC_VER)
static void maskAll() throw()
{
_clearfp(); // always call _clearfp() before setting control word
--
2.13.0

View File

@@ -1,25 +0,0 @@
From 3133bde97438739f9d416e85302f346d1a5a1899 Mon Sep 17 00:00:00 2001
From: Alexpux <alexey.pawlow@gmail.com>
Date: Fri, 21 Nov 2014 21:44:53 +0300
Subject: [PATCH 12/27] Fix cast error for 64-bit.
---
src/remote/os/win32/srvr_w32.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/remote/os/win32/srvr_w32.cpp b/src/remote/os/win32/srvr_w32.cpp
index fd0f75c692..a0bf167bbe 100644
--- a/src/remote/os/win32/srvr_w32.cpp
+++ b/src/remote/os/win32/srvr_w32.cpp
@@ -269,7 +269,7 @@ int WINAPI WinMain(HINSTANCE hThisInst, HINSTANCE /*hPrevInst*/, LPSTR lpszArgs,
else if (server_flag & SRVR_wnet)
port = WNET_reconnect(connection_handle, status_vector);
else if (server_flag & SRVR_xnet)
- port = XNET_reconnect((ULONG) connection_handle, status_vector);
+ port = XNET_reconnect((ULONG_PTR) connection_handle, status_vector);
if (port) {
service_connection(port);
--
2.13.0

View File

@@ -1,25 +0,0 @@
From b44435148212da2bf91490e12722ef59c8efd3ea Mon Sep 17 00:00:00 2001
From: Alexpux <alexey.pawlow@gmail.com>
Date: Fri, 21 Nov 2014 21:44:53 +0300
Subject: [PATCH 13/27] Fix source extension.
---
builds/posix/prefix.mingw | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/builds/posix/prefix.mingw b/builds/posix/prefix.mingw
index 7523670f6d..ac1327c46c 100644
--- a/builds/posix/prefix.mingw
+++ b/builds/posix/prefix.mingw
@@ -31,7 +31,7 @@ PLATFORM_PATH=os/win32
OS_SPECIFIC_Files=thd_priority.cpp
-OS_ServerFiles= os/win32/srvr_w32 os/win32/window.cpp os/win32/chop.cpp os/win32/property.cpp os/win32/cntl.cpp
+OS_ServerFiles= os/win32/srvr_w32.cpp os/win32/window.cpp os/win32/chop.cpp os/win32/property.cpp os/win32/cntl.cpp
# Override link command for implicit stdc++ linking
LIB_LINK=$(LD)
--
2.13.0

View File

@@ -1,40 +0,0 @@
From 3ef250d8ffa5a949012c71518cc1201f7d84d606 Mon Sep 17 00:00:00 2001
From: Alexpux <alexey.pawlow@gmail.com>
Date: Sat, 22 Nov 2014 12:03:41 +0300
Subject: [PATCH 14/27] Move extra mingw sources definitions for fbintl to
Makefile.in.intl
---
builds/posix/Makefile.in.intl | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/builds/posix/Makefile.in.intl b/builds/posix/Makefile.in.intl
index 1bd37d02f2..d5a2c8bebc 100644
--- a/builds/posix/Makefile.in.intl
+++ b/builds/posix/Makefile.in.intl
@@ -52,6 +52,13 @@ INTL_Files1= ld.cpp cv_narrow.cpp \
cs_ksc.cpp cv_ksc.cpp lc_ksc.cpp \
cs_icu.cpp cv_icu.cpp lc_icu.cpp
+ifeq ($(PLATFORM),win32)
+INTL_Files2 += $(FBCONFIG_Sources) \
+ $(FBCLASSES_MsgSources) \
+ $(OS_SPECIFIC_Sources) \
+ jrd/isc.cpp jrd/gds.cpp \
+ common/utils.cpp
+endif
# use INTL_Files2 in prefix file for host-specific additional files
INTL_Sources= $(addprefix intl/, $(INTL_Files1)) $(INTL_Files2) \
jrd/IntlUtil.cpp jrd/unicode_util.cpp jrd/CharSet.cpp jrd/mod_loader.cpp jrd/path_utils.cpp
@@ -61,7 +68,7 @@ INTL_Objects = $(addprefix $(OBJ)/, $(addsuffix .o, $(basename $(INTL_Sources)))
# SD: Shared variables are overriden to exclude extra files and
# this way fix 'unresolved symbol' errors when some unused routines call
# other routines from not included modules
-FBCLASSES_ClientFiles=alloc.cpp locks.cpp fb_string.cpp timestamp.cpp
+FBCLASSES_ClientFiles=alloc.cpp locks.cpp fb_string.cpp timestamp.cpp TempFile.cpp
AllObjects = $(INTL_Objects)
--
2.13.0

View File

@@ -1,102 +0,0 @@
From 8fa9f201df10cee4f5f21d9d439798de8f433d8d Mon Sep 17 00:00:00 2001
From: Alexpux <alexey.pawlow@gmail.com>
Date: Sat, 22 Nov 2014 22:59:59 +0300
Subject: [PATCH 15/27] Add missing sources for utils building.
---
builds/posix/Makefile.in.client.gsec | 2 +-
builds/posix/Makefile.in.client.util | 4 ++--
builds/posix/Makefile.in.embed.util | 8 ++++----
builds/posix/Makefile.in.fbtrace | 2 +-
4 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/builds/posix/Makefile.in.client.gsec b/builds/posix/Makefile.in.client.gsec
index 2efa520f3a..803ea4f71f 100644
--- a/builds/posix/Makefile.in.client.gsec
+++ b/builds/posix/Makefile.in.client.gsec
@@ -29,7 +29,7 @@ include $(ROOT)/gen/make.shared.variables
@SET_MAKE@
-GSEC_Other_Sources = jrd/isc_file.cpp jrd/ThreadData.cpp common/UtilSvc.cpp jrd/enc.cpp \
+GSEC_Other_Sources = jrd/isc.cpp jrd/isc_file.cpp jrd/ThreadData.cpp common/UtilSvc.cpp jrd/enc.cpp \
jrd/sha.cpp jrd/guid.cpp
GSEC_Files = gsec.cpp call_service.cpp gsecMain.cpp security.cpp
GSEC_Sources = $(addprefix utilities/gsec/, $(GSEC_Files)) $(GSEC_Other_Sources)
diff --git a/builds/posix/Makefile.in.client.util b/builds/posix/Makefile.in.client.util
index dab8911753..70bfab7901 100644
--- a/builds/posix/Makefile.in.client.util
+++ b/builds/posix/Makefile.in.client.util
@@ -40,14 +40,14 @@ include $(ROOT)/gen/make.shared.variables
@SET_MAKE@
-LOCKPRINT_Other_Sources = jrd/isc_sync.cpp jrd/isc.cpp jrd/db_alias.cpp \
+LOCKPRINT_Other_Sources = jrd/isc_ipc.cpp jrd/isc_sync.cpp jrd/isc.cpp jrd/db_alias.cpp \
common/config/config.cpp common/config/config_file.cpp $(OS_SPECIFIC_Sources)
LOCKPRINT_Files= print.cpp
LOCKPRINT_Sources = $(addprefix lock/, $(LOCKPRINT_Files)) $(LOCKPRINT_Other_Sources)
LOCKPRINT_Objects = $(addprefix $(OBJ)/, $(addsuffix .o, $(basename $(LOCKPRINT_Sources)))) \
$(FBCONFIG_Objects)
-NBACKUP_Other_Sources = jrd/isc_file.cpp jrd/db_alias.cpp common/UtilSvc.cpp $(OS_SPECIFIC_Sources)
+NBACKUP_Other_Sources = jrd/isc.cpp jrd/isc_file.cpp jrd/db_alias.cpp common/UtilSvc.cpp $(OS_SPECIFIC_Sources)
NBACKUP_Files= nbackup.cpp nbackup/nbkMain.cpp
NBACKUP_Sources = $(addprefix utilities/, $(NBACKUP_Files)) $(NBACKUP_Other_Sources)
NBACKUP_Objects = $(addprefix $(OBJ)/, $(addsuffix .o, $(basename $(NBACKUP_Sources)))) \
diff --git a/builds/posix/Makefile.in.embed.util b/builds/posix/Makefile.in.embed.util
index 3d1a98fbb7..8488a05473 100644
--- a/builds/posix/Makefile.in.embed.util
+++ b/builds/posix/Makefile.in.embed.util
@@ -40,7 +40,7 @@ include $(ROOT)/gen/make.shared.variables
@SET_MAKE@
-LOCKPRINT_Other_Sources += jrd/isc_sync.cpp jrd/isc.cpp jrd/db_alias.cpp \
+LOCKPRINT_Other_Sources += jrd/isc_ipc.cpp jrd/isc_sync.cpp jrd/isc.cpp jrd/db_alias.cpp \
$(OS_SPECIFIC_Sources)
LOCKPRINT_Files= print.cpp
@@ -48,7 +48,7 @@ LOCKPRINT_Sources = $(addprefix lock/, $(LOCKPRINT_Files)) $(LOCKPRINT_Other_Sou
LOCKPRINT_Objects = $(addprefix $(OBJ)/, $(addsuffix .o, $(basename $(LOCKPRINT_Sources)))) \
$(FBCONFIG_Objects)
-NBACKUP_Other_Sources = jrd/isc_file.cpp jrd/db_alias.cpp common/UtilSvc.cpp $(OS_SPECIFIC_Sources)
+NBACKUP_Other_Sources = jrd/isc.cpp jrd/isc_file.cpp jrd/db_alias.cpp common/UtilSvc.cpp $(OS_SPECIFIC_Sources)
NBACKUP_Files= nbackup.cpp nbackup/nbkMain.cpp
NBACKUP_Sources = $(addprefix utilities/, $(NBACKUP_Files)) $(NBACKUP_Other_Sources)
@@ -65,7 +65,7 @@ DROP_Objects = $(addprefix $(OBJ)/, $(addsuffix .o, $(basename $(DROP_Sources)))
GSEC_Other_Sources = jrd/enc.cpp jrd/sha.cpp jrd/guid.cpp \
-jrd/isc_file.cpp common/config/config.cpp common/config/config_file.cpp \
+jrd/isc.cpp jrd/isc_file.cpp common/config/config.cpp common/config/config_file.cpp \
common/config/dir_list.cpp \
common/UtilSvc.cpp jrd/ThreadData.cpp \
$(OS_SPECIFIC_Sources)
@@ -76,7 +76,7 @@ GSEC_Objects = $(addprefix $(OBJ)/, $(addsuffix .o, $(basename $(GSEC_Sources)))
GSTAT_Other_Sources = jrd/btn.cpp jrd/db_alias.cpp common/utils.cpp jrd/ods.cpp \
-common/UtilSvc.cpp jrd/ThreadData.cpp jrd/isc_file.cpp $(OS_SPECIFIC_Sources)
+common/UtilSvc.cpp jrd/ThreadData.cpp jrd/isc.cpp jrd/isc_file.cpp $(OS_SPECIFIC_Sources)
GSTAT_Files = dba.epp ppg.cpp gstatMain.cpp
GSTAT_Sources = $(addprefix utilities/gstat/, $(GSTAT_Files)) $(GSTAT_Other_Sources)
diff --git a/builds/posix/Makefile.in.fbtrace b/builds/posix/Makefile.in.fbtrace
index 0f1a09ec2b..daee0d8954 100644
--- a/builds/posix/Makefile.in.fbtrace
+++ b/builds/posix/Makefile.in.fbtrace
@@ -49,7 +49,7 @@ FBTRACE_UTIL_Objects = $(addprefix $(OBJ)/, $(addsuffix .o, $(basename $(FBTRACE
FBTRACE_OTHER_Sources = $(OS_SPECIFIC_Sources) $(TRACE_OS_Sources) \
- jrd/isc.cpp jrd/isc_file.cpp jrd/CharSet.cpp jrd/TextType.cpp \
+ jrd/isc.cpp jrd/isc_file.cpp jrd/isc_sync.cpp jrd/CharSet.cpp jrd/TextType.cpp \
jrd/IntlUtil.cpp jrd/unicode_util.cpp common/classes/ClumpletReader.cpp common/utils.cpp
FBTRACE_OTHER_Objects = $(addprefix $(OBJ)/, $(addsuffix .o, $(basename $(FBTRACE_OTHER_Sources))))
--
2.13.0

View File

@@ -1,26 +0,0 @@
From 0d4ab03c720bdcd5a8966d38d98672a81e914614 Mon Sep 17 00:00:00 2001
From: Alexpux <alexey.pawlow@gmail.com>
Date: Sun, 23 Nov 2014 00:13:24 +0300
Subject: [PATCH 16/27] smtp_server: Add win32 platform files.
---
builds/posix/Makefile.in.inet_server | 3 +++
1 file changed, 3 insertions(+)
diff --git a/builds/posix/Makefile.in.inet_server b/builds/posix/Makefile.in.inet_server
index d59b07a39e..ad471fda12 100644
--- a/builds/posix/Makefile.in.inet_server
+++ b/builds/posix/Makefile.in.inet_server
@@ -40,6 +40,9 @@ include $(ROOT)/gen/make.shared.variables
SERVER_Files = server_stub.cpp
SERVER_Sources = $(addprefix remote/, $(SERVER_Files))
+ifeq ($(PLATFORM),win32)
+SERVER_Sources += utilities/nbackup/nbkMain.cpp common/UtilSvc.cpp
+endif
SERVER_Objects = $(addprefix $(OBJ)/, $(addsuffix .o, $(basename $(SERVER_Sources))))
AllObjects = $(SERVER_Objects)
--
2.13.0

View File

@@ -1,43 +0,0 @@
From ca51dedfbfc1489aafcb638b5f4ae45cefb5fbf3 Mon Sep 17 00:00:00 2001
From: Alexpux <alexey.pawlow@gmail.com>
Date: Sun, 23 Nov 2014 13:27:02 +0300
Subject: [PATCH 17/27] Fix building net_server and mp_server with mingw
---
builds/posix/Makefile.in.inet_server | 4 ++--
builds/posix/Makefile.in.smp_server | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/builds/posix/Makefile.in.inet_server b/builds/posix/Makefile.in.inet_server
index ad471fda12..99ddd19753 100644
--- a/builds/posix/Makefile.in.inet_server
+++ b/builds/posix/Makefile.in.inet_server
@@ -54,8 +54,8 @@ Dependencies = $(AllObjects:.o=.d)
# but we must ensure it's existance
fb_inet_server : $(LIBFBEMBED_SO) $(FB_CLASSIC_SERVER)
-$(FB_CLASSIC_SERVER): $(SERVER_Objects)
- $(EXE_LINK) $(LINK_EMPTY_SYMBOLS) $(LINK_OPTS) $^ -o $@ $(FBEMBED_LINK) $(LIB_GUI) $(LINK_LIBS)
+$(FB_CLASSIC_SERVER): $(SERVER_Objects) $(COMMON_Objects) $(CLUMPLETS_Objects) $(FBCONFIG_Objects) $(OS_SPECIFIC_Objects) $(DSQL_Objects) $(BURP_Objects) $(ALICE_Objects) $(LOCK_Objects) $(INTERFACE_Objects) $(NBACKUP_SERVER_Objects) $(NTRACE_SERVER_Objects) $(SECURITY_Objects) $(JRD_Objects)
+ $(EXE_LINK) $(LINK_EMPTY_SYMBOLS) $(LINK_OPTS) $^ -o $@ $(FBEMBED_LINK) $(LIB_GUI) $(ICU_LIBS) $(LINK_LIBS)
include $(ROOT)/gen/make.shared.targets
diff --git a/builds/posix/Makefile.in.smp_server b/builds/posix/Makefile.in.smp_server
index 1bc387230e..f3860213ef 100644
--- a/builds/posix/Makefile.in.smp_server
+++ b/builds/posix/Makefile.in.smp_server
@@ -59,8 +59,8 @@ $(OS_SPECIFIC_Objects)
fb_smp_server: $(FB_DAEMON)
-$(FB_DAEMON): $(SERVER_Objects)
- $(EXE_LINK) $(LINK_EMPTY_SYMBOLS) $(LINK_OPTS) $^ -o $@ $(FBEMBED_LINK) $(LINK_LIBS)
+$(FB_DAEMON): $(SERVER_Objects) $(DSQL_Objects) $(BURP_Objects) $(ALICE_Objects) $(JRD_Objects) $(LOCK_Objects) $(INTERFACE_Objects) $(SECURITY_Objects) $(NBACKUP_SERVER_Objects) $(NTRACE_SERVER_Objects)
+ $(EXE_LINK) $(LINK_EMPTY_SYMBOLS) $(LINK_OPTS) $^ -o $@ $(FBEMBED_LINK) $(LIB_GUI) $(LINK_LIBS) $(ICU_LIBS)
AllObjects = $(SERVER_Objects)
--
2.13.0

View File

@@ -1,96 +0,0 @@
From bd4dc8916de1872a19b588bd9983f874167c35d5 Mon Sep 17 00:00:00 2001
From: Alexpux <alexey.pawlow@gmail.com>
Date: Wed, 26 Nov 2014 09:27:40 +0300
Subject: [PATCH 19/27] Don't install unix files for Windows platform
---
configure.in | 66 ++++++++++++++++++++++++++++++++++++------------------------
1 file changed, 40 insertions(+), 26 deletions(-)
diff --git a/configure.in b/configure.in
index 21384bf391..10ad6a2857 100644
--- a/configure.in
+++ b/configure.in
@@ -1314,32 +1314,39 @@ MAKE_SRC_DIR=builds/posix
dnl common files for all posix hosts
dnl TODO: fix "arch-specific/linux/" paths for common posix scripts with SVN
-AC_CONFIG_FILES([gen/install/misc/firebird.conf:builds/install/misc/firebird.conf.in
-gen/install/misc/aliases.conf:builds/install/misc/aliases.conf.in
-gen/install/misc/fbintl.conf:builds/install/misc/fbintl.conf
-gen/install/misc/fbtrace.conf:src/utilities/ntrace/fbtrace.conf
-gen/firebird/bin/fb_config:builds/install/misc/fb_config.in
-gen/firebird/bin/posixLibrary.sh:builds/install/misc/posixLibrary.sh.in
-gen/firebird/bin/classicLibrary.sh:builds/install/misc/classicLibrary.sh.in
-gen/firebird/bin/superLibrary.sh:builds/install/misc/superLibrary.sh.in
-gen/firebird/bin/changeRunUser.sh:builds/install/misc/changeRunUser.sh.in
-gen/firebird/bin/restoreRootRunUser.sh:builds/install/misc/restoreRootRunUser.sh.in
-gen/firebird/bin/tarMainInstall.sh:builds/install/arch-specific/linux/misc/tarMainInstall.sh.in
-gen/firebird/bin/tarinstall.sh:builds/install/arch-specific/linux/misc/tarinstall.sh.in
-gen/firebird/bin/preinstall.sh:builds/install/arch-specific/linux/misc/preinstall.sh.in
-gen/firebird/bin/postinstall.sh:builds/install/arch-specific/linux/misc/postinstall.sh.in
-gen/firebird/bin/preuninstall.sh:builds/install/arch-specific/linux/misc/preuninstall.sh.in
-gen/firebird/bin/postuninstall.sh:builds/install/arch-specific/linux/misc/postuninstall.sh.in
-gen/firebird/bin/taruninstall.sh:builds/install/arch-specific/linux/misc/taruninstall.sh.in
-gen/firebird/bin/tarMainUninstall.sh:builds/install/arch-specific/linux/misc/tarMainUninstall.sh.in
-gen/firebird/bin/changeDBAPassword.sh:builds/install/misc/changeDBAPassword.sh.in
-gen/firebird/bin/changeGdsLibraryCompatibleLink.sh:builds/install/misc/changeGdsLibraryCompatibleLink.sh.in
-gen/firebird/bin/createAliasDB.sh:builds/install/misc/createAliasDB.sh.in],
-[chmod a+x gen/install/scripts/*.sh gen/install/*sh 2>/dev/null])
-
-if test $FIREBIRD_ARCH_TYPE = classic; then
- AC_CONFIG_FILES([gen/firebird/bin/changeMultiConnectMode.sh:builds/install/misc/changeMultiConnectMode.sh.in],
- [chmod a+x gen/install/scripts/*.sh gen/install/*sh 2>/dev/null])
+if test $PLATFORM = win32; then
+ AC_CONFIG_FILES(gen/firebird/firebird.conf:builds/install/misc/firebird.conf.in
+ gen/firebird/aliases.conf:builds/install/misc/aliases.conf.in
+ gen/firebird/intl/fbintl.conf:builds/install/misc/fbintl.conf
+ gen/firebird/fbtrace.conf:src/utilities/ntrace/fbtrace.conf)
+else
+ AC_CONFIG_FILES([gen/install/misc/firebird.conf:builds/install/misc/firebird.conf.in
+ gen/install/misc/aliases.conf:builds/install/misc/aliases.conf.in
+ gen/install/misc/fbintl.conf:builds/install/misc/fbintl.conf
+ gen/install/misc/fbtrace.conf:src/utilities/ntrace/fbtrace.conf
+ gen/firebird/bin/fb_config:builds/install/misc/fb_config.in
+ gen/firebird/bin/posixLibrary.sh:builds/install/misc/posixLibrary.sh.in
+ gen/firebird/bin/classicLibrary.sh:builds/install/misc/classicLibrary.sh.in
+ gen/firebird/bin/superLibrary.sh:builds/install/misc/superLibrary.sh.in
+ gen/firebird/bin/changeRunUser.sh:builds/install/misc/changeRunUser.sh.in
+ gen/firebird/bin/restoreRootRunUser.sh:builds/install/misc/restoreRootRunUser.sh.in
+ gen/firebird/bin/tarMainInstall.sh:builds/install/arch-specific/linux/misc/tarMainInstall.sh.in
+ gen/firebird/bin/tarinstall.sh:builds/install/arch-specific/linux/misc/tarinstall.sh.in
+ gen/firebird/bin/preinstall.sh:builds/install/arch-specific/linux/misc/preinstall.sh.in
+ gen/firebird/bin/postinstall.sh:builds/install/arch-specific/linux/misc/postinstall.sh.in
+ gen/firebird/bin/preuninstall.sh:builds/install/arch-specific/linux/misc/preuninstall.sh.in
+ gen/firebird/bin/postuninstall.sh:builds/install/arch-specific/linux/misc/postuninstall.sh.in
+ gen/firebird/bin/taruninstall.sh:builds/install/arch-specific/linux/misc/taruninstall.sh.in
+ gen/firebird/bin/tarMainUninstall.sh:builds/install/arch-specific/linux/misc/tarMainUninstall.sh.in
+ gen/firebird/bin/changeDBAPassword.sh:builds/install/misc/changeDBAPassword.sh.in
+ gen/firebird/bin/changeGdsLibraryCompatibleLink.sh:builds/install/misc/changeGdsLibraryCompatibleLink.sh.in
+ gen/firebird/bin/createAliasDB.sh:builds/install/misc/createAliasDB.sh.in],
+ [chmod a+x gen/install/scripts/*.sh gen/install/*sh 2>/dev/null])
+
+ if test $FIREBIRD_ARCH_TYPE = classic; then
+ AC_CONFIG_FILES([gen/firebird/bin/changeMultiConnectMode.sh:builds/install/misc/changeMultiConnectMode.sh.in],
+ [chmod a+x gen/install/scripts/*.sh gen/install/*sh 2>/dev/null])
+ fi
fi
dnl: Platform Specific Files
@@ -1439,6 +1446,13 @@ case "$PLATFORM" in
DARWIN)
;;
+
+ win32)
+ AC_CONFIG_FILES(gen/firebird/install_classic.bat:builds/install/arch-specific/win32/install_classic.bat
+ gen/firebird/install_super.bat:builds/install/arch-specific/win32/install_super.bat
+ gen/firebird/install_superclassic.bat:builds/install/arch-specific/win32/install_superclassic.bat
+ gen/firebird/uninstall.bat:builds/install/arch-specific/win32/uninstall.bat)
+ ;;
esac
if test -f ${MAKE_SRC_DIR}/postfix.${MAKEFILE_POSTFIX};then
POSTFIX_FILE=gen/make.platform.postfix:${MAKE_SRC_DIR}/postfix.${MAKEFILE_POSTFIX}
--
2.13.0

View File

@@ -1,116 +0,0 @@
From 2be65017c9c3136ffcfa6abe9f9d5f30e237a087 Mon Sep 17 00:00:00 2001
From: Alexpux <alexey.pawlow@gmail.com>
Date: Wed, 26 Nov 2014 09:27:40 +0300
Subject: [PATCH 20/27] Fix rules to use variables.
---
builds/posix/Makefile.in.examples | 18 +++++++++---------
builds/posix/Makefile.in.refDatabases | 8 ++++----
builds/posix/make.defaults | 2 +-
3 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/builds/posix/Makefile.in.examples b/builds/posix/Makefile.in.examples
index 31376494d9..ade180b4fa 100644
--- a/builds/posix/Makefile.in.examples
+++ b/builds/posix/Makefile.in.examples
@@ -117,9 +117,9 @@ $(EXAMPLES_DEST)% : $(EXAMPLES_SRC)%
$(EXAMPLES_DEST)/employee.fdb: $(EXAMPLES_DEST)/empbuild$(EXEC_EXT) $(INPUT_Sources) $(EXAMPLES_DEST)/isql$(EXEC_EXT)
- -$(RM) employee.fdb
- ./empbuild employee.fdb
- -$(CHMOD_6) employee.fdb
+ -$(RM) $(EXAMPLES_DEST)/employee.fdb
+ $(EXAMPLES_DEST)/empbuild$(EXEC_EXT) $(EXAMPLES_DEST)/employee.fdb
+ -$(CHMOD_6) $(EXAMPLES_DEST)/employee.fdb
# To get past the fact isql is called from the programs, we create a local link
# to the static one in this directory
@@ -134,16 +134,16 @@ $(EXAMPLES_DEST)/empbuild.c: $(EXAMPLES_DEST)/empbuild.fdb $(EXAMPLES_DEST)/empb
$(EXAMPLES_DEST)/empbuild.fdb : $(EXAMPLES_DEST)/empddl.sql $(EXAMPLES_DEST)/empbld.sql $(EXAMPLES_DEST)/isql$(EXEC_EXT)
-$(RM) $(EXAMPLES_DEST)/empbuild.fdb
- $(EXAMPLES_DEST)/isql$(EXEC_EXT) -i empbld.sql
+ $(EXAMPLES_DEST)/isql$(EXEC_EXT) -i $(EXAMPLES_DEST)/empbld.sql
# The chain for intlemp.fdb is the same a script file to create an empty database
# to allow a .e program to be compiled, to then create and populate with data
# the intlemp.fdb database.
$(EXAMPLES_DEST)/intlemp.fdb: $(EXAMPLES_DEST)/intlbld$(EXEC_EXT) $(INTL_Sources) $(EXAMPLES_DEST)/isql$(EXEC_EXT)
- -$(RM) intlemp.fdb
- ./intlbld intlemp.fdb
- -$(CHMOD_6) intlemp.fdb
+ -$(RM) $(EXAMPLES_DEST)/intlemp.fdb
+ $(EXAMPLES_DEST)/intlbld$(EXEC_EXT) $(EXAMPLES_DEST)/intlemp.fdb
+ -$(CHMOD_6) $(EXAMPLES_DEST)/intlemp.fdb
$(EXAMPLES_DEST)/intlbld$(EXEC_EXT): $(INTLBLD_Objects) $(COMMON_Objects) $(LIBFBSTATIC_A)
$(EXE_LINK) $(LINK_OPTS) $(INTLBLD_Objects) $(COMMON_Objects) -o $@ -L$(LIB) -lfbstatic $(LINK_LIBS) $(ICU_LIBS)
@@ -151,8 +151,8 @@ $(EXAMPLES_DEST)/intlbld$(EXEC_EXT): $(INTLBLD_Objects) $(COMMON_Objects) $(LIBF
$(EXAMPLES_DEST)/intlbld.c: $(EXAMPLES_DEST)/intlbuild.fdb $(EXAMPLES_DEST)/intlbld.e
$(EXAMPLES_DEST)/intlbuild.fdb : $(EXAMPLES_DEST)/intlddl.sql $(EXAMPLES_DEST)/intlbld.sql $(EXAMPLES_DEST)/isql$(EXEC_EXT)
- -$(RM) intlbuild.fdb
- $(EXAMPLES_DEST)/isql$(EXEC_EXT) -i intlbld.sql
+ -$(RM) $(EXAMPLES_DEST)/intlbuild.fdb
+ $(EXAMPLES_DEST)/isql$(EXEC_EXT) -i $(EXAMPLES_DEST)/intlbld.sql
$(EXAMPLES_DEST)/%.sql: $(EXAMPLES_SRC)/empbuild/%.sql
diff --git a/builds/posix/Makefile.in.refDatabases b/builds/posix/Makefile.in.refDatabases
index c1b61a64fc..68016ccebc 100644
--- a/builds/posix/Makefile.in.refDatabases
+++ b/builds/posix/Makefile.in.refDatabases
@@ -65,7 +65,7 @@ empty_db : empty.fdb yachts.lnk
empty.fdb : $(CREATE_DB)
$(MAKE) -f $(GEN_ROOT)/Makefile.static.createdb
-$(RM) $@
- $(BIN)/create_db $@
+ $(CREATE_DB) $@
$(TOUCH) $@
$(CHMOD) 444 $@
@@ -99,7 +99,7 @@ help.fdb: $(FIREBIRD)/help/help.fdb
$(LN) -f $^ $@
$(FIREBIRD)/help/help.fdb: $(BLD_ROOT)/misc/help.gbak
- $(BIN)/gbak_static -MODE read_only -R $< $@
+ $(GBAK_STATIC) -MODE read_only -R $< $@
$(TOUCH) $@
$(CHMOD) 444 $@
@@ -114,7 +114,7 @@ security2.fdb: $(SRC_ROOT)/dbs/security.sql
$(CHMOD) a=rw $@
metadata.fdb: $(BLD_ROOT)/misc/metadata.gbak
- $(BIN)/gbak_static -MODE read_only -R $< $@
+ $(GBAK_STATIC) -MODE read_only -R $< $@
$(TOUCH) $@
$(CHMOD) 444 $@
@@ -122,7 +122,7 @@ metadata.fdb: $(BLD_ROOT)/misc/metadata.gbak
# since it ensures the data is valid.
metadata.fdb.x: $(SRC_ROOT)/misc/metadata.sql
- $(BIN)/isql -i $<
+ $(ISQL) -i $<
$(TOUCH) $@
$(CHMOD) 444 $@
diff --git a/builds/posix/make.defaults b/builds/posix/make.defaults
index c2c2ffe343..2ad21f93f5 100755
--- a/builds/posix/make.defaults
+++ b/builds/posix/make.defaults
@@ -183,7 +183,7 @@ SHRLIB_FOREIGN_EXT= $(SHRLIB_EXT)
vpath %.so $(LIB)
vpath %.a $(LIB)
-vpath %.dll $(LIB)
+vpath %.dll $(BIN)
#_____________________________________________________________________________
--
2.13.0

View File

@@ -1,92 +0,0 @@
From 49a1247dc150c5c11a50225c98b142838e10110d Mon Sep 17 00:00:00 2001
From: Alexpux <alexey.pawlow@gmail.com>
Date: Sun, 30 Nov 2014 09:27:40 +0300
Subject: [PATCH 21/27] Auto detect WINDRES with autoconf.
Fix building .rc files.
---
builds/posix/make.defaults | 4 +++-
builds/posix/make.rules | 4 ++--
builds/posix/make.shared.targets | 10 +++++-----
configure.in | 10 ++++++++++
4 files changed, 20 insertions(+), 8 deletions(-)
diff --git a/builds/posix/make.defaults b/builds/posix/make.defaults
index 2ad21f93f5..a3836acf9a 100755
--- a/builds/posix/make.defaults
+++ b/builds/posix/make.defaults
@@ -139,9 +139,11 @@ ECHO= echo
QUIET_ECHO= @echo
CD= cd
CAT= cat
-AR= ar @AR_OPTIONS@ crsu
+AR= @AR@ @AR_OPTIONS@ crsu
LN= @LN_S@
+DLLTOOL= @DLLTOOL@
RANLIB= @RANLIB@
+RC= @RC@
BTYACC=$(ROOT)/extern/btyacc/btyacc
CC = @CC@
diff --git a/builds/posix/make.rules b/builds/posix/make.rules
index a784cb21ab..600b8f9e6a 100644
--- a/builds/posix/make.rules
+++ b/builds/posix/make.rules
@@ -115,5 +115,5 @@ $(OBJ)/%.o: $(SRC_ROOT)/%.cpp
# Rules for making resource files
-$(GEN_ROOT)/%.res: $(SRC_ROOT)/%.rc
- windres --output-format=coff --include-dir=$(<D) $< $@
+$(OBJ)/%.res: $(SRC_ROOT)/%.rc
+ $(RC) --output-format=coff --include-dir=$(<D) $< $@
diff --git a/builds/posix/make.shared.targets b/builds/posix/make.shared.targets
index ff5c2a2b1c..f881106012 100644
--- a/builds/posix/make.shared.targets
+++ b/builds/posix/make.shared.targets
@@ -93,16 +93,16 @@ $(BLRTABLE): $(BLRTABLE_Objects)
# Adding resources as prerequisite for some files
-$(FilesToAddVersionInfo): $(GEN_ROOT)/jrd/version.res
-$(FilesToAddDialog): $(GEN_ROOT)/remote/os/win32/window.res
-$(FilesToAddDialog2): $(GEN_ROOT)/iscguard/iscguard.res
+$(FilesToAddVersionInfo): $(OBJ)/jrd/version.res
+$(FilesToAddDialog): $(OBJ)/remote/os/win32/window.res
+$(FilesToAddDialog2): $(OBJ)/iscguard/iscguard.res
# Explicit dependence of resource script
-$(GEN_ROOT)/remote/os/win32/window.res: $(SRC_ROOT)/remote/os/win32/window.rc $(SRC_ROOT)/remote/os/win32/window.rh \
+$(OBJ)/remote/os/win32/window.res: $(SRC_ROOT)/remote/os/win32/window.rc $(SRC_ROOT)/remote/os/win32/window.rh \
$(SRC_ROOT)/jrd/version.rc $(SRC_ROOT)/jrd/build_no.h $(SRC_ROOT)/remote/os/win32/property.rc \
$(SRC_ROOT)/remote/os/win32/property.rh
-$(GEN_ROOT)/iscguard/iscguard.res: $(SRC_ROOT)/iscguard/iscguard.rc $(SRC_ROOT)/iscguard/iscguard.rh \
+$(OBJ)/iscguard/iscguard.res: $(SRC_ROOT)/iscguard/iscguard.rc $(SRC_ROOT)/iscguard/iscguard.rh \
$(SRC_ROOT)/jrd/version.rc
.PHONY: FORCE
diff --git a/configure.in b/configure.in
index 10ad6a2857..17509964ff 100644
--- a/configure.in
+++ b/configure.in
@@ -684,6 +684,16 @@ AC_LIBTOOL_DLOPEN
AC_LIBTOOL_WIN32_DLL
AC_PROG_MAKE_SET
AC_PROG_LIBTOOL
+if test $PLATFORM = win32; then
+ # Checks for mingw resource compiler.
+ AC_CHECK_PROGS([RC],
+ [$target-windres \
+ windres])
+
+ if test -z "${RC}"; then
+ AC_MSG_ERROR(windres command is not found.);
+ fi
+fi
dnl Check for system header files
AC_HEADER_DIRENT
--
2.13.0

View File

@@ -1,38 +0,0 @@
From 3132c5ed17e8693246664c01d9116d3d3338ba51 Mon Sep 17 00:00:00 2001
From: Alexpux <alexey.pawlow@gmail.com>
Date: Wed, 26 Nov 2014 09:27:40 +0300
Subject: [PATCH 22/27] Create symlinks of fbembed only if names are different
---
builds/posix/Makefile.in.libfbembed | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/builds/posix/Makefile.in.libfbembed b/builds/posix/Makefile.in.libfbembed
index d919ba2b34..2e70ab90f8 100644
--- a/builds/posix/Makefile.in.libfbembed
+++ b/builds/posix/Makefile.in.libfbembed
@@ -61,14 +61,18 @@ Dependencies = $(AllObjects:.o=.d)
libfbembed : $(LIBIBUTIL_SO) $(LIBFBEMBED_SONAME)
-$(LIBFBEMBED_SO): $(LIBFBEMBED_Objects) $(SERVER_Objects) $(COMMON_Objects)
- $(LINK_EMBED) -o $@ $^ $(LINK_EMBED_LIBS)
-
+ifneq ($(SharedLibraryName),$(SharedLibrarySoName))
$(LIBFBEMBED_SOBASENAME): $(LIBFBEMBED_SO)
(cd $(LIB) && $(LN) -f $(SharedLibraryName) $(SharedLibrarySoName) )
+endif
+ifneq ($(SharedLibrarySoName),$(SharedLibraryBaseName))
$(LIBFBEMBED_SONAME): $(LIBFBEMBED_SOBASENAME)
(cd $(LIB) && $(LN) -f $(SharedLibrarySoName) $(SharedLibraryBaseName) )
+endif
+
+$(LIBFBEMBED_SO): $(LIBFBEMBED_Objects) $(SERVER_Objects) $(COMMON_Objects)
+ $(LINK_EMBED) -o $@ $^ $(LINK_EMBED_LIBS)
include $(ROOT)/gen/make.shared.targets
--
2.13.0

View File

@@ -1,36 +0,0 @@
From adae02b6514ae186f797e01611c35ed1d843f256 Mon Sep 17 00:00:00 2001
From: Alexpux <alexey.pawlow@gmail.com>
Date: Sun, 23 Nov 2014 09:27:40 +0300
Subject: [PATCH 23/27] mod_loader: mingw always link to msvcrt.dll
---
src/jrd/os/win32/mod_loader.cpp | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/jrd/os/win32/mod_loader.cpp b/src/jrd/os/win32/mod_loader.cpp
index aeae4c2bd5..004625336d 100644
--- a/src/jrd/os/win32/mod_loader.cpp
+++ b/src/jrd/os/win32/mod_loader.cpp
@@ -74,7 +74,7 @@ public:
// if we don't use MSVC then we don't use MS CRT ?
// NS: versions of MSVC before 2005 and, as preliminary reports suggest,
// after 2008 do not need this hack
-#if !defined(_MSC_VER) || (_MSC_VER < 1400)
+#if (!defined(_MSC_VER) || (_MSC_VER < 1400)) && !defined(__MINGW32__)
return;
#else
@@ -89,7 +89,9 @@ public:
if ((*mFindActCtxSectionString)
(0, NULL,
ACTIVATION_CONTEXT_SECTION_DLL_REDIRECTION,
-#if _MSC_VER == 1400
+#if defined(__MINGW32__)
+ "msvcrt.dll",
+#elif _MSC_VER == 1400
"msvcr80.dll",
#elif _MSC_VER == 1500
"msvcr90.dll",
--
2.13.0

View File

@@ -1,168 +0,0 @@
From 6694e24ed8e6a86db3f6518e63cfa8581d838d5e Mon Sep 17 00:00:00 2001
From: Alexpux <alexey.pawlow@gmail.com>
Date: Sun, 23 Nov 2014 09:27:40 +0300
Subject: [PATCH 24/27] Relocate paths for unix-like files layout.
---
builds/posix/make.shared.variables | 4 +-
src/common/utils.cpp | 21 +-
src/jrd/gds.cpp | 7 +-
src/jrd/os/win32/config_root.cpp | 7 +-
src/jrd/os/win32/path_utils.cpp | 5 +-
7 files changed, 623 insertions(+), 12 deletions(-)
diff --git a/builds/posix/make.shared.variables b/builds/posix/make.shared.variables
index ef6099ed83..b10dae4cbc 100644
--- a/builds/posix/make.shared.variables
+++ b/builds/posix/make.shared.variables
@@ -259,7 +259,7 @@ VULCAN_Objects = $(addprefix $(OBJ)/, $(addsuffix .o, $(basename $(VULCAN_Source
# common
FBCOMMON_ClientFiles = fb_exception.cpp thd.cpp classes/MetaName.cpp StatusHolder.cpp classes/init.cpp StatusArg.cpp
-FBCOMMON_ServerFiles = utils.cpp
+FBCOMMON_ServerFiles = utils.cpp pathtools.cpp
FBCOMMON_ClientObjects = $(addprefix $(OBJ)/common/, $(addsuffix .o, $(basename $(FBCOMMON_ClientFiles)))) \
$(addprefix $(OBJ)/jrd/, $(addsuffix .o, $(basename fbsyslog.cpp)))
@@ -287,7 +287,7 @@ CLUMPLETS_Objects = $(addprefix $(OBJ)/, $(addsuffix .o, $(basename $(CLUMPLETS_
# just in case if make.platform defined some files
OS_SPECIFIC_Files += config_root.cpp path_utils.cpp mod_loader.cpp guid.cpp os_utils.cpp
-OS_SPECIFIC_Sources = $(addprefix jrd/, $(OS_SPECIFIC_Files)) common/dllinst.cpp
+OS_SPECIFIC_Sources = $(addprefix jrd/, $(OS_SPECIFIC_Files)) common/dllinst.cpp common/pathtools.cpp
ifneq ($(strip @BINRELOC_CFLAGS@),)
OS_SPECIFIC_Sources += $(ROOT)/extern/binreloc/binreloc.c
endif
diff --git a/src/common/utils.cpp b/src/common/utils.cpp
index 34c7c5c263..5991363f10 100644
--- a/src/common/utils.cpp
+++ b/src/common/utils.cpp
@@ -43,6 +43,7 @@
#include "../common/utils_proto.h"
#include "../common/classes/locks.h"
#include "../common/classes/init.h"
+#include "../common/pathtools.h"
#include "../jrd/constants.h"
#include "../jrd/os/path_utils.h"
#include "../jrd/os/fbsyslog.h"
@@ -929,9 +930,23 @@ Firebird::PathName getPrefix(FB_DIR prefType, const char* name)
#ifndef BOOT_BUILD
const char* configDir[] = {
- FB_BINDIR, FB_SBINDIR, FB_CONFDIR, FB_LIBDIR, FB_INCDIR, FB_DOCDIR, FB_UDFDIR, FB_SAMPLEDIR,
- FB_SAMPLEDBDIR, FB_HELPDIR, FB_INTLDIR, FB_MISCDIR, FB_SECDBDIR, FB_MSGDIR, FB_LOGDIR,
- FB_GUARDDIR, FB_PLUGDIR
+ single_path_relocation(FB_BINDIR,FB_BINDIR),
+ single_path_relocation(FB_BINDIR,FB_SBINDIR),
+ single_path_relocation(FB_BINDIR,FB_CONFDIR),
+ single_path_relocation(FB_BINDIR,FB_LIBDIR),
+ single_path_relocation(FB_BINDIR,FB_INCDIR),
+ single_path_relocation(FB_BINDIR,FB_DOCDIR),
+ single_path_relocation(FB_BINDIR,FB_UDFDIR),
+ single_path_relocation(FB_BINDIR,FB_SAMPLEDIR),
+ single_path_relocation(FB_BINDIR,FB_SAMPLEDBDIR),
+ single_path_relocation(FB_BINDIR,FB_HELPDIR),
+ single_path_relocation(FB_BINDIR,FB_INTLDIR),
+ single_path_relocation(FB_BINDIR,FB_MISCDIR),
+ single_path_relocation(FB_BINDIR,FB_SECDBDIR),
+ single_path_relocation(FB_BINDIR,FB_MSGDIR),
+ single_path_relocation(FB_BINDIR,FB_LOGDIR),
+ single_path_relocation(FB_BINDIR,FB_GUARDDIR),
+ single_path_relocation(FB_BINDIR,FB_PLUGDIR)
};
fb_assert(FB_NELEM(configDir) == FB_DIR_LAST);
diff --git a/src/jrd/gds.cpp b/src/jrd/gds.cpp
index a4ccaa9ac7..a802e8ce90 100644
--- a/src/jrd/gds.cpp
+++ b/src/jrd/gds.cpp
@@ -56,6 +56,7 @@
#include "../common/classes/timestamp.h"
#include "../common/classes/init.h"
#include "../common/classes/TempFile.h"
+#include "../common/pathtools.h"
#include "../common/utils_proto.h"
#ifdef HAVE_UNISTD_H
@@ -3604,13 +3605,13 @@ public:
{
prefix = Config::getRootDirectory();
if (prefix.isEmpty() && !GetProgramFilesDir(prefix))
- prefix = FB_CONFDIR[0] ? FB_CONFDIR : FB_PREFIX;
+ prefix = FB_CONFDIR[0] ? single_path_relocation(FB_BINDIR,FB_CONFDIR) : single_path_relocation(FB_BINDIR,FB_PREFIX);
}
catch (Firebird::fatal_exception&)
{
// CVC: Presumably here we failed because the config file can't be located.
if (!GetProgramFilesDir(prefix))
- prefix = FB_CONFDIR[0] ? FB_CONFDIR : FB_PREFIX;
+ prefix = FB_CONFDIR[0] ? single_path_relocation(FB_BINDIR,FB_CONFDIR) : single_path_relocation(FB_BINDIR,FB_PREFIX);
}
prefix.copyTo(fb_prefix_val, sizeof(fb_prefix_val));
fb_prefix = fb_prefix_val;
@@ -3693,7 +3694,7 @@ public:
Firebird::PathName msgPrefix;
if (!fb_utils::readenv(FB_MSG_ENV, msgPrefix))
{
- msgPrefix = FB_MSGDIR[0] ? FB_MSGDIR : prefix;
+ msgPrefix = FB_MSGDIR[0] ? single_path_relocation(FB_BINDIR,FB_MSGDIR) : prefix;
}
msgPrefix.copyTo(fb_prefix_msg_val, sizeof(fb_prefix_msg_val));
fb_prefix_msg = fb_prefix_msg_val;
diff --git a/src/jrd/os/win32/config_root.cpp b/src/jrd/os/win32/config_root.cpp
index f5c7d54b51..deb33cc713 100644
--- a/src/jrd/os/win32/config_root.cpp
+++ b/src/jrd/os/win32/config_root.cpp
@@ -28,6 +28,7 @@
#include "fb_types.h"
#include "../../../common/classes/fb_string.h"
#include "../../../common/dllinst.h"
+#include "../../../common/pathtools.h"
#include "../jrd/os/config_root.h"
#include "../utilities/install/registry.h"
@@ -88,7 +89,7 @@ bool getBinFromHInstance(PathName& root)
void ConfigRoot::osConfigRoot()
{
// check the registry first
-#if defined(SUPERCLIENT)
+#if defined(SUPERCLIENT) && !defined(__MINGW32__)
if (getRootFromRegistry(root_dir))
{
addSlash();
@@ -125,7 +126,7 @@ void ConfigRoot::osConfigRoot()
}
// As a last resort get it from the default install directory
- root_dir = FB_PREFIX;
+ root_dir = single_path_relocation(FB_BINDIR,FB_PREFIX);
}
void ConfigRoot::osConfigInstallDir()
@@ -159,5 +160,5 @@ void ConfigRoot::osConfigInstallDir()
}
// As a last resort get it from the default install directory
- install_dir = FB_PREFIX;
+ install_dir = single_path_relocation(FB_BINDIR,FB_PREFIX);
}
diff --git a/src/jrd/os/win32/path_utils.cpp b/src/jrd/os/win32/path_utils.cpp
index 6e22f15704..48186bcec4 100644
--- a/src/jrd/os/win32/path_utils.cpp
+++ b/src/jrd/os/win32/path_utils.cpp
@@ -4,8 +4,11 @@
#include <io.h> // _access
/// The Win32 implementation of the path_utils abstraction.
-
+#if defined(__MINGW32__)
+const char PathUtils::dir_sep = '/';
+#else
const char PathUtils::dir_sep = '\\';
+#endif
const char* PathUtils::up_dir_link = "..";
class Win32DirItr : public PathUtils::dir_iterator
--
2.13.0

View File

@@ -1,25 +0,0 @@
From ab52abf519b5121f1a7d820fc1bb86b253e908b6 Mon Sep 17 00:00:00 2001
From: Alexpux <alexey.pawlow@gmail.com>
Date: Tue, 11 Nov 2014 09:27:40 +0300
Subject: [PATCH 25/27] Fix building gstat
---
src/utilities/gstat/dba.epp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/utilities/gstat/dba.epp b/src/utilities/gstat/dba.epp
index 76a10c5b49..71e6cf5bf8 100644
--- a/src/utilities/gstat/dba.epp
+++ b/src/utilities/gstat/dba.epp
@@ -42,7 +42,7 @@
#include "../jrd/ibase.h"
#include "../jrd/ods.h"
#include "../jrd/btn.h"
-#include "../jrd/svc.h"
+#include "../jrd/ThreadData.h"
#include "../jrd/license.h"
#include "../jrd/msg_encode.h"
#include "../jrd/gdsassert.h"
--
2.13.0

View File

@@ -1,49 +0,0 @@
From d2f6452be919d2e2a77db67e6fdc7a2e498a091c Mon Sep 17 00:00:00 2001
From: Alexpux <alexey.pawlow@gmail.com>
Date: Sun, 22 Nov 2015 17:09:05 +0300
Subject: [PATCH 26/27] Fix using function pointer.
---
src/common/classes/locks.cpp | 3 ++-
src/common/classes/locks.h | 7 +++----
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/common/classes/locks.cpp b/src/common/classes/locks.cpp
index de6b2f8e36..aaf7f868d5 100644
--- a/src/common/classes/locks.cpp
+++ b/src/common/classes/locks.cpp
@@ -124,7 +124,8 @@ BOOL WINAPI TryEnterCriticalSection_Win9X(CRITICAL_SECTION* cs)
// On Win 98 and Win ME TryEnterCriticalSection is defined, but not implemented
// So direct linking to it won't hurt and will signal our incompatibility with Win 95
-TryEnterCS::tTryEnterCriticalSection* TryEnterCS::m_funct = &TryEnterCriticalSection;
+TryEnterCS::tTryEnterCriticalSection TryEnterCS::m_funct =
+ reinterpret_cast<TryEnterCS::tTryEnterCriticalSection>(TryEnterCriticalSection);
static TryEnterCS tryEnterCS;
diff --git a/src/common/classes/locks.h b/src/common/classes/locks.h
index 75ba1943fb..358659201f 100644
--- a/src/common/classes/locks.h
+++ b/src/common/classes/locks.h
@@ -60,14 +60,13 @@ public:
static bool tryEnter(LPCRITICAL_SECTION lpCS)
{
- return ((*m_funct) (lpCS) == TRUE);
+ return ((m_funct) (lpCS) == TRUE);
}
private:
- typedef WINBASEAPI BOOL WINAPI tTryEnterCriticalSection
- (LPCRITICAL_SECTION lpCriticalSection);
+ typedef BOOL (WINAPI *tTryEnterCriticalSection)(LPCRITICAL_SECTION lpCriticalSection);
- static tTryEnterCriticalSection* m_funct;
+ static tTryEnterCriticalSection m_funct;
};
class Mutex
--
2.13.0

View File

@@ -1,129 +0,0 @@
From a2575c3c96be502e4af420f50e6b816569330531 Mon Sep 17 00:00:00 2001
From: Alexpux <alexey.pawlow@gmail.com>
Date: Sun, 22 Nov 2015 17:09:05 +0300
Subject: [PATCH 27/27] The operator new declaration has changed slightly in
C++11.
It has to do with the fact that the throwing exception specification is deprecated in C++11,
and the introduction of the nothrow declaration:
throw (std::bad_alloc) has been omitted
throw() is replaced with nothrow
---
src/common/classes/alloc.cpp | 10 +++++-----
src/common/classes/alloc.h | 24 ++++++++++++------------
2 files changed, 17 insertions(+), 17 deletions(-)
diff --git a/src/common/classes/alloc.cpp b/src/common/classes/alloc.cpp
index 257030bccb..d6036ec2b2 100644
--- a/src/common/classes/alloc.cpp
+++ b/src/common/classes/alloc.cpp
@@ -2182,7 +2182,7 @@
}
#ifdef LIBC_CALLS_NEW
-void* MemoryPool::globalAlloc(size_t s) THROW_BAD_ALLOC
+void* MemoryPool::globalAlloc(size_t s)
{
if (!processMemoryPool)
{
@@ -2229,20 +2229,20 @@
} // namespace Firebird
-void* operator new(size_t s) THROW_BAD_ALLOC
+void* operator new(size_t s)
{
return Firebird::MemoryPool::globalAlloc(s ALLOC_ARGS);
}
-void* operator new[](size_t s) THROW_BAD_ALLOC
+void* operator new[](size_t s)
{
return Firebird::MemoryPool::globalAlloc(s ALLOC_ARGS);
}
-void operator delete(void* mem) throw()
+void operator delete(void* mem) noexcept
{
Firebird::MemoryPool::globalFree(mem);
}
-void operator delete[](void* mem) throw()
+void operator delete[](void* mem) noexcept
{
Firebird::MemoryPool::globalFree(mem);
}
diff --git a/src/common/classes/alloc.h b/src/common/classes/alloc.h
index 93ffe370cc..0c7e38f24d 100644
--- a/src/common/classes/alloc.h
+++ b/src/common/classes/alloc.h
@@ -405,9 +405,9 @@
// This method is needed when C++ runtime can call
// redefined by us operator new before initialization of global variables.
#ifdef LIBC_CALLS_NEW
- static void* globalAlloc(size_t s ALLOC_PARAMS) THROW_BAD_ALLOC;
+ static void* globalAlloc(size_t s ALLOC_PARAMS);
#else // LIBC_CALLS_NEW
- static void* globalAlloc(size_t s ALLOC_PARAMS) THROW_BAD_ALLOC
+ static void* globalAlloc(size_t s ALLOC_PARAMS)
{
return processMemoryPool->allocate(s ALLOC_PASS_ARGS);
}
@@ -494,46 +494,46 @@
// operators new and delete
-void* operator new(size_t s) THROW_BAD_ALLOC;
-void* operator new[](size_t s) THROW_BAD_ALLOC;
+void* operator new(size_t s);
+void* operator new[](size_t s);
void operator delete(void* mem) throw();
void operator delete[](void* mem) throw();
-inline void* operator new(size_t s, Firebird::MemoryPool& pool ALLOC_PARAMS) THROW_BAD_ALLOC
+inline void* operator new(size_t s, Firebird::MemoryPool& pool ALLOC_PARAMS)
{
return pool.allocate(s ALLOC_PASS_ARGS);
}
-inline void* operator new[](size_t s, Firebird::MemoryPool& pool ALLOC_PARAMS) THROW_BAD_ALLOC
+inline void* operator new[](size_t s, Firebird::MemoryPool& pool ALLOC_PARAMS)
{
return pool.allocate(s ALLOC_PASS_ARGS);
}
-inline void operator delete(void* mem, Firebird::MemoryPool& pool ALLOC_PARAMS) throw()
+inline void operator delete(void* mem, Firebird::MemoryPool& pool ALLOC_PARAMS) noexcept
{
MemoryPool::globalFree(mem);
}
-inline void operator delete[](void* mem, Firebird::MemoryPool& pool ALLOC_PARAMS) throw()
+inline void operator delete[](void* mem, Firebird::MemoryPool& pool ALLOC_PARAMS) noexcept
{
MemoryPool::globalFree(mem);
}
#ifdef DEBUG_GDS_ALLOC
-inline void* operator new(size_t s ALLOC_PARAMS) THROW_BAD_ALLOC
+inline void* operator new(size_t s ALLOC_PARAMS)
{
return MemoryPool::globalAlloc(s ALLOC_PASS_ARGS);
}
-inline void* operator new[](size_t s ALLOC_PARAMS) THROW_BAD_ALLOC
+inline void* operator new[](size_t s ALLOC_PARAMS)
{
return MemoryPool::globalAlloc(s ALLOC_PASS_ARGS);
}
-inline void operator delete(void* mem ALLOC_PARAMS) throw()
+inline void operator delete(void* mem ALLOC_PARAMS) noexcept
{
MemoryPool::globalFree(mem);
}
-inline void operator delete[](void* mem ALLOC_PARAMS) throw()
+inline void operator delete[](void* mem ALLOC_PARAMS) noexcept
{
MemoryPool::globalFree(mem);
}
--
2.13.0

View File

@@ -1,205 +0,0 @@
From 403cbaf0f0b7acbe469edaf6df35c591f8fecb17 Mon Sep 17 00:00:00 2001
From: Alexey Pavlov <alexpux@gmail.com>
Date: Fri, 9 Jun 2017 14:57:58 +0300
Subject: [PATCH 28/28] Fix different warnings.
---
src/common/classes/fb_string.cpp | 6 +++---
src/common/classes/fb_string.h | 2 +-
src/common/cvt.cpp | 6 +++---
src/gpre/sqe.cpp | 4 +++-
src/gpre/sql.cpp | 12 ++++++------
src/include/fb_blk.h | 11 ++++++-----
src/jrd/Database.h | 4 ++--
src/jrd/RuntimeStatistics.h | 8 ++++----
src/jrd/common.h | 4 ++++
src/jrd/gds.cpp | 2 +-
10 files changed, 33 insertions(+), 26 deletions(-)
diff --git a/src/common/classes/fb_string.cpp b/src/common/classes/fb_string.cpp
index 439bcfdbaa..9173634fca 100644
--- a/src/common/classes/fb_string.cpp
+++ b/src/common/classes/fb_string.cpp
@@ -460,13 +460,13 @@ extern "C" {
return STRNCASECMP(s1, s2, n);
}
- bool AbstractString::equalsNoCase(AbstractString::const_pointer string) const
+ bool AbstractString::equalsNoCase(AbstractString::const_pointer stringval) const
{
- size_t l = strlen(string);
+ size_t l = strlen(stringval);
if (l > length())
{
l = length();
}
- return (STRNCASECMP(c_str(), string, ++l) == 0);
+ return (STRNCASECMP(c_str(), stringval, ++l) == 0);
}
} // namespace Firebird
diff --git a/src/common/classes/fb_string.h b/src/common/classes/fb_string.h
index b1fea2703c..962176cad3 100644
--- a/src/common/classes/fb_string.h
+++ b/src/common/classes/fb_string.h
@@ -425,7 +425,7 @@ namespace Firebird
return hash(c_str(), tableSize);
}
- bool equalsNoCase(const_pointer string) const;
+ bool equalsNoCase(const_pointer stringval) const;
inline AbstractString& append(const AbstractString& str)
{
diff --git a/src/common/cvt.cpp b/src/common/cvt.cpp
index 4389a0ae68..c5dc8d5307 100644
--- a/src/common/cvt.cpp
+++ b/src/common/cvt.cpp
@@ -1671,11 +1671,11 @@ void CVT_move_common(const dsc* from, dsc* to, Callbacks* cb)
{
USHORT strtype_unused;
UCHAR* ptr;
- USHORT l = CVT_get_string_ptr_common(from, &strtype_unused, &ptr, NULL, 0, cb);
+ USHORT sval = CVT_get_string_ptr_common(from, &strtype_unused, &ptr, NULL, 0, cb);
- if (l == to->dsc_length)
+ if (sval == to->dsc_length)
{
- memcpy(to->dsc_address, ptr, l);
+ memcpy(to->dsc_address, ptr, sval);
return;
}
}
diff --git a/src/gpre/sqe.cpp b/src/gpre/sqe.cpp
index 61e989c3fa..bcd8b11065 100644
--- a/src/gpre/sqe.cpp
+++ b/src/gpre/sqe.cpp
@@ -1721,6 +1721,7 @@ static gpre_ctx* par_alias_list( gpre_req* request, gpre_nod* alias_list)
// a base table having a matching table name or alias
if (!context)
+ {
for (context = request->req_contexts; context; context = context->ctx_next)
{
if (context->ctx_scope_level != request->req_scope_level)
@@ -1738,7 +1739,8 @@ static gpre_ctx* par_alias_list( gpre_req* request, gpre_nod* alias_list)
fb_utils::snprintf(error_string, sizeof(error_string),
"there is no alias or table named %s at this scope level",
(TEXT*) *arg);
- PAR_error(error_string);
+ PAR_error(error_string);
+ }
}
// find the base table using the specified alias list, skipping the first one
diff --git a/src/gpre/sql.cpp b/src/gpre/sql.cpp
index 1f42573e41..32df2a2b03 100644
--- a/src/gpre/sql.cpp
+++ b/src/gpre/sql.cpp
@@ -5159,7 +5159,7 @@ static act* act_upsert(void)
if (MSC_match(KW_RETURNING))
{
- gpre_nod* value_list = SQE_list(SQE_value_or_null, NULL, false);
+ gpre_nod* value_list2 = SQE_list(SQE_value_or_null, NULL, false);
if (!MSC_match(KW_INTO))
CPR_s_error("INTO");
@@ -5177,7 +5177,7 @@ static act* act_upsert(void)
gpre_sym* new_ctx_sym = MSC_symbol(SYM_context, NEW_CONTEXT, strlen(NEW_CONTEXT), update_context);
HSH_insert(new_ctx_sym);
- upd_ret_list = return_values(request, value_list, var_list);
+ upd_ret_list = return_values(request, value_list2, var_list);
// restore the insertion context back
@@ -5186,12 +5186,12 @@ static act* act_upsert(void)
new_ctx_sym->sym_object = insert_context;
- ins_ret_list = return_values(request, value_list, var_list);
+ ins_ret_list = return_values(request, value_list2, var_list);
- for (int i = 0; i < value_list->nod_count; i++)
- SQE_resolve(&value_list->nod_arg[i], request, NULL);
+ for (int i = 0; i < value_list2->nod_count; i++)
+ SQE_resolve(&value_list2->nod_arg[i], request, NULL);
- into(request, value_list, var_list);
+ into(request, value_list2, var_list);
ref_list = (ref*) var_list;
HSH_remove(new_ctx_sym);
diff --git a/src/jrd/Database.h b/src/jrd/Database.h
index 4f81b88c90..62a5526638 100644
--- a/src/jrd/Database.h
+++ b/src/jrd/Database.h
@@ -81,8 +81,8 @@ namespace Jrd
class TrigVector : public Firebird::ObjectsArray<Trigger>
{
public:
- TrigVector(Firebird::MemoryPool& pool)
- : Firebird::ObjectsArray<Trigger>(pool),
+ TrigVector(Firebird::MemoryPool& mempool)
+ : Firebird::ObjectsArray<Trigger>(mempool),
useCount(0)
{ }
diff --git a/src/jrd/RuntimeStatistics.h b/src/jrd/RuntimeStatistics.h
index d00b3fb61c..3543d89a2a 100644
--- a/src/jrd/RuntimeStatistics.h
+++ b/src/jrd/RuntimeStatistics.h
@@ -101,8 +101,8 @@ public:
reset();
}
- explicit RuntimeStatistics(MemoryPool& pool)
- : Firebird::AutoStorage(pool), rel_counts(getPool())
+ explicit RuntimeStatistics(MemoryPool& mempool)
+ : Firebird::AutoStorage(mempool), rel_counts(getPool())
{
reset();
}
@@ -117,8 +117,8 @@ public:
relChgNumber = other.relChgNumber;
}
- RuntimeStatistics(MemoryPool& pool, const RuntimeStatistics& other)
- : Firebird::AutoStorage(pool), rel_counts(getPool())
+ RuntimeStatistics(MemoryPool& mempool, const RuntimeStatistics& other)
+ : Firebird::AutoStorage(mempool), rel_counts(getPool())
{
memcpy(values, other.values, sizeof(values));
rel_counts = other.rel_counts;
diff --git a/src/jrd/common.h b/src/jrd/common.h
index 49e8b607d8..37fb209480 100644
--- a/src/jrd/common.h
+++ b/src/jrd/common.h
@@ -494,7 +494,11 @@ extern "C" int remove(const char* path);
/* The following define is the prefix to go in front of a "d" or "u"
format item in a printf() format string, to indicate that the argument
is an SINT64 or FB_UINT64. */
+#if !defined(__USE_MINGW_ANSI_STDIO)
#define QUADFORMAT "I64"
+#else
+#define QUADFORMAT "ll"
+#endif
/* The following macro creates a quad-sized constant, possibly one
which is too large to fit in a long int. The Microsoft compiler does
not permit the LL suffix which some other platforms require, but it
diff --git a/src/jrd/gds.cpp b/src/jrd/gds.cpp
index a802e8ce90..b603a8dde1 100644
--- a/src/jrd/gds.cpp
+++ b/src/jrd/gds.cpp
@@ -122,7 +122,7 @@ static const TEXT gdslogid[] = "";
#ifdef WIN_NT
#include <shlobj.h>
-#if _MSC_VER <= 1500
+#if defined(_MSC_VER) && (_MSC_VER<=1500)
#include <shfolder.h>
#endif
#define _WINSOCKAPI_
--
2.13.0

View File

@@ -1,335 +0,0 @@
From 2b9a68b2a714f3cfa791e2dcb6b928b1b3a270a1 Mon Sep 17 00:00:00 2001
From: Alexey Pavlov <alexpux@gmail.com>
Date: Fri, 9 Jun 2017 15:01:35 +0300
Subject: [PATCH 29/29] Fix format warnings
---
src/gpre/c_cxx.cpp | 90 +++++++++++++++++++++++++++---------------------------
1 file changed, 45 insertions(+), 45 deletions(-)
diff --git a/src/gpre/c_cxx.cpp b/src/gpre/c_cxx.cpp
index f8fe95964a..efff81cc68 100644
--- a/src/gpre/c_cxx.cpp
+++ b/src/gpre/c_cxx.cpp
@@ -1226,7 +1226,7 @@ static void gen_compile( const act* action, int column)
fprintf(gpreGlob.out_file, "\n");
align(column - INDENT);
for (; blob; blob = blob->blb_next)
- fprintf(gpreGlob.out_file, "isc_%d = ", blob->blb_ident);
+ fprintf(gpreGlob.out_file, "isc_%zu = ", blob->blb_ident);
fprintf(gpreGlob.out_file, "0;");
}
}
@@ -1246,14 +1246,14 @@ static void gen_create_database( const act* action, int column)
const gpre_req* request = ((const mdbb*) action->act_object)->mdbb_dpb_request;
const gpre_dbb* db = request->req_database;
- sprintf(s1, "isc_%dl", request->req_ident);
- sprintf(trname, "isc_%dt", request->req_ident);
+ sprintf(s1, "isc_%zul", request->req_ident);
+ sprintf(trname, "isc_%zut", request->req_ident);
if (request->req_flags & REQ_extend_dpb)
{
- sprintf(s2, "isc_%dp", request->req_ident);
+ sprintf(s2, "isc_%zup", request->req_ident);
if (request->req_length)
- printa(column, "%s = isc_%d;", s2, request->req_ident);
+ printa(column, "%s = isc_%zu;", s2, request->req_ident);
else
printa(column, "%s = (char*) 0;", s2);
@@ -1267,7 +1267,7 @@ static void gen_create_database( const act* action, int column)
db->dbb_r_lc_ctype ? db->dbb_r_lc_ctype : "(char*) 0");
}
else
- sprintf(s2, "isc_%d", request->req_ident);
+ sprintf(s2, "isc_%zu", request->req_ident);
PAT args;
args.pat_vector1 = status_vector(action);
@@ -1285,7 +1285,7 @@ static void gen_create_database( const act* action, int column)
if (request->req_flags & REQ_extend_dpb)
{
if (request->req_length)
- printa(column, "if (%s != isc_%d)", s2, request->req_ident);
+ printa(column, "if (%s != isc_%zu)", s2, request->req_ident);
printa(column + (request->req_length ? INDENT : 0), "isc_free ((char*) %s);", s2);
// reset the length of the dpb
@@ -1303,7 +1303,7 @@ static void gen_create_database( const act* action, int column)
printa(column, "if (%s)", trname);
column += INDENT;
align(column);
- fprintf(gpreGlob.out_file, "isc_ddl (%s, &%s, &%s, (short) %d, isc_%d);",
+ fprintf(gpreGlob.out_file, "isc_ddl (%s, &%s, &%s, (short) %d, isc_%zu);",
status_vector(action), request->req_database->dbb_name->sym_string,
trname, request->req_length, request->req_ident);
column -= INDENT;
@@ -1356,7 +1356,7 @@ static void gen_cursor_init( const act* action, int column)
if (action->act_request->req_flags & (REQ_sql_blob_open | REQ_sql_blob_create))
{
- printa(column, "isc_%d = 0;", action->act_request->req_blobs->blb_ident);
+ printa(column, "isc_%zu = 0;", action->act_request->req_blobs->blb_ident);
}
}
@@ -1547,7 +1547,7 @@ static void gen_ddl( const act* action, int column)
}
align(column);
- fprintf(gpreGlob.out_file, "isc_ddl (%s, &%s, &%s, (short) %d, isc_%d);",
+ fprintf(gpreGlob.out_file, "isc_ddl (%s, &%s, &%s, (short) %d, isc_%zu);",
status_vector(action),
request->req_database->dbb_name->sym_string,
gpreGlob.transaction_name, request->req_length, request->req_ident);
@@ -2457,7 +2457,7 @@ static void gen_get_or_put_slice(const act* action, const ref* reference, bool g
gen_name(s1, reference, true); // blob handle
args.pat_string2 = s1;
args.pat_value1 = reference->ref_sdl_length; // slice description length
- sprintf(s2, "isc_%d", reference->ref_sdl_ident); // slice description
+ sprintf(s2, "isc_%zu", reference->ref_sdl_ident); // slice description
args.pat_string3 = s2;
args.pat_long1 = reference->ref_field->fld_array_info->ary_size;
@@ -2468,7 +2468,7 @@ static void gen_get_or_put_slice(const act* action, const ref* reference, bool g
args.pat_string5 = reference->ref_value;
else
{
- sprintf(s4, "isc_%d", reference->ref_field->fld_array_info->ary_ident);
+ sprintf(s4, "isc_%zu", reference->ref_field->fld_array_info->ary_ident);
args.pat_string5 = s4; // array name
}
@@ -2518,13 +2518,13 @@ static void gen_get_segment( const act* action, int column)
column += INDENT;
begin(column);
align(column);
- fprintf(gpreGlob.out_file, "isc_ftof (isc_%d, isc_%d, %s, isc_%d);",
+ fprintf(gpreGlob.out_file, "isc_ftof (isc_%zu, isc_%zu, %s, isc_%zu);",
blob->blb_buff_ident, blob->blb_len_ident,
into->ref_value, blob->blb_len_ident);
if (into->ref_null_value)
{
align(column);
- fprintf(gpreGlob.out_file, "%s = isc_%d;", into->ref_null_value, blob->blb_len_ident);
+ fprintf(gpreGlob.out_file, "%s = isc_%zu;", into->ref_null_value, blob->blb_len_ident);
}
endp(column);
column -= INDENT;
@@ -2696,9 +2696,9 @@ static void gen_put_segment( const act* action, int column)
blob = (blb*) action->act_request->req_blobs;
const ref* from = action->act_object;
align(column);
- fprintf(gpreGlob.out_file, "isc_%d = %s;", blob->blb_len_ident, from->ref_null_value);
+ fprintf(gpreGlob.out_file, "isc_%zu = %s;", blob->blb_len_ident, from->ref_null_value);
align(column);
- fprintf(gpreGlob.out_file, "isc_ftof (%s, isc_%d, isc_%d, isc_%d);",
+ fprintf(gpreGlob.out_file, "isc_ftof (%s, isc_%zu, isc_%zu, isc_%zu);",
from->ref_value, blob->blb_len_ident,
blob->blb_buff_ident, blob->blb_len_ident);
}
@@ -2857,32 +2857,32 @@ static void gen_request(const gpre_req* request)
if (request->req_flags & REQ_extend_dpb)
{
- printa(0, "static char\n *isc_%dp;", request->req_ident);
+ printa(0, "static char\n *isc_%zup;", request->req_ident);
if (!request->req_length)
- printa(0, "static short\n isc_%dl = %d;", request->req_ident, request->req_length);
+ printa(0, "static short\n isc_%zul = %d;", request->req_ident, request->req_length);
}
if (request->req_type == REQ_create_database)
- printa(0, "static %s\n *isc_%dt;", DCL_LONG, request->req_ident);
+ printa(0, "static %s\n *isc_%zut;", DCL_LONG, request->req_ident);
if (request->req_flags & (REQ_sql_blob_open | REQ_sql_blob_create))
- printa(0, "static isc_stmt_handle\n isc_%ds;\t\t/* sql statement handle */",
+ printa(0, "static isc_stmt_handle\n isc_%zus;\t\t/* sql statement handle */",
request->req_ident);
if (request->req_length)
{
if (request->req_flags & REQ_sql_cursor)
- printa(0, "static isc_stmt_handle\n isc_%ds;\t\t/* sql statement handle */",
+ printa(0, "static isc_stmt_handle\n isc_%zus;\t\t/* sql statement handle */",
request->req_ident);
#ifdef SCROLLABLE_CURSORS
if (request->req_flags & REQ_scroll)
printa(0, "static short\n isc_%ddirection;\t\t/* last direction sent to engine */",
request->req_ident);
#endif
- printa(0, "static %sshort\n isc_%dl = %d;",
+ printa(0, "static %sshort\n isc_%zul = %d;",
(request->req_flags & REQ_extend_dpb) ? "" : CONST_STR,
request->req_ident, request->req_length);
- printa(0, "static %schar\n isc_%d [] = {", CONST_STR, request->req_ident);
+ printa(0, "static %schar\n isc_%zu [] = {", CONST_STR, request->req_ident);
const TEXT* string_type = "blr";
if (gpreGlob.sw_raw)
@@ -2939,7 +2939,7 @@ static void gen_request(const gpre_req* request)
if (fb_print_blr(request->req_blr, request->req_length, gen_blr, 0, 0))
CPR_error("internal error during BLR generation");
}
- printa(INDENT, "};\t/* end of %s string for request isc_%d */\n",
+ printa(INDENT, "};\t/* end of %s string for request isc_%zu */\n",
string_type, request->req_ident);
}
@@ -2951,15 +2951,15 @@ static void gen_request(const gpre_req* request)
{
if (reference->ref_sdl)
{
- printa(0, "static %sshort\n isc_%dl = %d;", CONST_STR,
+ printa(0, "static %sshort\n isc_%zul = %d;", CONST_STR,
reference->ref_sdl_ident, reference->ref_sdl_length);
- printa(0, "static %schar\n isc_%d [] = {", CONST_STR, reference->ref_sdl_ident);
+ printa(0, "static %schar\n isc_%zu [] = {", CONST_STR, reference->ref_sdl_ident);
if (gpreGlob.sw_raw)
gen_raw(reference->ref_sdl, reference->ref_sdl_length);
else if (PRETTY_print_sdl(reference->ref_sdl, gen_blr, 0, 0))
CPR_error("internal error during SDL generation");
- printa(INDENT, "};\t/* end of sdl string for request isc_%d */\n",
+ printa(INDENT, "};\t/* end of sdl string for request isc_%zu */\n",
reference->ref_sdl_ident);
}
}
@@ -2982,9 +2982,9 @@ static void gen_request(const gpre_req* request)
if (request->req_type == REQ_slice)
{
printa(0, "static %s", DCL_LONG);
- printa(INDENT, "isc_%dv [%d],", request->req_ident,
+ printa(INDENT, "isc_%zuv [%d],", request->req_ident,
MAX(request->req_slice->slc_parameters, 1));
- printa(INDENT, "isc_%ds;", request->req_ident);
+ printa(INDENT, "isc_%zus;", request->req_ident);
}
}
@@ -3027,10 +3027,10 @@ static void gen_routine( const act* action, int column)
make_port(port, column);
for (const blb* blob = request->req_blobs; blob; blob = blob->blb_next)
{
- printa(column, "isc_blob_handle\t\tisc_%d;\t\t/* blob handle */", blob->blb_ident);
- printa(column, "char\t\t\tisc_%d [%d];\t/* blob segment */",
+ printa(column, "isc_blob_handle\t\tisc_%zu;\t\t/* blob handle */", blob->blb_ident);
+ printa(column, "char\t\t\tisc_%zu [%d];\t/* blob segment */",
blob->blb_buff_ident, blob->blb_seg_length);
- printa(column, "unsigned short\tisc_%d;\t\t/* segment length */", blob->blb_len_ident);
+ printa(column, "unsigned short\tisc_%zu;\t\t/* segment length */", blob->blb_len_ident);
}
}
}
@@ -3163,7 +3163,7 @@ static void gen_segment( const act* action, int column)
{
const blb* blob = (blb*) action->act_object;
- printa(column, "isc_%d",
+ printa(column, "isc_%zu",
(action->act_type == ACT_segment) ? blob->blb_buff_ident :
(action->act_type == ACT_segment_length) ? blob->blb_len_ident : blob->blb_ident);
}
@@ -3254,7 +3254,7 @@ static void gen_slice( const act* action, const ref* var_reference, int column)
// Compute array size
- printa(column, "isc_%ds = %d", request->req_ident, slice->slc_field->fld_array->fld_length);
+ printa(column, "isc_%zus = %d", request->req_ident, slice->slc_field->fld_array->fld_length);
const slc::slc_repeat* tail = slice->slc_rpt;
for (const slc::slc_repeat* const end = tail + slice->slc_dimensions; tail < end; ++tail)
@@ -3277,7 +3277,7 @@ static void gen_slice( const act* action, const ref* var_reference, int column)
const ref* reference;
for (reference = request->req_values; reference; reference = reference->ref_next)
{
- printa(column, "isc_%dv [%d] = %s;",
+ printa(column, "isc_%zuv [%d] = %s;",
request->req_ident, reference->ref_id, reference->ref_value);
}
@@ -3422,7 +3422,7 @@ static void gen_t_start( const act* action, int column)
remaining = 256 - column - INDENT;
}
remaining -= length;
- fprintf(gpreGlob.out_file, ", &%s, (short) %d, isc_tpb_%d",
+ fprintf(gpreGlob.out_file, ", &%s, (short) %d, isc_tpb_%zu",
tpb_iterator->tpb_database->dbb_name->sym_string,
tpb_iterator->tpb_length, tpb_iterator->tpb_ident);
}
@@ -3450,7 +3450,7 @@ static void gen_tpb(const tpb* tpb_buffer, int column)
for (length = 0; length < column; length++)
*p++ = ' ';
- sprintf(p, "isc_tpb_%d [%d] = {", tpb_buffer->tpb_ident, tpb_buffer->tpb_length);
+ sprintf(p, "isc_tpb_%zu [%d] = {", tpb_buffer->tpb_ident, tpb_buffer->tpb_length);
while (*p)
p++;
@@ -3666,7 +3666,7 @@ static void make_array_declaration(ref* reference)
}
}
- fprintf(gpreGlob.out_file, "static %s isc_%d", dtype, field->fld_array_info->ary_ident);
+ fprintf(gpreGlob.out_file, "static %s isc_%zu", dtype, field->fld_array_info->ary_ident);
// Print out the dimension part of the declaration
@@ -3748,7 +3748,7 @@ static void make_ok_test( const act* action, const gpre_req* request, int column
static void make_port(const gpre_port* port, int column)
{
- printa(column, "struct isc_%d_struct {", port->por_ident);
+ printa(column, "struct isc_%zu_struct {", port->por_ident);
for (const ref* reference = port->por_references; reference; reference = reference->ref_next)
{
@@ -3832,7 +3832,7 @@ static void make_port(const gpre_port* port, int column)
fprintf(gpreGlob.out_file, " %s isc_%d;\t/* %s */", dtype, reference->ref_ident, name);
}
- printa(column, "} isc_%d;", port->por_ident);
+ printa(column, "} isc_%zu;", port->por_ident);
}
@@ -3851,12 +3851,12 @@ static void make_ready(const gpre_dbb* db,
if (request)
{
- sprintf(s1, "isc_%dl", request->req_ident);
+ sprintf(s1, "isc_%zul", request->req_ident);
if (request->req_flags & REQ_extend_dpb)
- sprintf(s2, "isc_%dp", request->req_ident);
+ sprintf(s2, "isc_%zup", request->req_ident);
else
- sprintf(s2, "isc_%d", request->req_ident);
+ sprintf(s2, "isc_%zu", request->req_ident);
// if the dpb needs to be extended at runtime to include items
// in host variables, do so here; this assumes that there is
@@ -3865,7 +3865,7 @@ static void make_ready(const gpre_dbb* db,
if (request->req_flags & REQ_extend_dpb)
{
if (request->req_length)
- printa(column, "%s = isc_%d;", s2, request->req_ident);
+ printa(column, "%s = isc_%zu;", s2, request->req_ident);
else
printa(column, "%s = (char*) 0;", s2);
@@ -3900,7 +3900,7 @@ static void make_ready(const gpre_dbb* db,
if (request && request->req_flags & REQ_extend_dpb)
{
if (request->req_length)
- printa(column, "if (%s != isc_%d)", s2, request->req_ident);
+ printa(column, "if (%s != isc_%zu)", s2, request->req_ident);
printa(column + (request->req_length ? INDENT : 0), "isc_free ((char*) %s);", s2);
// reset the length of the dpb
--
2.13.0

View File

@@ -1,26 +0,0 @@
From e801534c5eb8cb049dc480fea48fddddd8415d05 Mon Sep 17 00:00:00 2001
From: Tim S <stahta01@users.sourceforge.net>
Date: Wed, 16 Aug 2017 20:35:10 -0400
Subject: [PATCH] Added build flags to fix build errors.
Added "-Wno-deprecated", "-fcheck-new", and "-std=gnu++11" options to fix compiler error/warnings.
---
builds/posix/prefix.mingw | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/builds/posix/prefix.mingw b/builds/posix/prefix.mingw
index 8e514d8c33..e4f38a1e6e 100644
--- a/builds/posix/prefix.mingw
+++ b/builds/posix/prefix.mingw
@@ -23,8 +23,8 @@
endif
# -Wno-unused-variable is used due to unused gpre generated variables
-PROD_FLAGS=-O2 -DMINGW -Wall -Wshadow -Wundef -Wno-long-long -Wno-unused-variable -Wno-sign-compare -Wno-parentheses -Wno-switch -fmessage-length=0 -Dlint -DWIN32_LEAN_AND_MEAN -MMD -mthreads
-DEV_FLAGS=-ggdb -DMINGW -Wall -Wshadow -Wundef -Wno-long-long -Wno-unused-variable -Wno-sign-compare -Wno-parentheses -Wno-switch -fmessage-length=0 -Dlint -DWIN32_LEAN_AND_MEAN -MMD -mthreads
+PROD_FLAGS=-O2 -DMINGW -Wall -Wshadow -Wundef -Wno-long-long -Wno-unused-variable -Wno-sign-compare -Wno-parentheses -Wno-switch -Wno-deprecated -fmessage-length=0 -Dlint -DWIN32_LEAN_AND_MEAN -MMD -mthreads -fcheck-new -std=gnu++11
+DEV_FLAGS=-ggdb -DMINGW -Wall -Wshadow -Wundef -Wno-long-long -Wno-unused-variable -Wno-sign-compare -Wno-parentheses -Wno-switch -Wno-deprecated -fmessage-length=0 -Dlint -DWIN32_LEAN_AND_MEAN -MMD -mthreads -fcheck-new -std=gnu++11
PLATFORM_PATH=os/win32

View File

@@ -1,24 +0,0 @@
From 2980d42e1b6164dddc62e78edaac8b99ccf8f83f Mon Sep 17 00:00:00 2001
From: Alexpux <alexey.pawlow@gmail.com>
Date: Wed, 19 Nov 2014 09:20:35 +0300
Subject: Fix calling SCL_check_access
---
src/jrd/tra.cpp | 2 +-
1 file changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/jrd/tra.cpp b/src/jrd/tra.cpp
index e0e36acafa..ecc334b805 100644
--- a/src/jrd/tra.cpp 2019-05-21 14:02:46.952465100 +0300
+++ b/src/jrd/tra.cpp 2019-05-21 14:06:08.562747900 +0300
@@ -3857,7 +3857,7 @@
{
ThreadStatusGuard status_vector(tdbb);
- SCL_check_access(tdbb, s_class, 0, NULL, NULL, SCL_read, object_table, false,
+ SCL_check_access(tdbb, s_class, 0, NULL, NULL, SCL_read, object_table,
blb_relation->rel_name);
s_class->scl_blb_access = SecurityClass::BA_SUCCESS;
}
--
2.21.0

View File

@@ -1,212 +0,0 @@
# Maintainer: Alexey Pavlov <alexpux@gmail.com>
# Package building only when previous package is not installed
_realname=firebird
pkgbase=mingw-w64-${_realname}2-git
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}2-git"
pkgver=2.5.9.27152.74a4ec5c50
pkgrel=8
pkgdesc="Cross-platform relational database offering many ANSI SQL standard features - version 2.x (mingw-w64)"
url="https://www.firebirdsql.org/"
license=('custom')
arch=('any')
mingw_arch=('mingw32' 'mingw64' 'ucrt64')
conflicts=("${MINGW_PACKAGE_PREFIX}-${_realname}" "${MINGW_PACKAGE_PREFIX}-${_realname}2" "${MINGW_PACKAGE_PREFIX}-libfbclient")
provides=("${MINGW_PACKAGE_PREFIX}-${_realname}2" "${MINGW_PACKAGE_PREFIX}-libfbclient")
replaces=("${MINGW_PACKAGE_PREFIX}-libfbclient")
depends=("${MINGW_PACKAGE_PREFIX}-gcc-libs"
"${MINGW_PACKAGE_PREFIX}-icu"
"${MINGW_PACKAGE_PREFIX}-zlib")
makedepends=(#"${MINGW_PACKAGE_PREFIX}-btyacc" # Maybe add check in firebird presence of system btyacc
"${MINGW_PACKAGE_PREFIX}-cc"
"${MINGW_PACKAGE_PREFIX}-libatomic_ops"
"${MINGW_PACKAGE_PREFIX}-autotools"
"git")
_commit="74a4ec5c50f6906c01a3a8cfbfc56361469cd9fa"
source=("${_realname}"::"git+https://github.com/FirebirdSQL/firebird.git#commit=${_commit}"
pathtools.c
pathtools.h
0001-Remove-hardcoded-march-to-allow-64-bit-builds.patch
0002-Always-use-Win32-threads-for-mingw.patch
0003-Define-AMD64-for-64-bit-mingw.patch
0004-mingw-w64-have-isinf.patch
0005-Fix-cast-error.patch
0006-mingw-w64-don-t-need-hack-for-SecPkgContext_AccessTo.patch
0007-Use-modern-ICU-libraries-when-link-with-system-wide-.patch
0008-mingw-w64-don-t-have-win98-support.patch
0009-Fix-redefinition-of-matherr.patch
0010-Don-t-export-gds__print_pool-as-it-not-part-of-API-a.patch
0011-mingw-w64-have-fenv.h.patch
0012-Fix-cast-error-for-64-bit.patch
0013-Fix-source-extension.patch
0014-Move-extra-mingw-sources-definitions-for-fbintl-to-M.patch
0015-Add-missing-sources-for-utils-building.patch
0016-smtp_server-Add-win32-platform-files.patch
0017-Fix-building-net_server-and-mp_server-with-mingw.patch
0018-For-mingw-place-dll-s-into-BIN-and-generate-import-l.patch
0019-Don-t-install-unix-files-for-Windows-platform.patch
0020-Fix-rules-to-use-variables.patch
0021-Auto-detect-WINDRES-with-autoconf.patch
0022-Create-symlinks-of-fbembed-only-if-names-are-differe.patch
0023-mod_loader-mingw-always-link-to-msvcrt.dll.patch
0024-Relocate-paths-for-unix-like-files-layout.patch
0025-Fix-building-gstat.patch
0026-Fix-using-function-pointer.patch
0027-The-operator-new-declaration-has-changed-slightly-in.patch
0028-Fix-different-warnings.patch
#0030-Use-nullptr.patch
0031-Fix-compiler-flags.patch
#0032-fix-SCL_check_access-call.patch
)
sha256sums=('SKIP'
'ebf471173f5ee9c4416c10a78760cea8afaf1a4a6e653977321e8547ce7bf3c0'
'1585ef1b61cf53a2ca27049c11d49e0834683dfda798f03547761375df482a90'
'eaa4b490dfaac611001d06f9e1f0fc782340c9631808cb4ded16148f16498146'
'6d8c2321a4fe693ac444db650b090fd841cc7c7b914bb30d0fe76559ca1be029'
'563193c16e0004f0b4123f153b09462fde08e8a1ab9de25c6de762a7a5751b1e'
'bae8d7bb1e5f84c431167db3606641c875d900991f62152652a1353c53ea28f6'
'56c702d53c017af3a371a6064d3280547c0e09bddadbcf1d8761a47614ce6c76'
'e51633c91aa54d2433cadc6726fabb1946e5b19cd928510c41112718607589a3'
'37026200645a621283f1d2ff7f50f719cea352838d0c3bdf65dbcc7f6fc94b5f'
'efc7fb392127fbeda7f798fca53fd4c8dafb6b9bdf231bf0fe11900fb058a7b7'
'c50164f18a1fa8e5369b7f64ef703936fe62c7499a06a601582441f9c9da2ef4'
'983fe70bc300265bf1e2690bdfeaab19031a4f80fd74f940948e9a56fda293fd'
'61fda2ac6e4e0349b1a60212c2b677581a562b4f08f741bef41c764fc9d10def'
'aec6b53a9b1319d5eceec2dbb823c7f0b675d11b9bde12bb5cc921398e09979e'
'559656a9f6234460ed979b7c743ab8629a954a6ec6e89bd981b5f471490b12c7'
'b6b9251c231f2551d70376b6c6e27879f3fcaf37d657e4ec81f0759a4d747df2'
'e6bc726aae8e519300d8d9ddddebc23f13f1b3f40e5b80d97845ee82e0755d9d'
'c34e0a04b015096434fad579c3e3de79cb08ae68a40f285d0159221bdee12365'
'2e104b68083bd010a2d54ae23ccbe70ddfcaa220cc400acf850b5462380955bb'
'7a84483a48d7d92177d8892c03e3291e3c693f365c7b5c0b38eb5d04d7e589cb'
'80e7741f59815024ace8c1f662c37f5f6c3618890d83b9c94ee074f181e2ea62'
'0439855ce3e58b3b41a0268c0135f3f3600e0ce3015706eefcd155643c590f73'
'e927670f2ef41cdb1f13f300308d75eb7de7b680c2e40246b65a0236fe8c2fad'
'865abc7226916fd4503a80ed5555a835d1774a4659fd32b49fdaa38e8f5d3353'
'5896a3a0b2732a9f835c183ea3d1269e1541428ce11c27b1f15fc3d683da8310'
'6f793e5f87afb1b4a3d3d91552f5966f7c2e30d5841137fe5becc4d44a716bff'
'32a3520e588f0cc6648dfdf66f5a2579ff67d4db30ecdaac69bcf275b8b8c919'
'2e2ee6f9c6d91a707b12666fa340c31b4f8edb8e910cd7ff08d6cfed5ed4c2d2'
'3dade981ceda60919b4ac4a64350855272ea60705ba58b984c15e6d3af3a18a8'
'ef1273dc6ba18c9a7fa112b17b8bde5b89abdb58bca0aa4c0f7c8e9989fc12a1'
'43372147adb06ccd4c86bbfc426d28b3f4a8b573623cb686a49299a81cc7500e')
pkgver() {
cd "${_realname}"
source ${srcdir}/${_realname}/src/misc/writeBuildNum.sh
printf '%s.%s.%s.%s.%s' ${MajorVer} ${MinorVer} ${RevNo} ${BuildNum} "$(git rev-parse --short "${_commit}")"
}
prepare() {
test ! -d "${startdir}/../mingw-w64-pathtools" || {
cmp "${startdir}/../mingw-w64-pathtools/pathtools.c" "${srcdir}/pathtools.c" &&
cmp "${startdir}/../mingw-w64-pathtools/pathtools.h" "${srcdir}/pathtools.h"
} || exit 1
cd ${_realname}
cp -fHv "${srcdir}"/pathtools.c src/common/pathtools.cpp
cp -fHv "${srcdir}"/pathtools.h src/common/
git apply ${srcdir}/0001-Remove-hardcoded-march-to-allow-64-bit-builds.patch
git apply ${srcdir}/0002-Always-use-Win32-threads-for-mingw.patch
git apply ${srcdir}/0003-Define-AMD64-for-64-bit-mingw.patch
git apply ${srcdir}/0004-mingw-w64-have-isinf.patch
git apply ${srcdir}/0005-Fix-cast-error.patch
git apply ${srcdir}/0006-mingw-w64-don-t-need-hack-for-SecPkgContext_AccessTo.patch
git apply ${srcdir}/0007-Use-modern-ICU-libraries-when-link-with-system-wide-.patch
git apply ${srcdir}/0008-mingw-w64-don-t-have-win98-support.patch
git apply ${srcdir}/0009-Fix-redefinition-of-matherr.patch
git apply ${srcdir}/0010-Don-t-export-gds__print_pool-as-it-not-part-of-API-a.patch
git apply ${srcdir}/0011-mingw-w64-have-fenv.h.patch
git apply ${srcdir}/0012-Fix-cast-error-for-64-bit.patch
git apply ${srcdir}/0013-Fix-source-extension.patch
git apply ${srcdir}/0014-Move-extra-mingw-sources-definitions-for-fbintl-to-M.patch
git apply ${srcdir}/0015-Add-missing-sources-for-utils-building.patch
git apply ${srcdir}/0016-smtp_server-Add-win32-platform-files.patch
git apply ${srcdir}/0017-Fix-building-net_server-and-mp_server-with-mingw.patch
git apply ${srcdir}/0018-For-mingw-place-dll-s-into-BIN-and-generate-import-l.patch
git apply ${srcdir}/0019-Don-t-install-unix-files-for-Windows-platform.patch
git apply ${srcdir}/0020-Fix-rules-to-use-variables.patch
git apply ${srcdir}/0021-Auto-detect-WINDRES-with-autoconf.patch
git apply ${srcdir}/0022-Create-symlinks-of-fbembed-only-if-names-are-differe.patch
git apply ${srcdir}/0023-mod_loader-mingw-always-link-to-msvcrt.dll.patch
git apply ${srcdir}/0024-Relocate-paths-for-unix-like-files-layout.patch
git apply ${srcdir}/0025-Fix-building-gstat.patch
git apply ${srcdir}/0026-Fix-using-function-pointer.patch
git apply ${srcdir}/0027-The-operator-new-declaration-has-changed-slightly-in.patch
git apply ${srcdir}/0028-Fix-different-warnings.patch
git apply ${srcdir}/0031-Fix-compiler-flags.patch
NOCONFIGURE=1 ./autogen.sh
}
build() {
[[ -d ${srcdir}/build-${MSYSTEM} ]] && rm -rf ${srcdir}/build-${MSYSTEM}
cp -rf ${_realname} build-${MSYSTEM} && cd build-${MSYSTEM}
local _debug_conf=
if check_option "debug" "y"; then
_debug_conf="--enable-debug"
fi
CFLAGS+=" -D_POSIX_C_SOURCE"
CPPFLAGS+=" -D_POSIX_C_SOURCE"
./configure \
--prefix=${MINGW_PREFIX} \
--build=${MINGW_CHOST} \
--host=${MINGW_CHOST} \
--target=${MINGW_CHOST} \
--enable-static \
--enable-shared \
${_debug_conf} \
--with-system-icu \
--with-fbbin=${MINGW_PREFIX}/bin \
--with-fbsbin=${MINGW_PREFIX}/bin \
--with-fbconf=${MINGW_PREFIX}/etc/${_realname} \
--with-fblib=${MINGW_PREFIX}/lib \
--with-fbinclude=${MINGW_PREFIX}/include \
--with-fbdoc=${MINGW_PREFIX}/share/${_realname}/doc \
--with-fbudf=${MINGW_PREFIX}/share/${_realname}/udf \
--with-fbsample=${MINGW_PREFIX}/share/${_realname}/samples \
--with-fbsample-db=${MINGW_PREFIX}/share/${_realname}/samples/empbuild \
--with-fbhelp=${MINGW_PREFIX}/share/${_realname}/help \
--with-fbintl=${MINGW_PREFIX}/share/${_realname}/intl \
--with-fbmisc=${MINGW_PREFIX}/share/${_realname}/misc \
--with-fbsecure-db=${MINGW_PREFIX}/etc/${_realname} \
--with-fbmsg=${MINGW_PREFIX}/etc/${_realname} \
--with-fblog=${MINGW_PREFIX}/var \
--with-fbglock=${MINGW_PREFIX}/var \
--with-fbplugins=${MINGW_PREFIX}/share/${_realname} \
ac_cv_func_localtime_r=yes \
ac_cv_func_ctime_r=yes
make -j1
}
package() {
cd ${srcdir}/build-${MSYSTEM}
mkdir -p ${pkgdir}${MINGW_PREFIX}/{bin,etc/${_realname},include,lib,share/${_realname}/{doc,help,intl,misc,plugins,samples,udf},var}
cp -f gen/firebird/bin/* ${pkgdir}${MINGW_PREFIX}/bin/
cp -f gen/firebird/lib/* ${pkgdir}${MINGW_PREFIX}/lib/
cp -f gen/firebird/include/* ${pkgdir}${MINGW_PREFIX}/include/
cp -f gen/firebird/UDF/* ${pkgdir}${MINGW_PREFIX}/share/${_realname}/udf/
cp -rf gen/firebird/examples/* ${pkgdir}${MINGW_PREFIX}/share/${_realname}/samples/
cp -f gen/firebird/help/* ${pkgdir}${MINGW_PREFIX}/share/${_realname}/help/
cp -f gen/firebird/intl/* ${pkgdir}${MINGW_PREFIX}/share/${_realname}/intl/
cp -f gen/firebird/plugins/* ${pkgdir}${MINGW_PREFIX}/share/${_realname}/plugins/
#cp -f gen/firebird/misc/* ${pkgdir}${MINGW_PREFIX}/share/${_realname}/misc/
cp -f gen/firebird/*.bat ${pkgdir}${MINGW_PREFIX}/bin/
cp -f gen/firebird/*.conf ${pkgdir}${MINGW_PREFIX}/etc/${_realname}/
cp -f gen/firebird/*.msg ${pkgdir}${MINGW_PREFIX}/etc/${_realname}/
cp -f gen/firebird/*.fdb ${pkgdir}${MINGW_PREFIX}/etc/${_realname}/
cp -rf doc/* ${pkgdir}${MINGW_PREFIX}/share/${_realname}/doc/
touch ${pkgdir}${MINGW_PREFIX}/var/${_realname}.log
# Remove build tools
rm -f ${pkgdir}${MINGW_PREFIX}/bin/{brltable,codes,create_db,*build*,*boot*,*static*,*current*}.exe
}

View File

@@ -1,640 +0,0 @@
/*
.Some useful path tools.
.ASCII only for now.
.Written by Ray Donnelly in 2014.
.Licensed under CC0 (and anything.
.else you need to license it under).
.No warranties whatsoever.
.email: <mingw.android@gmail.com>.
*/
#if defined(__APPLE__)
#include <stdlib.h>
#else
#include <malloc.h>
#endif
#include <limits.h>
#include <stdio.h>
#include <string.h>
#if defined(__linux__) || defined(__CYGWIN__) || defined(__MSYS__)
#include <alloca.h>
#endif
#include <unistd.h>
/* If you don't define this, then get_executable_path()
can only use argv[0] which will often not work well */
#define IMPLEMENT_SYS_GET_EXECUTABLE_PATH
#if defined(IMPLEMENT_SYS_GET_EXECUTABLE_PATH)
#if defined(__linux__) || defined(__CYGWIN__) || defined(__MSYS__)
/* Nothing needed, unistd.h is enough. */
#elif defined(__APPLE__)
#include <mach-o/dyld.h>
#elif defined(_WIN32)
#define WIN32_MEAN_AND_LEAN
#include <windows.h>
#include <psapi.h>
#endif
#endif /* defined(IMPLEMENT_SYS_GET_EXECUTABLE_PATH) */
#include "pathtools.h"
static char *
malloc_copy_string(char const * original)
{
char * result = (char *) malloc (sizeof (char*) * strlen (original)+1);
if (result != NULL)
{
strcpy (result, original);
}
return result;
}
void
sanitise_path(char * path)
{
size_t path_size = strlen (path);
/* Replace any '\' with '/' */
char * path_p = path;
while ((path_p = strchr (path_p, '\\')) != NULL)
{
*path_p = '/';
}
/* Replace any '//' with '/' */
path_p = path + !!*path; /* skip first character, if any, to handle UNC paths correctly */
while ((path_p = strstr (path_p, "//")) != NULL)
{
memmove (path_p, path_p + 1, path_size--);
}
return;
}
char *
get_relative_path(char const * from_in, char const * to_in)
{
size_t from_size = (from_in == NULL) ? 0 : strlen (from_in);
size_t to_size = (to_in == NULL) ? 0 : strlen (to_in);
size_t max_size = (from_size + to_size) * 2 + 4;
char * scratch_space = (char *) alloca (from_size + 1 + to_size + 1 + max_size + max_size);
char * from;
char * to;
char * common_part;
char * result;
size_t count;
/* No to, return "./" */
if (to_in == NULL)
{
return malloc_copy_string ("./");
}
/* If alloca failed or no from was given return a copy of to */
if ( from_in == NULL
|| scratch_space == NULL )
{
return malloc_copy_string (to_in);
}
from = scratch_space;
strcpy (from, from_in);
to = from + from_size + 1;
strcpy (to, to_in);
common_part = to + to_size + 1;
result = common_part + max_size;
simplify_path (from);
simplify_path (to);
result[0] = '\0';
size_t match_size_dirsep = 0; /* The match size up to the last /. Always wind back to this - 1 */
size_t match_size = 0; /* The running (and final) match size. */
size_t largest_size = (from_size > to_size) ? from_size : to_size;
int to_final_is_slash = (to[to_size-1] == '/') ? 1 : 0;
char from_c;
char to_c;
for (match_size = 0; match_size < largest_size; ++match_size)
{
/* To simplify the logic, always pretend the strings end with '/' */
from_c = (match_size < from_size) ? from[match_size] : '/';
to_c = (match_size < to_size) ? to[match_size] : '/';
if (from_c != to_c)
{
if (from_c != '\0' || to_c != '\0')
{
match_size = match_size_dirsep;
}
break;
}
else if (from_c == '/')
{
match_size_dirsep = match_size;
}
}
strncpy (common_part, from, match_size);
common_part[match_size] = '\0';
from += match_size;
to += match_size;
size_t ndotdots = 0;
char const* from_last = from + strlen(from) - 1;
while ((from = strchr (from, '/')) && from != from_last)
{
++ndotdots;
++from;
}
for (count = 0; count < ndotdots; ++count)
{
strcat(result, "../");
}
if (strlen(to) > 0)
{
strcat(result, to+1);
}
/* Make sure that if to ends with '/' result does the same, and
vice-versa. */
size_t size_result = strlen(result);
if ((to_final_is_slash == 1)
&& (!size_result || result[size_result-1] != '/'))
{
strcat (result, "/");
}
else if (!to_final_is_slash
&& size_result && result[size_result-1] == '/')
{
result[size_result-1] = '\0';
}
return malloc_copy_string (result);
}
void
simplify_path(char * path)
{
ssize_t n_toks = 1; /* in-case we need an empty initial token. */
ssize_t i, j;
size_t tok_size;
size_t in_size = strlen (path);
int it_ended_with_a_slash = (path[in_size - 1] == '/') ? 1 : 0;
char * result = path;
if (path[0] == '/' && path[1] == '/') {
/* preserve UNC path */
path++;
in_size--;
result++;
}
sanitise_path(result);
char * result_p = result;
do
{
++n_toks;
++result_p;
} while ((result_p = strchr (result_p, '/')) != NULL);
result_p = result;
char const ** toks = (char const **) alloca (sizeof (char const*) * n_toks);
n_toks = 0;
do
{
if (result_p > result)
{
*result_p++ = '\0';
}
else if (*result_p == '/')
{
/* A leading / creates an empty initial token. */
toks[n_toks++] = result_p;
*result_p++ = '\0';
}
toks[n_toks++] = result_p;
} while ((result_p = strchr (result_p, '/')) != NULL);
/* Remove all non-leading '.' and any '..' we can match
with an earlier forward path (i.e. neither '.' nor '..') */
for (i = 1; i < n_toks; ++i)
{
int removals[2] = { -1, -1 };
if ( strcmp (toks[i], "." ) == 0)
{
removals[0] = i;
}
else if ( strcmp (toks[i], ".." ) == 0)
{
/* Search backwards for a forward path to collapse.
If none are found then the .. also stays. */
for (j = i - 1; j > -1; --j)
{
if ( strcmp (toks[j], "." )
&& strcmp (toks[j], ".." ) )
{
removals[0] = j;
removals[1] = i;
break;
}
}
}
for (j = 0; j < 2; ++j)
{
if (removals[j] >= 0) /* Can become -2 */
{
--n_toks;
memmove (&toks[removals[j]], &toks[removals[j]+1], (n_toks - removals[j])*sizeof (char*));
--i;
if (!j)
{
--removals[1];
}
}
}
}
result_p = result;
for (i = 0; i < n_toks; ++i)
{
tok_size = strlen(toks[i]);
memmove (result_p, toks[i], tok_size);
result_p += tok_size;
if ((!i || tok_size) && ((i < n_toks - 1) || it_ended_with_a_slash == 1))
{
*result_p = '/';
++result_p;
}
}
*result_p = '\0';
}
int
get_executable_path(char const * argv0, char * result, ssize_t max_size)
{
char * system_result = (char *) alloca (max_size);
ssize_t system_result_size = -1;
ssize_t result_size = -1;
if (system_result != NULL)
{
#if defined(IMPLEMENT_SYS_GET_EXECUTABLE_PATH)
#if defined(__linux__) || defined(__CYGWIN__) || defined(__MSYS__)
system_result_size = readlink("/proc/self/exe", system_result, max_size);
#elif defined(__APPLE__)
uint32_t bufsize = (uint32_t)max_size;
if (_NSGetExecutablePath(system_result, &bufsize) == 0)
{
system_result_size = (ssize_t)bufsize;
}
#elif defined(_WIN32)
unsigned long bufsize = (unsigned long)max_size;
system_result_size = GetModuleFileNameA(NULL, system_result, bufsize);
if (system_result_size == 0 || system_result_size == (ssize_t)bufsize)
{
/* Error, possibly not enough space. */
system_result_size = -1;
}
else
{
/* Early conversion to unix slashes instead of more changes
everywhere else .. */
char * winslash;
system_result[system_result_size] = '\0';
while ((winslash = strchr (system_result, '\\')) != NULL)
{
*winslash = '/';
}
}
#else
#warning "Don't know how to get executable path on this system"
#endif
#endif /* defined(IMPLEMENT_SYS_GET_EXECUTABLE_PATH) */
}
/* Use argv0 as a default in-case of failure */
if (system_result_size != -1)
{
strncpy (result, system_result, system_result_size);
result[system_result_size] = '\0';
}
else
{
if (argv0 != NULL)
{
strncpy (result, argv0, max_size);
result[max_size-1] = '\0';
}
else
{
result[0] = '\0';
}
}
result_size = strlen (result);
return result_size;
}
#if defined(_WIN32)
int
get_dll_path(char * result, unsigned long max_size)
{
HMODULE handle;
char * p;
int ret;
if (!GetModuleHandleExA(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS |
GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT,
(LPCSTR) &get_dll_path, &handle))
{
return -1;
}
ret = GetModuleFileNameA(handle, result, max_size);
if (ret == 0 || ret == (int)max_size)
{
return -1;
}
/* Early conversion to unix slashes instead of more changes
everywhere else .. */
result[ret] = '\0';
p = result - 1;
while ((p = strchr (p + 1, '\\')) != NULL)
{
*p = '/';
}
return ret;
}
#endif
static char const *
strip_n_prefix_folders(char const * path, size_t n)
{
if (path == NULL)
{
return NULL;
}
if (path[0] != '/')
{
return path;
}
char const * last = path;
while (n-- && path != NULL)
{
last = path;
path = strchr (path + 1, '/');
}
return (path == NULL) ? last : path;
}
void
strip_n_suffix_folders(char * path, size_t n)
{
if (path == NULL)
{
return;
}
while (n--)
{
if (strrchr (path + 1, '/'))
{
*strrchr (path + 1, '/') = '\0';
}
else
{
return;
}
}
return;
}
static size_t
split_path_list(char const * path_list, char split_char, char *** arr)
{
size_t path_count;
size_t path_list_size;
char const * path_list_p;
path_list_p = path_list;
if (path_list == NULL || path_list[0] == '\0')
{
return 0;
}
path_list_size = strlen (path_list);
path_count = 0;
do
{
++path_count;
++path_list_p;
}
while ((path_list_p = strchr (path_list_p, split_char)) != NULL);
/* allocate everything in one go. */
char * all_memory = (char *) malloc (sizeof (char *) * path_count + strlen(path_list) + 1);
if (all_memory == NULL)
return 0;
*arr = (char **)all_memory;
all_memory += sizeof (char *) * path_count;
path_count = 0;
path_list_p = path_list;
char const * next_path_list_p = 0;
do
{
next_path_list_p = strchr (path_list_p, split_char);
if (next_path_list_p != NULL)
{
++next_path_list_p;
}
size_t this_size = (next_path_list_p != NULL)
? next_path_list_p - path_list_p - 1
: &path_list[path_list_size] - path_list_p;
memcpy (all_memory, path_list_p, this_size);
all_memory[this_size] = '\0';
(*arr)[path_count++] = all_memory;
all_memory += this_size + 1;
} while ((path_list_p = next_path_list_p) != NULL);
return path_count;
}
static char *
get_relocated_path_list_ref(char const * from, char const * to_path_list, char *ref_path)
{
char * temp;
if ((temp = strrchr (ref_path, '/')) != NULL)
{
temp[1] = '\0';
}
char **arr = NULL;
/* Ask Alexey why he added this. Are we not 100% sure
that we're dealing with unix paths here? */
char split_char = ':';
if (strchr (to_path_list, ';'))
{
split_char = ';';
}
size_t count = split_path_list (to_path_list, split_char, &arr);
int result_size = 1 + (count - 1); /* count - 1 is for ; delim. */
size_t ref_path_size = strlen (ref_path);
size_t i;
/* Space required is:
count * (ref_path_size + strlen (rel_to_datadir))
rel_to_datadir upper bound is:
(count * strlen (from)) + (3 * num_slashes (from))
+ strlen(arr[i]) + 1.
.. pathalogically num_slashes (from) is strlen (from)
(from = ////////) */
size_t space_required = (count * (ref_path_size + 4 * strlen (from))) + count - 1;
for (i = 0; i < count; ++i)
{
space_required += strlen (arr[i]);
}
char * scratch = (char *) alloca (space_required);
if (scratch == NULL)
return NULL;
for (i = 0; i < count; ++i)
{
char * rel_to_datadir = get_relative_path (from, arr[i]);
scratch[0] = '\0';
arr[i] = scratch;
strcat (scratch, ref_path);
strcat (scratch, rel_to_datadir);
free (rel_to_datadir);
simplify_path (arr[i]);
size_t arr_i_size = strlen (arr[i]);
result_size += arr_i_size;
scratch = arr[i] + arr_i_size + 1;
}
char * result = (char *) malloc (result_size);
if (result == NULL)
{
return NULL;
}
result[0] = '\0';
for (i = 0; i < count; ++i)
{
strcat (result, arr[i]);
if (i != count-1)
{
#if defined(_WIN32)
strcat (result, ";");
#else
strcat (result, ":");
#endif
}
}
free ((void*)arr);
return result;
}
char *
get_relocated_path_list(char const *from, char const *to_path_list)
{
char exe_path[MAX_PATH];
get_executable_path (NULL, &exe_path[0], sizeof (exe_path) / sizeof (exe_path[0]));
return get_relocated_path_list_ref(from, to_path_list, exe_path);
}
char *
get_relocated_path_list_lib(char const *from, char const *to_path_list)
{
char dll_path[PATH_MAX];
get_dll_path (&dll_path[0], sizeof(dll_path)/sizeof(dll_path[0]));
return get_relocated_path_list_ref(from, to_path_list, dll_path);
}
static char *
single_path_relocation_ref(const char *from, const char *to, char *ref_path)
{
#if defined(__MINGW32__)
if (strrchr (ref_path, '/') != NULL)
{
strrchr (ref_path, '/')[1] = '\0';
}
char * rel_to_datadir = get_relative_path (from, to);
strcat (ref_path, rel_to_datadir);
free (rel_to_datadir);
simplify_path (&ref_path[0]);
return malloc_copy_string(ref_path);
#else
return malloc_copy_string(to);
#endif
}
char *
single_path_relocation(const char *from, const char *to)
{
#if defined(__MINGW32__)
char exe_path[PATH_MAX];
get_executable_path (NULL, &exe_path[0], sizeof(exe_path)/sizeof(exe_path[0]));
return single_path_relocation_ref(from, to, exe_path);
#else
return malloc_copy_string(to);
#endif
}
char *
single_path_relocation_lib(const char *from, const char *to)
{
#if defined(__MINGW32__)
char dll_path[PATH_MAX];
get_dll_path (&dll_path[0], sizeof(dll_path)/sizeof(dll_path[0]));
return single_path_relocation_ref(from, to, dll_path);
#else
return malloc_copy_string(to);
#endif
}
char const *
msys2_get_relocated_single_path(char const * unix_path)
{
char * unix_part = (char *) strip_n_prefix_folders (unix_path, 1);
char win_part[MAX_PATH];
get_executable_path (NULL, &win_part[0], MAX_PATH);
strip_n_suffix_folders (&win_part[0], 2); /* 2 because the file name is present. */
char * new_path = (char *) malloc (strlen (unix_part) + strlen (win_part) + 1);
strcpy (new_path, win_part);
strcat (new_path, unix_part);
return new_path;
}
char *
msys2_get_relocated_path_list(char const * paths)
{
char win_part[MAX_PATH];
get_executable_path (NULL, &win_part[0], MAX_PATH);
strip_n_suffix_folders (&win_part[0], 2); /* 2 because the file name is present. */
char **arr = NULL;
size_t count = split_path_list (paths, ':', &arr);
int result_size = 1 + (count - 1); /* count - 1 is for ; delim. */
size_t i;
for (i = 0; i < count; ++i)
{
arr[i] = (char *) strip_n_prefix_folders (arr[i], 1);
result_size += strlen (arr[i]) + strlen (win_part);
}
char * result = (char *) malloc (result_size);
if (result == NULL)
{
return NULL;
}
result[0] = '\0';
for (i = 0; i < count; ++i)
{
strcat (result, win_part);
strcat (result, arr[i]);
if (i != count-1)
{
#if defined(_WIN32)
strcat (result, ";");
#else
strcat (result, ":");
#endif
}
}
free ((void*)arr);
return result;
}

View File

@@ -1,65 +0,0 @@
/*
.Some useful path tools.
.ASCII only for now.
.Written by Ray Donnelly in 2014.
.Licensed under CC0 (and anything.
.else you need to license it under).
.No warranties whatsoever.
.email: <mingw.android@gmail.com>.
*/
#ifndef PATHTOOLS_H
#define PATHTOOLS_H
#include <stddef.h>
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
/* In-place replaces any '\' with '/' and any '//' with '/' */
void sanitise_path(char * path);
/* Uses a host OS specific function to determine the path of the executable,
if IMPLEMENT_SYS_GET_EXECUTABLE_PATH is defined, otherwise uses argv0. */
int get_executable_path(char const * argv0, char * result, ssize_t max_size);
int get_dll_path(char * result, unsigned long max_size);
/* Where possible, in-place removes occourances of '.' and 'path/..' */
void simplify_path(char * path);
/* Allocates (via malloc) and returns the path to get from from to to. */
char * get_relative_path(char const * from, char const * to);
/* NULL terminates path to remove n suffix folders. */
void strip_n_suffix_folders(char * path, size_t n);
char * get_relocated_path_list(char const * from, char const * to_path_list);
char * get_relocated_path_list_lib(char const * from, char const * to_path_list);
char * single_path_relocation(const char *from, const char *to);
char * single_path_relocation_lib(const char *from, const char *to);
/* Allocates (via malloc) and returns a relocated path from a single Unix path.
This function makes large assumptions regarding PREFIX and is therefore very
much an MSYS2-only function. It operates by removing the first folder of the
input and final folder of the program executable then appending the input to
that.
*/
char const * msys2_get_relocated_single_path(char const * unix_path);
/* Allocates (via malloc) and for each ':' delimited Unix sub-path, returns the
result of applying the procedure detailed for msys2_get_relocated_single_path
on that Unix sub-path with the results joined up again with a ';' delimiter.
It implements the same logic in msys2_get_relocated_single_path to reduce the
the number of mallocs.
*/
char * msys2_get_relocated_path_list(char const * paths);
#ifdef __cplusplus
}
#endif
#endif /* PATHTOOLS_H */