Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix auto-detection of optional libraries for OS X

The OS X version of grep doesn't support -P (--perl-regexp). It was breaking the building.
Solved by slightly changing the RegExp and using -E (--extended-regexp).
  • Loading branch information...
commit 19bcf35a949b22abbbf6d9b02b4b3067da5284c2 1 parent 718e868
@lpinca lpinca authored
Showing with 3 additions and 3 deletions.
  1. +3 −3 util/has_lib.sh
View
6 util/has_lib.sh
@@ -1,15 +1,15 @@
#!/usr/bin/env bash
has_lib() {
- local regex="lib$1.+(so|dylib)(?!\.)"
+ local regex="lib$1.+(so|dylib)$"
# Try using ldconfig on linux systems
- for LINE in `which ldconfig > /dev/null && ldconfig -p 2>/dev/null | grep -P $regex`; do
+ for LINE in `which ldconfig > /dev/null && ldconfig -p 2>/dev/null | grep -E $regex`; do
return 0
done
# Try just checking common library locations
for dir in /lib /usr/lib /usr/local/lib /opt/local/lib; do
- test -d $dir && ls $dir | grep -P $regex && return 0
+ test -d $dir && ls $dir | grep -E $regex && return 0
done
return 1
Please sign in to comment.
Something went wrong with that request. Please try again.