yowko / gource

Automatically exported from code.google.com/p/gource
0 stars 0 forks source link

Checks for stl support in system-wide tinyxml #139

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. be sure system wide tinyxml is compiled with stl support
2. ./configure --with-tinyxml
3. make
4. will fail with undefined reference to `TiXmlString::nullrep_' in 
src/cvs2cl.o and src/svn.o

What is the expected output? What do you see instead?
It should compile :)

What version of the product are you using? On what operating system?
gource-0.37 on sabayon and gentoo linux AMD64

Why is this happening?
Quite simple. When compiling a file including tinyxml.h TIXML_USE_STL must be 
defined if stl support is enabled in the tinyxml library, otherwise tinyxml.h 
will default to using tinystr.h which defines TiXmlString::nullrep_ but 
tinyxml.so is compiled with stl support, not defining nullrep_. At link time 
this will result in undefined reference.

Workaround?
Yes. Exporting CXXFLAGS=-DTIXML_USE_STL then ./configure --with-tinyxml && make 
will work. Indeed it should be CPPFLAGS and not CXXFLAGS, but this will not 
work due to issue #138 (but will work once it is fixed).

The best solution would be to add pkg-config support to tinyxml i guess or they 
can simply bundle the define in the header file. Otherwise a check for stl 
support can also be added to gource build system. I leave the decision which 
one to choose to gource authors :). 

Cheers :)

Original issue reported on code.google.com by enrico.t...@gmail.com on 11 Oct 2011 at 10:07

GoogleCodeExporter commented 9 years ago
May be there is even a better idea: adding the --with-tinyxml-stl configure 
option which will automatically add -DTIXML_USE_STL to AM_CPPFLAGS for system 
wide tinyxml stl enabled library, while --with-tinyxml should be used for 
system wide tinyxml without stl support.

What do you think about this?

Cheers

Original comment by enrico.t...@gmail.com on 11 Oct 2011 at 12:59

GoogleCodeExporter commented 9 years ago
Hi. I'll apply your other suggested fixed and for this perhaps I'll just change 
it to use pkg-config? ie:

if test "x$use_tinyxml_system_library" = "xyes"; then
    PKG_CHECK_MODULES(TINYXML, tinyxml >= 2.5.3, [], AC_MSG_ERROR(TinyXML 2.5.3 or greater is required. Please see INSTALL))
    CXXFLAGS="$CXXFLAGS $TINYXML_CFLAGS"
    CPPFLAGS="$CPPFLAGS $TINYXML_CFLAGS"
    LIBS="$LIBS $TINYXML_LIBS"
fi

Cheers

Andrew

Original comment by acaudw...@gmail.com on 13 Oct 2011 at 12:35

GoogleCodeExporter commented 9 years ago
Unluck tinyxml doesn't integrate with pkg-config at the moment as far as i know 
:(. We might ask tinyxml developers to integrate it, otherwise the stl support 
autodetection might be a bit harder. That's why i suggested to just add 
--with-tinyxml-stl with no autodetection. 

Cheers and thank you very much :)

Enrico

Original comment by enrico.t...@gmail.com on 13 Oct 2011 at 7:20

GoogleCodeExporter commented 9 years ago
Ah.

I think I will fix issue 138 so you can pass the TIXML_USE_STL flag and 
probably leave the rest of this alone for now.

IMHO Gentoo/other distros should supply their own pkg-config file anyway, 
especially since if they are building with custom options, and upstreams should 
try and use the pkg-config if it exists, and the world will be a better place...

Cheers

Andrew

Original comment by acaudw...@gmail.com on 13 Oct 2011 at 8:04

GoogleCodeExporter commented 9 years ago
I agree upstream should really use pkg-config. Well at least mention this issue 
in the README or INSTALL file, so self compiling users can know about this :)

Original comment by enrico.t...@gmail.com on 14 Oct 2011 at 7:21