3 # Copyright (C) 2011-2012 by Werner Lemberg.
5 # This file is part of the ttfautohint library, and may only be used,
6 # modified, and distributed under the terms given in `COPYING'. By
7 # continuing to use, modify, or distribute this file you indicate that you
8 # have read `COPYING' and understand and accept it fully.
10 # The file `COPYING' mentioned in the previous paragraph is distributed
11 # with the ttfautohint library.
13 AC_INIT([ttfautohint],
15 [freetype-devel@nongnu.org])
16 AC_CONFIG_AUX_DIR([gnulib])
17 AM_INIT_AUTOMAKE([-Wall -Werror gnits])
18 AC_CONFIG_MACRO_DIR([gnulib/m4
20 AM_SILENT_RULES([yes])
32 AT_REQUIRE_QT_VERSION([4.6])
34 if test x"$with_qt" != x"no"; then
35 AC_MSG_CHECKING([for QLocale::quoteString])
36 AS_VERSION_COMPARE([$QT_VERSION], [4.8],
40 AC_DEFINE([HAVE_QT_QUOTESTRING], [1],
41 [Define if Qt function QLocale::quoteString is available.])])
44 AM_CONDITIONAL([USE_QT], [test x"$with_qt" != x"no"])
50 AC_ARG_WITH(freetype-config,
51 [ --with-freetype-config=PROG Use FreeType configuration program PROG],
52 freetype_config=$withval,
55 if test "$freetype_config" = "yes"; then
56 AC_PATH_PROG(ft_config,
59 if test "$ft_config" = "no"; then
60 AC_MSG_ERROR([FreeType library is missing; see http://www.freetype.org/])
63 ft_config="$freetype_config"
66 FREETYPE_CPPFLAGS="`$ft_config --cflags`"
67 FREETYPE_LIBS="`$ft_config --libtool`"
69 AC_SUBST(FREETYPE_CPPFLAGS)
70 AC_SUBST(FREETYPE_LIBS)
73 AC_MSG_CHECKING([whether FreeType header files are version 2.4.5 or higher])
74 old_CPPFLAGS="$CPPFLAGS"
75 CPPFLAGS=$FREETYPE_CPPFLAGS
76 AC_PREPROC_IFELSE([AC_LANG_SOURCE([[
79 #include FT_FREETYPE_H
80 #if (FREETYPE_MAJOR*1000 + FREETYPE_MINOR)*1000 + FREETYPE_PATCH < 2004005
81 #error Freetype version too low.
86 CPPFLAGS="$old_CPPFLAGS"],
87 [AC_MSG_ERROR([Need FreeType version 2.4.5 or higher])])
90 AC_MSG_CHECKING([whether FreeType library is version 2.4.5 or higher])
91 old_CPPFLAGS="$CPPFLAGS"
92 CPPFLAGS=$FREETYPE_CPPFLAGS
95 AC_LANG_PUSH([LTLIZED C])
96 AC_RUN_IFELSE([AC_LANG_SOURCE([[
100 #include FT_FREETYPE_H
107 FT_Int major, minor, patch;
109 error = FT_Init_FreeType(&library);
112 printf("(test program reports error code %d)... ", error);
116 FT_Library_Version(library, &major, &minor, &patch);
118 printf("(found %d.%d.%d)... ", major, minor, patch);
120 if (((major*1000 + minor)*1000 + patch) >= 2004005)
127 CPPFLAGS="$old_CPPFLAGS"
129 [AC_MSG_ERROR([Need FreeType version 2.4.5 or higher])])
133 if test $cross_compiling = no; then
134 AM_MISSING_PROG(HELP2MAN, help2man)
140 AC_CONFIG_HEADERS([config.h])
141 AC_CONFIG_FILES([Makefile
147 # end of configure.ac