Merge pull request #9889 from valeriosetti/issue101-3.6

[Backport 3.6] Move pkgconfig.sh to the framework