aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2015-03-22 18:14:30 +0000
committerIngo Schwarze <schwarze@openbsd.org>2015-03-22 18:14:30 +0000
commit916afae122e94e9627eab3ab62e1d5391e0e1fec (patch)
tree9fe1eb80edf8e1516007756fc8e0029f38e33ddc
parent2dd6335f7e38c6febe4d28c1b9d484009f454ef7 (diff)
downloadmandoc-916afae122e94e9627eab3ab62e1d5391e0e1fec.tar.gz
mandoc-916afae122e94e9627eab3ab62e1d5391e0e1fec.tar.zst
mandoc-916afae122e94e9627eab3ab62e1d5391e0e1fec.zip
make MANPATH_DEFAULT compile-time configurable
-rwxr-xr-xconfigure2
-rw-r--r--configure.local.example9
-rw-r--r--manpath.c3
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 <stdio.h>"
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 <schwarze@openbsd.org>
#
@@ -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 <schwarze@openbsd.org>
* Copyright (c) 2011 Kristaps Dzonsons <kristaps@bsd.lv>
@@ -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);