From ba8ce9226af026f873883b7d4e29079bbfece586 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 27 Dec 2018 17:23:11 +0200 Subject: Fix logic bug in pkg-config shared/static selection --- build2/cc/pkgconfig.cxx | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/build2/cc/pkgconfig.cxx b/build2/cc/pkgconfig.cxx index 1630076f..c35569c6 100644 --- a/build2/cc/pkgconfig.cxx +++ b/build2/cc/pkgconfig.cxx @@ -1131,16 +1131,6 @@ namespace build2 for (const dir_path& d: top_usrd) pkgconfig_search (d, add_pc_dir); for (const dir_path& d: top_sysd) pkgconfig_search (d, add_pc_dir); - // First sort out the interface dependencies (which we are setting on - // lib{}). If we have the shared .pc variant, then we use that. - // Otherwise -- static but extract without the --static option (see also - // the saving logic). - // - pkgconf& ipc (sp.empty () ? apc : spc); // Interface package info. - bool ibl ((sp.empty () - ? at->mtime () - : st->mtime ()) == timestamp_unreal); // Binless. - bool pa (at != nullptr && !ap.empty ()); if (pa || sp.empty ()) apc = pkgconf (ap, pc_dirs, sys_lib_dirs, sys_inc_dirs); @@ -1149,7 +1139,19 @@ namespace build2 if (ps || ap.empty ()) spc = pkgconf (sp, pc_dirs, sys_lib_dirs, sys_inc_dirs); - parse_libs (lt, ibl, ipc, false, &prs); + // Sort out the interface dependencies (which we are setting on lib{}). + // If we have the shared .pc variant, then we use that. Otherwise -- + // static but extract without the --static option (see also the saving + // logic). + // + pkgconf& ipc (ps ? spc : apc); // Interface package info. + + parse_libs ( + lt, + (ps ? st->mtime () : at->mtime ()) == timestamp_unreal /* binless */, + ipc, + false, + &prs); if (pa) { -- cgit