summaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2024-05-24 09:37:57 -0400
committerTavian Barnes <tavianator@tavianator.com>2024-05-24 14:23:50 -0400
commit3a6c1f049bb3643c86eb87f6c69cf7c3d3c95c86 (patch)
tree8793e871cc4ee1b3d3ff82b73d04c9264aaf12a9 /build
parent64fcb1d975e8ec8ac70f7ae8add2f7499e6fe6e9 (diff)
downloadbfs-3a6c1f049bb3643c86eb87f6c69cf7c3d3c95c86.tar.xz
configure: Use --with/--without for libraries
Diffstat (limited to 'build')
-rw-r--r--build/header.mk2
-rwxr-xr-xbuild/msg-if.sh4
-rwxr-xr-xbuild/pkgconf.sh18
-rw-r--r--build/pkgs.mk10
-rw-r--r--build/with/libacl.c (renamed from build/use/libacl.c)0
-rw-r--r--build/with/libcap.c (renamed from build/use/libcap.c)0
-rw-r--r--build/with/libselinux.c (renamed from build/use/libselinux.c)0
-rw-r--r--build/with/liburing.c (renamed from build/use/liburing.c)0
-rw-r--r--build/with/oniguruma.c (renamed from build/use/oniguruma.c)0
9 files changed, 15 insertions, 19 deletions
diff --git a/build/header.mk b/build/header.mk
index fb8246d..09454c5 100644
--- a/build/header.mk
+++ b/build/header.mk
@@ -51,7 +51,7 @@ HEADERS := \
gen/has/uselocale.h
# Previously generated by pkgs.mk
-PKG_HEADERS := ${ALL_PKGS:%=gen/use/%.h}
+PKG_HEADERS := ${ALL_PKGS:%=gen/with/%.h}
gen/config.h: ${PKG_HEADERS} ${HEADERS}
${MSG} "[ GEN] $@"
diff --git a/build/msg-if.sh b/build/msg-if.sh
index 8112aea..e0d0957 100755
--- a/build/msg-if.sh
+++ b/build/msg-if.sh
@@ -6,8 +6,8 @@
# Print a success/failure indicator from a makefile:
#
# $ ./configure
-# [ CC ] use/liburing.c ✘
-# [ CC ] use/oniguruma.c ✔
+# [ CC ] with/liburing.c ✘
+# [ CC ] with/oniguruma.c ✔
set -eu
diff --git a/build/pkgconf.sh b/build/pkgconf.sh
index 96e4bf1..244c95d 100755
--- a/build/pkgconf.sh
+++ b/build/pkgconf.sh
@@ -26,22 +26,18 @@ esac
if [ -z "$MODE" ]; then
# Check whether the libraries exist at all
for LIB; do
- # Check ${USE_$LIB}
- USE_LIB="USE_$(printf '%s' "$LIB" | tr 'a-z-' 'A-Z_')"
- eval "USE=\"\${$USE_LIB:-}\""
- case "$USE" in
- y|1)
- continue
- ;;
- n|0)
- exit 1
- ;;
+ # Check ${WITH_$LIB}
+ WITH_LIB="WITH_$(printf '%s' "$LIB" | tr 'a-z-' 'A-Z_')"
+ eval "WITH=\"\${$WITH_LIB:-}\""
+ case "$WITH" in
+ y|1) continue ;;
+ n|0) exit 1 ;;
esac
CFLAGS=$("$0" --cflags "$LIB") || exit 1
LDFLAGS=$("$0" --ldflags "$LIB") || exit 1
LDLIBS=$("$0" --ldlibs "$LIB") || exit 1
- build/cc.sh $CFLAGS $LDFLAGS build/use/$LIB.c $LDLIBS || exit 1
+ build/cc.sh $CFLAGS $LDFLAGS build/with/$LIB.c $LDLIBS || exit 1
done
fi
diff --git a/build/pkgs.mk b/build/pkgs.mk
index 5a26548..5de9ac2 100644
--- a/build/pkgs.mk
+++ b/build/pkgs.mk
@@ -8,7 +8,7 @@ include gen/vars.mk
include gen/flags.mk
include build/exports.mk
-HEADERS := ${ALL_PKGS:%=gen/use/%.h}
+HEADERS := ${ALL_PKGS:%=gen/with/%.h}
gen/pkgs.mk: ${HEADERS}
${MSG} "[ GEN] $@"
@@ -24,10 +24,10 @@ gen/pkgs.mk: ${HEADERS}
.PHONY: gen/pkgs.mk
-# Convert gen/use/foo.h to foo
-PKG = ${@:gen/use/%.h=%}
+# Convert gen/with/foo.h to foo
+PKG = ${@:gen/with/%.h=%}
${HEADERS}::
@${MKDIR} ${@D}
- @build/define-if.sh use/${PKG} build/pkgconf.sh ${PKG} >$@ 2>$@.log; \
- build/msg-if.sh "[ CC ] use/${PKG}.c" test $$? -eq 0;
+ @build/define-if.sh with/${PKG} build/pkgconf.sh ${PKG} >$@ 2>$@.log; \
+ build/msg-if.sh "[ CC ] with/${PKG}.c" test $$? -eq 0;
diff --git a/build/use/libacl.c b/build/with/libacl.c
index de1fe50..de1fe50 100644
--- a/build/use/libacl.c
+++ b/build/with/libacl.c
diff --git a/build/use/libcap.c b/build/with/libcap.c
index 58e832c..58e832c 100644
--- a/build/use/libcap.c
+++ b/build/with/libcap.c
diff --git a/build/use/libselinux.c b/build/with/libselinux.c
index bca409d..bca409d 100644
--- a/build/use/libselinux.c
+++ b/build/with/libselinux.c
diff --git a/build/use/liburing.c b/build/with/liburing.c
index bea499a..bea499a 100644
--- a/build/use/liburing.c
+++ b/build/with/liburing.c
diff --git a/build/use/oniguruma.c b/build/with/oniguruma.c
index cb17596..cb17596 100644
--- a/build/use/oniguruma.c
+++ b/build/with/oniguruma.c