]> git.cameronkatri.com Git - mandoc.git/blobdiff - configure
Fix incorrectly swapped labels of left/right arrows; from bentley@.
[mandoc.git] / configure
index 93f44a90f153dde84b6e18613d3cb1c48eef2a1c..f9416ce7399d84ff32c9f23edf42a590dcc86038 100755 (executable)
--- a/configure
+++ b/configure
@@ -1,8 +1,8 @@
 #!/bin/sh
 #
-# $Id: configure,v 1.58 2017/02/16 15:12:32 schwarze Exp $
+# $Id: configure,v 1.64 2017/07/01 09:47:30 schwarze Exp $
 #
-# Copyright (c) 2014, 2015, 2016 Ingo Schwarze <schwarze@openbsd.org>
+# Copyright (c) 2014, 2015, 2016, 2017 Ingo Schwarze <schwarze@openbsd.org>
 #
 # Permission to use, copy, modify, and distribute this software for any
 # purpose with or without fee is hereby granted, provided that the above
@@ -33,6 +33,9 @@ echo "config.log: writing..."
 # Initialize all variables here,
 # such that nothing can leak in from the environment.
 
+SOURCEDIR=`dirname "$0"`
+
+MANPATH_BASE="/usr/share/man:/usr/X11R6/man"
 MANPATH_DEFAULT="/usr/share/man:/usr/X11R6/man:/usr/local/man"
 OSNAME=
 UTF8_LOCALE=
@@ -65,11 +68,13 @@ HAVE_ISBLANK=
 HAVE_MKDTEMP=
 HAVE_NANOSLEEP=
 HAVE_NTOHL=
+HAVE_O_DIRECTORY=
 HAVE_OHASH=
 HAVE_PATH_MAX=
 HAVE_PLEDGE=
 HAVE_PROGNAME=
 HAVE_REALLOCARRAY=
+HAVE_RECALLOCARRAY=
 HAVE_RECVMSG=
 HAVE_REWB_BSD=
 HAVE_REWB_SYSV=
@@ -88,6 +93,7 @@ HAVE_WCHAR=
 PREFIX="/usr/local"
 BINDIR=
 SBINDIR=
+BIN_FROM_SBIN=
 INCLUDEDIR=
 LIBDIR=
 MANDIR=
@@ -115,6 +121,7 @@ INSTALL_PROGRAM=
 INSTALL_LIB=
 INSTALL_MAN=
 INSTALL_DATA=
+LN="ln -f"
 
 # --- manual settings from configure.local -----------------------------
 
@@ -154,7 +161,8 @@ ${1}${3}: testing...
 ${COMP} -o test-${1} test-${1}.c ${3}
 __HEREDOC__
 
-       if ${COMP} -o "test-${1}" "test-${1}.c" ${3} 1>&3 2>&3; then
+       if ${COMP} -o "test-${1}" "${SOURCEDIR}/test-${1}.c" ${3} 1>&3 2>&3
+       then
                echo "${1}${3}: ${CC} succeeded" 1>&3
        else
                echo "${1}${3}: ${CC} failed with $?" 1>&3
@@ -217,11 +225,13 @@ runtest getsubopt GETSUBOPT       || true
 runtest isblank                ISBLANK         || true
 runtest mkdtemp                MKDTEMP         || true
 runtest ntohl          NTOHL           || true
+runtest O_DIRECTORY    O_DIRECTORY     || true
 runtest PATH_MAX       PATH_MAX        || true
 runtest pledge         PLEDGE          || true
 runtest sandbox_init   SANDBOX_INIT    || true
 runtest progname       PROGNAME        || true
 runtest reallocarray   REALLOCARRAY    || true
+runtest recallocarray  RECALLOCARRAY   || true
 runtest rewb-bsd       REWB_BSD        || true
 runtest rewb-sysv      REWB_SYSV       || true
 runtest strcasestr     STRCASESTR      || true
@@ -341,7 +351,8 @@ cat << __HEREDOC__
 
 __HEREDOC__
 
