After I did ("frickel") some make files for some of my projects, I finaly have a clue how the 'autotools hell' works... more or less.
Here is a patch for the lua problem. I copied most of it from GNOME Hearts 0.1.3 (
http://www.gnomefiles.org/app.php/Hearts). They had exactly the same problem.
Code: Select all
Index: configure.ac
===================================================================
--- configure.ac (Revision 10772)
+++ configure.ac (Arbeitskopie)
@@ -501,12 +501,11 @@
# FFmpeg #
#--------#
-## THIS IS FOR SURE A BUG (-llualib)
# checking for FFmpeg-headers
AX_CHECK_REQUIRED_HEADER_LIB([avformat.h ffmpeg/avformat.h] ,[avformat], [main],
[AX_CHECK_REQUIRED_HEADER_LIB([avcodec.h ffmpeg/avcodec.h], [avcodec], [main],,, [http://ffmpeg.sourceforge.net]) LIBS="${LIBS} -lavformat -lavcodec"],
[AX_GET_INSTALL_NECESSARY_LIB([http://svn.orxonox.net/webdev/develop/ext_libs], [ffmpeg.tar.gz], [ffmpeg], [extern_libs/], [include/*.h lib/*.a])
- LIBS="-llualib -llua" CPPFLAGS="${CPPFLAGS} -I$(top_build_dir)/extern_libs" ],
+ CPPFLAGS="${CPPFLAGS} -I$(top_build_dir)/extern_libs" ],
[http://ffmpeg.sourceforge.net])
@@ -590,9 +589,35 @@
#-----#
# LUA #
#-----#
-LUA_DIR="/usr/include/lua"
-AX_CHECK_LUA([${LUA_DIR}])
+# strange Lua fix from GNOME Hearts 0.1.3, because it's liblua50 on Debian and liblua (with no .pc file) everywhere else
+PKG_CHECK_MODULES(LUA, [lua50, lualib50], [], [
+ AC_CHECK_LIB(lua, lua_open, LIB_LUA=-llua)
+ AC_CHECK_LIB(lualib, luaopen_base, LIB_LUA_LIB=-llualib, , [$LIB_LUA -ldl -lm])
+
+ if test "x${LIB_LUA}" = "x"; then
+ echo "Could not find liblua. Please install liblua 5.0"
+ exit 1
+ fi
+ if test "x${LIB_LUA_LIB}" = "x"; then
+ echo "Could not find liblualib. Please install liblualib 5.0"
+ exit 1
+ fi
+
+ LUA_INT=`lua -e "print(_VERSION)" | awk '/Lua/ {split($2, VERSION, "."); printf "%d\n", VERSION[[1]] * 100 + VERSION[[2]];}'`
+ if test $LUA_INT -ne 500; then
+ echo "Wrong Lua version found. You need Lua 5.0. Note: Orxonox will not work with Lua 5.1"
+ exit 1
+ fi
+
+ LUA_CFLAGS=
+ LUA_LIBS="$LIB_LUA $LIB_LUA_LIB"
+])
+AC_SUBST(LUA_CFLAGS)
+AC_SUBST(LUA_INCLUDES)
+AC_SUBST(LUA_LIBS)
+CPPFLAGS="$CPPFLAGS $LUA_CFLAGS"
+
#--------#
# efence #
#--------#
So the dirty hack from above isn't needed anymore. It's tested with Debian Etch and Ubuntu Feisty and it should be tested on other distros too before inclusion.
There is one cosmetic error on my system I couldn't solve: $LIB_LUA = -I/usr/include//lua50 (one slash would be enough, but it works anyway.) Any ideas? Maybe a debian bug...
This patch should also solve this bug:
viewtopic.php?t=117
because configure enforces Lua 5.0.x. But that can be chanced easily in the future when we support Lua 5.1.x.
nowic
@bensch: AX_CHECK_LUA would be removed. I have no clue what that does
"I've always lived cheaply. I live like a student, basically. And I like that because it means that money is not telling me what to do. I can do what I think is important for me to do. It freed me to do what seemed worth doing." -- Richard Stallman