source: mod_gnutls/m4/lua.m4 @ 70c2d86

debian/masterdebian/stretch-backportsjessie-backportsupstream upstream/0.3.4
Last change on this file since 70c2d86 was 70c2d86, checked in by Daniel Kahn Gillmor <dkg@…>, 7 years ago

Imported Upstream version 0.3.4

  • Property mode set to 100644
File size: 1.7 KB
Line 
1dnl Check for Lua 5.0 Libraries
2dnl CHECK_LUA(ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND])
3dnl Sets:
4dnl  LUA_CFLAGS
5dnl  LUA_LIBS
6AC_DEFUN([CHECK_LUA],
7[dnl
8
9AC_ARG_WITH(
10    lua,
11    [AC_HELP_STRING([--with-lua=PATH],[Path to the Lua 5.0 prefix])],
12    lua_path="$withval",
13    :)
14
15dnl # Determine memcache lib directory
16if test -z $mc_path; then
17    test_paths="/usr/local /usr"
18else
19    test_paths="${lua_path}"
20fi
21
22for x in $test_paths ; do
23    AC_MSG_CHECKING([for lua.h in ${x}/include/lua50])
24    if test -f ${x}/include/lua50/lua.h; then
25        AC_MSG_RESULT([yes])
26        save_CFLAGS=$CFLAGS
27        save_LDFLAGS=$LDFLAGS
28        CFLAGS="$CFLAGS"
29        LDFLAGS="-L$x/lib $LDFLAGS"
30        AC_CHECK_LIB(lua50, lua_open,
31            [
32            LUA_LIBS="-L$x/lib -llua50 -llualib50"
33            LUA_CFLAGS="-I$x/include/lua50"
34            ])
35        CFLAGS=$save_CFLAGS
36        LDFLAGS=$save_LDFLAGS
37        break
38    else
39        AC_MSG_RESULT([no])
40    fi
41    AC_MSG_CHECKING([for lua.h in ${x}/include])
42    if test -f ${x}/include/lua.h; then
43        AC_MSG_RESULT([yes])
44        save_CFLAGS=$CFLAGS
45        save_LDFLAGS=$LDFLAGS
46        CFLAGS="$CFLAGS"
47        LDFLAGS="-L$x/lib $LDFLAGS"
48        AC_CHECK_LIB(lua, lua_open,
49            [
50            LUA_LIBS="-L$x/lib -llua -llualib"
51            LUA_CFLAGS="-I$x/include/lua50"
52            ])
53        CFLAGS=$save_CFLAGS
54        LDFLAGS=$save_LDFLAGS
55        break
56    else
57        AC_MSG_RESULT([no])
58    fi
59done
60
61AC_SUBST(LUA_LIBS)
62AC_SUBST(LUA_CFLAGS)
63
64if test -z "${LUA_LIBS}"; then
65  AC_MSG_NOTICE([*** Lua 5.0 library not found.])
66  ifelse([$2], , AC_MSG_ERROR([Lua 5.0 library is required]), $2)
67else
68  AC_MSG_NOTICE([using '${LUA_LIBS}' for Lua Library])
69  ifelse([$1], , , $1)
70fi
71])
Note: See TracBrowser for help on using the repository browser.