Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0bf111e741 | ||
|
|
42d8d7ca57 | ||
|
|
5ccf9b577d | ||
|
|
cfe7b808cf | ||
|
|
f8245e0bb3 | ||
|
|
0682795bcf | ||
|
|
6d97793557 | ||
|
|
bbf604b69f | ||
|
|
31a13bc8d3 | ||
|
|
76e1dbdb3a | ||
|
|
12115e6c59 | ||
|
|
1c7c8af7d0 | ||
|
|
fe3b288e65 | ||
|
|
84a51b3601 | ||
|
|
05611e687e | ||
|
|
78421c1ecc | ||
|
|
da3a1e98fd | ||
|
|
028c2e3c0a | ||
|
|
fa74b75c10 | ||
|
|
51ab96ae0d | ||
|
|
82945d86be | ||
|
|
d71febe142 | ||
|
|
fe4d95add4 | ||
|
|
102f97cb07 | ||
|
|
10e3a01fce | ||
|
|
b37d4565d1 | ||
|
|
921f0045a2 | ||
|
|
c5d91b13a1 | ||
|
|
d73b1762a9 | ||
|
|
f6d3f346d8 | ||
|
|
9788dcf2a6 | ||
|
|
116746de32 | ||
|
|
990f4c3639 | ||
|
|
f26c88f95b | ||
|
|
8307051b6a | ||
|
|
6aa9c192ed | ||
|
|
0995755d56 | ||
|
|
333b86b81c | ||
|
|
4adc14081a | ||
|
|
7c25d80e2b | ||
|
|
159e6213df | ||
|
|
fd118bd1cf | ||
|
|
8ac868da8b | ||
|
|
3b88d2086f | ||
|
|
9b7024becb | ||
|
|
b0f9221dca | ||
|
|
d854219aa9 | ||
|
|
056188d31e | ||
|
|
b466277ae9 | ||
|
|
8c63fe7dcd | ||
|
|
4d8cc8d980 | ||
|
|
9a909d5e9d | ||
|
|
6bc1e3c838 | ||
|
|
a0d2801f64 | ||
|
|
ac076a890d | ||
|
|
f89ea26a1b | ||
|
|
be80be1a24 | ||
|
|
0c0db6e986 | ||
|
|
4fca55f381 | ||
|
|
c8f3497730 | ||
|
|
7686500d1a | ||
|
|
b9cebb4453 | ||
|
|
679eb6fcd9 | ||
|
|
21ae7bea54 | ||
|
|
0f6d38ec1a | ||
|
|
97d28467b8 | ||
|
|
baddbbded1 | ||
|
|
2db0665299 | ||
|
|
82880179d2 |
@@ -0,0 +1 @@
|
||||
*.patch -whitespace
|
||||
@@ -0,0 +1,214 @@
|
||||
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-15
|
||||
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-15-${{ 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-15-${{ runner.arch }}-release-${{ github.sha }}
|
||||
path: ${{ runner.temp }}/bext-macos-15-${{ 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-15)-(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"
|
||||
+12
-110
@@ -71,49 +71,6 @@ 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
|
||||
@@ -174,10 +131,15 @@ 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
|
||||
@@ -188,7 +150,6 @@ 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:
|
||||
@@ -207,10 +168,15 @@ 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
|
||||
@@ -221,45 +187,9 @@ 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
|
||||
@@ -297,34 +227,6 @@ 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
|
||||
|
||||
+8
-29
@@ -11,7 +11,6 @@
|
||||
[submodule "lief/LIEF"]
|
||||
path = lief/LIEF
|
||||
url = https://github.com/BRL-CAD/LIEF
|
||||
branch = RELEASE
|
||||
ignore = dirty
|
||||
shallow = true
|
||||
[submodule "lemon/lemon"]
|
||||
@@ -22,7 +21,6 @@
|
||||
[submodule "re2c/re2c"]
|
||||
path = re2c/re2c
|
||||
url = https://github.com/BRL-CAD/re2c
|
||||
branch = RELEASE
|
||||
ignore = dirty
|
||||
shallow = true
|
||||
[submodule "perplex/perplex"]
|
||||
@@ -40,11 +38,6 @@
|
||||
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
|
||||
@@ -53,7 +46,6 @@
|
||||
[submodule "png/libpng"]
|
||||
path = png/libpng
|
||||
url = https://github.com/BRL-CAD/libpng
|
||||
branch = RELEASE
|
||||
ignore = dirty
|
||||
shallow = true
|
||||
[submodule "netpbm/netpbm"]
|
||||
@@ -70,13 +62,11 @@
|
||||
[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"]
|
||||
@@ -93,13 +83,11 @@
|
||||
[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"]
|
||||
@@ -111,13 +99,17 @@
|
||||
[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
|
||||
branch = RELEASE
|
||||
ignore = dirty
|
||||
shallow = true
|
||||
[submodule "openvdb/openvdb"]
|
||||
path = openvdb/openvdb
|
||||
url = https://github.com/BRL-CAD/openvdb
|
||||
branch = master
|
||||
ignore = dirty
|
||||
shallow = true
|
||||
[submodule "osmesa/osmesa"]
|
||||
@@ -131,16 +123,10 @@
|
||||
branch = RELEASE
|
||||
ignore = dirty
|
||||
shallow = true
|
||||
[submodule "itcl3/itcl"]
|
||||
path = itcl/itcl
|
||||
url = https://github.com/BRL-CAD/itcl
|
||||
branch = RELEASE
|
||||
ignore = dirty
|
||||
shallow = true
|
||||
[submodule "itk3/itk"]
|
||||
[submodule "itk/itk"]
|
||||
path = itk/itk
|
||||
url = https://github.com/BRL-CAD/itk
|
||||
branch = RELEASE
|
||||
branch = main
|
||||
ignore = dirty
|
||||
shallow = true
|
||||
[submodule "iwidgets/iwidgets"]
|
||||
@@ -243,19 +229,16 @@
|
||||
[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"]
|
||||
@@ -338,7 +321,6 @@
|
||||
[submodule "manifold/manifold"]
|
||||
path = manifold/manifold
|
||||
url = https://github.com/BRL-CAD/manifold.git
|
||||
branch = RELEASE
|
||||
ignore = dirty
|
||||
shallow = true
|
||||
[submodule "appleseed/appleseed"]
|
||||
@@ -359,19 +341,16 @@
|
||||
[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"]
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
set(bext_root "${CMAKE_CURRENT_LIST_DIR}/..")
|
||||
get_filename_component(bext_root "${bext_root}" ABSOLUTE)
|
||||
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/BextGit.cmake")
|
||||
|
||||
if (NOT DEFINED PROFILE)
|
||||
message(FATAL_ERROR "Set PROFILE to one of: auto, bundled, minimal, everything")
|
||||
endif (NOT DEFINED PROFILE)
|
||||
@@ -73,16 +75,6 @@ if (LIST_ONLY)
|
||||
return()
|
||||
endif (LIST_ONLY)
|
||||
|
||||
set(git_args submodule update --init --recursive --jobs 8)
|
||||
if (GIT_SHALLOW_CLONE)
|
||||
list(APPEND git_args --recommend-shallow)
|
||||
endif (GIT_SHALLOW_CLONE)
|
||||
list(APPEND git_args -- ${project_paths})
|
||||
|
||||
execute_process(
|
||||
COMMAND ${GIT_EXECUTABLE} ${git_args}
|
||||
WORKING_DIRECTORY ${bext_root}
|
||||
COMMAND_ERROR_IS_FATAL ANY
|
||||
)
|
||||
bext_git_submodule_update("${bext_root}" --jobs 8 -- ${project_paths})
|
||||
|
||||
message(STATUS "Bootstrap complete for profile ${profile}")
|
||||
|
||||
@@ -0,0 +1,104 @@
|
||||
# Shared repository selection for configure-time and bootstrap submodule updates.
|
||||
# Keep .gitmodules canonical and scope all overrides to the Git process tree.
|
||||
include_guard(GLOBAL)
|
||||
|
||||
set(_BEXT_GIT_CANONICAL_ROOT "https://github.com/BRL-CAD")
|
||||
set(BEXT_REPOSITORY_ROOT "${_BEXT_GIT_CANONICAL_ROOT}" CACHE STRING
|
||||
"Repository URL or local mirror directory containing bext's dependency repositories")
|
||||
|
||||
function(bext_git_repository_root out_root out_local)
|
||||
set(root "${BEXT_REPOSITORY_ROOT}")
|
||||
set(local FALSE)
|
||||
if (root STREQUAL "")
|
||||
message(FATAL_ERROR "BEXT_REPOSITORY_ROOT must be a repository URL or local mirror directory")
|
||||
endif ()
|
||||
|
||||
# Check drive paths before URL schemes or scp-style SSH locations.
|
||||
if (root MATCHES "^file://")
|
||||
set(local TRUE)
|
||||
string(REPLACE "=" "%3D" root "${root}")
|
||||
elseif (root MATCHES "^[A-Za-z]:[/\\\\]" OR
|
||||
NOT (root MATCHES "^[A-Za-z][A-Za-z0-9+.-]*://" OR root MATCHES "^[^/]+:.+"))
|
||||
set(local TRUE)
|
||||
string(REPLACE "\\" "/" root "${root}")
|
||||
if (WIN32 OR NOT root MATCHES "^[A-Za-z]:/")
|
||||
get_filename_component(root "${root}" ABSOLUTE
|
||||
BASE_DIR "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/..")
|
||||
endif ()
|
||||
# Encode path characters with special meaning in a file URL. In
|
||||
# particular, a literal % in a native path must not become a URL escape.
|
||||
string(REPLACE "%" "%25" root "${root}")
|
||||
string(REPLACE " " "%20" root "${root}")
|
||||
string(REPLACE "#" "%23" root "${root}")
|
||||
string(REPLACE "?" "%3F" root "${root}")
|
||||
string(REPLACE "=" "%3D" root "${root}")
|
||||
if (root MATCHES "^[A-Za-z]:/")
|
||||
set(root "file:///${root}")
|
||||
elseif (root MATCHES "^//")
|
||||
set(root "file:${root}")
|
||||
else ()
|
||||
set(root "file://${root}")
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
if (NOT root MATCHES "^file:///*$")
|
||||
string(REGEX REPLACE "/+$" "" root "${root}")
|
||||
string(APPEND root "/")
|
||||
else ()
|
||||
set(root "file:///")
|
||||
endif ()
|
||||
set(${out_root} "${root}" PARENT_SCOPE)
|
||||
set(${out_local} "${local}" PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
function(bext_git_submodule_update working_directory)
|
||||
find_program(GIT_EXECUTABLE git)
|
||||
if (NOT GIT_EXECUTABLE)
|
||||
message(FATAL_ERROR "Need to populate Git submodules, but unable to find git executable")
|
||||
endif ()
|
||||
|
||||
bext_git_repository_root(root local)
|
||||
set(git_command "${GIT_EXECUTABLE}")
|
||||
if (WIN32)
|
||||
list(APPEND git_command -c core.longpaths=true)
|
||||
endif ()
|
||||
if (NOT root STREQUAL "${_BEXT_GIT_CANONICAL_ROOT}/")
|
||||
list(APPEND git_command -c "url.${root}.insteadOf=${_BEXT_GIT_CANONICAL_ROOT}/")
|
||||
endif ()
|
||||
|
||||
set(shallow_args)
|
||||
if (local)
|
||||
list(APPEND git_command -c protocol.file.allow=always)
|
||||
# The environment restriction also reaches recursive Git processes and
|
||||
# overrides any protocol permissions in the user's Git configuration.
|
||||
list(PREPEND git_command "${CMAKE_COMMAND}" -E env GIT_ALLOW_PROTOCOL=file --)
|
||||
list(APPEND shallow_args --no-recommend-shallow)
|
||||
elseif (GIT_SHALLOW_CLONE)
|
||||
list(APPEND shallow_args --recommend-shallow)
|
||||
endif ()
|
||||
|
||||
execute_process(
|
||||
COMMAND ${git_command} submodule update --init --recursive ${shallow_args} ${ARGN}
|
||||
WORKING_DIRECTORY "${working_directory}"
|
||||
RESULT_VARIABLE git_result
|
||||
)
|
||||
if (NOT git_result STREQUAL "0")
|
||||
set(local_note "")
|
||||
if (local)
|
||||
set(local_note " Only file transport is permitted; all required repositories and pinned commits must be available locally, including recursive submodules.")
|
||||
endif ()
|
||||
message(WARNING
|
||||
"Git submodule update failed in ${working_directory} using BEXT_REPOSITORY_ROOT=${BEXT_REPOSITORY_ROOT} (${git_result}).${local_note}")
|
||||
endif ()
|
||||
endfunction()
|
||||
|
||||
bext_git_repository_root(_bext_git_root _bext_git_local)
|
||||
message(STATUS "bext repository root: ${_bext_git_root}")
|
||||
if (_bext_git_local)
|
||||
message(STATUS "bext Git updates: file transport only, shallow recommendations disabled")
|
||||
if (GIT_SHALLOW_CLONE)
|
||||
message(STATUS "Ignoring GIT_SHALLOW_CLONE for the local repository mirror")
|
||||
endif ()
|
||||
endif ()
|
||||
unset(_bext_git_root)
|
||||
unset(_bext_git_local)
|
||||
+47
-18
@@ -47,6 +47,21 @@ 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}")
|
||||
@@ -355,15 +370,6 @@ 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}"
|
||||
@@ -392,13 +398,6 @@ 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}")
|
||||
|
||||
@@ -408,6 +407,8 @@ 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)
|
||||
@@ -416,7 +417,35 @@ 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(RENAME "${BEXT_MANIFEST}.tmp" "${BEXT_MANIFEST}")
|
||||
file(COPY_FILE "${BEXT_MANIFEST}.tmp" "${BEXT_MANIFEST}" ONLY_IF_DIFFERENT)
|
||||
file(REMOVE "${BEXT_MANIFEST}.tmp")
|
||||
|
||||
file(TOUCH "${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")
|
||||
message(STATUS "Generated bext install manifest: ${BEXT_MANIFEST}")
|
||||
|
||||
@@ -1,117 +0,0 @@
|
||||
# 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
|
||||
+175
-5
@@ -4,22 +4,69 @@ 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)
|
||||
list(APPEND patch_args "${arg}")
|
||||
# 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()
|
||||
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)
|
||||
@@ -34,6 +81,125 @@ 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
|
||||
@@ -44,27 +210,29 @@ 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_dry_run_args)
|
||||
set(reverse_check_args)
|
||||
foreach(arg IN LISTS patch_args)
|
||||
if (arg STREQUAL "-N" OR arg STREQUAL "--forward")
|
||||
continue()
|
||||
endif()
|
||||
list(APPEND reverse_dry_run_args "${arg}")
|
||||
list(APPEND reverse_check_args "${arg}")
|
||||
endforeach()
|
||||
list(PREPEND reverse_dry_run_args "--dry-run" "-R")
|
||||
list(PREPEND reverse_check_args "${BEXT_PATCH_CHECK_OPTION}" "-R")
|
||||
|
||||
execute_process(
|
||||
COMMAND "${BEXT_PATCH_NATIVE_EXECUTABLE}" ${reverse_dry_run_args}
|
||||
COMMAND "${BEXT_PATCH_NATIVE_EXECUTABLE}" ${reverse_check_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."
|
||||
@@ -73,4 +241,6 @@ 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}")
|
||||
|
||||
+8
-18
@@ -34,6 +34,7 @@
|
||||
#
|
||||
###
|
||||
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/BextGit.cmake")
|
||||
|
||||
###############################################################################
|
||||
# It is common for more complex targets to need to key build settings off of
|
||||
@@ -102,22 +103,11 @@ endmacro(TargetInstallDeps root)
|
||||
function(git_submodule_init path checkfile)
|
||||
string(REGEX REPLACE "[^A-Za-z0-9_+.-]" "_" stamp_name "${path}")
|
||||
set(sha1_stamp "${CMAKE_CURRENT_BINARY_DIR}/build_sha1_${stamp_name}.txt")
|
||||
if (NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${path}/${checkfile})
|
||||
find_program(GIT_EXECUTABLE git)
|
||||
if (NOT GIT_EXECUTABLE)
|
||||
message(FATAL_ERROR "Need to populate Git submodule, but unable to find git executable")
|
||||
endif (NOT GIT_EXECUTABLE)
|
||||
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)
|
||||
if (NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${path}/${checkfile}")
|
||||
bext_git_submodule_update("${CMAKE_CURRENT_SOURCE_DIR}" -- "${path}")
|
||||
if (NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${path}/${checkfile}")
|
||||
message(FATAL_ERROR "Git submodule ${path} is missing ${checkfile} after checkout")
|
||||
endif ()
|
||||
execute_process(
|
||||
COMMAND git log -1 --format=%H
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/${path}
|
||||
@@ -125,7 +115,7 @@ function(git_submodule_init path checkfile)
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
file(WRITE "${sha1_stamp}" ${GIT_SHA1})
|
||||
else (NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${path}/${checkfile})
|
||||
else ()
|
||||
execute_process(
|
||||
COMMAND git log -1 --format=%H
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/${path}
|
||||
@@ -144,7 +134,7 @@ function(git_submodule_init path checkfile)
|
||||
endif (NOT "${BUILD_SHA1}" MATCHES "${GIT_SHA1}")
|
||||
endif()
|
||||
file(WRITE "${sha1_stamp}" ${GIT_SHA1})
|
||||
endif (NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${path}/${checkfile})
|
||||
endif ()
|
||||
endfunction(git_submodule_init path)
|
||||
|
||||
###############################################################################
|
||||
|
||||
+45
-25
@@ -200,8 +200,8 @@ include(ExternalProject)
|
||||
# source patching or staging is needed.
|
||||
# * Use a local URL when patching a submodule, so ExternalProject stages a
|
||||
# build-tree copy before PATCH_COMMAND and other source modifications run.
|
||||
# * A deliberate exception is a very large source tree such as Qt6, where the
|
||||
# copy cost is significant and in-place patching/building is preferred.
|
||||
# * A large source tree such as Qt6 is built in place when unmodified, but is
|
||||
# staged when caller-supplied patches must be applied.
|
||||
# Do not replace URL with SOURCE_DIR merely to avoid the local URL spelling;
|
||||
# that can cause patches or generated-file changes to modify the checkout.
|
||||
|
||||
@@ -277,11 +277,21 @@ if (NOT isMultiConfig)
|
||||
set(BUILD_TYPE_SPECIFIER "-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}")
|
||||
endif (NOT isMultiConfig)
|
||||
|
||||
# With MSVC, some of the non-CMake subbuilds are going to need the vcvars bat
|
||||
# file to set up the environment.
|
||||
# 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.
|
||||
if(MSVC)
|
||||
|
||||
get_filename_component(COMPILER_DIR "${CMAKE_C_COMPILER}" DIRECTORY)
|
||||
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_ROOT "${COMPILER_DIR}" NAME)
|
||||
set(VCVARS_BAT "${COMPILER_DIR}/vcvars${COMPILER_ROOT}.bat")
|
||||
if(NOT EXISTS "${VCVARS_BAT}")
|
||||
@@ -291,11 +301,11 @@ if(MSVC)
|
||||
get_filename_component(COMPILER_DIR "${COMPILER_DIR}" DIRECTORY)
|
||||
endforeach(DIRS RANGE 0 5)
|
||||
set(COMPILER_DIR "${COMPILER_DIR}/Auxiliary/Build")
|
||||
if(CMAKE_CL_64)
|
||||
if(BEXT_MSVC_TARGET_ARCH STREQUAL "x64")
|
||||
set(VCVARS_BAT "${COMPILER_DIR}/vcvars64.bat")
|
||||
else(CMAKE_CL_64)
|
||||
else(BEXT_MSVC_TARGET_ARCH STREQUAL "x64")
|
||||
set(VCVARS_BAT "${COMPILER_DIR}/vcvars32.bat")
|
||||
endif(CMAKE_CL_64)
|
||||
endif(BEXT_MSVC_TARGET_ARCH STREQUAL "x64")
|
||||
if(NOT EXISTS "${VCVARS_BAT}")
|
||||
message(FATAL_ERROR "Could not find vcvars bat file in ${COMPILER_DIR}")
|
||||
endif(NOT EXISTS "${VCVARS_BAT}")
|
||||
@@ -303,14 +313,6 @@ 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
|
||||
@@ -351,6 +353,21 @@ 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
|
||||
@@ -443,7 +460,6 @@ add_project(lemon GROUPS "BRLCAD")
|
||||
add_project(re2c GROUPS "BRLCAD")
|
||||
add_project(perplex GROUPS "BRLCAD")
|
||||
add_project(strclear GROUPS "BRLCAD")
|
||||
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
|
||||
@@ -451,11 +467,6 @@ add_project(xmltools GROUPS "BRLCAD_EXTRA") # Used for Docbook building
|
||||
add_project(lief GROUPS "BRLCAD")
|
||||
add_project(plief GROUPS "BRLCAD")
|
||||
|
||||
# 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
|
||||
# libraries will depend on others listed here (for example, we want openNURBS
|
||||
@@ -600,7 +611,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
|
||||
@@ -666,9 +677,19 @@ 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")
|
||||
@@ -742,7 +763,6 @@ endif ()
|
||||
if (TARGET PLIEF_BLD-install)
|
||||
add_dependencies(bext_finalize PLIEF_BLD-install)
|
||||
endif ()
|
||||
add_dependencies(BuildStamp bext_finalize)
|
||||
|
||||
|
||||
###############################################################################
|
||||
|
||||
+5
-6
@@ -37,9 +37,8 @@ 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) |
|
||||
| `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) |
|
||||
| `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) |
|
||||
| `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) |
|
||||
@@ -58,13 +57,14 @@ 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` | `install` | `patch`, `zlib` | [repository](https://github.com/BRL-CAD/libpng) |
|
||||
| `png` | `USE_APPLESEED`, `USE_BRLCAD`, `USE_TCL` | `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,9 +83,8 @@ 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` | `install` | `patch` | [repository](https://github.com/BRL-CAD/zlib) |
|
||||
| `zlib` | `USE_APPLESEED`, `USE_BRLCAD`, `USE_OSPRAY`, `USE_TCL` | `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 -->
|
||||
|
||||
|
||||
+56
@@ -50,6 +50,58 @@ Shallow clone options:
|
||||
Shallow clones are fine for compile-only use, but they are not recommended for
|
||||
development or for submodule update work.
|
||||
|
||||
# Alternate repositories and offline mirrors
|
||||
|
||||
`BEXT_REPOSITORY_ROOT` selects the directory containing the dependency
|
||||
repositories. It defaults to `https://github.com/BRL-CAD`. For another host,
|
||||
specify the URL of the equivalent repository directory:
|
||||
|
||||
```sh
|
||||
cmake --preset auto -DBEXT_REPOSITORY_ROOT=https://git.example.org/brlcad
|
||||
```
|
||||
|
||||
For offline use, the directory can contain bare Git mirrors such as
|
||||
`bext.git`, `astyle.git`, and `libpng.git`, as produced by BRL-CAD's
|
||||
`sh/mirror_repos.sh`. Clone bext first, then let CMake populate the required
|
||||
submodules:
|
||||
|
||||
```sh
|
||||
git clone /path/to/mirror/BRL-CAD/bext.git
|
||||
cd bext
|
||||
cmake --preset auto -DBEXT_REPOSITORY_ROOT=/path/to/mirror/BRL-CAD
|
||||
```
|
||||
|
||||
The root points directly to the repositories; CMake does not append `BRL-CAD`.
|
||||
Local paths and `file://` URLs are supported, as are remote Git URLs including
|
||||
`ssh://` URLs. Relative local paths are resolved against the bext source
|
||||
directory. Quote the `-D` argument if the path contains spaces. The setting
|
||||
is saved in the configure cache.
|
||||
|
||||
The optional bootstrap script accepts the same setting:
|
||||
|
||||
```sh
|
||||
cmake -DPROFILE=auto -DBEXT_REPOSITORY_ROOT=/path/to/mirror/BRL-CAD \
|
||||
-P CMake/BextBootstrap.cmake
|
||||
```
|
||||
|
||||
Bootstrap runs separately from configure, so pass the setting to both commands
|
||||
if you use both workflows. `LIST_ONLY=ON` previews bootstrap selection without
|
||||
fetching.
|
||||
|
||||
CMake redirects `https://github.com/BRL-CAD/` URLs using command-scoped Git
|
||||
configuration, including recursive submodule operations. Local roots enable
|
||||
file transport and forbid network transport for those Git operations. They
|
||||
also disable shallow-clone recommendations, even with `GIT_SHALLOW_CLONE=ON`,
|
||||
so full mirrors can supply older pinned commits. The mirrors must contain all
|
||||
required commits. Recursive submodules outside that URL prefix need their
|
||||
own Git URL mappings and local mirrors; otherwise initialization fails.
|
||||
|
||||
The override does not change `.gitmodules` or install persistent Git rewrite
|
||||
settings. To return CMake-driven updates to GitHub, set
|
||||
`-DBEXT_REPOSITORY_ROOT=https://github.com/BRL-CAD`. Direct Git commands use
|
||||
their normal configuration. This setting controls submodule fetching, not
|
||||
network access by dependency build scripts.
|
||||
|
||||
# Path and directory caveats
|
||||
|
||||
* Avoid symlinked source or build directory paths. `bext` warns about these
|
||||
@@ -106,6 +158,10 @@ 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.
|
||||
|
||||
@@ -34,6 +34,10 @@ cmake --preset auto
|
||||
Use `LIST_ONLY=ON` to preview the selected submodules without fetching them,
|
||||
and `GIT_SHALLOW_CLONE=ON` to specify shallow clones during bootstrap.
|
||||
|
||||
Both configure and bootstrap accept `BEXT_REPOSITORY_ROOT` to fetch from an
|
||||
alternate host or a local Git mirror. See [alternate repositories and offline
|
||||
mirrors](INSTALL.md#alternate-repositories-and-offline-mirrors) for examples.
|
||||
|
||||
# How manual selection works
|
||||
|
||||
Build selection happens in three layers:
|
||||
@@ -176,3 +180,4 @@ cmake ../brlcad \
|
||||
* [DEPENDENCIES.md](DEPENDENCIES.md) - package-to-group reference, output
|
||||
classification, and dependency addition workflow
|
||||
* [NOTES.md](NOTES.md) - maintainer notes and submodule procedures
|
||||
* [XMIN.md](XMIN.md) - testing-only headless X11 support using Xmin
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
# Xmin-backed bundled toolkits
|
||||
|
||||
Xmin is a small, self-contained X11 server and client library - see
|
||||
https://github.com/starseeker/Xmin
|
||||
|
||||
An installed Xmin SDK can provide the X11 and OpenGL surface for bext's
|
||||
bundled Tk and Qt, allowing fully interactive automated GUI application testing
|
||||
in an environment that has neither X nor OpenGL.
|
||||
|
||||
Set `BEXT_XMIN_ROOT` to select the standard Xmin profile:
|
||||
|
||||
```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
|
||||
```
|
||||
|
||||
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.
|
||||
|
||||
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.
|
||||
@@ -33,6 +33,9 @@ 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: 35f559a2f6...848edc8206
+128
-31
@@ -1,22 +1,74 @@
|
||||
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 @@
|
||||
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:
|
||||
-
|
||||
-# 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)
|
||||
@@ -56,21 +108,66 @@ diff -Naur astyle/build/cmake/InstallOptions.cmake ASTYLE_BLD/build/cmake/Instal
|
||||
- endif()
|
||||
- endif()
|
||||
-endif()
|
||||
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 @@
|
||||
-
|
||||
-
|
||||
-# 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)
|
||||
|
||||
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 )
|
||||
-# 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 "-------------------------------------------" )
|
||||
|
||||
+1
-1
Submodule clipper2/Clipper2 updated: 6901921c4b...ef88ee97c0
+27
-2
@@ -24,10 +24,36 @@ 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 ${PATCH_EXECUTABLE};-E;-p1;${PATCH_OPTIONS};-i;${CMAKE_CURRENT_SOURCE_DIR}/eigen.patch
|
||||
PATCH_COMMAND ${EIGEN_PATCH_COMMAND}
|
||||
CMAKE_ARGS
|
||||
-DBUILD_TESTING=OFF
|
||||
-DEIGEN_BUILD_DOC=OFF
|
||||
@@ -61,4 +87,3 @@ endif (ENABLE_EIGEN)
|
||||
# indent-tabs-mode: t
|
||||
# End:
|
||||
# ex: shiftwidth=2 tabstop=8
|
||||
|
||||
|
||||
+1
-1
Submodule eigen/eigen updated: 3147391d94...bc3b39870e
@@ -1,25 +0,0 @@
|
||||
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
|
||||
@@ -0,0 +1,11 @@
|
||||
--- 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})
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
--- 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
|
||||
@@ -0,0 +1,15 @@
|
||||
--- 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
|
||||
@@ -3,7 +3,7 @@ bext_enable(EXPAT)
|
||||
|
||||
if (ENABLE_EXPAT)
|
||||
|
||||
git_submodule_init(libexpat CMakeLists.txt)
|
||||
git_submodule_init(libexpat expat/CMakeLists.txt)
|
||||
|
||||
RegisterDeps(EXPAT)
|
||||
|
||||
|
||||
+1
-1
Submodule gdal/gdal updated: ecf8a961b2...c8b4c45fca
+8
-53
@@ -1,47 +1,5 @@
|
||||
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
|
||||
--- a/cmake/modules/packages/FindSQLite3.cmake
|
||||
+++ b/cmake/modules/packages/FindSQLite3.cmake
|
||||
@@ -57,7 +57,7 @@
|
||||
NAMES sqlite3.h
|
||||
HINTS ${PC_SQLITE3_INCLUDE_DIRS})
|
||||
@@ -51,9 +9,8 @@ diff -Naur gdal/cmake/modules/packages/FindSQLite3.cmake GDAL_BLD/cmake/modules/
|
||||
NAMES_PER_DIR
|
||||
HINTS ${PC_SQLITE3_LIBRARY_DIRS})
|
||||
endif()
|
||||
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
|
||||
--- a/gcore/gdal_multidomainmetadata.h
|
||||
+++ b/gcore/gdal_multidomainmetadata.h
|
||||
@@ -18,6 +18,15 @@
|
||||
#include "cpl_port.h"
|
||||
#include "cpl_string.h"
|
||||
@@ -70,9 +27,8 @@ diff -Naur gdal/gcore/gdal_multidomainmetadata.h GDAL_BLD/gcore/gdal_multidomain
|
||||
#include <map>
|
||||
|
||||
/*! @cond Doxygen_Suppress */
|
||||
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
|
||||
--- a/gdal.cmake
|
||||
+++ b/gdal.cmake
|
||||
@@ -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")
|
||||
@@ -86,9 +42,8 @@ diff -Naur gdal/gdal.cmake GDAL_BLD/gdal.cmake
|
||||
if (MINGW AND BUILD_SHARED_LIBS)
|
||||
set_target_properties(${GDAL_LIB_TARGET_NAME} PROPERTIES SUFFIX "-${GDAL_SOVERSION}${CMAKE_SHARED_LIBRARY_SUFFIX}")
|
||||
endif ()
|
||||
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
|
||||
--- a/port/cpl_port.h
|
||||
+++ b/port/cpl_port.h
|
||||
@@ -1019,7 +1019,7 @@
|
||||
#define TRUE 1
|
||||
#endif
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
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
|
||||
--- a/frmts/png/pngdataset.cpp
|
||||
+++ b/frmts/png/pngdataset.cpp
|
||||
@@ -42,7 +42,9 @@
|
||||
#pragma clang diagnostic pop
|
||||
#endif
|
||||
@@ -12,9 +11,8 @@ diff -Naur gdal/frmts/png/pngdataset.cpp GDAL_BLD/frmts/png/pngdataset.cpp
|
||||
|
||||
#include <algorithm>
|
||||
#include <limits>
|
||||
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
|
||||
--- a/frmts/png/pngdataset.h
|
||||
+++ b/frmts/png/pngdataset.h
|
||||
@@ -40,7 +40,9 @@
|
||||
|
||||
#include "png.h"
|
||||
|
||||
+1
-1
Submodule gte/GeometricTools updated: 7adae93f85...e095b84018
+1
-1
@@ -6,7 +6,7 @@ diff -Naur GeometricTools/CMakeLists.txt GTE_BLD/CMakeLists.txt
|
||||
+
|
||||
+project(GTE)
|
||||
+
|
||||
+file(GLOB GTE_MFILES "${CMAKE_SOURCE_DIR}/GTE/Mathematics/*")
|
||||
+file(GLOB GTE_MFILES LIST_DIRECTORIES false "${CMAKE_SOURCE_DIR}/GTE/Mathematics/*")
|
||||
+
|
||||
+if(NOT DEFINED INCLUDE_DIR)
|
||||
+ set(INCLUDE_DIR include)
|
||||
|
||||
@@ -1,146 +0,0 @@
|
||||
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
|
||||
|
||||
@@ -1,223 +0,0 @@
|
||||
# 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
|
||||
|
||||
@@ -1,554 +0,0 @@
|
||||
# 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
@@ -1,600 +0,0 @@
|
||||
/*
|
||||
* 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 */
|
||||
@@ -1,46 +0,0 @@
|
||||
/*
|
||||
* 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 */
|
||||
@@ -1,732 +0,0 @@
|
||||
/*
|
||||
* 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:
|
||||
*/
|
||||
@@ -1,582 +0,0 @@
|
||||
/*
|
||||
* 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 */
|
||||
-1
Submodule itcl/itcl deleted from 33cea588fa
@@ -1,3 +0,0 @@
|
||||
PATCH
|
||||
TCL
|
||||
|
||||
-145
@@ -1,145 +0,0 @@
|
||||
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
|
||||
+
|
||||
+
|
||||
+
|
||||
+
|
||||
+84
-79
@@ -1,114 +1,119 @@
|
||||
# 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...
|
||||
# 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.
|
||||
|
||||
if (USE_BRLCAD)
|
||||
|
||||
# Decide if we're using Itk
|
||||
cad_enable(ITK "archer;mged;bwish;rtwizard;brlman")
|
||||
cad_enable(ITK "${BEXT_TK_COMPONENTS}")
|
||||
|
||||
else (USE_BRLCAD)
|
||||
|
||||
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)
|
||||
bext_enable_all_default(ITK itk)
|
||||
|
||||
endif (USE_BRLCAD)
|
||||
|
||||
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)
|
||||
if (TARGET TK_BLD AND NOT DEFINED ENABLE_ITK AND NOT DISABLE_ITK)
|
||||
set(ENABLE_ITK ON)
|
||||
endif ()
|
||||
set(ENABLE_ITK "${ENABLE_ITK}" CACHE BOOL "Enable itk build")
|
||||
|
||||
if (ENABLE_ITK)
|
||||
|
||||
git_submodule_init(itk configure.in)
|
||||
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)
|
||||
|
||||
RegisterDeps(ITK)
|
||||
|
||||
# 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(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")
|
||||
|
||||
set(ITK_SRC_CPY_TGT "${CMAKE_CURRENT_BINARY_DIR}/ITK_BLD-prefix/src/ITK_BLD")
|
||||
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}")
|
||||
|
||||
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
|
||||
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"
|
||||
)
|
||||
|
||||
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}/itk3.txt
|
||||
${DOC_LICENSE_DIR}/itk.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
|
||||
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
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.
|
||||
@@ -1,280 +0,0 @@
|
||||
# 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
|
||||
|
||||
@@ -1,116 +0,0 @@
|
||||
# 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:
|
||||
@@ -1,554 +0,0 @@
|
||||
# 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
|
||||
@@ -1,217 +0,0 @@
|
||||
/*
|
||||
* ------------------------------------------------------------------------
|
||||
* 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 */
|
||||
@@ -1,332 +0,0 @@
|
||||
/*
|
||||
* 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 */
|
||||
|
||||
@@ -1,468 +0,0 @@
|
||||
/*
|
||||
* ------------------------------------------------------------------------
|
||||
* 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: 0d1dc9780c...e697407849
@@ -1,5 +1,4 @@
|
||||
PATCH
|
||||
TCL
|
||||
TK
|
||||
ITCL
|
||||
|
||||
|
||||
+99
-209
@@ -1,216 +1,106 @@
|
||||
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) {
|
||||
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) {
|
||||
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 @@
|
||||
|
||||
int optc, result;
|
||||
char **optv;
|
||||
+ const char **splitOptv = NULL;
|
||||
char *name, *info;
|
||||
Tcl_Obj *resultPtr;
|
||||
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 @@
|
||||
#
|
||||
|
||||
@@ -4126,7 +4131,8 @@
|
||||
Tcl_IncrRefCount(resultPtr);
|
||||
info = Tcl_GetStringFromObj(resultPtr, (int*)NULL);
|
||||
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
|
||||
|
||||
- result = Tcl_SplitList(interp, info, &optc, &optv);
|
||||
+ result = Tcl_SplitList(interp, info, &optc, &splitOptv);
|
||||
+ optv = (char **)splitOptv;
|
||||
-# 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
|
||||
|
||||
Tcl_DecrRefCount(resultPtr);
|
||||
$(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
|
||||
|
||||
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"
|
||||
test: setup $(PROJECT)
|
||||
@echo testing itk
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
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
|
||||
@@ -0,0 +1,37 @@
|
||||
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
|
||||
@@ -0,0 +1,41 @@
|
||||
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
|
||||
@@ -0,0 +1,62 @@
|
||||
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
|
||||
@@ -0,0 +1,16 @@
|
||||
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
|
||||
@@ -0,0 +1 @@
|
||||
git-e697407849b01d3498b56fc46e5a423690190954
|
||||
@@ -0,0 +1,99 @@
|
||||
#------------------------------------------------------------- -*- 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
|
||||
+8
-12
@@ -5,16 +5,12 @@ if (USE_BRLCAD)
|
||||
|
||||
endif (USE_BRLCAD)
|
||||
|
||||
# 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.
|
||||
# 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.
|
||||
|
||||
if (NOT DEFINED ENABLE_IWIDGETS AND NOT DISABLE_IWIDGETS)
|
||||
set(ENABLE_IWIDGETS ON)
|
||||
@@ -27,8 +23,9 @@ if (ENABLE_IWIDGETS)
|
||||
RegisterDeps(IWIDGETS)
|
||||
|
||||
ExternalProject_Add(IWIDGETS_BLD
|
||||
SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/iwidgets"
|
||||
URL "${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}
|
||||
@@ -58,4 +55,3 @@ endif (ENABLE_IWIDGETS)
|
||||
# indent-tabs-mode: t
|
||||
# End:
|
||||
# ex: shiftwidth=2 tabstop=8
|
||||
|
||||
|
||||
@@ -0,0 +1,77 @@
|
||||
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.
|
||||
|
||||
Panedwindow's frame hull shares its resource class name with Tk's native
|
||||
panedwindow widget, whose event bindings call a different widget API. The
|
||||
patch removes that class tag from the hull's binding list while retaining
|
||||
Iwidgets' configure and sash bindings and the Panedwindow resource class.
|
||||
Pointer motion and clicks therefore use the correct handlers without
|
||||
changing native Tk panedwindow behavior.
|
||||
|
||||
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,4 +1,3 @@
|
||||
PATCH
|
||||
ITCL
|
||||
ITK
|
||||
|
||||
|
||||
@@ -0,0 +1,351 @@
|
||||
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/panedwindow.itk b/generic/panedwindow.itk
|
||||
--- a/generic/panedwindow.itk
|
||||
+++ b/generic/panedwindow.itk
|
||||
@@ -134,8 +134,11 @@
|
||||
# Add binding for the configure event.
|
||||
#
|
||||
bind pw-config-$this <Configure> [itcl::code $this _pwConfigureEventHandler %w %h]
|
||||
+ # Tk's native Panedwindow uses the same class name but a different API.
|
||||
+ # Keep the hull's resource class and Iwidgets' own event bindings.
|
||||
bindtags $itk_component(hull) \
|
||||
- [linsert [bindtags $itk_component(hull)] 0 pw-config-$this]
|
||||
+ [linsert [lsearch -all -inline -not -exact \
|
||||
+ [bindtags $itk_component(hull)] Panedwindow] 0 pw-config-$this]
|
||||
|
||||
array set _relief {0 sunken 1 raised}
|
||||
|
||||
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,6 +24,7 @@ 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: af9c1c2685...c85e6b905b
+5
-2
@@ -16,9 +16,12 @@ 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_gnuhash_debug_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
|
||||
CMAKE_ARGS
|
||||
${BUILD_TYPE_SPECIFIER}
|
||||
-DBIN_DIR=${BIN_DIR}
|
||||
|
||||
+1
-1
Submodule lief/LIEF updated: b16f99f9d2...d05b3499b6
@@ -1,9 +1,10 @@
|
||||
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
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 334f6f83..d9b0db12 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -1,4 +1,4 @@
|
||||
-cmake_minimum_required(VERSION 3.24)
|
||||
+cmake_minimum_required(VERSION 3.22)
|
||||
project(LIEF LANGUAGES C CXX)
|
||||
|
||||
enable_language(C)
|
||||
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
|
||||
|
||||
@@ -0,0 +1,97 @@
|
||||
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;
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
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 "";
|
||||
@@ -1,16 +0,0 @@
|
||||
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;
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
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: 1e4cd2d792...6f0a32496a
+1
-1
@@ -3,7 +3,7 @@ bext_enable(LZ4)
|
||||
|
||||
if (ENABLE_LZ4)
|
||||
|
||||
git_submodule_init(lz4 CMakeLists.txt)
|
||||
git_submodule_init(lz4 build/cmake/CMakeLists.txt)
|
||||
|
||||
RegisterDeps(LZ4)
|
||||
|
||||
|
||||
@@ -16,7 +16,8 @@ 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.patch
|
||||
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
|
||||
CMAKE_ARGS
|
||||
${BUILD_TYPE_SPECIFIER}
|
||||
$<$<BOOL:${CLIPPER2_TARGET}>:-DClipper2_ROOT=${CMAKE_BUNDLE_INSTALL_PREFIX}>
|
||||
|
||||
+1
-1
Submodule manifold/manifold updated: 7e2292bb24...0edd9d5487
@@ -1,78 +0,0 @@
|
||||
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()
|
||||
+
|
||||
@@ -0,0 +1,167 @@
|
||||
--- 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
|
||||
@@ -0,0 +1,81 @@
|
||||
--- 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 mmesh/mmesh updated: 04852cddc0...ffdca572a3
+1
-1
Submodule netpbm/netpbm updated: 99ce8abc6f...3da4bff319
@@ -7,6 +7,17 @@ if (ENABLE_OIDN)
|
||||
|
||||
RegisterDeps(OIDN)
|
||||
|
||||
# OIDN is always built Release, including in a Debug bext tree. On MSVC,
|
||||
# oneTBB's headers otherwise auto-link tbb12.lib even when the imported
|
||||
# TBB::tbb target correctly resolves to the tree's tbb12_debug.lib. Rely on
|
||||
# the explicit CMake target, as OIDN's fallback FindTBB module does.
|
||||
set(OIDN_CXX_FLAGS_ARGS)
|
||||
if (MSVC)
|
||||
list(APPEND OIDN_CXX_FLAGS_ARGS
|
||||
-DCMAKE_CXX_FLAGS:STRING=/D__TBB_NO_IMPLICIT_LINKAGE=1
|
||||
)
|
||||
endif (MSVC)
|
||||
|
||||
ExternalProject_Add(OIDN_BLD
|
||||
URL "${CMAKE_CURRENT_SOURCE_DIR}/oidn"
|
||||
BUILD_ALWAYS ${EXT_BUILD_ALWAYS} ${LOG_OPTS}
|
||||
@@ -15,6 +26,7 @@ if (ENABLE_OIDN)
|
||||
# OIDN's debug builds are broken upstream, so it is always built Release -
|
||||
# this matches OSPRay's own superbuild recipe (dep_oidn.cmake).
|
||||
-DCMAKE_BUILD_TYPE=Release
|
||||
${OIDN_CXX_FLAGS_ARGS}
|
||||
-DCMAKE_PREFIX_PATH=${CMAKE_BUNDLE_INSTALL_PREFIX}
|
||||
$<$<BOOL:${ONETBB_TARGET}>:-DTBB_ROOT=${CMAKE_BUNDLE_INSTALL_PREFIX}>
|
||||
$<$<BOOL:${ISPC_TARGET}>:-DISPC_EXECUTABLE=${CMAKE_BUNDLE_INSTALL_PREFIX}/${BIN_DIR}/ispc${CMAKE_EXECUTABLE_SUFFIX}>
|
||||
@@ -41,6 +53,8 @@ if (ENABLE_OIDN)
|
||||
STEP_TARGETS install
|
||||
)
|
||||
|
||||
unset(OIDN_CXX_FLAGS_ARGS)
|
||||
|
||||
TargetInstallDeps(OIDN OIDN_DEPENDS)
|
||||
# ISPC is only produced when a renderer group (e.g. OSPRAY) is active, so wire
|
||||
# the ordering dependency explicitly the same way embree does.
|
||||
|
||||
+1
-1
Submodule onetbb/oneTBB updated: ea2f73b591...3046c8b0c2
@@ -49,7 +49,7 @@ if (ENABLE_OPENCV)
|
||||
-DBUILD_opencv_apps=ON
|
||||
-DBUILD_opencv_calib3d=OFF
|
||||
-DBUILD_opencv_core=ON
|
||||
-DBUILD_opencv_dnn=ON
|
||||
-DBUILD_opencv_dnn=OFF
|
||||
-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=ON
|
||||
-DWITH_FLATBUFFERS=OFF
|
||||
-DWITH_FREETYPE=OFF
|
||||
-DWITH_GDAL=OFF
|
||||
-DWITH_GDCM=OFF
|
||||
|
||||
+1
-1
Submodule opencv/opencv updated: ed26aa55c1...40738fb16c
@@ -36,17 +36,6 @@ 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: 285c43ce2b...23fc677ba0
@@ -1,17 +1,5 @@
|
||||
--- 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
|
||||
@@ -33,18 +21,6 @@
|
||||
#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,24 +12,6 @@
|
||||
#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 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"
|
||||
|
||||
--- 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.
|
||||
+#if 0
|
||||
#if defined(ON_COMPILER_MSC) && !defined(ON_CMAKE_BUILD)
|
||||
|
||||
#if !defined(OPENNURBS_ZLIB_LIB_DIR)
|
||||
@@ -52,6 +53,8 @@
|
||||
@@ -60,6 +61,8 @@
|
||||
|
||||
#endif
|
||||
#endif // defined(ON_COMPILER_MSC) && !defined(ON_CMAKE_BUILD)
|
||||
|
||||
+#endif
|
||||
+
|
||||
// compressed buffer I/O uses zlib 1.1.3 inflate()/deflate()
|
||||
class ON_CompressorImplementation
|
||||
{
|
||||
@@ -319,11 +322,11 @@
|
||||
@@ -327,11 +332,11 @@
|
||||
// no uncompressed input is left - switch to finish mode
|
||||
flush = Z_FINISH;
|
||||
}
|
||||
@@ -31,7 +31,7 @@
|
||||
rc = false;
|
||||
break;
|
||||
}
|
||||
@@ -519,11 +522,11 @@
|
||||
@@ -527,11 +532,11 @@
|
||||
// no compressed input is left - switch to finish mode
|
||||
flush = Z_FINISH;
|
||||
}
|
||||
@@ -45,7 +45,7 @@
|
||||
rc = false;
|
||||
break;
|
||||
}
|
||||
@@ -1200,11 +1203,11 @@
|
||||
@@ -1208,11 +1213,11 @@
|
||||
// no uncompressed input is left - switch to finish mode
|
||||
flush = Z_FINISH;
|
||||
}
|
||||
@@ -59,7 +59,7 @@
|
||||
rc = false;
|
||||
break;
|
||||
}
|
||||
@@ -1333,11 +1336,11 @@
|
||||
@@ -1341,11 +1346,11 @@
|
||||
// no compressed input is left - switch to finish mode
|
||||
flush = Z_FINISH;
|
||||
}
|
||||
|
||||
@@ -17,11 +17,14 @@ if (ENABLE_OPENVDB)
|
||||
ExternalProject_Add(OPENVDB_BLD
|
||||
URL "${CMAKE_CURRENT_SOURCE_DIR}/openvdb"
|
||||
BUILD_ALWAYS ${EXT_BUILD_ALWAYS} ${LOG_OPTS}
|
||||
#PATCH_COMMAND ${PATCH_EXECUTABLE};-E;-p1;${PATCH_OPTIONS};-i;${CMAKE_CURRENT_SOURCE_DIR}/openvdb.patch
|
||||
PATCH_COMMAND ${CMAKE_COMMAND};-E;copy;${PROJECT_SOURCE_DIR}/CMake/FindZLIB.cmake;<SOURCE_DIR>/cmake/FindZLIB.cmake
|
||||
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
+1
Submodule openvdb/openvdb added at c81d904ded
@@ -1,3 +1,3 @@
|
||||
ONETBB
|
||||
PATCH
|
||||
|
||||
ZLIB
|
||||
|
||||
+1
-1
Submodule osmesa/osmesa updated: 06676241df...bfa90de454
+53
-3
@@ -5,14 +5,50 @@
|
||||
# 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
|
||||
# We ignore whitespace for portability and flexibility when applying patches.
|
||||
# Use split short options accepted by both bundled and Unix patch tools.
|
||||
#
|
||||
# -N avoids attempting to reverse patch if the patching is already done.
|
||||
set(PATCH_OPTIONS "--ignore-whitespace;-N" CACHE STRING "Command line options to use when patching" FORCE)
|
||||
set(PATCH_OPTIONS "-l;-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.
|
||||
@@ -39,7 +75,7 @@ if (ENABLE_PATCH)
|
||||
git_submodule_init(patch README.md)
|
||||
|
||||
ExternalProject_Add(PATCH_BLD
|
||||
SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/patch"
|
||||
URL "${CMAKE_CURRENT_SOURCE_DIR}/patch"
|
||||
BUILD_ALWAYS ${EXT_BUILD_ALWAYS} ${LOG_OPTS}
|
||||
CMAKE_ARGS
|
||||
${BUILD_TYPE_SPECIFIER}
|
||||
@@ -62,12 +98,26 @@ 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
|
||||
--
|
||||
|
||||
@@ -0,0 +1,206 @@
|
||||
// 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: 15358ea32a...e0ae942bae
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user