From 35ded3af74a5bc4b038a07308354d5f7501ae3c7 Mon Sep 17 00:00:00 2001 From: Chun-wei Fan Date: Tue, 3 Nov 2015 16:56:27 +0800 Subject: [PATCH 1/5] build: Move source listings into separate Makefile snippets This moves all the source listings in src/Makefile.am, src/hb-ucdn/Makefile.am and util/Makefile.am into separate Makefile snippets, so that they may be shared between different Makefile-based build systems, such as NMake for Visual Studio. --- src/Makefile.am | 165 +++++++---------------------------- src/Makefile.sources | 147 +++++++++++++++++++++++++++++++ src/hb-ucdn/Makefile.am | 6 +- src/hb-ucdn/Makefile.sources | 4 + util/Makefile.am | 34 ++------ util/Makefile.sources | 32 +++++++ 6 files changed, 223 insertions(+), 165 deletions(-) create mode 100644 src/Makefile.sources create mode 100644 src/hb-ucdn/Makefile.sources create mode 100644 util/Makefile.sources diff --git a/src/Makefile.am b/src/Makefile.am index 3d013ebaa..9b0affa9d 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,6 +1,5 @@ # Process this file with automake to produce Makefile.in -NULL = SUBDIRS = DIST_SUBDIRS = BUILT_SOURCES = @@ -19,121 +18,23 @@ fuzzing: $(BUILT_SOURCES) libharfbuzz-fuzzing.la lib_LTLIBRARIES = libharfbuzz.la +include Makefile.sources + HBCFLAGS = HBLIBS = HBNONPCLIBS = HBDEPS = -HBSOURCES = \ - hb-atomic-private.hh \ - hb-blob.cc \ - hb-buffer-deserialize-json.hh \ - hb-buffer-deserialize-text.hh \ - hb-buffer-private.hh \ - hb-buffer-serialize.cc \ - hb-buffer.cc \ - hb-cache-private.hh \ - hb-common.cc \ - hb-face-private.hh \ - hb-face.cc \ - hb-font-private.hh \ - hb-font.cc \ - hb-mutex-private.hh \ - hb-object-private.hh \ - hb-open-file-private.hh \ - hb-open-type-private.hh \ - hb-ot-cmap-table.hh \ - hb-ot-glyf-table.hh \ - hb-ot-head-table.hh \ - hb-ot-hhea-table.hh \ - hb-ot-hmtx-table.hh \ - hb-ot-maxp-table.hh \ - hb-ot-name-table.hh \ - hb-ot-os2-table.hh \ - hb-ot-tag.cc \ - hb-private.hh \ - hb-set-private.hh \ - hb-set.cc \ - hb-shape.cc \ - hb-shape-plan-private.hh \ - hb-shape-plan.cc \ - hb-shaper-list.hh \ - hb-shaper-impl-private.hh \ - hb-shaper-private.hh \ - hb-shaper.cc \ - hb-unicode-private.hh \ - hb-unicode.cc \ - hb-utf-private.hh \ - hb-warning.cc \ - $(NULL) -HBHEADERS = \ - hb.h \ - hb-blob.h \ - hb-buffer.h \ - hb-common.h \ - hb-deprecated.h \ - hb-face.h \ - hb-font.h \ - hb-set.h \ - hb-shape.h \ - hb-shape-plan.h \ - hb-unicode.h \ - $(NULL) -HBNODISTHEADERS = \ - hb-version.h \ - $(NULL) +HBSOURCES = $(HB_BASE_sources) +HBHEADERS = $(HB_BASE_headers) +HBNODISTHEADERS = $(HB_NODIST_headers) if HAVE_OT -HBSOURCES += \ - hb-ot-font.cc \ - hb-ot-layout.cc \ - hb-ot-layout-common-private.hh \ - hb-ot-layout-gdef-table.hh \ - hb-ot-layout-gpos-table.hh \ - hb-ot-layout-gsubgpos-private.hh \ - hb-ot-layout-gsub-table.hh \ - hb-ot-layout-jstf-table.hh \ - hb-ot-layout-private.hh \ - hb-ot-map.cc \ - hb-ot-map-private.hh \ - hb-ot-shape.cc \ - hb-ot-shape-complex-arabic.cc \ - hb-ot-shape-complex-arabic-fallback.hh \ - hb-ot-shape-complex-arabic-private.hh \ - hb-ot-shape-complex-arabic-table.hh \ - hb-ot-shape-complex-arabic-win1256.hh \ - hb-ot-shape-complex-default.cc \ - hb-ot-shape-complex-hangul.cc \ - hb-ot-shape-complex-hebrew.cc \ - hb-ot-shape-complex-indic.cc \ - hb-ot-shape-complex-indic-machine.hh \ - hb-ot-shape-complex-indic-private.hh \ - hb-ot-shape-complex-indic-table.cc \ - hb-ot-shape-complex-myanmar.cc \ - hb-ot-shape-complex-myanmar-machine.hh \ - hb-ot-shape-complex-thai.cc \ - hb-ot-shape-complex-tibetan.cc \ - hb-ot-shape-complex-use.cc \ - hb-ot-shape-complex-use-machine.hh \ - hb-ot-shape-complex-use-private.hh \ - hb-ot-shape-complex-use-table.cc \ - hb-ot-shape-complex-private.hh \ - hb-ot-shape-normalize-private.hh \ - hb-ot-shape-normalize.cc \ - hb-ot-shape-fallback-private.hh \ - hb-ot-shape-fallback.cc \ - hb-ot-shape-private.hh \ - $(NULL) -HBHEADERS += \ - hb-ot.h \ - hb-ot-font.h \ - hb-ot-layout.h \ - hb-ot-shape.h \ - hb-ot-tag.h \ - $(NULL) +HBSOURCES += $(HB_OT_sources) +HBHEADERS += $(HB_OT_headers) endif if HAVE_FALLBACK -HBSOURCES += hb-fallback-shape.cc +HBSOURCES += $(HB_FALLBACK_sources) endif if HAVE_PTHREAD @@ -145,8 +46,8 @@ if HAVE_GLIB HBCFLAGS += $(GLIB_CFLAGS) HBLIBS += $(GLIB_LIBS) HBDEPS += $(GLIB_DEPS) -HBSOURCES += hb-glib.cc -HBHEADERS += hb-glib.h +HBSOURCES += $(HB_GLIB_sources) +HBHEADERS += $(HB_GLIB_headers) endif if HAVE_FREETYPE @@ -158,37 +59,37 @@ HBLIBS += $(FREETYPE_LIBS) # fine but pkg-config 0.26 as shipped in Ubuntu 14.04 crashes. Remove # in a year or two, or otherwise work around it... #HBDEPS += $(FREETYPE_DEPS) -HBSOURCES += hb-ft.cc -HBHEADERS += hb-ft.h +HBSOURCES += $(HB_FT_sources) +HBHEADERS += $(HB_FT_headers) endif if HAVE_GRAPHITE2 HBCFLAGS += $(GRAPHITE2_CFLAGS) HBLIBS += $(GRAPHITE2_LIBS) HBDEPS += $(GRAPHITE2_DEPS) -HBSOURCES += hb-graphite2.cc -HBHEADERS += hb-graphite2.h +HBSOURCES += $(HB_GRAPHITE2_sources) +HBHEADERS += $(HB_GRAPHITE2_headers) endif if HAVE_UNISCRIBE HBCFLAGS += $(UNISCRIBE_CFLAGS) HBNONPCLIBS += $(UNISCRIBE_LIBS) -HBSOURCES += hb-uniscribe.cc -HBHEADERS += hb-uniscribe.h +HBSOURCES += $(HB_UNISCRIBE_sources) +HBHEADERS += $(HB_UNISCRIBE_headers) endif if HAVE_CORETEXT HBCFLAGS += $(CORETEXT_CFLAGS) HBNONPCLIBS += $(CORETEXT_LIBS) -HBSOURCES += hb-coretext.cc -HBHEADERS += hb-coretext.h +HBSOURCES += $(HB_CORETEXT_sources) +HBHEADERS += $(HB_CORETEXT_headers) endif if HAVE_UCDN SUBDIRS += hb-ucdn HBCFLAGS += -I$(srcdir)/hb-ucdn HBLIBS += hb-ucdn/libhb-ucdn.la -HBSOURCES += hb-ucdn.cc +HBSOURCES += $(HB_UCDN_sources) endif DIST_SUBDIRS += hb-ucdn @@ -239,33 +140,33 @@ CLEANFILES += libharfbuzz-fuzzing.la if HAVE_ICU lib_LTLIBRARIES += libharfbuzz-icu.la -libharfbuzz_icu_la_SOURCES = hb-icu.cc +libharfbuzz_icu_la_SOURCES = $(HB_ICU_sources) libharfbuzz_icu_la_CPPFLAGS = $(ICU_CFLAGS) libharfbuzz_icu_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(HB_LIBTOOL_VERSION_INFO) -no-undefined libharfbuzz_icu_la_LIBADD = $(ICU_LIBS) libharfbuzz.la -pkginclude_HEADERS += hb-icu.h +pkginclude_HEADERS += $(HB_ICU_headers) pkgconfig_DATA += harfbuzz-icu.pc endif EXTRA_DIST += harfbuzz-icu.pc.in if HAVE_GOBJECT lib_LTLIBRARIES += libharfbuzz-gobject.la -libharfbuzz_gobject_la_SOURCES = hb-gobject-structs.cc -nodist_libharfbuzz_gobject_la_SOURCES = hb-gobject-enums.cc +libharfbuzz_gobject_la_SOURCES = $(HB_GOBJECT_sources) +nodist_libharfbuzz_gobject_la_SOURCES = $(HB_GOBJECT_ENUM_sources) libharfbuzz_gobject_la_CPPFLAGS = $(GOBJECT_CFLAGS) libharfbuzz_gobject_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(HB_LIBTOOL_VERSION_INFO) -no-undefined libharfbuzz_gobject_la_LIBADD = $(GOBJECT_LIBS) libharfbuzz.la -pkginclude_HEADERS += hb-gobject.h hb-gobject-structs.h -nodist_pkginclude_HEADERS += hb-gobject-enums.h +pkginclude_HEADERS += $(HB_GOBJECT_headers) +nodist_pkginclude_HEADERS += $(HB_GOBJECT_ENUM_headers) pkgconfig_DATA += harfbuzz-gobject.pc BUILT_SOURCES += \ - hb-gobject-enums.cc \ - hb-gobject-enums.h \ + $(HB_GOBJECT_ENUM_sources) \ + $(HB_GOBJECT_ENUM_headers) \ $(NULL) DISTCLEANFILES += \ - hb-gobject-enums.cc \ - hb-gobject-enums.h \ + $(HB_GOBJECT_ENUM_sources) \ + $(HB_GOBJECT_ENUM_headers) \ $(NULL) hb-gobject-enums.%: hb-gobject-enums.%.tmpl $(HBHEADERS) $(AM_V_GEN) $(GLIB_MKENUMS) \ @@ -437,10 +338,10 @@ HarfBuzz_0_0_gir_FILES = \ $(HBHEADERS) \ $(HBNODISTHEADERS) \ $(HBSOURCES) \ - hb-gobject-enums.cc \ - hb-gobject-enums.h \ - hb-gobject-structs.cc \ - hb-gobject-structs.h \ + $(HB_GOBJECT_ENUM_sources) \ + $(HB_GOBJECT_ENUM_headers) \ + $(HB_GOBJECT_sources) \ + $(HB_GOBJECT_STRUCTS_headers) \ $(NULL) girdir = $(datadir)/gir-1.0 diff --git a/src/Makefile.sources b/src/Makefile.sources new file mode 100644 index 000000000..769b69dcf --- /dev/null +++ b/src/Makefile.sources @@ -0,0 +1,147 @@ +NULL = + +# Base and default-included sources and headers + +HB_BASE_sources = \ + hb-atomic-private.hh \ + hb-blob.cc \ + hb-buffer-deserialize-json.hh \ + hb-buffer-deserialize-text.hh \ + hb-buffer-private.hh \ + hb-buffer-serialize.cc \ + hb-buffer.cc \ + hb-cache-private.hh \ + hb-common.cc \ + hb-face-private.hh \ + hb-face.cc \ + hb-font-private.hh \ + hb-font.cc \ + hb-mutex-private.hh \ + hb-object-private.hh \ + hb-open-file-private.hh \ + hb-open-type-private.hh \ + hb-ot-cmap-table.hh \ + hb-ot-glyf-table.hh \ + hb-ot-head-table.hh \ + hb-ot-hhea-table.hh \ + hb-ot-hmtx-table.hh \ + hb-ot-maxp-table.hh \ + hb-ot-name-table.hh \ + hb-ot-os2-table.hh \ + hb-ot-tag.cc \ + hb-private.hh \ + hb-set-private.hh \ + hb-set.cc \ + hb-shape.cc \ + hb-shape-plan-private.hh \ + hb-shape-plan.cc \ + hb-shaper-list.hh \ + hb-shaper-impl-private.hh \ + hb-shaper-private.hh \ + hb-shaper.cc \ + hb-unicode-private.hh \ + hb-unicode.cc \ + hb-utf-private.hh \ + hb-warning.cc \ + $(NULL) + +HB_BASE_headers = \ + hb.h \ + hb-blob.h \ + hb-buffer.h \ + hb-common.h \ + hb-deprecated.h \ + hb-face.h \ + hb-font.h \ + hb-set.h \ + hb-shape.h \ + hb-shape-plan.h \ + hb-unicode.h \ + $(NULL) + +HB_NODIST_headers = \ + hb-version.h \ + $(NULL) + +HB_FALLBACK_sources = hb-fallback-shape.cc + +HB_OT_sources = \ + hb-ot-font.cc \ + hb-ot-layout.cc \ + hb-ot-layout-common-private.hh \ + hb-ot-layout-gdef-table.hh \ + hb-ot-layout-gpos-table.hh \ + hb-ot-layout-gsubgpos-private.hh \ + hb-ot-layout-gsub-table.hh \ + hb-ot-layout-jstf-table.hh \ + hb-ot-layout-private.hh \ + hb-ot-map.cc \ + hb-ot-map-private.hh \ + hb-ot-shape.cc \ + hb-ot-shape-complex-arabic.cc \ + hb-ot-shape-complex-arabic-fallback.hh \ + hb-ot-shape-complex-arabic-private.hh \ + hb-ot-shape-complex-arabic-table.hh \ + hb-ot-shape-complex-arabic-win1256.hh \ + hb-ot-shape-complex-default.cc \ + hb-ot-shape-complex-hangul.cc \ + hb-ot-shape-complex-hebrew.cc \ + hb-ot-shape-complex-indic.cc \ + hb-ot-shape-complex-indic-machine.hh \ + hb-ot-shape-complex-indic-private.hh \ + hb-ot-shape-complex-indic-table.cc \ + hb-ot-shape-complex-myanmar.cc \ + hb-ot-shape-complex-myanmar-machine.hh \ + hb-ot-shape-complex-thai.cc \ + hb-ot-shape-complex-tibetan.cc \ + hb-ot-shape-complex-use.cc \ + hb-ot-shape-complex-use-machine.hh \ + hb-ot-shape-complex-use-private.hh \ + hb-ot-shape-complex-use-table.cc \ + hb-ot-shape-complex-private.hh \ + hb-ot-shape-normalize-private.hh \ + hb-ot-shape-normalize.cc \ + hb-ot-shape-fallback-private.hh \ + hb-ot-shape-fallback.cc \ + hb-ot-shape-private.hh \ + $(NULL) + +HB_OT_headers = \ + hb-ot.h \ + hb-ot-font.h \ + hb-ot-layout.h \ + hb-ot-shape.h \ + hb-ot-tag.h \ + $(NULL) + +# Optional Sources and Headers with external deps + +HB_FT_sources = hb-ft.cc +HB_FT_headers = hb-ft.h + +HB_GLIB_sources = hb-glib.cc +HB_GLIB_headers = hb-glib.h + +HB_GRAPHITE2_sources = hb-graphite2.cc +HB_GRAPHITE2_headers = hb-graphite2.h + +# System-dependent sources and headers + +HB_CORETEXT_sources = hb-coretext.cc +HB_CORETEXT_headers = hb-coretext.h + +HB_UNISCRIBE_sources = hb-uniscribe.cc +HB_UNISCRIBE_headers = hb-uniscribe.h + +# Additional supplemental sources +HB_UCDN_sources = hb-ucdn.cc + +# Sources for libharfbuzz-gobject and libharfbuzz-icu +HB_ICU_sources = hb-icu.cc +HB_ICU_headers = hb-icu.h + +HB_GOBJECT_sources = hb-gobject-structs.cc +HB_GOBJECT_STRUCTS_headers = hb-gobject-structs.h +HB_GOBJECT_headers = hb-gobject.h $(HB_GOBJECT_STRUCTS_headers) +HB_GOBJECT_ENUM_sources = hb-gobject-enums.cc +HB_GOBJECT_ENUM_headers = hb-gobject-enums.h diff --git a/src/hb-ucdn/Makefile.am b/src/hb-ucdn/Makefile.am index 0670b5c33..73b550254 100644 --- a/src/hb-ucdn/Makefile.am +++ b/src/hb-ucdn/Makefile.am @@ -2,11 +2,9 @@ noinst_LTLIBRARIES = libhb-ucdn.la +include Makefile.sources -libhb_ucdn_la_SOURCES = \ - ucdn.h \ - ucdn.c \ - unicodedata_db.h +libhb_ucdn_la_SOURCES = $(LIBHB_UCDN_sources) libhb_ucdn_la_CPPFLAGS = \ -I$(top_srcdir) \ -I$(top_srcdir)/src \ diff --git a/src/hb-ucdn/Makefile.sources b/src/hb-ucdn/Makefile.sources new file mode 100644 index 000000000..d5f87b282 --- /dev/null +++ b/src/hb-ucdn/Makefile.sources @@ -0,0 +1,4 @@ +LIBHB_UCDN_sources = \ + ucdn.h \ + ucdn.c \ + unicodedata_db.h diff --git a/util/Makefile.am b/util/Makefile.am index a676e0456..2543a6091 100644 --- a/util/Makefile.am +++ b/util/Makefile.am @@ -1,11 +1,12 @@ # Process this file with automake to produce Makefile.in -NULL = EXTRA_DIST = CLEANFILES = DISTCLEANFILES = MAINTAINERCLEANFILES = +include Makefile.sources + # Convenience targets: lib: @$(MAKE) $(AM_MAKEFLAGS) -C $(top_builddir)/src lib @@ -31,21 +32,7 @@ if HAVE_GLIB if HAVE_FREETYPE if HAVE_CAIRO_FT -hb_view_SOURCES = \ - hb-view.cc \ - options.cc \ - options.hh \ - main-font-text.hh \ - shape-consumer.hh \ - ansi-print.cc \ - ansi-print.hh \ - helper-cairo.cc \ - helper-cairo.hh \ - helper-cairo-ansi.cc \ - helper-cairo-ansi.hh \ - view-cairo.cc \ - view-cairo.hh \ - $(NULL) +hb_view_SOURCES = $(HB_VIEW_sources) hb_view_LDADD = \ $(LDADD) \ $(CAIRO_LIBS) \ @@ -55,22 +42,11 @@ bin_PROGRAMS += hb-view endif # HAVE_CAIRO_FT endif # HAVE_FREETYPE -hb_shape_SOURCES = \ - hb-shape.cc \ - options.cc \ - options.hh \ - main-font-text.hh \ - shape-consumer.hh \ - $(NULL) +hb_shape_SOURCES = $(HB_SHAPE_sources) bin_PROGRAMS += hb-shape if HAVE_OT -hb_ot_shape_closure_SOURCES = \ - hb-ot-shape-closure.cc \ - options.cc \ - options.hh \ - main-font-text.hh \ - $(NULL) +hb_ot_shape_closure_SOURCES = $(HB_OT_SHAPE_CLOSURE_sources) bin_PROGRAMS += hb-ot-shape-closure endif # HAVE_OT diff --git a/util/Makefile.sources b/util/Makefile.sources new file mode 100644 index 000000000..368fdb049 --- /dev/null +++ b/util/Makefile.sources @@ -0,0 +1,32 @@ +NULL = + +HB_VIEW_sources = \ + hb-view.cc \ + options.cc \ + options.hh \ + main-font-text.hh \ + shape-consumer.hh \ + ansi-print.cc \ + ansi-print.hh \ + helper-cairo.cc \ + helper-cairo.hh \ + helper-cairo-ansi.cc \ + helper-cairo-ansi.hh \ + view-cairo.cc \ + view-cairo.hh \ + $(NULL) + +HB_SHAPE_sources = \ + hb-shape.cc \ + options.cc \ + options.hh \ + main-font-text.hh \ + shape-consumer.hh \ + $(NULL) + +HB_OT_SHAPE_CLOSURE_sources = \ + hb-ot-shape-closure.cc \ + options.cc \ + options.hh \ + main-font-text.hh \ + $(NULL) From 5c3e7260bcb4999b8b7cb9afb26e6eaff867634b Mon Sep 17 00:00:00 2001 From: Chun-wei Fan Date: Tue, 3 Nov 2015 18:52:46 +0800 Subject: [PATCH 2/5] MSVC builds: Add a pre-configured config.h(.win32) template This adds a pre-configured config.h template that can be used for Visual Studio builds, where autotools is not normally available. This has the configs that are suitable for Visual Studio builds, as well as all the features used for Windows builds enabled (HAVE_OT, HAVE_FALLBACK and HAVE_UNISCRIBE). Note that the optional features are not enabled here, they are enabled by /D's (or -D's) in the NMake Makefiles as requested. --- win32/config.h.win32.in | 155 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 155 insertions(+) create mode 100644 win32/config.h.win32.in diff --git a/win32/config.h.win32.in b/win32/config.h.win32.in new file mode 100644 index 000000000..4f42b83ea --- /dev/null +++ b/win32/config.h.win32.in @@ -0,0 +1,155 @@ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* The normal alignment of `struct{char;}', in bytes. */ +#define ALIGNOF_STRUCT_CHAR__ 1 + +/* Define to 1 if you have the `atexit' function. */ +#define HAVE_ATEXIT 1 + +/* Have cairo graphics library */ +/* #undef HAVE_CAIRO */ + +/* Have cairo-ft support in cairo graphics library */ +/* #undef HAVE_CAIRO_FT */ + +/* Have Core Text backend */ +/* #undef HAVE_CORETEXT */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_DLFCN_H */ + +/* Have simple TrueType Layout backend */ +#define HAVE_FALLBACK 1 + +/* Have fontconfig library */ +/* #undef HAVE_FONTCONFIG */ + +/* Have FreeType 2 library */ +/* #undef HAVE_FREETYPE */ + +/* Define to 1 if you have the `getpagesize' function. */ +/* #undef HAVE_GETPAGESIZE */ + +/* Have glib2 library */ +/* #undef HAVE_GLIB */ + +/* Have gobject2 library */ +/* #undef HAVE_GOBJECT */ + +/* Have Graphite2 library */ +/* #undef HAVE_GRAPHITE2 */ + +/* Have ICU library */ +/* #undef HAVE_ICU */ + +/* Have Intel __sync_* atomic primitives */ +/* #undef HAVE_INTEL_ATOMIC_PRIMITIVES */ + +/* Define to 1 if you have the header file. */ +#if !defined (_MSC_VER) || (_MSC_VER >= 1800) +#define HAVE_INTTYPES_H 1 +#endif + +/* Define to 1 if you have the `isatty' function. */ +#define HAVE_ISATTY 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if you have the `mmap' function. */ +/* #undef HAVE_MMAP */ + +/* Define to 1 if you have the `mprotect' function. */ +/* #undef HAVE_MPROTECT */ + +/* Have native OpenType Layout backend */ +#define HAVE_OT 1 + +/* Have POSIX threads */ +/* #undef HAVE_PTHREAD */ + +/* Have PTHREAD_PRIO_INHERIT. */ +/* #undef HAVE_PTHREAD_PRIO_INHERIT */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SCHED_H */ + +/* Have sched_yield */ +/* #undef HAVE_SCHED_YIELD */ + +/* Have Solaris __machine_*_barrier and atomic_* operations */ +/* #undef HAVE_SOLARIS_ATOMIC_OPS */ + +/* Define to 1 if you have the header file. */ +#if !defined (_MSC_VER) || (_MSC_VER >= 1600) +#define HAVE_STDINT_H 1 +#endif + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the header file. */ +#ifndef _MSC_VER +#define HAVE_STRINGS_H 1 +#endif + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the `sysconf' function. */ +/* #undef HAVE_SYSCONF */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_MMAN_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Have UCDN Unicode functions */ +#define HAVE_UCDN 1 + +/* Have Uniscribe library */ +#define HAVE_UNISCRIBE 1 + +/* Define to 1 if you have the header file. */ +#ifndef _MSC_VER +#define HAVE_UNISTD_H 1 +#endif + +/* Define to 1 if you have the header file. */ +#define HAVE_USP10_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_WINDOWS_H 1 + +/* Define to the sub-directory in which libtool stores uninstalled libraries. + */ +#define LT_OBJDIR ".libs/" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "@PACKAGE_BUGREPORT@" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "@PACKAGE_NAME@" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "@PACKAGE_NAME@ @PACKAGE_VERSION@" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "@PACKAGE_TARNAME@" + +/* Define to the home page for this package. */ +#define PACKAGE_URL "@PACKAGE_URL@" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "@PACKAGE_VERSION@" + +/* Define to necessary symbol if this constant uses a non-standard name on + your system. */ +/* #undef PTHREAD_CREATE_JOINABLE */ + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 From d7b6636e5ebf1ddf7d7a04007ffbc411cf7e462e Mon Sep 17 00:00:00 2001 From: Chun-wei Fan Date: Tue, 3 Nov 2015 19:00:42 +0800 Subject: [PATCH 3/5] build: Support Visual Studio builds using NMake This adds a set of NMake Makefiles that can be used to build HarfBuzz, from the standard basic build building the minimal HarfBuzz DLL (consisting of OpenType, fallback and Uniscribe support only), to a full fledged build consisting of GLib and FreeType support, as well as building the utilities, the test programs in src/ and test/api, and HarfBuzz-ICU and HarfBuzz-GObject, and up to building the introspection files. This means a flexible build mechanism is supported here, so anything that is supported for a Windows build (code-wise), should all be supported by this build system. As in an earlier commit, the source listings are shared with the autotools builds with the various Makefile.sources in src/, src/hb-ucdn and util/, and this set of NMake Makefiles will transform these lists into the form they want. In the current form, all the test programs in test/api pass, and this has been checked successfully with 'make -j8 distcheck'. --- BUILD.md | 4 +- Makefile.am | 2 +- configure.ac | 2 + win32/Makefile.am | 14 +++ win32/Makefile.vc | 52 +++++++++ win32/README.txt | 75 +++++++++++++ win32/build-rules-msvc.mak | 140 ++++++++++++++++++++++++ win32/config-msvc.mak | 188 ++++++++++++++++++++++++++++++++ win32/create-lists-msvc.mak | 151 +++++++++++++++++++++++++ win32/create-lists.bat | 42 +++++++ win32/detectenv-msvc.mak | 136 +++++++++++++++++++++++ win32/generate-msvc.mak | 26 +++++ win32/hb-introspection-msvc.mak | 42 +++++++ win32/info-msvc.mak | 130 ++++++++++++++++++++++ win32/install.mak | 29 +++++ win32/introspection-msvc.mak | 73 +++++++++++++ 16 files changed, 1104 insertions(+), 2 deletions(-) create mode 100644 win32/Makefile.am create mode 100644 win32/Makefile.vc create mode 100644 win32/README.txt create mode 100644 win32/build-rules-msvc.mak create mode 100644 win32/config-msvc.mak create mode 100644 win32/create-lists-msvc.mak create mode 100644 win32/create-lists.bat create mode 100644 win32/detectenv-msvc.mak create mode 100644 win32/generate-msvc.mak create mode 100644 win32/hb-introspection-msvc.mak create mode 100644 win32/info-msvc.mak create mode 100644 win32/install.mak create mode 100644 win32/introspection-msvc.mak diff --git a/BUILD.md b/BUILD.md index e9d7d4d5d..86285c648 100644 --- a/BUILD.md +++ b/BUILD.md @@ -15,7 +15,9 @@ or using Homebrew: If you are using a tarball, you can now proceed to running configure and make as with any other standard package. That should leave you with a shared library in src/, and a few utility programs including hb-view and hb-shape -under util/. +under util/. From the tarball, NMake Makefiles are also provided in win32/, +which supports building HarfBuzz using Visual Studio, with a README.txt that +gives instructions on building using NMake. If you are bootstraping from git, you need a few more tools before you can run autogen.sh for the first time. Namely, pkg-config and ragel. Again, on Ubuntu / Debian: diff --git a/Makefile.am b/Makefile.am index 3c1e7a27c..8987d5749 100644 --- a/Makefile.am +++ b/Makefile.am @@ -4,7 +4,7 @@ NULL = ACLOCAL_AMFLAGS = -I m4 -SUBDIRS = src util test docs +SUBDIRS = src util test docs win32 EXTRA_DIST = \ autogen.sh \ diff --git a/configure.ac b/configure.ac index 764211553..d14e0fc76 100644 --- a/configure.ac +++ b/configure.ac @@ -444,6 +444,8 @@ test/fuzzing/Makefile test/shaping/Makefile docs/Makefile docs/version.xml +win32/Makefile +win32/config.h.win32 ]) AC_OUTPUT diff --git a/win32/Makefile.am b/win32/Makefile.am new file mode 100644 index 000000000..be7a477af --- /dev/null +++ b/win32/Makefile.am @@ -0,0 +1,14 @@ +EXTRA_DIST = \ + build-rules-msvc.mak \ + config-msvc.mak \ + config.h.win32 \ + create-lists.bat \ + create-lists-msvc.mak \ + detectenv-msvc.mak \ + generate-msvc.mak \ + hb-introspection-msvc.mak \ + info-msvc.mak \ + install.mak \ + introspection-msvc.mak \ + Makefile.vc \ + README.txt diff --git a/win32/Makefile.vc b/win32/Makefile.vc new file mode 100644 index 000000000..fdde7a7d4 --- /dev/null +++ b/win32/Makefile.vc @@ -0,0 +1,52 @@ +# NMake Makefile for building HarfBuzz as a DLL on Windows + +# The items below this line should not be changed, unless one is maintaining +# the NMake Makefiles. Customizations can be done in the following NMake Makefile +# portions (please see comments in the these files to see what can be customized): +# +# detectenv-msvc.mak +# config-msvc.mak + +!include detectenv-msvc.mak + +# Include the Makefile portions with the source listings +!include ..\src\Makefile.sources +!include ..\src\hb-ucdn\Makefile.sources +!include ..\util\Makefile.sources + +# Include the Makefile portion that enables features based on user input +!include config-msvc.mak + +!if "$(VALID_CFGSET)" == "TRUE" + +# Include the Makefile portion to convert the source and header lists +# into the lists we need for compilation and introspection +!include create-lists-msvc.mak + +all: $(HB_LIBS) $(HB_UTILS) $(EXTRA_TARGETS) all-build-info + +tests: all $(HB_TESTS) + +# Include the build rules for sources, DLLs and executables +!include build-rules-msvc.mak + +# Include the rules for build directory creation and code generation +!include generate-msvc.mak + +# Generate the introspection files + +!if "$(INTROSPECTION)" == "1" +# Include the rules for building the introspection files +!include introspection-msvc.mak +!include hb-introspection-msvc.mak +!endif + +!include install.mak + +!else +all: help + @echo You need to specify a valid configuration, via + @echo CFG=release or CFG=debug +!endif + +!include info-msvc.mak diff --git a/win32/README.txt b/win32/README.txt new file mode 100644 index 000000000..1cb965c3d --- /dev/null +++ b/win32/README.txt @@ -0,0 +1,75 @@ +Instructions for building HarfBuzz on Visual Studio +=================================================== +Building the HarfBuzz DLL on Windows is now also supported using Visual Studio +versions 2008 through 2015, in both 32-bit and 64-bit (x64) flavors, via NMake +Makefiles. + +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 +build configurations, the OpenType and Simple TrueType layout (fallback) +backends are enabled, as well as the Uniscribe platform shaper, and this +is the base configuration that is built if no options (see below) are +specified. A 'clean' target is provided-it is recommended that one cleans +the build and redo the build if any configuration option changed. An +'install' target is also provided to copy the built items in their appropriate +locations under $(PREFIX), which is described below. + +Invoke the build by issuing the command: +nmake /f Makefile.vc CFG=[release|debug] [PREFIX=...] +where: + +CFG: Required. Choose from a release or debug build. Note that + all builds generate a .pdb file for each .dll and .exe built--this refers + to the C/C++ runtime that the build uses. + +PREFIX: Optional. Base directory of where the third-party headers, libraries + and needed tools can be found, i.e. headers in $(PREFIX)\include, + libraries in $(PREFIX)\lib and tools in $(PREFIX)\bin. If not + specified, $(PREFIX) is set as $(srcroot)\..\vs$(X)\$(platform), where + $(platform) is win32 for 32-bit builds or x64 for 64-bit builds, and + $(X) is the short version of the Visual Studio used, as follows: + 2008: 9 + 2010: 10 + 2012: 11 + 2013: 12 + 2015: 14 + +Explanation of options, set by