File: configure.ac

package info (click to toggle)
ttfautohint 1.6-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 8,504 kB
  • ctags: 4,347
  • sloc: ansic: 38,386; sh: 5,749; cpp: 4,131; perl: 340; makefile: 309; sed: 39
file content (254 lines) | stat: -rw-r--r-- 6,644 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
# configure.ac

# Copyright (C) 2011-2016 by Werner Lemberg.
#
# This file is part of the ttfautohint library, and may only be used,
# modified, and distributed under the terms given in `COPYING'.  By
# continuing to use, modify, or distribute this file you indicate that you
# have read `COPYING' and understand and accept it fully.
#
# The file `COPYING' mentioned in the previous paragraph is distributed
# with the ttfautohint library.

AC_INIT([ttfautohint],
        m4_esyscmd([gnulib/git-version-gen VERSION]),
        [freetype-devel@nongnu.org])
AC_CONFIG_AUX_DIR([gnulib])

AM_INIT_AUTOMAKE([-Wall -Werror tar-ustar]
                 m4_bmatch(m4_defn([AC_PACKAGE_VERSION]),
                           [-], [gnu],
                           [gnits]))

AC_CONFIG_MACRO_DIRS([gnulib/m4
                      m4])

AM_SILENT_RULES([no])

AC_USE_SYSTEM_EXTENSIONS

AC_PROG_LN_S

AC_PROG_CPP
AC_PROG_CC
AC_PROG_CC_C99
AC_PROG_CXX
AX_CXX_COMPILE_STDCXX([11])
AC_C_INLINE

gl_EARLY

PKG_PROG_PKG_CONFIG([0.24])

# AM_PROG_AR is new in automake 1.11.2;
# however, MinGW doesn't have it yet (May 2012)
m4_ifdef([AM_PROG_AR], [AM_PROG_AR])

AC_PATH_PROG([BISON], [bison])
AC_PATH_PROG([FLEX], [flex])

gl_INIT

PKG_CHECK_MODULES([HARFBUZZ], [harfbuzz >= 0.9.19])

AT_WITH_QT
AT_REQUIRE_QT_VERSION([4.6])

if test x"$with_qt" != x"no"; then
  AC_MSG_CHECKING([for QLocale::quoteString])
  AS_VERSION_COMPARE([$QT_VERSION], [4.8],
    [AC_MSG_RESULT(no)],
    [AC_MSG_RESULT(no)],
    [AC_MSG_RESULT(yes)
     AC_DEFINE([HAVE_QT_QUOTESTRING], [1],
       [Define if Qt function QLocale::quoteString is available.])])
fi

AM_CONDITIONAL([USE_QT], [test x"$with_qt" != x"no"])

LT_INIT
LT_LTLIZE_LANG([C])


# We use libtool's convenient check for the math library.
LT_LIB_M
AC_SUBST(LIBM)


AC_ARG_WITH([doc],
            [AS_HELP_STRING([--with-doc],
                            [install documentation @<:@default=yes@:>@])],
            [],
            [with_doc=yes])

AC_ARG_WITH([freetype-config],
            [AS_HELP_STRING([--with-freetype-config=PROG],
                            [use FreeType configuration program PROG])],
            [freetype_config=$withval],
            [freetype_config=yes])

