import intf_libs  = libboost-assert%lib{boost_assert}
import intf_libs += libboost-config%lib{boost_config}
import intf_libs += libboost-core%lib{boost_core}
import intf_libs += libboost-intrusive%lib{boost_intrusive}
import intf_libs += libboost-move%lib{boost_move}
impl_libs = # Implementation dependencies.

intf_libs = $cxx.deduplicate_export_libs($intf_libs)

# Public headers.
#
pub = [dir_path] ../include/boost/

include $pub

pub_hdrs = $($pub/ pub_hdrs)

lib{boost_container}: $pub/{$pub_hdrs}

# BEGIN MANUAL CUSTOMIZATION
#

# Private headers and sources as well as dependencies.
#
# There are multiple C source files but only `alloc_lib.c` must be compiled.
# However, the other `.c` files need to be distributed because they are
# included by `alloc_lib.c` so include them as ad hoc prerequisites.
#
lib{boost_container}: {hxx h cxx}{**} c{alloc_lib} $impl_libs $intf_libs

lib{boost_container}: c{dlmalloc_*}: include = adhoc

#
# END MANUAL CUSTOMIZATION

# Build options.
#
out_pfx_inc = [dir_path] $out_root/include/
src_pfx_inc = [dir_path] $src_root/include/
out_pfx_src = [dir_path] $out_root/src/
src_pfx_src = [dir_path] $src_root/src/

cc.poptions =+ "-I$out_pfx_src" "-I$src_pfx_src" \
               "-I$out_pfx_inc" "-I$src_pfx_inc"

{hbmia obja}{*}: cc.poptions += -DBOOST_CONTAINER_STATIC_LINK
{hbmis objs}{*}: cc.poptions += -DBOOST_CONTAINER_DYN_LINK


# Export options.
#
lib{boost_container}:
{
  cc.export.poptions = "-I$out_pfx_inc" "-I$src_pfx_inc" \
                         -DBOOST_CONTAINER_NO_LIB
  cc.export.libs = $intf_libs
}

liba{boost_container}: cc.export.poptions += -DBOOST_CONTAINER_STATIC_LINK
libs{boost_container}: cc.export.poptions += -DBOOST_CONTAINER_DYN_LINK

# For pre-releases use the complete version to make sure they cannot be used
# in place of another pre-release or the final version. See the version module
# for details on the version.* variable values.
#
if $version.pre_release
  lib{boost_container}: bin.lib.version = "-$version.project_id"
else
  lib{boost_container}: bin.lib.version = "-$version.major.$version.minor"

# Don't install private headers.
#
{hxx ixx txx h}{*}: install = false
