about summary refs log tree commit diff
path: root/configure
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2021-05-02 13:37:36 -0400
committerJune McEnroe <june@causal.agency>2021-05-02 13:50:35 -0400
commit0a8b0bedea5df1ff892e5ca5c71578239e2bf781 (patch)
tree24f820825ab9f35613bdacb11ee3d9c1e65cf21e /configure
parentMatch multiple types with -t (diff)
downloadlitterbox-0a8b0bedea5df1ff892e5ca5c71578239e2bf781.tar.gz
litterbox-0a8b0bedea5df1ff892e5ca5c71578239e2bf781.zip
Only link litterbox with -ltls
Diffstat (limited to '')
-rwxr-xr-xconfigure23
1 files changed, 10 insertions, 13 deletions
diff --git a/configure b/configure
index bf9d132..1811b56 100755
--- a/configure
+++ b/configure
@@ -4,21 +4,21 @@ set -eu
 cflags() {
 	echo "CFLAGS += $*"
 }
-ldlibs() {
-	echo "LDLIBS ${o:-}= $*"
-	o=+
-}
-config() {
-	pkg-config --print-errors "$@"
-	cflags $(pkg-config --cflags "$@")
-	ldlibs $(pkg-config --libs "$@")
-}
 defstr() {
 	cflags "-D'$1=\"$2\"'"
 }
 defvar() {
 	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
+}
 
 exec >config.mk
 
@@ -32,17 +32,14 @@ done
 
 case "$(uname)" in
 	(OpenBSD)
-		ldlibs -ltls
 		config sqlite3
-		defvar SQLITE3_BIN sqlite3 exec_prefix /bin/sqlite3
 		;;
 	(Linux)
 		cflags -D_GNU_SOURCE
 		config sqlite3 libtls
-		defvar SQLITE3_BIN sqlite3 exec_prefix /bin/sqlite3
 		;;
 	(*)
 		config sqlite3 libtls
-		defvar SQLITE3_BIN sqlite3 exec_prefix /bin/sqlite3
 		;;
 esac
+defvar SQLITE3_BIN sqlite3 exec_prefix /bin/sqlite3