Make Uniscribe optional on nmake win32 builds

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.
This commit is contained in:
Ebrahim Byagowi 2016-10-09 09:06:05 +03:30
parent 331c46c79b
commit d8e2eb9ee0
5 changed files with 31 additions and 15 deletions

View 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" 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" 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" 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 "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"' - '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"'

View File

@ -7,11 +7,10 @@ Makefiles.
The following are instructions for performing such a build, as there is a The following are instructions for performing such a build, as there is a
number of build configurations supported for the build. Note that for all number of build configurations supported for the build. Note that for all
build configurations, the OpenType and Simple TrueType layout (fallback) build configurations, the OpenType and Simple TrueType layout (fallback)
backends are enabled, as well as the Uniscribe platform shaper, and this backends are enabled, and this is the base configuration that is built if no
is the base configuration that is built if no options (see below) are options (see below) are specified. A 'clean' target is provided-it is recommended
specified. A 'clean' target is provided-it is recommended that one cleans that one cleans the build and redo the build if any configuration option changed.
the build and redo the build if any configuration option changed. An An 'install' target is also provided to copy the built items in their appropriate
'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.
Invoke the build by issuing the command: Invoke the build by issuing the command:
@ -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. for ICU (International Components for Unicode), which deprecated ICU LE.
Requires the ICU libraries. Requires the ICU libraries.
DIRECTWRITE: Enable (experimental) DirectWrite platform shaper support, UNISCRIBE: Enable Uniscribe platform shaper support.
DIRECTWRITE: Enable DirectWrite platform shaper support,
requires a rather recent Windows SDK, and at least Windows Vista/ requires a rather recent Windows SDK, and at least Windows Vista/
Server 2008 with SP2 and platform update. Server 2008 with SP2 and platform update.

View File

@ -20,6 +20,9 @@ CAIRO_LIB = cairo.lib
# Graphite2 is needed for building SIL Graphite2 support # Graphite2 is needed for building SIL Graphite2 support
GRAPHITE2_LIB = graphite2.lib 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 is needed for DirectWrite shaping support
DIRECTWRITE_LIB = dwrite.lib DIRECTWRITE_LIB = dwrite.lib
@ -31,17 +34,15 @@ HB_UCDN_CFLAGS = /I..\src\hb-ucdn
HB_SOURCES = \ HB_SOURCES = \
$(HB_BASE_sources) \ $(HB_BASE_sources) \
$(HB_FALLBACK_sources) \ $(HB_FALLBACK_sources) \
$(HB_OT_sources) \ $(HB_OT_sources)
$(HB_UNISCRIBE_sources) \
HB_HEADERS = \ HB_HEADERS = \
$(HB_BASE_headers) \ $(HB_BASE_headers) \
$(HB_NODIST_headers) \ $(HB_NODIST_headers) \
$(HB_OT_headers) \ $(HB_OT_headers)
$(HB_UNISCRIBE_headers)
# Minimal set of (system) libraries needed for the HarfBuzz DLL # 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 # We build the HarfBuzz DLL/LIB at least
HB_LIBS = $(CFG)\$(PLAT)\harfbuzz.lib HB_LIBS = $(CFG)\$(PLAT)\harfbuzz.lib
@ -188,6 +189,13 @@ HB_CFLAGS = \
HB_SOURCES = $(HB_SOURCES) $(LIBHB_UCDN_sources) $(HB_UCDN_sources) HB_SOURCES = $(HB_SOURCES) $(LIBHB_UCDN_sources) $(HB_UCDN_sources)
!endif !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" !if "$(DIRECTWRITE)" == "1"
HB_CFLAGS = $(HB_CFLAGS) /DHAVE_DIRECTWRITE HB_CFLAGS = $(HB_CFLAGS) /DHAVE_DIRECTWRITE
HB_SOURCES = $(HB_SOURCES) $(HB_DIRECTWRITE_sources) HB_SOURCES = $(HB_SOURCES) $(HB_DIRECTWRITE_sources)

View File

@ -115,7 +115,7 @@
#define HAVE_UCDN 1 #define HAVE_UCDN 1
/* Have Uniscribe library */ /* Have Uniscribe library */
#define HAVE_UNISCRIBE 1 /* #undef HAVE_UNISCRIBE */
/* Define to 1 if you have the <unistd.h> header file. */ /* Define to 1 if you have the <unistd.h> header file. */
#ifndef _MSC_VER #ifndef _MSC_VER

View File

@ -1,6 +1,6 @@
# NMake Makefile portion for displaying config info # NMake Makefile portion for displaying config info
INC_FEATURES = Uniscribe Fallback OT INC_FEATURES = Fallback OT
BUILT_TOOLS = BUILT_TOOLS =
BUILT_LIBRARIES = HarfBuzz BUILT_LIBRARIES = HarfBuzz
@ -23,6 +23,10 @@ INC_FEATURES = $(INC_FEATURES) FreeType
INC_FEATURES = $(INC_FEATURES) Graphite2 INC_FEATURES = $(INC_FEATURES) Graphite2
!endif !endif
!if "$(UNISCRIBE)" == "1"
INC_FEATURES = $(INC_FEATURES) Uniscribe
!endif
!if "$(DIRECTWRITE)" == "1" !if "$(DIRECTWRITE)" == "1"
INC_FEATURES = $(INC_FEATURES) DirectWrite INC_FEATURES = $(INC_FEATURES) DirectWrite
!endif !endif
@ -77,9 +81,12 @@ help:
@echo. @echo.
@echo OPTION: Optional, may be any of the following, use OPTION=1 to enable; @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 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 with a bundled Unicode implementation (UCDN).
@echo ====== @echo ======
@echo UNISCRIBE:
@echo Enable Uniscribe support.
@echo.
@echo DIRECTWRITE: @echo DIRECTWRITE:
@echo Enable DirectWrite support, requires a recent enough Windows SDK. @echo Enable DirectWrite support, requires a recent enough Windows SDK.
@echo. @echo.