From e404ff79067fcde24150f42c2dcb926ec5926fd1 Mon Sep 17 00:00:00 2001 From: s_alexander Date: Wed, 13 Jan 2010 20:33:19 +0000 Subject: change lua lib filename for different versions git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@2088 b956fd51-792f-4845-bead-9b4dfca2ff2c --- configure | 4 ++++ configure.ac | 3 +++ src/config.inc.in | 5 ++++- src/lib/Lua/ULua.pas | 6 +++--- 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/configure b/configure index 97d41e66..4d70de01 100755 --- a/configure +++ b/configure @@ -641,6 +641,7 @@ libavcodec_VERSION_RELEASE libavcodec_VERSION_MINOR libavcodec_VERSION_MAJOR libavcodec_VERSION +lua_LIB_NAME DARWIN_VERSION MACOSX_VERSION MACOSX_VERSION_INT @@ -4911,6 +4912,7 @@ See the pkg-config man page for more details. fi fi +lua_LIB_NAME="lua5.1" if [ x$lua_HAVE = xno ]; then have_lib="no" @@ -4984,8 +4986,10 @@ See the pkg-config man page for more details. fi fi + lua_LIB_NAME="lua" fi + # find FFMpeg # Note: do not use the min/max version parameters with ffmpeg # otherwise it might fail in ubuntu due to a wrong version number diff --git a/configure.ac b/configure.ac index 8f9f6e11..e0846256 100644 --- a/configure.ac +++ b/configure.ac @@ -170,9 +170,12 @@ PKG_HAVE([sqlite3], [sqlite3], yes) # (K)Ubuntu uses lua5.1.pc, Mac OS X and other # linux distributions use lua.pc PKG_HAVE([lua], [lua5.1], no) +lua_LIB_NAME="lua5.1" if [[ x$lua_HAVE = xno ]]; then PKG_HAVE([lua], [lua >= 5.1], yes) + lua_LIB_NAME="lua" fi +AC_SUBST(lua_LIB_NAME) # find FFMpeg # Note: do not use the min/max version parameters with ffmpeg diff --git a/src/config.inc.in b/src/config.inc.in index 004f8413..b5e086f4 100644 --- a/src/config.inc.in +++ b/src/config.inc.in @@ -5,6 +5,10 @@ {* Libraries *} +{$IF Defined(IncludeConstants)} + lua_lib_name = '@lua_LIB_NAME@'; +{$IFEND} + {$@DEFINE_HAVE_FFMPEG@ HaveFFmpeg} {$IF Defined(HaveFFmpeg) and Defined(IncludeConstants)} av__codec = 'libavcodec'; @@ -47,4 +51,3 @@ {$IFEND} {$@DEFINE_HAVE_PORTMIXER@ HavePortmixer} - diff --git a/src/lib/Lua/ULua.pas b/src/lib/Lua/ULua.pas index f0396bfe..1de48a3c 100644 --- a/src/lib/Lua/ULua.pas +++ b/src/lib/Lua/ULua.pas @@ -15,7 +15,8 @@ interface {$IFDEF UNIX} uses - dl; + dl, + UConfig; {$ENDIF} {$DEFINE LUA51} @@ -37,8 +38,7 @@ const LuaDLL = 'liblua.5.1.dylib'; {$linklib liblua.5.1} {$ELSE} - LuaDLL51 = 'lua5.1.so'; - LuaDLL = 'lua.so'; + LuaDLL = lua_lib_name; {$ENDIF} {$ENDIF} {$IFDEF MACOS} -- cgit v1.2.3