xref: /netbsd-src/external/bsd/mdocml/dist/configure.local.example (revision 544c191c349c1704c9d5e679d12ec15cff579663)
1*544c191cSchristos# Id: configure.local.example,v 1.36 2019/03/06 10:18:58 schwarze Exp
2fec65c98Schristos#
3*544c191cSchristos# Copyright (c) 2014-2019 Ingo Schwarze <schwarze@openbsd.org>
4fec65c98Schristos#
5fec65c98Schristos# Permission to use, copy, modify, and distribute this software for any
6fec65c98Schristos# purpose with or without fee is hereby granted, provided that the above
7fec65c98Schristos# copyright notice and this permission notice appear in all copies.
8fec65c98Schristos#
9fec65c98Schristos# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10fec65c98Schristos# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11fec65c98Schristos# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12fec65c98Schristos# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13fec65c98Schristos# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14fec65c98Schristos# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15fec65c98Schristos# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16fec65c98Schristos
17fec65c98Schristos# For all settings documented in this file, there are reasonable
18fec65c98Schristos# defaults and/or the ./configure script attempts autodetection.
19fec65c98Schristos# Consequently, you only need to create a file ./configure.local
20fec65c98Schristos# and put any of these settings into it if ./configure autodetection
21fec65c98Schristos# fails or if you want to make different choices for other reasons.
22fec65c98Schristos
23c9bcef03Schristos# If autodetection fails, please tell <tech@mandoc.bsd.lv>.
24fec65c98Schristos
25fec65c98Schristos# We recommend that you write ./configure.local from scratch and
26fec65c98Schristos# only put the lines there you need.  This file contains examples.
27fec65c98Schristos# It is not intended as a template to be copied as a whole.
28fec65c98Schristos
29fec65c98Schristos# --- user settings relevant for all builds ----------------------------
30fec65c98Schristos
31fec65c98Schristos# For -Tutf8 and -Tlocale operation, mandoc(1) requires <locale.h>
32fec65c98Schristos# providing setlocale(3) and <wchar.h> providing wcwidth(3) and
33fec65c98Schristos# putwchar(3) with a wchar_t storing UCS-4 values.  Theoretically,
34fec65c98Schristos# the latter should be tested with the __STDC_ISO_10646__ feature
35fec65c98Schristos# macro.  In practice, many <wchar.h> headers do not provide that
36fec65c98Schristos# macro even though they treat wchar_t as UCS-4.  So the automatic
37fec65c98Schristos# test only checks that wchar_t is wide enough, that is, at least
38fec65c98Schristos# four bytes.
39fec65c98Schristos
40fec65c98Schristos# The following line forces multi-byte support.
41fec65c98Schristos# If your C library does not treat wchar_t as UCS-4, the UTF-8 output
42fec65c98Schristos# mode will print garbage.
43fec65c98Schristos
44fec65c98SchristosHAVE_WCHAR=1
45fec65c98Schristos
46fec65c98Schristos# The following line disables multi-byte support.
47fec65c98Schristos# The output modes -Tutf8 and -Tlocale will be the same as -Tascii.
48fec65c98Schristos
49fec65c98SchristosHAVE_WCHAR=0
50fec65c98Schristos
519508192eSchristos# For -Tutf8 mode, mandoc needs to set an arbitrary locale having
529508192eSchristos# a UTF-8 character set.  If autodetection of a suitable locale
539508192eSchristos# fails or selects an undesirable locale, you can manually choose
549508192eSchristos# the locale for -Tutf8 mode:
559508192eSchristos
569508192eSchristosUTF8_LOCALE=en_US.UTF-8
579508192eSchristos
589ff1f2acSchristos# When man(1) or apropos(1) is called without -m and -M options,
599508192eSchristos# MANPATH is not set in the environment, and man.conf(5) is not
609508192eSchristos# available, manuals are searched for in the following directory
619508192eSchristos# trees by default.
629ff1f2acSchristos
639ff1f2acSchristosMANPATH_DEFAULT="/usr/share/man:/usr/X11R6/man:/usr/local/man"
649ff1f2acSchristos
65c9bcef03Schristos# Validation of cross references with mandoc -Tlint only looks
66c9bcef03Schristos# for manual pages in the following directories:
67c9bcef03Schristos
68c9bcef03SchristosMANPATH_BASE="/usr/share/man:/usr/X11R6/man"
69c9bcef03Schristos
70*544c191cSchristos# When man(1) is called with the -S option and no manual page is
71*544c191cSchristos# found matching the requested name and the requested architecture,
72*544c191cSchristos# it tries to figure out whether the requested architecture is valid
73*544c191cSchristos# for the present operating system.  Normally, ./configure detects
74*544c191cSchristos# the operating system using uname(1).  If that fails or is not
75*544c191cSchristos# desired, either of the following lines can be used:
76*544c191cSchristos
77*544c191cSchristosOSENUM=MANDOC_OS_NETBSD
78*544c191cSchristosOSENUM=MANDOC_OS_OPENBSD
79*544c191cSchristosOSENUM=MANDOC_OS_OTHER
80*544c191cSchristos
81fec65c98Schristos# In manual pages written in the mdoc(7) language, the operating system
82fec65c98Schristos# version is displayed in the page footer line.  If an operating system
83fec65c98Schristos# is specified as an argument to the .Os macro, that is always used.
84fec65c98Schristos# If the .Os macro has no argument and an operation system is specified
85fec65c98Schristos# with the mandoc(1) -Ios= command line option, that is used.
86fec65c98Schristos# Otherwise, the uname(3) library function is called at runtime to find
87fec65c98Schristos# the name of the operating system.
88fec65c98Schristos# If you do not want uname(3) to be called but instead want a fixed
89fec65c98Schristos# string to be used, use the following line:
90fec65c98Schristos
91*544c191cSchristosOSNAME="OpenBSD 6.5"
92fec65c98Schristos
93fec65c98Schristos# The following installation directories are used.
94fec65c98Schristos# It is possible to set only one or a few of these variables,
95fec65c98Schristos# there is no need to copy the whole block.
96fec65c98Schristos# Even if you set PREFIX to something else, the other variables
97fec65c98Schristos# pick it up without copying them all over.
98fec65c98Schristos
99fec65c98SchristosPREFIX="/usr/local"
100fec65c98SchristosBINDIR="${PREFIX}/bin"
101fec65c98SchristosSBINDIR="${PREFIX}/sbin"
102fec65c98SchristosMANDIR="${PREFIX}/man"
103fec65c98Schristos
104c9bcef03Schristos# If BINDIR and SBINDIR are not subdirectories of the same parent
105c9bcef03Schristos# directory or if the basename(1) of BINDIR differs from "bin",
106c9bcef03Schristos# the relative path from SBINDIR to BINDIR is also needed.
107c9bcef03Schristos# The default is:
108c9bcef03Schristos
109c9bcef03SchristosBIN_FROM_SBIN="../bin"
110c9bcef03Schristos
1119ff1f2acSchristos# Some distributions may want to avoid naming conflicts
1129ff1f2acSchristos# with the configuration files of other man(1) implementations.
1139ff1f2acSchristos# This changes the name of the installed section 5 manual page as well.
114c9bcef03Schristos
1159ff1f2acSchristosMANM_MANCONF="mandoc.conf"	# default is "man.conf"
1169ff1f2acSchristos
117fec65c98Schristos# Some distributions may want to avoid naming conflicts among manuals.
118fec65c98Schristos# If you want to change the names of installed section 7 manual pages,
119fec65c98Schristos# the following alternative names are suggested.
120fec65c98Schristos# The suffix ".7" will automatically be appended.
121fec65c98Schristos# It is possible to set only one or a few of these variables,
122fec65c98Schristos# there is no need to copy the whole block.
123fec65c98Schristos
124fec65c98SchristosMANM_MAN="mandoc_man"		# default is "man"
125fec65c98SchristosMANM_MDOC="mandoc_mdoc"		# default is "mdoc"
126fec65c98SchristosMANM_ROFF="mandoc_roff"		# default is "roff"
127fec65c98SchristosMANM_EQN="mandoc_eqn"		# default is "eqn"
128fec65c98SchristosMANM_TBL="mandoc_tbl"		# default is "tbl"
129fec65c98Schristos
1309508192eSchristos# Some distributions may want to avoid naming conflicts with
1319508192eSchristos# other man(1), apropos(1), makewhatis(8), or soelim(1) utilities.
1329ff1f2acSchristos# If you want to change the names of binary programs,
1339ff1f2acSchristos# the following alternative names are suggested.
1349ff1f2acSchristos# Using different names is possible as well.
1359508192eSchristos# This changes the names of the installed section 1 and section 8
1369508192eSchristos# manual pages as well.
1379508192eSchristos# It is possible to set only one or two of these variables,
1389508192eSchristos# there is no need to copy the whole block.
139fec65c98Schristos
140fec65c98SchristosBINM_MAN=mman			# default is "man"
1419508192eSchristosBINM_APROPOS=mapropos		# default is "apropos"
1429508192eSchristosBINM_WHATIS=mwhatis		# default is "whatis"
1439508192eSchristosBINM_MAKEWHATIS=mandocdb	# default is "makewhatis"
1449ff1f2acSchristosBINM_SOELIM=msoelim		# default is "soelim"
1459ff1f2acSchristos
1469508192eSchristos# Some distributions do not want hardlinks
1479508192eSchristos# between installed binary programs.
1489508192eSchristos# Set the following variable to use symbolic links instead.
1499508192eSchristos# It is also used for links between manual pages.
1509508192eSchristos# It is only used by the install* targets.
1519508192eSchristos# When using this, DESTDIR must be empty or an absolute path.
1529508192eSchristos
1539508192eSchristosLN="ln -sf"			# default is "ln -f"
1549508192eSchristos
1559ff1f2acSchristos# Before falling back to the bundled version of the ohash(3) hashing
1569ff1f2acSchristos# library, autoconfiguration tries the following linker flag to
1579ff1f2acSchristos# link against your system version.  If you do have ohash(3) on
1589ff1f2acSchristos# your system but it needs different linker flags, set the following
1599ff1f2acSchristos# variable to specify the required linker flags.
1609ff1f2acSchristos
1619ff1f2acSchristosLD_OHASH="-lutil"
1629ff1f2acSchristos
1639508192eSchristos# Some platforms may need an additional linker flag for nanosleep(2).
1649508192eSchristos# If none is needed or it is -lrt, it is autodetected.
1659508192eSchristos# Otherwise, set the following variable.
1669508192eSchristos
1679508192eSchristosLD_NANOSLEEP="-lrt"
1689508192eSchristos
1699508192eSchristos# Some platforms may need an additional linker flag for recvmsg(2).
1709508192eSchristos# If none is needed or it is -lsocket, it is autodetected.
1719508192eSchristos# Otherwise, set the following variable.
1729508192eSchristos
1739508192eSchristosLD_RECVMSG="-lsocket"
1749508192eSchristos
1759508192eSchristos# Some platforms might need additional linker flags to link against
1769508192eSchristos# libmandoc that are not autodetected, though no such cases are
1779508192eSchristos# currently known.
1789508192eSchristos
1799508192eSchristosLDADD="-lm"
1809ff1f2acSchristos
1819ff1f2acSchristos# Some systems may want to set additional linker flags for all the
1829ff1f2acSchristos# binaries, not only for those using libmandoc, for example for
1839ff1f2acSchristos# hardening options.
1849ff1f2acSchristos
1859ff1f2acSchristosLDFLAGS="-Wl,-z,relro"
186fec65c98Schristos
187fec65c98Schristos# It is possible to change the utility program used for installation
188fec65c98Schristos# and the modes files are installed with.  The defaults are:
189fec65c98Schristos
190fec65c98SchristosINSTALL="install"
191fec65c98SchristosINSTALL_PROGRAM="${INSTALL} -m 0555"
192fec65c98SchristosINSTALL_LIB="${INSTALL} -m 0444"
193fec65c98SchristosINSTALL_MAN="${INSTALL} -m 0444"
194fec65c98SchristosINSTALL_DATA="${INSTALL} -m 0444"
195fec65c98Schristos
196fec65c98Schristos# When using the "homebrew" package manager on Mac OS X, the actual
197fec65c98Schristos# manuals are located in a so-called "cellar" and only symlinked
198fec65c98Schristos# into the manual trees.  To allow mandoc to follow such symlinks,
199fec65c98Schristos# you have to specify the physical location of the cellar as returned
200fec65c98Schristos# by realpath(3), for example:
201fec65c98Schristos
202fec65c98SchristosPREFIX="/usr/local"
203fec65c98SchristosHOMEBREWDIR="${PREFIX}/Cellar"
204fec65c98Schristos
2059508192eSchristos# --- user settings for the mandoc(3) library --------------------------
2069508192eSchristos
2079508192eSchristos# By default, libmandoc.a is not installed.  It is almost never needed
2089508192eSchristos# because there is almost no non-mandoc software out there using this
2099508192eSchristos# library.  The one notable exception is NetBSD apropos(1).
2109508192eSchristos# So, when building for the NetBSD base system - but not for NetBSD
2119508192eSchristos# ports nor for pkgsrc! - you may want the following:
2129508192eSchristos
2139508192eSchristosINSTALL_LIBMANDOC=1
2149508192eSchristos
2159508192eSchristos# The following settings are only used when INSTALL_LIBMANDOC is set.
2169508192eSchristos
2179508192eSchristosINCLUDEDIR="${PREFIX}/include/mandoc"
2189508192eSchristosLIBDIR="${PREFIX}/lib/mandoc"
2199508192eSchristos
2209508192eSchristos# --- user settings related to man.cgi ---------------------------------
221fec65c98Schristos
222fec65c98Schristos# By default, building man.cgi(8) is disabled.  To enable it, copy
223fec65c98Schristos# cgi.h.example to cgi.h, edit it, and use the following line.
224fec65c98Schristos
225fec65c98SchristosBUILD_CGI=1
226fec65c98Schristos
227fec65c98Schristos# The remaining settings in this section are only relevant if BUILD_CGI
228fec65c98Schristos# is enabled.  Otherwise, they have no effect either way.
229fec65c98Schristos
230c9bcef03Schristos# By default, man.cgi(8) is linked statically if the compiler supports
231c9bcef03Schristos# the -static option.  If automatic detection fails, you can force
232c9bcef03Schristos# static linking of man.cgi(8).
233fec65c98Schristos
234c9bcef03SchristosSTATIC="-static"
235fec65c98Schristos
236c9bcef03Schristos# Some systems may require -pthread for static linking:
237fec65c98Schristos
238fec65c98SchristosSTATIC="-static -pthread"
239fec65c98Schristos
240c9bcef03Schristos# If static linking works in general but not with additional libraries
241c9bcef03Schristos# like -lrt or -lz, you can force dynamic linking.  This may for
242c9bcef03Schristos# example be required on SunOS 5.9.
243c9bcef03Schristos
244c9bcef03SchristosSTATIC=" "
245c9bcef03Schristos
246fec65c98Schristos# Some directories.
247fec65c98Schristos# This works just like PREFIX, see above.
248fec65c98Schristos
249fec65c98SchristosWWWPREFIX="/var/www"
250fec65c98SchristosHTDOCDIR="${WWWPREFIX}/htdocs"
251fec65c98SchristosCGIBINDIR="${WWWPREFIX}/cgi-bin"
252fec65c98Schristos
2539508192eSchristos# --- user settings related to catman ----------------------------------
2549508192eSchristos
2559508192eSchristos# By default, building mandocd(8) and catman(8) is disabled.
2569508192eSchristos# To enable it, use the following line.
2579508192eSchristos# It does not work on SunOS 5.10 because there is no mkdirat(2)
2589508192eSchristos# nor on SunOS 5.9 which also lacks CMSG_LEN(3) and CMSG_SPACE(3).
2599508192eSchristos
2609508192eSchristosBUILD_CATMAN=1
2619508192eSchristos
2629508192eSchristos# Install catman(8) with a different name.
2639508192eSchristos# See BINM_MAN above for details of how this works.
2649508192eSchristos
2659508192eSchristosBINM_CATMAN=mcatman		# default is "catman"
2669508192eSchristos
267fec65c98Schristos# --- settings that rarely need to be touched --------------------------
268fec65c98Schristos
269fec65c98Schristos# Do not set these variables unless you really need to.
270fec65c98Schristos
271fec65c98Schristos# You can manually override the compiler to be used.
272fec65c98Schristos# But that's rarely useful because ./configure asks your make(1)
273fec65c98Schristos# which compiler to use, and that answer will hardly be wrong.
274fec65c98Schristos
275fec65c98SchristosCC=cc
276fec65c98Schristos
277c9bcef03Schristos# Because the system compiler may not provide <stdint.h>,
278c9bcef03Schristos# SunOS 5.9 may need:
279c9bcef03Schristos
280c9bcef03SchristosCC=gcc
281c9bcef03Schristos
2829ff1f2acSchristos# IBM AIX may need:
2839ff1f2acSchristos
2849ff1f2acSchristosCC=xlc
2859ff1f2acSchristos
286c9bcef03Schristos# Normally, leave CFLAGS unset.  In that case, -g will automatically
287c9bcef03Schristos# be used, and various -W options will be added if the compiler
288c9bcef03Schristos# supports them.  If you define CFLAGS manually, it will be used
289c9bcef03Schristos# unchanged, and nothing will be added.
2909ff1f2acSchristos
2919ff1f2acSchristosCFLAGS="-g"
2929ff1f2acSchristos
293fec65c98Schristos# In rare cases, it may be required to skip individual automatic tests.
294fec65c98Schristos# Each of the following variables can be set to 0 (test will not be run
295fec65c98Schristos# and will be regarded as failed) or 1 (test will not be run and will
296fec65c98Schristos# be regarded as successful).
297fec65c98Schristos
298fec65c98SchristosHAVE_DIRENT_NAMLEN=0
2999508192eSchristosHAVE_ENDIAN=0
3009508192eSchristosHAVE_EFTYPE=0
3019ff1f2acSchristosHAVE_ERR=0
3029508192eSchristosHAVE_FTS=0  # Setting this implies HAVE_FTS_COMPARE_CONST=0.
3039508192eSchristosHAVE_FTS_COMPARE_CONST=0  # Setting this implies HAVE_FTS=1.
3049ff1f2acSchristosHAVE_GETLINE=0
305fec65c98SchristosHAVE_GETSUBOPT=0
3069ff1f2acSchristosHAVE_ISBLANK=0
307*544c191cSchristosHAVE_LESS_T=0
3089ff1f2acSchristosHAVE_MKDTEMP=0
3099508192eSchristosHAVE_NTOHL=0
3109508192eSchristosHAVE_O_DIRECTORY=0
3119508192eSchristosHAVE_OHASH=0
3129508192eSchristosHAVE_PATH_MAX=0
3139ff1f2acSchristosHAVE_PLEDGE=0
3149ff1f2acSchristosHAVE_PROGNAME=0
315fec65c98SchristosHAVE_REALLOCARRAY=0
316c9bcef03SchristosHAVE_RECALLOCARRAY=0
3179ff1f2acSchristosHAVE_REWB_BSD=0
3189ff1f2acSchristosHAVE_REWB_SYSV=0
319fec65c98SchristosHAVE_STRCASESTR=0
3209ff1f2acSchristosHAVE_STRINGLIST=0
321fec65c98SchristosHAVE_STRLCAT=0
322fec65c98SchristosHAVE_STRLCPY=0
323fec65c98SchristosHAVE_STRPTIME=0
324fec65c98SchristosHAVE_STRSEP=0
325fec65c98SchristosHAVE_STRTONUM=0
3269508192eSchristosHAVE_SYS_ENDIAN=0
3279ff1f2acSchristosHAVE_VASPRINTF=0
3289ff1f2acSchristosHAVE_WCHAR=0
329