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])
30 AC_ARG_WITH(freetype-config,
31 [ --with-freetype-config=PROG Use FreeType configuration program PROG],
32 freetype_config=$withval,
35 if test "$freetype_config" = "yes"; then
36 AC_PATH_PROG(ft_config,
39 if test "$ft_config" = "no"; then
40 AC_MSG_ERROR([FreeType library is missing; see http://www.freetype.org/])
43 ft_config="$freetype_config"
46 FREETYPE_CPPFLAGS="`$ft_config --cflags`"
47 FREETYPE_LDFLAGS="`$ft_config --libtool`"
49 AC_SUBST(FREETYPE_CPPFLAGS)
50 AC_SUBST(FREETYPE_LDFLAGS)
53 AC_MSG_CHECKING([whether FreeType header files are version 2.4.5 or higher])
54 old_CPPFLAGS="$CPPFLAGS"
55 CPPFLAGS=$FREETYPE_CPPFLAGS
56 AC_PREPROC_IFELSE([AC_LANG_SOURCE([[
59 #include FT_FREETYPE_H
60 #if (FREETYPE_MAJOR*1000 + FREETYPE_MINOR)*1000 + FREETYPE_PATCH < 2004005
61 #error Freetype version too low.
66 CPPFLAGS="$old_CPPFLAGS"],
67 [AC_MSG_ERROR([Need FreeType version 2.4.5 or higher])])
70 AC_MSG_CHECKING([whether FreeType library is version 2.4.5 or higher])
71 old_CPPFLAGS="$CPPFLAGS"
72 CPPFLAGS=$FREETYPE_CPPFLAGS
74 LIBS=$FREETYPE_LDFLAGS
75 AC_LANG_PUSH([LTLIZED C])
76 AC_RUN_IFELSE([AC_LANG_SOURCE([[
80 #include FT_FREETYPE_H
87 FT_Int major, minor, patch;
89 error = FT_Init_FreeType(&library);
92 printf("(test program reports error code %d)... ", error);
96 FT_Library_Version(library, &major, &minor, &patch);
98 printf("(found %d.%d.%d)... ", major, minor, patch);
100 if (((major*1000 + minor)*1000 + patch) >= 2004005)
107 CPPFLAGS="$old_CPPFLAGS"
109 [AC_MSG_ERROR([Need FreeType version 2.4.5 or higher])])
113 if test $cross_compiling = no; then
114 AM_MISSING_PROG(HELP2MAN, help2man)
120 AC_CONFIG_HEADERS([config.h])
121 AC_CONFIG_FILES([Makefile
125 # end of configure.ac