-[ ${HAVE_GETLINE} -eq 0 -o ${HAVE_REALLOCARRAY} -eq 0 -o \
+[ ${HAVE_GETLINE} -eq 0 -o \
+  ${HAVE_REALLOCARRAY} -eq 0 -o ${HAVE_RECALLOCARRAY} -eq 0 -o \
   ${HAVE_STRLCAT} -eq 0 -o ${HAVE_STRLCPY} -eq 0 ] \
        && echo "#include <sys/types.h>"
 [ ${HAVE_VASPRINTF} -eq 0 ] && echo "#include <stdarg.h>"
@@ -349,11 +360,13 @@ __HEREDOC__
 
 echo
 echo "#define MAN_CONF_FILE \"/etc/${MANM_MANCONF}\""
+echo "#define MANPATH_BASE \"${MANPATH_BASE}\""
 echo "#define MANPATH_DEFAULT \"${MANPATH_DEFAULT}\""
 [ -n "${OSNAME}" ] && echo "#define OSNAME \"${OSNAME}\""
 [ -n "${UTF8_LOCALE}" ] && echo "#define UTF8_LOCALE \"${UTF8_LOCALE}\""
 [ -n "${HOMEBREWDIR}" ] && echo "#define HOMEBREWDIR \"${HOMEBREWDIR}\""
 [ ${HAVE_EFTYPE} -eq 0 ] && echo "#define EFTYPE EINVAL"
+[ ${HAVE_O_DIRECTORY} -eq 0 ] && echo "#define O_DIRECTORY 0"
 [ ${HAVE_PATH_MAX} -eq 0 ] && echo "#define PATH_MAX 4096"
 if [ ${HAVE_ENDIAN} -eq 0 -a ${HAVE_SYS_ENDIAN} -eq 0 ]; then
        echo "#define be32toh ntohl"
@@ -375,6 +388,7 @@ cat << __HEREDOC__
 #define HAVE_PLEDGE ${HAVE_PLEDGE}
 #define HAVE_PROGNAME ${HAVE_PROGNAME}
 #define HAVE_REALLOCARRAY ${HAVE_REALLOCARRAY}
+#define HAVE_RECALLOCARRAY ${HAVE_RECALLOCARRAY}
 #define HAVE_REWB_BSD ${HAVE_REWB_BSD}
 #define HAVE_REWB_SYSV ${HAVE_REWB_SYSV}
 #define HAVE_SANDBOX_INIT ${HAVE_SANDBOX_INIT}
@@ -426,6 +440,9 @@ fi
 [ ${HAVE_REALLOCARRAY} -eq 0 ] && \
        echo "extern    void     *reallocarray(void *, size_t, size_t);"
 
+[ ${HAVE_RECALLOCARRAY} -eq 0 ] && \
+       echo "extern    void     *recallocarray(void *, size_t, size_t, size_t);"
+
 [ ${HAVE_STRCASESTR} -eq 0 ] && \
        echo "extern    char     *strcasestr(const char *, const char *);"
 
@@ -451,14 +468,15 @@ echo "config.h: written" 1>&3
 
 exec > Makefile.local
 
-[ -z "${BINDIR}"     ] && BINDIR="${PREFIX}/bin"
-[ -z "${SBINDIR}"    ] && SBINDIR="${PREFIX}/sbin"
-[ -z "${INCLUDEDIR}" ] && INCLUDEDIR="${PREFIX}/include/mandoc"
-[ -z "${LIBDIR}"     ] && LIBDIR="${PREFIX}/lib/mandoc"
-[ -z "${MANDIR}"     ] && MANDIR="${PREFIX}/man"
+[ -z "${BINDIR}"          ] && BINDIR="${PREFIX}/bin"
+[ -z "${SBINDIR}"         ] && SBINDIR="${PREFIX}/sbin"
+[ -z "${BIN_FROM_SBIN}"   ] && BIN_FROM_SBIN="../bin"
+[ -z "${INCLUDEDIR}"      ] && INCLUDEDIR="${PREFIX}/include/mandoc"
+[ -z "${LIBDIR}"          ] && LIBDIR="${PREFIX}/lib/mandoc"
+[ -z "${MANDIR}"          ] && MANDIR="${PREFIX}/man"
 
-[ -z "${HTDOCDIR}"   ] && HTDOCDIR="${WWWPREFIX}/htdocs"
-[ -z "${CGIBINDIR}"  ] && CGIBINDIR="${WWWPREFIX}/cgi-bin"
+[ -z "${HTDOCDIR}"        ] && HTDOCDIR="${WWWPREFIX}/htdocs"
+[ -z "${CGIBINDIR}"       ] && CGIBINDIR="${WWWPREFIX}/cgi-bin"
 
 [ -z "${INSTALL_PROGRAM}" ] && INSTALL_PROGRAM="${INSTALL} -m 0555"
 [ -z "${INSTALL_LIB}"     ] && INSTALL_LIB="${INSTALL} -m 0444"
@@ -486,6 +504,7 @@ STATIC              = ${STATIC}
 PREFIX         = ${PREFIX}
 BINDIR         = ${BINDIR}
 SBINDIR                = ${SBINDIR}
+BIN_FROM_SBIN  = ${BIN_FROM_SBIN}
 INCLUDEDIR     = ${INCLUDEDIR}
 LIBDIR         = ${LIBDIR}
 MANDIR         = ${MANDIR}
@@ -509,6 +528,7 @@ INSTALL_PROGRAM     = ${INSTALL_PROGRAM}
 INSTALL_LIB    = ${INSTALL_LIB}
 INSTALL_MAN    = ${INSTALL_MAN}
 INSTALL_DATA   = ${INSTALL_DATA}
+LN             = ${LN}
 __HEREDOC__
 
 echo "Makefile.local: written" 1>&2