| 1 |
dnl |
| 2 |
dnl ChkTeX, configuration file. |
| 3 |
dnl Copyright (C) 1995-96 Jens T. Berger Thielemann |
| 4 |
dnl |
| 5 |
dnl This program is free software; you can redistribute it and/or modify |
| 6 |
dnl it under the terms of the GNU General Public License as published by |
| 7 |
dnl the Free Software Foundation; either version 2 of the License, or |
| 8 |
dnl (at your option) any later version. |
| 9 |
dnl |
| 10 |
dnl This program is distributed in the hope that it will be useful, |
| 11 |
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 |
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 |
dnl GNU General Public License for more details. |
| 14 |
dnl |
| 15 |
dnl You should have received a copy of the GNU General Public License |
| 16 |
dnl along with this program; if not, write to the Free Software |
| 17 |
dnl Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
| 18 |
dnl |
| 19 |
dnl Contact the author at: |
| 20 |
dnl Jens Berger |
| 21 |
dnl Spektrumvn. 4 |
| 22 |
dnl N-0666 Oslo |
| 23 |
dnl Norway |
| 24 |
dnl E-mail: <[email protected]> |
| 25 |
dnl |
| 26 |
dnl |
| 27 |
|
| 28 |
|
| 29 |
dnl Process this file with autoconf to produce a configure script. |
| 30 |
AC_INIT([ChkTeX],[1.7.9]) |
| 31 |
AC_SUBST(SCRIPTS) |
| 32 |
AC_SUBST(BUILT_SCRIPTS) |
| 33 |
AC_SUBST(CLEAN) |
| 34 |
CLEAN= |
| 35 |
|
| 36 |
AC_ARG_ENABLE(pcre,[ |
| 37 |
--enable-pcre: Use PCRE to allow regular expressions in |
| 38 |
user warnings. (Default: yes, if available).],, |
| 39 |
enable_pcre=yes) |
| 40 |
|
| 41 |
AC_ARG_ENABLE(posixre,[ |
| 42 |
--enable-posixre: Use POSIX extended regular expressions in |
| 43 |
user warnings. (Default: yes, unless using PCRE).],, |
| 44 |
enable_posixre=yes) |
| 45 |
|
| 46 |
AC_ARG_ENABLE(lacheck-replace,[ |
| 47 |
--enable-lacheck-replace: Installs a lacheck replacement. (Default: no).],, |
| 48 |
enable_lacheck_replace=no) |
| 49 |
|
| 50 |
AC_ARG_ENABLE(debug-info,[ |
| 51 |
--enable-debug-info: Compile in miscellaneous runtime debugging |
| 52 |
information. (Default: yes).],, |
| 53 |
enable_debug_info=yes) |
| 54 |
|
| 55 |
AC_ARG_ENABLE(coverage-testing,[ |
| 56 |
--enable-coverage-testing: Activate coverage testing with gcov. (Default: no)],, |
| 57 |
enable_coverage_testing=no) |
| 58 |
|
| 59 |
AC_MSG_CHECKING(whether lacheck replacement should be installed) |
| 60 |
if test "$enable_lacheck_replace" = "yes"; then |
| 61 |
SCRIPTS="$SCRIPTS lacheck" |
| 62 |
AC_MSG_RESULT(yes) |
| 63 |
else |
| 64 |
AC_MSG_RESULT(no) |
| 65 |
fi |
| 66 |
|
| 67 |
AC_MSG_CHECKING(whether runtime debug info should be used) |
| 68 |
if test "$enable_debug_info" = "yes"; then |
| 69 |
AC_MSG_RESULT(yes) |
| 70 |
else |
| 71 |
AC_DEFINE(STRIP_DEBUG, 1, Strip debug info) |
| 72 |
AC_MSG_RESULT(no) |
| 73 |
fi |
| 74 |
|
| 75 |
AC_MSG_CHECKING(whether coverage testing is enabled) |
| 76 |
if test "$enable_coverage_testing" = "yes"; then |
| 77 |
AC_MSG_RESULT(yes) |
| 78 |
CFLAGS="${CFLAGS} -fprofile-arcs -ftest-coverage -O0" |
| 79 |
CLEAN="${CLEAN} \$(wildcard *.bb *.bbg *.da *.gcov)" |
| 80 |
else |
| 81 |
AC_MSG_RESULT(no) |
| 82 |
fi |
| 83 |
|
| 84 |
|
| 85 |
dnl Check compiler and flags |
| 86 |
AC_PROG_CC |
| 87 |
AX_CFLAGS_STRICT_PROTOTYPES |
| 88 |
VL_PROG_CC_WARNINGS |
| 89 |
|
| 90 |
dnl Checks for programs. |
| 91 |
AC_PROG_INSTALL |
| 92 |
AC_PROG_LN_S |
| 93 |
AC_PROG_MKDIR_P |
| 94 |
AC_PATH_PROGS(PERL5, perl5 perl, no, $PATH:/usr/bin:/usr/local/bin) |
| 95 |
if test "$PERL5" != no; then |
| 96 |
AC_MSG_CHECKING(whether perl is v5 or higher) |
| 97 |
if $PERL5 -e 'exit($] >= 5)'; then |
| 98 |
PERL5=no |
| 99 |
AC_MSG_RESULT(no) |
| 100 |
else |
| 101 |
AC_MSG_RESULT(yes) |
| 102 |
fi |
| 103 |
fi |
| 104 |
|
| 105 |
if test "$PERL5" != no; then |
| 106 |
BUILT_SCRIPTS="$BUILT_SCRIPTS deweb" |
| 107 |
SCRIPTS="$SCRIPTS chkweb" |
| 108 |
else |
| 109 |
AC_MSG_WARN(chkweb will not be installed since you do not have perl5.) |
| 110 |
fi |
| 111 |
|
| 112 |
AC_CHECK_PROGS(GROFF, 'groff -man -P-bu -Tlatin1' 'nroff -man', 'nroff -man') |
| 113 |
|
| 114 |
AC_PATH_PROG(PDFLATEX, pdflatex, no) |
| 115 |
AC_PATH_PROG(LATEX, latex, no) |
| 116 |
dnl if test "$LATEX" = no; then |
| 117 |
dnl AC_MSG_ERROR([No LaTeX on the system, cannot find latex program.]) |
| 118 |
dnl fi |
| 119 |
|
| 120 |
AC_PATH_PROG(DVIPS, dvips) |
| 121 |
|
| 122 |
AC_PATH_PROG(LYNX, lynx) |
| 123 |
AC_PATH_PROG(LATEX2HTML, latex2html) |
| 124 |
|
| 125 |
dnl Checks for libraries. |
| 126 |
AC_CHECK_LIB(termlib, tgetent) |
| 127 |
AC_CHECK_LIB(termcap, tgetent) |
| 128 |
|
| 129 |
AC_HEADER_DIRENT |
| 130 |
AC_CHECK_HEADERS(limits.h stat.h strings.h stdarg.h dnl |
| 131 |
sys/stat.h termcap.h termlib.h unistd.h) |
| 132 |
|
| 133 |
dnl Checks for typedefs, structures, and compiler characteristics. |
| 134 |
AC_C_CONST |
| 135 |
AC_C_INLINE |
| 136 |
AC_TYPE_SIZE_T |
| 137 |
AC_TYPE_UINT64_T |
| 138 |
|
| 139 |
dnl Checks for library functions. |
| 140 |
AC_FUNC_VPRINTF |
| 141 |
AC_CHECK_FUNCS(access closedir fileno isatty opendir readdir stat dnl |
| 142 |
strcasecmp strdup strlwr strtol) |
| 143 |
|
| 144 |
dnl Checks for declarations. |
| 145 |
AC_CHECK_DECLS([stpcpy]) |
| 146 |
|
| 147 |
dnl Check for PCRE regular expression support |
| 148 |
AC_MSG_CHECKING(whether PCRE regular expressions are enabled) |
| 149 |
AC_MSG_RESULT($enable_pcre) |
| 150 |
if test "$enable_pcre" = "yes"; then |
| 151 |
AC_CHECK_PROG(WITH_PCRE, pcre-config, yes, no) |
| 152 |
if test "$WITH_PCRE" = "yes"; then |
| 153 |
AC_DEFINE(HAVE_PCRE, 1, Whether PCRE can be used for user warnings.) |
| 154 |
CFLAGS="${CFLAGS} $(pcre-config --cflags-posix)" |
| 155 |
LDFLAGS="${LDFLAGS} $(pcre-config --libs-posix)" |
| 156 |
else |
| 157 |
AC_DEFINE(HAVE_PCRE, 0) |
| 158 |
AC_MSG_WARN(PCRE library not found.) |
| 159 |
fi |
| 160 |
else |
| 161 |
AC_DEFINE(HAVE_PCRE, 0) |
| 162 |
AC_MSG_WARN(PCRE regular expressions not enabled.) |
| 163 |
fi |
| 164 |
|
| 165 |
dnl Check for POSIX extended regular expression support |
| 166 |
AC_MSG_CHECKING(for POSIX extended regular expressions) |
| 167 |
AC_EGREP_CPP([yes], |
| 168 |
[#include <regex.h> |
| 169 |
#ifdef REG_EXTENDED |
| 170 |
yes |
| 171 |
# endif |
| 172 |
], posix_ere=yes, posix_ere=no) |
| 173 |
AC_MSG_RESULT($posix_ere) |
| 174 |
if test "$WITH_PCRE" = "yes"; then |
| 175 |
AC_DEFINE(HAVE_POSIX_ERE, 0, Whether POSIX ERE can be used for user warnings.) |
| 176 |
else |
| 177 |
if test "$enable_posixre" = "yes"; then |
| 178 |
if test "$posix_ere" = "yes"; then |
| 179 |
AC_DEFINE(HAVE_POSIX_ERE, 1) |
| 180 |
else |
| 181 |
AC_DEFINE(HAVE_POSIX_ERE, 0) |
| 182 |
fi |
| 183 |
else |
| 184 |
AC_DEFINE(HAVE_POSIX_ERE, 0) |
| 185 |
AC_MSG_WARN(Regular expressions not enabled.) |
| 186 |
fi |
| 187 |
fi |
| 188 |
|
| 189 |
|
| 190 |
AC_CONFIG_HEADERS([config.h]) |
| 191 |
AC_CONFIG_FILES([stamp-h], [echo timestamp > stamp-h]) |
| 192 |
AC_CONFIG_FILES([Makefile deweb rmeheader ChkTeX.tex]) |
| 193 |
AC_OUTPUT |