diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2024-04-25 12:01:40 -0400 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2024-04-25 12:07:57 -0400 |
commit | 339c20aea74d5b4c6b8b178b478cc5530bc9af79 (patch) | |
tree | e0e856ca7dbf97ea1bfe95e0adc605acb5fc127c /config/pkgs.mk | |
parent | 19189e3f6f18b13e4f9c947c99062e658e98827d (diff) | |
download | bfs-339c20aea74d5b4c6b8b178b478cc5530bc9af79.tar.xz |
config: Add BFS_USE_LIB* to config.h instead of CPPFLAGS
Diffstat (limited to 'config/pkgs.mk')
-rw-r--r-- | config/pkgs.mk | 35 |
1 files changed, 30 insertions, 5 deletions
diff --git a/config/pkgs.mk b/config/pkgs.mk index 3a18289..2c100ab 100644 --- a/config/pkgs.mk +++ b/config/pkgs.mk @@ -6,12 +6,37 @@ include config/prelude.mk include ${GEN}/vars.mk include ${GEN}/flags.mk -include ${GEN}/pkgs.mk include config/exports.mk -${GEN}/pkgs.mk:: +# External dependencies +USE_PKGS := \ + ${GEN}/libacl.use \ + ${GEN}/libcap.use \ + ${GEN}/libselinux.use \ + ${GEN}/liburing.use \ + ${GEN}/oniguruma.use + +${GEN}/pkgs.mk: ${USE_PKGS} ${MSG} "[ GEN] ${TGT}" - printf 'CFLAGS += %s\n' "$$(config/pkgconf.sh --cflags ${PKGS})" >>$@ 2>>$@.log - printf 'LDFLAGS += %s\n' "$$(config/pkgconf.sh --ldflags ${PKGS})" >>$@ 2>>$@.log - printf 'LDLIBS := %s $${LDLIBS}\n' "$$(config/pkgconf.sh --ldlibs ${PKGS})" >>$@ 2>>$@.log + printf '# %s\n' "${TGT}" >$@ + gen() { \ + printf 'PKGS := %s\n' "$$*"; \ + printf 'CFLAGS += %s\n' "$$(config/pkgconf.sh --cflags "$$@")"; \ + printf 'LDFLAGS += %s\n' "$$(config/pkgconf.sh --ldflags "$$@")"; \ + printf 'LDLIBS := %s $${LDLIBS}\n' "$$(config/pkgconf.sh --ldlibs "$$@")"; \ + }; \ + gen $$(cat ${.ALLSRC}) >>$@ ${VCAT} $@ +.PHONY: ${GEN}/pkgs.mk + +# Convert ${GEN}/foo.use to foo +PKG = ${@:${GEN}/%.use=%} + +${USE_PKGS}:: + if config/pkgconf.sh ${PKG} 2>$@.log; then \ + printf '%s\n' ${PKG} >$@; \ + test "${IS_V}" || printf '[ CC ] %-${MSG_WIDTH}s ✔\n' config/${PKG}.c; \ + else \ + : >$@; \ + test "${IS_V}" || printf '[ CC ] %-${MSG_WIDTH}s ✘\n' config/${PKG}.c; \ + fi |