summaryrefslogtreecommitdiffstats
path: root/config/pkg.sh
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2024-04-10 13:13:19 -0400
committerTavian Barnes <tavianator@tavianator.com>2024-04-10 13:23:40 -0400
commit6c8d11e8e5b3457286fcda75b6516e93f1f12f17 (patch)
treeb637ba7322df4e60e4e8174f53b48348b8f408a1 /config/pkg.sh
parent8f5ce115d51d31756b6911310a0deb1bafba46c0 (diff)
downloadbfs-6c8d11e8e5b3457286fcda75b6516e93f1f12f17.tar.xz
build: Run pkg-config with all packages at once
Diffstat (limited to 'config/pkg.sh')
-rwxr-xr-xconfig/pkg.sh24
1 files changed, 3 insertions, 21 deletions
diff --git a/config/pkg.sh b/config/pkg.sh
index 6335b4b..2ca533e 100755
--- a/config/pkg.sh
+++ b/config/pkg.sh
@@ -8,37 +8,19 @@
set -eu
NAME="${1^^}"
-declare -n XUSE="XUSE_$NAME"
+declare -n XUSE="USE_$NAME"
-if [ "$XUSE" ]; then
+if [ "${XUSE:-}" ]; then
USE="$XUSE"
-elif [[ "$NOLIBS" == *y* ]]; then
- USE=n
elif config/pkgconf.sh "$1"; then
USE=y
else
USE=n
fi
-printf '%s := %s\n' "USE_$NAME" "$USE"
-
if [ "$USE" = y ]; then
+ printf 'PKGS += %s\n' "$1"
printf 'CPPFLAGS += -DBFS_USE_%s=1\n' "$NAME"
-
- CFLAGS=$(config/pkgconf.sh --cflags "$1")
- if [ "$CFLAGS" ]; then
- printf 'CFLAGS += %s\n' "$CFLAGS"
- fi
-
- LDFLAGS=$(config/pkgconf.sh --ldflags "$1")
- if [ "$LDFLAGS" ]; then
- printf 'LDFLAGS += %s\n' "$LDFLAGS"
- fi
-
- LDLIBS=$(config/pkgconf.sh --ldlibs "$1")
- if [ "$LDLIBS" ]; then
- printf 'LDLIBS += %s\n' "$LDLIBS"
- fi
else
printf 'CPPFLAGS += -DBFS_USE_%s=0\n' "$NAME"
fi