From ad52e044bcf733bcc6c0373bafcd78a8c0beb400 Mon Sep 17 00:00:00 2001 From: fanc999 Date: Wed, 21 Jun 2017 22:19:57 +0800 Subject: [PATCH] Win32/NMake builds: Support builds from GIT (#498) Add Python scripts to generate the full win32/config.h.win32 and src/hb-version.h which can be used to build directly from a GIT checkout. Since the scripts are currently intended for building from a GIT checkout, these are not distributed in the release tarballs. Also, support the re-build of Ragel-generated .hh headers using the NMake build system, and allow one to specify the path of the Ragel executable if a suitable one cannot be found in the PATH. Update the Win32/NMake build documentation to let people know about how these mechanisms can be utilized. --- win32/README.txt | 20 +++++- win32/build-rules-msvc.mak | 5 +- win32/config-msvc.mak | 7 ++ win32/create-lists-msvc.mak | 9 +++ win32/generate-msvc.mak | 6 ++ win32/info-msvc.mak | 8 ++- win32/pc_base.py | 124 ++++++++++++++++++++++++++++++++++++ win32/replace.py | 115 +++++++++++++++++++++++++++++++++ win32/setup.py | 62 ++++++++++++++++++ 9 files changed, 353 insertions(+), 3 deletions(-) create mode 100644 win32/pc_base.py create mode 100644 win32/replace.py create mode 100644 win32/setup.py diff --git a/win32/README.txt b/win32/README.txt index dc31e8b6d..90554c012 100644 --- a/win32/README.txt +++ b/win32/README.txt @@ -11,7 +11,22 @@ backends are enabled, and this is the base configuration that is built if no options (see below) are specified. A 'clean' target is provided-it is recommended that one cleans the build and redo the build if any configuration option changed. An 'install' target is also provided to copy the built items in their appropriate -locations under $(PREFIX), which is described below. +locations under $(PREFIX), which is described below. A 'reallyclean' target is +provided that not only does what is done for the 'clean' target, but also removes +the sources/headers that are generated from the Ragel sources. Therefore, if one +is not building from a release tarball, or is rebuilding after using the 'reallyclean' +target or when the Ragel (*.rl) sources are updated, the Ragel state machine +compiler (ragel.exe) is needed, and needs to be passed in via RAGEL= +if ragel.exe is not already in the PATH. + +We now support building from a GIT checkout via NMake for convenience. In addition to +the requirements as outlined in the later part of this file, you will need to run the +setup.py (Python 2.7.x or later) script to generate the headers (src\hb-version.h and +win32\config.h.win32) that are normally shipped in a release tarball before running +NMake, and you will need to pass RAGEL= if the Ragel state machine +compiler (ragel.exe) is not in your PATH when invoking NMake. Note that the +'reallyclean' target does not remove these 2 generated headers, so re-run the setup.py +script if necessary. Invoke the build by issuing the command: nmake /f Makefile.vc CFG=[release|debug] [PREFIX=...] @@ -32,6 +47,7 @@ PREFIX: Optional. Base directory of where the third-party headers, libraries 2012: 11 2013: 12 2015: 14 + 2017: 15 Explanation of options, set by