Version 4.3.0.0.beta1, tag libreoffice-4.3.0.0.beta1
[LibreOffice.git] / external / firebird / firebird-cygwin-msvc.patch.1
blob5e2368b89bcf4b3cca75d26f282320dc5cc10cb9
1 diff -u firebird/builds/posix/make.defaults firebird/builds/posix/make.defaults
2 --- firebird/builds/posix/make.defaults 2013-07-03 16:23:44.804062000 +0100
3 +++ firebird/builds/posix/make.defaults 2013-07-05 12:30:01.607151400 +0100
4 @@ -49,7 +49,11 @@
5  
6  FIREBIRD=$(GEN_ROOT)/firebird
7  INTERBASE=$(FIREBIRD)
8 +ifeq (@PLATFORM@,win32)
9 +FIREBIRD_LOCK=$(shell cygpath -w $(shell cd $(FIREBIRD); pwd) )
10 +else
11  FIREBIRD_LOCK=$(shell cd $(FIREBIRD); pwd)
12 +endif
14  export INTERBASE
15  export FIREBIRD
16 @@ -135,7 +139,11 @@
17  CD=                    cd
18  CAT=                   cat
19  AR=                    ar @AR_OPTIONS@ crsu
20 +ifeq (@PLATFORM@,win32)
21 +LN=                    cp
22 +else
23  LN=                    @LN_S@
24 +endif
25  RANLIB=                        @RANLIB@
26  BTYACC=$(ROOT)/extern/btyacc/btyacc
28 @@ -152,16 +160,32 @@
29  STATICEXE_LINK:= @CXX@ $(GLOB_OPTIONS) $(CXXFLAGS)
31  LINK_LIBS = @LIBS@
32 +ifeq ($(PLATFORM),win32)
33 +ifeq ($(MSVC_USE_DEBUG_RUNTIME),TRUE)
34 +ICU_LIBS = -licuucd -licudtd -licuind
35 +else
36 +ICU_LIBS = -licuuc -licudt -licuin
37 +endif
38 +else
39  ICU_LIBS = -licuuc -licudata -licui18n
40 +endif
41  STATICLINK_LIBS = @LIBS@
42  SO_LINK_LIBS = @LIBS@
44  # Default extensions
46 +ifeq (@PLATFORM@,win32)
47 +ARCH_EXT=              .lib
48 +else
49  ARCH_EXT=              .a
50 +endif
51  EXEC_EXT=              @EXEEXT@
52  SHRLIB_EXT=@SHRLIB_EXT@
53 +ifeq (@PLATFORM@,win32)
54 +LIB_PREFIX=            
55 +else
56  LIB_PREFIX=            lib
57 +endif
58  SHRLIB_FOREIGN_EXT=    $(SHRLIB_EXT)
60  #_____________________________________________________________________________
61 @@ -179,6 +199,7 @@
62  vpath %.so $(LIB)
63  vpath %.a $(LIB)
64  vpath %.dll $(LIB)
65 +vpath %.lib $(LIB)
67  #_____________________________________________________________________________
69 @@ -193,9 +214,9 @@
70  #     Scold me, but I don't want library names to be in configure.in
71  # 
73 -SharedLibraryName=libfbembed.${SHRLIB_EXT}.${FirebirdVersion}
74 -SharedLibrarySoName=libfbembed.${SHRLIB_EXT}.${MajorVer}.${MinorVer}
75 -SharedLibraryBaseName=libfbembed.${SHRLIB_EXT}
76 +SharedLibraryName=ifbembed.${SHRLIB_EXT}
77 +SharedLibrarySoName=ifbembed.${SHRLIB_EXT}
78 +SharedLibraryBaseName=ifbembed.${SHRLIB_EXT}
80  LIBFBEMBED_SO = $(LIB)/$(SharedLibraryName)
81  LIBFBEMBED_SOBASENAME = $(LIB)/$(SharedLibrarySoName)
82 @@ -219,7 +240,11 @@
84  LIBFBINTL_SO = $(FIREBIRD)/intl/$(LIB_PREFIX)fbintl.$(SHRLIB_EXT)
86 +ifeq ($(PLATFORM),win32)
87 +LIBFBSTATIC_A = $(LIB)/fbstatic.lib
88 +else
89  LIBFBSTATIC_A = $(LIB)/libfbstatic.a
90 +endif
92  ifeq ($(EDITLINE_FLG),Y)
93    ifeq ($(STD_EDITLINE), true)
94 unchanged:
95 --- firebird.org/builds/posix/make.shared.variables     2013-06-26 10:05:19.351343000 +0100
96 +++ firebird/builds/posix/make.shared.variables 2013-07-04 08:12:24.432879700 +0100
97 @@ -291,7 +291,8 @@
98  OS_SPECIFIC_Sources += $(ROOT)/extern/binreloc/binreloc.c
99  endif
100  OS_SPECIFIC_Objects = $(addprefix $(OBJ)/, $(addsuffix .o, $(basename $(OS_SPECIFIC_Sources))))
102 +#FBCOMMON_ClientFiles+=$(OS_SPECIFIC_Files)
103 +#FBCOMMON_Objects+=$(OS_SPECIFIC_Objects)
105  #________________________________________________________________________
107 unchanged:
108 --- firebird/builds/posix/Makefile.in.examples  2013-07-04 14:22:42.262676600 +0100
109 +++ firebird/builds/posix/Makefile.in.examples  2013-07-05 10:14:02.897675100 +0100
110 @@ -64,10 +64,13 @@
111  EXAMPLES_DEST= $(GEN_ROOT)/examples
112  EXAMPLES_SRC=  $(ROOT)/examples
115 +ifeq ($(PLATFORM),win32)
116 +EMPBLD_Objects=        $(EXAMPLES_DEST)/empbuild.obj
117 +INTLBLD_Objects= $(EXAMPLES_DEST)/intlbld.obj
118 +else
119  EMPBLD_Objects=        $(EXAMPLES_DEST)/empbuild.o
121  INTLBLD_Objects= $(EXAMPLES_DEST)/intlbld.o
122 +endif
124  INPUT_Files   =        empddl.sql empdml.sql indexoff.sql indexon.sql \
125                 job.inp lang.inp proj.inp qtr.inp
126 @@ -168,0 +180,3 @@
128 +$(EXAMPLES_DEST)/%.obj: $(EXAMPLES_DEST)/%.c 
129 +       $(CC) -c $(firstword $<) -Fo$@ $(WCFLAGS)
130 \ No newline at end of file
131 unchanged:
132 --- firebird.org/builds/posix/Makefile.in.extlib        2013-06-26 10:05:19.366787100 +0100
133 +++ firebird/builds/posix/Makefile.in.extlib    2013-07-04 12:31:37.591067100 +0100
134 @@ -76,14 +76,20 @@
135  lib_ib_udf: $(LIBIBUTIL_SO) $(UDF)/ib_udf.$(SHRLIB_EXT)
137  $(UDF)/ib_udf.$(SHRLIB_EXT): $(UDF_Objects)
138 -       $(call LINK_UDF,ib_udf) -o $@ $^ $(LINK_UDF_LIBS)
139 +       @CXX@ $^ -o $@ -LD -L$(LIB) $(GLOB_OPTIONS) $(CXXFLAGS) -lib_util \
140 +       $(LINK_UDF_LIBS) $(LIB_LINK_OPTIONS) $(call LIB_LINK_SONAME,ib_udf.$(SHRLIB_EXT))\
141 +       $(call LIB_LINK_RPATH,lib) \
142 +       /link /dll
144  # ib_util
146  lib_ib_util: $(LIBIBUTIL_SO)
148  $(LIBIBUTIL_SO): $(UTIL_Objects)
149 -       $(LINK_IB_UTIL) -o $@ $^ $(LINK_IB_UTIL_LIBS)
150 +       @CXX@ $^ -o $@ -LD \
151 +       $(call LIB_LINK_RPATH,lib)  $(GLOB_OPTIONS) $(CXXFLAGS) $(LINK_IBUTIL_SYMBOLS) \
152 +       $(LIB_LINK_OPTIONS) $(LINK_IB_UTIL_LIBS) $(call LIB_LINK_SONAME,$(IbUtilLibraryName)) \
153 +       /link /dll
155  include $(ROOT)/gen/make.shared.targets
157 unchanged:
158 --- firebird.org/builds/posix/Makefile.in.firebird      2013-06-26 10:05:19.382231200 +0100
159 +++ firebird/builds/posix/Makefile.in.firebird  2013-07-04 18:36:17.079544900 +0100
160 @@ -145,7 +145,8 @@
162  firebird : firebird_@FIREBIRD_ARCH_TYPE@ $(PLATFORM_POSTBUILD_TARGET)
164 -firebird_classic firebird_embedded: firebird_basic classic_targets fbtrace
165 +firebird_classic firebird_embedded: firebird_basic classic_targets
166 +#fbtrace
167  firebird_super firebird_server: firebird_basic super_targets fbtrace
170 @@ -301,7 +301,7 @@
171  .PHONY: ref_databases msgs msgs_intl generated_headers intl extlib includes
173  basic_targets: ref_databases msgs msgs_intl generated_headers \
174 -               intl extlib includes examples_cp
175 +               intl extlib includes
177  # hack to make code regeneration work
178  generated_headers :
179 @@ -331,8 +336,9 @@
180  .PHONY: libfbembed inet_server fb_smp_server embed_gfix embed_gbak embed_isql 
181  .PHONY: embed_gpre embed_util
183 -classic_targets: $(PLAT_CLASSIC_PRE_TARGET) libfbembed inet_server fb_smp_server embed_gfix embed_gbak embed_isql \
184 -       embed_gpre libfbclient embed_util embed_gdef embed_qli embed_fbudf $(PLAT_CLASSIC_POST_TARGET)
185 +classic_targets: $(PLAT_CLASSIC_PRE_TARGET) libfbembed
186 +#inet_server fb_smp_server embed_gfix embed_gbak embed_isql \
187 +#      embed_gpre libfbclient embed_util embed_gdef embed_qli embed_fbudf $(PLAT_CLASSIC_POST_TARGET)
189  libfbembed:
190         $(MAKE) $(CPU_OPTION) -f $(GEN_ROOT)/Makefile.libfbembed $@
191 @@ -446,7 +452,7 @@
192  MAKE_HEADER_Bin = ./makeHeader
194  $(INCLUDE_DEST)/ibase.h: $(SRC_IBASE_ExtraFiles)
195 -       $(STATICEXE_LINK) -o $(MAKE_HEADER_Bin) $(MAKE_HEADER_Src)
196 +       $(STATICEXE_LINK) -o $(MAKE_HEADER_Bin)$(EXEC_EXT) $(MAKE_HEADER_Src)
197         $(CP) $^ .
198         $(MAKE_HEADER_Bin) <ibase.h >$@
199         $(RM) -f ibase.h
200 --- firebird.org/builds/posix/Makefile.in.intl  2013-06-26 10:05:19.382231200 +0100
201 +++ firebird/builds/posix/Makefile.in.intl      2013-07-04 12:26:09.029586700 +0100
202 @@ -81,8 +81,13 @@
203  libfbintl : $(LIBFBINTL_SO)
205  $(LIBFBINTL_SO):       $(INTL_Objects) $(FBCOMMON_ClientObjects) $(FBCLASSES_ClientObjects)
206 +ifeq (@PLATFORM@,win32)
207 +       @CXX@ $^ -o $@  -LD $(GLOB_OPTIONS) $(CXXFLAGS) $(LINK_INTL_LIBS)\
208 +       $(LINK_FBINTL_SYMBOLS) $(LIB_LINK_OPTIONS) -lfbstatic $(call LIB_LINK_SONAME,libintl.$(SHRLIB_EXT).1)\
209 +       $(call LIB_LINK_RPATH,lib) /link /dll
210 +else
211         $(LINK_INTL) -o $@ $^ $(LINK_INTL_LIBS)
213 +endif
215  include $(ROOT)/gen/make.shared.targets
217 diff -u firebird/builds/posix/Makefile.in.libfbembed firebird/builds/posix/Makefile.in.libfbembed
218 --- firebird/builds/posix/Makefile.in.libfbembed        2013-07-04 17:51:37.197367500 +0100
219 +++ firebird/builds/posix/Makefile.in.libfbembed        2013-07-05 12:55:58.287451400 +0100
220 @@ -62,13 +62,19 @@
221  libfbembed : $(LIBIBUTIL_SO) $(LIBFBEMBED_SONAME)
223  $(LIBFBEMBED_SO): $(LIBFBEMBED_Objects) $(SERVER_Objects) $(COMMON_Objects)
224 +ifeq ($(PLATFORM),win32)
225 +       @CXX@ $^ -o $@ $(LINK_EMBED_LIBS)  $(GLOB_OPTIONS) $(CXXFLAGS)\
226 +       $(LINK_FIREBIRD_EMBED_SYMBOLS) $(LIB_LINK_OPTIONS) $(LIB_EMBED_LINK_OPTIONS)\
227 +       $(call LIB_LINK_SONAME,$(SharedLibrarySoName)) $(call LIB_LINK_RPATH,lib)
228 +else
229         $(LINK_EMBED) -o $@ $^ $(LINK_EMBED_LIBS)
230 +endif
232  $(LIBFBEMBED_SOBASENAME): $(LIBFBEMBED_SO)
233 -       (cd $(LIB) && $(LN) -f $(SharedLibraryName) $(SharedLibrarySoName) )
234 +#      (cd $(LIB) && $(LN) -f $(SharedLibraryName) $(SharedLibrarySoName) )
236  $(LIBFBEMBED_SONAME): $(LIBFBEMBED_SOBASENAME)
237 -       (cd $(LIB) && $(LN) -f $(SharedLibrarySoName) $(SharedLibraryBaseName) )
238 +#      (cd $(LIB) && $(LN) -f $(SharedLibrarySoName) $(SharedLibraryBaseName) )
240  include $(ROOT)/gen/make.shared.targets
242 unchanged:
243 --- firebird.org/builds/posix/Makefile.in.libfbstatic   2013-06-26 10:05:19.382231200 +0100
244 +++ firebird/builds/posix/Makefile.in.libfbstatic       2013-07-03 16:23:14.103208000 +0100
245 @@ -57,9 +57,9 @@
246  # will not be different from the above fbmem_boot.a library
247  # compile time macros being the main (if there) difference
249 -libfbstatic: $(PARSE_Sources) $(LIB)/libfbstatic.a
250 +libfbstatic: $(PARSE_Sources) $(LIB)/$(LIB_PREFIX)fbstatic$(ARCH_EXT)
252 -$(LIB)/libfbstatic.a:  $(LIBFBSTATIC_Objects)
253 +$(LIB)/$(LIB_PREFIX)fbstatic$(ARCH_EXT):       $(LIBFBSTATIC_Objects)
254         -$(RM) $@
255         $(AR) $@ $^
256         -$(RANLIB) $@
257 unchanged:
258 --- firebird.org/builds/posix/prefix.mingw      2013-06-26 10:05:19.413119400 +0100
259 +++ firebird/builds/posix/prefix.mingw  2013-07-04 18:13:52.948234400 +0100
260 @@ -20,8 +20,8 @@
261  # 
263  # -Wno-unused-variable is used due to unused gpre generated variables
264 -PROD_FLAGS=-O2  -march=i586 -DMINGW -mno-cygwin -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
265 -DEV_FLAGS=-ggdb -march=i586 -DMINGW -mno-cygwin -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
266 +PROD_FLAGS=-O2  -march=i586 -DMINGW -mno-cygwin -Wall -fmessage-length=0 -Dlint -DWIN32_LEAN_AND_MEAN -MMD -mthreads
267 +DEV_FLAGS=-ggdb -march=i586 -DMINGW -mno-cygwin -Wall -fmessage-length=0 -Dlint -DWIN32_LEAN_AND_MEAN -MMD -mthreads
269  PLATFORM_PATH=os/win32
271 @@ -33,13 +33,15 @@
272  LIB_LINK=$(LD)
274  LIB_LINK_OPTIONS+=-Wl,--enable-stdcall-fixup
275 +LIB_PLATFORM_RPATH=
277  # Strip symbols from release versions to decrease size
278  ifeq ($(IsProdTypeBuild),Y)
279  LINK_OPTS+=-Wl,-s
280  LIB_LINK_OPTIONS+=-Wl,-s
281  endif
283 +LIB_LINK_OPTIONS=
284 +LINK_OPTS=
285  # Generation of fbclient_ms.lib
286  LIB_LINK_IMPLIB:=-Wl,--out-implib,firebird/lib/fbclient_ms.lib
287  LIB_GUI:= -mwindows -lcomctl32 -lgdi32
288 @@ -65,7 +67,7 @@
289  ClientLibrarySoName := $(ClientLibraryName)
291  # Looks like MinGW 3 does not support version scripts but support def-files
292 -LINK_FIREBIRD_SYMBOLS = $(BLD_ROOT)/win32/defs/fbclient_s.def $(BLD_ROOT)/win32/defs/fbclient.def
293 +LINK_FIREBIRD_SYMBOLS = /def:$(BLD_ROOT)/win32/defs/fbclient_s.def /def:$(BLD_ROOT)/win32/defs/fbclient.def
295  # This is required for newly built executable to find newly built shared
296  # libraries because on Win32 there is no such thing as LD_LIBRARY_PATH
297 unchanged:
298 --- firebird.org/configure      2013-06-26 10:05:19.675669100 +0100
299 +++ firebird/configure  2013-06-26 10:14:11.490867900 +0100
300 @@ -2796,7 +2796,7 @@
301      SHRLIB_EXT=so
302      ;;
304 -  *-*-mingw*)
305 +  *-*-mingw* | *-*-cygwin*)
306      MAKEFILE_PREFIX=mingw
307      PLATFORM=win32
309 @@ -8934,6 +8934,9 @@
310  mingw*)
311    opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp
312    ;;
313 +cygwin*)
314 +  opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp
315 +  ;;
316  esac
318  # If we're using GNU nm, then use its standard symbol codes.
319 @@ -9882,7 +9885,7 @@
320         esac
321         ;;
323 -    mingw* | pw32* | os2*)
324 +    mingw* | cygwin* | pw32* | os2*)
325        # This hack is so that the source file can tell whether it is being
326        # built for inclusion in a dll (and should export symbols for example).
327        lt_prog_compiler_pic='-DDLL_EXPORT'
328 @@ -14675,7 +14678,7 @@
329      beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
330        # PIC is the default for these OSes.
331        ;;
332 -    mingw* | os2* | pw32*)
333 +    mingw* | cygwin* | os2* | pw32*)
334        # This hack is so that the source file can tell whether it is being
335        # built for inclusion in a dll (and should export symbols for example).
336        lt_prog_compiler_pic_CXX='-DDLL_EXPORT'
337 @@ -16452,7 +16455,7 @@
338        # PIC is the default for these OSes.
339        ;;
341 -    mingw* | pw32* | os2*)
342 +    mingw* | cygwin* | pw32* | os2*)
343        # This hack is so that the source file can tell whether it is being
344        # built for inclusion in a dll (and should export symbols for example).
345        lt_prog_compiler_pic_F77='-DDLL_EXPORT'
346 @@ -16522,7 +16525,7 @@
347         esac
348         ;;
350 -    mingw* | pw32* | os2*)
351 +    mingw* | cygwin* | pw32* | os2*)
352        # This hack is so that the source file can tell whether it is being
353        # built for inclusion in a dll (and should export symbols for example).
354        lt_prog_compiler_pic_F77='-DDLL_EXPORT'
355 @@ -19067,7 +19070,7 @@
356        # PIC is the default for these OSes.
357        ;;
359 -    mingw* | pw32* | os2*)
360 +    mingw* | cygwin* | pw32* | os2*)
361        # This hack is so that the source file can tell whether it is being
362        # built for inclusion in a dll (and should export symbols for example).
363        lt_prog_compiler_pic_GCJ='-DDLL_EXPORT'
364 @@ -19137,7 +19140,7 @@
365         esac
366         ;;
368 -    mingw* | pw32* | os2*)
369 +    mingw* | cygwin* | pw32* | os2*)
370        # This hack is so that the source file can tell whether it is being
371        # built for inclusion in a dll (and should export symbols for example).
372        lt_prog_compiler_pic_GCJ='-DDLL_EXPORT'
373 unchanged:
374 --- firebird.org/configure.in   2013-06-26 10:05:19.675669100 +0100
375 +++ firebird/configure.in       2013-06-26 14:16:35.816845700 +0100
376 @@ -1,30 +1,4 @@
377 -dnl ############################# INITIALISATION ###############################
379 -AC_PREREQ(2.56)
380 -AC_INIT(src)
382 -AC_CONFIG_AUX_DIR(builds/make.new/config)
383 -AC_CACHE_VAL(ac_cv_prog_make_set, [AC_PROG_MAKE_SET])
384 -AC_PREFIX_DEFAULT(/usr/local/firebird)
386 -m4_ifdef([AC_CONFIG_MACRO_DIR],
387 -         [],
388 -         [m4_define([AC_CONFIG_MACRO_DIR], [])])
389 -AC_CONFIG_MACRO_DIR(m4)
391 -AC_CONFIG_HEADER(src/include/gen/autoconfig.h:builds/make.new/config/config.h.in)
393 -dnl XE_APPEND(value, varname)
394 -define([XE_APPEND],[[$2]="$[$2] [$1]"])
396 -dnl XE_PREPEND(value, varname)
397 -define([XE_PREPEND],[[$2]="[$1] $[$2]"])
399 -dnl XE_CONF_DIR(param, help, variable, default)
400 -define([XE_CONF_DIR],[
401 -AC_ARG_WITH([$1], 
402 -       [AC_HELP_STRING([--with-$1], [$2])], 
403 -       [[$3]="$withval"
405          AC_DEFINE_UNQUOTED([$3], "$[$3]", [$2])], 
406         [[$3]="[`if test ""x$prefix"" = ""xNONE"" ; then echo ""$ac_default_prefix""; else echo ""$prefix""; fi`][$4]"
407          AC_DEFINE_UNQUOTED([$3], [""], [$2])]
408 @@ -37,8 +11,8 @@
410  dnl ############################# ADD TESTS BELOW ##############################
412 -AC_CANONICAL_SYSTEM
413 -CPU_TYPE=$target_cpu
414 +AC_CANONICAL_HOST
415 +CPU_TYPE=$host_cpu
416  AC_SUBST(CPU_TYPE)
419 @@ -61,7 +35,7 @@
420  dnl Test for special ar options?
421  AR_OPT_CHECK=false
423 -case "$target" in
424 +case "$host" in
425    i*86-*-darwin*)
426  dnl    MAKEFILE_PREFIX=darwin_i386
427      MAKEFILE_PREFIX=darwin_x86_64
428 @@ -112,7 +86,7 @@
430    amd64-*-freebsd* | x86_64*-*-freebsd* | x86_64*-*-k*bsd*-gnu)
431      MAKEFILE_PREFIX=freebsd_amd64
432 -    case "$target" in
433 +    case "$host" in
434          x86_64*-*-k*bsd-gnu)      # Debian/kFreeBSD
435              PLATFORM=GENTOOFREEBSD
436              INSTALL_PREFIX=linux
437 @@ -138,7 +112,7 @@
439    *-*-freebsd* | *-*-k*bsd*-gnu)
440      MAKEFILE_PREFIX=freebsd
441 -    case "$target" in
442 +    case "$host" in
443          *-*-k*bsd-gnu)      # Debian/kFreeBSD
444              PLATFORM=GENTOOFREEBSD
445              INSTALL_PREFIX=linux
446 @@ -394,7 +368,7 @@
447      SHRLIB_EXT=so
448      ;;
450 -  *-*-mingw*)
451 +  *-*-mingw* | *-*-cygwin*)
452      MAKEFILE_PREFIX=mingw
453      PLATFORM=win32
454      AC_DEFINE(WIN_NT, 1, [Define this if OS is Windows NT])
455 @@ -756,7 +730,25 @@
456  AC_CHECK_FUNCS(swab _swab)
457  AC_FUNC_MMAP
458  AC_FUNC_FORK
459 -AC_FUNC_SETPGRP
461 +dnl AC_FUNC_SETPGRP does not work if cross compiling
462 +dnl Instead, assume we will have a prototype for setpgrp if cross compiling.
463 +if test "$cross_compiling" = no; then
464 +  AC_FUNC_SETPGRP
465 +else
466 +  AC_CACHE_CHECK([whether setpgrp takes no argument], ac_cv_func_setpgrp_void,
467 +    [AC_TRY_COMPILE([
468 +#include <unistd.h>
469 +], [
470 +  if (setpgrp(1,1) == -1)
471 +    exit (0);
472 +  else
473 +    exit (1);
474 +], ac_cv_func_setpgrp_void=no, ac_cv_func_setpgrp_void=yes)])
475 +if test $ac_cv_func_setpgrp_void = yes; then
476 +  AC_DEFINE(SETPGRP_VOID, 1)
479  AC_CHECK_FUNCS(setpgid)
480  AC_FUNC_GETPGRP
481  AC_CHECK_FUNCS(flock)
482 @@ -822,7 +814,9 @@
483  [AC_DEFINE(WORKING_SEM_INIT,1,[Define this if sem_init() works on the platform])
484  AC_MSG_RESULT(yes)],
485  [AC_MSG_RESULT(no)
486 -AC_SEARCH_LIBS(sem_open, rt)])
487 +AC_SEARCH_LIBS(sem_open, rt)],
488 +[AC_DEFINE(WORKING_SEM_INIT,1,[Define this if sem_init() works on the platform])
489 +AC_MSG_RESULT(cross-compiling, assuming yes)])
490  fi
491  fi
493 @@ -885,27 +879,13 @@
495  dnl EKU: try to determine the alignment of long and double
496  dnl      replaces FB_ALIGNMENT and FB_DOUBLE_ALIGN in src/jrd/common.h
497 -AC_MSG_CHECKING(alignment of long)
498 -AC_TRY_RUN([main () {
499 -  struct s {
500 -    char a;
501 -    long long b;
502 -  };
503 -  exit((int)&((struct s*)0)->b);
504 -}], ac_cv_c_alignment=$ac_status, ac_cv_c_alignment=$ac_status)
505 -AC_MSG_RESULT($ac_cv_c_alignment)
506 -AC_DEFINE_UNQUOTED(FB_ALIGNMENT, $ac_cv_c_alignment, [Alignment of long])
508 -AC_MSG_CHECKING(alignment of double)
509 -AC_TRY_RUN([main () {
510 -  struct s {
511 -    char a;
512 -    double b;
513 -  };
514 -  exit((int)&((struct s*)0)->b);
515 -}], ac_cv_c_double_align=$ac_status, ac_cv_c_double_align=$ac_status)
516 -AC_MSG_RESULT($ac_cv_c_double_align)
517 -AC_DEFINE_UNQUOTED(FB_DOUBLE_ALIGN, $ac_cv_c_double_align, [Alignment of double])
518 +AC_CHECK_ALIGNOF(long long)
519 +AC_MSG_RESULT($ac_cv_alignof_long_long)
520 +AC_DEFINE_UNQUOTED(FB_ALIGNMENT, $ac_cv_alignof_long_long, [Alignment of long])
522 +AC_CHECK_ALIGNOF(double)
523 +AC_MSG_RESULT($ac_cv_alignof_double)
524 +AC_DEFINE_UNQUOTED(FB_DOUBLE_ALIGN, $ac_cv_alignof_double, [Alignment of double])
526  dnl EKU: don't know how to convert this into an autoconf test:
527  dnl      #define FB_ALIGN(n,b) ...
528 @@ -980,7 +960,7 @@
529  #define FB_PIPE_NAME "interbas"])
530      AC_DEFINE_UNQUOTED(FB_PIPE_NAME,"$FB_PIPE_NAME")
531      AC_SUBST(FB_PIPE_NAME)
532 -    XE_PREPEND( -mno-cygwin -mthreads -lmpr -lversion -lws2_32 -lole32,LIBS)
533 +    XE_PREPEND( -mthreads -lmpr -lversion -lws2_32 -lole32,LIBS)
534      ;;
536    *)
537 unchanged:
538 --- firebird.org/extern/btyacc/main.c   2013-06-26 10:05:19.907330600 +0100
539 +++ firebird/extern/btyacc/main.c       2013-06-26 10:25:20.065917200 +0100
540 @@ -2,7 +2,7 @@
541  #include <signal.h>
542  #include <stdio.h>
544 -#if defined(WIN32)
545 +#if defined(WIN32) || defined(_WIN32)
546  #include <io.h>
547  #else
548  #include <unistd.h>
549 unchanged:
550 --- firebird.org/src/burp/mvol.cpp      2013-06-26 10:05:24.089577700 +0100
551 +++ firebird/src/burp/mvol.cpp  2013-07-03 15:29:42.818271200 +0100
552 @@ -47,7 +47,7 @@
553  #include <fcntl.h>
554  #include <sys/types.h>
556 -#ifdef HAVE_IO_H
557 +#if defined(HAVE_IO_H) || defined(WIN_NT)
558  #include <io.h>  // isatty
559  #endif
561 unchanged:
562 --- firebird.org/src/burp/restore.epp   2013-06-26 10:05:24.089577700 +0100
563 +++ firebird/src/burp/restore.epp       2013-07-03 15:25:34.792722000 +0100
564 @@ -54,6 +54,10 @@
565  #include "../common/classes/SafeArg.h"
566  #include "memory_routines.h"
568 +#ifdef WIN_NT
569 +#define snprintf _snprintf
570 +#endif
572  using MsgFormat::SafeArg;
575 unchanged:
576 --- firebird.org/src/common/classes/BaseStream.cpp      2013-06-26 10:05:24.106566100 +0100
577 +++ firebird/src/common/classes/BaseStream.cpp  2013-06-27 19:12:19.694346700 +0100
578 @@ -28,6 +28,10 @@
579  #include "BaseStream.h"
580  #include <string.h>
582 +#if defined(WIN_NT)
583 +#include <io.h>
584 +#endif
586  #ifdef HAVE_UNISTD_H
587  #include <unistd.h>
588  #endif
589 unchanged:
590 --- firebird.org/src/common/classes/fb_string.cpp       2013-06-26 10:05:24.123554500 +0100
591 +++ firebird/src/common/classes/fb_string.cpp   2013-07-03 18:12:28.168333200 +0100
592 @@ -32,6 +32,10 @@
593  #include <ctype.h>
594  #include <stdarg.h>
596 +#ifdef WIN_NT
597 +#pragma comment(lib, "User32.lib")
598 +#endif
600  #ifdef HAVE_STRCASECMP
601  #define STRNCASECMP strncasecmp
602  #else
603 unchanged:
604 --- firebird.org/src/common/classes/FpeControl.h        2013-06-26 10:05:24.123554500 +0100
605 +++ firebird/src/common/classes/FpeControl.h    2013-06-28 13:19:21.411841900 +0100
606 @@ -204,7 +204,7 @@
607  #ifdef WIN_NT
608  inline bool isinf(double x)
610 -       return (!_finite (x) && !isnan(x));
611 +       return (!_finite (x) && !_isnan(x));
613  #else
614  #ifndef isinf
615 unchanged:
616 --- firebird.org/src/isql/isql.epp      2013-06-26 10:05:24.718148500 +0100
617 +++ firebird/src/isql/isql.epp  2013-07-03 15:39:19.475181200 +0100
618 @@ -98,6 +98,7 @@
619  #include "../jrd/common.h"
620  #if defined(WIN_NT)
621  #include <windows.h>
622 +#define isnan _isnan
623  #endif
624  #include "../jrd/ibase.h"
625  #include "../isql/isql.h"
626 unchanged:
627 --- firebird.org/src/jrd/divorce.cpp    2013-06-26 10:05:24.786102100 +0100
628 +++ firebird/src/jrd/divorce.cpp        2013-06-29 11:37:36.553854700 +0100
629 @@ -54,7 +54,7 @@
630  #include "../jrd/divorce.h"
631  #include "../common/classes/semaphore.h"
633 -#ifdef HAVE_IO_H
634 +#if defined(HAVE_IO_H) || defined(WIN_NT)
635  #include <io.h>
636  #endif
638 unchanged:
639 --- firebird.org/src/jrd/fun.epp        2013-06-26 10:05:24.888032500 +0100
640 +++ firebird/src/jrd/fun.epp    2013-06-29 11:19:52.564078500 +0100
641 @@ -733,7 +733,7 @@
642                                 status_exception::raise(Arg::Gds(isc_expression_eval_err) <<
643                                                                         Arg::Gds(isc_udf_fp_overflow) << Arg::Str(function->fun_name));
644                         }
645 -                       else if (isnan(value->vlu_misc.vlu_double))
646 +                       else if (_isnan(value->vlu_misc.vlu_double))
647                         {
648                                 status_exception::raise(Arg::Gds(isc_expression_eval_err) <<
649                                                                         Arg::Gds(isc_udf_fp_nan) << Arg::Str(function->fun_name));
650 unchanged:
651 --- firebird.org/src/jrd/gds.cpp        2013-06-26 10:05:24.888032500 +0100
652 +++ firebird/src/jrd/gds.cpp    2013-06-29 10:38:05.140333200 +0100
653 @@ -71,6 +71,8 @@
654  #include <stdarg.h>
656  #if defined(WIN_NT)
657 +#pragma comment(lib, "advapi32")
658 +#pragma comment(lib, "Shell32")
659  #include <io.h> // umask, close, lseek, read, open, _sopen
660  #include <process.h>
661  #include <sys/types.h>
662 @@ -121,7 +123,7 @@
664  #ifdef WIN_NT
665  #include <shlobj.h>
666 -#include <shfolder.h>
667 +//#include <shfolder.h>
668  #define _WINSOCKAPI_
669  #include <share.h>
670  #include "err_proto.h"
671 unchanged:
672 --- firebird.org/src/jrd/isc.cpp        2013-06-26 10:05:24.922009300 +0100
673 +++ firebird/src/jrd/isc.cpp    2013-06-29 10:38:56.698423800 +0100
674 @@ -58,7 +58,7 @@
675  /* Win32 specific stuff */
677  #ifdef WIN_NT
679 +#pragma comment(lib, "User32")
680  #include <windows.h>
681  #include <aclapi.h>
682  #include <lmcons.h>
683 unchanged:
684 --- firebird.org/src/jrd/isc_sync.cpp   2013-06-26 10:05:24.938997700 +0100
685 +++ firebird/src/jrd/isc_sync.cpp       2013-06-30 18:45:43.811961300 +0100
686 @@ -127,10 +127,10 @@
687  #include <sys/param.h>
688  #endif
690 -#ifndef HAVE_GETPAGESIZE
691 +#if !defined(HAVE_GETPAGESIZE) && !defined(WIN_NT)
692  static size_t getpagesize()
694 -       return PAGESIZE;
695 +       return _PAGESIZE;
697  #endif
699 @@ -4320,7 +4320,13 @@
700   *
701   **************************************/
702         char hostname[64];
703 -       const int rc = snprintf(buffer, bufsize, object_name, ISC_get_host(hostname, sizeof(hostname)));
704 +       const int rc = 
705 +       #ifdef WIN_NT
706 +               _snprintf(
707 +       #else
708 +               snprintf(
709 +       #endif
710 +               buffer, bufsize, object_name, ISC_get_host(hostname, sizeof(hostname)));
711         if (size_t(rc) == bufsize || rc <= 0)
712         {
713                 SetLastError(ERROR_FILENAME_EXCED_RANGE);
714 unchanged:
715 --- firebird.org/src/jrd/os/win32/mod_loader.cpp        2013-06-26 10:05:25.006951300 +0100
716 +++ firebird/src/jrd/os/win32/mod_loader.cpp    2013-06-27 18:30:42.642374700 +0100
717 @@ -93,6 +93,10 @@
718                      "msvcr80.dll",
719  #elif _MSC_VER == 1500
720                      "msvcr90.dll",
721 +#elif _MSC_VER == 1600
722 +                                       "mscvr100.dll",
723 +#elif _MSC_VER == 1700
724 +                                       "mscvr110.dll",
725  #else
726                      #error Specify CRT DLL name here !
727  #endif
728 unchanged:
729 --- firebird.org/src/jrd/trace/TraceConfigStorage.cpp   2013-06-26 10:05:25.754440900 +0100
730 +++ firebird/src/jrd/trace/TraceConfigStorage.cpp       2013-07-02 12:32:31.799779900 +0100
731 @@ -42,9 +42,10 @@
732  #ifdef HAVE_UNISTD_H
733  #include <unistd.h>
734  #endif
735 -#ifdef HAVE_IO_H
736 +#if defined(HAVE_IO_H) || defined(WIN_NT)
737  #include <io.h>
738  #endif
740  #include <fcntl.h>
741  #include <sys/types.h>
742  #include <sys/stat.h>
743 unchanged:
744 --- firebird.org/src/jrd/trace/TraceLog.cpp     2013-06-26 10:05:25.958301700 +0100
745 +++ firebird/src/jrd/trace/TraceLog.cpp 2013-07-02 12:32:49.747208200 +0100
746 @@ -29,7 +29,7 @@
747  #ifdef HAVE_UNISTD_H
748  #include <unistd.h>
749  #endif
750 -#ifdef HAVE_IO_H
751 +#if defined(HAVE_IO_H) || defined(WIN_NT)
752  #include <io.h>
753  #endif
754  #include <fcntl.h>
755 unchanged:
756 --- firebird.org/src/misc/makeHeader.cpp        2013-06-26 10:05:26.230116100 +0100
757 +++ firebird/src/misc/makeHeader.cpp    2013-07-04 12:43:53.149081800 +0100
758 @@ -1,9 +1,9 @@
759  #include <stdio.h>
760  #include <string.h>
761  #include <errno.h>
762 -//#ifdef HAVE_UNISTD_H
763 +#ifdef HAVE_UNISTD_H
764  #include <unistd.h>
765 -//#endif
766 +#endif
770 unchanged:
771 --- firebird.org/extern/btyacc/Makefile 2013-07-05 07:58:12.591917200 +0100
772 +++ firebird/extern/btyacc/Makefile     2013-07-05 09:31:07.589691500 +0100
773 @@ -42,7 +42,10 @@
774  all:           $(PROGRAM)
776  $(PROGRAM):     $(OBJS) $(LIBS)
777 -               $(CC) $(LDFLAGS) -o $(PROGRAM) $(OBJS) $(LIBS)
778 +               $(CC) -o $(PROGRAM).exe $(OBJS) $(LIBS) $(LDFLAGS)
780 +%.o: %.c
781 +       $(CC)  -c $< -Fo$@ $(CCFLAGS)
783  clean:;                rm -f $(OBJS)
785 unchanged:
786 --- firebird.orig/builds/posix/make.rules       2013-08-04 19:06:02.208552600 +0900
787 +++ firebird/builds/posix/make.rules    2013-08-04 19:13:59.981368500 +0900
788 @@ -116,4 +116,4 @@
789  # Rules for making resource files
791  $(GEN_ROOT)/%.res: $(SRC_ROOT)/%.rc
792 -       windres --output-format=coff --include-dir=$(<D) $< $@
793 +       windres --output-format=coff --include-dir=$(<D) --target=pe-i386 $< $@
794 only in patch2: