summaryrefslogtreecommitdiff
path: root/Build/source/texk/dvipng/configure.ac
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2006-12-05 00:57:33 +0000
committerKarl Berry <karl@freefriends.org>2006-12-05 00:57:33 +0000
commit0ab657d91067f9edfc1f4de294c8def270e3a055 (patch)
treedc88c28686667f85641a6aa36fba0bb0842a5587 /Build/source/texk/dvipng/configure.ac
parent8b990bc0750e51fd017c6e8287d452dde22f4804 (diff)
dvipng 1.9
git-svn-id: svn://tug.org/texlive/trunk@2584 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/dvipng/configure.ac')
-rw-r--r--Build/source/texk/dvipng/configure.ac304
1 files changed, 100 insertions, 204 deletions
diff --git a/Build/source/texk/dvipng/configure.ac b/Build/source/texk/dvipng/configure.ac
index bf04d46be1b..54388a02660 100644
--- a/Build/source/texk/dvipng/configure.ac
+++ b/Build/source/texk/dvipng/configure.ac
@@ -1,30 +1,8 @@
-# configure.ac
-
-#************************************************************************
-#
-# 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., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-#
-# Copyright (C) 2002-2006 Jan-Åke Larsson
-#
-#************************************************************************
+# Thomas Esser, for teTeX. All settings here are my fault, don't blame
+# the dvipng maintainers for it.
# Process this file with autoconf to produce a configure script.
-AC_INIT([dvipng], [1.8], [dvipng@nongnu.org])
+AC_INIT([dvipng], [1.9], [dvipng@nongnu.org])
AC_CONFIG_SRCDIR([dvipng.c])
AC_ARG_ENABLE(debug,
@@ -39,20 +17,13 @@ AC_ARG_ENABLE(timing,
[ if test "$enableval" = yes ; then
AC_DEFINE(TIMING, 1, [Define as 1 to get execution time output.])
fi ])
-# Building inside teTeX or TeX Live?
-AC_ARG_ENABLE(tetex-build,
- AC_HELP_STRING([--enable-tetex-build],[build within teTeX/TeX Live]),
- [ if test "$enableval" = yes ; then
- AC_DEFINE(TETEX_BUILD, 1, [Define as 1 to build within teTeX/TeX Live.])
- fi ])
# Checks for programs.
AC_SET_MAKE
AC_PROG_CC
AC_PROG_INSTALL
-AC_PROG_LN_S
AC_ARG_WITH(gs,
- AC_HELP_STRING([--with-gs=/PATH/TO/gs],[Specify where GhostScript is located]),
+ AC_HELP_STRING([--with-gs=/PATH/TO/gs],[Hard-wire the location of GhostScript]),
[if test "x$withval" = xno ; then
GS=no
else
@@ -65,6 +36,21 @@ AC_ARG_WITH(gs,
fi
])
AC_DEFINE_UNQUOTED(GS_PATH, "$GS", [Define as the path to GhostScript.])
+
+
+dnl Check devices for GS
+dnl AC_GS_HAS_DEVICE(DEVICE,ACTION-IF-FAILED)
+dnl
+AC_DEFUN(AC_GS_HAS_DEVICE,
+ [AC_MSG_CHECKING([whether $GS has the $1 device])
+ if $GS -h | grep $1 >/dev/null; then
+ AC_MSG_RESULT(yes)
+ else
+ AC_MSG_RESULT(no)
+ $2
+ fi
+])
+
GS_WARN=""
AC_GS_HAS_DEVICE(pngalpha,
[GS_WARN="Your EPS inclusions will be cropped to the
@@ -77,217 +63,127 @@ if test -n "$GS_WARN"; then
AC_MSG_WARN([$GS_WARN])
fi
-# Checks for libraries.
-AC_CHECK_LIB(m, pow)
-AC_CHECK_LIB(gen, basename)
-
-if test "x$enable_tetex_build" = xyes; then
- # In teTeX and TeX Live, LDFLAGS is passed by texk/Makefile and
- # reserved for the user. Therefore we need another variable for the
- # loader flags to find the local kpathsea. We use dvipng_LDFLAGS.
- dvipng_LDFLAGS=
- AC_SUBST(dvipng_LDFLAGS)
-
- if test ! -d $srcdir/../../texk/kpathsea; then
- AC_MSG_ERROR([
---enable-tetex-build was specified, but the kpathsea
-directory is not in in $srcdir/../../texk/kpathsea.
- fi
-
- CPPFLAGS="$CPPFLAGS -I\$(top_builddir)/../../texk -I\$(top_srcdir)/../../texk"
- dvipng_LDFLAGS="-L\$(top_builddir)/../../texk/kpathsea/.libs"
-
- # Get these libraries from the sources, too.
-sinclude(../../libs/zlib/withenable.ac)
-sinclude(../../libs/zlib/zlib.ac)
-sinclude(../../libs/libpng/withenable.ac)
-sinclude(../../libs/libpng/libpng.ac)
-sinclude(../../libs/t1lib/withenable.ac)
-sinclude(../../libs/t1lib/t1lib.ac)
-sinclude(../../libs/gd/withenable.ac)
-sinclude(../../libs/gd/gd.ac)
-sinclude(../../libs/freetype2/withenable.ac)
-sinclude(../../libs/freetype2/gd.ac)
-sinclude(../kpathsea/withenable.ac)
- AC_DEFINE(HAVE_KPATHSEA_KPATHSEA_H)
- AC_DEFINE(HAVE_PNG_H)
-
- AC_DEFINE(HAVE_T1LIB_H)
- ac_cv_lib_t1_T1_InitLib=yes
-
- AC_DEFINE(HAVE_FT2)
- ac_have_freetype2=yes
- PSFONTS_O="t1.o ft.o"
-
- AC_DEFINE(HAVE_GD_H)
- ac_cv_func_gdImageCreateTrueColor=yes
- ac_cv_func_gdImagePngEx=yes
- ac_cv_func_gdImageGif=yes
-
- # tetex/tex live build; this always has kpathsea, xbasename, etc.,
- # as we're building from current sources. Do this stuff at the end so
- # other configure tests don't try to link with kpathsea (which doesn't
- # exist at configure time).
- LIBS="-lkpathsea -lm $LIBS"
- AC_MSG_NOTICE([tetex build enabled, LIBS now: $LIBS])
-
-else
- # normal standalone build, not within teTeX/TeX Live sources.
-AC_CHECK_HEADERS([gd.h png.h kpathsea/kpathsea.h],,
- [AC_MSG_ERROR([cannot find/use $ac_header])])
-AC_CHECK_HEADERS([t1lib.h])
-AC_CHECK_LIB(z, deflate)
-AC_CHECK_LIB([gd], [gdImageCreate],,
- [AC_MSG_ERROR([cannot find/use libgd
-This drawing library can be downloaded at http://www.boutell.com/gd])])
-AC_CHECK_LIB([t1], [T1_InitLib])
+ac_cv_lib_t1_T1_InitLib=yes
PSFONTS_O=""
if test "$ac_cv_lib_t1_T1_InitLib" = yes; then
PSFONTS_O="t1.o"
fi
+AC_SUBST(PSFONTS_O)
-AC_CHECK_LIB([kpathsea], [kpse_set_progname],,
- AC_MSG_ERROR([cannot find/use libkpathsea]))
-AC_CHECK_LIB([png], [png_read_image],,
- [AC_MSG_ERROR([cannot find/use libpng])])
-AC_CHECK_FT2(,[CFLAGS="$FT2_CFLAGS $CFLAGS"
- LIBS="$FT2_LIBS $LIBS"
- PSFONTS_O="$PSFONTS_O ft.o"
+ac_have_freetype2="yes" # we have ft2
+if test "$ac_have_freetype2" = yes; then
+ # Have to set compiler and linker flags in Makefile.in, it seems.
+ PSFONTS_O="$PSFONTS_O sfd.o ft.o"
AC_DEFINE(HAVE_FT2, 1, [Define to 1 if you have freetype2])
- ac_have_freetype2="yes"],
- [ac_have_freetype2="no"])
-AC_CHECK_FUNCS([gdImageCreateTrueColor gdImagePngEx gdImageGif FT_Library_Version])
+ AC_DEFINE(HAVE_FT_LIBRARY_VERSION)
fi
if test -n "$PSFONTS_O"; then
PSFONTS_O="$PSFONTS_O enc.o fontmap.o tfm.o"
fi
-AC_SUBST(PSFONTS_O)
-
-# Checks for header files.
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_HEADER_TIME
-AC_HEADER_STDBOOL
-AC_CHECK_HEADERS([fcntl.h sys/time.h])
+AC_CHECK_HEADERS([inttypes.h fcntl.h sys/time.h stdbool.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
+
+#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
-AC_HAS_KPSE_ENC_FORMATS
+ # typedef can be a problem, but in dvipng int64_t only is used as
+ # typecast, and there are no problems.
+# MY_CHECK_TYPE(int64_t, long long)
+# MY_CHECK_TYPE(uint64_t, unsigned long long)
+#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])
+AC_CHECK_FUNCS([dup2 strchr strrchr memchr memset putenv munmap strtol])
if test "$enable_timing" = "yes"; then
AC_CHECK_FUNCS([ftime gettimeofday])
fi
-if test "$ac_cv_func_gdImageGif" = "yes"; then
- INSTALL_BIN_TARGET="install-dvigif"
-else
- INSTALL_BIN_TARGET="install-dvipng"
+
+dnl
+dnl MAKEINFO_CHECK_MACRO( MACRO, [ACTION-IF-FOUND
+dnl [, ACTION-IF-NOT-FOUND]])
+dnl
+AC_DEFUN(MAKEINFO_CHECK_MACRO,
+[if test -n "$MAKEINFO" -a "$makeinfo" != ":"; then
+ AC_MSG_CHECKING([if $MAKEINFO understands @$1{}])
+ echo \\\\input texinfo > conftest.texi
+ echo @$1{test} >> conftest.texi
+ if $MAKEINFO conftest.texi > /dev/null 2> /dev/null; then
+ AC_MSG_RESULT(yes)
+ ifelse([$2], , :, [$2])
+ else
+ AC_MSG_RESULT(no)
+ ifelse([$3], , :, [$3])
+ fi
+ rm -f conftest.texi conftest.info
fi
-AC_SUBST(INSTALL_BIN_TARGET)
+])
+
+dnl
+dnl MAKEINFO_CHECK_MACROS( MACRO ... [, ACTION-IF-FOUND
+dnl [, ACTION-IF-NOT-FOUND]])
+dnl
+AC_DEFUN(MAKEINFO_CHECK_MACROS,
+[for ac_macro in $1; do
+ MAKEINFO_CHECK_MACRO($ac_macro, $2,
+ [MAKEINFO_MACROS="-D no-$ac_macro $MAKEINFO_MACROS"
+ $3])dnl
+ done
+AC_SUBST(MAKEINFO_MACROS)
+])
# 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)
-# SELFAUTO
-AC_ARG_ENABLE(selfauto-set,
- AC_HELP_STRING([--enable-selfauto-set],
- [This option will make the final binary explicitly set the
- $SELFAUTO... variables to make it look as dvipng is installed in the
- main texmf tree, even if it isn't. This is necessary when texmf.cnf
- uses $SELFAUTO... variables and dvipng is not installed in the texmf
- tree. Otherwise, dvipng may not be able to find virtual fonts, or
- psfonts.map.]),
- [ if test "$enableval" = yes ; then
- AC_MSG_CHECKING([for \$SELFAUTOLOC])
- SELFAUTOLOC=`kpsewhich -expand-var=\\\$SELFAUTOLOC`
- AC_DEFINE_UNQUOTED(ENV_SELFAUTOLOC,["SELFAUTOLOC=$SELFAUTOLOC"],
- [The environment setting for $SELFAUTOLOC])
- AC_MSG_RESULT([$SELFAUTOLOC])
- AC_MSG_CHECKING([for \$SELFAUTODIR])
- SELFAUTODIR=`kpsewhich -expand-var=\\\$SELFAUTODIR`
- AC_DEFINE_UNQUOTED(ENV_SELFAUTODIR,["SELFAUTODIR=$SELFAUTODIR"],
- [The environment setting for $SELFAUTODIR])
- AC_MSG_RESULT([$SELFAUTODIR])
- AC_MSG_CHECKING([for \$SELFAUTOPARENT])
- SELFAUTOPARENT=`kpsewhich -expand-var=\\\$SELFAUTOPARENT`
- AC_DEFINE_UNQUOTED(ENV_SELFAUTOPARENT,["SELFAUTOPARENT=$SELFAUTOPARENT"],
- [The environment setting for $SELFAUTOPARENT])
- AC_MSG_RESULT([$SELFAUTOPARENT])
- fi ],
- [AC_MSG_CHECKING([for texmf.cnf])
- TEXMF_CNF=`kpsewhich texmf.cnf`
- AC_MSG_RESULT([$TEXMF_CNF])
- AC_MSG_CHECKING([for psfonts.map])
- cp `which kpsewhich` .
- PSFONTS_MAP=`./kpsewhich psfonts.map`
- rm -f ./kpsewhich
- if test -n "$PSFONTS_MAP"; then
- AC_MSG_RESULT([$PSFONTS_MAP])
- else
- AC_MSG_RESULT([not found from outside the texmf tree])
- AC_MSG_CHECKING([for \$SELFAUTO in texmf.cnf])
- if grep SELFAUTO "$TEXMF_CNF" > /dev/null 2> /dev/null; then
- AC_MSG_RESULT([yes
-***************************************************************
-texmf.cnf is using \$SELFAUTO... variables. If you are going to
-install dvipng outside the texmf tree, you may need to use
---enable-selfauto-set, type ./configure --help for help.
-***************************************************************])
- else
- AC_MSG_RESULT([no])
- fi
- fi])
+sinclude(../../libs/zlib/withenable.ac)
+sinclude(../../libs/zlib/zlib.ac)
+sinclude(../../libs/libpng/withenable.ac)
+sinclude(../../libs/libpng/libpng.ac)
+sinclude(../../libs/t1lib/withenable.ac)
+sinclude(../../libs/t1lib/t1lib.ac)
+sinclude(../../libs/gd/withenable.ac)
+sinclude(../../libs/gd/gd.ac)
+sinclude(../../libs/freetype2/withenable.ac)
+sinclude(../../libs/freetype2/freetype2.ac)
+sinclude(../kpathsea/withenable.ac)
-AC_MSG_RESULT([
-** Configuration summary for $PACKAGE_STRING:
+LIBS="../kpathsea/.libs/libkpathsea.a $LIBS"
+AC_DEFINE(HAVE_KPATHSEA_KPATHSEA_H)
+AC_DEFINE(HAVE_KPSE_ENC_FORMATS)
+AC_DEFINE(HAVE_LIBKPATHSEA)
- The -d (debug) switch is enabled: $enable_debug
- Your gd is new enough (>=2.0) to enable
- the --truecolor switch, full alpha
- transparency, proper rescaling of
- included bitmaps, and jpeg inclusion: $ac_cv_func_gdImageCreateTrueColor
- 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: $ac_have_freetype2
- T1lib font rendering available: $ac_cv_lib_t1_T1_InitLib
-])
+dnl -- gd jpeg fn not defined? AC_DEFINE(HAVE_GDIMAGECREATETRUECOLOR)
+dnl then we get a warning about gdImageAlpha, but so what.
+AC_DEFINE(HAVE_GDIMAGEPNGEX)
+AC_DEFINE(HAVE_GD_H)
+AC_DEFINE(HAVE_LIBGD)
+
+AC_DEFINE(HAVE_T1LIB_H)
+AC_DEFINE(HAVE_LIBT1)
+
+AC_DEFINE(HAVE_PNG_H)
+AC_DEFINE(HAVE_LIBPNG)
+
+AC_DEFINE(HAVE_LIBZ)
+
+AC_CHECK_LIB(m, main)
+AC_CHECK_LIB(gen, basename)
-AC_CONFIG_HEADER([config.h])
-AC_CONFIG_FILES([Makefile])
+AC_CONFIG_HEADERS([config.h])
+AC_CONFIG_FILES(Makefile)
AC_OUTPUT