GitHub user jparise opened a pull request: https://github.com/apache/thrift/pull/333
Directly link libboost_unit_test_framework.a. Not all linkers support the `-l:libfoo.a` syntax (notably ld(1) on Mac OS X). For full compatibility, we want to link directly against the static library using its full path. (We can't link the dynamic version of this library because of the way that the `_main()` symbol is defined and used by the Thrift unit tests.) Unfortunately, AX_BOOST_BASE doesn't expose the selected library path as a variable, so we derive BOOST_LIB_DIR from BOOST_LDPATH instead. That variable is defined conditionally on C++ and Boost support. Lastly, I looked at the GNU AX_BOOST_UNIT_TEST_FRAMEWORK macro. It unfortunately prefers the dynamic library over the static one (see above), so it's not suitable for our use case. That macro could be extended to take an argument (e.g. 'static') which would force the use of the static library, but that felt unnecessary here. Fixes [THRIFT-2906](https://issues.apache.org/jira/browse/THRIFT-2906) You can merge this pull request into a Git repository by running: $ git pull https://github.com/jparise/thrift thrift-2906 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/thrift/pull/333.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #333 ---- commit 76577ed0189a628275246552e60ebbceb3c2cf4a Author: Jon Parise <j...@pinterest.com> Date: 2014-12-19T01:51:46Z Directly link libboost_unit_test_framework.a. Not all linkers support the `-l:libfoo.a` syntax (notably ld(1) on Mac OS X). For full compatibility, we want to link directly against the static library using its full path. (We can't link the dynamic version of this library because of the way that the _main() symbol is defined and used by the Thrift unit tests.) Unfortunately, AX_BOOST_BASE doesn't expose the selected library path as a variable, so we derive BOOST_LIB_DIR from BOOST_LDPATH instead. That variable is defined conditionally on C++ and Boost support. Lastly, I looked at the GNU AX_BOOST_UNIT_TEST_FRAMEWORK macro. It unfortunately prefers the dynamic library over the static one (see above), so it's not suitable for our use case. That macro could be extended to take an argument (e.g. 'static') which would force the use of the static library, but that felt unnecessary here. Fixes THRIFT-2906 ---- --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---