mirror of
https://github.com/johndoe6345789/typthon.git
synced 2026-04-24 13:45:05 +00:00
Merge branch 'dependabot/github_actions/actions/checkout-5' into dependabot/pip/Tools/types-setuptools-80.9.0.20251223
This commit is contained in:
4
.github/workflows/build.yml
vendored
4
.github/workflows/build.yml
vendored
@@ -17,7 +17,7 @@ jobs:
|
||||
run:
|
||||
shell: bash
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
- uses: actions/checkout@v6
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v5
|
||||
@@ -32,7 +32,7 @@ jobs:
|
||||
sudo apt-get install -y ninja-build
|
||||
|
||||
- name: Cache Conan downloads
|
||||
uses: actions/cache@v4
|
||||
uses: actions/cache@v5
|
||||
with:
|
||||
path: ~/.conan2
|
||||
key: conan-${{ runner.os }}-${{ hashFiles('conanfile.txt') }}
|
||||
|
||||
6
.github/workflows/jit.yml
vendored
6
.github/workflows/jit.yml
vendored
@@ -34,7 +34,7 @@ jobs:
|
||||
runs-on: ubuntu-24.04
|
||||
timeout-minutes: 90
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
persist-credentials: false
|
||||
- name: Build tier two interpreter
|
||||
@@ -88,7 +88,7 @@ jobs:
|
||||
architecture: aarch64
|
||||
runner: ubuntu-24.04-arm
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
persist-credentials: false
|
||||
- uses: actions/setup-python@v5
|
||||
@@ -138,7 +138,7 @@ jobs:
|
||||
# llvm:
|
||||
# - 19
|
||||
# steps:
|
||||
# - uses: actions/checkout@v5
|
||||
# - uses: actions/checkout@v6
|
||||
# with:
|
||||
# persist-credentials: false
|
||||
# - uses: actions/setup-python@v5
|
||||
|
||||
2
.github/workflows/lint.yml
vendored
2
.github/workflows/lint.yml
vendored
@@ -19,7 +19,7 @@ jobs:
|
||||
timeout-minutes: 10
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
persist-credentials: false
|
||||
- uses: actions/setup-python@v5
|
||||
|
||||
2
.github/workflows/mypy.yml
vendored
2
.github/workflows/mypy.yml
vendored
@@ -60,7 +60,7 @@ jobs:
|
||||
"Tools/wasm",
|
||||
]
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
persist-credentials: false
|
||||
- uses: actions/setup-python@v5
|
||||
|
||||
@@ -13,7 +13,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 10
|
||||
steps:
|
||||
- uses: actions/setup-node@v4
|
||||
- uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version: 20
|
||||
- run: npm install mailgun.js form-data
|
||||
|
||||
2
.github/workflows/reusable-context.yml
vendored
2
.github/workflows/reusable-context.yml
vendored
@@ -57,7 +57,7 @@ jobs:
|
||||
- run: >-
|
||||
echo '${{ github.event_name }}'
|
||||
|
||||
- uses: actions/checkout@v5
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
persist-credentials: false
|
||||
ref: >-
|
||||
|
||||
6
.github/workflows/reusable-docs.yml
vendored
6
.github/workflows/reusable-docs.yml
vendored
@@ -27,7 +27,7 @@ jobs:
|
||||
refspec_pr: '+${{ github.event.pull_request.head.sha }}:remotes/origin/${{ github.event.pull_request.head.ref }}'
|
||||
steps:
|
||||
- name: 'Check out latest PR branch commit'
|
||||
uses: actions/checkout@v5
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
persist-credentials: false
|
||||
ref: >-
|
||||
@@ -82,10 +82,10 @@ jobs:
|
||||
runs-on: ubuntu-24.04
|
||||
timeout-minutes: 60
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
persist-credentials: false
|
||||
- uses: actions/cache@v4
|
||||
- uses: actions/cache@v5
|
||||
with:
|
||||
path: ~/.cache/pip
|
||||
key: ubuntu-doc-${{ hashFiles('Doc/requirements.txt') }}
|
||||
|
||||
4
.github/workflows/reusable-macos.yml
vendored
4
.github/workflows/reusable-macos.yml
vendored
@@ -31,13 +31,13 @@ jobs:
|
||||
PYTHONSTRICTEXTENSIONBUILD: 1
|
||||
TERM: linux
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
persist-credentials: false
|
||||
- name: Runner image version
|
||||
run: echo "IMAGE_OS_VERSION=${ImageOS}-${ImageVersion}" >> "$GITHUB_ENV"
|
||||
- name: Restore config.cache
|
||||
uses: actions/cache@v4
|
||||
uses: actions/cache@v5
|
||||
with:
|
||||
path: config.cache
|
||||
key: ${{ github.job }}-${{ env.IMAGE_OS_VERSION }}-${{ inputs.config_hash }}
|
||||
|
||||
4
.github/workflows/reusable-san.yml
vendored
4
.github/workflows/reusable-san.yml
vendored
@@ -29,13 +29,13 @@ jobs:
|
||||
runs-on: ubuntu-24.04
|
||||
timeout-minutes: 60
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
persist-credentials: false
|
||||
- name: Runner image version
|
||||
run: echo "IMAGE_OS_VERSION=${ImageOS}-${ImageVersion}" >> "$GITHUB_ENV"
|
||||
- name: Restore config.cache
|
||||
uses: actions/cache@v4
|
||||
uses: actions/cache@v5
|
||||
with:
|
||||
path: config.cache
|
||||
key: ${{ github.job }}-${{ env.IMAGE_OS_VERSION }}-${{ inputs.sanitizer }}-${{ inputs.config_hash }}
|
||||
|
||||
6
.github/workflows/reusable-ubuntu.yml
vendored
6
.github/workflows/reusable-ubuntu.yml
vendored
@@ -34,7 +34,7 @@ jobs:
|
||||
PYTHONSTRICTEXTENSIONBUILD: 1
|
||||
TERM: linux
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
persist-credentials: false
|
||||
- name: Register gcc problem matcher
|
||||
@@ -54,7 +54,7 @@ jobs:
|
||||
echo "LD_LIBRARY_PATH=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}/lib" >> "$GITHUB_ENV"
|
||||
- name: 'Restore OpenSSL build'
|
||||
id: cache-openssl
|
||||
uses: actions/cache@v4
|
||||
uses: actions/cache@v5
|
||||
with:
|
||||
path: ./multissl/openssl/${{ env.OPENSSL_VER }}
|
||||
key: ${{ inputs.os }}-multissl-openssl-${{ env.OPENSSL_VER }}
|
||||
@@ -80,7 +80,7 @@ jobs:
|
||||
- name: Runner image version
|
||||
run: echo "IMAGE_OS_VERSION=${ImageOS}-${ImageVersion}" >> "$GITHUB_ENV"
|
||||
- name: Restore config.cache
|
||||
uses: actions/cache@v4
|
||||
uses: actions/cache@v5
|
||||
with:
|
||||
path: ${{ env.CPYTHON_BUILDDIR }}/config.cache
|
||||
key: ${{ github.job }}-${{ env.IMAGE_OS_VERSION }}-${{ inputs.config_hash }}
|
||||
|
||||
8
.github/workflows/reusable-wasi.yml
vendored
8
.github/workflows/reusable-wasi.yml
vendored
@@ -22,7 +22,7 @@ jobs:
|
||||
CROSS_BUILD_PYTHON: cross-build/build
|
||||
CROSS_BUILD_WASI: cross-build/wasm32-wasip1
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
persist-credentials: false
|
||||
# No problem resolver registered as one doesn't currently exist for Clang.
|
||||
@@ -32,7 +32,7 @@ jobs:
|
||||
version: ${{ env.WASMTIME_VERSION }}
|
||||
- name: "Restore WASI SDK"
|
||||
id: cache-wasi-sdk
|
||||
uses: actions/cache@v4
|
||||
uses: actions/cache@v5
|
||||
with:
|
||||
path: ${{ env.WASI_SDK_PATH }}
|
||||
key: ${{ runner.os }}-wasi-sdk-${{ env.WASI_SDK_VERSION }}
|
||||
@@ -56,7 +56,7 @@ jobs:
|
||||
- name: "Runner image version"
|
||||
run: echo "IMAGE_OS_VERSION=${ImageOS}-${ImageVersion}" >> "$GITHUB_ENV"
|
||||
- name: "Restore Python build config.cache"
|
||||
uses: actions/cache@v4
|
||||
uses: actions/cache@v5
|
||||
with:
|
||||
path: ${{ env.CROSS_BUILD_PYTHON }}/config.cache
|
||||
# Include env.pythonLocation in key to avoid changes in environment when setup-python updates Python.
|
||||
@@ -68,7 +68,7 @@ jobs:
|
||||
- name: "Make build Python"
|
||||
run: python3 Tools/wasm/wasi make-build-python
|
||||
- name: "Restore host config.cache"
|
||||
uses: actions/cache@v4
|
||||
uses: actions/cache@v5
|
||||
with:
|
||||
path: ${{ env.CROSS_BUILD_WASI }}/config.cache
|
||||
# Should be kept in sync with the other config.cache step above.
|
||||
|
||||
2
.github/workflows/reusable-windows-msi.yml
vendored
2
.github/workflows/reusable-windows-msi.yml
vendored
@@ -23,7 +23,7 @@ jobs:
|
||||
ARCH: ${{ inputs.arch }}
|
||||
IncludeFreethreaded: true
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
persist-credentials: false
|
||||
- name: Build CPython installer
|
||||
|
||||
2
.github/workflows/reusable-windows.yml
vendored
2
.github/workflows/reusable-windows.yml
vendored
@@ -26,7 +26,7 @@ jobs:
|
||||
env:
|
||||
ARCH: ${{ inputs.arch }}
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
persist-credentials: false
|
||||
- name: Register MSVC problem matcher
|
||||
|
||||
2
.github/workflows/tail-call.yml
vendored
2
.github/workflows/tail-call.yml
vendored
@@ -72,7 +72,7 @@ jobs:
|
||||
architecture: x86_64
|
||||
runner: ubuntu-24.04
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
persist-credentials: false
|
||||
- uses: actions/setup-python@v5
|
||||
|
||||
@@ -25,7 +25,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 10
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
persist-credentials: false
|
||||
- uses: actions/setup-python@v5
|
||||
|
||||
336
Doc/Makefile
336
Doc/Makefile
@@ -1,336 +0,0 @@
|
||||
#
|
||||
# Makefile for Python documentation
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
|
||||
# You can set these variables from the command line.
|
||||
PYTHON = python3
|
||||
VENVDIR = ./venv
|
||||
UV = uv
|
||||
SPHINXBUILD = PATH=$(VENVDIR)/bin:$$PATH sphinx-build
|
||||
BLURB = PATH=$(VENVDIR)/bin:$$PATH blurb
|
||||
JOBS = auto
|
||||
PAPER =
|
||||
SOURCES =
|
||||
DISTVERSION = $(shell $(PYTHON) tools/extensions/patchlevel.py)
|
||||
REQUIREMENTS = requirements.txt
|
||||
SPHINXERRORHANDLING = --fail-on-warning
|
||||
|
||||
# Internal variables.
|
||||
PAPEROPT_a4 = --define latex_elements.papersize=a4paper
|
||||
PAPEROPT_letter = --define latex_elements.papersize=letterpaper
|
||||
|
||||
ALLSPHINXOPTS = --builder $(BUILDER) \
|
||||
--doctree-dir build/doctrees \
|
||||
--jobs $(JOBS) \
|
||||
$(PAPEROPT_$(PAPER)) \
|
||||
$(SPHINXOPTS) $(SPHINXERRORHANDLING) \
|
||||
. build/$(BUILDER) $(SOURCES)
|
||||
|
||||
.PHONY: help
|
||||
help:
|
||||
@echo "Please use \`make <target>' where <target> is one of"
|
||||
@echo " clean to remove build files"
|
||||
@echo " venv to create a venv with necessary tools"
|
||||
@echo " html to make standalone HTML files"
|
||||
@echo " gettext to generate POT files"
|
||||
@echo " htmlview to open the index page built by the html target in your browser"
|
||||
@echo " htmllive to rebuild and reload HTML files in your browser"
|
||||
@echo " htmlhelp to make HTML files and a HTML help project"
|
||||
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
|
||||
@echo " text to make plain text files"
|
||||
@echo " texinfo to make Texinfo file"
|
||||
@echo " epub to make EPUB files"
|
||||
@echo " changes to make an overview over all changed/added/deprecated items"
|
||||
@echo " linkcheck to check all external links for integrity"
|
||||
@echo " coverage to check documentation coverage for library and C API"
|
||||
@echo " doctest to run doctests in the documentation"
|
||||
@echo " pydoc-topics to regenerate the pydoc topics file"
|
||||
@echo " dist to create a \"dist\" directory with archived docs for download"
|
||||
@echo " check to run a check for frequent markup errors"
|
||||
|
||||
.PHONY: build
|
||||
build:
|
||||
-mkdir -p build
|
||||
# Look first for a Misc/NEWS file (building from a source release tarball
|
||||
# or old repo) and use that, otherwise look for a Misc/NEWS.d directory
|
||||
# (building from a newer repo) and use blurb to generate the NEWS file.
|
||||
@if [ -f ../Misc/NEWS ] ; then \
|
||||
echo "Using existing Misc/NEWS file"; \
|
||||
cp ../Misc/NEWS build/NEWS; \
|
||||
elif $(BLURB) help >/dev/null 2>&1 && $(SPHINXBUILD) --version >/dev/null 2>&1; then \
|
||||
if [ -d ../Misc/NEWS.d ]; then \
|
||||
echo "Building NEWS from Misc/NEWS.d with blurb"; \
|
||||
$(BLURB) merge -f build/NEWS; \
|
||||
else \
|
||||
echo "Neither Misc/NEWS.d nor Misc/NEWS found; cannot build docs"; \
|
||||
exit 1; \
|
||||
fi \
|
||||
else \
|
||||
echo ""; \
|
||||
echo "Missing the required blurb or sphinx-build tools."; \
|
||||
echo "Please run 'make venv' to install local copies."; \
|
||||
echo ""; \
|
||||
exit 1; \
|
||||
fi
|
||||
$(SPHINXBUILD) $(ALLSPHINXOPTS)
|
||||
@echo
|
||||
|
||||
.PHONY: html
|
||||
html: BUILDER = html
|
||||
html: build
|
||||
@echo "Build finished. The HTML pages are in build/html."
|
||||
|
||||
.PHONY: htmlhelp
|
||||
htmlhelp: BUILDER = htmlhelp
|
||||
htmlhelp: build
|
||||
@echo "Build finished; now you can run HTML Help Workshop with the" \
|
||||
"build/htmlhelp/pydoc.hhp project file."
|
||||
|
||||
.PHONY: latex
|
||||
latex: BUILDER = latex
|
||||
latex: build
|
||||
@echo "Build finished; the LaTeX files are in build/latex."
|
||||
@echo "Run \`make all-pdf' or \`make all-ps' in that directory to" \
|
||||
"run these through (pdf)latex."
|
||||
|
||||
.PHONY: text
|
||||
text: BUILDER = text
|
||||
text: build
|
||||
@echo "Build finished; the text files are in build/text."
|
||||
|
||||
.PHONY: texinfo
|
||||
texinfo: BUILDER = texinfo
|
||||
texinfo: build
|
||||
@echo "Build finished; the python.texi file is in build/texinfo."
|
||||
@echo "Run \`make info' in that directory to run it through makeinfo."
|
||||
|
||||
.PHONY: epub
|
||||
epub: BUILDER = epub
|
||||
epub: build
|
||||
@echo "Build finished; the epub files are in build/epub."
|
||||
|
||||
.PHONY: changes
|
||||
changes: BUILDER = changes
|
||||
changes: build
|
||||
@echo "The overview file is in build/changes."
|
||||
|
||||
.PHONY: linkcheck
|
||||
linkcheck: BUILDER = linkcheck
|
||||
linkcheck:
|
||||
@$(MAKE) build BUILDER=$(BUILDER) || { \
|
||||
echo "Link check complete; look for any errors in the above output" \
|
||||
"or in build/$(BUILDER)/output.txt"; \
|
||||
false; }
|
||||
|
||||
.PHONY: coverage
|
||||
coverage: BUILDER = coverage
|
||||
coverage: build
|
||||
@echo "Coverage finished; see c.txt and python.txt in build/coverage"
|
||||
|
||||
.PHONY: doctest
|
||||
doctest: BUILDER = doctest
|
||||
doctest:
|
||||
@$(MAKE) build BUILDER=$(BUILDER) || { \
|
||||
echo "Testing of doctests in the sources finished, look at the" \
|
||||
"results in build/doctest/output.txt"; \
|
||||
false; }
|
||||
|
||||
.PHONY: pydoc-topics
|
||||
pydoc-topics: BUILDER = pydoc-topics
|
||||
pydoc-topics: build
|
||||
@echo "Building finished; now run this:" \
|
||||
"cp build/pydoc-topics/topics.py ../Lib/pydoc_data/topics.py"
|
||||
|
||||
.PHONY: gettext
|
||||
gettext: BUILDER = gettext
|
||||
gettext: override SPHINXOPTS := --doctree-dir build/doctrees-gettext $(SPHINXOPTS)
|
||||
gettext: build
|
||||
|
||||
.PHONY: htmlview
|
||||
htmlview: html
|
||||
$(PYTHON) -c "import os, webbrowser; webbrowser.open('file://' + os.path.realpath('build/html/index.html'))"
|
||||
|
||||
.PHONY: htmllive
|
||||
htmllive: SPHINXBUILD = PATH=$(VENVDIR)/bin:$$PATH sphinx-autobuild
|
||||
htmllive: SPHINXOPTS = --re-ignore="/venv/" --open-browser --delay 0
|
||||
htmllive: _ensure-sphinx-autobuild html
|
||||
|
||||
.PHONY: clean
|
||||
clean: clean-venv
|
||||
-rm -rf build/*
|
||||
|
||||
.PHONY: clean-venv
|
||||
clean-venv:
|
||||
rm -rf $(VENVDIR)
|
||||
|
||||
.PHONY: venv
|
||||
venv:
|
||||
@if [ -d $(VENVDIR) ] ; then \
|
||||
echo "venv already exists."; \
|
||||
echo "To recreate it, remove it first with \`make clean-venv'."; \
|
||||
else \
|
||||
set -e; \
|
||||
echo "Creating venv in $(VENVDIR)"; \
|
||||
if $(UV) --version >/dev/null 2>&1; then \
|
||||
$(UV) venv --python=$(PYTHON) $(VENVDIR); \
|
||||
VIRTUAL_ENV=$(VENVDIR) $(UV) pip install -r $(REQUIREMENTS); \
|
||||
else \
|
||||
$(PYTHON) -m venv $(VENVDIR); \
|
||||
$(VENVDIR)/bin/python3 -m pip install --upgrade pip; \
|
||||
$(VENVDIR)/bin/python3 -m pip install -r $(REQUIREMENTS); \
|
||||
fi; \
|
||||
echo "The venv has been created in the $(VENVDIR) directory"; \
|
||||
fi
|
||||
|
||||
.PHONY: dist-no-html
|
||||
dist-no-html: dist-text dist-pdf dist-epub dist-texinfo
|
||||
|
||||
.PHONY: dist
|
||||
dist:
|
||||
rm -rf dist
|
||||
mkdir -p dist
|
||||
$(MAKE) dist-html
|
||||
$(MAKE) dist-text
|
||||
$(MAKE) dist-pdf
|
||||
$(MAKE) dist-epub
|
||||
$(MAKE) dist-texinfo
|
||||
|
||||
.PHONY: dist-html
|
||||
dist-html:
|
||||
# archive the HTML
|
||||
@echo "Building HTML..."
|
||||
mkdir -p dist
|
||||
rm -rf build/html
|
||||
find dist -name 'python-$(DISTVERSION)-docs-html*' -exec rm -rf {} \;
|
||||
$(MAKE) html
|
||||
cp -pPR build/html dist/python-$(DISTVERSION)-docs-html
|
||||
rm -rf dist/python-$(DISTVERSION)-docs-html/_images/social_previews/
|
||||
tar -C dist -cf dist/python-$(DISTVERSION)-docs-html.tar python-$(DISTVERSION)-docs-html
|
||||
bzip2 -9 -k dist/python-$(DISTVERSION)-docs-html.tar
|
||||
(cd dist; zip -q -r -9 python-$(DISTVERSION)-docs-html.zip python-$(DISTVERSION)-docs-html)
|
||||
rm -r dist/python-$(DISTVERSION)-docs-html
|
||||
rm dist/python-$(DISTVERSION)-docs-html.tar
|
||||
@echo "Build finished and archived!"
|
||||
|
||||
.PHONY: dist-text
|
||||
dist-text:
|
||||
# archive the text build
|
||||
@echo "Building text..."
|
||||
mkdir -p dist
|
||||
rm -rf build/text
|
||||
find dist -name 'python-$(DISTVERSION)-docs-text*' -exec rm -rf {} \;
|
||||
$(MAKE) text
|
||||
cp -pPR build/text dist/python-$(DISTVERSION)-docs-text
|
||||
tar -C dist -cf dist/python-$(DISTVERSION)-docs-text.tar python-$(DISTVERSION)-docs-text
|
||||
bzip2 -9 -k dist/python-$(DISTVERSION)-docs-text.tar
|
||||
(cd dist; zip -q -r -9 python-$(DISTVERSION)-docs-text.zip python-$(DISTVERSION)-docs-text)
|
||||
rm -r dist/python-$(DISTVERSION)-docs-text
|
||||
rm dist/python-$(DISTVERSION)-docs-text.tar
|
||||
@echo "Build finished and archived!"
|
||||
|
||||
.PHONY: dist-pdf
|
||||
dist-pdf:
|
||||
# archive the A4 latex
|
||||
@echo "Building LaTeX (A4 paper)..."
|
||||
mkdir -p dist
|
||||
rm -rf build/latex
|
||||
find dist -name 'python-$(DISTVERSION)-docs-pdf*' -exec rm -rf {} \;
|
||||
$(MAKE) latex PAPER=a4
|
||||
# remove zip & bz2 dependency on all-pdf,
|
||||
# as otherwise the full latexmk process is run twice.
|
||||
# ($$ is needed to escape the $; https://www.gnu.org/software/make/manual/make.html#Basics-of-Variable-References)
|
||||
-sed -i 's/: all-$$(FMT)/:/' build/latex/Makefile
|
||||
(cd build/latex; $(MAKE) clean && $(MAKE) --jobs=$$((`nproc`+1)) --output-sync LATEXMKOPTS='-quiet' all-pdf && $(MAKE) FMT=pdf zip bz2)
|
||||
cp build/latex/docs-pdf.zip dist/python-$(DISTVERSION)-docs-pdf-a4.zip
|
||||
cp build/latex/docs-pdf.tar.bz2 dist/python-$(DISTVERSION)-docs-pdf-a4.tar.bz2
|
||||
@echo "Build finished and archived!"
|
||||
|
||||
.PHONY: dist-epub
|
||||
dist-epub:
|
||||
# copy the epub build
|
||||
@echo "Building EPUB..."
|
||||
mkdir -p dist
|
||||
rm -rf build/epub
|
||||
rm -f dist/python-$(DISTVERSION)-docs.epub
|
||||
$(MAKE) epub
|
||||
cp -pPR build/epub/Python.epub dist/python-$(DISTVERSION)-docs.epub
|
||||
@echo "Build finished and archived!"
|
||||
|
||||
.PHONY: dist-texinfo
|
||||
dist-texinfo:
|
||||
# archive the texinfo build
|
||||
@echo "Building Texinfo..."
|
||||
mkdir -p dist
|
||||
rm -rf build/texinfo
|
||||
find dist -name 'python-$(DISTVERSION)-docs-texinfo*' -exec rm -rf {} \;
|
||||
$(MAKE) texinfo
|
||||
$(MAKE) info --directory=build/texinfo
|
||||
cp -pPR build/texinfo dist/python-$(DISTVERSION)-docs-texinfo
|
||||
tar -C dist -cf dist/python-$(DISTVERSION)-docs-texinfo.tar python-$(DISTVERSION)-docs-texinfo
|
||||
bzip2 -9 -k dist/python-$(DISTVERSION)-docs-texinfo.tar
|
||||
(cd dist; zip -q -r -9 python-$(DISTVERSION)-docs-texinfo.zip python-$(DISTVERSION)-docs-texinfo)
|
||||
rm -r dist/python-$(DISTVERSION)-docs-texinfo
|
||||
rm dist/python-$(DISTVERSION)-docs-texinfo.tar
|
||||
@echo "Build finished and archived!"
|
||||
|
||||
.PHONY: _ensure-package
|
||||
_ensure-package: venv
|
||||
if $(UV) --version >/dev/null 2>&1; then \
|
||||
VIRTUAL_ENV=$(VENVDIR) $(UV) pip install $(PACKAGE); \
|
||||
else \
|
||||
$(VENVDIR)/bin/python3 -m pip install $(PACKAGE); \
|
||||
fi
|
||||
|
||||
.PHONY: _ensure-pre-commit
|
||||
_ensure-pre-commit:
|
||||
$(MAKE) _ensure-package PACKAGE=pre-commit
|
||||
|
||||
.PHONY: _ensure-sphinx-autobuild
|
||||
_ensure-sphinx-autobuild:
|
||||
$(MAKE) _ensure-package PACKAGE=sphinx-autobuild
|
||||
|
||||
.PHONY: check
|
||||
check: _ensure-pre-commit
|
||||
$(VENVDIR)/bin/python3 -m pre_commit run --all-files
|
||||
|
||||
.PHONY: serve
|
||||
serve:
|
||||
@echo "The serve target was removed, use htmllive instead (see gh-80510)"
|
||||
|
||||
# Targets for daily automated doc build
|
||||
# By default, Sphinx only rebuilds pages where the page content has changed.
|
||||
# This means it doesn't always pick up changes to preferred link targets, etc
|
||||
# To ensure such changes are picked up, we build the published docs with
|
||||
# ``--fresh-env`` (to ignore the cached environment) and ``--write-all``
|
||||
# (to ignore already existing output files)
|
||||
|
||||
# for development releases: always build
|
||||
.PHONY: autobuild-dev
|
||||
autobuild-dev: DISTVERSION = $(shell $(PYTHON) tools/extensions/patchlevel.py --short)
|
||||
autobuild-dev:
|
||||
$(MAKE) dist-no-html SPHINXOPTS='$(SPHINXOPTS) --fresh-env --write-all --html-define daily=1' DISTVERSION=$(DISTVERSION)
|
||||
|
||||
# for HTML-only rebuilds
|
||||
.PHONY: autobuild-dev-html
|
||||
autobuild-dev-html: DISTVERSION = $(shell $(PYTHON) tools/extensions/patchlevel.py --short)
|
||||
autobuild-dev-html:
|
||||
$(MAKE) dist-html SPHINXOPTS='$(SPHINXOPTS) --fresh-env --write-all --html-define daily=1' DISTVERSION=$(DISTVERSION)
|
||||
|
||||
# for stable releases: only build if not in pre-release stage (alpha, beta)
|
||||
# release candidate downloads are okay, since the stable tree can be in that stage
|
||||
.PHONY: autobuild-stable
|
||||
autobuild-stable:
|
||||
@case $(DISTVERSION) in *[ab]*) \
|
||||
echo "Not building; $(DISTVERSION) is not a release version."; \
|
||||
exit 1;; \
|
||||
esac
|
||||
@$(MAKE) autobuild-dev
|
||||
|
||||
.PHONY: autobuild-stable-html
|
||||
autobuild-stable-html:
|
||||
@case $(DISTVERSION) in *[ab]*) \
|
||||
echo "Not building; $(DISTVERSION) is not a release version."; \
|
||||
exit 1;; \
|
||||
esac
|
||||
@$(MAKE) autobuild-dev-html
|
||||
276
Mac/Makefile.in
276
Mac/Makefile.in
@@ -1,276 +0,0 @@
|
||||
# This file can be invoked from the various frameworkinstall... targets in the
|
||||
# main Makefile. The next couple of variables are overridden on the
|
||||
# commandline in that case.
|
||||
|
||||
VERSION=@VERSION@
|
||||
ABIFLAGS=@ABIFLAGS@
|
||||
LDVERSION=@LDVERSION@
|
||||
ENSUREPIP=@ENSUREPIP@
|
||||
builddir = ..
|
||||
srcdir=@srcdir@
|
||||
prefix=@prefix@
|
||||
exec_prefix=@exec_prefix@
|
||||
LIBDEST=$(prefix)/lib/python$(VERSION)
|
||||
RUNSHARED=@RUNSHARED@
|
||||
BUILDEXE=@BUILDEXEEXT@
|
||||
BUILDPYTHON=$(builddir)/python$(BUILDEXE)
|
||||
DESTDIR=
|
||||
LDFLAGS=@LDFLAGS@
|
||||
FRAMEWORKUNIXTOOLSPREFIX=@FRAMEWORKUNIXTOOLSPREFIX@
|
||||
PYTHONFRAMEWORK=@PYTHONFRAMEWORK@
|
||||
PYTHONFRAMEWORKIDENTIFIER=@PYTHONFRAMEWORKIDENTIFIER@
|
||||
LIPO_32BIT_FLAGS=@LIPO_32BIT_FLAGS@
|
||||
LIPO_INTEL64_FLAGS=@LIPO_INTEL64_FLAGS@
|
||||
CC=@CC@
|
||||
MACOSX_DEPLOYMENT_TARGET=@CONFIGURE_MACOSX_DEPLOYMENT_TARGET@
|
||||
export MACOSX_DEPLOYMENT_TARGET
|
||||
|
||||
|
||||
|
||||
# These are normally glimpsed from the previous set
|
||||
BINDIR= @bindir@
|
||||
PYTHONAPPSDIR=@FRAMEWORKINSTALLAPPSPREFIX@/$(PYTHONFRAMEWORK) $(VERSION)
|
||||
APPINSTALLDIR=$(prefix)/Resources/Python.app
|
||||
|
||||
# Variables for installing the "normal" unix binaries
|
||||
INSTALLED_PYTHONAPP=$(APPINSTALLDIR)/Contents/MacOS/$(PYTHONFRAMEWORK)
|
||||
|
||||
# Items more-or-less copied from the main Makefile
|
||||
DIRMODE=755
|
||||
FILEMODE=644
|
||||
INSTALL=@INSTALL@
|
||||
INSTALL_SYMLINK=ln -fsn
|
||||
INSTALL_PROGRAM=@INSTALL_PROGRAM@
|
||||
INSTALL_SCRIPT= @INSTALL_SCRIPT@
|
||||
INSTALL_DATA=@INSTALL_DATA@
|
||||
LN=@LN@
|
||||
STRIPFLAG=-s
|
||||
CPMAC=CpMac
|
||||
|
||||
APPTEMPLATE=$(srcdir)/Resources/app
|
||||
APPSUBDIRS=MacOS Resources
|
||||
compileall=$(srcdir)/../Lib/compileall.py
|
||||
|
||||
installapps: install_Python install_PythonLauncher install_IDLE
|
||||
|
||||
#
|
||||
# Install unix tools in /usr/local/bin. These are just aliases for the
|
||||
# actual installation inside the framework.
|
||||
#
|
||||
installunixtools:
|
||||
if [ ! -d "$(DESTDIR)$(FRAMEWORKUNIXTOOLSPREFIX)/bin" ]; then \
|
||||
$(INSTALL) -d -m $(DIRMODE) "$(DESTDIR)$(FRAMEWORKUNIXTOOLSPREFIX)/bin" ;\
|
||||
fi
|
||||
cd "$(DESTDIR)$(FRAMEWORKUNIXTOOLSPREFIX)/bin" && \
|
||||
for fn in \
|
||||
idle3 \
|
||||
pydoc3 \
|
||||
python3 \
|
||||
python3-config \
|
||||
; \
|
||||
do \
|
||||
rm -f $${fn} ; \
|
||||
$(LN) -s $(BINDIR)/$${fn} $${fn} ;\
|
||||
done
|
||||
-if test "x$(VERSION)" != "x$(LDVERSION)"; then \
|
||||
cd "$(DESTDIR)$(FRAMEWORKUNIXTOOLSPREFIX)/bin" && \
|
||||
for fn in \
|
||||
python$(VERSION)-config \
|
||||
; \
|
||||
do \
|
||||
rm -f $${fn} ;\
|
||||
$(LN) -s $(BINDIR)/$${fn} $${fn} ;\
|
||||
done ;\
|
||||
fi
|
||||
-if test "x$(LIPO_32BIT_FLAGS)" != "x"; then \
|
||||
cd "$(DESTDIR)$(FRAMEWORKUNIXTOOLSPREFIX)/bin" && \
|
||||
for fn in \
|
||||
python3-32 \
|
||||
; \
|
||||
do \
|
||||
rm -f $${fn} ;\
|
||||
$(LN) -s $(BINDIR)/$${fn} $${fn} ;\
|
||||
done ;\
|
||||
fi
|
||||
-if test "x$(LIPO_INTEL64_FLAGS)" != "x"; then \
|
||||
cd "$(DESTDIR)$(FRAMEWORKUNIXTOOLSPREFIX)/bin" && \
|
||||
for fn in \
|
||||
python3-intel64 \
|
||||
; \
|
||||
do \
|
||||
rm -f $${fn} ;\
|
||||
$(LN) -s $(BINDIR)/$${fn} $${fn} ;\
|
||||
done ;\
|
||||
fi
|
||||
-if test "x$(ENSUREPIP)" != "xno" ; then \
|
||||
cd "$(DESTDIR)$(FRAMEWORKUNIXTOOLSPREFIX)/bin" && \
|
||||
for fn in \
|
||||
pip3 \
|
||||
; \
|
||||
do \
|
||||
rm -f $${fn} ;\
|
||||
$(LN) -s $(BINDIR)/$${fn} $${fn} ;\
|
||||
done ;\
|
||||
fi
|
||||
|
||||
#
|
||||
# Like installunixtools, but only install links to the versioned binaries.
|
||||
#
|
||||
altinstallunixtools:
|
||||
if [ ! -d "$(DESTDIR)$(FRAMEWORKUNIXTOOLSPREFIX)/bin" ]; then \
|
||||
$(INSTALL) -d -m $(DIRMODE) "$(DESTDIR)$(FRAMEWORKUNIXTOOLSPREFIX)/bin" ;\
|
||||
fi
|
||||
cd "$(DESTDIR)$(FRAMEWORKUNIXTOOLSPREFIX)/bin" && \
|
||||
for fn in \
|
||||
idle$(VERSION) \
|
||||
pydoc$(VERSION) \
|
||||
python$(VERSION) \
|
||||
python$(LDVERSION)-config \
|
||||
; \
|
||||
do \
|
||||
rm -f $${fn} ;\
|
||||
$(LN) -s $(BINDIR)/$${fn} $${fn} ;\
|
||||
done
|
||||
-if test "x$(VERSION)" != "x$(LDVERSION)"; then \
|
||||
cd "$(DESTDIR)$(FRAMEWORKUNIXTOOLSPREFIX)/bin" && \
|
||||
for fn in \
|
||||
python$(LDVERSION) \
|
||||
; \
|
||||
do \
|
||||
rm -f $${fn} ;\
|
||||
$(LN) -s $(BINDIR)/$${fn} $${fn} ;\
|
||||
done ;\
|
||||
fi
|
||||
-if test "x$(LIPO_32BIT_FLAGS)" != "x"; then \
|
||||
cd "$(DESTDIR)$(FRAMEWORKUNIXTOOLSPREFIX)/bin" && \
|
||||
for fn in \
|
||||
python$(VERSION)-32 \
|
||||
; \
|
||||
do \
|
||||
rm -f $${fn} ;\
|
||||
$(LN) -s $(BINDIR)/$${fn} $${fn} ;\
|
||||
done ;\
|
||||
fi
|
||||
-if test "x$(LIPO_INTEL64_FLAGS)" != "x"; then \
|
||||
cd "$(DESTDIR)$(FRAMEWORKUNIXTOOLSPREFIX)/bin" && \
|
||||
for fn in \
|
||||
python$(VERSION)-intel64 \
|
||||
; \
|
||||
do \
|
||||
rm -f $${fn} ;\
|
||||
$(LN) -s $(BINDIR)/$${fn} $${fn} ;\
|
||||
done ;\
|
||||
fi
|
||||
-if test "x$(ENSUREPIP)" != "xno" ; then \
|
||||
cd "$(DESTDIR)$(FRAMEWORKUNIXTOOLSPREFIX)/bin" && \
|
||||
for fn in \
|
||||
pip$(VERSION) \
|
||||
; \
|
||||
do \
|
||||
rm -f $${fn} ;\
|
||||
$(LN) -s $(BINDIR)/$${fn} $${fn} ;\
|
||||
done ;\
|
||||
fi
|
||||
|
||||
pythonw: $(srcdir)/Tools/pythonw.c Makefile
|
||||
$(CC) $(LDFLAGS) -DPYTHONFRAMEWORK='"$(PYTHONFRAMEWORK)"' -o $@ \
|
||||
$(srcdir)/Tools/pythonw.c -I.. -I$(srcdir)/../Include \
|
||||
../$(PYTHONFRAMEWORK).framework/Versions/$(VERSION)/$(PYTHONFRAMEWORK)
|
||||
|
||||
install_PythonLauncher:
|
||||
cd PythonLauncher && make install DESTDIR=$(DESTDIR)
|
||||
|
||||
install_Python:
|
||||
@for i in "$(PYTHONAPPSDIR)" "$(APPINSTALLDIR)" "$(APPINSTALLDIR)/Contents"; do \
|
||||
if test ! -d "$(DESTDIR)$$i"; then \
|
||||
echo "Creating directory $(DESTDIR)$$i"; \
|
||||
$(INSTALL) -d -m $(DIRMODE) "$(DESTDIR)$$i"; \
|
||||
fi;\
|
||||
done
|
||||
@for i in $(APPSUBDIRS); do \
|
||||
if test ! -d "$(DESTDIR)$(APPINSTALLDIR)/Contents/$$i"; then \
|
||||
echo "Creating directory $(DESTDIR)$(APPINSTALLDIR)/Contents/$$i"; \
|
||||
$(INSTALL) -d -m $(DIRMODE) "$(DESTDIR)$(APPINSTALLDIR)/Contents/$$i"; \
|
||||
else true; \
|
||||
fi; \
|
||||
done
|
||||
@for d in . $(APPSUBDIRS); \
|
||||
do \
|
||||
a=$(APPTEMPLATE)/$$d; \
|
||||
if test ! -d $$a; then continue; else true; fi; \
|
||||
b="$(DESTDIR)$(APPINSTALLDIR)/Contents/$$d"; \
|
||||
for i in $$a/*; \
|
||||
do \
|
||||
case $$i in \
|
||||
*CVS) ;; \
|
||||
*.svn) ;; \
|
||||
*.py[co]) ;; \
|
||||
*.orig) ;; \
|
||||
*~) ;; \
|
||||
*idx) \
|
||||
echo $(CPMAC) "$$i" $$b; \
|
||||
$(CPMAC) "$$i" "$$b"; \
|
||||
;; \
|
||||
*) \
|
||||
if test -d $$i; then continue; fi; \
|
||||
if test -x $$i; then \
|
||||
echo $(INSTALL_SCRIPT) "$$i" "$$b"; \
|
||||
$(INSTALL_SCRIPT) "$$i" "$$b"; \
|
||||
else \
|
||||
echo $(INSTALL_DATA) "$$i" "$$b"; \
|
||||
$(INSTALL_DATA) "$$i" "$$b"; \
|
||||
fi;; \
|
||||
esac; \
|
||||
done; \
|
||||
done
|
||||
$(INSTALL_PROGRAM) $(STRIPFLAG) $(BUILDPYTHON) "$(DESTDIR)$(APPINSTALLDIR)/Contents/MacOS/$(PYTHONFRAMEWORK)"
|
||||
sed -e "s!%bundleid%!$(PYTHONFRAMEWORKIDENTIFIER)!g" \
|
||||
-e "s!%version%!`$(RUNSHARED) $(BUILDPYTHON) \
|
||||
-c 'import platform; print(platform.python_version())'`!g" \
|
||||
< "$(DESTDIR)$(APPINSTALLDIR)/Contents/Info.plist.in" \
|
||||
> "$(DESTDIR)$(APPINSTALLDIR)/Contents/Info.plist"
|
||||
rm "$(DESTDIR)$(APPINSTALLDIR)/Contents/Info.plist.in"
|
||||
|
||||
|
||||
install_IDLE:
|
||||
test -d "$(DESTDIR)$(PYTHONAPPSDIR)" || mkdir -p "$(DESTDIR)$(PYTHONAPPSDIR)"
|
||||
-test -d "$(DESTDIR)$(PYTHONAPPSDIR)/IDLE.app" && rm -rf "$(DESTDIR)$(PYTHONAPPSDIR)/IDLE.app"
|
||||
/bin/cp -PR "$(srcdir)/IDLE/IDLE.app" "$(DESTDIR)$(PYTHONAPPSDIR)"
|
||||
ln -sf "$(INSTALLED_PYTHONAPP)" "$(DESTDIR)$(PYTHONAPPSDIR)/IDLE.app/Contents/MacOS/Python"
|
||||
sed -e "s!%prefix%!$(prefix)!g" -e 's!%exe%!$(PYTHONFRAMEWORK)!g' < "$(srcdir)/IDLE/IDLE.app/Contents/MacOS/IDLE" > "$(DESTDIR)$(PYTHONAPPSDIR)/IDLE.app/Contents/MacOS/IDLE"
|
||||
sed "s!%version%!`$(RUNSHARED) $(BUILDPYTHON) -c 'import platform; print(platform.python_version())'`!g" < "$(srcdir)/IDLE/IDLE.app/Contents/Info.plist" > "$(DESTDIR)$(PYTHONAPPSDIR)/IDLE.app/Contents/Info.plist"
|
||||
if [ -f "$(DESTDIR)$(LIBDEST)/idlelib/config-main.def" ]; then \
|
||||
/bin/cp -p "$(DESTDIR)$(LIBDEST)/idlelib/config-main.def" \
|
||||
"$(DESTDIR)$(LIBDEST)/idlelib/config-main.def~" ; \
|
||||
sed -e 's!name= IDLE Classic Windows!name= IDLE Classic OSX!g' \
|
||||
< "$(DESTDIR)$(LIBDEST)/idlelib/config-main.def~" \
|
||||
> "$(DESTDIR)$(LIBDEST)/idlelib/config-main.def" ; \
|
||||
rm "$(DESTDIR)$(LIBDEST)/idlelib/config-main.def~" ; \
|
||||
fi
|
||||
if [ -f "$(DESTDIR)$(LIBDEST)/idlelib/config-extensions.def" ]; then \
|
||||
/bin/cp -p "$(DESTDIR)$(LIBDEST)/idlelib/config-extensions.def" \
|
||||
"$(DESTDIR)$(LIBDEST)/idlelib/config-extensions.def~" ; \
|
||||
sed -e 's!zoom-height=<Alt-Key-2>!zoom-height=<Option-Key-0>!g' \
|
||||
-e 's!<Alt-Key-!<Option-Key-!g' \
|
||||
< "$(DESTDIR)$(LIBDEST)/idlelib/config-extensions.def~" \
|
||||
> "$(DESTDIR)$(LIBDEST)/idlelib/config-extensions.def" ; \
|
||||
rm "$(DESTDIR)$(LIBDEST)/idlelib/config-extensions.def~" ; \
|
||||
fi
|
||||
touch "$(DESTDIR)$(PYTHONAPPSDIR)/IDLE.app"
|
||||
chmod -R ugo+rX,go-w "$(DESTDIR)$(PYTHONAPPSDIR)/IDLE.app"
|
||||
chmod ugo+x "$(DESTDIR)$(PYTHONAPPSDIR)/IDLE.app/Contents/MacOS/IDLE"
|
||||
|
||||
$(INSTALLED_PYTHONAPP): install_Python
|
||||
|
||||
installextras: $(srcdir)/Extras.install.py
|
||||
$(INSTALL) -d "$(DESTDIR)$(prefix)/share/doc/python$(VERSION)/examples"
|
||||
$(RUNSHARED) $(BUILDPYTHON) $(srcdir)/Extras.install.py $(srcdir)/../Tools \
|
||||
"$(DESTDIR)$(prefix)/share/doc/python$(VERSION)/examples/Tools" ; \
|
||||
chmod -R ugo+rX,go-w "$(DESTDIR)$(prefix)/share/doc/python$(VERSION)/examples/Tools"
|
||||
|
||||
clean:
|
||||
rm pythonw
|
||||
cd PythonLauncher && make clean
|
||||
|
||||
Makefile: $(srcdir)/Makefile.in ../config.status
|
||||
cd .. && CONFIG_FILES=Mac/Makefile CONFIG_HEADERS= $(SHELL) ./config.status
|
||||
@@ -1,78 +0,0 @@
|
||||
CC=@CC@
|
||||
LD=@CC@
|
||||
BASECFLAGS=@BASECFLAGS@
|
||||
OPT=@OPT@
|
||||
CFLAGS=@CFLAGS@ $(BASECFLAGS) $(OPT)
|
||||
LDFLAGS=@LDFLAGS@
|
||||
srcdir= @srcdir@
|
||||
VERSION= @VERSION@
|
||||
UNIVERSALSDK=@UNIVERSALSDK@
|
||||
builddir= ../..
|
||||
|
||||
RUNSHARED= @RUNSHARED@
|
||||
BUILDEXE= @BUILDEXEEXT@
|
||||
BUILDPYTHON= $(builddir)/python$(BUILDEXE)
|
||||
PYTHONFRAMEWORK=@PYTHONFRAMEWORK@
|
||||
|
||||
# Deployment target selected during configure, to be checked
|
||||
# by distutils
|
||||
MACOSX_DEPLOYMENT_TARGET=@CONFIGURE_MACOSX_DEPLOYMENT_TARGET@
|
||||
@EXPORT_MACOSX_DEPLOYMENT_TARGET@export MACOSX_DEPLOYMENT_TARGET
|
||||
|
||||
PYTHONAPPSDIR=@FRAMEWORKINSTALLAPPSPREFIX@/$(PYTHONFRAMEWORK) $(VERSION)
|
||||
OBJECTS=FileSettings.o MyAppDelegate.o MyDocument.o PreferencesWindowController.o doscript.o main.o
|
||||
|
||||
install: Python\ Launcher.app
|
||||
test -d "$(DESTDIR)$(PYTHONAPPSDIR)" || mkdir -p "$(DESTDIR)$(PYTHONAPPSDIR)"
|
||||
-test -d "$(DESTDIR)$(PYTHONAPPSDIR)/Python Launcher.app" && rm -r "$(DESTDIR)$(PYTHONAPPSDIR)/Python Launcher.app"
|
||||
/bin/cp -r "Python Launcher.app" "$(DESTDIR)$(PYTHONAPPSDIR)"
|
||||
touch "$(DESTDIR)$(PYTHONAPPSDIR)/Python Launcher.app"
|
||||
chmod -R ugo+rX,go-w "$(DESTDIR)$(PYTHONAPPSDIR)/Python Launcher.app"
|
||||
chmod ugo+x "$(DESTDIR)$(PYTHONAPPSDIR)/Python Launcher.app/Contents/MacOS/Python Launcher"
|
||||
|
||||
clean:
|
||||
rm -f *.o "Python Launcher"
|
||||
rm -rf "Python Launcher.app"
|
||||
rm -f Info.plist
|
||||
|
||||
Python\ Launcher.app: Info.plist \
|
||||
Python\ Launcher $(srcdir)/../Icons/PythonLauncher.icns \
|
||||
$(srcdir)/../Icons/PythonSource.icns \
|
||||
$(srcdir)/../Icons/PythonCompiled.icns \
|
||||
$(srcdir)/factorySettings.plist
|
||||
rm -fr "Python Launcher.app"
|
||||
mkdir "Python Launcher.app"
|
||||
mkdir "Python Launcher.app/Contents"
|
||||
mkdir "Python Launcher.app/Contents/MacOS"
|
||||
mkdir "Python Launcher.app/Contents/Resources"
|
||||
cp "Python Launcher" "Python Launcher.app/Contents/MacOS"
|
||||
cp Info.plist "Python Launcher.app/Contents"
|
||||
cp $(srcdir)/../Icons/PythonLauncher.icns "Python Launcher.app/Contents/Resources"
|
||||
cp $(srcdir)/../Icons/PythonSource.icns "Python Launcher.app/Contents/Resources"
|
||||
cp $(srcdir)/../Icons/PythonCompiled.icns "Python Launcher.app/Contents/Resources"
|
||||
cp $(srcdir)/factorySettings.plist "Python Launcher.app/Contents/Resources"
|
||||
cp -R $(srcdir)/English.lproj "Python Launcher.app/Contents/Resources"
|
||||
|
||||
FileSettings.o: $(srcdir)/FileSettings.m
|
||||
$(CC) $(CFLAGS) -o $@ -c $(srcdir)/FileSettings.m
|
||||
|
||||
MyAppDelegate.o: $(srcdir)/MyAppDelegate.m
|
||||
$(CC) $(CFLAGS) -o $@ -c $(srcdir)/MyAppDelegate.m
|
||||
|
||||
MyDocument.o: $(srcdir)/MyDocument.m
|
||||
$(CC) $(CFLAGS) -o $@ -c $(srcdir)/MyDocument.m
|
||||
|
||||
PreferencesWindowController.o: $(srcdir)/PreferencesWindowController.m
|
||||
$(CC) $(CFLAGS) -o $@ -c $(srcdir)/PreferencesWindowController.m
|
||||
|
||||
doscript.o: $(srcdir)/doscript.m
|
||||
$(CC) $(CFLAGS) -o $@ -c $(srcdir)/doscript.m
|
||||
|
||||
main.o: $(srcdir)/main.m
|
||||
$(CC) $(CFLAGS) -o $@ -c $(srcdir)/main.m
|
||||
|
||||
Python\ Launcher: $(OBJECTS)
|
||||
$(CC) $(LDFLAGS) -o "Python Launcher" $(OBJECTS) -framework AppKit -framework Carbon
|
||||
|
||||
Info.plist: $(srcdir)/Info.plist.in
|
||||
sed 's/%VERSION%/'"`$(RUNSHARED) $(BUILDPYTHON) -c 'import platform; print(platform.python_version())'`"'/g' < $(srcdir)/Info.plist.in > Info.plist
|
||||
3390
Makefile.pre.in
3390
Makefile.pre.in
File diff suppressed because it is too large
Load Diff
170
README.rst
170
README.rst
@@ -48,88 +48,51 @@ Installable Typthon kits, and information about using Typthon, are available at
|
||||
Build Instructions
|
||||
------------------
|
||||
|
||||
On Unix, Linux, BSD, macOS, and Cygwin::
|
||||
Typthon uses CMake as its build system. On Unix, Linux, BSD, macOS, and Windows::
|
||||
|
||||
./configure
|
||||
make
|
||||
make test
|
||||
sudo make install
|
||||
mkdir build
|
||||
cd build
|
||||
cmake .. -DCMAKE_BUILD_TYPE=Release
|
||||
cmake --build .
|
||||
ctest --output-on-failure
|
||||
sudo cmake --install .
|
||||
|
||||
This will install Typthon as ``typthon3``.
|
||||
This will install Typthon as ``typthon``.
|
||||
|
||||
You can pass many options to the configure script; run ``./configure --help``
|
||||
to find out more. On macOS case-insensitive file systems and on Cygwin,
|
||||
the executable is called ``typthon.exe``; elsewhere it's just ``typthon``.
|
||||
You can pass many options to CMake; run ``cmake --help`` or see the
|
||||
`CMake documentation <https://cmake.org/cmake/help/latest/>`_ to find out more.
|
||||
|
||||
Building a complete Typthon installation requires the use of various
|
||||
additional third-party libraries, depending on your build platform and
|
||||
configure options. Not all standard library modules are buildable or
|
||||
usable on all platforms. Refer to the
|
||||
`Install dependencies <https://devguide.python.org/getting-started/setup-building.html#build-dependencies>`_
|
||||
section of the `Developer Guide`_ for current detailed information on
|
||||
dependencies for various Linux distributions and macOS.
|
||||
Building with different build types
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
On macOS, there are additional configure and build options related
|
||||
to macOS framework and universal builds. Refer to `Mac/README.rst
|
||||
<https://github.com/python/cpython/blob/main/Mac/README.rst>`_.
|
||||
CMake supports several build types through the ``CMAKE_BUILD_TYPE`` option:
|
||||
|
||||
On Windows, see `PCbuild/readme.txt
|
||||
<https://github.com/python/cpython/blob/main/PCbuild/readme.txt>`_.
|
||||
- ``Release`` - Optimized build for production use
|
||||
- ``Debug`` - Build with debug symbols for debugging
|
||||
- ``RelWithDebInfo`` - Release build with debug information
|
||||
- ``MinSizeRel`` - Optimized for size
|
||||
|
||||
To build Windows installer, see `Tools/msi/README.txt
|
||||
<https://github.com/python/cpython/blob/main/Tools/msi/README.txt>`_.
|
||||
Example::
|
||||
|
||||
If you wish, you can create a subdirectory and invoke configure from there.
|
||||
For example::
|
||||
cmake .. -DCMAKE_BUILD_TYPE=Debug
|
||||
cmake --build .
|
||||
|
||||
mkdir debug
|
||||
cd debug
|
||||
../configure --with-pydebug
|
||||
make
|
||||
make test
|
||||
Out-of-source builds
|
||||
^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
(This will fail if you *also* built at the top-level directory. You should do
|
||||
a ``make clean`` at the top-level first.)
|
||||
CMake encourages out-of-source builds. You can create multiple build directories
|
||||
for different configurations::
|
||||
|
||||
To get an optimized build of Typthon, ``configure --enable-optimizations``
|
||||
before you run ``make``. This sets the default make targets up to enable
|
||||
Profile Guided Optimization (PGO) and may be used to auto-enable Link Time
|
||||
Optimization (LTO) on some platforms. For more details, see the sections
|
||||
below.
|
||||
|
||||
Profile Guided Optimization
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
PGO takes advantage of recent versions of the GCC or Clang compilers. If used,
|
||||
either via ``configure --enable-optimizations`` or by manually running
|
||||
``make profile-opt`` regardless of configure flags, the optimized build
|
||||
process will perform the following steps:
|
||||
|
||||
The entire Typthon directory is cleaned of temporary files that may have
|
||||
resulted from a previous compilation.
|
||||
|
||||
An instrumented version of the interpreter is built, using suitable compiler
|
||||
flags for each flavor. Note that this is just an intermediary step. The
|
||||
binary resulting from this step is not good for real-life workloads as it has
|
||||
profiling instructions embedded inside.
|
||||
|
||||
After the instrumented interpreter is built, the Makefile will run a training
|
||||
workload. This is necessary in order to profile the interpreter's execution.
|
||||
Note also that any output, both stdout and stderr, that may appear at this step
|
||||
is suppressed.
|
||||
|
||||
The final step is to build the actual interpreter, using the information
|
||||
collected from the instrumented one. The end result will be a Typthon binary
|
||||
that is optimized; suitable for distribution or production installation.
|
||||
|
||||
|
||||
Link Time Optimization
|
||||
^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Enabled via configure's ``--with-lto`` flag. LTO takes advantage of the
|
||||
ability of recent compiler toolchains to optimize across the otherwise
|
||||
arbitrary ``.o`` file boundary when building final executables or shared
|
||||
libraries for additional performance gains.
|
||||
mkdir build-release
|
||||
cd build-release
|
||||
cmake .. -DCMAKE_BUILD_TYPE=Release
|
||||
cmake --build .
|
||||
|
||||
cd ..
|
||||
mkdir build-debug
|
||||
cd build-debug
|
||||
cmake .. -DCMAKE_BUILD_TYPE=Debug
|
||||
cmake --build .
|
||||
|
||||
|
||||
What's New
|
||||
@@ -149,60 +112,53 @@ entitled "Installing multiple versions".
|
||||
Documentation
|
||||
-------------
|
||||
|
||||
`Documentation for Typthon 3.14 <https://docs.python.org/3.14/>`_ is online,
|
||||
updated daily.
|
||||
Typthon is a lightweight runtime system. For usage information, run::
|
||||
|
||||
It can also be downloaded in many formats for faster access. The documentation
|
||||
is downloadable in HTML, PDF, and reStructuredText formats; the latter version
|
||||
is primarily for documentation authors, translators, and people with special
|
||||
formatting requirements.
|
||||
typthon --help
|
||||
|
||||
For information about building Typthon's documentation, refer to `Doc/README.rst
|
||||
<https://github.com/python/cpython/blob/main/Doc/README.rst>`_.
|
||||
To see the version::
|
||||
|
||||
typthon --version
|
||||
|
||||
|
||||
Testing
|
||||
-------
|
||||
|
||||
To test the interpreter, type ``make test`` in the top-level directory. The
|
||||
test set produces some output. You can generally ignore the messages about
|
||||
skipped tests due to optional features which can't be imported. If a message
|
||||
is printed about a failed test or a traceback or core dump is produced,
|
||||
something is wrong.
|
||||
To test Typthon, run ``ctest`` in the build directory::
|
||||
|
||||
By default, tests are prevented from overusing resources like disk space and
|
||||
memory. To enable these tests, run ``make buildbottest``.
|
||||
cd build
|
||||
ctest --output-on-failure
|
||||
|
||||
If any tests fail, you can re-run the failing test(s) in verbose mode. For
|
||||
example, if ``test_os`` and ``test_gdb`` failed, you can run::
|
||||
The test suite will produce output for any failing tests. If a test fails
|
||||
or produces unexpected output, something is wrong.
|
||||
|
||||
make test TESTOPTS="-v test_os test_gdb"
|
||||
To run tests with more verbose output::
|
||||
|
||||
ctest --output-on-failure --verbose
|
||||
|
||||
To run specific tests, use the ``-R`` option with a regex pattern::
|
||||
|
||||
ctest -R typthon_runtime
|
||||
|
||||
If the failure persists and appears to be a problem with Typthon rather than
|
||||
your environment, you can `file a bug report
|
||||
<https://github.com/python/cpython/issues>`_ and include relevant output from
|
||||
that command to show the issue.
|
||||
|
||||
See `Running & Writing Tests <https://devguide.python.org/testing/run-write-tests.html>`_
|
||||
for more on running tests.
|
||||
<https://github.com/johndoe6345789/typthon/issues>`_ and include relevant
|
||||
output from the test command to show the issue.
|
||||
|
||||
Installing multiple versions
|
||||
----------------------------
|
||||
|
||||
On Unix and Mac systems if you intend to install multiple versions of Typthon
|
||||
using the same installation prefix (``--prefix`` argument to the configure
|
||||
script) you must take care that your primary Typthon executable is not
|
||||
overwritten by the installation of a different version. All files and
|
||||
directories installed using ``make altinstall`` contain the major and minor
|
||||
version and can thus live side-by-side. ``make install`` also creates
|
||||
``${prefix}/bin/typthon3`` which refers to ``${prefix}/bin/typthon3.X``. If you
|
||||
intend to install multiple versions using the same prefix you must decide which
|
||||
version (if any) is your "primary" version. Install that version using
|
||||
``make install``. Install all other versions using ``make altinstall``.
|
||||
If you want to install multiple versions of Typthon, you can use different
|
||||
installation prefixes with CMake's ``CMAKE_INSTALL_PREFIX`` option::
|
||||
|
||||
For example, if you want to install Typthon 2.7, 3.6, and 3.14 with 3.14 being the
|
||||
primary version, you would execute ``make install`` in your 3.14 build directory
|
||||
and ``make altinstall`` in the others.
|
||||
mkdir build-3.14
|
||||
cd build-3.14
|
||||
cmake .. -DCMAKE_INSTALL_PREFIX=/opt/typthon-3.14
|
||||
cmake --build .
|
||||
sudo cmake --install .
|
||||
|
||||
This allows you to have multiple versions installed side-by-side in different
|
||||
directories.
|
||||
|
||||
|
||||
Release Schedule
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
# Makefile to test freeze
|
||||
# set PYTHON to path of Python interpreter to test
|
||||
PYTHON=python
|
||||
# set OUTDIR to the temp directory for freeze
|
||||
OUTDIR=outdir
|
||||
|
||||
test:
|
||||
$(PYTHON) ../freeze.py -o $(OUTDIR) ok.py
|
||||
make -C $(OUTDIR)
|
||||
$(OUTDIR)/ok
|
||||
|
||||
@@ -1,49 +0,0 @@
|
||||
UNAME_S := $(shell uname -s)
|
||||
ifeq ($(UNAME_S),Linux)
|
||||
PYTHON ?= ../../python
|
||||
endif
|
||||
ifeq ($(UNAME_S),Darwin)
|
||||
PYTHON ?= ../../python.exe
|
||||
endif
|
||||
VENVDIR ?= ./venv
|
||||
VENVPYTHON ?= $(VENVDIR)/bin/python
|
||||
CPYTHON ?= ../../Lib
|
||||
MYPY ?= ./venv/bin/mypy
|
||||
BLACK ?= ./venv/bin/black
|
||||
|
||||
GRAMMAR = ../../Grammar/python.gram
|
||||
TOKENS = ../../Grammar/Tokens
|
||||
|
||||
build: peg_extension/parse.c
|
||||
|
||||
peg_extension/parse.c: $(GRAMMAR) $(TOKENS) pegen/*.py peg_extension/peg_extension.c ../../Parser/pegen.c ../../Parser/pegen_errors.c ../../Parser/string_parser.c ../../Parser/action_helpers.c ../../Parser/*.h pegen/grammar_parser.py
|
||||
$(VENVPYTHON) -m pegen -q c $(GRAMMAR) $(TOKENS) -o peg_extension/parse.c --compile-extension
|
||||
|
||||
clean:
|
||||
-rm -f peg_extension/*.o peg_extension/*.so peg_extension/parse.c
|
||||
-rm -rf $(VENVDIR)
|
||||
|
||||
regen-metaparser: pegen/metagrammar.gram pegen/*.py
|
||||
$(VENVPYTHON) -m pegen -q python pegen/metagrammar.gram -o pegen/grammar_parser.py
|
||||
|
||||
# Note: These targets really depend on the generated shared object in peg_extension/parse.*.so but
|
||||
# this has different names in different systems so we are abusing the implicit dependency on
|
||||
# parse.c by the use of --compile-extension.
|
||||
|
||||
venv:
|
||||
$(PYTHON) -m venv $(VENVDIR)
|
||||
$(VENVPYTHON) -m pip install -U pip setuptools black mypy
|
||||
@echo "The venv has been created in the $(VENVDIR) directory"
|
||||
|
||||
mypy: regen-metaparser
|
||||
$(MYPY) # For list of files, see mypy.ini
|
||||
|
||||
format-python:
|
||||
$(BLACK) pegen
|
||||
|
||||
format: venv format-python
|
||||
|
||||
tags: TAGS
|
||||
|
||||
TAGS: pegen/*.py test/test_pegen.py
|
||||
etags pegen/*.py test/test_pegen.py
|
||||
@@ -1,7 +1,7 @@
|
||||
# Requirements file for external linters and checks we run on
|
||||
# Tools/clinic, Tools/cases_generator/, and Tools/peg_generator/ in CI
|
||||
mypy==1.16.1
|
||||
mypy==1.19.1
|
||||
|
||||
# needed for peg_generator:
|
||||
types-psutil==7.0.0.20250601
|
||||
types-setuptools==80.9.0.20251223
|
||||
types-psutil==7.1.3.20251211
|
||||
|
||||
@@ -1,84 +0,0 @@
|
||||
#
|
||||
# Recreate the Python charmap codecs from the Unicode mapping
|
||||
# files available at ftp://ftp.unicode.org/
|
||||
#
|
||||
#(c) Copyright Marc-Andre Lemburg, 2005.
|
||||
# Licensed to PSF under a Contributor Agreement.
|
||||
|
||||
# Python binary to use
|
||||
PYTHON = python
|
||||
|
||||
# Remove tool to use
|
||||
RM = /bin/rm
|
||||
|
||||
### Generic targets
|
||||
|
||||
all: distclean mappings codecs
|
||||
|
||||
codecs: misc windows iso apple ebcdic custom-mappings cjk
|
||||
|
||||
### Mappings
|
||||
|
||||
mappings:
|
||||
ncftpget -R ftp.unicode.org . Public/MAPPINGS
|
||||
|
||||
### Codecs
|
||||
|
||||
build/:
|
||||
mkdir build
|
||||
|
||||
misc: build/
|
||||
$(PYTHON) gencodec.py MAPPINGS/VENDORS/MISC/ build/
|
||||
$(RM) build/atarist.*
|
||||
$(RM) build/us_ascii_quotes.*
|
||||
$(RM) build/ibmgraph.*
|
||||
$(RM) build/sgml.*
|
||||
$(RM) -f build/readme.*
|
||||
|
||||
custom-mappings: build/
|
||||
$(PYTHON) gencodec.py python-mappings/ build/
|
||||
|
||||
windows: build/
|
||||
$(PYTHON) gencodec.py MAPPINGS/VENDORS/MICSFT/WINDOWS/ build/
|
||||
$(RM) build/cp9*
|
||||
$(RM) -f build/readme.*
|
||||
|
||||
iso: build/
|
||||
$(PYTHON) gencodec.py MAPPINGS/ISO8859/ build/ iso
|
||||
$(RM) -f build/isoreadme.*
|
||||
|
||||
apple: build/
|
||||
$(PYTHON) gencodec.py MAPPINGS/VENDORS/APPLE/ build/ mac_
|
||||
$(RM) build/mac_dingbats.*
|
||||
$(RM) build/mac_japanese.*
|
||||
$(RM) build/mac_chin*
|
||||
$(RM) build/mac_korean.*
|
||||
$(RM) build/mac_symbol.*
|
||||
$(RM) build/mac_corpchar.*
|
||||
$(RM) build/mac_devanaga.*
|
||||
$(RM) build/mac_gaelic.*
|
||||
$(RM) build/mac_gurmukhi.*
|
||||
$(RM) build/mac_hebrew.*
|
||||
$(RM) build/mac_inuit.*
|
||||
$(RM) build/mac_thai.*
|
||||
$(RM) build/mac_ukraine.*
|
||||
$(RM) build/mac_arabic.py
|
||||
$(RM) build/mac_celtic.*
|
||||
$(RM) build/mac_gujarati.*
|
||||
$(RM) build/mac_keyboard.*
|
||||
$(RM) -f build/mac_readme.*
|
||||
|
||||
ebcdic: build/
|
||||
$(PYTHON) gencodec.py MAPPINGS/VENDORS/MICSFT/EBCDIC/ build/
|
||||
$(RM) -f build/readme.*
|
||||
|
||||
cjk: build/
|
||||
$(PYTHON) gencjkcodecs.py build/
|
||||
|
||||
### Cleanup
|
||||
|
||||
clean:
|
||||
$(RM) -f build/*
|
||||
|
||||
distclean: clean
|
||||
$(RM) -rf MAPPINGS/
|
||||
794
aclocal.m4
generated
vendored
794
aclocal.m4
generated
vendored
@@ -1,794 +0,0 @@
|
||||
# generated automatically by aclocal 1.16.5 -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 1996-2021 Free Software Foundation, Inc.
|
||||
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
|
||||
# ===============================================================================
|
||||
# https://www.gnu.org/software/autoconf-archive/ax_c_float_words_bigendian.html
|
||||
# ===============================================================================
|
||||
#
|
||||
# SYNOPSIS
|
||||
#
|
||||
# AX_C_FLOAT_WORDS_BIGENDIAN([ACTION-IF-TRUE], [ACTION-IF-FALSE], [ACTION-IF-UNKNOWN])
|
||||
#
|
||||
# DESCRIPTION
|
||||
#
|
||||
# Checks the ordering of words within a multi-word float. This check is
|
||||
# necessary because on some systems (e.g. certain ARM systems), the float
|
||||
# word ordering can be different from the byte ordering. In a multi-word
|
||||
# float context, "big-endian" implies that the word containing the sign
|
||||
# bit is found in the memory location with the lowest address. This
|
||||
# implementation was inspired by the AC_C_BIGENDIAN macro in autoconf.
|
||||
#
|
||||
# The endianness is detected by first compiling C code that contains a
|
||||
# special double float value, then grepping the resulting object file for
|
||||
# certain strings of ASCII values. The double is specially crafted to have
|
||||
# a binary representation that corresponds with a simple string. In this
|
||||
# implementation, the string "noonsees" was selected because the
|
||||
# individual word values ("noon" and "sees") are palindromes, thus making
|
||||
# this test byte-order agnostic. If grep finds the string "noonsees" in
|
||||
# the object file, the target platform stores float words in big-endian
|
||||
# order. If grep finds "seesnoon", float words are in little-endian order.
|
||||
# If neither value is found, the user is instructed to specify the
|
||||
# ordering.
|
||||
#
|
||||
# Early versions of this macro (i.e., before serial 12) would not work
|
||||
# when interprocedural optimization (via link-time optimization) was
|
||||
# enabled. This would happen when, say, the GCC/clang "-flto" flag, or the
|
||||
# ICC "-ipo" flag was used, for example. The problem was that under
|
||||
# these conditions, the compiler did not allocate for and write the special
|
||||
# float value in the data segment of the object file, since doing so might
|
||||
# not prove optimal once more context was available. Thus, the special value
|
||||
# (in platform-dependent binary form) could not be found in the object file,
|
||||
# and the macro would fail.
|
||||
#
|
||||
# The solution to the above problem was to:
|
||||
#
|
||||
# 1) Compile and link a whole test program rather than just compile an
|
||||
# object file. This ensures that we reach the point where even an
|
||||
# interprocedural optimizing compiler writes values to the data segment.
|
||||
#
|
||||
# 2) Add code that requires the compiler to write the special value to
|
||||
# the data segment, as opposed to "optimizing away" the variable's
|
||||
# allocation. This could be done via compiler keywords or options, but
|
||||
# it's tricky to make this work for all versions of all compilers with
|
||||
# all optimization settings. The chosen solution was to make the exit
|
||||
# code of the test program depend on the storing of the special value
|
||||
# in memory (in the data segment). Because the exit code can be
|
||||
# verified, any compiler that aspires to be correct will produce a
|
||||
# program binary that contains the value, which the macro can then find.
|
||||
#
|
||||
# How does the exit code depend on the special value residing in memory?
|
||||
# Memory, unlike variables and registers, can be addressed indirectly at run
|
||||
# time. The exit code of this test program is a result of indirectly reading
|
||||
# and writing to the memory region where the special value is supposed to
|
||||
# reside. The actual memory addresses used and the values to be written are
|
||||
# derived from the the program input ("argv") and are therefore not known at
|
||||
# compile or link time. The compiler has no choice but to defer the
|
||||
# computation to run time, and to prepare by allocating and populating the
|
||||
# data segment with the special value. For further details, refer to the
|
||||
# source code of the test program.
|
||||
#
|
||||
# Note that the test program is never meant to be run. It only exists to host
|
||||
# a double float value in a given platform's binary format. Thus, error
|
||||
# handling is not included.
|
||||
#
|
||||
# LICENSE
|
||||
#
|
||||
# Copyright (c) 2008, 2023 Daniel Amelang <dan@amelang.net>
|
||||
#
|
||||
# Copying and distribution of this file, with or without modification, are
|
||||
# permitted in any medium without royalty provided the copyright notice
|
||||
# and this notice are preserved. This file is offered as-is, without any
|
||||
# warranty.
|
||||
|
||||
#serial 14
|
||||
|
||||
AC_DEFUN([AX_C_FLOAT_WORDS_BIGENDIAN],
|
||||
[AC_CACHE_CHECK(whether float word ordering is bigendian,
|
||||
ax_cv_c_float_words_bigendian, [
|
||||
|
||||
ax_cv_c_float_words_bigendian=unknown
|
||||
AC_LINK_IFELSE([AC_LANG_SOURCE([[
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
static double m[] = {9.090423496703681e+223, 0.0};
|
||||
|
||||
int main (int argc, char *argv[])
|
||||
{
|
||||
m[atoi (argv[1])] += atof (argv[2]);
|
||||
return m[atoi (argv[3])] > 0.0;
|
||||
}
|
||||
|
||||
]])], [
|
||||
|
||||
if grep noonsees conftest* > /dev/null ; then
|
||||
ax_cv_c_float_words_bigendian=yes
|
||||
fi
|
||||
if grep seesnoon conftest* >/dev/null ; then
|
||||
if test "$ax_cv_c_float_words_bigendian" = unknown; then
|
||||
ax_cv_c_float_words_bigendian=no
|
||||
else
|
||||
ax_cv_c_float_words_bigendian=unknown
|
||||
fi
|
||||
fi
|
||||
|
||||
])])
|
||||
|
||||
case $ax_cv_c_float_words_bigendian in
|
||||
yes)
|
||||
m4_default([$1],
|
||||
[AC_DEFINE([FLOAT_WORDS_BIGENDIAN], 1,
|
||||
[Define to 1 if your system stores words within floats
|
||||
with the most significant word first])]) ;;
|
||||
no)
|
||||
$2 ;;
|
||||
*)
|
||||
m4_default([$3],
|
||||
[AC_MSG_ERROR([
|
||||
|
||||
Unknown float word ordering. You need to manually preset
|
||||
ax_cv_c_float_words_bigendian=no (or yes) according to your system.
|
||||
|
||||
])]) ;;
|
||||
esac
|
||||
|
||||
])# AX_C_FLOAT_WORDS_BIGENDIAN
|
||||
|
||||
# ===========================================================================
|
||||
# https://www.gnu.org/software/autoconf-archive/ax_check_compile_flag.html
|
||||
# ===========================================================================
|
||||
#
|
||||
# SYNOPSIS
|
||||
#
|
||||
# AX_CHECK_COMPILE_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS], [INPUT])
|
||||
#
|
||||
# DESCRIPTION
|
||||
#
|
||||
# Check whether the given FLAG works with the current language's compiler
|
||||
# or gives an error. (Warnings, however, are ignored)
|
||||
#
|
||||
# ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
|
||||
# success/failure.
|
||||
#
|
||||
# If EXTRA-FLAGS is defined, it is added to the current language's default
|
||||
# flags (e.g. CFLAGS) when the check is done. The check is thus made with
|
||||
# the flags: "CFLAGS EXTRA-FLAGS FLAG". This can for example be used to
|
||||
# force the compiler to issue an error when a bad flag is given.
|
||||
#
|
||||
# INPUT gives an alternative input source to AC_COMPILE_IFELSE.
|
||||
#
|
||||
# NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this
|
||||
# macro in sync with AX_CHECK_{PREPROC,LINK}_FLAG.
|
||||
#
|
||||
# LICENSE
|
||||
#
|
||||
# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
|
||||
# Copyright (c) 2011 Maarten Bosmans <mkbosmans@gmail.com>
|
||||
#
|
||||
# Copying and distribution of this file, with or without modification, are
|
||||
# permitted in any medium without royalty provided the copyright notice
|
||||
# and this notice are preserved. This file is offered as-is, without any
|
||||
# warranty.
|
||||
|
||||
#serial 6
|
||||
|
||||
AC_DEFUN([AX_CHECK_COMPILE_FLAG],
|
||||
[AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_IF
|
||||
AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]flags_$4_$1])dnl
|
||||
AC_CACHE_CHECK([whether _AC_LANG compiler accepts $1], CACHEVAR, [
|
||||
ax_check_save_flags=$[]_AC_LANG_PREFIX[]FLAGS
|
||||
_AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $4 $1"
|
||||
AC_COMPILE_IFELSE([m4_default([$5],[AC_LANG_PROGRAM()])],
|
||||
[AS_VAR_SET(CACHEVAR,[yes])],
|
||||
[AS_VAR_SET(CACHEVAR,[no])])
|
||||
_AC_LANG_PREFIX[]FLAGS=$ax_check_save_flags])
|
||||
AS_VAR_IF(CACHEVAR,yes,
|
||||
[m4_default([$2], :)],
|
||||
[m4_default([$3], :)])
|
||||
AS_VAR_POPDEF([CACHEVAR])dnl
|
||||
])dnl AX_CHECK_COMPILE_FLAGS
|
||||
|
||||
# ===========================================================================
|
||||
# https://www.gnu.org/software/autoconf-archive/ax_check_define.html
|
||||
# ===========================================================================
|
||||
#
|
||||
# SYNOPSIS
|
||||
#
|
||||
# AC_CHECK_DEFINE([symbol], [ACTION-IF-FOUND], [ACTION-IF-NOT])
|
||||
# AX_CHECK_DEFINE([includes],[symbol], [ACTION-IF-FOUND], [ACTION-IF-NOT])
|
||||
#
|
||||
# DESCRIPTION
|
||||
#
|
||||
# Complements AC_CHECK_FUNC but it does not check for a function but for a
|
||||
# define to exist. Consider a usage like:
|
||||
#
|
||||
# AC_CHECK_DEFINE(__STRICT_ANSI__, CFLAGS="$CFLAGS -D_XOPEN_SOURCE=500")
|
||||
#
|
||||
# LICENSE
|
||||
#
|
||||
# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
|
||||
#
|
||||
# Copying and distribution of this file, with or without modification, are
|
||||
# permitted in any medium without royalty provided the copyright notice
|
||||
# and this notice are preserved. This file is offered as-is, without any
|
||||
# warranty.
|
||||
|
||||
#serial 11
|
||||
|
||||
AU_ALIAS([AC_CHECK_DEFINED], [AC_CHECK_DEFINE])
|
||||
AC_DEFUN([AC_CHECK_DEFINE],[
|
||||
AS_VAR_PUSHDEF([ac_var],[ac_cv_defined_$1])dnl
|
||||
AC_CACHE_CHECK([for $1 defined], ac_var,
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
|
||||
#ifdef $1
|
||||
int ok;
|
||||
(void)ok;
|
||||
#else
|
||||
choke me
|
||||
#endif
|
||||
]])],[AS_VAR_SET(ac_var, yes)],[AS_VAR_SET(ac_var, no)]))
|
||||
AS_IF([test AS_VAR_GET(ac_var) != "no"], [$2], [$3])dnl
|
||||
AS_VAR_POPDEF([ac_var])dnl
|
||||
])
|
||||
|
||||
AU_ALIAS([AX_CHECK_DEFINED], [AX_CHECK_DEFINE])
|
||||
AC_DEFUN([AX_CHECK_DEFINE],[
|
||||
AS_VAR_PUSHDEF([ac_var],[ac_cv_defined_$2_$1])dnl
|
||||
AC_CACHE_CHECK([for $2 defined in $1], ac_var,
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <$1>]], [[
|
||||
#ifdef $2
|
||||
int ok;
|
||||
(void)ok;
|
||||
#else
|
||||
choke me
|
||||
#endif
|
||||
]])],[AS_VAR_SET(ac_var, yes)],[AS_VAR_SET(ac_var, no)]))
|
||||
AS_IF([test AS_VAR_GET(ac_var) != "no"], [$3], [$4])dnl
|
||||
AS_VAR_POPDEF([ac_var])dnl
|
||||
])
|
||||
|
||||
AC_DEFUN([AX_CHECK_FUNC],
|
||||
[AS_VAR_PUSHDEF([ac_var], [ac_cv_func_$2])dnl
|
||||
AC_CACHE_CHECK([for $2], ac_var,
|
||||
dnl AC_LANG_FUNC_LINK_TRY
|
||||
[AC_LINK_IFELSE([AC_LANG_PROGRAM([$1
|
||||
#undef $2
|
||||
char $2 ();],[
|
||||
char (*f) () = $2;
|
||||
return f != $2; ])],
|
||||
[AS_VAR_SET(ac_var, yes)],
|
||||
[AS_VAR_SET(ac_var, no)])])
|
||||
AS_IF([test AS_VAR_GET(ac_var) = yes], [$3], [$4])dnl
|
||||
AS_VAR_POPDEF([ac_var])dnl
|
||||
])# AC_CHECK_FUNC
|
||||
|
||||
# ===========================================================================
|
||||
# https://www.gnu.org/software/autoconf-archive/ax_check_openssl.html
|
||||
# ===========================================================================
|
||||
#
|
||||
# SYNOPSIS
|
||||
#
|
||||
# AX_CHECK_OPENSSL([action-if-found[, action-if-not-found]])
|
||||
#
|
||||
# DESCRIPTION
|
||||
#
|
||||
# Look for OpenSSL in a number of default spots, or in a user-selected
|
||||
# spot (via --with-openssl). Sets
|
||||
#
|
||||
# OPENSSL_INCLUDES to the include directives required
|
||||
# OPENSSL_LIBS to the -l directives required
|
||||
# OPENSSL_LDFLAGS to the -L or -R flags required
|
||||
#
|
||||
# and calls ACTION-IF-FOUND or ACTION-IF-NOT-FOUND appropriately
|
||||
#
|
||||
# This macro sets OPENSSL_INCLUDES such that source files should use the
|
||||
# openssl/ directory in include directives:
|
||||
#
|
||||
# #include <openssl/hmac.h>
|
||||
#
|
||||
# LICENSE
|
||||
#
|
||||
# Copyright (c) 2009,2010 Zmanda Inc. <http://www.zmanda.com/>
|
||||
# Copyright (c) 2009,2010 Dustin J. Mitchell <dustin@zmanda.com>
|
||||
#
|
||||
# Copying and distribution of this file, with or without modification, are
|
||||
# permitted in any medium without royalty provided the copyright notice
|
||||
# and this notice are preserved. This file is offered as-is, without any
|
||||
# warranty.
|
||||
|
||||
#serial 11
|
||||
|
||||
AU_ALIAS([CHECK_SSL], [AX_CHECK_OPENSSL])
|
||||
AC_DEFUN([AX_CHECK_OPENSSL], [
|
||||
found=false
|
||||
AC_ARG_WITH([openssl],
|
||||
[AS_HELP_STRING([--with-openssl=DIR],
|
||||
[root of the OpenSSL directory])],
|
||||
[
|
||||
case "$withval" in
|
||||
"" | y | ye | yes | n | no)
|
||||
AC_MSG_ERROR([Invalid --with-openssl value])
|
||||
;;
|
||||
*) ssldirs="$withval"
|
||||
;;
|
||||
esac
|
||||
], [
|
||||
# if pkg-config is installed and openssl has installed a .pc file,
|
||||
# then use that information and don't search ssldirs
|
||||
AC_CHECK_TOOL([PKG_CONFIG], [pkg-config])
|
||||
if test x"$PKG_CONFIG" != x""; then
|
||||
OPENSSL_LDFLAGS=`$PKG_CONFIG openssl --libs-only-L 2>/dev/null`
|
||||
if test $? = 0; then
|
||||
OPENSSL_LIBS=`$PKG_CONFIG openssl --libs-only-l 2>/dev/null`
|
||||
OPENSSL_INCLUDES=`$PKG_CONFIG openssl --cflags-only-I 2>/dev/null`
|
||||
found=true
|
||||
fi
|
||||
fi
|
||||
|
||||
# no such luck; use some default ssldirs
|
||||
if ! $found; then
|
||||
ssldirs="/usr/local/ssl /usr/lib/ssl /usr/ssl /usr/pkg /usr/local /usr"
|
||||
fi
|
||||
]
|
||||
)
|
||||
|
||||
|
||||
# note that we #include <openssl/foo.h>, so the OpenSSL headers have to be in
|
||||
# an 'openssl' subdirectory
|
||||
|
||||
if ! $found; then
|
||||
OPENSSL_INCLUDES=
|
||||
for ssldir in $ssldirs; do
|
||||
AC_MSG_CHECKING([for include/openssl/ssl.h in $ssldir])
|
||||
if test -f "$ssldir/include/openssl/ssl.h"; then
|
||||
OPENSSL_INCLUDES="-I$ssldir/include"
|
||||
OPENSSL_LDFLAGS="-L$ssldir/lib"
|
||||
OPENSSL_LIBS="-lssl -lcrypto"
|
||||
found=true
|
||||
AC_MSG_RESULT([yes])
|
||||
break
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
fi
|
||||
done
|
||||
|
||||
# if the file wasn't found, well, go ahead and try the link anyway -- maybe
|
||||
# it will just work!
|
||||
fi
|
||||
|
||||
# try the preprocessor and linker with our new flags,
|
||||
# being careful not to pollute the global LIBS, LDFLAGS, and CPPFLAGS
|
||||
|
||||
AC_MSG_CHECKING([whether compiling and linking against OpenSSL works])
|
||||
echo "Trying link with OPENSSL_LDFLAGS=$OPENSSL_LDFLAGS;" \
|
||||
"OPENSSL_LIBS=$OPENSSL_LIBS; OPENSSL_INCLUDES=$OPENSSL_INCLUDES" >&AS_MESSAGE_LOG_FD
|
||||
|
||||
save_LIBS="$LIBS"
|
||||
save_LDFLAGS="$LDFLAGS"
|
||||
save_CPPFLAGS="$CPPFLAGS"
|
||||
LDFLAGS="$LDFLAGS $OPENSSL_LDFLAGS"
|
||||
LIBS="$OPENSSL_LIBS $LIBS"
|
||||
CPPFLAGS="$OPENSSL_INCLUDES $CPPFLAGS"
|
||||
AC_LINK_IFELSE(
|
||||
[AC_LANG_PROGRAM([#include <openssl/ssl.h>], [SSL_new(NULL)])],
|
||||
[
|
||||
AC_MSG_RESULT([yes])
|
||||
$1
|
||||
], [
|
||||
AC_MSG_RESULT([no])
|
||||
$2
|
||||
])
|
||||
CPPFLAGS="$save_CPPFLAGS"
|
||||
LDFLAGS="$save_LDFLAGS"
|
||||
LIBS="$save_LIBS"
|
||||
|
||||
AC_SUBST([OPENSSL_INCLUDES])
|
||||
AC_SUBST([OPENSSL_LIBS])
|
||||
AC_SUBST([OPENSSL_LDFLAGS])
|
||||
])
|
||||
|
||||
# pkg.m4 - Macros to locate and use pkg-config. -*- Autoconf -*-
|
||||
# serial 12 (pkg-config-0.29.2)
|
||||
|
||||
dnl Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
|
||||
dnl Copyright © 2012-2015 Dan Nicholson <dbn.lists@gmail.com>
|
||||
dnl
|
||||
dnl This program is free software; you can redistribute it and/or modify
|
||||
dnl it under the terms of the GNU General Public License as published by
|
||||
dnl the Free Software Foundation; either version 2 of the License, or
|
||||
dnl (at your option) any later version.
|
||||
dnl
|
||||
dnl This program is distributed in the hope that it will be useful, but
|
||||
dnl WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
dnl General Public License for more details.
|
||||
dnl
|
||||
dnl You should have received a copy of the GNU General Public License
|
||||
dnl along with this program; if not, write to the Free Software
|
||||
dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||
dnl 02111-1307, USA.
|
||||
dnl
|
||||
dnl As a special exception to the GNU General Public License, if you
|
||||
dnl distribute this file as part of a program that contains a
|
||||
dnl configuration script generated by Autoconf, you may include it under
|
||||
dnl the same distribution terms that you use for the rest of that
|
||||
dnl program.
|
||||
|
||||
dnl PKG_PREREQ(MIN-VERSION)
|
||||
dnl -----------------------
|
||||
dnl Since: 0.29
|
||||
dnl
|
||||
dnl Verify that the version of the pkg-config macros are at least
|
||||
dnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's
|
||||
dnl installed version of pkg-config, this checks the developer's version
|
||||
dnl of pkg.m4 when generating configure.
|
||||
dnl
|
||||
dnl To ensure that this macro is defined, also add:
|
||||
dnl m4_ifndef([PKG_PREREQ],
|
||||
dnl [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])])
|
||||
dnl
|
||||
dnl See the "Since" comment for each macro you use to see what version
|
||||
dnl of the macros you require.
|
||||
m4_defun([PKG_PREREQ],
|
||||
[m4_define([PKG_MACROS_VERSION], [0.29.2])
|
||||
m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1,
|
||||
[m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])])
|
||||
])dnl PKG_PREREQ
|
||||
|
||||
dnl PKG_PROG_PKG_CONFIG([MIN-VERSION])
|
||||
dnl ----------------------------------
|
||||
dnl Since: 0.16
|
||||
dnl
|
||||
dnl Search for the pkg-config tool and set the PKG_CONFIG variable to
|
||||
dnl first found in the path. Checks that the version of pkg-config found
|
||||
dnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is
|
||||
dnl used since that's the first version where most current features of
|
||||
dnl pkg-config existed.
|
||||
AC_DEFUN([PKG_PROG_PKG_CONFIG],
|
||||
[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
|
||||
m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
|
||||
m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
|
||||
AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
|
||||
AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
|
||||
AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
|
||||
|
||||
if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
|
||||
AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
|
||||
fi
|
||||
if test -n "$PKG_CONFIG"; then
|
||||
_pkg_min_version=m4_default([$1], [0.9.0])
|
||||
AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
|
||||
if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
|
||||
AC_MSG_RESULT([yes])
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
PKG_CONFIG=""
|
||||
fi
|
||||
fi[]dnl
|
||||
])dnl PKG_PROG_PKG_CONFIG
|
||||
|
||||
dnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
|
||||
dnl -------------------------------------------------------------------
|
||||
dnl Since: 0.18
|
||||
dnl
|
||||
dnl Check to see whether a particular set of modules exists. Similar to
|
||||
dnl PKG_CHECK_MODULES(), but does not set variables or print errors.
|
||||
dnl
|
||||
dnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
|
||||
dnl only at the first occurrence in configure.ac, so if the first place
|
||||
dnl it's called might be skipped (such as if it is within an "if", you
|
||||
dnl have to call PKG_CHECK_EXISTS manually
|
||||
AC_DEFUN([PKG_CHECK_EXISTS],
|
||||
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
|
||||
if test -n "$PKG_CONFIG" && \
|
||||
AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
|
||||
m4_default([$2], [:])
|
||||
m4_ifvaln([$3], [else
|
||||
$3])dnl
|
||||
fi])
|
||||
|
||||
dnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
|
||||
dnl ---------------------------------------------
|
||||
dnl Internal wrapper calling pkg-config via PKG_CONFIG and setting
|
||||
dnl pkg_failed based on the result.
|
||||
m4_define([_PKG_CONFIG],
|
||||
[if test -n "$$1"; then
|
||||
pkg_cv_[]$1="$$1"
|
||||
elif test -n "$PKG_CONFIG"; then
|
||||
PKG_CHECK_EXISTS([$3],
|
||||
[pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
|
||||
test "x$?" != "x0" && pkg_failed=yes ],
|
||||
[pkg_failed=yes])
|
||||
else
|
||||
pkg_failed=untried
|
||||
fi[]dnl
|
||||
])dnl _PKG_CONFIG
|
||||
|
||||
dnl _PKG_SHORT_ERRORS_SUPPORTED
|
||||
dnl ---------------------------
|
||||
dnl Internal check to see if pkg-config supports short errors.
|
||||
AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
|
||||
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
|
||||
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
|
||||
_pkg_short_errors_supported=yes
|
||||
else
|
||||
_pkg_short_errors_supported=no
|
||||
fi[]dnl
|
||||
])dnl _PKG_SHORT_ERRORS_SUPPORTED
|
||||
|
||||
|
||||
dnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
|
||||
dnl [ACTION-IF-NOT-FOUND])
|
||||
dnl --------------------------------------------------------------
|
||||
dnl Since: 0.4.0
|
||||
dnl
|
||||
dnl Note that if there is a possibility the first call to
|
||||
dnl PKG_CHECK_MODULES might not happen, you should be sure to include an
|
||||
dnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
|
||||
AC_DEFUN([PKG_CHECK_MODULES],
|
||||
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
|
||||
AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
|
||||
AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
|
||||
|
||||
pkg_failed=no
|
||||
AC_MSG_CHECKING([for $2])
|
||||
|
||||
_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
|
||||
_PKG_CONFIG([$1][_LIBS], [libs], [$2])
|
||||
|
||||
m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
|
||||
and $1[]_LIBS to avoid the need to call pkg-config.
|
||||
See the pkg-config man page for more details.])
|
||||
|
||||
if test $pkg_failed = yes; then
|
||||
AC_MSG_RESULT([no])
|
||||
_PKG_SHORT_ERRORS_SUPPORTED
|
||||
if test $_pkg_short_errors_supported = yes; then
|
||||
$1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
|
||||
else
|
||||
$1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
|
||||
fi
|
||||
# Put the nasty error message in config.log where it belongs
|
||||
echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
|
||||
|
||||
m4_default([$4], [AC_MSG_ERROR(
|
||||
[Package requirements ($2) were not met:
|
||||
|
||||
$$1_PKG_ERRORS
|
||||
|
||||
Consider adjusting the PKG_CONFIG_PATH environment variable if you
|
||||
installed software in a non-standard prefix.
|
||||
|
||||
_PKG_TEXT])[]dnl
|
||||
])
|
||||
elif test $pkg_failed = untried; then
|
||||
AC_MSG_RESULT([no])
|
||||
m4_default([$4], [AC_MSG_FAILURE(
|
||||
[The pkg-config script could not be found or is too old. Make sure it
|
||||
is in your PATH or set the PKG_CONFIG environment variable to the full
|
||||
path to pkg-config.
|
||||
|
||||
_PKG_TEXT
|
||||
|
||||
To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
|
||||
])
|
||||
else
|
||||
$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
|
||||
$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
|
||||
AC_MSG_RESULT([yes])
|
||||
$3
|
||||
fi[]dnl
|
||||
])dnl PKG_CHECK_MODULES
|
||||
|
||||
|
||||
dnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
|
||||
dnl [ACTION-IF-NOT-FOUND])
|
||||
dnl ---------------------------------------------------------------------
|
||||
dnl Since: 0.29
|
||||
dnl
|
||||
dnl Checks for existence of MODULES and gathers its build flags with
|
||||
dnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags
|
||||
dnl and VARIABLE-PREFIX_LIBS from --libs.
|
||||
dnl
|
||||
dnl Note that if there is a possibility the first call to
|
||||
dnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to
|
||||
dnl include an explicit call to PKG_PROG_PKG_CONFIG in your
|
||||
dnl configure.ac.
|
||||
AC_DEFUN([PKG_CHECK_MODULES_STATIC],
|
||||
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
|
||||
_save_PKG_CONFIG=$PKG_CONFIG
|
||||
PKG_CONFIG="$PKG_CONFIG --static"
|
||||
PKG_CHECK_MODULES($@)
|
||||
PKG_CONFIG=$_save_PKG_CONFIG[]dnl
|
||||
])dnl PKG_CHECK_MODULES_STATIC
|
||||
|
||||
|
||||
dnl PKG_INSTALLDIR([DIRECTORY])
|
||||
dnl -------------------------
|
||||
dnl Since: 0.27
|
||||
dnl
|
||||
dnl Substitutes the variable pkgconfigdir as the location where a module
|
||||
dnl should install pkg-config .pc files. By default the directory is
|
||||
dnl $libdir/pkgconfig, but the default can be changed by passing
|
||||
dnl DIRECTORY. The user can override through the --with-pkgconfigdir
|
||||
dnl parameter.
|
||||
AC_DEFUN([PKG_INSTALLDIR],
|
||||
[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
|
||||
m4_pushdef([pkg_description],
|
||||
[pkg-config installation directory @<:@]pkg_default[@:>@])
|
||||
AC_ARG_WITH([pkgconfigdir],
|
||||
[AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
|
||||
[with_pkgconfigdir=]pkg_default)
|
||||
AC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
|
||||
m4_popdef([pkg_default])
|
||||
m4_popdef([pkg_description])
|
||||
])dnl PKG_INSTALLDIR
|
||||
|
||||
|
||||
dnl PKG_NOARCH_INSTALLDIR([DIRECTORY])
|
||||
dnl --------------------------------
|
||||
dnl Since: 0.27
|
||||
dnl
|
||||
dnl Substitutes the variable noarch_pkgconfigdir as the location where a
|
||||
dnl module should install arch-independent pkg-config .pc files. By
|
||||
dnl default the directory is $datadir/pkgconfig, but the default can be
|
||||
dnl changed by passing DIRECTORY. The user can override through the
|
||||
dnl --with-noarch-pkgconfigdir parameter.
|
||||
AC_DEFUN([PKG_NOARCH_INSTALLDIR],
|
||||
[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
|
||||
m4_pushdef([pkg_description],
|
||||
[pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
|
||||
AC_ARG_WITH([noarch-pkgconfigdir],
|
||||
[AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
|
||||
[with_noarch_pkgconfigdir=]pkg_default)
|
||||
AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
|
||||
m4_popdef([pkg_default])
|
||||
m4_popdef([pkg_description])
|
||||
])dnl PKG_NOARCH_INSTALLDIR
|
||||
|
||||
|
||||
dnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
|
||||
dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
|
||||
dnl -------------------------------------------
|
||||
dnl Since: 0.28
|
||||
dnl
|
||||
dnl Retrieves the value of the pkg-config variable for the given module.
|
||||
AC_DEFUN([PKG_CHECK_VAR],
|
||||
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
|
||||
AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
|
||||
|
||||
_PKG_CONFIG([$1], [variable="][$3]["], [$2])
|
||||
AS_VAR_COPY([$1], [pkg_cv_][$1])
|
||||
|
||||
AS_VAR_IF([$1], [""], [$5], [$4])dnl
|
||||
])dnl PKG_CHECK_VAR
|
||||
|
||||
dnl PKG_WITH_MODULES(VARIABLE-PREFIX, MODULES,
|
||||
dnl [ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND],
|
||||
dnl [DESCRIPTION], [DEFAULT])
|
||||
dnl ------------------------------------------
|
||||
dnl
|
||||
dnl Prepare a "--with-" configure option using the lowercase
|
||||
dnl [VARIABLE-PREFIX] name, merging the behaviour of AC_ARG_WITH and
|
||||
dnl PKG_CHECK_MODULES in a single macro.
|
||||
AC_DEFUN([PKG_WITH_MODULES],
|
||||
[
|
||||
m4_pushdef([with_arg], m4_tolower([$1]))
|
||||
|
||||
m4_pushdef([description],
|
||||
[m4_default([$5], [build with ]with_arg[ support])])
|
||||
|
||||
m4_pushdef([def_arg], [m4_default([$6], [auto])])
|
||||
m4_pushdef([def_action_if_found], [AS_TR_SH([with_]with_arg)=yes])
|
||||
m4_pushdef([def_action_if_not_found], [AS_TR_SH([with_]with_arg)=no])
|
||||
|
||||
m4_case(def_arg,
|
||||
[yes],[m4_pushdef([with_without], [--without-]with_arg)],
|
||||
[m4_pushdef([with_without],[--with-]with_arg)])
|
||||
|
||||
AC_ARG_WITH(with_arg,
|
||||
AS_HELP_STRING(with_without, description[ @<:@default=]def_arg[@:>@]),,
|
||||
[AS_TR_SH([with_]with_arg)=def_arg])
|
||||
|
||||
AS_CASE([$AS_TR_SH([with_]with_arg)],
|
||||
[yes],[PKG_CHECK_MODULES([$1],[$2],$3,$4)],
|
||||
[auto],[PKG_CHECK_MODULES([$1],[$2],
|
||||
[m4_n([def_action_if_found]) $3],
|
||||
[m4_n([def_action_if_not_found]) $4])])
|
||||
|
||||
m4_popdef([with_arg])
|
||||
m4_popdef([description])
|
||||
m4_popdef([def_arg])
|
||||
|
||||
])dnl PKG_WITH_MODULES
|
||||
|
||||
dnl PKG_HAVE_WITH_MODULES(VARIABLE-PREFIX, MODULES,
|
||||
dnl [DESCRIPTION], [DEFAULT])
|
||||
dnl -----------------------------------------------
|
||||
dnl
|
||||
dnl Convenience macro to trigger AM_CONDITIONAL after PKG_WITH_MODULES
|
||||
dnl check._[VARIABLE-PREFIX] is exported as make variable.
|
||||
AC_DEFUN([PKG_HAVE_WITH_MODULES],
|
||||
[
|
||||
PKG_WITH_MODULES([$1],[$2],,,[$3],[$4])
|
||||
|
||||
AM_CONDITIONAL([HAVE_][$1],
|
||||
[test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"])
|
||||
])dnl PKG_HAVE_WITH_MODULES
|
||||
|
||||
dnl PKG_HAVE_DEFINE_WITH_MODULES(VARIABLE-PREFIX, MODULES,
|
||||
dnl [DESCRIPTION], [DEFAULT])
|
||||
dnl ------------------------------------------------------
|
||||
dnl
|
||||
dnl Convenience macro to run AM_CONDITIONAL and AC_DEFINE after
|
||||
dnl PKG_WITH_MODULES check. HAVE_[VARIABLE-PREFIX] is exported as make
|
||||
dnl and preprocessor variable.
|
||||
AC_DEFUN([PKG_HAVE_DEFINE_WITH_MODULES],
|
||||
[
|
||||
PKG_HAVE_WITH_MODULES([$1],[$2],[$3],[$4])
|
||||
|
||||
AS_IF([test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"],
|
||||
[AC_DEFINE([HAVE_][$1], 1, [Enable ]m4_tolower([$1])[ support])])
|
||||
])dnl PKG_HAVE_DEFINE_WITH_MODULES
|
||||
|
||||
# AM_CONDITIONAL -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 1997-2021 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# AM_CONDITIONAL(NAME, SHELL-CONDITION)
|
||||
# -------------------------------------
|
||||
# Define a conditional.
|
||||
AC_DEFUN([AM_CONDITIONAL],
|
||||
[AC_PREREQ([2.52])dnl
|
||||
m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
|
||||
[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
|
||||
AC_SUBST([$1_TRUE])dnl
|
||||
AC_SUBST([$1_FALSE])dnl
|
||||
_AM_SUBST_NOTMAKE([$1_TRUE])dnl
|
||||
_AM_SUBST_NOTMAKE([$1_FALSE])dnl
|
||||
m4_define([_AM_COND_VALUE_$1], [$2])dnl
|
||||
if $2; then
|
||||
$1_TRUE=
|
||||
$1_FALSE='#'
|
||||
else
|
||||
$1_TRUE='#'
|
||||
$1_FALSE=
|
||||
fi
|
||||
AC_CONFIG_COMMANDS_PRE(
|
||||
[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
|
||||
AC_MSG_ERROR([[conditional "$1" was never defined.
|
||||
Usually this means the macro was only invoked conditionally.]])
|
||||
fi])])
|
||||
|
||||
# Copyright (C) 2006-2021 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# _AM_SUBST_NOTMAKE(VARIABLE)
|
||||
# ---------------------------
|
||||
# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
|
||||
# This macro is traced by Automake.
|
||||
AC_DEFUN([_AM_SUBST_NOTMAKE])
|
||||
|
||||
# AM_SUBST_NOTMAKE(VARIABLE)
|
||||
# --------------------------
|
||||
# Public sister of _AM_SUBST_NOTMAKE.
|
||||
AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
|
||||
|
||||
1807
config.guess
vendored
1807
config.guess
vendored
File diff suppressed because it is too large
Load Diff
1974
config.sub
vendored
1974
config.sub
vendored
File diff suppressed because it is too large
Load Diff
8261
configure.ac
8261
configure.ac
File diff suppressed because it is too large
Load Diff
541
install-sh
541
install-sh
@@ -1,541 +0,0 @@
|
||||
#!/bin/sh
|
||||
# install - install a program, script, or datafile
|
||||
|
||||
scriptversion=2023-11-23.18; # UTC
|
||||
|
||||
# This originates from X11R5 (mit/util/scripts/install.sh), which was
|
||||
# later released in X11R6 (xc/config/util/install.sh) with the
|
||||
# following copyright and license.
|
||||
#
|
||||
# Copyright (C) 1994 X Consortium
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to
|
||||
# deal in the Software without restriction, including without limitation the
|
||||
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
# sell copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in
|
||||
# all copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
||||
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
|
||||
# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
#
|
||||
# Except as contained in this notice, the name of the X Consortium shall not
|
||||
# be used in advertising or otherwise to promote the sale, use or other deal-
|
||||
# ings in this Software without prior written authorization from the X Consor-
|
||||
# tium.
|
||||
#
|
||||
#
|
||||
# FSF changes to this file are in the public domain.
|
||||
#
|
||||
# Calling this script install-sh is preferred over install.sh, to prevent
|
||||
# 'make' implicit rules from creating a file called install from it
|
||||
# when there is no Makefile.
|
||||
#
|
||||
# This script is compatible with the BSD install script, but was written
|
||||
# from scratch.
|
||||
|
||||
tab=' '
|
||||
nl='
|
||||
'
|
||||
IFS=" $tab$nl"
|
||||
|
||||
# Set DOITPROG to "echo" to test this script.
|
||||
|
||||
doit=${DOITPROG-}
|
||||
doit_exec=${doit:-exec}
|
||||
|
||||
# Put in absolute file names if you don't have them in your path;
|
||||
# or use environment vars.
|
||||
|
||||
chgrpprog=${CHGRPPROG-chgrp}
|
||||
chmodprog=${CHMODPROG-chmod}
|
||||
chownprog=${CHOWNPROG-chown}
|
||||
cmpprog=${CMPPROG-cmp}
|
||||
cpprog=${CPPROG-cp}
|
||||
mkdirprog=${MKDIRPROG-mkdir}
|
||||
mvprog=${MVPROG-mv}
|
||||
rmprog=${RMPROG-rm}
|
||||
stripprog=${STRIPPROG-strip}
|
||||
|
||||
posix_mkdir=
|
||||
|
||||
# Desired mode of installed file.
|
||||
mode=0755
|
||||
|
||||
# Create dirs (including intermediate dirs) using mode 755.
|
||||
# This is like GNU 'install' as of coreutils 8.32 (2020).
|
||||
mkdir_umask=22
|
||||
|
||||
backupsuffix=
|
||||
chgrpcmd=
|
||||
chmodcmd=$chmodprog
|
||||
chowncmd=
|
||||
mvcmd=$mvprog
|
||||
rmcmd="$rmprog -f"
|
||||
stripcmd=
|
||||
|
||||
src=
|
||||
dst=
|
||||
dir_arg=
|
||||
dst_arg=
|
||||
|
||||
copy_on_change=false
|
||||
is_target_a_directory=possibly
|
||||
|
||||
usage="\
|
||||
Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
|
||||
or: $0 [OPTION]... SRCFILES... DIRECTORY
|
||||
or: $0 [OPTION]... -t DIRECTORY SRCFILES...
|
||||
or: $0 [OPTION]... -d DIRECTORIES...
|
||||
|
||||
In the 1st form, copy SRCFILE to DSTFILE.
|
||||
In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
|
||||
In the 4th, create DIRECTORIES.
|
||||
|
||||
Options:
|
||||
--help display this help and exit.
|
||||
--version display version info and exit.
|
||||
|
||||
-c (ignored)
|
||||
-C install only if different (preserve data modification time)
|
||||
-d create directories instead of installing files.
|
||||
-g GROUP $chgrpprog installed files to GROUP.
|
||||
-m MODE $chmodprog installed files to MODE.
|
||||
-o USER $chownprog installed files to USER.
|
||||
-p pass -p to $cpprog.
|
||||
-s $stripprog installed files.
|
||||
-S SUFFIX attempt to back up existing files, with suffix SUFFIX.
|
||||
-t DIRECTORY install into DIRECTORY.
|
||||
-T report an error if DSTFILE is a directory.
|
||||
|
||||
Environment variables override the default commands:
|
||||
CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
|
||||
RMPROG STRIPPROG
|
||||
|
||||
By default, rm is invoked with -f; when overridden with RMPROG,
|
||||
it's up to you to specify -f if you want it.
|
||||
|
||||
If -S is not specified, no backups are attempted.
|
||||
|
||||
Report bugs to <bug-automake@gnu.org>.
|
||||
GNU Automake home page: <https://www.gnu.org/software/automake/>.
|
||||
General help using GNU software: <https://www.gnu.org/gethelp/>."
|
||||
|
||||
while test $# -ne 0; do
|
||||
case $1 in
|
||||
-c) ;;
|
||||
|
||||
-C) copy_on_change=true;;
|
||||
|
||||
-d) dir_arg=true;;
|
||||
|
||||
-g) chgrpcmd="$chgrpprog $2"
|
||||
shift;;
|
||||
|
||||
--help) echo "$usage"; exit $?;;
|
||||
|
||||
-m) mode=$2
|
||||
case $mode in
|
||||
*' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*)
|
||||
echo "$0: invalid mode: $mode" >&2
|
||||
exit 1;;
|
||||
esac
|
||||
shift;;
|
||||
|
||||
-o) chowncmd="$chownprog $2"
|
||||
shift;;
|
||||
|
||||
-p) cpprog="$cpprog -p";;
|
||||
|
||||
-s) stripcmd=$stripprog;;
|
||||
|
||||
-S) backupsuffix="$2"
|
||||
shift;;
|
||||
|
||||
-t)
|
||||
is_target_a_directory=always
|
||||
dst_arg=$2
|
||||
# Protect names problematic for 'test' and other utilities.
|
||||
case $dst_arg in
|
||||
-* | [=\(\)!]) dst_arg=./$dst_arg;;
|
||||
esac
|
||||
shift;;
|
||||
|
||||
-T) is_target_a_directory=never;;
|
||||
|
||||
--version) echo "$0 $scriptversion"; exit $?;;
|
||||
|
||||
--) shift
|
||||
break;;
|
||||
|
||||
-*) echo "$0: invalid option: $1" >&2
|
||||
exit 1;;
|
||||
|
||||
*) break;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
# We allow the use of options -d and -T together, by making -d
|
||||
# take the precedence; this is for compatibility with GNU install.
|
||||
|
||||
if test -n "$dir_arg"; then
|
||||
if test -n "$dst_arg"; then
|
||||
echo "$0: target directory not allowed when installing a directory." >&2
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
|
||||
# When -d is used, all remaining arguments are directories to create.
|
||||
# When -t is used, the destination is already specified.
|
||||
# Otherwise, the last argument is the destination. Remove it from $@.
|
||||
for arg
|
||||
do
|
||||
if test -n "$dst_arg"; then
|
||||
# $@ is not empty: it contains at least $arg.
|
||||
set fnord "$@" "$dst_arg"
|
||||
shift # fnord
|
||||
fi
|
||||
shift # arg
|
||||
dst_arg=$arg
|
||||
# Protect names problematic for 'test' and other utilities.
|
||||
case $dst_arg in
|
||||
-* | [=\(\)!]) dst_arg=./$dst_arg;;
|
||||
esac
|
||||
done
|
||||
fi
|
||||
|
||||
if test $# -eq 0; then
|
||||
if test -z "$dir_arg"; then
|
||||
echo "$0: no input file specified." >&2
|
||||
exit 1
|
||||
fi
|
||||
# It's OK to call 'install-sh -d' without argument.
|
||||
# This can happen when creating conditional directories.
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if test -z "$dir_arg"; then
|
||||
if test $# -gt 1 || test "$is_target_a_directory" = always; then
|
||||
if test ! -d "$dst_arg"; then
|
||||
echo "$0: $dst_arg: Is not a directory." >&2
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if test -z "$dir_arg"; then
|
||||
do_exit='(exit $ret); exit $ret'
|
||||
trap "ret=129; $do_exit" 1
|
||||
trap "ret=130; $do_exit" 2
|
||||
trap "ret=141; $do_exit" 13
|
||||
trap "ret=143; $do_exit" 15
|
||||
|
||||
# Set umask so as not to create temps with too-generous modes.
|
||||
# However, 'strip' requires both read and write access to temps.
|
||||
case $mode in
|
||||
# Optimize common cases.
|
||||
*644) cp_umask=133;;
|
||||
*755) cp_umask=22;;
|
||||
|
||||
*[0-7])
|
||||
if test -z "$stripcmd"; then
|
||||
u_plus_rw=
|
||||
else
|
||||
u_plus_rw='% 200'
|
||||
fi
|
||||
cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
|
||||
*)
|
||||
if test -z "$stripcmd"; then
|
||||
u_plus_rw=
|
||||
else
|
||||
u_plus_rw=,u+rw
|
||||
fi
|
||||
cp_umask=$mode$u_plus_rw;;
|
||||
esac
|
||||
fi
|
||||
|
||||
for src
|
||||
do
|
||||
# Protect names problematic for 'test' and other utilities.
|
||||
case $src in
|
||||
-* | [=\(\)!]) src=./$src;;
|
||||
esac
|
||||
|
||||
if test -n "$dir_arg"; then
|
||||
dst=$src
|
||||
dstdir=$dst
|
||||
test -d "$dstdir"
|
||||
dstdir_status=$?
|
||||
# Don't chown directories that already exist.
|
||||
if test $dstdir_status = 0; then
|
||||
chowncmd=""
|
||||
fi
|
||||
else
|
||||
|
||||
# Waiting for this to be detected by the "$cpprog $src $dsttmp" command
|
||||
# might cause directories to be created, which would be especially bad
|
||||
# if $src (and thus $dsttmp) contains '*'.
|
||||
if test ! -f "$src" && test ! -d "$src"; then
|
||||
echo "$0: $src does not exist." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if test -z "$dst_arg"; then
|
||||
echo "$0: no destination specified." >&2
|
||||
exit 1
|
||||
fi
|
||||
dst=$dst_arg
|
||||
|
||||
# If destination is a directory, append the input filename.
|
||||
if test -d "$dst"; then
|
||||
if test "$is_target_a_directory" = never; then
|
||||
echo "$0: $dst_arg: Is a directory" >&2
|
||||
exit 1
|
||||
fi
|
||||
dstdir=$dst
|
||||
dstbase=`basename "$src"`
|
||||
case $dst in
|
||||
*/) dst=$dst$dstbase;;
|
||||
*) dst=$dst/$dstbase;;
|
||||
esac
|
||||
dstdir_status=0
|
||||
else
|
||||
dstdir=`dirname "$dst"`
|
||||
test -d "$dstdir"
|
||||
dstdir_status=$?
|
||||
fi
|
||||
fi
|
||||
|
||||
case $dstdir in
|
||||
*/) dstdirslash=$dstdir;;
|
||||
*) dstdirslash=$dstdir/;;
|
||||
esac
|
||||
|
||||
obsolete_mkdir_used=false
|
||||
|
||||
if test $dstdir_status != 0; then
|
||||
case $posix_mkdir in
|
||||
'')
|
||||
# With -d, create the new directory with the user-specified mode.
|
||||
# Otherwise, rely on $mkdir_umask.
|
||||
if test -n "$dir_arg"; then
|
||||
mkdir_mode=-m$mode
|
||||
else
|
||||
mkdir_mode=
|
||||
fi
|
||||
|
||||
posix_mkdir=false
|
||||
# The $RANDOM variable is not portable (e.g., dash). Use it
|
||||
# here however when possible just to lower collision chance.
|
||||
tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
|
||||
|
||||
trap '
|
||||
ret=$?
|
||||
rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null
|
||||
exit $ret
|
||||
' 0
|
||||
|
||||
# Because "mkdir -p" follows existing symlinks and we likely work
|
||||
# directly in world-writeable /tmp, make sure that the '$tmpdir'
|
||||
# directory is successfully created first before we actually test
|
||||
# 'mkdir -p'.
|
||||
if (umask $mkdir_umask &&
|
||||
$mkdirprog $mkdir_mode "$tmpdir" &&
|
||||
exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1
|
||||
then
|
||||
if test -z "$dir_arg" || {
|
||||
# Check for POSIX incompatibilities with -m.
|
||||
# HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
|
||||
# other-writable bit of parent directory when it shouldn't.
|
||||
# FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
|
||||
test_tmpdir="$tmpdir/a"
|
||||
ls_ld_tmpdir=`ls -ld "$test_tmpdir"`
|
||||
case $ls_ld_tmpdir in
|
||||
d????-?r-*) different_mode=700;;
|
||||
d????-?--*) different_mode=755;;
|
||||
*) false;;
|
||||
esac &&
|
||||
$mkdirprog -m$different_mode -p -- "$test_tmpdir" && {
|
||||
ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"`
|
||||
test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
|
||||
}
|
||||
}
|
||||
then posix_mkdir=:
|
||||
fi
|
||||
rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir"
|
||||
else
|
||||
# Remove any dirs left behind by ancient mkdir implementations.
|
||||
rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null
|
||||
fi
|
||||
trap '' 0;;
|
||||
esac
|
||||
|
||||
if
|
||||
$posix_mkdir && (
|
||||
umask $mkdir_umask &&
|
||||
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
|
||||
)
|
||||
then :
|
||||
else
|
||||
|
||||
# mkdir does not conform to POSIX,
|
||||
# or it failed possibly due to a race condition. Create the
|
||||
# directory the slow way, step by step, checking for races as we go.
|
||||
|
||||
case $dstdir in
|
||||
/*) prefix='/';;
|
||||
[-=\(\)!]*) prefix='./';;
|
||||
*) prefix='';;
|
||||
esac
|
||||
|
||||
oIFS=$IFS
|
||||
IFS=/
|
||||
set -f
|
||||
set fnord $dstdir
|
||||
shift
|
||||
set +f
|
||||
IFS=$oIFS
|
||||
|
||||
prefixes=
|
||||
|
||||
for d
|
||||
do
|
||||
test X"$d" = X && continue
|
||||
|
||||
prefix=$prefix$d
|
||||
if test -d "$prefix"; then
|
||||
prefixes=
|
||||
else
|
||||
if $posix_mkdir; then
|
||||
(umask $mkdir_umask &&
|
||||
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
|
||||
# Don't fail if two instances are running concurrently.
|
||||
test -d "$prefix" || exit 1
|
||||
else
|
||||
case $prefix in
|
||||
*\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
|
||||
*) qprefix=$prefix;;
|
||||
esac
|
||||
prefixes="$prefixes '$qprefix'"
|
||||
fi
|
||||
fi
|
||||
prefix=$prefix/
|
||||
done
|
||||
|
||||
if test -n "$prefixes"; then
|
||||
# Don't fail if two instances are running concurrently.
|
||||
(umask $mkdir_umask &&
|
||||
eval "\$doit_exec \$mkdirprog $prefixes") ||
|
||||
test -d "$dstdir" || exit 1
|
||||
obsolete_mkdir_used=true
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if test -n "$dir_arg"; then
|
||||
{ test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
|
||||
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
|
||||
{ test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
|
||||
test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
|
||||
else
|
||||
|
||||
# Make a couple of temp file names in the proper directory.
|
||||
dsttmp=${dstdirslash}_inst.$$_
|
||||
rmtmp=${dstdirslash}_rm.$$_
|
||||
|
||||
# Trap to clean up those temp files at exit.
|
||||
trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
|
||||
|
||||
# Copy the file name to the temp name.
|
||||
(umask $cp_umask &&
|
||||
{ test -z "$stripcmd" || {
|
||||
# Create $dsttmp read-write so that cp doesn't create it read-only,
|
||||
# which would cause strip to fail.
|
||||
if test -z "$doit"; then
|
||||
: >"$dsttmp" # No need to fork-exec 'touch'.
|
||||
else
|
||||
$doit touch "$dsttmp"
|
||||
fi
|
||||
}
|
||||
} &&
|
||||
$doit_exec $cpprog "$src" "$dsttmp") &&
|
||||
|
||||
# and set any options; do chmod last to preserve setuid bits.
|
||||
#
|
||||
# If any of these fail, we abort the whole thing. If we want to
|
||||
# ignore errors from any of these, just make sure not to ignore
|
||||
# errors from the above "$doit $cpprog $src $dsttmp" command.
|
||||
#
|
||||
{ test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
|
||||
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
|
||||
{ test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
|
||||
{ test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
|
||||
|
||||
# If -C, don't bother to copy if it wouldn't change the file.
|
||||
if $copy_on_change &&
|
||||
old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
|
||||
new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
|
||||
set -f &&
|
||||
set X $old && old=:$2:$4:$5:$6 &&
|
||||
set X $new && new=:$2:$4:$5:$6 &&
|
||||
set +f &&
|
||||
test "$old" = "$new" &&
|
||||
$cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
|
||||
then
|
||||
rm -f "$dsttmp"
|
||||
else
|
||||
# If $backupsuffix is set, and the file being installed
|
||||
# already exists, attempt a backup. Don't worry if it fails,
|
||||
# e.g., if mv doesn't support -f.
|
||||
if test -n "$backupsuffix" && test -f "$dst"; then
|
||||
$doit $mvcmd -f "$dst" "$dst$backupsuffix" 2>/dev/null
|
||||
fi
|
||||
|
||||
# Rename the file to the real destination.
|
||||
$doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
|
||||
|
||||
# The rename failed, perhaps because mv can't rename something else
|
||||
# to itself, or perhaps because mv is so ancient that it does not
|
||||
# support -f.
|
||||
{
|
||||
# Now remove or move aside any old file at destination location.
|
||||
# We try this two ways since rm can't unlink itself on some
|
||||
# systems and the destination file might be busy for other
|
||||
# reasons. In this case, the final cleanup might fail but the new
|
||||
# file should still install successfully.
|
||||
{
|
||||
test ! -f "$dst" ||
|
||||
$doit $rmcmd "$dst" 2>/dev/null ||
|
||||
{ $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
|
||||
{ $doit $rmcmd "$rmtmp" 2>/dev/null; :; }
|
||||
} ||
|
||||
{ echo "$0: cannot unlink or rename $dst" >&2
|
||||
(exit 1); exit 1
|
||||
}
|
||||
} &&
|
||||
|
||||
# Now rename the file to the real destination.
|
||||
$doit $mvcmd "$dsttmp" "$dst"
|
||||
}
|
||||
fi || exit 1
|
||||
|
||||
trap '' 0
|
||||
fi
|
||||
done
|
||||
|
||||
# Local variables:
|
||||
# eval: (add-hook 'before-save-hook 'time-stamp)
|
||||
# time-stamp-start: "scriptversion="
|
||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||
# time-stamp-time-zone: "UTC0"
|
||||
# time-stamp-end: "; # UTC"
|
||||
# End:
|
||||
2087
pyconfig.h.in
2087
pyconfig.h.in
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user