~drizzle-trunk/drizzle/development

1099.1.1 by Monty Taylor
pandora-build v0.23
1
dnl -*- mode: m4; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
dnl vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
dnl   
4
dnl pandora-build: A pedantic build system
5
dnl Copyright (C) 2009 Sun Microsystems, Inc.
1126.6.8 by Monty Taylor
pandora-build v0.62 - cleaned up some copyright header mistakes. Merged in trond's innodb detection.
6
dnl This file is free software; Sun Microsystems
1099.1.1 by Monty Taylor
pandora-build v0.23
7
dnl gives unlimited permission to copy and/or distribute it,
8
dnl with or without modifications, as long as this notice is preserved.
9
dnl
10
dnl From Monty Taylor
11
12
AC_DEFUN([PANDORA_WITH_LUA],[
13
    dnl Check for lua
14
    AC_ARG_WITH([lua], 
15
    [AS_HELP_STRING([--with-lua],
16
      [Build Lua Bindings @<:@default=yes@:>@])],
17
    [with_lua=$withval], 
18
    [with_lua=yes])
19
20
  AS_IF([test "x$with_lua" != "xno"],[
21
    AS_IF([test "x$with_lua" = "xyes"],
22
      [LUAPC=lua],
23
      [LUAPC=$with_lua])
24
25
    PKG_CHECK_MODULES([LUA], $LUAPC >= 5.1, [
26
      AC_DEFINE([HAVE_LUA], [1], [liblua])
27
      AC_DEFINE([HAVE_LUA_H], [1], [lua.h])
28
      with_lua=yes
29
    ],[
1093.9.25 by Monty Taylor
pandora-build v0.51
30
      LUAPC=lua5.1
31
      PKG_CHECK_MODULES([LUA], $LUAPC >= 5.1, [
1099.1.1 by Monty Taylor
pandora-build v0.23
32
        AC_DEFINE([HAVE_LUA], [1], [liblua])
33
        AC_DEFINE([HAVE_LUA_H], [1], [lua.h])
1093.9.25 by Monty Taylor
pandora-build v0.51
34
        with_lua=yes
1099.1.1 by Monty Taylor
pandora-build v0.23
35
      ],[
36
        AC_DEFINE([HAVE_LUA],["x"],["x"])
37
        with_lua=no
38
      ])
39
    ])
40
1093.9.25 by Monty Taylor
pandora-build v0.51
41
    AC_CACHE_CHECK([for LUA installation location],[pandora_cv_lua_archdir],[
42
      AS_IF([test "$prefix" = "NONE"],[
43
        pandora_cv_lua_archdir=`${PKG_CONFIG} --define-variable=prefix=${ac_default_prefix} --variable=INSTALL_CMOD ${LUAPC}`
44
      ],[
45
        pandora_cv_lua_archdir=`${PKG_CONFIG} --define-variable=prefix=${prefix} --variable=INSTALL_CMOD ${LUAPC}`
46
      ])
47
    ])
48
    LUA_ARCHDIR="${pandora_cv_lua_archdir}"
49
    AC_SUBST(LUA_ARCHDIR)
50
    AC_SUBST(LUA_CFLAGS)
51
    AC_SUBST(LUA_LIBS)
1099.1.1 by Monty Taylor
pandora-build v0.23
52
  ])
53
  AM_CONDITIONAL(BUILD_LUA, test "$with_lua" = "yes")
54
55
])