about summary refs log tree commit diff
path: root/configure
diff options
context:
space:
mode:
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure12
1 files changed, 8 insertions, 4 deletions
diff --git a/configure b/configure
index 4199980..07e3245 100755
--- a/configure
+++ b/configure
@@ -1,6 +1,8 @@
 #!/bin/sh
 set -eu
 
+: ${PKG_CONFIG:=pkg-config}
+
 cflags() {
 	echo "CFLAGS += $*"
 }
@@ -8,16 +10,16 @@ defstr() {
 	cflags "-D'$1=\"$2\"'"
 }
 defvar() {
-	defstr "$1" "$(pkg-config --variable=$3 $2)${4:-}"
+	defstr "$1" "$(${PKG_CONFIG} --variable=$3 $2)${4:-}"
 }
 ldadd() {
 	lib=$1; shift
 	echo "LDADD.${lib} = $*"
 }
 config() {
-	pkg-config --print-errors "$@"
-	cflags $(pkg-config --cflags "$@")
-	for lib; do ldadd $lib $(pkg-config --libs $lib); done
+	${PKG_CONFIG} --print-errors "$@"
+	cflags $(${PKG_CONFIG} --cflags "$@")
+	for lib; do ldadd $lib $(${PKG_CONFIG} --libs $lib); done
 }
 
 exec >config.mk
@@ -27,6 +29,7 @@ for opt; do
 		(--prefix=*) echo "PREFIX = ${opt#*=}" ;;
 		(--bindir=*) echo "BINDIR = ${opt#*=}" ;;
 		(--mandir=*) echo "MANDIR = ${opt#*=}" ;;
+		(--enable-sandman) echo 'BINS += sandman' ;;
 		(*) echo "warning: unsupported option ${opt}" >&2 ;;
 	esac
 done
@@ -43,6 +46,7 @@ case "$(uname)" in
 		cflags -Wno-pedantic -D_GNU_SOURCE
 		config libtls ncursesw
 		defvar OPENSSL_BIN openssl exec_prefix /bin/openssl
+		echo 'OBJS += compat_readpassphrase.o'
 		;;
 	(Darwin)
 		cflags -D__STDC_WANT_LIB_EXT1__=1