From 916afae122e94e9627eab3ab62e1d5391e0e1fec Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Sun, 22 Mar 2015 18:14:30 +0000 Subject: make MANPATH_DEFAULT compile-time configurable --- configure | 2 ++ configure.local.example | 9 ++++++++- manpath.c | 3 +-- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/configure b/configure index 0a2fae40..0e20da5e 100755 --- a/configure +++ b/configure @@ -31,6 +31,7 @@ echo "config.log: writing..." # Initialize all variables here, # such that nothing can leak in from the environment. +MANPATH_DEFAULT="/usr/share/man:/usr/X11R6/man:/usr/local/man" OSNAME= CC=`printf "all:\\n\\t@echo \\\$(CC)\\n" | make -f -` @@ -278,6 +279,7 @@ __HEREDOC__ [ ${HAVE_FGETLN} -eq 0 ] && echo "#include " echo +echo "#define MANPATH_DEFAULT \"${MANPATH_DEFAULT}\"" [ -n "${OSNAME}" ] && echo "#define OSNAME \"${OSNAME}\"" [ -n "${HOMEBREWDIR}" ] && echo "#define HOMEBREWDIR \"${HOMEBREWDIR}\"" diff --git a/configure.local.example b/configure.local.example index bb391591..cf30c9af 100644 --- a/configure.local.example +++ b/configure.local.example @@ -1,4 +1,4 @@ -# $Id: configure.local.example,v 1.6 2015/02/16 14:56:22 schwarze Exp $ +# $Id: configure.local.example,v 1.7 2015/03/22 18:14:30 schwarze Exp $ # # Copyright (c) 2014, 2015 Ingo Schwarze # @@ -48,6 +48,13 @@ HAVE_WCHAR=1 HAVE_WCHAR=0 +# When man(1) or apropos(1) is called without -m and -M options, +# MANPATH is not set in the environment, man.conf(5) is not available +# and manpath(1) not used, manuals are searched for in the following +# directory trees by default. + +MANPATH_DEFAULT="/usr/share/man:/usr/X11R6/man:/usr/local/man" + # In manual pages written in the mdoc(7) language, the operating system # version is displayed in the page footer line. If an operating system # is specified as an argument to the .Os macro, that is always used. diff --git a/manpath.c b/manpath.c index 57572e55..f5ef2cc4 100644 --- a/manpath.c +++ b/manpath.c @@ -1,4 +1,4 @@ -/* $Id: manpath.c,v 1.20 2015/03/21 17:19:36 schwarze Exp $ */ +/* $Id: manpath.c,v 1.21 2015/03/22 18:14:30 schwarze Exp $ */ /* * Copyright (c) 2011, 2014, 2015 Ingo Schwarze * Copyright (c) 2011 Kristaps Dzonsons @@ -32,7 +32,6 @@ #define MAN_CONF_FILE "/etc/man.conf" #define MAN_CONF_KEY "_whatdb" -#define MANPATH_DEFAULT "/usr/share/man:/usr/X11R6/man:/usr/local/man" static void manpath_add(struct manpaths *, const char *, int); static void manpath_parseline(struct manpaths *, char *, int); -- cgit v1.2.3-56-ge451