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])
37 AC_ARG_WITH(freetype-config,
38 [ --with-freetype-config=PROG Use FreeType configuration program PROG],
39 freetype_config=$withval,
42 if test "$freetype_config" = "yes"; then
43 AC_PATH_PROG(ft_config,
46 if test "$ft_config" = "no"; then
47 AC_MSG_ERROR([FreeType library is missing; see http://www.freetype.org/])
50 ft_config="$freetype_config"
53 FREETYPE_CPPFLAGS="`$ft_config --cflags`"
54 FREETYPE_LIBS="`$ft_config --libtool`"
56 AC_SUBST(FREETYPE_CPPFLAGS)
57 AC_SUBST(FREETYPE_LIBS)
60 AC_MSG_CHECKING([whether FreeType header files are version 2.4.5 or higher])
61 old_CPPFLAGS="$CPPFLAGS"
62 CPPFLAGS=$FREETYPE_CPPFLAGS
63 AC_PREPROC_IFELSE([AC_LANG_SOURCE([[
66 #include FT_FREETYPE_H
67 #if (FREETYPE_MAJOR*1000 + FREETYPE_MINOR)*1000 + FREETYPE_PATCH < 2004005
68 #error Freetype version too low.
73 CPPFLAGS="$old_CPPFLAGS"],
74 [AC_MSG_ERROR([Need FreeType version 2.4.5 or higher])])
77 AC_MSG_CHECKING([whether FreeType library is version 2.4.5 or higher])
78 old_CPPFLAGS="$CPPFLAGS"
79 CPPFLAGS=$FREETYPE_CPPFLAGS
82 AC_LANG_PUSH([LTLIZED C])
83 AC_RUN_IFELSE([AC_LANG_SOURCE([[
87 #include FT_FREETYPE_H
94 FT_Int major, minor, patch;
96 error = FT_Init_FreeType(&library);
99 printf("(test program reports error code %d)... ", error);
103 FT_Library_Version(library, &major, &minor, &patch);
105 printf("(found %d.%d.%d)... ", major, minor, patch);
107 if (((major*1000 + minor)*1000 + patch) >= 2004005)
114 CPPFLAGS="$old_CPPFLAGS"
116 [AC_MSG_ERROR([Need FreeType version 2.4.5 or higher])])
120 if test $cross_compiling = no; then
121 AM_MISSING_PROG(HELP2MAN, help2man)
127 AC_CONFIG_HEADERS([config.h])
128 AC_CONFIG_FILES([Makefile
134 # end of configure.ac