diff --git a/.ci/azp-linux-asan-test.yml b/.ci/azp-linux-asan-test.yml index 7fc68224c7..352a209e3e 100644 --- a/.ci/azp-linux-asan-test.yml +++ b/.ci/azp-linux-asan-test.yml @@ -17,6 +17,6 @@ steps: set -e export B2=`ls -1 ${PWD}/.build/*/debug/address-sanitizer-on/cxxstd-11-iso/b2` cd test - python test_all.py ${TOOLSET} + ./test_all.py ${TOOLSET} cd .. displayName: Test diff --git a/.ci/azp-linux-test.yml b/.ci/azp-linux-test.yml index 0135c2895c..ca4d97c07d 100644 --- a/.ci/azp-linux-test.yml +++ b/.ci/azp-linux-test.yml @@ -15,7 +15,7 @@ steps: - bash: | set -e cd test - python test_all.py ${TOOLSET} + ./test_all.py ${TOOLSET} cd .. displayName: Test - bash: | diff --git a/.ci/azp-macos-extra.yml b/.ci/azp-macos-extra.yml index e75527b5e7..78b52c24be 100644 --- a/.ci/azp-macos-extra.yml +++ b/.ci/azp-macos-extra.yml @@ -7,16 +7,14 @@ steps: displayName: Install - bash: | set -e - CXX_PATH=`which ${CXX}` - echo "using ${TEST_TOOLSET} : : ${CXX_PATH} ;" > ${HOME}/user-config.jam ./bootstrap.sh ${TOOLSET} - ./b2 --prefix=$HOME/temp/.b2 install ${TEST_TOOLSET} + ./b2 --prefix=$HOME/temp/.b2 install ${TOOLSET:+toolset=$TOOLSET} rm ./b2 export PATH=$HOME/temp/.b2/bin:$PATH cd $HOME touch build.jam b2 -v - b2 -n --debug-configuration + b2 -n --debug-configuration ${TOOLSET:+toolset=$TOOLSET} displayName: Bootstrap - { bash: "./.ci/b2_example.sh example/hello", displayName: "example/hello" } - { bash: "./.ci/b2_example.sh example/libraries", displayName: "example/libraries" } diff --git a/.ci/azp-macos-test.yml b/.ci/azp-macos-test.yml index 2841b83e09..1e517948b4 100644 --- a/.ci/azp-macos-test.yml +++ b/.ci/azp-macos-test.yml @@ -8,34 +8,28 @@ steps: - bash: | set -e cd src/engine - ./build.sh ${TOOLSET} --cxx=${CXX} + ./build.sh ${TOOLSET} ./b2 -v cd ../.. displayName: Build - bash: | set -e - CXX_PATH=`which ${CXX}` cd test - echo "using ${TEST_TOOLSET} : : ${CXX_PATH} ;" > ${HOME}/user-config.jam - python test_all.py ${TEST_TOOLSET} + ./test_all.py ${TOOLSET} cd .. displayName: Test - bash: | set -e - CXX_PATH=`which ${CXX}` - echo "using ${TEST_TOOLSET} : : ${CXX_PATH} ;" > ${HOME}/user-config.jam - ./src/engine/b2 b2 warnings-as-errors=on variant=debug,release address-model=32,64 toolset=${TEST_TOOLSET} + ./src/engine/b2 b2 warnings-as-errors=on variant=debug,release address-model=32,64 ${TOOLSET:+toolset=$TOOLSET} displayName: "No Warnings" - bash: | set -e - CXX_PATH=`which ${CXX}` - echo "using ${TEST_TOOLSET} : : ${CXX_PATH} ;" > ${HOME}/user-config.jam ./bootstrap.sh ${TOOLSET} - ./b2 --prefix=$HOME/temp/.b2 install ${TEST_TOOLSET} + ./b2 --prefix=$HOME/temp/.b2 install ${TOOLSET:+toolset=$TOOLSET} rm ./b2 export PATH=$HOME/temp/.b2/bin:$PATH cd $HOME touch build.jam b2 -v - b2 -n --debug-configuration + b2 -n --debug-configuration ${TOOLSET:+toolset=$TOOLSET} displayName: Bootstrap diff --git a/.ci/azp-windows-test.yml b/.ci/azp-windows-test.yml index f6291bc2a6..b1de83580e 100644 --- a/.ci/azp-windows-test.yml +++ b/.ci/azp-windows-test.yml @@ -10,7 +10,7 @@ steps: $env:HOME = $env:HOMEDRIVE + $env:HOMEPATH cd test echo "using" $env:TEST_TOOLSET ":" ":" $env:CXX ";" > ${env:HOME}/user-config.jam - python test_all.py $env:TEST_TOOLSET + py test_all.py $env:TEST_TOOLSET cd .. displayName: Test - powershell: | diff --git a/.cirrus.yml b/.cirrus.yml index 331b480118..a09ed95051 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -7,20 +7,16 @@ freebsd_task: # All the GCC's and Clang's currently supported by FreeBSD ports. matrix: - - { name: 'FreeBSD, GCC 12', env: { TOOLSET: gcc, TEST_TOOLSET: gcc, CXX: 'g++12', PACKAGE: 'gcc12-devel' }, freebsd_instance: { image_family: 'freebsd-13-0' } } - - { name: 'FreeBSD, GCC 11', env: { TOOLSET: gcc, TEST_TOOLSET: gcc, CXX: 'g++11', PACKAGE: 'gcc11-devel' }, freebsd_instance: { image_family: 'freebsd-13-0' } } - - { name: 'FreeBSD, GCC 10', env: { TOOLSET: gcc, TEST_TOOLSET: gcc, CXX: 'g++10', PACKAGE: 'gcc10-devel' }, freebsd_instance: { image_family: 'freebsd-13-0' } } - - { name: 'FreeBSD, GCC 9', env: { TOOLSET: gcc, TEST_TOOLSET: gcc, CXX: 'g++9', PACKAGE: 'gcc9-devel' }, freebsd_instance: { image_family: 'freebsd-13-0' } } - - { name: 'FreeBSD, GCC 8', env: { TOOLSET: gcc, TEST_TOOLSET: gcc, CXX: 'g++8', PACKAGE: 'gcc8' }, freebsd_instance: { image_family: 'freebsd-13-0' } } - # - { name: 'FreeBSD, GCC 7', env: { TOOLSET: gcc, TEST_TOOLSET: gcc, CXX: 'g++7', PACKAGE: 'gcc7' }, freebsd_instance: { image_family: 'freebsd-13-0' } } - - { name: 'FreeBSD, Clang 14', env: { TOOLSET: clang, TEST_TOOLSET: clang, CXX: 'clang++14', PACKAGE: 'devel/llvm14' }, freebsd_instance: { image_family: 'freebsd-13-0' } } - - { name: 'FreeBSD, Clang 13', env: { TOOLSET: clang, TEST_TOOLSET: clang, CXX: 'clang++13', PACKAGE: 'devel/llvm13' }, freebsd_instance: { image_family: 'freebsd-13-0' } } - - { name: 'FreeBSD, Clang 12', env: { TOOLSET: clang, TEST_TOOLSET: clang, CXX: 'clang++12', PACKAGE: 'devel/llvm12' }, freebsd_instance: { image_family: 'freebsd-13-0' } } - - { name: 'FreeBSD, Clang 11', env: { TOOLSET: clang, TEST_TOOLSET: clang, CXX: 'clang++11', PACKAGE: 'devel/llvm11' }, freebsd_instance: { image_family: 'freebsd-13-0' } } - - { name: 'FreeBSD, Clang 10', env: { TOOLSET: clang, TEST_TOOLSET: clang, CXX: 'clang++10', PACKAGE: 'devel/llvm10' }, freebsd_instance: { image_family: 'freebsd-13-0' } } - - { name: 'FreeBSD, Clang 9', env: { TOOLSET: clang, TEST_TOOLSET: clang, CXX: 'clang++90', PACKAGE: 'devel/llvm90' }, freebsd_instance: { image_family: 'freebsd-13-0' } } - - { name: 'FreeBSD, Clang 8', env: { TOOLSET: clang, TEST_TOOLSET: clang, CXX: 'clang++80', PACKAGE: 'devel/llvm80' }, freebsd_instance: { image_family: 'freebsd-13-0' } } - - { name: 'FreeBSD, Clang 7', env: { TOOLSET: clang, TEST_TOOLSET: clang, CXX: 'clang++70', PACKAGE: 'devel/llvm70' }, freebsd_instance: { image_family: 'freebsd-13-0' } } + - { name: 'FreeBSD, GCC 12', env: { TOOLSET: gcc, TEST_TOOLSET: gcc, CXX: 'g++12', PACKAGE: 'gcc12' }, freebsd_instance: { image_family: 'freebsd-13-1' } } + - { name: 'FreeBSD, GCC 11', env: { TOOLSET: gcc, TEST_TOOLSET: gcc, CXX: 'g++11', PACKAGE: 'gcc11' }, freebsd_instance: { image_family: 'freebsd-13-1' } } + - { name: 'FreeBSD, GCC 10', env: { TOOLSET: gcc, TEST_TOOLSET: gcc, CXX: 'g++10', PACKAGE: 'gcc10' }, freebsd_instance: { image_family: 'freebsd-13-1' } } + - { name: 'FreeBSD, GCC 9', env: { TOOLSET: gcc, TEST_TOOLSET: gcc, CXX: 'g++9', PACKAGE: 'gcc9' }, freebsd_instance: { image_family: 'freebsd-13-1' } } + - { name: 'FreeBSD, GCC 8', env: { TOOLSET: gcc, TEST_TOOLSET: gcc, CXX: 'g++8', PACKAGE: 'gcc8' }, freebsd_instance: { image_family: 'freebsd-13-1' } } + - { name: 'FreeBSD, Clang 14', env: { TOOLSET: clang, TEST_TOOLSET: clang, CXX: 'clang++14', PACKAGE: 'devel/llvm14' }, freebsd_instance: { image_family: 'freebsd-13-1' } } + - { name: 'FreeBSD, Clang 13', env: { TOOLSET: clang, TEST_TOOLSET: clang, CXX: 'clang++13', PACKAGE: 'devel/llvm13' }, freebsd_instance: { image_family: 'freebsd-13-1' } } + - { name: 'FreeBSD, Clang 12', env: { TOOLSET: clang, TEST_TOOLSET: clang, CXX: 'clang++12', PACKAGE: 'devel/llvm12' }, freebsd_instance: { image_family: 'freebsd-13-1' } } + - { name: 'FreeBSD, Clang 11', env: { TOOLSET: clang, TEST_TOOLSET: clang, CXX: 'clang++11', PACKAGE: 'devel/llvm11' }, freebsd_instance: { image_family: 'freebsd-13-1' } } + - { name: 'FreeBSD, Clang 10', env: { TOOLSET: clang, TEST_TOOLSET: clang, CXX: 'clang++10', PACKAGE: 'devel/llvm10' }, freebsd_instance: { image_family: 'freebsd-13-1' } } # To install with ports we need to initialize the package manager. To avoid # confirmation prompts we need to set an env var. install_script: [ diff --git a/.github/workflows/installer_windows.yml b/.github/workflows/installer_windows.yml index 6df51e2a8d..194b99a2c4 100644 --- a/.github/workflows/installer_windows.yml +++ b/.github/workflows/installer_windows.yml @@ -49,8 +49,8 @@ jobs: - name: "Build" run: | $env:path += ';' + "${{github.workspace}}/b2" - cd "${{github.workspace}}/b2-pkg/windows-wix" - b2 --debug-configuration --b2root="${{github.workspace}}/b2" + cd "${{github.workspace}}/b2-pkg" + b2 --debug-configuration --b2root="${{github.workspace}}/b2" -j1 -d+2 windows-wix - name: "Upload" uses: actions/upload-artifact@v3 with: diff --git a/Jamroot.jam b/Jamroot.jam index 01eb6bf0fa..36919e97b1 100644 --- a/Jamroot.jam +++ b/Jamroot.jam @@ -27,6 +27,7 @@ project b2 11 msvc:_CRT_SECURE_NO_WARNINGS=1 msvc:_CRT_NONSTDC_NO_DEPRECATE=1 + clang:-Wno-deprecated-declarations ; #| diff --git a/README.adoc b/README.adoc index 25bb454ad9..5bc9056a95 100644 --- a/README.adoc +++ b/README.adoc @@ -14,11 +14,11 @@ file LICENSE.txt or copy at https://www.bfgroup.xyz/b2/LICENSE.txt) Continuously tested on: -* FreeBSD Clang 7, 8, 9, 10, 11, 12 -* FreeBSD GCC 8, 9, 10, 11 -* Linux Clang 4, 5, 6, 7, 8, 9, 10, 11, 12, 13 -* Linux GCC 5, 6, 7, 8, 9, 10, 11 -* macOS Xcode 11.2.1, 11.3, 11.3.1, 11.4.1, 11.5, 11.6, 11.7, 12.0.1, 12.1.1, 12.2, 12.3, 12.4, 12.5.1, 13.0, 13.1, 13.2.1 +* FreeBSD Clang 10, 11, 12, 13, 14 +* FreeBSD GCC 8, 9, 10, 11, 12 +* Linux Clang 9, 10, 11, 12, 13, 14, 15 +* Linux GCC 9, 10, 11, 12 +* macOS Xcode 11.7, 12.4, 12.5.1, 13.4.1, 14.0.1, 14.1, 14.2 * Windows MinGW 8.1.0 * Windows VS 2013, 2015, 2017, 2019, 2022 * Cygwin 3.1.7 x64 diff --git a/appveyor.yml b/appveyor.yml index 663c97ad05..cbf6c2252a 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -9,6 +9,7 @@ branches: - /main/ - /release/ - /feature\/.*/ + - /backport-.*/ environment: matrix: @@ -55,7 +56,7 @@ for: echo ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> TEST" echo ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>" cd test - python test_all.py %TEST_TOOLSET% + py test_all.py %TEST_TOOLSET% cd .. - cmd: | echo ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>" diff --git a/azure-pipelines.yml b/azure-pipelines.yml index b10a7379af..3e28388cf0 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -10,6 +10,7 @@ trigger: - main - release - feature/* + - version/* paths: exclude: - .circleci/* @@ -23,6 +24,7 @@ pr: branches: include: - main + - version/* paths: exclude: - appveyor.yml @@ -35,7 +37,7 @@ variables: - { name: gcc_latest, value: '12' } - { name: vc_latest, value: 'vc143' } - { name: vs_latest, value: '2022' } -- { name: xc_latest, value: '13.4.1' } +- { name: xc_latest, value: '14.2' } - { name: macos_latest_vm, value: 'macOS-12' } @@ -102,7 +104,8 @@ stages: - job: 'macOS' strategy: matrix: - Xcode ${{variables.xc_latest}}: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++, XCODE_APP: "/Applications/Xcode_${{variables.xc_latest}}.app", VM_IMAGE: "${{variables.macos_latest_vm}}"} + Xcode ${{variables.xc_latest}}: {XCODE_APP: "/Applications/Xcode_${{variables.xc_latest}}.app", VM_IMAGE: "${{variables.macos_latest_vm}}"} + GCC ${{variables.gcc_latest}}: {TOOLSET: "gcc-${{variables.gcc_latest}}", XCODE_APP: "/Applications/Xcode_${{variables.xc_latest}}.app", VM_IMAGE: "${{variables.macos_latest_vm}}"} pool: vmImage: $(VM_IMAGE) steps: @@ -128,15 +131,12 @@ stages: matrix: Xcode ${{variables.xc_latest}} arm+x86/64: { B2_ARGS: "architecture=arm+x86 address-model=64", - TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++, XCODE_APP: "/Applications/Xcode_${{variables.xc_latest}}.app", VM_IMAGE: "${{variables.macos_latest_vm}}"} Xcode ${{variables.xc_latest}} arm/64: { B2_ARGS: "architecture=arm address-model=64", - TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++, XCODE_APP: "/Applications/Xcode_${{variables.xc_latest}}.app", VM_IMAGE: "${{variables.macos_latest_vm}}"} Xcode ${{variables.xc_latest}} x86/64: { B2_ARGS: "architecture=x86 address-model=64", - TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++, XCODE_APP: "/Applications/Xcode_${{variables.xc_latest}}.app", VM_IMAGE: "${{variables.macos_latest_vm}}"} pool: vmImage: $(VM_IMAGE) @@ -238,24 +238,27 @@ stages: - job: 'macOS' strategy: matrix: - # Xcode 13.4.1: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++, XCODE_APP: /Applications/Xcode_13.4.1.app, VM_IMAGE: 'macOS-12'} - Xcode 13.3.1: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++, XCODE_APP: /Applications/Xcode_13.3.1.app, VM_IMAGE: 'macOS-12'} - Xcode 13.2.1: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++, XCODE_APP: /Applications/Xcode_13.2.1.app, VM_IMAGE: 'macOS-12'} - Xcode 13.1: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++, XCODE_APP: /Applications/Xcode_13.1.app, VM_IMAGE: 'macOS-12'} - Xcode 13.0: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++, XCODE_APP: /Applications/Xcode_13.0.app, VM_IMAGE: 'macOS-11'} - Xcode 12.5.1: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++, XCODE_APP: /Applications/Xcode_12.5.1.app, VM_IMAGE: 'macOS-11'} - Xcode 12.4: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++, XCODE_APP: /Applications/Xcode_12.4.app, VM_IMAGE: 'macOS-11'} - # Xcode 12.3: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++, XCODE_APP: /Applications/Xcode_12.3.app, VM_IMAGE: 'macOS-10.15'} - # Xcode 12.2: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++, XCODE_APP: /Applications/Xcode_12.2.app, VM_IMAGE: 'macOS-10.15'} - # Xcode 12.1.1: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++, XCODE_APP: /Applications/Xcode_12.1.1.app, VM_IMAGE: 'macOS-10.15'} - # Xcode 12.0.1: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++, XCODE_APP: /Applications/Xcode_12.0.1.app, VM_IMAGE: 'macOS-10.15'} - Xcode 11.7: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++, XCODE_APP: /Applications/Xcode_11.7.app, VM_IMAGE: 'macOS-11'} - # Xcode 11.6: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++, XCODE_APP: /Applications/Xcode_11.6.app, VM_IMAGE: 'macOS-10.15'} - # Xcode 11.5: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++, XCODE_APP: /Applications/Xcode_11.5.app, VM_IMAGE: 'macOS-10.15'} - # Xcode 11.4.1: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++, XCODE_APP: /Applications/Xcode_11.4.1.app, VM_IMAGE: 'macOS-10.15'} - # Xcode 11.3.1: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++, XCODE_APP: /Applications/Xcode_11.3.1.app, VM_IMAGE: 'macOS-10.15'} - # Xcode 11.3: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++, XCODE_APP: /Applications/Xcode_11.3.app, VM_IMAGE: 'macOS-10.15'} - # Xcode 11.2.1: {TOOLSET: clang, TEST_TOOLSET: clang, CXX: clang++, XCODE_APP: /Applications/Xcode_11.2.1.app, VM_IMAGE: 'macOS-10.15'} + # Xcode 14.2: {XCODE_APP: /Applications/Xcode_14.2.app, VM_IMAGE: 'macOS-12'} + Xcode 14.1: {XCODE_APP: /Applications/Xcode_14.1.app, VM_IMAGE: 'macOS-12'} + Xcode 14.0.1: {XCODE_APP: /Applications/Xcode_14.0.1.app, VM_IMAGE: 'macOS-12'} + Xcode 13.4.1: {XCODE_APP: /Applications/Xcode_13.4.1.app, VM_IMAGE: 'macOS-12'} + # Xcode 13.3.1: {XCODE_APP: /Applications/Xcode_13.3.1.app, VM_IMAGE: 'macOS-12'} + # Xcode 13.2.1: {XCODE_APP: /Applications/Xcode_13.2.1.app, VM_IMAGE: 'macOS-12'} + # Xcode 13.1: {XCODE_APP: /Applications/Xcode_13.1.app, VM_IMAGE: 'macOS-12'} + # Xcode 13.0: {XCODE_APP: /Applications/Xcode_13.0.app, VM_IMAGE: 'macOS-11'} + Xcode 12.5.1: {XCODE_APP: /Applications/Xcode_12.5.1.app, VM_IMAGE: 'macOS-11'} + Xcode 12.4: {XCODE_APP: /Applications/Xcode_12.4.app, VM_IMAGE: 'macOS-11'} + # Xcode 12.3: {XCODE_APP: /Applications/Xcode_12.3.app, VM_IMAGE: 'macOS-10.15'} + # Xcode 12.2: {XCODE_APP: /Applications/Xcode_12.2.app, VM_IMAGE: 'macOS-10.15'} + # Xcode 12.1.1: {XCODE_APP: /Applications/Xcode_12.1.1.app, VM_IMAGE: 'macOS-10.15'} + # Xcode 12.0.1: {XCODE_APP: /Applications/Xcode_12.0.1.app, VM_IMAGE: 'macOS-10.15'} + Xcode 11.7: {XCODE_APP: /Applications/Xcode_11.7.app, VM_IMAGE: 'macOS-11'} + # Xcode 11.6: {XCODE_APP: /Applications/Xcode_11.6.app, VM_IMAGE: 'macOS-10.15'} + # Xcode 11.5: {XCODE_APP: /Applications/Xcode_11.5.app, VM_IMAGE: 'macOS-10.15'} + # Xcode 11.4.1: {XCODE_APP: /Applications/Xcode_11.4.1.app, VM_IMAGE: 'macOS-10.15'} + # Xcode 11.3.1: {XCODE_APP: /Applications/Xcode_11.3.1.app, VM_IMAGE: 'macOS-10.15'} + # Xcode 11.3: {XCODE_APP: /Applications/Xcode_11.3.app, VM_IMAGE: 'macOS-10.15'} + # Xcode 11.2.1: {XCODE_APP: /Applications/Xcode_11.2.1.app, VM_IMAGE: 'macOS-10.15'} pool: vmImage: $(VM_IMAGE) steps: @@ -369,6 +372,7 @@ stages: displayName: 'Release Linux' strategy: matrix: + 1.81.0 .. GCC ${{variables.gcc_latest}}: {BOOST_VERSION: 1.81.0, BOOST_VERSION_U: 1_81_0, TOOLSET: gcc, CXX: "g++-${{variables.gcc_latest}}", PACKAGES: "g++-${{variables.gcc_latest}}", VM_IMAGE: "${{variables.linux_latest_vm}}"} 1.80.0 .. GCC ${{variables.gcc_latest}}: {BOOST_VERSION: 1.80.0, BOOST_VERSION_U: 1_80_0, TOOLSET: gcc, CXX: "g++-${{variables.gcc_latest}}", PACKAGES: "g++-${{variables.gcc_latest}}", VM_IMAGE: "${{variables.linux_latest_vm}}"} 1.79.0 .. GCC ${{variables.gcc_latest}}: {BOOST_VERSION: 1.79.0, BOOST_VERSION_U: 1_79_0, TOOLSET: gcc, CXX: "g++-${{variables.gcc_latest}}", PACKAGES: "g++-${{variables.gcc_latest}}", VM_IMAGE: "${{variables.linux_latest_vm}}"} 1.78.0 .. GCC ${{variables.gcc_latest}}: {BOOST_VERSION: 1.78.0, BOOST_VERSION_U: 1_78_0, TOOLSET: gcc, CXX: "g++-${{variables.gcc_latest}}", PACKAGES: "g++-${{variables.gcc_latest}}", VM_IMAGE: "${{variables.linux_latest_vm}}"} @@ -415,6 +419,7 @@ stages: vmImage: "${{variables.macos_latest_vm}}" strategy: matrix: + 1.81.0 .. Xcode ${{variables.xc_latest}}: {BOOST_VERSION: 1.81.0, BOOST_VERSION_U: 1_81_0, TOOLSET: clang, CXX: clang++, XCODE_APP: "/Applications/Xcode_${{variables.xc_latest}}.app"} 1.80.0 .. Xcode ${{variables.xc_latest}}: {BOOST_VERSION: 1.80.0, BOOST_VERSION_U: 1_80_0, TOOLSET: clang, CXX: clang++, XCODE_APP: "/Applications/Xcode_${{variables.xc_latest}}.app"} 1.79.0 .. Xcode ${{variables.xc_latest}}: {BOOST_VERSION: 1.79.0, BOOST_VERSION_U: 1_79_0, TOOLSET: clang, CXX: clang++, XCODE_APP: "/Applications/Xcode_${{variables.xc_latest}}.app"} 1.78.0 .. Xcode ${{variables.xc_latest}}: {BOOST_VERSION: 1.78.0, BOOST_VERSION_U: 1_78_0, TOOLSET: clang, CXX: clang++, XCODE_APP: "/Applications/Xcode_${{variables.xc_latest}}.app"} @@ -460,6 +465,7 @@ stages: vmImage: "${{variables.windows_latest_vm}}" strategy: matrix: + 1.81.0 .. VS ${{variables.vs_latest}}: {BOOST_VERSION: 1.81.0, BOOST_VERSION_U: 1_81_0, TOOLSET: "${{variables.vc_latest}}"} 1.80.0 .. VS ${{variables.vs_latest}}: {BOOST_VERSION: 1.80.0, BOOST_VERSION_U: 1_80_0, TOOLSET: "${{variables.vc_latest}}"} 1.79.0 .. VS ${{variables.vs_latest}}: {BOOST_VERSION: 1.79.0, BOOST_VERSION_U: 1_79_0, TOOLSET: "${{variables.vc_latest}}"} 1.78.0 .. VS ${{variables.vs_latest}}: {BOOST_VERSION: 1.78.0, BOOST_VERSION_U: 1_78_0, TOOLSET: "${{variables.vc_latest}}"} diff --git a/bootstrap.sh b/bootstrap.sh index fbf577e62d..00dba3eb21 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -17,7 +17,8 @@ if [ $? -ne 0 ]; then exit 1 fi cd "$pwd" -cp "./src/engine/b2" . +cp "./src/engine/b2" . 2>/dev/null +cp "./src/engine/b2.exe" . 2>/dev/null cat << EOF diff --git a/doc/src/history.adoc b/doc/src/history.adoc index 254e8c3be3..64fbde5aeb 100644 --- a/doc/src/history.adoc +++ b/doc/src/history.adoc @@ -1,6 +1,74 @@ [[b2.history]] = History +== Version 4.10.0 + +This release contains many bug fixes but along the way also cleanup and +refactoring of many toolsets, thanks to Nikita. + +* *New*: Scan assembler files for C Preprocessor includes. + -- _Nikita Kniazev_ +* Fix: Inherit generator overrides from a base toolset. + -- _Nikita Kniazev_ +* *New*: Add linemarkers feature that on preprocessing targets changes behavior to + emit/omit line directives like `+#line+` and `+#+`. + -- _Nikita Kniazev_ +* Fix compiler name for QNX. + -- _James Choi_ +* Fix openssl name handling. + -- _Dmitry Arkhipov_ +* Fix clang-win assembler path deduction. + -- _Nikita Kniazev_ +* Fix toolset sub-feature requirements inheritance. + -- _Nikita Kniazev_ +* Unify compile and link of clang-linux toolset with gcc toolset. + -- _Nikita Kniazev_ +* Fix same directory pch header generation for msvc toolset. + -- _Nikita Kniazev_ +* Implement `--durations` which reports top targets by execution time. + -- _Nikita Kniazev_ +* Change clang-darwin to inherit from clang-linux and unify compile commands. + -- _Nikita Kniazev_ +* Fix clang-linux to not override RPATH_OPTION. + -- _Nikita Kniazev_ +* Fix inadvertently running configuration checks that shouldn't (as reported by + Alexander Grund). By changing `no` conditionals evaluation to short + circuit. + -- _Nikita Kniazev_ +* Fix same toolset overrides (inherit-overrides). + -- _Nikita Kniazev_ +* *New*: Add using the C processors for assembly source files. + -- _Nikita Kniazev_ +* Many improvements and cleanup of internal testing. + -- _Nikita Kniazev_ +* Unify gcc and clang-linux soname option handling and disable it on Windows. + -- _Nikita Kniazev_ +* Unity gcc/mingw linking of shared and import libs. + -- _Nikita Kniazev_ +* Fix pdb generation ordering and naming issues. + -- _Nikita Kniazev_ +* Unify clang-darwin linking with gcc. + -- _Nikita Kniazev_ +* Fix mingw/msys/cygwin, winthreads/pthread inconsistencies to correct compiler + flags. + -- _Nikita Kniazev_ +* Unify clang-vxworks by inheriting from clang-linux. + -- _Nikita Kniazev_ +* Don't store empty config cache and log. + -- _Nikita Kniazev_ +* Fix generator custom rule name inheritance. This affects cygwin/mingw linking. + -- _Nikita Kniazev_ +* Fix testing.execute=off to correct run-fail behavior. + -- _Nikita Kniazev_ +* Fix use-project with native paths. + -- _René Ferdinand Rivera Morell_ +* Fix msvc auto config version priority. Now msvc toolsets are configured in + correct newest to oldest regardless of being found from the registry or not. + -- _René Ferdinand Rivera Morell_ +* *New*: Add support for automatic searching of external projects for global + target and project references. + -- _René Ferdinand Rivera Morell_ + == Version 4.9.6 * Fix version check for winsdk on `clang-win` toolset. diff --git a/doc/src/reference.adoc b/doc/src/reference.adoc index 0e68345f27..49baf0bb59 100644 --- a/doc/src/reference.adoc +++ b/doc/src/reference.adoc @@ -195,6 +195,7 @@ include::../../src/tools/features/asmflags-feature.jam[tag=doc] include::../../src/tools/features/exception-feature.jam[tag=asynch-doc] include::../../src/tools/features/build-feature.jam[tag=doc] include::../../src/tools/features/cflags-feature.jam[tag=doc] +include::../../src/tools/features/compileflags-feature.jam[tag=doc] include::../../src/tools/features/conditional-feature.jam[tag=doc] include::../../src/tools/features/coverage-feature.jam[tag=doc] include::../../src/tools/features/cxxflags-feature.jam[tag=doc] @@ -223,6 +224,7 @@ include::../../src/tools/features/instruction-set-feature.jam[tag=doc] include::../../src/tools/features/library-feature.jam[tag=doc] include::../../src/tools/features/find-lib-feature.jam[tag=path-doc] include::../../src/tools/features/sanitizers-feature.jam[tag=leak-doc] +include::../../src/tools/features/linemarkers-feature.jam[tag=doc] include::../../src/tools/features/link-feature.jam[tag=doc] include::../../src/tools/features/linkflags-feature.jam[tag=doc] include::../../src/tools/features/local-visibility-feature.jam[tag=doc] @@ -243,6 +245,7 @@ include::../../src/tools/features/strip-feature.jam[tag=doc] include::../../src/tools/features/dll-feature.jam[tag=suppress-doc] include::../../src/tools/features/tag-feature.jam[tag=doc] include::../../src/tools/features/os-feature.jam[tag=doc] +include::../../src/tools/features/threadapi-feature.jam[tag=doc] include::../../src/tools/features/threading-feature.jam[tag=doc] include::../../src/tools/features/sanitizers-feature.jam[tag=thread-doc] include::../../src/tools/features/toolset-feature.jam[tag=doc] @@ -300,6 +303,7 @@ include::../../src/tools/borland.jam[tag=doc] include::../../src/tools/como.jam[tag=doc] include::../../src/tools/cw.jam[tag=doc] include::../../src/tools/dmc.jam[tag=doc] +include::../../src/tools/embarcadero.jam[tag=doc] include::../../src/tools/gcc.jam[tag=doc] include::../../src/tools/hp_cxx.jam[tag=doc] include::../../src/tools/intel.jam[tag=doc] diff --git a/doc/src/tasks.adoc b/doc/src/tasks.adoc index 53152af569..d56bcc4727 100644 --- a/doc/src/tasks.adoc +++ b/doc/src/tasks.adoc @@ -670,7 +670,7 @@ for details. [[bbv2.tasks.packagemanagers]] == Package Managers -B2 support automatic, or manual, loading of generated build files +B2 supports automatic, or manual, loading of generated build files from package managers. For example using the Conan package manager which generates `conanbuildinfo.jam` files B2 will load that files automatically when it loads the project at the same location. The included file can @@ -726,3 +726,98 @@ managers. Currently the supported ones are: * Conan (`conan`): currently supports the link:https://docs.conan.io/en/latest/reference/generators/b2.html[`b2 generator`]. + +[[bbv2.tasks.projectsearch]] +== Searching For Projects + +B2 supports automatic searching for referenced global projects. For example, +if you have references to `/boost/predef` with some minimal configuration B2 +can find the B2 project for it and automatically resolve the reference. The +searching supports two modes: finding regular B2 project directories, and +package/config style loading of single jam files. + +[[bbv2.tasks.projectsearch.path]] +=== Search Path + +To control which and where projects are found one can use different methods: + +* `B2_PROJECT_PATH` environment variable. +* `--project-search` command line argument. +* `rule project-search` project rule. + +The search path in both `B2_PROJECT_PATH` and `--project-search` specifies a +key-value list of _project-id_ and _path_. The parts of that key-value list, as +the name indicates, is a path delimiter separated list. For example if we had +these two projects we wanted to find: `/zlib` and `/boost/asio` the search paths +could look like: + +[horizontal] +Linux:: +`/zlib:/usr/local/share/zlib:/boost/asio:/home/user/external/boost-1.81/libs/asio` +Windows, VxWorks:: +`/zlib;C:/Dev/zlib;/boost/asio;C:Dev/boost-1.81/libs/asio` +VMS:: +`/zlib,X:external.zlib,/boost/asio,X:external.boost181.libs.asio` + +The _project-id_ in the search path specification maps that project root to the +indicated _path_. Which B2 will use to search for any projects and sub-projects +with that _project-id_ root. + +[[bbv2.tasks.projectsearch.process]] +=== Search Process + +Regardless of how the search path is specified, how the search happens is the +same. Searching involves either searching for a B2 project directory, i.e. +a directory containing a jamfile, or searching for a specially named `*.jam` +file to include (similar to how the <> support includes +jam files). + +For a given _project-id_ of the form `/d1/d2/../dn` we search for the following, +in this order: + +. The project at `d1/d2/../dn` in any path registered for the `/` root. +. The project at `dn` in any path registered for the `/d1/d2/../dn-1` root. +. The jamfile `dn.jam` in any path registered for the `/d1/d2/../dn-1` root. +. The project at `dn-1_dn` in any path registered for the `/d1/d2/../dn-2` root. +. The jamfile `dn-1_dn.jam` in any path registered for the `/d1/d2/../dn-2` + root. +. And so on until it searches for the project `d1_d2_.._dn` in any path + registered for the `/` root. +. And for the jamfile `d1_d2_.._dn.jam` in any path registered for the `/` root. + +For example, with this search paths: + +* `/boost`: `/usr/share/boost-1.81.0`, `/home/user/boost-dev/libs` +* `/`: `/usr/share/b2/external` + +And given the `/boost/core` _project-id_ to resolve, we search for: + +. `/usr/share/b2/external/boost/core/` +. `/usr/share/boost-1.81.0/core/` +. `/home/user/boost-dev/libs/core/` +. `/usr/share/boost-1.81.0/core.jam` +. `/home/user/boost-dev/libs/core.jam` +. `/usr/share/boost-1.81.0/boost_core/` +. `/home/user/boost-dev/libs/boost_core/` +. `/usr/share/boost-1.81.0/boost_core.jam` +. `/home/user/boost-dev/libs/boost_core.jam` +. `/usr/share/b2/external/boost_core.jam` + +The first project jamfile will be assigned to the _project-id_. Or the first +`*.jam` file found will be loaded. + +[[bbv2.tasks.projectsearch.loading]] +=== Loading Process + +Depending on whether a project jamfile or `*.jam` file determines how the +project is loaded. + +When loading a project jamfile with a _project-id_ and _path_ it is equivalent +to calling `use-project _project-id_ : _path_ ;` from the context of the project +that has the reference. + +When loading a `*.jam` file as the _path_ it is equivalent to calling: +`use-packages _path_ ;` from the context of the project that has the reference. +In this case it means that the file will be loaded as part of the referenced +project and hence any bare targets or information it declares will be part of +the project. diff --git a/example/customization/inline_file.py b/example/customization/inline_file.py index 77cd8cb293..f4d4c2fd5f 100644 --- a/example/customization/inline_file.py +++ b/example/customization/inline_file.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright 2003 Vladimir Prus # Distributed under the Boost Software License, Version 1.0. diff --git a/src/build-system.jam b/src/build-system.jam index 8f45391bdc..40386ccb74 100644 --- a/src/build-system.jam +++ b/src/build-system.jam @@ -811,6 +811,25 @@ local rule should-clean-project ( project ) } } + local durations = [ MATCH "(--durations(=([0-9]+))?)" : $(.argv) ] ; + if $(durations) { + durations = $(durations[3]) ; + durations ?= 10 ; + + .target-times = ; + rule record-time ( : target : start end user system clock ) + { + # limit precision to milliseconds + clock = [ MATCH "^([0-9]+[.][0-9][0-9][0-9])" : $(clock) ] ; + + .target-times += "$(clock):::$(target)" ; + } + IMPORT build-system : record-time : : build-system.record-time ; + + # When no __TIMING_RULE__ is set "on" a target, the search falls back to + # the global module. + module { __TIMING_RULE__ = build-system.record-time ; } + } # Convert collected virtual targets into actual raw Jam targets. for t in $(virtual-targets) @@ -1083,5 +1102,19 @@ local rule should-clean-project ( project ) { UPDATE all $(.out-xml) ; } + if $(durations) { + ECHO "============================= slowest $(durations) durations =============================" ; + local sorted-durations = [ SORT $(.target-times) ] ; + for local t in [ sequence.reverse $(sorted-durations[-$(durations)--1]) ] { + t = [ SPLIT_BY_CHARACTERS $(t) : ":::" ] ; + local action = [ on $(t[-1]) return $(.action) ] ; + if $(action) { + ECHO $(t[1])s [ indirect.get-rule [ $(action).action-name ] ] $(t[-1]) ; + } + else { + ECHO $(t[1])s $(t[-1]) ; + } + } + } } } diff --git a/src/build/ac.jam b/src/build/ac.jam index 02ae62bdb6..53412ab89c 100644 --- a/src/build/ac.jam +++ b/src/build/ac.jam @@ -70,7 +70,7 @@ rule find-include-path ( properties : header : provided-path ? : test-source ? ) { jam-targets += [ $(t).actualize ] ; } - if [ UPDATE_NOW $(jam-targets) : [ modules.peek configure : .log-fd ] + if [ UPDATE_NOW $(jam-targets) : [ configure.get-log-fd ] : ignore-minus-n ] { return %default ; @@ -119,7 +119,7 @@ rule find-library ( properties : names + : provided-path ? ) { jam-targets += [ $(t).actualize ] ; } - if [ UPDATE_NOW $(jam-targets) : [ modules.peek configure : .log-fd ] + if [ UPDATE_NOW $(jam-targets) : [ configure.get-log-fd ] : ignore-minus-n ] { result = $(name) $(link-opts[1]) ; diff --git a/src/build/config-cache.jam b/src/build/config-cache.jam index 05a6fcd3ff..33495194a9 100644 --- a/src/build/config-cache.jam +++ b/src/build/config-cache.jam @@ -22,7 +22,7 @@ rule set ( name : value * ) rule save ( ) { - if $(.cache-file) + if $(.cache-file) && $(.all-vars) { local cache-file-native = [ path.native $(.cache-file) ] ; local target = $(cache-file-native) ; @@ -41,7 +41,8 @@ rule save ( ) FILE_CONTENTS on $(target) = $(contents) ; ALWAYS $(target) ; config-cache.write $(target) ; - UPDATE_NOW $(target) : [ modules.peek configure : .log-fd ] : ignore-minus-n ; + import configure ; + UPDATE_NOW $(target) : [ configure.get-log-fd ] : ignore-minus-n ; import common ; common.Clean clean-all : $(target) ; } @@ -71,7 +72,8 @@ rule load ( cache-file ) { FILE_CONTENTS on $(cache-file) = "" ; config-cache.write $(cache-file) ; - UPDATE_NOW $(cache-file) : [ modules.peek configure : .log-fd ] ; + import configure ; + UPDATE_NOW $(cache-file) : [ configure.get-log-fd ] ; include $(cache-file) ; } .cache-file = $(cache-file) ; diff --git a/src/build/configure.jam b/src/build/configure.jam index 8c89b1e1fb..0ba363a09c 100644 --- a/src/build/configure.jam +++ b/src/build/configure.jam @@ -225,7 +225,7 @@ rule try-build ( targets * : ps : what : retry ? ) { x = [ PAD " - $(what)" : $(.width) ] ; if [ UPDATE_NOW $(jam-targets) : - $(.log-fd) : ignore-minus-n : ignore-minus-q ] + [ get-log-fd ] : ignore-minus-n : ignore-minus-q ] { .$(what)-supported.$(ps) = yes ; result = true ; @@ -310,7 +310,7 @@ rule try-find-build ( ps : what : * ) jam-targets += [ $(t).actualize ] ; } if [ UPDATE_NOW $(jam-targets) : - $(.log-fd) : ignore-minus-n : ignore-minus-q ] + [ get-log-fd ] : ignore-minus-n : ignore-minus-q ] { result = [ CALC $(i) - 2 ] ; log-check-result "$(x) : $($(i)[1])" "$(cache-min:J= )" ; @@ -476,12 +476,26 @@ rule find-builds ( what : properties * : * ) # rule set-log-file ( log-file ) { - path.makedirs [ path.parent $(log-file) ] ; - .log-fd = [ FILE_OPEN [ path.native $(log-file) ] : "w" ] ; + .log-file = $(log-file) ; +} + +rule get-log-fd ( ) +{ + if $(.log-fd) { + return $(.log-fd) ; + } + if ! $(.log-file) { + import errors : error ; + error "Log file was not set" ; + } + + path.makedirs [ path.parent $(.log-file) ] ; + .log-fd = [ FILE_OPEN [ path.native $(.log-file) ] : "w" ] ; if ! $(.log-fd) { - ECHO "warning:" failed to open log file $(log-file) for writing ; + ECHO "warning:" failed to open log file $(.log-file) for writing ; } + return $(.log-fd) ; } diff --git a/src/build/generators.jam b/src/build/generators.jam index 80cf55879e..4333fbcc1a 100644 --- a/src/build/generators.jam +++ b/src/build/generators.jam @@ -47,6 +47,7 @@ import "class" : new ; import property-set ; import sequence ; import set ; +import regex ; import type ; import utility ; import virtual-target ; @@ -298,29 +299,27 @@ class generator # feature name in requirements (i.e. grist-only element), as matching # any value of the feature. - if [ $(property-set-to-match).contains-raw $(self.property-requirements) ] && - [ $(property-set-to-match).contains-features $(self.feature-requirements) ] - { - return true ; + if ! [ $(property-set-to-match).contains-raw $(self.property-requirements) ] { + generators.dout [ indent ] " property-requirements are not met:" $(self.property-requirements) ; + return ; } - else - { + if ! [ $(property-set-to-match).contains-features $(self.feature-requirements) ] { + generators.dout [ indent ] " feature-requirements are not met:" $(self.feature-requirements) ; return ; } + return true ; } # Returns another generator which differs from $(self) in # - id - # - value to feature in properties + # - requirements, which are refined with the new ones # rule clone ( new-id : new-toolset-properties + ) { local g = [ new $(__class__) $(new-id) $(self.composing) : $(self.source-types) : $(self.target-types-and-names) : - # Note: this does not remove any subfeatures of which - # might cause problems. - [ property.change $(self.requirements) : ] - $(new-toolset-properties) ] ; + [ property.refine $(self.requirements) : $(new-toolset-properties) ] + ] ; return $(g) ; } @@ -563,9 +562,12 @@ class generator } # Assign an action for each target. - local action = [ action-class ] ; - local a = [ class.new $(action) $(sources) : $(self.rule-name) : - $(property-set) ] ; + local a = [ action $(sources) : $(property-set) + : $(project) $(name) ] ; + if ! $(a) + { + return ; + } # Create generated target for each target type. local targets ; @@ -582,9 +584,20 @@ class generator $(project) : $(a) ] ; } + targets += [ additional-targets-produced $(sources) : $(property-set) + : $(project) $(name) $(a) : $(targets) ] ; + return [ sequence.transform virtual-target.register : $(targets) ] ; } + # Hook to produce additional targets for cases which could not be (easily) + # solved by registering multiple constrained generators. + # + rule additional-targets-produced ( sources + : property-set + : project name action : targets + ) + { + } + # Attempts to convert 'sources' to targets of types that this generator can # handle. The intention is to produce the set of targets that can be used # when the generator is run. @@ -736,6 +749,16 @@ class generator { return "action" ; } + + # Returns action to be used to generate targets. Default implementation + # returns instantiated class returned by "action-class" member rule. + # + rule action ( sources + : property-set : project name ) + { + local action = [ action-class ] ; + return [ class.new $(action) $(sources) : $(self.rule-name) : + $(property-set) ] ; + } } @@ -834,6 +857,25 @@ rule generators-for-toolset ( toolset ) } +# Adds generator overrides from 'base' to 'toolset'. +# Intended for use in toolset.inherit-generators. +# +rule inherit-overrides ( toolset : base : generators-to-ignore * ) +{ + for local overrider-id in [ MATCH "^\\.override\\.$(base)\\.(.*)" : [ VARNAMES $(__name__) ] ] + { + if ! $(base).$(overrider-id) in $(generators-to-ignore) + { + for local overridee-id in [ regex.replace-list $(.override.$(base).$(overrider-id)) + : ^$(base)\\. : $(toolset). ] + { + override $(toolset).$(overrider-id) : $(overridee-id) ; + } + } + } +} + + # Make generator 'overrider-id' be preferred to 'overridee-id'. If, when # searching for generators that could produce a target of a certain type, both # those generators are among viable generators, the overridden generator is diff --git a/src/build/project.jam b/src/build/project.jam index 98809b49dd..df5e49a8ce 100644 --- a/src/build/project.jam +++ b/src/build/project.jam @@ -36,13 +36,16 @@ import "class" : new ; import modules ; +import os ; import path ; import print ; import property-set ; +import regex ; import sequence ; .debug-loading = [ MATCH ^(--debug-loading)$ : [ modules.peek : ARGV ] ] ; +.debug-project-search = [ MATCH ^(--debug-project-search)$ : [ modules.peek : ARGV ] ] ; # Loads the Jamfile at the given location. After loading, project global file @@ -141,12 +144,42 @@ rule load-parent ( location ) # rule find ( name : current-location ) { + name = [ NORMALIZE_PATH $(name) ] ; local project-module ; # Try interpreting name as project id. if [ path.is-rooted $(name) ] { project-module = $($(name).jamfile-module) ; + if ! $(project-module) + { + # Not immediately found as a project. Try and search for a project + # we can import. + local root-and-jamfile = [ search $(name) ] ; + local root = $(root-and-jamfile[1]) ; + local jamfile = $(root-and-jamfile[2]) ; + if $(root) + { + local caller-project = [ CALLER_MODULE ] ; + local caller-module = [ $(caller-project).project-module ] ; + if $(jamfile) + { + modules.call-in $(caller-module) + : use-packages $(jamfile) ; + } + else + { + if $(.debug-project-search) + { + ECHO Using project '$(name)' from '$(root)' ; + } + modules.call-in $(caller-module) + : use-project $(name) : $(root) ; + load-used-projects $(caller-module) ; + } + } + project-module = $($(name).jamfile-module) ; + } } if ! $(project-module) @@ -177,6 +210,96 @@ rule find ( name : current-location ) } +B2_PROJECT_PATH = [ modules.peek : B2_PROJECT_PATH ] + [ regex.split-list + [ MATCH ^--project-search=(.*)$ : [ modules.peek : ARGV ] ] + : [ os.path-separator ] ] ; +{ + while $(B2_PROJECT_PATH) + { + local root = $(B2_PROJECT_PATH[1]) ; + local path = [ path.make $(B2_PROJECT_PATH[2]) ] ; + B2_PROJECT_PATH = $(B2_PROJECT_PATH[3-]) ; + if $(root) && $(path) + { + path = [ path.root $(path) [ path.pwd ] ] ; + .search-path.$(root) += $(path) ; + } + } +} + + +rule add-project-search ( root : search-paths + ) +{ + for local search-path in $(search-paths) + { + if ! [ path.is-rooted $(search-path) ] + { + local prj = [ current ] ; + search-path = [ path.join [ $(prj).location ] $(search-path) ] ; + search-path = [ path.root $(search-path) [ path.pwd ] ] ; + } + .search-path.$(root) += $(search-path) ; + } +} + + +local rule search ( name ) +{ + if [ path.is-rooted $(name) ] + { + # Check for a regular B2 project relative to the search path and + # project subdir. + for local dir in "$(.search-path./)" + { + dir = $(dir)$(name) ; + local jamfile = [ path.glob $(dir) : $(JAMROOT) $(JAMFILE) ] ; + if $(jamfile) + { + return $(dir) ; + } + } + # Do searching for various dir names and jamfiles based on the built + # basename __[.jam]. + local base = [ path.basename $(name) ] ; + local root = [ path.parent $(name) ] ; + while $(base) + { + # Check for a regular B2 project in the search path and subdir base. + for local dir in $(.search-path.$(root)) + { + dir = [ path.join $(dir) $(base) ] ; + local jamfile = [ path.glob $(dir) : $(JAMROOT) $(JAMFILE) ] ; + if $(jamfile) + { + return $(dir) ; + } + } + # Check for a .jam to include. + for local dir in $(.search-path.$(root)) + { + local jamfile = [ path.glob $(dir) : $(base:L).jam ] ; + if $(jamfile) + { + return $(dir) $(jamfile[1]) ; + } + } + if [ path.has-parent $(root) ] + { + base = [ path.basename $(root) ] $(base) ; + base = $(base:L:J=_) ; + root = [ path.parent $(root) ] ; + } + else + { + base = ; + root = ; + } + } + } +} + + # Returns the name of the module corresponding to 'jamfile-location'. If no # module corresponds to that location yet, associates the default module name # with that location. @@ -322,7 +445,7 @@ rule load-package-manager-build-info ( ) if $(pm) && ! ( $(pm-tag) in $(.package-manager-build-info) ) { .package-manager-build-info += $(pm-tag) ; - # We found a matching builf info to load, but we have to be careful + # We found a matching build info to load, but we have to be careful # as the loading can affect the current project since it can define # sub-projects. Hence we save and restore the current project. local saved-project = $(.current-project) ; @@ -619,6 +742,9 @@ rule initialize ( { .first-project-root = $(module-name) ; } + # Set the default build-dir so that we don't get build results + # spread out everywhere. + # $(attributes).set build-dir : ".b2/bin" ; } local parent ; @@ -1266,8 +1392,9 @@ module project-rules import path ; local caller = [ CALLER_MODULE ] ; local location = [ project.attribute $(caller) location ] ; - modules.poke $(caller) : .used-projects : [ modules.peek $(caller) : - .used-projects ] $(id) [ path.root $(where) $(location) ] ; + where = [ path.root [ path.make $(where) ] $(location) ] ; + modules.poke $(caller) : .used-projects + : [ modules.peek $(caller) : .used-projects ] $(id) $(where) ; } rule build-project ( dir ) @@ -1417,4 +1544,12 @@ module project-rules ] ; } } + + # Defines search paths for resolving global, i.e. rooted, project references. + rule project-search ( root : search-paths + ) + { + import path ; + import project ; + project.add-project-search $(root) : $(search-paths) ; + } } diff --git a/src/build/property.jam b/src/build/property.jam index a7a2e71dd4..05219af668 100644 --- a/src/build/property.jam +++ b/src/build/property.jam @@ -84,6 +84,10 @@ rule evaluate-conditionals-in-context ( properties * : context * ) { indirect += $(p) ; } + else if $(p) = no + { + return no ; + } else { result += $(p) ; @@ -125,6 +129,10 @@ rule evaluate-conditionals-in-context ( properties * : context * ) properties += $(s[2]) ; } } + if no = $(properties[-1]) + { + return no ; + } } for local i in [ MATCH "^@(.*)" : $(indirect:G=) ] { @@ -138,13 +146,14 @@ rule evaluate-conditionals-in-context ( properties * : context * ) local location = [ $(p).location ] ; local project-id = [ project.attribute $(m) id ] ; project-id ?= [ path.root $(location) [ path.pwd ] ] ; - properties += + new = [ translate $(new) : $(project-id) : $(location) : $(m) ] ; } - else + if no in $(new) { - properties += $(new) ; + return no ; } + properties += $(new) ; } } return $(result) ; diff --git a/src/build/targets.jam b/src/build/targets.jam index d4bb186ce1..ffeb677016 100644 --- a/src/build/targets.jam +++ b/src/build/targets.jam @@ -1407,6 +1407,12 @@ class basic-target : abstract-target local result = [ construct $(self.name) : $(source-targets) : $(rproperties) ] ; + if $(result) && [ $(result[1]).get ] = no + { + result = ; + skip = true ; + } + if $(result) { local gur = $(result[1]) ; diff --git a/src/build/toolset.jam b/src/build/toolset.jam index a632605cc7..1fce54c26e 100644 --- a/src/build/toolset.jam +++ b/src/build/toolset.jam @@ -572,10 +572,18 @@ rule inherit-generators ( toolset properties * : base : generators-to-ignore * ) base = $(base:B) ; } local new-id = $(toolset)$(suffix) ; + local rule-name = [ $(g).rule-name ] ; - generators.register [ $(g).clone $(new-id) : $(properties) ] ; + g = [ $(g).clone $(new-id) : $(properties) ] ; + # Custom rule names needs special handling + if $(id) != $(rule-name) { + $(g).set-rule-name [ regex.replace $(rule-name) ^$(base)\\. $(toolset). ] ; + } + + generators.register $(g) ; } } + generators.inherit-overrides $(toolset) : $(base) : $(generators-to-ignore) ; } diff --git a/src/build/version.jam b/src/build/version.jam index 4f75c960b6..917f44e6b0 100644 --- a/src/build/version.jam +++ b/src/build/version.jam @@ -9,7 +9,7 @@ import numbers ; # Mirror engine JAM_VERSION .major = "4" ; -.minor = "9" ; +.minor = "10" ; rule build ( ) diff --git a/src/build/virtual-target.jam b/src/build/virtual-target.jam index 85ef46cdcb..bd57411eb1 100644 --- a/src/build/virtual-target.jam +++ b/src/build/virtual-target.jam @@ -756,12 +756,6 @@ class action self.targets += $(targets) ; } - rule replace-targets ( old-targets * : new-targets * ) - { - self.targets = [ set.difference $(self.targets) : $(old-targets) ] ; - self.targets += $(new-targets) ; - } - rule targets ( ) { return $(self.targets) ; diff --git a/src/engine/bump_version.py b/src/engine/bump_version.py index 66f5f1c72e..9ba0bc6bc9 100644 --- a/src/engine/bump_version.py +++ b/src/engine/bump_version.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # This script is used to bump the bjam version. It takes a single argument, e.g # diff --git a/src/engine/execunix.cpp b/src/engine/execunix.cpp index 7825fffe74..fd8220e779 100644 --- a/src/engine/execunix.cpp +++ b/src/engine/execunix.cpp @@ -461,7 +461,7 @@ void exec_wait() while ( !finished ) { int i; - int select_timeout = globs.timeout; + long select_timeout = globs.timeout; /* Check for timeouts: * - kill children that already timed out @@ -474,7 +474,7 @@ void exec_wait() for ( i = 0; i < globs.jobs; ++i ) if ( cmdtab[ i ].pid ) { - clock_t const consumed = + long const consumed = (long) ( current - cmdtab[ i ].start_time ) / tps; if ( consumed >= globs.timeout ) { diff --git a/src/engine/patchlevel.h b/src/engine/patchlevel.h index 30ae77c5ad..23a2fb6aa6 100644 --- a/src/engine/patchlevel.h +++ b/src/engine/patchlevel.h @@ -12,5 +12,5 @@ Distributed under the Boost Software License, Version 1.0. #define VERSION_MAJOR 4 -#define VERSION_MINOR 9 -#define VERSION_PATCH 6 +#define VERSION_MINOR 10 +#define VERSION_PATCH 0 diff --git a/src/tools/acc.jam b/src/tools/acc.jam index 06790420fe..67b44fc6c5 100644 --- a/src/tools/acc.jam +++ b/src/tools/acc.jam @@ -58,8 +58,6 @@ import common ; feature.extend toolset : acc ; toolset.inherit acc : unix ; -generators.override builtin.lib-generator : acc.prebuilt ; -generators.override acc.searched-lib-generator : searched-lib-generator ; # Configures the acc toolset. rule init ( version ? : user-provided-command * : options * ) diff --git a/src/tools/clang-darwin.jam b/src/tools/clang-darwin.jam index 597751161e..61a7551b76 100644 --- a/src/tools/clang-darwin.jam +++ b/src/tools/clang-darwin.jam @@ -10,34 +10,24 @@ import feature : feature ; import os ; import toolset ; import toolset : flags ; -import gcc ; import common ; import errors ; import generators ; feature.extend-subfeature toolset clang : platform : darwin ; +# FIXME: import order affects default value for 'platform' subfeature +import clang-linux ; toolset.inherit-generators clang-darwin clang darwin - : gcc - : gcc.mingw.link gcc.mingw.link.dll + : clang-linux ; -generators.override clang-darwin.prebuilt : builtin.lib-generator ; -generators.override clang-darwin.prebuilt : builtin.prebuilt ; -generators.override clang-darwin.searched-lib-generator : searched-lib-generator ; - -# Override default do-nothing generators. -generators.override clang-darwin.compile.c.pch : pch.default-c-pch-generator ; -generators.override clang-darwin.compile.c++.pch : pch.default-cpp-pch-generator ; - -toolset.inherit-rules clang-darwin : gcc ; -toolset.inherit-flags clang-darwin : gcc - : full +toolset.inherit-rules clang-darwin : clang-linux ; +toolset.inherit-flags clang-darwin : clang-linux + : x86/32 x86/64 - on/full - on/fat ; if [ MATCH (--debug-configuration) : [ modules.peek : ARGV ] ] @@ -80,62 +70,3 @@ rule get-short-version ( command-string ) import clang-linux ; return [ clang-linux.get-short-version $(command-string) ] ; } - -SPACE = " " ; - -# Declare flags and action for compilation. - -# For clang, 'on' and 'full' are identical -toolset.flags clang-darwin.compile OPTIONS full : -Wno-inline ; - -# LTO -toolset.flags clang-darwin.compile OPTIONS on/thin : -flto=thin ; -toolset.flags clang-darwin.link OPTIONS on/thin : -flto=thin ; - -toolset.flags clang-darwin.compile OPTIONS on/full : -flto=full ; -toolset.flags clang-darwin.link OPTIONS on/full : -flto=full ; - -# stdlib selection -toolset.flags clang-darwin.compile OPTIONS gnu gnu11 : -stdlib=libstdc++ ; -toolset.flags clang-darwin.link OPTIONS gnu gnu11 : -stdlib=libstdc++ ; - -toolset.flags clang-darwin.compile OPTIONS libc++ : -stdlib=libc++ ; -toolset.flags clang-darwin.link OPTIONS libc++ : -stdlib=libc++ ; - -rule compile.c ( targets * : sources * : properties * ) -{ - DEPENDS $(<) : [ on $(<) return $(PCH_FILE) ] ; -} - -rule compile.c++ ( targets * : sources * : properties * ) -{ - DEPENDS $(<) : [ on $(<) return $(PCH_FILE) ] ; -} - -.include-pch = "-include-pch " ; - -actions compile.c bind PCH_FILE -{ - "$(CONFIG_COMMAND)" -x c $(OPTIONS) $(USER_OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" $(.include-pch)"$(PCH_FILE)" -c -o "$(<)" "$(>)" -} - -actions compile.c++ bind PCH_FILE -{ - "$(CONFIG_COMMAND)" -x c++ $(OPTIONS) $(USER_OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" $(.include-pch)"$(PCH_FILE)" -c -o "$(<)" "$(>)" -} - -# Declare actions for linking -rule link ( targets * : sources * : properties * ) -{ - SPACE on $(targets) = " " ; -} - -actions link bind LIBRARIES -{ - "$(CONFIG_COMMAND)" $(USER_OPTIONS) -L"$(LINKPATH)" -o "$(<)" "$(>)" "$(LIBRARIES)" $(START-GROUP) $(FINDLIBS-ST-PFX) -l$(FINDLIBS-ST) $(FINDLIBS-SA-PFX) -l$(FINDLIBS-SA) $(END-GROUP) $(OPTIONS) -} - -actions link.dll bind LIBRARIES -{ - "$(CONFIG_COMMAND)" $(USER_OPTIONS) -L"$(LINKPATH)" -o "$(<)" -single_module -dynamiclib -install_name "@rpath/$(<[1]:D=)" "$(>)" "$(LIBRARIES)" $(START-GROUP) $(FINDLIBS-ST-PFX) -l$(FINDLIBS-ST) $(FINDLIBS-SA-PFX) -l$(FINDLIBS-SA) $(END-GROUP) $(OPTIONS) -} diff --git a/src/tools/clang-linux.jam b/src/tools/clang-linux.jam index 79e98b14c4..b389ff3364 100644 --- a/src/tools/clang-linux.jam +++ b/src/tools/clang-linux.jam @@ -28,20 +28,13 @@ feature.extend-subfeature toolset clang : platform : linux ; toolset.inherit-generators clang-linux clang linux : gcc : gcc.mingw.link gcc.mingw.link.dll gcc.cygwin.link gcc.cygwin.link.dll ; -generators.override clang-linux.prebuilt : builtin.lib-generator ; -generators.override clang-linux.prebuilt : builtin.prebuilt ; -generators.override clang-linux.searched-lib-generator : searched-lib-generator ; - -# Override default do-nothing generators. -generators.override clang-linux.compile.c.pch : pch.default-c-pch-generator ; -generators.override clang-linux.compile.c++.pch : pch.default-cpp-pch-generator ; toolset.inherit-rules clang-linux : gcc ; toolset.inherit-flags clang-linux : gcc : full - multi/windows on/full on/fat + : INCLUDE-GCH ; if [ MATCH (--debug-configuration) : [ modules.peek : ARGV ] ] { @@ -118,15 +111,12 @@ rule get-short-version ( command-string : single-digit-since ? ) ############################################################################### # Flags -local all-os = [ feature.values ] ; +toolset.flags clang-linux.compile INCLUDE-PCH : -include-pch ; # note: clang silently ignores some of these inlining options # For clang, 'on' and 'full' are identical. toolset.flags clang-linux.compile OPTIONS full : -Wno-inline ; -toolset.flags clang-linux.compile OPTIONS multi/windows : -pthread ; -toolset.flags clang-linux.link OPTIONS multi/windows : -pthread ; - # LTO toolset.flags clang-linux.compile OPTIONS on/thin : -flto=thin ; toolset.flags clang-linux.link OPTIONS on/thin : -flto=thin ; @@ -140,46 +130,3 @@ toolset.flags clang-linux.link OPTIONS gnu gnu11 : -stdlib=libst toolset.flags clang-linux.compile OPTIONS libc++ : -stdlib=libc++ ; toolset.flags clang-linux.link OPTIONS libc++ : -stdlib=libc++ ; - -# Enable response file control -toolset.flags clang-linux RESPONSE_FILE_SUB auto : a ; -toolset.flags clang-linux RESPONSE_FILE_SUB file : f ; -toolset.flags clang-linux RESPONSE_FILE_SUB contents : c ; - -# Used in actions for multi argument options -_ = " " ; -############################################################################### -# C and C++ compilation - -rule compile.c++ ( targets * : sources * : properties * ) { - DEPENDS $(<) : [ on $(<) return $(PCH_FILE) ] ; -} - -actions compile.c++ bind PCH_FILE -{ - "$(CONFIG_COMMAND)" -c -x c++ $(OPTIONS) $(USER_OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -Xclang$(_)-include-pch$(_)-Xclang$(_)"$(PCH_FILE)" -include"$(FORCE_INCLUDES)" -o "$(<)" "$(>)" -} - -rule compile.c ( targets * : sources * : properties * ) -{ - DEPENDS $(<) : [ on $(<) return $(PCH_FILE) ] ; -} - -actions compile.c bind PCH_FILE -{ - "$(CONFIG_COMMAND)" -c -x c $(OPTIONS) $(USER_OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -Xclang$(_)-include-pch$(_)-Xclang$(_)"$(PCH_FILE)" -include"$(FORCE_INCLUDES)" -c -o "$(<)" "$(>)" -} - -############################################################################### -# Linking - -local soname-os = [ set.difference $(all-os) : windows ] ; -toolset.flags clang-linux.link SONAME_OPT $(soname-os) : "-Wl,-soname -Wl," ; - -actions link bind LIBRARIES { - "$(CONFIG_COMMAND)" -L"$(LINKPATH)" -o "$(<)" @($(<[1]:T).rsp:O=FC:<=@":>=":E=-Wl,-R$(_)-Wl,$(RPATH) -Wl,-rpath-link$(_)-Wl,"$(RPATH_LINK)" $(START-GROUP) "$(>:T)" "$(LIBRARIES:T)" $(FINDLIBS-ST-PFX:T) -l$(FINDLIBS-ST:T) $(FINDLIBS-SA-PFX:T) -l$(FINDLIBS-SA:T) $(END-GROUP)) $(OPTIONS) $(USER_OPTIONS) -} - -actions link.dll bind LIBRARIES { - "$(CONFIG_COMMAND)" -L"$(LINKPATH)" -o "$(<)" @($(<[1]:T).rsp:O=FC:<=@":>=":E=-Wl,-R$(_)-Wl,$(RPATH) $(SONAME_OPT)$(<[1]:D=) -shared $(START-GROUP) "$(>:T)" "$(LIBRARIES:T)" $(FINDLIBS-ST-PFX:T) -l$(FINDLIBS-ST:T) $(FINDLIBS-SA-PFX:T) -l$(FINDLIBS-SA:T) $(END-GROUP)) $(OPTIONS) $(USER_OPTIONS) -} diff --git a/src/tools/clang-vxworks.jam b/src/tools/clang-vxworks.jam index 083ea155bd..1b00572c72 100644 --- a/src/tools/clang-vxworks.jam +++ b/src/tools/clang-vxworks.jam @@ -12,29 +12,20 @@ import gcc ; import common ; import errors ; import generators ; +import numbers ; feature.extend-subfeature toolset clang : platform : vxworks ; +# FIXME: import order affects default value for 'platform' subfeature +import clang-linux ; toolset.inherit-generators clang-vxworks clang vxworks - : gcc - # Don't inherit PCH generators. They were not tested, and probably - # don't work for this compiler. - : gcc.mingw.link gcc.mingw.link.dll gcc.compile.c.pch gcc.compile.c++.pch + : clang-linux ; -generators.override clang-vxworks.prebuilt : builtin.lib-generator ; -generators.override clang-vxworks.prebuilt : builtin.prebuilt ; -generators.override clang-vxworks.searched-lib-generator : searched-lib-generator ; - - -toolset.inherit-rules clang-vxworks : gcc ; -toolset.inherit-flags clang-vxworks : gcc - : full - x86/32 - x86/64 - ; +toolset.inherit-rules clang-vxworks : clang-linux ; +toolset.inherit-flags clang-vxworks : clang-linux ; if [ MATCH (--debug-configuration) : [ modules.peek : ARGV ] ] { @@ -49,7 +40,6 @@ rule init ( version ? : command * : options * ) : $(command) ] ; linker = [ get-values : $(options) ] ; - linker ?= ld ; # Determine the version local command-string = $(command:J=" ") ; @@ -64,60 +54,17 @@ rule init ( version ? : command * : options * ) common.handle-options clang-vxworks : $(condition) : $(command) : $(options) ; - toolset.flags clang-vxworks.link .LD : $(linker) ; + if ! $(linker) { + # use default linker + } + else if ! [ numbers.less [ MATCH "^([0-9]+)" : 0$(version:E=12) ] 12 ] { + toolset.flags clang-vxworks.link OPTIONS $(condition) : --ld-path=$(linker) ; + } + else { + toolset.flags clang-vxworks.link OPTIONS $(condition) : -fuse-ld=$(linker) ; + } # - Archive builder. local archiver = [ feature.get-values : $(options) ] ; toolset.flags clang-vxworks.archive .AR $(condition) : $(archiver[1]) ; } - -SPACE = " " ; - -toolset.flags clang-vxworks.compile OPTIONS ; -toolset.flags clang-vxworks.compile.c++ OPTIONS ; -toolset.flags clang-vxworks.compile INCLUDES ; - -# For clang, 'on' and 'full' are identical -toolset.flags clang-vxworks.compile OPTIONS full : -Wno-inline ; - - -actions compile.c -{ - "$(CONFIG_COMMAND)" -x c $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -include"$(FORCE_INCLUDES)" -c -o "$(<)" "$(>)" -} - -actions compile.c++ -{ - "$(CONFIG_COMMAND)" -x c++ $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -include"$(FORCE_INCLUDES)" -c -o "$(<)" "$(>)" -} - - - -# Default value. Mostly for the sake of clang-linux -# that inherits from gcc, but does not has the same -# logic to set the .AR variable. We can put the same -# logic in clang-linux, but that's hardly worth the trouble -# as on Linux, 'ar' is always available. -.AR = ar ; - - -actions piecemeal archive -{ - "$(.AR)" $(AROPTIONS) rcu "$(<)" "$(>)" -} - -# Declare actions for linking -rule link ( targets * : sources * : properties * ) -{ - SPACE on $(targets) = " " ; -} - -actions link bind LIBRARIES -{ - "$(.LD)" $(USER_OPTIONS) -L"$(LINKPATH)" -o "$(<)" "$(>)" "$(LIBRARIES)" $(START-GROUP) $(FINDLIBS-ST-PFX) -l$(FINDLIBS-ST) $(FINDLIBS-SA-PFX) -l$(FINDLIBS-SA) $(END-GROUP) $(OPTIONS) - } - -actions link.dll bind LIBRARIES -{ - "$(.LD)" $(USER_OPTIONS) -L"$(LINKPATH)" -o "$(<)" "$(>)" "$(LIBRARIES)" $(START-GROUP) $(FINDLIBS-ST-PFX) -l$(FINDLIBS-ST) $(FINDLIBS-SA-PFX) -l$(FINDLIBS-SA) $(END-GROUP) $(OPTIONS) -fpic -shared -non-static -} diff --git a/src/tools/clang-win.jam b/src/tools/clang-win.jam index d153daded5..1321f32643 100644 --- a/src/tools/clang-win.jam +++ b/src/tools/clang-win.jam @@ -23,12 +23,6 @@ toolset.inherit-generators clang-win clang win toolset.inherit-flags clang-win : msvc : : YLOPTION ; toolset.inherit-rules clang-win : msvc ; -# Override default do-nothing generators. -generators.override clang-win.compile.rc : rc.compile.resource ; -generators.override clang-win.compile.mc : mc.compile ; -generators.override clang-win.compile.c.pch : pch.default-c-pch-generator ; -generators.override clang-win.compile.c++.pch : pch.default-cpp-pch-generator ; - if [ MATCH (--debug-(clang-(win-)?)?configuration) : [ modules.peek : ARGV ] ] { @@ -98,13 +92,13 @@ rule init ( version ? : command * : options * ) for local arch in x86 arm { local clang-arch ; - if $(arch) = x86 - { - if $(addr) = 32 { clang-arch = i386 ; } else { clang-arch = x86_64 ; } - } - else if $(arch) = arm - { - if $(addr) = 32 { clang-arch = arm ; } else { clang-arch = aarch64 ; } + local target-assembler ; + + switch $(arch)-$(addr) { + case x86-64 : clang-arch = x86_64 ; target-assembler = ml64 ; + case x86-32 : clang-arch = i386 ; target-assembler = ml ; + case arm-64 : clang-arch = aarch64 ; target-assembler = armasm64 ; + case arm-32 : clang-arch = arm ; target-assembler = armasm ; } local config = [ SPLIT_BY_CHARACTERS [ SHELL "$(compiler) --target=$(clang-arch)-pc-windows-msvc -### foo.obj /link 2>&1" ] : "\n" ] ; @@ -123,38 +117,17 @@ rule init ( version ? : command * : options * ) } } - local asm ; - - if $(items) - { - asm = [ regex.replace $(items[1]) "x64\\\\link\\.exe" "x64\\ml64.exe" ] ; - asm = [ regex.replace $(asm) "x86\\\\link\\.exe" "x86\\ml.exe" ] ; - asm = [ regex.replace $(asm) "arm64\\\\link\\.exe" "arm64\\armasm64.exe" ] ; - asm = [ regex.replace $(asm) "arm\\\\link\\.exe" "arm\\armasm.exe" ] ; - - if ! [ MATCH "(ml\\.exe)" "(ml64\\.exe)" "(armasm64\\.exe)" "(armasm\\.exe)" : $(asm) ] - { - asm = ; - } - } - local assembler = [ get-option "assembler" : $(addr) : $(options) ] ; - assembler ?= $(asm) ; - if $(arch) = x86 - { - if $(addr) = 32 { assembler ?= ml.exe ; } else { assembler ?= ml64.exe ; } - } - else if $(arch) = arm - { - if $(addr) = 32 { assembler ?= armasm.exe ; } else { assembler ?= armasm64.exe ; } - } - local linker ; if $(items) { linker = [ regex.replace $(items[1]) "\\\\HostX64\\\\x86\\\\" "\\HostX86\\x86\\" ] ; } + if $(linker) { + assembler ?= $(linker:B=$(target-assembler)) ; + } + assembler ?= $(target-assembler) ; .notice "$(arch)-$(addr):" "using linker '$(linker)'" ; @@ -234,7 +207,7 @@ rule init ( version ? : command * : options * ) } else if $(arch) = arm { - toolset.flags clang-win.compile .ASM $(cond) : $(assembler) -machine $(arch) ; + toolset.flags clang-win.compile .ASM $(cond) : $(assembler) -nologo ; toolset.flags clang-win.compile .ASM_OUTPUT $(cond) : -o ; } toolset.flags clang-win.archive .LD $(cond) : $(archiver) /nologo ; diff --git a/src/tools/common.jam b/src/tools/common.jam index 804fb01a38..42f2833c93 100644 --- a/src/tools/common.jam +++ b/src/tools/common.jam @@ -722,7 +722,7 @@ if [ os.name ] = NT { actions quietly mkdir { - if not exist "$(<)\\" mkdir "$(<)" + if not exist "$(<)" mkdir "$(<)" } } else diff --git a/src/tools/como-linux.jam b/src/tools/como-linux.jam index 52f3a216e1..5bf54e734c 100644 --- a/src/tools/como-linux.jam +++ b/src/tools/como-linux.jam @@ -20,8 +20,6 @@ feature.extend-subfeature toolset como : platform : linux ; toolset.inherit-generators como-linux como linux : unix ; -generators.override como-linux.prebuilt : builtin.lib-generator ; -generators.override como-linux.searched-lib-generator : searched-lib-generator ; toolset.inherit-flags como-linux : unix ; toolset.inherit-rules como-linux : gcc ; diff --git a/src/tools/cray.jam b/src/tools/cray.jam index 9364b5511b..b8f1447e3b 100644 --- a/src/tools/cray.jam +++ b/src/tools/cray.jam @@ -323,6 +323,9 @@ toolset.flags cray.compile OPTIONS off : -h vector0 ; toolset.flags cray.compile OPTIONS on ; # Blank. CCE vectorizes by default. toolset.flags cray.compile OPTIONS full : -h vector3 ; +toolset.flags cray.compile.c.preprocess OPTIONS off : -P ; +toolset.flags cray.compile.c++.preprocess OPTIONS off : -P ; + toolset.flags cray.link FINDLIBS-SA multi : rt ; # Not sure if this is correct. toolset.flags cray.link OPTIONS shared : -h pic ; @@ -894,13 +897,6 @@ generators.register [ new cray-linking-generator : SHARED_LIB : cray ] ; -# Tell B2 to prefer 'cray' generators over other valid -# generators. This is used to resolve a tie when B2 finds that -# there is more than one viable generator for a particular build request. - -generators.override cray.prebuilt : builtin.prebuilt ; -generators.override cray.searched-lib-generator : searched-lib-generator ; - type.set-generated-target-suffix PREPROCESSED_CPP : cray : i ; type.set-generated-target-suffix PREPROCESSED_C : cray : i ; diff --git a/src/tools/darwin.jam b/src/tools/darwin.jam index 558af6dc88..222d00ba8a 100644 --- a/src/tools/darwin.jam +++ b/src/tools/darwin.jam @@ -46,13 +46,6 @@ feature.extend toolset : darwin ; import gcc ; toolset.inherit-generators darwin : gcc : gcc.mingw.link gcc.mingw.link.dll ; -generators.override darwin.prebuilt : builtin.prebuilt ; -generators.override darwin.searched-lib-generator : searched-lib-generator ; - -# Override default do-nothing generators. -generators.override darwin.compile.c.pch : pch.default-c-pch-generator ; -generators.override darwin.compile.c++.pch : pch.default-cpp-pch-generator ; - type.set-generated-target-suffix PCH : darwin : gch ; toolset.inherit-rules darwin : gcc : localize ; diff --git a/src/tools/diab.jam b/src/tools/diab.jam index c07572af89..e2310ac885 100644 --- a/src/tools/diab.jam +++ b/src/tools/diab.jam @@ -15,10 +15,6 @@ feature.extend toolset : diab ; # Inherit from Unix toolset to get library ordering magic. toolset.inherit diab : unix ; -generators.override diab.prebuilt : builtin.lib-generator ; -generators.override diab.prebuilt : builtin.prebuilt ; -generators.override diab.searched-lib-generator : searched-lib-generator ; - rule init ( version ? : command * : options * ) { diff --git a/src/tools/doxproc.py b/src/tools/doxproc.py index 92ec1c3117..b681e04638 100644 --- a/src/tools/doxproc.py +++ b/src/tools/doxproc.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright 2006 Rene Rivera # Distributed under the Boost Software License, Version 1.0. # (See accompanying file LICENSE.txt or https://www.bfgroup.xyz/b2/LICENSE.txt) diff --git a/src/tools/embarcadero.jam b/src/tools/embarcadero.jam index c561bfc94f..6b28f96fbc 100644 --- a/src/tools/embarcadero.jam +++ b/src/tools/embarcadero.jam @@ -141,9 +141,6 @@ import errors ; feature.extend toolset : embarcadero ; toolset.inherit-generators embarcadero : clang-linux ; -generators.override embarcadero.prebuilt : builtin.lib-generator ; -generators.override embarcadero.prebuilt : builtin.prebuilt ; -generators.override embarcadero.searched-lib-generator : searched-lib-generator ; toolset.inherit-rules embarcadero : clang-linux ; toolset.inherit-flags embarcadero diff --git a/src/tools/features/linemarkers-feature.jam b/src/tools/features/linemarkers-feature.jam new file mode 100644 index 0000000000..0808d53897 --- /dev/null +++ b/src/tools/features/linemarkers-feature.jam @@ -0,0 +1,22 @@ +# Copyright 2023 Nikita Kniazev +# Distributed under the Boost Software License, Version 1.0. +# (See accompanying file LICENSE.txt or copy at +# https://www.bfgroup.xyz/b2/LICENSE.txt) + +import feature ; + +#| tag::doc[] + +[[bbv2.builtin.features.linemarkers]]`linemarkers`:: +*Allowed values:* `off`. ++ +On preprocessing targets changes behavior to emit/omit line directives +like `\#line` and `#_linenum_`. ++ +*NOTE:* The value doesn't propagate. + +|# # end::doc[] + +feature.feature linemarkers + : off + : optional ; diff --git a/src/tools/features/threadapi-feature.jam b/src/tools/features/threadapi-feature.jam index 35945ded06..2eec99da9e 100644 --- a/src/tools/features/threadapi-feature.jam +++ b/src/tools/features/threadapi-feature.jam @@ -18,7 +18,7 @@ Selects threading implementation. The default is `win32` if `` is |# # end::doc[] -feature threadapi : pthread win32 : symmetric propagated ; +feature threadapi : pthread win32 : propagated ; toolset.add-defaults windows:win32 ; rule get-default ( property-set ) diff --git a/src/tools/gcc.jam b/src/tools/gcc.jam index bbbb3e6a35..834f5e1bf6 100644 --- a/src/tools/gcc.jam +++ b/src/tools/gcc.jam @@ -119,6 +119,9 @@ import virtual-target ; import errors ; +# Used in actions for multi argument options +_ = " " ; + if [ MATCH (--debug-configuration) : [ modules.peek : ARGV ] ] { .debug-configuration = true ; @@ -131,9 +134,6 @@ toolset.inherit-generators gcc : unix : unix.link unix.link.dll ; toolset.inherit-flags gcc : unix ; toolset.inherit-rules gcc : unix ; -generators.override gcc.prebuilt : builtin.prebuilt ; -generators.override gcc.searched-lib-generator : searched-lib-generator ; - # Make gcc toolset object files use the "o" suffix on all platforms. type.set-generated-target-suffix OBJ : gcc : o ; type.set-generated-target-suffix OBJ : gcc windows : o ; @@ -385,8 +385,10 @@ local rule compile-link-flags ( * ) } } - threading-flags windows : -mthreads ; - threading-flags cygwin : -mthreads ; + # -mthreads is obsolete at least since mingw-w64 fork ~2011 and is not presented in clang + threading-flags windows/gcc : -mthreads ; + threading-flags windows/pthread : -pthread ; + threading-flags cygwin/pthread : -pthread ; threading-flags solaris : -pthreads : rt ; threading-flags qnx : -pthread ; @@ -452,7 +454,7 @@ generators.register-c-compiler gcc.compile.c++.preprocess : CPP : PREPROCESSED_C generators.register-c-compiler gcc.compile.c.preprocess : C : PREPROCESSED_C : gcc ; generators.register-c-compiler gcc.compile.c++ : CPP : OBJ : gcc ; generators.register-c-compiler gcc.compile.c : C : OBJ : gcc ; -generators.register-c-compiler gcc.compile.asm : ASM : OBJ : gcc ; +generators.register-c-compiler gcc.compile.asm : ASM_CPP : OBJ : gcc ; generators.register-c-compiler gcc.compile.m : OBJECTIVE_C : OBJ : gcc ; generators.register-c-compiler gcc.compile.mm : OBJECTIVE_CPP : OBJ : gcc ; @@ -511,27 +513,27 @@ rule compile.fortran ( targets * : sources * : properties * ) actions compile.c++ bind PCH_FILE { - "$(CONFIG_COMMAND)" $(LANG) -ftemplate-depth-$(TEMPLATE_DEPTH) $(OPTIONS) $(USER_OPTIONS) -D$(DEFINES) -include"$(PCH_FILE:S=)" -I"$(INCLUDES)" -include"$(FORCE_INCLUDES)" -c -o "$(<)" "$(>:T)" + "$(CONFIG_COMMAND)" $(LANG) -ftemplate-depth-$(TEMPLATE_DEPTH) $(OPTIONS) $(USER_OPTIONS) -D$(DEFINES) $(INCLUDE-GCH)$(_)"$(PCH_FILE:S=)" $(INCLUDE-PCH)$(_)"$(PCH_FILE)" -I"$(INCLUDES)" -include$(_)"$(FORCE_INCLUDES)" -c -o "$(<)" "$(>:T)" } actions compile.c bind PCH_FILE { - "$(CONFIG_COMMAND)" $(LANG) $(OPTIONS) $(USER_OPTIONS) -D$(DEFINES) -include"$(PCH_FILE:S=)" -I"$(INCLUDES)" -include"$(FORCE_INCLUDES)" -c -o "$(<)" "$(>:T)" + "$(CONFIG_COMMAND)" $(LANG) $(OPTIONS) $(USER_OPTIONS) -D$(DEFINES) $(INCLUDE-GCH)$(_)"$(PCH_FILE:S=)" $(INCLUDE-PCH)$(_)"$(PCH_FILE)" -I"$(INCLUDES)" -include$(_)"$(FORCE_INCLUDES)" -c -o "$(<)" "$(>:T)" } actions compile.c++.preprocess bind PCH_FILE { - "$(CONFIG_COMMAND)" $(LANG) -ftemplate-depth-$(TEMPLATE_DEPTH) $(OPTIONS) $(USER_OPTIONS) -D$(DEFINES) -include"$(PCH_FILE:S=)" -I"$(INCLUDES)" -include"$(FORCE_INCLUDES)" "$(>:T)" -E >"$(<)" + "$(CONFIG_COMMAND)" $(LANG) -ftemplate-depth-$(TEMPLATE_DEPTH) $(OPTIONS) $(USER_OPTIONS) -D$(DEFINES) $(INCLUDE-GCH)$(_)"$(PCH_FILE:S=)" $(INCLUDE-PCH)$(_)"$(PCH_FILE)" -I"$(INCLUDES)" -include$(_)"$(FORCE_INCLUDES)" "$(>:T)" -E >"$(<)" } actions compile.c.preprocess bind PCH_FILE { - "$(CONFIG_COMMAND)" $(LANG) $(OPTIONS) $(USER_OPTIONS) -D$(DEFINES) -include"$(PCH_FILE:S=)" -I"$(INCLUDES)" -include"$(FORCE_INCLUDES)" "$(>:T)" -E >$(<) + "$(CONFIG_COMMAND)" $(LANG) $(OPTIONS) $(USER_OPTIONS) -D$(DEFINES) $(INCLUDE-GCH)$(_)"$(PCH_FILE:S=)" $(INCLUDE-PCH)$(_)"$(PCH_FILE)" -I"$(INCLUDES)" -include$(_)"$(FORCE_INCLUDES)" "$(>:T)" -E >$(<) } actions compile.fortran { - "$(CONFIG_COMMAND)" $(LANG) $(OPTIONS) $(USER_OPTIONS) -D$(DEFINES) -include"$(PCH_FILE:S=)" -I"$(INCLUDES)" -c -o "$(<)" "$(>)" + "$(CONFIG_COMMAND)" $(LANG) $(OPTIONS) $(USER_OPTIONS) -D$(DEFINES) $(INCLUDE-GCH)$(_)"$(PCH_FILE:S=)" $(INCLUDE-PCH)$(_)"$(PCH_FILE)" -I"$(INCLUDES)" -include$(_)"$(FORCE_INCLUDES)" -c -o "$(<)" "$(>)" } rule compile.asm ( targets * : sources * : properties * ) @@ -608,15 +610,16 @@ generators.override gcc.compile.c.pch : pch.default-c-pch-generator ; generators.override gcc.compile.c++.pch : pch.default-cpp-pch-generator ; toolset.flags gcc.compile PCH_FILE on : ; +toolset.flags gcc.compile INCLUDE-GCH : -include ; actions compile.c++.pch { - "$(CONFIG_COMMAND)" -x c++-header -ftemplate-depth-$(TEMPLATE_DEPTH) $(OPTIONS) $(USER_OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -include"$(FORCE_INCLUDES)" -c -o "$(<)" "$(>:T)" + "$(CONFIG_COMMAND)" -x c++-header -ftemplate-depth-$(TEMPLATE_DEPTH) $(OPTIONS) $(USER_OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -include$(_)"$(FORCE_INCLUDES)" -c -o "$(<)" "$(>:T)" } actions compile.c.pch { - "$(CONFIG_COMMAND)" -x c-header $(OPTIONS) $(USER_OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -include"$(FORCE_INCLUDES)" -c -o "$(<)" "$(>:T)" + "$(CONFIG_COMMAND)" -x c-header $(OPTIONS) $(USER_OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -include$(_)"$(FORCE_INCLUDES)" -c -o "$(<)" "$(>:T)" } ### @@ -653,6 +656,9 @@ toolset.flags gcc.compile OPTIONS global : -fvisibility=defaul toolset.flags gcc.compile.c++ OPTIONS off : -fno-exceptions ; toolset.flags gcc.compile.c++ OPTIONS off : -fno-rtti ; +toolset.flags gcc.compile.c.preprocess OPTIONS off : -P ; +toolset.flags gcc.compile.c++.preprocess OPTIONS off : -P ; + # sanitizers toolset.flags gcc.compile.c++ OPTIONS on : -fsanitize=address -fno-omit-frame-pointer ; toolset.flags gcc.compile.c++ OPTIONS norecover : -fsanitize=address -fno-sanitize-recover=address -fno-omit-frame-pointer ; @@ -758,14 +764,14 @@ g = [ new gcc-linking-generator gcc.mingw.link : OBJ SEARCHED_LIB STATIC_LIB IMPORT_LIB : EXE : gcc windows ] ; -$(g).set-rule-name gcc.link.mingw ; +$(g).set-rule-name gcc.link ; generators.register $(g) ; g = [ new gcc-linking-generator gcc.mingw.link.dll : OBJ SEARCHED_LIB STATIC_LIB IMPORT_LIB - : IMPORT_LIB SHARED_LIB + : SHARED_LIB IMPORT_LIB : gcc windows ] ; -$(g).set-rule-name gcc.link.dll.mingw ; +$(g).set-rule-name gcc.link.dll ; generators.register $(g) ; generators.register @@ -795,7 +801,7 @@ generators.register $(g) ; g = [ new gcc-linking-generator gcc.cygwin.link.dll : OBJ SEARCHED_LIB STATIC_LIB IMPORT_LIB - : IMPORT_LIB SHARED_LIB + : SHARED_LIB IMPORT_LIB : gcc cygwin ] ; $(g).set-rule-name gcc.link.dll ; generators.register $(g) ; @@ -831,9 +837,6 @@ toolset.flags gcc.link OPTIONS norecover : -fsanitize=undef toolset.flags gcc.link OPTIONS on : --coverage ; -toolset.flags gcc.link.dll .IMPLIB-COMMAND windows : "-Wl,--out-implib," ; -toolset.flags gcc.link.dll .IMPLIB-COMMAND cygwin : "-Wl,--out-implib," ; - # target specific link flags { # aix @@ -871,6 +874,10 @@ toolset.flags gcc.link.dll .IMPLIB-COMMAND cygwin : "-Wl,--out-implib # This does not support -R. toolset.flags gcc.link RPATH_OPTION darwin : -rpath ; # -rpath-link is not supported at all. + toolset.flags gcc.link SHARED_OPTION darwin : -dynamiclib -single_module ; + toolset.flags gcc.link HAVE_SONAME darwin : "" ; + toolset.flags gcc.link SONAME_OPTION darwin : -install_name ; + toolset.flags gcc.link SONAME_PREFIX darwin : @rpath/ ; # See note [1] toolset.flags gcc.link OPTIONS darwin/static : -static ; @@ -943,8 +950,9 @@ toolset.flags gcc.link.dll .IMPLIB-COMMAND cygwin : "-Wl,--out-implib toolset.flags gcc.link FINDLIBS-SA-PFX windows/static : -Wl,-Bdynamic ; toolset.flags gcc.link OPTIONS windows/static : -Wl,-Bstatic ; - toolset.flags gcc.link HAVE_SONAME $(generic-os) : "" ; - toolset.flags gcc.link SONAME_OPTION $(generic-os) : -h ; + local soname-os = [ set.difference $(generic-os) : windows ] ; + toolset.flags gcc.link HAVE_SONAME $(soname-os) : "" ; + toolset.flags gcc.link SONAME_OPTION $(soname-os) : -soname ; # See note [1] toolset.flags gcc.link OPTIONS $(generic-os)/static : -static ; @@ -1025,34 +1033,14 @@ rule link.dll ( targets * : sources * : properties * ) quote-rpath $(targets) ; } -rule link.mingw ( targets * : sources * : properties * ) -{ - SPACE on $(targets) = " " ; -} - -rule link.dll.mingw ( targets * : sources * : properties * ) -{ - SPACE on $(targets) = " " ; -} - -actions link.mingw bind LIBRARIES -{ - "$(CONFIG_COMMAND)" -L"$(LINKPATH)" -o "$(<)" @($(<:T).rsp:O=FC:<=@":>=":E=$(START-GROUP) "$(>:T)" "$(LIBRARIES:T)" $(FINDLIBS-ST-PFX:T) -l$(FINDLIBS-ST:T) $(FINDLIBS-SA-PFX:T) -l$(FINDLIBS-SA:T) $(END-GROUP)) $(OPTIONS) $(USER_OPTIONS) -} - -actions link.dll.mingw bind LIBRARIES -{ - "$(CONFIG_COMMAND)" -L"$(LINKPATH)" "$(.IMPLIB-COMMAND)$(<[1])" -o "$(<[-1])" -shared @($(<[-1]:T).rsp:O=FC:<=@":>=":E=$(START-GROUP) "$(>:T)" "$(LIBRARIES:T)" $(FINDLIBS-ST-PFX:T) -l$(FINDLIBS-ST:T) $(FINDLIBS-SA-PFX:T) -l$(FINDLIBS-SA:T) $(END-GROUP)) $(OPTIONS) $(USER_OPTIONS) -} - actions link bind LIBRARIES { - "$(CONFIG_COMMAND)" -L"$(LINKPATH)" -Wl,$(RPATH_OPTION:E=-R)$(SPACE)-Wl,$(RPATH) -Wl,-rpath-link$(SPACE)-Wl,"$(RPATH_LINK)" -o "$(<)" $(START-GROUP) "$(>:T)" "$(LIBRARIES)" $(FINDLIBS-ST-PFX) -l$(FINDLIBS-ST) $(FINDLIBS-SA-PFX) -l$(FINDLIBS-SA) $(END-GROUP) $(OPTIONS) $(USER_OPTIONS) + "$(CONFIG_COMMAND)" @($(<[1]:T).rsp:O=FC:<=@":>=":E=-L"$(LINKPATH)" -Wl,$(RPATH_OPTION:E=-R)$(SPACE)-Wl,$(RPATH) -Wl,-rpath-link$(SPACE)-Wl,"$(RPATH_LINK)" -o "$(<)" $(START-GROUP) "$(>:T)" "$(LIBRARIES)" $(FINDLIBS-ST-PFX) -l$(FINDLIBS-ST) $(FINDLIBS-SA-PFX) -l$(FINDLIBS-SA) $(END-GROUP) $(OPTIONS) $(USER_OPTIONS)) } actions link.dll bind LIBRARIES { - "$(CONFIG_COMMAND)" -L"$(LINKPATH)" -Wl,$(RPATH_OPTION:E=-R)$(SPACE)-Wl,$(RPATH) "$(.IMPLIB-COMMAND)$(<[1])" -o "$(<[-1])" $(HAVE_SONAME)-Wl,$(SONAME_OPTION)$(SPACE)-Wl,$(<[-1]:D=) -shared $(START-GROUP) "$(>:T)" "$(LIBRARIES)" $(FINDLIBS-ST-PFX) -l$(FINDLIBS-ST) $(FINDLIBS-SA-PFX) -l$(FINDLIBS-SA) $(END-GROUP) $(OPTIONS) $(USER_OPTIONS) + "$(CONFIG_COMMAND)" @($(<[1]:T).rsp:O=FC:<=@":>=":E=-L"$(LINKPATH)" -Wl,$(RPATH_OPTION:E=-R)$(SPACE)-Wl,$(RPATH) -Wl,$(IMPLIB_OPTION:E=--out-implib),"$(<[2])" -o "$(<[1])" $(HAVE_SONAME)-Wl,$(SONAME_OPTION)$(SPACE)-Wl,"$(SONAME_PREFIX:E=)$(<[1]:D=)" $(SHARED_OPTION:E=-shared) $(START-GROUP) "$(>:T)" "$(LIBRARIES)" $(FINDLIBS-ST-PFX) -l$(FINDLIBS-ST) $(FINDLIBS-SA-PFX) -l$(FINDLIBS-SA) $(END-GROUP) $(OPTIONS) $(USER_OPTIONS)) } ### diff --git a/src/tools/generators/c-preprocessing-generator.jam b/src/tools/generators/c-preprocessing-generator.jam new file mode 100644 index 0000000000..fcf5bedf30 --- /dev/null +++ b/src/tools/generators/c-preprocessing-generator.jam @@ -0,0 +1,52 @@ +# Copyright 2023 Nikita Kniazev +# Distributed under the Boost Software License, Version 1.0. +# (See accompanying file LICENSE.txt or copy at +# https://www.bfgroup.xyz/b2/LICENSE.txt) + +# Preprocess a source file with C preprocessor + +# TODO: Is it possible to not run preprocessor when no directives detected? + +import "class" : new ; +import generators ; + +class C-preprocessing-generator : generator +{ + rule __init__ ( id : source-type : target-type : requirements * ) + { + # Non-composing, single type enforces single input source requirement + generator.__init__ $(id) : $(source-type) + : $(target-type) : $(requirements) ; + } + + rule action ( source : property-set : project name ) + { + # Pretend it's a C source + local source-as-C = [ $(source).clone-with-different-type C ] ; + # GCC defines __ASSEMBLER__ during asm preprocessing + property-set = [ $(property-set).add-raw __ASSEMBLER__ ] ; + # TODO: provide a generic way to do such things? + if $(self.target-types-and-names) = ASM + { + # TODO: detect assemblers that support linemarkers like armasm + property-set = [ $(property-set).refine + [ property-set.create off ] ] ; + } + # Find a C preprocessor + local preprocessor = [ generators.construct $(project) $(name) + : PREPROCESSED_C : $(property-set) : $(source-as-C) ] ; + if ! $(preprocessor) + { + return ; + } + # Clone preprocessor action with our source and target + local preproc-action = [ $(preprocessor[2]).action ] ; + local action-class = [ modules.peek $(preproc-action) : __class__ ] ; + local rule-name = [ $(preproc-action).action-name ] ; + return [ class.new $(action-class) $(source) + : $(rule-name) : $(property-set) ] ; + } +} + +generators.register + [ new C-preprocessing-generator builtin.preprocess-asm : ASM_CPP : ASM ] ; diff --git a/src/tools/hp_cxx.jam b/src/tools/hp_cxx.jam index 33514a0027..5e664241ed 100644 --- a/src/tools/hp_cxx.jam +++ b/src/tools/hp_cxx.jam @@ -78,10 +78,6 @@ feature.extend c++abi : cxxarm ; # Inherit from Unix toolset to get library ordering magic. toolset.inherit hp_cxx : unix ; -generators.override hp_cxx.prebuilt : builtin.lib-generator ; -generators.override hp_cxx.prebuilt : builtin.prebuilt ; -generators.override hp_cxx.searched-lib-generator : searched-lib-generator ; - rule init ( version ? : command * : options * ) { diff --git a/src/tools/intel-darwin.jam b/src/tools/intel-darwin.jam index adb0b9658a..b5e16da7c7 100644 --- a/src/tools/intel-darwin.jam +++ b/src/tools/intel-darwin.jam @@ -24,10 +24,6 @@ toolset.inherit-generators intel-darwin : gcc.mingw.link gcc.mingw.link.dll gcc.compile.c.pch gcc.compile.c++.pch ; -generators.override intel-darwin.prebuilt : builtin.lib-generator ; -generators.override intel-darwin.prebuilt : builtin.prebuilt ; -generators.override intel-darwin.searched-lib-generator : searched-lib-generator ; - toolset.inherit-rules intel-darwin : gcc ; toolset.inherit-flags intel-darwin : gcc : off on full space diff --git a/src/tools/intel-linux.jam b/src/tools/intel-linux.jam index f1a881a4a6..3d3cdb54de 100644 --- a/src/tools/intel-linux.jam +++ b/src/tools/intel-linux.jam @@ -24,13 +24,6 @@ feature.extend-subfeature toolset intel : platform : linux ; toolset.inherit-generators intel-linux intel linux : gcc : gcc.mingw.link gcc.mingw.link.dll ; -generators.override intel-linux.prebuilt : builtin.lib-generator ; -generators.override intel-linux.prebuilt : builtin.prebuilt ; -generators.override intel-linux.searched-lib-generator : searched-lib-generator ; - -# Override default do-nothing generators. -generators.override intel-linux.compile.c.pch : pch.default-c-pch-generator ; -generators.override intel-linux.compile.c++.pch : pch.default-cpp-pch-generator ; type.set-generated-target-suffix PCH : intel linux : pchi ; diff --git a/src/tools/intel-vxworks.jam b/src/tools/intel-vxworks.jam index e9d51b7663..e0c27d66c3 100644 --- a/src/tools/intel-vxworks.jam +++ b/src/tools/intel-vxworks.jam @@ -23,10 +23,6 @@ toolset.inherit-generators intel-vxworks : gcc.mingw.link gcc.mingw.link.dll gcc.compile.c.pch gcc.compile.c++.pch ; -generators.override intel-vxworks.prebuilt : builtin.lib-generator ; -generators.override intel-vxworks.prebuilt : builtin.prebuilt ; -generators.override intel-vxworks.searched-lib-generator : searched-lib-generator ; - toolset.inherit-rules intel-vxworks : gcc ; toolset.inherit-flags intel-vxworks : gcc : off on full space diff --git a/src/tools/intel-win.jam b/src/tools/intel-win.jam index d74c9f4970..0eedc51e78 100644 --- a/src/tools/intel-win.jam +++ b/src/tools/intel-win.jam @@ -25,12 +25,6 @@ toolset.inherit-generators intel-win intel win toolset.inherit-flags intel-win : msvc : : YLOPTION ; toolset.inherit-rules intel-win : msvc ; -# Override default do-nothing generators. -generators.override intel-win.compile.c.pch : pch.default-c-pch-generator ; -generators.override intel-win.compile.c++.pch : pch.default-cpp-pch-generator ; -generators.override intel-win.compile.rc : rc.compile.resource ; -generators.override intel-win.compile.mc : mc.compile ; - toolset.flags intel-win.compile PCH_SOURCE on : ; toolset.add-requirements intel-win,shared:multi ; diff --git a/src/tools/link.jam b/src/tools/link.jam index e9e8851fe6..fa4070e349 100644 --- a/src/tools/link.jam +++ b/src/tools/link.jam @@ -229,8 +229,8 @@ class symlink-target-class : basic-target rule do-file-link { - local target = [ path.native [ path.relative-to [ path.pwd ] $(<) ] ] ; - local source = [ path.native [ path.relative-to [ path.pwd ] $(>) ] ] ; + local target = [ path.relative-to [ path.pwd ] $(<) ] ; + local source = [ path.relative-to [ path.pwd ] $(>) ] ; local old-source = [ on $(target) return $(LINK-SOURCE) ] ; if $(old-source) { @@ -240,6 +240,8 @@ rule do-file-link Link previously defined to another file, $(old-source[1]). ; } LINK-SOURCE on $(target) = $(source) $(.current-target) ; + target = [ path.native $(target) ] ; + source = [ path.native $(source) ] ; LOCATE on $(target) = . ; DEPENDS $(.current-target) : $(target) ; if $(.can-symlink) = true diff --git a/src/tools/mipspro.jam b/src/tools/mipspro.jam index 095334e39c..afd3f6591b 100644 --- a/src/tools/mipspro.jam +++ b/src/tools/mipspro.jam @@ -14,8 +14,6 @@ import common ; feature.extend toolset : mipspro ; toolset.inherit mipspro : unix ; -generators.override mipspro.prebuilt : builtin.lib-generator ; -generators.override mipspro.searched-lib-generator : searched-lib-generator ; # Documentation and toolchain description located # http://www.sgi.com/products/software/irix/tools/ diff --git a/src/tools/msvc.jam b/src/tools/msvc.jam index 447187249a..2e481d4f06 100644 --- a/src/tools/msvc.jam +++ b/src/tools/msvc.jam @@ -689,7 +689,7 @@ rule compile.c ( targets + : sources * : properties * ) { set-setup-command $(targets) : $(properties) ; get-rspline $(targets) : -TC CFLAGS ; - compile-c-c++ $(<) : $(>) [ on $(<) return $(PCH_FILE) ] [ on $(<) return $(PCH_HEADER) ] ; + compile-c-c++ $(<) : $(>) ; } @@ -697,7 +697,7 @@ rule compile.c.preprocess ( targets + : sources * : properties * ) { set-setup-command $(targets) : $(properties) ; get-rspline $(targets) : -TC CFLAGS ; - preprocess-c-c++ $(<) : $(>) [ on $(<) return $(PCH_FILE) ] [ on $(<) return $(PCH_HEADER) ] ; + preprocess-c-c++ $(<) : $(>) ; } @@ -706,6 +706,8 @@ rule compile.c.pch ( targets + : sources * : properties * ) set-setup-command $(targets) : $(properties) ; get-rspline $(targets[1]) : -TC CFLAGS ; get-rspline $(targets[2]) : -TC CFLAGS ; + local pch-header = [ on $(<) return $(PCH_HEADER) ] ; + PCH_HEADER_AS_SPELLED on $(<) = $(sources:G=) ; local pch-source = [ on $(<) return $(PCH_SOURCE) ] ; if $(pch-source) { @@ -738,14 +740,14 @@ toolset.flags msvc YLOPTION : "-Yl" ; # for each source file by rule archive, as in this case compiler must be used # to create a single PDB for our library. # -actions compile-c-c++ bind PDB_NAME PCH_HEADER +actions compile-c-c++ bind PDB_NAME PCH_HEADER_AS_SPELLED PCH_FILE { - $(.SETUP) $(.CC) @($(<[1]:W).rsp:O=FC:<=@":>=":E="$(>[1]:W)" -c -Fo"$(<[1]:W)" $(PDB_CFLAG)"$(PDB_NAME)" -I"$(PCH_HEADER:D)" -FI"$(PCH_HEADER:D=)" -Yu"$(>[3]:D=)" -Fp"$(>[2]:W)" $(CC_RSPLINE)) $(.CC.FILTER) + $(.SETUP) $(.CC) @($(<[1]:W).rsp:O=FC:<=@":>=":E="$(>[1]:W)" -c -Fo"$(<[1]:W)" $(PDB_CFLAG)"$(PDB_NAME)" -FI"$(PCH_HEADER_AS_SPELLED:T)" -Yu"$(PCH_HEADER_AS_SPELLED:T)" -Fp"$(PCH_FILE:W)" $(CC_RSPLINE)) $(.CC.FILTER) } -actions preprocess-c-c++ bind PDB_NAME PCH_HEADER +actions preprocess-c-c++ bind PDB_NAME PCH_HEADER_AS_SPELLED PCH_FILE { - $(.SETUP) $(.CC) @($(<[1]:W).rsp:O=FC:<=@":>=":E="$(>[1]:W)" -P -Fi"$(<[1]:W)" $(PDB_CFLAG)"$(PDB_NAME)" -I"$(PCH_HEADER:D)" -FI"$(PCH_HEADER:D=)" -Yu"$(>[3]:D=)" -Fp"$(>[2]:W)" $(CC_RSPLINE)) + $(.SETUP) $(.CC) @($(<[1]:W).rsp:O=FC:<=@":>=":E="$(>[1]:W)" -P -Fi"$(<[1]:W)" $(PDB_CFLAG)"$(PDB_NAME)" -FI"$(PCH_HEADER_AS_SPELLED:T)" -Yu"$(PCH_HEADER_AS_SPELLED:T)" -Fp"$(PCH_FILE:W)" $(CC_RSPLINE)) } rule compile-c-c++ ( targets + : sources * ) @@ -754,6 +756,8 @@ rule compile-c-c++ ( targets + : sources * ) DEPENDS $(<[1]) : [ on $(<[1]) return $(PCH_FILE) ] ; PDB_NAME on $(<) = $(<[1]:S=.pdb) ; LOCATE on $(<[1]:S=.pdb) = [ on $(<[1]) return $(LOCATE) ] ; + local pch-header = [ on $(<[1]) return $(PCH_HEADER) ] ; + PCH_HEADER_AS_SPELLED on $(<[1]) = $(pch-header:G=) ; } rule preprocess-c-c++ ( targets + : sources * ) @@ -762,6 +766,8 @@ rule preprocess-c-c++ ( targets + : sources * ) DEPENDS $(<[1]) : [ on $(<[1]) return $(PCH_FILE) ] ; PDB_NAME on $(<) = $(<:S=.pdb) ; LOCATE on $(<[1]:S=.pdb) = [ on $(<[1]) return $(LOCATE) ] ; + local pch-header = [ on $(<[1]) return $(PCH_HEADER) ] ; + PCH_HEADER_AS_SPELLED on $(<[1]) = $(pch-header:G=) ; } # Action for running the C/C++ compiler using precompiled headers. In addition @@ -770,18 +776,18 @@ rule preprocess-c-c++ ( targets + : sources * ) # # The global .escaped-double-quote variable is used to avoid messing up Emacs # syntax highlighting in the messy N-quoted code below. -actions compile-c-c++-pch +actions compile-c-c++-pch bind PCH_HEADER_AS_SPELLED { - $(.SETUP) $(.CC) @($(<[1]:W).rsp:O=FC:<=@":>=":E="$(>[2]:W)" -c -Fo"$(<[2]:W)" -I"$(>[1]:D)" -Yc"$(>[1]:D=)" $(YLOPTION)"__bjam_pch_symbol_$(>[1]:D=)" -Fp"$(<[1]:W)" $(CC_RSPLINE)) @($(<[1]:W).cpp:<=":>=":E=$(.hash)include $(.escaped-double-quote)$(>[1]:D=)$(.escaped-double-quote)$(.nl)) $(.CC.FILTER) + $(.SETUP) $(.CC) @($(<[1]:W).rsp:O=FC:<=@":>=":E="$(>[2]:W)" -c -Fo"$(<[2]:W)" -Yc"$(PCH_HEADER_AS_SPELLED:T)" $(YLOPTION)"__bjam_pch_symbol_$(>[1]:D=)" -Fp"$(<[1]:W)" $(CC_RSPLINE)) @($(<[1]:W).cpp:<=":>=":E=$(.hash)include $(.escaped-double-quote)$(PCH_HEADER_AS_SPELLED:T)$(.escaped-double-quote)$(.nl)) $(.CC.FILTER) } # Action for running the C/C++ compiler using precompiled headers. An already # built source file for compiling the precompiled headers is expected to be # given as one of the source parameters. -actions compile-c-c++-pch-s +actions compile-c-c++-pch-s bind PCH_HEADER_AS_SPELLED { - $(.SETUP) $(.CC) @($(<[1]:W).rsp:O=FC:<=@":>=":E="$(>[2]:W)" -c -Fo"$(<[2]:W)" -I"$(>[1]:D)" -Yc"$(>[1]:D=)" $(YLOPTION)"__bjam_pch_symbol_$(>[1]:D=)" -Fp"$(<[1]:W)" $(CC_RSPLINE)) $(.CC.FILTER) + $(.SETUP) $(.CC) @($(<[1]:W).rsp:O=FC:<=@":>=":E="$(>[2]:W)" -c -Fo"$(<[2]:W)" -Yc"$(PCH_HEADER_AS_SPELLED:T)" $(YLOPTION)"__bjam_pch_symbol_$(>[1]:D=)" -Fp"$(<[1]:W)" $(CC_RSPLINE)) $(.CC.FILTER) } @@ -789,14 +795,14 @@ rule compile.c++ ( targets + : sources * : properties * ) { set-setup-command $(targets) : $(properties) ; get-rspline $(targets) : -TP C++FLAGS ; - compile-c-c++ $(<) : $(>) [ on $(<) return $(PCH_FILE) ] [ on $(<) return $(PCH_HEADER) ] ; + compile-c-c++ $(<) : $(>) ; } rule compile.c++.preprocess ( targets + : sources * : properties * ) { set-setup-command $(targets) : $(properties) ; get-rspline $(targets) : -TP C++FLAGS ; - preprocess-c-c++ $(<) : $(>) [ on $(<) return $(PCH_FILE) ] [ on $(<) return $(PCH_HEADER) ] ; + preprocess-c-c++ $(<) : $(>) ; } @@ -805,6 +811,8 @@ rule compile.c++.pch ( targets + : sources * : properties * ) set-setup-command $(targets) : $(properties) ; get-rspline $(targets[1]) : -TP C++FLAGS ; get-rspline $(targets[2]) : -TP C++FLAGS ; + local pch-header = [ on $(<) return $(PCH_HEADER) ] ; + PCH_HEADER_AS_SPELLED on $(<) = $(sources:G=) ; local pch-source = [ on $(<) return $(PCH_SOURCE) ] ; if $(pch-source) { @@ -1005,6 +1013,7 @@ class msvc-pch-generator : pch-generator # If we do not have the PCH source - that is fine. We will just create a # temporary .cpp file in the action. + local pch-header-root = [ $(pch-header).path ] ; local generated = [ generator.run $(project) $(name) : [ property-set.create # Passing of is a dirty trick, needed because @@ -1012,6 +1021,8 @@ class msvc-pch-generator : pch-generator # broken. For more detailed information see: # https://zigzag.cs.msu.su:7813/boost.build/ticket/111 $(pch-source) + $(pch-header) + $(pch-header-root) [ $(property-set).raw ] ] : $(pch-header) ] ; @@ -1025,6 +1036,7 @@ class msvc-pch-generator : pch-generator } return [ $(generated[1]).add-raw $(pch-header) + $(pch-header-root) $(pch-file) ] $(generated[2-]) ; } } @@ -1063,6 +1075,10 @@ local rule auto-detect-toolset-versions ( ) register-configuration $(i) : [ path.native $(vc-path[1]) ] ; } } + else + { + register-configuration $(i) : [ default-path $(i) ] ; + } } } @@ -1801,56 +1817,36 @@ rule get-rspline ( target : lang-opt lang-flags ) class msvc-linking-generator : linking-generator { - # Calls the base version. If necessary, also create a target for the - # manifest file.specifying source's name as the name of the created - # target. As result, the PCH will be named whatever.hpp.gch, and not - # whatever.gch. - rule generated-targets ( sources + : property-set : project name ? ) + # Linking may produce additional targets which needs registration + # to be copied by stage (install) step. + rule additional-targets-produced ( sources + : property-set + : project name action : targets + ) { - local result = [ linking-generator.generated-targets $(sources) - : $(property-set) : $(project) $(name) ] ; + local result ; + local name-main = [ $(targets[1]).name ] ; - if $(result) + if [ $(property-set).get ] = "on" { - local name-main = [ $(result[1]).name ] ; - local action = [ $(result[1]).action ] ; - - if [ $(property-set).get ] = "on" - { - # We force the exact name on PDB. The reason is tagging -- the - # tag rule may reasonably special case some target types, like - # SHARED_LIB. The tag rule will not catch PDBs, and it cannot - # even easily figure out if a PDB is paired with a SHARED_LIB, - # EXE or something else. Because PDBs always get the same name - # as the main target, with .pdb as extension, just force it. - local target = [ class.new file-target $(name-main:S=.pdb) exact - : PDB : $(project) : $(action) ] ; - local registered-target = [ virtual-target.register $(target) ] - ; - if $(target) != $(registered-target) - { - $(action).replace-targets $(target) : $(registered-target) ; - } - result += $(registered-target) ; - } + # We force the exact name on PDB. The reason is tagging -- the + # tag rule may reasonably special case some target types, like + # SHARED_LIB. The tag rule will not catch PDBs, and it cannot + # even easily figure out if a PDB is paired with a SHARED_LIB, + # EXE or something else. Because PDBs always get the same name + # as the main target, with .pdb as extension, just force it. + result += [ class.new file-target $(name-main:S=.pdb) exact + : PDB : $(project) : $(action) ] ; + } - if [ $(property-set).get ] = "off" - { - # Manifest is an evil target. It has .manifest appened to the - # name of the main target, including extension, e.g. - # a.exe.manifest. We use the 'exact' name to achieve this - # effect. - local target = [ class.new file-target $(name-main).manifest - exact : MANIFEST : $(project) : $(action) ] ; - local registered-target = [ virtual-target.register $(target) ] - ; - if $(target) != $(registered-target) - { - $(action).replace-targets $(target) : $(registered-target) ; - } - result += $(registered-target) ; - } + if [ $(property-set).get ] = "off" + { + # Manifest is an evil target. It has .manifest appened to the + # name of the main target, including extension, e.g. + # a.exe.manifest. We use the 'exact' name to achieve this + # effect. + result += [ class.new file-target $(name-main).manifest exact + : MANIFEST : $(project) : $(action) ] ; } + return $(result) ; } } @@ -1961,6 +1957,9 @@ local rule register-toolset-really ( ) toolset.flags msvc.compile C++FLAGS 20 : "/std:c++20" ; toolset.flags msvc.compile C++FLAGS latest : "/std:c++latest" ; + toolset.flags msvc.compile.c.preprocess OPTIONS off : -EP ; + toolset.flags msvc.compile.c++.preprocess OPTIONS off : -EP ; + # By default 8.0 enables rtti support while prior versions disabled it. We # simply enable or disable it explicitly so we do not have to depend on this # default behaviour. diff --git a/src/tools/openssl.jam b/src/tools/openssl.jam index 984f9100a5..553dabd6f0 100644 --- a/src/tools/openssl.jam +++ b/src/tools/openssl.jam @@ -43,8 +43,10 @@ if --debug-configuration in [ modules.peek : ARGV ] # # # The directory containing the openssl binaries. -# -# Overrides the default library name. +# +# Overrides the default name of ssl library. +# +# Overrides the default name of crypto library. # # The directory containing the openssl headers. # @@ -86,9 +88,10 @@ rule init ( local library-path = [ feature.get-values : $(options) ] ; local include-path = [ feature.get-values : $(options) ] ; - local library-name = [ feature.get-values : $(options) ] ; + local ssl-name = [ feature.get-values : $(options) ] ; + local crypto-name = [ feature.get-values : $(options) ] ; - if ! $(library-path) && ! $(include-path) && ! $(source-path) && ! $(library-name) + if ! $(library-path) && ! $(include-path) && ! $(source-path) && ! $(ssl-name) && ! $(crypto-name) { is-default = true ; } @@ -122,15 +125,18 @@ rule init ( } } + ssl-name ?= $(ssl_names) ; + crypto-name ?= $(crypto_names) ; + local ssl_lib = [ new ac-library ssl : $(.project) : $(condition) : - $(include-path) : $(library-path) : ssl ] ; + $(include-path) : $(library-path) ] ; $(ssl_lib).set-header openssl/ssl.h ; - $(ssl_lib).set-default-names $(ssl_names) ; + $(ssl_lib).set-default-names $(ssl-name) ; local crypto_lib = [ new ac-library crypto : $(.project) : $(condition) : - $(include-path) : $(library-path) : crypto ] ; + $(include-path) : $(library-path) ] ; $(crypto_lib).set-header openssl/crypto.h ; - $(crypto_lib).set-default-names $(crypto_names) ; + $(crypto_lib).set-default-names $(crypto-name) ; targets.main-target-alternative $(ssl_lib) ; targets.main-target-alternative $(crypto_lib) ; diff --git a/src/tools/pathscale.jam b/src/tools/pathscale.jam index 83ce395bc2..fc77768ea0 100644 --- a/src/tools/pathscale.jam +++ b/src/tools/pathscale.jam @@ -14,8 +14,6 @@ import fortran ; feature.extend toolset : pathscale ; toolset.inherit pathscale : unix ; -generators.override pathscale.prebuilt : builtin.prebuilt ; -generators.override pathscale.searched-lib-generator : searched-lib-generator ; # Documentation and toolchain description located # http://www.pathscale.com/docs.html diff --git a/src/tools/pgi.jam b/src/tools/pgi.jam index 7d4994ef57..c18062e521 100644 --- a/src/tools/pgi.jam +++ b/src/tools/pgi.jam @@ -16,8 +16,6 @@ import gcc ; feature.extend toolset : pgi ; toolset.inherit pgi : unix ; -generators.override pgi.prebuilt : builtin.lib-generator ; -generators.override pgi.searched-lib-generator : searched-lib-generator ; # Documentation and toolchain description located # http://www.pgroup.com/resources/docs.htm diff --git a/src/tools/qcc.jam b/src/tools/qcc.jam index 6ad4067014..96f927f4b8 100644 --- a/src/tools/qcc.jam +++ b/src/tools/qcc.jam @@ -38,7 +38,7 @@ toolset.inherit-rules qcc : unix ; rule init ( version ? : command * : options * ) { local condition = [ common.check-init-parameters qcc : version $(version) ] ; - local command = [ common.get-invocation-command qcc : QCC : $(command) ] ; + local command = [ common.get-invocation-command qcc : qcc : $(command) ] ; common.handle-options qcc : $(condition) : $(command) : $(options) ; } @@ -212,9 +212,6 @@ generators.register [ new qcc-linking-generator qcc.link : LIB OBJ : EXE generators.register [ new qcc-linking-generator qcc.link.dll : LIB OBJ : SHARED_LIB : qcc ] ; -generators.override qcc.prebuilt : builtin.prebuilt ; -generators.override qcc.searched-lib-generator : searched-lib-generator ; - # Declare flags for linking. # First, the common flags. diff --git a/src/tools/sun.jam b/src/tools/sun.jam index a5a19089d4..50b74abfbf 100644 --- a/src/tools/sun.jam +++ b/src/tools/sun.jam @@ -69,9 +69,6 @@ import common ; feature.extend toolset : sun ; toolset.inherit sun : unix ; -generators.override sun.prebuilt : builtin.lib-generator ; -generators.override sun.prebuilt : builtin.prebuilt ; -generators.override sun.searched-lib-generator : searched-lib-generator ; rule init ( version ? : command * : options * ) diff --git a/src/tools/testing.jam b/src/tools/testing.jam index ed24912e46..5945597229 100644 --- a/src/tools/testing.jam +++ b/src/tools/testing.jam @@ -348,6 +348,28 @@ local rule register-fail-expected ( source-type : test-type ) testing.expect-failure : $(source-type) : $(test-type) ] ; } +class capture-output-generator : generator +{ + import generators ; + + rule run ( project name ? : property-set : sources + ) + { + local result = [ generator.run $(project) $(name) : $(property-set) + : $(sources) ] ; + + if $(result) && [ $(property-set).get ] = off + { + # skip self and dependants but still build dependencies + local action = [ $(result[2]).action ] ; + local exe = [ $(action).sources ] ; + DEPENDS all : [ $(exe).actualize ] ; + return [ property-set.create no ] $(result[2-]) ; + } + + return $(result) ; + } +} + # Register generators. Depending on target type, either 'expect-success' or # 'expect-failure' rule will be used. generators.register-standard testing.expect-success : OBJ : COMPILE ; @@ -358,7 +380,7 @@ generators.register-standard testing.expect-success : EXE : LINK register-fail-expected EXE : LINK_FAIL ; # Generator which runs an EXE and captures output. -generators.register-standard testing.capture-output : EXE : RUN_OUTPUT ; +generators.register [ class.new capture-output-generator testing.capture-output : EXE : RUN_OUTPUT ] ; # Generator which creates a target if sources run successfully. Differs from RUN # in that run output is not captured. The reason why it exists is that the 'run' @@ -525,12 +547,6 @@ rule capture-output ( target : source : properties * ) run-path-setup $(target) : $(source) : $(properties) ; - DISABLE_TEST_EXECUTION on $(target) = 0 ; - if [ feature.get-values testing.execute : $(properties) ] = off - { - DISABLE_TEST_EXECUTION on $(target) = 1 ; - } - if ! [ feature.get-values testing.launcher : $(properties) ] { ## On VMS set default launcher to MCR @@ -640,11 +656,6 @@ if --verbose-test in [ modules.peek : ARGV ] actions capture-output bind INPUT_FILES output-file { $(PATH_SETUP) - $(.SHELL_SET)status=$(DISABLE_TEST_EXECUTION) - if $(.STATUS_NOT_0) - echo Skipping test execution due to testing.execute=off - exit $(.EXIT_SUCCESS) - $(.ENDIF) $(LAUNCHER) "$(>)" $(ARGS) "$(INPUT_FILES)" > "$(output-file)" 2>&1 $(.NULLIN) $(.SET_STATUS) $(.RUN_OUTPUT_NL) >> "$(output-file)" @@ -675,11 +686,6 @@ if [ os.name ] = VMS actions capture-output bind INPUT_FILES output-file { $(PATH_SETUP) - $(.SHELL_SET)status=$(DISABLE_TEST_EXECUTION) - if $(.STATUS_NOT_0) - $(.SAY) "Skipping test execution due to testing.execute=off" - exit "$(.EXIT_SUCCESS)" - $(.ENDIF) !! Execute twice - first for status, second for output set noon pipe $(LAUNCHER) $(>:W) $(ARGS) $(INPUT_FILES:W) 2>NL: >NL: diff --git a/src/tools/types/asm.jam b/src/tools/types/asm.jam index d2b233acaf..65ffa8fa2b 100644 --- a/src/tools/types/asm.jam +++ b/src/tools/types/asm.jam @@ -1,4 +1,14 @@ # Copyright Craig Rodrigues 2005. Distributed under the Boost # Software License, Version 1.0. (See accompanying # file LICENSE.txt or copy at https://www.bfgroup.xyz/b2/LICENSE.txt) -type ASM : s S asm ; +import scanner ; +import type ; +import types/cpp ; + +type ASM_CPP : s S asm ; +type ASM : : ASM_CPP ; + +# FIXME: Scan for MASM/ARMASM includes +type.set-scanner ASM_CPP : c-scanner ; + +type.set-generated-target-suffix ASM : windows : asm ; diff --git a/src/tools/unix.jam b/src/tools/unix.jam index c86f089de7..25c22a8f9e 100644 --- a/src/tools/unix.jam +++ b/src/tools/unix.jam @@ -138,7 +138,7 @@ generators.register [ new unix-prebuilt-lib-generator unix.prebuilt : : LIB : unix ] ; -generators.override unix.prebuilt : builtin.lib-generator ; +generators.override unix.prebuilt : builtin.prebuilt ; # Declare generators @@ -154,6 +154,8 @@ generators.register [ new unix-linking-generator unix.link.dll : LIB OBJ : SHARE generators.register [ new unix-searched-lib-generator unix.searched-lib-generator : : SEARCHED_LIB : unix ] ; +generators.override unix.searched-lib-generator : searched-lib-generator ; + # The derived toolset must specify their own actions. actions link { diff --git a/src/tools/vacpp.jam b/src/tools/vacpp.jam index b7d2e2de7a..b6930447b9 100644 --- a/src/tools/vacpp.jam +++ b/src/tools/vacpp.jam @@ -39,8 +39,6 @@ import os ; feature.extend toolset : vacpp ; toolset.inherit vacpp : unix ; -generators.override vacpp.prebuilt : builtin.prebuilt ; -generators.override vacpp.searched-lib-generator : searched-lib-generator ; # Configure the vacpp toolset rule init ( version ? : command * : options * ) diff --git a/src/tools/vmsdecc.jam b/src/tools/vmsdecc.jam index a4007f7224..350e5a9603 100644 --- a/src/tools/vmsdecc.jam +++ b/src/tools/vmsdecc.jam @@ -30,10 +30,6 @@ toolset.inherit-generators vmsdecc : unix : unix.link unix.link.dll ; toolset.inherit-flags vmsdecc : unix ; toolset.inherit-rules vmsdecc : unix ; -generators.override vmsdecc.archive-generator : builtin.archive-generator ; -generators.override vmsdecc.prebuilt : builtin.prebuilt ; -generators.override vmsdecc.searched-lib-generator : searched-lib-generator ; - type.set-generated-target-suffix EXE : vmsdecc vms : exe ; type.set-generated-target-suffix OBJ : vmsdecc vms : obj ; type.set-generated-target-suffix PREPROCESSED_C : vmsdecc vms : i ; @@ -98,6 +94,9 @@ flags vmsdecc.compile OPTIONS pedantic : /WARN=ENABLE=ALL ; flags vmsdecc.compile.c++ OPTIONS off : /OPT=NOINLINE ; +flags vmsdecc.compile.c.preprocess OPTIONS off : /NOLINE_DIRECTIVES ; +flags vmsdecc.compile.c++.preprocess OPTIONS off : /NOLINE_DIRECTIVES ; + flags vmsdecc OPTIONS 32 : /POINTER=32 ; flags vmsdecc OPTIONS 64 : /POINTER=64 ; ## /POINTER=64=ARGV argv-64 diff --git a/src/tools/xlcpp.jam b/src/tools/xlcpp.jam index 03082e2944..7d3c601c43 100644 --- a/src/tools/xlcpp.jam +++ b/src/tools/xlcpp.jam @@ -17,8 +17,6 @@ import os ; feature.extend toolset : xlcpp ; toolset.inherit xlcpp : unix ; -generators.override xlcpp.prebuilt : builtin.prebuilt ; -generators.override xlcpp.searched-lib-generator : searched-lib-generator ; # Configure the xlcpp toolset rule init ( version ? : command * : options * ) diff --git a/src/util/doc.jam b/src/util/doc.jam index 35c968e841..356dbe467c 100644 --- a/src/util/doc.jam +++ b/src/util/doc.jam @@ -270,6 +270,7 @@ local rule print-help-top ( ) print.list-item "-d0 Suppress all informational messages" ; print.list-item "-q Stop at first error" ; print.list-item "--reconfigure Rerun all configuration checks" ; + print.list-item "--durations[=N] Report top N targets by execution time" ; print.list-item "--debug-configuration Diagnose configuration" ; print.list-item "--debug-building Report which targets are built with what properties" ; print.list-item "--debug-generator Diagnose generator search/execution" ; diff --git a/test/BoostBuild.py b/test/BoostBuild.py index c3e6ac2c13..bed89c8bfb 100644 --- a/test/BoostBuild.py +++ b/test/BoostBuild.py @@ -28,7 +28,7 @@ import traceback import tree import types - +from difflib import ndiff from xml.sax.saxutils import escape try: @@ -79,11 +79,11 @@ def set_defer_annotations(n): defer_annotations = n -def annotate_stack_trace(tb=None): +def annotate_stack_trace(tb=None, level=None): if tb: - trace = TestCmd.caller(traceback.extract_tb(tb), 0) + trace = TestCmd.caller(traceback.extract_tb(tb), level or 0) else: - trace = TestCmd.caller(traceback.extract_stack(), 1) + trace = TestCmd.caller(traceback.extract_stack(), level or 1) annotation("stacktrace", trace) @@ -99,16 +99,22 @@ def get_toolset(): for arg in sys.argv[1:]: if not arg.startswith("-"): toolset = arg - return toolset or "gcc" + if toolset: + return toolset -# Detect the host OS. -cygwin = hasattr(os, "uname") and os.uname()[0].lower().startswith("cygwin") -windows = cygwin or os.environ.get("OS", "").lower().startswith("windows") + if sys.platform == "win32": + return "msvc" + if sys.platform == "darwin" or sys.platform.startswith("freebsd"): + return "clang" + + return "gcc" -if cygwin: + +# Detect the host OS. +if sys.platform == "cygwin": default_os = "cygwin" -elif windows: +elif sys.platform == "win32": default_os = "windows" elif hasattr(os, "uname"): default_os = os.uname()[0].lower() @@ -149,7 +155,7 @@ def prepare_suffix_map(toolset, target_os=default_os): if target_os == "cygwin": suffixes[".lib"] = ".a" suffixes[".obj"] = ".o" - suffixes[".implib"] = ".lib.a" + suffixes[".implib"] = ".dll.a" elif target_os == "windows": if toolset == "gcc": # MinGW @@ -187,6 +193,11 @@ def prepare_library_prefix(toolset, target_os=default_os): else: dll_prefix = "lib" + global implib_prefix + implib_prefix = None + if toolset == "gcc": + implib_prefix = "lib" + def re_remove(sequence, regex): me = re.compile(regex) @@ -259,7 +270,7 @@ def __init__(self, arguments=None, executable=None, if not executable: executable = os.getenv('B2') if not executable: - executable = 'b2' if os.name != 'nt' else 'b2.exe' + executable = 'b2' if sys.platform not in ['win32', 'cygwin'] else 'b2.exe' assert arguments.__class__ is not str self.original_workdir = os.path.dirname(__file__) @@ -271,6 +282,7 @@ def __init__(self, arguments=None, executable=None, self.translate_suffixes = translate_suffixes self.use_test_config = use_test_config + self.target_os = default_os self.toolset = get_toolset() self.expanded_toolset = expand_toolset(self.toolset) self.pass_toolset = pass_toolset @@ -332,11 +344,17 @@ def cleanup(self): pass def set_toolset(self, toolset, target_os=default_os): + self.target_os = target_os self.toolset = toolset self.expanded_toolset = expand_toolset(toolset, target_os) self.pass_toolset = True prepare_prefixes_and_suffixes(toolset, target_os) + def is_implib_expected(self): + return self.target_os in ["windows", "cygwin"] and not re.match(r'^clang(-linux)?(-[\d.]+)?$', self.toolset) + + def is_pdb_expected(self): + return self.toolset == "msvc" or "-win" in self.toolset # # Methods that change the working directory's content. @@ -377,10 +395,7 @@ def rename(self, src, dst): os.rename(src_name, dst_name) def copy(self, src, dst): - try: - self.write(dst, self.read(src, binary=True)) - except: - self.fail_test(1) + self.write(dst, self.read(src, binary=True)) def copy_timestamp(self, src, dst): src_name = self.native_file_name(src) @@ -532,7 +547,7 @@ def run_build_system(self, extra_args=None, subdir="", stdout=None, stderr = self.stderr() if stderr: annotation("STDERR", stderr) - self.maybe_do_diff(self.stdout(), stdout, stdout_test) + self.do_diff(self.stdout(), stdout) self.fail_test(1, dump_stdio=False) # Intel tends to produce some messages to stderr which make tests fail. @@ -545,7 +560,7 @@ def run_build_system(self, extra_args=None, subdir="", stdout=None, annotation("Expected STDERR", stderr) annotation("Actual STDERR", self.stderr()) annotation("STDOUT", self.stdout()) - self.maybe_do_diff(actual_stderr, stderr, stderr_test) + self.do_diff(actual_stderr, stderr) self.fail_test(1, dump_stdio=False) if expected_duration is not None: @@ -556,8 +571,6 @@ def run_build_system(self, extra_args=None, subdir="", stdout=None, expected_duration)) self.fail_test(1, dump_stdio=False) - self.__ignore_junk() - def glob_file(self, name): name = self.adjust_name(name) result = None @@ -579,14 +592,15 @@ def __read(self, name, binary=False): openMode = "r" if binary: openMode += "b" - else: + elif sys.version_info[0] < 3: openMode += "U" f = open(name, openMode) result = f.read() f.close() return result - except: - annotation("failure", "Could not open '%s'" % name) + except Exception as e: + annotation("failure", "Could not open '%s': %s" % (name, e)) + annotate_stack_trace(level=3) self.fail_test(1) return "" @@ -633,7 +647,7 @@ def fail_test(self, condition, dump_difference=True, dump_stdio=True, print(" ".join(self.last_program_invocation)) if dump_stack: - annotate_stack_trace() + annotate_stack_trace(level=2) sys.exit(1) # A number of methods below check expectations with actual difference @@ -734,7 +748,7 @@ def expect_nothing(self, names): def __ignore_junk(self): # Not totally sure about this change, but I do not see a good # alternative. - if windows: + if self.target_os == "windows": self.ignore("*.ilk") # MSVC incremental linking files. self.ignore("*.pdb") # MSVC program database files. self.ignore("*.rsp") # Response files. @@ -758,6 +772,7 @@ def __ignore_junk(self): self.ignore("*.dSYM/*") def expect_nothing_more(self): + self.__ignore_junk() if not self.unexpected_difference.empty(): annotation("failure", "Unexpected changes found") output = StringIO() @@ -801,51 +816,30 @@ def sorted_(z): print(actual) self.fail_test(1) - def maybe_do_diff(self, actual, expected, result=None): - if os.environ.get("DO_DIFF"): - e = tempfile.mktemp("expected") - a = tempfile.mktemp("actual") - f = open(e, "w") - f.write(expected) - f.close() - f = open(a, "w") - f.write(actual) - f.close() - print("DIFFERENCE") - # Current diff should return 1 to indicate 'different input files' - # but some older diff versions may return 0 and depending on the - # exact Python/OS platform version, os.system() call may gobble up - # the external process's return code and return 0 itself. - if os.system('diff -u "%s" "%s"' % (e, a)) not in [0, 1]: - print('Unable to compute difference: diff -u "%s" "%s"' % (e, a - )) - os.unlink(e) - os.unlink(a) - elif type(result) is TestCmd.MatchError: - print(result.message) - else: - print("Set environmental variable 'DO_DIFF' to examine the " - "difference.") + def do_diff(self, actual, expected): + actual = actual.splitlines(keepends=True) + expected = expected.splitlines(keepends=True) + annotation("DIFFERENCE", "".join(ndiff(actual, expected))) # Internal methods. def adjust_lib_name(self, name): global lib_prefix global dll_prefix + global implib_prefix result = name pos = name.rfind(".") if pos != -1: suffix = name[pos:] - if suffix == ".lib": - (head, tail) = os.path.split(name) - if lib_prefix: - tail = lib_prefix + tail - result = os.path.join(head, tail) - elif suffix == ".dll" or suffix == ".implib": - (head, tail) = os.path.split(name) - if dll_prefix: - tail = dll_prefix + tail - result = os.path.join(head, tail) + prefix = { + ".lib": lib_prefix, + ".dll": dll_prefix, + ".implib": implib_prefix, + }.get(suffix) + (head, tail) = os.path.split(name) + if prefix: + tail = prefix + tail + result = os.path.join(head, tail) # If we want to use this name in a Jamfile, we better convert \ to /, # as otherwise we would have to quote \. result = result.replace("\\", "/") diff --git a/test/MockToolset.py b/test/MockToolset.py index 834a56b0f5..e95132e17d 100755 --- a/test/MockToolset.py +++ b/test/MockToolset.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright (C) 2013 Steven Watanabe # Distributed under the Boost Software License, Version 1.0. diff --git a/test/TestToolset.py b/test/TestToolset.py index 7fef16b02a..83f8f27324 100644 --- a/test/TestToolset.py +++ b/test/TestToolset.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # # Copyright 2017 Steven Watanabe # @@ -67,9 +67,11 @@ def expand_properties(properties, toolset): result += ["target-os=" + default_target_os] if not has_property("windows-api", properties): result += ["windows-api=desktop"] + if get_target_os(properties) == "windows": + result += ["threadapi=win32"] return result -def compute_path(properties, target_type): +def compute_path(properties, toolset, target_type): path = "" if "variant=release" in properties: path += "/release" @@ -93,6 +95,8 @@ def compute_path(properties, target_type): path += "/strip-on" if get_target_os(properties) != default_target_os: path += "/target-os-" + get_target_os(properties) + if "threadapi=win32" in properties and (toolset != "msvc" or "-win" in toolset): + path += "/threadapi-win32" if "threading=multi" in properties: if "runtime-link=static" not in properties: # TODO: I don't think this it's intended to work this way though path += "/threading-multi" @@ -105,8 +109,8 @@ def test_toolset(toolset, version, property_sets): t.set_tree("toolset-mock") - # Build necessary tools - t.run_build_system(["-sPYTHON_CMD=%s" % sys.executable], subdir="src") + # Extract default target-os value + t.run_build_system(subdir="src") set_default_target_os(t.read("src/bin/target-os.txt").strip()) for properties in property_sets: @@ -114,12 +118,12 @@ def test_toolset(toolset, version, property_sets): properties = adjust_properties(properties) expanded_properties = expand_properties(properties, toolset) def path(t): - return toolset.split("-")[0] + "-*" + version + compute_path(expanded_properties, t) + return toolset.split("-")[0] + "-*" + version + compute_path(expanded_properties, toolset, t) os.environ["B2_PROPERTIES"] = " ".join(expanded_properties) t.run_build_system(["--user-config=", "-sPYTHON_CMD=%s" % sys.executable] + properties) t.expect_addition("bin/%s/lib.obj" % (path("obj"))) if "link=static" not in properties: - if get_target_os(properties) in ["cygwin", "windows"] and toolset != "clang-linux": + if t.is_implib_expected(): t.expect_addition("bin/%s/l1.implib" % (path("dll"))) t.expect_addition("bin/%s/l1.dll" % (path("dll"))) t.ignore_addition("bin/%s/*l1.*.rsp" % (path("dll"))) diff --git a/test/absolute_sources.py b/test/absolute_sources.py index 93fdf49fc7..3d9041ad0a 100644 --- a/test/absolute_sources.py +++ b/test/absolute_sources.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright 2003, 2004 Vladimir Prus # Distributed under the Boost Software License, Version 1.0. diff --git a/test/alias.py b/test/alias.py index ef89df96e6..b14740ef3f 100644 --- a/test/alias.py +++ b/test/alias.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright 2003 Dave Abrahams # Copyright 2003 Vladimir Prus diff --git a/test/alternatives.py b/test/alternatives.py index c2bcc3926c..499cbd9fda 100644 --- a/test/alternatives.py +++ b/test/alternatives.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright 2003 Dave Abrahams # Copyright 2003, 2006 Vladimir Prus diff --git a/test/always.py b/test/always.py index 5ebe4d57b3..7fa60aa401 100644 --- a/test/always.py +++ b/test/always.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright 2016 Steven Watanabe # Distributed under the Boost Software License, Version 1.0. diff --git a/test/bad_dirname.py b/test/bad_dirname.py index 44af30a660..71d8b297d6 100644 --- a/test/bad_dirname.py +++ b/test/bad_dirname.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright 2003 Vladimir Prus # Distributed under the Boost Software License, Version 1.0. diff --git a/test/boostbook.py b/test/boostbook.py index a5e6a0f114..cbfdc3e608 100644 --- a/test/boostbook.py +++ b/test/boostbook.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright 2004, 2006 Vladimir Prus # Distributed under the Boost Software License, Version 1.0. diff --git a/test/build_dir.py b/test/build_dir.py index f9175c9846..4abc886987 100644 --- a/test/build_dir.py +++ b/test/build_dir.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright 2003 Dave Abrahams # Copyright 2002, 2003, 2005 Vladimir Prus diff --git a/test/build_file.py b/test/build_file.py index fcfe2378f0..fc400ecb45 100644 --- a/test/build_file.py +++ b/test/build_file.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright (C) 2006. Vladimir Prus # Copyright (C) 2008. Jurko Gospodnetic diff --git a/test/build_hooks.py b/test/build_hooks.py index 167331341e..9772c3c178 100644 --- a/test/build_hooks.py +++ b/test/build_hooks.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright (C) Vladimir Prus 2006. # Distributed under the Boost Software License, Version 1.0. (See diff --git a/test/build_no.py b/test/build_no.py index 54c1e9dbb1..596b195828 100644 --- a/test/build_no.py +++ b/test/build_no.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright (C) Vladimir Prus 2006. # Distributed under the Boost Software License, Version 1.0. (See diff --git a/test/builtin_echo.py b/test/builtin_echo.py index 9597aca1bf..a5f2d5c157 100755 --- a/test/builtin_echo.py +++ b/test/builtin_echo.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright 2012 Steven Watanabe # Distributed under the Boost Software License, Version 1.0. diff --git a/test/builtin_exit.py b/test/builtin_exit.py index 82f69dc7aa..2e2223702c 100755 --- a/test/builtin_exit.py +++ b/test/builtin_exit.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright 2012 Steven Watanabe # Distributed under the Boost Software License, Version 1.0. diff --git a/test/builtin_glob.py b/test/builtin_glob.py index bb6153f5db..b47e927f89 100755 --- a/test/builtin_glob.py +++ b/test/builtin_glob.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright 2014 Steven Watanabe # Distributed under the Boost Software License, Version 1.0. diff --git a/test/builtin_glob_archive.py b/test/builtin_glob_archive.py index 38c97e22ed..dda50cdb6e 100644 --- a/test/builtin_glob_archive.py +++ b/test/builtin_glob_archive.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright 2014 Steven Watanabe # Copyright 2015 Artur Shepilko diff --git a/test/builtin_readlink.py b/test/builtin_readlink.py index dafd3d7bc3..a76c9a5c2f 100755 --- a/test/builtin_readlink.py +++ b/test/builtin_readlink.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright 2012 Steven Watanabe # Distributed under the Boost Software License, Version 1.0. @@ -7,12 +7,14 @@ import BoostBuild import os import sys +from unittest.mock import patch t = BoostBuild.Tester(pass_toolset=0) t.write("link-target", "") try: - os.symlink("link-target", "link") + with patch.dict(os.environ, {var: "winsymlinks:nativestrict" for var in ["MSYS", "CYGWIN"]}): + os.symlink("link-target", "link") except (AttributeError, OSError) as e: # Either OS does not support symlinks or not enough privilege print("XFAIL: %s" % e) diff --git a/test/builtin_split_by_characters.py b/test/builtin_split_by_characters.py index d10015caab..4324488140 100755 --- a/test/builtin_split_by_characters.py +++ b/test/builtin_split_by_characters.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright 2012. Jurko Gospodnetic # Distributed under the Boost Software License, Version 1.0. diff --git a/test/bzip2.py b/test/bzip2.py index 0525abd292..7909cc3b01 100755 --- a/test/bzip2.py +++ b/test/bzip2.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright (C) 2013 Steven Watanabe # Distributed under the Boost Software License, Version 1.0. diff --git a/test/c_file.py b/test/c_file.py index b4dbaf4be0..47c190a64c 100644 --- a/test/c_file.py +++ b/test/c_file.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright 2003 Vladimir Prus # Distributed under the Boost Software License, Version 1.0. diff --git a/test/chain.py b/test/chain.py index ede2bbcb3a..b0fa02406d 100644 --- a/test/chain.py +++ b/test/chain.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright 2003 Dave Abrahams # Copyright 2002, 2003 Vladimir Prus diff --git a/test/clean.py b/test/clean.py index 0d17f370c3..109b299d0f 100644 --- a/test/clean.py +++ b/test/clean.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright (C) Vladimir Prus 2006. # Distributed under the Boost Software License, Version 1.0. (See diff --git a/test/cli_property_expansion.py b/test/cli_property_expansion.py index 4d143358df..3120e71fa1 100644 --- a/test/cli_property_expansion.py +++ b/test/cli_property_expansion.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright 2015 Aaron Boman # Distributed under the Boost Software License, Version 1.0. diff --git a/test/collect_debug_info.py b/test/collect_debug_info.py index fe9ef7ec94..3407ce692a 100755 --- a/test/collect_debug_info.py +++ b/test/collect_debug_info.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright 2012 Jurko Gospodnetic # Distributed under the Boost Software License, Version 1.0. diff --git a/test/command_line_properties.py b/test/command_line_properties.py index 518991b6cb..336708464a 100644 --- a/test/command_line_properties.py +++ b/test/command_line_properties.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 import BoostBuild diff --git a/test/composite.py b/test/composite.py index cb93240d63..9ffc87f287 100644 --- a/test/composite.py +++ b/test/composite.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright 2003 Vladimir Prus # Distributed under the Boost Software License, Version 1.0. diff --git a/test/conditionals.py b/test/conditionals.py index 9df4c34889..208020fb5b 100644 --- a/test/conditionals.py +++ b/test/conditionals.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright 2003 Dave Abrahams # Copyright 2002, 2003, 2004 Vladimir Prus diff --git a/test/conditionals2.py b/test/conditionals2.py index 65a225fd75..d37777cfd4 100644 --- a/test/conditionals2.py +++ b/test/conditionals2.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright 2003 Vladimir Prus # Distributed under the Boost Software License, Version 1.0. diff --git a/test/conditionals3.py b/test/conditionals3.py index d2045bec05..60695f8ee9 100644 --- a/test/conditionals3.py +++ b/test/conditionals3.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright 2003 Vladimir Prus # Distributed under the Boost Software License, Version 1.0. diff --git a/test/conditionals4.py b/test/conditionals4.py index 28b7872079..f0e93f30ce 100644 --- a/test/conditionals4.py +++ b/test/conditionals4.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright 2021 Dmitry Arkhipov (grisumbras@gmail.com) # Distributed under the Boost Software License, Version 1.0. diff --git a/test/conditionals_multiple.py b/test/conditionals_multiple.py index 4d204a9d00..b278412ddd 100755 --- a/test/conditionals_multiple.py +++ b/test/conditionals_multiple.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright 2008 Jurko Gospodnetic # Distributed under the Boost Software License, Version 1.0. diff --git a/test/configuration.py b/test/configuration.py index 567e07387f..88cce5a260 100755 --- a/test/configuration.py +++ b/test/configuration.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright 2008, 2012 Jurko Gospodnetic # Distributed under the Boost Software License, Version 1.0. diff --git a/test/configure.py b/test/configure.py index 7f287a5141..4c0addaefc 100644 --- a/test/configure.py +++ b/test/configure.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright 2017 Steven Watanabe # Distributed under the Boost Software License, Version 1.0. @@ -9,6 +9,17 @@ import BoostBuild + +def test_check_empty_config(): + """Check no empty cache and log files are generated""" + t = BoostBuild.Tester(use_test_config=0) + t.write("Jamroot", "") + t.run_build_system() + t.expect_nothing(["bin/config.log", "bin/project-cache.jam"]) + t.expect_nothing_more() + t.cleanup() + + def test_check_target_builds(): t = BoostBuild.Tester(use_test_config=0) t.write("Jamroot", """ @@ -38,6 +49,8 @@ def test_check_target_builds(): t.expect_addition("bin/$toolset/debug*/pass.obj") t.expect_addition("bin/$toolset/debug*/foo.obj") t.expect_addition("bin/$toolset/debug*/bar.obj") + t.expect_addition("bin/config.log") + t.expect_addition("bin/project-cache.jam") t.expect_nothing_more() # An up-to-date build should use the cache @@ -105,6 +118,34 @@ def test_check_target_builds(): t.cleanup() + +def test_build_no_short_circuits(): + t = BoostBuild.Tester(use_test_config=0) + t.write("Jamroot", """\ +import configure ; +obj fail : fail.cpp ; +obj should-not-be-even-tried : pass.cpp ; +explicit fail should-not-be-even-tried ; +obj conditional : pass.cpp : + debug:no debug: + [ configure.check-target-builds should-not-be-even-tried "conditional" ] + ; +obj indirect-conditional : pass.cpp : + [ configure.check-target-builds fail : : no debug: ] + [ configure.check-target-builds should-not-be-even-tried "indirect-conditional" ] + ; +obj indirect-conditional : pass.cpp : + [ configure.check-target-builds fail : : debug:no debug: ] + [ configure.check-target-builds should-not-be-even-tried "conditional-in-indirect-conditional" ] + ; +""") + t.write("pass.cpp", "void f() {}\n") + t.write("fail.cpp", "#error fail.cpp\n") + t.run_build_system() + t.expect_nothing_more() + t.cleanup() + + def test_choose(): t = BoostBuild.Tester(use_test_config=0) t.write("Jamroot", """ @@ -261,7 +302,10 @@ def test_choose_none(): t.expect_nothing_more() t.cleanup() + +test_check_empty_config() test_check_target_builds() +test_build_no_short_circuits() test_choose() test_translation() test_choose_none() diff --git a/test/copy_time.py b/test/copy_time.py index 12809f09cc..19f8c01a37 100755 --- a/test/copy_time.py +++ b/test/copy_time.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # # Copyright (c) 2008 Steven Watanabe # diff --git a/test/core_action_output.py b/test/core_action_output.py index 52d5e43e73..6252c16351 100755 --- a/test/core_action_output.py +++ b/test/core_action_output.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright 2012. Jurko Gospodnetic # Distributed under the Boost Software License, Version 1.0. diff --git a/test/core_action_status.py b/test/core_action_status.py index e9d5966ab3..486c6d26b3 100755 --- a/test/core_action_status.py +++ b/test/core_action_status.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright 2007 Rene Rivera. # Copyright 2011 Steven Watanabe diff --git a/test/core_actions_quietly.py b/test/core_actions_quietly.py index a8779d389a..6c0d75fe5e 100755 --- a/test/core_actions_quietly.py +++ b/test/core_actions_quietly.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright 2007 Rene Rivera. # Copyright 2011 Steven Watanabe diff --git a/test/core_arguments.py b/test/core_arguments.py index a743cfae0a..8adc4cd455 100755 --- a/test/core_arguments.py +++ b/test/core_arguments.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright 2001 Dave Abrahams # Copyright 2011 Steven Watanabe diff --git a/test/core_at_file.py b/test/core_at_file.py index b8caf2bab5..0e9977e89c 100755 --- a/test/core_at_file.py +++ b/test/core_at_file.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright 2011 Steven Watanabe # Copyright 2020 Rene Ferdinand Rivera Morell diff --git a/test/core_bindrule.py b/test/core_bindrule.py index bd1682bf5e..9958685576 100755 --- a/test/core_bindrule.py +++ b/test/core_bindrule.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright 2001 Dave Abrahams # Copyright 2011 Steven Watanabe diff --git a/test/core_d12.py b/test/core_d12.py index c330b77c79..380f080566 100644 --- a/test/core_d12.py +++ b/test/core_d12.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright 2002, 2003 Vladimir Prus # Distributed under the Boost Software License, Version 1.0. diff --git a/test/core_delete_module.py b/test/core_delete_module.py index 6b3bda5661..8ad9182d20 100644 --- a/test/core_delete_module.py +++ b/test/core_delete_module.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright 2003 Dave Abrahams # Distributed under the Boost Software License, Version 1.0. diff --git a/test/core_dependencies.py b/test/core_dependencies.py index c8aca1592e..a3a2fe91e3 100644 --- a/test/core_dependencies.py +++ b/test/core_dependencies.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright 2003 Vladimir Prus # Distributed under the Boost Software License, Version 1.0. diff --git a/test/core_fail_expected.py b/test/core_fail_expected.py index 1d4be557b6..5865f4f19e 100644 --- a/test/core_fail_expected.py +++ b/test/core_fail_expected.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright 2017 Steven Watanabe # Distributed under the Boost Software License, Version 1.0. diff --git a/test/core_import_module.py b/test/core_import_module.py index 1fd0c650b9..3b2b686926 100644 --- a/test/core_import_module.py +++ b/test/core_import_module.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright 2003 Vladimir Prus # Distributed under the Boost Software License, Version 1.0. diff --git a/test/core_jamshell.py b/test/core_jamshell.py index b1886d0f9d..67292870b9 100644 --- a/test/core_jamshell.py +++ b/test/core_jamshell.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright 2014 Steven Watanabe # Distributed under the Boost Software License, Version 1.0. diff --git a/test/core_language.py b/test/core_language.py index 66875c27c4..611af9aa4a 100755 --- a/test/core_language.py +++ b/test/core_language.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright 2002, 2003 Vladimir Prus # Distributed under the Boost Software License, Version 1.0. diff --git a/test/core_modifiers.py b/test/core_modifiers.py index 37cb933a39..0bd7de1d8b 100644 --- a/test/core_modifiers.py +++ b/test/core_modifiers.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright 2003 Vladimir Prus # Distributed under the Boost Software License, Version 1.0. diff --git a/test/core_multifile_actions.py b/test/core_multifile_actions.py index d44d53cb00..b6b78a5438 100755 --- a/test/core_multifile_actions.py +++ b/test/core_multifile_actions.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright 2013 Steven Watanabe # Distributed under the Boost Software License, Version 1.0. diff --git a/test/core_nt_cmd_line.py b/test/core_nt_cmd_line.py index 5796922cf9..10fefb71a3 100755 --- a/test/core_nt_cmd_line.py +++ b/test/core_nt_cmd_line.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright 2001 Dave Abrahams # Copyright 2011 Steven Watanabe diff --git a/test/core_option_d2.py b/test/core_option_d2.py index fbd57362af..575923c7b6 100755 --- a/test/core_option_d2.py +++ b/test/core_option_d2.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright 2007 Rene Rivera. # Copyright 2011 Steven Watanabe diff --git a/test/core_option_l.py b/test/core_option_l.py index e35afe8195..93452b9faa 100755 --- a/test/core_option_l.py +++ b/test/core_option_l.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright 2007 Rene Rivera. # Copyright 2011 Steven Watanabe diff --git a/test/core_option_n.py b/test/core_option_n.py index bfdccefdd9..3b90505a52 100755 --- a/test/core_option_n.py +++ b/test/core_option_n.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright 2007 Rene Rivera. # Copyright 2011 Steven Watanabe diff --git a/test/core_parallel_actions.py b/test/core_parallel_actions.py index 98be1b0e17..6563c4fd97 100755 --- a/test/core_parallel_actions.py +++ b/test/core_parallel_actions.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright 2006 Rene Rivera. # Copyright 2011 Steven Watanabe diff --git a/test/core_parallel_multifile_actions_1.py b/test/core_parallel_multifile_actions_1.py index 214d005046..261bebe4c8 100755 --- a/test/core_parallel_multifile_actions_1.py +++ b/test/core_parallel_multifile_actions_1.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright 2007 Rene Rivera. # Copyright 2011 Steven Watanabe diff --git a/test/core_parallel_multifile_actions_2.py b/test/core_parallel_multifile_actions_2.py index a6911f6ff5..be66f731ef 100755 --- a/test/core_parallel_multifile_actions_2.py +++ b/test/core_parallel_multifile_actions_2.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright 2008 Jurko Gospodnetic, Vladimir Prus # Copyright 2011 Steven Watanabe diff --git a/test/core_scanner.py b/test/core_scanner.py index ee2c6f059c..4dabe9ae09 100644 --- a/test/core_scanner.py +++ b/test/core_scanner.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright 2018 Steven Watanabe # Distributed under the Boost Software License, Version 1.0. diff --git a/test/core_source_line_tracking.py b/test/core_source_line_tracking.py index 2bd9d562b9..3933d6d076 100755 --- a/test/core_source_line_tracking.py +++ b/test/core_source_line_tracking.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright 2012. Jurko Gospodnetic # Distributed under the Boost Software License, Version 1.0. diff --git a/test/core_syntax_error_exit_status.py b/test/core_syntax_error_exit_status.py index bffa676b7b..b7246e4f1f 100644 --- a/test/core_syntax_error_exit_status.py +++ b/test/core_syntax_error_exit_status.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright (C) Mateusz Loskot 2020. # Distributed under the Boost Software License, Version 1.0. (See diff --git a/test/core_typecheck.py b/test/core_typecheck.py index 5d0e991f9f..f2861efbc4 100644 --- a/test/core_typecheck.py +++ b/test/core_typecheck.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright 2003 Vladimir Prus # Distributed under the Boost Software License, Version 1.0. diff --git a/test/core_update_now.py b/test/core_update_now.py index 9c02807b9f..5d7003010d 100755 --- a/test/core_update_now.py +++ b/test/core_update_now.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright 2011 Steven Watanabe # Distributed under the Boost Software License, Version 1.0. diff --git a/test/core_variables_in_actions.py b/test/core_variables_in_actions.py index f72f50c81d..6dbb6bd038 100755 --- a/test/core_variables_in_actions.py +++ b/test/core_variables_in_actions.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright 2012. Jurko Gospodnetic # Distributed under the Boost Software License, Version 1.0. diff --git a/test/core_varnames.py b/test/core_varnames.py index 9d66a65ba8..02863c2049 100644 --- a/test/core_varnames.py +++ b/test/core_varnames.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright 2003 Dave Abrahams # Distributed under the Boost Software License, Version 1.0. diff --git a/test/custom_generator.py b/test/custom_generator.py index 2609c74a72..6ec9d5f5b8 100644 --- a/test/custom_generator.py +++ b/test/custom_generator.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright 2003, 2004, 2005 Vladimir Prus # Distributed under the Boost Software License, Version 1.0. diff --git a/test/debugger-mi.py b/test/debugger-mi.py index 25c52c7e4c..7241bc4f74 100644 --- a/test/debugger-mi.py +++ b/test/debugger-mi.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright 2016 Steven Watanabe # Distributed under the Boost Software License, Version 1.0. diff --git a/test/debugger.py b/test/debugger.py index 46c8aca6db..856cef0c4d 100644 --- a/test/debugger.py +++ b/test/debugger.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright 2016 Steven Watanabe # Distributed under the Boost Software License, Version 1.0. diff --git a/test/default_build.py b/test/default_build.py index 207a037532..cd3e1df103 100644 --- a/test/default_build.py +++ b/test/default_build.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright 2003 Dave Abrahams # Copyright 2002, 2003 Vladimir Prus diff --git a/test/default_features.py b/test/default_features.py index 7d3d4d22f1..8b1d0c86ac 100644 --- a/test/default_features.py +++ b/test/default_features.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright 2003 Vladimir Prus # Distributed under the Boost Software License, Version 1.0. diff --git a/test/default_toolset.py b/test/default_toolset.py index a403a4dc9c..791dad0c41 100755 --- a/test/default_toolset.py +++ b/test/default_toolset.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright 2008 Jurko Gospodnetic # Distributed under the Boost Software License, Version 1.0. diff --git a/test/dependency_property.py b/test/dependency_property.py index 7f0a56df17..24aaaefcce 100644 --- a/test/dependency_property.py +++ b/test/dependency_property.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright 2003 Vladimir Prus # Distributed under the Boost Software License, Version 1.0. diff --git a/test/dependency_test.py b/test/dependency_test.py index a74df12ae5..bf0c2f487f 100644 --- a/test/dependency_test.py +++ b/test/dependency_test.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright 2003 Dave Abrahams # Copyright 2002, 2003, 2005, 2006 Vladimir Prus diff --git a/test/disambiguation.py b/test/disambiguation.py index 18cc13c191..475832760c 100644 --- a/test/disambiguation.py +++ b/test/disambiguation.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright (C) Vladimir Prus 2006. # Distributed under the Boost Software License, Version 1.0. (See diff --git a/test/dll_path.py b/test/dll_path.py index 456911659d..b7469b29d5 100644 --- a/test/dll_path.py +++ b/test/dll_path.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright (C) 2003. Vladimir Prus # Distributed under the Boost Software License, Version 1.0. diff --git a/test/docs.py b/test/docs.py new file mode 100644 index 0000000000..ccbfdf47ad --- /dev/null +++ b/test/docs.py @@ -0,0 +1,74 @@ +#!/usr/bin/env python3 + +# Copyright 2023 Nikita Kniazev +# Distributed under the Boost Software License, Version 1.0. +# (See accompanying file LICENSE.txt or copy at +# https://www.bfgroup.xyz/b2/LICENSE.txt) + +import re +import sys +from collections import defaultdict +from pathlib import Path + + +def read_text(path, root): + try: + return path.read_text('utf-8') + except UnicodeDecodeError as e: + data = path.read_bytes() + i = data.rfind(b'\n', 0, e.start) + 1 + j = data.find(b'\n', e.end) + e.reason += f'\nOn line: {data[i:j]}\nIn file {path.relative_to(root)}' + raise + + +def main(): + for path in Path(__file__).absolute().parents: + if (path / 'Jamroot.jam').is_file(): + root = path + break + else: + print("Could not locate Jamroot.jam") + exit(1) + + already_included = defaultdict(set) + for doc in (root / 'doc/src').rglob('*.adoc'): + if not doc.is_file(): + continue + for match in re.finditer(r'include::([^\[]+)\[tag=([^\]]+)', read_text(doc, root)): + path = (doc.parent / match.group(1)).resolve().relative_to(root).as_posix() + already_included[str(path)].add(match.group(2)) + + if '-v' in sys.argv: + for incl, tags in sorted(already_included.items()): + print(f'* {incl}: {tags}') + + fail = False + #for path in (root / 'src').rglob('*.[jch]*'): + for path in (root / 'src').rglob('*.jam'): + if not path.is_file(): + continue + + tags = set(re.findall(r'tag::([^\[]+)', read_text(path, root))) + if not tags: + continue + + path = path.relative_to(root).as_posix() + already_included_tags = already_included.get(str(path)) + if already_included_tags is None: + print(f'{path} has documentation but is not included anywhere, uses tags: {", ".join(tags)}') + fail = True + continue + + tags -= already_included_tags + if tags: + print(f'{path} has unused in documentation tags: {", ".join(tags)}') + fail = True + + if not fail and __name__ == '__main__': + print('Everything seems to be OK', file=sys.stderr) + + exit(fail) + + +main() diff --git a/test/double_loading.py b/test/double_loading.py index 9b99964cba..ad17f70e11 100644 --- a/test/double_loading.py +++ b/test/double_loading.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright 2003 Vladimir Prus # Distributed under the Boost Software License, Version 1.0. diff --git a/test/duplicate.py b/test/duplicate.py index 6e65f91175..cfc650773d 100644 --- a/test/duplicate.py +++ b/test/duplicate.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright 2004 Vladimir Prus # Distributed under the Boost Software License, Version 1.0. diff --git a/test/example_customization.py b/test/example_customization.py index 16c100ec71..12d1413dd9 100644 --- a/test/example_customization.py +++ b/test/example_customization.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright (C) Vladimir Prus 2006. # Distributed under the Boost Software License, Version 1.0. (See diff --git a/test/example_gettext.py b/test/example_gettext.py index 3460702035..62f4f8b342 100644 --- a/test/example_gettext.py +++ b/test/example_gettext.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright (C) Vladimir Prus 2006. # Distributed under the Boost Software License, Version 1.0. (See diff --git a/test/example_libraries.py b/test/example_libraries.py index 12f2d09987..90eb7dded4 100644 --- a/test/example_libraries.py +++ b/test/example_libraries.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright (C) Vladimir Prus 2006. # Distributed under the Boost Software License, Version 1.0. (See diff --git a/test/example_make.py b/test/example_make.py index 7036a9772a..3f7aa795db 100644 --- a/test/example_make.py +++ b/test/example_make.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright (C) Vladimir Prus 2006. # Distributed under the Boost Software License, Version 1.0. (See diff --git a/test/example_qt4.py b/test/example_qt4.py index ec6bb32de5..4fddfa948e 100644 --- a/test/example_qt4.py +++ b/test/example_qt4.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright (C) Vladimir Prus 2006. # Distributed under the Boost Software License, Version 1.0. (See diff --git a/test/exit_status.py b/test/exit_status.py index 1e14dea587..3760f2e050 100755 --- a/test/exit_status.py +++ b/test/exit_status.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright (C) Vladimir Prus 2010. # Distributed under the Boost Software License, Version 1.0. (See diff --git a/test/expansion.py b/test/expansion.py index 7ab350d8b5..688fdf1721 100644 --- a/test/expansion.py +++ b/test/expansion.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright 2003 Vladimir Prus # Distributed under the Boost Software License, Version 1.0. diff --git a/test/explicit.py b/test/explicit.py index 918994cb10..6ef18e33d5 100644 --- a/test/explicit.py +++ b/test/explicit.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright 2003 Vladimir Prus # Distributed under the Boost Software License, Version 1.0. diff --git a/test/feature_cxxflags.py b/test/feature_cxxflags.py index 0e5aeba55c..d3385a5150 100755 --- a/test/feature_cxxflags.py +++ b/test/feature_cxxflags.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright 2014 Steven Watanabe # Distributed under the Boost Software License, Version 1.0. diff --git a/test/feature_force_include.py b/test/feature_force_include.py index 03aea48917..1f95cb6e03 100644 --- a/test/feature_force_include.py +++ b/test/feature_force_include.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # Copyright 2020 Nikita Kniazev # Distributed under the Boost Software License, Version 1.0. diff --git a/test/feature_implicit_dependency.py b/test/feature_implicit_dependency.py index 2d22f34087..55699ffb9d 100644 --- a/test/feature_implicit_dependency.py +++ b/test/feature_implicit_dependency.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright (c) Steven Watanabe 2018. # Distributed under the Boost Software License, Version 1.0. (See diff --git a/test/feature_relevant.py b/test/feature_relevant.py index a6e20aafc1..3e2459f8bb 100644 --- a/test/feature_relevant.py +++ b/test/feature_relevant.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright 2018 Steven Watanabe # Distributed under the Boost Software License, Version 1.0. diff --git a/test/feature_suppress_import_lib.py b/test/feature_suppress_import_lib.py index 84de4c2221..179e5f0109 100644 --- a/test/feature_suppress_import_lib.py +++ b/test/feature_suppress_import_lib.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright 2018 Steven Watanabe # Distributed under the Boost Software License, Version 1.0. diff --git a/test/file_types.py b/test/file_types.py index 9924e336a5..52a70ed466 100644 --- a/test/file_types.py +++ b/test/file_types.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # # Copyright 2018 Steven Watanabe # diff --git a/test/flags.py b/test/flags.py index 3a12c94d95..53c270f98f 100644 --- a/test/flags.py +++ b/test/flags.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright (C) Steven Watanabe 2018 # Distributed under the Boost Software License, Version 1.0. (See diff --git a/test/gcc_runtime.py b/test/gcc_runtime.py index a7963c3440..eca21f87c9 100644 --- a/test/gcc_runtime.py +++ b/test/gcc_runtime.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright 2004 Vladimir Prus # Distributed under the Boost Software License, Version 1.0. diff --git a/test/generator_selection.py b/test/generator_selection.py index 84fc431587..40f913b6ca 100755 --- a/test/generator_selection.py +++ b/test/generator_selection.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright 2008, 2012 Jurko Gospodnetic # Distributed under the Boost Software License, Version 1.0. diff --git a/test/generators_test.py b/test/generators_test.py index 148044fa5f..606fe8644b 100644 --- a/test/generators_test.py +++ b/test/generators_test.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright 2002, 2003 Dave Abrahams # Copyright 2002, 2003, 2004, 2005 Vladimir Prus diff --git a/test/implicit_dependency.py b/test/implicit_dependency.py index 49f82296c4..a23fab1d95 100644 --- a/test/implicit_dependency.py +++ b/test/implicit_dependency.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright (C) Vladimir Prus 2006. # Distributed under the Boost Software License, Version 1.0. (See diff --git a/test/indirect_conditional.py b/test/indirect_conditional.py index 4d8373cb1f..a0f604e36a 100644 --- a/test/indirect_conditional.py +++ b/test/indirect_conditional.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright (C) 2006. Vladimir Prus # Distributed under the Boost Software License, Version 1.0. diff --git a/test/inherit_toolset.py b/test/inherit_toolset.py index defdeadec0..9a0f068602 100644 --- a/test/inherit_toolset.py +++ b/test/inherit_toolset.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright 2003 Vladimir Prus # Distributed under the Boost Software License, Version 1.0. diff --git a/test/inherited_dependency.py b/test/inherited_dependency.py index 412fa239b4..53882d1eb0 100755 --- a/test/inherited_dependency.py +++ b/test/inherited_dependency.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # # Copyright (c) 2008 Steven Watanabe # diff --git a/test/inline.py b/test/inline.py index 5e62e6f32a..b71747b790 100644 --- a/test/inline.py +++ b/test/inline.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright 2003, 2006 Vladimir Prus # Distributed under the Boost Software License, Version 1.0. diff --git a/test/install_build_no.py b/test/install_build_no.py index 0ccf3c5cc6..0af4eb1414 100755 --- a/test/install_build_no.py +++ b/test/install_build_no.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright 2021 Dmitry Arkhipov (grisumbras@gmail.com) # Distributed under the Boost Software License, Version 1.0. diff --git a/test/lang_asm.py b/test/lang_asm.py new file mode 100644 index 0000000000..67ee8b770a --- /dev/null +++ b/test/lang_asm.py @@ -0,0 +1,40 @@ +#!/usr/bin/python + +# Copyright 2023 Nikita Kniazev +# Distributed under the Boost Software License, Version 1.0. +# (See accompanying file LICENSE.txt or https://www.bfgroup.xyz/b2/LICENSE.txt) + +# Test that assembler file is actually C-preprocessed. + +import BoostBuild + +t = BoostBuild.Tester(use_test_config=False) + +t.write("jamroot.jam", """\ +obj hello : hello.S : OK ; +""") + +''' +''' +t.write("hello.S", """\ +#ifndef __ASSEMBLER__ +# error __ASSEMBLER__ expected to be defined +#endif +#if __ASSEMBLER__ != 1 +# error __ASSEMBLER__ expected to be defined to value of 1 +#endif +#ifndef OK +# error OK was not defined +#endif +// MASM/ARMASM requires END token at the end of the file +#ifdef __GNUC__ +# define END +#endif +// whitespace before END is to stop MARMASM from barking 'warning A4045: missing END directive' + END +""") + +t.run_build_system(["-d+2", "--debug-configuration"]) +t.expect_addition("bin/$toolset/debug*/hello.obj") + +t.cleanup() diff --git a/test/lang_objc.py b/test/lang_objc.py index a3a60d99d6..17e75b52bc 100644 --- a/test/lang_objc.py +++ b/test/lang_objc.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # Copyright Nikita Kniazev 2021. # Distributed under the Boost Software License, Version 1.0. (See diff --git a/test/lib_source_property.py b/test/lib_source_property.py index 5cb36d3bd9..ea41dd0af1 100644 --- a/test/lib_source_property.py +++ b/test/lib_source_property.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright (C) Vladimir Prus 2006. # Distributed under the Boost Software License, Version 1.0. (See diff --git a/test/lib_zlib.py b/test/lib_zlib.py index de410b3a20..da917a0490 100755 --- a/test/lib_zlib.py +++ b/test/lib_zlib.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright (C) 2013 Steven Watanabe # Distributed under the Boost Software License, Version 1.0. diff --git a/test/libjpeg.py b/test/libjpeg.py index 4201ccffff..ec86c64ba5 100755 --- a/test/libjpeg.py +++ b/test/libjpeg.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright (C) 2013 Steven Watanabe # Distributed under the Boost Software License, Version 1.0. diff --git a/test/liblzma.py b/test/liblzma.py index ffa16b6f90..621a4a855a 100755 --- a/test/liblzma.py +++ b/test/liblzma.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copy-paste-modify from zlib.py # Copyright (C) 2013 Steven Watanabe diff --git a/test/libpng.py b/test/libpng.py index ad11ce6ed2..93029e04cc 100755 --- a/test/libpng.py +++ b/test/libpng.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright (C) 2013 Steven Watanabe # Distributed under the Boost Software License, Version 1.0. diff --git a/test/library_chain.py b/test/library_chain.py index 57751ad421..d4291c3185 100644 --- a/test/library_chain.py +++ b/test/library_chain.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright 2003, 2004, 2005, 2006 Vladimir Prus # Distributed under the Boost Software License, Version 1.0. @@ -117,7 +117,7 @@ t.run_build_system(subdir="a") t.expect_addition("a/dist/a.dll") -if sys.platform == 'win32': +if t.is_implib_expected(): # This is a Windows import library. file = t.adjust_name("a.implib") else: diff --git a/test/library_order.py b/test/library_order.py index 071dd059d6..79755c53c2 100644 --- a/test/library_order.py +++ b/test/library_order.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright 2004 Vladimir Prus # Distributed under the Boost Software License, Version 1.0. diff --git a/test/library_property.py b/test/library_property.py index f85e3dd999..f1d500291d 100644 --- a/test/library_property.py +++ b/test/library_property.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright 2004 Vladimir Prus # Distributed under the Boost Software License, Version 1.0. diff --git a/test/libtiff.py b/test/libtiff.py index b089f43c4e..af3e60e58c 100755 --- a/test/libtiff.py +++ b/test/libtiff.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright (C) 2013 Steven Watanabe # Distributed under the Boost Software License, Version 1.0. diff --git a/test/libzstd.py b/test/libzstd.py index 1dbe47ce30..7f9038e48b 100755 --- a/test/libzstd.py +++ b/test/libzstd.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copy-paste-modify from zlib.py # Copyright (C) 2013 Steven Watanabe diff --git a/test/link.py b/test/link.py index 480e71e5a5..b2cfd1837d 100755 --- a/test/link.py +++ b/test/link.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright 2014-2015 Steven Watanabe # Distributed under the Boost Software License, Version 1.0. @@ -8,6 +8,8 @@ # common boost/ directory in the new git layout. import BoostBuild +import os +from unittest.mock import patch def ignore_config(t): """These files are created by the configuration logic in link.jam @@ -339,12 +341,14 @@ def test_error_duplicate(): t.cleanup() -test_basic() -test_merge_two() -test_merge_existing_all() -test_merge_recursive() -test_merge_recursive_existing_all() -test_include_scan() -test_include_scan_merge_existing() -test_update_file_link_all() -test_error_duplicate() + +with patch.dict(os.environ, {var: "winsymlinks:nativestrict" for var in ["MSYS", "CYGWIN"]}): + test_basic() + test_merge_two() + test_merge_existing_all() + test_merge_recursive() + test_merge_recursive_existing_all() + test_include_scan() + test_include_scan_merge_existing() + test_update_file_link_all() + test_error_duplicate() diff --git a/test/load_dir.py b/test/load_dir.py index 62d5421044..a673ecad2e 100644 --- a/test/load_dir.py +++ b/test/load_dir.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 """ Traverses a directory and output the code that would create the same directory @@ -37,7 +37,7 @@ def create_file(arg, dirname, fnames): print('\n""")\n') -header = """#!/usr/bin/python +header = """#!/usr/bin/env python3 # Copyright (C) FILL SOMETHING HERE 2005. # Distributed under the Boost Software License, Version 1.0. (See diff --git a/test/load_order.py b/test/load_order.py index 7fdce85b5e..6f01c78479 100644 --- a/test/load_order.py +++ b/test/load_order.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright 2004 Vladimir Prus. # Distributed under the Boost Software License, Version 1.0. diff --git a/test/loop.py b/test/loop.py index bbc6cee775..defebc520e 100644 --- a/test/loop.py +++ b/test/loop.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright 2003 Vladimir Prus # Distributed under the Boost Software License, Version 1.0. diff --git a/test/make_rule.py b/test/make_rule.py index 81d8405f05..b3a2ad7936 100644 --- a/test/make_rule.py +++ b/test/make_rule.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright 2003 Dave Abrahams # Copyright 2003, 2006 Vladimir Prus diff --git a/test/message.py b/test/message.py index 4e0217a880..704f5eb35a 100755 --- a/test/message.py +++ b/test/message.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright (C) Vladimir Prus 2003. # Distributed under the Boost Software License, Version 1.0. diff --git a/test/module_actions.py b/test/module_actions.py index 11d9c5623c..4e589b67f8 100644 --- a/test/module_actions.py +++ b/test/module_actions.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright 2003 Dave Abrahams # Copyright 2006 Rene Rivera diff --git a/test/ndebug.py b/test/ndebug.py index 82f3db81ea..f86abbcb94 100644 --- a/test/ndebug.py +++ b/test/ndebug.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright 2003 Vladimir Prus # Distributed under the Boost Software License, Version 1.0. diff --git a/test/no_type.py b/test/no_type.py index 9a83886f94..43faf0a41f 100644 --- a/test/no_type.py +++ b/test/no_type.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright 2002 Vladimir Prus # Distributed under the Boost Software License, Version 1.0. diff --git a/test/notfile.py b/test/notfile.py index a3e5c58ee9..332e8ce56f 100644 --- a/test/notfile.py +++ b/test/notfile.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright (C) Vladimir Prus 2005. # Distributed under the Boost Software License, Version 1.0. diff --git a/test/ordered_include.py b/test/ordered_include.py index 12f32c8d0e..4674dbbb32 100644 --- a/test/ordered_include.py +++ b/test/ordered_include.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # # Copyright (c) 2008 Steven Watanabe # diff --git a/test/ordered_properties.py b/test/ordered_properties.py index 49eb0a3c11..331e4b01f9 100644 --- a/test/ordered_properties.py +++ b/test/ordered_properties.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright 2004 Vladimir Prus # Distributed under the Boost Software License, Version 1.0. diff --git a/test/out_of_tree.py b/test/out_of_tree.py index dad21e18f3..d88290cf76 100644 --- a/test/out_of_tree.py +++ b/test/out_of_tree.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright (C) Vladimir Prus 2005. # Distributed under the Boost Software License, Version 1.0. (See diff --git a/test/package.py b/test/package.py index f5fc44dffc..cc085126dd 100644 --- a/test/package.py +++ b/test/package.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright 2018 Steven Watanabe # Distributed under the Boost Software License, Version 1.0. diff --git a/test/param.py b/test/param.py index feba794e19..0ec44618d7 100644 --- a/test/param.py +++ b/test/param.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright 2018 Steven Watanabe # Distributed under the Boost Software License, Version 1.0. diff --git a/test/path_features.py b/test/path_features.py index 59af7fd8a5..48feefa5d3 100644 --- a/test/path_features.py +++ b/test/path_features.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright 2003 Dave Abrahams # Copyright 2002, 2003, 2004 Vladimir Prus diff --git a/test/pch.py b/test/pch.py index bcb9bd57af..f94d5cab1e 100644 --- a/test/pch.py +++ b/test/pch.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright 2006 Vladimir Prus. # Copyright Nikita Kniazev 2020. @@ -15,12 +15,15 @@ t.write("jamroot.jam", """ import pch ; project : requirements on ; -cpp-pch pch : a/pch.hpp ; -cpp-pch pch-afx : a/pch.hpp : HELLO ; -cpp-pch pch-msvc-source : a/pch.hpp : msvc:a/pch.cpp ; +cpp-pch pch : pch.hpp ; +cpp-pch pch-afx : pch.hpp : HELLO ; +cpp-pch pch-msvc-source : pch.hpp : msvc:pch.cpp ; exe hello : hello.cpp pch ; exe hello-afx : hello-afx.cpp pch-afx : HELLO ; exe hello-msvc-source : hello-msvc-source.cpp pch-msvc-source ; + +cpp-pch subdir-pch : a/pch_different.hpp ; +exe hello-subdir : a/hello.cpp subdir-pch ; """) pch_content = """\ @@ -31,13 +34,13 @@ class TestClass TestClass( int, int ) {} }; """ -t.write("a/pch.hpp", pch_content) +t.write("pch.hpp", pch_content) +t.copy("pch.hpp", "a/pch_different.hpp") -t.write("a/pch.cpp", """#include +t.write("pch.cpp", """#include """) -toolset = BoostBuild.get_toolset() -for name in ("hello.cpp", "hello-afx.cpp", "hello-msvc-source.cpp"): +for name in ("hello.cpp", "hello-afx.cpp", "hello-msvc-source.cpp", "a/hello.cpp", "a/hello-rel.cpp"): t.write(name, """int main() { TestClass c(1, 2); } """) @@ -45,6 +48,7 @@ class TestClass t.expect_addition("bin/$toolset/debug*/hello.exe") t.expect_addition("bin/$toolset/debug*/hello-afx.exe") t.expect_addition("bin/$toolset/debug*/hello-msvc-source.exe") +t.expect_addition("bin/$toolset/debug*/hello-subdir.exe") # Now make the header unusable, replace its content with some garbage, but @@ -52,10 +56,12 @@ class TestClass # B2 will not recreate PCH, and compiler will happily use pre-compiled # header, not noticing that the real header is bad. -t.rename("a/pch.hpp", "a/pch.hpp.orig") -s = "THIS WILL NOT COMPILE. " -t.write("a/pch.hpp", s + (len(pch_content) - len(s)) * 'x') -t.copy_timestamp("a/pch.hpp.orig", "a/pch.hpp") +t.rename("pch.hpp", "pch.hpp.orig") +s = """#error PCH REBUILD HAPPEND +THIS WILL NOT COMPILE +""" +t.write("pch.hpp", s + (len(pch_content) - len(s)) * 'x') +t.copy_timestamp("pch.hpp.orig", "pch.hpp") t.rm("bin/$toolset/debug*/hello.obj") t.rm("bin/$toolset/debug*/hello-afx.obj") @@ -66,4 +72,23 @@ class TestClass t.expect_addition("bin/$toolset/debug*/hello-afx.obj") t.expect_addition("bin/$toolset/debug*/hello-msvc-source.obj") +t.rm("bin") +t.copy("a/pch_different.hpp", "pch.hpp") +t.rename("a", "b") +t.write("b/jamfile.jam", """\ +import pch ; +project : requirements on ; +cpp-pch pch : pch_different.hpp ; +exe hello : hello.cpp pch ; +cpp-pch pch-rel : ../pch.hpp ; +exe hello-rel : hello-rel.cpp pch-rel ; +""") +t.run_build_system(["-d+2", "b"]) +t.expect_addition("b/bin/$toolset/debug*/hello.exe") +t.expect_addition("b/bin/$toolset/debug*/hello-rel.exe") +t.rm("b/bin") +t.run_build_system(["-d+2"], subdir="b") +t.expect_addition("b/bin/$toolset/debug*/hello.exe") +t.expect_addition("b/bin/$toolset/debug*/hello-rel.exe") + t.cleanup() diff --git a/test/prebuilt.py b/test/prebuilt.py index 194cc3967d..1f21455db3 100644 --- a/test/prebuilt.py +++ b/test/prebuilt.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright 2002, 2003, 2004 Vladimir Prus # Distributed under the Boost Software License, Version 1.0. diff --git a/test/prebuilt/ext/jamfile2.jam b/test/prebuilt/ext/jamfile2.jam index 6481808c6e..4c95a78d71 100644 --- a/test/prebuilt/ext/jamfile2.jam +++ b/test/prebuilt/ext/jamfile2.jam @@ -18,7 +18,7 @@ if [ os.name ] in NT } else if [ os.name ] in CYGWIN { - dll-suffix = dll ; + dll-suffix = dll.a ; } else if [ os.name ] in MACOSX { diff --git a/test/prebuilt/ext/jamfile3.jam b/test/prebuilt/ext/jamfile3.jam index be2257fa26..f90fc44865 100644 --- a/test/prebuilt/ext/jamfile3.jam +++ b/test/prebuilt/ext/jamfile3.jam @@ -22,7 +22,7 @@ if [ os.name ] in NT } else if [ os.name ] in CYGWIN { - dll-suffix = dll ; + dll-suffix = dll.a ; } else if [ os.name ] in MACOSX { diff --git a/test/preprocessor.py b/test/preprocessor.py index b30790c3d5..39aca878c7 100755 --- a/test/preprocessor.py +++ b/test/preprocessor.py @@ -1,7 +1,8 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright 2003 Vladimir Prus # Copyright 2011 Steven Watanabe +# Copyright 2023 Nikita Kniazev # Distributed under the Boost Software License, Version 1.0. # (See accompanying file LICENSE.txt or https://www.bfgroup.xyz/b2/LICENSE.txt) @@ -16,6 +17,8 @@ preprocessed hello : hello.cpp ; preprocessed a : a.c ; exe test : hello a : FAIL ; +preprocessed nolinemarkers-cpp : hello.cpp : off ; +preprocessed nolinemarkers-c : a.c : off ; """) t.write("hello.cpp", """ @@ -45,9 +48,13 @@ } """) -t.run_build_system() +t.run_build_system(["-d+2"]) t.expect_addition("bin/$toolset/debug*/hello.ii") t.expect_addition("bin/$toolset/debug*/a.i") +t.expect_addition("bin/$toolset/debug*/nolinemarkers-cpp.ii") +t.expect_addition("bin/$toolset/debug*/nolinemarkers-c.i") t.expect_addition("bin/$toolset/debug*/test.exe") +t.fail_test('#' in t.read("bin/$toolset/debug*/nolinemarkers-cpp.ii")) +t.fail_test('#' in t.read("bin/$toolset/debug*/nolinemarkers-c.i")) t.cleanup() diff --git a/test/print.py b/test/print.py index 10f999c35e..aedfdeeca3 100644 --- a/test/print.py +++ b/test/print.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright 2003 Douglas Gregor # Copyright 2005 Vladimir Prus diff --git a/test/project_dependencies.py b/test/project_dependencies.py index 7148dc1ad7..97821caeb4 100644 --- a/test/project_dependencies.py +++ b/test/project_dependencies.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright 2003 Dave Abrahams # Copyright 2002, 2003, 2004 Vladimir Prus diff --git a/test/project_glob.py b/test/project_glob.py index 8e80a20c44..ee4000fad3 100644 --- a/test/project_glob.py +++ b/test/project_glob.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright (C) 2003. Vladimir Prus # Distributed under the Boost Software License, Version 1.0. diff --git a/test/project_id.py b/test/project_id.py index d985d3047c..4d6540f527 100755 --- a/test/project_id.py +++ b/test/project_id.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright (C) 2012. Jurko Gospodnetic # Distributed under the Boost Software License, Version 1.0. diff --git a/test/project_root_constants.py b/test/project_root_constants.py index 865789935e..2d9c3877fc 100644 --- a/test/project_root_constants.py +++ b/test/project_root_constants.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright 2003, 2004, 2005 Vladimir Prus # Distributed under the Boost Software License, Version 1.0. diff --git a/test/project_root_rule.py b/test/project_root_rule.py index 8507926622..2b9bcab88b 100644 --- a/test/project_root_rule.py +++ b/test/project_root_rule.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright (C) Vladimir Prus 2005. # Distributed under the Boost Software License, Version 1.0. (See diff --git a/test/project_test3.py b/test/project_test3.py index 72533f116a..31f7e9ced4 100644 --- a/test/project_test3.py +++ b/test/project_test3.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright 2002, 2003 Dave Abrahams # Copyright 2002, 2003, 2004, 2006 Vladimir Prus diff --git a/test/project_test4.py b/test/project_test4.py index 816340c8c0..905d9e8c45 100644 --- a/test/project_test4.py +++ b/test/project_test4.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright 2003 Dave Abrahams # Copyright 2002, 2003, 2004 Vladimir Prus diff --git a/test/property_expansion.py b/test/property_expansion.py index 48ece0c912..e36deb160a 100644 --- a/test/property_expansion.py +++ b/test/property_expansion.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright 2003 Vladimir Prus # Distributed under the Boost Software License, Version 1.0. diff --git a/test/qt4.py b/test/qt4.py index 85e5e6781b..e503a5ca98 100755 --- a/test/qt4.py +++ b/test/qt4.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # (c) Copyright Juergen Hunold 2008 # Use, modification, and distribution are subject to the diff --git a/test/qt5.py b/test/qt5.py index 4712a79e85..f511e4582e 100755 --- a/test/qt5.py +++ b/test/qt5.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # (c) Copyright Juergen Hunold 2012 # Use, modification, and distribution are subject to the diff --git a/test/rebuilds.py b/test/rebuilds.py index d84fc96a3b..1f06984646 100644 --- a/test/rebuilds.py +++ b/test/rebuilds.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright 2005 Dave Abrahams # Distributed under the Boost Software License, Version 1.0. diff --git a/test/relative_sources.py b/test/relative_sources.py index 12ce2e8a5a..1a21a124fd 100644 --- a/test/relative_sources.py +++ b/test/relative_sources.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright 2003 Dave Abrahams # Copyright 2002, 2006 Vladimir Prus diff --git a/test/remove_requirement.py b/test/remove_requirement.py index 56133d6dc4..a98db79c1a 100644 --- a/test/remove_requirement.py +++ b/test/remove_requirement.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright (C) Vladimir Prus 2006. # Distributed under the Boost Software License, Version 1.0. (See diff --git a/test/rescan_header.py b/test/rescan_header.py index 6384e5abd7..9ab79e5c7c 100755 --- a/test/rescan_header.py +++ b/test/rescan_header.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright 2012 Steven Watanabe # Distributed under the Boost Software License, Version 1.0. diff --git a/test/resolution.py b/test/resolution.py index cec8a4322c..372744b643 100644 --- a/test/resolution.py +++ b/test/resolution.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright (C) Vladimir Prus 2006. # Distributed under the Boost Software License, Version 1.0. diff --git a/test/rootless.py b/test/rootless.py index 9f407d934e..b9c722c86d 100644 --- a/test/rootless.py +++ b/test/rootless.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright 2018 Rene Rivera # Distributed under the Boost Software License, Version 1.0. diff --git a/test/scanner_causing_rebuilds.py b/test/scanner_causing_rebuilds.py index d0b55ee162..b687011fc3 100755 --- a/test/scanner_causing_rebuilds.py +++ b/test/scanner_causing_rebuilds.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright 2012 Jurko Gospodnetic # Distributed under the Boost Software License, Version 1.0. diff --git a/test/searched_lib.py b/test/searched_lib.py index 67fef4630e..dee2b72986 100644 --- a/test/searched_lib.py +++ b/test/searched_lib.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright 2003 Dave Abrahams # Copyright 2003, 2004, 2005, 2006 Vladimir Prus @@ -31,8 +31,8 @@ # Auto adjusting of suffixes does not work, since we need to # change dll to lib. -if ( ( os.name == "nt" ) or os.uname()[0].lower().startswith("cygwin") ) and \ - ( BoostBuild.get_toolset() != "gcc" ): +if t.is_implib_expected(): + t.expect_addition("lib/bin/$toolset/debug*/test_lib.implib") t.copy("lib/bin/$toolset/debug*/test_lib.implib", "lib/test_lib.implib") t.copy("lib/bin/$toolset/debug*/test_lib.dll", "lib/test_lib.dll") else: diff --git a/test/skipping.py b/test/skipping.py index a3eda7a0a1..a0827fd791 100644 --- a/test/skipping.py +++ b/test/skipping.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright 2003 Vladimir Prus # Distributed under the Boost Software License, Version 1.0. diff --git a/test/sort_rule.py b/test/sort_rule.py index 82f7d82e63..8b23875dc4 100755 --- a/test/sort_rule.py +++ b/test/sort_rule.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright (C) 2008. Jurko Gospodnetic # Distributed under the Boost Software License, Version 1.0. diff --git a/test/source_locations.py b/test/source_locations.py index 11422d43af..6c929cf95e 100644 --- a/test/source_locations.py +++ b/test/source_locations.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright (C) Craig Rodrigues 2005. # Distributed under the Boost Software License, Version 1.0. (See diff --git a/test/source_order.py b/test/source_order.py index 90011fe5b9..36b7ec536e 100755 --- a/test/source_order.py +++ b/test/source_order.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright 2013 Steven Watanabe # Distributed under the Boost Software License, Version 1.0. diff --git a/test/space_in_path.py b/test/space_in_path.py index bfcba48949..e929778e7b 100755 --- a/test/space_in_path.py +++ b/test/space_in_path.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright 2012 Steven Watanabe # Distributed under the Boost Software License, Version 1.0. diff --git a/test/stage.py b/test/stage.py index 8b31b4b0f8..b88a7be665 100644 --- a/test/stage.py +++ b/test/stage.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright 2003 Dave Abrahams # Copyright 2002, 2003, 2004, 2005, 2006 Vladimir Prus diff --git a/test/standalone.py b/test/standalone.py index f13ed59dbb..aae0367215 100644 --- a/test/standalone.py +++ b/test/standalone.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright 2003 Vladimir Prus # Distributed under the Boost Software License, Version 1.0. diff --git a/test/static_and_shared_library.py b/test/static_and_shared_library.py index e30a5465d8..12813990a7 100755 --- a/test/static_and_shared_library.py +++ b/test/static_and_shared_library.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright 2002, 2003 Dave Abrahams # Copyright 2002, 2003, 2005 Vladimir Prus diff --git a/test/suffix.py b/test/suffix.py index e831ece20e..45c9b89f70 100644 --- a/test/suffix.py +++ b/test/suffix.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright 2003, 2004 Vladimir Prus # Distributed under the Boost Software License, Version 1.0. diff --git a/test/symlink.py b/test/symlink.py index b84309afe6..9779c9fb82 100644 --- a/test/symlink.py +++ b/test/symlink.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright 2003 Dave Abrahams # Copyright 2003 Vladimir Prus diff --git a/test/tag.py b/test/tag.py index 260bb385fe..74a20d2389 100644 --- a/test/tag.py +++ b/test/tag.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright (C) 2003. Pedro Ferreira # Distributed under the Boost Software License, Version 1.0. @@ -7,6 +7,8 @@ import BoostBuild +import re +from functools import reduce ############################################################################### # @@ -64,6 +66,12 @@ def test_tag_property(t): case shared : tags += s ; case static : tags += t ; } + switch $(type) + { + case SHARED_LIB : tags += _dll ; + case STATIC_LIB : tags += _lib ; + case EXE : tags += _exe ; + } if $(tags) { return [ virtual-target.add-prefix-and-suffix $(name)_$(tags:J="") @@ -79,26 +87,28 @@ def test_tag_property(t): t.write("a.cpp", """\ int main() {} -#ifdef _MSC_VER -__declspec (dllexport) void x () {} -#endif """) - file_list = ( - BoostBuild.List("bin/$toolset/debug*/a_ds.exe") + - BoostBuild.List("bin/$toolset/debug*/b_ds.dll") + - BoostBuild.List("c/a_ds.exe") + - BoostBuild.List("bin/$toolset/release*/a_rs.exe") + - BoostBuild.List("bin/$toolset/release*/b_rs.dll") + - BoostBuild.List("c/a_rs.exe") + - BoostBuild.List("bin/$toolset/debug*/a_dt.exe") + - BoostBuild.List("bin/$toolset/debug*/b_dt.lib") + - BoostBuild.List("c/a_dt.exe") + - BoostBuild.List("bin/$toolset/release*/a_rt.exe") + - BoostBuild.List("bin/$toolset/release*/b_rt.lib") + - BoostBuild.List("c/a_rt.exe")) - - variants = ["debug", "release", "link=static,shared"] + file_list = { + "bin/$toolset/debug*/a_ds_exe.exe", + "bin/$toolset/debug*/b_ds_dll.dll", + "c/a_ds_exe.exe", + "bin/$toolset/release*/a_rs_exe.exe", + "bin/$toolset/release*/b_rs_dll.dll", + "c/a_rs_exe.exe", + "bin/$toolset/debug*/a_dt_exe.exe", + "bin/$toolset/debug*/b_dt_lib.lib", + "c/a_dt_exe.exe", + "bin/$toolset/release*/a_rt_exe.exe", + "bin/$toolset/release*/b_rt_lib.lib", + "c/a_rt_exe.exe", + } + if t.is_pdb_expected(): + file_list |= {re.sub(r'(_\w*d\w*)\.(exe|dll)$', r'\1.pdb', file) + for file in file_list} + file_list = list(reduce(lambda x, y: x+y, map(BoostBuild.List, file_list))) + + variants = ["debug", "release", "link=static,shared", "debug-symbols=on"] t.run_build_system(variants) t.expect_addition(file_list) diff --git a/test/template.py b/test/template.py index 180a823035..f660c9a9f4 100644 --- a/test/template.py +++ b/test/template.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright (C) FILL SOMETHING HERE 2006. # Distributed under the Boost Software License, Version 1.0. (See diff --git a/test/test1.py b/test/test1.py index 4341deece2..21edf45003 100644 --- a/test/test1.py +++ b/test/test1.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright 2002 Vladimir Prus # Distributed under the Boost Software License, Version 1.0. diff --git a/test/test2.py b/test/test2.py index df42a2c543..6161577d5d 100644 --- a/test/test2.py +++ b/test/test2.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright 2002, 2003 Dave Abrahams # Copyright 2002, 2003 Vladimir Prus diff --git a/test/test_all.py b/test/test_all.py old mode 100644 new mode 100755 index 39657358dc..67131255ca --- a/test/test_all.py +++ b/test/test_all.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright 2002-2005 Dave Abrahams. # Copyright 2002-2006 Vladimir Prus. @@ -10,8 +10,11 @@ import BoostBuild +import concurrent.futures import os import os.path +import time +import signal import sys xml = "--xml" in sys.argv @@ -30,6 +33,24 @@ BoostBuild.set_defer_annotations(1) +def iterfutures(futures): + while futures: + done, futures = concurrent.futures.wait( + futures,return_when=concurrent.futures.FIRST_COMPLETED) + for future in done: + yield future, futures + + +def run_test(test): + ts = time.perf_counter() + exc = None + try: + __import__(test) + except BaseException as e: + exc = e + return test, time.perf_counter() - ts, exc, BoostBuild.annotations + + def run_tests(critical_tests, other_tests): """ Runs first the critical_tests and then the other_tests. @@ -49,21 +70,48 @@ def run_tests(critical_tests, other_tests): if len(x) > max_test_name_len: max_test_name_len = len(x) + cancelled = False + executor = concurrent.futures.ProcessPoolExecutor() + + def handler(sig, frame): + cancelled = True + processes = executor._processes.values() + executor.shutdown(wait=False, cancel_futures=True) + for process in processes: + process.terminate() + + signal.signal(signal.SIGINT, handler) + pass_count = 0 failures_count = 0 - - for test in all_tests: + start_ts = time.perf_counter() + isatty = sys.stdout.isatty() or "--interactive" in sys.argv + futures = {executor.submit(run_test, test): test for test in all_tests} + for future, pending in iterfutures(futures): + test = futures[future] if not xml: s = "%%-%ds :" % max_test_name_len % test + if isatty: + s = f"\r{s}" print(s, end='') passed = 0 + ts = float('nan') try: - __import__(test) + test, ts, exc, annotations = future.result() + BoostBuild.annotations += annotations + if exc is not None: + raise exc from None passed = 1 + except concurrent.futures.process.BrokenProcessPool: + # It could be us who broke the pool by terminating its threads + if not cancelled: + raise except KeyboardInterrupt: """This allows us to abort the testing manually using Ctrl-C.""" - raise + print("\n\nTesting was cancelled by external signal.") + cancelled = True + break except SystemExit as e: """This is the regular way our test scripts are supposed to report test failures.""" @@ -98,10 +146,19 @@ def run_tests(critical_tests, other_tests): if not xml: if passed: - print("PASSED") + print(f"PASSED {ts * 1000:>5.0f}ms") else: - print("FAILED") + print(f"FAILED {ts * 1000:>5.0f}ms") BoostBuild.flush_annotations() + + if isatty: + msg = ", ".join(futures[future] for future in pending if future.running()) + if msg: + msg = f"[{len(futures) - len(pending)}/{len(futures)}] {msg}" + max_len = max_test_name_len + len(" :PASSED 12345ms") + if len(msg) > max_len: + msg = msg[:max_len - 3] + "..." + print(msg, end='') else: rs = "succeed" if not passed: @@ -124,14 +181,15 @@ def run_tests(critical_tests, other_tests): open("test_results.txt", "w").close() if not xml: - print(''' + print(f''' === Test summary === - PASS: %d - FAIL: %d - ''' % (pass_count, failures_count)) + PASS: {pass_count} + FAIL: {failures_count} + TIME: {time.perf_counter() - start_ts:.0f}s + ''') # exit with failure with failures - if failures_count > 0: + if cancelled or failures_count > 0: sys.exit(1) def last_failed_test(): @@ -154,7 +212,7 @@ def reorder_tests(tests, first_test): return tests -critical_tests = ["unit_tests", "module_actions", "core_d12", +critical_tests = ["docs", "unit_tests", "module_actions", "core_d12", "core_typecheck", "core_delete_module", "core_language", "core_arguments", "core_varnames", "core_import_module"] @@ -251,6 +309,7 @@ def reorder_tests(tests, first_test): "inherited_dependency", "inline", "install_build_no", + "lang_asm", "libjpeg", "liblzma", "libpng", @@ -347,8 +406,7 @@ def reorder_tests(tests, first_test): if toolset.startswith("clang") or toolset.startswith("gcc") or toolset.startswith("msvc"): tests.append("pch") - if sys.platform != "darwin": # clang-darwin does not yet support - tests.append("feature_force_include") + tests.append("feature_force_include") # Clang includes Objective-C driver everywhere, but GCC usually in a separate gobj package if toolset.startswith("clang") or "darwin" in toolset: @@ -367,7 +425,8 @@ def reorder_tests(tests, first_test): tests.append("example_customization") # Requires gettext tools. tests.append("example_gettext") -elif not xml: +elif not xml and __name__ == "__main__": print("Note: skipping extra tests") -run_tests(critical_tests, tests) +if __name__ == "__main__": + run_tests(critical_tests, tests) diff --git a/test/test_rc.py b/test/test_rc.py index 0c0224f911..4241a1ad47 100755 --- a/test/test_rc.py +++ b/test/test_rc.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright 2012 Jurko Gospodnetic # Distributed under the Boost Software License, Version 1.0. diff --git a/test/testing.py b/test/testing.py index c3d5f83a1f..e34ab11f4c 100755 --- a/test/testing.py +++ b/test/testing.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright 2008 Jurko Gospodnetic # Copyright 2017 Steven Watanabe @@ -82,6 +82,62 @@ def test_run_fail(): t.cleanup() + +def test_run_execute_off(): + t = BoostBuild.Tester(use_test_config=False) + + t.write("pass.cpp", "int main() {}\n") + t.write("fail-run.cpp", "int main() { return 1; }\n") + t.write("Jamroot.jam", """\ +import testing ; +import notfile ; + +rule check ( target : source : properties * ) +{ + ECHO executed $(target:G=) $(source:G=) ; +} + +run pass.cpp ; +run-fail fail-run.cpp ; +notfile a : @check : pass ; +notfile b : @check : fail-run ; +""") + + t.run_build_system(["testing.execute=off"]) + t.expect_addition([ + "bin/pass.test/$toolset/debug*/pass.obj", + "bin/pass.test/$toolset/debug*/pass.exe", + "bin/fail-run.test/$toolset/debug*/fail-run.obj", + "bin/fail-run.test/$toolset/debug*/fail-run.exe", + ]) + t.fail_test("executed" in t.stdout()) + t.expect_nothing_more() + + t.run_build_system() + t.expect_addition([ + "bin/pass.test/$toolset/debug*/pass.output", + "bin/pass.test/$toolset/debug*/pass.run", + "bin/pass.test/$toolset/debug*/pass.test", + "bin/fail-run.test/$toolset/debug*/fail-run.output", + "bin/fail-run.test/$toolset/debug*/fail-run.run", + "bin/fail-run.test/$toolset/debug*/fail-run.test", + ]) + t.expect_output_lines([ + "executed a pass.test", + "executed b fail-run.test", + ]) + t.expect_nothing_more() + + t.run_build_system() + t.expect_nothing_more() + + t.run_build_system(["testing.execute=off"]) + t.fail_test("executed" in t.stdout()) + t.expect_nothing_more() + + t.cleanup() + + def test_run_change(): """Tests that the test file is removed when a test fails after it previously passed.""" @@ -541,6 +597,7 @@ def test_files_with_spaces_in_their_name(): test_run() test_run_fail() +test_run_execute_off() test_run_change() test_run_path() test_run_args() diff --git a/test/timedata.py b/test/timedata.py index 007a409c8b..6d66b6b0b2 100644 --- a/test/timedata.py +++ b/test/timedata.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright 2005 David Abrahams # Copyright 2008, 2012 Jurko Gospodnetic diff --git a/test/toolset-mock/project-config.jam b/test/toolset-mock/project-config.jam index 36c5337e1a..82802f143b 100644 --- a/test/toolset-mock/project-config.jam +++ b/test/toolset-mock/project-config.jam @@ -12,33 +12,23 @@ path-constant here : . ; local PYTHON = [ os.environ PYTHON_CMD ] ; -using gcc : 4.8.3 : $(PYTHON) $(here)/src/gcc-4.8.3-linux.py : : linux ; -using gcc : 4.2.1 : $(PYTHON) $(here)/src/gcc-4.2.1-darwin.py : : darwin ; +local ar = $(PYTHON)\"\ \"$(here)/src/ar.py ; + +using gcc : 4.8.3 : $(PYTHON) $(here)/src/gcc-4.8.3-linux.py : $(ar) : linux ; +using gcc : 4.2.1 : $(PYTHON) $(here)/src/gcc-4.2.1-darwin.py : $(ar) : darwin ; # hard-code this to make the test work on other platforms modules.poke darwin : .host-osx-version : 10.11.0 ; using darwin : 4.2.1 : $(PYTHON) $(here)/src/darwin-4.2.1.py - : $(here)/src/bin/libtool - $(here)/src/bin/strip + : $(PYTHON)\"\ \"$(here)/src/libtool.py + $(PYTHON)\"\ \"$(here)/src/strip.py : darwin ; -using clang-darwin : 3.9.0 : $(PYTHON) $(here)/src/clang-3.9.0-darwin.py - : $(here)/src/bin/ar - ; - -using clang-linux : 3.9.0 : $(PYTHON) $(here)/src/clang-linux-3.9.0.py - : $(here)/src/bin/ar - ; - -using clang-vxworks : 4.0.1 : $(PYTHON) $(here)/src/clang-vxworks-4.0.1.py - : $(here)/src/bin/ld - $(here)/src/bin/ar - ; - -using intel-darwin : 10.2 : $(PYTHON) $(here)/src/intel-darwin-10.2.py - : $(here)/src/bin/ar - ; +using clang-darwin : 3.9.0 : $(PYTHON) $(here)/src/clang-3.9.0-darwin.py : $(ar) ; +using clang-linux : 3.9.0 : $(PYTHON) $(here)/src/clang-linux-3.9.0.py : $(ar) ; +using clang-vxworks : 4.0.1 : $(PYTHON) $(here)/src/clang-vxworks-4.0.1.py : $(ar) ; +using intel-darwin : 10.2 : $(PYTHON) $(here)/src/intel-darwin-10.2.py : $(ar) ; # TODO: msvc toolset should not require this env variable to be presented modules.poke .ENVIRON : PROCESSOR_ARCHITEW6432 : amd64 ; diff --git a/test/toolset-mock/src/Jamroot.jam b/test/toolset-mock/src/Jamroot.jam index 172e26db7d..a2f1678969 100644 --- a/test/toolset-mock/src/Jamroot.jam +++ b/test/toolset-mock/src/Jamroot.jam @@ -4,44 +4,9 @@ # (See accompanying file LICENSE.txt or copy at # https://www.bfgroup.xyz/b2/LICENSE.txt) -import os ; import print ; -import regex ; import feature ; -.PYTHON = [ os.environ PYTHON_CMD ] ; -path-constant .AR : ar.py ; -path-constant .LIBTOOL : libtool.py ; -path-constant .STRIP : strip.py ; -path-constant .LD : ld.py ; - -rule c-escape ( str ) -{ - return [ regex.replace $(str) \\\\ \\\\ ] ; -} - -rule cfg-header ( target : : properties * ) -{ - local PYTHON = [ c-escape $(.PYTHON) ] ; - local AR = [ c-escape $(.AR) ] ; - local LIBTOOL = [ c-escape $(.LIBTOOL) ] ; - local STRIP = [ c-escape $(.STRIP) ] ; - local LD = [ c-escape $(.LD) ] ; - print.output $(target) ; - print.text "#define PYTHON_CMD "\"$(PYTHON)\" : true ; - print.text "#define AR_CMD "\"$(AR)\" : true ; - print.text "#define LIBTOOL_CMD "\"$(LIBTOOL)\" : true ; - print.text "#define STRIP_CMD "\"$(STRIP)\" : true ; - print.text "#define LD_CMD "\"$(LD)\" : true ; -} - -# We can only build one variant at a time and we need to have a fixed path -project : requirements bin ; - -make config.h : : @cfg-header ; - -project : requirements config.h ; - rule write-target-os ( target : : properties * ) { local target-os = [ feature.defaults ] ; @@ -50,8 +15,3 @@ rule write-target-os ( target : : properties * ) } make target-os.txt : : @write-target-os ; - -exe ar : [ obj ar.obj : mock-program.cpp : PY_SCRIPT=AR_CMD ] ; -exe libtool : [ obj libtool.obj : mock-program.cpp : PY_SCRIPT=LIBTOOL_CMD ] ; -exe strip : [ obj strip.obj : mock-program.cpp : PY_SCRIPT=STRIP_CMD ] ; -exe ld : [ obj ld.obj : mock-program.cpp : PY_SCRIPT=LD_CMD ] ; diff --git a/test/toolset-mock/src/ar.py b/test/toolset-mock/src/ar.py index 2ecb7d7e75..af787ced35 100644 --- a/test/toolset-mock/src/ar.py +++ b/test/toolset-mock/src/ar.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # coding: utf-8 # # Copyright 2017-2018 Steven Watanabe @@ -20,8 +20,8 @@ command('ar', 'rsc', output_file('bin/intel-darwin-10.2/debug/link-static/runtime-link-static/target-os-darwin/libl1.a'), input_file('bin/intel-darwin-10.2/debug/link-static/runtime-link-static/target-os-darwin/lib.o')) command('ar', 'rsc', output_file('bin/clang-linux-3.9.0/debug/link-static/libl1.a'), input_file('bin/clang-linux-3.9.0/debug/link-static/lib.o')) command('ar', 'rsc', output_file('bin/clang-linux-3.9.0/debug/link-static/runtime-link-static/libl1.a'), input_file('bin/clang-linux-3.9.0/debug/link-static/runtime-link-static/lib.o')) -command('ar', 'rcu', output_file('bin/clang-vxworks-4.0.1/debug/link-static/libl1.a'), input_file('bin/clang-vxworks-4.0.1/debug/link-static/lib.o')) -command('ar', 'rcu', output_file('bin/clang-vxworks-4.0.1/debug/link-static/runtime-link-static/libl1.a'), input_file('bin/clang-vxworks-4.0.1/debug/link-static/runtime-link-static/lib.o')) +command('ar', 'rsc', output_file('bin/clang-vxworks-4.0.1/debug/link-static/libl1.a'), input_file('bin/clang-vxworks-4.0.1/debug/link-static/lib.o')) +command('ar', 'rsc', output_file('bin/clang-vxworks-4.0.1/debug/link-static/runtime-link-static/libl1.a'), input_file('bin/clang-vxworks-4.0.1/debug/link-static/runtime-link-static/lib.o')) command('ar', 'rsc', output_file('bin/clang-linux-3.9.0/debug/link-static/target-os-windows/libl1.lib'), input_file('bin/clang-linux-3.9.0/debug/link-static/target-os-windows/lib.obj')) main() diff --git a/test/toolset-mock/src/clang-3.9.0-darwin.py b/test/toolset-mock/src/clang-3.9.0-darwin.py index 85bf386106..00974bea4c 100644 --- a/test/toolset-mock/src/clang-3.9.0-darwin.py +++ b/test/toolset-mock/src/clang-3.9.0-darwin.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # # Copyright 2017 Steven Watanabe # @@ -12,37 +12,37 @@ # all builds are multi-threaded for darwin if allow_properties("variant=debug", "link=shared", "runtime-link=shared"): - command('clang++', '-x', 'c++', unordered('-O0', '-fno-inline', '-Wall', '-g', '-fPIC'), '-c', '-o', output_file('bin/clang-darwin-3.9.0/debug/target-os-darwin/lib.o'), input_file(source='lib.cpp')) - command('clang++', '-o', output_file('bin/clang-darwin-3.9.0/debug/target-os-darwin/libl1.dylib'), '-single_module', '-dynamiclib', '-install_name', '@rpath/libl1.dylib', input_file('bin/clang-darwin-3.9.0/debug/target-os-darwin/lib.o'), unordered('-g', '-fPIC')) - command('clang++', '-x', 'c++', unordered('-O0', '-fno-inline', '-Wall', '-g', '-fPIC'), '-c', '-o', output_file('bin/clang-darwin-3.9.0/debug/target-os-darwin/main.o'), input_file(source='main.cpp')) - command('clang++', '-o', output_file('bin/clang-darwin-3.9.0/debug/target-os-darwin/test'), input_file('bin/clang-darwin-3.9.0/debug/target-os-darwin/main.o'), input_file('bin/clang-darwin-3.9.0/debug/target-os-darwin/libl1.dylib'), unordered('-g', '-fPIC')) + command('clang++', unordered('-O0', '-fno-inline', '-Wall', '-g', '-fPIC'), '-c', '-o', output_file('bin/clang-darwin-3.9.0/debug/target-os-darwin/lib.o'), input_file(source='lib.cpp')) + command('clang++', '-o', output_file('bin/clang-darwin-3.9.0/debug/target-os-darwin/libl1.dylib'), '-Wl,-install_name', '-Wl,@rpath/libl1.dylib', '-dynamiclib', '-single_module', input_file('bin/clang-darwin-3.9.0/debug/target-os-darwin/lib.o'), unordered('-g', '-fPIC')) + command('clang++', unordered('-O0', '-fno-inline', '-Wall', '-g', '-fPIC'), '-c', '-o', output_file('bin/clang-darwin-3.9.0/debug/target-os-darwin/main.o'), input_file(source='main.cpp')) + command('clang++', '-Wl,-rpath', arg('-Wl,', target_path('bin/clang-darwin-3.9.0/debug/target-os-darwin/libl1.dylib')), '-o', output_file('bin/clang-darwin-3.9.0/debug/target-os-darwin/test'), input_file('bin/clang-darwin-3.9.0/debug/target-os-darwin/main.o'), input_file('bin/clang-darwin-3.9.0/debug/target-os-darwin/libl1.dylib'), unordered('-g', '-fPIC')) if allow_properties("variant=release", "link=shared", "runtime-link=shared"): - command('clang++', '-x', 'c++', unordered('-O3', '-Wno-inline', '-Wall', '-fPIC'), '-DNDEBUG', '-c', '-o', output_file('bin/clang-darwin-3.9.0/release/target-os-darwin/lib.o'), input_file(source='lib.cpp')) - command('clang++', '-v', '-o', output_file('bin/clang-darwin-3.9.0/release/target-os-darwin/libl1.dylib'), '-single_module', '-dynamiclib', '-install_name', '@rpath/libl1.dylib', input_file('bin/clang-darwin-3.9.0/release/target-os-darwin/lib.o'), '-fPIC') - command('clang++', '-x', 'c++', unordered('-O3', '-Wno-inline', '-Wall', '-fPIC'), '-DNDEBUG', '-c', '-o', output_file('bin/clang-darwin-3.9.0/release/target-os-darwin/main.o'), input_file(source='main.cpp')) - command('clang++', '-v', '-o', output_file('bin/clang-darwin-3.9.0/release/target-os-darwin/test'), input_file('bin/clang-darwin-3.9.0/release/target-os-darwin/main.o'), input_file('bin/clang-darwin-3.9.0/release/target-os-darwin/libl1.dylib'), '-fPIC') + command('clang++', unordered('-O3', '-Wno-inline', '-Wall', '-fPIC'), '-DNDEBUG', '-c', '-o', output_file('bin/clang-darwin-3.9.0/release/target-os-darwin/lib.o'), input_file(source='lib.cpp')) + command('clang++', '-o', output_file('bin/clang-darwin-3.9.0/release/target-os-darwin/libl1.dylib'), '-Wl,-install_name', '-Wl,@rpath/libl1.dylib', '-dynamiclib', '-single_module', input_file('bin/clang-darwin-3.9.0/release/target-os-darwin/lib.o'), '-fPIC', '-v') + command('clang++', unordered('-O3', '-Wno-inline', '-Wall', '-fPIC'), '-DNDEBUG', '-c', '-o', output_file('bin/clang-darwin-3.9.0/release/target-os-darwin/main.o'), input_file(source='main.cpp')) + command('clang++', '-Wl,-rpath', arg('-Wl,', target_path('bin/clang-darwin-3.9.0/release/target-os-darwin/libl1.dylib')), '-o', output_file('bin/clang-darwin-3.9.0/release/target-os-darwin/test'), input_file('bin/clang-darwin-3.9.0/release/target-os-darwin/main.o'), input_file('bin/clang-darwin-3.9.0/release/target-os-darwin/libl1.dylib'), '-fPIC', '-v') if allow_properties("variant=debug", "link=static", "runtime-link=shared"): - command('clang++', '-x', 'c++', unordered('-O0', '-fno-inline', '-Wall', '-g'), '-c', '-o', output_file('bin/clang-darwin-3.9.0/debug/link-static/target-os-darwin/lib.o'), input_file(source='lib.cpp')) - command('clang++', '-x', 'c++', unordered('-O0', '-fno-inline', '-Wall', '-g'), '-c', '-o', output_file('bin/clang-darwin-3.9.0/debug/link-static/target-os-darwin/main.o'), input_file(source='main.cpp')) + command('clang++', unordered('-O0', '-fno-inline', '-Wall', '-g'), '-c', '-o', output_file('bin/clang-darwin-3.9.0/debug/link-static/target-os-darwin/lib.o'), input_file(source='lib.cpp')) + command('clang++', unordered('-O0', '-fno-inline', '-Wall', '-g'), '-c', '-o', output_file('bin/clang-darwin-3.9.0/debug/link-static/target-os-darwin/main.o'), input_file(source='main.cpp')) command('clang++', '-o', output_file('bin/clang-darwin-3.9.0/debug/link-static/target-os-darwin/test'), input_file('bin/clang-darwin-3.9.0/debug/link-static/target-os-darwin/main.o'), input_file('bin/clang-darwin-3.9.0/debug/link-static/target-os-darwin/libl1.a'), '-g') if allow_properties("variant=debug", "link=static", "runtime-link=static"): - command('clang++', '-x', 'c++', unordered('-O0', '-fno-inline', '-Wall', '-g'), '-c', '-o', output_file('bin/clang-darwin-3.9.0/debug/link-static/runtime-link-static/target-os-darwin/lib.o'), input_file(source='lib.cpp')) - command('clang++', '-x', 'c++', unordered('-O0', '-fno-inline', '-Wall', '-g'), '-c', '-o', output_file('bin/clang-darwin-3.9.0/debug/link-static/runtime-link-static/target-os-darwin/main.o'), input_file(source='main.cpp')) + command('clang++', unordered('-O0', '-fno-inline', '-Wall', '-g'), '-c', '-o', output_file('bin/clang-darwin-3.9.0/debug/link-static/runtime-link-static/target-os-darwin/lib.o'), input_file(source='lib.cpp')) + command('clang++', unordered('-O0', '-fno-inline', '-Wall', '-g'), '-c', '-o', output_file('bin/clang-darwin-3.9.0/debug/link-static/runtime-link-static/target-os-darwin/main.o'), input_file(source='main.cpp')) command('clang++', '-o', output_file('bin/clang-darwin-3.9.0/debug/link-static/runtime-link-static/target-os-darwin/test'), input_file('bin/clang-darwin-3.9.0/debug/link-static/runtime-link-static/target-os-darwin/main.o'), input_file('bin/clang-darwin-3.9.0/debug/link-static/runtime-link-static/target-os-darwin/libl1.a'), unordered('-g', '-static')) if allow_properties("variant=debug", "link=shared", "runtime-link=shared", "architecture=x86", "address-model=32"): - command('clang++', '-x', 'c++', unordered('-O0', '-fno-inline', '-Wall', '-g', '-march=i686', '-fPIC', '-m32'), '-c', '-o', output_file('bin/clang-darwin-3.9.0/debug/x86/target-os-darwin/lib.o'), input_file(source='lib.cpp')) - command('clang++', '-o', output_file('bin/clang-darwin-3.9.0/debug/x86/target-os-darwin/libl1.dylib'), '-single_module', '-dynamiclib', '-install_name', '@rpath/libl1.dylib', input_file('bin/clang-darwin-3.9.0/debug/x86/target-os-darwin/lib.o'), unordered('-g', '-march=i686', '-fPIC', '-m32')) - command('clang++', '-x', 'c++', unordered('-O0', '-fno-inline', '-Wall', '-g', '-march=i686', '-fPIC', '-m32'), '-c', '-o', output_file('bin/clang-darwin-3.9.0/debug/x86/target-os-darwin/main.o'), input_file(source='main.cpp')) - command('clang++', '-o', output_file('bin/clang-darwin-3.9.0/debug/x86/target-os-darwin/test'), input_file('bin/clang-darwin-3.9.0/debug/x86/target-os-darwin/main.o'), input_file('bin/clang-darwin-3.9.0/debug/x86/target-os-darwin/libl1.dylib'), unordered('-g', '-march=i686', '-fPIC', '-m32')) + command('clang++', unordered('-O0', '-fno-inline', '-Wall', '-g', '-march=i686', '-fPIC', '-m32'), '-c', '-o', output_file('bin/clang-darwin-3.9.0/debug/x86/target-os-darwin/lib.o'), input_file(source='lib.cpp')) + command('clang++', '-o', output_file('bin/clang-darwin-3.9.0/debug/x86/target-os-darwin/libl1.dylib'), '-Wl,-install_name', '-Wl,@rpath/libl1.dylib', '-dynamiclib', '-single_module', input_file('bin/clang-darwin-3.9.0/debug/x86/target-os-darwin/lib.o'), unordered('-g', '-march=i686', '-fPIC', '-m32')) + command('clang++', unordered('-O0', '-fno-inline', '-Wall', '-g', '-march=i686', '-fPIC', '-m32'), '-c', '-o', output_file('bin/clang-darwin-3.9.0/debug/x86/target-os-darwin/main.o'), input_file(source='main.cpp')) + command('clang++', '-Wl,-rpath', arg('-Wl,', target_path('bin/clang-darwin-3.9.0/debug/x86/target-os-darwin/libl1.dylib')), '-o', output_file('bin/clang-darwin-3.9.0/debug/x86/target-os-darwin/test'), input_file('bin/clang-darwin-3.9.0/debug/x86/target-os-darwin/main.o'), input_file('bin/clang-darwin-3.9.0/debug/x86/target-os-darwin/libl1.dylib'), unordered('-g', '-march=i686', '-fPIC', '-m32')) if allow_properties("variant=debug", "link=shared", "runtime-link=shared", "cxxstd=latest"): - command('clang++', '-x', 'c++', unordered('-O0', '-fno-inline', '-Wall', '-g', '-fPIC', '-std=c++1z'), '-c', '-o', output_file('bin/clang-darwin-3.9.0/debug/target-os-darwin/lib.o'), input_file(source='lib.cpp')) - command('clang++', '-o', output_file('bin/clang-darwin-3.9.0/debug/target-os-darwin/libl1.dylib'), '-single_module', '-dynamiclib', '-install_name', '@rpath/libl1.dylib', input_file('bin/clang-darwin-3.9.0/debug/target-os-darwin/lib.o'), unordered('-g', '-fPIC', '-std=c++1z')) - command('clang++', '-x', 'c++', unordered('-O0', '-fno-inline', '-Wall', '-g', '-fPIC', '-std=c++1z'), '-c', '-o', output_file('bin/clang-darwin-3.9.0/debug/target-os-darwin/main.o'), input_file(source='main.cpp')) - command('clang++', '-o', output_file('bin/clang-darwin-3.9.0/debug/target-os-darwin/test'), input_file('bin/clang-darwin-3.9.0/debug/target-os-darwin/main.o'), input_file('bin/clang-darwin-3.9.0/debug/target-os-darwin/libl1.dylib'), unordered('-g', '-fPIC', '-std=c++1z')) + command('clang++', unordered('-O0', '-fno-inline', '-Wall', '-g', '-fPIC', '-std=c++1z'), '-c', '-o', output_file('bin/clang-darwin-3.9.0/debug/target-os-darwin/lib.o'), input_file(source='lib.cpp')) + command('clang++', '-o', output_file('bin/clang-darwin-3.9.0/debug/target-os-darwin/libl1.dylib'), '-Wl,-install_name', '-Wl,@rpath/libl1.dylib', '-dynamiclib', '-single_module', input_file('bin/clang-darwin-3.9.0/debug/target-os-darwin/lib.o'), unordered('-g', '-fPIC', '-std=c++1z')) + command('clang++', unordered('-O0', '-fno-inline', '-Wall', '-g', '-fPIC', '-std=c++1z'), '-c', '-o', output_file('bin/clang-darwin-3.9.0/debug/target-os-darwin/main.o'), input_file(source='main.cpp')) + command('clang++', '-Wl,-rpath', arg('-Wl,', target_path('bin/clang-darwin-3.9.0/debug/target-os-darwin/libl1.dylib')), '-o', output_file('bin/clang-darwin-3.9.0/debug/target-os-darwin/test'), input_file('bin/clang-darwin-3.9.0/debug/target-os-darwin/main.o'), input_file('bin/clang-darwin-3.9.0/debug/target-os-darwin/libl1.dylib'), unordered('-g', '-fPIC', '-std=c++1z')) main() diff --git a/test/toolset-mock/src/clang-linux-3.9.0.py b/test/toolset-mock/src/clang-linux-3.9.0.py index 9c8cc80308..d46a86200e 100644 --- a/test/toolset-mock/src/clang-linux-3.9.0.py +++ b/test/toolset-mock/src/clang-linux-3.9.0.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # coding: utf-8 # # Copyright 2017 Steven Watanabe @@ -15,73 +15,73 @@ # target-os=linux .. if allow_properties('target-os=linux', 'variant=debug', 'link=shared', 'threading=single', 'runtime-link=shared'): - command('clang++', unordered(ordered('-x', 'c++'), '-O0', '-fno-inline', '-Wall', '-g', '-fPIC', '-c'), '-o', output_file('bin/clang-linux-3.9.0/debug/lib.o'), input_file(source='lib.cpp')) + command('clang++', unordered('-O0', '-fno-inline', '-Wall', '-g', '-fPIC', '-c'), '-o', output_file('bin/clang-linux-3.9.0/debug/lib.o'), input_file(source='lib.cpp')) command('clang++', '-o', output_file('bin/clang-linux-3.9.0/debug/libl1.so'), '-Wl,-soname', '-Wl,libl1.so', '-shared', '-Wl,--start-group', input_file('bin/clang-linux-3.9.0/debug/lib.o'), '-Wl,-Bstatic', '-Wl,-Bdynamic', '-Wl,--end-group', unordered('-g', '-fPIC')) - command('clang++', unordered(ordered('-x', 'c++'), '-O0', '-fno-inline', '-Wall', '-g', '-fPIC', '-c'), '-o', output_file('bin/clang-linux-3.9.0/debug/main.o'), input_file(source='main.cpp')) - command('clang++', '-o', output_file('bin/clang-linux-3.9.0/debug/test'), '-Wl,-R', arg('-Wl,', target_path('bin/clang-linux-3.9.0/debug/libl1.so')), '-Wl,-rpath-link', arg('-Wl,', target_path('bin/clang-linux-3.9.0/debug/libl1.so')), '-Wl,--start-group', input_file('bin/clang-linux-3.9.0/debug/main.o'), input_file('bin/clang-linux-3.9.0/debug/libl1.so'), '-Wl,-Bstatic', '-Wl,-Bdynamic', '-Wl,--end-group', unordered('-g', '-fPIC')) + command('clang++', unordered('-O0', '-fno-inline', '-Wall', '-g', '-fPIC', '-c'), '-o', output_file('bin/clang-linux-3.9.0/debug/main.o'), input_file(source='main.cpp')) + command('clang++', unordered(ordered('-o', output_file('bin/clang-linux-3.9.0/debug/test')), ordered('-Wl,-rpath', arg('-Wl,', target_path('bin/clang-linux-3.9.0/debug/libl1.so'))), ordered('-Wl,-rpath-link', arg('-Wl,', target_path('bin/clang-linux-3.9.0/debug/libl1.so'))), ordered('-Wl,--start-group', input_file('bin/clang-linux-3.9.0/debug/main.o'), input_file('bin/clang-linux-3.9.0/debug/libl1.so'), '-Wl,-Bstatic', '-Wl,-Bdynamic', '-Wl,--end-group'), unordered('-g', '-fPIC'))) if allow_properties('target-os=linux', 'variant=release', 'link=shared', 'threading=single', 'runtime-link=shared', 'strip=on'): - command('clang++', unordered(ordered('-x', 'c++'), '-O3', '-Wno-inline', '-Wall', '-fPIC', '-DNDEBUG', '-c'), '-o', output_file('bin/clang-linux-3.9.0/release/lib.o'), input_file(source='lib.cpp')) + command('clang++', unordered('-O3', '-Wno-inline', '-Wall', '-fPIC', '-DNDEBUG', '-c'), '-o', output_file('bin/clang-linux-3.9.0/release/lib.o'), input_file(source='lib.cpp')) command('clang++', '-o', output_file('bin/clang-linux-3.9.0/release/libl1.so'), '-Wl,-soname', '-Wl,libl1.so', '-shared', '-Wl,--start-group', input_file('bin/clang-linux-3.9.0/release/lib.o'), '-Wl,-Bstatic', '-Wl,-Bdynamic', '-Wl,--end-group', unordered('-fPIC', '-Wl,--strip-all')) - command('clang++', unordered(ordered('-x', 'c++'), '-O3', '-Wno-inline', '-Wall', '-fPIC', '-DNDEBUG', '-c'), '-o', output_file('bin/clang-linux-3.9.0/release/main.o'), input_file(source='main.cpp')) - command('clang++', '-o', output_file('bin/clang-linux-3.9.0/release/test'), '-Wl,-R', arg('-Wl,', target_path('bin/clang-linux-3.9.0/release/libl1.so')), '-Wl,-rpath-link', arg('-Wl,', target_path('bin/clang-linux-3.9.0/release/libl1.so')), '-Wl,--start-group', input_file('bin/clang-linux-3.9.0/release/main.o'), input_file('bin/clang-linux-3.9.0/release/libl1.so'), '-Wl,-Bstatic', '-Wl,-Bdynamic', '-Wl,--end-group', unordered('-fPIC', '-Wl,--strip-all')) + command('clang++', unordered('-O3', '-Wno-inline', '-Wall', '-fPIC', '-DNDEBUG', '-c'), '-o', output_file('bin/clang-linux-3.9.0/release/main.o'), input_file(source='main.cpp')) + command('clang++', unordered(ordered('-o', output_file('bin/clang-linux-3.9.0/release/test')), ordered('-Wl,-rpath', arg('-Wl,', target_path('bin/clang-linux-3.9.0/release/libl1.so'))), ordered('-Wl,-rpath-link', arg('-Wl,', target_path('bin/clang-linux-3.9.0/release/libl1.so'))), ordered('-Wl,--start-group', input_file('bin/clang-linux-3.9.0/release/main.o'), input_file('bin/clang-linux-3.9.0/release/libl1.so'), '-Wl,-Bstatic', '-Wl,-Bdynamic', '-Wl,--end-group'), unordered('-fPIC', '-Wl,--strip-all'))) if allow_properties('target-os=linux', 'variant=debug', 'link=shared', 'threading=multi', 'runtime-link=shared'): - command('clang++', unordered(ordered('-x', 'c++'), '-O0', '-fno-inline', '-Wall', '-g', '-pthread', '-fPIC', '-c'), '-o', output_file('bin/clang-linux-3.9.0/debug/threading-multi/lib.o'), input_file(source='lib.cpp')) + command('clang++', unordered('-O0', '-fno-inline', '-Wall', '-g', '-pthread', '-fPIC', '-c'), '-o', output_file('bin/clang-linux-3.9.0/debug/threading-multi/lib.o'), input_file(source='lib.cpp')) command('clang++', '-o', output_file('bin/clang-linux-3.9.0/debug/threading-multi/libl1.so'), '-Wl,-soname', '-Wl,libl1.so', '-shared', '-Wl,--start-group', input_file('bin/clang-linux-3.9.0/debug/threading-multi/lib.o'), '-Wl,-Bstatic', '-Wl,-Bdynamic', '-lrt', '-Wl,--end-group', unordered('-g', '-pthread', '-fPIC')) - command('clang++', unordered(ordered('-x', 'c++'), '-O0', '-fno-inline', '-Wall', '-g', '-pthread', '-fPIC', '-c'), '-o', output_file('bin/clang-linux-3.9.0/debug/threading-multi/main.o'), input_file(source='main.cpp')) - command('clang++', '-o', output_file('bin/clang-linux-3.9.0/debug/threading-multi/test'), '-Wl,-R', arg('-Wl,', target_path('bin/clang-linux-3.9.0/debug/threading-multi/libl1.so')), '-Wl,-rpath-link', arg('-Wl,', target_path('bin/clang-linux-3.9.0/debug/threading-multi/libl1.so')), '-Wl,--start-group', input_file('bin/clang-linux-3.9.0/debug/threading-multi/main.o'), input_file('bin/clang-linux-3.9.0/debug/threading-multi/libl1.so'), '-Wl,-Bstatic', '-Wl,-Bdynamic', '-lrt', '-Wl,--end-group', unordered('-g', '-pthread', '-fPIC')) + command('clang++', unordered('-O0', '-fno-inline', '-Wall', '-g', '-pthread', '-fPIC', '-c'), '-o', output_file('bin/clang-linux-3.9.0/debug/threading-multi/main.o'), input_file(source='main.cpp')) + command('clang++', unordered(ordered('-o', output_file('bin/clang-linux-3.9.0/debug/threading-multi/test')), ordered('-Wl,-rpath', arg('-Wl,', target_path('bin/clang-linux-3.9.0/debug/threading-multi/libl1.so'))), ordered('-Wl,-rpath-link', arg('-Wl,', target_path('bin/clang-linux-3.9.0/debug/threading-multi/libl1.so'))), ordered('-Wl,--start-group', input_file('bin/clang-linux-3.9.0/debug/threading-multi/main.o'), input_file('bin/clang-linux-3.9.0/debug/threading-multi/libl1.so'), '-Wl,-Bstatic', '-Wl,-Bdynamic', '-lrt', '-Wl,--end-group'), unordered('-g', '-pthread', '-fPIC'))) if allow_properties('target-os=linux', 'variant=debug', 'link=static', 'threading=single', 'runtime-link=shared'): - command('clang++', unordered(ordered('-x', 'c++'), '-O0', '-fno-inline', '-Wall', '-g', '-c'), '-o', output_file('bin/clang-linux-3.9.0/debug/link-static/lib.o'), input_file(source='lib.cpp')) - command('clang++', unordered(ordered('-x', 'c++'), '-O0', '-fno-inline', '-Wall', '-g', '-c'), '-o', output_file('bin/clang-linux-3.9.0/debug/link-static/main.o'), input_file(source='main.cpp')) + command('clang++', unordered('-O0', '-fno-inline', '-Wall', '-g', '-c'), '-o', output_file('bin/clang-linux-3.9.0/debug/link-static/lib.o'), input_file(source='lib.cpp')) + command('clang++', unordered('-O0', '-fno-inline', '-Wall', '-g', '-c'), '-o', output_file('bin/clang-linux-3.9.0/debug/link-static/main.o'), input_file(source='main.cpp')) command('clang++', '-o', output_file('bin/clang-linux-3.9.0/debug/link-static/test'), '-Wl,--start-group', input_file('bin/clang-linux-3.9.0/debug/link-static/main.o'), input_file('bin/clang-linux-3.9.0/debug/link-static/libl1.a'), '-Wl,-Bstatic', '-Wl,-Bdynamic', '-Wl,--end-group', '-g') if allow_properties('target-os=linux', 'variant=debug', 'link=static', 'threading=single', 'runtime-link=static'): - command('clang++', unordered(ordered('-x', 'c++'), '-O0', '-fno-inline', '-Wall', '-g', '-c'), '-o', output_file('bin/clang-linux-3.9.0/debug/link-static/runtime-link-static/lib.o'), input_file(source='lib.cpp')) - command('clang++', unordered(ordered('-x', 'c++'), '-O0', '-fno-inline', '-Wall', '-g', '-c'), '-o', output_file('bin/clang-linux-3.9.0/debug/link-static/runtime-link-static/main.o'), input_file(source='main.cpp')) + command('clang++', unordered('-O0', '-fno-inline', '-Wall', '-g', '-c'), '-o', output_file('bin/clang-linux-3.9.0/debug/link-static/runtime-link-static/lib.o'), input_file(source='lib.cpp')) + command('clang++', unordered('-O0', '-fno-inline', '-Wall', '-g', '-c'), '-o', output_file('bin/clang-linux-3.9.0/debug/link-static/runtime-link-static/main.o'), input_file(source='main.cpp')) command('clang++', '-o', output_file('bin/clang-linux-3.9.0/debug/link-static/runtime-link-static/test'), '-Wl,--start-group', input_file('bin/clang-linux-3.9.0/debug/link-static/runtime-link-static/main.o'), input_file('bin/clang-linux-3.9.0/debug/link-static/runtime-link-static/libl1.a'), '-Wl,--end-group', unordered('-g', '-static')) if allow_properties('target-os=linux', 'variant=debug', 'link=shared', 'threading=single', 'runtime-link=shared', 'architecture=x86', 'address-model=32'): - command('clang++', unordered(ordered('-x', 'c++'), '-O0', '-fno-inline', '-Wall', '-g', '-march=i686', '-m32', '-fPIC', '-c', '--target=i386-pc-linux'), '-o', output_file('bin/clang-linux-3.9.0/debug/lib.o'), input_file(source='lib.cpp')) + command('clang++', unordered('-O0', '-fno-inline', '-Wall', '-g', '-march=i686', '-m32', '-fPIC', '-c', '--target=i386-pc-linux'), '-o', output_file('bin/clang-linux-3.9.0/debug/lib.o'), input_file(source='lib.cpp')) command('clang++', '-o', output_file('bin/clang-linux-3.9.0/debug/libl1.so'), '-Wl,-soname', '-Wl,libl1.so', '-shared', '-Wl,--start-group', input_file('bin/clang-linux-3.9.0/debug/lib.o'), '-Wl,-Bstatic', '-Wl,-Bdynamic', '-Wl,--end-group', unordered('-g', '-march=i686', '-fPIC', '-m32', '--target=i386-pc-linux')) - command('clang++', unordered(ordered('-x', 'c++'), '-O0', '-fno-inline', '-Wall', '-g', '-march=i686', '-m32', '-fPIC', '-c', '--target=i386-pc-linux'), '-o', output_file('bin/clang-linux-3.9.0/debug/main.o'), input_file(source='main.cpp')) - command('clang++', '-o', output_file('bin/clang-linux-3.9.0/debug/test'), '-Wl,-R', arg('-Wl,', target_path('bin/clang-linux-3.9.0/debug/libl1.so')), '-Wl,-rpath-link', arg('-Wl,', target_path('bin/clang-linux-3.9.0/debug/libl1.so')), '-Wl,--start-group', input_file('bin/clang-linux-3.9.0/debug/main.o'), input_file('bin/clang-linux-3.9.0/debug/libl1.so'), '-Wl,-Bstatic', '-Wl,-Bdynamic', '-Wl,--end-group', unordered('-g', '-march=i686', '-fPIC', '-m32', '--target=i386-pc-linux')) + command('clang++', unordered('-O0', '-fno-inline', '-Wall', '-g', '-march=i686', '-m32', '-fPIC', '-c', '--target=i386-pc-linux'), '-o', output_file('bin/clang-linux-3.9.0/debug/main.o'), input_file(source='main.cpp')) + command('clang++', unordered(ordered('-o', output_file('bin/clang-linux-3.9.0/debug/test')), ordered('-Wl,-rpath', arg('-Wl,', target_path('bin/clang-linux-3.9.0/debug/libl1.so'))), ordered('-Wl,-rpath-link', arg('-Wl,', target_path('bin/clang-linux-3.9.0/debug/libl1.so'))), ordered('-Wl,--start-group', input_file('bin/clang-linux-3.9.0/debug/main.o'), input_file('bin/clang-linux-3.9.0/debug/libl1.so'), '-Wl,-Bstatic', '-Wl,-Bdynamic', '-Wl,--end-group'), unordered('-g', '-march=i686', '-fPIC', '-m32', '--target=i386-pc-linux'))) # target-os=windows .. if allow_properties('target-os=windows', 'variant=debug', 'link=shared', 'threading=single', 'runtime-link=shared'): - command('clang++', unordered(ordered('-x', 'c++'), '-O0', '-fno-inline', '-Wall', '-g', '-c'), '-o', output_file('bin/clang-linux-3.9.0/debug/target-os-windows/lib.obj'), input_file(source='lib.cpp')) + command('clang++', unordered('-O0', '-fno-inline', '-Wall', '-g', '-c'), '-o', output_file('bin/clang-linux-3.9.0/debug/target-os-windows/lib.obj'), input_file(source='lib.cpp')) command('clang++', '-o', output_file('bin/clang-linux-3.9.0/debug/target-os-windows/l1.dll'), '-shared', '-Wl,--start-group', input_file('bin/clang-linux-3.9.0/debug/target-os-windows/lib.obj'), '-Wl,-Bstatic', '-Wl,-Bdynamic', '-Wl,--end-group', unordered('-g')) - command('clang++', unordered(ordered('-x', 'c++'), '-O0', '-fno-inline', '-Wall', '-g', '-c'), '-o', output_file('bin/clang-linux-3.9.0/debug/target-os-windows/main.obj'), input_file(source='main.cpp')) + command('clang++', unordered('-O0', '-fno-inline', '-Wall', '-g', '-c'), '-o', output_file('bin/clang-linux-3.9.0/debug/target-os-windows/main.obj'), input_file(source='main.cpp')) command('clang++', '-o', output_file('bin/clang-linux-3.9.0/debug/target-os-windows/test.exe'), '-Wl,--start-group', input_file('bin/clang-linux-3.9.0/debug/target-os-windows/main.obj'), input_file('bin/clang-linux-3.9.0/debug/target-os-windows/l1.dll'), '-Wl,-Bstatic', '-Wl,-Bdynamic', '-Wl,--end-group', unordered('-g')) if allow_properties('target-os=windows', 'variant=release', 'link=shared', 'threading=single', 'runtime-link=shared', 'strip=on'): - command('clang++', unordered(ordered('-x', 'c++'), '-O3', '-Wno-inline', '-Wall', '-DNDEBUG', '-c'), '-o', output_file('bin/clang-linux-3.9.0/release/target-os-windows/lib.obj'), input_file(source='lib.cpp')) + command('clang++', unordered('-O3', '-Wno-inline', '-Wall', '-DNDEBUG', '-c'), '-o', output_file('bin/clang-linux-3.9.0/release/target-os-windows/lib.obj'), input_file(source='lib.cpp')) command('clang++', '-o', output_file('bin/clang-linux-3.9.0/release/strip-on/target-os-windows/l1.dll'), '-shared', '-Wl,--start-group', input_file('bin/clang-linux-3.9.0/release/target-os-windows/lib.obj'), '-Wl,-Bstatic', '-Wl,-Bdynamic', '-Wl,--end-group', unordered('-Wl,--strip-all')) - command('clang++', unordered(ordered('-x', 'c++'), '-O3', '-Wno-inline', '-Wall', '-DNDEBUG', '-c'), '-o', output_file('bin/clang-linux-3.9.0/release/strip-on/target-os-windows/main.obj'), input_file(source='main.cpp')) + command('clang++', unordered('-O3', '-Wno-inline', '-Wall', '-DNDEBUG', '-c'), '-o', output_file('bin/clang-linux-3.9.0/release/strip-on/target-os-windows/main.obj'), input_file(source='main.cpp')) command('clang++', '-o', output_file('bin/clang-linux-3.9.0/release/test'), '-Wl,--start-group', input_file('bin/clang-linux-3.9.0/release/strip-on/target-os-windows/main.obj'), input_file('bin/clang-linux-3.9.0/release/strip-on/target-os-windows/l1.dll'), '-Wl,-Bstatic', '-Wl,-Bdynamic', '-Wl,--end-group', unordered('-Wl,--strip-all')) if allow_properties('target-os=windows', 'variant=debug', 'link=shared', 'threading=multi', 'runtime-link=shared'): - command('clang++', unordered(ordered('-x', 'c++'), '-O0', '-fno-inline', '-Wall', '-g', '-pthread', '-c'), '-o', output_file('bin/clang-linux-3.9.0/debug/target-os-windows/threading-multi/lib.obj'), input_file(source='lib.cpp')) - command('clang++', '-o', output_file('bin/clang-linux-3.9.0/debug/target-os-windows/threading-multi/l1.dll'), '-shared', '-Wl,--start-group', input_file('bin/clang-linux-3.9.0/debug/target-os-windows/threading-multi/lib.obj'), '-Wl,-Bstatic', '-Wl,-Bdynamic', '-Wl,--end-group', unordered('-g', '-pthread')) - command('clang++', unordered(ordered('-x', 'c++'), '-O0', '-fno-inline', '-Wall', '-g', '-pthread', '-c'), '-o', output_file('bin/clang-linux-3.9.0/debug/target-os-windows/threading-multi/main.obj'), input_file(source='main.cpp')) - command('clang++', '-o', output_file('bin/clang-linux-3.9.0/debug/threading-multi/test'), '-Wl,--start-group', input_file('bin/clang-linux-3.9.0/debug/target-os-windows/threading-multi/main.obj'), input_file('bin/clang-linux-3.9.0/debug/target-os-windows/threading-multi/l1.dll'), '-Wl,-Bstatic', '-Wl,-Bdynamic', '-Wl,--end-group', unordered('-g', '-pthread')) + command('clang++', unordered('-O0', '-fno-inline', '-Wall', '-g', '-c'), '-o', output_file('bin/clang-linux-3.9.0/debug/target-os-windows/threading-multi/lib.obj'), input_file(source='lib.cpp')) + command('clang++', '-o', output_file('bin/clang-linux-3.9.0/debug/target-os-windows/threading-multi/l1.dll'), '-shared', '-Wl,--start-group', input_file('bin/clang-linux-3.9.0/debug/target-os-windows/threading-multi/lib.obj'), '-Wl,-Bstatic', '-Wl,-Bdynamic', '-Wl,--end-group', unordered('-g')) + command('clang++', unordered('-O0', '-fno-inline', '-Wall', '-g', '-c'), '-o', output_file('bin/clang-linux-3.9.0/debug/target-os-windows/threading-multi/main.obj'), input_file(source='main.cpp')) + command('clang++', '-o', output_file('bin/clang-linux-3.9.0/debug/threading-multi/test'), '-Wl,--start-group', input_file('bin/clang-linux-3.9.0/debug/target-os-windows/threading-multi/main.obj'), input_file('bin/clang-linux-3.9.0/debug/target-os-windows/threading-multi/l1.dll'), '-Wl,-Bstatic', '-Wl,-Bdynamic', '-Wl,--end-group', unordered('-g')) if allow_properties('target-os=windows', 'variant=debug', 'link=static', 'threading=single', 'runtime-link=shared'): - command('clang++', unordered(ordered('-x', 'c++'), '-O0', '-fno-inline', '-Wall', '-g', '-c'), '-o', output_file('bin/clang-linux-3.9.0/debug/link-static/target-os-windows/lib.obj'), input_file(source='lib.cpp')) - command('clang++', unordered(ordered('-x', 'c++'), '-O0', '-fno-inline', '-Wall', '-g', '-c'), '-o', output_file('bin/clang-linux-3.9.0/debug/link-static/target-os-windows/main.obj'), input_file(source='main.cpp')) + command('clang++', unordered('-O0', '-fno-inline', '-Wall', '-g', '-c'), '-o', output_file('bin/clang-linux-3.9.0/debug/link-static/target-os-windows/lib.obj'), input_file(source='lib.cpp')) + command('clang++', unordered('-O0', '-fno-inline', '-Wall', '-g', '-c'), '-o', output_file('bin/clang-linux-3.9.0/debug/link-static/target-os-windows/main.obj'), input_file(source='main.cpp')) command('clang++', '-o', output_file('bin/clang-linux-3.9.0/debug/link-static/target-os-windows/test.exe'), '-Wl,--start-group', input_file('bin/clang-linux-3.9.0/debug/link-static/target-os-windows/main.obj'), input_file('bin/clang-linux-3.9.0/debug/link-static/target-os-windows/libl1.lib'), '-Wl,-Bstatic', '-Wl,-Bdynamic', '-Wl,--end-group', '-g') if allow_properties('target-os=windows', 'variant=debug', 'link=static', 'threading=single', 'runtime-link=static'): - command('clang++', unordered(ordered('-x', 'c++'), '-O0', '-fno-inline', '-Wall', '-g', '-c'), '-o', output_file('bin/clang-linux-3.9.0/debug/link-static/runtime-link-static/target-os-windows/lib.obj'), input_file(source='lib.cpp')) - command('clang++', unordered(ordered('-x', 'c++'), '-O0', '-fno-inline', '-Wall', '-g', '-c'), '-o', output_file('bin/clang-linux-3.9.0/debug/link-static/runtime-link-static/target-os-windows/main.obj'), input_file(source='main.cpp')) + command('clang++', unordered('-O0', '-fno-inline', '-Wall', '-g', '-c'), '-o', output_file('bin/clang-linux-3.9.0/debug/link-static/runtime-link-static/target-os-windows/lib.obj'), input_file(source='lib.cpp')) + command('clang++', unordered('-O0', '-fno-inline', '-Wall', '-g', '-c'), '-o', output_file('bin/clang-linux-3.9.0/debug/link-static/runtime-link-static/target-os-windows/main.obj'), input_file(source='main.cpp')) command('clang++', '-o', output_file('bin/clang-linux-3.9.0/debug/link-static/runtime-link-static/target-os-windows/test.exe'), '-Wl,--start-group', input_file('bin/clang-linux-3.9.0/debug/link-static/target-os-windows/main.obj'), input_file('bin/clang-linux-3.9.0/debug/link-static/target-os-windows/libl1.lib'), '-Wl,--end-group', unordered('-g', '-static')) if allow_properties('target-os=windows', 'variant=debug', 'link=shared', 'threading=single', 'runtime-link=shared', 'architecture=x86', 'address-model=32'): - command('clang++', unordered(ordered('-x', 'c++'), '-O0', '-fno-inline', '-Wall', '-g', '-march=i686', '-m32', '-c'), '-o', output_file('bin/clang-linux-3.9.0/debug/address-model-32/architecture-x86/target-os-windows/lib.obj'), input_file(source='lib.cpp')) + command('clang++', unordered('-O0', '-fno-inline', '-Wall', '-g', '-march=i686', '-m32', '-c'), '-o', output_file('bin/clang-linux-3.9.0/debug/address-model-32/architecture-x86/target-os-windows/lib.obj'), input_file(source='lib.cpp')) command('clang++', '-o', output_file('bin/clang-linux-3.9.0/debug/address-model-32/architecture-x86/target-os-windows/l1.dll'), '-shared', '-Wl,--start-group', input_file('bin/clang-linux-3.9.0/debug/address-model-32/architecture-x86/target-os-windows/lib.obj'), '-Wl,-Bstatic', '-Wl,-Bdynamic', '-Wl,--end-group', unordered('-g', '-march=i686', '-m32')) - command('clang++', unordered(ordered('-x', 'c++'), '-O0', '-fno-inline', '-Wall', '-g', '-march=i686', '-m32', '-c'), '-o', output_file('bin/clang-linux-3.9.0/debug/address-model-32/architecture-x86/target-os-windows/main.obj'), input_file(source='main.cpp')) + command('clang++', unordered('-O0', '-fno-inline', '-Wall', '-g', '-march=i686', '-m32', '-c'), '-o', output_file('bin/clang-linux-3.9.0/debug/address-model-32/architecture-x86/target-os-windows/main.obj'), input_file(source='main.cpp')) command('clang++', '-o', output_file('bin/clang-linux-3.9.0/debug/address-model-32/architecture-x86/target-os-windows/test.exe'), '-Wl,--start-group', input_file('bin/clang-linux-3.9.0/debug/address-model-32/architecture-x86/target-os-windows/main.obj'), input_file('bin/clang-linux-3.9.0/debug/address-model-32/architecture-x86/target-os-windows/l1.dll'), '-Wl,-Bstatic', '-Wl,-Bdynamic', '-Wl,--end-group', unordered('-g', '-march=i686', '-m32')) main() diff --git a/test/toolset-mock/src/clang-vxworks-4.0.1.py b/test/toolset-mock/src/clang-vxworks-4.0.1.py index b6a13b4fde..76c379c9ad 100644 --- a/test/toolset-mock/src/clang-vxworks-4.0.1.py +++ b/test/toolset-mock/src/clang-vxworks-4.0.1.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # # Copyright 2018 Steven Watanabe # @@ -11,31 +11,43 @@ command('clang++', '-print-prog-name=ar', stdout=script('ar.py')) if allow_properties('variant=debug', 'link=shared', 'threading=single', 'runtime-link=shared'): - command('clang++', unordered(ordered('-x', 'c++'), '-O0', '-fno-inline', '-Wall', '-g', '-fPIC', '-c'), '-o', output_file('bin/clang-vxworks-4.0.1/debug/lib.o'), input_file(source='lib.cpp')) - command('clang++', unordered(ordered('-x', 'c++'), '-O0', '-fno-inline', '-Wall', '-g', '-fPIC', '-c'), '-o', output_file('bin/clang-vxworks-4.0.1/debug/main.o'), input_file(source='main.cpp')) + command('clang++', unordered('-O0', '-fno-inline', '-Wall', '-g', '-fPIC', '-c'), '-o', output_file('bin/clang-vxworks-4.0.1/debug/lib.o'), input_file(source='lib.cpp')) + command('clang++', '-o', output_file('bin/clang-vxworks-4.0.1/debug/libl1.so'), '-shared', input_file('bin/clang-vxworks-4.0.1/debug/lib.o'), unordered('-g', '-fPIC')) + command('clang++', unordered('-O0', '-fno-inline', '-Wall', '-g', '-fPIC', '-c'), '-o', output_file('bin/clang-vxworks-4.0.1/debug/main.o'), input_file(source='main.cpp')) + command('clang++', '-o', output_file('bin/clang-vxworks-4.0.1/debug/test'), input_file('bin/clang-vxworks-4.0.1/debug/main.o'), input_file('bin/clang-vxworks-4.0.1/debug/libl1.so'), unordered('-g', '-fPIC')) if allow_properties('variant=release', 'link=shared', 'threading=single', 'runtime-link=shared', 'strip=on'): - command('clang++', unordered(ordered('-x', 'c++'), '-O3', '-Wno-inline', '-Wall', '-fPIC', '-DNDEBUG', '-c'), '-o', output_file('bin/clang-vxworks-4.0.1/release/lib.o'), input_file(source='lib.cpp')) - command('clang++', unordered(ordered('-x', 'c++'), '-O3', '-Wno-inline', '-Wall', '-fPIC', '-DNDEBUG', '-c'), '-o', output_file('bin/clang-vxworks-4.0.1/release/main.o'), input_file(source='main.cpp')) + command('clang++', unordered('-O3', '-Wno-inline', '-Wall', '-fPIC', '-DNDEBUG', '-c'), '-o', output_file('bin/clang-vxworks-4.0.1/release/lib.o'), input_file(source='lib.cpp')) + command('clang++', '-o', output_file('bin/clang-vxworks-4.0.1/release/libl1.so'), '-shared', input_file('bin/clang-vxworks-4.0.1/release/lib.o'), unordered('-fPIC', '-Wl,--strip-all', '-t')) + command('clang++', unordered('-O3', '-Wno-inline', '-Wall', '-fPIC', '-DNDEBUG', '-c'), '-o', output_file('bin/clang-vxworks-4.0.1/release/main.o'), input_file(source='main.cpp')) + command('clang++', '-o', output_file('bin/clang-vxworks-4.0.1/release/test'), input_file('bin/clang-vxworks-4.0.1/release/main.o'), input_file('bin/clang-vxworks-4.0.1/release/libl1.so'), unordered('-fPIC', '-Wl,--strip-all', '-t')) if allow_properties('variant=debug', 'link=shared', 'threading=multi', 'runtime-link=shared'): - command('clang++', unordered(ordered('-x', 'c++'), '-O0', '-fno-inline', '-Wall', '-g', '-fPIC', '-c'), '-o', output_file('bin/clang-vxworks-4.0.1/debug/threading-multi/lib.o'), input_file(source='lib.cpp')) - command('clang++', unordered(ordered('-x', 'c++'), '-O0', '-fno-inline', '-Wall', '-g', '-fPIC', '-c'), '-o', output_file('bin/clang-vxworks-4.0.1/debug/threading-multi/main.o'), input_file(source='main.cpp')) + command('clang++', unordered('-O0', '-fno-inline', '-Wall', '-g', '-fPIC', '-c'), '-o', output_file('bin/clang-vxworks-4.0.1/debug/threading-multi/lib.o'), input_file(source='lib.cpp')) + command('clang++', '-o', output_file('bin/clang-vxworks-4.0.1/debug/threading-multi/libl1.so'), '-shared', input_file('bin/clang-vxworks-4.0.1/debug/threading-multi/lib.o'), unordered('-g', '-fPIC')) + command('clang++', unordered('-O0', '-fno-inline', '-Wall', '-g', '-fPIC', '-c'), '-o', output_file('bin/clang-vxworks-4.0.1/debug/threading-multi/main.o'), input_file(source='main.cpp')) + command('clang++', '-o', output_file('bin/clang-vxworks-4.0.1/debug/threading-multi/test'), input_file('bin/clang-vxworks-4.0.1/debug/threading-multi/main.o'), input_file('bin/clang-vxworks-4.0.1/debug/threading-multi/libl1.so'), unordered('-g', '-fPIC')) if allow_properties('variant=debug', 'link=static', 'threading=single', 'runtime-link=shared'): - command('clang++', unordered(ordered('-x', 'c++'), '-O0', '-fno-inline', '-Wall', '-g', '-c'), '-o', output_file('bin/clang-vxworks-4.0.1/debug/link-static/lib.o'), input_file(source='lib.cpp')) - command('clang++', unordered(ordered('-x', 'c++'), '-O0', '-fno-inline', '-Wall', '-g', '-c'), '-o', output_file('bin/clang-vxworks-4.0.1/debug/link-static/main.o'), input_file(source='main.cpp')) + command('clang++', unordered('-O0', '-fno-inline', '-Wall', '-g', '-c'), '-o', output_file('bin/clang-vxworks-4.0.1/debug/link-static/lib.o'), input_file(source='lib.cpp')) + command('clang++', unordered('-O0', '-fno-inline', '-Wall', '-g', '-c'), '-o', output_file('bin/clang-vxworks-4.0.1/debug/link-static/main.o'), input_file(source='main.cpp')) + command('clang++', '-o', output_file('bin/clang-vxworks-4.0.1/debug/link-static/test'), input_file('bin/clang-vxworks-4.0.1/debug/link-static/main.o'), input_file('bin/clang-vxworks-4.0.1/debug/link-static/libl1.a'), '-g') if allow_properties('variant=debug', 'link=static', 'threading=single', 'runtime-link=static'): - command('clang++', unordered(ordered('-x', 'c++'), '-O0', '-fno-inline', '-Wall', '-g', '-c'), '-o', output_file('bin/clang-vxworks-4.0.1/debug/link-static/runtime-link-static/lib.o'), input_file(source='lib.cpp')) - command('clang++', unordered(ordered('-x', 'c++'), '-O0', '-fno-inline', '-Wall', '-g', '-c'), '-o', output_file('bin/clang-vxworks-4.0.1/debug/link-static/runtime-link-static/main.o'), input_file(source='main.cpp')) + command('clang++', unordered('-O0', '-fno-inline', '-Wall', '-g', '-c'), '-o', output_file('bin/clang-vxworks-4.0.1/debug/link-static/runtime-link-static/lib.o'), input_file(source='lib.cpp')) + command('clang++', unordered('-O0', '-fno-inline', '-Wall', '-g', '-c'), '-o', output_file('bin/clang-vxworks-4.0.1/debug/link-static/runtime-link-static/main.o'), input_file(source='main.cpp')) + command('clang++', '-o', output_file('bin/clang-vxworks-4.0.1/debug/link-static/runtime-link-static/test'), input_file('bin/clang-vxworks-4.0.1/debug/link-static/runtime-link-static/main.o'), input_file('bin/clang-vxworks-4.0.1/debug/link-static/runtime-link-static/libl1.a'), unordered('-g')) if allow_properties('variant=debug', 'link=shared', 'threading=single', 'runtime-link=shared', 'architecture=x86', 'address-model=32'): - command('clang++', unordered(ordered('-x', 'c++'), '-O0', '-fno-inline', '-Wall', '-g', '-march=i686', '-m32', '-fPIC', '-c'), '-o', output_file('bin/clang-vxworks-4.0.1/debug/lib.o'), input_file(source='lib.cpp')) - command('clang++', unordered(ordered('-x', 'c++'), '-O0', '-fno-inline', '-Wall', '-g', '-march=i686', '-m32', '-fPIC', '-c'), '-o', output_file('bin/clang-vxworks-4.0.1/debug/main.o'), input_file(source='main.cpp')) + command('clang++', unordered('-O0', '-fno-inline', '-Wall', '-g', '-march=i686', '-m32', '-fPIC', '-c'), '-o', output_file('bin/clang-vxworks-4.0.1/debug/lib.o'), input_file(source='lib.cpp')) + command('clang++', '-o', output_file('bin/clang-vxworks-4.0.1/debug/libl1.so'), '-shared', input_file('bin/clang-vxworks-4.0.1/debug/lib.o'), unordered('-g', '-march=i686', '-fPIC', '-m32')) + command('clang++', unordered('-O0', '-fno-inline', '-Wall', '-g', '-march=i686', '-m32', '-fPIC', '-c'), '-o', output_file('bin/clang-vxworks-4.0.1/debug/main.o'), input_file(source='main.cpp')) + command('clang++', '-o', output_file('bin/clang-vxworks-4.0.1/debug/test'), input_file('bin/clang-vxworks-4.0.1/debug/main.o'), input_file('bin/clang-vxworks-4.0.1/debug/libl1.so'), unordered('-g', '-march=i686', '-fPIC', '-m32')) if allow_properties('variant=debug', 'link=shared', 'threading=single', 'runtime-link=shared', 'rtti=off', 'exception-handling=off'): - command('clang++', unordered(ordered('-x', 'c++'), '-O0', '-fno-inline', '-fno-rtti', '-fno-exceptions', '-Wall', '-g', '-fPIC', '-D_NO_RTTI', '-D_NO_EX=1', '-c'), '-o', output_file('bin/clang-vxworks-4.0.1/debug/lib.o'), input_file(source='lib.cpp')) - command('clang++', unordered(ordered('-x', 'c++'), '-O0', '-fno-inline', '-fno-rtti', '-fno-exceptions', '-Wall', '-g', '-fPIC', '-D_NO_RTTI', '-D_NO_EX=1', '-c'), '-o', output_file('bin/clang-vxworks-4.0.1/debug/main.o'), input_file(source='main.cpp')) + command('clang++', unordered('-O0', '-fno-inline', '-fno-rtti', '-fno-exceptions', '-Wall', '-g', '-fPIC', '-D_NO_RTTI', '-D_NO_EX=1', '-c'), '-o', output_file('bin/clang-vxworks-4.0.1/debug/lib.o'), input_file(source='lib.cpp')) + command('clang++', '-o', output_file('bin/clang-vxworks-4.0.1/debug/libl1.so'), '-shared', input_file('bin/clang-vxworks-4.0.1/debug/lib.o'), unordered('-g', '-fPIC')) + command('clang++', unordered('-O0', '-fno-inline', '-fno-rtti', '-fno-exceptions', '-Wall', '-g', '-fPIC', '-D_NO_RTTI', '-D_NO_EX=1', '-c'), '-o', output_file('bin/clang-vxworks-4.0.1/debug/main.o'), input_file(source='main.cpp')) + command('clang++', '-o', output_file('bin/clang-vxworks-4.0.1/debug/test'), input_file('bin/clang-vxworks-4.0.1/debug/main.o'), input_file('bin/clang-vxworks-4.0.1/debug/libl1.so'), unordered('-g', '-fPIC')) main() diff --git a/test/toolset-mock/src/darwin-4.2.1.py b/test/toolset-mock/src/darwin-4.2.1.py index 1c12e00b3c..bf38a0d7f1 100644 --- a/test/toolset-mock/src/darwin-4.2.1.py +++ b/test/toolset-mock/src/darwin-4.2.1.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # # Copyright 2017 Steven Watanabe # diff --git a/test/toolset-mock/src/gcc-4.2.1-darwin.py b/test/toolset-mock/src/gcc-4.2.1-darwin.py index ae5230eb16..560a77dce4 100644 --- a/test/toolset-mock/src/gcc-4.2.1-darwin.py +++ b/test/toolset-mock/src/gcc-4.2.1-darwin.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # # Copyright 2017 Steven Watanabe # @@ -13,13 +13,13 @@ # all builds are multi-threaded for darwin if allow_properties("variant=debug", "link=shared", "runtime-link=shared"): command('g++', unordered('-O0', '-fno-inline', '-Wall', '-g', '-fPIC'), '-c', '-o', output_file('bin/gcc-darwin-4.2.1/debug/target-os-darwin/lib.o'), input_file(source='lib.cpp')) - command('g++', '-o', output_file('bin/gcc-darwin-4.2.1/debug/target-os-darwin/libl1.dylib'), '-shared', input_file('bin/gcc-darwin-4.2.1/debug/target-os-darwin/lib.o'), unordered('-g', '-fPIC')) + command('g++', '-o', output_file('bin/gcc-darwin-4.2.1/debug/target-os-darwin/libl1.dylib'), '-Wl,-install_name', '-Wl,@rpath/libl1.dylib', '-dynamiclib', '-single_module', input_file('bin/gcc-darwin-4.2.1/debug/target-os-darwin/lib.o'), unordered('-g', '-fPIC')) command('g++', unordered('-O0', '-fno-inline', '-Wall', '-g', '-fPIC'), '-c', '-o', output_file('bin/gcc-darwin-4.2.1/debug/target-os-darwin/main.o'), input_file(source='main.cpp')) command('g++', '-Wl,-rpath', arg('-Wl,', target_path('bin/gcc-darwin-4.2.1/debug/target-os-darwin/libl1.dylib')), '-o', output_file('bin/gcc-darwin-4.2.1/debug/target-os-darwin/test'), input_file('bin/gcc-darwin-4.2.1/debug/target-os-darwin/main.o'), input_file('bin/gcc-darwin-4.2.1/debug/target-os-darwin/libl1.dylib'), unordered('-g', '-fPIC')) if allow_properties("variant=release", "link=shared", "runtime-link=shared"): command('g++', unordered('-O3', '-finline-functions', '-Wno-inline', '-Wall', '-fPIC', '-DNDEBUG'), '-c', '-o', output_file('bin/gcc-darwin-4.2.1/release/target-os-darwin/lib.o'), input_file(source='lib.cpp')) - command('g++', '-o', output_file('bin/gcc-darwin-4.2.1/release/target-os-darwin/libl1.dylib'), '-shared', input_file('bin/gcc-darwin-4.2.1/release/target-os-darwin/lib.o'), '-fPIC') + command('g++', '-o', output_file('bin/gcc-darwin-4.2.1/release/target-os-darwin/libl1.dylib'), '-Wl,-install_name', '-Wl,@rpath/libl1.dylib', '-dynamiclib', '-single_module', input_file('bin/gcc-darwin-4.2.1/release/target-os-darwin/lib.o'), '-fPIC') command('g++', unordered('-O3', '-finline-functions', '-Wno-inline', '-Wall', '-fPIC', '-DNDEBUG'), '-c', '-o', output_file('bin/gcc-darwin-4.2.1/release/target-os-darwin/main.o'), input_file(source='main.cpp')) command('g++', '-Wl,-rpath', arg('-Wl,', target_path('bin/gcc-darwin-4.2.1/release/target-os-darwin/libl1.dylib')), '-o', output_file('bin/gcc-darwin-4.2.1/release/target-os-darwin/test'), input_file('bin/gcc-darwin-4.2.1/release/target-os-darwin/main.o'), input_file('bin/gcc-darwin-4.2.1/release/target-os-darwin/libl1.dylib'), '-fPIC') diff --git a/test/toolset-mock/src/gcc-4.8.3-linux.py b/test/toolset-mock/src/gcc-4.8.3-linux.py index d454301e46..d260788a6f 100644 --- a/test/toolset-mock/src/gcc-4.8.3-linux.py +++ b/test/toolset-mock/src/gcc-4.8.3-linux.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # # Copyright 2017 Steven Watanabe # @@ -12,19 +12,19 @@ if allow_properties("variant=debug", "link=shared", "threading=single", "runtime-link=shared"): command("g++", unordered("-O0", "-fno-inline", "-Wall", "-g", "-fPIC"), "-c", "-o", output_file("bin/gcc-gnu-4.8.3/debug/lib.o"), input_file(source="lib.cpp")) - command("g++", "-o", output_file("bin/gcc-gnu-4.8.3/debug/libl1.so"), "-Wl,-h", "-Wl,libl1.so", "-shared", "-Wl,--start-group", input_file("bin/gcc-gnu-4.8.3/debug/lib.o"), "-Wl,-Bstatic", "-Wl,-Bdynamic", "-Wl,--end-group", unordered("-g", "-fPIC")) + command("g++", "-o", output_file("bin/gcc-gnu-4.8.3/debug/libl1.so"), "-Wl,-soname", "-Wl,libl1.so", "-shared", "-Wl,--start-group", input_file("bin/gcc-gnu-4.8.3/debug/lib.o"), "-Wl,-Bstatic", "-Wl,-Bdynamic", "-Wl,--end-group", unordered("-g", "-fPIC")) command("g++", unordered("-O0", "-fno-inline", "-Wall", "-g", "-fPIC"), "-c", "-o", output_file("bin/gcc-gnu-4.8.3/debug/main.o"), input_file(source="main.cpp")) command("g++", "-Wl,-rpath", arg("-Wl,", target_path("bin/gcc-gnu-4.8.3/debug/libl1.so")), "-Wl,-rpath-link", arg("-Wl,", target_path("bin/gcc-gnu-4.8.3/debug/libl1.so")), "-o", output_file("bin/gcc-gnu-4.8.3/debug/test"), "-Wl,--start-group", input_file("bin/gcc-gnu-4.8.3/debug/main.o"), input_file("bin/gcc-gnu-4.8.3/debug/libl1.so"), "-Wl,-Bstatic", "-Wl,-Bdynamic", "-Wl,--end-group", unordered("-g", "-fPIC")) if allow_properties("variant=release", "link=shared", "threading=single", "runtime-link=shared"): command('g++', unordered('-O3', '-finline-functions', '-Wno-inline', '-Wall', '-fPIC', '-DNDEBUG'), '-c', '-o', output_file('bin/gcc-gnu-4.8.3/release/lib.o'), input_file(source='lib.cpp')) - command('g++', '-o', output_file('bin/gcc-gnu-4.8.3/release/libl1.so'), '-Wl,-h', '-Wl,libl1.so', '-shared', '-Wl,--start-group', input_file('bin/gcc-gnu-4.8.3/release/lib.o'), '-Wl,-Bstatic', '-Wl,-Bdynamic', '-Wl,--end-group', '-fPIC') + command('g++', '-o', output_file('bin/gcc-gnu-4.8.3/release/libl1.so'), '-Wl,-soname', '-Wl,libl1.so', '-shared', '-Wl,--start-group', input_file('bin/gcc-gnu-4.8.3/release/lib.o'), '-Wl,-Bstatic', '-Wl,-Bdynamic', '-Wl,--end-group', '-fPIC') command('g++', unordered('-O3', '-finline-functions', '-Wno-inline', '-Wall', '-fPIC', '-DNDEBUG'), '-c', '-o', output_file('bin/gcc-gnu-4.8.3/release/main.o'), input_file(source='main.cpp')) command('g++', '-Wl,-rpath', arg('-Wl,', target_path('bin/gcc-gnu-4.8.3/release/libl1.so')), '-Wl,-rpath-link', arg('-Wl,', target_path('bin/gcc-gnu-4.8.3/release/libl1.so')), '-o', output_file('bin/gcc-gnu-4.8.3/release/test'), '-Wl,--start-group', input_file('bin/gcc-gnu-4.8.3/release/main.o'), input_file('bin/gcc-gnu-4.8.3/release/libl1.so'), '-Wl,-Bstatic', '-Wl,-Bdynamic', '-Wl,--end-group', '-fPIC') if allow_properties("variant=debug", "link=shared", "threading=multi", "runtime-link=shared"): command('g++', unordered('-O0', '-fno-inline', '-Wall', '-g', '-pthread', '-fPIC'), '-c', '-o', output_file('bin/gcc-gnu-4.8.3/debug/threading-multi/lib.o'), input_file(source='lib.cpp')) - command('g++', '-o', output_file('bin/gcc-gnu-4.8.3/debug/threading-multi/libl1.so'), '-Wl,-h', '-Wl,libl1.so', '-shared', '-Wl,--start-group', input_file('bin/gcc-gnu-4.8.3/debug/threading-multi/lib.o'), '-Wl,-Bstatic', '-Wl,-Bdynamic', '-lrt', '-Wl,--end-group', unordered('-g', '-pthread', '-fPIC')) + command('g++', '-o', output_file('bin/gcc-gnu-4.8.3/debug/threading-multi/libl1.so'), '-Wl,-soname', '-Wl,libl1.so', '-shared', '-Wl,--start-group', input_file('bin/gcc-gnu-4.8.3/debug/threading-multi/lib.o'), '-Wl,-Bstatic', '-Wl,-Bdynamic', '-lrt', '-Wl,--end-group', unordered('-g', '-pthread', '-fPIC')) command('g++', unordered('-O0', '-fno-inline', '-Wall', '-g', '-pthread', '-fPIC'), '-c', '-o', output_file('bin/gcc-gnu-4.8.3/debug/threading-multi/main.o'), input_file(source='main.cpp')) command('g++', '-Wl,-rpath', arg('-Wl,', target_path('bin/gcc-gnu-4.8.3/debug/threading-multi/libl1.so')), '-Wl,-rpath-link', arg('-Wl,', target_path('bin/gcc-gnu-4.8.3/debug/threading-multi/libl1.so')), '-o', output_file('bin/gcc-gnu-4.8.3/debug/threading-multi/test'), '-Wl,--start-group', input_file('bin/gcc-gnu-4.8.3/debug/threading-multi/main.o'), input_file('bin/gcc-gnu-4.8.3/debug/threading-multi/libl1.so'), '-Wl,-Bstatic', '-Wl,-Bdynamic', '-lrt', '-Wl,--end-group', unordered('-g', '-pthread', '-fPIC')) @@ -41,7 +41,7 @@ if allow_properties("variant=debug", "link=shared", "threading=single", "runtime-link=shared"): command("g++", unordered("-O0", "-fno-inline", "-Wall", "-g", "-fPIC", "-std=c++1y"), "-c", "-o", output_file("bin/gcc-gnu-4.8.3/debug/lib.o"), input_file(source="lib.cpp")) - command("g++", "-o", output_file("bin/gcc-gnu-4.8.3/debug/libl1.so"), "-Wl,-h", "-Wl,libl1.so", "-shared", "-Wl,--start-group", input_file("bin/gcc-gnu-4.8.3/debug/lib.o"), "-Wl,-Bstatic", "-Wl,-Bdynamic", "-Wl,--end-group", unordered("-g", "-fPIC", "-std=c++1y")) + command("g++", "-o", output_file("bin/gcc-gnu-4.8.3/debug/libl1.so"), "-Wl,-soname", "-Wl,libl1.so", "-shared", "-Wl,--start-group", input_file("bin/gcc-gnu-4.8.3/debug/lib.o"), "-Wl,-Bstatic", "-Wl,-Bdynamic", "-Wl,--end-group", unordered("-g", "-fPIC", "-std=c++1y")) command("g++", unordered("-O0", "-fno-inline", "-Wall", "-g", "-fPIC", "-std=c++1y"), "-c", "-o", output_file("bin/gcc-gnu-4.8.3/debug/main.o"), input_file(source="main.cpp")) command("g++", "-Wl,-rpath", arg("-Wl,", target_path("bin/gcc-gnu-4.8.3/debug/libl1.so")), "-Wl,-rpath-link", arg("-Wl,", target_path("bin/gcc-gnu-4.8.3/debug/libl1.so")), "-o", output_file("bin/gcc-gnu-4.8.3/debug/test"), "-Wl,--start-group", input_file("bin/gcc-gnu-4.8.3/debug/main.o"), input_file("bin/gcc-gnu-4.8.3/debug/libl1.so"), "-Wl,-Bstatic", "-Wl,-Bdynamic", "-Wl,--end-group", unordered("-g", "-fPIC", "-std=c++1y")) diff --git a/test/toolset-mock/src/intel-darwin-10.2.py b/test/toolset-mock/src/intel-darwin-10.2.py index 23b9ad9d71..f82027fa9b 100644 --- a/test/toolset-mock/src/intel-darwin-10.2.py +++ b/test/toolset-mock/src/intel-darwin-10.2.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # # Copyright 2017 Steven Watanabe # diff --git a/test/toolset-mock/src/ld.py b/test/toolset-mock/src/ld.py deleted file mode 100644 index 040c231915..0000000000 --- a/test/toolset-mock/src/ld.py +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/python -# -# Copyright 2018 Steven Watanabe -# -# Distributed under the Boost Software License, Version 1.0. -# (See accompanying file LICENSE.txt or copy at -# https://www.bfgroup.xyz/b2/LICENSE.txt) - -from MockProgram import * - -if allow_properties('variant=debug', 'link=shared', 'threading=single', 'runtime-link=shared'): - command('ld', '-o', output_file('bin/clang-vxworks-4.0.1/debug/libl1.so'), input_file('bin/clang-vxworks-4.0.1/debug/lib.o'), unordered('-g', '-fPIC'), '-fpic', '-shared', '-non-static') - command('ld', '-o', output_file('bin/clang-vxworks-4.0.1/debug/test'), input_file('bin/clang-vxworks-4.0.1/debug/main.o'), input_file('bin/clang-vxworks-4.0.1/debug/libl1.so'), unordered('-g', '-fPIC')) - -if allow_properties('variant=release', 'link=shared', 'threading=single', 'runtime-link=shared', 'strip=on'): - command('ld', '-t', '-o', output_file('bin/clang-vxworks-4.0.1/release/libl1.so'), input_file('bin/clang-vxworks-4.0.1/release/lib.o'), unordered('-fPIC', '-Wl,--strip-all'), '-fpic', '-shared', '-non-static') - command('ld', '-t', '-o', output_file('bin/clang-vxworks-4.0.1/release/test'), input_file('bin/clang-vxworks-4.0.1/release/main.o'), input_file('bin/clang-vxworks-4.0.1/release/libl1.so'), unordered('-fPIC', '-Wl,--strip-all')) - -if allow_properties('variant=debug', 'link=shared', 'threading=multi', 'runtime-link=shared'): - command('ld', '-o', output_file('bin/clang-vxworks-4.0.1/debug/threading-multi/libl1.so'), input_file('bin/clang-vxworks-4.0.1/debug/threading-multi/lib.o'), unordered('-g', '-fPIC'), '-fpic', '-shared', '-non-static') - command('ld', '-o', output_file('bin/clang-vxworks-4.0.1/debug/threading-multi/test'), input_file('bin/clang-vxworks-4.0.1/debug/threading-multi/main.o'), input_file('bin/clang-vxworks-4.0.1/debug/threading-multi/libl1.so'), unordered('-g', '-fPIC')) - -if allow_properties('variant=debug', 'link=static', 'threading=single', 'runtime-link=shared'): - command('ld', '-o', output_file('bin/clang-vxworks-4.0.1/debug/link-static/test'), input_file('bin/clang-vxworks-4.0.1/debug/link-static/main.o'), input_file('bin/clang-vxworks-4.0.1/debug/link-static/libl1.a'), '-g') - -if allow_properties('variant=debug', 'link=static', 'threading=single', 'runtime-link=static'): - command('ld', '-o', output_file('bin/clang-vxworks-4.0.1/debug/link-static/runtime-link-static/test'), input_file('bin/clang-vxworks-4.0.1/debug/link-static/runtime-link-static/main.o'), input_file('bin/clang-vxworks-4.0.1/debug/link-static/runtime-link-static/libl1.a'), unordered('-g')) - -if allow_properties('variant=debug', 'link=shared', 'threading=single', 'runtime-link=shared', 'architecture=x86', 'address-model=32'): - command('ld', '-o', output_file('bin/clang-vxworks-4.0.1/debug/libl1.so'), input_file('bin/clang-vxworks-4.0.1/debug/lib.o'), unordered('-g', '-march=i686', '-fPIC', '-m32'), '-fpic', '-shared', '-non-static') - command('ld', '-o', output_file('bin/clang-vxworks-4.0.1/debug/test'), input_file('bin/clang-vxworks-4.0.1/debug/main.o'), input_file('bin/clang-vxworks-4.0.1/debug/libl1.so'), unordered('-g', '-march=i686', '-fPIC', '-m32')) - -main() diff --git a/test/toolset-mock/src/libtool.py b/test/toolset-mock/src/libtool.py index 35b6051cc2..60ec21e46a 100644 --- a/test/toolset-mock/src/libtool.py +++ b/test/toolset-mock/src/libtool.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # # Copyright 2017 Steven Watanabe # diff --git a/test/toolset-mock/src/mock-program.cpp b/test/toolset-mock/src/mock-program.cpp deleted file mode 100644 index e4a4523a5c..0000000000 --- a/test/toolset-mock/src/mock-program.cpp +++ /dev/null @@ -1,42 +0,0 @@ -// mock-program.cpp -// -// Copyright (c) 2017 Steven Watanabe -// -// Distributed under the Boost Software License Version 1.0. (See -// accompanying file LICENSE.txt or copy at -// https://www.bfgroup.xyz/b2/LICENSE.txt) - -// This program does nothing except to exec a python script - -#include -#include -#include -#include "config.h" - -#if defined(_WIN32) - #include - #define execv _execv -#else - #include -#endif - -#ifndef PY_SCRIPT -#error PY_SCRIPT must be defined to the absolute path to the script to run -#endif - -#ifndef PYTHON_CMD -#error PYTHON_CMD must be defined to the absolute path to the python interpreter -#endif - -int main(int argc, char ** argv) -{ - std::vector args; - char python_cmd[] = PYTHON_CMD; - char script[] = PY_SCRIPT; - args.push_back(python_cmd); - args.push_back(script); - args.insert(args.end(), argv + 1, argv + argc); - args.push_back(NULL); - execv(python_cmd, &args[0]); - perror("exec"); -} diff --git a/test/toolset-mock/src/strip.py b/test/toolset-mock/src/strip.py index 09b074307b..38f2a5b890 100644 --- a/test/toolset-mock/src/strip.py +++ b/test/toolset-mock/src/strip.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # # Copyright 2017 Steven Watanabe # diff --git a/test/toolset_clang_darwin.py b/test/toolset_clang_darwin.py index e261fa9a64..8e0ac4be17 100644 --- a/test/toolset_clang_darwin.py +++ b/test/toolset_clang_darwin.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # # Copyright 2017 Steven Watanabe # diff --git a/test/toolset_clang_linux.py b/test/toolset_clang_linux.py index eed96875fd..1ff12336e0 100644 --- a/test/toolset_clang_linux.py +++ b/test/toolset_clang_linux.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # coding: utf-8 # # Copyright 2017 Steven Watanabe diff --git a/test/toolset_clang_vxworks.py b/test/toolset_clang_vxworks.py index 66ed4d8f2a..1305e79780 100644 --- a/test/toolset_clang_vxworks.py +++ b/test/toolset_clang_vxworks.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # # Copyright 2018 Steven Watanabe # diff --git a/test/toolset_darwin.py b/test/toolset_darwin.py index 246c27305c..ff8aa8f311 100644 --- a/test/toolset_darwin.py +++ b/test/toolset_darwin.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # # Copyright 2017 Steven Watanabe # diff --git a/test/toolset_defaults.py b/test/toolset_defaults.py index 912b8a05de..0539c5cf18 100644 --- a/test/toolset_defaults.py +++ b/test/toolset_defaults.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright 2018 Steven Watanabe # Distributed under the Boost Software License, Version 1.0. diff --git a/test/toolset_gcc.py b/test/toolset_gcc.py index 948de9e42c..3f3b345d77 100644 --- a/test/toolset_gcc.py +++ b/test/toolset_gcc.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # # Copyright 2017 Steven Watanabe # diff --git a/test/toolset_intel_darwin.py b/test/toolset_intel_darwin.py index 53df4744ee..d8e61c9bf8 100644 --- a/test/toolset_intel_darwin.py +++ b/test/toolset_intel_darwin.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # # Copyright 2017 Steven Watanabe # diff --git a/test/toolset_msvc.py b/test/toolset_msvc.py index 9dc43a1568..d5f65f49c4 100644 --- a/test/toolset_msvc.py +++ b/test/toolset_msvc.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # # Copyright 2022 Nikita Kniazev # diff --git a/test/toolset_requirements.py b/test/toolset_requirements.py index a911ba0e37..43a4b1292a 100644 --- a/test/toolset_requirements.py +++ b/test/toolset_requirements.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright 2014 Steven Watanabe # Distributed under the Boost Software License, Version 1.0. diff --git a/test/transitive_skip.py b/test/transitive_skip.py index 85d73de307..a042bf0d3b 100644 --- a/test/transitive_skip.py +++ b/test/transitive_skip.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright 2021 Dmitry Arkhipov (grisumbras@gmail.com) # Distributed under the Boost Software License, Version 1.0. diff --git a/test/unit_test.py b/test/unit_test.py index dde205ff9a..8a070f7863 100644 --- a/test/unit_test.py +++ b/test/unit_test.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright 2003, 2004 Vladimir Prus # Distributed under the Boost Software License, Version 1.0. diff --git a/test/unit_tests.py b/test/unit_tests.py index 323e31c0e6..ab8dff812a 100644 --- a/test/unit_tests.py +++ b/test/unit_tests.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright 2002, 2003 Vladimir Prus # Distributed under the Boost Software License, Version 1.0. diff --git a/test/unused.py b/test/unused.py index 8599dd3b02..7e0fa3e9d1 100644 --- a/test/unused.py +++ b/test/unused.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright 2003 Vladimir Prus # Distributed under the Boost Software License, Version 1.0. diff --git a/test/use_requirements.py b/test/use_requirements.py index 575a3e5a9c..5e1057931c 100644 --- a/test/use_requirements.py +++ b/test/use_requirements.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright 2003 Dave Abrahams # Copyright 2002, 2003, 2004, 2006 Vladimir Prus diff --git a/test/using.py b/test/using.py index 1ee3dffa03..b28fb0eb4d 100644 --- a/test/using.py +++ b/test/using.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright (C) Vladimir Prus 2005. # Distributed under the Boost Software License, Version 1.0. (See diff --git a/test/wrapper.py b/test/wrapper.py index f99e261691..a77dbde2ea 100644 --- a/test/wrapper.py +++ b/test/wrapper.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright 2004 Vladimir Prus # Distributed under the Boost Software License, Version 1.0. diff --git a/test/wrong_project.py b/test/wrong_project.py index bacd01b70a..b885bb9cf4 100644 --- a/test/wrong_project.py +++ b/test/wrong_project.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Copyright Vladimir Prus 2005. # Distributed under the Boost Software License, Version 1.0.