Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3c4a035e0f | ||
|
|
5a9782e40a |
@@ -1 +0,0 @@
|
||||
*.patch -whitespace
|
||||
@@ -1,214 +0,0 @@
|
||||
name: Binary dependencies
|
||||
|
||||
on:
|
||||
push:
|
||||
schedule:
|
||||
- cron: '30 2 * * 3'
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: false
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
env:
|
||||
BEXT_ARCHIVE_RETENTION_DAYS: 90
|
||||
|
||||
jobs:
|
||||
# Finalized package metadata retains its install prefix. runner.temp is
|
||||
# stable between producer and consumer jobs on each pinned runner image.
|
||||
linux_release:
|
||||
name: Ubuntu GCC Release Build
|
||||
runs-on: ubuntu-24.04
|
||||
outputs:
|
||||
artifact-id: ${{ steps.upload.outputs.artifact-id }}
|
||||
steps:
|
||||
- name: Setup - CMake
|
||||
uses: lukka/get-cmake@latest
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup - System
|
||||
env:
|
||||
DEBIAN_FRONTEND: noninteractive
|
||||
run: |
|
||||
sudo apt-get update
|
||||
# Install XCB/OpenGL dev pkgs for Qt - see:
|
||||
# https://wiki.qt.io/Building_Qt_6_from_Git
|
||||
# https://doc.qt.io/qt-6/linux-requirements.html
|
||||
sudo apt-get install libfontconfig1-dev libfreetype6-dev libx11-dev libx11-xcb-dev libxext-dev libxfixes-dev libxi-dev libxrender-dev libxcb1-dev libxcb-cursor-dev libxcb-glx0-dev libxcb-keysyms1-dev libxcb-image0-dev libxcb-shm0-dev libxcb-icccm4-dev libxcb-sync-dev libxcb-xfixes0-dev libxcb-shape0-dev libxcb-randr0-dev libxcb-render-util0-dev libxcb-util-dev libxcb-xinerama0-dev libxcb-xkb-dev libxkbcommon-dev libxkbcommon-x11-dev
|
||||
sudo apt-get install libgl-dev
|
||||
sudo apt-get install libinput-dev
|
||||
sudo apt-get clean
|
||||
|
||||
- name: Configure
|
||||
run: cmake -S . -G Ninja -B build -DENABLE_ALL=ON -DGIT_SHALLOW_CLONE=ON -DCMAKE_BUILD_TYPE=Release -DEXT_BUILD_VERBOSE=ON -DCMAKE_INSTALL_PREFIX="$RUNNER_TEMP/bext_output"
|
||||
|
||||
- name: Build
|
||||
run: cmake --build build --parallel 2 --verbose
|
||||
|
||||
- name: Package dependency tree
|
||||
if: github.ref == 'refs/heads/main'
|
||||
shell: bash
|
||||
env:
|
||||
BEXT_CHANNEL: ubuntu-24.04-${{ runner.arch }}-release
|
||||
working-directory: ${{ runner.temp }}/bext_output
|
||||
run: |
|
||||
test -d install
|
||||
test -d noinstall
|
||||
test -f bext-install-manifest.json
|
||||
cmake -E tar cfz "$RUNNER_TEMP/bext-$BEXT_CHANNEL.tar.gz" --format=gnutar install noinstall bext-install-manifest.json
|
||||
|
||||
- name: Upload dependency tree
|
||||
if: github.ref == 'refs/heads/main'
|
||||
id: upload
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: bext-ubuntu-24.04-${{ runner.arch }}-release-${{ github.sha }}
|
||||
path: ${{ runner.temp }}/bext-ubuntu-24.04-${{ runner.arch }}-release.tar.gz
|
||||
if-no-files-found: error
|
||||
retention-days: ${{ env.BEXT_ARCHIVE_RETENTION_DAYS }}
|
||||
compression-level: 0
|
||||
|
||||
windows_ninja_release:
|
||||
name: MSVC - Ninja Release build
|
||||
runs-on: windows-2025
|
||||
outputs:
|
||||
artifact-id: ${{ steps.upload.outputs.artifact-id }}
|
||||
steps:
|
||||
- name: Setup - CMake
|
||||
uses: lukka/get-cmake@latest
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Add github workspace to path
|
||||
shell: pwsh
|
||||
run: Add-Content -Path $env:GITHUB_PATH -Value $env:GITHUB_WORKSPACE
|
||||
|
||||
- name: Add msbuild to PATH
|
||||
uses: microsoft/setup-msbuild@v2
|
||||
|
||||
- name: Add cl.exe to PATH
|
||||
uses: ilammy/msvc-dev-cmd@v1
|
||||
|
||||
- name: Configure
|
||||
shell: pwsh
|
||||
run: |
|
||||
cmake -S . -B build -G Ninja -DCMAKE_C_COMPILER=cl.exe -DCMAKE_CXX_COMPILER=cl.exe -DCMAKE_BUILD_TYPE=Release -DENABLE_ALL=ON -DGIT_SHALLOW_CLONE=ON -DEXT_BUILD_VERBOSE=ON -DCMAKE_INSTALL_PREFIX="$env:RUNNER_TEMP/bext_output"
|
||||
# Ensure generated files are flushed before compilation begins.
|
||||
Write-VolumeCache C
|
||||
Write-VolumeCache D
|
||||
|
||||
- name: Build
|
||||
shell: pwsh
|
||||
run: cmake --build build --parallel 2 --verbose
|
||||
|
||||
- name: Package dependency tree
|
||||
if: github.ref == 'refs/heads/main'
|
||||
shell: bash
|
||||
env:
|
||||
BEXT_CHANNEL: windows-2025-${{ runner.arch }}-release
|
||||
working-directory: ${{ runner.temp }}/bext_output
|
||||
run: |
|
||||
test -d install
|
||||
test -d noinstall
|
||||
test -f bext-install-manifest.json
|
||||
cmake -E tar cfz "$RUNNER_TEMP/bext-$BEXT_CHANNEL.tar.gz" --format=gnutar install noinstall bext-install-manifest.json
|
||||
|
||||
- name: Upload dependency tree
|
||||
if: github.ref == 'refs/heads/main'
|
||||
id: upload
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: bext-windows-2025-${{ runner.arch }}-release-${{ github.sha }}
|
||||
path: ${{ runner.temp }}/bext-windows-2025-${{ runner.arch }}-release.tar.gz
|
||||
if-no-files-found: error
|
||||
retention-days: ${{ env.BEXT_ARCHIVE_RETENTION_DAYS }}
|
||||
compression-level: 0
|
||||
|
||||
macos_release:
|
||||
name: macOS Clang Release Build
|
||||
runs-on: macos-14
|
||||
outputs:
|
||||
artifact-id: ${{ steps.upload.outputs.artifact-id }}
|
||||
steps:
|
||||
- name: Setup - CMake
|
||||
uses: lukka/get-cmake@latest
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install Xquartz
|
||||
run: brew install xquartz --cask
|
||||
|
||||
- name: Configure
|
||||
env:
|
||||
CC: clang
|
||||
CXX: clang++
|
||||
run: cmake -S . -G Ninja -B build -DENABLE_ALL=ON -DGIT_SHALLOW_CLONE=ON -DCMAKE_BUILD_TYPE=Release -DEXT_BUILD_VERBOSE=ON -DCMAKE_INSTALL_PREFIX="$RUNNER_TEMP/bext_output"
|
||||
|
||||
- name: Build
|
||||
run: cmake --build build --parallel 2 --verbose
|
||||
|
||||
- name: Package dependency tree
|
||||
if: github.ref == 'refs/heads/main'
|
||||
shell: bash
|
||||
env:
|
||||
BEXT_CHANNEL: macos-14-${{ runner.arch }}-release
|
||||
working-directory: ${{ runner.temp }}/bext_output
|
||||
run: |
|
||||
test -d install
|
||||
test -d noinstall
|
||||
test -f bext-install-manifest.json
|
||||
cmake -E tar cfz "$RUNNER_TEMP/bext-$BEXT_CHANNEL.tar.gz" --format=gnutar install noinstall bext-install-manifest.json
|
||||
|
||||
- name: Upload dependency tree
|
||||
if: github.ref == 'refs/heads/main'
|
||||
id: upload
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: bext-macos-14-${{ runner.arch }}-release-${{ github.sha }}
|
||||
path: ${{ runner.temp }}/bext-macos-14-${{ runner.arch }}-release.tar.gz
|
||||
if-no-files-found: error
|
||||
retention-days: ${{ env.BEXT_ARCHIVE_RETENTION_DAYS }}
|
||||
compression-level: 0
|
||||
|
||||
publish:
|
||||
name: Publish dependency set
|
||||
if: github.ref == 'refs/heads/main'
|
||||
needs: [linux_release, windows_ninja_release, macos_release]
|
||||
runs-on: ubuntu-24.04
|
||||
permissions:
|
||||
actions: write
|
||||
contents: read
|
||||
steps:
|
||||
- name: Record complete dependency set
|
||||
run: echo "${{ github.sha }}" > "$RUNNER_TEMP/bext-production"
|
||||
|
||||
- name: Upload completion marker
|
||||
id: marker
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: bext-production-${{ github.sha }}
|
||||
path: ${{ runner.temp }}/bext-production
|
||||
if-no-files-found: error
|
||||
retention-days: ${{ env.BEXT_ARCHIVE_RETENTION_DAYS }}
|
||||
|
||||
- name: Remove superseded dependency sets
|
||||
shell: bash
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
CURRENT_ARTIFACT_IDS: ${{ needs.linux_release.outputs.artifact-id }},${{ needs.windows_ninja_release.outputs.artifact-id }},${{ needs.macos_release.outputs.artifact-id }},${{ steps.marker.outputs.artifact-id }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
artifact_pattern='^bext-((ubuntu-24\.04|windows-2025|macos-14)-(X86|X64|ARM|ARM64)-release|production)-'
|
||||
artifact_rows="$(gh api --paginate "repos/$GITHUB_REPOSITORY/actions/artifacts?per_page=100" --jq '.artifacts[] | [.id, .name] | @tsv')"
|
||||
while IFS=$'\t' read -r artifact_id artifact_name; do
|
||||
if [[ "$artifact_name" =~ $artifact_pattern && ",${CURRENT_ARTIFACT_IDS}," != *",${artifact_id},"* ]]; then
|
||||
gh api --method DELETE "repos/$GITHUB_REPOSITORY/actions/artifacts/$artifact_id"
|
||||
fi
|
||||
done <<< "$artifact_rows"
|
||||
+110
-12
@@ -71,6 +71,49 @@ jobs:
|
||||
export PATH=$GITHUB_WORKSPACE:$PATH
|
||||
cmake --preset ${{ matrix.preset }} -DGIT_SHALLOW_CLONE=ON -DEXT_BUILD_VERBOSE=ON
|
||||
|
||||
windows_ninja_release:
|
||||
name: MSVC - Ninja Release build
|
||||
runs-on: windows-latest
|
||||
strategy:
|
||||
fail-fast: true
|
||||
steps:
|
||||
- name: Setup - CMake
|
||||
uses: lukka/get-cmake@latest
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Add github workspace to path
|
||||
# https://github.community/t/deprecated-add-path/136621
|
||||
run: echo "$ENV{GITHUB_WORKSPACE}" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
|
||||
|
||||
- name: Add msbuild to PATH
|
||||
uses: microsoft/setup-msbuild@v2
|
||||
|
||||
- name: Add cl.exe to PATH
|
||||
uses: ilammy/msvc-dev-cmd@v1
|
||||
|
||||
- name: Configure
|
||||
shell: powershell
|
||||
run: |
|
||||
cmake -S . -B build -G Ninja -DCMAKE_C_COMPILER="cl.exe" -DCMAKE_CXX_COMPILER="cl.exe" -DCMAKE_BUILD_TYPE=Release -DENABLE_ALL=ON -DGIT_SHALLOW_CLONE=ON -DEXT_BUILD_VERBOSE=ON
|
||||
# We do the following in order to help ensure files are "flushed"
|
||||
# to disk before compilation is attempted
|
||||
# https://superuser.com/a/1553374/1286142
|
||||
powershell Write-VolumeCache C
|
||||
powershell Write-VolumeCache D
|
||||
|
||||
- name: Build
|
||||
shell: powershell
|
||||
run: |
|
||||
cd build; ninja -j2 -v
|
||||
|
||||
# TODO - if the loading isn't too extreme, it would be good to do a BRL-CAD
|
||||
# build against the output of this...
|
||||
# - name: Build - BRL-CAD
|
||||
# run: |
|
||||
# # TODO - figure out how to do this...
|
||||
|
||||
windows_ninja_debug:
|
||||
name: MSVC - Ninja Debug build
|
||||
runs-on: windows-latest
|
||||
@@ -131,15 +174,10 @@ jobs:
|
||||
# https://github.community/t/deprecated-add-path/136621
|
||||
run: echo "$ENV{GITHUB_WORKSPACE}" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
|
||||
|
||||
- name: Add msbuild to PATH
|
||||
uses: microsoft/setup-msbuild@v2
|
||||
|
||||
- name: Add cl.exe to PATH
|
||||
uses: ilammy/msvc-dev-cmd@v1
|
||||
|
||||
- name: Configure
|
||||
shell: cmd
|
||||
run: |
|
||||
call "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Auxiliary/Build/vcvars64.bat"
|
||||
cmake -S . -B build -DENABLE_ALL=ON -DGIT_SHALLOW_CLONE=ON -DCMAKE_BUILD_TYPE=Release -DEXT_BUILD_VERBOSE=ON
|
||||
# We do the following in order to help ensure files are "flushed"
|
||||
# to disk before compilation is attempted
|
||||
@@ -150,6 +188,7 @@ jobs:
|
||||
- name: Build
|
||||
shell: cmd
|
||||
run: |
|
||||
call "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Auxiliary/Build/vcvars64.bat"
|
||||
cmake --build build --config Release -j2
|
||||
|
||||
windows_std_tools_debug:
|
||||
@@ -168,15 +207,10 @@ jobs:
|
||||
# https://github.community/t/deprecated-add-path/136621
|
||||
run: echo "$ENV{GITHUB_WORKSPACE}" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
|
||||
|
||||
- name: Add msbuild to PATH
|
||||
uses: microsoft/setup-msbuild@v2
|
||||
|
||||
- name: Add cl.exe to PATH
|
||||
uses: ilammy/msvc-dev-cmd@v1
|
||||
|
||||
- name: Configure
|
||||
shell: cmd
|
||||
run: |
|
||||
call "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Auxiliary/Build/vcvars64.bat"
|
||||
cmake -S . -B build -DENABLE_ALL=ON -DGIT_SHALLOW_CLONE=ON -DCMAKE_BUILD_TYPE=Debug -DEXT_BUILD_VERBOSE=ON
|
||||
# We do the following in order to help ensure files are "flushed"
|
||||
# to disk before compilation is attempted
|
||||
@@ -187,9 +221,45 @@ jobs:
|
||||
- name: Build
|
||||
shell: cmd
|
||||
run: |
|
||||
call "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Auxiliary/Build/vcvars64.bat"
|
||||
cmake --build build --config Debug -j2
|
||||
|
||||
|
||||
linux_release:
|
||||
name: Ubuntu GCC Release Build
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: true
|
||||
steps:
|
||||
- name: Setup - CMake
|
||||
uses: lukka/get-cmake@latest
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup - System
|
||||
env:
|
||||
DEBIAN_FRONTEND: noninteractive
|
||||
run: |
|
||||
sudo apt-get update
|
||||
# Install XCB/OpenGL dev pkgs for Qt - see:
|
||||
# https://wiki.qt.io/Building_Qt_6_from_Git
|
||||
# https://doc.qt.io/qt-6/linux-requirements.html
|
||||
sudo apt-get install libfontconfig1-dev libfreetype6-dev libx11-dev libx11-xcb-dev libxext-dev libxfixes-dev libxi-dev libxrender-dev libxcb1-dev libxcb-cursor-dev libxcb-glx0-dev libxcb-keysyms1-dev libxcb-image0-dev libxcb-shm0-dev libxcb-icccm4-dev libxcb-sync-dev libxcb-xfixes0-dev libxcb-shape0-dev libxcb-randr0-dev libxcb-render-util0-dev libxcb-util-dev libxcb-xinerama0-dev libxcb-xkb-dev libxkbcommon-dev libxkbcommon-x11-dev
|
||||
sudo apt-get install libgl-dev
|
||||
sudo apt-get install libinput-dev
|
||||
sudo apt-get clean
|
||||
|
||||
- name: Configure
|
||||
run: |
|
||||
export PATH=$ENV{GITHUB_WORKSPACE}:$PATH
|
||||
cmake -S . -G Ninja -B build -DENABLE_ALL=ON -DGIT_SHALLOW_CLONE=ON -DCMAKE_BUILD_TYPE=Release -DEXT_BUILD_VERBOSE=ON
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
export PATH=$ENV{GITHUB_WORKSPACE}:$PATH
|
||||
cd build && ninja -j2 -v
|
||||
|
||||
linux_debug:
|
||||
name: Ubuntu GCC Debug Build
|
||||
runs-on: ubuntu-latest
|
||||
@@ -227,6 +297,34 @@ jobs:
|
||||
cd build && ninja -j2 -v
|
||||
|
||||
|
||||
osx_release:
|
||||
name: macOS Clang Release Build
|
||||
runs-on: macos-latest
|
||||
strategy:
|
||||
fail-fast: true
|
||||
steps:
|
||||
- name: Setup - CMake
|
||||
uses: lukka/get-cmake@latest
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install Xquartz
|
||||
run: |
|
||||
brew install xquartz --cask
|
||||
|
||||
- name: Configure
|
||||
run: |
|
||||
export PATH=$ENV{GITHUB_WORKSPACE}:$PATH
|
||||
export CC=clang
|
||||
export CXX=clang++
|
||||
cmake -S . -G Ninja -B build -DENABLE_ALL=ON -DGIT_SHALLOW_CLONE=ON -DCMAKE_BUILD_TYPE=Release -DEXT_BUILD_VERBOSE=ON
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
export PATH=$ENV{GITHUB_WORKSPACE}:$PATH
|
||||
cd build && ninja -j2 -v
|
||||
|
||||
osx_debug:
|
||||
name: macOS Clang Debug Build
|
||||
runs-on: macos-latest
|
||||
|
||||
+29
-7
@@ -11,6 +11,7 @@
|
||||
[submodule "lief/LIEF"]
|
||||
path = lief/LIEF
|
||||
url = https://github.com/BRL-CAD/LIEF
|
||||
branch = RELEASE
|
||||
ignore = dirty
|
||||
shallow = true
|
||||
[submodule "lemon/lemon"]
|
||||
@@ -21,6 +22,7 @@
|
||||
[submodule "re2c/re2c"]
|
||||
path = re2c/re2c
|
||||
url = https://github.com/BRL-CAD/re2c
|
||||
branch = RELEASE
|
||||
ignore = dirty
|
||||
shallow = true
|
||||
[submodule "perplex/perplex"]
|
||||
@@ -38,6 +40,11 @@
|
||||
url = https://github.com/BRL-CAD/strclear
|
||||
ignore = dirty
|
||||
shallow = true
|
||||
[submodule "xmltools/xmltools"]
|
||||
path = xmltools/xmltools
|
||||
url = https://github.com/BRL-CAD/xmltools
|
||||
ignore = dirty
|
||||
shallow = true
|
||||
[submodule "zlib/zlib"]
|
||||
path = zlib/zlib
|
||||
url = https://github.com/BRL-CAD/zlib
|
||||
@@ -46,6 +53,7 @@
|
||||
[submodule "png/libpng"]
|
||||
path = png/libpng
|
||||
url = https://github.com/BRL-CAD/libpng
|
||||
branch = RELEASE
|
||||
ignore = dirty
|
||||
shallow = true
|
||||
[submodule "netpbm/netpbm"]
|
||||
@@ -62,11 +70,13 @@
|
||||
[submodule "lmdb/lmdb"]
|
||||
path = lmdb/lmdb
|
||||
url = https://github.com/BRL-CAD/lmdb
|
||||
branch = RELEASE
|
||||
ignore = dirty
|
||||
shallow = true
|
||||
[submodule "eigen/eigen"]
|
||||
path = eigen/eigen
|
||||
url = https://github.com/BRL-CAD/eigen
|
||||
branch = RELEASE
|
||||
ignore = dirty
|
||||
shallow = true
|
||||
[submodule "stepcode/stepcode"]
|
||||
@@ -83,11 +93,13 @@
|
||||
[submodule "proj/PROJ"]
|
||||
path = proj/PROJ
|
||||
url = https://github.com/BRL-CAD/PROJ
|
||||
branch = RELEASE
|
||||
ignore = dirty
|
||||
shallow = true
|
||||
[submodule "gdal/gdal"]
|
||||
path = gdal/gdal
|
||||
url = https://github.com/BRL-CAD/gdal
|
||||
branch = RELEASE
|
||||
ignore = dirty
|
||||
shallow = true
|
||||
[submodule "assetimport/assimp"]
|
||||
@@ -99,17 +111,13 @@
|
||||
[submodule "opencv/opencv"]
|
||||
path = opencv/opencv
|
||||
url = https://github.com/BRL-CAD/opencv
|
||||
branch = RELEASE
|
||||
ignore = dirty
|
||||
shallow = true
|
||||
[submodule "opennurbs/opennurbs"]
|
||||
path = opennurbs/opennurbs
|
||||
url = https://github.com/BRL-CAD/opennurbs
|
||||
ignore = dirty
|
||||
shallow = true
|
||||
[submodule "openvdb/openvdb"]
|
||||
path = openvdb/openvdb
|
||||
url = https://github.com/BRL-CAD/openvdb
|
||||
branch = master
|
||||
branch = RELEASE
|
||||
ignore = dirty
|
||||
shallow = true
|
||||
[submodule "osmesa/osmesa"]
|
||||
@@ -123,9 +131,16 @@
|
||||
branch = RELEASE
|
||||
ignore = dirty
|
||||
shallow = true
|
||||
[submodule "itk/itk"]
|
||||
[submodule "itcl3/itcl"]
|
||||
path = itcl/itcl
|
||||
url = https://github.com/BRL-CAD/itcl
|
||||
branch = RELEASE
|
||||
ignore = dirty
|
||||
shallow = true
|
||||
[submodule "itk3/itk"]
|
||||
path = itk/itk
|
||||
url = https://github.com/BRL-CAD/itk
|
||||
branch = RELEASE
|
||||
ignore = dirty
|
||||
shallow = true
|
||||
[submodule "iwidgets/iwidgets"]
|
||||
@@ -228,16 +243,19 @@
|
||||
[submodule "jpeg/libjpeg-turbo"]
|
||||
path = jpeg/libjpeg-turbo
|
||||
url = https://github.com/BRL-CAD/libjpeg-turbo
|
||||
branch = RELEASE
|
||||
ignore = dirty
|
||||
shallow = true
|
||||
[submodule "tiff/libtiff"]
|
||||
path = tiff/libtiff
|
||||
url = https://github.com/BRL-CAD/libtiff
|
||||
branch = RELEASE
|
||||
ignore = dirty
|
||||
shallow = true
|
||||
[submodule "onetbb/oneTBB"]
|
||||
path = onetbb/oneTBB
|
||||
url = https://github.com/BRL-CAD/oneTBB
|
||||
branch = RELEASE
|
||||
ignore = dirty
|
||||
shallow = true
|
||||
[submodule "llvm/llvm-project"]
|
||||
@@ -320,6 +338,7 @@
|
||||
[submodule "manifold/manifold"]
|
||||
path = manifold/manifold
|
||||
url = https://github.com/BRL-CAD/manifold.git
|
||||
branch = RELEASE
|
||||
ignore = dirty
|
||||
shallow = true
|
||||
[submodule "appleseed/appleseed"]
|
||||
@@ -340,16 +359,19 @@
|
||||
[submodule "clipper2/Clipper2"]
|
||||
path = clipper2/Clipper2
|
||||
url = https://github.com/BRL-CAD/Clipper2.git
|
||||
branch = RELEASE
|
||||
ignore = dirty
|
||||
shallow = true
|
||||
[submodule "tinygltf/tinygltf"]
|
||||
path = tinygltf/tinygltf
|
||||
url = https://github.com/BRL-CAD/tinygltf.git
|
||||
branch = release
|
||||
ignore = dirty
|
||||
shallow = true
|
||||
[submodule "poissonrecon/PoissonRecon"]
|
||||
path = poissonrecon/PoissonRecon
|
||||
url = https://github.com/BRL-CAD/PoissonRecon
|
||||
branch = RELEASE
|
||||
ignore = dirty
|
||||
shallow = true
|
||||
[submodule "bullet/bullet3"]
|
||||
|
||||
@@ -78,9 +78,6 @@ if (GIT_SHALLOW_CLONE)
|
||||
list(APPEND git_args --recommend-shallow)
|
||||
endif (GIT_SHALLOW_CLONE)
|
||||
list(APPEND git_args -- ${project_paths})
|
||||
if (WIN32)
|
||||
list(PREPEND git_args -c core.longpaths=true)
|
||||
endif (WIN32)
|
||||
|
||||
execute_process(
|
||||
COMMAND ${GIT_EXECUTABLE} ${git_args}
|
||||
|
||||
+18
-47
@@ -47,21 +47,6 @@ function(bext_write_file_list outvar filename values)
|
||||
set(${outvar} "${filename}" PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
function(bext_content_fingerprints outvar root label file_list_var)
|
||||
set(records "")
|
||||
foreach(relative IN LISTS ${file_list_var})
|
||||
set(path "${root}/${relative}")
|
||||
if (IS_SYMLINK "${path}")
|
||||
file(READ_SYMLINK "${path}" value)
|
||||
string(APPEND records "L ${label}/${relative} ${value}\n")
|
||||
else ()
|
||||
file(SHA256 "${path}" value)
|
||||
string(APPEND records "F ${label}/${relative} ${value}\n")
|
||||
endif ()
|
||||
endforeach()
|
||||
set(${outvar} "${records}" PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
function(bext_relative_path outvar path)
|
||||
file(RELATIVE_PATH relative "${BEXT_INSTALL_ROOT}" "${path}")
|
||||
string(REPLACE "\\" "/" relative "${relative}")
|
||||
@@ -370,6 +355,15 @@ list(SORT plain_text_files)
|
||||
# install prefix intact: downstream projects replace this canonical prefix
|
||||
# with their own staging prefix after copying the finalized tree.
|
||||
set(text_paths ${text_files})
|
||||
foreach(path ${text_paths})
|
||||
set(text_path "${BEXT_INSTALL_ROOT}/${path}")
|
||||
if (UNIX)
|
||||
file(CHMOD "${text_path}"
|
||||
PERMISSIONS OWNER_READ OWNER_WRITE
|
||||
GROUP_READ GROUP_WRITE
|
||||
WORLD_READ)
|
||||
endif ()
|
||||
endforeach()
|
||||
foreach(clear_target
|
||||
"${BEXT_SOURCE_ROOT}"
|
||||
"${BEXT_BINARY_ROOT}"
|
||||
@@ -398,6 +392,13 @@ if ("${BEXT_SYSTEM_NAME}" STREQUAL "Darwin" AND
|
||||
list(APPEND binary_cleanup_paths "${BEXT_INSTALL_ROOT}/${relative}")
|
||||
endforeach()
|
||||
endif ()
|
||||
foreach(path ${binary_paths})
|
||||
if (UNIX)
|
||||
file(CHMOD "${path}"
|
||||
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
|
||||
GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
|
||||
endif ()
|
||||
endforeach()
|
||||
bext_run_binary_clear("${binary_cleanup_paths}")
|
||||
bext_run_rpath_update("${rpath_paths}")
|
||||
|
||||
@@ -407,8 +408,6 @@ bext_json_escape(platform "${BEXT_SYSTEM_NAME}")
|
||||
file(APPEND "${BEXT_MANIFEST}.tmp" " \"platform\": \"${platform}\",\n")
|
||||
file(APPEND "${BEXT_MANIFEST}.tmp" " \"install_root\": \"install\",\n")
|
||||
file(APPEND "${BEXT_MANIFEST}.tmp" " \"generated_by\": \"bext\",\n")
|
||||
bext_write_json_array("${BEXT_MANIFEST}.tmp" "files" installed_files)
|
||||
file(APPEND "${BEXT_MANIFEST}.tmp" ",\n")
|
||||
bext_write_json_array("${BEXT_MANIFEST}.tmp" "rpath" rpath_files)
|
||||
file(APPEND "${BEXT_MANIFEST}.tmp" ",\n")
|
||||
bext_write_json_array("${BEXT_MANIFEST}.tmp" "binary" binary_files)
|
||||
@@ -417,35 +416,7 @@ bext_write_json_array("${BEXT_MANIFEST}.tmp" "cmake" cmake_files)
|
||||
file(APPEND "${BEXT_MANIFEST}.tmp" ",\n")
|
||||
bext_write_json_array("${BEXT_MANIFEST}.tmp" "text" plain_text_files)
|
||||
file(APPEND "${BEXT_MANIFEST}.tmp" "\n}\n")
|
||||
file(COPY_FILE "${BEXT_MANIFEST}.tmp" "${BEXT_MANIFEST}" ONLY_IF_DIFFERENT)
|
||||
file(REMOVE "${BEXT_MANIFEST}.tmp")
|
||||
file(RENAME "${BEXT_MANIFEST}.tmp" "${BEXT_MANIFEST}")
|
||||
|
||||
# Existing files are watched by downstream builds. This list also detects
|
||||
# additions and removals without changing its timestamp on a no-op build.
|
||||
file(GLOB_RECURSE noinstall_files
|
||||
LIST_DIRECTORIES false
|
||||
RELATIVE "${BEXT_NOINSTALL_ROOT}"
|
||||
"${BEXT_NOINSTALL_ROOT}/*"
|
||||
)
|
||||
list(REMOVE_ITEM noinstall_files "build-stamp")
|
||||
list(SORT noinstall_files)
|
||||
set(noinstall_inventory "${BEXT_BINARY_ROOT}/CMakeFiles/bext-noinstall-files.txt")
|
||||
bext_write_file_list(noinstall_inventory "${noinstall_inventory}" noinstall_files)
|
||||
file(COPY_FILE "${noinstall_inventory}" "${BEXT_NOINSTALL_ROOT}/build-stamp"
|
||||
ONLY_IF_DIFFERENT)
|
||||
|
||||
# Finalized binaries and config files may be rewritten on every install even
|
||||
# when their resulting bytes are unchanged. Publish one stable dependency for
|
||||
# downstream builds instead of making them watch every output timestamp.
|
||||
bext_content_fingerprints(installed_content "${BEXT_INSTALL_ROOT}" "install"
|
||||
installed_files)
|
||||
bext_content_fingerprints(noinstall_content "${BEXT_NOINSTALL_ROOT}" "noinstall"
|
||||
noinstall_files)
|
||||
file(SHA256 "${BEXT_MANIFEST}" manifest_digest)
|
||||
string(SHA256 content_digest
|
||||
"${installed_content}${noinstall_content}M ${manifest_digest}\n")
|
||||
set(content_stamp "${BEXT_BINARY_ROOT}/bext-content-stamp")
|
||||
file(WRITE "${content_stamp}.tmp" "${content_digest}\n")
|
||||
file(COPY_FILE "${content_stamp}.tmp" "${content_stamp}" ONLY_IF_DIFFERENT)
|
||||
file(REMOVE "${content_stamp}.tmp")
|
||||
file(TOUCH "${BEXT_MANIFEST}")
|
||||
message(STATUS "Generated bext install manifest: ${BEXT_MANIFEST}")
|
||||
|
||||
@@ -0,0 +1,117 @@
|
||||
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
||||
# file Copyright.txt or https://cmake.org/licensing for details.
|
||||
|
||||
#[=======================================================================[.rst:
|
||||
FindITCL
|
||||
--------
|
||||
|
||||
This module finds if Itcl is installed and determines where the include
|
||||
files and libraries are. It also determines what the name of the
|
||||
library is. This code sets the following variables:
|
||||
|
||||
::
|
||||
|
||||
ITCL_FOUND = Itcl was found
|
||||
ITCL_LIBRARY = path to Itcl library (tcl tcl80)
|
||||
ITCL_INCLUDE_PATH = path to where itcl.h can be found
|
||||
ITCL_STUB_LIBRARY = path to Itcl stub library
|
||||
|
||||
#]=======================================================================]
|
||||
|
||||
|
||||
set(_ITCL_SEARCHES)
|
||||
|
||||
# Search ITCL_ROOT first if it is set.
|
||||
if(ITCL_ROOT)
|
||||
set(_ITCL_SEARCH_ROOT PATHS ${ITCL_ROOT} NO_DEFAULT_PATH)
|
||||
list(APPEND _ITCL_SEARCHES _ITCL_SEARCH_ROOT)
|
||||
endif()
|
||||
|
||||
set(ITCL_POSSIBLE_LIB_PATH_SUFFIXES
|
||||
lib
|
||||
lib/itcl
|
||||
lib/itcl3.4
|
||||
itcl
|
||||
itcl3.4
|
||||
)
|
||||
|
||||
set(ITCL_POSSIBLE_LIB_NAMES
|
||||
itcl
|
||||
itcl3
|
||||
itcl3.4
|
||||
)
|
||||
|
||||
if(NOT ITCL_LIBRARY)
|
||||
foreach(search ${_ITCL_SEARCHES})
|
||||
find_library(ITCL_LIBRARY
|
||||
NAMES ${ITCL_POSSIBLE_LIB_NAMES}
|
||||
NAMES_PER_DIR ${${search}}
|
||||
PATH_SUFFIXES ${ITCL_POSSIBLE_LIB_PATH_SUFFIXES})
|
||||
endforeach()
|
||||
endif()
|
||||
if(NOT ITCL_LIBRARY)
|
||||
find_library(ITCL_LIBRARY
|
||||
NAMES ${ITCL_POSSIBLE_LIB_NAMES}
|
||||
PATH_SUFFIXES ${ITCL_POSSIBLE_LIB_PATH_SUFFIXES}
|
||||
)
|
||||
endif(NOT ITCL_LIBRARY)
|
||||
|
||||
set(ITCLSTUB_POSSIBLE_LIB_NAMES
|
||||
itclstub
|
||||
itclstub3
|
||||
itclstub3.4
|
||||
)
|
||||
if(NOT ITCL_STUB_LIBRARY)
|
||||
foreach(search ${_ITCL_SEARCHES})
|
||||
find_library(ITCL_STUB_LIBRARY
|
||||
NAMES ${ITCLSTUB_POSSIBLE_LIB_NAMES}
|
||||
NAMES_PER_DIR ${${search}}
|
||||
PATH_SUFFIXES ${ITCL_POSSIBLE_LIB_PATH_SUFFIXES}
|
||||
)
|
||||
endforeach()
|
||||
endif()
|
||||
if(NOT ITCL_STUB_LIBRARY)
|
||||
find_library(ITCL_STUB_LIBRARY
|
||||
NAMES ${ITCLSTUB_POSSIBLE_LIB_NAMES}
|
||||
PATH_SUFFIXES ${ITCL_POSSIBLE_LIB_PATH_SUFFIXES}
|
||||
)
|
||||
endif()
|
||||
|
||||
set(ITCL_POSSIBLE_INCLUDE_PATH_SUFFIXES
|
||||
include
|
||||
include/itcl
|
||||
include/itcl3
|
||||
include/itcl3.4
|
||||
)
|
||||
|
||||
foreach(search ${_ITCL_SEARCHES})
|
||||
find_path(ITCL_INCLUDE_PATH
|
||||
NAMES itcl.h ${${search}}
|
||||
PATH_SUFFIXES ${ITCL_POSSIBLE_INCLUDE_PATH_SUFFIXES}
|
||||
)
|
||||
endforeach()
|
||||
if (NOT ITCL_INCLUDE_PATH)
|
||||
find_path(ITCL_INCLUDE_PATH
|
||||
NAMES itcl.h
|
||||
HINTS ${ITCL_POSSIBLE_INCLUDE_PATHS}
|
||||
)
|
||||
endif()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(ITCL
|
||||
REQUIRED_VARS ITCL_LIBRARY ITCL_STUB_LIBRARY ITCL_INCLUDE_PATH
|
||||
)
|
||||
|
||||
mark_as_advanced(
|
||||
ITCL_INCLUDE_PATH
|
||||
ITCL_LIBRARY
|
||||
ITCL_STUB_LIBRARY
|
||||
)
|
||||
|
||||
# Local Variables:
|
||||
# tab-width: 8
|
||||
# mode: cmake
|
||||
# indent-tabs-mode: t
|
||||
# End:
|
||||
# ex: shiftwidth=2 tabstop=8
|
||||
+5
-175
@@ -4,69 +4,22 @@ if (NOT DEFINED BEXT_PATCH_NATIVE_EXECUTABLE OR NOT BEXT_PATCH_NATIVE_EXECUTABLE
|
||||
message(FATAL_ERROR "BEXT_PATCH_NATIVE_EXECUTABLE is not defined")
|
||||
endif()
|
||||
|
||||
if (NOT DEFINED BEXT_PATCH_CHECK_OPTION OR NOT BEXT_PATCH_CHECK_OPTION)
|
||||
set(BEXT_PATCH_CHECK_OPTION "--dry-run")
|
||||
endif()
|
||||
|
||||
set(patch_args)
|
||||
set(seen_separator FALSE)
|
||||
set(has_forward_flag FALSE)
|
||||
set(has_reverse_flag FALSE)
|
||||
set(has_noninteractive_flag FALSE)
|
||||
set(has_check_flag FALSE)
|
||||
set(has_input_file FALSE)
|
||||
set(has_reject_file FALSE)
|
||||
set(expect_input_file FALSE)
|
||||
set(expect_reject_file FALSE)
|
||||
set(input_file "")
|
||||
|
||||
math(EXPR last_arg "${CMAKE_ARGC} - 1")
|
||||
foreach(arg_index RANGE 0 ${last_arg})
|
||||
set(arg "${CMAKE_ARGV${arg_index}}")
|
||||
if (seen_separator)
|
||||
# Some platform patch tools accept -p1 while others require -p 1.
|
||||
# Normalize the compact form once here for every wrapped invocation.
|
||||
if (arg MATCHES "^-p([0-9]+)$")
|
||||
list(APPEND patch_args "-p" "${CMAKE_MATCH_1}")
|
||||
else()
|
||||
list(APPEND patch_args "${arg}")
|
||||
endif()
|
||||
if (expect_input_file)
|
||||
set(input_file "${arg}")
|
||||
set(expect_input_file FALSE)
|
||||
elseif (expect_reject_file)
|
||||
set(expect_reject_file FALSE)
|
||||
elseif (arg STREQUAL "-i" OR arg STREQUAL "--input")
|
||||
set(has_input_file TRUE)
|
||||
set(expect_input_file TRUE)
|
||||
elseif (arg MATCHES "^-i(.+)")
|
||||
set(has_input_file TRUE)
|
||||
set(input_file "${CMAKE_MATCH_1}")
|
||||
elseif (arg MATCHES "^--input=(.+)")
|
||||
set(has_input_file TRUE)
|
||||
set(input_file "${CMAKE_MATCH_1}")
|
||||
endif()
|
||||
if (arg STREQUAL "-r" OR arg STREQUAL "--reject-file")
|
||||
set(has_reject_file TRUE)
|
||||
set(expect_reject_file TRUE)
|
||||
elseif (arg MATCHES "^-r(.+)")
|
||||
set(has_reject_file TRUE)
|
||||
elseif (arg MATCHES "^--reject-file=(.+)")
|
||||
set(has_reject_file TRUE)
|
||||
endif()
|
||||
list(APPEND patch_args "${arg}")
|
||||
if (arg STREQUAL "-N" OR arg STREQUAL "--forward")
|
||||
set(has_forward_flag TRUE)
|
||||
endif()
|
||||
if (arg STREQUAL "-R" OR arg STREQUAL "--reverse")
|
||||
set(has_reverse_flag TRUE)
|
||||
endif()
|
||||
if (arg STREQUAL "-f" OR arg STREQUAL "--force" OR
|
||||
arg STREQUAL "-t" OR arg STREQUAL "--batch")
|
||||
set(has_noninteractive_flag TRUE)
|
||||
endif()
|
||||
if (arg STREQUAL "-C" OR arg STREQUAL "--dry-run")
|
||||
set(has_check_flag TRUE)
|
||||
endif()
|
||||
endif()
|
||||
if (arg STREQUAL "--")
|
||||
set(seen_separator TRUE)
|
||||
@@ -81,125 +34,6 @@ if (NOT patch_args)
|
||||
message(FATAL_ERROR "Patch wrapper did not receive any patch arguments")
|
||||
endif()
|
||||
|
||||
if (expect_input_file)
|
||||
message(FATAL_ERROR "Patch input option is missing its file path")
|
||||
endif()
|
||||
if (expect_reject_file)
|
||||
message(FATAL_ERROR "Patch reject option is missing its file path")
|
||||
endif()
|
||||
|
||||
set(reject_path "")
|
||||
set(reject_log_path "")
|
||||
if (input_file AND DEFINED BEXT_PATCH_REJECT_DIR AND
|
||||
BEXT_PATCH_REJECT_DIR)
|
||||
get_filename_component(patch_name "${input_file}" NAME)
|
||||
get_filename_component(patch_context "${CMAKE_CURRENT_BINARY_DIR}" NAME)
|
||||
string(REGEX REPLACE "[^A-Za-z0-9_.-]" "_" patch_context
|
||||
"${patch_context}")
|
||||
set(reject_path
|
||||
"${BEXT_PATCH_REJECT_DIR}/${patch_context}-${patch_name}.rej")
|
||||
set(reject_log_path "${reject_path}.log")
|
||||
endif()
|
||||
|
||||
function(clear_reject_artifacts)
|
||||
if (reject_path)
|
||||
file(REMOVE "${reject_path}" "${reject_log_path}")
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
function(preserve_reject_artifacts)
|
||||
if (NOT reject_path)
|
||||
return()
|
||||
endif()
|
||||
|
||||
# Keep a native reject file when patch emitted one. Applicability checks do
|
||||
# not normally emit rejects, so fall back to preserving the full patch.
|
||||
file(MAKE_DIRECTORY "${BEXT_PATCH_REJECT_DIR}")
|
||||
if (EXISTS "${reject_path}")
|
||||
file(SIZE "${reject_path}" reject_size)
|
||||
else()
|
||||
set(reject_size 0)
|
||||
endif()
|
||||
if (reject_size EQUAL 0)
|
||||
configure_file("${input_file}" "${reject_path}" COPYONLY)
|
||||
endif()
|
||||
file(WRITE "${reject_log_path}"
|
||||
"Patch file: ${input_file}\n"
|
||||
"Working directory: ${CMAKE_CURRENT_BINARY_DIR}\n\n"
|
||||
"${patch_failure_output}")
|
||||
message(STATUS
|
||||
"Saved failed patch and diagnostics to ${reject_path} and "
|
||||
"${reject_log_path}")
|
||||
endfunction()
|
||||
|
||||
clear_reject_artifacts()
|
||||
if (reject_path AND NOT has_reject_file)
|
||||
list(APPEND patch_args "-r" "${reject_path}")
|
||||
endif()
|
||||
|
||||
# Patch commands run during configure/build steps cannot consult a user. The
|
||||
# short -t form is accepted by the bundled and supported Unix patch tools.
|
||||
# Preserve an explicit --force/-f choice if a caller has made one.
|
||||
if (NOT has_noninteractive_flag)
|
||||
list(PREPEND patch_args "-t")
|
||||
endif()
|
||||
|
||||
# Preflight file-based patches so a bad patch cannot leave a source tree half
|
||||
# modified. Stdin cannot be preflighted because it cannot be replayed for the
|
||||
# real invocation.
|
||||
if (has_input_file AND NOT has_check_flag)
|
||||
set(forward_check_args ${patch_args})
|
||||
list(PREPEND forward_check_args "${BEXT_PATCH_CHECK_OPTION}")
|
||||
execute_process(
|
||||
COMMAND "${BEXT_PATCH_NATIVE_EXECUTABLE}" ${forward_check_args}
|
||||
RESULT_VARIABLE forward_check_result
|
||||
OUTPUT_VARIABLE forward_check_stdout
|
||||
ERROR_VARIABLE forward_check_stderr
|
||||
)
|
||||
|
||||
if (NOT forward_check_result EQUAL 0)
|
||||
if (forward_check_result EQUAL 1 AND has_forward_flag AND
|
||||
NOT has_reverse_flag)
|
||||
set(reverse_check_args)
|
||||
foreach(arg IN LISTS patch_args)
|
||||
if (arg STREQUAL "-N" OR arg STREQUAL "--forward")
|
||||
continue()
|
||||
endif()
|
||||
list(APPEND reverse_check_args "${arg}")
|
||||
endforeach()
|
||||
list(PREPEND reverse_check_args "${BEXT_PATCH_CHECK_OPTION}" "-R")
|
||||
|
||||
execute_process(
|
||||
COMMAND "${BEXT_PATCH_NATIVE_EXECUTABLE}" ${reverse_check_args}
|
||||
RESULT_VARIABLE reverse_result
|
||||
OUTPUT_QUIET
|
||||
ERROR_QUIET
|
||||
)
|
||||
|
||||
if (reverse_result EQUAL 0)
|
||||
clear_reject_artifacts()
|
||||
message(STATUS
|
||||
"Patch already applied or reversed; continuing because -N/--forward was requested."
|
||||
)
|
||||
return()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(patch_failure_output
|
||||
"${forward_check_stdout}${forward_check_stderr}")
|
||||
preserve_reject_artifacts()
|
||||
if (forward_check_stdout)
|
||||
message("${forward_check_stdout}")
|
||||
endif()
|
||||
if (forward_check_stderr)
|
||||
message("${forward_check_stderr}")
|
||||
endif()
|
||||
message(FATAL_ERROR
|
||||
"Patch preflight failed with exit code ${forward_check_result}"
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
execute_process(
|
||||
COMMAND "${BEXT_PATCH_NATIVE_EXECUTABLE}" ${patch_args}
|
||||
RESULT_VARIABLE patch_result
|
||||
@@ -210,29 +44,27 @@ execute_process(
|
||||
)
|
||||
|
||||
if (patch_result EQUAL 0)
|
||||
clear_reject_artifacts()
|
||||
return()
|
||||
endif()
|
||||
|
||||
if (patch_result EQUAL 1 AND has_forward_flag AND NOT has_reverse_flag)
|
||||
set(reverse_check_args)
|
||||
set(reverse_dry_run_args)
|
||||
foreach(arg IN LISTS patch_args)
|
||||
if (arg STREQUAL "-N" OR arg STREQUAL "--forward")
|
||||
continue()
|
||||
endif()
|
||||
list(APPEND reverse_check_args "${arg}")
|
||||
list(APPEND reverse_dry_run_args "${arg}")
|
||||
endforeach()
|
||||
list(PREPEND reverse_check_args "${BEXT_PATCH_CHECK_OPTION}" "-R")
|
||||
list(PREPEND reverse_dry_run_args "--dry-run" "-R")
|
||||
|
||||
execute_process(
|
||||
COMMAND "${BEXT_PATCH_NATIVE_EXECUTABLE}" ${reverse_check_args}
|
||||
COMMAND "${BEXT_PATCH_NATIVE_EXECUTABLE}" ${reverse_dry_run_args}
|
||||
RESULT_VARIABLE reverse_result
|
||||
OUTPUT_QUIET
|
||||
ERROR_QUIET
|
||||
)
|
||||
|
||||
if (reverse_result EQUAL 0)
|
||||
clear_reject_artifacts()
|
||||
execute_process(
|
||||
COMMAND ${CMAKE_COMMAND} -E echo
|
||||
"Patch already applied or reversed; continuing because -N/--forward was requested."
|
||||
@@ -241,6 +73,4 @@ if (patch_result EQUAL 1 AND has_forward_flag AND NOT has_reverse_flag)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(patch_failure_output "${patch_stdout}${patch_stderr}")
|
||||
preserve_reject_artifacts()
|
||||
message(FATAL_ERROR "Patch command failed with exit code ${patch_result}")
|
||||
|
||||
+11
-15
@@ -107,21 +107,17 @@ function(git_submodule_init path checkfile)
|
||||
if (NOT GIT_EXECUTABLE)
|
||||
message(FATAL_ERROR "Need to populate Git submodule, but unable to find git executable")
|
||||
endif (NOT GIT_EXECUTABLE)
|
||||
set(git_args submodule update --init --recursive)
|
||||
if (GIT_SHALLOW_CLONE)
|
||||
list(APPEND git_args --recommend-shallow)
|
||||
endif (GIT_SHALLOW_CLONE)
|
||||
if (WIN32)
|
||||
list(PREPEND git_args -c core.longpaths=true)
|
||||
endif (WIN32)
|
||||
execute_process(
|
||||
COMMAND ${GIT_EXECUTABLE} ${git_args} ${path}
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
COMMAND_ERROR_IS_FATAL ANY
|
||||
)
|
||||
if (NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${path}/${checkfile}")
|
||||
message(FATAL_ERROR "Git submodule ${path} is missing ${checkfile} after checkout")
|
||||
endif ()
|
||||
if (NOT GIT_SHALLOW_CLONE)
|
||||
execute_process(
|
||||
COMMAND ${GIT_EXECUTABLE} submodule update --init --recursive ${path}
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
)
|
||||
else (NOT GIT_SHALLOW_CLONE)
|
||||
execute_process(
|
||||
COMMAND ${GIT_EXECUTABLE} submodule update --init --recursive --recommend-shallow ${path}
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
)
|
||||
endif (NOT GIT_SHALLOW_CLONE)
|
||||
execute_process(
|
||||
COMMAND git log -1 --format=%H
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/${path}
|
||||
|
||||
+26
-46
@@ -277,21 +277,11 @@ if (NOT isMultiConfig)
|
||||
set(BUILD_TYPE_SPECIFIER "-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}")
|
||||
endif (NOT isMultiConfig)
|
||||
|
||||
# With MSVC, some non-CMake subbuilds need the vcvars bat file to set up their
|
||||
# environment. Always reinitialize the generated wrappers: a parent shell such
|
||||
# as Git Bash can reorder PATH while leaving Visual Studio's environment markers
|
||||
# intact. The wrappers also put the selected compiler's directory first so a
|
||||
# POSIX utility named link cannot shadow MSVC's link.exe.
|
||||
# With MSVC, some of the non-CMake subbuilds are going to need the vcvars bat
|
||||
# file to set up the environment.
|
||||
if(MSVC)
|
||||
|
||||
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
set(BEXT_MSVC_TARGET_ARCH x64)
|
||||
else(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
set(BEXT_MSVC_TARGET_ARCH x86)
|
||||
endif(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
|
||||
get_filename_component(BEXT_MSVC_COMPILER_BIN_DIR "${CMAKE_C_COMPILER}" DIRECTORY)
|
||||
set(COMPILER_DIR "${BEXT_MSVC_COMPILER_BIN_DIR}")
|
||||
get_filename_component(COMPILER_DIR "${CMAKE_C_COMPILER}" DIRECTORY)
|
||||
get_filename_component(COMPILER_ROOT "${COMPILER_DIR}" NAME)
|
||||
set(VCVARS_BAT "${COMPILER_DIR}/vcvars${COMPILER_ROOT}.bat")
|
||||
if(NOT EXISTS "${VCVARS_BAT}")
|
||||
@@ -301,11 +291,11 @@ if(MSVC)
|
||||
get_filename_component(COMPILER_DIR "${COMPILER_DIR}" DIRECTORY)
|
||||
endforeach(DIRS RANGE 0 5)
|
||||
set(COMPILER_DIR "${COMPILER_DIR}/Auxiliary/Build")
|
||||
if(BEXT_MSVC_TARGET_ARCH STREQUAL "x64")
|
||||
if(CMAKE_CL_64)
|
||||
set(VCVARS_BAT "${COMPILER_DIR}/vcvars64.bat")
|
||||
else(BEXT_MSVC_TARGET_ARCH STREQUAL "x64")
|
||||
else(CMAKE_CL_64)
|
||||
set(VCVARS_BAT "${COMPILER_DIR}/vcvars32.bat")
|
||||
endif(BEXT_MSVC_TARGET_ARCH STREQUAL "x64")
|
||||
endif(CMAKE_CL_64)
|
||||
if(NOT EXISTS "${VCVARS_BAT}")
|
||||
message(FATAL_ERROR "Could not find vcvars bat file in ${COMPILER_DIR}")
|
||||
endif(NOT EXISTS "${VCVARS_BAT}")
|
||||
@@ -313,6 +303,14 @@ if(MSVC)
|
||||
|
||||
endif(MSVC)
|
||||
|
||||
# Add a target that will run every time we build and touch a file in
|
||||
# noinstall to allow interested parent CMake builds to be aware of potential
|
||||
# changes, even if all that happens is to add files - otherwise, add-only
|
||||
# operations won't trigger a CMake reconfigure even if the client build is
|
||||
# watching the install files.
|
||||
file(MAKE_DIRECTORY ${CMAKE_NOBUNDLE_INSTALL_PREFIX})
|
||||
add_custom_target(BuildStamp ALL COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_NOBUNDLE_INSTALL_PREFIX}/build-stamp)
|
||||
|
||||
# If configurations change after a build has been performed, we don't
|
||||
# automatically scrub a pre-existing output directory to remove the files from
|
||||
# the newly disabled components. This variable records whether we need to warn
|
||||
@@ -353,21 +351,6 @@ option(USE_OSPRAY "OSPRay rendering system" OFF)
|
||||
option(USE_QT "Qt graphical toolkit support" ON)
|
||||
option(USE_TCL "Tcl/Tk support" ON)
|
||||
|
||||
# An Xmin prefix selects a coherent toolkit build profile. Individual
|
||||
# dependency logic applies the version-matched patches only when that
|
||||
# dependency is selected for a local build.
|
||||
set(BEXT_XMIN_ROOT "" CACHE PATH "Installed Xmin SDK used by bundled Tk and Qt")
|
||||
if (BEXT_XMIN_ROOT)
|
||||
if (NOT UNIX OR APPLE)
|
||||
message(FATAL_ERROR "The bext Xmin profile currently requires Linux or BSD")
|
||||
endif ()
|
||||
if (NOT IS_DIRECTORY "${BEXT_XMIN_ROOT}")
|
||||
message(FATAL_ERROR "BEXT_XMIN_ROOT is not an installed SDK: ${BEXT_XMIN_ROOT}")
|
||||
endif ()
|
||||
file(REAL_PATH "${BEXT_XMIN_ROOT}" BEXT_XMIN_ROOT)
|
||||
set(BEXT_XMIN_ROOT "${BEXT_XMIN_ROOT}" CACHE PATH "Installed Xmin SDK used by bundled Tk and Qt" FORCE)
|
||||
endif ()
|
||||
|
||||
|
||||
###############################################################################
|
||||
# Python is a build-time dependency for both LLVM and ISPC. I think
|
||||
@@ -459,13 +442,19 @@ add_project(astyle GROUPS "BRLCAD")
|
||||
add_project(lemon GROUPS "BRLCAD")
|
||||
add_project(re2c GROUPS "BRLCAD")
|
||||
add_project(perplex GROUPS "BRLCAD")
|
||||
add_project(strclear GROUPS "BRLCAD")
|
||||
add_project(strclear)
|
||||
add_project(xmltools GROUPS "BRLCAD_EXTRA") # Used for Docbook building
|
||||
|
||||
# RPATH editing - LIEF has the core capabilities, and plief exposes them via
|
||||
# a command line utility with patchelf compatible options, so we can drop
|
||||
# either patchelf or plief into our upstream workflows.
|
||||
add_project(lief GROUPS "BRLCAD")
|
||||
add_project(plief GROUPS "BRLCAD")
|
||||
add_project(lief)
|
||||
add_project(plief)
|
||||
|
||||
# Keeping this set up for easy turn-on until we're confident plief+LIEF has
|
||||
# all of our use cases covered - plief is preferred, but we've already hit
|
||||
# one case where a bug in LIEF had to be fixed.
|
||||
#add_project(patchelf GROUPS "BRLCAD")
|
||||
|
||||
###############################################################################
|
||||
# Build logic is broken out per-library, but the ordering is important. Some
|
||||
@@ -611,7 +600,7 @@ add_project(gdal GROUPS "GDAL")
|
||||
# OpenVDB - storage and manipulation of sparse volumetric data discretized on
|
||||
# three-dimensional grids
|
||||
# https://github.com/AcademySoftwareFoundation/openvdb
|
||||
add_project(openvdb GROUPS "BRLCAD_EXTRA")
|
||||
#add_project(openvdb GROUPS "BRLCAD_EXTRA")
|
||||
|
||||
# tinygltf - tiny glTF library(loader/saver)
|
||||
# https://github.com/syoyo/tinygltf
|
||||
@@ -677,19 +666,9 @@ add_project(embree GROUPS "APPLESEED;OSPRAY")
|
||||
# static lib building on so we get the stub libraries.
|
||||
# https://www.tcl.tk
|
||||
set(TCL_ENABLE_TK ON CACHE BOOL "enable tk")
|
||||
# Tcl 8.6.18 bundles Itcl 4.3.7. Itk remains a separate upstream project.
|
||||
# Keep the compatibility floors distinct from the bundled versions so a newer
|
||||
# system installation can be used without changing the versions we ship.
|
||||
set(BEXT_ITCL_MIN_VERSION "4.3.0")
|
||||
set(BEXT_ITCL_BUNDLED_VERSION "4.3.7")
|
||||
set(BEXT_ITCL_BUNDLED_SOURCE_DIR
|
||||
"${CMAKE_SOURCE_DIR}/tcl/tcl/pkgs/itcl${BEXT_ITCL_BUNDLED_VERSION}"
|
||||
)
|
||||
set(BEXT_ITK_MIN_VERSION "4.2.3")
|
||||
set(BEXT_ITK_BUNDLED_VERSION "4.2.7")
|
||||
set(BEXT_TK_COMPONENTS "archer;mged;bwish;rtwizard;brlman")
|
||||
add_project(tcl GROUPS "TCL")
|
||||
add_project(tk GROUPS "TCL")
|
||||
add_project(itcl GROUPS "TCL")
|
||||
add_project(itk GROUPS "TCL")
|
||||
add_project(iwidgets GROUPS "TCL")
|
||||
add_project(tkhtml GROUPS "TCL")
|
||||
@@ -763,6 +742,7 @@ endif ()
|
||||
if (TARGET PLIEF_BLD-install)
|
||||
add_dependencies(bext_finalize PLIEF_BLD-install)
|
||||
endif ()
|
||||
add_dependencies(BuildStamp bext_finalize)
|
||||
|
||||
|
||||
###############################################################################
|
||||
|
||||
+6
-5
@@ -37,8 +37,9 @@ selection further.
|
||||
| `gte` | `USE_BRLCAD` | `noinstall` | `patch` | [repository](https://github.com/BRL-CAD/GeometricTools) |
|
||||
| `icu` | `USE_APPLESEED` | `install` | `patch` | [repository](https://github.com/BRL-CAD/icu) |
|
||||
| `ispc` | `USE_OSPRAY` | `install` | `bison`, `flex`, `patch`, `llvm`, `ncurses`, `zlib` | [repository](https://github.com/BRL-CAD/ispc) |
|
||||
| `itk` | `USE_TCL` | `install` | `patch`, `tcl`, `tk` | [repository](https://github.com/BRL-CAD/itk) |
|
||||
| `iwidgets` | `USE_TCL` | `install` | `patch`, `itk` | [repository](https://github.com/BRL-CAD/iwidgets) |
|
||||
| `itcl` | `USE_TCL` | `install` | `patch`, `tcl` | [repository](https://github.com/BRL-CAD/itcl) |
|
||||
| `itk` | `USE_TCL` | `install` | `patch`, `tcl`, `tk`, `itcl` | [repository](https://github.com/BRL-CAD/itk) |
|
||||
| `iwidgets` | `USE_TCL` | `install` | `patch`, `itcl`, `itk` | [repository](https://github.com/BRL-CAD/iwidgets) |
|
||||
| `jpeg` | `USE_APPLESEED`, `USE_BRLCAD`, `USE_GDAL` | `install` | `patch` | [repository](https://github.com/BRL-CAD/libjpeg-turbo) |
|
||||
| `lemon` | `USE_BRLCAD` | `noinstall` | `patch` | [repository](https://github.com/BRL-CAD/lemon) |
|
||||
| `lief` | `USE_BRLCAD` | `noinstall` | `patch` | [repository](https://github.com/BRL-CAD/LIEF) |
|
||||
@@ -57,14 +58,13 @@ selection further.
|
||||
| `openexr` | `USE_APPLESEED` | `install` | `deflate`, `patch` | [repository](https://github.com/BRL-CAD/openexr) |
|
||||
| `openimageio` | `USE_APPLESEED` | `install` | `boost`, `fmt`, `jpeg`, `opencolorio`, `openexr`, `patch`, `png`, `tiff`, `zlib` | [repository](https://github.com/BRL-CAD/oiio) |
|
||||
| `opennurbs` | `USE_BRLCAD` | `install` | `patch`, `zlib` | [repository](https://github.com/BRL-CAD/opennurbs) |
|
||||
| `openvdb` | `USE_BRLCAD_EXTRA` | `install` | `onetbb`, `patch`, `zlib` | [repository](https://github.com/BRL-CAD/openvdb) |
|
||||
| `osl` | `USE_APPLESEED` | `install` | `bison`, `boost`, `flex`, `llvm`, `openexr`, `openimageio`, `patch`, `pugixml`, `zlib` | [repository](https://github.com/BRL-CAD/OpenShadingLanguage) |
|
||||
| `osmesa` | `USE_BRLCAD` | `install` | `patch` | [repository](https://github.com/BRL-CAD/osmesa) |
|
||||
| `ospray` | `USE_OSPRAY` | `install` | `embree`, `ispc`, `oidn`, `onetbb`, `patch`, `rkcommon` | [repository](https://github.com/BRL-CAD/ospray) |
|
||||
| `patch` | always considered | `noinstall` | — | [repository](https://github.com/BRL-CAD/patch) |
|
||||
| `perplex` | `USE_BRLCAD` | `noinstall` | `patch`, `lemon`, `re2c` | [repository](https://github.com/BRL-CAD/perplex) |
|
||||
| `plief` | `USE_BRLCAD` | `noinstall` | `lief`, `patch` | [repository](https://github.com/BRL-CAD/plief) |
|
||||
| `png` | `USE_APPLESEED`, `USE_BRLCAD`, `USE_TCL` | `install` | `patch`, `zlib` | [repository](https://github.com/BRL-CAD/libpng) |
|
||||
| `png` | `USE_APPLESEED`, `USE_BRLCAD` | `install` | `patch`, `zlib` | [repository](https://github.com/BRL-CAD/libpng) |
|
||||
| `poissonrecon` | `USE_BRLCAD` | `noinstall` | `patch` | [repository](https://github.com/BRL-CAD/PoissonRecon) |
|
||||
| `proj` | `USE_GDAL` | `install` | `patch`, `sqlite3` | [repository](https://github.com/BRL-CAD/PROJ) |
|
||||
| `pugixml` | `USE_BRLCAD`, `USE_APPLESEED` | `install` | `patch` | [repository](https://github.com/BRL-CAD/pugixml) |
|
||||
@@ -83,8 +83,9 @@ selection further.
|
||||
| `tkhtml` | `USE_TCL` | `install` | `patch`, `tcl`, `tk` | [repository](https://github.com/BRL-CAD/tkhtml) |
|
||||
| `tktable` | `USE_TCL` | `install` | `patch`, `tcl`, `tk` | [repository](https://github.com/BRL-CAD/tktable) |
|
||||
| `xerces-c` | `USE_APPLESEED` | `install` | `icu`, `patch` | [repository](https://github.com/BRL-CAD/xerces-c) |
|
||||
| `xmltools` | `USE_BRLCAD_EXTRA` | `noinstall` | `patch` | [repository](https://github.com/BRL-CAD/xmltools) |
|
||||
| `yaml-cpp` | `USE_APPLESEED` | `install` | `patch` | [repository](https://github.com/BRL-CAD/yaml-cpp) |
|
||||
| `zlib` | `USE_APPLESEED`, `USE_BRLCAD`, `USE_OSPRAY`, `USE_TCL` | `install` | `patch` | [repository](https://github.com/BRL-CAD/zlib) |
|
||||
| `zlib` | `USE_APPLESEED`, `USE_BRLCAD`, `USE_OSPRAY` | `install` | `patch` | [repository](https://github.com/BRL-CAD/zlib) |
|
||||
| `zstd` | `USE_APPLESEED`, `USE_OSPRAY` | `install` | `patch` | [repository](https://github.com/BRL-CAD/zstd) |
|
||||
<!-- END GENERATED PROJECT TABLE -->
|
||||
|
||||
|
||||
@@ -106,10 +106,6 @@ sudo apt install autotools-dev autoconf
|
||||
If you enable Qt, Appleseed, or OSPRay, make sure Python 3 is installed and
|
||||
available in the build environment.
|
||||
|
||||
Keep the source and build directories close to the drive root when possible.
|
||||
Some Windows build tools still have path length limits, even though bext enables
|
||||
Git's long path handling when it checks out submodules.
|
||||
|
||||
# macOS
|
||||
|
||||
Assuming XCode is installed, good to go.
|
||||
|
||||
@@ -61,49 +61,44 @@ When `bext` is driven from a BRL-CAD build, `BRLCAD_COMPONENTS` can further
|
||||
narrow some BRL-CAD-related packages to only those needed by the requested
|
||||
component set.
|
||||
|
||||
## Xmin-backed bundled toolkits
|
||||
## Additional bundled Tk patches
|
||||
|
||||
An installed Xmin SDK can provide the X11 and OpenGL surface for bext's
|
||||
bundled Tk and Qt. Set `BEXT_XMIN_ROOT` to select the standard Xmin profile:
|
||||
Unix builds may pass a semicolon-separated list of absolute patch paths in
|
||||
`TK_EXTRA_PATCHES`. The patches are applied after bext's built-in Tk patches.
|
||||
Additional arguments for Tk's Unix `configure` script may likewise be supplied
|
||||
as a semicolon-separated `TK_CONFIGURE_ARGS` list. For example:
|
||||
|
||||
```sh
|
||||
cmake -DTK_EXTRA_PATCHES=/absolute/path/tk.patch \
|
||||
-DTK_CONFIGURE_ARGS=--with-example=/absolute/prefix ...
|
||||
```
|
||||
|
||||
## Xmin-backed bundled Qt
|
||||
|
||||
An installed Xmin SDK can provide the complete X11/XCB/OpenGL surface for
|
||||
bext's bundled Qt without linking Qt to host X libraries. Set
|
||||
`QT_XMIN_ROOT` to the exact SDK prefix and provide the patch matching bext's
|
||||
Qt version in `QT_EXTRA_PATCHES`:
|
||||
|
||||
```sh
|
||||
cmake -S /path/to/bext -B /path/to/bext-build \
|
||||
-DBEXT_XMIN_ROOT=/absolute/path/to/xmin-sdk \
|
||||
-DENABLE_TCL=ON -DENABLE_QT=ON
|
||||
-DENABLE_QT=ON \
|
||||
-DQT_XMIN_ROOT=/absolute/path/to/xmin-sdk \
|
||||
-DQT_EXTRA_PATCHES=/absolute/path/to/Xmin/patches/qt/qt-6.11.1-xmin.patch
|
||||
```
|
||||
|
||||
The profile affects only Tk and Qt packages selected for a local build. It
|
||||
does not enable a package excluded by `USE_*`, `BRLCAD_COMPONENTS`, or an
|
||||
explicit `DISABLE_*` setting.
|
||||
|
||||
* Tk is configured with `--with-xmin` and bext's matching Tk patch.
|
||||
* Qt is built with the matching Xmin patch, the qxcb desktop-OpenGL profile,
|
||||
and dependency audits that reject accidental host X11 or OpenGL linkage.
|
||||
|
||||
The patches are maintained next to the dependency build logic as
|
||||
`tk/tk_xmin.patch` and `qt/qt_xmin.patch`. They are tied to the exact Tk
|
||||
and Qt submodule revisions in this repository. Updating either dependency
|
||||
therefore requires updating its patch; a stale patch fails during the patch
|
||||
step rather than silently producing a mixed build.
|
||||
|
||||
The Xmin SDK must include toolkit-client support for Tk. Qt additionally
|
||||
requires the Qt X11 compatibility client and client OpenGL support. Normal
|
||||
system discovery is unchanged when `BEXT_XMIN_ROOT` is empty.
|
||||
The Xmin SDK must have been installed with `XMIN_BUILD_QT_CLIENT=ON` and
|
||||
`XMIN_BUILD_CLIENT_GL=ON`. This mode forces Qt's qxcb desktop-OpenGL profile,
|
||||
uses bundled font and image dependencies, disables conventional X11, XCB,
|
||||
xkbcommon, EGL, and OpenGL package discovery, and rejects Qt artifacts that
|
||||
resolve any corresponding host libraries. Normal Qt autodetection is
|
||||
unchanged when `QT_XMIN_ROOT` is empty.
|
||||
|
||||
Qt's installed package metadata retains an explicit dependency on Xmin.
|
||||
Downstream projects must therefore keep the same SDK discoverable with
|
||||
`Xmin_DIR` or `CMAKE_PREFIX_PATH`; configuration fails instead of falling back
|
||||
to host X libraries when that SDK is absent.
|
||||
|
||||
## Advanced toolkit patch controls
|
||||
|
||||
Unix builds may pass additional, semicolon-separated absolute patch paths in
|
||||
`TK_EXTRA_PATCHES`, plus additional Tk `configure` arguments in
|
||||
`TK_CONFIGURE_ARGS`. `QT_EXTRA_PATCHES` provides the corresponding Qt
|
||||
hook. `QT_XMIN_ROOT` remains available for manually supplied Qt Xmin patches.
|
||||
These low-level controls are not needed when `BEXT_XMIN_ROOT` selects the
|
||||
standard profile.
|
||||
|
||||
# Official profiles
|
||||
|
||||
The supported configure entry points are:
|
||||
|
||||
@@ -33,9 +33,6 @@ if (ENABLE_ASTYLE)
|
||||
-DCMAKE_INSTALL_PREFIX=${CMAKE_NOBUNDLE_INSTALL_PREFIX}
|
||||
-DCMAKE_INSTALL_LIBDIR:PATH=${LIB_DIR}
|
||||
-DCMAKE_INSTALL_RPATH=${CMAKE_NOBUNDLE_INSTALL_PREFIX}/${LIB_DIR}
|
||||
-DBUILD_SHARED_LIBS=OFF
|
||||
-DBUILD_STATIC_LIBS=OFF
|
||||
-DBUILD_JAVA_LIBS=OFF
|
||||
LOG_CONFIGURE ${EXT_BUILD_QUIET}
|
||||
LOG_BUILD ${EXT_BUILD_QUIET}
|
||||
LOG_INSTALL ${EXT_BUILD_QUIET}
|
||||
|
||||
+1
-1
Submodule astyle/astyle updated: 848edc8206...35f559a2f6
+31
-128
@@ -1,74 +1,22 @@
|
||||
diff -Naur astyle/CMakeLists.txt ASTYLE_BLD/CMakeLists.txt
|
||||
--- astyle/CMakeLists.txt 2026-09-09 09:23:57.197122193 -0400
|
||||
+++ ASTYLE_BLD/CMakeLists.txt 2026-09-09 09:17:33.423173910 -0400
|
||||
@@ -17,6 +17,8 @@
|
||||
endif()
|
||||
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
+set(CMAKE_CXX_EXTENSIONS OFF)
|
||||
+set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
# Linux Soname Version
|
||||
set(MAJORVER 3)
|
||||
@@ -72,151 +74,13 @@
|
||||
target_compile_options(astyle PRIVATE /utf-8)
|
||||
endif()
|
||||
|
||||
-# Set build-specific compile options
|
||||
-if(BUILD_SHARED_LIBS OR BUILD_STATIC_LIBS)
|
||||
- if(BUILD_JAVA_LIBS)
|
||||
- find_package(JNI)
|
||||
- if (NOT JNI_FOUND)
|
||||
- set(err_jni "Use '-DJAVA_HOME=<JNI Directory>' to define the Java path")
|
||||
- message(FATAL_ERROR ${err_jni})
|
||||
- endif()
|
||||
- target_compile_options(astyle PRIVATE -DASTYLE_JNI)
|
||||
- target_include_directories(astyle PRIVATE ${JNI_INCLUDE_DIRS})
|
||||
- else()
|
||||
- target_compile_options(astyle PRIVATE -DASTYLE_LIB)
|
||||
- endif()
|
||||
- # Windows DLL exports removed
|
||||
- set_property(TARGET astyle PROPERTY DEFINE_SYMBOL "")
|
||||
- # Linux solib version added
|
||||
- set_property(TARGET astyle PROPERTY VERSION ${SOLIBVER})
|
||||
- set_property(TARGET astyle PROPERTY SOVERSION ${MAJORVER})
|
||||
-endif()
|
||||
-
|
||||
-
|
||||
-# Linker options:
|
||||
-
|
||||
-# Strip release builds
|
||||
-if(CMAKE_BUILD_TYPE STREQUAL "Release" OR CMAKE_BUILD_TYPE STREQUAL "MinSizeRel")
|
||||
- if(NOT BUILD_STATIC_LIBS AND NOT BORLAND AND NOT MSVC)
|
||||
- add_custom_command(TARGET astyle POST_BUILD
|
||||
- COMMAND ${CMAKE_STRIP} $<TARGET_FILE_NAME:astyle>)
|
||||
- endif()
|
||||
-endif()
|
||||
-# Shared library options
|
||||
-if(BUILD_SHARED_LIBS)
|
||||
- set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "") # remove -rdynamic
|
||||
- if(${CMAKE_CXX_COMPILER_ID} STREQUAL "Intel")
|
||||
- # need static linking because cannot find the intel libraries at runtime
|
||||
- set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -static-intel")
|
||||
- elseif(MINGW)
|
||||
- # minGW dlls don't work
|
||||
- # tdm-gcc dlls work with everything except python
|
||||
- set(CMAKE_SHARED_LINKER_FLAGS
|
||||
- "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--add-stdcall-alias -Wl,--dll")
|
||||
- elseif(BORLAND)
|
||||
- # use a development environment to compile Borland dlls
|
||||
- endif()
|
||||
-endif()
|
||||
-
|
||||
-
|
||||
-# Installation options:
|
||||
-
|
||||
diff -Naur astyle/build/cmake/InstallOptions.cmake ASTYLE_BLD/build/cmake/InstallOptions.cmake
|
||||
--- astyle/build/cmake/InstallOptions.cmake 2024-06-24 11:35:23.444068225 -0400
|
||||
+++ ASTYLE_BLD/build/cmake/InstallOptions.cmake 2024-06-24 11:36:14.697228521 -0400
|
||||
@@ -1,45 +1,10 @@
|
||||
-# Define install directories
|
||||
-# To uninstall 'xargs rm < install_manifest.txt'
|
||||
-# Default linux install prefix is /usr/local"
|
||||
-# This may be modified by -DCMAKE_INSTALL_PREFIX=
|
||||
-# Default Win32 install prefix is not used (C:/Program Files (x86))
|
||||
-
|
||||
+install(TARGETS astyle
|
||||
+ LIBRARY DESTINATION lib
|
||||
+ ARCHIVE DESTINATION lib
|
||||
+ RUNTIME DESTINATION bin
|
||||
+ )
|
||||
+install(FILES ${DOCS} DESTINATION share/doc/astyle/html)
|
||||
+if (MAN)
|
||||
+ INSTALL(FILES ${MAN} DESTINATION man/man1)
|
||||
+endif (MAN)
|
||||
|
||||
-option(INSTALL_DOC ON)
|
||||
-
|
||||
-if(BUILD_SHARED_LIBS OR BUILD_STATIC_LIBS)
|
||||
@@ -108,66 +56,21 @@ diff -Naur astyle/CMakeLists.txt ASTYLE_BLD/CMakeLists.txt
|
||||
- endif()
|
||||
- endif()
|
||||
-endif()
|
||||
-
|
||||
-
|
||||
-# output files:
|
||||
+install(TARGETS astyle
|
||||
+ LIBRARY DESTINATION lib
|
||||
+ ARCHIVE DESTINATION lib
|
||||
+ RUNTIME DESTINATION bin
|
||||
+ )
|
||||
+install(FILES ${DOCS} DESTINATION share/doc/astyle/html)
|
||||
+if (MAN)
|
||||
+ INSTALL(FILES ${MAN} DESTINATION man/man1)
|
||||
+endif (MAN)
|
||||
diff -Naur astyle/CMakeLists.txt ASTYLE_BLD/CMakeLists.txt
|
||||
--- astyle/CMakeLists.txt 2024-06-06 01:30:44.000000000 -0400
|
||||
+++ ASTYLE_BLD/CMakeLists.txt 2024-06-28 12:11:49.297259511 -0400
|
||||
@@ -6,9 +6,13 @@
|
||||
|
||||
-# Set output file names if different than 'astyle'
|
||||
-if(BUILD_JAVA_LIBS)
|
||||
- if(WIN32)
|
||||
- set_property(TARGET astyle PROPERTY OUTPUT_NAME AStyle32j)
|
||||
- set_property(TARGET astyle PROPERTY PREFIX "")
|
||||
- else()
|
||||
- set_property(TARGET astyle PROPERTY OUTPUT_NAME astylej)
|
||||
- endif()
|
||||
-elseif(BUILD_SHARED_LIBS)
|
||||
- if(WIN32)
|
||||
- set_property(TARGET astyle PROPERTY OUTPUT_NAME AStyle32)
|
||||
- set_property(TARGET astyle PROPERTY PREFIX "")
|
||||
- endif()
|
||||
-elseif(BUILD_STATIC_LIBS)
|
||||
- if(WIN32)
|
||||
- set_property(TARGET astyle PROPERTY OUTPUT_NAME AStyleLib)
|
||||
- set_property(TARGET astyle PROPERTY PREFIX "")
|
||||
- endif()
|
||||
-else()
|
||||
- if(WIN32)
|
||||
- set_property(TARGET astyle PROPERTY OUTPUT_NAME AStyle)
|
||||
- endif()
|
||||
-endif()
|
||||
-
|
||||
-
|
||||
-# print info:
|
||||
-
|
||||
-if(BUILD_JAVA_LIBS)
|
||||
- SET(ASTYLE_BUILD_TYPE "Java Shared Library")
|
||||
-elseif(BUILD_SHARED_LIBS)
|
||||
- SET(ASTYLE_BUILD_TYPE "Shared Library")
|
||||
-elseif(BUILD_STATIC_LIBS)
|
||||
- SET(ASTYLE_BUILD_TYPE "Static Library")
|
||||
-else()
|
||||
- SET(ASTYLE_BUILD_TYPE "Executable")
|
||||
-endif()
|
||||
-
|
||||
-# Display build information
|
||||
-
|
||||
-message( STATUS "---------- General Configuration ----------" )
|
||||
-message( STATUS )
|
||||
-message( STATUS "CMake Generator: ${CMAKE_GENERATOR}" )
|
||||
-message( STATUS "CMake Compiler: ${CMAKE_CXX_COMPILER_ID}" )
|
||||
-message( STATUS "AStyle Build: ${ASTYLE_BUILD_TYPE}" )
|
||||
-message( STATUS "AStyle Configuration: ${CMAKE_BUILD_TYPE}" )
|
||||
-if( BUILD_JAVA_LIBS )
|
||||
- message( STATUS "Java Include Path: ${JAVA_INCLUDE_PATH}" )
|
||||
-endif()
|
||||
-message( STATUS )
|
||||
-message( STATUS "-------------------------------------------" )
|
||||
project(astyle CXX)
|
||||
|
||||
+set(CMAKE_CXX_EXTENSIONS OFF)
|
||||
+set(CMAKE_CXX_STANDARD 17)
|
||||
+set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
+
|
||||
include( build/cmake/Options.cmake REQUIRED )
|
||||
include( build/cmake/CompilerOptions.cmake REQUIRED )
|
||||
-include( build/cmake/LinkerOptions.cmake REQUIRED )
|
||||
+#include( build/cmake/LinkerOptions.cmake REQUIRED )
|
||||
include( build/cmake/InstallOptions.cmake REQUIRED )
|
||||
include( build/cmake/OutputFiles.cmake REQUIRED )
|
||||
include( build/cmake/PrintInfo.cmake REQUIRED )
|
||||
|
||||
+1
-1
Submodule clipper2/Clipper2 updated: ef88ee97c0...6901921c4b
+2
-27
@@ -24,36 +24,10 @@ if (ENABLE_EIGEN)
|
||||
|
||||
RegisterDeps(EIGEN)
|
||||
|
||||
set(EIGEN_PATCH_FILES "${CMAKE_CURRENT_SOURCE_DIR}/eigen_common.patch")
|
||||
if (APPLE)
|
||||
list(APPEND EIGEN_PATCH_FILES
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/eigen_macos.patch")
|
||||
endif (APPLE)
|
||||
if (MSVC)
|
||||
list(APPEND EIGEN_PATCH_FILES
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/eigen_msvc.patch")
|
||||
endif (MSVC)
|
||||
|
||||
set(EIGEN_PATCH_COMMAND)
|
||||
foreach(EIGEN_PATCH_FILE IN LISTS EIGEN_PATCH_FILES)
|
||||
if (NOT EIGEN_PATCH_COMMAND)
|
||||
set(EIGEN_PATCH_COMMAND
|
||||
${PATCH_EXECUTABLE} -E -p1 ${PATCH_OPTIONS} -i ${EIGEN_PATCH_FILE}
|
||||
)
|
||||
else ()
|
||||
list(APPEND EIGEN_PATCH_COMMAND
|
||||
COMMAND ${PATCH_EXECUTABLE} -E -p1 ${PATCH_OPTIONS}
|
||||
-i ${EIGEN_PATCH_FILE}
|
||||
)
|
||||
endif ()
|
||||
endforeach ()
|
||||
unset(EIGEN_PATCH_FILE)
|
||||
unset(EIGEN_PATCH_FILES)
|
||||
|
||||
ExternalProject_Add(EIGEN_BLD
|
||||
URL "${CMAKE_CURRENT_SOURCE_DIR}/eigen"
|
||||
BUILD_ALWAYS ${EXT_BUILD_ALWAYS} ${LOG_OPTS}
|
||||
PATCH_COMMAND ${EIGEN_PATCH_COMMAND}
|
||||
PATCH_COMMAND ${PATCH_EXECUTABLE};-E;-p1;${PATCH_OPTIONS};-i;${CMAKE_CURRENT_SOURCE_DIR}/eigen.patch
|
||||
CMAKE_ARGS
|
||||
-DBUILD_TESTING=OFF
|
||||
-DEIGEN_BUILD_DOC=OFF
|
||||
@@ -87,3 +61,4 @@ endif (ENABLE_EIGEN)
|
||||
# indent-tabs-mode: t
|
||||
# End:
|
||||
# ex: shiftwidth=2 tabstop=8
|
||||
|
||||
|
||||
+1
-1
Submodule eigen/eigen updated: bc3b39870e...3147391d94
@@ -0,0 +1,25 @@
|
||||
diff -Naur eigen/CMakeLists.txt EIGEN_BLD/CMakeLists.txt
|
||||
--- eigen/CMakeLists.txt 2024-04-16 20:37:46.506698007 -0400
|
||||
+++ EIGEN_BLD/CMakeLists.txt 2024-04-16 20:38:21.574118370 -0400
|
||||
@@ -635,7 +635,7 @@
|
||||
export (TARGETS eigen NAMESPACE Eigen3:: FILE Eigen3Targets.cmake)
|
||||
# Export Eigen3 package to CMake registry such that it can be easily found by
|
||||
# CMake even if it has not been installed to a standard directory.
|
||||
-export (PACKAGE Eigen3)
|
||||
+#export (PACKAGE Eigen3)
|
||||
|
||||
install (EXPORT Eigen3Targets NAMESPACE Eigen3:: DESTINATION ${CMAKEPACKAGE_INSTALL_DIR})
|
||||
|
||||
diff -Naur eigen/Eigen/src/Core/util/Memory.h EIGEN_BLD/Eigen/src/Core/util/Memory.h
|
||||
--- eigen/Eigen/src/Core/util/Memory.h 2024-04-16 20:37:46.522697745 -0400
|
||||
+++ EIGEN_BLD/Eigen/src/Core/util/Memory.h 2024-04-16 20:37:14.119233248 -0400
|
||||
@@ -586,6 +586,9 @@
|
||||
// to the appropriate stack allocation function
|
||||
#if ! defined EIGEN_ALLOCA && ! defined EIGEN_GPU_COMPILE_PHASE
|
||||
#if EIGEN_OS_LINUX || EIGEN_OS_MAC || (defined alloca)
|
||||
+ #if EIGEN_OS_MAC
|
||||
+ # include <alloca.h>
|
||||
+ #endif
|
||||
#define EIGEN_ALLOCA alloca
|
||||
#elif EIGEN_COMP_MSVC
|
||||
#define EIGEN_ALLOCA _alloca
|
||||
@@ -1,11 +0,0 @@
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -260,7 +260,7 @@
|
||||
export (TARGETS eigen NAMESPACE Eigen3:: FILE Eigen3Targets.cmake)
|
||||
# Export Eigen3 package to CMake registry such that it can be easily found by
|
||||
# CMake even if it has not been installed to a standard directory.
|
||||
- export (PACKAGE Eigen3)
|
||||
+ #export (PACKAGE Eigen3)
|
||||
|
||||
install (EXPORT Eigen3Targets NAMESPACE Eigen3:: DESTINATION ${CMAKEPACKAGE_INSTALL_DIR})
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
--- a/Eigen/src/Core/util/Memory.h
|
||||
+++ b/Eigen/src/Core/util/Memory.h
|
||||
@@ -647,6 +647,9 @@
|
||||
// to the appropriate stack allocation function
|
||||
#if !defined EIGEN_ALLOCA && !defined EIGEN_GPU_COMPILE_PHASE
|
||||
#if EIGEN_OS_LINUX || EIGEN_OS_MAC || (defined alloca)
|
||||
+#if EIGEN_OS_MAC
|
||||
+# include <alloca.h>
|
||||
+#endif
|
||||
#define EIGEN_ALLOCA alloca
|
||||
#elif EIGEN_COMP_MSVC
|
||||
#define EIGEN_ALLOCA _alloca
|
||||
@@ -1,15 +0,0 @@
|
||||
--- a/lapack/CMakeLists.txt
|
||||
+++ b/lapack/CMakeLists.txt
|
||||
@@ -20,6 +20,12 @@
|
||||
|
||||
add_custom_target(lapack)
|
||||
include_directories(../blas)
|
||||
+
|
||||
+# Eigen's template-heavy complex LAPACK sources can exceed the default COFF
|
||||
+# section limit when compiled with MSVC, particularly in debug builds.
|
||||
+if(MSVC)
|
||||
+ set_property(SOURCE complex_single.cpp complex_double.cpp APPEND PROPERTY COMPILE_OPTIONS "/bigobj")
|
||||
+endif()
|
||||
|
||||
set(EigenLapack_SRCS
|
||||
dsecnd_INT_CPU_TIME.cpp second_INT_CPU_TIME.cpp single.cpp double.cpp complex_single.cpp complex_double.cpp
|
||||
+1
-1
Submodule gdal/gdal updated: c8b4c45fca...ecf8a961b2
+53
-8
@@ -1,5 +1,47 @@
|
||||
--- a/cmake/modules/packages/FindSQLite3.cmake
|
||||
+++ b/cmake/modules/packages/FindSQLite3.cmake
|
||||
diff -Naur gdal/apps/gdalalg_raster_tile.cpp GDAL_BLD/apps/gdalalg_raster_tile.cpp
|
||||
--- gdal/apps/gdalalg_raster_tile.cpp 2026-02-04 16:36:48.022371225 -0500
|
||||
+++ GDAL_BLD/apps/gdalalg_raster_tile.cpp 2026-02-04 16:36:21.803485814 -0500
|
||||
@@ -326,37 +326,6 @@
|
||||
.SetMaxValueIncluded(100)
|
||||
.SetCategory(ADVANCED_RESAMPLING_CATEGORY);
|
||||
|
||||
- constexpr const char *ADVANCED_RESAMPLING_CATEGORY = "Advanced Resampling";
|
||||
- auto &excludedValuesArg =
|
||||
- AddArg("excluded-values", 0,
|
||||
- _("Tuples of values (e.g. <R>,<G>,<B> or (<R1>,<G1>,<B1>),"
|
||||
- "(<R2>,<G2>,<B2>)) that must beignored as contributing source "
|
||||
- "pixels during (average) resampling"),
|
||||
- &m_excludedValues)
|
||||
- .SetCategory(ADVANCED_RESAMPLING_CATEGORY);
|
||||
- auto &excludedValuesPctThresholdArg =
|
||||
- AddArg(
|
||||
- "excluded-values-pct-threshold", 0,
|
||||
- _("Minimum percentage of source pixels that must be set at one of "
|
||||
- "the --excluded-values to cause the excluded value to be used as "
|
||||
- "the target pixel value"),
|
||||
- &m_excludedValuesPctThreshold)
|
||||
- .SetDefault(m_excludedValuesPctThreshold)
|
||||
- .SetMinValueIncluded(0)
|
||||
- .SetMaxValueIncluded(100)
|
||||
- .SetCategory(ADVANCED_RESAMPLING_CATEGORY);
|
||||
- auto &nodataValuesPctThresholdArg =
|
||||
- AddArg(
|
||||
- "nodata-values-pct-threshold", 0,
|
||||
- _("Minimum percentage of source pixels that must be set at one of "
|
||||
- "nodata (or alpha=0 or any other way to express transparent pixel"
|
||||
- "to cause the target pixel value to be transparent"),
|
||||
- &m_nodataValuesPctThreshold)
|
||||
- .SetDefault(m_nodataValuesPctThreshold)
|
||||
- .SetMinValueIncluded(0)
|
||||
- .SetMaxValueIncluded(100)
|
||||
- .SetCategory(ADVANCED_RESAMPLING_CATEGORY);
|
||||
-
|
||||
constexpr const char *PUBLICATION_CATEGORY = "Publication";
|
||||
AddArg("webviewer", 0, _("Web viewer to generate"), &m_webviewers)
|
||||
.SetDefault("all")
|
||||
diff -Naur gdal/cmake/modules/packages/FindSQLite3.cmake GDAL_BLD/cmake/modules/packages/FindSQLite3.cmake
|
||||
--- gdal/cmake/modules/packages/FindSQLite3.cmake 2026-02-04 16:36:47.818372116 -0500
|
||||
+++ GDAL_BLD/cmake/modules/packages/FindSQLite3.cmake 2026-02-04 16:28:57.601427168 -0500
|
||||
@@ -57,7 +57,7 @@
|
||||
NAMES sqlite3.h
|
||||
HINTS ${PC_SQLITE3_INCLUDE_DIRS})
|
||||
@@ -9,8 +51,9 @@
|
||||
NAMES_PER_DIR
|
||||
HINTS ${PC_SQLITE3_LIBRARY_DIRS})
|
||||
endif()
|
||||
--- a/gcore/gdal_multidomainmetadata.h
|
||||
+++ b/gcore/gdal_multidomainmetadata.h
|
||||
diff -Naur gdal/gcore/gdal_multidomainmetadata.h GDAL_BLD/gcore/gdal_multidomainmetadata.h
|
||||
--- gdal/gcore/gdal_multidomainmetadata.h 2026-02-05 09:46:40.132404369 -0500
|
||||
+++ GDAL_BLD/gcore/gdal_multidomainmetadata.h 2026-02-05 09:48:20.477951010 -0500
|
||||
@@ -18,6 +18,15 @@
|
||||
#include "cpl_port.h"
|
||||
#include "cpl_string.h"
|
||||
@@ -27,8 +70,9 @@
|
||||
#include <map>
|
||||
|
||||
/*! @cond Doxygen_Suppress */
|
||||
--- a/gdal.cmake
|
||||
+++ b/gdal.cmake
|
||||
diff -Naur gdal/gdal.cmake GDAL_BLD/gdal.cmake
|
||||
--- gdal/gdal.cmake 2026-02-04 16:36:47.825372086 -0500
|
||||
+++ GDAL_BLD/gdal.cmake 2026-02-04 16:28:57.602427164 -0500
|
||||
@@ -238,12 +238,6 @@
|
||||
set_property(TARGET ${GDAL_LIB_TARGET_NAME} PROPERTY PLUGIN_OUTPUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/gdalplugins")
|
||||
file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/gdalplugins")
|
||||
@@ -42,8 +86,9 @@
|
||||
if (MINGW AND BUILD_SHARED_LIBS)
|
||||
set_target_properties(${GDAL_LIB_TARGET_NAME} PROPERTIES SUFFIX "-${GDAL_SOVERSION}${CMAKE_SHARED_LIBRARY_SUFFIX}")
|
||||
endif ()
|
||||
--- a/port/cpl_port.h
|
||||
+++ b/port/cpl_port.h
|
||||
diff -Naur gdal/port/cpl_port.h GDAL_BLD/port/cpl_port.h
|
||||
--- gdal/port/cpl_port.h 2026-02-04 16:36:47.823372095 -0500
|
||||
+++ GDAL_BLD/port/cpl_port.h 2026-02-04 16:28:57.603427159 -0500
|
||||
@@ -1019,7 +1019,7 @@
|
||||
#define TRUE 1
|
||||
#endif
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
--- a/frmts/png/pngdataset.cpp
|
||||
+++ b/frmts/png/pngdataset.cpp
|
||||
diff -Naur gdal/frmts/png/pngdataset.cpp GDAL_BLD/frmts/png/pngdataset.cpp
|
||||
--- gdal/frmts/png/pngdataset.cpp 2026-05-29 11:02:04.453453107 -0400
|
||||
+++ GDAL_BLD/frmts/png/pngdataset.cpp 2026-05-29 11:02:51.019304367 -0400
|
||||
@@ -42,7 +42,9 @@
|
||||
#pragma clang diagnostic pop
|
||||
#endif
|
||||
@@ -11,8 +12,9 @@
|
||||
|
||||
#include <algorithm>
|
||||
#include <limits>
|
||||
--- a/frmts/png/pngdataset.h
|
||||
+++ b/frmts/png/pngdataset.h
|
||||
diff -Naur gdal/frmts/png/pngdataset.h GDAL_BLD/frmts/png/pngdataset.h
|
||||
--- gdal/frmts/png/pngdataset.h 2026-05-29 11:02:04.454453104 -0400
|
||||
+++ GDAL_BLD/frmts/png/pngdataset.h 2026-05-29 11:02:42.415331850 -0400
|
||||
@@ -40,7 +40,9 @@
|
||||
|
||||
#include "png.h"
|
||||
|
||||
+1
-1
Submodule gte/GeometricTools updated: e095b84018...7adae93f85
+1
-1
@@ -6,7 +6,7 @@ diff -Naur GeometricTools/CMakeLists.txt GTE_BLD/CMakeLists.txt
|
||||
+
|
||||
+project(GTE)
|
||||
+
|
||||
+file(GLOB GTE_MFILES LIST_DIRECTORIES false "${CMAKE_SOURCE_DIR}/GTE/Mathematics/*")
|
||||
+file(GLOB GTE_MFILES "${CMAKE_SOURCE_DIR}/GTE/Mathematics/*")
|
||||
+
|
||||
+if(NOT DEFINED INCLUDE_DIR)
|
||||
+ set(INCLUDE_DIR include)
|
||||
|
||||
@@ -0,0 +1,146 @@
|
||||
if (USE_BRLCAD)
|
||||
|
||||
# Decide if we're using ITcl
|
||||
cad_enable(ITCL "archer;mged;bwish;rtwizard;brlman")
|
||||
|
||||
else (USE_BRLCAD)
|
||||
|
||||
if (ENABLE_TCL AND NOT DEFINED ENABLE_ITCL)
|
||||
set(ENABLE_ITCL ON)
|
||||
endif (ENABLE_TCL AND NOT DEFINED ENABLE_ITCL)
|
||||
|
||||
endif (USE_BRLCAD)
|
||||
|
||||
if (NOT ENABLE_ITCL AND NOT DEFINED DISABLE_ITCL)
|
||||
|
||||
find_package(ITCL)
|
||||
|
||||
if (NOT ITCL_FOUND AND NOT DEFINED ENABLE_ITCL)
|
||||
set(ENABLE_ITCL "ON" CACHE BOOL "Enable itcl build")
|
||||
endif (NOT ITCL_FOUND AND NOT DEFINED ENABLE_ITCL)
|
||||
|
||||
endif (NOT ENABLE_ITCL AND NOT DEFINED DISABLE_ITCL)
|
||||
set(ENABLE_ITCL "${ENABLE_ITCL}" CACHE BOOL "Enable itcl build")
|
||||
|
||||
if (ENABLE_ITCL)
|
||||
|
||||
git_submodule_init(itcl configure.in)
|
||||
|
||||
RegisterDeps(ITCL)
|
||||
|
||||
# Itcl3 has a problem in that it requires internal Tcl headers.
|
||||
# Occasionally (but not always) we can get these headers from
|
||||
# a system include path.
|
||||
|
||||
if (NOT TARGET TCL_BLD)
|
||||
# If we're not building the bundled Tcl, see if the system
|
||||
# Tcl gives us the private headers.
|
||||
set(CMAKE_FIND_FRAMEWORK NEVER)
|
||||
find_package(TCL)
|
||||
set(HDRS_CANDIDATE_DIR ${TCL_INCLUDE_PATH}8.6/tcl-private)
|
||||
if (EXISTS ${HDRS_CANDIDATE_DIR})
|
||||
set(TCL_PRIVATE_HDRS ${HDRS_CANDIDATE_DIR}/generic)
|
||||
if(NOT WIN32)
|
||||
set(TCL_PRIVATE_HDRS_OS ${HDRS_CANDIDATE_DIR}/unix)
|
||||
else(NOT WIN32)
|
||||
set(TCL_PRIVATE_HDRS_OS ${HDRS_CANDIDATE_DIR}/win)
|
||||
endif(NOT WIN32)
|
||||
endif (EXISTS ${HDRS_CANDIDATE_DIR})
|
||||
endif (NOT TARGET TCL_BLD)
|
||||
|
||||
# message("TCL HEADERS1: ${TCL_PRIVATE_HDRS}")
|
||||
|
||||
# If we can't find them from the system, see if we have a local
|
||||
# clone of Tcl to use
|
||||
if (NOT TCL_PRIVATE_HDRS AND EXISTS ${CMAKE_SOURCE_DIR}/tcl/tcl)
|
||||
set(TCL_SOURCE_DIR ${CMAKE_SOURCE_DIR}/tcl/tcl)
|
||||
set(TCL_PRIVATE_HDRS ${TCL_SOURCE_DIR}/generic)
|
||||
if(NOT WIN32)
|
||||
set(TCL_PRIVATE_HDRS_OS ${TCL_SOURCE_DIR}/unix)
|
||||
else(NOT WIN32)
|
||||
set(TCL_PRIVATE_HDRS_OS ${TCL_SOURCE_DIR}/win)
|
||||
endif(NOT WIN32)
|
||||
endif (NOT TCL_PRIVATE_HDRS AND EXISTS ${CMAKE_SOURCE_DIR}/tcl/tcl)
|
||||
|
||||
# message("TCL HEADERS2: ${TCL_PRIVATE_HDRS}")
|
||||
|
||||
|
||||
# We need to know where the ITcl sources will wind up for some of
|
||||
# this logic
|
||||
set(ITCL_SRC_CPY_TGT "${CMAKE_CURRENT_BINARY_DIR}/ITCL_BLD-prefix/src/ITCL_BLD")
|
||||
|
||||
# If we STILL don't have anything, patch the Itcl sources to add
|
||||
# the headers in question
|
||||
set(TCL_HDRS_PATCH_CMD)
|
||||
if (NOT TCL_PRIVATE_HDRS)
|
||||
if(CMAKE_VERSION VERSION_LESS "3.26.0")
|
||||
set(TCL_HDRS_PATCH_CMD ${CMAKE_COMMAND};-E;copy_directory;${CMAKE_CURRENT_SOURCE_DIR}/addfiles/tcl_hdrs;${ITCL_SRC_CPY_TGT}/tcl_hdrs)
|
||||
else()
|
||||
set(TCL_HDRS_PATCH_CMD ${CMAKE_COMMAND};-E;copy_directory_if_different;${CMAKE_CURRENT_SOURCE_DIR}/addfiles/tcl_hdrs;${ITCL_SRC_CPY_TGT}/tcl_hdrs)
|
||||
endif()
|
||||
set(TCL_PRIVATE_HDRS "${ITCL_SRC_CPY_TGT}/tcl_hdrs")
|
||||
if(NOT WIN32)
|
||||
set(TCL_PRIVATE_HDRS_OS ${TCL_PRIVATE_HDRS}/unix)
|
||||
else(NOT WIN32)
|
||||
set(TCL_PRIVATE_HDRS_OS ${TCL_PRIVATE_HDRS}/win)
|
||||
endif(NOT WIN32)
|
||||
endif (NOT TCL_PRIVATE_HDRS)
|
||||
|
||||
# message("TCL HEADERS3: ${TCL_PRIVATE_HDRS}")
|
||||
|
||||
# When building ITCL, its path setup must take into account the subdirectory
|
||||
# in which we are storing the library.
|
||||
set(RPATH_SUFFIX itcl3.4)
|
||||
|
||||
|
||||
ExternalProject_Add(ITCL_BLD
|
||||
URL "${CMAKE_CURRENT_SOURCE_DIR}/itcl"
|
||||
BUILD_ALWAYS ${EXT_BUILD_ALWAYS} ${LOG_OPTS}
|
||||
PATCH_COMMAND ${PATCH_EXECUTABLE};-E;-p1;${PATCH_OPTIONS};-i;${CMAKE_CURRENT_SOURCE_DIR}/itcl.patch
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory ${ITCL_SRC_CPY_TGT}/CMake
|
||||
COMMAND ${TCL_HDRS_PATCH_CMD}
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/addfiles/CMakeLists.txt ${ITCL_SRC_CPY_TGT}
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/addfiles/FindTCL.cmake ${ITCL_SRC_CPY_TGT}/CMake
|
||||
CMAKE_ARGS
|
||||
${BUILD_TYPE_SPECIFIER}
|
||||
-DBIN_DIR=$<IF:$<BOOL:${WIN32}>,${LIB_DIR},${BIN_DIR}>
|
||||
-DLIB_DIR=${LIB_DIR}
|
||||
-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
|
||||
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
|
||||
-DCMAKE_INSTALL_PREFIX=${CMAKE_BUNDLE_INSTALL_PREFIX}
|
||||
-DCMAKE_INSTALL_RPATH=${CMAKE_BUNDLE_INSTALL_PREFIX}/${LIB_DIR}/${RPATH_SUFFIX}
|
||||
-DINCLUDE_DIR=${INCLUDE_DIR}
|
||||
-DSHARED_DIR=${LIB_DIR}
|
||||
-DTCL_ENABLE_TK=ON
|
||||
-DTCL_ROOT=$<$<BOOL:${TCL_TARGET}>:${CMAKE_BUNDLE_INSTALL_PREFIX}>
|
||||
-DTCL_PRIVATE_HDRS=${TCL_PRIVATE_HDRS}
|
||||
-DTCL_PRIVATE_HDRS_OS=${TCL_PRIVATE_HDRS_OS}
|
||||
LOG_CONFIGURE ${EXT_BUILD_QUIET}
|
||||
LOG_BUILD ${EXT_BUILD_QUIET}
|
||||
LOG_INSTALL ${EXT_BUILD_QUIET}
|
||||
LOG_OUTPUT_ON_FAILURE ${EXT_BUILD_QUIET}
|
||||
STEP_TARGETS install
|
||||
)
|
||||
|
||||
TargetInstallDeps(ITCL ITCL_DEPENDS)
|
||||
|
||||
# Copy the license into position in CMAKE_BUNDLE_INSTALL_PREFIX
|
||||
configure_file(
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/itcl/license.terms
|
||||
${DOC_LICENSE_DIR}/itcl3.txt
|
||||
COPYONLY
|
||||
)
|
||||
|
||||
endif (ENABLE_ITCL)
|
||||
|
||||
mark_as_advanced(ITCL_LIBRARY)
|
||||
mark_as_advanced(ITCL_LIBRARIES)
|
||||
mark_as_advanced(ITCL_VERSION)
|
||||
|
||||
# Local Variables:
|
||||
# tab-width: 8
|
||||
# mode: cmake
|
||||
# indent-tabs-mode: t
|
||||
# End:
|
||||
# ex: shiftwidth=2 tabstop=8
|
||||
|
||||
@@ -0,0 +1,223 @@
|
||||
# C M A K E L I S T S . T X T
|
||||
# ITCL
|
||||
#
|
||||
# Copyright (c) 2010 United States Government as represented by
|
||||
# the U.S. Army Research Laboratory.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
#
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
#
|
||||
# 2. Redistributions in binary form must reproduce the above
|
||||
# copyright notice, this list of conditions and the following
|
||||
# disclaimer in the documentation and/or other materials provided
|
||||
# with the distribution.
|
||||
#
|
||||
# 3. The name of the author may not be used to endorse or promote
|
||||
# products derived from this software without specific prior written
|
||||
# permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
|
||||
# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
|
||||
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
|
||||
# GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
# *******************************************************************
|
||||
# *** ITCL CMakeLists.txt ***
|
||||
# *******************************************************************
|
||||
|
||||
# Minimum required version of CMake
|
||||
cmake_minimum_required(VERSION 3.18)
|
||||
|
||||
# set CMake project name
|
||||
project(ITCL)
|
||||
|
||||
# install(CODE) uses generator expressions - requires 3.14 or newer.
|
||||
# We want it to be on, but until we can bump our minimum requirement
|
||||
# set it to OLD to make sure we don't break anything.
|
||||
if (POLICY CMP0087)
|
||||
cmake_policy(SET CMP0087 OLD)
|
||||
endif (POLICY CMP0087)
|
||||
|
||||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMake")
|
||||
|
||||
set(CMAKE_FIND_FRAMEWORK NEVER)
|
||||
find_package(TCL)
|
||||
|
||||
# version numbers
|
||||
set(ITCL_VERSION_MAJOR 3)
|
||||
set(ITCL_VERSION_MINOR 4)
|
||||
set(ITCL_PATCH_LEVEL 3)
|
||||
|
||||
set(ITCL_VERSION "${ITCL_VERSION_MAJOR}.${ITCL_VERSION_MINOR}")
|
||||
|
||||
#---------------------------------------------------------------------
|
||||
# Initialize some relative variable names
|
||||
if(NOT BIN_DIR)
|
||||
if (WIN32)
|
||||
set(BIN_DIR lib)
|
||||
else (WIN32)
|
||||
set(BIN_DIR bin)
|
||||
endif (WIN32)
|
||||
endif(NOT BIN_DIR)
|
||||
if(NOT SHARED_DIR)
|
||||
set(SHARED_DIR lib)
|
||||
endif(NOT SHARED_DIR)
|
||||
if(NOT LIB_DIR)
|
||||
set(LIB_DIR lib)
|
||||
endif(NOT LIB_DIR)
|
||||
if(NOT INCLUDE_DIR)
|
||||
set(INCLUDE_DIR include)
|
||||
endif(NOT INCLUDE_DIR)
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
# First, get some standard options out of the way
|
||||
add_definitions(-DSTDC_HEADERS=1)
|
||||
|
||||
# We're building Itcl
|
||||
add_definitions(-DBUILD_itcl)
|
||||
|
||||
# Use fPIC if we have it
|
||||
include(CheckCCompilerFlag)
|
||||
check_c_compiler_flag(-fPIC HAVE_PIC_COMPILER_FLAG)
|
||||
if(HAVE_PIC_COMPILER_FLAG)
|
||||
add_definitions(-fPIC)
|
||||
endif(HAVE_PIC_COMPILER_FLAG)
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
# Header checks.
|
||||
#--------------------------------------------------------------------
|
||||
|
||||
include(CMakeParseArguments)
|
||||
include(CheckIncludeFiles)
|
||||
include(CheckCSourceCompiles)
|
||||
function(Tcl_Check_Include_File filename)
|
||||
cmake_parse_arguments(OPT "USE" "" "" ${ARGN})
|
||||
string(REPLACE "." "_" var "${filename}")
|
||||
string(REPLACE "/" "_" var "${var}")
|
||||
string(TOUPPER "${var}" var)
|
||||
check_include_files(${filename} HAVE_${var})
|
||||
if(HAVE_${var})
|
||||
set(CVAR HAVE_${var})
|
||||
if(OPT_USE)
|
||||
# Usability test requested - we're not done yet.
|
||||
check_c_source_compiles("#include <${filename}>\nint main() {return 0;}" ${var}_USABLE)
|
||||
if(${var}_USABLE)
|
||||
set(HAVE_${var} 1 PARENT_SCOPE)
|
||||
set(${CVAR} 1 PARENT_SCOPE)
|
||||
add_definitions(-D${CVAR}=1)
|
||||
endif(${var}_USABLE)
|
||||
else(OPT_USE)
|
||||
set(HAVE_${var} 1 PARENT_SCOPE)
|
||||
set(${CVAR} 1 PARENT_SCOPE)
|
||||
add_definitions(-D${CVAR}=1)
|
||||
endif(OPT_USE)
|
||||
endif(HAVE_${var})
|
||||
endfunction(Tcl_Check_Include_File)
|
||||
|
||||
Tcl_Check_Include_File(sys/types.h)
|
||||
Tcl_Check_Include_File(sys/stat.h)
|
||||
Tcl_Check_Include_File(stdlib.h)
|
||||
Tcl_Check_Include_File(string.h)
|
||||
Tcl_Check_Include_File(strings.h)
|
||||
Tcl_Check_Include_File(memory.h)
|
||||
Tcl_Check_Include_File(inttypes.h)
|
||||
Tcl_Check_Include_File(stdint.h)
|
||||
Tcl_Check_Include_File(unistd.h)
|
||||
Tcl_Check_Include_File(net/errno.h)
|
||||
Tcl_Check_Include_File(dirent.h)
|
||||
Tcl_Check_Include_File(errno.h USE)
|
||||
Tcl_Check_Include_File(float.h USE)
|
||||
Tcl_Check_Include_File(values.h USE)
|
||||
Tcl_Check_Include_File(limits.h USE)
|
||||
Tcl_Check_Include_File(sys/wait.h USE)
|
||||
Tcl_Check_Include_File(dlfcn.h USE)
|
||||
Tcl_Check_Include_File(sys/param.h USE)
|
||||
|
||||
set(ITCL_SRCS
|
||||
generic/itclStubInit.c
|
||||
generic/itclStubLib.c
|
||||
generic/itcl_bicmds.c
|
||||
generic/itcl_class.c
|
||||
generic/itcl_cmds.c
|
||||
generic/itcl_ensemble.c
|
||||
generic/itcl_linkage.c
|
||||
generic/itcl_methods.c
|
||||
generic/itcl_migrate.c
|
||||
generic/itcl_objects.c
|
||||
generic/itcl_parse.c
|
||||
generic/itcl_util.c
|
||||
)
|
||||
|
||||
if(WIN32)
|
||||
set(ITCL_SRCS ${ITCL_SRCS} win/dllEntryPoint.c)
|
||||
endif(WIN32)
|
||||
|
||||
set(ITCL_STUB_SRCS generic/itclStubLib.c)
|
||||
|
||||
set(ITCL_INCLUDE_PATH ${ITCL_SOURCE_DIR}/generic ${ITCL_BINARY_DIR}/include)
|
||||
mark_as_advanced(ITCL_INCLUDE_PATH)
|
||||
|
||||
# ITcl requires private Tcl headers, which we can't always assume from a system
|
||||
# install of Tcl. Require the build to tell us where to look
|
||||
if (NOT DEFINED TCL_PRIVATE_HDRS)
|
||||
message(FATAL_ERROR "Itcl3 needs to know where to find the Tcl private headers")
|
||||
endif (NOT DEFINED TCL_PRIVATE_HDRS)
|
||||
|
||||
include_directories(
|
||||
${TCL_INCLUDE_PATH}
|
||||
${ITCL_INCLUDE_PATH}
|
||||
${TCL_PRIVATE_HDRS};${TCL_PRIVATE_HDRS_OS}
|
||||
)
|
||||
|
||||
add_library(itcl${ITCL_VERSION} SHARED ${ITCL_SRCS})
|
||||
target_link_libraries(itcl${ITCL_VERSION} ${M_LIBRARY} ${TCL_STUB_LIBRARY} )
|
||||
set_property(TARGET itcl${ITCL_VERSION} APPEND PROPERTY COMPILE_DEFINITIONS USE_TCL_STUBS)
|
||||
install(TARGETS itcl${ITCL_VERSION}
|
||||
RUNTIME DESTINATION ${BIN_DIR}/itcl${ITCL_VERSION}
|
||||
LIBRARY DESTINATION ${SHARED_DIR}/itcl${ITCL_VERSION}
|
||||
ARCHIVE DESTINATION ${LIB_DIR}/itcl${ITCL_VERSION})
|
||||
|
||||
add_library(itclstub STATIC ${ITCL_STUB_SRCS})
|
||||
install(TARGETS itclstub
|
||||
RUNTIME DESTINATION ${BIN_DIR}/itcl${ITCL_VERSION}
|
||||
LIBRARY DESTINATION ${LIB_DIR}/itcl${ITCL_VERSION}
|
||||
ARCHIVE DESTINATION ${LIB_DIR}/itcl${ITCL_VERSION})
|
||||
set_property(TARGET itclstub APPEND PROPERTY COMPILE_DEFINITIONS USE_TCL_STUBS)
|
||||
|
||||
# Create pkgIndex.tcl files
|
||||
file(GENERATE
|
||||
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/pkgIndex.tcl"
|
||||
CONTENT "
|
||||
if {![package vsatisfies [package provide Tcl] 8.5]} {return}
|
||||
package ifneeded Itcl ${ITCL_VERSION} [list load [file join $dir ../../${SHARED_DIR}/itcl${ITCL_VERSION} $<TARGET_FILE_NAME:itcl${ITCL_VERSION}>] Itcl]
|
||||
")
|
||||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/pkgIndex.tcl DESTINATION ${LIB_DIR}/itcl${ITCL_VERSION})
|
||||
|
||||
install(FILES library/itcl.tcl DESTINATION ${LIB_DIR}/itcl${ITCL_VERSION})
|
||||
|
||||
set(ITCL_HDRS
|
||||
generic/itcl.h
|
||||
generic/itclDecls.h
|
||||
generic/itclInt.h
|
||||
generic/itclIntDecls.h
|
||||
)
|
||||
install(FILES ${ITCL_HDRS} DESTINATION ${INCLUDE_DIR})
|
||||
|
||||
# Local Variables:
|
||||
# tab-width: 8
|
||||
# mode: cmake
|
||||
# indent-tabs-mode: t
|
||||
# End:
|
||||
# ex: shiftwidth=2 tabstop=8
|
||||
|
||||
@@ -0,0 +1,554 @@
|
||||
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
||||
# file Copyright.txt or https://cmake.org/licensing for details.
|
||||
|
||||
#[=======================================================================[.rst:
|
||||
FindTCL
|
||||
-------
|
||||
|
||||
This module finds if Tcl is installed and determines where the include
|
||||
files and libraries are. It also determines what the name of the
|
||||
library is. This code sets the following variables:
|
||||
|
||||
::
|
||||
|
||||
TCL_FOUND = Tcl was found
|
||||
TCLSH_FOUND = TRUE if tclsh has been found
|
||||
TCL_LIBRARY = path to Tcl library (tcl tcl80)
|
||||
TCL_INCLUDE_PATH = path to where tcl.h can be found
|
||||
TCL_TCLSH = path to tclsh binary (tcl tcl80)
|
||||
|
||||
|
||||
|
||||
If TCL_ENABLE_TK is set, the following are also set:
|
||||
|
||||
::
|
||||
|
||||
TK_FOUND = Tk was found
|
||||
TCLTK_FOUND = Tcl and Tk were found
|
||||
TK_LIBRARY = path to Tk library (tk tk80 etc)
|
||||
TK_INCLUDE_PATH = path to where tk.h can be found
|
||||
TK_WISH = full path to the wish executable
|
||||
TCL_STUB_LIBRARY = path to Tcl stub library
|
||||
TK_STUB_LIBRARY = path to Tk stub library
|
||||
TTK_STUB_LIBRARY = path to ttk stub library
|
||||
|
||||
#]=======================================================================]
|
||||
|
||||
|
||||
set(_TCL_SEARCHES)
|
||||
|
||||
# Search TCL_ROOT first if it is set.
|
||||
if(TCL_ROOT)
|
||||
set(_TCL_SEARCH_ROOT PATHS ${TCL_ROOT} NO_DEFAULT_PATH)
|
||||
list(APPEND _TCL_SEARCHES _TCL_SEARCH_ROOT)
|
||||
endif()
|
||||
|
||||
if(WIN32)
|
||||
get_filename_component(
|
||||
ActiveTcl_CurrentVersion
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\ActiveState\\ActiveTcl;CurrentVersion]"
|
||||
NAME
|
||||
)
|
||||
set(
|
||||
TCLTK_POSSIBLE_BIN_PATHS
|
||||
${TCLTK_POSSIBLE_BIN_PATHS}
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\ActiveState\\ActiveTcl\\${ActiveTcl_CurrentVersion}]/bin"
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.6;Root]/bin"
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.5;Root]/bin"
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.4;Root]/bin"
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.3;Root]/bin"
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.2;Root]/bin"
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.0;Root]/bin"
|
||||
)
|
||||
|
||||
get_filename_component(
|
||||
ActiveTcl_CurrentVersion
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\ActiveState\\ActiveTcl;CurrentVersion]"
|
||||
NAME
|
||||
)
|
||||
set(
|
||||
TCLTK_POSSIBLE_LIB_PATHS
|
||||
${TCLTK_POSSIBLE_LIB_PATHS}
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\ActiveState\\ActiveTcl\\${ActiveTcl_CurrentVersion}]/lib"
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.6;Root]/lib"
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.5;Root]/lib"
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.4;Root]/lib"
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.3;Root]/lib"
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.2;Root]/lib"
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.0;Root]/lib"
|
||||
"$ENV{ProgramFiles}/Tcl/Lib"
|
||||
"C:/Program Files/Tcl/lib"
|
||||
"C:/Tcl/lib"
|
||||
)
|
||||
|
||||
set(
|
||||
TCLTK_POSSIBLE_INCLUDE_PATHS
|
||||
${TCLTK_POSSIBLE_INCLUDE_PATHS}
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\ActiveState\\ActiveTcl\\${ActiveTcl_CurrentVersion}]/include"
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.6;Root]/include"
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.5;Root]/include"
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.4;Root]/include"
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.3;Root]/include"
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.2;Root]/include"
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.0;Root]/include"
|
||||
"$ENV{ProgramFiles}/Tcl/include"
|
||||
"C:/Program Files/Tcl/include"
|
||||
"C:/Tcl/include"
|
||||
)
|
||||
endif()
|
||||
|
||||
set(
|
||||
TCL_TCLSH_NAMES
|
||||
tclsh
|
||||
tclsh${TCL_LIBRARY_VERSION}
|
||||
tclsh${TK_LIBRARY_VERSION}
|
||||
tclsh${TK_WISH_VERSION}
|
||||
tclsh87
|
||||
tclsh8.7
|
||||
tclsh86
|
||||
tclsh8.6
|
||||
tclsh85
|
||||
tclsh8.5
|
||||
tclsh84
|
||||
tclsh8.4
|
||||
tclsh83
|
||||
tclsh8.3
|
||||
tclsh82
|
||||
tclsh8.2
|
||||
tclsh80
|
||||
tclsh8.0
|
||||
)
|
||||
if(CYGWIN)
|
||||
set(TCL_TCLSH_NAMES ${TCL_TCLSH_NAMES} cygtclsh83 cygtclsh80)
|
||||
endif(CYGWIN)
|
||||
|
||||
foreach(search ${_TCL_SEARCHES})
|
||||
find_program(TCL_TCLSH NAMES ${TCL_TCLSH_NAMES} ${${search}} PATH_SUFFIXES bin)
|
||||
endforeach()
|
||||
if(NOT TCL_TCLSH)
|
||||
find_program(TCL_TCLSH NAMES ${TCL_TCLSH_NAMES} HINTS ${TCLTK_POSSIBLE_BIN_PATHS})
|
||||
endif(NOT TCL_TCLSH)
|
||||
|
||||
if(TCL_ENABLE_TK)
|
||||
set(
|
||||
TK_WISH_NAMES
|
||||
wish
|
||||
wish${TCL_LIBRARY_VERSION}
|
||||
wish${TK_LIBRARY_VERSION}
|
||||
wish${TCL_TCLSH_VERSION}
|
||||
wish86
|
||||
wish8.6
|
||||
wish85
|
||||
wish8.5
|
||||
wish84
|
||||
wish8.4
|
||||
wish83
|
||||
wish8.3
|
||||
wish82
|
||||
wish8.2
|
||||
wish80
|
||||
wish8.0
|
||||
)
|
||||
|
||||
if(CYGWIN)
|
||||
set(TK_WISH_NAMES ${TK_WISH_NAMES} cygwish80)
|
||||
endif()
|
||||
|
||||
foreach(search ${_TCL_SEARCHES})
|
||||
find_program(TK_WISH NAMES ${TK_WISH_NAMES} ${${search}} PATH_SUFFIXES bin)
|
||||
endforeach()
|
||||
if(NOT TK_WISH)
|
||||
find_program(TK_WISH NAMES ${TK_WISH_NAMES} HINTS ${TCLTK_POSSIBLE_BIN_PATHS})
|
||||
endif(NOT TK_WISH)
|
||||
endif(TCL_ENABLE_TK)
|
||||
|
||||
if(TCLSH_VERSION_STRING)
|
||||
set(TCL_TCLSH_VERSION "${TCLSH_VERSION_STRING}")
|
||||
else()
|
||||
get_filename_component(TCL_TCLSH_PATH "${TCL_TCLSH}" PATH)
|
||||
get_filename_component(TCL_TCLSH_PATH_PARENT "${TCL_TCLSH_PATH}" PATH)
|
||||
string(REGEX REPLACE "^.*tclsh([0-9]\\.*[0-9]).*$" "\\1" TCL_TCLSH_VERSION "${TCL_TCLSH}")
|
||||
endif()
|
||||
|
||||
set(TCLTK_POSSIBLE_LIB_PATHS "${TCL_INCLUDE_PATH_PARENT}/lib" "${TCL_LIBRARY_PATH}" "${TCL_TCLSH_PATH_PARENT}/lib")
|
||||
if(TCL_ENABLE_TK)
|
||||
set(
|
||||
TCLTK_POSSIBLE_LIB_PATHS
|
||||
${TCLTK_POSSIBLE_LIB_PATHS}
|
||||
"${TK_INCLUDE_PATH_PARENT}/lib"
|
||||
"${TK_LIBRARY_PATH}"
|
||||
"${TK_WISH_PATH_PARENT}/lib"
|
||||
)
|
||||
endif(TCL_ENABLE_TK)
|
||||
|
||||
set(
|
||||
TCLTK_POSSIBLE_LIB_PATH_SUFFIXES
|
||||
lib
|
||||
lib/tcl
|
||||
lib/tcl/tcl8.7
|
||||
lib/tcl/tcl8.6
|
||||
lib/tcl/tcl8.5
|
||||
lib/tcl/tcl8.4
|
||||
)
|
||||
if(TCL_ENABLE_TK)
|
||||
set(
|
||||
TCLTK_POSSIBLE_LIB_PATH_SUFFIXES
|
||||
${TCLTK_POSSIBLE_LIB_PATH_SUFFIXES}
|
||||
lib/tcl/tk8.7
|
||||
lib/tcl/tk8.6
|
||||
lib/tcl/tk8.5
|
||||
lib/tcl/tk8.4
|
||||
)
|
||||
endif(TCL_ENABLE_TK)
|
||||
|
||||
set(
|
||||
TCL_POSSIBLE_LIB_NAMES
|
||||
tcl
|
||||
tcl${TCL_LIBRARY_VERSION}
|
||||
tcl${TCL_TCLSH_VERSION}
|
||||
tcl${TK_WISH_VERSION}
|
||||
tcl87
|
||||
tcl8.7
|
||||
tcl87t
|
||||
tcl8.7t
|
||||
tcl86
|
||||
tcl8.6
|
||||
tcl86t
|
||||
tcl8.6t
|
||||
tcl85
|
||||
tcl8.5
|
||||
tcl84
|
||||
tcl8.4
|
||||
tcl83
|
||||
tcl8.3
|
||||
tcl82
|
||||
tcl8.2
|
||||
tcl80
|
||||
tcl8.0
|
||||
)
|
||||
|
||||
if(NOT TCL_LIBRARY)
|
||||
foreach(search ${_TCL_SEARCHES})
|
||||
find_library(
|
||||
TCL_LIBRARY
|
||||
NAMES ${TCL_POSSIBLE_LIB_NAMES}
|
||||
NAMES_PER_DIR
|
||||
${${search}}
|
||||
PATH_SUFFIXES ${TCLTK_POSSIBLE_LIB_PATH_SUFFIXES}
|
||||
)
|
||||
endforeach()
|
||||
endif()
|
||||
if(NOT TCL_LIBRARY)
|
||||
find_library(
|
||||
TCL_LIBRARY
|
||||
NAMES ${TCL_POSSIBLE_LIB_NAMES}
|
||||
PATHS ${TCLTK_POSSIBLE_LIB_PATHS}
|
||||
PATH_SUFFIXES ${TCLTK_POSSIBLE_LIB_PATH_SUFFIXES}
|
||||
)
|
||||
endif(NOT TCL_LIBRARY)
|
||||
|
||||
set(
|
||||
TCLSTUB_POSSIBLE_LIB_NAMES
|
||||
tclstub
|
||||
tclstub${TK_LIBRARY_VERSION}
|
||||
tclstub${TCL_TCLSH_VERSION}
|
||||
tclstub${TK_WISH_VERSION}
|
||||
tclstub87
|
||||
tclstub8.7
|
||||
tclstub86
|
||||
tclstub8.6
|
||||
tclstub85
|
||||
tclstub8.5
|
||||
tclstub84
|
||||
tclstub8.4
|
||||
tclstub83
|
||||
tclstub8.3
|
||||
tclstub82
|
||||
tclstub8.2
|
||||
tclstub80
|
||||
tclstub8.0
|
||||
)
|
||||
if(NOT TCL_STUB_LIBRARY)
|
||||
foreach(search ${_TCL_SEARCHES})
|
||||
find_library(
|
||||
TCL_STUB_LIBRARY
|
||||
NAMES ${TCLSTUB_POSSIBLE_LIB_NAMES}
|
||||
NAMES_PER_DIR
|
||||
${${search}}
|
||||
PATH_SUFFIXES ${TCLTK_POSSIBLE_LIB_PATH_SUFFIXES}
|
||||
)
|
||||
endforeach()
|
||||
endif()
|
||||
if(NOT TCL_STUB_LIBRARY)
|
||||
find_library(TCL_STUB_LIBRARY NAMES ${TCLSTUB_POSSIBLE_LIB_NAMES} PATHS ${TCLTK_POSSIBLE_LIB_PATHS})
|
||||
endif()
|
||||
|
||||
if(TCL_ENABLE_TK)
|
||||
set(
|
||||
TK_POSSIBLE_LIB_NAMES
|
||||
tk
|
||||
tk${TK_LIBRARY_VERSION}
|
||||
tk${TCL_TCLSH_VERSION}
|
||||
tk${TK_WISH_VERSION}
|
||||
tk87
|
||||
tk8.7
|
||||
tk87t
|
||||
tk8.7t
|
||||
tk86
|
||||
tk8.6
|
||||
tk86t
|
||||
tk8.6t
|
||||
tk85
|
||||
tk8.5
|
||||
tk84
|
||||
tk8.4
|
||||
tk83
|
||||
tk8.3
|
||||
tk82
|
||||
tk8.2
|
||||
tk80
|
||||
tk8.0
|
||||
)
|
||||
|
||||
if(NOT TK_LIBRARY)
|
||||
foreach(search ${_TCL_SEARCHES})
|
||||
find_library(
|
||||
TK_LIBRARY
|
||||
NAMES ${TK_POSSIBLE_LIB_NAMES}
|
||||
NAMES_PER_DIR
|
||||
${${search}}
|
||||
PATH_SUFFIXES ${TCLTK_POSSIBLE_LIB_PATH_SUFFIXES}
|
||||
)
|
||||
endforeach()
|
||||
endif()
|
||||
if(NOT TK_LIBRARY)
|
||||
find_library(
|
||||
TK_LIBRARY
|
||||
NAMES ${TK_POSSIBLE_LIB_NAMES}
|
||||
PATHS ${TCLTK_POSSIBLE_LIB_PATHS}
|
||||
PATH_SUFFIXES ${TCLTK_POSSIBLE_LIB_PATH_SUFFIXES}
|
||||
)
|
||||
endif(NOT TK_LIBRARY)
|
||||
|
||||
set(
|
||||
TK_STUB_POSSIBLE_LIB_NAMES
|
||||
tkstub
|
||||
tkstub${TCL_LIBRARY_VERSION}
|
||||
tkstub${TCL_TCLSH_VERSION}
|
||||
tkstub${TK_WISH_VERSION}
|
||||
tkstub87
|
||||
tkstub8.7
|
||||
tkstub86
|
||||
tkstub8.6
|
||||
tkstub85
|
||||
tkstub8.5
|
||||
tkstub84
|
||||
tkstub8.4
|
||||
tkstub83
|
||||
tkstub8.3
|
||||
tkstub82
|
||||
tkstub8.2
|
||||
tkstub80
|
||||
tkstub8.0
|
||||
)
|
||||
|
||||
if(NOT TK_STUB_LIBRARY)
|
||||
foreach(search ${_TCL_SEARCHES})
|
||||
find_library(
|
||||
TK_STUB_LIBRARY
|
||||
NAMES ${TK_STUB_POSSIBLE_LIB_NAMES}
|
||||
NAMES_PER_DIR
|
||||
${${search}}
|
||||
PATH_SUFFIXES ${TCLTK_POSSIBLE_LIB_PATH_SUFFIXES}
|
||||
)
|
||||
endforeach()
|
||||
endif()
|
||||
if(NOT TK_STUB_LIBRARY)
|
||||
find_library(TK_STUB_LIBRARY NAMES ${TK_STUB_POSSIBLE_LIB_NAMES} PATHS ${TCLTK_POSSIBLE_LIB_PATHS})
|
||||
endif()
|
||||
|
||||
set(
|
||||
TTK_STUB_POSSIBLE_LIB_NAMES
|
||||
ttkstub
|
||||
ttkstub${TCL_LIBRARY_VERSION}
|
||||
ttkstub${TCL_TCLSH_VERSION}
|
||||
ttkstub${TK_WISH_VERSION}
|
||||
ttkstub88
|
||||
ttkstub8.8
|
||||
ttkstub87
|
||||
ttkstub8.7
|
||||
ttkstub86
|
||||
ttkstub8.6
|
||||
ttkstub85
|
||||
ttkstub8.5
|
||||
)
|
||||
|
||||
if(NOT TTK_STUB_LIBRARY)
|
||||
foreach(search ${_TCL_SEARCHES})
|
||||
find_library(
|
||||
TTK_STUB_LIBRARY
|
||||
NAMES ${TTK_STUB_POSSIBLE_LIB_NAMES}
|
||||
NAMES_PER_DIR
|
||||
${${search}}
|
||||
PATH_SUFFIXES ${TCLTK_POSSIBLE_LIB_PATH_SUFFIXES}
|
||||
)
|
||||
endforeach()
|
||||
endif()
|
||||
if(NOT TTK_STUB_LIBRARY)
|
||||
find_library(TTK_STUB_LIBRARY NAMES ${TTK_STUB_POSSIBLE_LIB_NAMES} PATHS ${TCLTK_POSSIBLE_LIB_PATHS})
|
||||
endif()
|
||||
endif(TCL_ENABLE_TK)
|
||||
|
||||
set(
|
||||
TCLTK_POSSIBLE_INCLUDE_PATHS
|
||||
"${TCL_LIBRARY_PATH_PARENT}/include"
|
||||
"${TCL_INCLUDE_PATH}"
|
||||
"${TCL_TCLSH_PATH_PARENT}/include"
|
||||
)
|
||||
if(TCL_ENABLE_TK)
|
||||
set(
|
||||
TCLTK_POSSIBLE_INCLUDE_PATHS
|
||||
${TCLTK_POSSIBLE_INCLUDE_PATHS}
|
||||
"${TCL_LIBRARY_PATH_PARENT}/include"
|
||||
"${TCL_INCLUDE_PATH}"
|
||||
"${TCL_TCLSH_PATH_PARENT}/include"
|
||||
)
|
||||
endif(TCL_ENABLE_TK)
|
||||
|
||||
set(
|
||||
TCLTK_POSSIBLE_INCLUDE_PATH_SUFFIXES
|
||||
include
|
||||
include/tcl${TCL_LIBRARY_VERSION}
|
||||
include/tcl8.7
|
||||
include/tcl8.6
|
||||
include/tcl8.5
|
||||
include/tcl8.4
|
||||
include/tcl8.3
|
||||
include/tcl8.2
|
||||
include/tcl8.0
|
||||
)
|
||||
|
||||
if(TCL_ENABLE_TK)
|
||||
set(
|
||||
TCLTK_POSSIBLE_INCLUDE_PATH_SUFFIXES
|
||||
${TCLTK_POSSIBLE_INCLUDE_PATH_SUFFIXES}
|
||||
include/tcl${TK_LIBRARY_VERSION}
|
||||
include/tk8.7
|
||||
include/tk8.6
|
||||
include/tk8.5
|
||||
include/tk8.4
|
||||
)
|
||||
endif(TCL_ENABLE_TK)
|
||||
|
||||
foreach(search ${_TCL_SEARCHES})
|
||||
find_path(TCL_INCLUDE_PATH NAMES tcl.h ${${search}} PATH_SUFFIXES ${TCLTK_POSSIBLE_INCLUDE_PATH_SUFFIXES})
|
||||
endforeach()
|
||||
if(NOT TCL_INCLUDE_PATH)
|
||||
find_path(
|
||||
TCL_INCLUDE_PATH
|
||||
NAMES tcl.h
|
||||
HINTS ${TCLTK_POSSIBLE_INCLUDE_PATHS}
|
||||
PATH_SUFFIXES ${TCLTK_POSSIBLE_INCLUDE_PATH_SUFFIXES}
|
||||
)
|
||||
endif()
|
||||
|
||||
if(TCL_ENABLE_TK)
|
||||
foreach(search ${_TCL_SEARCHES})
|
||||
find_path(TK_INCLUDE_PATH NAMES tk.h ${${search}} PATH_SUFFIXES ${TCLTK_POSSIBLE_INCLUDE_PATH_SUFFIXES})
|
||||
endforeach()
|
||||
if(NOT TK_INCLUDE_PATH)
|
||||
find_path(
|
||||
TK_INCLUDE_PATH
|
||||
NAMES tk.h
|
||||
HINTS ${TCLTK_POSSIBLE_INCLUDE_PATHS}
|
||||
PATH_SUFFIXES ${TCLTK_POSSIBLE_INCLUDE_PATH_SUFFIXES}
|
||||
)
|
||||
endif()
|
||||
|
||||
# IFF we have TCL_TK_SYSTEM_GRAPHICS set and have a system TK_WISH, check that the
|
||||
# windowing system matches the specified type
|
||||
if(NOT "${TCL_TK_SYSTEM_GRAPHICS}" STREQUAL "" AND TK_WISH AND NOT TARGET "${TK_WISH}")
|
||||
set(
|
||||
tkwin_script
|
||||
"
|
||||
set filename \"${CMAKE_BINARY_DIR}/CMakeTmp/TK_WINDOWINGSYSTEM\"
|
||||
set fileId [open $filename \"w\"]
|
||||
set windowingsystem [tk windowingsystem]
|
||||
puts $fileId $windowingsystem
|
||||
close $fileId
|
||||
exit
|
||||
"
|
||||
)
|
||||
set(tkwin_scriptfile "${CMAKE_BINARY_DIR}/CMakeTmp/tk_windowingsystem.tcl")
|
||||
set(WSYS "wm-NOTFOUND")
|
||||
file(WRITE ${tkwin_scriptfile} ${tkwin_script})
|
||||
execute_process(COMMAND ${TK_WISH} ${tkwin_scriptfile} OUTPUT_VARIABLE EXECOUTPUT)
|
||||
if(EXISTS "${CMAKE_BINARY_DIR}/CMakeTmp/TK_WINDOWINGSYSTEM")
|
||||
file(READ "${CMAKE_BINARY_DIR}/CMakeTmp/TK_WINDOWINGSYSTEM" readresultvar)
|
||||
string(REGEX REPLACE "\n" "" WSYS "${readresultvar}")
|
||||
endif(EXISTS "${CMAKE_BINARY_DIR}/CMakeTmp/TK_WINDOWINGSYSTEM")
|
||||
|
||||
# If we have no information about the windowing system or it does not match
|
||||
# a specified system, the find_package detection has failed
|
||||
if(NOT "${WSYS}" STREQUAL "${TCL_TK_SYSTEM_GRAPHICS}")
|
||||
unset(TCL_LIBRARY CACHE)
|
||||
unset(TCL_STUB_LIBRARY CACHE)
|
||||
unset(TK_LIBRARY CACHE)
|
||||
unset(TK_STUB_LIBRARY CACHE)
|
||||
unset(TCL_FOUND CACHE)
|
||||
unset(TK_FOUND CACHE)
|
||||
unset(TCLTK_FOUND CACHE)
|
||||
unset(TCLSH_FOUND CACHE)
|
||||
unset(TCL_LIBRARY CACHE)
|
||||
unset(TCL_INCLUDE_PATH CACHE)
|
||||
unset(TCL_TCLSH CACHE)
|
||||
unset(TK_LIBRARY CACHE)
|
||||
unset(TK_INCLUDE_PATH CACHE)
|
||||
unset(TK_WISH CACHE)
|
||||
unset(TCL_STUB_LIBRARY CACHE)
|
||||
unset(TK_STUB_LIBRARY CACHE)
|
||||
unset(TTK_STUB_LIBRARY CACHE)
|
||||
endif(NOT "${WSYS}" STREQUAL "${TCL_TK_SYSTEM_GRAPHICS}")
|
||||
endif(NOT "${TCL_TK_SYSTEM_GRAPHICS}" STREQUAL "" AND TK_WISH AND NOT TARGET "${TK_WISH}")
|
||||
endif(TCL_ENABLE_TK)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
find_package_handle_standard_args(
|
||||
TCL
|
||||
REQUIRED_VARS TCL_LIBRARY TCL_STUB_LIBRARY TCL_INCLUDE_PATH TCL_TCLSH
|
||||
VERSION_VAR TCLSH_VERSION_STRING
|
||||
)
|
||||
|
||||
if(TCL_ENABLE_TK)
|
||||
set(FPHSA_NAME_MISMATCHED 1)
|
||||
set(TCLTK_FIND_REQUIRED ${TCL_FIND_REQUIRED})
|
||||
set(TCLTK_FIND_QUIETLY ${TCL_FIND_QUIETLY})
|
||||
find_package_handle_standard_args(
|
||||
TCLTK
|
||||
REQUIRED_VARS TCL_LIBRARY TCL_STUB_LIBRARY TCL_INCLUDE_PATH TK_LIBRARY TK_STUB_LIBRARY TK_INCLUDE_PATH
|
||||
)
|
||||
set(TK_FIND_REQUIRED ${TCL_FIND_REQUIRED})
|
||||
set(TK_FIND_QUIETLY ${TCL_FIND_QUIETLY})
|
||||
find_package_handle_standard_args(TK REQUIRED_VARS TK_LIBRARY TK_STUB_LIBRARY TK_INCLUDE_PATH TK_WISH)
|
||||
unset(FPHSA_NAME_MISMATCHED)
|
||||
endif(TCL_ENABLE_TK)
|
||||
|
||||
mark_as_advanced(
|
||||
TCL_INCLUDE_PATH
|
||||
TCL_LIBRARY
|
||||
TCL_STUB_LIBRARY
|
||||
TCL_TCLSH
|
||||
TK_INCLUDE_PATH
|
||||
TK_LIBRARY
|
||||
TK_STUB_LIBRARY
|
||||
TK_WISH
|
||||
TTK_STUB_LIBRARY
|
||||
)
|
||||
|
||||
# Local Variables:
|
||||
# tab-width: 8
|
||||
# mode: cmake
|
||||
# indent-tabs-mode: t
|
||||
# End:
|
||||
# ex: shiftwidth=2 tabstop=8
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,600 @@
|
||||
/*
|
||||
* tclIntPlatDecls.h --
|
||||
*
|
||||
* This file contains the declarations for all platform dependent
|
||||
* unsupported functions that are exported by the Tcl library. These
|
||||
* interfaces are not guaranteed to remain the same between
|
||||
* versions. Use at your own risk.
|
||||
*
|
||||
* Copyright (c) 1998-1999 by Scriptics Corporation.
|
||||
* All rights reserved.
|
||||
*/
|
||||
|
||||
#ifndef _TCLINTPLATDECLS
|
||||
#define _TCLINTPLATDECLS
|
||||
|
||||
#undef TCL_STORAGE_CLASS
|
||||
#ifdef BUILD_tcl
|
||||
# define TCL_STORAGE_CLASS DLLEXPORT
|
||||
#else
|
||||
# ifdef USE_TCL_STUBS
|
||||
# define TCL_STORAGE_CLASS
|
||||
# else
|
||||
# define TCL_STORAGE_CLASS DLLIMPORT
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* WARNING: This file is automatically generated by the tools/genStubs.tcl
|
||||
* script. Any modifications to the function declarations below should be made
|
||||
* in the generic/tclInt.decls script.
|
||||
*/
|
||||
|
||||
/* !BEGIN!: Do not edit below this line. */
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Exported function declarations:
|
||||
*/
|
||||
|
||||
#if !defined(_WIN32) && !defined(__CYGWIN__) && !defined(MAC_OSX_TCL) /* UNIX */
|
||||
/* 0 */
|
||||
EXTERN void TclGetAndDetachPids(Tcl_Interp *interp,
|
||||
Tcl_Channel chan);
|
||||
/* 1 */
|
||||
EXTERN int TclpCloseFile(TclFile file);
|
||||
/* 2 */
|
||||
EXTERN Tcl_Channel TclpCreateCommandChannel(TclFile readFile,
|
||||
TclFile writeFile, TclFile errorFile,
|
||||
int numPids, Tcl_Pid *pidPtr);
|
||||
/* 3 */
|
||||
EXTERN int TclpCreatePipe(TclFile *readPipe, TclFile *writePipe);
|
||||
/* 4 */
|
||||
EXTERN int TclpCreateProcess(Tcl_Interp *interp, int argc,
|
||||
const char **argv, TclFile inputFile,
|
||||
TclFile outputFile, TclFile errorFile,
|
||||
Tcl_Pid *pidPtr);
|
||||
/* 5 */
|
||||
EXTERN int TclUnixWaitForFile_(int fd, int mask, int timeout);
|
||||
/* 6 */
|
||||
EXTERN TclFile TclpMakeFile(Tcl_Channel channel, int direction);
|
||||
/* 7 */
|
||||
EXTERN TclFile TclpOpenFile(const char *fname, int mode);
|
||||
/* 8 */
|
||||
EXTERN int TclUnixWaitForFile(int fd, int mask, int timeout);
|
||||
/* 9 */
|
||||
EXTERN TclFile TclpCreateTempFile(const char *contents);
|
||||
/* 10 */
|
||||
EXTERN Tcl_DirEntry * TclpReaddir(TclDIR *dir);
|
||||
/* 11 */
|
||||
EXTERN struct tm * TclpLocaltime_unix(const time_t *clock);
|
||||
/* 12 */
|
||||
EXTERN struct tm * TclpGmtime_unix(const time_t *clock);
|
||||
/* 13 */
|
||||
EXTERN char * TclpInetNtoa(struct in_addr addr);
|
||||
/* 14 */
|
||||
EXTERN int TclUnixCopyFile(const char *src, const char *dst,
|
||||
const Tcl_StatBuf *statBufPtr,
|
||||
int dontCopyAtts);
|
||||
/* 15 */
|
||||
EXTERN int TclMacOSXGetFileAttribute(Tcl_Interp *interp,
|
||||
int objIndex, Tcl_Obj *fileName,
|
||||
Tcl_Obj **attributePtrPtr);
|
||||
/* 16 */
|
||||
EXTERN int TclMacOSXSetFileAttribute(Tcl_Interp *interp,
|
||||
int objIndex, Tcl_Obj *fileName,
|
||||
Tcl_Obj *attributePtr);
|
||||
/* 17 */
|
||||
EXTERN int TclMacOSXCopyFileAttributes(const char *src,
|
||||
const char *dst,
|
||||
const Tcl_StatBuf *statBufPtr);
|
||||
/* 18 */
|
||||
EXTERN int TclMacOSXMatchType(Tcl_Interp *interp,
|
||||
const char *pathName, const char *fileName,
|
||||
Tcl_StatBuf *statBufPtr,
|
||||
Tcl_GlobTypeData *types);
|
||||
/* 19 */
|
||||
EXTERN void TclMacOSXNotifierAddRunLoopMode(
|
||||
const void *runLoopMode);
|
||||
/* Slot 20 is reserved */
|
||||
/* Slot 21 is reserved */
|
||||
/* 22 */
|
||||
EXTERN TclFile TclpCreateTempFile_(const char *contents);
|
||||
/* Slot 23 is reserved */
|
||||
/* Slot 24 is reserved */
|
||||
/* Slot 25 is reserved */
|
||||
/* Slot 26 is reserved */
|
||||
/* Slot 27 is reserved */
|
||||
/* Slot 28 is reserved */
|
||||
/* 29 */
|
||||
EXTERN int TclWinCPUID(unsigned int index, unsigned int *regs);
|
||||
/* 30 */
|
||||
EXTERN int TclUnixOpenTemporaryFile(Tcl_Obj *dirObj,
|
||||
Tcl_Obj *basenameObj, Tcl_Obj *extensionObj,
|
||||
Tcl_Obj *resultingNameObj);
|
||||
#endif /* UNIX */
|
||||
#if defined(_WIN32) || defined(__CYGWIN__) /* WIN */
|
||||
/* 0 */
|
||||
EXTERN void TclWinConvertError(DWORD errCode);
|
||||
/* 1 */
|
||||
EXTERN void TclWinConvertWSAError(DWORD errCode);
|
||||
/* 2 */
|
||||
EXTERN struct servent * TclWinGetServByName(const char *nm,
|
||||
const char *proto);
|
||||
/* 3 */
|
||||
EXTERN int TclWinGetSockOpt(SOCKET s, int level, int optname,
|
||||
char *optval, int *optlen);
|
||||
/* 4 */
|
||||
EXTERN HINSTANCE TclWinGetTclInstance(void);
|
||||
/* 5 */
|
||||
EXTERN int TclUnixWaitForFile(int fd, int mask, int timeout);
|
||||
/* 6 */
|
||||
EXTERN unsigned short TclWinNToHS(unsigned short ns);
|
||||
/* 7 */
|
||||
EXTERN int TclWinSetSockOpt(SOCKET s, int level, int optname,
|
||||
const char *optval, int optlen);
|
||||
/* 8 */
|
||||
EXTERN int TclpGetPid(Tcl_Pid pid);
|
||||
/* 9 */
|
||||
EXTERN int TclWinGetPlatformId(void);
|
||||
/* 10 */
|
||||
EXTERN Tcl_DirEntry * TclpReaddir(TclDIR *dir);
|
||||
/* 11 */
|
||||
EXTERN void TclGetAndDetachPids(Tcl_Interp *interp,
|
||||
Tcl_Channel chan);
|
||||
/* 12 */
|
||||
EXTERN int TclpCloseFile(TclFile file);
|
||||
/* 13 */
|
||||
EXTERN Tcl_Channel TclpCreateCommandChannel(TclFile readFile,
|
||||
TclFile writeFile, TclFile errorFile,
|
||||
int numPids, Tcl_Pid *pidPtr);
|
||||
/* 14 */
|
||||
EXTERN int TclpCreatePipe(TclFile *readPipe, TclFile *writePipe);
|
||||
/* 15 */
|
||||
EXTERN int TclpCreateProcess(Tcl_Interp *interp, int argc,
|
||||
const char **argv, TclFile inputFile,
|
||||
TclFile outputFile, TclFile errorFile,
|
||||
Tcl_Pid *pidPtr);
|
||||
/* 16 */
|
||||
EXTERN int TclpIsAtty(int fd);
|
||||
/* 17 */
|
||||
EXTERN int TclUnixCopyFile(const char *src, const char *dst,
|
||||
const Tcl_StatBuf *statBufPtr,
|
||||
int dontCopyAtts);
|
||||
/* 18 */
|
||||
EXTERN TclFile TclpMakeFile(Tcl_Channel channel, int direction);
|
||||
/* 19 */
|
||||
EXTERN TclFile TclpOpenFile(const char *fname, int mode);
|
||||
/* 20 */
|
||||
EXTERN void TclWinAddProcess(HANDLE hProcess, DWORD id);
|
||||
/* 21 */
|
||||
EXTERN char * TclpInetNtoa(struct in_addr addr);
|
||||
/* 22 */
|
||||
EXTERN TclFile TclpCreateTempFile(const char *contents);
|
||||
/* Slot 23 is reserved */
|
||||
/* 24 */
|
||||
EXTERN char * TclWinNoBackslash(char *path);
|
||||
/* Slot 25 is reserved */
|
||||
/* 26 */
|
||||
EXTERN void TclWinSetInterfaces(int wide);
|
||||
/* 27 */
|
||||
EXTERN void TclWinFlushDirtyChannels(void);
|
||||
/* 28 */
|
||||
EXTERN void TclWinResetInterfaces(void);
|
||||
/* 29 */
|
||||
EXTERN int TclWinCPUID(unsigned int index, unsigned int *regs);
|
||||
/* 30 */
|
||||
EXTERN int TclUnixOpenTemporaryFile(Tcl_Obj *dirObj,
|
||||
Tcl_Obj *basenameObj, Tcl_Obj *extensionObj,
|
||||
Tcl_Obj *resultingNameObj);
|
||||
#endif /* WIN */
|
||||
#ifdef MAC_OSX_TCL /* MACOSX */
|
||||
/* 0 */
|
||||
EXTERN void TclGetAndDetachPids(Tcl_Interp *interp,
|
||||
Tcl_Channel chan);
|
||||
/* 1 */
|
||||
EXTERN int TclpCloseFile(TclFile file);
|
||||
/* 2 */
|
||||
EXTERN Tcl_Channel TclpCreateCommandChannel(TclFile readFile,
|
||||
TclFile writeFile, TclFile errorFile,
|
||||
int numPids, Tcl_Pid *pidPtr);
|
||||
/* 3 */
|
||||
EXTERN int TclpCreatePipe(TclFile *readPipe, TclFile *writePipe);
|
||||
/* 4 */
|
||||
EXTERN int TclpCreateProcess(Tcl_Interp *interp, int argc,
|
||||
const char **argv, TclFile inputFile,
|
||||
TclFile outputFile, TclFile errorFile,
|
||||
Tcl_Pid *pidPtr);
|
||||
/* 5 */
|
||||
EXTERN int TclUnixWaitForFile_(int fd, int mask, int timeout);
|
||||
/* 6 */
|
||||
EXTERN TclFile TclpMakeFile(Tcl_Channel channel, int direction);
|
||||
/* 7 */
|
||||
EXTERN TclFile TclpOpenFile(const char *fname, int mode);
|
||||
/* 8 */
|
||||
EXTERN int TclUnixWaitForFile(int fd, int mask, int timeout);
|
||||
/* 9 */
|
||||
EXTERN TclFile TclpCreateTempFile(const char *contents);
|
||||
/* 10 */
|
||||
EXTERN Tcl_DirEntry * TclpReaddir(TclDIR *dir);
|
||||
/* 11 */
|
||||
EXTERN struct tm * TclpLocaltime_unix(const time_t *clock);
|
||||
/* 12 */
|
||||
EXTERN struct tm * TclpGmtime_unix(const time_t *clock);
|
||||
/* 13 */
|
||||
EXTERN char * TclpInetNtoa(struct in_addr addr);
|
||||
/* 14 */
|
||||
EXTERN int TclUnixCopyFile(const char *src, const char *dst,
|
||||
const Tcl_StatBuf *statBufPtr,
|
||||
int dontCopyAtts);
|
||||
/* 15 */
|
||||
EXTERN int TclMacOSXGetFileAttribute(Tcl_Interp *interp,
|
||||
int objIndex, Tcl_Obj *fileName,
|
||||
Tcl_Obj **attributePtrPtr);
|
||||
/* 16 */
|
||||
EXTERN int TclMacOSXSetFileAttribute(Tcl_Interp *interp,
|
||||
int objIndex, Tcl_Obj *fileName,
|
||||
Tcl_Obj *attributePtr);
|
||||
/* 17 */
|
||||
EXTERN int TclMacOSXCopyFileAttributes(const char *src,
|
||||
const char *dst,
|
||||
const Tcl_StatBuf *statBufPtr);
|
||||
/* 18 */
|
||||
EXTERN int TclMacOSXMatchType(Tcl_Interp *interp,
|
||||
const char *pathName, const char *fileName,
|
||||
Tcl_StatBuf *statBufPtr,
|
||||
Tcl_GlobTypeData *types);
|
||||
/* 19 */
|
||||
EXTERN void TclMacOSXNotifierAddRunLoopMode(
|
||||
const void *runLoopMode);
|
||||
/* Slot 20 is reserved */
|
||||
/* Slot 21 is reserved */
|
||||
/* 22 */
|
||||
EXTERN TclFile TclpCreateTempFile_(const char *contents);
|
||||
/* Slot 23 is reserved */
|
||||
/* Slot 24 is reserved */
|
||||
/* Slot 25 is reserved */
|
||||
/* Slot 26 is reserved */
|
||||
/* Slot 27 is reserved */
|
||||
/* Slot 28 is reserved */
|
||||
/* 29 */
|
||||
EXTERN int TclWinCPUID(unsigned int index, unsigned int *regs);
|
||||
/* 30 */
|
||||
EXTERN int TclUnixOpenTemporaryFile(Tcl_Obj *dirObj,
|
||||
Tcl_Obj *basenameObj, Tcl_Obj *extensionObj,
|
||||
Tcl_Obj *resultingNameObj);
|
||||
#endif /* MACOSX */
|
||||
|
||||
typedef struct TclIntPlatStubs {
|
||||
int magic;
|
||||
void *hooks;
|
||||
|
||||
#if !defined(_WIN32) && !defined(__CYGWIN__) && !defined(MAC_OSX_TCL) /* UNIX */
|
||||
void (*tclGetAndDetachPids) (Tcl_Interp *interp, Tcl_Channel chan); /* 0 */
|
||||
int (*tclpCloseFile) (TclFile file); /* 1 */
|
||||
Tcl_Channel (*tclpCreateCommandChannel) (TclFile readFile, TclFile writeFile, TclFile errorFile, int numPids, Tcl_Pid *pidPtr); /* 2 */
|
||||
int (*tclpCreatePipe) (TclFile *readPipe, TclFile *writePipe); /* 3 */
|
||||
int (*tclpCreateProcess) (Tcl_Interp *interp, int argc, const char **argv, TclFile inputFile, TclFile outputFile, TclFile errorFile, Tcl_Pid *pidPtr); /* 4 */
|
||||
int (*tclUnixWaitForFile_) (int fd, int mask, int timeout); /* 5 */
|
||||
TclFile (*tclpMakeFile) (Tcl_Channel channel, int direction); /* 6 */
|
||||
TclFile (*tclpOpenFile) (const char *fname, int mode); /* 7 */
|
||||
int (*tclUnixWaitForFile) (int fd, int mask, int timeout); /* 8 */
|
||||
TclFile (*tclpCreateTempFile) (const char *contents); /* 9 */
|
||||
Tcl_DirEntry * (*tclpReaddir) (TclDIR *dir); /* 10 */
|
||||
struct tm * (*tclpLocaltime_unix) (const time_t *clock); /* 11 */
|
||||
struct tm * (*tclpGmtime_unix) (const time_t *clock); /* 12 */
|
||||
char * (*tclpInetNtoa) (struct in_addr addr); /* 13 */
|
||||
int (*tclUnixCopyFile) (const char *src, const char *dst, const Tcl_StatBuf *statBufPtr, int dontCopyAtts); /* 14 */
|
||||
int (*tclMacOSXGetFileAttribute) (Tcl_Interp *interp, int objIndex, Tcl_Obj *fileName, Tcl_Obj **attributePtrPtr); /* 15 */
|
||||
int (*tclMacOSXSetFileAttribute) (Tcl_Interp *interp, int objIndex, Tcl_Obj *fileName, Tcl_Obj *attributePtr); /* 16 */
|
||||
int (*tclMacOSXCopyFileAttributes) (const char *src, const char *dst, const Tcl_StatBuf *statBufPtr); /* 17 */
|
||||
int (*tclMacOSXMatchType) (Tcl_Interp *interp, const char *pathName, const char *fileName, Tcl_StatBuf *statBufPtr, Tcl_GlobTypeData *types); /* 18 */
|
||||
void (*tclMacOSXNotifierAddRunLoopMode) (const void *runLoopMode); /* 19 */
|
||||
void (*reserved20)(void);
|
||||
void (*reserved21)(void);
|
||||
TclFile (*tclpCreateTempFile_) (const char *contents); /* 22 */
|
||||
void (*reserved23)(void);
|
||||
void (*reserved24)(void);
|
||||
void (*reserved25)(void);
|
||||
void (*reserved26)(void);
|
||||
void (*reserved27)(void);
|
||||
void (*reserved28)(void);
|
||||
int (*tclWinCPUID) (unsigned int index, unsigned int *regs); /* 29 */
|
||||
int (*tclUnixOpenTemporaryFile) (Tcl_Obj *dirObj, Tcl_Obj *basenameObj, Tcl_Obj *extensionObj, Tcl_Obj *resultingNameObj); /* 30 */
|
||||
#endif /* UNIX */
|
||||
#if defined(_WIN32) || defined(__CYGWIN__) /* WIN */
|
||||
void (*tclWinConvertError) (DWORD errCode); /* 0 */
|
||||
void (*tclWinConvertWSAError) (DWORD errCode); /* 1 */
|
||||
struct servent * (*tclWinGetServByName) (const char *nm, const char *proto); /* 2 */
|
||||
int (*tclWinGetSockOpt) (SOCKET s, int level, int optname, char *optval, int *optlen); /* 3 */
|
||||
HINSTANCE (*tclWinGetTclInstance) (void); /* 4 */
|
||||
int (*tclUnixWaitForFile) (int fd, int mask, int timeout); /* 5 */
|
||||
unsigned short (*tclWinNToHS) (unsigned short ns); /* 6 */
|
||||
int (*tclWinSetSockOpt) (SOCKET s, int level, int optname, const char *optval, int optlen); /* 7 */
|
||||
int (*tclpGetPid) (Tcl_Pid pid); /* 8 */
|
||||
int (*tclWinGetPlatformId) (void); /* 9 */
|
||||
Tcl_DirEntry * (*tclpReaddir) (TclDIR *dir); /* 10 */
|
||||
void (*tclGetAndDetachPids) (Tcl_Interp *interp, Tcl_Channel chan); /* 11 */
|
||||
int (*tclpCloseFile) (TclFile file); /* 12 */
|
||||
Tcl_Channel (*tclpCreateCommandChannel) (TclFile readFile, TclFile writeFile, TclFile errorFile, int numPids, Tcl_Pid *pidPtr); /* 13 */
|
||||
int (*tclpCreatePipe) (TclFile *readPipe, TclFile *writePipe); /* 14 */
|
||||
int (*tclpCreateProcess) (Tcl_Interp *interp, int argc, const char **argv, TclFile inputFile, TclFile outputFile, TclFile errorFile, Tcl_Pid *pidPtr); /* 15 */
|
||||
int (*tclpIsAtty) (int fd); /* 16 */
|
||||
int (*tclUnixCopyFile) (const char *src, const char *dst, const Tcl_StatBuf *statBufPtr, int dontCopyAtts); /* 17 */
|
||||
TclFile (*tclpMakeFile) (Tcl_Channel channel, int direction); /* 18 */
|
||||
TclFile (*tclpOpenFile) (const char *fname, int mode); /* 19 */
|
||||
void (*tclWinAddProcess) (HANDLE hProcess, DWORD id); /* 20 */
|
||||
char * (*tclpInetNtoa) (struct in_addr addr); /* 21 */
|
||||
TclFile (*tclpCreateTempFile) (const char *contents); /* 22 */
|
||||
void (*reserved23)(void);
|
||||
char * (*tclWinNoBackslash) (char *path); /* 24 */
|
||||
void (*reserved25)(void);
|
||||
void (*tclWinSetInterfaces) (int wide); /* 26 */
|
||||
void (*tclWinFlushDirtyChannels) (void); /* 27 */
|
||||
void (*tclWinResetInterfaces) (void); /* 28 */
|
||||
int (*tclWinCPUID) (unsigned int index, unsigned int *regs); /* 29 */
|
||||
int (*tclUnixOpenTemporaryFile) (Tcl_Obj *dirObj, Tcl_Obj *basenameObj, Tcl_Obj *extensionObj, Tcl_Obj *resultingNameObj); /* 30 */
|
||||
#endif /* WIN */
|
||||
#ifdef MAC_OSX_TCL /* MACOSX */
|
||||
void (*tclGetAndDetachPids) (Tcl_Interp *interp, Tcl_Channel chan); /* 0 */
|
||||
int (*tclpCloseFile) (TclFile file); /* 1 */
|
||||
Tcl_Channel (*tclpCreateCommandChannel) (TclFile readFile, TclFile writeFile, TclFile errorFile, int numPids, Tcl_Pid *pidPtr); /* 2 */
|
||||
int (*tclpCreatePipe) (TclFile *readPipe, TclFile *writePipe); /* 3 */
|
||||
int (*tclpCreateProcess) (Tcl_Interp *interp, int argc, const char **argv, TclFile inputFile, TclFile outputFile, TclFile errorFile, Tcl_Pid *pidPtr); /* 4 */
|
||||
int (*tclUnixWaitForFile_) (int fd, int mask, int timeout); /* 5 */
|
||||
TclFile (*tclpMakeFile) (Tcl_Channel channel, int direction); /* 6 */
|
||||
TclFile (*tclpOpenFile) (const char *fname, int mode); /* 7 */
|
||||
int (*tclUnixWaitForFile) (int fd, int mask, int timeout); /* 8 */
|
||||
TclFile (*tclpCreateTempFile) (const char *contents); /* 9 */
|
||||
Tcl_DirEntry * (*tclpReaddir) (TclDIR *dir); /* 10 */
|
||||
struct tm * (*tclpLocaltime_unix) (const time_t *clock); /* 11 */
|
||||
struct tm * (*tclpGmtime_unix) (const time_t *clock); /* 12 */
|
||||
char * (*tclpInetNtoa) (struct in_addr addr); /* 13 */
|
||||
int (*tclUnixCopyFile) (const char *src, const char *dst, const Tcl_StatBuf *statBufPtr, int dontCopyAtts); /* 14 */
|
||||
int (*tclMacOSXGetFileAttribute) (Tcl_Interp *interp, int objIndex, Tcl_Obj *fileName, Tcl_Obj **attributePtrPtr); /* 15 */
|
||||
int (*tclMacOSXSetFileAttribute) (Tcl_Interp *interp, int objIndex, Tcl_Obj *fileName, Tcl_Obj *attributePtr); /* 16 */
|
||||
int (*tclMacOSXCopyFileAttributes) (const char *src, const char *dst, const Tcl_StatBuf *statBufPtr); /* 17 */
|
||||
int (*tclMacOSXMatchType) (Tcl_Interp *interp, const char *pathName, const char *fileName, Tcl_StatBuf *statBufPtr, Tcl_GlobTypeData *types); /* 18 */
|
||||
void (*tclMacOSXNotifierAddRunLoopMode) (const void *runLoopMode); /* 19 */
|
||||
void (*reserved20)(void);
|
||||
void (*reserved21)(void);
|
||||
TclFile (*tclpCreateTempFile_) (const char *contents); /* 22 */
|
||||
void (*reserved23)(void);
|
||||
void (*reserved24)(void);
|
||||
void (*reserved25)(void);
|
||||
void (*reserved26)(void);
|
||||
void (*reserved27)(void);
|
||||
void (*reserved28)(void);
|
||||
int (*tclWinCPUID) (unsigned int index, unsigned int *regs); /* 29 */
|
||||
int (*tclUnixOpenTemporaryFile) (Tcl_Obj *dirObj, Tcl_Obj *basenameObj, Tcl_Obj *extensionObj, Tcl_Obj *resultingNameObj); /* 30 */
|
||||
#endif /* MACOSX */
|
||||
} TclIntPlatStubs;
|
||||
|
||||
extern const TclIntPlatStubs *tclIntPlatStubsPtr;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(USE_TCL_STUBS)
|
||||
|
||||
/*
|
||||
* Inline function declarations:
|
||||
*/
|
||||
|
||||
#if !defined(_WIN32) && !defined(__CYGWIN__) && !defined(MAC_OSX_TCL) /* UNIX */
|
||||
#define TclGetAndDetachPids \
|
||||
(tclIntPlatStubsPtr->tclGetAndDetachPids) /* 0 */
|
||||
#define TclpCloseFile \
|
||||
(tclIntPlatStubsPtr->tclpCloseFile) /* 1 */
|
||||
#define TclpCreateCommandChannel \
|
||||
(tclIntPlatStubsPtr->tclpCreateCommandChannel) /* 2 */
|
||||
#define TclpCreatePipe \
|
||||
(tclIntPlatStubsPtr->tclpCreatePipe) /* 3 */
|
||||
#define TclpCreateProcess \
|
||||
(tclIntPlatStubsPtr->tclpCreateProcess) /* 4 */
|
||||
#define TclUnixWaitForFile_ \
|
||||
(tclIntPlatStubsPtr->tclUnixWaitForFile_) /* 5 */
|
||||
#define TclpMakeFile \
|
||||
(tclIntPlatStubsPtr->tclpMakeFile) /* 6 */
|
||||
#define TclpOpenFile \
|
||||
(tclIntPlatStubsPtr->tclpOpenFile) /* 7 */
|
||||
#define TclUnixWaitForFile \
|
||||
(tclIntPlatStubsPtr->tclUnixWaitForFile) /* 8 */
|
||||
#define TclpCreateTempFile \
|
||||
(tclIntPlatStubsPtr->tclpCreateTempFile) /* 9 */
|
||||
#define TclpReaddir \
|
||||
(tclIntPlatStubsPtr->tclpReaddir) /* 10 */
|
||||
#define TclpLocaltime_unix \
|
||||
(tclIntPlatStubsPtr->tclpLocaltime_unix) /* 11 */
|
||||
#define TclpGmtime_unix \
|
||||
(tclIntPlatStubsPtr->tclpGmtime_unix) /* 12 */
|
||||
#define TclpInetNtoa \
|
||||
(tclIntPlatStubsPtr->tclpInetNtoa) /* 13 */
|
||||
#define TclUnixCopyFile \
|
||||
(tclIntPlatStubsPtr->tclUnixCopyFile) /* 14 */
|
||||
#define TclMacOSXGetFileAttribute \
|
||||
(tclIntPlatStubsPtr->tclMacOSXGetFileAttribute) /* 15 */
|
||||
#define TclMacOSXSetFileAttribute \
|
||||
(tclIntPlatStubsPtr->tclMacOSXSetFileAttribute) /* 16 */
|
||||
#define TclMacOSXCopyFileAttributes \
|
||||
(tclIntPlatStubsPtr->tclMacOSXCopyFileAttributes) /* 17 */
|
||||
#define TclMacOSXMatchType \
|
||||
(tclIntPlatStubsPtr->tclMacOSXMatchType) /* 18 */
|
||||
#define TclMacOSXNotifierAddRunLoopMode \
|
||||
(tclIntPlatStubsPtr->tclMacOSXNotifierAddRunLoopMode) /* 19 */
|
||||
/* Slot 20 is reserved */
|
||||
/* Slot 21 is reserved */
|
||||
#define TclpCreateTempFile_ \
|
||||
(tclIntPlatStubsPtr->tclpCreateTempFile_) /* 22 */
|
||||
/* Slot 23 is reserved */
|
||||
/* Slot 24 is reserved */
|
||||
/* Slot 25 is reserved */
|
||||
/* Slot 26 is reserved */
|
||||
/* Slot 27 is reserved */
|
||||
/* Slot 28 is reserved */
|
||||
#define TclWinCPUID \
|
||||
(tclIntPlatStubsPtr->tclWinCPUID) /* 29 */
|
||||
#define TclUnixOpenTemporaryFile \
|
||||
(tclIntPlatStubsPtr->tclUnixOpenTemporaryFile) /* 30 */
|
||||
#endif /* UNIX */
|
||||
#if defined(_WIN32) || defined(__CYGWIN__) /* WIN */
|
||||
#define TclWinConvertError \
|
||||
(tclIntPlatStubsPtr->tclWinConvertError) /* 0 */
|
||||
#define TclWinConvertWSAError \
|
||||
(tclIntPlatStubsPtr->tclWinConvertWSAError) /* 1 */
|
||||
#define TclWinGetServByName \
|
||||
(tclIntPlatStubsPtr->tclWinGetServByName) /* 2 */
|
||||
#define TclWinGetSockOpt \
|
||||
(tclIntPlatStubsPtr->tclWinGetSockOpt) /* 3 */
|
||||
#define TclWinGetTclInstance \
|
||||
(tclIntPlatStubsPtr->tclWinGetTclInstance) /* 4 */
|
||||
#define TclUnixWaitForFile \
|
||||
(tclIntPlatStubsPtr->tclUnixWaitForFile) /* 5 */
|
||||
#define TclWinNToHS \
|
||||
(tclIntPlatStubsPtr->tclWinNToHS) /* 6 */
|
||||
#define TclWinSetSockOpt \
|
||||
(tclIntPlatStubsPtr->tclWinSetSockOpt) /* 7 */
|
||||
#define TclpGetPid \
|
||||
(tclIntPlatStubsPtr->tclpGetPid) /* 8 */
|
||||
#define TclWinGetPlatformId \
|
||||
(tclIntPlatStubsPtr->tclWinGetPlatformId) /* 9 */
|
||||
#define TclpReaddir \
|
||||
(tclIntPlatStubsPtr->tclpReaddir) /* 10 */
|
||||
#define TclGetAndDetachPids \
|
||||
(tclIntPlatStubsPtr->tclGetAndDetachPids) /* 11 */
|
||||
#define TclpCloseFile \
|
||||
(tclIntPlatStubsPtr->tclpCloseFile) /* 12 */
|
||||
#define TclpCreateCommandChannel \
|
||||
(tclIntPlatStubsPtr->tclpCreateCommandChannel) /* 13 */
|
||||
#define TclpCreatePipe \
|
||||
(tclIntPlatStubsPtr->tclpCreatePipe) /* 14 */
|
||||
#define TclpCreateProcess \
|
||||
(tclIntPlatStubsPtr->tclpCreateProcess) /* 15 */
|
||||
#define TclpIsAtty \
|
||||
(tclIntPlatStubsPtr->tclpIsAtty) /* 16 */
|
||||
#define TclUnixCopyFile \
|
||||
(tclIntPlatStubsPtr->tclUnixCopyFile) /* 17 */
|
||||
#define TclpMakeFile \
|
||||
(tclIntPlatStubsPtr->tclpMakeFile) /* 18 */
|
||||
#define TclpOpenFile \
|
||||
(tclIntPlatStubsPtr->tclpOpenFile) /* 19 */
|
||||
#define TclWinAddProcess \
|
||||
(tclIntPlatStubsPtr->tclWinAddProcess) /* 20 */
|
||||
#define TclpInetNtoa \
|
||||
(tclIntPlatStubsPtr->tclpInetNtoa) /* 21 */
|
||||
#define TclpCreateTempFile \
|
||||
(tclIntPlatStubsPtr->tclpCreateTempFile) /* 22 */
|
||||
/* Slot 23 is reserved */
|
||||
#define TclWinNoBackslash \
|
||||
(tclIntPlatStubsPtr->tclWinNoBackslash) /* 24 */
|
||||
/* Slot 25 is reserved */
|
||||
#define TclWinSetInterfaces \
|
||||
(tclIntPlatStubsPtr->tclWinSetInterfaces) /* 26 */
|
||||
#define TclWinFlushDirtyChannels \
|
||||
(tclIntPlatStubsPtr->tclWinFlushDirtyChannels) /* 27 */
|
||||
#define TclWinResetInterfaces \
|
||||
(tclIntPlatStubsPtr->tclWinResetInterfaces) /* 28 */
|
||||
#define TclWinCPUID \
|
||||
(tclIntPlatStubsPtr->tclWinCPUID) /* 29 */
|
||||
#define TclUnixOpenTemporaryFile \
|
||||
(tclIntPlatStubsPtr->tclUnixOpenTemporaryFile) /* 30 */
|
||||
#endif /* WIN */
|
||||
#ifdef MAC_OSX_TCL /* MACOSX */
|
||||
#define TclGetAndDetachPids \
|
||||
(tclIntPlatStubsPtr->tclGetAndDetachPids) /* 0 */
|
||||
#define TclpCloseFile \
|
||||
(tclIntPlatStubsPtr->tclpCloseFile) /* 1 */
|
||||
#define TclpCreateCommandChannel \
|
||||
(tclIntPlatStubsPtr->tclpCreateCommandChannel) /* 2 */
|
||||
#define TclpCreatePipe \
|
||||
(tclIntPlatStubsPtr->tclpCreatePipe) /* 3 */
|
||||
#define TclpCreateProcess \
|
||||
(tclIntPlatStubsPtr->tclpCreateProcess) /* 4 */
|
||||
#define TclUnixWaitForFile_ \
|
||||
(tclIntPlatStubsPtr->tclUnixWaitForFile_) /* 5 */
|
||||
#define TclpMakeFile \
|
||||
(tclIntPlatStubsPtr->tclpMakeFile) /* 6 */
|
||||
#define TclpOpenFile \
|
||||
(tclIntPlatStubsPtr->tclpOpenFile) /* 7 */
|
||||
#define TclUnixWaitForFile \
|
||||
(tclIntPlatStubsPtr->tclUnixWaitForFile) /* 8 */
|
||||
#define TclpCreateTempFile \
|
||||
(tclIntPlatStubsPtr->tclpCreateTempFile) /* 9 */
|
||||
#define TclpReaddir \
|
||||
(tclIntPlatStubsPtr->tclpReaddir) /* 10 */
|
||||
#define TclpLocaltime_unix \
|
||||
(tclIntPlatStubsPtr->tclpLocaltime_unix) /* 11 */
|
||||
#define TclpGmtime_unix \
|
||||
(tclIntPlatStubsPtr->tclpGmtime_unix) /* 12 */
|
||||
#define TclpInetNtoa \
|
||||
(tclIntPlatStubsPtr->tclpInetNtoa) /* 13 */
|
||||
#define TclUnixCopyFile \
|
||||
(tclIntPlatStubsPtr->tclUnixCopyFile) /* 14 */
|
||||
#define TclMacOSXGetFileAttribute \
|
||||
(tclIntPlatStubsPtr->tclMacOSXGetFileAttribute) /* 15 */
|
||||
#define TclMacOSXSetFileAttribute \
|
||||
(tclIntPlatStubsPtr->tclMacOSXSetFileAttribute) /* 16 */
|
||||
#define TclMacOSXCopyFileAttributes \
|
||||
(tclIntPlatStubsPtr->tclMacOSXCopyFileAttributes) /* 17 */
|
||||
#define TclMacOSXMatchType \
|
||||
(tclIntPlatStubsPtr->tclMacOSXMatchType) /* 18 */
|
||||
#define TclMacOSXNotifierAddRunLoopMode \
|
||||
(tclIntPlatStubsPtr->tclMacOSXNotifierAddRunLoopMode) /* 19 */
|
||||
/* Slot 20 is reserved */
|
||||
/* Slot 21 is reserved */
|
||||
#define TclpCreateTempFile_ \
|
||||
(tclIntPlatStubsPtr->tclpCreateTempFile_) /* 22 */
|
||||
/* Slot 23 is reserved */
|
||||
/* Slot 24 is reserved */
|
||||
/* Slot 25 is reserved */
|
||||
/* Slot 26 is reserved */
|
||||
/* Slot 27 is reserved */
|
||||
/* Slot 28 is reserved */
|
||||
#define TclWinCPUID \
|
||||
(tclIntPlatStubsPtr->tclWinCPUID) /* 29 */
|
||||
#define TclUnixOpenTemporaryFile \
|
||||
(tclIntPlatStubsPtr->tclUnixOpenTemporaryFile) /* 30 */
|
||||
#endif /* MACOSX */
|
||||
|
||||
#endif /* defined(USE_TCL_STUBS) */
|
||||
|
||||
/* !END!: Do not edit above this line. */
|
||||
|
||||
#undef TCL_STORAGE_CLASS
|
||||
#define TCL_STORAGE_CLASS DLLIMPORT
|
||||
#undef TclpLocaltime_unix
|
||||
#undef TclpGmtime_unix
|
||||
#undef TclWinConvertWSAError
|
||||
#define TclWinConvertWSAError TclWinConvertError
|
||||
#undef TclpInetNtoa
|
||||
#define TclpInetNtoa inet_ntoa
|
||||
|
||||
#undef TclpCreateTempFile_
|
||||
#undef TclUnixWaitForFile_
|
||||
#ifndef MAC_OSX_TCL /* not accessible on Win32/UNIX */
|
||||
#undef TclMacOSXGetFileAttribute /* 15 */
|
||||
#undef TclMacOSXSetFileAttribute /* 16 */
|
||||
#undef TclMacOSXCopyFileAttributes /* 17 */
|
||||
#undef TclMacOSXMatchType /* 18 */
|
||||
#undef TclMacOSXNotifierAddRunLoopMode /* 19 */
|
||||
#endif
|
||||
|
||||
#if defined(_WIN32)
|
||||
# undef TclWinNToHS
|
||||
# undef TclWinGetServByName
|
||||
# undef TclWinGetSockOpt
|
||||
# undef TclWinSetSockOpt
|
||||
# define TclWinNToHS ntohs
|
||||
# define TclWinGetServByName getservbyname
|
||||
# define TclWinGetSockOpt getsockopt
|
||||
# define TclWinSetSockOpt setsockopt
|
||||
#else
|
||||
# undef TclpGetPid
|
||||
# define TclpGetPid(pid) ((unsigned long) (pid))
|
||||
#endif
|
||||
|
||||
#endif /* _TCLINTPLATDECLS */
|
||||
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
* tclPort.h --
|
||||
*
|
||||
* This header file handles porting issues that occur because
|
||||
* of differences between systems. It reads in platform specific
|
||||
* portability files.
|
||||
*
|
||||
* Copyright (c) 1994-1995 Sun Microsystems, Inc.
|
||||
*
|
||||
* See the file "license.terms" for information on usage and redistribution
|
||||
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
*/
|
||||
|
||||
#ifndef _TCLPORT
|
||||
#define _TCLPORT
|
||||
|
||||
#ifdef HAVE_TCL_CONFIG_H
|
||||
#include "tclConfig.h"
|
||||
#endif
|
||||
#if defined(_WIN32)
|
||||
# include "tclWinPort.h"
|
||||
#else
|
||||
# include "tclUnixPort.h"
|
||||
#endif
|
||||
#include "tcl.h"
|
||||
|
||||
#if !defined(LLONG_MIN)
|
||||
# ifdef TCL_WIDE_INT_IS_LONG
|
||||
# define LLONG_MIN LONG_MIN
|
||||
# else
|
||||
# ifdef LLONG_BIT
|
||||
# define LLONG_MIN ((Tcl_WideInt)(Tcl_LongAsWide(1)<<(LLONG_BIT-1)))
|
||||
# else
|
||||
/* Assume we're on a system with a 64-bit 'long long' type */
|
||||
# define LLONG_MIN ((Tcl_WideInt)(Tcl_LongAsWide(1)<<63))
|
||||
# endif
|
||||
# endif
|
||||
/* Assume that if LLONG_MIN is undefined, then so is LLONG_MAX */
|
||||
# define LLONG_MAX (~LLONG_MIN)
|
||||
#endif
|
||||
|
||||
#define UWIDE_MAX ((Tcl_WideUInt)-1)
|
||||
#define WIDE_MAX ((Tcl_WideInt)(UWIDE_MAX >> 1))
|
||||
#define WIDE_MIN ((Tcl_WideInt)((Tcl_WideUInt)WIDE_MAX+1))
|
||||
|
||||
#endif /* _TCLPORT */
|
||||
@@ -0,0 +1,732 @@
|
||||
/*
|
||||
* tclUnixPort.h --
|
||||
*
|
||||
* This header file handles porting issues that occur because of
|
||||
* differences between systems. It reads in UNIX-related header files and
|
||||
* sets up UNIX-related macros for Tcl's UNIX core. It should be the only
|
||||
* file that contains #ifdefs to handle different flavors of UNIX. This
|
||||
* file sets up the union of all UNIX-related things needed by any of the
|
||||
* Tcl core files. This file depends on configuration #defines such as
|
||||
* NO_DIRENT_H that are set up by the "configure" script.
|
||||
*
|
||||
* Much of the material in this file was originally contributed by Karl
|
||||
* Lehenbauer, Mark Diekhans and Peter da Silva.
|
||||
*
|
||||
* Copyright (c) 1991-1994 The Regents of the University of California.
|
||||
* Copyright (c) 1994-1997 Sun Microsystems, Inc.
|
||||
*
|
||||
* See the file "license.terms" for information on usage and redistribution of
|
||||
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
*/
|
||||
|
||||
#ifndef _TCLUNIXPORT
|
||||
#define _TCLUNIXPORT
|
||||
|
||||
/*
|
||||
*---------------------------------------------------------------------------
|
||||
* The following sets of #includes and #ifdefs are required to get Tcl to
|
||||
* compile under the various flavors of unix.
|
||||
*---------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#ifdef HAVE_NET_ERRNO_H
|
||||
# include <net/errno.h>
|
||||
#endif
|
||||
#include <pwd.h>
|
||||
#include <signal.h>
|
||||
#ifdef HAVE_SYS_PARAM_H
|
||||
# include <sys/param.h>
|
||||
#endif
|
||||
#include <sys/types.h>
|
||||
#ifdef USE_DIRENT2_H
|
||||
# include "../compat/dirent2.h"
|
||||
#else
|
||||
#ifdef NO_DIRENT_H
|
||||
# include "../compat/dirent.h"
|
||||
#else
|
||||
# include <dirent.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
*---------------------------------------------------------------------------
|
||||
* Parameterize for 64-bit filesystem support.
|
||||
*---------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#ifdef HAVE_STRUCT_DIRENT64
|
||||
typedef struct dirent64 Tcl_DirEntry;
|
||||
# define TclOSreaddir readdir64
|
||||
#else
|
||||
typedef struct dirent Tcl_DirEntry;
|
||||
# define TclOSreaddir readdir
|
||||
#endif
|
||||
#ifdef HAVE_DIR64
|
||||
typedef DIR64 TclDIR;
|
||||
# define TclOSopendir opendir64
|
||||
# define TclOSrewinddir rewinddir64
|
||||
# define TclOSclosedir closedir64
|
||||
#else
|
||||
typedef DIR TclDIR;
|
||||
# define TclOSopendir opendir
|
||||
# define TclOSrewinddir rewinddir
|
||||
# define TclOSclosedir closedir
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_TYPE_OFF64_T
|
||||
typedef off64_t Tcl_SeekOffset;
|
||||
# define TclOSseek lseek64
|
||||
# define TclOSopen open64
|
||||
#else
|
||||
typedef off_t Tcl_SeekOffset;
|
||||
# define TclOSseek lseek
|
||||
# define TclOSopen open
|
||||
#endif
|
||||
|
||||
#ifdef __CYGWIN__
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
/* Make some symbols available without including <windows.h> */
|
||||
# define DWORD unsigned int
|
||||
# define CP_UTF8 65001
|
||||
# define GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS 0x00000004
|
||||
# define HANDLE void *
|
||||
# define HINSTANCE void *
|
||||
# define SOCKET unsigned int
|
||||
# define WSAEWOULDBLOCK 10035
|
||||
typedef unsigned short WCHAR;
|
||||
#ifdef __clang__
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wignored-attributes"
|
||||
#endif
|
||||
__declspec(dllimport) extern __stdcall int GetModuleHandleExW(unsigned int, const void *, void *);
|
||||
__declspec(dllimport) extern __stdcall int GetModuleFileNameW(void *, const void *, int);
|
||||
__declspec(dllimport) extern __stdcall int WideCharToMultiByte(int, int, const void *, int,
|
||||
char *, int, const char *, void *);
|
||||
__declspec(dllimport) extern __stdcall int MultiByteToWideChar(int, int, const char *, int,
|
||||
WCHAR *, int);
|
||||
__declspec(dllimport) extern __stdcall void OutputDebugStringW(const WCHAR *);
|
||||
__declspec(dllimport) extern __stdcall int IsDebuggerPresent(void);
|
||||
__declspec(dllimport) extern __stdcall int GetLastError(void);
|
||||
__declspec(dllimport) extern __stdcall int GetFileAttributesW(const WCHAR *);
|
||||
__declspec(dllimport) extern __stdcall int SetFileAttributesW(const WCHAR *, int);
|
||||
__declspec(dllimport) extern int cygwin_conv_path(int, const void *, void *, int);
|
||||
#ifdef __clang__
|
||||
#pragma clang diagnostic pop
|
||||
#endif
|
||||
# define timezone _timezone
|
||||
extern int TclOSstat(const char *name, void *statBuf);
|
||||
extern int TclOSlstat(const char *name, void *statBuf);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#elif defined(HAVE_STRUCT_STAT64) && !defined(__APPLE__)
|
||||
# define TclOSstat(name, buf) stat64(name, (struct stat64 *)buf)
|
||||
# define TclOSlstat(name,buf) lstat64(name, (struct stat64 *)buf)
|
||||
#else
|
||||
# define TclOSstat(name, buf) stat(name, (struct stat *)buf)
|
||||
# define TclOSlstat(name, buf) lstat(name, (struct stat *)buf)
|
||||
#endif
|
||||
|
||||
/*
|
||||
*---------------------------------------------------------------------------
|
||||
* Miscellaneous includes that might be missing.
|
||||
*---------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#include <sys/file.h>
|
||||
#ifdef HAVE_SYS_SELECT_H
|
||||
# include <sys/select.h>
|
||||
#endif
|
||||
#include <sys/stat.h>
|
||||
#ifdef TIME_WITH_SYS_TIME
|
||||
# include <sys/time.h>
|
||||
# include <time.h>
|
||||
#else
|
||||
#ifdef HAVE_SYS_TIME_H
|
||||
# include <sys/time.h>
|
||||
#else
|
||||
# include <time.h>
|
||||
#endif
|
||||
#endif
|
||||
#ifndef NO_SYS_WAIT_H
|
||||
# include <sys/wait.h>
|
||||
#endif
|
||||
#ifdef HAVE_INTTYPES_H
|
||||
# include <inttypes.h>
|
||||
#endif
|
||||
#include <limits.h>
|
||||
#ifdef HAVE_STDINT_H
|
||||
# include <stdint.h>
|
||||
#endif
|
||||
#ifdef HAVE_UNISTD_H
|
||||
# include <unistd.h>
|
||||
#else
|
||||
# include "../compat/unistd.h"
|
||||
#endif
|
||||
|
||||
extern int TclUnixSetBlockingMode(int fd, int mode);
|
||||
|
||||
#include <utime.h>
|
||||
|
||||
/*
|
||||
*---------------------------------------------------------------------------
|
||||
* Socket support stuff: This likely needs more work to parameterize for each
|
||||
* system.
|
||||
*---------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#include <sys/socket.h> /* struct sockaddr, SOCK_STREAM, ... */
|
||||
#ifndef NO_UNAME
|
||||
# include <sys/utsname.h> /* uname system call. */
|
||||
#endif
|
||||
#include <netinet/in.h> /* struct in_addr, struct sockaddr_in */
|
||||
#include <arpa/inet.h> /* inet_ntoa() */
|
||||
#include <netdb.h> /* getaddrinfo() */
|
||||
#ifdef NEED_FAKE_RFC2553
|
||||
# include "../compat/fake-rfc2553.h"
|
||||
#endif
|
||||
|
||||
/*
|
||||
*---------------------------------------------------------------------------
|
||||
* Some platforms (e.g. SunOS) don't define FLT_MAX and FLT_MIN, so we look
|
||||
* for an alternative definition. If no other alternative is available we use
|
||||
* a reasonable guess.
|
||||
*---------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#ifndef NO_FLOAT_H
|
||||
# include <float.h>
|
||||
#else
|
||||
#ifndef NO_VALUES_H
|
||||
# include <values.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef FLT_MAX
|
||||
# ifdef MAXFLOAT
|
||||
# define FLT_MAX MAXFLOAT
|
||||
# else
|
||||
# define FLT_MAX 3.402823466E+38F
|
||||
# endif
|
||||
#endif
|
||||
#ifndef FLT_MIN
|
||||
# ifdef MINFLOAT
|
||||
# define FLT_MIN MINFLOAT
|
||||
# else
|
||||
# define FLT_MIN 1.175494351E-38F
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
*---------------------------------------------------------------------------
|
||||
* NeXT doesn't define O_NONBLOCK, so #define it here if necessary.
|
||||
*---------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#ifndef O_NONBLOCK
|
||||
# define O_NONBLOCK 0x80
|
||||
#endif
|
||||
|
||||
/*
|
||||
*---------------------------------------------------------------------------
|
||||
* The type of the status returned by wait varies from UNIX system to UNIX
|
||||
* system. The macro below defines it:
|
||||
*---------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#ifdef _AIX
|
||||
# define WAIT_STATUS_TYPE pid_t
|
||||
#else
|
||||
#ifndef NO_UNION_WAIT
|
||||
# define WAIT_STATUS_TYPE union wait
|
||||
#else
|
||||
# define WAIT_STATUS_TYPE int
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
*---------------------------------------------------------------------------
|
||||
* Supply definitions for macros to query wait status, if not already defined
|
||||
* in header files above.
|
||||
*---------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#ifndef WIFEXITED
|
||||
# define WIFEXITED(stat) (((*((int *) &(stat))) & 0xFF) == 0)
|
||||
#endif
|
||||
|
||||
#ifndef WEXITSTATUS
|
||||
# define WEXITSTATUS(stat) (((*((int *) &(stat))) >> 8) & 0xFF)
|
||||
#endif
|
||||
|
||||
#ifndef WIFSIGNALED
|
||||
# define WIFSIGNALED(stat) \
|
||||
(((*((int *) &(stat)))) && ((*((int *) &(stat))) \
|
||||
== ((*((int *) &(stat))) & 0x00FF)))
|
||||
#endif
|
||||
|
||||
#ifndef WTERMSIG
|
||||
# define WTERMSIG(stat) ((*((int *) &(stat))) & 0x7F)
|
||||
#endif
|
||||
|
||||
#ifndef WIFSTOPPED
|
||||
# define WIFSTOPPED(stat) (((*((int *) &(stat))) & 0xFF) == 0177)
|
||||
#endif
|
||||
|
||||
#ifndef WSTOPSIG
|
||||
# define WSTOPSIG(stat) (((*((int *) &(stat))) >> 8) & 0xFF)
|
||||
#endif
|
||||
|
||||
/*
|
||||
*---------------------------------------------------------------------------
|
||||
* Define constants for waitpid() system call if they aren't defined by a
|
||||
* system header file.
|
||||
*---------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#ifndef WNOHANG
|
||||
# define WNOHANG 1
|
||||
#endif
|
||||
#ifndef WUNTRACED
|
||||
# define WUNTRACED 2
|
||||
#endif
|
||||
|
||||
/*
|
||||
*---------------------------------------------------------------------------
|
||||
* Supply macros for seek offsets, if they're not already provided by an
|
||||
* include file.
|
||||
*---------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#ifndef SEEK_SET
|
||||
# define SEEK_SET 0
|
||||
#endif
|
||||
#ifndef SEEK_CUR
|
||||
# define SEEK_CUR 1
|
||||
#endif
|
||||
#ifndef SEEK_END
|
||||
# define SEEK_END 2
|
||||
#endif
|
||||
|
||||
/*
|
||||
*---------------------------------------------------------------------------
|
||||
* The stuff below is needed by the "time" command. If this system has no
|
||||
* gettimeofday call, then must use times() instead.
|
||||
*---------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#ifdef NO_GETTOD
|
||||
# include <sys/times.h>
|
||||
#else
|
||||
# ifdef HAVE_BSDGETTIMEOFDAY
|
||||
# define gettimeofday BSDgettimeofday
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef GETTOD_NOT_DECLARED
|
||||
extern int gettimeofday(struct timeval *tp,
|
||||
struct timezone *tzp);
|
||||
#endif
|
||||
|
||||
/*
|
||||
*---------------------------------------------------------------------------
|
||||
* Define access mode constants if they aren't already defined.
|
||||
*---------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#ifndef F_OK
|
||||
# define F_OK 00
|
||||
#endif
|
||||
#ifndef X_OK
|
||||
# define X_OK 01
|
||||
#endif
|
||||
#ifndef W_OK
|
||||
# define W_OK 02
|
||||
#endif
|
||||
#ifndef R_OK
|
||||
# define R_OK 04
|
||||
#endif
|
||||
|
||||
/*
|
||||
*---------------------------------------------------------------------------
|
||||
* Define FD_CLOEEXEC (the close-on-exec flag bit) if it isn't already
|
||||
* defined.
|
||||
*---------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#ifndef FD_CLOEXEC
|
||||
# define FD_CLOEXEC 1
|
||||
#endif
|
||||
|
||||
/*
|
||||
*---------------------------------------------------------------------------
|
||||
* On systems without symbolic links (i.e. S_IFLNK isn't defined) define
|
||||
* "lstat" to use "stat" instead.
|
||||
*---------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#ifndef S_IFLNK
|
||||
# undef TclOSlstat
|
||||
# define lstat stat
|
||||
# define lstat64 stat64
|
||||
# define TclOSlstat TclOSstat
|
||||
#endif
|
||||
|
||||
/*
|
||||
*---------------------------------------------------------------------------
|
||||
* Define macros to query file type bits, if they're not already defined.
|
||||
*---------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#ifndef S_ISREG
|
||||
# ifdef S_IFREG
|
||||
# define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
|
||||
# else
|
||||
# define S_ISREG(m) 0
|
||||
# endif
|
||||
#endif /* !S_ISREG */
|
||||
#ifndef S_ISDIR
|
||||
# ifdef S_IFDIR
|
||||
# define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
|
||||
# else
|
||||
# define S_ISDIR(m) 0
|
||||
# endif
|
||||
#endif /* !S_ISDIR */
|
||||
#ifndef S_ISCHR
|
||||
# ifdef S_IFCHR
|
||||
# define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR)
|
||||
# else
|
||||
# define S_ISCHR(m) 0
|
||||
# endif
|
||||
#endif /* !S_ISCHR */
|
||||
|
||||
#ifndef S_ISBLK
|
||||
# ifdef S_IFBLK
|
||||
# define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK)
|
||||
# else
|
||||
# define S_ISBLK(m) 0
|
||||
# endif
|
||||
#endif /* !S_ISBLK */
|
||||
|
||||
#ifndef S_ISFIFO
|
||||
# ifdef S_IFIFO
|
||||
# define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO)
|
||||
# else
|
||||
# define S_ISFIFO(m) 0
|
||||
# endif
|
||||
#endif /* !S_ISFIFO */
|
||||
|
||||
#ifndef S_ISLNK
|
||||
# ifdef S_IFLNK
|
||||
# define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK)
|
||||
# else
|
||||
# define S_ISLNK(m) 0
|
||||
# endif
|
||||
#endif /* !S_ISLNK */
|
||||
|
||||
#ifndef S_ISSOCK
|
||||
# ifdef S_IFSOCK
|
||||
# define S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK)
|
||||
# else
|
||||
# define S_ISSOCK(m) 0
|
||||
# endif
|
||||
#endif /* !S_ISSOCK */
|
||||
|
||||
/*
|
||||
*---------------------------------------------------------------------------
|
||||
* Make sure that MAXPATHLEN and MAXNAMLEN are defined.
|
||||
*---------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#ifndef MAXPATHLEN
|
||||
# ifdef PATH_MAX
|
||||
# define MAXPATHLEN PATH_MAX
|
||||
# else
|
||||
# define MAXPATHLEN 2048
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef MAXNAMLEN
|
||||
# ifdef NAME_MAX
|
||||
# define MAXNAMLEN NAME_MAX
|
||||
# else
|
||||
# define MAXNAMLEN 255
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
*---------------------------------------------------------------------------
|
||||
* The following macro defines the type of the mask arguments to select:
|
||||
*---------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#ifndef NO_FD_SET
|
||||
# define SELECT_MASK fd_set
|
||||
#else /* NO_FD_SET */
|
||||
# ifndef _AIX
|
||||
typedef long fd_mask;
|
||||
# endif /* !AIX */
|
||||
# if defined(_IBMR2)
|
||||
# define SELECT_MASK void
|
||||
# else /* !defined(_IBMR2) */
|
||||
# define SELECT_MASK int
|
||||
# endif /* defined(_IBMR2) */
|
||||
#endif /* !NO_FD_SET */
|
||||
|
||||
/*
|
||||
*---------------------------------------------------------------------------
|
||||
* Define "NBBY" (number of bits per byte) if it's not already defined.
|
||||
*---------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#ifndef NBBY
|
||||
# define NBBY 8
|
||||
#endif
|
||||
|
||||
/*
|
||||
*---------------------------------------------------------------------------
|
||||
* The following macro defines the number of fd_masks in an fd_set:
|
||||
*---------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#ifndef FD_SETSIZE
|
||||
# ifdef OPEN_MAX
|
||||
# define FD_SETSIZE OPEN_MAX
|
||||
# else
|
||||
# define FD_SETSIZE 256
|
||||
# endif
|
||||
#endif /* FD_SETSIZE */
|
||||
|
||||
#ifndef howmany
|
||||
# define howmany(x, y) (((x)+((y)-1))/(y))
|
||||
#endif /* !defined(howmany) */
|
||||
|
||||
#ifndef NFDBITS
|
||||
# define NFDBITS NBBY*sizeof(fd_mask)
|
||||
#endif /* NFDBITS */
|
||||
|
||||
#define MASK_SIZE howmany(FD_SETSIZE, NFDBITS)
|
||||
|
||||
/*
|
||||
*---------------------------------------------------------------------------
|
||||
* Not all systems declare the errno variable in errno.h, so this file does it
|
||||
* explicitly. The list of system error messages also isn't generally declared
|
||||
* in a header file anywhere.
|
||||
*---------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#ifdef NO_ERRNO
|
||||
extern int errno;
|
||||
#endif /* NO_ERRNO */
|
||||
|
||||
/*
|
||||
*---------------------------------------------------------------------------
|
||||
* Not all systems declare all the errors that Tcl uses! Provide some
|
||||
* work-arounds...
|
||||
*---------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#ifndef EOVERFLOW
|
||||
# ifdef EFBIG
|
||||
# define EOVERFLOW EFBIG
|
||||
# else /* !EFBIG */
|
||||
# define EOVERFLOW EINVAL
|
||||
# endif /* EFBIG */
|
||||
#endif /* EOVERFLOW */
|
||||
|
||||
/*
|
||||
*---------------------------------------------------------------------------
|
||||
* Variables provided by the C library:
|
||||
*---------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#if defined(__APPLE__) && defined(__DYNAMIC__)
|
||||
# include <crt_externs.h>
|
||||
# define environ (*_NSGetEnviron())
|
||||
# define USE_PUTENV 1
|
||||
#else
|
||||
# if defined(_sgi) || defined(__sgi)
|
||||
# define environ _environ
|
||||
# endif
|
||||
extern char ** environ;
|
||||
#endif
|
||||
|
||||
/*
|
||||
*---------------------------------------------------------------------------
|
||||
* Darwin specifc configure overrides.
|
||||
*---------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#ifdef __APPLE__
|
||||
|
||||
/*
|
||||
*---------------------------------------------------------------------------
|
||||
* Support for fat compiles: configure runs only once for multiple architectures
|
||||
*---------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
# if defined(__LP64__) && defined (NO_COREFOUNDATION_64)
|
||||
# undef HAVE_COREFOUNDATION
|
||||
# endif /* __LP64__ && NO_COREFOUNDATION_64 */
|
||||
# include <sys/cdefs.h>
|
||||
# ifdef __DARWIN_UNIX03
|
||||
# if __DARWIN_UNIX03
|
||||
# undef HAVE_PUTENV_THAT_COPIES
|
||||
# else
|
||||
# define HAVE_PUTENV_THAT_COPIES 1
|
||||
# endif
|
||||
# endif /* __DARWIN_UNIX03 */
|
||||
|
||||
/*
|
||||
*---------------------------------------------------------------------------
|
||||
* Include AvailabilityMacros.h here (when available) to ensure any symbolic
|
||||
* MAC_OS_X_VERSION_* constants passed on the command line are translated.
|
||||
*---------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
# ifdef HAVE_AVAILABILITYMACROS_H
|
||||
# include <AvailabilityMacros.h>
|
||||
# endif
|
||||
|
||||
/*
|
||||
*---------------------------------------------------------------------------
|
||||
* Support for weak import.
|
||||
*---------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
# ifdef HAVE_WEAK_IMPORT
|
||||
# if !defined(HAVE_AVAILABILITYMACROS_H) || !defined(MAC_OS_X_VERSION_MIN_REQUIRED)
|
||||
# undef HAVE_WEAK_IMPORT
|
||||
# else
|
||||
# ifndef WEAK_IMPORT_ATTRIBUTE
|
||||
# define WEAK_IMPORT_ATTRIBUTE __attribute__((weak_import))
|
||||
# endif
|
||||
# endif
|
||||
# endif /* HAVE_WEAK_IMPORT */
|
||||
|
||||
/*
|
||||
*---------------------------------------------------------------------------
|
||||
* Support for MAC_OS_X_VERSION_MAX_ALLOWED define from AvailabilityMacros.h:
|
||||
* only use API available in the indicated OS version or earlier.
|
||||
*---------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
# ifdef MAC_OS_X_VERSION_MAX_ALLOWED
|
||||
# if MAC_OS_X_VERSION_MAX_ALLOWED < 1050 && defined(__LP64__)
|
||||
# undef HAVE_COREFOUNDATION
|
||||
# endif
|
||||
# if MAC_OS_X_VERSION_MAX_ALLOWED < 1040
|
||||
# undef HAVE_OSSPINLOCKLOCK
|
||||
# undef HAVE_PTHREAD_ATFORK
|
||||
# undef HAVE_COPYFILE
|
||||
# endif
|
||||
# if MAC_OS_X_VERSION_MAX_ALLOWED < 1030
|
||||
# ifdef TCL_THREADS
|
||||
/* prior to 10.3, realpath is not threadsafe, c.f. bug 711232 */
|
||||
# define NO_REALPATH 1
|
||||
# endif
|
||||
# undef HAVE_LANGINFO
|
||||
# endif
|
||||
# endif /* MAC_OS_X_VERSION_MAX_ALLOWED */
|
||||
# if defined(HAVE_COREFOUNDATION) && defined(__LP64__) && \
|
||||
defined(HAVE_WEAK_IMPORT) && MAC_OS_X_VERSION_MIN_REQUIRED < 1050
|
||||
# warning "Weak import of 64-bit CoreFoundation is not supported, will not run on Mac OS X < 10.5."
|
||||
# endif
|
||||
/*
|
||||
* For now, test exec-17.1 fails (I/O setup after closing stdout) with
|
||||
* posix_spawnp(), but the classic implementation (based on fork()+execvp())
|
||||
* works well under macOS.
|
||||
*/
|
||||
# undef HAVE_POSIX_SPAWNP
|
||||
# undef HAVE_VFORK
|
||||
#endif /* __APPLE__ */
|
||||
|
||||
/*
|
||||
*---------------------------------------------------------------------------
|
||||
* The following macros and declarations represent the interface between
|
||||
* generic and unix-specific parts of Tcl. Some of the macros may override
|
||||
* functions declared in tclInt.h.
|
||||
*---------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/*
|
||||
* The default platform eol translation on Unix is TCL_TRANSLATE_LF.
|
||||
*/
|
||||
|
||||
#ifdef DJGPP
|
||||
#define TCL_PLATFORM_TRANSLATION TCL_TRANSLATE_CRLF
|
||||
typedef int socklen_t;
|
||||
#else
|
||||
#define TCL_PLATFORM_TRANSLATION TCL_TRANSLATE_LF
|
||||
#endif
|
||||
|
||||
/*
|
||||
*---------------------------------------------------------------------------
|
||||
* The following macros have trivial definitions, allowing generic code to
|
||||
* address platform-specific issues.
|
||||
*---------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#define TclpReleaseFile(file) /* Nothing. */
|
||||
|
||||
/*
|
||||
*---------------------------------------------------------------------------
|
||||
* The following defines wrap the system memory allocation routines.
|
||||
*---------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#define TclpSysAlloc(size, isBin) malloc((size_t)(size))
|
||||
#define TclpSysFree(ptr) free((char *)(ptr))
|
||||
#define TclpSysRealloc(ptr, size) realloc((char *)(ptr), (size_t)(size))
|
||||
|
||||
/*
|
||||
*---------------------------------------------------------------------------
|
||||
* The following macros and declaration wrap the C runtime library functions.
|
||||
*---------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#define TclpExit exit
|
||||
|
||||
#ifdef TCL_THREADS
|
||||
# include <pthread.h>
|
||||
#endif /* TCL_THREADS */
|
||||
|
||||
/* FIXME - Hyper-enormous platform assumption! */
|
||||
#ifndef AF_INET6
|
||||
# define AF_INET6 10
|
||||
#endif
|
||||
|
||||
/*
|
||||
*---------------------------------------------------------------------------
|
||||
* Set of MT-safe implementations of some known-to-be-MT-unsafe library calls.
|
||||
* Instead of returning pointers to the static storage, those return pointers
|
||||
* to the TSD data.
|
||||
*---------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#include <pwd.h>
|
||||
#include <grp.h>
|
||||
|
||||
extern struct passwd * TclpGetPwNam(const char *name);
|
||||
extern struct group * TclpGetGrNam(const char *name);
|
||||
extern struct passwd * TclpGetPwUid(uid_t uid);
|
||||
extern struct group * TclpGetGrGid(gid_t gid);
|
||||
extern struct hostent * TclpGetHostByName(const char *name);
|
||||
extern struct hostent * TclpGetHostByAddr(const char *addr,
|
||||
int length, int type);
|
||||
extern void *TclpMakeTcpClientChannelMode(
|
||||
void *tcpSocket, int mode);
|
||||
|
||||
#endif /* _TCLUNIXPORT */
|
||||
|
||||
/*
|
||||
* Local Variables:
|
||||
* mode: c
|
||||
* c-basic-offset: 4
|
||||
* fill-column: 78
|
||||
* End:
|
||||
*/
|
||||
@@ -0,0 +1,582 @@
|
||||
/*
|
||||
* tclWinPort.h --
|
||||
*
|
||||
* This header file handles porting issues that occur because of
|
||||
* differences between Windows and Unix. It should be the only
|
||||
* file that contains #ifdefs to handle different flavors of OS.
|
||||
*
|
||||
* Copyright (c) 1994-1997 Sun Microsystems, Inc.
|
||||
*
|
||||
* See the file "license.terms" for information on usage and redistribution
|
||||
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
*/
|
||||
|
||||
#ifndef _TCLWINPORT
|
||||
#define _TCLWINPORT
|
||||
|
||||
#if !defined(_WIN64) && !defined(__MINGW_USE_VC2005_COMPAT)
|
||||
/* See [Bug 3354324]: file mtime sets wrong time */
|
||||
# define __MINGW_USE_VC2005_COMPAT
|
||||
#endif
|
||||
|
||||
/*
|
||||
* We must specify the lower version we intend to support.
|
||||
*
|
||||
* WINVER = 0x0501 means Windows XP and above
|
||||
*/
|
||||
|
||||
#ifndef WINVER
|
||||
# define WINVER 0x0501
|
||||
#endif
|
||||
#ifndef _WIN32_WINNT
|
||||
# define _WIN32_WINNT 0x0501
|
||||
#endif
|
||||
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
#undef WIN32_LEAN_AND_MEAN
|
||||
|
||||
/* Compatibility to older visual studio / windows platform SDK */
|
||||
#if !defined(MAXULONG_PTR)
|
||||
typedef DWORD DWORD_PTR;
|
||||
typedef DWORD_PTR * PDWORD_PTR;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Ask for the winsock function typedefs, also.
|
||||
*/
|
||||
#ifndef INCL_WINSOCK_API_TYPEDEFS
|
||||
# define INCL_WINSOCK_API_TYPEDEFS 1
|
||||
#endif
|
||||
#include <winsock2.h>
|
||||
#include <ws2tcpip.h>
|
||||
#ifdef HAVE_WSPIAPI_H
|
||||
# include <wspiapi.h>
|
||||
#endif
|
||||
|
||||
#ifdef CHECK_UNICODE_CALLS
|
||||
# define _UNICODE
|
||||
# define UNICODE
|
||||
# define __TCHAR_DEFINED
|
||||
typedef float *_TCHAR;
|
||||
# define _TCHAR_DEFINED
|
||||
typedef float *TCHAR;
|
||||
#endif /* CHECK_UNICODE_CALLS */
|
||||
|
||||
/*
|
||||
* Pull in the typedef of TCHAR for windows.
|
||||
*/
|
||||
#include <tchar.h>
|
||||
#ifndef _TCHAR_DEFINED
|
||||
/* Borland seems to forget to set this. */
|
||||
typedef _TCHAR TCHAR;
|
||||
# define _TCHAR_DEFINED
|
||||
#endif
|
||||
#if defined(_MSC_VER) && defined(__STDC__)
|
||||
/* VS2005 SP1 misses this. See [Bug #3110161] */
|
||||
typedef _TCHAR TCHAR;
|
||||
#endif
|
||||
|
||||
/*
|
||||
*---------------------------------------------------------------------------
|
||||
* The following sets of #includes and #ifdefs are required to get Tcl to
|
||||
* compile under the windows compilers.
|
||||
*---------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#include <time.h>
|
||||
#include <wchar.h>
|
||||
#include <io.h>
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <float.h>
|
||||
#include <malloc.h>
|
||||
#include <process.h>
|
||||
#include <signal.h>
|
||||
#ifdef HAVE_INTTYPES_H
|
||||
# include <inttypes.h>
|
||||
#endif
|
||||
#include <limits.h>
|
||||
|
||||
#ifndef __GNUC__
|
||||
# define strncasecmp _strnicmp
|
||||
# define strcasecmp _stricmp
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Need to block out these includes for building extensions with MetroWerks
|
||||
* compiler for Win32.
|
||||
*/
|
||||
|
||||
#ifndef __MWERKS__
|
||||
#include <sys/stat.h>
|
||||
#include <sys/timeb.h>
|
||||
# ifdef __BORLANDC__
|
||||
# include <utime.h>
|
||||
# else
|
||||
# include <sys/utime.h>
|
||||
# endif /* __BORLANDC__ */
|
||||
#endif /* __MWERKS__ */
|
||||
|
||||
/*
|
||||
* The following defines redefine the Windows Socket errors as
|
||||
* BSD errors so Tcl_PosixError can do the right thing.
|
||||
*/
|
||||
|
||||
#ifndef ENOTEMPTY
|
||||
# define ENOTEMPTY 41 /* Directory not empty */
|
||||
#endif
|
||||
#ifndef EREMOTE
|
||||
# define EREMOTE 66 /* The object is remote */
|
||||
#endif
|
||||
#ifndef EPFNOSUPPORT
|
||||
# define EPFNOSUPPORT 96 /* Protocol family not supported */
|
||||
#endif
|
||||
#ifndef EADDRINUSE
|
||||
# define EADDRINUSE 100 /* Address already in use */
|
||||
#endif
|
||||
#ifndef EADDRNOTAVAIL
|
||||
# define EADDRNOTAVAIL 101 /* Can't assign requested address */
|
||||
#endif
|
||||
#ifndef EAFNOSUPPORT
|
||||
# define EAFNOSUPPORT 102 /* Address family not supported */
|
||||
#endif
|
||||
#ifndef EALREADY
|
||||
# define EALREADY 103 /* Operation already in progress */
|
||||
#endif
|
||||
#ifndef EBADMSG
|
||||
# define EBADMSG 104 /* Not a data message */
|
||||
#endif
|
||||
#ifndef ECANCELED
|
||||
# define ECANCELED 105 /* Canceled */
|
||||
#endif
|
||||
#ifndef ECONNABORTED
|
||||
# define ECONNABORTED 106 /* Software caused connection abort */
|
||||
#endif
|
||||
#ifndef ECONNREFUSED
|
||||
# define ECONNREFUSED 107 /* Connection refused */
|
||||
#endif
|
||||
#ifndef ECONNRESET
|
||||
# define ECONNRESET 108 /* Connection reset by peer */
|
||||
#endif
|
||||
#ifndef EDESTADDRREQ
|
||||
# define EDESTADDRREQ 109 /* Destination address required */
|
||||
#endif
|
||||
#ifndef EHOSTUNREACH
|
||||
# define EHOSTUNREACH 110 /* No route to host */
|
||||
#endif
|
||||
#ifndef EIDRM
|
||||
# define EIDRM 111 /* Identifier removed */
|
||||
#endif
|
||||
#ifndef EINPROGRESS
|
||||
# define EINPROGRESS 112 /* Operation now in progress */
|
||||
#endif
|
||||
#ifndef EISCONN
|
||||
# define EISCONN 113 /* Socket is already connected */
|
||||
#endif
|
||||
#ifndef ELOOP
|
||||
# define ELOOP 114 /* Symbolic link loop */
|
||||
#endif
|
||||
#ifndef EMSGSIZE
|
||||
# define EMSGSIZE 115 /* Message too long */
|
||||
#endif
|
||||
#ifndef ENETDOWN
|
||||
# define ENETDOWN 116 /* Network is down */
|
||||
#endif
|
||||
#ifndef ENETRESET
|
||||
# define ENETRESET 117 /* Network dropped connection on reset */
|
||||
#endif
|
||||
#ifndef ENETUNREACH
|
||||
# define ENETUNREACH 118 /* Network is unreachable */
|
||||
#endif
|
||||
#ifndef ENOBUFS
|
||||
# define ENOBUFS 119 /* No buffer space available */
|
||||
#endif
|
||||
#ifndef ENODATA
|
||||
# define ENODATA 120 /* No data available */
|
||||
#endif
|
||||
#ifndef ENOLINK
|
||||
# define ENOLINK 121 /* Link has be severed */
|
||||
#endif
|
||||
#ifndef ENOMSG
|
||||
# define ENOMSG 122 /* No message of desired type */
|
||||
#endif
|
||||
#ifndef ENOPROTOOPT
|
||||
# define ENOPROTOOPT 123 /* Protocol not available */
|
||||
#endif
|
||||
#ifndef ENOSR
|
||||
# define ENOSR 124 /* Out of stream resources */
|
||||
#endif
|
||||
#ifndef ENOSTR
|
||||
# define ENOSTR 125 /* Not a stream device */
|
||||
#endif
|
||||
#ifndef ENOTCONN
|
||||
# define ENOTCONN 126 /* Socket is not connected */
|
||||
#endif
|
||||
#ifndef ENOTRECOVERABLE
|
||||
# define ENOTRECOVERABLE 127 /* Not recoverable */
|
||||
#endif
|
||||
#ifndef ENOTSOCK
|
||||
# define ENOTSOCK 128 /* Socket operation on non-socket */
|
||||
#endif
|
||||
#ifndef ENOTSUP
|
||||
# define ENOTSUP 129 /* Operation not supported */
|
||||
#endif
|
||||
#ifndef EOPNOTSUPP
|
||||
# define EOPNOTSUPP 130 /* Operation not supported on socket */
|
||||
#endif
|
||||
#ifndef EOTHER
|
||||
# define EOTHER 131 /* Other error */
|
||||
#endif
|
||||
#ifndef EOVERFLOW
|
||||
# define EOVERFLOW 132 /* File too big */
|
||||
#endif
|
||||
#ifndef EOWNERDEAD
|
||||
# define EOWNERDEAD 133 /* Owner dead */
|
||||
#endif
|
||||
#ifndef EPROTO
|
||||
# define EPROTO 134 /* Protocol error */
|
||||
#endif
|
||||
#ifndef EPROTONOSUPPORT
|
||||
# define EPROTONOSUPPORT 135 /* Protocol not supported */
|
||||
#endif
|
||||
#ifndef EPROTOTYPE
|
||||
# define EPROTOTYPE 136 /* Protocol wrong type for socket */
|
||||
#endif
|
||||
#ifndef ETIME
|
||||
# define ETIME 137 /* Timer expired */
|
||||
#endif
|
||||
#ifndef ETIMEDOUT
|
||||
# define ETIMEDOUT 138 /* Connection timed out */
|
||||
#endif
|
||||
#ifndef ETXTBSY
|
||||
# define ETXTBSY 139 /* Text file or pseudo-device busy */
|
||||
#endif
|
||||
#ifndef EWOULDBLOCK
|
||||
# define EWOULDBLOCK 140 /* Operation would block */
|
||||
#endif
|
||||
|
||||
|
||||
/* Visual Studio doesn't have these, so just choose some high numbers */
|
||||
#ifndef ESOCKTNOSUPPORT
|
||||
# define ESOCKTNOSUPPORT 240 /* Socket type not supported */
|
||||
#endif
|
||||
#ifndef ESHUTDOWN
|
||||
# define ESHUTDOWN 241 /* Can't send after socket shutdown */
|
||||
#endif
|
||||
#ifndef ETOOMANYREFS
|
||||
# define ETOOMANYREFS 242 /* Too many references: can't splice */
|
||||
#endif
|
||||
#ifndef EHOSTDOWN
|
||||
# define EHOSTDOWN 243 /* Host is down */
|
||||
#endif
|
||||
#ifndef EUSERS
|
||||
# define EUSERS 244 /* Too many users (for UFS) */
|
||||
#endif
|
||||
#ifndef EDQUOT
|
||||
# define EDQUOT 245 /* Disc quota exceeded */
|
||||
#endif
|
||||
#ifndef ESTALE
|
||||
# define ESTALE 246 /* Stale NFS file handle */
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Signals not known to the standard ANSI signal.h. These are used
|
||||
* by Tcl_WaitPid() and generic/tclPosixStr.c
|
||||
*/
|
||||
|
||||
#ifndef SIGTRAP
|
||||
# define SIGTRAP 5
|
||||
#endif
|
||||
#ifndef SIGBUS
|
||||
# define SIGBUS 10
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Supply definitions for macros to query wait status, if not already
|
||||
* defined in header files above.
|
||||
*/
|
||||
|
||||
#ifdef TCL_UNION_WAIT
|
||||
# define WAIT_STATUS_TYPE union wait
|
||||
#else
|
||||
# define WAIT_STATUS_TYPE int
|
||||
#endif /* TCL_UNION_WAIT */
|
||||
|
||||
#ifndef WIFEXITED
|
||||
# define WIFEXITED(stat) (((*((int *) &(stat))) & 0xC0000000) == 0)
|
||||
#endif
|
||||
|
||||
#ifndef WEXITSTATUS
|
||||
# define WEXITSTATUS(stat) (*((int *) &(stat)))
|
||||
#endif
|
||||
|
||||
#ifndef WIFSIGNALED
|
||||
# define WIFSIGNALED(stat) ((*((int *) &(stat))) & 0xC0000000)
|
||||
#endif
|
||||
|
||||
#ifndef WTERMSIG
|
||||
# define WTERMSIG(stat) ((*((int *) &(stat))) & 0x7F)
|
||||
#endif
|
||||
|
||||
#ifndef WIFSTOPPED
|
||||
# define WIFSTOPPED(stat) 0
|
||||
#endif
|
||||
|
||||
#ifndef WSTOPSIG
|
||||
# define WSTOPSIG(stat) (((*((int *) &(stat))) >> 8) & 0xFF)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Define constants for waitpid() system call if they aren't defined
|
||||
* by a system header file.
|
||||
*/
|
||||
|
||||
#ifndef WNOHANG
|
||||
# define WNOHANG 1
|
||||
#endif
|
||||
#ifndef WUNTRACED
|
||||
# define WUNTRACED 2
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Define access mode constants if they aren't already defined.
|
||||
*/
|
||||
|
||||
#ifndef F_OK
|
||||
# define F_OK 00
|
||||
#endif
|
||||
#ifndef X_OK
|
||||
# define X_OK 01
|
||||
#endif
|
||||
#ifndef W_OK
|
||||
# define W_OK 02
|
||||
#endif
|
||||
#ifndef R_OK
|
||||
# define R_OK 04
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Define macros to query file type bits, if they're not already
|
||||
* defined.
|
||||
*/
|
||||
|
||||
#ifndef S_IFLNK
|
||||
# define S_IFLNK 0120000 /* Symbolic Link */
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Windows compilers do not define S_IFBLK. However, Tcl uses it in
|
||||
* GetTypeFromMode to identify blockSpecial devices based on the
|
||||
* value in the statsbuf st_mode field. We have no other way to pass this
|
||||
* from NativeStat on Windows so are forced to define it here.
|
||||
* The definition here is essentially what is seen on Linux and MingW.
|
||||
* XXX - the root problem is Tcl using Unix definitions instead of
|
||||
* abstracting the structure into a platform independent one. Sigh - perhaps
|
||||
* Tcl 9
|
||||
*/
|
||||
#ifndef S_IFBLK
|
||||
# define S_IFBLK (S_IFDIR | S_IFCHR)
|
||||
#endif
|
||||
|
||||
#ifndef S_ISREG
|
||||
# ifdef S_IFREG
|
||||
# define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
|
||||
# else
|
||||
# define S_ISREG(m) 0
|
||||
# endif
|
||||
#endif /* !S_ISREG */
|
||||
#ifndef S_ISDIR
|
||||
# ifdef S_IFDIR
|
||||
# define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
|
||||
# else
|
||||
# define S_ISDIR(m) 0
|
||||
# endif
|
||||
#endif /* !S_ISDIR */
|
||||
#ifndef S_ISCHR
|
||||
# ifdef S_IFCHR
|
||||
# define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR)
|
||||
# else
|
||||
# define S_ISCHR(m) 0
|
||||
# endif
|
||||
#endif /* !S_ISCHR */
|
||||
#ifndef S_ISBLK
|
||||
# ifdef S_IFBLK
|
||||
# define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK)
|
||||
# else
|
||||
# define S_ISBLK(m) 0
|
||||
# endif
|
||||
#endif /* !S_ISBLK */
|
||||
#ifndef S_ISFIFO
|
||||
# ifdef S_IFIFO
|
||||
# define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO)
|
||||
# else
|
||||
# define S_ISFIFO(m) 0
|
||||
# endif
|
||||
#endif /* !S_ISFIFO */
|
||||
#ifndef S_ISLNK
|
||||
# ifdef S_IFLNK
|
||||
# define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK)
|
||||
# else
|
||||
# define S_ISLNK(m) 0
|
||||
# endif
|
||||
#endif /* !S_ISLNK */
|
||||
|
||||
|
||||
/*
|
||||
* Define MAXPATHLEN in terms of MAXPATH if available
|
||||
*/
|
||||
|
||||
#ifndef MAXPATH
|
||||
# define MAXPATH MAX_PATH
|
||||
#endif /* MAXPATH */
|
||||
|
||||
#ifndef MAXPATHLEN
|
||||
# define MAXPATHLEN MAXPATH
|
||||
#endif /* MAXPATHLEN */
|
||||
|
||||
/*
|
||||
* Define pid_t and uid_t if they're not already defined.
|
||||
*/
|
||||
|
||||
#if !defined(TCL_PID_T)
|
||||
# define pid_t int
|
||||
#endif /* !TCL_PID_T */
|
||||
#if !defined(TCL_UID_T)
|
||||
# define uid_t int
|
||||
#endif /* !TCL_UID_T */
|
||||
|
||||
/*
|
||||
* Visual C++ has some odd names for common functions, so we need to
|
||||
* define a few macros to handle them. Also, it defines EDEADLOCK and
|
||||
* EDEADLK as the same value, which confuses Tcl_ErrnoId().
|
||||
*/
|
||||
|
||||
#if defined(_MSC_VER) || defined(__MSVCRT__)
|
||||
# define environ _environ
|
||||
# if defined(_MSC_VER) && (_MSC_VER < 1600)
|
||||
# define hypot _hypot
|
||||
# endif
|
||||
# define exception _exception
|
||||
# undef EDEADLOCK
|
||||
# if defined(_MSC_VER) && (_MSC_VER >= 1700)
|
||||
# define timezone _timezone
|
||||
# endif
|
||||
#endif /* _MSC_VER || __MSVCRT__ */
|
||||
|
||||
/*
|
||||
* Borland's timezone and environ functions.
|
||||
*/
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
# define timezone _timezone
|
||||
# define environ _environ
|
||||
#endif /* __BORLANDC__ */
|
||||
|
||||
#ifdef __WATCOMC__
|
||||
# if !defined(__CHAR_SIGNED__)
|
||||
# error "You must use the -j switch to ensure char is signed."
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* MSVC 8.0 started to mark many standard C library functions depreciated
|
||||
* including the *printf family and others. Tell it to shut up.
|
||||
* (_MSC_VER is 1200 for VC6, 1300 or 1310 for vc7.net, 1400 for 8.0)
|
||||
*/
|
||||
#if defined(_MSC_VER)
|
||||
# pragma warning(disable:4090) /* see: https://developercommunity.visualstudio.com/t/c-compiler-incorrect-propagation-of-const-qualifie/390711 */
|
||||
# pragma warning(disable:4146)
|
||||
# pragma warning(disable:4244)
|
||||
# if _MSC_VER >= 1400
|
||||
# pragma warning(disable:4267)
|
||||
# pragma warning(disable:4996)
|
||||
# endif
|
||||
#endif
|
||||
/*
|
||||
*---------------------------------------------------------------------------
|
||||
* The following macros and declarations represent the interface between
|
||||
* generic and windows-specific parts of Tcl. Some of the macros may
|
||||
* override functions declared in tclInt.h.
|
||||
*---------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/*
|
||||
* The default platform eol translation on Windows is TCL_TRANSLATE_CRLF:
|
||||
*/
|
||||
|
||||
#define TCL_PLATFORM_TRANSLATION TCL_TRANSLATE_CRLF
|
||||
|
||||
/*
|
||||
* Declare dynamic loading extension macro.
|
||||
*/
|
||||
|
||||
#define TCL_SHLIB_EXT ".dll"
|
||||
|
||||
/*
|
||||
* The following define ensures that we use the native putenv
|
||||
* implementation to modify the environment array. This keeps
|
||||
* the C level environment in synch with the system level environment.
|
||||
*/
|
||||
|
||||
#define USE_PUTENV 1
|
||||
#define USE_PUTENV_FOR_UNSET 1
|
||||
|
||||
/*
|
||||
* Msvcrt's putenv() copies the string rather than takes ownership of it.
|
||||
*/
|
||||
|
||||
#if defined(_MSC_VER) || defined(__MSVCRT__)
|
||||
# define HAVE_PUTENV_THAT_COPIES 1
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Older version of Mingw are known to lack a MWMO_ALERTABLE define.
|
||||
*/
|
||||
#if !defined(MWMO_ALERTABLE)
|
||||
# define MWMO_ALERTABLE 2
|
||||
#endif
|
||||
|
||||
/*
|
||||
* The following defines wrap the system memory allocation routines for
|
||||
* use by tclAlloc.c.
|
||||
*/
|
||||
|
||||
#define TclpSysAlloc(size, isBin) ((void*)HeapAlloc(GetProcessHeap(), \
|
||||
(DWORD)0, (DWORD)size))
|
||||
#define TclpSysFree(ptr) (HeapFree(GetProcessHeap(), \
|
||||
(DWORD)0, (HGLOBAL)ptr))
|
||||
#define TclpSysRealloc(ptr, size) ((void*)HeapReAlloc(GetProcessHeap(), \
|
||||
(DWORD)0, (LPVOID)ptr, (DWORD)size))
|
||||
|
||||
/* This type is not defined in the Windows headers */
|
||||
#define socklen_t int
|
||||
|
||||
|
||||
/*
|
||||
* The following macros have trivial definitions, allowing generic code to
|
||||
* address platform-specific issues.
|
||||
*/
|
||||
|
||||
#define TclpReleaseFile(file) ckfree((char *) file)
|
||||
|
||||
/*
|
||||
* The following macros and declarations wrap the C runtime library
|
||||
* functions.
|
||||
*/
|
||||
|
||||
#define TclpExit exit
|
||||
|
||||
#ifndef INVALID_SET_FILE_POINTER
|
||||
#define INVALID_SET_FILE_POINTER 0xFFFFFFFF
|
||||
#endif /* INVALID_SET_FILE_POINTER */
|
||||
|
||||
#ifndef LABEL_SECURITY_INFORMATION
|
||||
# define LABEL_SECURITY_INFORMATION (0x00000010L)
|
||||
#endif
|
||||
|
||||
#define Tcl_DirEntry void
|
||||
#define TclDIR void
|
||||
|
||||
#endif /* _TCLWINPORT */
|
||||
Submodule
+1
Submodule itcl/itcl added at 33cea588fa
@@ -0,0 +1,3 @@
|
||||
PATCH
|
||||
TCL
|
||||
|
||||
+145
@@ -0,0 +1,145 @@
|
||||
diff -Naur itcl/generic/itcl_cmds.c ITCL_BLD/generic/itcl_cmds.c
|
||||
--- itcl/generic/itcl_cmds.c 2024-08-06 13:13:08.429776852 -0400
|
||||
+++ ITCL_BLD/generic/itcl_cmds.c 2024-08-06 13:12:35.230286310 -0400
|
||||
@@ -53,9 +53,6 @@
|
||||
if {[info exists library]} {\n\
|
||||
lappend dirs $library\n\
|
||||
} else {\n\
|
||||
- if {[catch {uplevel #0 source -rsrc itcl}] == 0} {\n\
|
||||
- return\n\
|
||||
- }\n\
|
||||
set dirs {}\n\
|
||||
if {[info exists env(ITCL_LIBRARY)]} {\n\
|
||||
lappend dirs $env(ITCL_LIBRARY)\n\
|
||||
@@ -866,7 +863,7 @@
|
||||
int objc; /* number of arguments */
|
||||
Tcl_Obj *CONST objv[]; /* argument objects */
|
||||
{
|
||||
- int pLevel = (int)clientData;
|
||||
+ int pLevel = (int)(size_t)clientData;
|
||||
|
||||
int result;
|
||||
int oldLevel;
|
||||
@@ -1145,7 +1142,7 @@
|
||||
if (!entry) {
|
||||
Tcl_AppendResult(interp,
|
||||
"can't scope variable \"", token,
|
||||
- "\": missing object context\"",
|
||||
+ "\": missing object context",
|
||||
(char*)NULL);
|
||||
result = TCL_ERROR;
|
||||
goto scopeCmdDone;
|
||||
diff -Naur itcl/generic/itclInt.decls ITCL_BLD/generic/itclInt.decls
|
||||
--- itcl/generic/itclInt.decls 2024-08-06 13:13:08.429776852 -0400
|
||||
+++ ITCL_BLD/generic/itclInt.decls 2024-08-06 13:12:35.230286310 -0400
|
||||
@@ -252,7 +252,7 @@
|
||||
CONST char* arglist, CONST char* body, ItclMemberCode** mcodePtr)
|
||||
}
|
||||
declare 58 generic {
|
||||
- void Itcl_DeleteMemberCode (CONST char* cdata)
|
||||
+ void Itcl_DeleteMemberCode (char* cdata)
|
||||
}
|
||||
declare 59 generic {
|
||||
int Itcl_GetMemberCode (Tcl_Interp* interp, ItclMember* member)
|
||||
diff -Naur itcl/generic/itclIntDecls.h ITCL_BLD/generic/itclIntDecls.h
|
||||
--- itcl/generic/itclIntDecls.h 2024-08-06 13:13:08.429776852 -0400
|
||||
+++ ITCL_BLD/generic/itclIntDecls.h 2024-08-06 13:12:35.230286310 -0400
|
||||
@@ -410,7 +410,7 @@
|
||||
#ifndef Itcl_DeleteMemberCode_TCL_DECLARED
|
||||
#define Itcl_DeleteMemberCode_TCL_DECLARED
|
||||
/* 58 */
|
||||
-TCL_EXTERN(void) Itcl_DeleteMemberCode _ANSI_ARGS_((CONST char* cdata));
|
||||
+TCL_EXTERN(void) Itcl_DeleteMemberCode _ANSI_ARGS_((char* cdata));
|
||||
#endif
|
||||
#ifndef Itcl_GetMemberCode_TCL_DECLARED
|
||||
#define Itcl_GetMemberCode_TCL_DECLARED
|
||||
@@ -853,7 +853,7 @@
|
||||
int (*itcl_ChangeMemberFunc) _ANSI_ARGS_((Tcl_Interp* interp, ItclMemberFunc* mfunc, CONST char* arglist, CONST char* body)); /* 55 */
|
||||
void (*itcl_DeleteMemberFunc) _ANSI_ARGS_((CONST char* cdata)); /* 56 */
|
||||
int (*itcl_CreateMemberCode) _ANSI_ARGS_((Tcl_Interp* interp, ItclClass * cdefn, CONST char* arglist, CONST char* body, ItclMemberCode** mcodePtr)); /* 57 */
|
||||
- void (*itcl_DeleteMemberCode) _ANSI_ARGS_((CONST char* cdata)); /* 58 */
|
||||
+ void (*itcl_DeleteMemberCode) _ANSI_ARGS_((char* cdata)); /* 58 */
|
||||
int (*itcl_GetMemberCode) _ANSI_ARGS_((Tcl_Interp* interp, ItclMember* member)); /* 59 */
|
||||
void *reserved60;
|
||||
int (*itcl_EvalMemberCode) _ANSI_ARGS_((Tcl_Interp * interp, ItclMemberFunc * mfunc, ItclMember * member, ItclObject * contextObj, int objc, Tcl_Obj *CONST objv[])); /* 61 */
|
||||
diff -Naur itcl/generic/itcl_methods.c ITCL_BLD/generic/itcl_methods.c
|
||||
--- itcl/generic/itcl_methods.c 2024-08-06 13:13:08.429776852 -0400
|
||||
+++ ITCL_BLD/generic/itcl_methods.c 2024-08-06 13:12:35.230286310 -0400
|
||||
@@ -731,8 +731,7 @@
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
void
|
||||
-Itcl_DeleteMemberCode(cdata)
|
||||
- CONST char* cdata; /* pointer to member function definition */
|
||||
+Itcl_DeleteMemberCode(char *cdata)
|
||||
{
|
||||
ItclMemberCode* mcode = (ItclMemberCode*)cdata;
|
||||
|
||||
@@ -1156,7 +1155,7 @@
|
||||
nameLen = strlen(name);
|
||||
|
||||
localPtr = (CompiledLocal*)ckalloc(
|
||||
- (unsigned)(sizeof(CompiledLocal)-sizeof(localPtr->name) + nameLen+1)
|
||||
+ TclOffset(CompiledLocal, name) + nameLen+1
|
||||
);
|
||||
|
||||
localPtr->nextPtr = NULL;
|
||||
diff -Naur itcl/win/itcl.rc ITCL_BLD/win/itcl.rc
|
||||
--- itcl/win/itcl.rc 1969-12-31 19:00:00.000000000 -0500
|
||||
+++ ITCL_BLD/win/itcl.rc 2024-08-06 13:12:35.230286310 -0400
|
||||
@@ -0,0 +1,55 @@
|
||||
+//
|
||||
+// Version resource script.
|
||||
+//
|
||||
+
|
||||
+#include <winver.h>
|
||||
+#include <itcl.h>
|
||||
+
|
||||
+//
|
||||
+// build-up the name suffix that defines the type of build this is.
|
||||
+//
|
||||
+#if DEBUG && !UNCHECKED
|
||||
+#define SUFFIX_DEBUG "g"
|
||||
+#else
|
||||
+#define SUFFIX_DEBUG ""
|
||||
+#endif
|
||||
+
|
||||
+#define SUFFIX SUFFIX_DEBUG
|
||||
+
|
||||
+
|
||||
+VS_VERSION_INFO VERSIONINFO
|
||||
+ FILEVERSION ITCL_MAJOR_VERSION,ITCL_MINOR_VERSION,ITCL_RELEASE_LEVEL,ITCL_RELEASE_SERIAL
|
||||
+ PRODUCTVERSION ITCL_MAJOR_VERSION,ITCL_MINOR_VERSION,ITCL_RELEASE_LEVEL,ITCL_RELEASE_SERIAL
|
||||
+ FILEFLAGSMASK 0x3fL
|
||||
+#ifdef DEBUG
|
||||
+ FILEFLAGS VS_FF_DEBUG
|
||||
+#else
|
||||
+ FILEFLAGS 0x0L
|
||||
+#endif
|
||||
+ FILEOS VOS__WINDOWS32
|
||||
+ FILETYPE VFT_DLL
|
||||
+ FILESUBTYPE 0x0L
|
||||
+BEGIN
|
||||
+ BLOCK "StringFileInfo"
|
||||
+ BEGIN
|
||||
+ BLOCK "040904b0"
|
||||
+ BEGIN
|
||||
+ VALUE "FileDescription", "Itcl language extension for Tcl\0"
|
||||
+ VALUE "Authors", "Michael McLennan\0"
|
||||
+ VALUE "OriginalFilename", "itcl" STRINGIFY(ITCL_MAJOR_VERSION) STRINGIFY(ITCL_MINOR_VERSION) SUFFIX ".dll\0"
|
||||
+ VALUE "CompanyName", "Bell Labs Innovations for Lucent Technologies\0"
|
||||
+ VALUE "FileVersion", ITCL_PATCH_LEVEL
|
||||
+ VALUE "LegalCopyright", "Copyright \251 1993-2004\0"
|
||||
+ VALUE "ProductName", "[Incr Tcl] " ITCL_VERSION " for Windows\0"
|
||||
+ VALUE "ProductVersion", ITCL_PATCH_LEVEL
|
||||
+ END
|
||||
+ END
|
||||
+ BLOCK "VarFileInfo"
|
||||
+ BEGIN
|
||||
+ VALUE "Translation", 0x409, 1200
|
||||
+ END
|
||||
+END
|
||||
+
|
||||
+
|
||||
+
|
||||
+
|
||||
+79
-84
@@ -1,119 +1,114 @@
|
||||
# Itk uses private Tcl and Itcl interfaces plus Tk stubs. Build it only as
|
||||
# part of bext's internally consistent Tcl/Tk stack; system Tcl/Tk must supply
|
||||
# Itk.
|
||||
# Unfortunately, there does not appear to be a reliable way to test for the
|
||||
# presence of the Itk package on a system Tcl/Tk. We key off of the presence
|
||||
# of the TK_BLD and ITCL_BLD targets, but that may produce a false negative if
|
||||
# those builds are both off but we still need Itk. As far as I can tell the
|
||||
# "package require Itk" test (which is what is required to properly test for an
|
||||
# available Itk package) can ONLY be performed successfully on a system that
|
||||
# supports creation of a graphics window. Window creation isn't typically
|
||||
# available on continuous integration runners, which means the test will always
|
||||
# fail there even when it shouldn't.
|
||||
|
||||
# We try to find the itk library, since that's the only test we can do without
|
||||
# needing the graphical invocation. Unfortunately, even a find_library search
|
||||
# looking for libitk isn't completely reliable, since the presence of a shared
|
||||
# library is not a guarantee it is correctly hooked into the "package require"
|
||||
# mechanism of the system Tcl/Tk we want to use. (It is possible to have more
|
||||
# than one Tcl/Tk on a system - this situation is known to have occurred on the
|
||||
# Mac when 3rd party package managers are used, for example.)
|
||||
|
||||
# Hopefully situations where a user has a complex Itcl/Itk setup are rare
|
||||
# enough that it won't be a significant issue, since there appears to be
|
||||
# only so much we can do to sort it out...
|
||||
|
||||
if (USE_BRLCAD)
|
||||
|
||||
cad_enable(ITK "${BEXT_TK_COMPONENTS}")
|
||||
# Decide if we're using Itk
|
||||
cad_enable(ITK "archer;mged;bwish;rtwizard;brlman")
|
||||
|
||||
else (USE_BRLCAD)
|
||||
|
||||
bext_enable_all_default(ITK itk)
|
||||
if (ENABLE_ITCL AND NOT DEFINED ENABLE_ITK AND NOT DISABLE_TCL)
|
||||
set(ENABLE_ITK ON)
|
||||
endif (ENABLE_ITCL AND NOT DEFINED ENABLE_ITK AND NOT DISABLE_TCL)
|
||||
|
||||
endif (USE_BRLCAD)
|
||||
|
||||
if (TARGET TK_BLD AND NOT DEFINED ENABLE_ITK AND NOT DISABLE_ITK)
|
||||
set(ENABLE_ITK ON)
|
||||
endif ()
|
||||
if (NOT ENABLE_ITK AND NOT DISABLE_ITCL AND NOT DISABLE_TCL)
|
||||
find_library(ITK_SYS_LIBRARY NAMES itk3)
|
||||
|
||||
if (NOT ITK_SYS_LIBRARY AND NOT DEFINED ENABLE_ITK)
|
||||
set(ENABLE_ITK "ON" CACHE BOOL "Enable itk build")
|
||||
endif (NOT ITK_SYS_LIBRARY AND NOT DEFINED ENABLE_ITK)
|
||||
|
||||
endif (NOT ENABLE_ITK AND NOT DISABLE_ITCL AND NOT DISABLE_TCL)
|
||||
set(ENABLE_ITK "${ENABLE_ITK}" CACHE BOOL "Enable itk build")
|
||||
|
||||
if (ENABLE_ITK)
|
||||
|
||||
if (NOT TARGET TCL_BLD OR NOT TARGET TK_BLD)
|
||||
message(FATAL_ERROR
|
||||
"A local Itk build requires bext's bundled Tcl and Tk because Itk uses "
|
||||
"private Tcl and Itcl interfaces. A system Tcl/Tk stack must provide "
|
||||
"Itk ${BEXT_ITK_MIN_VERSION} or newer; otherwise configure with "
|
||||
"-DENABLE_TCL=ON."
|
||||
)
|
||||
endif ()
|
||||
|
||||
git_submodule_init(itk configure)
|
||||
git_submodule_init(itk configure.in)
|
||||
|
||||
RegisterDeps(ITK)
|
||||
|
||||
set(BEXT_ITK_VERSION "${BEXT_ITK_BUNDLED_VERSION}" CACHE INTERNAL "Bundled Itk version" FORCE)
|
||||
set(RPATH_SUFFIX "itk${BEXT_ITK_BUNDLED_VERSION}")
|
||||
set(ITK_SRC_DIR "${CMAKE_CURRENT_BINARY_DIR}/ITK_BLD-prefix/src/ITK_BLD")
|
||||
set(ITK_BIN_DIR "${CMAKE_CURRENT_BINARY_DIR}/ITK_BLD-prefix/src/ITK_BLD-build")
|
||||
# If we're building ITK, it's path setup must take into account the
|
||||
# subdirectory in which we are storing the library.
|
||||
set(RPATH_SUFFIX itk3.4)
|
||||
|
||||
set(WITH_TCL_DIR "${CMAKE_BUNDLE_INSTALL_PREFIX}/${LIB_DIR}")
|
||||
set(WITH_TCL_INCLUDE_DIR "${CMAKE_BUNDLE_INSTALL_PREFIX}/${INCLUDE_DIR}")
|
||||
set(TCL_SRC_DIR "${CMAKE_BINARY_DIR}/tcl/TCL_BLD-prefix/src/TCL_BLD")
|
||||
set(WITH_TK_DIR "${CMAKE_BUNDLE_INSTALL_PREFIX}/${LIB_DIR}")
|
||||
set(WITH_TK_INCLUDE_DIR "${CMAKE_BUNDLE_INSTALL_PREFIX}/${INCLUDE_DIR}")
|
||||
set(TK_SRC_DIR "${CMAKE_BINARY_DIR}/tk/TK_BLD-prefix/src/TK_BLD")
|
||||
set(WITH_ITCL_DIR "${BEXT_ITCL_CONFIG_DIR}")
|
||||
set(ITCL_SRC_DIR "${BEXT_ITCL_SOURCE_DIR}")
|
||||
set(ITK_SRC_CPY_TGT "${CMAKE_CURRENT_BINARY_DIR}/ITK_BLD-prefix/src/ITK_BLD")
|
||||
|
||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/itk_configure.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/itk_configure.cmake @ONLY)
|
||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/itk_build.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/itk_build.cmake @ONLY)
|
||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/itk_install.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/itk_install.cmake @ONLY)
|
||||
|
||||
set(ITK_PATCH_COMMAND
|
||||
${CMAKE_COMMAND}
|
||||
"-DITK_SOURCE_DIR=<SOURCE_DIR>"
|
||||
"-DITK_PATCH_EXECUTABLE=${PATCH_NATIVE_EXECUTABLE}"
|
||||
"-DITK_PATCH_CHECK_OPTION=${PATCH_CHECK_OPTION}"
|
||||
"-DITK_PATCH_REJECT_DIR=${PATCH_REJECT_DIR}"
|
||||
"-DITK_PATCH_FILE=${CMAKE_CURRENT_SOURCE_DIR}/itk.patch"
|
||||
"-DITK_INSTALL_PATCH_FILE=${CMAKE_CURRENT_SOURCE_DIR}/itk_install.patch"
|
||||
-P "${CMAKE_CURRENT_SOURCE_DIR}/itk_apply_patch.cmake"
|
||||
ExternalProject_Add(ITK_BLD
|
||||
URL "${CMAKE_CURRENT_SOURCE_DIR}/itk"
|
||||
BUILD_ALWAYS ${EXT_BUILD_ALWAYS} ${LOG_OPTS}
|
||||
PATCH_COMMAND ${PATCH_EXECUTABLE};-E;-p1;${PATCH_OPTIONS};-i;${CMAKE_CURRENT_SOURCE_DIR}/itk.patch
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory ${ITK_SRC_CPY_TGT}/CMake
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/addfiles/CMakeLists.txt ${ITK_SRC_CPY_TGT}
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/addfiles/FindTCL.cmake ${ITK_SRC_CPY_TGT}/CMake
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/addfiles/FindITCL.cmake ${ITK_SRC_CPY_TGT}/CMake
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory ${ITK_SRC_CPY_TGT}/generic/itcl3
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/addfiles/itclDecls.h ${ITK_SRC_CPY_TGT}/generic/itcl3
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/addfiles/itcl.h ${ITK_SRC_CPY_TGT}/generic/itcl3
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/addfiles/itclIntDecls.h ${ITK_SRC_CPY_TGT}/generic/itcl3
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/addfiles/itclInt.h ${ITK_SRC_CPY_TGT}/generic/itcl3
|
||||
CMAKE_ARGS
|
||||
${BUILD_TYPE_SPECIFIER}
|
||||
-DBIN_DIR=$<IF:$<BOOL:${WIN32}>,${LIB_DIR},${BIN_DIR}>
|
||||
-DLIB_DIR=${LIB_DIR}
|
||||
-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
|
||||
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
|
||||
-DCMAKE_INSTALL_PREFIX=${CMAKE_BUNDLE_INSTALL_PREFIX}
|
||||
-DCMAKE_INSTALL_RPATH=${CMAKE_BUNDLE_INSTALL_PREFIX}/${LIB_DIR}/${RPATH_SUFFIX}
|
||||
-DINCLUDE_DIR=${INCLUDE_DIR}
|
||||
-DITCL_ROOT=$<$<BOOL:${ITCL_TARGET}>:${CMAKE_BUNDLE_INSTALL_PREFIX}>
|
||||
-DSHARED_DIR=${LIB_DIR}
|
||||
-DTCL_ENABLE_TK=ON
|
||||
-DTCL_ROOT=$<$<BOOL:${TCL_TARGET}>:${CMAKE_BUNDLE_INSTALL_PREFIX}>
|
||||
-DTCL_SOURCE_DIR=${CMAKE_SOURCE_DIR}/tcl/tcl
|
||||
-DTK_SOURCE_DIR=${CMAKE_SOURCE_DIR}/tk/tk
|
||||
LOG_CONFIGURE ${EXT_BUILD_QUIET}
|
||||
LOG_BUILD ${EXT_BUILD_QUIET}
|
||||
LOG_INSTALL ${EXT_BUILD_QUIET}
|
||||
LOG_OUTPUT_ON_FAILURE ${EXT_BUILD_QUIET}
|
||||
STEP_TARGETS install
|
||||
)
|
||||
|
||||
if (NOT MSVC)
|
||||
ExternalProject_Add(ITK_BLD
|
||||
URL "${CMAKE_CURRENT_SOURCE_DIR}/itk"
|
||||
BUILD_ALWAYS ${EXT_BUILD_ALWAYS} ${LOG_OPTS}
|
||||
PATCH_COMMAND ${ITK_PATCH_COMMAND}
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/manifest.uuid <SOURCE_DIR>/manifest.uuid
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory <SOURCE_DIR>/tclconfig
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${BEXT_ITCL_BUNDLED_SOURCE_DIR}/tclconfig/install-sh <SOURCE_DIR>/tclconfig/install-sh
|
||||
CONFIGURE_COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/itk_configure.cmake
|
||||
BUILD_COMMAND ${BEXT_MAKE_COMMAND} -j${pcnt}
|
||||
INSTALL_COMMAND ${BEXT_MAKE_COMMAND} -j1 INSTALL_OPTIONS=-C install
|
||||
LOG_CONFIGURE ${EXT_BUILD_QUIET}
|
||||
LOG_BUILD ${EXT_BUILD_QUIET}
|
||||
LOG_INSTALL ${EXT_BUILD_QUIET}
|
||||
LOG_OUTPUT_ON_FAILURE ${EXT_BUILD_QUIET}
|
||||
STEP_TARGETS install
|
||||
)
|
||||
else (NOT MSVC)
|
||||
# Itk's rules.vc is newer than Tcl 8.6's, so rules-ext.vc selects the
|
||||
# local nmake support files. Upstream omits the matching targets.vc;
|
||||
# supply the complete file rather than patching one into existence.
|
||||
ExternalProject_Add(ITK_BLD
|
||||
URL "${CMAKE_CURRENT_SOURCE_DIR}/itk"
|
||||
BUILD_ALWAYS ${EXT_BUILD_ALWAYS} ${LOG_OPTS}
|
||||
PATCH_COMMAND ${ITK_PATCH_COMMAND}
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/manifest.uuid <SOURCE_DIR>/manifest.uuid
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/targets.vc <SOURCE_DIR>/win/targets.vc
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory <SOURCE_DIR>/tclconfig
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${BEXT_ITCL_BUNDLED_SOURCE_DIR}/tclconfig/install-sh <SOURCE_DIR>/tclconfig/install-sh
|
||||
CONFIGURE_COMMAND ""
|
||||
BINARY_DIR ${ITK_SRC_DIR}/win
|
||||
BUILD_COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/itk_build.cmake
|
||||
INSTALL_COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/itk_install.cmake
|
||||
LOG_BUILD ${EXT_BUILD_QUIET}
|
||||
LOG_INSTALL ${EXT_BUILD_QUIET}
|
||||
LOG_OUTPUT_ON_FAILURE ${EXT_BUILD_QUIET}
|
||||
STEP_TARGETS install
|
||||
)
|
||||
endif (NOT MSVC)
|
||||
|
||||
TargetInstallDeps(ITK ITK_DEPENDS)
|
||||
|
||||
# Copy the license into position in CMAKE_BUNDLE_INSTALL_PREFIX
|
||||
configure_file(
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/itk/license.terms
|
||||
${DOC_LICENSE_DIR}/itk.txt
|
||||
${DOC_LICENSE_DIR}/itk3.txt
|
||||
COPYONLY
|
||||
)
|
||||
|
||||
endif (ENABLE_ITK)
|
||||
|
||||
mark_as_advanced(ITK_LIBRARY)
|
||||
mark_as_advanced(ITK_LIBRARIES)
|
||||
mark_as_advanced(ITK_VERSION)
|
||||
|
||||
# Local Variables:
|
||||
# tab-width: 8
|
||||
# mode: cmake
|
||||
# indent-tabs-mode: t
|
||||
# End:
|
||||
# ex: shiftwidth=2 tabstop=8
|
||||
|
||||
|
||||
@@ -1,51 +0,0 @@
|
||||
Itk in bext
|
||||
===========
|
||||
|
||||
Tcl 8.6.18 already bundles Itcl 4.3.7, so bext deliberately has no separate
|
||||
Itcl project. Itk is not part of either source distribution, so the bundled
|
||||
stack builds Itk from its own upstream repository after Tcl and Tk. A system
|
||||
Tcl/Tk stack must already provide Itcl and Itk; bext never builds Itk against
|
||||
system Tcl/Tk.
|
||||
|
||||
Itk cannot be built from installed public headers alone. Its implementation
|
||||
includes Tcl's private tclInt.h and Itcl's private itclInt.h and directly uses
|
||||
the corresponding internal structures and entry points. The Itk build must
|
||||
therefore use the private headers and stubs from the exact Tcl/Itcl sources it
|
||||
accompanies. Bext supplies the standard install-sh helper omitted from the Itk
|
||||
repository. On Windows, explicit Tcl, Tk, and Itcl source directories are
|
||||
passed to nmake. On Unix-like platforms, upstream's generated TEA configure
|
||||
logic gets the corresponding source locations from the bundled configuration.
|
||||
|
||||
Upstream's generic Windows TEA install target copies only ``*.tcl`` library
|
||||
files. Itk also needs its ``*.itk`` class definitions and ``tclIndex`` at
|
||||
runtime, so bext extends the nmake install target to copy them and verifies the
|
||||
complete script set before accepting the install.
|
||||
|
||||
Itk itself makes no direct Xlib calls: all of its window-system interaction
|
||||
goes through Tk stubs. Upstream's TEA configuration nevertheless adds the
|
||||
host X library to Itk. Bext suppresses that unnecessary dependency so Itk
|
||||
uses the X implementation selected by its matching Tk build and does not mix
|
||||
two incompatible X ABIs in builds such as the Xmin test configuration.
|
||||
|
||||
Itk's own nominal Itcl 4.1 requirement is not sufficient: its upstream suite
|
||||
has seven failures with Itcl 4.1.0, involving private/protected components and
|
||||
destroyed-component cleanup, while all 100 tests pass with Itcl 4.1.1. Bext
|
||||
therefore retains 4.1.1 as Itk's stub and package-index floor.
|
||||
|
||||
BRL-CAD has a stronger system-stack requirement. With Tcl/Tk 8.6.18, Itcl
|
||||
4.1.1, 4.1.2, and 4.2.3 fail the Tk-first Iwidgets baseline because they lack
|
||||
Itcl 4.3.0's workaround for Tcl 8.6.15's `Tcl_NewObjectInstance` behavior.
|
||||
The complete baseline passes with Itcl 4.3.0 and Itk 4.2.3, so bext requires
|
||||
Itcl 4.3.0 or newer before accepting a system stack.
|
||||
|
||||
System selection is all-or-nothing: Tcl must load Itcl 4.3.0 or newer, and its
|
||||
package path must advertise Itk 4.2.3 or newer before bext accepts the matching
|
||||
system Tk. Itk detection asks Tcl's package handler to index available versions
|
||||
without executing the selected package's load script, enforcing the floor on
|
||||
headless builders without trying to create a Tk window. If either extension is
|
||||
missing or too old, bext selects the complete bundled stack.
|
||||
|
||||
The bundled Itk revision reports version 4.2.7 and includes the upstream August
|
||||
2024 release plus subsequent Windows, Tcl/Tk 9, warning, and TEA maintenance.
|
||||
The complete upstream suite and BRL-CAD GUI baseline pass with the bundled
|
||||
Itcl under Xmin using the Xmin-compatible Tk build.
|
||||
@@ -0,0 +1,280 @@
|
||||
# C M A K E L I S T S . T X T
|
||||
# ITK
|
||||
#
|
||||
# Copyright (c) 2010 United States Government as represented by
|
||||
# the U.S. Army Research Laboratory.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
#
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
#
|
||||
# 2. Redistributions in binary form must reproduce the above
|
||||
# copyright notice, this list of conditions and the following
|
||||
# disclaimer in the documentation and/or other materials provided
|
||||
# with the distribution.
|
||||
#
|
||||
# 3. The name of the author may not be used to endorse or promote
|
||||
# products derived from this software without specific prior written
|
||||
# permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
|
||||
# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
|
||||
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
|
||||
# GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
# *******************************************************************
|
||||
# *** Itk CMakeLists.txt ***
|
||||
# *******************************************************************
|
||||
|
||||
# Minimum required version of CMake
|
||||
cmake_minimum_required(VERSION 3.12)
|
||||
|
||||
# set CMake project name
|
||||
project(ITK)
|
||||
|
||||
# install(CODE) uses generator expressions - requires 3.14 or newer.
|
||||
# We want it to be on, but until we can bump our minimum requirement
|
||||
# set it to OLD to make sure we don't break anything.
|
||||
if (POLICY CMP0087)
|
||||
cmake_policy(SET CMP0087 OLD)
|
||||
endif (POLICY CMP0087)
|
||||
|
||||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMake")
|
||||
|
||||
set(CMAKE_FIND_FRAMEWORK NEVER)
|
||||
find_package(TCL REQUIRED)
|
||||
find_package(ITCL REQUIRED)
|
||||
|
||||
# version numbers
|
||||
set(ITK_VERSION_MAJOR 3)
|
||||
set(ITK_VERSION_MINOR 4)
|
||||
set(ITK_PATCH_LEVEL 2)
|
||||
set(ITK_VERSION "${ITK_VERSION_MAJOR}.${ITK_VERSION_MINOR}")
|
||||
|
||||
#---------------------------------------------------------------------
|
||||
# Initialize some relative variable names
|
||||
if(NOT BIN_DIR)
|
||||
if (WIN32)
|
||||
set(BIN_DIR lib)
|
||||
else (WIN32)
|
||||
set(BIN_DIR bin)
|
||||
endif (WIN32)
|
||||
endif(NOT BIN_DIR)
|
||||
if(NOT SHARED_DIR)
|
||||
set(SHARED_DIR lib)
|
||||
endif(NOT SHARED_DIR)
|
||||
if(NOT LIB_DIR)
|
||||
set(LIB_DIR lib)
|
||||
endif(NOT LIB_DIR)
|
||||
if(NOT INCLUDE_DIR)
|
||||
set(INCLUDE_DIR include)
|
||||
endif(NOT INCLUDE_DIR)
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
# First, get some standard options out of the way
|
||||
add_definitions(-DSTDC_HEADERS=1)
|
||||
|
||||
# We're building Itk
|
||||
add_definitions(-DBUILD_itk)
|
||||
|
||||
# We want to check /usr/local by default, so add it if it exists. (We need
|
||||
# this to find X11 headers on FreeBSD, for example...)
|
||||
if (IS_DIRECTORY /usr/local)
|
||||
set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} /usr/local)
|
||||
if (IS_DIRECTORY /usr/local/include)
|
||||
set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} /usr/local/include)
|
||||
endif (IS_DIRECTORY /usr/local/include)
|
||||
endif (IS_DIRECTORY /usr/local)
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
# We need to enable the threading macros found in tcl.h and tclInt.h.
|
||||
# The use of the threading features is determined by the core the
|
||||
# extension is loaded into, but we need to compile with these macros
|
||||
# turned on.
|
||||
#--------------------------------------------------------------------
|
||||
add_definitions(-DTCL_THREADS=1)
|
||||
|
||||
include(CMakeParseArguments)
|
||||
include(CheckIncludeFiles)
|
||||
include(CheckCSourceCompiles)
|
||||
function(Tcl_Check_Include_File filename)
|
||||
cmake_parse_arguments(OPT "USE" "" "" ${ARGN})
|
||||
string(REPLACE "." "_" var "${filename}")
|
||||
string(REPLACE "/" "_" var "${var}")
|
||||
string(TOUPPER "${var}" var)
|
||||
check_include_files(${filename} HAVE_${var})
|
||||
if(HAVE_${var})
|
||||
set(CVAR HAVE_${var})
|
||||
if(OPT_USE)
|
||||
# Usability test requested - we're not done yet.
|
||||
check_c_source_compiles("#include <${filename}>\nint main() {return 0;}" ${var}_USABLE)
|
||||
if(${var}_USABLE)
|
||||
set(HAVE_${var} 1 PARENT_SCOPE)
|
||||
set(${CVAR} 1 PARENT_SCOPE)
|
||||
add_definitions(-D${CVAR}=1)
|
||||
endif(${var}_USABLE)
|
||||
else(OPT_USE)
|
||||
set(HAVE_${var} 1 PARENT_SCOPE)
|
||||
set(${CVAR} 1 PARENT_SCOPE)
|
||||
add_definitions(-D${CVAR}=1)
|
||||
endif(OPT_USE)
|
||||
endif(HAVE_${var})
|
||||
endfunction(Tcl_Check_Include_File)
|
||||
|
||||
Tcl_Check_Include_File(dlfcn.h USE)
|
||||
Tcl_Check_Include_File(errno.h USE)
|
||||
Tcl_Check_Include_File(float.h USE)
|
||||
Tcl_Check_Include_File(inttypes.h)
|
||||
Tcl_Check_Include_File(limits.h USE)
|
||||
Tcl_Check_Include_File(memory.h)
|
||||
Tcl_Check_Include_File(net/errno.h USE)
|
||||
Tcl_Check_Include_File(stdint.h)
|
||||
Tcl_Check_Include_File(stdlib.h)
|
||||
Tcl_Check_Include_File(string.h)
|
||||
Tcl_Check_Include_File(strings.h)
|
||||
Tcl_Check_Include_File(sys/param.h USE)
|
||||
Tcl_Check_Include_File(sys/stat.h)
|
||||
Tcl_Check_Include_File(sys/types.h)
|
||||
Tcl_Check_Include_File(sys/wait.h USE)
|
||||
Tcl_Check_Include_File(unistd.h)
|
||||
Tcl_Check_Include_File(values.h USE)
|
||||
|
||||
# TODO - for now, we need X11 on both *nix and Mac platforms.
|
||||
# Eventually we'll need to re-enable support for Aqua on Mac...
|
||||
if(NOT WIN32)
|
||||
find_package(X11)
|
||||
endif()
|
||||
|
||||
set(ITK_SRCS
|
||||
generic/itkStubInit.c
|
||||
generic/itkStubLib.c
|
||||
generic/itk_archetype.c
|
||||
generic/itk_cmds.c
|
||||
generic/itk_option.c
|
||||
generic/itk_util.c
|
||||
)
|
||||
|
||||
if(WIN32)
|
||||
set(ITK_SRCS ${ITK_SRCS} win/dllEntryPoint.c)
|
||||
endif(WIN32)
|
||||
|
||||
set(ITK_STUB_SRCS generic/itkStubLib.c)
|
||||
|
||||
set(ITK_INCLUDE_DIRS ${ITK_SOURCE_DIR}/generic ${ITK_BINARY_DIR}/include)
|
||||
mark_as_advanced(ITK_INCLUDE_DIRS)
|
||||
|
||||
|
||||
# Like ITcl, Itk requires private Tcl headers
|
||||
# At least one Linux distro puts what we need here
|
||||
set(HDRS_CANDIDATE_DIR ${TCL_INCLUDE_PATH}8.6/tcl-private)
|
||||
if (EXISTS ${HDRS_CANDIDATE_DIR})
|
||||
set(TCL_PRIVATE_HDRS ${HDRS_CANDIDATE_DIR}/generic)
|
||||
if(NOT WIN32)
|
||||
set(TCL_PRIVATE_HDRS ${TCL_PRIVATE_HDRS} ${HDRS_CANDIDATE_DIR}/unix)
|
||||
else(NOT WIN32)
|
||||
set(TCL_PRIVATE_HDRS ${TCL_PRIVATE_HDRS} ${HDRS_CANDIDATE_DIR}/win)
|
||||
endif(NOT WIN32)
|
||||
endif ()
|
||||
# Itk also requires private Tk headers
|
||||
set(HDRS_CANDIDATE_DIR ${TCL_INCLUDE_PATH}8.6/tk-private)
|
||||
if (EXISTS ${HDRS_CANDIDATE_DIR})
|
||||
set(TCL_PRIVATE_HDRS ${TCL_PRIVATE_HDRS} ${HDRS_CANDIDATE_DIR}/generic)
|
||||
if(NOT WIN32)
|
||||
set(TCL_PRIVATE_HDRS ${TCL_PRIVATE_HDRS} ${HDRS_CANDIDATE_DIR}/unix)
|
||||
else(NOT WIN32)
|
||||
set(TCL_PRIVATE_HDRS ${TCL_PRIVATE_HDRS} ${HDRS_CANDIDATE_DIR}/win)
|
||||
endif(NOT WIN32)
|
||||
endif ()
|
||||
|
||||
# If we don't have what we need, see if we know where to find
|
||||
# a source directory
|
||||
if (NOT TCL_PRIVATE_HDRS)
|
||||
if (NOT DEFINED TCL_SOURCE_DIR)
|
||||
message(FATAL_ERROR "Itk3 needs to know where to find the Tcl source directory")
|
||||
endif (NOT DEFINED TCL_SOURCE_DIR)
|
||||
set(TCL_PRIVATE_HDRS ${TCL_SOURCE_DIR}/generic)
|
||||
if(NOT WIN32)
|
||||
set(TCL_PRIVATE_HDRS ${TCL_PRIVATE_HDRS} ${TCL_SOURCE_DIR}/unix)
|
||||
else(NOT WIN32)
|
||||
set(TCL_PRIVATE_HDRS ${TCL_PRIVATE_HDRS} ${TCL_SOURCE_DIR}/win)
|
||||
endif(NOT WIN32)
|
||||
if (NOT DEFINED TK_SOURCE_DIR)
|
||||
message(FATAL_ERROR "Itk3 needs to know where to find the Tk source directory")
|
||||
endif (NOT DEFINED TK_SOURCE_DIR)
|
||||
if(WIN32)
|
||||
set(TCL_PRIVATE_HDRS ${TCL_PRIVATE_HDRS} ${TK_SOURCE_DIR}/xlib)
|
||||
endif(WIN32)
|
||||
endif (NOT TCL_PRIVATE_HDRS)
|
||||
|
||||
include_directories(
|
||||
# Itcl3 is iffy as a system install - just reference the local copy
|
||||
${CMAKE_SOURCE_DIR}/generic/itcl3
|
||||
${TCL_INCLUDE_PATH}
|
||||
${TK_INCLUDE_PATH}
|
||||
${ITCL_INCLUDE_PATH}
|
||||
${ITK_INCLUDE_DIRS}
|
||||
${X11_INCLUDE_DIR}
|
||||
${TCL_PRIVATE_HDRS}
|
||||
)
|
||||
|
||||
add_library(itk${ITK_VERSION} SHARED ${ITK_SRCS})
|
||||
target_link_libraries(itk${ITK_VERSION} ${M_LIBRARY} ${TCL_STUB_LIBRARY} ${TK_STUB_LIBRARY} ${ITCL_STUB_LIBRARY})
|
||||
set_property(TARGET itk${ITK_VERSION} APPEND PROPERTY COMPILE_DEFINITIONS USE_TCL_STUBS)
|
||||
set_property(TARGET itk${ITK_VERSION} APPEND PROPERTY COMPILE_DEFINITIONS USE_ITCL_STUBS)
|
||||
set_property(TARGET itk${ITK_VERSION} APPEND PROPERTY COMPILE_DEFINITIONS USE_TK_STUBS)
|
||||
install(TARGETS itk${ITK_VERSION}
|
||||
RUNTIME DESTINATION ${BIN_DIR}/itk${ITK_VERSION}
|
||||
LIBRARY DESTINATION ${SHARED_DIR}/itk${ITK_VERSION}
|
||||
ARCHIVE DESTINATION ${LIB_DIR}/itk${ITK_VERSION})
|
||||
|
||||
add_library(itkstub STATIC ${ITK_STUB_SRCS})
|
||||
target_link_libraries(itkstub ${ITCL_STUB_LIBRARY} ${TCL_STUB_LIBRARY} ${TK_STUB_LIBRARY})
|
||||
set_property(TARGET itkstub APPEND PROPERTY COMPILE_DEFINITIONS USE_TCL_STUBS)
|
||||
set_property(TARGET itkstub APPEND PROPERTY COMPILE_DEFINITIONS USE_ITCL_STUBS)
|
||||
set_property(TARGET itkstub APPEND PROPERTY COMPILE_DEFINITIONS USE_TK_STUBS)
|
||||
install(TARGETS itkstub
|
||||
RUNTIME DESTINATION ${BIN_DIR}/itk${ITK_VERSION}
|
||||
LIBRARY DESTINATION ${LIB_DIR}/itk${ITK_VERSION}
|
||||
ARCHIVE DESTINATION ${LIB_DIR}/itk${ITK_VERSION})
|
||||
|
||||
# Create pkgIndex.tcl files
|
||||
file(GENERATE
|
||||
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/pkgIndex.tcl"
|
||||
CONTENT "
|
||||
if {![package vsatisfies [package provide Tcl] 8.5]} {return}
|
||||
package ifneeded Itk ${ITK_VERSION} [list load [file join $dir ../../${SHARED_DIR}/itk${ITK_VERSION} $<TARGET_FILE_NAME:itk${ITK_VERSION}>] Itk]
|
||||
")
|
||||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/pkgIndex.tcl DESTINATION ${LIB_DIR}/itk${ITK_VERSION})
|
||||
|
||||
set(ITK_LIBRARY_FILES
|
||||
library/Archetype.itk
|
||||
library/Toplevel.itk
|
||||
library/Widget.itk
|
||||
library/itk.tcl
|
||||
library/tclIndex
|
||||
)
|
||||
install(FILES ${ITK_LIBRARY_FILES} DESTINATION lib/itk${ITK_VERSION})
|
||||
|
||||
set(ITK_HDRS
|
||||
generic/itk.h
|
||||
generic/itkDecls.h
|
||||
)
|
||||
install(FILES ${ITK_HDRS} DESTINATION ${INCLUDE_DIR})
|
||||
|
||||
# Local Variables:
|
||||
# tab-width: 8
|
||||
# mode: cmake
|
||||
# indent-tabs-mode: t
|
||||
# End:
|
||||
# ex: shiftwidth=2 tabstop=8
|
||||
|
||||
@@ -0,0 +1,116 @@
|
||||
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
||||
# file Copyright.txt or https://cmake.org/licensing for details.
|
||||
|
||||
#[=======================================================================[.rst:
|
||||
FindTCL
|
||||
-------
|
||||
|
||||
This module finds if Tcl is installed and determines where the include
|
||||
files and libraries are. It also determines what the name of the
|
||||
library is. This code sets the following variables:
|
||||
|
||||
::
|
||||
|
||||
ITCL_FOUND = Tcl was found
|
||||
ITCL_LIBRARY = path to Tcl library (tcl tcl80)
|
||||
ITCL_INCLUDE_PATH = path to where tcl.h can be found
|
||||
ITCL_STUB_LIBRARY = path to Tcl stub library
|
||||
|
||||
#]=======================================================================]
|
||||
|
||||
|
||||
set(_ITCL_SEARCHES)
|
||||
|
||||
# Search ITCL_ROOT first if it is set.
|
||||
if(ITCL_ROOT)
|
||||
set(_ITCL_SEARCH_ROOT PATHS ${ITCL_ROOT} NO_DEFAULT_PATH)
|
||||
list(APPEND _ITCL_SEARCHES _ITCL_SEARCH_ROOT)
|
||||
endif()
|
||||
|
||||
set(ITCL_POSSIBLE_LIB_PATH_SUFFIXES
|
||||
lib
|
||||
lib/itcl
|
||||
lib/itcl3.4
|
||||
itcl
|
||||
itcl3.4
|
||||
)
|
||||
|
||||
set(ITCL_POSSIBLE_LIB_NAMES
|
||||
itcl
|
||||
itcl3
|
||||
itcl3.4
|
||||
)
|
||||
|
||||
if(NOT ITCL_LIBRARY)
|
||||
foreach(search ${_ITCL_SEARCHES})
|
||||
find_library(ITCL_LIBRARY
|
||||
NAMES ${ITCL_POSSIBLE_LIB_NAMES}
|
||||
NAMES_PER_DIR ${${search}}
|
||||
PATH_SUFFIXES ${ITCL_POSSIBLE_LIB_PATH_SUFFIXES})
|
||||
endforeach()
|
||||
endif()
|
||||
if(NOT ITCL_LIBRARY)
|
||||
find_library(ITCL_LIBRARY
|
||||
NAMES ${ITCL_POSSIBLE_LIB_NAMES}
|
||||
PATH_SUFFIXES ${ITCL_POSSIBLE_LIB_PATH_SUFFIXES}
|
||||
)
|
||||
endif(NOT ITCL_LIBRARY)
|
||||
|
||||
set(ITCLSTUB_POSSIBLE_LIB_NAMES
|
||||
itclstub
|
||||
itclstub3
|
||||
itclstub3.4
|
||||
)
|
||||
if(NOT ITCL_STUB_LIBRARY)
|
||||
foreach(search ${_ITCL_SEARCHES})
|
||||
find_library(ITCL_STUB_LIBRARY
|
||||
NAMES ${ITCLSTUB_POSSIBLE_LIB_NAMES}
|
||||
NAMES_PER_DIR ${${search}}
|
||||
PATH_SUFFIXES ${ITCL_POSSIBLE_LIB_PATH_SUFFIXES}
|
||||
)
|
||||
endforeach()
|
||||
endif()
|
||||
if(NOT ITCL_STUB_LIBRARY)
|
||||
find_library(ITCL_STUB_LIBRARY
|
||||
NAMES ${ITCLSTUB_POSSIBLE_LIB_NAMES}
|
||||
PATH_SUFFIXES ${ITCL_POSSIBLE_LIB_PATH_SUFFIXES}
|
||||
)
|
||||
endif()
|
||||
|
||||
set(ITCL_POSSIBLE_INCLUDE_PATH_SUFFIXES
|
||||
include
|
||||
include/itcl
|
||||
include/itcl3
|
||||
include/itcl3.4
|
||||
)
|
||||
|
||||
foreach(search ${_ITCL_SEARCHES})
|
||||
find_path(ITCL_INCLUDE_PATH
|
||||
NAMES itcl.h ${${search}}
|
||||
PATH_SUFFIXES ${ITCL_POSSIBLE_INCLUDE_PATH_SUFFIXES}
|
||||
)
|
||||
endforeach()
|
||||
if (NOT ITCL_INCLUDE_PATH)
|
||||
find_path(ITCL_INCLUDE_PATH
|
||||
NAMES itcl.h
|
||||
HINTS ${ITCL_POSSIBLE_INCLUDE_PATHS}
|
||||
)
|
||||
endif()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(ITCL
|
||||
REQUIRED_VARS ITCL_LIBRARY ITCL_STUB_LIBRARY ITCL_INCLUDE_PATH
|
||||
)
|
||||
|
||||
mark_as_advanced(
|
||||
ITCL_INCLUDE_PATH
|
||||
ITCL_LIBRARY
|
||||
ITCL_STUB_LIBRARY
|
||||
)
|
||||
|
||||
# Local Variables:
|
||||
# tab-width: 8
|
||||
# mode: cmake
|
||||
# indent-tabs-mode: t
|
||||
# End:
|
||||
@@ -0,0 +1,554 @@
|
||||
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
||||
# file Copyright.txt or https://cmake.org/licensing for details.
|
||||
|
||||
#[=======================================================================[.rst:
|
||||
FindTCL
|
||||
-------
|
||||
|
||||
This module finds if Tcl is installed and determines where the include
|
||||
files and libraries are. It also determines what the name of the
|
||||
library is. This code sets the following variables:
|
||||
|
||||
::
|
||||
|
||||
TCL_FOUND = Tcl was found
|
||||
TCLSH_FOUND = TRUE if tclsh has been found
|
||||
TCL_LIBRARY = path to Tcl library (tcl tcl80)
|
||||
TCL_INCLUDE_PATH = path to where tcl.h can be found
|
||||
TCL_TCLSH = path to tclsh binary (tcl tcl80)
|
||||
|
||||
|
||||
|
||||
If TCL_ENABLE_TK is set, the following are also set:
|
||||
|
||||
::
|
||||
|
||||
TK_FOUND = Tk was found
|
||||
TCLTK_FOUND = Tcl and Tk were found
|
||||
TK_LIBRARY = path to Tk library (tk tk80 etc)
|
||||
TK_INCLUDE_PATH = path to where tk.h can be found
|
||||
TK_WISH = full path to the wish executable
|
||||
TCL_STUB_LIBRARY = path to Tcl stub library
|
||||
TK_STUB_LIBRARY = path to Tk stub library
|
||||
TTK_STUB_LIBRARY = path to ttk stub library
|
||||
|
||||
#]=======================================================================]
|
||||
|
||||
|
||||
set(_TCL_SEARCHES)
|
||||
|
||||
# Search TCL_ROOT first if it is set.
|
||||
if(TCL_ROOT)
|
||||
set(_TCL_SEARCH_ROOT PATHS ${TCL_ROOT} NO_DEFAULT_PATH)
|
||||
list(APPEND _TCL_SEARCHES _TCL_SEARCH_ROOT)
|
||||
endif()
|
||||
|
||||
if(WIN32)
|
||||
get_filename_component(
|
||||
ActiveTcl_CurrentVersion
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\ActiveState\\ActiveTcl;CurrentVersion]"
|
||||
NAME
|
||||
)
|
||||
set(
|
||||
TCLTK_POSSIBLE_BIN_PATHS
|
||||
${TCLTK_POSSIBLE_BIN_PATHS}
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\ActiveState\\ActiveTcl\\${ActiveTcl_CurrentVersion}]/bin"
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.6;Root]/bin"
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.5;Root]/bin"
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.4;Root]/bin"
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.3;Root]/bin"
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.2;Root]/bin"
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.0;Root]/bin"
|
||||
)
|
||||
|
||||
get_filename_component(
|
||||
ActiveTcl_CurrentVersion
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\ActiveState\\ActiveTcl;CurrentVersion]"
|
||||
NAME
|
||||
)
|
||||
set(
|
||||
TCLTK_POSSIBLE_LIB_PATHS
|
||||
${TCLTK_POSSIBLE_LIB_PATHS}
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\ActiveState\\ActiveTcl\\${ActiveTcl_CurrentVersion}]/lib"
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.6;Root]/lib"
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.5;Root]/lib"
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.4;Root]/lib"
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.3;Root]/lib"
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.2;Root]/lib"
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.0;Root]/lib"
|
||||
"$ENV{ProgramFiles}/Tcl/Lib"
|
||||
"C:/Program Files/Tcl/lib"
|
||||
"C:/Tcl/lib"
|
||||
)
|
||||
|
||||
set(
|
||||
TCLTK_POSSIBLE_INCLUDE_PATHS
|
||||
${TCLTK_POSSIBLE_INCLUDE_PATHS}
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\ActiveState\\ActiveTcl\\${ActiveTcl_CurrentVersion}]/include"
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.6;Root]/include"
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.5;Root]/include"
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.4;Root]/include"
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.3;Root]/include"
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.2;Root]/include"
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.0;Root]/include"
|
||||
"$ENV{ProgramFiles}/Tcl/include"
|
||||
"C:/Program Files/Tcl/include"
|
||||
"C:/Tcl/include"
|
||||
)
|
||||
endif()
|
||||
|
||||
set(
|
||||
TCL_TCLSH_NAMES
|
||||
tclsh
|
||||
tclsh${TCL_LIBRARY_VERSION}
|
||||
tclsh${TK_LIBRARY_VERSION}
|
||||
tclsh${TK_WISH_VERSION}
|
||||
tclsh87
|
||||
tclsh8.7
|
||||
tclsh86
|
||||
tclsh8.6
|
||||
tclsh85
|
||||
tclsh8.5
|
||||
tclsh84
|
||||
tclsh8.4
|
||||
tclsh83
|
||||
tclsh8.3
|
||||
tclsh82
|
||||
tclsh8.2
|
||||
tclsh80
|
||||
tclsh8.0
|
||||
)
|
||||
if(CYGWIN)
|
||||
set(TCL_TCLSH_NAMES ${TCL_TCLSH_NAMES} cygtclsh83 cygtclsh80)
|
||||
endif(CYGWIN)
|
||||
|
||||
foreach(search ${_TCL_SEARCHES})
|
||||
find_program(TCL_TCLSH NAMES ${TCL_TCLSH_NAMES} ${${search}} PATH_SUFFIXES bin)
|
||||
endforeach()
|
||||
if(NOT TCL_TCLSH)
|
||||
find_program(TCL_TCLSH NAMES ${TCL_TCLSH_NAMES} HINTS ${TCLTK_POSSIBLE_BIN_PATHS})
|
||||
endif(NOT TCL_TCLSH)
|
||||
|
||||
if(TCL_ENABLE_TK)
|
||||
set(
|
||||
TK_WISH_NAMES
|
||||
wish
|
||||
wish${TCL_LIBRARY_VERSION}
|
||||
wish${TK_LIBRARY_VERSION}
|
||||
wish${TCL_TCLSH_VERSION}
|
||||
wish86
|
||||
wish8.6
|
||||
wish85
|
||||
wish8.5
|
||||
wish84
|
||||
wish8.4
|
||||
wish83
|
||||
wish8.3
|
||||
wish82
|
||||
wish8.2
|
||||
wish80
|
||||
wish8.0
|
||||
)
|
||||
|
||||
if(CYGWIN)
|
||||
set(TK_WISH_NAMES ${TK_WISH_NAMES} cygwish80)
|
||||
endif()
|
||||
|
||||
foreach(search ${_TCL_SEARCHES})
|
||||
find_program(TK_WISH NAMES ${TK_WISH_NAMES} ${${search}} PATH_SUFFIXES bin)
|
||||
endforeach()
|
||||
if(NOT TK_WISH)
|
||||
find_program(TK_WISH NAMES ${TK_WISH_NAMES} HINTS ${TCLTK_POSSIBLE_BIN_PATHS})
|
||||
endif(NOT TK_WISH)
|
||||
endif(TCL_ENABLE_TK)
|
||||
|
||||
if(TCLSH_VERSION_STRING)
|
||||
set(TCL_TCLSH_VERSION "${TCLSH_VERSION_STRING}")
|
||||
else()
|
||||
get_filename_component(TCL_TCLSH_PATH "${TCL_TCLSH}" PATH)
|
||||
get_filename_component(TCL_TCLSH_PATH_PARENT "${TCL_TCLSH_PATH}" PATH)
|
||||
string(REGEX REPLACE "^.*tclsh([0-9]\\.*[0-9]).*$" "\\1" TCL_TCLSH_VERSION "${TCL_TCLSH}")
|
||||
endif()
|
||||
|
||||
set(TCLTK_POSSIBLE_LIB_PATHS "${TCL_INCLUDE_PATH_PARENT}/lib" "${TCL_LIBRARY_PATH}" "${TCL_TCLSH_PATH_PARENT}/lib")
|
||||
if(TCL_ENABLE_TK)
|
||||
set(
|
||||
TCLTK_POSSIBLE_LIB_PATHS
|
||||
${TCLTK_POSSIBLE_LIB_PATHS}
|
||||
"${TK_INCLUDE_PATH_PARENT}/lib"
|
||||
"${TK_LIBRARY_PATH}"
|
||||
"${TK_WISH_PATH_PARENT}/lib"
|
||||
)
|
||||
endif(TCL_ENABLE_TK)
|
||||
|
||||
set(
|
||||
TCLTK_POSSIBLE_LIB_PATH_SUFFIXES
|
||||
lib
|
||||
lib/tcl
|
||||
lib/tcl/tcl8.7
|
||||
lib/tcl/tcl8.6
|
||||
lib/tcl/tcl8.5
|
||||
lib/tcl/tcl8.4
|
||||
)
|
||||
if(TCL_ENABLE_TK)
|
||||
set(
|
||||
TCLTK_POSSIBLE_LIB_PATH_SUFFIXES
|
||||
${TCLTK_POSSIBLE_LIB_PATH_SUFFIXES}
|
||||
lib/tcl/tk8.7
|
||||
lib/tcl/tk8.6
|
||||
lib/tcl/tk8.5
|
||||
lib/tcl/tk8.4
|
||||
)
|
||||
endif(TCL_ENABLE_TK)
|
||||
|
||||
set(
|
||||
TCL_POSSIBLE_LIB_NAMES
|
||||
tcl
|
||||
tcl${TCL_LIBRARY_VERSION}
|
||||
tcl${TCL_TCLSH_VERSION}
|
||||
tcl${TK_WISH_VERSION}
|
||||
tcl87
|
||||
tcl8.7
|
||||
tcl87t
|
||||
tcl8.7t
|
||||
tcl86
|
||||
tcl8.6
|
||||
tcl86t
|
||||
tcl8.6t
|
||||
tcl85
|
||||
tcl8.5
|
||||
tcl84
|
||||
tcl8.4
|
||||
tcl83
|
||||
tcl8.3
|
||||
tcl82
|
||||
tcl8.2
|
||||
tcl80
|
||||
tcl8.0
|
||||
)
|
||||
|
||||
if(NOT TCL_LIBRARY)
|
||||
foreach(search ${_TCL_SEARCHES})
|
||||
find_library(
|
||||
TCL_LIBRARY
|
||||
NAMES ${TCL_POSSIBLE_LIB_NAMES}
|
||||
NAMES_PER_DIR
|
||||
${${search}}
|
||||
PATH_SUFFIXES ${TCLTK_POSSIBLE_LIB_PATH_SUFFIXES}
|
||||
)
|
||||
endforeach()
|
||||
endif()
|
||||
if(NOT TCL_LIBRARY)
|
||||
find_library(
|
||||
TCL_LIBRARY
|
||||
NAMES ${TCL_POSSIBLE_LIB_NAMES}
|
||||
PATHS ${TCLTK_POSSIBLE_LIB_PATHS}
|
||||
PATH_SUFFIXES ${TCLTK_POSSIBLE_LIB_PATH_SUFFIXES}
|
||||
)
|
||||
endif(NOT TCL_LIBRARY)
|
||||
|
||||
set(
|
||||
TCLSTUB_POSSIBLE_LIB_NAMES
|
||||
tclstub
|
||||
tclstub${TK_LIBRARY_VERSION}
|
||||
tclstub${TCL_TCLSH_VERSION}
|
||||
tclstub${TK_WISH_VERSION}
|
||||
tclstub87
|
||||
tclstub8.7
|
||||
tclstub86
|
||||
tclstub8.6
|
||||
tclstub85
|
||||
tclstub8.5
|
||||
tclstub84
|
||||
tclstub8.4
|
||||
tclstub83
|
||||
tclstub8.3
|
||||
tclstub82
|
||||
tclstub8.2
|
||||
tclstub80
|
||||
tclstub8.0
|
||||
)
|
||||
if(NOT TCL_STUB_LIBRARY)
|
||||
foreach(search ${_TCL_SEARCHES})
|
||||
find_library(
|
||||
TCL_STUB_LIBRARY
|
||||
NAMES ${TCLSTUB_POSSIBLE_LIB_NAMES}
|
||||
NAMES_PER_DIR
|
||||
${${search}}
|
||||
PATH_SUFFIXES ${TCLTK_POSSIBLE_LIB_PATH_SUFFIXES}
|
||||
)
|
||||
endforeach()
|
||||
endif()
|
||||
if(NOT TCL_STUB_LIBRARY)
|
||||
find_library(TCL_STUB_LIBRARY NAMES ${TCLSTUB_POSSIBLE_LIB_NAMES} PATHS ${TCLTK_POSSIBLE_LIB_PATHS})
|
||||
endif()
|
||||
|
||||
if(TCL_ENABLE_TK)
|
||||
set(
|
||||
TK_POSSIBLE_LIB_NAMES
|
||||
tk
|
||||
tk${TK_LIBRARY_VERSION}
|
||||
tk${TCL_TCLSH_VERSION}
|
||||
tk${TK_WISH_VERSION}
|
||||
tk87
|
||||
tk8.7
|
||||
tk87t
|
||||
tk8.7t
|
||||
tk86
|
||||
tk8.6
|
||||
tk86t
|
||||
tk8.6t
|
||||
tk85
|
||||
tk8.5
|
||||
tk84
|
||||
tk8.4
|
||||
tk83
|
||||
tk8.3
|
||||
tk82
|
||||
tk8.2
|
||||
tk80
|
||||
tk8.0
|
||||
)
|
||||
|
||||
if(NOT TK_LIBRARY)
|
||||
foreach(search ${_TCL_SEARCHES})
|
||||
find_library(
|
||||
TK_LIBRARY
|
||||
NAMES ${TK_POSSIBLE_LIB_NAMES}
|
||||
NAMES_PER_DIR
|
||||
${${search}}
|
||||
PATH_SUFFIXES ${TCLTK_POSSIBLE_LIB_PATH_SUFFIXES}
|
||||
)
|
||||
endforeach()
|
||||
endif()
|
||||
if(NOT TK_LIBRARY)
|
||||
find_library(
|
||||
TK_LIBRARY
|
||||
NAMES ${TK_POSSIBLE_LIB_NAMES}
|
||||
PATHS ${TCLTK_POSSIBLE_LIB_PATHS}
|
||||
PATH_SUFFIXES ${TCLTK_POSSIBLE_LIB_PATH_SUFFIXES}
|
||||
)
|
||||
endif(NOT TK_LIBRARY)
|
||||
|
||||
set(
|
||||
TK_STUB_POSSIBLE_LIB_NAMES
|
||||
tkstub
|
||||
tkstub${TCL_LIBRARY_VERSION}
|
||||
tkstub${TCL_TCLSH_VERSION}
|
||||
tkstub${TK_WISH_VERSION}
|
||||
tkstub87
|
||||
tkstub8.7
|
||||
tkstub86
|
||||
tkstub8.6
|
||||
tkstub85
|
||||
tkstub8.5
|
||||
tkstub84
|
||||
tkstub8.4
|
||||
tkstub83
|
||||
tkstub8.3
|
||||
tkstub82
|
||||
tkstub8.2
|
||||
tkstub80
|
||||
tkstub8.0
|
||||
)
|
||||
|
||||
if(NOT TK_STUB_LIBRARY)
|
||||
foreach(search ${_TCL_SEARCHES})
|
||||
find_library(
|
||||
TK_STUB_LIBRARY
|
||||
NAMES ${TK_STUB_POSSIBLE_LIB_NAMES}
|
||||
NAMES_PER_DIR
|
||||
${${search}}
|
||||
PATH_SUFFIXES ${TCLTK_POSSIBLE_LIB_PATH_SUFFIXES}
|
||||
)
|
||||
endforeach()
|
||||
endif()
|
||||
if(NOT TK_STUB_LIBRARY)
|
||||
find_library(TK_STUB_LIBRARY NAMES ${TK_STUB_POSSIBLE_LIB_NAMES} PATHS ${TCLTK_POSSIBLE_LIB_PATHS})
|
||||
endif()
|
||||
|
||||
set(
|
||||
TTK_STUB_POSSIBLE_LIB_NAMES
|
||||
ttkstub
|
||||
ttkstub${TCL_LIBRARY_VERSION}
|
||||
ttkstub${TCL_TCLSH_VERSION}
|
||||
ttkstub${TK_WISH_VERSION}
|
||||
ttkstub88
|
||||
ttkstub8.8
|
||||
ttkstub87
|
||||
ttkstub8.7
|
||||
ttkstub86
|
||||
ttkstub8.6
|
||||
ttkstub85
|
||||
ttkstub8.5
|
||||
)
|
||||
|
||||
if(NOT TTK_STUB_LIBRARY)
|
||||
foreach(search ${_TCL_SEARCHES})
|
||||
find_library(
|
||||
TTK_STUB_LIBRARY
|
||||
NAMES ${TTK_STUB_POSSIBLE_LIB_NAMES}
|
||||
NAMES_PER_DIR
|
||||
${${search}}
|
||||
PATH_SUFFIXES ${TCLTK_POSSIBLE_LIB_PATH_SUFFIXES}
|
||||
)
|
||||
endforeach()
|
||||
endif()
|
||||
if(NOT TTK_STUB_LIBRARY)
|
||||
find_library(TTK_STUB_LIBRARY NAMES ${TTK_STUB_POSSIBLE_LIB_NAMES} PATHS ${TCLTK_POSSIBLE_LIB_PATHS})
|
||||
endif()
|
||||
endif(TCL_ENABLE_TK)
|
||||
|
||||
set(
|
||||
TCLTK_POSSIBLE_INCLUDE_PATHS
|
||||
"${TCL_LIBRARY_PATH_PARENT}/include"
|
||||
"${TCL_INCLUDE_PATH}"
|
||||
"${TCL_TCLSH_PATH_PARENT}/include"
|
||||
)
|
||||
if(TCL_ENABLE_TK)
|
||||
set(
|
||||
TCLTK_POSSIBLE_INCLUDE_PATHS
|
||||
${TCLTK_POSSIBLE_INCLUDE_PATHS}
|
||||
"${TCL_LIBRARY_PATH_PARENT}/include"
|
||||
"${TCL_INCLUDE_PATH}"
|
||||
"${TCL_TCLSH_PATH_PARENT}/include"
|
||||
)
|
||||
endif(TCL_ENABLE_TK)
|
||||
|
||||
set(
|
||||
TCLTK_POSSIBLE_INCLUDE_PATH_SUFFIXES
|
||||
include
|
||||
include/tcl${TCL_LIBRARY_VERSION}
|
||||
include/tcl8.7
|
||||
include/tcl8.6
|
||||
include/tcl8.5
|
||||
include/tcl8.4
|
||||
include/tcl8.3
|
||||
include/tcl8.2
|
||||
include/tcl8.0
|
||||
)
|
||||
|
||||
if(TCL_ENABLE_TK)
|
||||
set(
|
||||
TCLTK_POSSIBLE_INCLUDE_PATH_SUFFIXES
|
||||
${TCLTK_POSSIBLE_INCLUDE_PATH_SUFFIXES}
|
||||
include/tcl${TK_LIBRARY_VERSION}
|
||||
include/tk8.7
|
||||
include/tk8.6
|
||||
include/tk8.5
|
||||
include/tk8.4
|
||||
)
|
||||
endif(TCL_ENABLE_TK)
|
||||
|
||||
foreach(search ${_TCL_SEARCHES})
|
||||
find_path(TCL_INCLUDE_PATH NAMES tcl.h ${${search}} PATH_SUFFIXES ${TCLTK_POSSIBLE_INCLUDE_PATH_SUFFIXES})
|
||||
endforeach()
|
||||
if(NOT TCL_INCLUDE_PATH)
|
||||
find_path(
|
||||
TCL_INCLUDE_PATH
|
||||
NAMES tcl.h
|
||||
HINTS ${TCLTK_POSSIBLE_INCLUDE_PATHS}
|
||||
PATH_SUFFIXES ${TCLTK_POSSIBLE_INCLUDE_PATH_SUFFIXES}
|
||||
)
|
||||
endif()
|
||||
|
||||
if(TCL_ENABLE_TK)
|
||||
foreach(search ${_TCL_SEARCHES})
|
||||
find_path(TK_INCLUDE_PATH NAMES tk.h ${${search}} PATH_SUFFIXES ${TCLTK_POSSIBLE_INCLUDE_PATH_SUFFIXES})
|
||||
endforeach()
|
||||
if(NOT TK_INCLUDE_PATH)
|
||||
find_path(
|
||||
TK_INCLUDE_PATH
|
||||
NAMES tk.h
|
||||
HINTS ${TCLTK_POSSIBLE_INCLUDE_PATHS}
|
||||
PATH_SUFFIXES ${TCLTK_POSSIBLE_INCLUDE_PATH_SUFFIXES}
|
||||
)
|
||||
endif()
|
||||
|
||||
# IFF we have TCL_TK_SYSTEM_GRAPHICS set and have a system TK_WISH, check that the
|
||||
# windowing system matches the specified type
|
||||
if(NOT "${TCL_TK_SYSTEM_GRAPHICS}" STREQUAL "" AND TK_WISH AND NOT TARGET "${TK_WISH}")
|
||||
set(
|
||||
tkwin_script
|
||||
"
|
||||
set filename \"${CMAKE_BINARY_DIR}/CMakeTmp/TK_WINDOWINGSYSTEM\"
|
||||
set fileId [open $filename \"w\"]
|
||||
set windowingsystem [tk windowingsystem]
|
||||
puts $fileId $windowingsystem
|
||||
close $fileId
|
||||
exit
|
||||
"
|
||||
)
|
||||
set(tkwin_scriptfile "${CMAKE_BINARY_DIR}/CMakeTmp/tk_windowingsystem.tcl")
|
||||
set(WSYS "wm-NOTFOUND")
|
||||
file(WRITE ${tkwin_scriptfile} ${tkwin_script})
|
||||
execute_process(COMMAND ${TK_WISH} ${tkwin_scriptfile} OUTPUT_VARIABLE EXECOUTPUT)
|
||||
if(EXISTS "${CMAKE_BINARY_DIR}/CMakeTmp/TK_WINDOWINGSYSTEM")
|
||||
file(READ "${CMAKE_BINARY_DIR}/CMakeTmp/TK_WINDOWINGSYSTEM" readresultvar)
|
||||
string(REGEX REPLACE "\n" "" WSYS "${readresultvar}")
|
||||
endif(EXISTS "${CMAKE_BINARY_DIR}/CMakeTmp/TK_WINDOWINGSYSTEM")
|
||||
|
||||
# If we have no information about the windowing system or it does not match
|
||||
# a specified system, the find_package detection has failed
|
||||
if(NOT "${WSYS}" STREQUAL "${TCL_TK_SYSTEM_GRAPHICS}")
|
||||
unset(TCL_LIBRARY CACHE)
|
||||
unset(TCL_STUB_LIBRARY CACHE)
|
||||
unset(TK_LIBRARY CACHE)
|
||||
unset(TK_STUB_LIBRARY CACHE)
|
||||
unset(TCL_FOUND CACHE)
|
||||
unset(TK_FOUND CACHE)
|
||||
unset(TCLTK_FOUND CACHE)
|
||||
unset(TCLSH_FOUND CACHE)
|
||||
unset(TCL_LIBRARY CACHE)
|
||||
unset(TCL_INCLUDE_PATH CACHE)
|
||||
unset(TCL_TCLSH CACHE)
|
||||
unset(TK_LIBRARY CACHE)
|
||||
unset(TK_INCLUDE_PATH CACHE)
|
||||
unset(TK_WISH CACHE)
|
||||
unset(TCL_STUB_LIBRARY CACHE)
|
||||
unset(TK_STUB_LIBRARY CACHE)
|
||||
unset(TTK_STUB_LIBRARY CACHE)
|
||||
endif(NOT "${WSYS}" STREQUAL "${TCL_TK_SYSTEM_GRAPHICS}")
|
||||
endif(NOT "${TCL_TK_SYSTEM_GRAPHICS}" STREQUAL "" AND TK_WISH AND NOT TARGET "${TK_WISH}")
|
||||
endif(TCL_ENABLE_TK)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
find_package_handle_standard_args(
|
||||
TCL
|
||||
REQUIRED_VARS TCL_LIBRARY TCL_STUB_LIBRARY TCL_INCLUDE_PATH TCL_TCLSH
|
||||
VERSION_VAR TCLSH_VERSION_STRING
|
||||
)
|
||||
|
||||
if(TCL_ENABLE_TK)
|
||||
set(FPHSA_NAME_MISMATCHED 1)
|
||||
set(TCLTK_FIND_REQUIRED ${TCL_FIND_REQUIRED})
|
||||
set(TCLTK_FIND_QUIETLY ${TCL_FIND_QUIETLY})
|
||||
find_package_handle_standard_args(
|
||||
TCLTK
|
||||
REQUIRED_VARS TCL_LIBRARY TCL_STUB_LIBRARY TCL_INCLUDE_PATH TK_LIBRARY TK_STUB_LIBRARY TK_INCLUDE_PATH
|
||||
)
|
||||
set(TK_FIND_REQUIRED ${TCL_FIND_REQUIRED})
|
||||
set(TK_FIND_QUIETLY ${TCL_FIND_QUIETLY})
|
||||
find_package_handle_standard_args(TK REQUIRED_VARS TK_LIBRARY TK_STUB_LIBRARY TK_INCLUDE_PATH TK_WISH)
|
||||
unset(FPHSA_NAME_MISMATCHED)
|
||||
endif(TCL_ENABLE_TK)
|
||||
|
||||
mark_as_advanced(
|
||||
TCL_INCLUDE_PATH
|
||||
TCL_LIBRARY
|
||||
TCL_STUB_LIBRARY
|
||||
TCL_TCLSH
|
||||
TK_INCLUDE_PATH
|
||||
TK_LIBRARY
|
||||
TK_STUB_LIBRARY
|
||||
TK_WISH
|
||||
TTK_STUB_LIBRARY
|
||||
)
|
||||
|
||||
# Local Variables:
|
||||
# tab-width: 8
|
||||
# mode: cmake
|
||||
# indent-tabs-mode: t
|
||||
# End:
|
||||
# ex: shiftwidth=2 tabstop=8
|
||||
@@ -0,0 +1,217 @@
|
||||
/*
|
||||
* ------------------------------------------------------------------------
|
||||
* PACKAGE: [incr Tcl]
|
||||
* DESCRIPTION: Object-Oriented Extensions to Tcl
|
||||
*
|
||||
* [incr Tcl] provides object-oriented extensions to Tcl, much as
|
||||
* C++ provides object-oriented extensions to C. It provides a means
|
||||
* of encapsulating related procedures together with their shared data
|
||||
* in a local namespace that is hidden from the outside world. It
|
||||
* promotes code re-use through inheritance. More than anything else,
|
||||
* it encourages better organization of Tcl applications through the
|
||||
* object-oriented paradigm, leading to code that is easier to
|
||||
* understand and maintain.
|
||||
*
|
||||
* ADDING [incr Tcl] TO A Tcl-BASED APPLICATION:
|
||||
*
|
||||
* To add [incr Tcl] facilities to a Tcl application, modify the
|
||||
* Tcl_AppInit() routine as follows:
|
||||
*
|
||||
* 1) Include this header file near the top of the file containing
|
||||
* Tcl_AppInit():
|
||||
*
|
||||
* #include "itcl.h"
|
||||
*
|
||||
* 2) Within the body of Tcl_AppInit(), add the following lines:
|
||||
*
|
||||
* if (Itcl_Init(interp) == TCL_ERROR) {
|
||||
* return TCL_ERROR;
|
||||
* }
|
||||
*
|
||||
* 3) Link your application with libitcl.a
|
||||
*
|
||||
* NOTE: An example file "tclAppInit.c" containing the changes shown
|
||||
* above is included in this distribution.
|
||||
*
|
||||
* ========================================================================
|
||||
* AUTHOR: Michael J. McLennan
|
||||
* Bell Labs Innovations for Lucent Technologies
|
||||
* mmclennan@lucent.com
|
||||
* http://www.tcltk.com/itcl
|
||||
* ========================================================================
|
||||
* Copyright (c) 1993-1998 Lucent Technologies, Inc.
|
||||
* ------------------------------------------------------------------------
|
||||
* See the file "license.terms" for information on usage and redistribution
|
||||
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
*/
|
||||
#ifndef ITCL_H
|
||||
#define ITCL_H
|
||||
|
||||
#include "tcl.h"
|
||||
|
||||
#ifndef TCL_ALPHA_RELEASE
|
||||
# define TCL_ALPHA_RELEASE 0
|
||||
#endif
|
||||
#ifndef TCL_BETA_RELEASE
|
||||
# define TCL_BETA_RELEASE 1
|
||||
#endif
|
||||
#ifndef TCL_FINAL_RELEASE
|
||||
# define TCL_FINAL_RELEASE 2
|
||||
#endif
|
||||
|
||||
|
||||
#define ITCL_MAJOR_VERSION 3
|
||||
#define ITCL_MINOR_VERSION 4
|
||||
#define ITCL_RELEASE_LEVEL TCL_FINAL_RELEASE
|
||||
#define ITCL_RELEASE_SERIAL 3
|
||||
|
||||
#define ITCL_VERSION "3.4"
|
||||
#define ITCL_PATCH_LEVEL "3.4.3"
|
||||
|
||||
/*
|
||||
* A special definition used to allow this header file to be included
|
||||
* in resource files so that they can get obtain version information from
|
||||
* this file. Resource compilers don't like all the C stuff, like typedefs
|
||||
* and procedure declarations, that occur below.
|
||||
*/
|
||||
|
||||
#ifndef RC_INVOKED
|
||||
|
||||
#undef TCL_STORAGE_CLASS
|
||||
#ifdef BUILD_itcl
|
||||
# define TCL_STORAGE_CLASS DLLEXPORT
|
||||
#else
|
||||
# ifdef USE_ITCL_STUBS
|
||||
# define TCL_STORAGE_CLASS
|
||||
# else
|
||||
# define TCL_STORAGE_CLASS DLLIMPORT
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Fix the Borland bug that's in the EXTERN macro from tcl.h.
|
||||
*/
|
||||
#ifndef TCL_EXTERN
|
||||
# undef DLLIMPORT
|
||||
# undef DLLEXPORT
|
||||
# ifdef __cplusplus
|
||||
# define TCL_EXTERNC extern "C"
|
||||
# else
|
||||
# define TCL_EXTERNC extern
|
||||
# endif
|
||||
# if defined(STATIC_BUILD)
|
||||
# define DLLIMPORT
|
||||
# define DLLEXPORT
|
||||
# define TCL_EXTERN(RTYPE) TCL_EXTERNC RTYPE
|
||||
# elif (defined(__WIN32__) && ( \
|
||||
defined(_MSC_VER) || (__BORLANDC__ >= 0x0550) || \
|
||||
defined(__LCC__) || defined(__WATCOMC__) || \
|
||||
(defined(__GNUC__) && defined(__declspec)) \
|
||||
)) || (defined(MAC_TCL) && FUNCTION_DECLSPEC)
|
||||
# define DLLIMPORT __declspec(dllimport)
|
||||
# define DLLEXPORT __declspec(dllexport)
|
||||
# define TCL_EXTERN(RTYPE) TCL_EXTERNC TCL_STORAGE_CLASS RTYPE
|
||||
# elif defined(__BORLANDC__)
|
||||
# define DLLIMPORT __import
|
||||
# define DLLEXPORT __export
|
||||
/* Pre-5.5 Borland requires the attributes be placed after the */
|
||||
/* return type instead. */
|
||||
# define TCL_EXTERN(RTYPE) TCL_EXTERNC RTYPE TCL_STORAGE_CLASS
|
||||
# else
|
||||
# define DLLIMPORT
|
||||
# define DLLEXPORT
|
||||
# define TCL_EXTERN(RTYPE) TCL_EXTERNC TCL_STORAGE_CLASS RTYPE
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Protection levels:
|
||||
*
|
||||
* ITCL_PUBLIC - accessible from any namespace
|
||||
* ITCL_PROTECTED - accessible from namespace that imports in "protected" mode
|
||||
* ITCL_PRIVATE - accessible only within the namespace that contains it
|
||||
*/
|
||||
#define ITCL_PUBLIC 1
|
||||
#define ITCL_PROTECTED 2
|
||||
#define ITCL_PRIVATE 3
|
||||
#define ITCL_DEFAULT_PROTECT 4
|
||||
|
||||
|
||||
/*
|
||||
* Generic stack.
|
||||
*/
|
||||
typedef struct Itcl_Stack {
|
||||
ClientData *values; /* values on stack */
|
||||
int len; /* number of values on stack */
|
||||
int max; /* maximum size of stack */
|
||||
ClientData space[5]; /* initial space for stack data */
|
||||
} Itcl_Stack;
|
||||
|
||||
#define Itcl_GetStackSize(stackPtr) ((stackPtr)->len)
|
||||
|
||||
/*
|
||||
* Generic linked list.
|
||||
*/
|
||||
struct Itcl_List;
|
||||
typedef struct Itcl_ListElem {
|
||||
struct Itcl_List* owner; /* list containing this element */
|
||||
ClientData value; /* value associated with this element */
|
||||
struct Itcl_ListElem *prev; /* previous element in linked list */
|
||||
struct Itcl_ListElem *next; /* next element in linked list */
|
||||
} Itcl_ListElem;
|
||||
|
||||
typedef struct Itcl_List {
|
||||
int validate; /* validation stamp */
|
||||
int num; /* number of elements */
|
||||
struct Itcl_ListElem *head; /* previous element in linked list */
|
||||
struct Itcl_ListElem *tail; /* next element in linked list */
|
||||
} Itcl_List;
|
||||
|
||||
#define Itcl_FirstListElem(listPtr) ((listPtr)->head)
|
||||
#define Itcl_LastListElem(listPtr) ((listPtr)->tail)
|
||||
#define Itcl_NextListElem(elemPtr) ((elemPtr)->next)
|
||||
#define Itcl_PrevListElem(elemPtr) ((elemPtr)->prev)
|
||||
#define Itcl_GetListLength(listPtr) ((listPtr)->num)
|
||||
#define Itcl_GetListValue(elemPtr) ((elemPtr)->value)
|
||||
|
||||
/*
|
||||
* Token representing the state of an interpreter.
|
||||
*/
|
||||
typedef struct Itcl_InterpState_ *Itcl_InterpState;
|
||||
|
||||
|
||||
/*
|
||||
* Include the public function declarations that are accessible via
|
||||
* the stubs table.
|
||||
*/
|
||||
|
||||
#include "itclDecls.h"
|
||||
|
||||
|
||||
/*
|
||||
* Itcl_InitStubs is used by extensions like Itk that can be linked
|
||||
* against the itcl stubs library. If we are not using stubs
|
||||
* then this reduces to package require.
|
||||
*/
|
||||
|
||||
#ifdef USE_ITCL_STUBS
|
||||
|
||||
TCL_EXTERNC CONST char *
|
||||
Itcl_InitStubs _ANSI_ARGS_((Tcl_Interp *interp,
|
||||
CONST char *version, int exact));
|
||||
#else
|
||||
#define Itcl_InitStubs(interp, version, exact) \
|
||||
Tcl_PkgRequire(interp, "Itcl", version, exact)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Public functions that are not accessible via the stubs table.
|
||||
*/
|
||||
|
||||
|
||||
#endif /* RC_INVOKED */
|
||||
|
||||
#undef TCL_STORAGE_CLASS
|
||||
#define TCL_STORAGE_CLASS DLLIMPORT
|
||||
|
||||
#endif /* ITCL_H */
|
||||
@@ -0,0 +1,332 @@
|
||||
/*
|
||||
* itclDecls.h --
|
||||
*
|
||||
* Declarations of functions in the platform independent public Itcl API.
|
||||
*
|
||||
* See the file "license.terms" for information on usage and redistribution
|
||||
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
*/
|
||||
|
||||
#ifndef _ITCLDECLS
|
||||
#define _ITCLDECLS
|
||||
|
||||
/*
|
||||
* WARNING: This file is automatically generated by the tools/genStubs.tcl
|
||||
* script. Any modifications to the function declarations below should be made
|
||||
* in the itcl/generic/tcl.decls script.
|
||||
*/
|
||||
|
||||
/* !BEGIN!: Do not edit below this line. */
|
||||
|
||||
/*
|
||||
* Exported function declarations:
|
||||
*/
|
||||
|
||||
#ifndef Itcl_Init_TCL_DECLARED
|
||||
#define Itcl_Init_TCL_DECLARED
|
||||
/* 0 */
|
||||
TCL_EXTERN(int) Itcl_Init _ANSI_ARGS_((Tcl_Interp * interp));
|
||||
#endif
|
||||
#ifndef Itcl_SafeInit_TCL_DECLARED
|
||||
#define Itcl_SafeInit_TCL_DECLARED
|
||||
/* 1 */
|
||||
TCL_EXTERN(int) Itcl_SafeInit _ANSI_ARGS_((Tcl_Interp * interp));
|
||||
#endif
|
||||
#ifndef Itcl_RegisterC_TCL_DECLARED
|
||||
#define Itcl_RegisterC_TCL_DECLARED
|
||||
/* 2 */
|
||||
TCL_EXTERN(int) Itcl_RegisterC _ANSI_ARGS_((Tcl_Interp * interp,
|
||||
CONST char * name, Tcl_CmdProc * proc,
|
||||
ClientData clientData,
|
||||
Tcl_CmdDeleteProc * deleteProc));
|
||||
#endif
|
||||
#ifndef Itcl_RegisterObjC_TCL_DECLARED
|
||||
#define Itcl_RegisterObjC_TCL_DECLARED
|
||||
/* 3 */
|
||||
TCL_EXTERN(int) Itcl_RegisterObjC _ANSI_ARGS_((Tcl_Interp * interp,
|
||||
CONST char * name, Tcl_ObjCmdProc * proc,
|
||||
ClientData clientData,
|
||||
Tcl_CmdDeleteProc * deleteProc));
|
||||
#endif
|
||||
#ifndef Itcl_FindC_TCL_DECLARED
|
||||
#define Itcl_FindC_TCL_DECLARED
|
||||
/* 4 */
|
||||
TCL_EXTERN(int) Itcl_FindC _ANSI_ARGS_((Tcl_Interp * interp,
|
||||
CONST char * name, Tcl_CmdProc ** argProcPtr,
|
||||
Tcl_ObjCmdProc ** objProcPtr,
|
||||
ClientData * cDataPtr));
|
||||
#endif
|
||||
#ifndef Itcl_InitStack_TCL_DECLARED
|
||||
#define Itcl_InitStack_TCL_DECLARED
|
||||
/* 5 */
|
||||
TCL_EXTERN(void) Itcl_InitStack _ANSI_ARGS_((Itcl_Stack * stack));
|
||||
#endif
|
||||
#ifndef Itcl_DeleteStack_TCL_DECLARED
|
||||
#define Itcl_DeleteStack_TCL_DECLARED
|
||||
/* 6 */
|
||||
TCL_EXTERN(void) Itcl_DeleteStack _ANSI_ARGS_((Itcl_Stack * stack));
|
||||
#endif
|
||||
#ifndef Itcl_PushStack_TCL_DECLARED
|
||||
#define Itcl_PushStack_TCL_DECLARED
|
||||
/* 7 */
|
||||
TCL_EXTERN(void) Itcl_PushStack _ANSI_ARGS_((ClientData cdata,
|
||||
Itcl_Stack * stack));
|
||||
#endif
|
||||
#ifndef Itcl_PopStack_TCL_DECLARED
|
||||
#define Itcl_PopStack_TCL_DECLARED
|
||||
/* 8 */
|
||||
TCL_EXTERN(ClientData) Itcl_PopStack _ANSI_ARGS_((Itcl_Stack * stack));
|
||||
#endif
|
||||
#ifndef Itcl_PeekStack_TCL_DECLARED
|
||||
#define Itcl_PeekStack_TCL_DECLARED
|
||||
/* 9 */
|
||||
TCL_EXTERN(ClientData) Itcl_PeekStack _ANSI_ARGS_((Itcl_Stack * stack));
|
||||
#endif
|
||||
#ifndef Itcl_GetStackValue_TCL_DECLARED
|
||||
#define Itcl_GetStackValue_TCL_DECLARED
|
||||
/* 10 */
|
||||
TCL_EXTERN(ClientData) Itcl_GetStackValue _ANSI_ARGS_((Itcl_Stack * stack,
|
||||
int pos));
|
||||
#endif
|
||||
#ifndef Itcl_InitList_TCL_DECLARED
|
||||
#define Itcl_InitList_TCL_DECLARED
|
||||
/* 11 */
|
||||
TCL_EXTERN(void) Itcl_InitList _ANSI_ARGS_((Itcl_List * listPtr));
|
||||
#endif
|
||||
#ifndef Itcl_DeleteList_TCL_DECLARED
|
||||
#define Itcl_DeleteList_TCL_DECLARED
|
||||
/* 12 */
|
||||
TCL_EXTERN(void) Itcl_DeleteList _ANSI_ARGS_((Itcl_List * listPtr));
|
||||
#endif
|
||||
#ifndef Itcl_CreateListElem_TCL_DECLARED
|
||||
#define Itcl_CreateListElem_TCL_DECLARED
|
||||
/* 13 */
|
||||
TCL_EXTERN(Itcl_ListElem*) Itcl_CreateListElem _ANSI_ARGS_((
|
||||
Itcl_List * listPtr));
|
||||
#endif
|
||||
#ifndef Itcl_DeleteListElem_TCL_DECLARED
|
||||
#define Itcl_DeleteListElem_TCL_DECLARED
|
||||
/* 14 */
|
||||
TCL_EXTERN(Itcl_ListElem*) Itcl_DeleteListElem _ANSI_ARGS_((
|
||||
Itcl_ListElem * elemPtr));
|
||||
#endif
|
||||
#ifndef Itcl_InsertList_TCL_DECLARED
|
||||
#define Itcl_InsertList_TCL_DECLARED
|
||||
/* 15 */
|
||||
TCL_EXTERN(Itcl_ListElem*) Itcl_InsertList _ANSI_ARGS_((Itcl_List * listPtr,
|
||||
ClientData val));
|
||||
#endif
|
||||
#ifndef Itcl_InsertListElem_TCL_DECLARED
|
||||
#define Itcl_InsertListElem_TCL_DECLARED
|
||||
/* 16 */
|
||||
TCL_EXTERN(Itcl_ListElem*) Itcl_InsertListElem _ANSI_ARGS_((
|
||||
Itcl_ListElem * pos, ClientData val));
|
||||
#endif
|
||||
#ifndef Itcl_AppendList_TCL_DECLARED
|
||||
#define Itcl_AppendList_TCL_DECLARED
|
||||
/* 17 */
|
||||
TCL_EXTERN(Itcl_ListElem*) Itcl_AppendList _ANSI_ARGS_((Itcl_List * listPtr,
|
||||
ClientData val));
|
||||
#endif
|
||||
#ifndef Itcl_AppendListElem_TCL_DECLARED
|
||||
#define Itcl_AppendListElem_TCL_DECLARED
|
||||
/* 18 */
|
||||
TCL_EXTERN(Itcl_ListElem*) Itcl_AppendListElem _ANSI_ARGS_((
|
||||
Itcl_ListElem * pos, ClientData val));
|
||||
#endif
|
||||
#ifndef Itcl_SetListValue_TCL_DECLARED
|
||||
#define Itcl_SetListValue_TCL_DECLARED
|
||||
/* 19 */
|
||||
TCL_EXTERN(void) Itcl_SetListValue _ANSI_ARGS_((
|
||||
Itcl_ListElem * elemPtr, ClientData val));
|
||||
#endif
|
||||
#ifndef Itcl_EventuallyFree_TCL_DECLARED
|
||||
#define Itcl_EventuallyFree_TCL_DECLARED
|
||||
/* 20 */
|
||||
TCL_EXTERN(void) Itcl_EventuallyFree _ANSI_ARGS_((ClientData cdata,
|
||||
Tcl_FreeProc * fproc));
|
||||
#endif
|
||||
#ifndef Itcl_PreserveData_TCL_DECLARED
|
||||
#define Itcl_PreserveData_TCL_DECLARED
|
||||
/* 21 */
|
||||
TCL_EXTERN(void) Itcl_PreserveData _ANSI_ARGS_((ClientData cdata));
|
||||
#endif
|
||||
#ifndef Itcl_ReleaseData_TCL_DECLARED
|
||||
#define Itcl_ReleaseData_TCL_DECLARED
|
||||
/* 22 */
|
||||
TCL_EXTERN(void) Itcl_ReleaseData _ANSI_ARGS_((ClientData cdata));
|
||||
#endif
|
||||
#ifndef Itcl_SaveInterpState_TCL_DECLARED
|
||||
#define Itcl_SaveInterpState_TCL_DECLARED
|
||||
/* 23 */
|
||||
TCL_EXTERN(Itcl_InterpState) Itcl_SaveInterpState _ANSI_ARGS_((
|
||||
Tcl_Interp* interp, int status));
|
||||
#endif
|
||||
#ifndef Itcl_RestoreInterpState_TCL_DECLARED
|
||||
#define Itcl_RestoreInterpState_TCL_DECLARED
|
||||
/* 24 */
|
||||
TCL_EXTERN(int) Itcl_RestoreInterpState _ANSI_ARGS_((
|
||||
Tcl_Interp* interp, Itcl_InterpState state));
|
||||
#endif
|
||||
#ifndef Itcl_DiscardInterpState_TCL_DECLARED
|
||||
#define Itcl_DiscardInterpState_TCL_DECLARED
|
||||
/* 25 */
|
||||
TCL_EXTERN(void) Itcl_DiscardInterpState _ANSI_ARGS_((
|
||||
Itcl_InterpState state));
|
||||
#endif
|
||||
|
||||
typedef struct ItclStubHooks {
|
||||
struct ItclIntStubs *itclIntStubs;
|
||||
} ItclStubHooks;
|
||||
|
||||
typedef struct ItclStubs {
|
||||
int magic;
|
||||
struct ItclStubHooks *hooks;
|
||||
|
||||
int (*itcl_Init) _ANSI_ARGS_((Tcl_Interp * interp)); /* 0 */
|
||||
int (*itcl_SafeInit) _ANSI_ARGS_((Tcl_Interp * interp)); /* 1 */
|
||||
int (*itcl_RegisterC) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * name, Tcl_CmdProc * proc, ClientData clientData, Tcl_CmdDeleteProc * deleteProc)); /* 2 */
|
||||
int (*itcl_RegisterObjC) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * name, Tcl_ObjCmdProc * proc, ClientData clientData, Tcl_CmdDeleteProc * deleteProc)); /* 3 */
|
||||
int (*itcl_FindC) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * name, Tcl_CmdProc ** argProcPtr, Tcl_ObjCmdProc ** objProcPtr, ClientData * cDataPtr)); /* 4 */
|
||||
void (*itcl_InitStack) _ANSI_ARGS_((Itcl_Stack * stack)); /* 5 */
|
||||
void (*itcl_DeleteStack) _ANSI_ARGS_((Itcl_Stack * stack)); /* 6 */
|
||||
void (*itcl_PushStack) _ANSI_ARGS_((ClientData cdata, Itcl_Stack * stack)); /* 7 */
|
||||
ClientData (*itcl_PopStack) _ANSI_ARGS_((Itcl_Stack * stack)); /* 8 */
|
||||
ClientData (*itcl_PeekStack) _ANSI_ARGS_((Itcl_Stack * stack)); /* 9 */
|
||||
ClientData (*itcl_GetStackValue) _ANSI_ARGS_((Itcl_Stack * stack, int pos)); /* 10 */
|
||||
void (*itcl_InitList) _ANSI_ARGS_((Itcl_List * listPtr)); /* 11 */
|
||||
void (*itcl_DeleteList) _ANSI_ARGS_((Itcl_List * listPtr)); /* 12 */
|
||||
Itcl_ListElem* (*itcl_CreateListElem) _ANSI_ARGS_((Itcl_List * listPtr)); /* 13 */
|
||||
Itcl_ListElem* (*itcl_DeleteListElem) _ANSI_ARGS_((Itcl_ListElem * elemPtr)); /* 14 */
|
||||
Itcl_ListElem* (*itcl_InsertList) _ANSI_ARGS_((Itcl_List * listPtr, ClientData val)); /* 15 */
|
||||
Itcl_ListElem* (*itcl_InsertListElem) _ANSI_ARGS_((Itcl_ListElem * pos, ClientData val)); /* 16 */
|
||||
Itcl_ListElem* (*itcl_AppendList) _ANSI_ARGS_((Itcl_List * listPtr, ClientData val)); /* 17 */
|
||||
Itcl_ListElem* (*itcl_AppendListElem) _ANSI_ARGS_((Itcl_ListElem * pos, ClientData val)); /* 18 */
|
||||
void (*itcl_SetListValue) _ANSI_ARGS_((Itcl_ListElem * elemPtr, ClientData val)); /* 19 */
|
||||
void (*itcl_EventuallyFree) _ANSI_ARGS_((ClientData cdata, Tcl_FreeProc * fproc)); /* 20 */
|
||||
void (*itcl_PreserveData) _ANSI_ARGS_((ClientData cdata)); /* 21 */
|
||||
void (*itcl_ReleaseData) _ANSI_ARGS_((ClientData cdata)); /* 22 */
|
||||
Itcl_InterpState (*itcl_SaveInterpState) _ANSI_ARGS_((Tcl_Interp* interp, int status)); /* 23 */
|
||||
int (*itcl_RestoreInterpState) _ANSI_ARGS_((Tcl_Interp* interp, Itcl_InterpState state)); /* 24 */
|
||||
void (*itcl_DiscardInterpState) _ANSI_ARGS_((Itcl_InterpState state)); /* 25 */
|
||||
} ItclStubs;
|
||||
|
||||
TCL_EXTERNC ItclStubs *itclStubsPtr;
|
||||
|
||||
#if defined(USE_ITCL_STUBS) && !defined(USE_ITCL_STUB_PROCS)
|
||||
|
||||
/*
|
||||
* Inline function declarations:
|
||||
*/
|
||||
|
||||
#ifndef Itcl_Init
|
||||
#define Itcl_Init \
|
||||
(itclStubsPtr->itcl_Init) /* 0 */
|
||||
#endif
|
||||
#ifndef Itcl_SafeInit
|
||||
#define Itcl_SafeInit \
|
||||
(itclStubsPtr->itcl_SafeInit) /* 1 */
|
||||
#endif
|
||||
#ifndef Itcl_RegisterC
|
||||
#define Itcl_RegisterC \
|
||||
(itclStubsPtr->itcl_RegisterC) /* 2 */
|
||||
#endif
|
||||
#ifndef Itcl_RegisterObjC
|
||||
#define Itcl_RegisterObjC \
|
||||
(itclStubsPtr->itcl_RegisterObjC) /* 3 */
|
||||
#endif
|
||||
#ifndef Itcl_FindC
|
||||
#define Itcl_FindC \
|
||||
(itclStubsPtr->itcl_FindC) /* 4 */
|
||||
#endif
|
||||
#ifndef Itcl_InitStack
|
||||
#define Itcl_InitStack \
|
||||
(itclStubsPtr->itcl_InitStack) /* 5 */
|
||||
#endif
|
||||
#ifndef Itcl_DeleteStack
|
||||
#define Itcl_DeleteStack \
|
||||
(itclStubsPtr->itcl_DeleteStack) /* 6 */
|
||||
#endif
|
||||
#ifndef Itcl_PushStack
|
||||
#define Itcl_PushStack \
|
||||
(itclStubsPtr->itcl_PushStack) /* 7 */
|
||||
#endif
|
||||
#ifndef Itcl_PopStack
|
||||
#define Itcl_PopStack \
|
||||
(itclStubsPtr->itcl_PopStack) /* 8 */
|
||||
#endif
|
||||
#ifndef Itcl_PeekStack
|
||||
#define Itcl_PeekStack \
|
||||
(itclStubsPtr->itcl_PeekStack) /* 9 */
|
||||
#endif
|
||||
#ifndef Itcl_GetStackValue
|
||||
#define Itcl_GetStackValue \
|
||||
(itclStubsPtr->itcl_GetStackValue) /* 10 */
|
||||
#endif
|
||||
#ifndef Itcl_InitList
|
||||
#define Itcl_InitList \
|
||||
(itclStubsPtr->itcl_InitList) /* 11 */
|
||||
#endif
|
||||
#ifndef Itcl_DeleteList
|
||||
#define Itcl_DeleteList \
|
||||
(itclStubsPtr->itcl_DeleteList) /* 12 */
|
||||
#endif
|
||||
#ifndef Itcl_CreateListElem
|
||||
#define Itcl_CreateListElem \
|
||||
(itclStubsPtr->itcl_CreateListElem) /* 13 */
|
||||
#endif
|
||||
#ifndef Itcl_DeleteListElem
|
||||
#define Itcl_DeleteListElem \
|
||||
(itclStubsPtr->itcl_DeleteListElem) /* 14 */
|
||||
#endif
|
||||
#ifndef Itcl_InsertList
|
||||
#define Itcl_InsertList \
|
||||
(itclStubsPtr->itcl_InsertList) /* 15 */
|
||||
#endif
|
||||
#ifndef Itcl_InsertListElem
|
||||
#define Itcl_InsertListElem \
|
||||
(itclStubsPtr->itcl_InsertListElem) /* 16 */
|
||||
#endif
|
||||
#ifndef Itcl_AppendList
|
||||
#define Itcl_AppendList \
|
||||
(itclStubsPtr->itcl_AppendList) /* 17 */
|
||||
#endif
|
||||
#ifndef Itcl_AppendListElem
|
||||
#define Itcl_AppendListElem \
|
||||
(itclStubsPtr->itcl_AppendListElem) /* 18 */
|
||||
#endif
|
||||
#ifndef Itcl_SetListValue
|
||||
#define Itcl_SetListValue \
|
||||
(itclStubsPtr->itcl_SetListValue) /* 19 */
|
||||
#endif
|
||||
#ifndef Itcl_EventuallyFree
|
||||
#define Itcl_EventuallyFree \
|
||||
(itclStubsPtr->itcl_EventuallyFree) /* 20 */
|
||||
#endif
|
||||
#ifndef Itcl_PreserveData
|
||||
#define Itcl_PreserveData \
|
||||
(itclStubsPtr->itcl_PreserveData) /* 21 */
|
||||
#endif
|
||||
#ifndef Itcl_ReleaseData
|
||||
#define Itcl_ReleaseData \
|
||||
(itclStubsPtr->itcl_ReleaseData) /* 22 */
|
||||
#endif
|
||||
#ifndef Itcl_SaveInterpState
|
||||
#define Itcl_SaveInterpState \
|
||||
(itclStubsPtr->itcl_SaveInterpState) /* 23 */
|
||||
#endif
|
||||
#ifndef Itcl_RestoreInterpState
|
||||
#define Itcl_RestoreInterpState \
|
||||
(itclStubsPtr->itcl_RestoreInterpState) /* 24 */
|
||||
#endif
|
||||
#ifndef Itcl_DiscardInterpState
|
||||
#define Itcl_DiscardInterpState \
|
||||
(itclStubsPtr->itcl_DiscardInterpState) /* 25 */
|
||||
#endif
|
||||
|
||||
#endif /* defined(USE_ITCL_STUBS) && !defined(USE_ITCL_STUB_PROCS) */
|
||||
|
||||
/* !END!: Do not edit above this line. */
|
||||
|
||||
#endif /* _ITCLDECLS */
|
||||
|
||||
@@ -0,0 +1,468 @@
|
||||
/*
|
||||
* ------------------------------------------------------------------------
|
||||
* PACKAGE: [incr Tcl]
|
||||
* DESCRIPTION: Object-Oriented Extensions to Tcl
|
||||
*
|
||||
* [incr Tcl] provides object-oriented extensions to Tcl, much as
|
||||
* C++ provides object-oriented extensions to C. It provides a means
|
||||
* of encapsulating related procedures together with their shared data
|
||||
* in a local namespace that is hidden from the outside world. It
|
||||
* promotes code re-use through inheritance. More than anything else,
|
||||
* it encourages better organization of Tcl applications through the
|
||||
* object-oriented paradigm, leading to code that is easier to
|
||||
* understand and maintain.
|
||||
*
|
||||
* ADDING [incr Tcl] TO A Tcl-BASED APPLICATION:
|
||||
*
|
||||
* To add [incr Tcl] facilities to a Tcl application, modify the
|
||||
* Tcl_AppInit() routine as follows:
|
||||
*
|
||||
* 1) Include this header file near the top of the file containing
|
||||
* Tcl_AppInit():
|
||||
*
|
||||
* #include "itcl.h"
|
||||
*
|
||||
* 2) Within the body of Tcl_AppInit(), add the following lines:
|
||||
*
|
||||
* if (Itcl_Init(interp) == TCL_ERROR) {
|
||||
* return TCL_ERROR;
|
||||
* }
|
||||
*
|
||||
* 3) Link your application with libitcl.a
|
||||
*
|
||||
* NOTE: An example file "tclAppInit.c" containing the changes shown
|
||||
* above is included in this distribution.
|
||||
*
|
||||
* ========================================================================
|
||||
* AUTHOR: Michael J. McLennan
|
||||
* Bell Labs Innovations for Lucent Technologies
|
||||
* mmclennan@lucent.com
|
||||
* http://www.tcltk.com/itcl
|
||||
* ========================================================================
|
||||
* Copyright (c) 1993-1998 Lucent Technologies, Inc.
|
||||
* ------------------------------------------------------------------------
|
||||
* See the file "license.terms" for information on usage and redistribution
|
||||
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
*/
|
||||
#ifndef ITCLINT_H
|
||||
#define ITCLINT_H
|
||||
|
||||
#include "tclInt.h"
|
||||
#include "itcl.h"
|
||||
|
||||
#ifdef BUILD_itcl
|
||||
# undef TCL_STORAGE_CLASS
|
||||
# define TCL_STORAGE_CLASS DLLEXPORT
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Handle hiding of errorLine in 8.6
|
||||
*/
|
||||
#if (TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION < 6)
|
||||
#define Tcl_GetErrorLine(interp) ((interp)->errorLine)
|
||||
#endif
|
||||
|
||||
#define ITCL_TCL_PRE_8_5 (TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION < 5)
|
||||
|
||||
#define ItclCallFrame CallFrame
|
||||
|
||||
#if !ITCL_TCL_PRE_8_5
|
||||
|
||||
#define Itcl_CallFrame Tcl_CallFrame
|
||||
|
||||
#if defined(USE_TCL_STUBS)
|
||||
|
||||
/*
|
||||
* Fix Tcl bug #803489 the right way. We need to always use the old Stub
|
||||
* slot positions, not the new broken ones part of TIP 127. I do like
|
||||
* that these functions have moved to the public space (about time), but
|
||||
* the slot change is the killer and is the painful side affect.
|
||||
*/
|
||||
|
||||
# undef Tcl_CreateNamespace
|
||||
# define Tcl_CreateNamespace \
|
||||
(tclIntStubsPtr->tcl_CreateNamespace)
|
||||
# undef Tcl_DeleteNamespace
|
||||
# define Tcl_DeleteNamespace \
|
||||
(tclIntStubsPtr->tcl_DeleteNamespace)
|
||||
# undef Tcl_AppendExportList
|
||||
# define Tcl_AppendExportList \
|
||||
(tclIntStubsPtr->tcl_AppendExportList)
|
||||
# undef Tcl_Export
|
||||
# define Tcl_Export \
|
||||
(tclIntStubsPtr->tcl_Export)
|
||||
# undef Tcl_Import
|
||||
# define Tcl_Import \
|
||||
(tclIntStubsPtr->tcl_Import)
|
||||
# undef Tcl_ForgetImport
|
||||
# define Tcl_ForgetImport \
|
||||
(tclIntStubsPtr->tcl_ForgetImport)
|
||||
# undef Tcl_GetCurrentNamespace
|
||||
# define Tcl_GetCurrentNamespace \
|
||||
(tclIntStubsPtr->tcl_GetCurrentNamespace)
|
||||
# undef Tcl_GetGlobalNamespace
|
||||
# define Tcl_GetGlobalNamespace \
|
||||
(tclIntStubsPtr->tcl_GetGlobalNamespace)
|
||||
# undef Tcl_FindNamespace
|
||||
# define Tcl_FindNamespace \
|
||||
(tclIntStubsPtr->tcl_FindNamespace)
|
||||
# undef Tcl_FindCommand
|
||||
# define Tcl_FindCommand \
|
||||
(tclIntStubsPtr->tcl_FindCommand)
|
||||
# undef Tcl_GetCommandFromObj
|
||||
# define Tcl_GetCommandFromObj \
|
||||
(tclIntStubsPtr->tcl_GetCommandFromObj)
|
||||
# undef Tcl_GetCommandFullName
|
||||
# define Tcl_GetCommandFullName \
|
||||
(tclIntStubsPtr->tcl_GetCommandFullName)
|
||||
#endif /* use stubs */
|
||||
|
||||
#define ItclInitVarFlags(varPtr) \
|
||||
(varPtr)->flags = 0
|
||||
|
||||
#define ItclInitVarArgument(varPtr) \
|
||||
(varPtr)->flags = VAR_ARGUMENT
|
||||
|
||||
#define ItclVarHashCreateVar(tablePtr, key, newPtr) \
|
||||
TclVarHashCreateVar((tablePtr), (key), (newPtr))
|
||||
|
||||
#define ItclVarRefCount(varPtr) VarHashRefCount(varPtr)
|
||||
|
||||
#define ItclClearVarUndefined(varPtr)
|
||||
|
||||
#define ItclNextLocal(varPtr) ((varPtr)++)
|
||||
|
||||
#define ItclVarObjValue(varPtr) ((varPtr)->value.objPtr)
|
||||
|
||||
#define itclVarInHashSize sizeof(VarInHash)
|
||||
#define itclVarLocalSize sizeof(Var)
|
||||
|
||||
#else /* Compiling on Tcl8.x, x<5 */
|
||||
|
||||
typedef struct Itcl_CallFrame {
|
||||
Tcl_Namespace *nsPtr;
|
||||
int dummy1;
|
||||
int dummy2;
|
||||
void *dummy3;
|
||||
void *dummy4;
|
||||
void *dummy5;
|
||||
int dummy6;
|
||||
void *dummy7;
|
||||
void *dummy8;
|
||||
int dummy9;
|
||||
void *dummy10;
|
||||
void *dummy11;
|
||||
void *dummy12;
|
||||
void *dummy13;
|
||||
} Itcl_CallFrame;
|
||||
|
||||
/*
|
||||
* Definition of runtime behaviour to be able to run irrespective of the Tcl
|
||||
* version.
|
||||
*/
|
||||
|
||||
#define VarInHash Var
|
||||
|
||||
#define TclVarHashTable Tcl_HashTable
|
||||
|
||||
typedef struct ItclShortVar {
|
||||
int flags;
|
||||
union {
|
||||
Tcl_Obj *objPtr;
|
||||
TclVarHashTable *tablePtr;
|
||||
struct Var *linkPtr;
|
||||
} value;
|
||||
} ItclShortVar;
|
||||
|
||||
typedef struct ItclVarInHash {
|
||||
ItclShortVar var;
|
||||
int refCount;
|
||||
Tcl_HashEntry entry;
|
||||
} ItclVarInHash;
|
||||
|
||||
#define ItclOffset(type, field) ((int) ((char *) &((type *) 0)->field))
|
||||
|
||||
#define itclOldRuntime (itclVarFlagOffset!=0)
|
||||
|
||||
extern int itclVarFlagOffset;
|
||||
extern int itclVarRefCountOffset;
|
||||
extern int itclVarInHashSize;
|
||||
extern int itclVarLocalSize;
|
||||
extern int itclVarValueOffset;
|
||||
|
||||
/*
|
||||
* VarReform related macros: provide access to the Var fields with offsets
|
||||
* determined at load time, so that the same code copes with the different
|
||||
* structs in Tcl8.5 and previous Tcl.
|
||||
*/
|
||||
|
||||
#define ItclNextLocal(varPtr) \
|
||||
((varPtr) = (Var *) (((char *)(varPtr))+itclVarLocalSize))
|
||||
|
||||
#define ItclVarObjValue(varPtr) \
|
||||
(*((Tcl_Obj **) (((char *)(varPtr))+itclVarValueOffset)))
|
||||
|
||||
#define ItclVarRefCount(varPtr) \
|
||||
(*((int *) (((char *)(varPtr))+itclVarRefCountOffset)))
|
||||
|
||||
#define ItclVarFlags(varPtr) \
|
||||
(*((int *)(((char *)(varPtr))+itclVarFlagOffset)))
|
||||
|
||||
/* Note that itclVarFlagOffset==0 exactly when we are running in Tcl8.5 */
|
||||
#define ItclInitVarFlags(varPtr) \
|
||||
if (itclOldRuntime) { \
|
||||
(varPtr)->flags = (VAR_SCALAR | VAR_UNDEFINED | VAR_IN_HASHTABLE);\
|
||||
} else { \
|
||||
((ItclShortVar *)(varPtr))->flags = 0;\
|
||||
}
|
||||
|
||||
/* This is used for CompiledLocal, not for Var & Co. That struct did not
|
||||
* change, but the correct flag init did! The flags bits themselves are
|
||||
* unchanged */
|
||||
|
||||
#define ItclInitVarArgument(varPtr) \
|
||||
if (itclOldRuntime) { \
|
||||
(varPtr)->flags = (VAR_SCALAR | VAR_ARGUMENT);\
|
||||
} else { \
|
||||
(varPtr)->flags = VAR_ARGUMENT;\
|
||||
}
|
||||
|
||||
#define TclIsVarNamespaceVar(varPtr) \
|
||||
(ItclVarFlags(varPtr) & VAR_NAMESPACE_VAR)
|
||||
|
||||
#define TclSetVarNamespaceVar(varPtr) \
|
||||
if (!TclIsVarNamespaceVar(varPtr)) {\
|
||||
ItclVarFlags(varPtr) |= VAR_NAMESPACE_VAR;\
|
||||
ItclVarRefCount(varPtr)++;\
|
||||
}
|
||||
|
||||
#define ItclClearVarUndefined(varPtr) \
|
||||
if (itclOldRuntime) { \
|
||||
ItclVarFlags(varPtr) &= ~VAR_UNDEFINED;\
|
||||
}
|
||||
|
||||
#ifndef MODULE_SCOPE
|
||||
#define MODULE_SCOPE
|
||||
#endif
|
||||
|
||||
MODULE_SCOPE Var * ItclVarHashCreateVar (TclVarHashTable * tablePtr,
|
||||
const char * key, int * newPtr);
|
||||
|
||||
#endif /* Version dependent defs and macros */
|
||||
|
||||
|
||||
#define ItclVarHashFindVar(tablePtr, key) \
|
||||
ItclVarHashCreateVar((tablePtr), (key), NULL)
|
||||
|
||||
|
||||
/*
|
||||
* Common info for managing all known objects.
|
||||
* Each interpreter has one of these data structures stored as
|
||||
* clientData in the "itcl" namespace. It is also accessible
|
||||
* as associated data via the key ITCL_INTERP_DATA.
|
||||
*/
|
||||
struct ItclObject;
|
||||
typedef struct ItclObjectInfo {
|
||||
Tcl_Interp *interp; /* interpreter that manages this info */
|
||||
Tcl_HashTable objects; /* list of all known objects */
|
||||
|
||||
Itcl_Stack transparentFrames; /* stack of call frames that should be
|
||||
* treated transparently. When
|
||||
* Itcl_EvalMemberCode is invoked in
|
||||
* one of these contexts, it does an
|
||||
* "uplevel" to get past the transparent
|
||||
* frame and back to the calling context. */
|
||||
Tcl_HashTable contextFrames; /* object contexts for active call frames */
|
||||
|
||||
int protection; /* protection level currently in effect */
|
||||
|
||||
Itcl_Stack cdefnStack; /* stack of class definitions currently
|
||||
* being parsed */
|
||||
} ItclObjectInfo;
|
||||
|
||||
#define ITCL_INTERP_DATA "itcl_data"
|
||||
|
||||
/*
|
||||
* Representation for each [incr Tcl] class.
|
||||
*/
|
||||
typedef struct ItclClass {
|
||||
char *name; /* class name */
|
||||
char *fullname; /* fully qualified class name */
|
||||
Tcl_Interp *interp; /* interpreter that manages this info */
|
||||
Tcl_Namespace *namesp; /* namespace representing class scope */
|
||||
Tcl_Command accessCmd; /* access command for creating instances */
|
||||
|
||||
struct ItclObjectInfo *info; /* info about all known objects */
|
||||
Itcl_List bases; /* list of base classes */
|
||||
Itcl_List derived; /* list of all derived classes */
|
||||
Tcl_HashTable heritage; /* table of all base classes. Look up
|
||||
* by pointer to class definition. This
|
||||
* provides fast lookup for inheritance
|
||||
* tests. */
|
||||
Tcl_Obj *initCode; /* initialization code for new objs */
|
||||
Tcl_HashTable variables; /* definitions for all data members
|
||||
in this class. Look up simple string
|
||||
names and get back ItclVarDefn* ptrs */
|
||||
Tcl_HashTable functions; /* definitions for all member functions
|
||||
in this class. Look up simple string
|
||||
names and get back ItclMemberFunc* ptrs */
|
||||
int numInstanceVars; /* number of instance vars in variables
|
||||
table */
|
||||
Tcl_HashTable resolveVars; /* all possible names for variables in
|
||||
* this class (e.g., x, foo::x, etc.) */
|
||||
Tcl_HashTable resolveCmds; /* all possible names for functions in
|
||||
* this class (e.g., x, foo::x, etc.) */
|
||||
int unique; /* unique number for #auto generation */
|
||||
int flags; /* maintains class status */
|
||||
} ItclClass;
|
||||
|
||||
typedef struct ItclHierIter {
|
||||
ItclClass *current; /* current position in hierarchy */
|
||||
Itcl_Stack stack; /* stack used for traversal */
|
||||
} ItclHierIter;
|
||||
|
||||
/*
|
||||
* Representation for each [incr Tcl] object.
|
||||
*/
|
||||
typedef struct ItclObject {
|
||||
ItclClass *classDefn; /* most-specific class */
|
||||
Tcl_Command accessCmd; /* object access command */
|
||||
|
||||
int dataSize; /* number of elements in data array */
|
||||
Var** data; /* all object-specific data members */
|
||||
Tcl_HashTable* constructed; /* temp storage used during construction */
|
||||
Tcl_HashTable* destructed; /* temp storage used during destruction */
|
||||
} ItclObject;
|
||||
|
||||
#define ITCL_IGNORE_ERRS 0x002 /* useful for construction/destruction */
|
||||
|
||||
/*
|
||||
* Implementation for any code body in an [incr Tcl] class.
|
||||
*/
|
||||
typedef struct ItclMemberCode {
|
||||
int flags; /* flags describing implementation */
|
||||
CompiledLocal *arglist; /* list of arg names and initial values */
|
||||
int argcount; /* number of args in arglist */
|
||||
Proc *procPtr; /* Tcl proc representation (needed to
|
||||
* handle compiled locals) */
|
||||
union {
|
||||
Tcl_CmdProc *argCmd; /* (argc,argv) C implementation */
|
||||
Tcl_ObjCmdProc *objCmd; /* (objc,objv) C implementation */
|
||||
} cfunc;
|
||||
|
||||
ClientData clientData; /* client data for C implementations */
|
||||
|
||||
} ItclMemberCode;
|
||||
|
||||
#define Itcl_IsMemberCodeImplemented(mcode) \
|
||||
(((mcode)->flags & ITCL_IMPLEMENT_NONE) == 0)
|
||||
|
||||
/*
|
||||
* Basic representation for class members (commands/variables)
|
||||
*/
|
||||
typedef struct ItclMember {
|
||||
Tcl_Interp* interp; /* interpreter containing the class */
|
||||
ItclClass* classDefn; /* class containing this member */
|
||||
char* name; /* member name */
|
||||
char* fullname; /* member name with "class::" qualifier */
|
||||
int protection; /* protection level */
|
||||
int flags; /* flags describing member (see below) */
|
||||
ItclMemberCode *code; /* code associated with member */
|
||||
} ItclMember;
|
||||
|
||||
/*
|
||||
* Flag bits for ItclMemberCode and ItclMember:
|
||||
*/
|
||||
#define ITCL_IMPLEMENT_NONE 0x001 /* no implementation */
|
||||
#define ITCL_IMPLEMENT_TCL 0x002 /* Tcl implementation */
|
||||
#define ITCL_IMPLEMENT_ARGCMD 0x004 /* (argc,argv) C implementation */
|
||||
#define ITCL_IMPLEMENT_OBJCMD 0x008 /* (objc,objv) C implementation */
|
||||
#define ITCL_IMPLEMENT_C 0x00c /* either kind of C implementation */
|
||||
#define ITCL_CONSTRUCTOR 0x010 /* non-zero => is a constructor */
|
||||
#define ITCL_DESTRUCTOR 0x020 /* non-zero => is a destructor */
|
||||
#define ITCL_COMMON 0x040 /* non-zero => is a "proc" */
|
||||
#define ITCL_ARG_SPEC 0x080 /* non-zero => has an argument spec */
|
||||
|
||||
#define ITCL_OLD_STYLE 0x100 /* non-zero => old-style method
|
||||
* (process "config" argument) */
|
||||
|
||||
#define ITCL_THIS_VAR 0x200 /* non-zero => built-in "this" variable */
|
||||
|
||||
/*
|
||||
* Representation of member functions in an [incr Tcl] class.
|
||||
*/
|
||||
typedef struct ItclMemberFunc {
|
||||
ItclMember *member; /* basic member info */
|
||||
Tcl_Command accessCmd; /* Tcl command installed for this function */
|
||||
CompiledLocal *arglist; /* list of arg names and initial values */
|
||||
int argcount; /* number of args in arglist */
|
||||
} ItclMemberFunc;
|
||||
|
||||
/*
|
||||
* Instance variables.
|
||||
*/
|
||||
typedef struct ItclVarDefn {
|
||||
ItclMember *member; /* basic member info */
|
||||
char* init; /* initial value */
|
||||
} ItclVarDefn;
|
||||
|
||||
/*
|
||||
* Instance variable lookup entry.
|
||||
*/
|
||||
typedef struct ItclVarLookup {
|
||||
ItclVarDefn* vdefn; /* variable definition */
|
||||
int usage; /* number of uses for this record */
|
||||
int accessible; /* non-zero => accessible from class with
|
||||
* this lookup record in its resolveVars */
|
||||
char *leastQualName; /* simplist name for this variable, with
|
||||
* the fewest qualifiers. This string is
|
||||
* taken from the resolveVars table, so
|
||||
* it shouldn't be freed. */
|
||||
union {
|
||||
int index; /* index into virtual table (instance data) */
|
||||
Tcl_Var common; /* variable (common data) */
|
||||
} var;
|
||||
} ItclVarLookup;
|
||||
|
||||
/*
|
||||
* Representation for the context in which a body of [incr Tcl]
|
||||
* code executes. In ordinary Tcl, this is a CallFrame. But for
|
||||
* [incr Tcl] code bodies, we must be careful to set up the
|
||||
* CallFrame properly, to plug in instance variables before
|
||||
* executing the code body.
|
||||
*/
|
||||
typedef struct ItclContext {
|
||||
ItclClass *classDefn; /* class definition */
|
||||
Itcl_CallFrame frame; /* call frame for object context */
|
||||
Var *compiledLocals; /* points to storage for compiled locals */
|
||||
Var localStorage[20]; /* default storage for compiled locals */
|
||||
} ItclContext;
|
||||
|
||||
/*
|
||||
* Compatibility flags. Used to support small "hacks". These are stored
|
||||
* in the global variable named itclCompatFlags.
|
||||
*/
|
||||
|
||||
extern int itclCompatFlags;
|
||||
|
||||
#define ITCL_COMPAT_USE_ISTATE_API 0x2 /* Tcl 8.5a2 added interp state APIs */
|
||||
|
||||
#include "itclIntDecls.h"
|
||||
|
||||
/*
|
||||
* Since the Tcl/Tk distribution doesn't perform any asserts,
|
||||
* dynamic loading can fail to find the __assert function.
|
||||
* As a workaround, we'll include our own.
|
||||
*/
|
||||
|
||||
#undef assert
|
||||
#ifndef DEBUG
|
||||
#define assert(EX) ((void)0)
|
||||
#else
|
||||
#define assert(EX) (void)((EX) || (Itcl_Assert(STRINGIFY(EX), __FILE__, __LINE__), 0))
|
||||
#endif /* DEBUG */
|
||||
|
||||
#undef TCL_STORAGE_CLASS
|
||||
#define TCL_STORAGE_CLASS DLLIMPORT
|
||||
|
||||
#endif /* ITCLINT_H */
|
||||
File diff suppressed because it is too large
Load Diff
+1
-1
Submodule itk/itk updated: e697407849...0d1dc9780c
@@ -1,4 +1,5 @@
|
||||
PATCH
|
||||
TCL
|
||||
TK
|
||||
ITCL
|
||||
|
||||
|
||||
+209
-99
@@ -1,106 +1,216 @@
|
||||
diff -Naur itk/configure ITK_BLD/configure
|
||||
--- itk/configure 2026-09-14 11:05:50.343138038 -0400
|
||||
+++ ITK_BLD/configure 2026-09-14 11:04:56.453544503 -0400
|
||||
@@ -7050,7 +7050,9 @@
|
||||
fi
|
||||
# TEA specific:
|
||||
if test x"${XLIBSW}" != x ; then
|
||||
- PKG_LIBS="${PKG_LIBS} ${XLIBSW}"
|
||||
+ # Itk uses Tk stubs and does not make direct Xlib calls. Avoid
|
||||
+ # preserving TEA_PATH_X's platform X libraries.
|
||||
+ :
|
||||
fi
|
||||
|
||||
fi
|
||||
diff -Naur itk/configure.ac ITK_BLD/configure.ac
|
||||
--- itk/configure.ac 2026-09-14 11:07:25.749985453 -0400
|
||||
+++ ITK_BLD/configure.ac 2026-09-14 11:07:25.734985540 -0400
|
||||
@@ -162,7 +162,8 @@
|
||||
|
||||
TEA_PUBLIC_TK_HEADERS
|
||||
#TEA_PRIVATE_TK_HEADERS
|
||||
-TEA_PATH_X
|
||||
+# Itk uses Tk stubs and makes no direct Xlib calls. Its X implementation is
|
||||
+# selected by Tk, so do not add a second platform X library dependency.
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
# We need to enable the threading macros found in tcl.h and tclInt.h.
|
||||
diff -Naur itk/generic/itkBase.c ITK_BLD/generic/itkBase.c
|
||||
--- itk/generic/itkBase.c 2026-09-14 11:07:25.763985372 -0400
|
||||
+++ ITK_BLD/generic/itkBase.c 2026-09-14 11:07:25.701985731 -0400
|
||||
@@ -129,7 +129,7 @@
|
||||
if (Tk_InitStubs(interp, "8.6-", 0) == NULL) {
|
||||
return TCL_ERROR;
|
||||
};
|
||||
- if (Itcl_InitStubs(interp, "4.1", 0) == NULL) {
|
||||
+ if (Itcl_InitStubs(interp, "4.1.1", 0) == NULL) {
|
||||
diff -Naur itk/generic/itk_cmds.c ITK_BLD/generic/itk_cmds.c
|
||||
--- itk/generic/itk_cmds.c 2024-07-10 10:44:13.330651607 -0400
|
||||
+++ ITK_BLD/generic/itk_cmds.c 2024-07-10 10:32:07.734264686 -0400
|
||||
@@ -111,8 +111,7 @@
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
static int
|
||||
-Initialize(interp)
|
||||
- Tcl_Interp *interp; /* interpreter to be updated */
|
||||
+Initialize(Tcl_Interp *interp)
|
||||
{
|
||||
Tcl_Namespace *itkNs, *parserNs;
|
||||
ClientData parserInfo;
|
||||
@@ -256,8 +255,7 @@
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
int
|
||||
-Itk_Init(interp)
|
||||
- Tcl_Interp *interp; /* interpreter to be updated */
|
||||
+Itk_Init(Tcl_Interp *interp)
|
||||
{
|
||||
if (Initialize(interp) != TCL_OK) {
|
||||
return TCL_ERROR;
|
||||
@@ -282,8 +280,7 @@
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
int
|
||||
-Itk_SafeInit(interp)
|
||||
- Tcl_Interp *interp; /* interpreter to be updated */
|
||||
+Itk_SafeInit(Tcl_Interp *interp)
|
||||
{
|
||||
if (Initialize(interp) != TCL_OK) {
|
||||
return TCL_ERROR;
|
||||
@@ -316,11 +313,7 @@
|
||||
*/
|
||||
/* ARGSUSED */
|
||||
int
|
||||
-Itk_ConfigBodyCmd(dummy, interp, objc, objv)
|
||||
- ClientData dummy; /* unused */
|
||||
- Tcl_Interp *interp; /* current interpreter */
|
||||
- int objc; /* number of arguments */
|
||||
- Tcl_Obj *CONST objv[]; /* argument objects */
|
||||
+Itk_ConfigBodyCmd(ClientData dummy, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])
|
||||
{
|
||||
int result = TCL_OK;
|
||||
|
||||
diff -Naur itk/generic/itk_archetype.c ITK_BLD/generic/itk_archetype.c
|
||||
--- itk/generic/itk_archetype.c 2026-05-31 11:06:17
|
||||
+++ ITK_BLD/generic/itk_archetype.c 2026-05-31 11:06:17
|
||||
@@ -3974,6 +3974,8 @@
|
||||
char **confv = NULL;
|
||||
int optc;
|
||||
char **optv = NULL;
|
||||
+ const char **splitConfv = NULL;
|
||||
+ const char **splitOptv = NULL;
|
||||
|
||||
int i, newEntry;
|
||||
Tcl_HashTable *tPtr;
|
||||
@@ -3988,13 +3990,15 @@
|
||||
* Only consider options with all 5 required components. Avoid
|
||||
* aliases like "-bg".
|
||||
*/
|
||||
- if (Tcl_SplitList(interp, options, &confc, &confv) != TCL_OK) {
|
||||
+ if (Tcl_SplitList(interp, options, &confc, &splitConfv) != TCL_OK) {
|
||||
goto tableFail;
|
||||
}
|
||||
+ confv = (char **)splitConfv;
|
||||
for (i=0; i < confc; i++) {
|
||||
- if (Tcl_SplitList(interp, confv[i], &optc, &optv) != TCL_OK) {
|
||||
+ if (Tcl_SplitList(interp, confv[i], &optc, &splitOptv) != TCL_OK) {
|
||||
goto tableFail;
|
||||
}
|
||||
+ optv = (char **)splitOptv;
|
||||
if (optc == 5) { /* avoid aliased options */
|
||||
entry = Tcl_CreateHashEntry(tPtr, optv[0], &newEntry);
|
||||
if (newEntry) {
|
||||
@@ -4089,6 +4093,7 @@
|
||||
|
||||
diff -Naur itk/pkgIndex.tcl.in ITK_BLD/pkgIndex.tcl.in
|
||||
--- itk/pkgIndex.tcl.in 2026-09-14 11:07:25.759985395 -0400
|
||||
+++ ITK_BLD/pkgIndex.tcl.in 2026-09-14 11:07:25.716985644 -0400
|
||||
@@ -3,7 +3,7 @@
|
||||
#
|
||||
int optc, result;
|
||||
char **optv;
|
||||
+ const char **splitOptv = NULL;
|
||||
char *name, *info;
|
||||
Tcl_Obj *resultPtr;
|
||||
|
||||
if {![package vsatisfies [package provide Tcl] 8.6-]} {return}
|
||||
-if {[string length [package provide Itcl]] && ![package vsatisfies [package provide Itcl] 4.1]} return
|
||||
+if {[string length [package provide Itcl]] && ![package vsatisfies [package provide Itcl] 4.1.1]} return
|
||||
if {[package vsatisfies [package provide Tcl] 9.0-]} {
|
||||
package ifneeded itk @PACKAGE_VERSION@ \
|
||||
[list load [file join $dir @PKG_LIB_FILE9@] Itk]
|
||||
diff -Naur itk/win/makefile.vc ITK_BLD/win/makefile.vc
|
||||
--- itk/win/makefile.vc 2026-09-14 11:07:25.785985244 -0400
|
||||
+++ ITK_BLD/win/makefile.vc 2026-09-14 11:07:25.731985557 -0400
|
||||
@@ -60,28 +60,37 @@
|
||||
# In principle, we don't need the ITCL source directory, and an installed
|
||||
# ITCL should suffice. But that needs additional machinery not implemented
|
||||
# yet.
|
||||
+!if "$(ITCLDIR)" != ""
|
||||
+ITCL_DIR = $(ITCLDIR)
|
||||
+!else
|
||||
!if [echo ITCL_DIR = \> nmakehlp.out] \
|
||||
|| [nmakehlp -L generic\itcl.h >> nmakehlp.out]
|
||||
!error Could not locate ITCL source directory.
|
||||
!endif
|
||||
+!include nmakehlp.out
|
||||
+!endif
|
||||
# Locate TK headers and libraries.
|
||||
# In principle, we don't need the TK source directory, and an installed
|
||||
# TK should suffice. But that needs additional machinery not implemented
|
||||
# yet.
|
||||
+!if "$(TKDIR)" != ""
|
||||
+TK_DIR = $(TKDIR)
|
||||
+!else
|
||||
!if [echo TK_DIR = \> nmakehlp.out] \
|
||||
|| [nmakehlp -L generic\tk.h >> nmakehlp.out]
|
||||
!error Could not locate TK source directory.
|
||||
!endif
|
||||
!include nmakehlp.out
|
||||
+!endif
|
||||
@@ -4126,7 +4131,8 @@
|
||||
Tcl_IncrRefCount(resultPtr);
|
||||
info = Tcl_GetStringFromObj(resultPtr, (int*)NULL);
|
||||
|
||||
-# Get the ITCL version from its configure.ac
|
||||
+# Get the ITCL version from its public header.
|
||||
!if [echo ITCL_DOTVERSION = \> versions.vc] \
|
||||
- && [nmakehlp -V "$(ITCL_DIR)\configure.ac" itcl >> versions.vc]
|
||||
+ && [nmakehlp -V "$(ITCL_DIR)\generic\itcl.h" ITCL_PATCH_LEVEL >> versions.vc]
|
||||
!error Could not retrieve ITCL version.
|
||||
!endif
|
||||
-# Get the TK version from its configure.ac
|
||||
-!if [echo TK_DOTVERSION = \> versions.vc] \
|
||||
- && [nmakehlp -V "$(TK_DIR)\configure.ac" tk >> versions.vc]
|
||||
+# Get the Tk version from its public header.
|
||||
+!if [echo TK_DOTVERSION = \>> versions.vc] \
|
||||
+ && [nmakehlp -V "$(TK_DIR)\generic\tk.h" TK_VERSION >> versions.vc]
|
||||
!error Could not retrieve TK version.
|
||||
!endif
|
||||
!include versions.vc
|
||||
@@ -140,7 +149,7 @@
|
||||
git rev-parse HEAD >>$(ROOT)\manifest.uuid
|
||||
- result = Tcl_SplitList(interp, info, &optc, &optv);
|
||||
+ result = Tcl_SplitList(interp, info, &optc, &splitOptv);
|
||||
+ optv = (char **)splitOptv;
|
||||
|
||||
$(TMP_DIR)\itkUuid.h: $(ROOT)\manifest.uuid
|
||||
- copy $(WIN_DIR)\itkUuid.h.in+$(ROOT)\manifest.uuid $(TMP_DIR)\itkUuid.h
|
||||
+ copy /b $(WIN_DIR)\itkUuid.h.in+$(ROOT)\manifest.uuid $(TMP_DIR)\itkUuid.h
|
||||
Tcl_DecrRefCount(resultPtr);
|
||||
|
||||
test: setup $(PROJECT)
|
||||
@echo testing itk
|
||||
diff -Naur itk/win/rc/itk.rc ITK_BLD/win/rc/itk.rc
|
||||
--- itk/win/rc/itk.rc 2024-07-10 10:44:13.334651538 -0400
|
||||
+++ ITK_BLD/win/rc/itk.rc 2024-07-10 10:32:07.734264686 -0400
|
||||
@@ -1,59 +1,59 @@
|
||||
-//
|
||||
-// Version resource script.
|
||||
-//
|
||||
-
|
||||
-#include <winver.h>
|
||||
-#include <itcl.h>
|
||||
-#include <itk.h>
|
||||
-
|
||||
-//
|
||||
-// build-up the name suffix that defines the type of build this is.
|
||||
-//
|
||||
-#if DEBUG
|
||||
-#define SUFFIX_DEBUG "g"
|
||||
-#else
|
||||
-#define SUFFIX_DEBUG ""
|
||||
-#endif
|
||||
-
|
||||
-#define SUFFIX SUFFIX_DEBUG
|
||||
-
|
||||
-
|
||||
-VS_VERSION_INFO VERSIONINFO
|
||||
- FILEVERSION ITK_MAJOR_VERSION,ITK_MINOR_VERSION,ITK_RELEASE_LEVEL,ITK_RELEASE_SERIAL
|
||||
- PRODUCTVERSION ITK_MAJOR_VERSION,ITK_MINOR_VERSION,ITK_RELEASE_LEVEL,ITK_RELEASE_SERIAL
|
||||
- FILEFLAGSMASK 0x3fL
|
||||
-#if DEBUG
|
||||
- FILEFLAGS VS_FF_DEBUG
|
||||
-#else
|
||||
- FILEFLAGS 0x0L
|
||||
-#endif
|
||||
- FILEOS VOS__WINDOWS32
|
||||
- FILETYPE VFT_DLL
|
||||
- FILESUBTYPE 0x0L
|
||||
-
|
||||
-BEGIN
|
||||
- BLOCK "StringFileInfo"
|
||||
- BEGIN
|
||||
- BLOCK "040904b0"
|
||||
- BEGIN
|
||||
- VALUE "FileDescription", "[Incr Tk] Object-Oriented Tk extension\0"
|
||||
- VALUE "Authors", "Michael McLennan\0"
|
||||
- VALUE "OriginalFilename", "itk" STRINGIFY(ITK_MAJOR_VERSION) STRINGIFY(ITK_MINOR_VERSION) SUFFIX ".dll\0"
|
||||
- VALUE "CompanyName", "Bell Labs Innovations for Lucent Technologies\0"
|
||||
- VALUE "FileVersion", ITK_PATCH_LEVEL
|
||||
- VALUE "LegalCopyright", "Copyright \251 1993-2003\0"
|
||||
- VALUE "ProductName", "[Incr Tk] " ITK_VERSION " for Windows\0"
|
||||
- VALUE "ProductVersion", ITK_PATCH_LEVEL
|
||||
- END
|
||||
- END
|
||||
- BLOCK "VarFileInfo"
|
||||
- BEGIN
|
||||
- VALUE "Translation", 0x409, 1200
|
||||
- END
|
||||
-END
|
||||
-
|
||||
-//
|
||||
-// Icons
|
||||
-//
|
||||
-
|
||||
-toaster ICON DISCARDABLE "itk.ico"
|
||||
+//
|
||||
+// Version resource script.
|
||||
+//
|
||||
+
|
||||
+#include <winver.h>
|
||||
+#include <itcl.h>
|
||||
+#include <itk.h>
|
||||
+
|
||||
+//
|
||||
+// build-up the name suffix that defines the type of build this is.
|
||||
+//
|
||||
+#if DEBUG
|
||||
+#define SUFFIX_DEBUG "g"
|
||||
+#else
|
||||
+#define SUFFIX_DEBUG ""
|
||||
+#endif
|
||||
+
|
||||
+#define SUFFIX SUFFIX_DEBUG
|
||||
+
|
||||
+
|
||||
+VS_VERSION_INFO VERSIONINFO
|
||||
+ FILEVERSION ITK_MAJOR_VERSION,ITK_MINOR_VERSION,ITK_RELEASE_LEVEL,ITK_RELEASE_SERIAL
|
||||
+ PRODUCTVERSION ITK_MAJOR_VERSION,ITK_MINOR_VERSION,ITK_RELEASE_LEVEL,ITK_RELEASE_SERIAL
|
||||
+ FILEFLAGSMASK 0x3fL
|
||||
+#if DEBUG
|
||||
+ FILEFLAGS VS_FF_DEBUG
|
||||
+#else
|
||||
+ FILEFLAGS 0x0L
|
||||
+#endif
|
||||
+ FILEOS VOS__WINDOWS32
|
||||
+ FILETYPE VFT_DLL
|
||||
+ FILESUBTYPE 0x0L
|
||||
+
|
||||
+BEGIN
|
||||
+ BLOCK "StringFileInfo"
|
||||
+ BEGIN
|
||||
+ BLOCK "040904b0"
|
||||
+ BEGIN
|
||||
+ VALUE "FileDescription", "[Incr Tk] Object-Oriented Tk extension\0"
|
||||
+ VALUE "Authors", "Michael McLennan\0"
|
||||
+ VALUE "OriginalFilename", "itk" STRINGIFY(ITK_MAJOR_VERSION) STRINGIFY(ITK_MINOR_VERSION) SUFFIX ".dll\0"
|
||||
+ VALUE "CompanyName", "Bell Labs Innovations for Lucent Technologies\0"
|
||||
+ VALUE "FileVersion", ITK_PATCH_LEVEL
|
||||
+ VALUE "LegalCopyright", "Copyright \251 1993-2003\0"
|
||||
+ VALUE "ProductName", "[Incr Tk] " ITK_VERSION " for Windows\0"
|
||||
+ VALUE "ProductVersion", ITK_PATCH_LEVEL
|
||||
+ END
|
||||
+ END
|
||||
+ BLOCK "VarFileInfo"
|
||||
+ BEGIN
|
||||
+ VALUE "Translation", 0x409, 1200
|
||||
+ END
|
||||
+END
|
||||
+
|
||||
+//
|
||||
+// Icons
|
||||
+//
|
||||
+
|
||||
+toaster ICON DISCARDABLE "itk.ico"
|
||||
|
||||
@@ -1,48 +0,0 @@
|
||||
if (NOT ITK_SOURCE_DIR OR NOT ITK_PATCH_EXECUTABLE OR
|
||||
NOT ITK_PATCH_CHECK_OPTION OR NOT ITK_PATCH_REJECT_DIR OR
|
||||
NOT ITK_PATCH_FILE OR NOT ITK_INSTALL_PATCH_FILE)
|
||||
message(FATAL_ERROR
|
||||
"Itk patching requires source, patch tool, check option, reject "
|
||||
"directory, and patch file paths")
|
||||
endif ()
|
||||
|
||||
# Upstream stores this Windows makefile with CRLF line endings. The BSD patch
|
||||
# utility used on some Unix hosts does not normalize them, so normalize the
|
||||
# staged copy before applying the cross-platform source patches.
|
||||
set(ITK_WINDOWS_MAKEFILE "${ITK_SOURCE_DIR}/win/makefile.vc")
|
||||
file(READ "${ITK_WINDOWS_MAKEFILE}" ITK_WINDOWS_MAKEFILE_CONTENTS)
|
||||
string(REPLACE "\r\n" "\n" ITK_WINDOWS_MAKEFILE_CONTENTS "${ITK_WINDOWS_MAKEFILE_CONTENTS}")
|
||||
file(WRITE "${ITK_WINDOWS_MAKEFILE}" "${ITK_WINDOWS_MAKEFILE_CONTENTS}")
|
||||
|
||||
set(ITK_PATCH_WRAPPER "${CMAKE_CURRENT_LIST_DIR}/../CMake/PatchWrapper.cmake")
|
||||
set(ITK_PATCH_FILES
|
||||
"${ITK_PATCH_FILE}"
|
||||
"${ITK_INSTALL_PATCH_FILE}"
|
||||
)
|
||||
foreach (ITK_CURRENT_PATCH_FILE IN LISTS ITK_PATCH_FILES)
|
||||
execute_process(
|
||||
COMMAND "${CMAKE_COMMAND}"
|
||||
"-DBEXT_PATCH_NATIVE_EXECUTABLE=${ITK_PATCH_EXECUTABLE}"
|
||||
"-DBEXT_PATCH_CHECK_OPTION=${ITK_PATCH_CHECK_OPTION}"
|
||||
"-DBEXT_PATCH_REJECT_DIR=${ITK_PATCH_REJECT_DIR}"
|
||||
-P "${ITK_PATCH_WRAPPER}" -- -E -p1 -N -i "${ITK_CURRENT_PATCH_FILE}"
|
||||
WORKING_DIRECTORY "${ITK_SOURCE_DIR}"
|
||||
RESULT_VARIABLE ITK_PATCH_RESULT
|
||||
OUTPUT_VARIABLE ITK_PATCH_OUTPUT
|
||||
ERROR_VARIABLE ITK_PATCH_ERROR
|
||||
)
|
||||
|
||||
if (ITK_PATCH_RESULT)
|
||||
message(FATAL_ERROR
|
||||
"Itk source patch failed for ${ITK_CURRENT_PATCH_FILE}:\n"
|
||||
"${ITK_PATCH_OUTPUT}${ITK_PATCH_ERROR}"
|
||||
)
|
||||
endif ()
|
||||
endforeach ()
|
||||
|
||||
# Local Variables:
|
||||
# tab-width: 8
|
||||
# mode: cmake
|
||||
# indent-tabs-mode: t
|
||||
# End:
|
||||
# ex: shiftwidth=2 tabstop=8
|
||||
@@ -1,37 +0,0 @@
|
||||
message("Itk build begins\n")
|
||||
|
||||
set(BUILD_SCRIPT "${CMAKE_BINARY_DIR}/build_itk.bat")
|
||||
file(WRITE "${BUILD_SCRIPT}"
|
||||
"@echo off\n"
|
||||
"set VSCMD_DEBUG=0\n"
|
||||
"set \"NoDefaultCurrentDirectoryInExePath=\"\n"
|
||||
"call \"@VCVARS_BAT@\"\n"
|
||||
"if errorlevel 1 exit /b %ERRORLEVEL%\n"
|
||||
"set \"PATH=@BEXT_MSVC_COMPILER_BIN_DIR@;%PATH%\"\n"
|
||||
"cd /D \"@ITK_SRC_DIR@/win\"\n"
|
||||
"set CC=\n"
|
||||
"set RC=\n"
|
||||
"nmake -f makefile.vc TCLDIR=@TCL_SRC_DIR@ TKDIR=@TK_SRC_DIR@ ITCLDIR=@ITCL_SRC_DIR@ INSTALLDIR=@CMAKE_BUNDLE_INSTALL_PREFIX@ SUFX=\n"
|
||||
"exit /b %ERRORLEVEL%\n"
|
||||
)
|
||||
|
||||
execute_process(
|
||||
WORKING_DIRECTORY "@ITK_SRC_DIR@/win"
|
||||
COMMAND cmd /c "${BUILD_SCRIPT}"
|
||||
RESULT_VARIABLE ITK_RET
|
||||
OUTPUT_VARIABLE CMD_OUT
|
||||
ERROR_VARIABLE CMD_OUT
|
||||
)
|
||||
|
||||
if (ITK_RET)
|
||||
message(FATAL_ERROR "Itk build failed:\n${CMD_OUT}\n")
|
||||
endif (ITK_RET)
|
||||
|
||||
message("Itk build succeeded:\n${CMD_OUT}\n")
|
||||
|
||||
# Local Variables:
|
||||
# tab-width: 8
|
||||
# mode: cmake
|
||||
# indent-tabs-mode: t
|
||||
# End:
|
||||
# ex: shiftwidth=2 tabstop=8
|
||||
@@ -1,41 +0,0 @@
|
||||
if (APPLE)
|
||||
execute_process(
|
||||
COMMAND xcrun --show-sdk-path
|
||||
OUTPUT_VARIABLE SDK_PATH
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
set(ENV{LDFLAGS} "-isysroot ${SDK_PATH} -L${SDK_PATH}/usr/lib -L@CMAKE_BUNDLE_INSTALL_PREFIX@/@LIB_DIR@ -F${SDK_PATH}/System/Library/Frameworks -framework CoreFoundation")
|
||||
set(ENV{CFLAGS} "-isysroot ${SDK_PATH} -L${SDK_PATH}/usr/lib -L@CMAKE_BUNDLE_INSTALL_PREFIX@/@LIB_DIR@ -F${SDK_PATH}/System/Library/Frameworks")
|
||||
set(ENV{CPPFLAGS} "-isystem ${SDK_PATH}/usr/include -F${SDK_PATH}/System/Library/Frameworks -I@CMAKE_BUNDLE_INSTALL_PREFIX@/@INCLUDE_DIR@")
|
||||
else ()
|
||||
set(ENV{LD_LIBRARY_PATH} "@CMAKE_BUNDLE_INSTALL_PREFIX@/@LIB_DIR@")
|
||||
set(ENV{LDFLAGS} "-L@CMAKE_BUNDLE_INSTALL_PREFIX@/@LIB_DIR@")
|
||||
set(ENV{CPPFLAGS} "-I@CMAKE_BUNDLE_INSTALL_PREFIX@/@INCLUDE_DIR@")
|
||||
endif (APPLE)
|
||||
|
||||
execute_process(
|
||||
COMMAND "@ITK_SRC_DIR@/configure"
|
||||
--prefix=@CMAKE_BUNDLE_INSTALL_PREFIX@
|
||||
--with-tcl=@WITH_TCL_DIR@
|
||||
--with-tk=@WITH_TK_DIR@
|
||||
--with-itcl=@WITH_ITCL_DIR@
|
||||
--with-tclinclude=@WITH_TCL_INCLUDE_DIR@
|
||||
--with-tkinclude=@WITH_TK_INCLUDE_DIR@
|
||||
RESULT_VARIABLE ITK_RET
|
||||
WORKING_DIRECTORY "@ITK_BIN_DIR@"
|
||||
OUTPUT_VARIABLE MSG
|
||||
ERROR_VARIABLE MSG
|
||||
)
|
||||
|
||||
if (ITK_RET)
|
||||
message(FATAL_ERROR "Itk configure failed:\n${MSG}\n")
|
||||
endif (ITK_RET)
|
||||
|
||||
message("${MSG}\nItk configure succeeded.\n")
|
||||
|
||||
# Local Variables:
|
||||
# tab-width: 8
|
||||
# mode: cmake
|
||||
# indent-tabs-mode: t
|
||||
# End:
|
||||
# ex: shiftwidth=2 tabstop=8
|
||||
@@ -1,62 +0,0 @@
|
||||
set(INSTALL_SCRIPT "${CMAKE_BINARY_DIR}/install_itk.bat")
|
||||
file(WRITE "${INSTALL_SCRIPT}"
|
||||
"@echo off\n"
|
||||
"set VSCMD_DEBUG=0\n"
|
||||
"set \"NoDefaultCurrentDirectoryInExePath=\"\n"
|
||||
"call \"@VCVARS_BAT@\"\n"
|
||||
"if errorlevel 1 exit /b %ERRORLEVEL%\n"
|
||||
"set \"PATH=@BEXT_MSVC_COMPILER_BIN_DIR@;%PATH%\"\n"
|
||||
"cd /D \"@ITK_SRC_DIR@/win\"\n"
|
||||
"set CC=\n"
|
||||
"set RC=\n"
|
||||
"nmake -f makefile.vc install TCLDIR=@TCL_SRC_DIR@ TKDIR=@TK_SRC_DIR@ ITCLDIR=@ITCL_SRC_DIR@ INSTALLDIR=@CMAKE_BUNDLE_INSTALL_PREFIX@ SUFX=\n"
|
||||
"exit /b %ERRORLEVEL%\n"
|
||||
)
|
||||
|
||||
execute_process(
|
||||
WORKING_DIRECTORY "@ITK_SRC_DIR@/win"
|
||||
COMMAND cmd /c "${INSTALL_SCRIPT}"
|
||||
RESULT_VARIABLE ITK_RET
|
||||
OUTPUT_VARIABLE CMD_OUT
|
||||
ERROR_VARIABLE CMD_OUT
|
||||
)
|
||||
|
||||
if (ITK_RET)
|
||||
message(FATAL_ERROR "Itk install failed:\n${CMD_OUT}\n")
|
||||
endif (ITK_RET)
|
||||
|
||||
set(ITK_SCRIPT_INSTALL_DIR
|
||||
"@CMAKE_BUNDLE_INSTALL_PREFIX@/@LIB_DIR@/itk@BEXT_ITK_BUNDLED_VERSION@"
|
||||
)
|
||||
set(ITK_REQUIRED_SCRIPT_FILES
|
||||
Archetype.itk
|
||||
Toplevel.itk
|
||||
Widget.itk
|
||||
itk.tcl
|
||||
pkgIndex.tcl
|
||||
tclIndex
|
||||
)
|
||||
set(ITK_MISSING_SCRIPT_FILES)
|
||||
foreach (ITK_REQUIRED_SCRIPT_FILE ${ITK_REQUIRED_SCRIPT_FILES})
|
||||
if (NOT EXISTS "${ITK_SCRIPT_INSTALL_DIR}/${ITK_REQUIRED_SCRIPT_FILE}")
|
||||
list(APPEND ITK_MISSING_SCRIPT_FILES
|
||||
"${ITK_SCRIPT_INSTALL_DIR}/${ITK_REQUIRED_SCRIPT_FILE}"
|
||||
)
|
||||
endif ()
|
||||
endforeach ()
|
||||
if (ITK_MISSING_SCRIPT_FILES)
|
||||
list(JOIN ITK_MISSING_SCRIPT_FILES "\n " ITK_MISSING_SCRIPT_FILES_TEXT)
|
||||
message(FATAL_ERROR
|
||||
"Itk install did not produce required runtime scripts:\n"
|
||||
" ${ITK_MISSING_SCRIPT_FILES_TEXT}\n"
|
||||
)
|
||||
endif ()
|
||||
|
||||
message("Itk install succeeded:\n${CMD_OUT}\n")
|
||||
|
||||
# Local Variables:
|
||||
# tab-width: 8
|
||||
# mode: cmake
|
||||
# indent-tabs-mode: t
|
||||
# End:
|
||||
# ex: shiftwidth=2 tabstop=8
|
||||
@@ -1,16 +0,0 @@
|
||||
diff -Naur itk/win/makefile.vc ITK_BLD/win/makefile.vc
|
||||
--- itk/win/makefile.vc 2026-09-14 11:07:25.785985244 -0400
|
||||
+++ ITK_BLD/win/makefile.vc 2026-09-15 17:45:00.000000000 -0400
|
||||
@@ -130,5 +130,11 @@
|
||||
|
||||
# Additional default actions for install
|
||||
-install: default-install-docs-n
|
||||
+install: default-install-docs-n install-itk-class-library
|
||||
+
|
||||
+# The generic TEA target copies only *.tcl. Install Itk's class definitions
|
||||
+# and autoload index as well so the base classes are available at runtime.
|
||||
+install-itk-class-library: default-install-scripts
|
||||
+ @$(CPY) $(LIBDIR)\*.itk "$(SCRIPT_INSTALL_DIR)"
|
||||
+ @$(CPY) $(LIBDIR)\tclIndex "$(SCRIPT_INSTALL_DIR)"
|
||||
|
||||
# The TIP 477 generation of pkgIndex.tcl from pkgIndex.tcl.in does not include
|
||||
@@ -1 +0,0 @@
|
||||
git-e697407849b01d3498b56fc46e5a423690190954
|
||||
@@ -1,99 +0,0 @@
|
||||
#------------------------------------------------------------- -*- makefile -*-
|
||||
# targets.vc --
|
||||
#
|
||||
# Part of the nmake based build system for Tcl and its extensions.
|
||||
# This file defines some standard targets for the convenience of extensions
|
||||
# and can be optionally included by the extension makefile.
|
||||
# See TIP 477 (https://core.tcl-lang.org/tips/doc/main/tip/477.md) for docs.
|
||||
|
||||
$(PROJECT): setup pkgindex $(PRJLIB)
|
||||
|
||||
!ifdef PRJ_STUBOBJS
|
||||
$(PROJECT): $(PRJSTUBLIB)
|
||||
$(PRJSTUBLIB): $(PRJ_STUBOBJS)
|
||||
$(LIBCMD) $**
|
||||
|
||||
$(PRJ_STUBOBJS):
|
||||
$(CCSTUBSCMD) %s
|
||||
!endif # PRJ_STUBOBJS
|
||||
|
||||
!ifdef PRJ_MANIFEST
|
||||
$(PROJECT): $(PRJLIB).manifest
|
||||
$(PRJLIB).manifest: $(PRJ_MANIFEST)
|
||||
@nmakehlp -s << $** >$@
|
||||
@MACHINE@ $(MACHINE:IX86=X86)
|
||||
<<
|
||||
!endif
|
||||
|
||||
!if "$(PROJECT)" != "tcl" && "$(PROJECT)" != "tk"
|
||||
$(PRJLIB): $(PRJ_OBJS) $(RESFILE)
|
||||
!if $(STATIC_BUILD)
|
||||
$(LIBCMD) $**
|
||||
!else
|
||||
$(DLLCMD) $**
|
||||
$(_VC_MANIFEST_EMBED_DLL)
|
||||
!endif
|
||||
-@del $*.exp
|
||||
!endif
|
||||
|
||||
!if "$(PRJ_HEADERS)" != "" && "$(PRJ_OBJS)" != ""
|
||||
$(PRJ_OBJS): $(PRJ_HEADERS)
|
||||
!endif
|
||||
|
||||
# If parent makefile has defined stub objects, add their installation
|
||||
# to the default install
|
||||
!if "$(PRJ_STUBOBJS)" != ""
|
||||
default-install: default-install-stubs
|
||||
!endif
|
||||
|
||||
# Unlike the other default targets, these cannot be in rules.vc because
|
||||
# the executed command depends on existence of macro PRJ_HEADERS_PUBLIC
|
||||
# that the parent makefile will not define until after including rules-ext.vc
|
||||
!if "$(PRJ_HEADERS_PUBLIC)" != ""
|
||||
default-install: default-install-headers
|
||||
default-install-headers:
|
||||
@$(ECHO) Installing headers to '$(INCLUDE_INSTALL_DIR)'
|
||||
@if not exist "$(INCLUDE_INSTALL_DIR)" $(MKDIR) "$(INCLUDE_INSTALL_DIR)"
|
||||
@for %f in ($(PRJ_HEADERS_PUBLIC)) do @$(COPY) %f "$(INCLUDE_INSTALL_DIR)"
|
||||
!endif
|
||||
|
||||
!if "$(DISABLE_STANDARD_TARGETS)" == ""
|
||||
DISABLE_STANDARD_TARGETS = 0
|
||||
!endif
|
||||
|
||||
!if "$(DISABLE_TARGET_setup)" == ""
|
||||
DISABLE_TARGET_setup = 0
|
||||
!endif
|
||||
!if "$(DISABLE_TARGET_install)" == ""
|
||||
DISABLE_TARGET_install = 0
|
||||
!endif
|
||||
!if "$(DISABLE_TARGET_clean)" == ""
|
||||
DISABLE_TARGET_clean = 0
|
||||
!endif
|
||||
!if "$(DISABLE_TARGET_test)" == ""
|
||||
DISABLE_TARGET_test = 0
|
||||
!endif
|
||||
!if "$(DISABLE_TARGET_shell)" == ""
|
||||
DISABLE_TARGET_shell = 0
|
||||
!endif
|
||||
|
||||
!if !$(DISABLE_STANDARD_TARGETS)
|
||||
!if !$(DISABLE_TARGET_setup)
|
||||
setup: default-setup
|
||||
!endif
|
||||
!if !$(DISABLE_TARGET_install)
|
||||
install: default-install
|
||||
!endif
|
||||
!if !$(DISABLE_TARGET_clean)
|
||||
clean: default-clean
|
||||
realclean: hose
|
||||
hose: default-hose
|
||||
distclean: realclean default-distclean
|
||||
!endif
|
||||
!if !$(DISABLE_TARGET_test)
|
||||
test: default-test
|
||||
!endif
|
||||
!if !$(DISABLE_TARGET_shell)
|
||||
shell: default-shell
|
||||
!endif
|
||||
!endif # DISABLE_STANDARD_TARGETS
|
||||
+12
-8
@@ -5,12 +5,16 @@ if (USE_BRLCAD)
|
||||
|
||||
endif (USE_BRLCAD)
|
||||
|
||||
# Tcl can inspect a system package index without loading Iwidgets, but the
|
||||
# advertised version does not establish Itcl 4 compatibility. The latest
|
||||
# upstream 4.1.1 sources still need the fixes in iwidgets_itcl4.patch, and a
|
||||
# system package using that same version may or may not carry equivalent
|
||||
# downstream fixes. Actually validating it loads Tk and requires a display.
|
||||
# Unless explicitly disabled, use the known patched copy.
|
||||
# Unfortunately, there does not appear to be a reliable way to test for the
|
||||
# presence of the IWidgets package on a system Tcl/Tk. As far as I can tell
|
||||
# the "package require Iwidgets" test (which is what is required to properly
|
||||
# test for an available Iwidgets package) can ONLY be performed successfully on
|
||||
# a system that supports creation of a graphics window. Window creation isn't
|
||||
# typically available on continuous integration runners, which means the test
|
||||
# will always fail there even when it shouldn't.
|
||||
|
||||
# Unless we have been specifically instructed not to, provide the bundled
|
||||
# version of IWidgets.
|
||||
|
||||
if (NOT DEFINED ENABLE_IWIDGETS AND NOT DISABLE_IWIDGETS)
|
||||
set(ENABLE_IWIDGETS ON)
|
||||
@@ -23,9 +27,8 @@ if (ENABLE_IWIDGETS)
|
||||
RegisterDeps(IWIDGETS)
|
||||
|
||||
ExternalProject_Add(IWIDGETS_BLD
|
||||
URL "${CMAKE_CURRENT_SOURCE_DIR}/iwidgets"
|
||||
SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/iwidgets"
|
||||
BUILD_ALWAYS ${EXT_BUILD_ALWAYS} ${LOG_OPTS}
|
||||
PATCH_COMMAND ${PATCH_EXECUTABLE};-E;-p1;${PATCH_OPTIONS};-i;${CMAKE_CURRENT_SOURCE_DIR}/iwidgets_itcl4.patch
|
||||
CMAKE_ARGS
|
||||
-DCMAKE_INSTALL_PREFIX=${CMAKE_BUNDLE_INSTALL_PREFIX}
|
||||
-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
|
||||
@@ -55,3 +58,4 @@ endif (ENABLE_IWIDGETS)
|
||||
# indent-tabs-mode: t
|
||||
# End:
|
||||
# ex: shiftwidth=2 tabstop=8
|
||||
|
||||
|
||||
@@ -1,70 +0,0 @@
|
||||
Iwidgets in bext
|
||||
================
|
||||
|
||||
Bext packages Iwidgets 4.1.1 because Iwidgets is not bundled with Tcl or Tk
|
||||
and cannot be assumed to be installed with a system Tcl/Tk stack. The source
|
||||
predates Itcl 4 and needs a small compatibility patch when used with the Itcl
|
||||
4.1.1-or-newer stack required by BRL-CAD.
|
||||
|
||||
Upstream status
|
||||
---------------
|
||||
|
||||
The latest official Incr Widgets source release is 4.1.1. The release archive
|
||||
and bext's generic widget sources match except for expanded CVS Id strings;
|
||||
bext omits obsolete build, CVS, demo, manual, and test files and supplies its
|
||||
own CMake packaging. The Tcl Core fossil project named "iwidgets for itk4"
|
||||
has only two check-ins, both from May 24, 2012, and its source retains the
|
||||
compatibility defects fixed here. There is consequently no newer maintained
|
||||
upstream source to import as of September 2026.
|
||||
|
||||
Tcl can discover versions advertised by system package indexes without loading
|
||||
Iwidgets or opening a display. That is sufficient for inventory, but not for
|
||||
safe selection: an unpatched system package and one with equivalent downstream
|
||||
fixes both advertise version 4.1.1. Loading enough code to validate behavior
|
||||
also loads Tk and requires a display. Bext therefore continues to use its
|
||||
known patched copy by default instead of treating the version string as proof
|
||||
of compatibility.
|
||||
|
||||
Compatibility patch
|
||||
-------------------
|
||||
|
||||
Itcl 3 accepted an array element as the argument to itcl::scope. Itcl 4
|
||||
instead resolves that argument as a variable name and rejects array element
|
||||
syntax. The patch resolves each common array's fully qualified variable name
|
||||
with namespace which, then appends the element index. This preserves the
|
||||
variable names expected by Tk -variable, -textvariable, trace, and tkwait
|
||||
without depending on Itcl 3's itcl::scope behavior.
|
||||
|
||||
The Finddialog match callback previously constructed a command with subst and
|
||||
then executed the resulting string. Tcl 8.5's argument expansion syntax
|
||||
invokes the stored command prefix directly, preserving argument boundaries and
|
||||
supporting the command prefixes produced by Itcl 4.
|
||||
|
||||
Labeledwidget::alignlabels originally passed the unqualified class name
|
||||
Labeledwidget to itcl::find. Itcl 4 resolves that name in the caller's object
|
||||
context. The result therefore depended on package initialization order: it
|
||||
worked when Itcl was loaded before Tk, but failed in applications such as
|
||||
bwish and Archer where Tk was initialized first. The patch uses the fully
|
||||
qualified ::iwidgets::Labeledwidget class name so both supported initialization
|
||||
orders behave identically.
|
||||
|
||||
These changes are kept as a bext patch rather than modifications to the source
|
||||
submodule. That keeps the imported upstream revision identifiable and makes
|
||||
the compatibility delta explicit and independently reviewable. The external
|
||||
project patches a staged copy so builds do not modify the source submodule.
|
||||
|
||||
Validation
|
||||
----------
|
||||
|
||||
The BRL-CAD Tcl/Itcl smoke baseline exercises the affected Iwidgets under both
|
||||
initialization orders:
|
||||
|
||||
* btclsh loads Itcl before Tk and represents command-line tools such as
|
||||
rtwizard;
|
||||
* bwish initializes Tk before tclcad loads Itcl and represents Archer and
|
||||
other Tk-first applications.
|
||||
|
||||
The baseline constructs and operates the affected widgets, invokes
|
||||
Labeledwidget::alignlabels, follows callbacks after returning to the event
|
||||
loop, and treats background Tcl errors as failures. Xmin supplies the X
|
||||
server needed to run the GUI case on headless builders.
|
||||
@@ -1,3 +1,4 @@
|
||||
PATCH
|
||||
ITCL
|
||||
ITK
|
||||
|
||||
|
||||
@@ -1,335 +0,0 @@
|
||||
diff --git a/generic/canvasprintbox.itk b/generic/canvasprintbox.itk
|
||||
index 9d41daa..4f7d1d0 100755
|
||||
--- a/generic/canvasprintbox.itk
|
||||
+++ b/generic/canvasprintbox.itk
|
||||
@@ -352,7 +352,7 @@ itcl::body iwidgets::Canvasprintbox::constructor {args} {
|
||||
itk_component add printerrb {
|
||||
radiobutton $cs.printerrb \
|
||||
-text Printer \
|
||||
- -variable [itcl::scope _globVar($this,output)] \
|
||||
+ -variable [namespace which -variable _globVar]($this,output) \
|
||||
-anchor w \
|
||||
-justify left \
|
||||
-value printer \
|
||||
@@ -366,7 +366,7 @@ itcl::body iwidgets::Canvasprintbox::constructor {args} {
|
||||
-labeltext "command:" \
|
||||
-state normal \
|
||||
-labelpos w \
|
||||
- -textvariable [itcl::scope _globVar($this,printeref)]
|
||||
+ -textvariable [namespace which -variable _globVar]($this,printeref)
|
||||
}
|
||||
|
||||
itk_component add filerb {
|
||||
@@ -374,7 +374,7 @@ itcl::body iwidgets::Canvasprintbox::constructor {args} {
|
||||
-text File \
|
||||
-justify left \
|
||||
-anchor w \
|
||||
- -variable [itcl::scope _globVar($this,output)] \
|
||||
+ -variable [namespace which -variable _globVar]($this,output) \
|
||||
-value file \
|
||||
-command [itcl::code $this _update_attr]
|
||||
} {
|
||||
@@ -386,7 +386,7 @@ itcl::body iwidgets::Canvasprintbox::constructor {args} {
|
||||
-labeltext "filename:" \
|
||||
-state disabled \
|
||||
-labelpos w \
|
||||
- -textvariable [itcl::scope _globVar($this,fileef)]
|
||||
+ -textvariable [namespace which -variable _globVar]($this,fileef)
|
||||
}
|
||||
|
||||
itk_component add propsframe {
|
||||
@@ -422,7 +422,7 @@ itcl::body iwidgets::Canvasprintbox::constructor {args} {
|
||||
-text {Stretch to fit} \
|
||||
-justify left \
|
||||
-anchor w \
|
||||
- -variable [itcl::scope _globVar($this,stretchcb)] \
|
||||
+ -variable [namespace which -variable _globVar]($this,stretchcb) \
|
||||
-command [itcl::code $this refresh]
|
||||
} {
|
||||
usual
|
||||
@@ -435,7 +435,7 @@ itcl::body iwidgets::Canvasprintbox::constructor {args} {
|
||||
-text Posterize \
|
||||
-justify left \
|
||||
-anchor w \
|
||||
- -variable [itcl::scope _globVar($this,postercb)] \
|
||||
+ -variable [namespace which -variable _globVar]($this,postercb) \
|
||||
-command [itcl::code $this refresh]
|
||||
} {
|
||||
usual
|
||||
@@ -445,7 +445,7 @@ itcl::body iwidgets::Canvasprintbox::constructor {args} {
|
||||
itk_component add hpcnt {
|
||||
iwidgets::entryfield $cs.hpcnt \
|
||||
-labeltext on \
|
||||
- -textvariable [itcl::scope _globVar($this,hpc)] \
|
||||
+ -textvariable [namespace which -variable _globVar]($this,hpc) \
|
||||
-validate integer -width 3 \
|
||||
-command [itcl::code $this refresh]
|
||||
}
|
||||
@@ -453,7 +453,7 @@ itcl::body iwidgets::Canvasprintbox::constructor {args} {
|
||||
itk_component add vpcnt {
|
||||
iwidgets::entryfield $cs.vpcnt \
|
||||
-labeltext by \
|
||||
- -textvariable [itcl::scope _globVar($this,vpc)] \
|
||||
+ -textvariable [namespace which -variable _globVar]($this,vpc) \
|
||||
-validate integer -width 3 \
|
||||
-command [itcl::code $this refresh]
|
||||
}
|
||||
diff --git a/generic/checkbox.itk b/generic/checkbox.itk
|
||||
index 49e8888..123be27 100755
|
||||
--- a/generic/checkbox.itk
|
||||
+++ b/generic/checkbox.itk
|
||||
@@ -172,7 +172,7 @@ itcl::body iwidgets::Checkbox::index {index} {
|
||||
itcl::body iwidgets::Checkbox::add {tag args} {
|
||||
itk_component add $tag {
|
||||
eval checkbutton $itk_component(childsite).cb[incr _unique] \
|
||||
- -variable [list [itcl::scope buttonVar($this,$tag)]] \
|
||||
+ -variable [list [namespace which -variable buttonVar]($this,$tag)] \
|
||||
-anchor w \
|
||||
-justify left \
|
||||
-highlightthickness 0 \
|
||||
@@ -207,7 +207,7 @@ itcl::body iwidgets::Checkbox::add {tag args} {
|
||||
itcl::body iwidgets::Checkbox::insert {index tag args} {
|
||||
itk_component add $tag {
|
||||
eval checkbutton $itk_component(childsite).cb[incr _unique] \
|
||||
- -variable [list [itcl::scope buttonVar($this,$tag)]] \
|
||||
+ -variable [list [namespace which -variable buttonVar]($this,$tag)] \
|
||||
-anchor w \
|
||||
-justify left \
|
||||
-highlightthickness 0 \
|
||||
@@ -258,7 +258,7 @@ itcl::body iwidgets::Checkbox::select {index} {
|
||||
# already selected. Check its associated variable, and if
|
||||
# it's set, then just ignore and return.
|
||||
#-----------------------------------------------------------
|
||||
- if {[set [itcl::scope buttonVar($this,$tag)]] ==
|
||||
+ if {[set [namespace which -variable buttonVar]($this,$tag)] ==
|
||||
[[component $tag] cget -onvalue]} {
|
||||
return
|
||||
}
|
||||
diff --git a/generic/combobox.itk b/generic/combobox.itk
|
||||
index 140724b..dfa690b 100755
|
||||
--- a/generic/combobox.itk
|
||||
+++ b/generic/combobox.itk
|
||||
@@ -1231,7 +1231,7 @@ itcl::body iwidgets::Combobox::_listShowing {{val ""}} {
|
||||
return $_listShowing($this)
|
||||
} elseif {$val == "-wait"} {
|
||||
while {!$_listShowing($this)} {
|
||||
- tkwait variable [itcl::scope _listShowing($this)]
|
||||
+ tkwait variable [namespace which -variable _listShowing]($this)
|
||||
}
|
||||
return
|
||||
}
|
||||
diff --git a/generic/finddialog.itk b/generic/finddialog.itk
|
||||
index 7bf38f1..608ebb9 100755
|
||||
--- a/generic/finddialog.itk
|
||||
+++ b/generic/finddialog.itk
|
||||
@@ -102,7 +102,7 @@ itcl::body ::iwidgets::Finddialog::constructor {args} {
|
||||
#
|
||||
itk_component add all {
|
||||
checkbutton $itk_interior.all \
|
||||
- -variable [itcl::scope _optionValues($this-all)] \
|
||||
+ -variable [namespace which -variable _optionValues]($this-all) \
|
||||
-text "All"
|
||||
}
|
||||
|
||||
@@ -111,7 +111,7 @@ itcl::body ::iwidgets::Finddialog::constructor {args} {
|
||||
#
|
||||
itk_component add case {
|
||||
checkbutton $itk_interior.case \
|
||||
- -variable [itcl::scope _optionValues($this-case)] \
|
||||
+ -variable [namespace which -variable _optionValues]($this-case) \
|
||||
-text "Consider Case"
|
||||
}
|
||||
|
||||
@@ -120,7 +120,7 @@ itcl::body ::iwidgets::Finddialog::constructor {args} {
|
||||
#
|
||||
itk_component add regexp {
|
||||
checkbutton $itk_interior.regexp \
|
||||
- -variable [itcl::scope _optionValues($this-regexp)] \
|
||||
+ -variable [namespace which -variable _optionValues]($this-regexp) \
|
||||
-text "Use Regular Expression"
|
||||
}
|
||||
|
||||
@@ -129,7 +129,7 @@ itcl::body ::iwidgets::Finddialog::constructor {args} {
|
||||
#
|
||||
itk_component add backwards {
|
||||
checkbutton $itk_interior.backwards \
|
||||
- -variable [itcl::scope _optionValues($this-backwards)] \
|
||||
+ -variable [namespace which -variable _optionValues]($this-backwards) \
|
||||
-text "Find Backwards"
|
||||
}
|
||||
|
||||
@@ -290,7 +290,7 @@ itcl::body ::iwidgets::Finddialog::find {} {
|
||||
# of the string matching the pattern.
|
||||
#
|
||||
set precmd "$itk_option(-textwidget) search \
|
||||
- -count [list [itcl::scope _matchLen($this)]]"
|
||||
+ -count [list [namespace which -variable _matchLen]($this)]"
|
||||
|
||||
if {! [_get case]} {
|
||||
append precmd " -nocase"
|
||||
@@ -423,7 +423,7 @@ itcl::body ::iwidgets::Finddialog::find {} {
|
||||
# If a match command is defined, then call it with the match point.
|
||||
#
|
||||
if {$itk_option(-matchcommand) != {}} {
|
||||
- [subst $itk_option(-matchcommand)] $matchPoint
|
||||
+ {*}$itk_option(-matchcommand) $matchPoint
|
||||
}
|
||||
|
||||
#
|
||||
diff --git a/generic/mainwindow.itk b/generic/mainwindow.itk
|
||||
index 032021e..4f94a4d 100755
|
||||
--- a/generic/mainwindow.itk
|
||||
+++ b/generic/mainwindow.itk
|
||||
@@ -84,7 +84,7 @@ itcl::body iwidgets::Mainwindow::constructor {args} {
|
||||
#
|
||||
itk_component add menubar {
|
||||
iwidgets::Menubar $itk_interior.menubar \
|
||||
- -helpvariable [itcl::scope _helpVar($this)]
|
||||
+ -helpvariable [namespace which -variable _helpVar]($this)
|
||||
} {
|
||||
keep -disabledforeground -cursor \
|
||||
-highlightbackground -highlightthickness
|
||||
@@ -101,7 +101,7 @@ itcl::body iwidgets::Mainwindow::constructor {args} {
|
||||
#
|
||||
itk_component add toolbar {
|
||||
iwidgets::Toolbar $itk_interior.toolbar -orient horizontal \
|
||||
- -helpvariable [itcl::scope _helpVar($this)]
|
||||
+ -helpvariable [namespace which -variable _helpVar]($this)
|
||||
} {
|
||||
keep -balloonbackground -balloondelay1 -balloondelay2 \
|
||||
-balloonfont -balloonforeground -disabledforeground -cursor \
|
||||
@@ -116,7 +116,7 @@ itcl::body iwidgets::Mainwindow::constructor {args} {
|
||||
#
|
||||
itk_component add mousebar {
|
||||
iwidgets::Toolbar $itk_interior.mousebar -orient vertical \
|
||||
- -helpvariable [itcl::scope _helpVar($this)]
|
||||
+ -helpvariable [namespace which -variable _helpVar]($this)
|
||||
} {
|
||||
keep -balloonbackground -balloondelay1 -balloondelay2 \
|
||||
-balloonfont -balloonforeground -disabledforeground -cursor \
|
||||
@@ -142,13 +142,13 @@ itcl::body iwidgets::Mainwindow::constructor {args} {
|
||||
|
||||
itk_component add help {
|
||||
label $itk_component(lineframe).help \
|
||||
- -textvariable [itcl::scope _helpVar($this)] \
|
||||
+ -textvariable [namespace which -variable _helpVar]($this) \
|
||||
-relief sunken -borderwidth 2 -width 10
|
||||
}
|
||||
|
||||
itk_component add status {
|
||||
label $itk_component(lineframe).status \
|
||||
- -textvariable [itcl::scope _statusVar($this)] \
|
||||
+ -textvariable [namespace which -variable _statusVar]($this) \
|
||||
-relief sunken -borderwidth 2 -width 10
|
||||
}
|
||||
|
||||
diff --git a/generic/radiobox.itk b/generic/radiobox.itk
|
||||
index 282eaa7..fe1b11e 100755
|
||||
--- a/generic/radiobox.itk
|
||||
+++ b/generic/radiobox.itk
|
||||
@@ -111,7 +111,7 @@ itcl::body iwidgets::Radiobox::constructor {args} {
|
||||
#
|
||||
set _modes($this) {}
|
||||
|
||||
- trace variable [itcl::scope _modes($this)] w [itcl::code $this _command]
|
||||
+ trace variable [namespace which -variable _modes]($this) w [itcl::code $this _command]
|
||||
|
||||
grid columnconfigure $itk_component(childsite) 0 -weight 1
|
||||
|
||||
@@ -123,7 +123,7 @@ itcl::body iwidgets::Radiobox::constructor {args} {
|
||||
# ------------------------------------------------------------------
|
||||
itcl::body iwidgets::Radiobox::destructor { } {
|
||||
|
||||
- trace vdelete [itcl::scope _modes($this)] w [itcl::code $this _command]
|
||||
+ trace vdelete [namespace which -variable _modes]($this) w [itcl::code $this _command]
|
||||
catch {unset _modes($this)}
|
||||
|
||||
}
|
||||
@@ -212,7 +212,7 @@ itcl::body iwidgets::Radiobox::add {tag args} {
|
||||
|
||||
itk_component add $tag {
|
||||
eval radiobutton $itk_component(childsite).rb[incr _unique] \
|
||||
- -variable [list [itcl::scope _modes($this)]] \
|
||||
+ -variable [list [namespace which -variable _modes]($this)] \
|
||||
-anchor w \
|
||||
-justify left \
|
||||
-highlightthickness 0 \
|
||||
@@ -250,7 +250,7 @@ itcl::body iwidgets::Radiobox::insert {index tag args} {
|
||||
|
||||
itk_component add $tag {
|
||||
eval radiobutton $itk_component(childsite).rb[incr _unique] \
|
||||
- -variable [list [itcl::scope _modes($this)]] \
|
||||
+ -variable [list [namespace which -variable _modes]($this)] \
|
||||
-highlightthickness 0 \
|
||||
-anchor w \
|
||||
-justify left \
|
||||
diff --git a/generic/shell.itk b/generic/shell.itk
|
||||
index c7b6f04..b326f05 100755
|
||||
--- a/generic/shell.itk
|
||||
+++ b/generic/shell.itk
|
||||
@@ -275,7 +275,7 @@ itcl::body iwidgets::Shell::activate {} {
|
||||
|
||||
lappend grabstack [list grab $itk_component(hull)]
|
||||
|
||||
- tkwait variable [itcl::scope _wait($this)]
|
||||
+ tkwait variable [namespace which -variable _wait]($this)
|
||||
return $_result
|
||||
|
||||
} elseif {$itk_option(-modality) == "global" } {
|
||||
@@ -293,7 +293,7 @@ itcl::body iwidgets::Shell::activate {} {
|
||||
|
||||
lappend grabstack [list grab -global $itk_component(hull)]
|
||||
|
||||
- tkwait variable [itcl::scope _wait($this)]
|
||||
+ tkwait variable [namespace which -variable _wait]($this)
|
||||
return $_result
|
||||
}
|
||||
}
|
||||
diff --git a/generic/watch.itk b/generic/watch.itk
|
||||
index ace2cc9..4993aca 100755
|
||||
--- a/generic/watch.itk
|
||||
+++ b/generic/watch.itk
|
||||
@@ -171,7 +171,7 @@ itcl::body iwidgets::Watch::constructor { args } {
|
||||
radiobutton $itk_component(frame).am \
|
||||
-text "AM" \
|
||||
-value "AM" \
|
||||
- -variable [itcl::scope _ampmVar($this)]
|
||||
+ -variable [namespace which -variable _ampmVar]($this)
|
||||
} {
|
||||
usual
|
||||
rename -font -labelfont labelFont Font
|
||||
@@ -181,7 +181,7 @@ itcl::body iwidgets::Watch::constructor { args } {
|
||||
radiobutton $itk_component(frame).pm \
|
||||
-text "PM" \
|
||||
-value "PM" \
|
||||
- -variable [itcl::scope _ampmVar($this)]
|
||||
+ -variable [namespace which -variable _ampmVar]($this)
|
||||
} {
|
||||
usual
|
||||
rename -font -labelfont labelFont Font
|
||||
diff --git a/generic/labeledwidget.itk b/generic/labeledwidget.itk
|
||||
index 2e0faa5..0f43ddb 100755
|
||||
--- a/generic/labeledwidget.itk
|
||||
+++ b/generic/labeledwidget.itk
|
||||
@@ -248,9 +248,9 @@
|
||||
# Verify that all the widgets are of type Labeledwidget and
|
||||
# determine the size of the maximum length label string.
|
||||
#
|
||||
foreach iwid $args {
|
||||
- set objcmd [itcl::find objects -isa Labeledwidget *::$iwid]
|
||||
+ set objcmd [itcl::find objects -isa ::iwidgets::Labeledwidget *::$iwid]
|
||||
|
||||
if {$objcmd == ""} {
|
||||
error "$iwid is not a \"Labeledwidget\""
|
||||
}
|
||||
@@ -273,9 +273,9 @@
|
||||
|
||||
set labelSize [expr {$shellWidth - $csWidth}]
|
||||
|
||||
if {$maxLabelWidth > $labelSize} {
|
||||
- set objcmd [itcl::find objects -isa Labeledwidget *::$iwid]
|
||||
+ set objcmd [itcl::find objects -isa ::iwidgets::Labeledwidget *::$iwid]
|
||||
set dist [expr {$maxLabelWidth - \
|
||||
($labelSize - [$objcmd cget -labelmargin])}]
|
||||
|
||||
$objcmd configure -labelmargin $dist
|
||||
@@ -24,7 +24,6 @@ if (ENABLE_JPEG)
|
||||
-DCMAKE_INSTALL_PREFIX=${CMAKE_BUNDLE_INSTALL_PREFIX}
|
||||
-DCMAKE_INSTALL_LIBDIR:PATH=${LIB_DIR}
|
||||
-DCMAKE_INSTALL_RPATH=${CMAKE_BUNDLE_INSTALL_PREFIX}/${LIB_DIR}
|
||||
-DCMAKE_POSITION_INDEPENDENT_CODE=ON
|
||||
LOG_CONFIGURE ${EXT_BUILD_QUIET}
|
||||
LOG_BUILD ${EXT_BUILD_QUIET}
|
||||
LOG_INSTALL ${EXT_BUILD_QUIET}
|
||||
|
||||
+1
-1
Submodule jpeg/libjpeg-turbo updated: c85e6b905b...af9c1c2685
+2
-5
@@ -16,12 +16,9 @@ if (NOT MSVC)
|
||||
URL "${CMAKE_CURRENT_SOURCE_DIR}/LIEF"
|
||||
BUILD_ALWAYS ${EXT_BUILD_ALWAYS} ${LOG_OPTS}
|
||||
PATCH_COMMAND ${PATCH_EXECUTABLE};-E;-p1;${PATCH_OPTIONS};-i;${CMAKE_CURRENT_SOURCE_DIR}/lief_cmake.patch
|
||||
COMMAND ${PATCH_EXECUTABLE};-E;-p1;${PATCH_OPTIONS};-i;${CMAKE_CURRENT_SOURCE_DIR}/lief_elf_symbol_demangle_guard.patch
|
||||
COMMAND ${PATCH_EXECUTABLE};-E;-p1;${PATCH_OPTIONS};-i;${CMAKE_CURRENT_SOURCE_DIR}/lief_fscale_macro_fix.patch
|
||||
COMMAND ${PATCH_EXECUTABLE};-E;-p1;${PATCH_OPTIONS};-i;${CMAKE_CURRENT_SOURCE_DIR}/lief_major_minor_macro_fix.patch
|
||||
# FreeBSD linkers can emit multiple BSS-like LOAD segments. LIEF 1.0
|
||||
# rejects those binaries during PHDR relocation, and its gap relocator
|
||||
# can extend a LOAD beyond the next segment's virtual address.
|
||||
COMMAND ${PATCH_EXECUTABLE};-E;-p1;${PATCH_OPTIONS};-i;${CMAKE_CURRENT_SOURCE_DIR}/lief_elf_phdr_relocation.patch
|
||||
COMMAND ${PATCH_EXECUTABLE};-E;-p1;${PATCH_OPTIONS};-i;${CMAKE_CURRENT_SOURCE_DIR}/lief_gnuhash_debug_fix.patch
|
||||
CMAKE_ARGS
|
||||
${BUILD_TYPE_SPECIFIER}
|
||||
-DBIN_DIR=${BIN_DIR}
|
||||
|
||||
+1
-1
Submodule lief/LIEF updated: d05b3499b6...b16f99f9d2
@@ -1,10 +1,9 @@
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 334f6f83..d9b0db12 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
diff -Naur LIEF/CMakeLists.txt LIEF_BLD/CMakeLists.txt
|
||||
--- LIEF/CMakeLists.txt 2026-02-05 12:03:01.774599713 -0500
|
||||
+++ LIEF_BLD/CMakeLists.txt 2026-02-05 12:03:42.945448427 -0500
|
||||
@@ -1,4 +1,4 @@
|
||||
-cmake_minimum_required(VERSION 3.24)
|
||||
+cmake_minimum_required(VERSION 3.22)
|
||||
project(LIEF LANGUAGES C CXX)
|
||||
|
||||
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
|
||||
enable_language(C)
|
||||
|
||||
@@ -1,97 +0,0 @@
|
||||
diff --git a/src/ELF/Binary.cpp b/src/ELF/Binary.cpp
|
||||
index 5ce58838d2..241eedb35e 100644
|
||||
--- a/src/ELF/Binary.cpp
|
||||
+++ b/src/ELF/Binary.cpp
|
||||
@@ -3018,21 +3018,30 @@ uint64_t Binary::relocate_phdr_table_v2() {
|
||||
sizeof(details::ELF64::Elf_Phdr);
|
||||
|
||||
|
||||
- std::vector<Segment*> load_seg;
|
||||
- Segment* bss_segment = nullptr;
|
||||
- size_t bss_cnt = 0;
|
||||
+ Segment* last_file_load = nullptr;
|
||||
+ Segment* last_virtual_load = nullptr;
|
||||
for (std::unique_ptr<Segment>& segment : segments_) {
|
||||
- if (segment->is_load()) {
|
||||
- load_seg.push_back(segment.get());
|
||||
- if (segment->physical_size() < segment->virtual_size()) {
|
||||
- bss_segment = segment.get();
|
||||
- ++bss_cnt;
|
||||
- }
|
||||
+ if (!segment->is_load()) {
|
||||
+ continue;
|
||||
}
|
||||
+ if (last_file_load == nullptr ||
|
||||
+ last_file_load->file_offset() < segment->file_offset()) {
|
||||
+ last_file_load = segment.get();
|
||||
+ }
|
||||
+ if (last_virtual_load == nullptr ||
|
||||
+ last_virtual_load->virtual_address() < segment->virtual_address()) {
|
||||
+ last_virtual_load = segment.get();
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ if (last_file_load == nullptr || last_file_load != last_virtual_load) {
|
||||
+ LIEF_ERR("Unable to identify a unique final LOAD segment");
|
||||
+ return 0;
|
||||
}
|
||||
|
||||
- if (bss_cnt != 1 || bss_segment == nullptr) {
|
||||
- LIEF_ERR("Expected exactly 1 BSS-like segment");
|
||||
+ Segment* bss_segment = last_file_load;
|
||||
+ if (bss_segment->physical_size() >= bss_segment->virtual_size()) {
|
||||
+ LIEF_ERR("The final LOAD segment is not BSS-like");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -3159,6 +3168,11 @@ uint64_t Binary::relocate_phdr_table_v2() {
|
||||
phdr_segment->file_offset(nsegment_addr->file_offset());
|
||||
phdr_segment->virtual_address(nsegment_addr->virtual_address());
|
||||
phdr_segment->physical_address(nsegment_addr->physical_address());
|
||||
+ // PT_PHDR must describe the area we just reserved. Otherwise, it would
|
||||
+ // keep the size of its previous location which is likely to no longer be
|
||||
+ // wrapped by a PT_LOAD segment.
|
||||
+ phdr_segment->physical_size(nsegment_addr->physical_size());
|
||||
+ phdr_segment->virtual_size(nsegment_addr->virtual_size());
|
||||
phdr_segment->clear();
|
||||
}
|
||||
|
||||
@@ -3238,14 +3252,20 @@ uint64_t Binary::relocate_phdr_table_v1() {
|
||||
continue;
|
||||
}
|
||||
Segment* adjacent = load_seg[i + 1];
|
||||
- const int64_t gap = adjacent->file_offset() -
|
||||
- (current->file_offset() + current->physical_size());
|
||||
- if (gap <= 0) {
|
||||
+ const int64_t file_gap = adjacent->file_offset() -
|
||||
+ (current->file_offset() + current->physical_size());
|
||||
+ const int64_t virtual_gap = adjacent->virtual_address() -
|
||||
+ (current->virtual_address() + current->virtual_size());
|
||||
+ if (file_gap <= 0 || virtual_gap <= 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
+ // Extending the segment through a larger file gap would overlap the next
|
||||
+ // LOAD in memory when their file and virtual layouts differ.
|
||||
+ const int64_t gap = std::min(file_gap, virtual_gap);
|
||||
const size_t nb_seg_gap = gap / phdr_size;
|
||||
- LIEF_DEBUG("Gap between {:d} <-> {:d}: {:x} ({:d} segments)", i, i + 1, gap,
|
||||
+ LIEF_DEBUG("Gap between {:d} <-> {:d}: file={:x}, virtual={:x} "
|
||||
+ "({:d} segments usable)", i, i + 1, file_gap, virtual_gap,
|
||||
nb_seg_gap);
|
||||
if (nb_seg_gap > potential_size) {
|
||||
seg_to_extend = current;
|
||||
@@ -3275,8 +3295,11 @@ uint64_t Binary::relocate_phdr_table_v1() {
|
||||
|
||||
// Extend the segment that wraps the next PHDR table so that it is contiguous
|
||||
// with the next segment.
|
||||
- int64_t delta = next_to_extend->file_offset() -
|
||||
- (seg_to_extend->file_offset() + seg_to_extend->physical_size());
|
||||
+ const int64_t file_gap = next_to_extend->file_offset() -
|
||||
+ (seg_to_extend->file_offset() + seg_to_extend->physical_size());
|
||||
+ const int64_t virtual_gap = next_to_extend->virtual_address() -
|
||||
+ (seg_to_extend->virtual_address() + seg_to_extend->virtual_size());
|
||||
+ const int64_t delta = std::min(file_gap, virtual_gap);
|
||||
if (delta <= 0) {
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
diff -Naur LIEF/src/ELF/Symbol.cpp LIEF_BLD/src/ELF/Symbol.cpp
|
||||
--- LIEF/src/ELF/Symbol.cpp 2026-07-01 09:26:59.559741917 -0400
|
||||
+++ LIEF_BLD/src/ELF/Symbol.cpp 2026-07-01 09:28:31.414010111 -0400
|
||||
@@ -90,15 +90,20 @@
|
||||
} else {
|
||||
#if defined(__unix__)
|
||||
int status;
|
||||
- const std::string& name = this->name().c_str();
|
||||
+ const std::string& name = this->name();
|
||||
+ if (name.rfind("_Z", 0) != 0) {
|
||||
+ return name;
|
||||
+ }
|
||||
+
|
||||
char* demangled_name = abi::__cxa_demangle(name.c_str(), nullptr, nullptr, &status);
|
||||
|
||||
- if (status == 0) {
|
||||
+ if (status == 0 && demangled_name != nullptr) {
|
||||
std::string realname = demangled_name;
|
||||
free(demangled_name);
|
||||
return realname;
|
||||
}
|
||||
|
||||
+ free(demangled_name); // NOLINT(cppcoreguidelines-no-malloc)
|
||||
return name;
|
||||
#else
|
||||
return "";
|
||||
@@ -0,0 +1,16 @@
|
||||
diff -Naur LIEF/src/ELF/ExeLayout.hpp LIEF_BLD/src/ELF/ExeLayout.hpp
|
||||
--- LIEF/src/ELF/ExeLayout.hpp 2026-07-01 09:31:32.857666677 -0400
|
||||
+++ LIEF_BLD/src/ELF/ExeLayout.hpp 2026-07-01 09:32:35.642528989 -0400
|
||||
@@ -380,7 +380,11 @@
|
||||
std::vector<uint32_t> hash_values(dynamic_symbols.size() - symndx, 0);
|
||||
|
||||
for (size_t i = symndx; i < dynamic_symbols.size(); ++i) {
|
||||
- LIEF_DEBUG("Dealing with symbol {}", to_string(dynamic_symbols[i]));
|
||||
+ // Avoid stringifying the symbol here: Symbol::operator<< demangles
|
||||
+ // names, and this debug argument is evaluated even when debug logging
|
||||
+ // is disabled. The GNU hash rebuild only needs the raw symbol name.
|
||||
+ // Causes a crash with QtCore-style malformed symbols.
|
||||
+ LIEF_DEBUG("Dealing with symbol {}", dynamic_symbols[i].name());
|
||||
const uint32_t hash = dl_new_hash(dynamic_symbols[i].name().c_str());
|
||||
int bucket = hash % nb_buckets;
|
||||
|
||||
@@ -1,34 +0,0 @@
|
||||
diff --git a/include/LIEF/runtime/osx/Host.hpp b/include/LIEF/runtime/osx/Host.hpp
|
||||
index bc366a58..7e155749 100644
|
||||
--- a/include/LIEF/runtime/osx/Host.hpp
|
||||
+++ b/include/LIEF/runtime/osx/Host.hpp
|
||||
@@ -32,9 +32,9 @@ class LIEF_API Host {
|
||||
uint32_t patch = 0;
|
||||
|
||||
version_t(uint32_t major, uint32_t minor, uint32_t patch) :
|
||||
- major(major),
|
||||
- minor(minor),
|
||||
- patch(patch) {}
|
||||
+ major{major},
|
||||
+ minor{minor},
|
||||
+ patch{patch} {}
|
||||
|
||||
bool operator<=(const version_t& rhs) const;
|
||||
bool operator>(const version_t& rhs) const {
|
||||
diff --git a/include/LIEF/runtime/windows/Host.hpp b/include/LIEF/runtime/windows/Host.hpp
|
||||
index ba5c8694..8c37cbad 100644
|
||||
--- a/include/LIEF/runtime/windows/Host.hpp
|
||||
+++ b/include/LIEF/runtime/windows/Host.hpp
|
||||
@@ -35,9 +35,9 @@ class LIEF_API Host {
|
||||
version_t() = default;
|
||||
|
||||
version_t(uint32_t major, uint32_t minor, uint32_t build_number) :
|
||||
- major(major),
|
||||
- minor(minor),
|
||||
- build_number(build_number) {}
|
||||
+ major{major},
|
||||
+ minor{minor},
|
||||
+ build_number{build_number} {}
|
||||
|
||||
bool operator<=(const version_t& rhs) const;
|
||||
bool operator>(const version_t& rhs) const {
|
||||
+1
-1
Submodule lmdb/lmdb updated: 6f0a32496a...1e4cd2d792
@@ -16,8 +16,7 @@ if (ENABLE_MANIFOLD)
|
||||
ExternalProject_Add(MANIFOLD_BLD
|
||||
URL "${CMAKE_CURRENT_SOURCE_DIR}/manifold"
|
||||
BUILD_ALWAYS ${EXT_BUILD_ALWAYS} ${LOG_OPTS}
|
||||
PATCH_COMMAND ${PATCH_EXECUTABLE};-E;-p1;${PATCH_OPTIONS};-i;${CMAKE_CURRENT_SOURCE_DIR}/manifold_static.patch
|
||||
COMMAND ${PATCH_EXECUTABLE};-E;-p1;${PATCH_OPTIONS};-i;${CMAKE_CURRENT_SOURCE_DIR}/manifold_alloc.patch
|
||||
PATCH_COMMAND ${PATCH_EXECUTABLE};-E;-p1;${PATCH_OPTIONS};-i;${CMAKE_CURRENT_SOURCE_DIR}/manifold.patch
|
||||
CMAKE_ARGS
|
||||
${BUILD_TYPE_SPECIFIER}
|
||||
$<$<BOOL:${CLIPPER2_TARGET}>:-DClipper2_ROOT=${CMAKE_BUNDLE_INSTALL_PREFIX}>
|
||||
|
||||
+1
-1
Submodule manifold/manifold updated: 0edd9d5487...7e2292bb24
@@ -0,0 +1,78 @@
|
||||
diff -Naur MANIFOLD/CMakeLists.txt MANIFOLD_BLD/CMakeLists.txt
|
||||
--- MANIFOLD/CMakeLists.txt 2026-04-30 12:43:33.539859541 -0400
|
||||
+++ MANIFOLD_BLD/CMakeLists.txt 2026-04-30 12:48:59.647836994 -0400
|
||||
@@ -36,6 +36,9 @@
|
||||
"${MANIFOLD_VERSION_MAJOR}.${MANIFOLD_VERSION_MINOR}.${MANIFOLD_VERSION_PATCH}"
|
||||
)
|
||||
|
||||
+# Toggle to also build a static library
|
||||
+option(BUILD_STATIC_LIBS "Build a static library (manifold-static) alongside the shared library" OFF)
|
||||
+
|
||||
# Primary user facing options
|
||||
option(MANIFOLD_CROSS_SECTION "Build CrossSection for 2D support" ON)
|
||||
option(MANIFOLD_DEBUG "Enable debug tracing/timing" OFF)
|
||||
diff -Naur MANIFOLD/src/CMakeLists.txt MANIFOLD_BLD/src/CMakeLists.txt
|
||||
--- MANIFOLD/src/CMakeLists.txt 2026-04-30 12:43:33.531859567 -0400
|
||||
+++ MANIFOLD_BLD/src/CMakeLists.txt 2026-04-30 12:53:50.548912999 -0400
|
||||
@@ -102,6 +102,60 @@
|
||||
PRIVATE ${MANIFOLD_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
+install(TARGETS manifold EXPORT manifoldTargets)
|
||||
+
|
||||
exportlib(manifold)
|
||||
|
||||
-install(TARGETS manifold EXPORT manifoldTargets)
|
||||
+# -----------------------------------------------------------------------
|
||||
+# Optional static library target
|
||||
+# -----------------------------------------------------------------------
|
||||
+if(BUILD_STATIC_LIBS)
|
||||
+ add_library(manifold_static STATIC
|
||||
+ ${MANIFOLD_SRCS} ${MANIFOLD_PRIVATE_HDRS}
|
||||
+ )
|
||||
+
|
||||
+ set_target_properties(manifold_static PROPERTIES
|
||||
+ OUTPUT_NAME manifold
|
||||
+ EXPORT_NAME manifold-static
|
||||
+ )
|
||||
+
|
||||
+ target_compile_features(manifold_static PUBLIC cxx_std_17)
|
||||
+ target_compile_options(manifold_static PRIVATE ${MANIFOLD_FLAGS})
|
||||
+
|
||||
+ # Reuse the OPTIONS list already set above for the shared target.
|
||||
+ foreach(OPT IN LISTS OPTIONS)
|
||||
+ if(${${OPT}})
|
||||
+ target_compile_definitions(manifold_static PUBLIC ${OPT})
|
||||
+ endif()
|
||||
+ endforeach()
|
||||
+ if(MANIFOLD_PAR)
|
||||
+ target_compile_definitions(manifold_static PUBLIC MANIFOLD_PAR=1)
|
||||
+ else()
|
||||
+ target_compile_definitions(manifold_static PUBLIC MANIFOLD_PAR=-1)
|
||||
+ endif()
|
||||
+
|
||||
+ target_include_directories(manifold_static
|
||||
+ PUBLIC
|
||||
+ $<INSTALL_INTERFACE:include>
|
||||
+ $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
|
||||
+ $<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/include>
|
||||
+ PRIVATE
|
||||
+ ${MANIFOLD_INCLUDE_DIRS}
|
||||
+ )
|
||||
+
|
||||
+ target_link_libraries(manifold_static
|
||||
+ PUBLIC
|
||||
+ $<$<BOOL:${TRACY_ENABLE}>:TracyClient>
|
||||
+ PRIVATE
|
||||
+ $<$<BOOL:${MANIFOLD_CROSS_SECTION}>:Clipper2::Clipper2-static>
|
||||
+ $<$<BOOL:${MANIFOLD_PAR}>:TBB::tbb>
|
||||
+ $<$<BOOL:${MANIFOLD_EXPORT}>:assimp::assimp>
|
||||
+ )
|
||||
+
|
||||
+ install(TARGETS manifold_static EXPORT manifoldTargets
|
||||
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
+ INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
|
||||
+ )
|
||||
+
|
||||
+endif()
|
||||
+
|
||||
@@ -1,167 +0,0 @@
|
||||
--- MANIFOLD/src/vec.h
|
||||
+++ MANIFOLD_BLD/src/vec.h
|
||||
@@ -31,6 +31,10 @@
|
||||
#define ZoneScoped
|
||||
#define ZoneScopedN(name)
|
||||
#endif
|
||||
+#include <cstdlib>
|
||||
+#include <limits>
|
||||
+#include <memory>
|
||||
+#include <new>
|
||||
#include <vector>
|
||||
|
||||
#include "manifold/vec_view.h"
|
||||
@@ -70,16 +74,14 @@
|
||||
// Note that the vector constructed with this constructor will contain
|
||||
// uninitialized memory. Please specify `val` if you need to make sure that
|
||||
// the data is initialized.
|
||||
- inline Vec(size_t size) : VecView<T>() {
|
||||
+ inline Vec(size_t size) : Vec() {
|
||||
ZoneScopedN("Vec(size)");
|
||||
- if constexpr (shared) count_ = new std::atomic<int>(1);
|
||||
reserve(size);
|
||||
this->size_ = size;
|
||||
}
|
||||
|
||||
- inline Vec(size_t size, T val) : VecView<T>() {
|
||||
+ inline Vec(size_t size, T val) : Vec() {
|
||||
ZoneScopedN("Vec(size, val)");
|
||||
- if constexpr (shared) count_ = new std::atomic<int>(1);
|
||||
resize(size, val);
|
||||
}
|
||||
|
||||
@@ -112,17 +114,15 @@
|
||||
moveContent(other);
|
||||
}
|
||||
|
||||
- inline Vec(const VecView<const T>& vec) : VecView<T>() {
|
||||
+ inline Vec(const VecView<const T>& vec) : Vec() {
|
||||
ZoneScopedN("Vec(const VecView&)");
|
||||
- if constexpr (shared) this->count_ = new std::atomic<int>(1);
|
||||
this->size_ = vec.size();
|
||||
this->capacity_ = this->size_;
|
||||
auto policy = autoPolicy(this->size_);
|
||||
if (this->size_ != 0) {
|
||||
- this->ptr_ = reinterpret_cast<T*>(malloc(this->size_ * sizeof(T)));
|
||||
- ASSERT(this->ptr_ != nullptr, std::bad_alloc());
|
||||
- TracyAllocS(this->ptr_, this->size_ * sizeof(T), 3);
|
||||
- copy(policy, vec.begin(), vec.end(), this->ptr_);
|
||||
+ auto buffer = allocate(this->size_);
|
||||
+ copy(policy, vec.begin(), vec.end(), buffer.get());
|
||||
+ this->ptr_ = buffer.release();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -137,8 +137,8 @@
|
||||
Vec& operator=(const Vec& other) {
|
||||
ZoneScopedN("Vec operator=(other)");
|
||||
if (&other == this) return *this;
|
||||
- dealloc();
|
||||
if constexpr (shared) {
|
||||
+ dealloc();
|
||||
other.count_->fetch_add(1);
|
||||
this->count_ = other.count_;
|
||||
this->ptr_ = other.ptr_;
|
||||
@@ -146,29 +146,15 @@
|
||||
this->capacity_ = other.capacity_;
|
||||
return *this;
|
||||
}
|
||||
- this->size_ = other.size_;
|
||||
- this->capacity_ = other.size_;
|
||||
- if (this->size_ != 0) {
|
||||
- this->ptr_ = reinterpret_cast<T*>(malloc(this->size_ * sizeof(T)));
|
||||
- ASSERT(this->ptr_ != nullptr, std::bad_alloc());
|
||||
- TracyAllocS(this->ptr_, this->size_ * sizeof(T), 3);
|
||||
- manifold::copy(other.begin(), other.end(), this->ptr_);
|
||||
- }
|
||||
+ Vec replacement(other.view());
|
||||
+ swap(replacement);
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline Vec<T, shared>& operator=(const Vec<T, !shared>& other) {
|
||||
ZoneScopedN("Vec operator=(other)");
|
||||
- dealloc();
|
||||
- if constexpr (shared) this->count_ = new std::atomic<int>(1);
|
||||
- this->size_ = other.size_;
|
||||
- this->capacity_ = other.size_;
|
||||
- if (this->size_ != 0) {
|
||||
- this->ptr_ = reinterpret_cast<T*>(malloc(this->size_ * sizeof(T)));
|
||||
- ASSERT(this->ptr_ != nullptr, std::bad_alloc());
|
||||
- TracyAllocS(this->ptr_, this->size_ * sizeof(T), 3);
|
||||
- manifold::copy(other.begin(), other.end(), this->ptr_);
|
||||
- }
|
||||
+ Vec replacement(other.view());
|
||||
+ *this = std::move(replacement);
|
||||
return *this;
|
||||
}
|
||||
|
||||
@@ -221,17 +207,15 @@
|
||||
void reserve(size_t n) {
|
||||
AssertUnique();
|
||||
if (n > capacity_) {
|
||||
- T* newBuffer = reinterpret_cast<T*>(malloc(n * sizeof(T)));
|
||||
- ASSERT(newBuffer != nullptr, std::bad_alloc());
|
||||
- TracyAllocS(newBuffer, n * sizeof(T), 3);
|
||||
+ auto newBuffer = allocate(n);
|
||||
if (this->size_ > 0)
|
||||
manifold::copy(autoPolicy(this->size_), this->ptr_,
|
||||
- this->ptr_ + this->size_, newBuffer);
|
||||
+ this->ptr_ + this->size_, newBuffer.get());
|
||||
if (this->ptr_ != nullptr) {
|
||||
TracyFreeS(this->ptr_, 3);
|
||||
free(this->ptr_);
|
||||
}
|
||||
- this->ptr_ = newBuffer;
|
||||
+ this->ptr_ = newBuffer.release();
|
||||
capacity_ = n;
|
||||
}
|
||||
}
|
||||
@@ -269,18 +253,16 @@
|
||||
|
||||
void shrink_to_fit() {
|
||||
AssertUnique();
|
||||
- T* newBuffer = nullptr;
|
||||
+ Buffer newBuffer;
|
||||
if (this->size_ > 0) {
|
||||
- newBuffer = reinterpret_cast<T*>(malloc(this->size_ * sizeof(T)));
|
||||
- ASSERT(newBuffer != nullptr, std::bad_alloc());
|
||||
- TracyAllocS(newBuffer, this->size_ * sizeof(T), 3);
|
||||
- manifold::copy(this->ptr_, this->ptr_ + this->size_, newBuffer);
|
||||
+ newBuffer = allocate(this->size_);
|
||||
+ manifold::copy(this->ptr_, this->ptr_ + this->size_, newBuffer.get());
|
||||
}
|
||||
if (this->ptr_ != nullptr) {
|
||||
TracyFreeS(this->ptr_, 3);
|
||||
free(this->ptr_);
|
||||
}
|
||||
- this->ptr_ = newBuffer;
|
||||
+ this->ptr_ = newBuffer.release();
|
||||
capacity_ = this->size_;
|
||||
}
|
||||
|
||||
@@ -297,6 +279,24 @@
|
||||
}
|
||||
|
||||
private:
|
||||
+ struct BufferDeleter {
|
||||
+ void operator()(T* pointer) const noexcept {
|
||||
+ TracyFreeS(pointer, 3);
|
||||
+ free(pointer);
|
||||
+ }
|
||||
+ };
|
||||
+ using Buffer = std::unique_ptr<T, BufferDeleter>;
|
||||
+
|
||||
+ static Buffer allocate(size_t count) {
|
||||
+ if (count > std::numeric_limits<size_t>::max() / sizeof(T))
|
||||
+ throw std::bad_alloc();
|
||||
+ T* pointer = reinterpret_cast<T*>(malloc(count * sizeof(T)));
|
||||
+ // Allocation failures must be handled in release builds as well.
|
||||
+ if (pointer == nullptr) throw std::bad_alloc();
|
||||
+ TracyAllocS(pointer, count * sizeof(T), 3);
|
||||
+ return Buffer(pointer);
|
||||
+ }
|
||||
+
|
||||
size_t capacity_ = 0;
|
||||
|
||||
// Normally empty structs have size 1 (1 byte) to ensure every field has a
|
||||
@@ -1,81 +0,0 @@
|
||||
--- MANIFOLD/CMakeLists.txt
|
||||
+++ MANIFOLD_BLD/CMakeLists.txt
|
||||
@@ -114,6 +114,12 @@
|
||||
option(CMAKE_BUILD_TYPE "Build type" Release)
|
||||
# default to building shared library
|
||||
option(BUILD_SHARED_LIBS "Build shared library" ON)
|
||||
+# optionally build a static library alongside the shared library
|
||||
+option(
|
||||
+ BUILD_STATIC_LIBS
|
||||
+ "Build a static library (manifold-static) alongside the shared library"
|
||||
+ OFF
|
||||
+)
|
||||
# Set some option values in the CMake cache
|
||||
set(MANIFOLD_FLAGS "" CACHE STRING "Manifold compiler flags")
|
||||
|
||||
--- MANIFOLD/src/CMakeLists.txt
|
||||
+++ MANIFOLD_BLD/src/CMakeLists.txt
|
||||
@@ -131,3 +131,63 @@
|
||||
exportlib(manifold)
|
||||
|
||||
install(TARGETS manifold EXPORT manifoldTargets)
|
||||
+
|
||||
+if(BUILD_STATIC_LIBS AND BUILD_SHARED_LIBS)
|
||||
+ add_library(manifold_static STATIC ${MANIFOLD_SRCS} ${MANIFOLD_PRIVATE_HDRS})
|
||||
+
|
||||
+ set_target_properties(
|
||||
+ manifold_static
|
||||
+ PROPERTIES OUTPUT_NAME manifold EXPORT_NAME manifold-static
|
||||
+ )
|
||||
+
|
||||
+ target_link_libraries(
|
||||
+ manifold_static PUBLIC $<$<BOOL:${TRACY_ENABLE}>:TracyClient>
|
||||
+ )
|
||||
+
|
||||
+ set(MANIFOLD_STATIC_CROSS_SECTION_LIBS ${MANIFOLD_CROSS_SECTION_LIBS})
|
||||
+ if(
|
||||
+ MANIFOLD_CROSS_SECTION
|
||||
+ AND MANIFOLD_CROSS_SECTION_BACKEND STREQUAL "clipper2"
|
||||
+ AND TARGET Clipper2::Clipper2-static
|
||||
+ )
|
||||
+ set(MANIFOLD_STATIC_CROSS_SECTION_LIBS Clipper2::Clipper2-static)
|
||||
+ endif()
|
||||
+ target_link_libraries(
|
||||
+ manifold_static
|
||||
+ PRIVATE
|
||||
+ $<$<BOOL:${MANIFOLD_PAR}>:TBB::tbb>
|
||||
+ ${MANIFOLD_STATIC_CROSS_SECTION_LIBS}
|
||||
+ )
|
||||
+
|
||||
+ target_compile_options(manifold_static PRIVATE ${MANIFOLD_FLAGS})
|
||||
+ target_compile_features(manifold_static PUBLIC cxx_std_17)
|
||||
+ foreach(OPT IN LISTS OPTIONS)
|
||||
+ if(${${OPT}})
|
||||
+ target_compile_definitions(manifold_static PUBLIC ${OPT})
|
||||
+ endif()
|
||||
+ endforeach()
|
||||
+ if(MANIFOLD_PAR)
|
||||
+ target_compile_definitions(manifold_static PUBLIC MANIFOLD_PAR=1)
|
||||
+ else()
|
||||
+ target_compile_definitions(manifold_static PUBLIC MANIFOLD_PAR=-1)
|
||||
+ endif()
|
||||
+ if(MANIFOLD_NO_IOSTREAM)
|
||||
+ target_compile_definitions(manifold_static PUBLIC MANIFOLD_NO_FILESYSTEM)
|
||||
+ endif()
|
||||
+
|
||||
+ target_include_directories(
|
||||
+ manifold_static
|
||||
+ PUBLIC
|
||||
+ $<INSTALL_INTERFACE:include>
|
||||
+ $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
|
||||
+ $<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/include>
|
||||
+ PRIVATE ${MANIFOLD_INCLUDE_DIRS}
|
||||
+ )
|
||||
+
|
||||
+ install(
|
||||
+ TARGETS manifold_static
|
||||
+ EXPORT manifoldTargets
|
||||
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
+ INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
|
||||
+ )
|
||||
+endif()
|
||||
+1
-1
Submodule netpbm/netpbm updated: 3da4bff319...99ce8abc6f
+1
-1
Submodule onetbb/oneTBB updated: 3046c8b0c2...ea2f73b591
@@ -49,7 +49,7 @@ if (ENABLE_OPENCV)
|
||||
-DBUILD_opencv_apps=ON
|
||||
-DBUILD_opencv_calib3d=OFF
|
||||
-DBUILD_opencv_core=ON
|
||||
-DBUILD_opencv_dnn=OFF
|
||||
-DBUILD_opencv_dnn=ON
|
||||
-DBUILD_opencv_features2d=ON
|
||||
-DBUILD_opencv_flann=ON
|
||||
-DBUILD_opencv_highgui=ON
|
||||
@@ -79,7 +79,7 @@ if (ENABLE_OPENCV)
|
||||
-DWITH_CUDA=OFF
|
||||
-DWITH_EIGEN=OFF
|
||||
-DWITH_FFMPEG=OFF
|
||||
-DWITH_FLATBUFFERS=OFF
|
||||
-DWITH_FLATBUFFERS=ON
|
||||
-DWITH_FREETYPE=OFF
|
||||
-DWITH_GDAL=OFF
|
||||
-DWITH_GDCM=OFF
|
||||
|
||||
+1
-1
Submodule opencv/opencv updated: 40738fb16c...ed26aa55c1
@@ -36,6 +36,17 @@ diff -Naur opencv/CMakeLists.txt OPENCV_BLD/CMakeLists.txt
|
||||
include(cmake/OpenCVMinDepVersions.cmake)
|
||||
|
||||
if(CMAKE_SYSTEM_NAME MATCHES WindowsPhone OR CMAKE_SYSTEM_NAME MATCHES WindowsStore)
|
||||
@@ -68,6 +70,10 @@
|
||||
cmake_policy(SET CMP0071 NEW) # CMake 3.10+: Let `AUTOMOC` and `AUTOUIC` process `GENERATED` files.
|
||||
endif()
|
||||
|
||||
+if (POLICY CMP0074)
|
||||
+ cmake_policy(SET CMP0074 NEW) # CMake 3.12+: find_package() uses <PackageName>_ROOT variables.
|
||||
+endif (POLICY CMP0074)
|
||||
+
|
||||
if(POLICY CMP0075)
|
||||
cmake_policy(SET CMP0075 NEW) # CMake 3.12+: Include file check macros honor `CMAKE_REQUIRED_LIBRARIES`
|
||||
endif()
|
||||
@@ -1154,7 +1160,7 @@
|
||||
if(ANDROID OR NOT UNIX)
|
||||
install(FILES ${OPENCV_LICENSE_FILE}
|
||||
|
||||
+1
-1
Submodule opennurbs/opennurbs updated: 23fc677ba0...285c43ce2b
@@ -1,5 +1,17 @@
|
||||
--- opennurbs/opennurbs_precompiledheader.cpp 2024-09-24 11:00:03.440753786 -0400
|
||||
+++ OPENNURBS_BLD/opennurbs_precompiledheader.cpp 2024-09-24 10:59:40.545148988 -0400
|
||||
@@ -28,9 +28,9 @@
|
||||
#error Incorrect _M_... setting for x64 build
|
||||
#endif
|
||||
|
||||
-#if !defined(_M_X64)
|
||||
+#if !defined(_M_X64) && !defined(_M_ARM64)
|
||||
// This should be automatically defined by the compiler
|
||||
-#error _M_X64 should be defined for x64 builds
|
||||
+#error _M_X64 or _M_ARM64 should be defined for x64 or ARM64 builds
|
||||
#endif
|
||||
|
||||
// All opennurbs code uses the "offical" _M_X64. Unfortunately,
|
||||
@@ -39,9 +39,9 @@
|
||||
// _M_X64 and _M_AMD64 for the WIN64 platform. If it doesn't,
|
||||
// then we have a serious problem because some system header
|
||||
@@ -21,6 +33,18 @@
|
||||
#error Incorrect _M_... setting for 32 bit Windows build.
|
||||
#endif
|
||||
|
||||
@@ -104,9 +104,9 @@
|
||||
#error Incorrect _M_... setting for x64 build
|
||||
#endif
|
||||
|
||||
-#if !defined(_M_X64)
|
||||
+#if !defined(_M_X64) && !defined(_M_ARM64)
|
||||
// This should be automatically defined by the compiler
|
||||
-#error _M_X64 should be defined for x64 builds
|
||||
+#error _M_X64 or _M_ARM64 should be defined for x64 or ARM64 builds
|
||||
#endif
|
||||
|
||||
// All opennurbs code uses the "offical" _M_X64. Unfortunately,
|
||||
@@ -115,9 +115,9 @@
|
||||
// _M_X64 and _M_AMD64 for the WIN64 platform. If it doesn't,
|
||||
// then we have a serious problem because some system header
|
||||
|
||||
@@ -12,6 +12,24 @@
|
||||
#endif
|
||||
/*
|
||||
//
|
||||
@@ -132,7 +137,7 @@
|
||||
#define ON_RUNTIME_WIN_WINOS
|
||||
#endif
|
||||
|
||||
-#if defined(_M_X64) || defined(_WIN64)
|
||||
+#if defined(_M_X64) || defined(_M_ARM64) || defined(_WIN64)
|
||||
#define ON_64BIT_RUNTIME
|
||||
#elif defined(_M_X86) || defined(_WIN32)
|
||||
#define ON_32BIT_RUNTIME
|
||||
@@ -141,7 +146,7 @@
|
||||
#endif
|
||||
|
||||
#if !defined(ON_LITTLE_ENDIAN)
|
||||
-#if (defined(_M_X64) || defined(_M_IX86) || defined (__i386__) || defined( __x86_64__ ))
|
||||
+#if (defined(_M_X64) || defined(_M_ARM64) || defined(_M_IX86) || defined(__i386__) || defined(__x86_64__) || defined(__x86_64))
|
||||
#define ON_LITTLE_ENDIAN
|
||||
#endif
|
||||
#endif
|
||||
@@ -151,7 +156,7 @@
|
||||
#define ON_RUNTIME_LINUX
|
||||
#endif
|
||||
|
||||
@@ -1,23 +1,23 @@
|
||||
--- opennurbs/opennurbs_zlib.cpp 2026-09-09 15:31:14.185083448 -0400
|
||||
+++ OPENNURBS_BLD/opennurbs_zlib.cpp 2026-09-09 15:41:51.335267196 -0400
|
||||
@@ -30,6 +30,7 @@
|
||||
// ON_CMAKE_BUILD should be renamed "ON_NOT_USING_MSVC_LINK_LIB_PRAGMA"
|
||||
// This whole thing should be reworked so MSVC builds also use build properties,
|
||||
// instead of this non-portable pragma.
|
||||
--- opennurbs/opennurbs_zlib.cpp 2024-06-25 15:44:35.958646126 -0400
|
||||
+++ OPENNURBS_BLD/opennurbs_zlib.cpp 2024-06-25 15:44:06.155134199 -0400
|
||||
@@ -23,6 +23,7 @@
|
||||
|
||||
#include "opennurbs_zlib.h"
|
||||
|
||||
+#if 0
|
||||
#if defined(ON_COMPILER_MSC) && !defined(ON_CMAKE_BUILD)
|
||||
|
||||
#if !defined(OPENNURBS_ZLIB_LIB_DIR)
|
||||
@@ -60,6 +61,8 @@
|
||||
@@ -52,6 +53,8 @@
|
||||
|
||||
#endif // defined(ON_COMPILER_MSC) && !defined(ON_CMAKE_BUILD)
|
||||
#endif
|
||||
|
||||
+#endif
|
||||
+
|
||||
// compressed buffer I/O uses zlib 1.1.3 inflate()/deflate()
|
||||
class ON_CompressorImplementation
|
||||
{
|
||||
@@ -327,11 +332,11 @@
|
||||
@@ -319,11 +322,11 @@
|
||||
// no uncompressed input is left - switch to finish mode
|
||||
flush = Z_FINISH;
|
||||
}
|
||||
@@ -31,7 +31,7 @@
|
||||
rc = false;
|
||||
break;
|
||||
}
|
||||
@@ -527,11 +532,11 @@
|
||||
@@ -519,11 +522,11 @@
|
||||
// no compressed input is left - switch to finish mode
|
||||
flush = Z_FINISH;
|
||||
}
|
||||
@@ -45,7 +45,7 @@
|
||||
rc = false;
|
||||
break;
|
||||
}
|
||||
@@ -1208,11 +1213,11 @@
|
||||
@@ -1200,11 +1203,11 @@
|
||||
// no uncompressed input is left - switch to finish mode
|
||||
flush = Z_FINISH;
|
||||
}
|
||||
@@ -59,7 +59,7 @@
|
||||
rc = false;
|
||||
break;
|
||||
}
|
||||
@@ -1341,11 +1346,11 @@
|
||||
@@ -1333,11 +1336,11 @@
|
||||
// no compressed input is left - switch to finish mode
|
||||
flush = Z_FINISH;
|
||||
}
|
||||
|
||||
@@ -17,14 +17,11 @@ if (ENABLE_OPENVDB)
|
||||
ExternalProject_Add(OPENVDB_BLD
|
||||
URL "${CMAKE_CURRENT_SOURCE_DIR}/openvdb"
|
||||
BUILD_ALWAYS ${EXT_BUILD_ALWAYS} ${LOG_OPTS}
|
||||
PATCH_COMMAND ${CMAKE_COMMAND};-E;copy;${PROJECT_SOURCE_DIR}/CMake/FindZLIB.cmake;<SOURCE_DIR>/cmake/FindZLIB.cmake
|
||||
#PATCH_COMMAND ${PATCH_EXECUTABLE};-E;-p1;${PATCH_OPTIONS};-i;${CMAKE_CURRENT_SOURCE_DIR}/openvdb.patch
|
||||
CMAKE_ARGS
|
||||
-DCMAKE_FIND_PACKAGE_PREFER_CONFIG=ON
|
||||
-DMIN_VER_CMAKE=3.19
|
||||
${BUILD_TYPE_SPECIFIER}
|
||||
# Do not let an earlier system-zlib result override the bundled ZLIB_ROOT.
|
||||
$<$<BOOL:${ZLIB_TARGET}>:-UZLIB_INCLUDE_DIR>
|
||||
$<$<BOOL:${ZLIB_TARGET}>:-UZLIB_LIBRARY*>
|
||||
$<$<BOOL:${ZLIB_TARGET}>:-DZ_PREFIX=ON>
|
||||
$<$<BOOL:${ZLIB_TARGET}>:-DZ_PREFIX_STR=${Z_PREFIX_STR}>
|
||||
$<$<BOOL:${ZLIB_TARGET}>:-DZLIB_ROOT=${CMAKE_BUNDLE_INSTALL_PREFIX}>
|
||||
|
||||
Submodule openvdb/openvdb deleted from c81d904ded
@@ -1,3 +1,3 @@
|
||||
ONETBB
|
||||
PATCH
|
||||
ZLIB
|
||||
|
||||
|
||||
+1
-1
Submodule osmesa/osmesa updated: bfa90de454...06676241df
+3
-53
@@ -5,50 +5,14 @@
|
||||
# tool by default.
|
||||
bext_enable_all_default(PATCH patch)
|
||||
|
||||
function(bext_find_patch_check_option patch_executable result_variable)
|
||||
set(check_directory "${CMAKE_BINARY_DIR}/CMakeFiles/patch-option-check")
|
||||
set(check_input "${check_directory}/input.txt")
|
||||
set(check_patch "${check_directory}/change.patch")
|
||||
file(MAKE_DIRECTORY "${check_directory}")
|
||||
file(WRITE "${check_patch}"
|
||||
"--- input.txt\n"
|
||||
"+++ input.txt\n"
|
||||
"@@ -1 +1 @@\n"
|
||||
"-before\n"
|
||||
"+after\n")
|
||||
|
||||
foreach(check_option IN ITEMS "--dry-run" "-C")
|
||||
file(WRITE "${check_input}" "before\n")
|
||||
execute_process(
|
||||
COMMAND "${patch_executable}" "${check_option}" -t -p 0
|
||||
-i "${check_patch}"
|
||||
WORKING_DIRECTORY "${check_directory}"
|
||||
RESULT_VARIABLE check_result
|
||||
OUTPUT_QUIET
|
||||
ERROR_QUIET
|
||||
)
|
||||
file(READ "${check_input}" check_contents)
|
||||
if (check_result EQUAL 0 AND check_contents STREQUAL "before\n")
|
||||
file(REMOVE_RECURSE "${check_directory}")
|
||||
set("${result_variable}" "${check_option}" PARENT_SCOPE)
|
||||
return()
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
file(REMOVE_RECURSE "${check_directory}")
|
||||
message(FATAL_ERROR
|
||||
"Patch executable ${patch_executable} has no supported check option")
|
||||
endfunction()
|
||||
|
||||
# Although individual projects may need their own patching options, there are
|
||||
# some common settings that will be used for most/all cases. We define those
|
||||
# here for uniformity.
|
||||
#
|
||||
# We ignore whitespace for portability and flexibility when applying patches.
|
||||
# Use split short options accepted by both bundled and Unix patch tools.
|
||||
# We ignore whitespace for portability and flexibility when applying patches
|
||||
#
|
||||
# -N avoids attempting to reverse patch if the patching is already done.
|
||||
set(PATCH_OPTIONS "-l;-N" CACHE STRING "Command line options to use when patching" FORCE)
|
||||
set(PATCH_OPTIONS "--ignore-whitespace;-N" CACHE STRING "Command line options to use when patching" FORCE)
|
||||
|
||||
# Preserve any existing user-specified patch path before we replace the public
|
||||
# PATCH_EXECUTABLE variable with a wrapper command list.
|
||||
@@ -75,7 +39,7 @@ if (ENABLE_PATCH)
|
||||
git_submodule_init(patch README.md)
|
||||
|
||||
ExternalProject_Add(PATCH_BLD
|
||||
URL "${CMAKE_CURRENT_SOURCE_DIR}/patch"
|
||||
SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/patch"
|
||||
BUILD_ALWAYS ${EXT_BUILD_ALWAYS} ${LOG_OPTS}
|
||||
CMAKE_ARGS
|
||||
${BUILD_TYPE_SPECIFIER}
|
||||
@@ -98,26 +62,12 @@ if (ENABLE_PATCH)
|
||||
|
||||
# If we're using sb_patch, add the newline-output option
|
||||
set(PATCH_OPTIONS "${PATCH_OPTIONS};--newline-output;preserve" CACHE STRING "Command line options to use when patching" FORCE)
|
||||
set(PATCH_CHECK_OPTION "--dry-run")
|
||||
|
||||
else (ENABLE_PATCH)
|
||||
|
||||
# GNU and BSD patch use different options for an applicability check.
|
||||
bext_find_patch_check_option("${PATCH_NATIVE_EXECUTABLE}"
|
||||
PATCH_CHECK_OPTION)
|
||||
|
||||
endif (ENABLE_PATCH)
|
||||
|
||||
set(PATCH_CHECK_OPTION "${PATCH_CHECK_OPTION}" CACHE INTERNAL
|
||||
"Patch option for a non-modifying applicability check" FORCE)
|
||||
set(PATCH_REJECT_DIR "${CMAKE_BINARY_DIR}/patch-rejects" CACHE INTERNAL
|
||||
"Directory for failed patch artifacts" FORCE)
|
||||
|
||||
set(PATCH_EXECUTABLE
|
||||
${CMAKE_COMMAND}
|
||||
-DBEXT_PATCH_NATIVE_EXECUTABLE:FILEPATH=${PATCH_NATIVE_EXECUTABLE}
|
||||
-DBEXT_PATCH_CHECK_OPTION:STRING=${PATCH_CHECK_OPTION}
|
||||
-DBEXT_PATCH_REJECT_DIR:PATH=${PATCH_REJECT_DIR}
|
||||
-P
|
||||
${CMAKE_SOURCE_DIR}/CMake/PatchWrapper.cmake
|
||||
--
|
||||
|
||||
@@ -1,206 +0,0 @@
|
||||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
// Copyright 2022-2026 Shannon Booth <shannon.ml.booth@gmail.com>
|
||||
|
||||
#include <algorithm>
|
||||
#include <patch/hunk.h>
|
||||
#include <patch/locator.h>
|
||||
#include <patch/utils.h>
|
||||
|
||||
namespace Patch {
|
||||
|
||||
bool matches_ignoring_whitespace(const std::string& as, const std::string& bs)
|
||||
{
|
||||
auto a = as.begin();
|
||||
auto b = bs.begin();
|
||||
|
||||
while (true) {
|
||||
if (b == bs.end() || is_whitespace(*b)) {
|
||||
// Strip leading whitespace off the second line (if any)
|
||||
while (b != bs.end() && is_whitespace(*b))
|
||||
++b;
|
||||
|
||||
// Now that we've stripped all leading whitespace off the second line,
|
||||
// strip all leading whitespace for the first line so that each
|
||||
// line should both be beginning with a non-whitespace character or
|
||||
// alternatively be at the end of the line.
|
||||
if (a != as.end()) {
|
||||
if (!is_whitespace(*a))
|
||||
return false;
|
||||
|
||||
do {
|
||||
a++;
|
||||
} while (a != as.end() && is_whitespace(*a));
|
||||
}
|
||||
|
||||
// Whitespace has been stripped off the beginning of both lines.
|
||||
// If either of the lines are at the end, the other line should
|
||||
// also be at the end! Any trailing whitespace should be trimmed
|
||||
// resulting in us reaching the end of the line by here.
|
||||
if (a == as.end())
|
||||
return b == bs.end();
|
||||
if (b == bs.end())
|
||||
return a == as.end();
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
// We know from the above check that 'b' was not at the end of the line.
|
||||
// Therefore - 'a' must also not be at the end of a line for the two
|
||||
// lines to be considered equal.
|
||||
if (a == as.end())
|
||||
return false;
|
||||
|
||||
// Whitespace is now normalized - we can (finally) perform the actual check!
|
||||
if (*a != *b)
|
||||
return false;
|
||||
|
||||
// Both characters are equal! Proceed to the next char for both lines.
|
||||
++a;
|
||||
++b;
|
||||
}
|
||||
}
|
||||
|
||||
bool matches(const Line& line1, const Line& line2, bool ignore_whitespace)
|
||||
{
|
||||
bool newline_match = line1.newline == line2.newline;
|
||||
bool content_match = line1.content == line2.content;
|
||||
|
||||
// Happy path - a perfect match
|
||||
if (newline_match && content_match)
|
||||
return true;
|
||||
|
||||
// Not an exact match - check if we need to try see if ignoring whitespace will help.
|
||||
if (!ignore_whitespace)
|
||||
return false;
|
||||
|
||||
// Fast path - content matches but newlines do not.
|
||||
if (content_match)
|
||||
return true;
|
||||
|
||||
return matches_ignoring_whitespace(line1.content, line2.content);
|
||||
}
|
||||
|
||||
LineNumber expected_line_number(const Hunk& hunk)
|
||||
{
|
||||
auto line = hunk.old_file_range.start_line;
|
||||
if (hunk.old_file_range.number_of_lines == 0)
|
||||
++line;
|
||||
return line;
|
||||
}
|
||||
|
||||
Location locate_hunk(const std::vector<Line>& content, const Hunk& hunk, bool ignore_whitespace, LineNumber offset, LineNumber max_fuzz)
|
||||
{
|
||||
// Make a first best guess at where the from-file range is telling us where the hunk should be.
|
||||
LineNumber offset_guess = expected_line_number(hunk) - 1 + offset;
|
||||
|
||||
// If there's no lines surrounding this hunk - it will always succeed,
|
||||
// so there is no point in checking any further. Note that this check is
|
||||
// also what makes matching against an empty 'from file' work (with no lines),
|
||||
// as in that case there is no content for us to even match against in the
|
||||
// first place!
|
||||
//
|
||||
// Furthermore, we also should reject patches being added when the hunk is
|
||||
// claiming the file is completely empty - but there are actually lines in
|
||||
// that file.
|
||||
if (hunk.old_file_range.number_of_lines == 0) {
|
||||
if (hunk.old_file_range.start_line == 0 && !content.empty())
|
||||
return {};
|
||||
const auto end = static_cast<LineNumber>(content.size());
|
||||
return { std::min(std::max<LineNumber>(offset_guess, 0), end), 0, 0 };
|
||||
}
|
||||
|
||||
LineNumber patch_prefix_content = 0;
|
||||
for (const auto& line : hunk.lines) {
|
||||
if (line.operation != ' ')
|
||||
break;
|
||||
++patch_prefix_content;
|
||||
}
|
||||
|
||||
LineNumber patch_suffix_content = 0;
|
||||
for (auto it = hunk.lines.rbegin(); it != hunk.lines.rend(); ++it) {
|
||||
if (it->operation != ' ')
|
||||
break;
|
||||
++patch_suffix_content;
|
||||
}
|
||||
|
||||
LineNumber context = std::max(patch_prefix_content, patch_suffix_content);
|
||||
|
||||
for (LineNumber fuzz = 0; fuzz <= max_fuzz; ++fuzz) {
|
||||
|
||||
auto suffix_fuzz = fuzz + patch_suffix_content - context;
|
||||
auto prefix_fuzz = fuzz + patch_prefix_content - context;
|
||||
const bool must_match_at_end = patch_suffix_content > 0 && suffix_fuzz < 0;
|
||||
const bool must_match_at_start = patch_prefix_content > 0 && prefix_fuzz < 0 && hunk.old_file_range.start_line <= 1;
|
||||
suffix_fuzz = std::max<LineNumber>(suffix_fuzz, 0);
|
||||
prefix_fuzz = std::max<LineNumber>(prefix_fuzz, 0);
|
||||
|
||||
// If the fuzz is greater than the total number of lines for a hunk,
|
||||
// then it may be possible for the hunk to match anything - so ignore
|
||||
// this case.
|
||||
if (static_cast<size_t>(suffix_fuzz) + static_cast<size_t>(prefix_fuzz) >= hunk.lines.size())
|
||||
return {};
|
||||
|
||||
auto hunk_matches_starting_from_line = [&](LineNumber line) {
|
||||
line += prefix_fuzz;
|
||||
|
||||
// Ensure that all of the lines in the hunk match starting from 'line'
|
||||
return std::all_of(hunk.lines.begin() + prefix_fuzz, hunk.lines.end() - suffix_fuzz, [&](const PatchLine& hunk_line) {
|
||||
// Ignore additions in our increment of line and
|
||||
// comparison as they are not part of the 'original file'
|
||||
if (hunk_line.operation == '+')
|
||||
return true;
|
||||
|
||||
if (static_cast<size_t>(line) >= content.size())
|
||||
return false;
|
||||
|
||||
// Check whether this line matches what is specified in this part of the hunk.
|
||||
if (!matches(content[static_cast<size_t>(line)], hunk_line.line, ignore_whitespace))
|
||||
return false;
|
||||
|
||||
// Proceed to the next line.
|
||||
++line;
|
||||
return true;
|
||||
});
|
||||
};
|
||||
|
||||
// Reduced leading or trailing context anchors a hunk to the beginning
|
||||
// or end of the file until enough fuzz permits matching elsewhere.
|
||||
if (must_match_at_start || must_match_at_end) {
|
||||
const auto end_line = static_cast<LineNumber>(content.size()) - hunk.old_file_range.number_of_lines;
|
||||
const auto line = must_match_at_start ? 0 : end_line;
|
||||
|
||||
if (line >= 0 && (!must_match_at_end || line == end_line) && hunk_matches_starting_from_line(line))
|
||||
return { line, fuzz, line - offset_guess };
|
||||
continue;
|
||||
}
|
||||
|
||||
// First look for the hunk in the forward direction
|
||||
for (LineNumber line = offset_guess; static_cast<size_t>(line) < content.size(); ++line) {
|
||||
if (hunk_matches_starting_from_line(line))
|
||||
return { line, fuzz, line - offset_guess };
|
||||
}
|
||||
|
||||
// Then look for it in the negative direction
|
||||
for (LineNumber line = offset_guess - 1; line >= 0; --line) {
|
||||
if (hunk_matches_starting_from_line(line))
|
||||
return { line, fuzz, line - offset_guess };
|
||||
}
|
||||
}
|
||||
|
||||
// No bueno.
|
||||
return {};
|
||||
}
|
||||
|
||||
bool has_prerequisite(const Line& line, const std::string& prerequisite)
|
||||
{
|
||||
return line.content.find(prerequisite) != std::string::npos;
|
||||
}
|
||||
|
||||
bool has_prerequisite(const std::vector<Line>& lines, const std::string& prerequisite)
|
||||
{
|
||||
return std::any_of(lines.begin(), lines.end(), [&prerequisite](const Line& line) {
|
||||
return has_prerequisite(line, prerequisite);
|
||||
});
|
||||
}
|
||||
|
||||
} // namespace Patch
|
||||
+1
-1
Submodule patch/patch updated: e0ae942bae...15358ea32a
@@ -0,0 +1,53 @@
|
||||
# Patchelf is only useful on some platforms - don't worry about trying
|
||||
# to build it everywhere
|
||||
if (NOT MSVC AND NOT APPLE)
|
||||
|
||||
# patchelf is used to rewrite RPATH settings on the third party binaries
|
||||
# after compilation - it is quite useful when it comes to making binary
|
||||
# bundles that can run successfully from locations other than their final
|
||||
# CMAKE_INSTALL_PREFIX target.
|
||||
|
||||
bext_enable_all_default(PATCHELF patchelf)
|
||||
|
||||
if (NOT ENABLE_PATCHELF)
|
||||
|
||||
find_program(PATCHELF_EXECUTABLE patchelf)
|
||||
mark_as_advanced(PATCHELF_EXECUTABLE)
|
||||
|
||||
if (NOT PATCHELF_EXECUTABLE AND NOT DEFINED ENABLE_PATCHELF)
|
||||
set(ENABLE_PATCHELF "ON" CACHE BOOL "Enable patchelf build")
|
||||
endif (NOT PATCHELF_EXECUTABLE AND NOT DEFINED ENABLE_PATCHELF)
|
||||
|
||||
endif (NOT ENABLE_PATCHELF)
|
||||
set(ENABLE_PATCHELF "${ENABLE_PATCHELF}" CACHE BOOL "Enable patchelf build")
|
||||
|
||||
if (ENABLE_PATCHELF)
|
||||
|
||||
ExternalProject_Add(PATCHELF_BLD
|
||||
SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/patchelf"
|
||||
BUILD_ALWAYS ${EXT_BUILD_ALWAYS} ${LOG_OPTS}
|
||||
CMAKE_ARGS
|
||||
$<$<NOT:$<BOOL:${CMAKE_CONFIGURATION_TYPES}>>:-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}>
|
||||
-DBIN_DIR=${BIN_DIR}
|
||||
-DBUILD_STATIC_LIBS=${BUILD_STATIC_LIBS}
|
||||
-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
|
||||
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
|
||||
-DCMAKE_INSTALL_PREFIX=${CMAKE_NOBUNDLE_INSTALL_PREFIX}
|
||||
-DLIB_DIR=${LIB_DIR}
|
||||
LOG_CONFIGURE ${EXT_BUILD_QUIET}
|
||||
LOG_BUILD ${EXT_BUILD_QUIET}
|
||||
LOG_INSTALL ${EXT_BUILD_QUIET}
|
||||
LOG_OUTPUT_ON_FAILURE ${EXT_BUILD_QUIET}
|
||||
STEP_TARGETS install
|
||||
)
|
||||
|
||||
endif (ENABLE_PATCHELF)
|
||||
|
||||
endif (NOT MSVC AND NOT APPLE)
|
||||
|
||||
# Local Variables:
|
||||
# tab-width: 8
|
||||
# mode: cmake
|
||||
# indent-tabs-mode: t
|
||||
# End:
|
||||
# ex: shiftwidth=2 tabstop=8
|
||||
@@ -0,0 +1,35 @@
|
||||
# Minimum required version of CMake
|
||||
cmake_minimum_required(VERSION 3.18)
|
||||
|
||||
# Set CMake project name
|
||||
project(PATCHELF)
|
||||
|
||||
if(NOT DEFINED BIN_DIR)
|
||||
set(BIN_DIR bin)
|
||||
endif(NOT DEFINED BIN_DIR)
|
||||
|
||||
if (NOT DEFINED LIB_DIR)
|
||||
set (LIB_DIR lib)
|
||||
endif (NOT DEFINED LIB_DIR)
|
||||
|
||||
include_directories(
|
||||
${CMAKE_CURRENT_BINARY_DIR}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
)
|
||||
|
||||
add_executable(patchelf patchelf.cc)
|
||||
set_target_properties(patchelf PROPERTIES FOLDER "Compilation Utilities")
|
||||
set(PATCHELF_EXECUTABLE "${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${BIN_DIR}/patchelf" CACHE STRING "patchelf location" FORCE)
|
||||
|
||||
install(TARGETS patchelf
|
||||
RUNTIME DESTINATION ${BIN_DIR}
|
||||
LIBRARY DESTINATION ${LIB_DIR}
|
||||
ARCHIVE DESTINATION ${LIB_DIR}
|
||||
)
|
||||
|
||||
# Local Variables:
|
||||
# tab-width: 8
|
||||
# mode: cmake
|
||||
# indent-tabs-mode: t
|
||||
# End:
|
||||
# ex: shiftwidth=2 tabstop=8
|
||||
@@ -0,0 +1,674 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU General Public License is a free, copyleft license for
|
||||
software and other kinds of works.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
the GNU General Public License is intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users. We, the Free Software Foundation, use the
|
||||
GNU General Public License for most of our software; it applies also to
|
||||
any other work released this way by its authors. You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to prevent others from denying you
|
||||
these rights or asking you to surrender the rights. Therefore, you have
|
||||
certain responsibilities if you distribute copies of the software, or if
|
||||
you modify it: responsibilities to respect the freedom of others.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must pass on to the recipients the same
|
||||
freedoms that you received. You must make sure that they, too, receive
|
||||
or can get the source code. And you must show them these terms so they
|
||||
know their rights.
|
||||
|
||||
Developers that use the GNU GPL protect your rights with two steps:
|
||||
(1) assert copyright on the software, and (2) offer you this License
|
||||
giving you legal permission to copy, distribute and/or modify it.
|
||||
|
||||
For the developers' and authors' protection, the GPL clearly explains
|
||||
that there is no warranty for this free software. For both users' and
|
||||
authors' sake, the GPL requires that modified versions be marked as
|
||||
changed, so that their problems will not be attributed erroneously to
|
||||
authors of previous versions.
|
||||
|
||||
Some devices are designed to deny users access to install or run
|
||||
modified versions of the software inside them, although the manufacturer
|
||||
can do so. This is fundamentally incompatible with the aim of
|
||||
protecting users' freedom to change the software. The systematic
|
||||
pattern of such abuse occurs in the area of products for individuals to
|
||||
use, which is precisely where it is most unacceptable. Therefore, we
|
||||
have designed this version of the GPL to prohibit the practice for those
|
||||
products. If such problems arise substantially in other domains, we
|
||||
stand ready to extend this provision to those domains in future versions
|
||||
of the GPL, as needed to protect the freedom of users.
|
||||
|
||||
Finally, every program is threatened constantly by software patents.
|
||||
States should not allow patents to restrict development and use of
|
||||
software on general-purpose computers, but in those that do, we wish to
|
||||
avoid the special danger that patents applied to a free program could
|
||||
make it effectively proprietary. To prevent this, the GPL assures that
|
||||
patents cannot be used to render the program non-free.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Use with the GNU Affero General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU Affero General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the special requirements of the GNU Affero General Public License,
|
||||
section 13, concerning interaction through a network will apply to the
|
||||
combination as such.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program does terminal interaction, make it output a short
|
||||
notice like this when it starts in an interactive mode:
|
||||
|
||||
<program> Copyright (C) <year> <name of author>
|
||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, your program's commands
|
||||
might be different; for a GUI interface, you would use an "about box".
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU GPL, see
|
||||
<http://www.gnu.org/licenses/>.
|
||||
|
||||
The GNU General Public License does not permit incorporating your program
|
||||
into proprietary programs. If your program is a subroutine library, you
|
||||
may consider it more useful to permit linking proprietary applications with
|
||||
the library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License. But first, please read
|
||||
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
||||
@@ -0,0 +1,11 @@
|
||||
Newer versions of patchelf (noticed with 0.15) require a C++17 compiler. We
|
||||
need to stick with the older version until BRL-CAD's minimum C++ support
|
||||
requirement (currently at C++14) is bumped up to C++17.
|
||||
|
||||
Although it is enormously heavier, in the connotation of elf binary editing it
|
||||
is worth making a note about the LIEF project: https://lief-project.github.io/
|
||||
It's a very large C++ build (as opposed to a single, easily built file with
|
||||
patchelf) so it's not a great candidate for bundling. That said, it comes up
|
||||
when possible alternatives to patchelf are discussed and would be a possible
|
||||
alternative to explore should that ever become necessary.
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user