Blob Blame History Raw
#
# set +o errexit -o noglob is assumed.
#

pkg_pkgconf_host_install_make_post() {
	if [ -e "${PKG_DESTDIR}/bin/${PKG_TARGET}-pkg-config" ]; then
		ex_rtl_fileop rm "${PKG_DESTDIR}/bin/${PKG_TARGET}-pkg-config";
	fi;
	cat > "${PKG_DESTDIR}/bin/${PKG_TARGET}-pkg-config" <<EOF
#!/bin/sh
if [ -z "\${PREFIX_NATIVE}" ]; then
	PREFIX_NATIVE="${PREFIX_NATIVE}";
fi;
if [ "\${#}" -eq 1 ]\
&& [ "x\${1}" = "x--version" ]; then
	"\$(dirname "\${0}")"/pkgconf --version;
else
	"\$(dirname "\${0}")"/pkgconf --define-variable=prefix="\${PREFIX_NATIVE%/}/" --keep-system-cflags "\${@}";
fi;
EOF
	chmod +x "${PKG_DESTDIR}/bin/${PKG_TARGET}-pkg-config";
	ex_rtl_fileop rm "${PKG_DESTDIR}/bin/pkg-config";
};

pkg_pkgconf_install_make_post() {
	if [ -e "${PREFIX_NATIVE}/bin/pkg-config" ]; then
		ex_rtl_fileop rm "${PREFIX_NATIVE}/bin/pkg-config";
	fi;
	ex_rtl_fileop ln_symbolic pkgconf "${PREFIX_NATIVE}/bin/pkg-config";
};

# vim:filetype=sh