Make Uniscribe optional on nmake win32 builds
authorEbrahim Byagowi <ebrahim@gnu.org>
Sun, 9 Oct 2016 05:36:05 +0000 (09:06 +0330)
committerEbrahim Byagowi <ebrahim@gnu.org>
Fri, 14 Oct 2016 06:41:37 +0000 (06:41 +0000)
Most of harfbuzz clients don't need Uniscribe and DirectWrite support at all
as harfbuzz is a replacement for Uniscribe so Chromium and Firefox are using
harfbuzz without them on Windows.

This removal also helps win32 nmake clients to have reduced binary size and
libs count.

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

index 4677a27..cc16e5e 100644 (file)
@@ -31,7 +31,7 @@ build_script:
   - 'if "%compiler%"=="msvc" call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" %ARCH%'
   - 'if "%compiler%"=="msvc" C:\msys64\usr\bin\bash -lc "cd $APPVEYOR_BUILD_FOLDER; PATH=$PATH:/mingw64/bin:/mingw32/bin; ./autogen.sh; make distdir"'
   - 'if "%compiler%"=="msvc" cd harfbuzz-*\win32'
-  - 'if "%compiler%"=="msvc" nmake /f Makefile.vc CFG=%CFG% DIRECTWRITE=1'
+  - 'if "%compiler%"=="msvc" nmake /f Makefile.vc CFG=%CFG% UNISCRIBE=1 DIRECTWRITE=1'
 
   - 'if "%compiler%"=="msys2" C:\msys64\usr\bin\bash -lc "pacman --noconfirm -S mingw-w64-$MSYS2_ARCH-{freetype,cairo,icu,gettext,gobject-introspection,gcc,gcc-libs,glib2,graphite2,pkg-config}"'
   - 'if "%compiler%"=="msys2" C:\msys64\usr\bin\bash -lc "cd $APPVEYOR_BUILD_FOLDER; PATH=$PATH:/mingw64/bin:/mingw32/bin; ./autogen.sh --with-uniscribe --with-freetype --with-glib --with-gobject --with-cairo --with-icu --with-graphite2 --build=$MINGW_CHOST --host=$MINGW_CHOST --prefix=$MINGW_PREFIX; make; make check"'
index e2ead01..07e211c 100644 (file)
@@ -7,11 +7,10 @@ Makefiles.
 The following are instructions for performing such a build, as there is a\r
 number of build configurations supported for the build.  Note that for all\r
 build configurations, the OpenType and Simple TrueType layout (fallback)\r
-backends are enabled, as well as the Uniscribe platform shaper, and this\r
-is the base configuration that is built if no options (see below) are\r
-specified.  A 'clean' target is provided-it is recommended that one cleans\r
-the build and redo the build if any configuration option changed.  An\r
-'install' target is also provided to copy the built items in their appropriate\r
+backends are enabled, and this is the base configuration that is built if no\r
+options (see below) are specified.  A 'clean' target is provided-it is recommended\r
+that one cleans the build and redo the build if any configuration option changed.\r
+An 'install' target is also provided to copy the built items in their appropriate\r
 locations under $(PREFIX), which is described below.\r
 \r
 Invoke the build by issuing the command:\r
@@ -68,7 +67,9 @@ ICU: Enables the build HarfBuzz-ICU, which is now the recommended layout engine
      for ICU (International Components for Unicode), which deprecated ICU LE.\r
      Requires the ICU libraries.\r
 \r
-DIRECTWRITE: Enable (experimental) DirectWrite platform shaper support,\r
+UNISCRIBE: Enable Uniscribe platform shaper support.\r
+\r
+DIRECTWRITE: Enable DirectWrite platform shaper support,\r
              requires a rather recent Windows SDK, and at least Windows Vista/\r
              Server 2008 with SP2 and platform update.\r
 \r
