Commit 58d67ca5 authored by Michael Steinert's avatar Michael Steinert Committed by Facebook Github Bot

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
parent a5093cb5
...@@ -2,7 +2,7 @@ AC_DEFUN([FB_FILTER_PKG_LIBS], ...@@ -2,7 +2,7 @@ AC_DEFUN([FB_FILTER_PKG_LIBS],
[AC_REQUIRE([AC_PROG_SED]) [AC_REQUIRE([AC_PROG_SED])
deps_=`for p in $PKG_DEPS; do pkg-config --libs $p; done` deps_=`for p in $PKG_DEPS; do pkg-config --libs $p; done`
filter_=`for l in $deps_;dnl 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` done`
PKG_LIBS=`echo $1 | $SED $filter_` PKG_LIBS=`echo $1 | $SED $filter_`
] ]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment