I have a project set up with autotools to build a C++ library including Python bindings with Boost.Python. I have a binary of Boost.Python on my system that I want to link against:
/usr/lib/libboost_python-py27.so.1.49.0
There is no corresponding .la file so I thought I could add the full path to the library to the libtool command similar to this:
bash ./libtool --mode=link g++ -rpath /usr/local/lib src/o1.lo src/o2.lo ... \
/usr/lib/libboost_python-py27.so.1.49.0 -o libNSM.la
But libtool is discarding the /usr/lib/libboost_python-py27.so.1.49.0 from the issued g++ command. If I run g++ by hand it works fine.
How can I make libtool use a native shared library or what would be the proper way to handle such a situation. I definitely want users to be able to use their existing boost binaries.
I have a binary of Boost.Python on my system that I want to link against
Have you installed boost-devel
to install the symlink to /usr/lib/libboost_python-py27.so.1.49.0
?
There is no corresponding .la file
It's not required for libtool
to link. If the boost-devel
package is installed -lboost_python-py27
will probably suffice.
How can I make libtool use a native shared library or what would be the proper way to handle such a situation. I definitely want users to be able to use their existing boost binaries.
You might want to look at the AX_BOOST_PYTHON macro from the GNU Autoconf Archive
to help the user set up the desired library for libboost_python
(You might need more than just that particular macro from there). The boost.m4 macro also seems to support python, and should provide something similar.