]> git.cameronkatri.com Git - mandoc.git/blob - configure
Bugfix:
[mandoc.git] / configure
1 #!/bin/sh
2 #
3 # $Id: configure,v 1.67 2018/08/15 02:15:52 schwarze Exp $
4 #
5 # Copyright (c) 2014,2015,2016,2017,2018 Ingo Schwarze <schwarze@openbsd.org>
6 #
7 # Permission to use, copy, modify, and distribute this software for any
8 # purpose with or without fee is hereby granted, provided that the above
9 # copyright notice and this permission notice appear in all copies.
10 #
11 # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
12 # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
13 # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
14 # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
15 # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
16 # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
17 # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18
19 set -e
20
21 [ -w config.log ] && mv config.log config.log.old
22 [ -w config.h ] && mv config.h config.h.old
23
24 # Output file descriptor usage:
25 # 1 (stdout): config.h, Makefile.local
26 # 2 (stderr): original stderr, usually to the console
27 # 3: config.log
28
29 exec 3> config.log
30 echo "file config.log: writing..."
31
32 # --- default settings -------------------------------------------------
33 # Initialize all variables here,
34 # such that nothing can leak in from the environment.
35
36 SOURCEDIR=`dirname "$0"`
37
38 MANPATH_BASE="/usr/share/man:/usr/X11R6/man"
39 MANPATH_DEFAULT="/usr/share/man:/usr/X11R6/man:/usr/local/man"
40 OSNAME=
41 UTF8_LOCALE=
42
43 CC=`printf "all:\\n\\t@echo \\\$(CC)\\n" | env -i make -sf -`
44 CFLAGS=
45 LDADD=
46 LDFLAGS=
47 LD_NANOSLEEP=
48 LD_OHASH=
49 LD_RECVMSG=
50 STATIC=
51
52 BUILD_CGI=0
53 BUILD_CATMAN=0
54 INSTALL_LIBMANDOC=0
55
56 HAVE_CMSG=
57 HAVE_CMSG_XPG42=0
58 HAVE_DIRENT_NAMLEN=
59 HAVE_EFTYPE=
60 HAVE_ENDIAN=
61 HAVE_ERR=
62 HAVE_FTS=
63 HAVE_FTS_COMPARE_CONST=
64 HAVE_GETLINE=
65 HAVE_GETSUBOPT=
66 HAVE_ISBLANK=
67 HAVE_MKDTEMP=
68 HAVE_NANOSLEEP=
69 HAVE_NTOHL=
70 HAVE_O_DIRECTORY=
71 HAVE_OHASH=
72 HAVE_PATH_MAX=
73 HAVE_PLEDGE=
74 HAVE_PROGNAME=
75 HAVE_REALLOCARRAY=
76 HAVE_RECALLOCARRAY=
77 HAVE_RECVMSG=
78 HAVE_REWB_BSD=
79 HAVE_REWB_SYSV=
80 HAVE_SANDBOX_INIT=
81 HAVE_STRCASESTR=
82 HAVE_STRINGLIST=
83 HAVE_STRLCAT=
84 HAVE_STRLCPY=
85 HAVE_STRNDUP=
86 HAVE_STRPTIME=
87 HAVE_STRSEP=
88 HAVE_STRTONUM=
89 HAVE_SYS_ENDIAN=
90 HAVE_VASPRINTF=
91 HAVE_WCHAR=
92
93 NEED_GNU_SOURCE=0
94 NEED_OPENBSD_SOURCE=0
95
96 PREFIX="/usr/local"
97 BINDIR=
98 SBINDIR=
99 BIN_FROM_SBIN=
100 INCLUDEDIR=
101 LIBDIR=
102 MANDIR=
103 HOMEBREWDIR=
104
105 WWWPREFIX="/var/www"
106 HTDOCDIR=
107 CGIBINDIR=
108
109 BINM_APROPOS="apropos"
110 BINM_CATMAN="catman"
111 BINM_MAKEWHATIS="makewhatis"
112 BINM_MAN="man"
113 BINM_SOELIM="soelim"
114 BINM_WHATIS="whatis"
115 MANM_MAN="man"
116 MANM_MANCONF="man.conf"
117 MANM_MDOC="mdoc"
118 MANM_ROFF="roff"
119 MANM_EQN="eqn"
120 MANM_TBL="tbl"
121
122 INSTALL="install"
123 INSTALL_PROGRAM=
124 INSTALL_LIB=
125 INSTALL_MAN=
126 INSTALL_DATA=
127 LN="ln -f"
128
129 # --- manual settings from configure.local -----------------------------
130
131 if [ -r ./configure.local ]; then
132 echo "file configure.local: reading..." 1>&2
133 echo "file configure.local: reading..." 1>&3
134 cat ./configure.local 1>&3
135 . ./configure.local
136 else
137 echo "file configure.local: no (fully automatic configuration)" 1>&2
138 echo "file configure.local: no (fully automatic configuration)" 1>&3
139 fi
140 echo 1>&3
141
142 # --- tests functions --------------------------------------------------
143
144 # Check whether this HAVE_ setting is manually overridden.
145 # If yes, use the override, if no, do not decide anything yet.
146 # Arguments: test file name, test var name, manual value
147 ismanual() {
148 [ -z "${3}" ] && return 1
149 echo "tested ${1}: HAVE_${2}=${3} (manual)" 1>&2
150 echo "tested ${1}: HAVE_${2}=${3} (manual)" 1>&3
151 echo 1>&3
152 return 0
153 }
154
155 # Run a single autoconfiguration test.
156 # In case of success, enable the feature.
157 # In case of failure, do not decide anything yet.
158 # Arguments: test file name, test var name, additional CFLAGS
159 singletest() {
160 n=${1}${3}${4}
161 cat 1>&3 << __HEREDOC__
162 testing ${n} ...
163 ${COMP} -o test-${1} test-${1}.c ${3} ${4}
164 __HEREDOC__
165
166 if ${COMP} -o "test-${1}" "${SOURCEDIR}/test-${1}.c" ${3} ${4} 1>&3 2>&3
167 then
168 echo "partial result of ${n}: ${CC} succeeded" 1>&3
169 else
170 echo "result of ${n}: ${CC} failed with exit status $?" 1>&3
171 echo "result of compiling ${n}: no" 1>&3
172 echo 1>&3
173 return 1
174 fi
175
176 if ./test-${1} 1>&3 2>&3; then
177 echo "tested ${n}: yes" 1>&2
178 echo "result of running ${n}: yes" 1>&3
179 echo 1>&3
180 eval HAVE_${2}=1
181 [ "X$3" = "X-D_GNU_SOURCE" ] && NEED_GNU_SOURCE=1
182 [ "X$3" = "X-D_OPENBSD_SOURCE" ] && NEED_OPENBSD_SOURCE=1
183 rm "test-${1}"
184 return 0
185 else
186 echo "result of ${n}: execution failed with exit status $?" 1>&3
187 echo "result of running ${n}: no" 1>&3
188 echo 1>&3
189 rm "test-${1}"
190 return 1
191 fi
192 }
193
194 # Run a complete autoconfiguration test, including the check for
195 # a manual override and disabling the feature on failure.
196 # Arguments: test file name, test var name, additional CFLAGS
197 runtest() {
198 eval _manual=\${HAVE_${2}}
199 ismanual "${1}" "${2}" "${_manual}" && return 0
200 singletest "${1}" "${2}" "${3}" "${4}" && return 0
201 echo "tested ${1}${3}${4}: no" 1>&2
202 eval HAVE_${2}=0
203 return 1
204 }
205
206 # Select a UTF-8 locale.
207 get_locale() {
208 [ -n "${HAVE_WCHAR}" ] && [ "${HAVE_WCHAR}" -eq 0 ] && return 0
209 ismanual UTF8_LOCALE UTF8_LOCALE "$UTF8_LOCALE" && return 0
210 echo "testing UTF8_LOCALE ..." 1>&3
211 UTF8_LOCALE=`locale -a | grep -i '^en_US\.UTF-*8$' | head -n 1`
212 if [ -z "${UTF8_LOCALE}" ]; then
213 UTF8_LOCALE=`locale -a | grep -i '\.UTF-*8' | head -n 1`
214 [ -n "${UTF8_LOCALE}" ] || return 1
215 fi
216 echo "selected UTF8_LOCALE=${UTF8_LOCALE}" 1>&2
217 echo "selected UTF8_LOCALE=${UTF8_LOCALE}" 1>&3
218 echo 1>&3
219 return 0;
220 }
221
222 # --- compiler options -------------------------------------------------
223
224 DEFCFLAGS="-g -W -Wall -Wmissing-prototypes -Wstrict-prototypes -Wwrite-strings -Wno-unused-parameter"
225
226 if [ -n "${CFLAGS}" ]; then
227 COMP="${CC} ${CFLAGS} -Wno-unused -Werror"
228 else
229 COMP="${CC} ${DEFCFLAGS} -Wno-unused -Werror"
230 fi
231 echo -n "tested ${CC} -W: " 1>&2
232 echo -n "testing ${CC} -W: " 1>&3
233 runtest noop WFLAG || true
234
235 if [ -n "${CFLAGS}" ]; then
236 echo "CFLAGS specified manually:" 1>&3
237 elif [ ${HAVE_WFLAG} -eq 0 ]; then
238 CFLAGS="-g"
239 else
240 CFLAGS="${DEFCFLAGS}"
241 fi
242 echo "selected CFLAGS=\"${CFLAGS}\"" 1>&2
243 echo "selected CFLAGS=\"${CFLAGS}\"" 1>&3
244 echo 1>&3
245
246 COMP="${CC} ${CFLAGS}"
247 [ ${HAVE_WFLAG} -eq 0 ] || COMP="${COMP} -Wno-unused -Werror"
248
249 if [ -n "${STATIC}" ]; then
250 echo "selected STATIC=\"${STATIC}\" (manual)" 1>&2
251 echo "selected STATIC=\"${STATIC}\" (manual)" 1>&3
252 echo 1>&3
253 else
254 runtest noop STATIC -static || true
255 [ ${HAVE_STATIC} -eq 0 ] || STATIC="-static"
256 echo "selected STATIC=\"${STATIC}\"" 1>&2
257 echo "selected STATIC=\"${STATIC}\"" 1>&3
258 echo 1>&3
259 fi
260
261 # --- tests for config.h ----------------------------------------------
262
263 # --- library functions ---
264 runtest dirent-namlen DIRENT_NAMLEN || true
265 runtest be32toh ENDIAN || true
266 runtest be32toh SYS_ENDIAN -DSYS_ENDIAN || true
267 runtest EFTYPE EFTYPE || true
268 runtest err ERR || true
269 runtest getline GETLINE || true
270 singletest getsubopt GETSUBOPT || \
271 runtest getsubopt GETSUBOPT -D_GNU_SOURCE || true
272 runtest isblank ISBLANK || true
273 runtest mkdtemp MKDTEMP || true
274 runtest ntohl NTOHL || true
275 runtest O_DIRECTORY O_DIRECTORY || true
276 runtest PATH_MAX PATH_MAX || true
277 runtest pledge PLEDGE || true
278 runtest sandbox_init SANDBOX_INIT || true
279 runtest progname PROGNAME || true
280 singletest reallocarray REALLOCARRAY || \
281 runtest reallocarray REALLOCARRAY -D_OPENBSD_SOURCE || true
282 singletest recallocarray RECALLOCARRAY || \
283 runtest recallocarray RECALLOCARRAY -D_OPENBSD_SOURCE || true
284 runtest rewb-bsd REWB_BSD || true
285 runtest rewb-sysv REWB_SYSV || true
286 singletest strcasestr STRCASESTR || \
287 runtest strcasestr STRCASESTR -D_GNU_SOURCE || true
288 runtest stringlist STRINGLIST || true
289 runtest strlcat STRLCAT || true
290 runtest strlcpy STRLCPY || true
291 runtest strndup STRNDUP || true
292 singletest strptime STRPTIME || \
293 runtest strptime STRPTIME -D_GNU_SOURCE || true
294 runtest strsep STRSEP || true
295 singletest strtonum STRTONUM || \
296 runtest strtonum STRTONUM -D_OPENBSD_SOURCE || true
297 singletest vasprintf VASPRINTF || \
298 runtest vasprintf VASPRINTF -D_GNU_SOURCE || true
299
300 if [ ${HAVE_ENDIAN} -eq 0 -a \
301 ${HAVE_SYS_ENDIAN} -eq 0 -a \
302 ${HAVE_NTOHL} -eq 0 ]; then
303 echo "FATAL: no endian conversion functions found" 1>&2
304 echo "FATAL: no endian conversion functions found" 1>&3
305 exit 1
306 fi
307
308 if ismanual fts FTS ${HAVE_FTS}; then
309 HAVE_FTS_COMPARE_CONST=0
310 elif runtest fts FTS_COMPARE_CONST -DFTS_COMPARE_CONST; then
311 HAVE_FTS=1
312 else
313 runtest fts FTS || true
314 fi
315
316 # --- wide character and locale support ---
317 if get_locale; then
318 singletest wchar WCHAR -DUTF8_LOCALE=\"${UTF8_LOCALE}\" || \
319 runtest wchar WCHAR -D_GNU_SOURCE \
320 -DUTF8_LOCALE=\"${UTF8_LOCALE}\" || true
321 else
322 HAVE_WCHAR=0
323 echo "tested wchar: no (no UTF8_LOCALE)" 1>&2
324 echo "tested wchar: no (no UTF8_LOCALE)" 1>&3
325 echo 1>&3
326 fi
327
328 # --- nanosleep ---
329 if [ -n "${LD_NANOSLEEP}" ]; then
330 runtest nanosleep NANOSLEEP "${LD_NANOSLEEP}" || true
331 elif singletest nanosleep NANOSLEEP; then
332 :
333 elif runtest nanosleep NANOSLEEP "-lrt"; then
334 LD_NANOSLEEP="-lrt"
335 fi
336 if [ "${HAVE_NANOSLEEP}" -eq 0 ]; then
337 echo "FATAL: nanosleep: no" 1>&2
338 echo "FATAL: nanosleep: no" 1>&3
339 exit 1
340 fi
341
342 if [ ${BUILD_CATMAN} -gt 0 ]; then
343 # --- recvmsg ---
344 if [ -n "${LD_RECVMSG}" ]; then
345 runtest recvmsg RECVMSG "${LD_RECVMSG}" || true
346 elif singletest recvmsg RECVMSG; then
347 :
348 elif runtest recvmsg RECVMSG "-lsocket"; then
349 LD_RECVMSG="-lsocket"
350 fi
351 if [ "${HAVE_RECVMSG}" -eq 0 ]; then
352 echo "FATAL: recvmsg: no" 1>&2
353 echo "FATAL: recvmsg: no" 1>&3
354 echo "Without recvmsg(2), you cannot BUILD_CATMAN." 1>&2
355 exit 1
356 fi
357
358 # --- cmsg ---
359 if singletest cmsg CMSG; then
360 :
361 elif runtest cmsg CMSG "-D_XPG4_2"; then
362 HAVE_CMSG_XPG42=1
363 fi
364 if [ "${HAVE_CMSG}" -eq 0 ]; then
365 echo "FATAL: cmsg: no" 1>&2
366 echo "FATAL: cmsg: no" 1>&3
367 echo "Without CMSG_FIRSTHDR(3), you cannot BUILD_CATMAN." 1>&2
368 exit 1
369 fi
370 fi
371
372 # --- ohash ---
373 if ismanual ohash OHASH "${HAVE_OHASH}"; then
374 :
375 elif [ -n "${LD_OHASH}" ]; then
376 runtest ohash OHASH "${LD_OHASH}" || true
377 elif singletest ohash OHASH; then
378 :
379 elif runtest ohash OHASH "-lutil"; then
380 LD_OHASH="-lutil"
381 fi
382 if [ "${HAVE_OHASH}" -eq 0 ]; then
383 LD_OHASH=
384 fi
385
386 # --- LDADD ---
387 LDADD="${LDADD} ${LD_NANOSLEEP} ${LD_RECVMSG} ${LD_OHASH} -lz"
388 echo "selected LDADD=\"${LDADD}\"" 1>&2
389 echo "selected LDADD=\"${LDADD}\"" 1>&3
390 echo 1>&3
391
392 # --- write config.h ---
393
394 exec > config.h
395
396 cat << __HEREDOC__
397 #ifdef __cplusplus
398 #error "Do not use C++. See the INSTALL file."
399 #endif
400
401 #if !defined(__GNUC__) || (__GNUC__ < 4)
402 #define __attribute__(x)
403 #endif
404
405 __HEREDOC__
406
407 [ ${NEED_GNU_SOURCE} -eq 0 ] || echo "#define _GNU_SOURCE"
408 [ ${NEED_OPENBSD_SOURCE} -eq 0 ] || echo "#define _OPENBSD_SOURCE"
409
410 [ ${HAVE_GETLINE} -eq 0 -o \
411 ${HAVE_REALLOCARRAY} -eq 0 -o ${HAVE_RECALLOCARRAY} -eq 0 -o \
412 ${HAVE_STRLCAT} -eq 0 -o ${HAVE_STRLCPY} -eq 0 -o \
413 ${HAVE_STRNDUP} -eq 0 ] \
414 && echo "#include <sys/types.h>"
415 [ ${HAVE_VASPRINTF} -eq 0 ] && echo "#include <stdarg.h>"
416 [ ${HAVE_GETLINE} -eq 0 ] && echo "#include <stdio.h>"
417
418 echo
419 echo "#define MAN_CONF_FILE \"/etc/${MANM_MANCONF}\""
420 echo "#define MANPATH_BASE \"${MANPATH_BASE}\""
421 echo "#define MANPATH_DEFAULT \"${MANPATH_DEFAULT}\""
422 [ -n "${OSNAME}" ] && echo "#define OSNAME \"${OSNAME}\""
423 [ -n "${UTF8_LOCALE}" ] && echo "#define UTF8_LOCALE \"${UTF8_LOCALE}\""
424 [ -n "${HOMEBREWDIR}" ] && echo "#define HOMEBREWDIR \"${HOMEBREWDIR}\""
425 [ ${HAVE_EFTYPE} -eq 0 ] && echo "#define EFTYPE EINVAL"
426 [ ${HAVE_O_DIRECTORY} -eq 0 ] && echo "#define O_DIRECTORY 0"
427 [ ${HAVE_PATH_MAX} -eq 0 ] && echo "#define PATH_MAX 4096"
428 if [ ${HAVE_ENDIAN} -eq 0 -a ${HAVE_SYS_ENDIAN} -eq 0 ]; then
429 echo "#define be32toh ntohl"
430 echo "#define htobe32 htonl"
431 fi
432
433 cat << __HEREDOC__
434 #define HAVE_CMSG_XPG42 ${HAVE_CMSG_XPG42}
435 #define HAVE_DIRENT_NAMLEN ${HAVE_DIRENT_NAMLEN}
436 #define HAVE_ENDIAN ${HAVE_ENDIAN}
437 #define HAVE_ERR ${HAVE_ERR}
438 #define HAVE_FTS ${HAVE_FTS}
439 #define HAVE_FTS_COMPARE_CONST ${HAVE_FTS_COMPARE_CONST}
440 #define HAVE_GETLINE ${HAVE_GETLINE}
441 #define HAVE_GETSUBOPT ${HAVE_GETSUBOPT}
442 #define HAVE_ISBLANK ${HAVE_ISBLANK}
443 #define HAVE_MKDTEMP ${HAVE_MKDTEMP}
444 #define HAVE_NTOHL ${HAVE_NTOHL}
445 #define HAVE_PLEDGE ${HAVE_PLEDGE}
446 #define HAVE_PROGNAME ${HAVE_PROGNAME}
447 #define HAVE_REALLOCARRAY ${HAVE_REALLOCARRAY}
448 #define HAVE_RECALLOCARRAY ${HAVE_RECALLOCARRAY}
449 #define HAVE_REWB_BSD ${HAVE_REWB_BSD}
450 #define HAVE_REWB_SYSV ${HAVE_REWB_SYSV}
451 #define HAVE_SANDBOX_INIT ${HAVE_SANDBOX_INIT}
452 #define HAVE_STRCASESTR ${HAVE_STRCASESTR}
453 #define HAVE_STRINGLIST ${HAVE_STRINGLIST}
454 #define HAVE_STRLCAT ${HAVE_STRLCAT}
455 #define HAVE_STRLCPY ${HAVE_STRLCPY}
456 #define HAVE_STRNDUP ${HAVE_STRNDUP}
457 #define HAVE_STRPTIME ${HAVE_STRPTIME}
458 #define HAVE_STRSEP ${HAVE_STRSEP}
459 #define HAVE_STRTONUM ${HAVE_STRTONUM}
460 #define HAVE_SYS_ENDIAN ${HAVE_SYS_ENDIAN}
461 #define HAVE_VASPRINTF ${HAVE_VASPRINTF}
462 #define HAVE_WCHAR ${HAVE_WCHAR}
463 #define HAVE_OHASH ${HAVE_OHASH}
464
465 #define BINM_APROPOS "${BINM_APROPOS}"
466 #define BINM_CATMAN "${BINM_CATMAN}"
467 #define BINM_MAKEWHATIS "${BINM_MAKEWHATIS}"
468 #define BINM_MAN "${BINM_MAN}"
469 #define BINM_SOELIM "${BINM_SOELIM}"
470 #define BINM_WHATIS "${BINM_WHATIS}"
471
472 __HEREDOC__
473
474 if [ ${HAVE_ERR} -eq 0 ]; then
475 echo "extern void err(int, const char *, ...);"
476 echo "extern void errx(int, const char *, ...);"
477 echo "extern void warn(const char *, ...);"
478 echo "extern void warnx(const char *, ...);"
479 fi
480
481 [ ${HAVE_GETLINE} -eq 0 ] && \
482 echo "extern ssize_t getline(char **, size_t *, FILE *);"
483
484 [ ${HAVE_GETSUBOPT} -eq 0 ] && \
485 echo "extern int getsubopt(char **, char * const *, char **);"
486
487 [ ${HAVE_ISBLANK} -eq 0 ] && \
488 echo "extern int isblank(int);"
489
490 [ ${HAVE_MKDTEMP} -eq 0 ] && \
491 echo "extern char *mkdtemp(char *);"
492
493 if [ ${HAVE_PROGNAME} -eq 0 ]; then
494 echo "extern const char *getprogname(void);"
495 echo "extern void setprogname(const char *);"
496 fi
497
498 [ ${HAVE_REALLOCARRAY} -eq 0 ] && \
499 echo "extern void *reallocarray(void *, size_t, size_t);"
500
501 [ ${HAVE_RECALLOCARRAY} -eq 0 ] && \
502 echo "extern void *recallocarray(void *, size_t, size_t, size_t);"
503
504 [ ${HAVE_STRCASESTR} -eq 0 ] && \
505 echo "extern char *strcasestr(const char *, const char *);"
506
507 [ ${HAVE_STRLCAT} -eq 0 ] && \
508 echo "extern size_t strlcat(char *, const char *, size_t);"
509
510 [ ${HAVE_STRLCPY} -eq 0 ] && \
511 echo "extern size_t strlcpy(char *, const char *, size_t);"
512
513 [ ${HAVE_STRNDUP} -eq 0 ] && \
514 echo "extern char *strndup(const char *, size_t);"
515
516 [ ${HAVE_STRSEP} -eq 0 ] && \
517 echo "extern char *strsep(char **, const char *);"
518
519 [ ${HAVE_STRTONUM} -eq 0 ] && \
520 echo "extern long long strtonum(const char *, long long, long long, const char **);"
521
522 [ ${HAVE_VASPRINTF} -eq 0 ] && \
523 echo "extern int vasprintf(char **, const char *, va_list);"
524
525 echo "file config.h: written" 1>&2
526 echo "file config.h: written" 1>&3
527
528 # --- tests for Makefile.local -----------------------------------------
529
530 exec > Makefile.local
531
532 [ -z "${BINDIR}" ] && BINDIR="${PREFIX}/bin"
533 [ -z "${SBINDIR}" ] && SBINDIR="${PREFIX}/sbin"
534 [ -z "${BIN_FROM_SBIN}" ] && BIN_FROM_SBIN="../bin"
535 [ -z "${INCLUDEDIR}" ] && INCLUDEDIR="${PREFIX}/include/mandoc"
536 [ -z "${LIBDIR}" ] && LIBDIR="${PREFIX}/lib/mandoc"
537 [ -z "${MANDIR}" ] && MANDIR="${PREFIX}/man"
538
539 [ -z "${HTDOCDIR}" ] && HTDOCDIR="${WWWPREFIX}/htdocs"
540 [ -z "${CGIBINDIR}" ] && CGIBINDIR="${WWWPREFIX}/cgi-bin"
541
542 [ -z "${INSTALL_PROGRAM}" ] && INSTALL_PROGRAM="${INSTALL} -m 0555"
543 [ -z "${INSTALL_LIB}" ] && INSTALL_LIB="${INSTALL} -m 0444"
544 [ -z "${INSTALL_MAN}" ] && INSTALL_MAN="${INSTALL} -m 0444"
545 [ -z "${INSTALL_DATA}" ] && INSTALL_DATA="${INSTALL} -m 0444"
546
547 BUILD_TARGETS=
548 [ ${BUILD_CGI} -gt 0 ] && BUILD_TARGETS="man.cgi"
549 [ ${BUILD_CATMAN} -gt 0 ] && \
550 BUILD_TARGETS="${BUILD_TARGETS} mandocd catman"
551 INSTALL_TARGETS=
552 [ ${INSTALL_LIBMANDOC} -gt 0 ] && INSTALL_TARGETS="lib-install"
553 [ ${BUILD_CGI} -gt 0 ] && INSTALL_TARGETS="${INSTALL_TARGETS} cgi-install"
554 [ ${BUILD_CATMAN} -gt 0 ] && \
555 INSTALL_TARGETS="${INSTALL_TARGETS} catman-install"
556
557 cat << __HEREDOC__
558 BUILD_TARGETS = ${BUILD_TARGETS}
559 INSTALL_TARGETS = ${INSTALL_TARGETS}
560 CC = ${CC}
561 CFLAGS = ${CFLAGS}
562 LDADD = ${LDADD}
563 LDFLAGS = ${LDFLAGS}
564 STATIC = ${STATIC}
565 PREFIX = ${PREFIX}
566 BINDIR = ${BINDIR}
567 SBINDIR = ${SBINDIR}
568 BIN_FROM_SBIN = ${BIN_FROM_SBIN}
569 INCLUDEDIR = ${INCLUDEDIR}
570 LIBDIR = ${LIBDIR}
571 MANDIR = ${MANDIR}
572 WWWPREFIX = ${WWWPREFIX}
573 HTDOCDIR = ${HTDOCDIR}
574 CGIBINDIR = ${CGIBINDIR}
575 BINM_APROPOS = ${BINM_APROPOS}
576 BINM_CATMAN = ${BINM_CATMAN}
577 BINM_MAKEWHATIS = ${BINM_MAKEWHATIS}
578 BINM_MAN = ${BINM_MAN}
579 BINM_SOELIM = ${BINM_SOELIM}
580 BINM_WHATIS = ${BINM_WHATIS}
581 MANM_MAN = ${MANM_MAN}
582 MANM_MANCONF = ${MANM_MANCONF}
583 MANM_MDOC = ${MANM_MDOC}
584 MANM_ROFF = ${MANM_ROFF}
585 MANM_EQN = ${MANM_EQN}
586 MANM_TBL = ${MANM_TBL}
587 INSTALL = ${INSTALL}
588 INSTALL_PROGRAM = ${INSTALL_PROGRAM}
589 INSTALL_LIB = ${INSTALL_LIB}
590 INSTALL_MAN = ${INSTALL_MAN}
591 INSTALL_DATA = ${INSTALL_DATA}
592 LN = ${LN}
593 __HEREDOC__
594
595 echo "file Makefile.local: written" 1>&2
596 echo "file Makefile.local: written" 1>&3
597
598 exit 0