index e0c6468..88ae071 100644 (file)
@@ -20,6 +20,9 @@ CAIRO_LIB = cairo.lib
 # Graphite2 is needed for building SIL Graphite2 support
 GRAPHITE2_LIB = graphite2.lib
 
+# Uniscribe is needed for Uniscribe shaping support
+UNISCRIBE_LIB = usp10.lib gdi32.lib rpcrt4.lib user32.lib
+
 # Directwrite is needed for DirectWrite shaping support
 DIRECTWRITE_LIB = dwrite.lib
 
@@ -31,17 +34,15 @@ HB_UCDN_CFLAGS = /I..\src\hb-ucdn
 HB_SOURCES =   \
        $(HB_BASE_sources)              \
        $(HB_FALLBACK_sources)  \
-       $(HB_OT_sources)                \
-       $(HB_UNISCRIBE_sources) \
+       $(HB_OT_sources)
 
 HB_HEADERS =   \
        $(HB_BASE_headers)              \
        $(HB_NODIST_headers)    \
-       $(HB_OT_headers)                \
-       $(HB_UNISCRIBE_headers)
+       $(HB_OT_headers)
 
 # Minimal set of (system) libraries needed for the HarfBuzz DLL
-HB_DEP_LIBS = usp10.lib gdi32.lib rpcrt4.lib user32.lib
+HB_DEP_LIBS =
 
 # We build the HarfBuzz DLL/LIB at least
 HB_LIBS = $(CFG)\$(PLAT)\harfbuzz.lib
@@ -188,6 +189,13 @@ HB_CFLAGS =        \
 HB_SOURCES = $(HB_SOURCES) $(LIBHB_UCDN_sources) $(HB_UCDN_sources)
 !endif
 
+!if "$(UNISCRIBE)" == "1"
+HB_CFLAGS = $(HB_CFLAGS) /DHAVE_UNISCRIBE
+HB_SOURCES = $(HB_SOURCES) $(HB_UNISCRIBE_sources)
+HB_HEADERS = $(HB_HEADERS) $(HB_UNISCRIBE_headers)
+HB_DEP_LIBS = $(HB_DEP_LIBS) $(UNISCRIBE_LIB)
+!endif
+
 !if "$(DIRECTWRITE)" == "1"
 HB_CFLAGS = $(HB_CFLAGS) /DHAVE_DIRECTWRITE
 HB_SOURCES = $(HB_SOURCES) $(HB_DIRECTWRITE_sources)
index 73ad205..d45cefb 100644 (file)
 #define HAVE_UCDN 1
 
 /* Have Uniscribe library */
-#define HAVE_UNISCRIBE 1
+/* #undef HAVE_UNISCRIBE */
 
 /* Define to 1 if you have the <unistd.h> header file. */
 #ifndef _MSC_VER
index bc85dc9..bbe631b 100644 (file)
@@ -1,6 +1,6 @@
 # NMake Makefile portion for displaying config info
 
-INC_FEATURES = Uniscribe Fallback OT
+INC_FEATURES = Fallback OT
 BUILT_TOOLS =
 BUILT_LIBRARIES = HarfBuzz
 
@@ -23,6 +23,10 @@ INC_FEATURES = $(INC_FEATURES) FreeType
 INC_FEATURES = $(INC_FEATURES) Graphite2
 !endif
 
+!if "$(UNISCRIBE)" == "1"
+INC_FEATURES = $(INC_FEATURES) Uniscribe
+!endif
+
 !if "$(DIRECTWRITE)" == "1"
 INC_FEATURES = $(INC_FEATURES) DirectWrite
 !endif
@@ -77,9 +81,12 @@ 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, fallback and Uniscribe support
+       @echo HarfBuzz DLL is built with OpenType and fallback support
        @echo with a bundled Unicode implementation (UCDN).
        @echo ======
+       @echo UNISCRIBE:
+       @echo Enable Uniscribe support.
+       @echo.
        @echo DIRECTWRITE:
        @echo Enable DirectWrite support, requires a recent enough Windows SDK.
        @echo.