1dnl Process this file with autoconf to produce a configure script.
2dnl
3dnl   Copyright (C) 2010-2015 Peter Breitenlohner <tex-live@tug.org>
4dnl
5dnl   This file is free software; the copyright holder
6dnl   gives unlimited permission to copy and/or distribute it,
7dnl   with or without modifications, as long as this notice is preserved.
8dnl
9dnl *********************************************************************
10dnl
11dnl  Adapted for TeX Live from chktex-1.6.4/configure.in
12dnl
13dnl *********************************************************************
14dnl
15m4_include([version.ac])[] dnl define chktex_version
16AC_INIT([ChkTeX (TeX Live)], chktex_version, [tex-k@tug.org])
17AC_PREREQ([2.65])
18AC_CONFIG_SRCDIR([chktex-]chktex_version[/ChkTeX.c])
19AC_CONFIG_AUX_DIR([../../build-aux])
20AC_CONFIG_MACRO_DIR([../../m4])
21
22dnl Common code for all programs using libkpathsea.
23KPSE_COMMON([chktex])
24
25dnl Need latex, dvips, and ps2pdf to build ChkTeX.pdf
26KPSE_CHECK_LATEX
27AC_CHECK_PROGS([DVIPS], [dvips], [no])
28AC_CHECK_PROGS([PS2PDF], [ps2pdf], [no])
29
30dnl Checks for header files.
31AC_CHECK_HEADERS([stat.h stdarg.h sys/stat.h])
32
33dnl Checks for library functions.
34AC_FUNC_VPRINTF
35AC_CHECK_FUNCS([access closedir fileno isatty opendir readdir stat strcasecmp strdup strlwr])
36
37dnl Checks for declarations.
38AC_CHECK_DECLS([stpcpy])
39
40AC_CONFIG_HEADERS([config.h])
41
42dnl For TeX Live we always use Posix extended regular expressions
43AC_DEFINE([TEX_LIVE], 1, [Define to 1 for a TeX Live build.])
44AC_DEFINE([HAVE_PCRE], 0, [Whether PCRE can be used for user warnings.])
45AC_DEFINE([HAVE_POSIX_ERE], 1, [Whether POSIX ERE can be used for user warnings.])
46
47KPSE_COND_MINGW32
48KPSE_COND_WIN32_WRAP
49
50AC_SUBST([CHKTEX_TREE], [chktex-]chktex_version)
51AC_SUBST([PERL5], ['/usr/bin/env perl'])
52
53KPSE_KPATHSEA_FLAGS
54
55AC_CONFIG_FILES([Makefile ChkTeX.t:chktex-]chktex_version[/ChkTeX.tex.in])
56AC_CONFIG_FILES([deweb.pl:chktex-]chktex_version[/deweb.in], [chmod +x deweb.pl])
57
58AC_OUTPUT
59