Hello all,
I am trying to make a makefile fragment like below to manage the copying of system-provided pkg-config.pc files into {WRKDIR}/.buildlink/lib/pkgconfig
>>(code)
BUILTIN_FIND_PKGCONFIG_FILES_VAR+= LIBSELINUX
BUILTIN_FIND_PKGCONFIG_FILES.LIBSELINUX= libselinux.pc
.include "../../mk/buildlink3/
find-pkgconfig-files.mk"
.PHONY: copy-base-pkgconfig
copy-base-pkgconfig:
.if !empty(USE_TOOLS:Mpkg-config)
# ${RUN} ${ECHO} "BUILTIN_FIND_PKGCONFIG_FILES_VAR=${BUILTIN_FIND_PKGCONFIG_FILES_VAR}"
. for _var_ in ${BUILTIN_FIND_PKGCONFIG_FILES_VAR}
${RUN} ${ECHO} "Copying base pkgconfig ${_var_}. ${${_var_}}"
. if empty (${${_var_}}:M__nonexistent__)
${RUN} ${CP} ${${_var_}} ${WRKDIR}/.buildlink/lib/pkgconfig/
. endif
. endfor
.endif
>>(end of code)
When I ran bmake copy-base-pkgconfig, the for loop does not run at all (no echo results), even though I confirmed BUILTIN_FIND_PKGCONFIG_FILES_VAR contains LIBSELINUX, by running bmake show-var VARNAME=BUILTIN_FIND_PKGCONFIG_FILES_VAR
I am using pkgsrc-2022Q1 on Debian GNU/Linux 11 (bullseye), X86_64.
This code is intended to be called like:
pre-configure: copy-base-pkgconfig
in a package Makefile which depends on the Linux base library.
Please help me find out what is wrong with my code.
Thank you!