From 000cda3ec5f121a5c279bd5a8074f027ba0efd1f Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Sun, 16 Jan 2022 15:34:51 +0000 Subject: Stop generating include/*.h from configure This was inconvenient when making changes to those central header files. All `configure`-generated preprocessor symbols are now in `config.h`. * configure.ac: Define various PROG_* symbols. Remove AC_SUBST calls for compressors and decompressors. (AC_CONFIG_FILES): Remove include/comp_src.h and include/manconfig.h. * m4/man-arg-override-dir.m4: Define OVERRIDE_DIR symbol. * include/manconfig.h.in: Rename to ... * include/manconfig.h: ... this. Remove PROG_*, OVERRIDE_DIR, and COMPRESS_EXT definitions. * include/comp_src.h.in: Rename to ... * include/comp_src.h: ... this. * README.md: Update references to include/manconfig.h. * .gitignore: Remove include/*.h. --- configure.ac | 47 +++++++++++++++++++++++++++++++++++------------ 1 file changed, 35 insertions(+), 12 deletions(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 61664f30..7c7e2446 100644 --- a/configure.ac +++ b/configure.ac @@ -99,11 +99,16 @@ AC_PROG_LN_S AM_PROG_AR LT_INIT([disable-static]) AC_CHECK_PROGS([cat], [cat]) +AC_DEFINE_UNQUOTED([PROG_CAT], ["$cat"], [Program to use as cat.]) MAN_CHECK_PROGS([browser], [BROWSER], [use BROWSER as default web browser], [www-browser lynx elinks w3m]) test -n "$browser" && browser="exec $browser" +AC_DEFINE_UNQUOTED([PROG_BROWSER], ["$browser"], [Program to use as browser.]) AC_CHECK_PROGS([tr], [tr]) +AC_DEFINE_UNQUOTED([PROG_TR], ["$tr"], [Program to use as tr.]) AC_CHECK_PROGS([grep], [grep]) +AC_DEFINE_UNQUOTED([PROG_GREP], ["$grep"], [Program to use as grep.]) MAN_CHECK_PROGS([pager], [PAGER], [use PAGER as default pager], [pager less more]) +AC_DEFINE_UNQUOTED([PROG_PAGER], ["$pager"], [Program to use as pager.]) # Define below (in list of preference) *roff macros to check for. macros="andoc an doc" @@ -158,13 +163,14 @@ dnl nroff="$nroff ${man_cv_prog_nroff_macro}${nroff_device}" AC_MSG_RESULT([$man_cv_prog_nroff_macro]) else AC_MSG_RESULT([ambiguous]) - AC_MSG_WARN([please edit include/manconfig.h and add nroff definition]) + AC_MSG_WARN([please edit config.h and add nroff definition]) fi else AC_MSG_WARN([Cannot find an nroff-like program, formatting of manual page source will not be supported.]) nroff="(nroff not installed)" AC_DEFINE([NROFF_MISSING], [1], [Define if you don't have nroff.]) fi +AC_DEFINE_UNQUOTED([PROG_NROFF], ["$nroff"], [Program to use as nroff.]) dnl It would be nice to use MAN_CHECK_PROGS here, but how do we determine dnl TROFF_IS_GROFF? @@ -180,6 +186,7 @@ else TROFF=troff fi AC_SUBST([TROFF]) +AC_DEFINE_UNQUOTED([PROG_TROFF], ["$troff"], [Program to use as troff.]) if test -n "$troff" then AC_DEFINE([HAS_TROFF], [1], [Define if you have troff.]) @@ -211,7 +218,7 @@ then AC_MSG_RESULT([$man_cv_prog_troff_options]) else AC_MSG_RESULT([ambiguous]) - AC_MSG_WARN([please edit include/manconfig.h and add troff definition]) + AC_MSG_WARN([please edit config.h and add troff definition]) fi else troff="(troff not installed)" @@ -270,6 +277,7 @@ then fi MAN_CHECK_PROGS([eqn], [EQN], [use EQN to preprocess equations], [eqn geqn]) +AC_DEFINE_UNQUOTED([PROG_EQN], ["$eqn"], [Program to use as eqn.]) MAN_CHECK_PROGS([neqn], [NEQN], [use NEQN to preprocess equations for character devices], [neqn gneqn]) # If we fail to find an neqn, use eqn and try to force it to output for an # ascii device. As this is only relevant for equations (?), not using latin1 @@ -279,7 +287,9 @@ then test -n "$eqn" && (test -n "$nroff_device" && neqn="$eqn -T$nroff_device" || neqn="$eqn -Tascii") fi +AC_DEFINE_UNQUOTED([PROG_NEQN], ["$neqn"], [Program to use as neqn.]) MAN_CHECK_PROGS([tbl], [TBL], [use TBL to preprocess tables], [tbl gtbl]) +AC_DEFINE_UNQUOTED([PROG_TBL], ["$tbl"], [Program to use as tbl.]) TBL_X_FORMAT= if test -n "$tbl" then @@ -299,11 +309,16 @@ then fi AC_SUBST([TBL_X_FORMAT]) MAN_CHECK_PROGS([col], [COL], [use COL to filter formatting characters from output], [col gcol]) +AC_DEFINE_UNQUOTED([PROG_COL], ["$col"], [Program to use as col.]) MAN_CHECK_PROGS([vgrind], [VGRIND], [use VGRIND to preprocess program sources], [vgrind gvgrind]) +AC_DEFINE_UNQUOTED([PROG_VGRIND], ["$vgrind"], [Program to use as vgrind.]) MAN_CHECK_PROGS([refer], [REFER], [use REFER to preprocess bibliographic references], [refer grefer]) +AC_DEFINE_UNQUOTED([PROG_REFER], ["$refer"], [Program to use as refer.]) MAN_CHECK_PROGS([grap], [GRAP], [use GRAP to preprocess graphs], [grap]) +AC_DEFINE_UNQUOTED([PROG_GRAP], ["$grap"], [Program to use as grap.]) MAN_CHECK_PROGS([pic], [PIC], [use PIC to preprocess pictures], [pic gpic]) test -n "$pic" && pic="$pic -S" +AC_DEFINE_UNQUOTED([PROG_PIC], ["$pic"], [Program to use as pic.]) MAN_CHECK_PROGS([gzip], [GZIP], [use GZIP as GNU compression utility], [gzip]) if test -n "$gzip" @@ -354,15 +369,25 @@ if test -n "$compressor" then AC_DEFINE([COMP_CAT], [1], [Define if you have compressors and want to support compressed cat files.]) fi +dnl Compressors are used for compressing cat pages. AC_SUBST([compressor]) -AC_SUBST([compress_ext]) -AC_SUBST([gunzip]) -AC_SUBST([uncompress]) -AC_SUBST([bunzip2]) -AC_SUBST([unlzma]) -AC_SUBST([unxz]) -AC_SUBST([unlzip]) -AC_SUBST([unzstd]) +AC_DEFINE_UNQUOTED( + [PROG_COMPRESSOR], ["$compressor"], + [Default compressor, used for compressing cat pages.]) +AC_DEFINE_UNQUOTED( + [COMPRESS_EXT], ["$compress_ext"], + [Default compression extension, used for compressing cat pages.]) +dnl Decompressors are used for decompressing cat pages and nroff source. +dnl To add further decompressors, you will also need to edit +dnl include/comp_src.h. +AC_DEFINE_UNQUOTED([PROG_GUNZIP], ["$gunzip"], [Program to use as gunzip.]) +AC_DEFINE_UNQUOTED( + [PROG_UNCOMPRESS], ["$uncompress"], [Program to use as uncompress.]) +AC_DEFINE_UNQUOTED([PROG_BUNZIP2], ["$bunzip2"], [Program to use as bunzip2.]) +AC_DEFINE_UNQUOTED([PROG_UNLZMA], ["$unlzma"], [Program to use as unlzma.]) +AC_DEFINE_UNQUOTED([PROG_UNXZ], ["$unxz"], [Program to use as unxz.]) +AC_DEFINE_UNQUOTED([PROG_UNLZIP], ["$unlzip"], [Program to use as unlzip.]) +AC_DEFINE_UNQUOTED([PROG_UNZSTD], ["$unzstd"], [Program to use as unzstd.]) MAN_COMPRESS_LIB([z], [gzopen]) dnl To add more decompressors just follow the scheme above. @@ -533,8 +558,6 @@ AC_CONFIG_FILES([Makefile libdb/Makefile docs/Makefile tools/Makefile - include/comp_src.h - include/manconfig.h po/Makefile.in]) if test -f "$srcdir/gl/po/Makefile.in.in"; then AC_CONFIG_FILES([gl/po/Makefile.in]) -- cgit v1.2.3