Opened 8 years ago

#11065 new Bugs

BZIP2_BINARY option broken in Windows

Reported by: joshuadavidson@… Owned by: Jonathan Turkanis
Milestone: To Be Determined Component: iostreams
Version: Boost 1.57.0 Severity: Problem
Keywords: Cc:

Description

Documentation ( http://www.boost.org/doc/libs/1_57_0/libs/iostreams/doc/installation.html ) suggests that users should be able to link to a precompiled bzip2 library. On Windows, that is not the case. In your Jamfile.v2, the following function breaks that option:

# Given a name of library, either 'zlib', or 'bzip2', creates the necessary
# main target and returns it. If compression is disabled, returns nothing.
# The 'sources' argument is the list of sources names for the library,
# which will be used if building the library.
rule create-library ( library-name : windows-name unix-name : sources + : requirements * )
{
    local LIB = $(library-name:U) ;
    if ! $(library-name) in zlib bzip2
    {
        EXIT "Wrong library name passed to 'create-library' in libs/iostream/build/Jamfile.v2" ;
    }

    if [ os.name ] = NT && ! $($(LIB)_SOURCE) && ! $($(LIB)_INCLUDE)
    {
        if $(debug)
        {
            ECHO "notice: iostreams: not using $(library-name) compression " ;
        }        
        NO_$(LIB) = 1 ;
	
	# This is necessary to that test Jamfiles don't run compression
	# tests when not needed. Dirty, but I don't have time to
	# write full-blow project module for zlib and bzip2.
	modules.poke : NO_$(LIB) : 1 ;
    }

    <snip />

That conditional needs to also consider whether $($(LIB)_BINARY) is set. As a side note if that conditional is fixed, the correct value for Windows would be "bz2" instead of libbz2. The aforementioned documentation makes it sound like Windows desires the prefix, but that is not the case for bzip2. It is, however, for zlib, which inexplicably doesn't use this rule.

Change History (0)

Note: See TracTickets for help on using tickets.