3
#************************************************************************
5
# Part of the dvipng distribution
7
# This program is free software: you can redistribute it and/or modify
8
# it under the terms of the GNU Lesser General Public License as
9
# published by the Free Software Foundation, either version 3 of the
10
# License, or (at your option) any later version.
12
# This program is distributed in the hope that it will be useful, but
13
# WITHOUT ANY WARRANTY; without even the implied warranty of
14
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15
# Lesser General Public License for more details.
17
# You should have received a copy of the GNU Lesser General Public
18
# License along with this program. If not, see
19
# <http://www.gnu.org/licenses/>.
21
# Copyright (C) 2002-2010 Jan-�ke Larsson
23
#************************************************************************
25
# Process this file with autoconf to produce a configure script.
26
AC_INIT([dvipng], [1.14], [dvipng@nongnu.org])
27
AC_CONFIG_SRCDIR([dvipng.c])
30
AC_HELP_STRING([--disable-debug],[Compile without debug (-d) option]),
31
[ if test "$enableval" = yes ; then
32
AC_DEFINE(DEBUG, 1, [Define as 1 to get the debug (-d) option.])
35
AC_DEFINE(DEBUG, 1, [Define as 1 to get the debug (-d) option.])])
37
AC_HELP_STRING([--enable-timing],[Output execution time of dvipng]),
38
[ if test "$enableval" = yes ; then
39
AC_DEFINE(TIMING, 1, [Define as 1 to get execution time output.])
42
# Checks for programs.
48
AC_HELP_STRING([--with-gs=/PATH/TO/gs],[Hard-wire the location of GhostScript]),
49
[if test "x$withval" != xno ; then
50
AC_PATH_PROG(GS,["$withval"])
51
AC_DEFINE_UNQUOTED(GS_PATH, "$GS", [Define as the path to GhostScript.])
54
[AC_CHECK_PROG(GS,gs,gs)
55
AC_DEFINE_UNQUOTED(GS_PATH, "gs", [Define as the path to GhostScript.])
56
if test -n "$GS"; then
59
AC_MSG_WARN([Cannot find GhostScript in your PATH])
63
# Checks for libraries.
65
AC_CHECK_LIB(z, deflate)
66
AC_CHECK_LIB([png], [png_read_image],,
67
[AC_MSG_ERROR([cannot find/use libpng])])
68
AC_CHECK_LIB([gd], [gdImageCreate],,
69
[AC_MSG_ERROR([cannot find/use libgd
70
This drawing library can be downloaded at http://www.boutell.com/gd])])
71
AC_CHECK_LIB([kpathsea], [kpse_set_program_name],,
72
AC_MSG_ERROR([cannot find/use libkpathsea]))
73
AC_CHECK_LIB([t1], [T1_InitLib])
75
if test "$ac_cv_lib_t1_T1_InitLib" = yes; then
80
# Checks for header files.
82
AC_CHECK_HEADERS([gd.h png.h kpathsea/kpathsea.h],,
83
[AC_MSG_ERROR([cannot find/use $ac_header])])
84
AC_CHECK_HEADERS([t1lib.h libgen.h])
85
AC_CHECK_FT2(,[CFLAGS="$FT2_CFLAGS $CFLAGS"
86
LIBS="$FT2_LIBS $LIBS"
87
PSFONTS_O="$PSFONTS_O sfd.o ft.o"
88
AC_DEFINE(HAVE_FT2, 1, [Define to 1 if you have freetype2])
89
ac_have_freetype2="yes"],
90
[ac_have_freetype2="no"])
91
if test -n "$PSFONTS_O"; then
92
PSFONTS_O="$PSFONTS_O enc.o fontmap.o tfm.o"
97
AC_CHECK_HEADERS([fcntl.h sys/time.h])
99
# Checks for typedefs, structures, and compiler characteristics.
103
if test "$ac_cv_header_inttypes_h" = "yes"; then
104
# Sometimes we want to use gcc -ansi -pedantic as a portability test
105
# The typedef of int64_t is not in the system header file in that
106
# case. Then, #define int64_t as "long long", which is non-ansi, but
107
# is present in most modern compilers. Using a #define rather than a
108
# typedef can be a problem, but in dvipng int64_t is only used as
109
# typecast, and there are no problems. autoconf 2.13 equivalent:
110
# AC_CHECK_TYPE(int64_t, long long)
111
# AC_CHECK_TYPE(uint64_t, unsigned long long)
112
AC_CHECK_TYPE([int64_t],,
113
[AC_DEFINE_UNQUOTED([int64_t], [long long],
114
[Define to `long long' if
115
<inttypes.h> does not define it.])])
116
AC_CHECK_TYPE([uint64_t],,
117
[AC_DEFINE_UNQUOTED([uint64_t], [unsigned long long],
118
[Define to `unsigned long long' if
119
<inttypes.h> does not define it.])])
121
AC_HAS_KPSE_ENC_FORMATS
124
# Checks for library functions.
130
AC_CHECK_FUNCS([dup2 memset munmap pow putenv strchr strrchr strtol strstr])
131
if test "$enable_timing" = "yes"; then
132
AC_CHECK_FUNCS([ftime gettimeofday])
134
AC_CHECK_FUNCS([gdImageCreateTrueColor gdImageCreateFromJpeg gdImagePngEx gdImageCreateFromPngPtr gdImageGif FT_Library_Version])
135
if test "$ac_cv_func_gdImageGif" = "yes"; then
136
INSTALL_BIN_TARGET="install-dvigif"
138
INSTALL_BIN_TARGET="install-dvipng"
140
AC_SUBST(INSTALL_BIN_TARGET)
142
# Documentation-related checks
143
AC_PATH_PROG(MAKEINFO, makeinfo, :)
144
MAKEINFO_CHECK_MACROS(acronym env option)
145
AC_PATH_PROG(INSTALL_INFO, install-info, :, $PATH /usr/sbin /sbin)
148
AC_ARG_ENABLE(selfauto-set,
149
AC_HELP_STRING([--enable-selfauto-set],
150
[This option will make the final binary explicitly set the
151
$SELFAUTO... variables to make it look as dvipng is installed in the
152
main texmf tree, even if it isn't. This is necessary when texmf.cnf
153
only uses $SELFAUTO... variables and dvipng is not installed in the
154
texmf tree. Otherwise, dvipng may not be able to find virtual
155
fonts, or psfonts.map. To find out, first build the binary and do
156
'make test'. If the test fails, you need this switch.]),
157
[ if test "$enableval" = yes ; then
158
AC_MSG_CHECKING([for \$SELFAUTOLOC])
159
SELFAUTOLOC=`kpsewhich -expand-var=\\\$SELFAUTOLOC`
160
AC_DEFINE_UNQUOTED(ENV_SELFAUTOLOC,["SELFAUTOLOC=$SELFAUTOLOC"],
161
[The environment setting for $SELFAUTOLOC])
162
AC_MSG_RESULT([$SELFAUTOLOC])
163
AC_MSG_CHECKING([for \$SELFAUTODIR])
164
SELFAUTODIR=`kpsewhich -expand-var=\\\$SELFAUTODIR`
165
AC_DEFINE_UNQUOTED(ENV_SELFAUTODIR,["SELFAUTODIR=$SELFAUTODIR"],
166
[The environment setting for $SELFAUTODIR])
167
AC_MSG_RESULT([$SELFAUTODIR])
168
AC_MSG_CHECKING([for \$SELFAUTOPARENT])
169
SELFAUTOPARENT=`kpsewhich -expand-var=\\\$SELFAUTOPARENT`
170
AC_DEFINE_UNQUOTED(ENV_SELFAUTOPARENT,["SELFAUTOPARENT=$SELFAUTOPARENT"],
171
[The environment setting for $SELFAUTOPARENT])
172
AC_MSG_RESULT([$SELFAUTOPARENT])
174
[AC_MSG_CHECKING([for texmf.cnf])
175
TEXMF_CNF=`kpsewhich texmf.cnf`
176
AC_MSG_RESULT([$TEXMF_CNF])
177
AC_PATH_PROG(KPSEWHICH, kpsewhich)
178
AC_MSG_CHECKING([for psfonts.map])
180
PSFONTS_MAP=`./kpsewhich psfonts.map`
182
if test -n "$PSFONTS_MAP"; then
183
AC_MSG_RESULT([$PSFONTS_MAP])
185
AC_MSG_RESULT([not found from outside the texmf tree])
186
AC_MSG_CHECKING([for \$SELFAUTO in texmf.cnf])
187
if grep SELFAUTO "$TEXMF_CNF" > /dev/null 2> /dev/null; then
189
***************************************************************
190
texmf.cnf is using \$SELFAUTO... variables. If you are going to
191
install dvipng outside the texmf tree, you may need to use
192
--enable-selfauto-set. To find out, do 'make ; make test'. If the test
193
is unsuccessful, add the mentioned switch and rebuild.
194
***************************************************************])
201
** Configuration summary for $PACKAGE_STRING:
203
The -d (debug) switch is enabled: $enable_debug
204
Your gd is new enough (>=2.0) to enable
205
the --truecolor switch, full alpha
206
transparency, proper rescaling of
207
included bitmaps, and jpeg inclusion: $ac_cv_func_gdImageCreateTrueColor
208
Your gd has jpeg inclusion enabled: $ac_cv_func_gdImageCreateFromJpeg
209
Your gd is new enough (>=2.0.12) to
210
enable transparent backgrounds for EPS
211
inclusion and the -z (compression)
212
switch: $ac_cv_func_gdImagePngEx
213
Your gd is new enough (>=2.0.21) to
214
allow image creation from memory $ac_cv_func_gdImageCreateFromPngPtr
215
Your gd is new enough (>=2.0.28) to
216
enable gif inclusion and output
217
(dvigif): $ac_cv_func_gdImageGif
218
FreeType font rendering available: $ac_have_freetype2
219
Support for subfonts (CJK-LaTeX): $ac_have_freetype2
220
T1lib font rendering available: $ac_cv_lib_t1_T1_InitLib
223
AC_CONFIG_HEADER([config.h])
224
AC_CONFIG_FILES([Makefile])