Branch libreoffice-24-8-3
[LibreOffice.git] / external / firebird / firebird-cygwin-msvc.patch
blobc59c614ba5da67cc0216e95321ae4a0a04989f54
1 --- src/include/firebird.h 2016-07-15 11:31:27.151443500 +0200
2 +++ src/include/firebird.h 2016-07-17 14:50:04.043792400 +0200
3 @@ -32,11 +32,7 @@
4 #ifndef INCLUDE_Firebird_H
5 #define INCLUDE_Firebird_H
7 -#ifdef _MSC_VER
8 -#include "gen/autoconfig_msvc.h"
9 -#else
10 #include "gen/autoconfig.h"
11 -#endif
13 #if defined __clang__
14 //#if __has_feature(address_sanitizer)
15 --- src/misc/writeBuildNum.sh 2016-07-07 15:57:04.538983200 +0200
16 +++ src/misc/writeBuildNum.sh 2016-07-13 11:31:18.132820200 +0200
17 @@ -95,9 +95,9 @@
18 createMakeVersion() {
20 OdsH="${Root}/src/jrd/ods.h"
21 -Mini="/tmp/miniods.h"
22 -TestCpp="/tmp/test.cpp"
23 -AOut="/tmp/a.out"
24 +Mini=$(cygpath -m "/tmp/miniods.h")
25 +TestCpp=$(cygpath -m "/tmp/test.cpp")
26 +AOut=$(cygpath -m "/tmp/a.out")
28 grep ODS_VERSION $OdsH | grep -v ENCODE_ODS >$Mini
30 --- configure 2016-07-07 15:57:04.538983200 +0200
31 +++ configure 2016-07-13 11:31:18.132820200 +0200
32 @@ -21490,13 +21490,12 @@
33 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
34 /* end confdefs.h. */
35 #include <stdlib.h>
36 -#include <semaphore.h>
37 int main () {
38 struct s {
39 char a;
40 - union { long long x; sem_t y; } b;
41 + long long b;
43 exit((int)&((struct s*)1024)->b - 1024);
45 _ACEOF
46 if ac_fn_c_try_run "$LINENO"; then :
47 --- builds/make.new/config/config.h.in 2016-07-07 15:55:55.693112800 +0200
48 +++ builds/make.new/config/config.h.in 2016-07-08 13:38:49.994986400 +0200
49 @@ -211,7 +211,7 @@
50 #undef HAVE_GETMNTENT
52 /* Define to 1 if you have the `getpagesize' function. */
53 -#undef HAVE_GETPAGESIZE
54 +#define HAVE_GETPAGESIZE 1
56 /* Define to 1 if you have the `getrlimit' function. */
57 #undef HAVE_GETRLIMIT
58 @@ -396,7 +396,7 @@
59 #undef HAVE_SIGSET
61 /* Define to 1 if you have the `snprintf' function. */
62 -#undef HAVE_SNPRINTF
63 +#define HAVE_SNPRINTF
65 /* Define to 1 if you have the <socket.h> header file. */
66 #undef HAVE_SOCKET_H
67 @@ -551,7 +551,7 @@
68 #undef HAVE_VFORK_H
70 /* Define to 1 if you have the `vsnprintf' function. */
71 -#undef HAVE_VSNPRINTF
72 +#define HAVE_VSNPRINTF
74 /* Define to 1 if you have the <winsock2.h> header file. */
75 #undef HAVE_WINSOCK2_H
76 @@ -646,7 +646,7 @@
77 #undef TIME_WITH_SYS_TIME
79 /* Define this if OS is Windows NT */
80 -#undef WIN_NT
81 +#define WIN_NT
83 /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
84 significant byte first (like Motorola and SPARC, unlike Intel). */
85 @@ -703,3 +703,20 @@
86 #ifndef HAVE_SOCKLEN_T
87 typedef int socklen_t;
88 #endif
90 +/* taken from src/include/gen/autoconfig_msvc.h */
91 +#ifndef WIN32_LEAN_AND_MEAN
92 +#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
93 +#endif
94 +/* target architecture */
95 +#if defined(_M_AMD64)
96 +#define AMD64
97 +#endif
99 +#define HAVE_IO_H
100 +#define HAVE_CTIME_S
102 +#if defined _MSC_VER
103 +#define isnan _isnan
104 +#endif
106 --- src/common/common.h 2016-07-15 11:31:26.366735500 +0200
107 +++ src/common/common.h 2016-07-17 16:18:39.121579400 +0200
108 @@ -551,15 +551,6 @@
109 #endif /* WIN_NT */
112 -#ifndef FB_CPU
113 -#error Define FB_CPU for your platform
114 -#endif
115 -#ifndef FB_OS
116 -#error Define FB_OS for your platform
117 -#endif
118 -#ifndef FB_CC
119 -#error Define FB_CC for your platform
120 -#endif
123 /*****************************************************
124 diff -ur builds/posix/make.defaults builds/posix/make.defaults
125 --- builds/posix/make.defaults 2016-07-07 13:56:13.036235166 +0200
126 +++ builds/posix/make.defaults 2016-07-07 14:29:52.368289242 +0200
127 @@ -56,7 +56,7 @@
128 else
129 FIREBIRD=$(FB_BUILD)
130 endif
131 -FIREBIRD_LOCK=$(FIREBIRD)
132 +FIREBIRD_LOCK=$(shell cygpath -w $(FIREBIRD))
134 export FIREBIRD
135 export FIREBIRD_LOCK
136 @@ -153,7 +153,7 @@
137 CD= cd
138 CAT= cat
139 AR= ar @AR_OPTIONS@
140 -LN= @LN_S@
141 +LN= cp
142 RANLIB= @RANLIB@
143 BTYACC=$(ROOT)/extern/btyacc/btyacc
144 CLOOP=$(GEN_ROOT)/$(TARGET)/cloop/release/bin/cloop
145 @@ -175,10 +175,10 @@
147 # Default extensions
149 -ARCH_EXT= .a
150 +ARCH_EXT= .lib
151 EXEC_EXT= @EXEEXT@
152 SHRLIB_EXT=@SHRLIB_EXT@
153 -LIB_PREFIX= lib
154 +LIB_PREFIX=
155 SHRLIB_FOREIGN_EXT= $(SHRLIB_EXT)
157 #_____________________________________________________________________________
158 @@ -201,9 +202,8 @@
160 # Search path for libraries
162 -vpath %.so $(LIB)
163 -vpath %.a $(LIB)
164 vpath %.dll $(LIB)
165 +vpath %.lib $(LIB)
167 #_____________________________________________________________________________
169 @@ -217,9 +217,9 @@
172 #LibraryFileName=libfbclient
173 -LibraryFileName=libfbclient
174 -LibraryFullName=$(LibraryFileName).${SHRLIB_EXT}.${FirebirdVersion}
175 -LibrarySoName=$(LibraryFileName).${SHRLIB_EXT}.2
176 +LibraryFileName=ifbclient
177 +LibraryFullName=$(LibraryFileName).${SHRLIB_EXT}
178 +LibrarySoName=$(LibraryFileName).${SHRLIB_EXT}
179 LibraryBaseName=$(LibraryFileName).${SHRLIB_EXT}
181 LIBFIREBIRD_FULLNAME = $(LIB)/$(LibraryFullName)
182 @@ -228,7 +228,7 @@
184 # The firebird engine library name
186 -EngineFileName=libEngine${OdsVersion}
187 +EngineFileName=Engine12
188 EngineSoName=$(EngineFileName).${SHRLIB_EXT}
189 ENGINE_SONAME = $(PLUGINS)/$(EngineSoName)
191 @@ -242,7 +242,7 @@
192 ifeq ($(STD_EDITLINE), true)
193 LIBEDITLINE := -l$(READLINE)
194 else
195 - LIBEDITLINE := $(LIB)/libedit.a
196 + LIBEDITLINE := $(LIB)/$(LIB_PREFIX)edit$(ARCH_EXT)
197 endif
198 endif
200 @@ -313,7 +313,7 @@
202 LIB_LINK_SONAME= -Wl,-soname,$(1)
203 LIB_LINK_MAPFILE= -Wl,--version-script,$(1)
204 -FIREBIRD_LIBRARY_LINK= -L$(LIB) -lfbclient $(MATHLIB)
205 +FIREBIRD_LIBRARY_LINK= -L$(LIB) -lifbclient $(MATHLIB)
207 EXE_LINK_OPTIONS= $(LDFLAGS) $(THR_FLAGS) $(UNDEF_FLAGS) $(LIB_PATH_OPTS) $(LINK_EMPTY_SYMBOLS)
208 LIB_LINK_OPTIONS= $(LDFLAGS) $(THR_FLAGS) -shared
209 @@ -355,7 +355,7 @@
211 # Pay attention - we place common library into obj, not lib dir
212 # It's just a set of object files, prepared to be used by ld, not an output library
213 -COMMON_LIB = $(OBJ)/common.a
214 +COMMON_LIB = $(OBJ)/$(LIB_PREFIX)common$(ARCH_EXT)
216 # From utilities
217 CREATE_DB = $(RBIN)/create_db$(EXEC_EXT)
218 --- builds/posix/Makefile.in 2016-07-07 15:56:06.459221300 +0200
219 +++ builds/posix/Makefile.in 2016-07-13 12:44:57.134217200 +0200
220 @@ -33,7 +33,7 @@
221 # Alex Peshkoff - created single makefile based on Mark's files
224 -ROOT=$(shell cd ..; pwd)
225 +ROOT=$(shell cygpath -m '$(shell cd ..; pwd)')
227 include make.defaults
228 ifeq ($(CROSS_OUT), Y)
229 @@ -178,7 +178,7 @@
230 .PHONY: cross1 cross2 boot yvalve engine fbintl gpre utilities plugins rest codes ids examples cross_rest preliminaryCheck
232 master_process:
233 - ln -sf $(SRC_ROOT)/include/gen/autoconfig.auto $(SRC_ROOT)/include/gen/autoconfig.h
234 + cp -f $(SRC_ROOT)/include/gen/autoconfig.auto $(SRC_ROOT)/include/gen/autoconfig.h
235 $(MAKE) updateBuildNum
236 $(MAKE) export_lists
237 $(MAKE) extern
238 @@ -214,7 +215,7 @@
239 $(MAKE) CROSS_OUT=Y cross2
241 cross1:
242 - ln -sf $(SRC_ROOT)/include/gen/autoconfig.auto $(SRC_ROOT)/include/gen/autoconfig.h
243 + cp -f $(SRC_ROOT)/include/gen/autoconfig.auto $(SRC_ROOT)/include/gen/autoconfig.h
244 $(MAKE) updateBuildNum
245 $(MAKE) export_lists
246 $(MAKE) extern
247 @@ -239,7 +240,7 @@
248 $(MAKE) -f Makefile.examples -C $(GEN_ROOT)/examples/
250 cross2:
251 - ln -sf $(SRC_ROOT)/include/cross/$(CROSS_CONFIG) $(SRC_ROOT)/include/gen/autoconfig.h
252 + cp -f $(SRC_ROOT)/include/cross/$(CROSS_CONFIG) $(SRC_ROOT)/include/gen/autoconfig.h
253 $(MAKE) prerequisites
254 $(MAKE) tommath
255 $(MAKE) yvalve
256 @@ -310,7 +311,7 @@
258 # remote redirector is statically linked in main FB library
259 $(LIBFIREBIRD_FULLNAME): $(YValve_Objects) $(Remote_Client_Objects) $(COMMON_LIB)
260 - $(LINK_FIREBIRD) -o $@ $^ $(LINK_FIREBIRD_LIBS) $(call LIB_LINK_DARWIN_INSTALL_NAME,lib/libfbclient.$(SHRLIB_EXT))
261 + $(LINK_FIREBIRD) $(CPPFLAGS) -o $@ $^ $(LINK_FIREBIRD_LIBS) $(call LIB_LINK_DARWIN_INSTALL_NAME,lib/libfbclient.$(SHRLIB_EXT))
264 #___________________________________________________________________________
265 @@ -320,8 +321,8 @@
267 engine: $(ENGINE_SONAME)
269 -$(ENGINE_SONAME): $(Engine_Objects) $(SVC_Objects) $(COMMON_LIB)
270 - $(LINK_ENGINE) -o $@ $^ $(LINK_ENGINE_LIBS) $(call LIB_LINK_DARWIN_INSTALL_NAME,plugins/$(EngineSoName))
271 +$(ENGINE_SONAME): $(Engine_Objects) $(SVC_Objects) $(YValve_Objects) $(Remote_Client_Objects) $(COMMON_LIB)
272 + $(LINK_ENGINE) $(CPPFLAGS) -o $@ $^ $(LINK_ENGINE_LIBS) $(call LIB_LINK_DARWIN_INSTALL_NAME,plugins/$(EngineSoName))
275 #___________________________________________________________________________
276 @@ -330,8 +331,8 @@
278 fbintl: $(LIBFBINTL_SO)
280 -$(LIBFBINTL_SO): $(INTL_Objects) $(COMMON_LIB)
281 - $(LINK_INTL) -o $@ $^ $(LINK_INTL_LIBS) $(call LIB_LINK_DARWIN_INSTALL_NAME,intl/libfbintl.$(SHRLIB_EXT))
282 +$(LIBFBINTL_SO): $(INTL_Objects) $(YValve_Objects) $(Remote_Client_Objects) $(COMMON_LIB)
283 + $(LINK_INTL) $(CPPFLAGS) -o $@ $^ $(LINK_INTL_LIBS) $(call LIB_LINK_DARWIN_INSTALL_NAME,intl/libfbintl.$(SHRLIB_EXT))
286 #___________________________________________________________________________
287 @@ -427,12 +429,13 @@
289 .PHONY: firebird_server fb_lock_print fbguard fbsvcmgr fbtracemgr gbak gfix gsec gsplit gstat isql nbackup
291 -utilities: firebird_server fb_lock_print fbguard fbsvcmgr fbtracemgr gbak gfix gsec gsplit gstat isql nbackup udfsupport
292 +# fbguard currently fails to link, with missing fork etc, in util.cpp
293 +utilities: firebird_server fb_lock_print fbsvcmgr fbtracemgr gbak gfix gsec gsplit gstat isql nbackup udfsupport
295 firebird_server: $(FB_DAEMON)
297 -$(FB_DAEMON): $(Remote_Server_Objects) $(COMMON_LIB)
298 - $(EXE_LINK) $(EXE_LINK_OPTIONS) $^ -o $@ $(FIREBIRD_LIBRARY_LINK) $(LINK_LIBS) $(call LINK_DARWIN_RPATH,..)
299 +$(FB_DAEMON): $(Remote_Server_Objects) $(Remote_Client_Objects) $(COMMON_LIB)
300 + $(EXE_LINK) $(EXE_LINK_OPTIONS) $^ -o $@ $(FIREBIRD_LIBRARY_LINK) $(LINK_LIBS) $(LIB_GUI) $(call LINK_DARWIN_RPATH,..)
302 fb_lock_print: $(LOCKPRINT)
304 @@ -633,7 +635,7 @@
305 IBASE_ExtraFiles = include/types_pub.h include/consts_pub.h dsql/sqlda_pub.h common/dsc_pub.h jrd/ibase.h jrd/inf_pub.h jrd/blr.h include/gen/iberror.h
306 SRC_IBASE_ExtraFiles = $(addprefix $(SRC_ROOT)/, $(IBASE_ExtraFiles))
307 MAKE_HEADER_Src = $(addprefix $(SRC_ROOT)/, misc/makeHeader.cpp)
308 -MAKE_HEADER_Bin = ./makeHeader
309 +MAKE_HEADER_Bin = ./makeHeader$(EXEC_EXT)
311 $(INCLUDE_DEST)/ibase.h: $(SRC_IBASE_ExtraFiles)
312 $(STATICEXE_LINK) -o $(MAKE_HEADER_Bin) $(MAKE_HEADER_Src)
313 diff -ur builds/posix/make.rules builds/posix/make.rules
314 --- builds/posix/make.rules 2016-07-07 13:56:13.036235166 +0200
315 +++ builds/posix/make.rules 2016-07-07 14:31:16.116291485 +0200
316 @@ -92,26 +92,23 @@
318 $(OBJ)/%.o: $(SRC_ROOT)/%.c
319 $(CC) $(WCFLAGS) -c $(firstword $<) -o $@
320 - @sed $(INLINE_EDIT_SED) -e "1,2s/:/: \$$(wildcard/" -e "\$$s/\(.*\)/\\1)/" $(patsubst %.o,%.d,$@)
322 $(OBJ)/%.o: $(OBJ)/%.cpp
323 $(CXX) $(WCXXFLAGS) -c $(firstword $<) -o $@
324 - @sed $(INLINE_EDIT_SED) -e "1,2s/:/: \$$(wildcard/" -e "\$$s/\(.*\)/\\1)/" $(patsubst %.o,%.d,$@)
326 $(OBJ)/%.o: $(SRC_ROOT)/%.cpp
327 $(CXX) $(WCXXFLAGS) -c $(firstword $<) -o $@
328 - @sed $(INLINE_EDIT_SED) -e "1,2s/:/: \$$(wildcard/" -e "\$$s/\(.*\)/\\1)/" $(patsubst %.o,%.d,$@)
330 $(OBJ)/%.o: $(ROOT)/%.cpp
331 $(CC) $(WCFLAGS) -c $(firstword $<) -o $@
332 - @sed $(INLINE_EDIT_SED) -e "1,2s/:/: \$$(wildcard/" -e "\$$s/\(.*\)/\\1)/" $(patsubst %.o,%.d,$@)
334 .SUFFIXES: .epp .e
336 # Rules for making resource files
338 $(GEN_ROOT)/%.res: $(SRC_ROOT)/%.rc
339 - windres --output-format=coff --include-dir=$(<D) $< $@
340 + mkdir -p $(@D)
341 + rc.exe $(SOLARINC) /fo $@ $<
343 # Rule for making gbak files when cross-compiling
345 --- src/common/utils.cpp 2016-07-15 11:31:26.746871100 +0200
346 +++ src/common/utils.cpp 2016-07-19 19:14:45.370689300 +0200
347 @@ -880,15 +880,15 @@
348 FILETIME utime, stime, dummy;
349 if (GetProcessTimes(GetCurrentProcess(), &dummy, &dummy, &stime, &utime))
351 - LARGE_INTEGER lint;
352 + LARGE_INTEGER myLargeInt;
354 - lint.HighPart = stime.dwHighDateTime;
355 - lint.LowPart = stime.dwLowDateTime;
356 - sysTime = lint.QuadPart / 10000;
358 - lint.HighPart = utime.dwHighDateTime;
359 - lint.LowPart = utime.dwLowDateTime;
360 - userTime = lint.QuadPart / 10000;
361 + myLargeInt.HighPart = stime.dwHighDateTime;
362 + myLargeInt.LowPart = stime.dwLowDateTime;
363 + sysTime = myLargeInt.QuadPart / 10000;
365 + myLargeInt.HighPart = utime.dwHighDateTime;
366 + myLargeInt.LowPart = utime.dwLowDateTime;
367 + userTime = myLargeInt.QuadPart / 10000;
369 else
371 diff -ur builds/posix/prefix.mingw builds/posix/prefix.mingw
372 --- builds/posix/prefix.mingw 2016-07-07 13:56:13.048235166 +0200
373 +++ builds/posix/prefix.mingw 2016-07-07 14:50:54.704323046 +0200
374 @@ -20,8 +20,8 @@
377 # -Wno-unused-variable is used due to unused gpre generated variables
378 -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 -Wno-non-virtual-dtor
379 -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 -Wno-non-virtual-dtor
380 +PROD_FLAGS=-O2 -DMINGW -Dlint -DWIN32_LEAN_AND_MEAN
381 +DEV_FLAGS=-ggdb -DMINGW -Dlint -DWIN32_LEAN_AND_MEAN
383 PLATFORM_PATH=os/win32
385 @@ -29,6 +29,7 @@
386 LIB_LINK=$(LD)
388 LIB_LINK_OPTIONS+=-Wl,--enable-stdcall-fixup
389 +LIB_PLATFORM_RPATH=
391 # Strip symbols from release versions to decrease size
392 ifeq ($(IsProdTypeBuild),Y)
393 @@ -36,6 +37,9 @@
394 LIB_LINK_OPTIONS+=-Wl,-s
395 endif
397 +LIB_LINK_OPTIONS=
398 +LINK_OPTS=
400 # Generation of fbclient_ms.lib
401 LIB_LINK_IMPLIB:=-Wl,--out-implib,firebird/lib/fbclient_ms.lib
402 LIB_GUI:= -mwindows -lcomctl32 -lgdi32
403 @@ -55,7 +59,9 @@
404 ClientLibrarySoName := $(ClientLibraryName)
406 # Looks like MinGW 3 does not support version scripts but support def-files
407 -LINK_FIREBIRD_SYMBOLS = $(BLD_ROOT)/win32/defs/fbclient_s.def $(BLD_ROOT)/win32/defs/fbclient.def
408 +LINK_FIREBIRD_SYMBOLS = /def:$(BLD_ROOT)/win32/defs/fbclient_s.def /def:$(BLD_ROOT)/win32/defs/firebird.def
409 +LINK_PLUGIN_SYMBOLS = /def:$(BLD_ROOT)/win32/defs/plugin.def
410 +LINK_IBUTIL_SYMBOLS = /def:$(BLD_ROOT)/win32/defs/ib_util.def
412 # This is required for newly built executable to find newly built shared
413 # libraries because on Win32 there is no such thing as LD_LIBRARY_PATH
414 --- builds/posix/make.shared.variables 2016-07-22 17:07:46.650672300 +0200
415 +++ builds/posix/make.shared.variables 2016-07-23 10:44:41.311454600 +0200
416 @@ -62,6 +62,7 @@
417 $(SecDbCache)
418 Remote_Client:= $(call dirObjects,remote/client) $(call dirObjects,auth/SecureRemotePassword/client) \
419 $(call makeObjects,auth/SecurityDatabase,LegacyClient.cpp) \
420 + $(call dirObjects,auth/trusted) \
421 $(call dirObjects,plugins/crypt/arc4)
422 Remote_Server_Objects:= $(Remote_Common) $(Remote_Server)
423 Remote_Client_Objects:= $(Remote_Common) $(Remote_Client)
424 diff -ur configure configure
425 --- configure 2016-07-07 13:55:54.976234682 +0200
426 +++ configure 2016-07-07 14:54:30.012328812 +0200
427 @@ -3337,6 +3337,14 @@
428 SHRLIB_EXT=dll
431 + *-*-cygwin*)
432 + MAKEFILE_PREFIX=mingw
433 + PLATFORM=win32
434 + EDITLINE_FLG=N
435 + RAW_DEVICES_FLG=N
436 + SHRLIB_EXT=dll
437 + ;;
440 as_fn_error $? "unsupported platform ${build}" "$LINENO" 5
442 @@ -8432,6 +8432,9 @@
443 mingw*)
444 opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
446 +cygwin*)
447 + opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
448 + ;;
449 esac
451 # Try without a prefix underscore, then with it.
452 diff -ur extern/btyacc/main.c extern/btyacc/main.c
453 --- extern/btyacc/main.c 2016-07-07 13:55:55.448234695 +0200
454 +++ extern/btyacc/main.c 2016-07-07 14:56:03.560331317 +0200
455 @@ -2,7 +2,7 @@
456 #include <signal.h>
457 #include <stdio.h>
459 -#if defined(WIN32)
460 +#if defined(WIN32) || defined(_WIN32)
461 #include <io.h>
462 #else
463 #include <unistd.h>
464 diff -ur extern/btyacc/Makefile extern/btyacc/Makefile
465 --- extern/btyacc/Makefile 2016-07-07 13:55:55.448234695 +0200
466 +++ extern/btyacc/Makefile 2016-07-07 14:57:42.284333961 +0200
467 @@ -30,7 +30,7 @@
469 PRINT = pr -f -l88
471 -PROGRAM = btyacc
472 +PROGRAM = btyacc.exe
474 SRCS = closure.c error.c lalr.c lr0.c main.c mkpar.c output.c \
475 mstring.c reader.c readskel.c skeleton.c symtab.c verbose.c warshall.c
476 @@ -58,7 +58,7 @@
477 index:; ctags -wx $(HDRS) $(SRCS)
479 install: $(PROGRAM)
480 - cp $(PROGRAM).exe /bin
481 + cp $(PROGRAM) /bin
483 oldinstall: $(PROGRAM)
484 @echo Installing $(PROGRAM) in $(DEST)
485 --- extern/cloop/src/tests/test1/CppTest.cpp 2016-07-07 15:56:27.948015300 +0200
486 +++ extern/cloop/src/tests/test1/CppTest.cpp 2016-07-13 18:58:48.529822600 +0200
487 @@ -24,6 +24,7 @@
488 #include <stdio.h>
489 #include <assert.h>
491 +#define WIN32
492 #ifdef WIN32
493 #include <windows.h>
494 #define DLL_EXPORT __declspec(dllexport)
495 --- extern/cloop/src/tests/test1/CTest.c 2016-07-07 15:56:27.611791300 +0200
496 +++ extern/cloop/src/tests/test1/CTest.c 2016-07-13 17:04:22.805090300 +0200
497 @@ -23,6 +23,7 @@
498 #include <stdlib.h>
499 #include <stdio.h>
501 +#define WIN32
502 #ifdef WIN32
503 #include <windows.h>
504 #define DLL_EXPORT __declspec(dllexport)
505 --- extern/cloop/Makefile 2016-07-07 15:56:28.279136300 +0200
506 +++ extern/cloop/Makefile 2016-07-13 16:22:38.493479800 +0200
507 @@ -11,8 +11,8 @@
508 SRC_DIR := src
509 BUILD_DIR := build
510 OUT_DIR := output
511 -SHRLIB_EXT := .so
512 -EXE_EXT :=
513 +SHRLIB_EXT := .dll
514 +EXE_EXT := .exe
516 OBJ_DIR := $(BUILD_DIR)/$(TARGET)
517 BIN_DIR := $(OUT_DIR)/$(TARGET)/bin
518 @@ -27,7 +27,7 @@
519 OBJS_C := $(patsubst $(SRC_DIR)/%.c,$(OBJ_DIR)/%.o,$(SRCS_C))
520 OBJS_CPP := $(patsubst $(SRC_DIR)/%.cpp,$(OBJ_DIR)/%.o,$(SRCS_CPP))
522 -C_FLAGS := -ggdb -fPIC -MMD -MP -W -Wall -Wno-unused-parameter
523 +C_FLAGS := -fPIC
524 CXX_FLAGS := $(C_FLAGS)
525 FPC_FLAGS := -Mdelphi
527 @@ -53,7 +53,7 @@
528 .PHONY: all mkdirs clean
530 all: mkdirs \
531 - $(BIN_DIR)/cloop \
532 + $(BIN_DIR)/cloop$(EXE_EXT) \
533 $(BIN_DIR)/test1-c$(SHRLIB_EXT) \
534 $(BIN_DIR)/test1-c$(EXE_EXT) \
535 $(BIN_DIR)/test1-cpp$(SHRLIB_EXT) \
536 @@ -63,6 +63,10 @@
538 mkdirs: $(OBJ_DIRS) $(BIN_DIR) $(LIB_DIR)
540 +# These files have the same basename, so various conflicting intermediate files break the build
541 +$(BIN_DIR)/test1-c$(EXE_EXT): | $(BIN_DIR)/test1-c$(SHRLIB_EXT)
542 +$(BIN_DIR)/test1-cpp$(EXE_EXT): | $(BIN_DIR)/test1-cpp$(SHRLIB_EXT)
544 $(OBJ_DIRS) $(BIN_DIR) $(LIB_DIR):
545 @mkdir -p $@
547 @@ -74,7 +74,7 @@
548 -include $(addsuffix .d,$(basename $(OBJS_C)))
549 -include $(addsuffix .d,$(basename $(OBJS_CPP)))
551 -$(BIN_DIR)/cloop: \
552 +$(BIN_DIR)/cloop$(EXE_EXT): \
553 $(OBJ_DIR)/cloop/Expr.o \
554 $(OBJ_DIR)/cloop/Generator.o \
555 $(OBJ_DIR)/cloop/Lexer.o \
556 @@ -83,20 +83,20 @@
558 $(LD) $^ -o $@
560 -$(SRC_DIR)/tests/test1/CalcCApi.h: $(BIN_DIR)/cloop $(SRC_DIR)/tests/test1/Interface.idl
561 - $(BIN_DIR)/cloop $(SRC_DIR)/tests/test1/Interface.idl c-header $@ CALC_C_API_H CALC_I
562 +$(SRC_DIR)/tests/test1/CalcCApi.h: $(BIN_DIR)/cloop$(EXE_EXT) $(SRC_DIR)/tests/test1/Interface.idl
563 + $(BIN_DIR)/cloop$(EXE_EXT) $(SRC_DIR)/tests/test1/Interface.idl c-header $@ CALC_C_API_H CALC_I
565 -$(SRC_DIR)/tests/test1/CalcCApi.c: $(BIN_DIR)/cloop $(SRC_DIR)/tests/test1/Interface.idl $(SRC_DIR)/tests/test1/CalcCApi.h
566 - $(BIN_DIR)/cloop $(SRC_DIR)/tests/test1/Interface.idl c-impl $@ CalcCApi.h CALC_I
567 +$(SRC_DIR)/tests/test1/CalcCApi.c: $(BIN_DIR)/cloop$(EXE_EXT) $(SRC_DIR)/tests/test1/Interface.idl $(SRC_DIR)/tests/test1/CalcCApi.h
568 + $(BIN_DIR)/cloop$(EXE_EXT) $(SRC_DIR)/tests/test1/Interface.idl c-impl $@ CalcCApi.h CALC_I
570 -$(SRC_DIR)/tests/test1/CalcCppApi.h: $(BIN_DIR)/cloop $(SRC_DIR)/tests/test1/Interface.idl
571 - $(BIN_DIR)/cloop $(SRC_DIR)/tests/test1/Interface.idl c++ $@ CALC_CPP_API_H calc I
572 +$(SRC_DIR)/tests/test1/CalcCppApi.h: $(BIN_DIR)/cloop$(EXE_EXT) $(SRC_DIR)/tests/test1/Interface.idl
573 + $(BIN_DIR)/cloop$(EXE_EXT) $(SRC_DIR)/tests/test1/Interface.idl c++ $@ CALC_CPP_API_H calc I
575 -$(SRC_DIR)/tests/test1/CalcPascalApi.pas: $(BIN_DIR)/cloop \
576 +$(SRC_DIR)/tests/test1/CalcPascalApi.pas: $(BIN_DIR)/cloop$(EXE_EXT) \
577 $(SRC_DIR)/tests/test1/Interface.idl \
578 $(SRC_DIR)/tests/test1/CalcPascalApi.interface.pas \
579 $(SRC_DIR)/tests/test1/CalcPascalApi.implementation.pas
580 - $(BIN_DIR)/cloop $(SRC_DIR)/tests/test1/Interface.idl pascal $@ CalcPascalApi \
581 + $(BIN_DIR)/cloop$(EXE_EXT) $(SRC_DIR)/tests/test1/Interface.idl pascal $@ CalcPascalApi \
582 --uses "SysUtils" \
583 --interfaceFile $(SRC_DIR)/tests/test1/CalcPascalApi.interface.pas \
584 --implementationFile $(SRC_DIR)/tests/test1/CalcPascalApi.implementation.pas \
585 @@ -108,23 +108,23 @@
586 $(OBJ_DIR)/tests/test1/CalcCApi.o \
587 $(OBJ_DIR)/tests/test1/CTest.o \
589 - $(LD) $^ -shared -ldl -o $@
590 + $(LD) $^ -o $@
592 $(BIN_DIR)/test1-c$(EXE_EXT): \
593 $(OBJ_DIR)/tests/test1/CalcCApi.o \
594 $(OBJ_DIR)/tests/test1/CTest.o \
596 - $(LD) $^ -ldl -o $@
597 + $(LD) $^ -o $@
599 $(BIN_DIR)/test1-cpp$(SHRLIB_EXT): \
600 $(OBJ_DIR)/tests/test1/CppTest.o \
602 - $(LD) $^ -shared -ldl -o $@
603 + $(LD) $^ -o $@
605 $(BIN_DIR)/test1-cpp$(EXE_EXT): \
606 $(OBJ_DIR)/tests/test1/CppTest.o \
608 - $(LD) $^ -ldl -o $@
609 + $(LD) $^ -o $@
611 $(BIN_DIR)/test1-pascal$(SHRLIB_EXT): \
612 $(SRC_DIR)/tests/test1/PascalClasses.pas \
613 diff -ur src/common/classes/fb_string.cpp src/common/classes/fb_string.cpp
614 --- src/common/classes/fb_string.cpp 2016-07-07 13:55:56.064234711 +0200
615 +++ src/common/classes/fb_string.cpp 2016-07-07 14:59:01.516336083 +0200
616 @@ -32,6 +32,12 @@
617 #include <ctype.h>
618 #include <stdarg.h>
620 +#ifdef WIN_NT
621 +#pragma comment(lib, "User32.lib")
622 +#pragma comment(lib, "advapi32")
623 +#pragma comment(lib, "shell32.lib")
624 +#endif
626 #ifdef HAVE_STRCASECMP
627 #define STRNCASECMP strncasecmp
628 #else
629 diff -ur src/misc/makeHeader.cpp src/misc/makeHeader.cpp
630 --- src/misc/makeHeader.cpp 2016-07-07 13:56:00.100234819 +0200
631 +++ src/misc/makeHeader.cpp 2016-07-07 15:00:14.780338045 +0200
632 @@ -1,9 +1,9 @@
633 #include <stdio.h>
634 #include <string.h>
635 #include <errno.h>
636 -//#ifdef HAVE_UNISTD_H
637 +#ifdef HAVE_UNISTD_H
638 #include <unistd.h>
639 -//#endif
640 +#endif
644 --- builds/posix/Makefile.in.plugins_examples.orig 2020-11-13 18:07:52.515550600 +0100
645 +++ builds/posix/Makefile.in.plugins_examples 2020-11-13 18:08:33.218626500 +0100
646 @@ -28,7 +28,7 @@
647 # Adriano dos Santos Fernandes
650 -ROOT=$(shell cd ..; pwd)
651 +ROOT=$(shell cygpath -m '$(shell cd ..; pwd)')
653 ifeq ($(IsDeveloper), Y)
654 DefaultTarget := Debug
655 --- examples/dbcrypt/CryptApplication.cpp.orig 2020-11-13 20:57:11.222938900 +0100
656 +++ examples/dbcrypt/CryptApplication.cpp 2020-11-13 21:01:19.332316100 +0100
657 @@ -27,6 +27,13 @@
658 #include "../interfaces/ifaceExamples.h"
659 #include <firebird/Message.h>
661 +#include "gen/autoconfig.h"
663 +#ifdef WIN_NT
664 +#include <windows.h>
665 +#include <winbase.h>
666 +#endif
668 using namespace Firebird;
670 class CryptKey : public ICryptKeyCallbackImpl<CryptKey, CheckStatusWrapper>
671 @@ -238,8 +238,15 @@
672 av++;
675 +#ifdef WIN_NT
676 + if (!getenv("ISC_USER"))
677 + SetEnvironmentVariable("ISC_USER", "sysdba");
678 + if (!getenv("ISC_PASSWORD"))
679 + SetEnvironmentVariable("ISC_PASSWORD", "masterkey");
680 +#else
681 setenv("ISC_USER", "sysdba", 0);
682 setenv("ISC_PASSWORD", "masterkey", 0);
683 +#endif
685 App app;