4 [https://github.com/harfbuzz/harfbuzz/issues/new],
6 [http://harfbuzz.org/])
8 AC_CONFIG_MACRO_DIR([m4])
9 AC_CONFIG_SRCDIR([src/harfbuzz.pc.in])
10 AC_CONFIG_HEADERS([config.h])
12 AM_INIT_AUTOMAKE([1.13.0 gnits tar-ustar dist-xz no-dist-gzip -Wall no-define color-tests -Wno-portability])
13 AM_SILENT_RULES([yes])
17 m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
19 LT_INIT([disable-static])
26 AX_CXX_COMPILE_STDCXX(11)
28 PKG_PROG_PKG_CONFIG([0.28])
29 AM_MISSING_PROG([RAGEL], [ragel])
30 AM_MISSING_PROG([GIT], [git])
33 m4_define(hb_version_triplet,m4_split(AC_PACKAGE_VERSION,[[.]]))
34 m4_define(hb_version_major,m4_argn(1,hb_version_triplet))
35 m4_define(hb_version_minor,m4_argn(2,hb_version_triplet))
36 m4_define(hb_version_micro,m4_argn(3,hb_version_triplet))
37 HB_VERSION_MAJOR=hb_version_major
38 HB_VERSION_MINOR=hb_version_minor
39 HB_VERSION_MICRO=hb_version_micro
40 HB_VERSION=AC_PACKAGE_VERSION
41 AC_SUBST(HB_VERSION_MAJOR)
42 AC_SUBST(HB_VERSION_MINOR)
43 AC_SUBST(HB_VERSION_MICRO)
47 m4_define([hb_version_int],
48 m4_eval(hb_version_major*10000 + hb_version_minor*100 + hb_version_micro))
49 HB_LIBTOOL_VERSION_INFO=hb_version_int:0:hb_version_int
50 AC_SUBST(HB_LIBTOOL_VERSION_INFO)
52 AC_ARG_WITH([libstdc++],
53 [AS_HELP_STRING([--with-libstdc++=@<:@yes/no@:>@],
54 [Allow linking with libstdc++ @<:@default=no@:>@])],
55 [with_libstdcxx=$withval],
57 AM_CONDITIONAL(WITH_LIBSTDCXX, [test "x$with_libstdcxx" = "xyes"])
61 m4_ifdef([GTK_DOC_CHECK], [
62 GTK_DOC_CHECK([1.15],[--flavour no-tmpl])
63 if test "x$enable_gtk_doc" = xyes; then
67 AM_CONDITIONAL([ENABLE_GTK_DOC], false)
70 # Functions and headers
71 AC_CHECK_FUNCS(atexit mprotect sysconf getpagesize mmap isatty newlocale uselocale)
72 AC_CHECK_HEADERS(unistd.h sys/mman.h stdbool.h xlocale.h)
76 AC_CHECK_ALIGNOF([struct{char;}])
77 if test "x$GCC" = "xyes"; then
79 # Make symbols link locally
80 AX_CHECK_LINK_FLAG([[-Bsymbolic-functions]], [LDFLAGS="$LDFLAGS -Bsymbolic-functions"])
82 # Make it possible to not link to libstdc++
83 # No threadsafe statics in C++ as we do it ourselves.
84 # We don't use these features, so it's safe to disable them
85 # even in the cases where we DO link to libstdc++.
86 # Put -fno-rtti before $CXXFLAGS such that users can re-enable it
87 # by overriding CXXFLAGS.
88 CXXFLAGS="-fno-rtti $CXXFLAGS -fno-exceptions -fno-threadsafe-statics"
95 CXXFLAGS="$CXXFLAGS -fvisibility-inlines-hidden"
101 if test "x$ac_cv_alignof_struct_char__" != x1; then
102 # Request byte alignment
103 CXXFLAGS="$CXXFLAGS -mstructure-size-boundary=8"
109 AM_CONDITIONAL(HAVE_GCC, test "x$GCC" = "xyes")
112 AC_MSG_CHECKING([for native Win32])
118 AC_MSG_RESULT([$hb_os_win32])
119 AM_CONDITIONAL(OS_WIN32, test "$hb_os_win32" = "yes")
122 AX_PTHREAD([have_pthread=true])
123 if $have_pthread; then
124 AC_DEFINE(HAVE_PTHREAD, 1, [Have POSIX threads])
126 AM_CONDITIONAL(HAVE_PTHREAD, $have_pthread)
128 dnl ==========================================================================
131 [AS_HELP_STRING([--with-glib=@<:@yes/no/auto@:>@],
132 [Use glib @<:@default=auto@:>@])],,
135 GLIB_DEPS="glib-2.0 >= 2.19.1"
137 if test "x$with_glib" = "xyes" -o "x$with_glib" = "xauto"; then
138 PKG_CHECK_MODULES(GLIB, $GLIB_DEPS, have_glib=true, :)
140 if test "x$with_glib" = "xyes" -a "x$have_glib" != "xtrue"; then
141 AC_MSG_ERROR([glib support requested but glib-2.0 not found])
144 AC_DEFINE(HAVE_GLIB, 1, [Have glib2 library])
146 AM_CONDITIONAL(HAVE_GLIB, $have_glib)
148 dnl ===========================================================================
151 [AS_HELP_STRING([--with-gobject=@<:@yes/no/auto@:>@],
152 [Use gobject @<:@default=no@:>@])],,
155 if test "x$with_gobject" = "xyes" -o "x$with_gobject" = "xauto"; then
156 PKG_CHECK_MODULES(GOBJECT, gobject-2.0 glib-2.0, have_gobject=true, :)
158 if test "x$with_gobject" = "xyes" -a "x$have_gobject" != "xtrue"; then
159 AC_MSG_ERROR([gobject support requested but gobject-2.0 / glib-2.0 not found])
161 if $have_gobject; then
162 AC_DEFINE(HAVE_GOBJECT, 1, [Have gobject2 library])
163 GLIB_MKENUMS=`$PKG_CONFIG --variable=glib_mkenums glib-2.0`
164 AC_SUBST(GLIB_MKENUMS)
166 AM_CONDITIONAL(HAVE_GOBJECT, $have_gobject)
167 AC_SUBST(have_gobject)
169 dnl ===========================================================================
172 dnl ===========================================================================
173 # Gobject-Introspection
174 have_introspection=false
175 m4_ifdef([GOBJECT_INTROSPECTION_CHECK], [
176 if $have_gobject; then
177 GOBJECT_INTROSPECTION_CHECK([1.34.0])
178 if test "x$found_introspection" = xyes; then
179 have_introspection=true
182 AM_CONDITIONAL([HAVE_INTROSPECTION], false)
185 AM_CONDITIONAL([HAVE_INTROSPECTION], false)
188 dnl ==========================================================================
191 [AS_HELP_STRING([--with-cairo=@<:@yes/no/auto@:>@],
192 [Use cairo @<:@default=auto@:>@])],,
195 if test "x$with_cairo" = "xyes" -o "x$with_cairo" = "xauto"; then
196 PKG_CHECK_MODULES(CAIRO, cairo >= 1.8.0, have_cairo=true, :)
198 LIBS="$LIBS $CAIRO_LIBS"
199 AC_CHECK_FUNCS(cairo_user_font_face_set_render_color_glyph_func)
202 if test "x$with_cairo" = "xyes" -a "x$have_cairo" != "xtrue"; then
203 AC_MSG_ERROR([cairo support requested but not found])
206 AC_DEFINE(HAVE_CAIRO, 1, [Have cairo graphics library])
208 AM_CONDITIONAL(HAVE_CAIRO, $have_cairo)
212 PKG_CHECK_MODULES(CAIRO_FT, cairo-ft, have_cairo_ft=true, :)
214 if $have_cairo_ft; then
215 AC_DEFINE(HAVE_CAIRO_FT, 1, [Have cairo-ft support in cairo graphics library])
217 AM_CONDITIONAL(HAVE_CAIRO_FT, $have_cairo_ft)
219 dnl ==========================================================================
222 [AS_HELP_STRING([--with-chafa=@<:@yes/no/auto@:>@],
223 [Use chafa @<:@default=auto@:>@])],,
226 if test "x$with_chafa" = "xyes" -o "x$with_chafa" = "xauto"; then
227 PKG_CHECK_MODULES(CHAFA, chafa >= 1.6.0, have_chafa=true, :)
229 if test "x$with_chafa" = "xyes" -a "x$have_chafa" != "xtrue"; then
230 AC_MSG_ERROR([chafa support requested but not found])
233 AC_DEFINE(HAVE_CHAFA, 1, [Have chafa terminal graphics library])
235 AM_CONDITIONAL(HAVE_CHAFA, $have_chafa)
237 dnl ==========================================================================
240 [AS_HELP_STRING([--with-icu=@<:@yes/no/builtin/auto@:>@],
241 [Use ICU @<:@default=auto@:>@])],,
244 if test "x$with_icu" = "xyes" -o "x$with_icu" = "xbuiltin" -o "x$with_icu" = "xauto"; then
245 PKG_CHECK_MODULES(ICU, icu-uc, have_icu=true, :)
247 if test \( "x$with_icu" = "xyes" -o "x$with_icu" = "xbuiltin" \) -a "x$have_icu" != "xtrue"; then
248 AC_MSG_ERROR([icu support requested but icu-uc not found])
252 CXXFLAGS="$CXXFLAGS `$PKG_CONFIG --variable=CXXFLAGS icu-uc`"
253 AC_DEFINE(HAVE_ICU, 1, [Have ICU library])
254 if test "x$with_icu" = "xbuiltin"; then
255 AC_DEFINE(HAVE_ICU_BUILTIN, 1, [Use hb-icu Unicode callbacks])
258 AM_CONDITIONAL(HAVE_ICU, $have_icu)
259 AM_CONDITIONAL(HAVE_ICU_BUILTIN, $have_icu && test "x$with_icu" = "xbuiltin")
261 dnl ===========================================================================
263 AC_ARG_WITH(graphite2,
264 [AS_HELP_STRING([--with-graphite2=@<:@yes/no/auto@:>@],
265 [Use the graphite2 library @<:@default=no@:>@])],,
268 GRAPHITE2_DEPS="graphite2 >= 1.2.0"
269 AC_SUBST(GRAPHITE2_DEPS)
270 if test "x$with_graphite2" = "xyes" -o "x$with_graphite2" = "xauto"; then
271 PKG_CHECK_MODULES(GRAPHITE2, $GRAPHITE2_DEPS, have_graphite2=true, :)
272 if test "x$have_graphite2" != "xtrue"; then
273 # If pkg-config is not available, graphite2 can still be there
274 ac_save_CFLAGS="$CFLAGS"
275 ac_save_CPPFLAGS="$CPPFLAGS"
276 CFLAGS="$CFLAGS $GRAPHITE2_CFLAGS"
277 CPPFLAGS="$CPPFLAGS $GRAPHITE2_CFLAGS"
278 AC_CHECK_HEADER(graphite2/Segment.h, have_graphite2=true, :)
279 CPPFLAGS="$ac_save_CPPFLAGS"
280 CFLAGS="$ac_save_CFLAGS"
283 if test "x$with_graphite2" = "xyes" -a "x$have_graphite2" != "xtrue"; then
284 AC_MSG_ERROR([graphite2 support requested but libgraphite2 not found])
286 if $have_graphite2; then
287 AC_DEFINE(HAVE_GRAPHITE2, 1, [Have Graphite2 library])
289 AM_CONDITIONAL(HAVE_GRAPHITE2, $have_graphite2)
291 dnl ==========================================================================
293 AC_ARG_WITH(freetype,
294 [AS_HELP_STRING([--with-freetype=@<:@yes/no/auto@:>@],
295 [Use the FreeType library @<:@default=auto@:>@])],,
296 [with_freetype=auto])
298 FREETYPE_DEPS="freetype2 >= 12.0.6"
299 AC_SUBST(FREETYPE_DEPS)
300 if test "x$with_freetype" = "xyes" -o "x$with_freetype" = "xauto"; then
301 # See freetype/docs/VERSION.DLL; 12.0.6 means freetype-2.4.2
302 PKG_CHECK_MODULES(FREETYPE, $FREETYPE_DEPS, have_freetype=true, :)
304 if test "x$with_freetype" = "xyes" -a "x$have_freetype" != "xtrue"; then
305 AC_MSG_ERROR([FreeType support requested but libfreetype2 not found])
307 if $have_freetype; then
308 AC_DEFINE(HAVE_FREETYPE, 1, [Have FreeType 2 library])
310 LIBS="$LIBS $FREETYPE_LIBS"
311 AC_CHECK_FUNCS(FT_Get_Var_Blend_Coordinates FT_Set_Var_Blend_Coordinates FT_Done_MM_Var)
314 AM_CONDITIONAL(HAVE_FREETYPE, $have_freetype)
316 dnl ===========================================================================
318 AC_ARG_WITH(uniscribe,
319 [AS_HELP_STRING([--with-uniscribe=@<:@yes/no/auto@:>@],
320 [Use the Uniscribe library @<:@default=no@:>@])],,
323 if test "x$with_uniscribe" = "xyes" -o "x$with_uniscribe" = "xauto"; then
324 AC_CHECK_HEADERS(usp10.h windows.h, have_uniscribe=true)
326 if test "x$with_uniscribe" = "xyes" -a "x$have_uniscribe" != "xtrue"; then
327 AC_MSG_ERROR([uniscribe support requested but not found])
329 if $have_uniscribe; then
331 UNISCRIBE_LIBS="-lusp10 -lgdi32 -lrpcrt4"
332 AC_SUBST(UNISCRIBE_CFLAGS)
333 AC_SUBST(UNISCRIBE_LIBS)
334 AC_DEFINE(HAVE_UNISCRIBE, 1, [Have Uniscribe library])
336 AM_CONDITIONAL(HAVE_UNISCRIBE, $have_uniscribe)
338 dnl ===========================================================================
341 [AS_HELP_STRING([--with-gdi=@<:@yes/no/auto@:>@],
342 [Provide GDI integration helpers @<:@default=no@:>@])],,
345 if test "x$with_gdi" = "xyes" -o "x$with_gdi" = "xauto"; then
346 AC_CHECK_HEADERS(windows.h, have_gdi=true)
348 if test "x$with_gdi" = "xyes" -a "x$have_gdi" != "xtrue"; then
349 AC_MSG_ERROR([gdi support requested but not found])
356 AC_DEFINE(HAVE_GDI, 1, [Have GDI library])
358 AM_CONDITIONAL(HAVE_GDI, $have_gdi)
360 dnl ===========================================================================
362 AC_ARG_WITH(directwrite,
363 [AS_HELP_STRING([--with-directwrite=@<:@yes/no/auto@:>@],
364 [Use the DirectWrite library (experimental) @<:@default=no@:>@])],,
365 [with_directwrite=no])
366 have_directwrite=false
368 if test "x$with_directwrite" = "xyes" -o "x$with_directwrite" = "xauto"; then
369 AC_CHECK_HEADERS(dwrite.h, have_directwrite=true)
372 if test "x$with_directwrite" = "xyes" -a "x$have_directwrite" != "xtrue"; then
373 AC_MSG_ERROR([directwrite support requested but not found])
375 if $have_directwrite; then
376 DIRECTWRITE_CXXFLAGS=
378 AC_SUBST(DIRECTWRITE_CXXFLAGS)
379 AC_SUBST(DIRECTWRITE_LIBS)
380 AC_DEFINE(HAVE_DIRECTWRITE, 1, [Have DirectWrite library])
382 AM_CONDITIONAL(HAVE_DIRECTWRITE, $have_directwrite)
384 dnl ===========================================================================
386 AC_ARG_WITH(coretext,
387 [AS_HELP_STRING([--with-coretext=@<:@yes/no/auto@:>@],
388 [Use CoreText @<:@default=no@:>@])],,
391 if test "x$with_coretext" = "xyes" -o "x$with_coretext" = "xauto"; then
392 AC_CHECK_TYPE(CTFontRef, have_coretext=true,, [#include <ApplicationServices/ApplicationServices.h>])
394 if $have_coretext; then
396 CORETEXT_LIBS="-framework ApplicationServices"
397 AC_SUBST(CORETEXT_CFLAGS)
398 AC_SUBST(CORETEXT_LIBS)
400 # On iOS CoreText and CoreGraphics are stand-alone frameworks
401 if test "x$have_coretext" != "xtrue"; then
402 # Check for a different symbol to avoid getting cached result.
403 AC_CHECK_TYPE(CTRunRef, have_coretext=true,, [#include <CoreText/CoreText.h>])
406 if $have_coretext; then
408 CORETEXT_LIBS="-framework CoreText -framework CoreGraphics -framework CoreFoundation"
409 AC_SUBST(CORETEXT_CFLAGS)
410 AC_SUBST(CORETEXT_LIBS)
414 if test "x$with_coretext" = "xyes" -a "x$have_coretext" != "xtrue"; then
415 AC_MSG_ERROR([CoreText support requested but libcoretext not found])
417 if $have_coretext; then
418 AC_DEFINE(HAVE_CORETEXT, 1, [Have Core Text backend])
420 AM_CONDITIONAL(HAVE_CORETEXT, $have_coretext)
422 dnl ===========================================================================
427 src/harfbuzz-config.cmake
431 test/fuzzing/Makefile
433 test/shape/data/Makefile
434 test/shape/data/aots/Makefile
435 test/shape/data/in-house/Makefile
436 test/shape/data/text-rendering-tests/Makefile
438 test/subset/data/Makefile
439 test/subset/data/repack_tests/Makefile
447 echo "C++ compiler version:"
453 Autotools is no longer our supported build system for building the library
454 for *nix distributions, please migrate to meson.
463 Unicode callbacks (you want at least one):
468 Font callbacks (the more the merrier):
469 FreeType: ${have_freetype}
471 Tools used for command-line utilities:
476 Graphite2: ${have_graphite2}
478 Platform shapers (not normally needed):
479 CoreText: ${have_coretext}
480 DirectWrite: ${have_directwrite}
482 Uniscribe: ${have_uniscribe}
485 Documentation: ${enable_gtk_doc}
486 GObject bindings: ${have_gobject}
487 Introspection: ${have_introspection}