bool NamespecAction::activate(InputBuilder& pBuilder) const
{
  sys::fs::Path* path = NULL;
  // find out the real path of the namespec.
  if (pBuilder.getConstraint().isSharedSystem()) {
    // In the system with shared object support, we can find both archive
    // and shared object.

    if (pBuilder.getAttributes().isStatic()) {
      // with --static, we must search an archive.
      path = m_SearchDirs.find(namespec(), Input::Archive);
    }
    else {
      // otherwise, with --Bdynamic, we can find either an archive or a
      // shared object.
      path = m_SearchDirs.find(namespec(), Input::DynObj);
    }
  }
  else {
    // In the system without shared object support, we only look for an archive
    path = m_SearchDirs.find(namespec(), Input::Archive);
  }

  if (NULL == path) {
    fatal(diag::err_cannot_find_namespec) << namespec();
    return false;
  }

  pBuilder.createNode<InputTree::Positional>(namespec(), *path);
  return true;
}
bool NoAddNeededAction::activate(InputBuilder& pBuilder) const
{
  pBuilder.getAttributes().unsetAddNeeded();
  return true;
}
bool BStaticAction::activate(InputBuilder& pBuilder) const
{
  pBuilder.getAttributes().setStatic();
  return true;
}
bool NoWholeArchiveAction::activate(InputBuilder& pBuilder) const
{
  pBuilder.getAttributes().unsetWholeArchive();
  return true;
}