Skip to content

Commit

Permalink
build: use pkg-config to find lpeg
Browse files Browse the repository at this point in the history
  • Loading branch information
TWO-FINGER authored and martanne committed Jan 26, 2018
1 parent 0ff02a7 commit 5879337
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -509,11 +509,25 @@ EOF
$LDFLAGS $LDFLAGS_LUA $LDFLAGS_LPEG -o "$tmpo" >/dev/null 2>&1 ; then
CONFIG_LPEG=1
printf "yes\n"
break
else
printf "no\n"
CFLAGS_LPEG=""
LDFLAGS_LPEG=""
for liblpeg in lua5.3-lpeg lua5.2-lpeg; do
printf "\n checking for %s... " "$liblpeg"
if test "$have_pkgconfig" = "yes" ; then
CFLAGS_LPEG=$(pkg-config --cflags $liblpeg 2>/dev/null)
LDFLAGS_LPEG=$(pkg-config --libs $liblpeg 2>/dev/null)
fi

if $CC $CFLAGS $CFLAGS_LUA $CFLAGS_LPEG "$tmpc" \
$LDFLAGS $LDFLAGS_LUA $LDFLAGS_LPEG -o "$tmpo" >/dev/null 2>&1 ; then
CONFIG_LPEG=1
printf "yes\n"
break
else
printf "no"
CFLAGS_LPEG=""
LDFLAGS_LPEG=""
fi
done
fi

test "$lpeg" = "yes" -a $CONFIG_LPEG -ne 1 && fail "$0: cannot find liblpeg"
Expand Down

0 comments on commit 5879337

Please sign in to comment.