[libxml2] Allow build on Visual Studio 2017 community edition for WIN32 on a 64 bit machine.
- From: Daniel Veillard <veillard src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libxml2] Allow build on Visual Studio 2017 community edition for WIN32 on a 64 bit machine.
- Date: Mon, 28 Aug 2017 12:58:53 +0000 (UTC)
commit 605899cf22d185f537eb5efb97a55be30467eb17
Author: Boris Shtrasman <borissh1983 gmail com>
Date: Wed Aug 16 12:22:44 2017 +0300
Allow build on Visual Studio 2017 community edition for WIN32 on a 64 bit machine.
This patch hold the necessary changes to build libxml2 with Visual
Studio 2017 for WIN32 on a 64 bit machine.
Today 64 bit windows installation are very common, and Visual Studio
2017 community is the most recent version i have access to.
I have chosen 32 bit and SDK 8.1 to be as close as possible to Igor Zlatkovic work.
win32/Makefile.msvc | 20 ++++++++++++++++----
win32/Readme.txt | 14 ++++++++++++++
2 files changed, 30 insertions(+), 4 deletions(-)
---
diff --git a/win32/Makefile.msvc b/win32/Makefile.msvc
index d16c1a2..2e4d6f8 100644
--- a/win32/Makefile.msvc
+++ b/win32/Makefile.msvc
@@ -26,6 +26,18 @@ XML_IMP = $(XML_BASENAME).lib
XML_DEF = $(XML_BASENAME).def
XML_A = $(XML_BASENAME)_a.lib
XML_A_DLL = $(XML_BASENAME)_a_dll.lib
+VS14_INCLUDE = "C:\Program Files (x86)\Microsoft Visual
Studio\2017\Community\VC\Tools\MSVC\14.10.25017\include"
+VS14_INCLUDE_AUX = "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\VS\include"
+VS14_INCLUDE_UCRT = "C:\Program Files (x86)\Windows Kits\10\Include\10.0.15063.0\ucrt"
+VS14_INCLUDE_UM = "C:\Program Files (x86)\Windows Kits\10\Include\10.0.15063.0\um"
+VS14_INCLUDE_SHARED = "C:\Program Files (x86)\Windows Kits\10\Include\10.0.15063.0\shared"
+VS14_INCLUDE_WINRT = "C:\Program Files (x86)\Windows Kits\10\Include\10.0.15063.0\winrt\Include\um"
+WindowsSDK_IncludePath = "C:\Program Files (x86)\Windows Kits\10\Include\10.0.15063.0\um"
+
+VC14_LINK_LIBRARY_PATH_X86 = "C:\Program Files (x86)\Microsoft Visual
Studio\2017\Community\VC\Tools\MSVC\14.10.25017\lib\x86"
+VC14_LINK_LIBRARY_PATH_X86_AUX = "C:\Program Files (x86)\Microsoft Visual
Studio\2017\Community\VC\Auxiliary\VS\lib\x86"
+VC14_LINK_LIBRARY_PATH_X86_UCRT = "C:\Program Files (x86)\Windows Kits\10\lib\10.0.10240.0\ucrt\x86"
+VC14_LINK_LIBRARY_PATH_X86_WINSDK = "C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86"
# Place where we let the compiler put its output.
BINDIR = bin.msvc
@@ -36,14 +48,14 @@ UTILS_INTDIR = int.utils.msvc
# The preprocessor and its options.
CPP = cl.exe /EP
-CPPFLAGS = /nologo /I$(XML_SRCDIR)\include /D "NOLIBTOOL"
+CPPFLAGS = /nologo /I$(XML_SRCDIR)\include /D "NOLIBTOOL"
!if "$(WITH_THREADS)" != "no"
CPPFLAGS = $(CPPFLAGS) /D "_REENTRANT"
!endif
# The compiler and its options.
CC = cl.exe
-CFLAGS = /nologo /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "NOLIBTOOL" /W1 $(CRUNTIME)
+CFLAGS = /nologo /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "NOLIBTOOL" /W1 $(CRUNTIME) /I$(VS14_INCLUDE)
/I$(VS14_INCLUDE) /I$(VS14_INCLUDE_AUX) /I$(VS14_INCLUDE_UCRT) /I$(VS14_INCLUDE_UM) /I$(VS14_INCLUDE_SHARED)
/I$(VS14_INCLUDE_WINRT) /I$(WindowsSDK_IncludePath)
CFLAGS = $(CFLAGS) /I$(XML_SRCDIR) /I$(XML_SRCDIR)\include /I$(INCPREFIX)
!if "$(WITH_THREADS)" != "no"
CFLAGS = $(CFLAGS) /D "_REENTRANT"
@@ -65,8 +77,8 @@ CFLAGS = $(CFLAGS) /D_CRT_SECURE_NO_DEPRECATE /D_CRT_NONSTDC_NO_DEPRECATE
# The linker and its options.
LD = link.exe
-LDFLAGS = /nologo /VERSION:$(LIBXML_MAJOR_VERSION).$(LIBXML_MINOR_VERSION)
-LDFLAGS = $(LDFLAGS) /LIBPATH:$(BINDIR) /LIBPATH:$(LIBPREFIX)
+LDFLAGS = /VERSION:$(LIBXML_MAJOR_VERSION).$(LIBXML_MINOR_VERSION) /MACHINE:X86
+LDFLAGS = $(LDFLAGS) /LIBPATH:$(BINDIR) /LIBPATH:$(LIBPREFIX) /LIBPATH:$(VC14_LINK_LIBRARY_PATH_X86)
/LIBPATH:$(VC14_LINK_LIBRARY_PATH_X86_AUX) /LIBPATH:$(VC14_LINK_LIBRARY_PATH_X86_UCRT)
/LIBPATH:$(VC14_LINK_LIBRARY_PATH_X86_WINSDK)
LIBS =
!if "$(WITH_FTP)" == "1" || "$(WITH_HTTP)" == "1"
LIBS = $(LIBS) wsock32.lib ws2_32.lib
diff --git a/win32/Readme.txt b/win32/Readme.txt
index 6b3eddd..8f45238 100644
--- a/win32/Readme.txt
+++ b/win32/Readme.txt
@@ -148,6 +148,20 @@ it will link to its own C-runtime named msvcr70.dll or msvcr71.dll. This
file is not available on any machine which doesn't have Visual Studio
.NET installed.
+2.1.1 UCRT and 32bit
+--------------------
+
+If you use the compiler which comes with Visual Studio 2015 and above, note that
+it will link to its own C-runtime named msvcr140.dll or msvcr140.dll. That
+files are redistributed via the ucrt packages (windows XP need the ucrt files manually copied).
+
+In order to build 32 bit on Visual Studio 2017 on a 64 bit machine,
+ you would need to call the 32 bit compiler:
+
+step1 update your path to call the 32bit versions (assuming Visual studio installed to C:\Program Files
(x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.10.25017):
+set PATH="C:\Program Files (x86)\Microsoft Visual
Studio\2017\Community\VC\Tools\MSVC\14.10.25017\bin\HostX86\x86";%PATH%
+step 2 call name
+nmake /f Makefile.msvc
2.2 GNU C/C++, Mingw edition
----------------------------
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]