aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTwoFinger <Two-Finger@users.noreply.github.com>2018-01-09 22:18:25 +0200
committerMarc André Tanner <mat@brain-dump.org>2018-01-26 20:06:31 +0100
commit5879337bb6905540a8f0797aa1b084b9cdc1d9fa (patch)
tree60f5e39bf401f1aa33e6a45764a9f81ca1bac208
parent0ff02a70f911327e8a1f92881f5ef43b7cd0e7c8 (diff)
downloadvis-5879337bb6905540a8f0797aa1b084b9cdc1d9fa.tar.gz
vis-5879337bb6905540a8f0797aa1b084b9cdc1d9fa.tar.xz
build: use pkg-config to find lpeg
-rwxr-xr-xconfigure22
1 files changed, 18 insertions, 4 deletions
diff --git a/configure b/configure
index 25059f1..9b867cd 100755
--- a/configure
+++ b/configure
@@ -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"