diff -ur firebird.org/builds/make.new/config/config.h.in firebird/builds/make.new/config/config.h.in --- firebird.org/builds/make.new/config/config.h.in 2015-07-30 18:57:00.826593100 +0200 +++ firebird/builds/make.new/config/config.h.in 2015-07-30 19:27:52.139226300 +0200 @@ -668,3 +668,37 @@ #ifndef HAVE_SOCKLEN_T typedef int socklen_t; #endif + +/* taken from src/include/gen/autoconfig_msvc.h */ +#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers +/* target architecture */ +#if defined(_M_IX86) +/* sizeof(void *) */ +#define SIZEOF_VOID_P 4 +/* sizeof(size_t) */ +#define SIZEOF_SIZE_T 4 +/* alignment of long */ +#define FB_ALIGNMENT 4 +#elif defined(_M_AMD64) +#define AMD64 +/* sizeof(void *) */ +#define SIZEOF_VOID_P 8 +/* sizeof(size_t) */ +#define SIZEOF_SIZE_T 8 +/* alignment of long */ +#define FB_ALIGNMENT 8 +#else +#error unknown target platform +#endif + +#define HAVE_IO_H + +#define HAVE_GETPAGESIZE + +#if defined _MSC_VER +#if _MSC_VER < 1500 +#define vsnprintf _vsnprintf +#endif +#define isnan _isnan +#endif +#define snprintf _snprintf diff -ur firebird.org/builds/posix/make.defaults firebird/builds/posix/make.defaults --- firebird.org/builds/posix/make.defaults 2015-07-30 18:56:58.936120900 +0200 +++ firebird/builds/posix/make.defaults 2015-07-30 19:29:23.420338600 +0200 @@ -49,7 +49,11 @@ FIREBIRD=$(GEN_ROOT)/firebird INTERBASE=$(FIREBIRD) +ifeq (@PLATFORM@,win32) +FIREBIRD_LOCK=$(shell cygpath -w $(shell cd $(FIREBIRD); pwd) ) +else FIREBIRD_LOCK=$(shell cd $(FIREBIRD); pwd) +endif export INTERBASE export FIREBIRD @@ -135,7 +139,11 @@ CD= cd CAT= cat AR= ar @AR_OPTIONS@ crsu +ifeq (@PLATFORM@,win32) +LN= cp +else LN= @LN_S@ +endif RANLIB= @RANLIB@ BTYACC=$(ROOT)/extern/btyacc/btyacc @@ -152,16 +160,32 @@ STATICEXE_LINK:= @CXX@ $(GLOB_OPTIONS) $(CXXFLAGS) LINK_LIBS = @LIBS@ +ifeq ($(PLATFORM),win32) +ifeq ($(MSVC_USE_DEBUG_RUNTIME),TRUE) +ICU_LIBS = -licuucd -licudtd -licuind +else +ICU_LIBS = -licuuc -licudt -licuin +endif +else ICU_LIBS = -licuuc -licudata -licui18n +endif STATICLINK_LIBS = @LIBS@ SO_LINK_LIBS = @LIBS@ # Default extensions +ifeq (@PLATFORM@,win32) +ARCH_EXT= .lib +else ARCH_EXT= .a +endif EXEC_EXT= @EXEEXT@ SHRLIB_EXT=@SHRLIB_EXT@ +ifeq (@PLATFORM@,win32) +LIB_PREFIX= +else LIB_PREFIX= lib +endif SHRLIB_FOREIGN_EXT= $(SHRLIB_EXT) #_____________________________________________________________________________ @@ -179,6 +203,7 @@ vpath %.so $(LIB) vpath %.a $(LIB) vpath %.dll $(LIB) +vpath %.lib $(LIB) #_____________________________________________________________________________ @@ -193,9 +218,9 @@ # Scold me, but I don't want library names to be in configure.in # -SharedLibraryName=libfbembed.${SHRLIB_EXT}.${FirebirdVersion} -SharedLibrarySoName=libfbembed.${SHRLIB_EXT}.${MajorVer}.${MinorVer} -SharedLibraryBaseName=libfbembed.${SHRLIB_EXT} +SharedLibraryName=ifbembed.${SHRLIB_EXT} +SharedLibrarySoName=ifbembed.${SHRLIB_EXT} +SharedLibraryBaseName=ifbembed.${SHRLIB_EXT} LIBFBEMBED_SO = $(LIB)/$(SharedLibraryName) LIBFBEMBED_SOBASENAME = $(LIB)/$(SharedLibrarySoName) @@ -219,7 +244,11 @@ LIBFBINTL_SO = $(FIREBIRD)/intl/$(LIB_PREFIX)fbintl.$(SHRLIB_EXT) +ifeq ($(PLATFORM),win32) +LIBFBSTATIC_A = $(LIB)/fbstatic.lib +else LIBFBSTATIC_A = $(LIB)/libfbstatic.a +endif ifeq ($(EDITLINE_FLG),Y) ifeq ($(STD_EDITLINE), true) diff -ur firebird.org/builds/posix/make.rules firebird/builds/posix/make.rules --- firebird.org/builds/posix/make.rules 2015-07-30 18:56:58.404726100 +0200 +++ firebird/builds/posix/make.rules 2015-07-30 19:29:24.404796300 +0200 @@ -116,4 +116,4 @@ # Rules for making resource files $(GEN_ROOT)/%.res: $(SRC_ROOT)/%.rc - windres --output-format=coff --include-dir=$($@ $(RM) -f ibase.h diff -ur firebird.org/builds/posix/Makefile.in.intl firebird/builds/posix/Makefile.in.intl --- firebird.org/builds/posix/Makefile.in.intl 2015-07-30 18:56:58.936120900 +0200 +++ firebird/builds/posix/Makefile.in.intl 2015-07-30 19:29:23.576732800 +0200 @@ -81,8 +81,13 @@ libfbintl : $(LIBFBINTL_SO) $(LIBFBINTL_SO): $(INTL_Objects) $(FBCOMMON_ClientObjects) $(FBCLASSES_ClientObjects) +ifeq (@PLATFORM@,win32) + @CXX@ $^ -o $@ -LD $(GLOB_OPTIONS) $(CXXFLAGS) $(LINK_INTL_LIBS)\ + $(LINK_FBINTL_SYMBOLS) $(LIB_LINK_OPTIONS) -lfbstatic $(call LIB_LINK_SONAME,libintl.$(SHRLIB_EXT).1)\ + $(call LIB_LINK_RPATH,lib) /link /dll +else $(LINK_INTL) -o $@ $^ $(LINK_INTL_LIBS) - +endif include $(ROOT)/gen/make.shared.targets diff -ur firebird.org/builds/posix/Makefile.in.libfbembed firebird/builds/posix/Makefile.in.libfbembed --- firebird.org/builds/posix/Makefile.in.libfbembed 2015-07-30 18:56:58.826768300 +0200 +++ firebird/builds/posix/Makefile.in.libfbembed 2015-07-30 19:29:23.670532500 +0200 @@ -62,13 +62,19 @@ libfbembed : $(LIBIBUTIL_SO) $(LIBFBEMBED_SONAME) $(LIBFBEMBED_SO): $(LIBFBEMBED_Objects) $(SERVER_Objects) $(COMMON_Objects) +ifeq ($(PLATFORM),win32) + @CXX@ $^ -o $@ $(LINK_EMBED_LIBS) $(GLOB_OPTIONS) $(CXXFLAGS)\ + $(LINK_FIREBIRD_EMBED_SYMBOLS) $(LIB_LINK_OPTIONS) $(LIB_EMBED_LINK_OPTIONS)\ + $(call LIB_LINK_SONAME,$(SharedLibrarySoName)) $(call LIB_LINK_RPATH,lib) +else $(LINK_EMBED) -o $@ $^ $(LINK_EMBED_LIBS) +endif $(LIBFBEMBED_SOBASENAME): $(LIBFBEMBED_SO) - (cd $(LIB) && $(LN) -f $(SharedLibraryName) $(SharedLibrarySoName) ) +# (cd $(LIB) && $(LN) -f $(SharedLibraryName) $(SharedLibrarySoName) ) $(LIBFBEMBED_SONAME): $(LIBFBEMBED_SOBASENAME) - (cd $(LIB) && $(LN) -f $(SharedLibrarySoName) $(SharedLibraryBaseName) ) +# (cd $(LIB) && $(LN) -f $(SharedLibrarySoName) $(SharedLibraryBaseName) ) include $(ROOT)/gen/make.shared.targets diff -ur firebird.org/builds/posix/Makefile.in.libfbstatic firebird/builds/posix/Makefile.in.libfbstatic --- firebird.org/builds/posix/Makefile.in.libfbstatic 2015-07-30 18:56:58.826768300 +0200 +++ firebird/builds/posix/Makefile.in.libfbstatic 2015-07-30 19:29:23.717391000 +0200 @@ -57,9 +57,9 @@ # will not be different from the above fbmem_boot.a library # compile time macros being the main (if there) difference -libfbstatic: $(PARSE_Sources) $(LIB)/libfbstatic.a +libfbstatic: $(PARSE_Sources) $(LIB)/$(LIB_PREFIX)fbstatic$(ARCH_EXT) -$(LIB)/libfbstatic.a: $(LIBFBSTATIC_Objects) +$(LIB)/$(LIB_PREFIX)fbstatic$(ARCH_EXT): $(LIBFBSTATIC_Objects) -$(RM) $@ $(AR) $@ $^ -$(RANLIB) $@ diff -ur firebird.org/builds/posix/prefix.mingw firebird/builds/posix/prefix.mingw --- firebird.org/builds/posix/prefix.mingw 2015-07-30 18:56:59.029762200 +0200 +++ firebird/builds/posix/prefix.mingw 2015-07-30 19:29:23.779759400 +0200 @@ -20,8 +20,8 @@ # # -Wno-unused-variable is used due to unused gpre generated variables -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 -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 +PROD_FLAGS=-O2 -march=i586 -DMINGW -mno-cygwin -Wall -fmessage-length=0 -Dlint -DWIN32_LEAN_AND_MEAN -MMD -mthreads +DEV_FLAGS=-ggdb -march=i586 -DMINGW -mno-cygwin -Wall -fmessage-length=0 -Dlint -DWIN32_LEAN_AND_MEAN -MMD -mthreads PLATFORM_PATH=os/win32 @@ -33,13 +33,15 @@ LIB_LINK=$(LD) LIB_LINK_OPTIONS+=-Wl,--enable-stdcall-fixup +LIB_PLATFORM_RPATH= # Strip symbols from release versions to decrease size ifeq ($(IsProdTypeBuild),Y) LINK_OPTS+=-Wl,-s LIB_LINK_OPTIONS+=-Wl,-s endif - +LIB_LINK_OPTIONS= +LINK_OPTS= # Generation of fbclient_ms.lib LIB_LINK_IMPLIB:=-Wl,--out-implib,firebird/lib/fbclient_ms.lib LIB_GUI:= -mwindows -lcomctl32 -lgdi32 @@ -65,7 +67,7 @@ ClientLibrarySoName := $(ClientLibraryName) # Looks like MinGW 3 does not support version scripts but support def-files -LINK_FIREBIRD_SYMBOLS = $(BLD_ROOT)/win32/defs/fbclient_s.def $(BLD_ROOT)/win32/defs/fbclient.def +LINK_FIREBIRD_SYMBOLS = /def:$(BLD_ROOT)/win32/defs/fbclient_s.def /def:$(BLD_ROOT)/win32/defs/fbclient.def # This is required for newly built executable to find newly built shared # libraries because on Win32 there is no such thing as LD_LIBRARY_PATH diff -ur firebird.org/configure firebird/configure --- firebird.org/configure 2015-07-30 18:57:33.826760500 +0200 +++ firebird/configure 2015-07-30 19:29:23.873496600 +0200 @@ -2878,7 +2878,7 @@ SHRLIB_EXT=so ;; - *-*-mingw*) + *-*-mingw* | *-*-cygwin*) MAKEFILE_PREFIX=mingw PLATFORM=win32 @@ -9016,6 +9016,9 @@ mingw*) opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; +cygwin*) + opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp + ;; esac # If we're using GNU nm, then use its standard symbol codes. @@ -9964,7 +9967,7 @@ esac ;; - mingw* | pw32* | os2*) + mingw* | cygwin* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' @@ -14757,7 +14760,7 @@ beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; - mingw* | os2* | pw32*) + mingw* | cygwin* | os2* | pw32*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic_CXX='-DDLL_EXPORT' @@ -16534,7 +16537,7 @@ # PIC is the default for these OSes. ;; - mingw* | pw32* | os2*) + mingw* | cygwin* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic_F77='-DDLL_EXPORT' @@ -16604,7 +16607,7 @@ esac ;; - mingw* | pw32* | os2*) + mingw* | cygwin* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic_F77='-DDLL_EXPORT' @@ -19149,7 +19152,7 @@ # PIC is the default for these OSes. ;; - mingw* | pw32* | os2*) + mingw* | cygwin* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic_GCJ='-DDLL_EXPORT' @@ -19219,7 +19222,7 @@ esac ;; - mingw* | pw32* | os2*) + mingw* | cygwin* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic_GCJ='-DDLL_EXPORT' diff -ur firebird.org/extern/btyacc/main.c firebird/extern/btyacc/main.c --- firebird.org/extern/btyacc/main.c 2015-07-30 18:57:01.029880800 +0200 +++ firebird/extern/btyacc/main.c 2015-07-30 19:29:23.920389000 +0200 @@ -2,7 +2,7 @@ #include #include -#if defined(WIN32) +#if defined(WIN32) || defined(_WIN32) #include #else #include diff -ur firebird.org/extern/btyacc/Makefile firebird/extern/btyacc/Makefile --- firebird.org/extern/btyacc/Makefile 2015-07-30 18:57:01.201632400 +0200 +++ firebird/extern/btyacc/Makefile 2015-07-30 19:29:24.326742400 +0200 @@ -42,7 +42,10 @@ all: $(PROGRAM) $(PROGRAM): $(OBJS) $(LIBS) - $(CC) $(LDFLAGS) -o $(PROGRAM) $(OBJS) $(LIBS) + $(CC) -o $(PROGRAM).exe $(OBJS) $(LIBS) $(LDFLAGS) + +%.o: %.c + $(CC) -c $< -Fo$@ $(CCFLAGS) clean:; rm -f $(OBJS) diff -ur firebird.org/src/common/classes/fb_string.cpp firebird/src/common/classes/fb_string.cpp --- firebird.org/src/common/classes/fb_string.cpp 2015-07-30 18:57:31.357886800 +0200 +++ firebird/src/common/classes/fb_string.cpp 2015-07-30 19:29:24.045626200 +0200 @@ -32,6 +32,10 @@ #include #include +#ifdef WIN_NT +#pragma comment(lib, "User32.lib") +#endif + #ifdef HAVE_STRCASECMP #define STRNCASECMP strncasecmp #else diff -ur firebird.org/src/jrd/gds.cpp firebird/src/jrd/gds.cpp --- firebird.org/src/jrd/gds.cpp 2015-07-30 18:57:25.045586000 +0200 +++ firebird/src/jrd/gds.cpp 2015-07-30 19:29:24.092207700 +0200 @@ -71,6 +71,8 @@ #include #if defined(WIN_NT) +#pragma comment(lib, "advapi32") +#pragma comment(lib, "Shell32") #include // umask, close, lseek, read, open, _sopen #include #include diff -ur firebird.org/src/jrd/isc.cpp firebird/src/jrd/isc.cpp --- firebird.org/src/jrd/isc.cpp 2015-07-30 18:57:24.186115300 +0200 +++ firebird/src/jrd/isc.cpp 2015-07-30 19:29:24.123769900 +0200 @@ -60,7 +60,7 @@ /* Win32 specific stuff */ #ifdef WIN_NT - +#pragma comment(lib, "User32") #include #include #include diff -ur firebird.org/src/jrd/os/win32/mod_loader.cpp firebird/src/jrd/os/win32/mod_loader.cpp --- firebird.org/src/jrd/os/win32/mod_loader.cpp 2015-07-30 18:57:24.014278400 +0200 +++ firebird/src/jrd/os/win32/mod_loader.cpp 2015-07-30 19:29:44.029786700 +0200 @@ -95,6 +95,10 @@ "msvcr90.dll", #elif _MSC_VER == 1600 "msvcr100.dll", +#elif _MSC_VER == 1700 + "msvcr110.dll", +#elif _MSC_VER == 1800 + "mscvr120.dll", #else #error Specify CRT DLL name here ! #endif diff -ur firebird.org/src/misc/makeHeader.cpp firebird/src/misc/makeHeader.cpp --- firebird.org/src/misc/makeHeader.cpp 2015-07-30 18:57:26.498503700 +0200 +++ firebird/src/misc/makeHeader.cpp 2015-07-30 19:29:24.279812900 +0200 @@ -1,9 +1,9 @@ #include #include #include -//#ifdef HAVE_UNISTD_H +#ifdef HAVE_UNISTD_H #include -//#endif +#endif