hwaf-ext: more robust declare_build_external