[wasm] Try at autotools build

This commit is contained in:
Behdad Esfahbod 2023-02-24 17:04:05 -07:00
parent ed39e07661
commit 99d2dab30f
4 changed files with 46 additions and 4 deletions

View File

@ -417,6 +417,28 @@ AM_CONDITIONAL(HAVE_CORETEXT, $have_coretext)
dnl =========================================================================== dnl ===========================================================================
AC_ARG_WITH(wasm,
[AS_HELP_STRING([--with-wasm=@<:@yes/no/auto@:>@],
[Use the wasm-micro-runtime library @<:@default=no@:>@])],,
[with_wasm=no])
have_wasm=false
if test "x$with_wasm" = "xyes" -o "x$with_wasm" = "xauto"; then
AC_CHECK_HEADERS(wasm_export.h, have_wasm=true)
fi
if test "x$with_wasm" = "xyes" -a "x$have_wasm" != "xtrue"; then
AC_MSG_ERROR([wasm support requested but not found])
fi
if $have_wasm; then
WASM_CFLAGS=
WASM_LIBS="-liwasm"
AC_SUBST(WASM_CFLAGS)
AC_SUBST(WASM_LIBS)
AC_DEFINE(HAVE_WASM, 1, [Have wasm-micro-runtime library])
fi
AM_CONDITIONAL(HAVE_WASM, $have_wasm)
dnl ===========================================================================
AC_CONFIG_FILES([ AC_CONFIG_FILES([
Makefile Makefile
src/Makefile src/Makefile
@ -478,6 +500,7 @@ Platform shapers (not normally needed):
DirectWrite: ${have_directwrite} DirectWrite: ${have_directwrite}
GDI: ${have_gdi} GDI: ${have_gdi}
Uniscribe: ${have_uniscribe} Uniscribe: ${have_uniscribe}
WebAssembly: ${have_wasm}
Other features: Other features:
Documentation: ${enable_gtk_doc} Documentation: ${enable_gtk_doc}

View File

@ -114,6 +114,16 @@ else
HB_HAS_CORETEXT_DEF = undef HB_HAS_CORETEXT HB_HAS_CORETEXT_DEF = undef HB_HAS_CORETEXT
endif endif
if HAVE_WASM
HBCFLAGS += $(WASM_CFLAGS)
HBNONPCLIBS += $(WASM_LIBS)
HBSOURCES += $(HB_WASM_sources)
HBHEADERS += $(HB_WASM_headers)
HB_HAS_WASM_DEF = define HB_HAS_WASM 1
else
HB_HAS_WASM_DEF = undef HB_HAS_WASM
endif
BUILT_SOURCES += \ BUILT_SOURCES += \
hb-version.h hb-version.h

View File

@ -255,7 +255,6 @@ HB_BASE_sources = \
hb-unicode.hh \ hb-unicode.hh \
hb-utf.hh \ hb-utf.hh \
hb-vector.hh \ hb-vector.hh \
hb-wasm-shape.cc \
hb-priority-queue.hh \ hb-priority-queue.hh \
hb.hh \ hb.hh \
$(NULL) $(NULL)
@ -339,10 +338,22 @@ HB_GDI_headers = hb-gdi.h
HB_UNISCRIBE_sources = hb-uniscribe.cc HB_UNISCRIBE_sources = hb-uniscribe.cc
HB_UNISCRIBE_headers = hb-uniscribe.h HB_UNISCRIBE_headers = hb-uniscribe.h
# Sources for libharfbuzz-gobject and libharfbuzz-icu
HB_ICU_sources = hb-icu.cc HB_ICU_sources = hb-icu.cc
HB_ICU_headers = hb-icu.h HB_ICU_headers = hb-icu.h
HB_WASM_sources = \
hb-wasm-api.cc \
hb-wasm-api.hh \
hb-wasm-api-blob.hh \
hb-wasm-api-buffer.hh \
hb-wasm-api-common.hh \
hb-wasm-api-face.hh \
hb-wasm-api-font.hh \
hb-wasm-api-shape.hh \
hb-wasm-shape.cc \
$(NULL)
HB_WASM_headers = hb-wasm-api.h
# Sources for libharfbuzz-subset # Sources for libharfbuzz-subset
HB_SUBSET_sources = \ HB_SUBSET_sources = \
hb-number.cc \ hb-number.cc \

View File

@ -58,5 +58,3 @@
#include "hb-ucd.cc" #include "hb-ucd.cc"
#include "hb-unicode.cc" #include "hb-unicode.cc"
#include "hb-uniscribe.cc" #include "hb-uniscribe.cc"
#include "hb-wasm-api.cc"
#include "hb-wasm-shape.cc"