Skip to content

Commit

Permalink
use pkg-config to find compiler flags for zlib (#5416)
Browse files Browse the repository at this point in the history
Co-authored-by: Michael Chirico <chiricom@google.com>
  • Loading branch information
CreRecombinase and MichaelChirico authored Jul 11, 2024
1 parent b5ef7ce commit d149c09
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ else
else
NOZLIB=0
lib=`pkg-config --libs zlib`
cflag=`pkg-config --cflags zlib`
expr -- "$lib" : ".*-lz$" >> config.log # -- for FreeBSD, #4652
if [ $? -ne 0 ]; then
expr -- "$lib" : ".*-lz " >> config.log
Expand Down Expand Up @@ -174,8 +175,8 @@ if [ "$NOZLIB" = "1" ]; then
sed -e "s|@zlib_cflags@|-DNOZLIB|" src/Makevars > src/Makevars.tmp && mv src/Makevars.tmp src/Makevars
sed -e "s|@zlib_libs@||" src/Makevars > src/Makevars.tmp && mv src/Makevars.tmp src/Makevars
else
sed -e "s|@zlib_cflags@||" src/Makevars > src/Makevars.tmp && mv src/Makevars.tmp src/Makevars
sed -e "s|@zlib_libs@|-lz|" src/Makevars > src/Makevars.tmp && mv src/Makevars.tmp src/Makevars
sed -e "s|@zlib_cflags@|${cflag}|" src/Makevars > src/Makevars.tmp && mv src/Makevars.tmp src/Makevars
sed -e "s|@zlib_libs@|${lib}|" src/Makevars > src/Makevars.tmp && mv src/Makevars.tmp src/Makevars
fi

exit 0

0 comments on commit d149c09

Please sign in to comment.