Commit c8bc922
committed
if --with_boost is specified, search *only* the specified directory hierarchy for libraries.
Arguably, if --with_boost is specified, the user wants to use only
that boost installation, and no other. This changeset implements this
behavior.
The original code in _BOOST_FIND_LIBS prepended the --with_boost path
to the default list of paths, resulting in all of the paths being
searched if the library wasn't found in that specified by
--with_boost. Because the search for a library begins with the most
specialized version:
boost_$boost_lib_$boost_tag_$boost_mt_$boost_rtopt_$boost_ver_
boost_$boost_lib_$boost_tag_$boost_rtopt_$boost_ver_
boost_$boost_lib_$boost_tag_$boost_mt_$boost_ver_
boost_$boost_lib_$boost_tag_$boost_ver_
if the user's preferred boost installation has a less specialized
version of a library than one provided in the default path, the latter
will be chosen instead.
This may lead to a mismatch between the headers discovered in the
--with_boost hierarchy and the library discovered in the default path,
if they are for different versions of boost, leading to link problems
if the latter is for an earlier version .
Additionally, this will silently invalidate a request for a specific
version of boost in BOOST_REQUIRE, as it will be fulfilled by the
headers, but not by the library.
The new code does the following:
* It will only search the --with_boost hierarchy if that is provided;
* It will (following the suggestion of issue #49 by mateidavid) use the
absolute path to the library so that the linker's default
library paths are not searched if the library is not found in the
--with_boost hierarchy
* It adds a second path "$with_boost/lib" to the search path, as that
seems to be a standard place for libraries
N.B. There is still a potential for mishap if --with_boost is *not*
specified, namely that if there exist multiple boost installations and
some do not have all of the libraries, it is possible to end up with
libraries selected from multiple installations.1 parent 1489691 commit c8bc922
1 file changed
+33
-12
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
50 | 60 | | |
51 | 61 | | |
52 | 62 | | |
| |||
370 | 380 | | |
371 | 381 | | |
372 | 382 | | |
373 | | - | |
| 383 | + | |
| 384 | + | |
374 | 385 | | |
375 | 386 | | |
376 | 387 | | |
| |||
435 | 446 | | |
436 | 447 | | |
437 | 448 | | |
438 | | - | |
439 | | - | |
440 | | - | |
441 | | - | |
442 | | - | |
443 | | - | |
444 | | - | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
445 | 462 | | |
| 463 | + | |
446 | 464 | | |
447 | 465 | | |
448 | 466 | | |
449 | 467 | | |
450 | 468 | | |
| 469 | + | |
| 470 | + | |
451 | 471 | | |
452 | 472 | | |
453 | 473 | | |
454 | | - | |
455 | | - | |
456 | | - | |
457 | | - | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
458 | 477 | | |
| 478 | + | |
| 479 | + | |
459 | 480 | | |
460 | 481 | | |
461 | 482 | | |
| |||
0 commit comments