From: Michael Steinert Date: Wed, 15 Mar 2017 16:23:02 +0000 (-0700) Subject: Fix the pkg-config filter X-Git-Tag: v2017.03.20.00~7 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=58d67ca5d73517414666cdf65e5e788f07e5a233;p=folly.git Fix the pkg-config filter Summary: I encountered a situation where "pkg-config --libs openssl" included some linker flags, i.e. $ pkg-config --libs openssl -Wl,-z,relro -lssl -lcrypto -ldl -lz This resulted in these linker flags being passed to sed. This change filters out the linker flags from the pkg-config output. Closes https://github.com/facebook/folly/pull/559 Reviewed By: pixelb Differential Revision: D4700120 Pulled By: yfeldblum fbshipit-source-id: 530d524caf965919418d19a1df53d2b418f67717 --- diff --git a/folly/m4/fb_filter_pkg_libs.m4 b/folly/m4/fb_filter_pkg_libs.m4 index 00353fe7..dbc0ced0 100644 --- a/folly/m4/fb_filter_pkg_libs.m4 +++ b/folly/m4/fb_filter_pkg_libs.m4 @@ -2,7 +2,7 @@ AC_DEFUN([FB_FILTER_PKG_LIBS], [AC_REQUIRE([AC_PROG_SED]) deps_=`for p in $PKG_DEPS; do pkg-config --libs $p; done` filter_=`for l in $deps_;dnl - do echo $l | $SED -e 's%\(-l.*\)%-e s/\1//%' -e '/^-L/d';dnl + do echo $l | $SED -ne 's%\(-l.*\)%-e s/\1//%p';dnl done` PKG_LIBS=`echo $1 | $SED $filter_` ]