1
dnl Process this file with autoconf to produce a configure script.
2
AC_INIT(src/dvipdfmx.c)
3
AM_INIT_AUTOMAKE(dvipdfmx, 20110311)
4
AM_CONFIG_HEADER(config.h)
7
dnl Checks for programs.
18
# Building inside teTeX or TeX Live?
19
AC_ARG_ENABLE(tetex-build, [ --enable-tetex-build build as part of a teTeX installation])
22
dnl Check for kpathsea library. (required)
23
if test "x$enable_tetex_build" = xyes; then
24
# In teTeX and TeX Live, LDFLAGS is passed by texk/Makefile and
25
# reserved for the user. Therefore we need another variable for the
26
# loader flags to find the local kpathsea. We use dvipdfmx_LDFLAGS
27
# since Automake already sets that up in the link command.
29
AC_SUBST(dvipdfmx_LDFLAGS)
31
if test ! -d $srcdir/../../texk/kpathsea; then
33
=========================================
35
You specified --enable-tetex-build, but I can't find the kpathsea
36
directory. I expected it to be in $srcdir/../../texk/kpathsea.
38
=========================================])
40
CPPFLAGS="$CPPFLAGS -I\$(top_builddir)/../../texk -I\$(top_srcdir)/../../texk"
41
dvipdfmx_LDFLAGS="-L\$(top_builddir)/../../texk/kpathsea/.libs"
43
AM_CONDITIONAL(TDS_VERSION_11, true)
44
AC_DEFINE([__TDS_VERSION__], 0x200406L)
46
dnl Don't bother going further if we don't have kpse installed.
48
[ --with-kpathsea=DIR use kpathsea include/library files from DIR], [
49
if test -d "$withval"; then
50
CPPFLAGS="$CPPFLAGS -I$withval/include"
51
LDFLAGS="$LDFLAGS -L$withval/lib"
54
if test -d "$prefix"; then
55
CPPFLAGS="$CPPFLAGS -I$prefix/include"
56
LDFLAGS="$LDFLAGS -L$prefix/lib"
58
CPPFLAGS="$CPPFLAGS -I$ac_default_prefix/include"
59
LDFLAGS="$LDFLAGS -L$ac_default_prefix/lib"
63
AC_CHECK_LIB(kpathsea, kpse_find_file, [LIBS="-lkpathsea $LIBS"],
64
AC_MSG_ERROR([kpathsea library not found
65
This version of dvipdfmx requires the kpathsea library and its headers. If
66
you know where it is you might try setting the LDFLAGS environment variable
67
with -L pointing to the directory containing libkpathsea.a.
71
dnl Check kpathsea support for required formats and funcs.
72
CHO_CHECK_KPSE_SUPPORT([dvipdfmx])
74
dnl Check for TDS version kpathsea library supports.
75
CHO_CHECK_KPSE_TDS_VERSION
79
dnl Checks for header files.
81
AC_CHECK_HEADERS(unistd.h)
82
AC_CHECK_HEADERS(stdint.h inttypes.h sys/types.h sys/wait.h)
84
dnl Checks for library functions.
86
AC_CHECK_FUNCS(open close getenv mkstemp basename)
88
dnl Checks for typedefs, structures, and compiler characteristics.
100
AC_CHECK_SIZEOF(char)
101
AC_CHECK_SIZEOF(short)
103
AC_CHECK_SIZEOF(long)
106
dnl Check for additional libraries.
107
if test "x$enable_tetex_build" = xyes; then
108
# Get these common libraries from the sources, too.
109
# Seems like it would be simpler to treat kpathsea this way too, but
110
# we're just starting from what lcdf-typetools did.
111
sinclude(../../libs/zlib/withenable.ac)
112
sinclude(../../libs/zlib/zlib.ac)
114
sinclude(../../libs/libpng/withenable.ac)
115
sinclude(../../libs/libpng/libpng.ac)
117
# yes, we have zlib and png.
119
AC_DEFINE(HAVE_LIBPNG)
121
# You must define HAVE_ZLIB_COMPRESS2 to enable '-z' option for controlling
122
# zlib compression level, but zlib.ac included above does not do this test.
123
# We assume zlib always has compress2() here although that's not always true.
124
AC_DEFINE([HAVE_ZLIB_COMPRESS2], 1)
126
# tetex/tex live build; this always has kpathsea, xbasename, etc.,
127
# as we're building from current sources. Do this stuff at the end so
128
# other configure tests don't try to link with kpathsea (which doesn't
129
# exist at configure time).
130
LIBS="-lkpathsea -lm $LIBS"
131
AC_MSG_NOTICE([tetex build enabled, LIBS now: $LIBS])
137
dnl these variables are defined in the tetex case and used in src/Makefile.am.
138
dnl just let them be empty.
139
AC_SUBST(LIBPNGCPPFLAGS)
142
AC_SUBST(ZLIBCPPFLAGS)
145
AC_SUBST(dvipdfmx_LDFLAGS)
148
AC_CONFIG_FILES([Makefile data/Makefile man/Makefile src/Makefile])