aboutsummaryrefslogtreecommitdiff
blob: f030c88ffa801a1f3d4eb27d76e7695612cbb2d0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
AC_PREREQ([2.69])
AC_INIT([lua5.1], [5.1.5], [https://bugs.gentoo.org/], [lua], [http://www.lua.org])

AC_CONFIG_SRCDIR([src/lapi.c])
AC_CONFIG_MACRO_DIR([m4])

AM_INIT_AUTOMAKE([1.15 foreign dist-xz no-dist-gzip serial-tests subdir-objects -Wall])

AC_PROG_CC
AC_PROG_SED
AM_PROG_AR
LT_INIT([disable-static])
LT_LIB_M

PKG_INSTALLDIR

AC_ARG_ENABLE([deprecated],
  [AS_HELP_STRING([--disable-deprecated], [Disable deprecated APIs [default=yes]])])

AS_IF([test "x$enable_deprecated" != "xno"], [
  AC_DEFINE([LUA_COMPAT_VARARG], [1], [Compatibility with old vararg feature])
  AC_DEFINE([LUA_COMPAT_MOD], [1], [Compatibility with old math.mod function])
  AC_DEFINE([LUA_COMPAT_LSTR], [1], [Compatibility with old long string nesting facility])
  AC_DEFINE([LUA_COMPAT_GFIND], [1], [Compatibility with old 'string.gfind' name])
  AC_DEFINE([LUA_COMPAT_OPENLIB], [1], [Compatibility with old 'luaL_openlib' behavior])
])

AC_ARG_WITH([readline],
  [AS_HELP_STRING([--with-readline], [Use readline for interpreter input [default=yes]])])

# Check for readline
AS_IF([test "x$with_readline" != "xno"], [
  PKG_CHECK_MODULES([READLINE], [readline])
  AC_DEFINE([LUA_USE_READLINE], [1], [Building with readline support])
])

AS_CASE([${host}],
  [*-mingw*], [
    AC_DEFINE([LUA_BUILD_AS_DLL], [1], [Building a DLL under Win32])
  ],
  [*-darwin*], [
    AC_DEFINE([LUA_USE_MACOSX], [1], [Use macOS routines])
  ],
  [*-linux*], [
    AC_DEFINE([LUA_USE_LINUX], [1], [Use Linux routines])
    AC_SEARCH_LIBS([dlopen], [dl dld], [], [
      AC_MSG_ERROR([unable to find the dlopen() function])
    ])
  ], [
    AC_DEFINE([LUA_USE_POSIX], [1], [Use POSIX routines])
    AC_SEARCH_LIBS([dlopen], [dl dld], [], [
      AC_MSG_ERROR([unable to find the dlopen() function])
    ])
  ]
)

AC_CONFIG_FILES([Makefile src/lua5.1.pc])
AC_OUTPUT