import intf_libs  = libboost-assert%lib{boost_assert}
import intf_libs += libboost-concept-check%lib{boost_concept_check}
import intf_libs += libboost-config%lib{boost_config}
import intf_libs += libboost-predef%lib{boost_predef}
import intf_libs += libboost-throw-exception%lib{boost_throw_exception}
import intf_libs += libboost-type-traits%lib{boost_type_traits}

# BEGIN MANUAL CUSTOMIZATION
#
if $config.libboost_regex.icu
{
  import intf_libs += libicuuc%lib{icuuc}
  import intf_libs += libicui18n%lib{icui18n}
}
#
# END MANUAL CUSTOMIZATION

intf_libs = $cxx.deduplicate_export_libs($intf_libs)

# BEGIN MANUAL CUSTOMIZATION
#
lib{boost_regex}: {hxx ixx txx h}{** -**/icu} $intf_libs
{
  export.metadata = 1 libboost_regex

  libboost_regex.icu = [bool] $config.libboost_regex.icu
}

# Note: as of Boost 1.91.0 the internal version directory is v5 only. That is,
# the v4 subtree (and thus boost/regex/v4/icu.hpp) has been removed. Naming the
# non-existent v4/icu header here was harmless for a normal build (icu is off by
# default, so the header had include=false) but broke `b dist`, which resolves
# the explicitly-named prerequisite regardless.
#
lib{boost_regex}: regex/hxx{icu v5/icu}: \
  include = $config.libboost_regex.icu
#
# END MANUAL CUSTOMIZATION

# Export options.
#
out_pfx = [dir_path] $out_root/include/
src_pfx = [dir_path] $src_root/include/

lib{boost_regex}:
{
  cc.export.poptions = "-I$out_pfx" "-I$src_pfx"
  cc.export.libs = $intf_libs
}

# Install into the boost/ subdirectory of, say, /usr/include/
# recreating subdirectories.
#
{hxx ixx txx h}{*}:
{
  install         = include/boost/
  install.subdirs = true
}
