Update Visual Studio builds for UCDN usage
authorChun-wei Fan <fanchunwei@src.gnome.org>
Thu, 23 Feb 2017 05:02:49 +0000 (13:02 +0800)
committerKhaled Hosny <khaledhosny@eglug.org>
Wed, 22 Mar 2017 21:03:49 +0000 (23:03 +0200)
We now use UCDN by default, so make it so in the build files; however
don't hardcode HAVE_UCDN as one may still opt not to use it (but pass
it in as a CFLAG unless one explicitly disables UCDN by using NO_UCDN=1
on the NMake command line).

Note that we are not blocking builds where UCDN is disabled along with
GLib and ICU, as that will trigger a build error anyways which will tell
the user what needs to be done to remedy this.

win32/README.txt
win32/config-msvc.mak
win32/config.h.win32.in
win32/info-msvc.mak

index af0dc15c1e78faf83b8b08f459e0f14d2dac426b..dc31e8b6d6d42259f05f2a208c7c78a8d1e7b65c 100644 (file)
@@ -36,7 +36,7 @@ PREFIX: Optional.  Base directory of where the third-party headers, libraries
 Explanation of options, set by <option>=1:\r
 ------------------------------------------\r
 GLIB: Enable GLib support in HarfBuzz, which also uses the GLib unicode\r
-      callback instead of the bundled UCDN unicode callback.  This requires the\r
+      callback if the bundled UCDN unicode callback is disabled.  This requires the\r
       GLib libraries, and is required for building all tool and test programs.\r
 \r
 GOBJECT: Enable building the HarfBuzz-GObject DLL, and thus implies GLib\r
@@ -63,7 +63,7 @@ CAIRO_FT: Enable the build of the hb-view tool, which makes use of Cairo, and
 \r
 GRAPHITE2: Enable the Graphite2 shaper, requires the SIL Graphite2 library.\r
 \r
-ICU: Enables the build of ICU Unicode functions. Requires the ICU libraries.
+ICU: Enables the build of ICU Unicode functions. Requires the ICU libraries.\r
 \r
 UNISCRIBE: Enable Uniscribe platform shaper support.\r
 \r
@@ -75,4 +75,4 @@ PYTHON: Full path to the Python interpretor to be used, if it is not in %PATH%.
 \r
 PERL: Full path to the PERL interpretor to be used, if it is not in %PATH%.\r
 \r
-LIBTOOL_DLL_NAME: Enable libtool-style DLL names.
\ No newline at end of file
+LIBTOOL_DLL_NAME: Enable libtool-style DLL names.\r
index 4cffaeacc43578ba62864c03121ac4503a5d388b..285ad14063999596878ce323ce4932bbf087dfea 100644 (file)
@@ -129,6 +129,16 @@ HB_HEADERS = $(HB_HEADERS) $(HB_GRAPHITE2_headers)
 HB_DEP_LIBS = $(HB_DEP_LIBS) $(GRAPHITE2_LIB)
 !endif
 
+# Always enable UCDN unless explicitly disabled
+!if "$(NO_UCDN)" != "1"
+HB_DEFINES = $(HB_DEFINES) /DHAVE_UCDN=1
+HB_CFLAGS =            \
+       $(HB_CFLAGS)            \
+       $(HB_UCDN_CFLAGS)
+
+HB_SOURCES = $(HB_SOURCES) $(LIBHB_UCDN_sources) $(HB_UCDN_sources)
+!endif
+
 # Enable GLib if desired
 !if "$(GLIB)" == "1"
 HB_DEFINES = $(HB_DEFINES) /DHAVE_GLIB=1
@@ -164,16 +174,12 @@ HB_TESTS = \
        $(CFG)\$(PLAT)\test-unicode.exe                         \
        $(CFG)\$(PLAT)\test-version.exe
 
-!elseif "$(ICU)" == "1"
+!else
+!if "$(ICU)" == "1"
 # use ICU for Unicode functions
 # and define some of the macros in GLib's msvc_recommended_pragmas.h
 # to reduce some unneeded build-time warnings
 HB_DEFINES = $(HB_DEFINES) /DHAVE_ICU=1 /DHAVE_ICU_BUILTIN=1
-HB_CFLAGS =    \
-       $(HB_CFLAGS)                                    \
-       /wd4244                                                 \
-       /D_CRT_SECURE_NO_WARNINGS               \
-       /D_CRT_NONSTDC_NO_WARNINGS
 
 # We don't want ICU to re-define int8_t in VS 2008, will cause build breakage
 # as we define it in hb-common.h, and we ought to use the definitions there.
@@ -186,18 +192,14 @@ HB_HEADERS = $(HB_HEADERS) $(HB_ICU_headers)
 HB_DEP_LIBS = $(HB_DEP_LIBS) $(HB_ICU_DEP_LIBS)
 !endif
 
-!if "$(UCDN)" != "0"
 # Define some of the macros in GLib's msvc_recommended_pragmas.h
 # to reduce some unneeded build-time warnings
-HB_DEFINES = $(HB_DEFINES) /DHAVE_UCDN=1
 HB_CFLAGS =    \
