summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2010-07-25 13:12:49 +0200
committerBram Moolenaar <Bram@vim.org>2010-07-25 13:12:49 +0200
commit8220a6813ed6889b4aefd2b313ff5e0875eb7952 (patch)
tree2a6f2602568588546bef690939d8ecd158747386 /src
parent7510fe74337599f70ae2044aef4f186b1f1c1bf9 (diff)
Use the SONAME-versioned liblua, if it exists. (James Vega)
Diffstat (limited to 'src')
-rwxr-xr-xsrc/auto/configure10
-rw-r--r--src/configure.in12
2 files changed, 18 insertions, 4 deletions
diff --git a/src/auto/configure b/src/auto/configure
index cd829d18d8..22ec98a822 100755
--- a/src/auto/configure
+++ b/src/auto/configure
@@ -4682,7 +4682,7 @@ $as_echo_n "checking Lua version... " >&6; }
if test "${vi_cv_version_lua+set}" = set; then :
$as_echo_n "(cached) " >&6
else
- vi_cv_version_lua=`${vi_cv_path_lua} -e "print(_VERSION:sub(5,7))"`
+ vi_cv_version_lua=`${vi_cv_path_lua} -e "print(_VERSION)" | sed 's/.* //'`
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $vi_cv_version_lua" >&5
$as_echo "$vi_cv_version_lua" >&6; }
@@ -4714,10 +4714,16 @@ $as_echo "no" >&6; }
$as_echo "#define FEAT_LUA 1" >>confdefs.h
if test "$enable_luainterp" = "dynamic"; then
+ for i in 0 1 2 3 4 5 6 7 8 9; do
+ if test -f "${vi_cv_path_lua_pfx}/lib/liblua${vi_cv_version_lua}.so.$i"; then
+ LUA_SONAME=".$i"
+ break
+ fi
+ done
$as_echo "#define DYNAMIC_LUA 1" >>confdefs.h
LUA_LIBS=""
- LUA_CFLAGS="-DDYNAMIC_LUA_DLL=\\\"liblua${vi_cv_version_lua}.so\\\" $LUA_CFLAGS"
+ LUA_CFLAGS="-DDYNAMIC_LUA_DLL=\\\"liblua${vi_cv_version_lua}.so$LUA_SONAME\\\" $LUA_CFLAGS"
fi
fi
diff --git a/src/configure.in b/src/configure.in
index f472210405..38fdea5909 100644
--- a/src/configure.in
+++ b/src/configure.in
@@ -452,7 +452,7 @@ if test "$enable_luainterp" = "yes" -o "$enable_luainterp" = "dynamic"; then
if test "X$vi_cv_path_lua" != "X"; then
dnl -- find Lua version
AC_CACHE_CHECK(Lua version, vi_cv_version_lua,
- [ vi_cv_version_lua=`${vi_cv_path_lua} -e "print(_VERSION:sub(5,7))"` ])
+ [ vi_cv_version_lua=`${vi_cv_path_lua} -e "print(_VERSION)" | sed 's/.* //'` ])
AC_MSG_CHECKING(if lua.h can be found in $vi_cv_path_lua_pfx/include/lua$vi_cv_version_lua)
if test -f $vi_cv_path_lua_pfx/include/lua$vi_cv_version_lua/lua.h; then
AC_MSG_RESULT(yes)
@@ -478,9 +478,17 @@ if test "$enable_luainterp" = "yes" -o "$enable_luainterp" = "dynamic"; then
LUA_PRO="if_lua.pro"
AC_DEFINE(FEAT_LUA)
if test "$enable_luainterp" = "dynamic"; then
+ dnl Determine the SONAME for the current version, but fallback to
+ dnl liblua${vi_cv_version_lua}.so if no SONAME-versioned file is found.
+ for i in 0 1 2 3 4 5 6 7 8 9; do
+ if test -f "${vi_cv_path_lua_pfx}/lib/liblua${vi_cv_version_lua}.so.$i"; then
+ LUA_SONAME=".$i"
+ break
+ fi
+ done
AC_DEFINE(DYNAMIC_LUA)
LUA_LIBS=""
- LUA_CFLAGS="-DDYNAMIC_LUA_DLL=\\\"liblua${vi_cv_version_lua}.so\\\" $LUA_CFLAGS"
+ LUA_CFLAGS="-DDYNAMIC_LUA_DLL=\\\"liblua${vi_cv_version_lua}.so$LUA_SONAME\\\" $LUA_CFLAGS"
fi
fi
AC_SUBST(LUA_SRC)