diff options
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | README.md | 6 | ||||
-rw-r--r-- | configure.ac | 47 | ||||
-rw-r--r-- | include/comp_src.h (renamed from include/comp_src.h.in) | 4 | ||||
-rw-r--r-- | include/manconfig.h (renamed from include/manconfig.h.in) | 100 | ||||
-rw-r--r-- | m4/man-arg-override-dir.m4 | 5 |
6 files changed, 47 insertions, 116 deletions
@@ -22,7 +22,6 @@ /libtool /stamp-h* docs/INSTALL.autoconf -include/*.h init/systemd/man-db.conf init/systemd/man-db.service lib/.deps @@ -64,7 +64,7 @@ As of May 13th, 2001, the last public release of the Filesystem Hierarchy Standard proposed the root of the manual page hierarchy as `/usr/share` and the root of the writable cat hierarchy as `/var/cache/man` for the purposes of man-to-cat filename translation. As such, the following are defined in -`./include/manconfig.h.in`: +`./include/manconfig.h`: ```c #define FHS_CAT_ROOT "/var/cache/man" /* required by fsstnd() */ @@ -172,8 +172,8 @@ Configure man-db: **Browse** or **edit** the following files that were created by the configuration process: -* `include/manconfig.h` regarding paths to support programs, - the default section list and other specific definitions. +* `include/manconfig.h` regarding the default section list and other + specific definitions. * `include/comp_src.h` if the default compressor support is inadequate for your requirements. (Usually `.Z` [compress], 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]) diff --git a/include/comp_src.h.in b/include/comp_src.h index 6827d550..2be2614b 100644 --- a/include/comp_src.h.in +++ b/include/comp_src.h @@ -1,8 +1,8 @@ -/* @configure_input@ - * +/* * comp_src.h: structure used by decompress.c * * Copyright (C) 1994 Graeme W. Wilford. (Wilf.) + * Copyright (C) 2003-2022 Colin Watson. * * This file is part of man-db. * diff --git a/include/manconfig.h.in b/include/manconfig.h index 61a2194b..feebd208 100644 --- a/include/manconfig.h.in +++ b/include/manconfig.h @@ -1,9 +1,8 @@ -/* @configure_input@ - * - * manconfig.h.in: definitions and declarations used throughout man-db +/* + * manconfig.h: definitions and declarations used throughout man-db * * Copyright (C) 1994, 1995 Graeme W. Wilford. (Wilf.) - * Copyright (C) 2001, 2002 Colin Watson. + * Copyright (C) 2001-2022 Colin Watson. * * This file is part of man-db. * @@ -97,77 +96,6 @@ #define MAN_DB "/index" DB_EXT #define mkdbname(path) xasprintf ("%s%s", path, MAN_DB) -/* The locations of the following files were determined by ../configure so - some of them may be incorrect. Edit as necessary */ - -#ifndef PROG_PAGER -# define PROG_PAGER "@pager@" -#endif - -#ifndef PROG_CAT -# define PROG_CAT "@cat@" -#endif - -#ifndef PROG_BROWSER -# define PROG_BROWSER "@browser@" -#endif - -#ifndef PROG_TR -# define PROG_TR "@tr@" -#endif - -#ifndef PROG_GREP -# define PROG_GREP "@grep@" -#endif - -#ifdef HAS_TROFF -# ifndef PROG_TROFF -# define PROG_TROFF "@troff@" -# endif -#endif - -#ifndef NROFF_MISSING -# ifndef PROG_NROFF -# define PROG_NROFF "@nroff@" -# endif -#endif - -#ifndef PROG_EQN -# define PROG_EQN "@eqn@" -#endif - -#ifndef PROG_NEQN -# define PROG_NEQN "@neqn@" -#endif - -#ifndef PROG_TBL -# define PROG_TBL "@tbl@" -#endif - -#ifndef PROG_COL -# define PROG_COL "@col@" -#endif - -#ifndef PROG_VGRIND -# define PROG_VGRIND "@vgrind@" -#endif - -#ifndef PROG_REFER -# define PROG_REFER "@refer@" -#endif - -#ifndef PROG_GRAP -# define PROG_GRAP "@grap@" -#endif - -#ifndef PROG_PIC -# define PROG_PIC "@pic@" -#endif - -#ifndef OVERRIDE_DIR -# define OVERRIDE_DIR "@override_dir@" -#endif - /*------------------------------------------------------------------*/ /* The following definitions are best left alone by the uninitiated */ /*------------------------------------------------------------------*/ @@ -205,28 +133,6 @@ # define TR_SET2 " \'\\055\\157\\047\\170\'" #endif -#ifdef COMP_CAT -/* This is the default compressor and compressed extension. - These are used for compressing cat pages. The compressor is likely to - be gzip or compress and the extension: .gz or .Z . Please make sure that - all of your cat pages have the same extension (whatever that may be) */ - -# define PROG_COMPRESSOR "@compressor@" -# define COMPRESS_EXT "@compress_ext@" -#endif /* COMP_CAT */ - -/* These are the currently supported decompressors. They are used for - decompressing cat pages and source nroff. To add further decompressors, - you will need to edit comp_src.h[.in] . Help is provided in the file */ - -#define PROG_GUNZIP "@gunzip@" -#define PROG_UNCOMPRESS "@uncompress@" -#define PROG_BUNZIP2 "@bunzip2@" -#define PROG_UNLZMA "@unlzma@" -#define PROG_UNXZ "@unxz@" -#define PROG_UNLZIP "@unlzip@" -#define PROG_UNZSTD "@unzstd@" - /*-----------------------------------------------------------------------*/ /* The things below here shouldn't really be changed unless you really */ /* know what you are doing. */ diff --git a/m4/man-arg-override-dir.m4 b/m4/man-arg-override-dir.m4 index 6a94ec38..88c75524 100644 --- a/m4/man-arg-override-dir.m4 +++ b/m4/man-arg-override-dir.m4 @@ -1,4 +1,4 @@ -# man-arg-override-dir.m4 serial 1 +# man-arg-override-dir.m4 serial 2 dnl MAN_ARG_OVERRIDE_DIR dnl Add an --enable-override-dir option. @@ -14,4 +14,7 @@ AC_ARG_WITH([override-dir], fi], [: ${override_dir=""}]) AC_SUBST([override_dir]) +AC_DEFINE_UNQUOTED( + [OVERRIDE_DIR], ["$$override_dir"], + [Relative override directory inside man path.]) ]) |