macOS - 安装 b2 (Jamfile)

文章目录

    • [安装 b2](#安装 b2)
    • [关于 b2](#关于 b2)
      • [chain of events](#chain of events)
      • [use B2](#use B2)
    • [b2 help](#b2 help)

安装 b2

官方文档 - Installation:https://www.boost.org/doc/libs/1_84_0/tools/build/doc/html/index.html#bbv2.installation


1、下载

前往 github - b2 - releases
https://github.com/bfgroup/b2/releases

这里我下载当前最新的 5.1.0 版本
https://github.com/bfgroup/b2/releases/download/5.1.0/b2-5.1.0.zip

解压zip文件


2、编译

进入解压后的文件夹,输入

shell 复制代码
./bootstrap.sh

3、安装

你可以设置指定安装文件夹,作为 b2 home,放到 PREFIX 位置

shell 复制代码
./b2 install --prefix=PREFIX

这里我创建文件夹 /Users/xx/Documents/software/b2

shell 复制代码
./b2 install --prefix=/Users/user/Documents/software/b2

安装成功,可以打印版本信息试试:

shell 复制代码
$ /Users/xx/Documents/software/b2/bin/b2 --version
B2 5.1.0 (OS=MACOSX, jobs=8)

4、添加到环境变量


关于 b2


B2 由两部分构成

  • 一个编译引擎,具有其自己的解释语言
  • B2 自身,以该语言实现。

chain of events

The chain of events when you type b2 on the command line is as follows:

  • The B2 executable tries to find B2 modules and loads the top-level module. The exact process is described in the section called "Initialization"
  • The top-level module loads user-defined configuration files, user-config.jam and site-config.jam, which define available toolsets.
  • The Jamfile in the current directory is read. That in turn might cause reading of further Jamfiles. As a result, a tree of projects is created, with targets inside projects.
  • Finally, using the build request specified on the command line, B2 decides which targets should be built and how. That information is passed back to Boost.Jam, which takes care of actually running the scheduled build action commands.

use B2

So, to be able to successfully use B2, you need to know only four things:

  • How to configure B2
  • How to declare targets in Jamfiles
  • How the build process works
  • Some Basics about the Boost.Jam language. See the section called "Boost.Jam Language".

b2 help

shell 复制代码
$ b2 --help
B2 4.6-git

Project-specific help:

Project has jamfile at Jamfile

This Jamfile requires boost-build v2 to build.

The version shipped with boost 1.34.0


General command line usage:

b2 [options] [properties] [targets]

Options, properties and targets can be specified in any order.


Important Options:

  • --clean, Remove targets instead of building
  • -,a Rebuild everything
  • -n, Don't execute the commands, only print them
  • -d+2, Show commands as they are executed
  • -d0, Suppress all informational messages
  • -q, Stop at first error
  • --reconfigure, Rerun all configuration checks
  • --debug-configuration, Diagnose configuration
  • --debug-building, Report which targets are built with what properties
  • --debug-generator, Diagnose generator search/execution

Further Help:

The following options can be used to obtain additional documentation.

  • --help-options, Print more obscure command line options.
  • --help-internal, B2 implementation details.
  • --help-doc-options, Implementation details doc formatting.

...found 1 target...


伊织 2024-03-25(一)

今天茶饮很丰富

相关推荐
FreeBuf_14 小时前
XCSSET新变种:专攻苹果macOS用户,实现窃密+勒索
macos
琉-璃14 小时前
Mac完整Homebrew安装教程、brew安装教程踩过的坑、brew安装总结、安装brew遇到的问题
macos
阿里云云原生16 小时前
让每次语音唤醒都可靠,公牛沐光重构可观测体系
macos·阿里云·重构·xcode·可观测
琉-璃19 小时前
Mac M2安装VUE3
macos
2501_9159090620 小时前
App Store 上架完整流程解析,iOS 应用发布步骤、ipa 文件上传工具、TestFlight 测试与苹果审核经验
android·macos·ios·小程序·uni-app·cocoa·iphone
2501_9160088920 小时前
iOS 26 全景揭秘,新界面、功能创新、兼容挑战与各种工具在新版系统中的定位
android·macos·ios·小程序·uni-app·cocoa·iphone
SkylerHu21 小时前
MacOS 使用ssh2-python报错ImportError: dlopen ... _libssh2_channel_direct_tcpip_ex
python·macos·ssh2
阿正的梦工坊21 小时前
Mac电脑解决 npm 和 Yarn 安装时的证书过期问题
前端·macos·npm
海上飞猪1 天前
【MacOS】Warp安装使用教程
macos
FreeBuf_1 天前
思科IOS零日RCE漏洞正遭野外利用(CVE-2025-20352)
macos·ios·cocoa