Opened 12 years ago

Closed 8 years ago

#5315 closed Patches (fixed)

address-model and architecture should be reflected in library naming

Reported by: boost@… Owned by: John Maddock
Milestone: To Be Determined Component: config
Version: Boost 1.57.0 Severity: Problem
Keywords: Cc:

Description

Hello,

i am using boost in projects that need to be build in versions with 32Bit and 64Bit Architectures on the windows platform. Using appropriate naming schemes i can deploy the executables and dlls in the same directory. Only boost libraries must be handled different, because the 32Bit and 64Bit versions end up with the same library name.

To resolve this issue, i suggest expanding the naming scheme to include the target architecture.

For example on windows this would change

boost_regex-vc100-mt-d-1_46.lib/
boost_regex-vc100-mt-d-1_46.dll

to

boost_regex-vc100-amd64-mt-d-1_46.lib/
boost_regex-vc100-amd64-mt-d-1_46.dll

Best regards
Sönke Schau

Change History (4)

comment:1 by boost@…, 8 years ago

Hello!
After all the years there is some progress here:
using --buildid= on the b2 commandline it is now possible to generate libraries and dlls with different names. The only missing link is to support buildid in the autolink process.
I therefor suppose to support a new (optional) variable BOOST_LIB_BUILDID and change the autolink coding in auto_link.hpp:

...
#elif defined(BOOST_AUTO_LINK_NOMANGLE)
#  pragma comment(lib, BOOST_STRINGIZE(BOOST_LIB_NAME) ".lib")
#  ifdef BOOST_LIB_DIAGNOSTIC
#     pragma message ("Linking to lib file: " BOOST_STRINGIZE(BOOST_LIB_NAME) ".lib")
#  endif
>> Add this >>
#elif defined(BOOST_LIB_BUILDID)
#  pragma comment(lib, BOOST_LIB_PREFIX BOOST_STRINGIZE(BOOST_LIB_NAME) "-" BOOST_LIB_TOOLSET BOOST_LIB_THREAD_OPT BOOST_LIB_RT_OPT "-" BOOST_LIB_VERSION "-" BOOST_LIB_BUILDID ".lib")
#  ifdef BOOST_LIB_DIAGNOSTIC
#     pragma message ("Linking to lib file: " BOOST_LIB_PREFIX BOOST_STRINGIZE(BOOST_LIB_NAME) "-" BOOST_LIB_TOOLSET BOOST_LIB_THREAD_OPT BOOST_LIB_RT_OPT "-" BOOST_LIB_VERSION "-" BOOST_LIB_BUILDID ".lib")
#  endif
<< Add this <<
#else
#  pragma comment(lib, BOOST_LIB_PREFIX BOOST_STRINGIZE(BOOST_LIB_NAME) "-" BOOST_LIB_TOOLSET BOOST_LIB_THREAD_OPT BOOST_LIB_RT_OPT "-" BOOST_LIB_VERSION ".lib")
#  ifdef BOOST_LIB_DIAGNOSTIC
#     pragma message ("Linking to lib file: " BOOST_LIB_PREFIX BOOST_STRINGIZE(BOOST_LIB_NAME) "-" BOOST_LIB_TOOLSET BOOST_LIB_THREAD_OPT BOOST_LIB_RT_OPT "-" BOOST_LIB_VERSION ".lib")
#  endif
#endif
...


This is all optional and will not break any existing behavior.
Best regards
Sönke Schau

comment:2 by boost@…, 8 years ago

Component: Building Boostconfig
Owner: set to John Maddock
Type: Feature RequestsPatches
Version: Boost 1.45.0Boost 1.57.0

comment:3 by boost@…, 8 years ago

Sorry i forgot BOOST_STRINGIZE() around BOOST_LIB_BUILDID. This is the working addendum:

#elif defined(BOOST_LIB_BUILDID)
#  pragma comment(lib, BOOST_LIB_PREFIX BOOST_STRINGIZE(BOOST_LIB_NAME) "-" BOOST_LIB_TOOLSET BOOST_LIB_THREAD_OPT BOOST_LIB_RT_OPT "-" BOOST_LIB_VERSION "-" BOOST_STRINGIZE(BOOST_LIB_BUILDID) ".lib")
#  ifdef BOOST_LIB_DIAGNOSTIC
#     pragma message ("Linking to lib file: " BOOST_LIB_PREFIX BOOST_STRINGIZE(BOOST_LIB_NAME) "-" BOOST_LIB_TOOLSET BOOST_LIB_THREAD_OPT BOOST_LIB_RT_OPT "-" BOOST_LIB_VERSION "-" BOOST_STRINGIZE(BOOST_LIB_BUILDID) ".lib")
#  endif

Regards Sönke

comment:4 by John Maddock, 8 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.