<URL: http://bugs.freeciv.org/Ticket/Display.html?id=40051 >
Instead of hardcoding lua & tolua paths to Makefiles, they are defined by configure (hardcoded there as long as we are using our own lua source tree, trivial to replace with pkg-config check later) - ML
diff -Nurd -X.diff_ignore freeciv/configure.ac freeciv/configure.ac --- freeciv/configure.ac 2008-01-25 22:45:32.000000000 +0200 +++ freeciv/configure.ac 2008-01-27 01:00:01.000000000 +0200 @@ -1,4 +1,4 @@ -dnl configure.ac for freeciv, for use with autoconf 2.50+ +dnl configure.ac for freeciv dnl Process this file with autoconf to produce a configure script. dnl Initialize with some random file to ensure the source is here. @@ -676,6 +676,28 @@ fi]) fi +dnl In the future we probably get rid of our own lua tree and use +dnl lua from system. +dnl LUA_AS_DEPENDENCY should be empty when using lua outside own our tree. +LUA_CFLAGS="-I\$(top_srcdir)/dependencies/lua/include" +LUA_LIBS="\$(top_builddir)/dependencies/lua/src/liblua.a \ + \$(top_builddir)/dependencies/lua/src/lib/liblualib.a" +LUA_AS_DEPENCY="$LUA_LIBS" +AC_SUBST([LUA_CFLAGS]) +AC_SUBST([LUA_LIBS]) +AC_SUBST([LUA_AS_DEPENDENCY]) + + +TOLUA_CFLAGS="-I\$(top_srcdir)/dependencies/tolua" +TOLUA_LIBS="\$(top_builddir)/dependencies/tolua/libtolua.a" +TOLUA_AS_DEPENCY="$TOLUA_LIBS" +AC_SUBST([TOLUA_CFLAGS]) +AC_SUBST([TOLUA_LIBS]) +AC_SUBST([TOLUA_AS_DEPENDENCY]) + +TOLUA="\$(top_builddir)/dependencies/tolua/tolua" +AC_SUBST([TOLUA]) + dnl Freeciv uses a non-standard macro, Q_(), to handle cases of qualified dnl translatable strings and macro PL_() to handle plural forms. dnl Since the Gettext supplied Autoconf support diff -Nurd -X.diff_ignore freeciv/manual/Makefile.am freeciv/manual/Makefile.am --- freeciv/manual/Makefile.am 2007-09-19 12:30:22.000000000 +0300 +++ freeciv/manual/Makefile.am 2008-01-26 16:27:13.000000000 +0200 @@ -13,9 +13,7 @@ ../utility/libcivutility.a ../common/aicore/libaicore.a \ ../client/helpdata.o \ ../server/scripting/libscripting.a \ - ../dependencies/lua/src/liblua.a \ - ../dependencies/lua/src/lib/liblualib.a \ - ../dependencies/tolua/libtolua.a \ + $(LUA_AS_DEPENDENCY) $(TOLUA_AS_DEPENDENCY) \ ../server/generator/libgenerator.a civmanual_LDFLAGS = $(GGZDMOD_LDFLAGS) civmanual_LDADD = ../utility/libcivutility.a ../common/libcivcommon.a \ @@ -25,8 +23,6 @@ ../utility/libcivutility.a ../server/libcivserver.a \ ../utility/libcivutility.a ../common/aicore/libaicore.a \ ../server/scripting/libscripting.a \ - ../dependencies/lua/src/liblua.a \ - ../dependencies/lua/src/lib/liblualib.a \ - ../dependencies/tolua/libtolua.a \ + $(LUA_LIBS) $(TOLUA_LIBS) \ ../server/generator/libgenerator.a \ $(SERVER_LIBS) $(AUTH_LIBS) $(LIB_GGZDMOD) diff -Nurd -X.diff_ignore freeciv/server/Makefile.am freeciv/server/Makefile.am --- freeciv/server/Makefile.am 2007-10-29 23:26:28.000000000 +0200 +++ freeciv/server/Makefile.am 2008-01-26 16:23:44.000000000 +0200 @@ -91,9 +91,7 @@ ../ai/libcivai.a ../utility/libcivutility.a ./libcivserver.a \ ../utility/libcivutility.a ../common/aicore/libaicore.a \ ./scripting/libscripting.a \ - ../dependencies/lua/src/liblua.a \ - ../dependencies/lua/src/lib/liblualib.a \ - ../dependencies/tolua/libtolua.a \ + $(LUA_AS_DEPENDENCY) $(TOLUA_AS_DEPENDENCY) \ ./generator/libgenerator.a civserver_LDFLAGS = $(GGZDMOD_LDFLAGS) civserver_LDADD = ../utility/libcivutility.a ../common/libcivcommon.a \ @@ -102,9 +100,7 @@ ../utility/libcivutility.a ./libcivserver.a ../utility/libcivutility.a \ ../common/aicore/libaicore.a ./generator/libgenerator.a \ ./scripting/libscripting.a \ - ../dependencies/lua/src/liblua.a \ - ../dependencies/lua/src/lib/liblualib.a \ - ../dependencies/tolua/libtolua.a \ + $(LUA_LIBS) $(TOLUA_LIBS) \ $(AUTH_LIBS) $(SERVER_LIBS) $(LIB_GGZDMOD) $(SERVERICON) desktopfiledir = $(prefix)/share/applications diff -Nurd -X.diff_ignore freeciv/server/scripting/Makefile.am freeciv/server/scripting/Makefile.am --- freeciv/server/scripting/Makefile.am 2007-09-19 12:30:22.000000000 +0300 +++ freeciv/server/scripting/Makefile.am 2008-01-26 16:26:00.000000000 +0200 @@ -5,8 +5,7 @@ AM_CPPFLAGS = \ -I$(top_srcdir)/utility -I$(top_srcdir)/common \ -I$(top_srcdir)/server \ - -I$(top_srcdir)/dependencies/lua/include \ - -I$(top_srcdir)/dependencies/tolua + $(LUA_CFLAGS) $(TOLUA_CFLAGS) # api_gen.[ch] are now distributed to aid in cross-compiling. See PR#13571. dist_libscripting_a_SOURCES = \ @@ -34,5 +33,4 @@ api.pkg $(srcdir)/api_gen.c $(srcdir)/api_gen.h: $(srcdir)/api.pkg - $(top_builddir)/dependencies/tolua/tolua -n api -o $(srcdir)/api_gen.c -H $(srcdir)/api_gen.h $(srcdir)/api.pkg - + $(TOLUA) -n api -o $(srcdir)/api_gen.c -H $(srcdir)/api_gen.h $(srcdir)/api.pkg
_______________________________________________ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev