----- Original Message -----
From: "Ronald Lamprecht" <[EMAIL PROTECTED]>
To: "Tacvek" <[EMAIL PROTECTED]>
Cc: <enigma-devel@nongnu.org>
Sent: Thursday, October 05, 2006 6:25 PM
Subject: Re: [Enigma-devel] crashes on linux gcc exception handling
Hi,
Tacvek wrote:
Why is it not possible to use the option "-x c++" as you did for the
compilation of Lua itself?
The work around is simple, add -lstdc++ to LDADD.
Of cource that is gcc specific... but so is '-x c++'.
The new patch should work. Its late right now so i will send it
tomorrow.
Ok. It is attached. It appears to work fine.
I've only tested Linux compilation, and mingw32 cross-compilation, so
it may be wise to check OS X compilation, although I don't think the
patch
will break that,
I tested it on native mingw - with the following result:
make[1]: Entering directory `/p/Ronald/Home/workareas/enigma-svn/tools'
if gcc -DHAVE_CONFIG_H -I. -I. -I../src -I../lib-src/lua -x
++ -I/mingw/include/SDL -Dmain=SDL_main -I../intl -DENABLE_ASSERT -g -DCXXLUA
-g -O2 -MT tolua-tolua.o -MD -MP -MF ".deps/tolua-tolua.Tpo" -c -o
tolua-tolua.o `test -f 'tolua.c' || echo './'`tolua.c; \
then mv -f ".deps/tolua-tolua.Tpo" ".deps/tolua-tolua.Po"; else rm -f
".deps/tolua-tolua.Tpo"; exit 1; fi
if gcc -DHAVE_CONFIG_H -I. -I. -I../src -I../lib-src/lua -x
++ -I/mingw/include/SDL -Dmain=SDL_main -I../intl -DENABLE_ASSERT -g -DCXXLUA
-g -O2 -MT tolua-toluabind.o -MD -MP -MF
".deps/tolua-toluabind.Tpo" -c -o tolua-toluabind.o `test -f
'toluabind.c' || echo './'`toluabind.c; \
then mv -f ".deps/tolua-toluabind.Tpo" ".deps/tolua-toluabind.Po"; else
rm -f ".deps/tolua-toluabind.Tpo"; exit 1; fi
gcc -g -O2 -o tolua.exe tolua-tolua.o
tolua-toluabind.o -L../lib-src/lua -llua -lstdc++ -lxerces -lpng -lwinmm
D:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../libmingw32.a(main.o)(.text+0x106):main.c:
undefined reference to [EMAIL PROTECTED]'
collect2: ld returned 1 exit status
make[1]: *** [tolua.exe] Error 1
Please notice the still existing SDL includes and the main redefinition.
The problems seems to be solved by moving additionally the following three
AM and AC statements behind the NOSDL calculation:
+CFLAGS_NOSDL="$CFLAGS"
+CXXFLAGS_NOSDL="$CXXFLAGS"
+LIBS_NOSDL="$LIBS"
+
+AM_PATH_SDL(1.2.0)
+AC_SUBST(SDL_LIBS)
+AC_SUBST(SDL_CFLAGS)
+
+CFLAGS="$CFLAGS $SDL_CFLAGS"
+CXXFLAGS="$CXXFLAGS $SDL_CFLAGS"
+LIBS="$LIBS $SDL_LIBS"
I tested the resulting patch with native mingw, nativ linux and cross
compilation on linux - no problems.
Please confirm that this modification is o.k.
Looks fine. I'm surprised that native mingw32 is acting differently than
cross in that respect.
In fact it is a good idea anyway in case for whatever reason AM_PATH_SDL
fails to
restore LIB, CFLAGS, and CXXFLAGS. (That looks to be what you are
describing).
_______________________________________________
Enigma-devel mailing list
Enigma-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/enigma-devel