summaryrefslogtreecommitdiffstats
path: root/configure
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2015-11-06 16:30:33 +0000
committerIngo Schwarze <schwarze@openbsd.org>2015-11-06 16:30:33 +0000
commita8ce1f9346beb8f6af8a2704f58ad1be8a491a40 (patch)
tree1176af75445468319b8f0983434244892aba9031 /configure
parentbdcb15a7e65b5df030d7dac778cb68ac4e3277e6 (diff)
downloadmandoc-a8ce1f9346beb8f6af8a2704f58ad1be8a491a40.tar.gz
Use getprogname(3) rather than __progname.
Suggested by Joerg@ Sonnenberger (NetBSD). Last year, deraadt@ confirmed on tech@ that this "has the potential to be more portable", and micro-optimizing for speed is not relevant here. Also gets rid of one global variable.
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure6
1 files changed, 5 insertions, 1 deletions
diff --git a/configure b/configure
index 7bafcdde..8d9e525f 100755
--- a/configure
+++ b/configure
@@ -290,7 +290,6 @@ echo
echo "#define MAN_CONF_FILE \"/etc/${MANM_MANCONF}\""
echo "#define MANPATH_DEFAULT \"${MANPATH_DEFAULT}\""
[ -n "${OSNAME}" ] && echo "#define OSNAME \"${OSNAME}\""
-[ ${HAVE_PROGNAME} -eq 0 ] && echo "#define __progname mandoc_progname"
[ -n "${HOMEBREWDIR}" ] && echo "#define HOMEBREWDIR \"${HOMEBREWDIR}\""
cat << __HEREDOC__
@@ -359,6 +358,11 @@ fi
[ ${HAVE_MKDTEMP} -eq 0 ] && \
echo "extern char *mkdtemp(char *);"
+if [ ${HAVE_PROGNAME} -eq 0 ]; then
+ echo "extern const char *getprogname(void);"
+ echo "extern void setprogname(const char *);"
+fi
+
[ ${HAVE_REALLOCARRAY} -eq 0 ] && \
echo "extern void *reallocarray(void *, size_t, size_t);"