[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Enigma-devel] BUG: tolua verirrt

From: Ronald Lamprecht
Subject: Re: [Enigma-devel] BUG: tolua verirrt
Date: Fri, 08 Dec 2006 16:47:46 +0100
User-agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)

Hi Tacvek,

Tacvek wrote:
make[1]: Leaving directory `/rep/svn/public/enigma-game-trunk/lib-src'
Making all in tools
make[1]: Entering directory `/rep/svn/public/enigma-game-trunk/tools'
gcc -I../lib-src/lua -x c++ -DENABLE_ASSERT -g -DCXXLUA -g -O2 -o tolua tolua-tolua.o tolua-toluabind.o -L../lib-src/lua -
llua -lstdc++ -lxerces-c -lpng -ldl

Autoconf 2.61 with automake 1.10 does show the problem.
I've found the change between automake 1.9 and 1.10 that is responsible.

The change is definately intentional. Indeed, it was only due to a bug in older automakes that
my code worked at all. Automake deliberately passes CFLAGS to the linker.

I think I have found a new workaround that is not likely to break.
I've attached the patch. The patch also does a little bit a unrelated cleanup to make automake happier.

Sidney reported some problems on MacOS. His fix proposal may generate trouble with the "dist" target. Could you try to analyse his problems:

3) On MacOS there is some difference between gcc and g++ that requires
you to link using g++ if any of the source files are in C++. This causes
the link step of the build of the tools directory to break now that LUA
is C++ because tolua.c and toluabind.c both have '.c' extensions and gcc
was being used. I have attached a patch to configure.ac and
tools/Makefile.am that when the C++ version of LUA is being used creates
an empty file tools/dummy.cc and adds that to the list tolua.c and
toluabind.c to compile and link. The result builds and runs fine on my
Intel MacBook running MacOS 10.4.8.



Index: tools/Makefile.am
--- tools/Makefile.am   (revision 510)
+++ tools/Makefile.am   (working copy)
@@ -22,6 +22,7 @@
+tolua_SOURCES += dummy.cc
 tolua_CPPFLAGS += -x c++ $(AM_CXXFLAGS) $(CXXFLAGS)
 tolua_LDADD += -lstdc++
Index: configure.ac
--- configure.ac        (revision 510)
+++ configure.ac        (working copy)
@@ -290,8 +290,10 @@
   AS_HELP_STRING(--enable-cxxlua, Build Lua with C++ 
 if test "x$enable_cxxlua" = xyes; then
+  echo > tools/dummy.cc
+  rm -f tools/dummy.cc

reply via email to

[Prev in Thread] Current Thread [Next in Thread]