Version 0.4.
[ttfautohint.git] / configure.ac
blobf9ff94a7ef10df3d282fbd0bcc28f484bcc99158
1 # configure.ac
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],
14         [0.4],
15         [freetype-devel@nongnu.org])
16 AM_INIT_AUTOMAKE([-Wall -Werror gnits])
18 AM_SILENT_RULES([yes])
20 AC_PROG_CC
21 AC_PROG_CPP
23 LT_INIT
25 AC_ARG_WITH(freetype-config,
26             [  --with-freetype-config=PROG   Use FreeType configuration program PROG],
27             freetype_config=$withval,
28             freetype_config=yes)
30 if test "$freetype_config" = "yes"; then 
31   AC_PATH_PROG(ft_config,
32                freetype-config,
33                no)
34   if test "$ft_config" = "no"; then
35     AC_MSG_ERROR([FreeType library is missing; see http://www.freetype.org/])
36   fi
37 else
38   ft_config="$freetype_config"
41 FREETYPE_CPPFLAGS="`$ft_config --cflags`"
42 FREETYPE_LDFLAGS="`$ft_config --libtool`"
44 AC_SUBST(FREETYPE_CPPFLAGS)
45 AC_SUBST(FREETYPE_LDFLAGS)
48 AC_MSG_CHECKING([whether FreeType version is 2.4.5 or higher])
49 old_CPPFLAGS="$CPPFLAGS"
50 CPPFLAGS=$FREETYPE_CPPFLAGS
51 AC_TRY_CPP([
53 #include <ft2build.h>
54 #include FT_FREETYPE_H
55 #if (FREETYPE_MAJOR*1000 + FREETYPE_MINOR)*1000 + FREETYPE_PATCH < 2004005
56 #error Freetype version too low.
57 #endif
60 [AC_MSG_RESULT(yes)
61  CPPFLAGS="$old_CPPFLAGS"],
62 [AC_MSG_ERROR([Need FreeType library version 2.4.5 or higher])])
65 AC_CONFIG_HEADERS([config.h])
66 AC_CONFIG_FILES([Makefile
67                  src/Makefile])
68 AC_OUTPUT
70 # end of configure.ac