-       $(HB_CFLAGS)                                    \
-       $(HB_UCDN_CFLAGS)                               \
-       /wd4244                                                 \
-       /D_CRT_SECURE_NO_WARNINGS               \
+       $(HB_CFLAGS)                    \
+       /wd4244                         \
+       /D_CRT_SECURE_NO_WARNINGS       \
        /D_CRT_NONSTDC_NO_WARNINGS
 
-HB_SOURCES = $(HB_SOURCES) $(LIBHB_UCDN_sources) $(HB_UCDN_sources)
 !endif
 
 !if "$(UNISCRIBE)" == "1"
index d45cefb5e192e2c04f0f21120e3b17fe5403c80e..435c1bb29675f832dedcd8217f98d22544843a04 100644 (file)
 #define HAVE_SYS_TYPES_H 1
 
 /* Have UCDN Unicode functions */
-#define HAVE_UCDN 1
+/* #undef HAVE_UCDN */
 
 /* Have Uniscribe library */
 /* #undef HAVE_UNISCRIBE */
index 3ec11d4dc50fc4ac858617d256842846771d1c8a..9b92e031183463aff790f7ca0a7dea2b00cdc68b 100644 (file)
@@ -4,6 +4,9 @@ INC_FEATURES = Fallback OT
 BUILT_TOOLS =
 BUILT_LIBRARIES = HarfBuzz
 
+!if "$(NO_UCDN)" != "1"
+UNICODE_IMPL = ucdn
+!else
 !if "$(GLIB)" == "1"
 UNICODE_IMPL = GLib
 INC_FEATURES = $(INC_FEATURES) GLib
@@ -13,8 +16,7 @@ BUILT_TOOLS = hb-view.exe $(BUILT_TOOLS)
 !endif
 !elseif "$(ICU)" == "1"
 UNICODE_IMPL = ICU
-!else
-UNICODE_IMPL = ucdn
+!endif
 !endif
 
 !if "$(FREETYPE)" == "1"
@@ -79,18 +81,18 @@ help:
        @echo.
        @echo OPTION: Optional, may be any of the following, use OPTION=1 to enable;
        @echo multiple OPTION's may be used.  If no OPTION is specified, a default
-       @echo HarfBuzz DLL is built with OpenType and fallback support
-       @echo with a bundled Unicode implementation (UCDN).
+       @echo HarfBuzz DLL is built with OpenType and support with a bundled
+       @echo Unicode implementation (UCDN).
        @echo ======
-       @echo UNISCRIBE:
-       @echo Enable Uniscribe support.
+       @echo.
+       @echo CAIRO_FT:
+       @echo Enables Cairo-Freetype support, needed for the build of the hb-view utility.
+       @echo Implies FreeType2 support and also requires Cairo built with FreeType2
+       @echo support; GLib2 support must also be enabled.
        @echo.
        @echo DIRECTWRITE:
        @echo Enable DirectWrite support, requires a recent enough Windows SDK.
        @echo.
-       @echo GRAPHITE2:
-       @echo Enable graphite2 support, requires the SIL Graphite2 library
-       @echo.
        @echo FREETYPE:
        @echo Enable FreeType2 support, requires the FreeType2 library
        @echo.
@@ -98,16 +100,19 @@ help:
        @echo Enable GLib2 support, with GLib Unicode support, requires the GNOME GLib2
        @echo library.  Enables the build of utility programs.
        @echo.
-       @echo ICU:
-       @echo Enable build with ICU Unicode functions, requires the International
-       @echo Components for Unicode (ICU) libraries.
-       @echo.
        @echo GOBJECT:
        @echo Enable the HarfBuzz-GObject library, also implies GLib2 support,
        @echo requires the GNOME GLib2 libraries and tools, notably the glib-mkenums
        @echo tool script, which will require a PERL interpreter (use
        @echo PERL=^$(PATH_TO_PERL_INTERPRETOR)) if it is not already in your PATH).
        @echo.
+       @echo GRAPHITE2:
+       @echo Enable graphite2 support, requires the SIL Graphite2 library
+       @echo.
+       @echo ICU:
+       @echo Enable build with ICU Unicode functions, requires the International
+       @echo Components for Unicode (ICU) libraries.
+       @echo.
        @echo INTROSPECTION:
        @echo Enable the build of introspection files, also implies GObject/GLib2 support,
        @echo requires the GNOME gobject-introspection libraries and tools.  You will need
@@ -117,15 +122,17 @@ help:
        @echo ^$(PATH_TO_PYTHON_INTERPRETOR) respectively, if python.exe is not already
        @echo in your PATH.
        @echo.
-       @echo CAIRO_FT:
-       @echo Enables Cairo-Freetype support, needed for the build of the hb-view utility.
-       @echo Implies FreeType2 support and also requires Cairo built with FreeType2
-       @echo support; GLib2 support must also be enabled.
-       @echo.
        @echo LIBTOOL_DLL_NAME:
        @echo Use a libtool-style DLL name to mimic the DLL file naming generated by
        @echo MinGW builds.
        @echo.
+       @echo NO_UCDN:
+       @echo Do not use the bundled Unicode callback, which is the default.  GLib or
+       @echo ICU-based unicode callback is therefore required.
+       @echo
+       @echo UNISCRIBE:
+       @echo Enable Uniscribe support.
+       @echo.
        @echo Note that GLib2 support is required for all utility and test programs.
        @echo ======
        @echo A 'clean' target is supported to remove all generated files, intermediate