Line 0
Link Here
|
|
|
1 |
AC_PREREQ(2.59) |
2 |
AC_INIT([lua], [5.3.0], [https://bugzilla.redhat.com/], [lua-at], [http://www.lua.org]) |
3 |
AC_SUBST([MAJOR_VERSION], [5.3]) |
4 |
|
5 |
AC_CONFIG_HEADERS([config.h]) |
6 |
AC_CONFIG_SRCDIR([src/lapi.c]) |
7 |
|
8 |
AM_INIT_AUTOMAKE([1.9 foreign]) |
9 |
|
10 |
AC_PROG_CC |
11 |
AC_PROG_LIBTOOL |
12 |
|
13 |
AC_ARG_WITH( |
14 |
[compat-module], |
15 |
[AC_HELP_STRING([--with-compat-module], [Enable LUA_COMPAT_MODULE functions [default=no]])], |
16 |
[use_compat_module=$withval], |
17 |
[use_compat_module=no] |
18 |
) |
19 |
|
20 |
COMPAT_DEFS="#undef LUA_COMPAT_ALL" |
21 |
if test "x$use_compat_module" == "xyes"; then |
22 |
COMPAT_DEFS="#define LUA_COMPAT_5_1 |
23 |
#define LUA_COMPAT_5_2" |
24 |
fi |
25 |
AC_SUBST(COMPAT_DEFS) |
26 |
|
27 |
AC_ARG_WITH( |
28 |
[readline], |
29 |
[AC_HELP_STRING([--with-readline], [Use readline for interpreter input [default=yes]])], |
30 |
[use_readline=$withval], |
31 |
[use_readline=yes] |
32 |
) |
33 |
|
34 |
LUA_LIBS="-lm" |
35 |
|
36 |
# Check for readline |
37 |
READLINE_DEFS="#undef LUA_USE_READLINE" |
38 |
if test "x$use_readline" == "xyes"; then |
39 |
AC_CHECK_LIB([readline], [readline], [:], [use_readline=no], [-lncurses]) |
40 |
AC_CHECK_HEADERS([readline/readline.h readline/history.h], [], [use_readline=no]) |
41 |
if test "x$use_readline" == "xno"; then |
42 |
AC_MSG_WARN([readline headers could not be found, disabling readline support]) |
43 |
else |
44 |
READLINE_DEFS="#define LUA_USE_READLINE" |
45 |
READLINE_LIBS="-lreadline -lncurses" |
46 |
fi |
47 |
fi |
48 |
AC_SUBST(READLINE_DEFS) |
49 |
AC_SUBST(READLINE_LIBS) |
50 |
|
51 |
case "$host" in |
52 |
*-mingw*) use_os=win32 ;; |
53 |
*-darwin*) use_os=macosx ;; |
54 |
*) use_os=posix ;; |
55 |
esac |
56 |
|
57 |
POSIX_DEFS="#undef LUA_USE_POSIX" |
58 |
LUA_DL_DEFS="#undef LUA_USE_DLOPEN" |
59 |
LUA_BUILD_AS_DLL_DEFS="#undef LUA_BUILD_AS_DLL" |
60 |
|
61 |
if test "x$use_os" == "xwin32"; then |
62 |
LUA_BUILD_AS_DLL_DEFS="#define LUA_BUILD_AS_DLL" |
63 |
elif test "x$use_os" == "xmacosx"; then |
64 |
POSIX_DEFS="#define LUA_USE_POSIX" |
65 |
LUA_DL_DEFS="#define LUA_DL_DYLD" |
66 |
elif test "x$use_os" == "xposix"; then |
67 |
POSIX_DEFS="#define LUA_USE_POSIX" |
68 |
LUA_DL_DEFS="#define LUA_DL_DLOPEN" |
69 |
LUA_LIBS="$LUA_LIBS -ldl" |
70 |
fi |
71 |
AC_SUBST(POSIX_DEFS) |
72 |
AC_SUBST(LUA_DL_DEFS) |
73 |
AC_SUBST(LUA_BUILD_AS_DLL_DEFS) |
74 |
|
75 |
AC_SUBST(LUA_LIBS) |
76 |
|
77 |
AC_CONFIG_FILES([Makefile |
78 |
src/Makefile |
79 |
src/lua$MAJOR_VERSION.pc |
80 |
src/luaconf.h.template |
81 |
doc/Makefile |
82 |
]) |
83 |
AC_OUTPUT |