build: Build the DirectWrite sources if requested
authorChun-wei Fan <fanchunwei@src.gnome.org>
Wed, 3 Feb 2016 10:31:23 +0000 (18:31 +0800)
committerChun-wei Fan <fanchunwei@src.gnome.org>
Wed, 3 Feb 2016 12:14:42 +0000 (20:14 +0800)
This adds to the autotools build system so that the (experimental)
DirectWrite support for HarfBuzz is built (and dist'ed).

configure.ac
src/Makefile.am
src/Makefile.sources

index d14e0fc..f76b4fc 100644 (file)
@@ -356,6 +356,30 @@ AM_CONDITIONAL(HAVE_UNISCRIBE, $have_uniscribe)
 
 dnl ===========================================================================
 
+AC_ARG_WITH(directwrite,
+       [AS_HELP_STRING([--with-directwrite=@<:@yes/no/auto@:>@],
+                       [Use the DirectWrite library (experimental) @<:@default=no@:>@])],,
+       [with_directwrite=no])
+have_directwrite=false
+AC_LANG_PUSH([C++])
+if test "x$with_directwrite" = "xyes" -o "x$with_directwrite" = "xauto"; then
+       AC_CHECK_HEADERS(dwrite.h, have_directwrite=true)
+fi
+AC_LANG_POP([C++])
+if test "x$with_directwrite" = "xyes" -a "x$have_directwrite" != "xtrue"; then
+       AC_MSG_ERROR([directwrite support requested but not found])
+fi
+if $have_directwrite; then
+       DIRECTWRITE_CXXFLAGS=
+       DIRECTWRITE_LIBS="-ldwrite"
+       AC_SUBST(DIRECTWRITE_CXXFLAGS)
+       AC_SUBST(DIRECTWRITE_LIBS)
+       AC_DEFINE(HAVE_DIRECTWRITE, 1, [Have DirectWrite library])
+fi
+AM_CONDITIONAL(HAVE_DIRECTWRITE, $have_directwrite)
+
+dnl ===========================================================================
+
 AC_ARG_WITH(coretext,
        [AS_HELP_STRING([--with-coretext=@<:@yes/no/auto@:>@],
                        [Use CoreText @<:@default=no@:>@])],,
@@ -472,6 +496,7 @@ Additional shapers (the more the better):
 Platform shapers (not normally needed):
        CoreText:               ${have_coretext}
        Uniscribe:              ${have_uniscribe}
+       DirectWrite:            ${have_directwrite}
 
 Other features:
        Documentation:          ${have_gtk_doc}
index 9b0affa..bb085ad 100644 (file)
@@ -78,6 +78,13 @@ HBSOURCES += $(HB_UNISCRIBE_sources)
 HBHEADERS += $(HB_UNISCRIBE_headers)
 endif
 
+if HAVE_DIRECTWRITE
+HBCFLAGS += $(DIRECTWRITE_CXXFLAGS)
+HBNONPCLIBS += $(DIRECTWRITE_LIBS)
+HBSOURCES += $(HB_DIRECTWRITE_sources)
+HBHEADERS += $(HB_DIRECTWRITE_headers)
+endif
+
 if HAVE_CORETEXT
 HBCFLAGS += $(CORETEXT_CFLAGS)
 HBNONPCLIBS += $(CORETEXT_LIBS)
index 769b69d..171c513 100644 (file)
@@ -130,6 +130,9 @@ HB_GRAPHITE2_headers = hb-graphite2.h
 HB_CORETEXT_sources = hb-coretext.cc
 HB_CORETEXT_headers = hb-coretext.h
 
+HB_DIRECTWRITE_sources = hb-directwrite.cc
+HB_DIRECTWRITE_headers = hb-directwrite.h
+
 HB_UNISCRIBE_sources = hb-uniscribe.cc
 HB_UNISCRIBE_headers = hb-uniscribe.h