Bug in AX_BOOST_PYTHON

Daniel Müllner <[email protected]>
Newsgroups gmane.comp.sysutils.autoconf.archive-maintainers
Message-ID <[email protected]>
Dear Peter,

we corresponded a while ago about several fixes in AX_BOOST_PYTHON, which I
wrote to make this macro behave correctly on Arch Linux. Now there is another
issue. I haven't found a way to submit a bug report without offering a patch,
so I am writing to you directly.

If Python3 is used and LDFLAGS contains the linker flag "-Wl,--as-needed" (as
is does by default in the Arch Linux build system), AX_BOOST_PYTHON does not
find the right boost_python library. 

Currently, AX_BOOST_PYTHON calls AC_CHECK_LIB for a couple of possible library
names, in my case boost_python and boost_python3.

If -Wl,--as-needed is not set, the linker notices that the small test program
doesn't get linked with the flags "-lboost_python -lpython3.4m" and continues
with -lboost_python3, which finally succeeds. However, if -Wl,--as-needed is
set, the linker processes the test program successfully with the flags
"-lboost_python -lpython3.4m", so that the Boost Python library is wrongly set
to the Python2 variant.

The problem is that AC_CHECK_LIB tries to compile and link a generic C++
program with no Boost Python function whatsoever. Hence, since there is no
Boost::Python function used in the compiled code, the linker doesn't need
anything from the boost_python(3) library.

Instead of linking the current C++ code

#ifdef __cplusplus
extern "C"
#endif
char exit ();
int
main ()
{
return exit ();
  ;
  return 0;
}

the following code (or similar) should be used to test the linker flags:

#include <boost/python/module.hpp>
BOOST_PYTHON_MODULE(test){}
int
main ()
{
  return 0;
}

I don't know how to do this since AC_CHECK_LIB is not made for this purpose.
Can you help me (respectively, many Arch Linux users)?

Best regards,

Daniel









_______________________________________________
  Nachricht gesendet von/durch Savannah
  http://savannah.gnu.org/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.