summaryrefslogtreecommitdiff
path: root/Build/source/texk/dvipng/configure.ac.demo
blob: 952d52a3c03f40b6c3652a17dc164de1f3a215c2 (plain)
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
#                                               -*- Autoconf -*-
# configure.ac
# Process this file with autoconf to produce a configure script.

#************************************************************************
#
#  Part of the dvipng distribution
#
#  This program is free software; you can redistribute it and/or modify
#  it under the terms of the GNU General Public License as published by
#  the Free Software Foundation; either version 2 of the License, or
#  (at your option) any later version.
#
#  This program is distributed in the hope that it will be useful, but
#  WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
#  General Public License for more details.
#
#  You should have received a copy of the GNU General Public License
#  along with this program; if not, write to the Free Software
#  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
#  02110-1301 USA.
#
#  Copyright (C) 2002-2006 Jan-Åke Larsson
#
#************************************************************************

AC_PREREQ(2.60)
AC_INIT([dvipng-demo], [1.9], [dvipng@nongnu.org])
AC_CONFIG_AUX_DIR([cf])
AC_CONFIG_SRCDIR([dvipng.c])
AC_CONFIG_HEADERS([config.h])

AM_INIT_AUTOMAKE[]dnl using automake

AC_ARG_ENABLE(debug, 
  AC_HELP_STRING([--disable-debug],[Compile without debug (-d) option]), 
    [ if test "$enableval" = yes ; then
      AC_DEFINE(DEBUG, 1, [Define as 1 to get the debug (-d) option.])
      fi ],	
    [ enable_debug="yes";
      AC_DEFINE(DEBUG, 1, [Define as 1 to get the debug (-d) option.])])
AC_ARG_ENABLE(timing, 
  AC_HELP_STRING([--enable-timing],[Output execution time of dvipng]), 
   [ if test "$enableval" = yes ; then
     AC_DEFINE(TIMING, 1, [Define as 1 to get execution time output.])
     fi ])

# Checks for programs.
AC_SET_MAKE
AC_PROG_CC
AC_PROG_INSTALL

AC_PROG_LIBTOOL[]dnl using libtool to link executables

AC_ARG_WITH(gs,
  AC_HELP_STRING([--with-gs=/PATH/TO/gs],[Hard-wire the location of GhostScript]), 
  [if test "x$withval" = xno ; then
    GS=no
  else
    AC_PATH_PROG(GS,["$withval"])
  fi],
  [AC_CHECK_PROG(GS,gs,gs)
  if test -z "$GS"; then
    GS="gs"
    AC_MSG_WARN([Cannot find GhostScript in your PATH])
  fi
])
AC_DEFINE_UNQUOTED(GS_PATH, "$GS", [Define as the path to GhostScript.])
GS_WARN=""
xx_GS_HAS_DEVICE(pngalpha,
   [GS_WARN="Your EPS inclusions will be cropped to the 
             boundingbox, and rendered on an opaque background. 
             Upgrade GhostScript to avoid this."
   xx_GS_HAS_DEVICE(png16m,
      [GS_WARN="Your EPS inclusions may not work.
             Upgrade/install GhostScript to avoid this."])])
if test -n "$GS_WARN"; then
  AC_MSG_WARN([$GS_WARN])
fi

# Checks for libraries and header files.
AC_SEARCH_LIBS([pow], [m])
AC_SEARCH_LIBS([basename], [gen])

KPSE_INIT([dvipng])[]dnl initialize kpathsea.m4
ENABLE_TETEX_BUILD[]dnl Kpathsea is required
KPSE_CHECK_ZLIB[]dnl Zlib is required (sorry, Libpng requires Zlib)
KPSE_CHECK_LIBPNG[]dnl Libpng is required
dnl KPSE_CHECK_FREETYPE2[]dnl Freetype2 is required
KPSE_WITH_FREETYPE2[]dnl Freetype2 is optional
KPSE_CHECK_GD[]dnl Gd is required
KPSE_WITH_T1LIB[]dnl T1lib is optional

AM_CONDITIONAL([USE_T1], [test "$have_t1lib" = yes])
AM_CONDITIONAL([USE_FT2], [test "$have_freetype2" = yes])

AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_HEADER_TIME
AC_HEADER_STDBOOL
AC_CHECK_HEADERS([fcntl.h sys/time.h])

# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_PID_T
AC_TYPE_SIZE_T
if test "$ac_cv_header_inttypes_h" = "yes"; then
  # Sometimes we want to use gcc -ansi -pedantic as a portability test
  # The typedef of int64_t is not in the system header file in that
  # case. Then, #define int64_t as "long long", which is non-ansi, but
  # is present in most modern compilers. Using a #define rather than a
  # typedef can be a problem, but in dvipng int64_t is only used as
  # typecast, and there are no problems. autoconf 2.13 equivalent:
  # AC_CHECK_TYPE(int64_t, long long)
  # AC_CHECK_TYPE(uint64_t, unsigned long long)
  AC_CHECK_TYPE([int64_t],,
                [AC_DEFINE_UNQUOTED([int64_t], [long long],
                                    [Define to `long long' if
                                     <inttypes.h> does not define it.])])
  AC_CHECK_TYPE([uint64_t],,
                [AC_DEFINE_UNQUOTED([uint64_t], [unsigned long long],
                                    [Define to `unsigned long long' if
                                     <inttypes.h> does not define it.])])
fi


# Checks for library functions.
AC_FUNC_ALLOCA
AC_FUNC_FORK
AC_FUNC_MALLOC
AC_FUNC_MMAP
AC_FUNC_STRTOD
AC_FUNC_VPRINTF
AC_CHECK_FUNCS([dup2 memset munmap pow putenv strchr strrchr strtol strstr])
if test "$enable_timing" = "yes"; then
  AC_CHECK_FUNCS([ftime gettimeofday])
fi
KPSE_CHECK_FUNCS([gdImageCreateTrueColor gdImagePngEx gdImageGif gdImageJpeg FT_Library_Version])
AM_CONDITIONAL([WITH_DVIGIF], [test "$ac_cv_func_gdImageGif" = yes])

# Documentation-related checks
AC_PATH_PROG(MAKEINFO, makeinfo, :)
MAKEINFO_CHECK_MACROS(acronym env option)
AC_PATH_PROG(INSTALL_INFO, install-info, :, $PATH /usr/sbin /sbin)

KPSE_SELFAUTO[]dnl handle SELFAUTO variables.
AC_SUBST([TEXMFMAIN])
AC_SUBST([enable_selfauto_set])

AC_MSG_RESULT([
** Configuration summary for $PACKAGE_STRING:

   The -d (debug) switch is enabled:        $enable_debug
   Your gd is new enough (>=2.0) to enable
     the --truecolor switch, full alpha 
     transparency, and proper rescaling of 
     included bitmaps:                      $ac_cv_func_gdImageCreateTrueColor
   Your gd was built with jpeg inclusion:   $ac_cv_func_gdImageJpeg 
   Your gd is new enough (>=2.0.12) to 
     enable transparent backgrounds for EPS
     inclusion and the -z (compression)
     switch:                                $ac_cv_func_gdImagePngEx
   Your gd is new enough (>=2.0.28) to
     enable gif inclusion and output 
     (dvigif):                              $ac_cv_func_gdImageGif
   FreeType font rendering available:       $have_freetype2
   Support for subfonts (CJK-LaTeX):        $have_freetype2
   T1lib font rendering available:          $have_t1lib
])

AC_CONFIG_FILES([Makefile])
AC_CONFIG_FILES([test_dvipng], [chmod a+x test_dvipng])
AC_OUTPUT