The previous logic in #1709 made an incorrect assumption that the
filename of shared/static library indicates that it was build as
multi-threaded or single threaded. This assumption does not hold in many
Linux distributions.
In addition to that. Boost.Thread and Boost.Log require -pthread (or
some other) flags in order to properly link.
Task generators created from other task generators may be
skipped during partial builds. This change re-enables
install_task as a task attribute and provides a task
object with input and output nodes which can be re-used
by other tasks.
- Output detected version of boost in dot-form (e.g., 1.56.0, instead of 1_56)
- Fix Boost.Log library detection:
* when linking to shared library, BOOST_LOG_DYN_LINK needs to be defined
* when linking to non-multithreaded version, BOOST_LOG_NO_THREADS needs to be defined
(see http://www.boost.org/doc/libs/1_60_0/libs/log/doc/html/log/installation/config.html)
It will only install DLL when waf is called with the "install" parameter, and will install the DLL in the install directory.
If the user wants to run his exe in the build dir, I'd recommend setting boost lib in the PATH.
improved regex, removing unnecessary plus sign (we want to match only one group)
reworked python matching (mostly for ubuntu I guess). In case of boost_python, tags and python version are optional, which should work on ubuntu and other cases, without duplicating matching patterns if we aren't searching for boost_python.
added back mandatory tags for the last line (for windows) and added a last line to match boost_lib only (arch/manjaro)
changed the way how the abi is generated, the tag for static (-s) is now added automatically based on the lib you specified in 'lib' and 'stlib'
added back --boost-mt
When checking file pattern, the abi is now optional in the last rule. It's now easier to find a lib on linux if your wscript if also configured for windows.
- removed "static" parameter, now use stlib to specify static libs (added a warning if you were using it)
- removed "mt" parameter, now specify it as part of the abi (see help)
- added "stlib" parameter, to specify which lib will be linked statically. "lib" is used to link shared libs.
explanation:
After struggling to link Boost.Log, the problem lies into which libs can/must be linked statically and dynamically.
I built a small test with only system, locale, log_setup, log and thread, and could link it as static.
But after adding boost_filesystem, I couldn't link everything as static anymore and would fail on a dependency in "locale" (icu, nconv).
Linking everything as shared would failed aswell (log). But linking only "locale" as shared, and the rest as static would work.
Hence the change.
Since I broke everything, I figured I would rework the "mt" parameter, since it's kinda part of the abi on windows.
The linkage test "fixes" #1038 : if we can't link, you'll know it before building.
Documentation was added for some MSVC problematics, it may not be great...
Added --boost-linkage_autodetect to accommodate automagically (ugly) for some typical boost builds on MSVC.