3 # Copyright (C) 2011 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 AM_INIT_AUTOMAKE([-Wall -Werror gnits])
17 AC_CONFIG_MACRO_DIR([m4])
18 AM_SILENT_RULES([yes])
26 AC_ARG_WITH(freetype-config,
27 [ --with-freetype-config=PROG Use FreeType configuration program PROG],
28 freetype_config=$withval,
31 if test "$freetype_config" = "yes"; then
32 AC_PATH_PROG(ft_config,
35 if test "$ft_config" = "no"; then
36 AC_MSG_ERROR([FreeType library is missing; see http://www.freetype.org/])
39 ft_config="$freetype_config"
42 FREETYPE_CPPFLAGS="`$ft_config --cflags`"
43 FREETYPE_LDFLAGS="`$ft_config --libtool`"
45 AC_SUBST(FREETYPE_CPPFLAGS)
46 AC_SUBST(FREETYPE_LDFLAGS)
49 AC_MSG_CHECKING([whether FreeType header files are version 2.4.5 or higher])
50 old_CPPFLAGS="$CPPFLAGS"
51 CPPFLAGS=$FREETYPE_CPPFLAGS
52 AC_PREPROC_IFELSE([AC_LANG_SOURCE([[
55 #include FT_FREETYPE_H
56 #if (FREETYPE_MAJOR*1000 + FREETYPE_MINOR)*1000 + FREETYPE_PATCH < 2004005
57 #error Freetype version too low.
62 CPPFLAGS="$old_CPPFLAGS"],
63 [AC_MSG_ERROR([Need FreeType version 2.4.5 or higher])])
66 AC_MSG_CHECKING([whether FreeType library is version 2.4.5 or higher])
67 old_CPPFLAGS="$CPPFLAGS"
68 CPPFLAGS=$FREETYPE_CPPFLAGS
70 LIBS=$FREETYPE_LDFLAGS
71 AC_LANG_PUSH([LTLIZED C])
72 AC_RUN_IFELSE([AC_LANG_SOURCE([[
76 #include FT_FREETYPE_H
83 FT_Int major, minor, patch;
85 error = FT_Init_FreeType(&library);
88 printf("(test program reports error code %d)... ", error);
92 FT_Library_Version(library, &major, &minor, &patch);
94 printf("(found %d.%d.%d)... ", major, minor, patch);
96 if (((major*1000 + minor)*1000 + patch) >= 2004005)
103 CPPFLAGS="$old_CPPFLAGS"
105 [AC_MSG_ERROR([Need FreeType version 2.4.5 or higher])])
109 AC_CONFIG_HEADERS([config.h])
110 AC_CONFIG_FILES([Makefile
114 # end of configure.ac