-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.ac
73 lines (64 loc) · 2.07 KB
/
configure.ac
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
AC_INIT(sancus-lua-core, 0.0, amery@geeks.cl)
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE([foreign dist-bzip2 -Wall -Werror])
LT_INIT
# lua.pc
#
PKG_CHECK_EXISTS([lua], lua_pc='lua', lua_pc='lua5.1')
PKG_CHECK_MODULES(LUA, [${lua_pc}])
# --with-install-lmod
#
AC_MSG_CHECKING([where to install lua modules])
AC_ARG_WITH([install-lmod],
[AS_HELP_STRING([--with-install-lmod], [where to install lua modules])],
[install_lmod="$withval"],
[install_lmod=""])
if test "x${install_lmod}" = x; then
install_lmod=`pkg-config --variable=INSTALL_LMOD ${lua_pc}`
if test "x${install_lmod}" = x; then
# INSTALL_LMOD undefined, compose one
lua_prefix=`pkg-config --variable=prefix ${lua_pc}`
lua_ver=`pkg-config --variable=V ${lua_pc}`
if test "x${lua_ver}" = x; then
lua_ver=`pkg-config --variable=major_version ${lua_pc}`
if test "x{lua_ver}" = x; then
AC_MSG_ERROR([${lua_pc}.pc:no INSTALL_LMOD/V/major_version found])
fi
fi
install_lmod=${lua_prefix}/share/lua/${lua_ver}
fi
fi
AC_MSG_RESULT([$install_lmod])
AC_SUBST(INSTALL_LMOD, ${install_lmod})
# --with-install-cmod
#
AC_MSG_CHECKING([where to install lua C modules])
AC_ARG_WITH([install-cmod],
[AS_HELP_STRING([--with-install-cmod], [where to install lua C modules])],
[install_cmod="$withval"],
[install_cmod=""])
if test "x${install_cmod}" = x; then
install_cmod=`pkg-config --variable=INSTALL_CMOD ${lua_pc}`
if test "x${install_cmod}" = x; then
# INSTALL_CMOD undefined, compose one
lua_prefix=`pkg-config --variable=prefix ${lua_pc}`
lua_ver=`pkg-config --variable=V ${lua_pc}`
if test "x${lua_ver}" = x; then
lua_ver=`pkg-config --variable=major_version ${lua_pc}`
if test "x{lua_ver}" = x; then
AC_MSG_ERROR([${lua_pc}.pc:no INSTALL_CMOD/V/major_version found])
fi
fi
install_cmod=${lua_prefix}/lib/lua/${lua_ver}
fi
fi
AC_MSG_RESULT([$install_cmod])
AC_SUBST(INSTALL_CMOD, ${install_cmod})
AC_CONFIG_FILES([sancus-lua.pc])
AC_CONFIG_FILES([Makefile
doc/Makefile
src/cmod/Makefile
src/lua/Makefile
src/Makefile])
AC_OUTPUT