Commit Diff


commit - cfe57149140baac9bfd1f900a6e6e425e41b6900
commit + a41ba086314a97211e1856fc968a8d18b11df953
blob - 0adf97437ca6d672a99314a848d308eae7039d08
blob + f1cccc911d3f8f5f2ef4786a26bc9db507fa7451
--- configure
+++ configure
@@ -271,7 +271,7 @@ test -z "${SSH_PROG}" && {
 HAVE_GETEXECNAME=
 HAVE_GETPROGNAME=
 HAVE_LIBEVENT=
-HAVE_LIBEVENT2=0		# may not be checked
+HAVE_LIBEVENT2=
 HAVE_PLEDGE=
 HAVE_PROGRAM_INVOCATION_SHORT_NAME=
 HAVE_PR_SET_NAME=
@@ -454,7 +454,7 @@ runtest strtonum	STRTONUM			  || true
 runtest unveil		UNVEIL				  || true
 runtest __progname	__PROGNAME			  || true
 
-if [ "${HAVE_LIBEVENT}" -eq 0 -a "${HAVE_LIBEVENT2}" -eq 0 ]; then
+if [ "${HAVE_LIBEVENT}" -eq 0 -a "${HAVE_LIBEVENT2:-0}" -eq 0 ]; then
 	echo "Fatal: missing libevent" 1>&2
 	echo "Fatal: missing libevent" 1>&3
 	exit 1
@@ -529,7 +529,7 @@ if [ ${HAVE_PLEDGE} -eq 0 -o ${HAVE_UNVEIL} -eq 0 ]; t
 	echo
 fi
 
-if [ ${HAVE_LIBEVENT2} -eq 1 ]; then
+if [ ${HAVE_LIBEVENT2:-0} -eq 1 ]; then
 	cat <<EOF
 #include <event2/event.h>
 #include <event2/event_compat.h>
@@ -572,6 +572,10 @@ cat <<EOF
 
 #if !HAVE_GETPROGNAME
 extern const char *getprogname(void);
+#endif
+
+#if !HAVE_PLEDGE
+# define pledge(a, b) (0)
 #endif
 
 #if !HAVE_STRLCAT
@@ -586,6 +590,10 @@ extern size_t strlcpy(char *, const char *, size_t);
 extern long long strtonum(const char *, long long, long long, const char **);
 #endif
 
+#if !HAVE_UNVEIL
+# define unveil(a, b) (0)
+#endif
+
 #ifndef __dead
 # define __dead __attribute__((noreturn))
 #endif