if test "$freetype_config" = "yes"; then
  AC_PATH_TOOL(ft_config,
               freetype-config,
               no)
  if test "$ft_config" = "no"; then
    AC_MSG_ERROR([FreeType library is missing; see http://www.freetype.org/])
  fi
else
  ft_config="$freetype_config"
fi

FREETYPE_CPPFLAGS="`$ft_config --cflags`"
FREETYPE_LIBS="`$ft_config --libtool`"

# many platforms no longer install .la files for system libraries
if test ! -f "$FREETYPE_LIBS"; then
  FREETYPE_LIBS="`$ft_config --libs`"
fi

AC_SUBST(FREETYPE_CPPFLAGS)
AC_SUBST(FREETYPE_LIBS)


AC_MSG_CHECKING([whether FreeType header files are version 2.4.5 or higher])
old_CPPFLAGS="$CPPFLAGS"
CPPFLAGS=$FREETYPE_CPPFLAGS
AC_PREPROC_IFELSE([AC_LANG_SOURCE([[

#include <ft2build.h>
#include FT_FREETYPE_H
#if (FREETYPE_MAJOR*1000 + FREETYPE_MINOR)*1000 + FREETYPE_PATCH < 2004005
#error Freetype version too low.
#endif

]])],
[AC_MSG_RESULT(yes)
 CPPFLAGS="$old_CPPFLAGS"],
[AC_MSG_ERROR([Need FreeType version 2.4.5 or higher])])


AC_MSG_CHECKING([whether FreeType library is version 2.4.5 or higher])
old_CPPFLAGS="$CPPFLAGS"
CPPFLAGS=$FREETYPE_CPPFLAGS
old_LIBS="$LIBS"
LIBS=$FREETYPE_LIBS
AC_LANG_PUSH([LTLIZED C])
AC_RUN_IFELSE([AC_LANG_SOURCE([[

#include <stdlib.h>
#include <ft2build.h>
#include FT_FREETYPE_H

int
main()
{
  FT_Error error;
  FT_Library library;
  FT_Int major, minor, patch;

  error = FT_Init_FreeType(&library);
  if (error)
  {
    printf("(test program reports error code %d)... ", error);
    exit(EXIT_FAILURE);
  }

  FT_Library_Version(library, &major, &minor, &patch);

  printf("(found %d.%d.%d)... ", major, minor, patch);

  if (((major*1000 + minor)*1000 + patch) >= 2004005)
    exit(EXIT_SUCCESS);
  exit(EXIT_FAILURE);
}

]])],
[AC_MSG_RESULT(yes)
 CPPFLAGS="$old_CPPFLAGS"
 LIBS="$old_LIBS"],
[AC_MSG_ERROR([Need FreeType version 2.4.5 or higher])],
[AC_MSG_RESULT([skipped due to cross-compilation])])
AC_LANG_POP


if test $cross_compiling = no; then
  AM_MISSING_PROG(HELP2MAN, help2man)
else
  HELP2MAN=:
fi

# The documentation is part of the distributed bundle.  In the following,
# tests for the documentation building tools are made fatal in case those
# files are missing (which can happen during bootstrap).

AC_DEFUN([TA_DOC],
  [if test -f "$1"; then
     AC_MSG_WARN([$2])
     with_doc=no
   else
     AC_MSG_ERROR([$2])
   fi])

image_file=$srcdir/doc/img/ttfautohintGUI.png
html_file=$srcdir/doc/ttfautohint.html
pdf_file=$srcdir/doc/ttfautohint.pdf

if test x"$with_doc" != x"no"; then
  # snapshot image creation
  if test x"$DISPLAY" == x; then
    TA_DOC([$image_file],
           [Need X11 to create snapshot image of ttfautohintGUI])
  else
    AC_CHECK_PROG([IMPORT], [import], [import], [no])
    if test x"$IMPORT" == x"no"; then
      TA_DOC([$image_file],
             [Need ImageMagick to create snapshot image of ttfautohintGUI])
    fi
  fi

  # conversion of SVG to PDF
  AC_CHECK_PROG([INKSCAPE], [inkscape], [inkscape], [no])
  if test x"$INKSCAPE" == x"no"; then
    TA_DOC([$pdf_file],
           [Need inkscape to convert SVG image files to PDF])
  fi

  # documentation creation
  AC_CHECK_PROG([PANDOC], [pandoc], [pandoc], [no])
  if test x"$PANDOC" == x"no"; then
    TA_DOC([$html_file],
           [Need pandoc to create PDF and HTML documentation files])
  fi

  # PDF documentation
  # To support Devanagari and other Indic scripts properly,
  # we currently can use XeTeX only.
  AC_CHECK_PROGS([LATEX], [xelatex], [no])
  if test x"$PDFLATEX" == x"no"; then
    TA_DOC([$pdf_file],
           [Need xelatex to create documentation in PDF format])
  fi
fi

AM_CONDITIONAL([WITH_DOC], [test x"$with_doc" != x"no"])

# pandoc (currently version 1.15.2.1) doesn't have the equivalent to
# a compiler's `-I' command line option to make it search image files
# in specified directories; for this reason, we create symlinks.
AC_CONFIG_COMMANDS([doc/img/create-links],
                   [abs_top_srcdir=`(cd "$srcdir"; pwd)`
                    abs_top_builddir=`pwd`
                    if test "$abs_top_srcdir" != "$abs_top_builddir"; then
                      cd doc \
                      && $LN_S "$abs_top_srcdir"/doc/img/* img
                    fi])

AC_CONFIG_HEADERS([config.h])
AC_CONFIG_FILES([Makefile
                 gnulib/src/Makefile
                 lib/Makefile
                 frontend/Makefile
                 doc/Makefile])
AC_OUTPUT

# end of configure.ac