aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2018-03-14 12:09:41 +0100
committerMarc André Tanner <mat@brain-dump.org>2018-03-14 12:09:41 +0100
commit6ea30e89c81cd717e9c3a3c2cd1d8a8d7e0834d2 (patch)
treefe70f5464f188be5758ae5b4597f2a58f1f03d23
parentbe949f35e816a91fca58e7735c6d6e3806421956 (diff)
parentbf0f3f519e7ded50dd2a91a9b6eb431114c1c0c0 (diff)
downloadvis-6ea30e89c81cd717e9c3a3c2cd1d8a8d7e0834d2.tar.gz
vis-6ea30e89c81cd717e9c3a3c2cd1d8a8d7e0834d2.tar.xz
Merge branch 'lpeg-ac_check_lib' of https://github.com/Two-Finger/vis
-rwxr-xr-xconfigure46
1 files changed, 23 insertions, 23 deletions
diff --git a/configure b/configure
index 1876ac4..7dc6bac 100755
--- a/configure
+++ b/configure
@@ -482,7 +482,7 @@ CONFIG_LPEG=0
if test $CONFIG_LUA -eq 1 -a "$lpeg" != "no" ; then
- printf "checking for Lua statically linked liblpeg... "
+ printf "checking for Lua statically linked liblpeg...\n"
cat > "$tmpc" <<EOF
#include <lua.h>
@@ -503,34 +503,34 @@ int main(int argc, char *argv[]) {
}
EOF
- CFLAGS_LPEG=""
- LDFLAGS_LPEG="-llpeg"
+ for liblpeg in lpeg lua5.3-lpeg lua5.2-lpeg; do
+ printf " checking for static %s... " "$liblpeg"
- 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"
- else
- printf "no\n"
- for liblpeg in lua5.3-lpeg lua5.2-lpeg; do
- printf " checking for static %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" \
+ if test "$have_pkgconfig" = "yes" ; then
+ CFLAGS_LPEG=$(pkg-config --cflags $liblpeg 2>/dev/null)
+ LDFLAGS_LPEG=$(pkg-config --libs $liblpeg 2>/dev/null)
+ if test $? -eq 0 && $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\n"
- CFLAGS_LPEG=""
- LDFLAGS_LPEG=""
fi
- done
- fi
+ fi
+
+ CFLAGS_LPEG=""
+ LDFLAGS_LPEG="-l$liblpeg"
+
+ 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\n"
+ CFLAGS_LPEG=""
+ LDFLAGS_LPEG=""
+ fi
+ done
test "$lpeg" = "yes" -a $CONFIG_LPEG -ne 1 && fail "$0: cannot find liblpeg"
fi