Add files using upload-large-folder tool
Browse filesThis view is limited to 50 files because it contains too many changes.
See raw diff
- .gitattributes +4 -0
- janus/lib/python3.10/config-3.10-x86_64-linux-gnu/Makefile +2108 -0
- janus/lib/python3.10/config-3.10-x86_64-linux-gnu/Setup +377 -0
- janus/lib/python3.10/config-3.10-x86_64-linux-gnu/Setup.local +1 -0
- janus/lib/python3.10/config-3.10-x86_64-linux-gnu/__pycache__/python-config.cpython-310.pyc +0 -0
- janus/lib/python3.10/config-3.10-x86_64-linux-gnu/config.c +114 -0
- janus/lib/python3.10/config-3.10-x86_64-linux-gnu/install-sh +518 -0
- janus/lib/python3.10/config-3.10-x86_64-linux-gnu/makesetup +309 -0
- janus/lib/python3.10/config-3.10-x86_64-linux-gnu/python-config.py +74 -0
- janus/lib/python3.10/config-3.10-x86_64-linux-gnu/python.o +0 -0
- janus/lib/python3.10/ctypes/__init__.py +563 -0
- janus/lib/python3.10/ctypes/__pycache__/_aix.cpython-310.pyc +0 -0
- janus/lib/python3.10/ctypes/__pycache__/util.cpython-310.pyc +0 -0
- janus/lib/python3.10/ctypes/__pycache__/wintypes.cpython-310.pyc +0 -0
- janus/lib/python3.10/ctypes/_aix.py +331 -0
- janus/lib/python3.10/ctypes/_endian.py +61 -0
- janus/lib/python3.10/ctypes/macholib/README.ctypes +7 -0
- janus/lib/python3.10/ctypes/macholib/__init__.py +9 -0
- janus/lib/python3.10/ctypes/macholib/__pycache__/__init__.cpython-310.pyc +0 -0
- janus/lib/python3.10/ctypes/macholib/__pycache__/dyld.cpython-310.pyc +0 -0
- janus/lib/python3.10/ctypes/macholib/__pycache__/dylib.cpython-310.pyc +0 -0
- janus/lib/python3.10/ctypes/macholib/__pycache__/framework.cpython-310.pyc +0 -0
- janus/lib/python3.10/ctypes/macholib/dyld.py +177 -0
- janus/lib/python3.10/ctypes/macholib/dylib.py +63 -0
- janus/lib/python3.10/ctypes/macholib/fetch_macholib +2 -0
- janus/lib/python3.10/ctypes/macholib/framework.py +65 -0
- janus/lib/python3.10/ctypes/util.py +397 -0
- janus/lib/python3.10/ctypes/wintypes.py +202 -0
- janus/lib/python3.10/curses/__init__.py +101 -0
- janus/lib/python3.10/curses/__pycache__/__init__.cpython-310.pyc +0 -0
- janus/lib/python3.10/curses/__pycache__/ascii.cpython-310.pyc +0 -0
- janus/lib/python3.10/curses/__pycache__/has_key.cpython-310.pyc +0 -0
- janus/lib/python3.10/curses/__pycache__/panel.cpython-310.pyc +0 -0
- janus/lib/python3.10/curses/__pycache__/textpad.cpython-310.pyc +0 -0
- janus/lib/python3.10/curses/ascii.py +99 -0
- janus/lib/python3.10/curses/has_key.py +192 -0
- janus/lib/python3.10/curses/panel.py +6 -0
- janus/lib/python3.10/curses/textpad.py +201 -0
- janus/lib/python3.10/email/__pycache__/__init__.cpython-310.pyc +0 -0
- janus/lib/python3.10/email/__pycache__/_encoded_words.cpython-310.pyc +0 -0
- janus/lib/python3.10/email/__pycache__/_policybase.cpython-310.pyc +0 -0
- janus/lib/python3.10/email/__pycache__/base64mime.cpython-310.pyc +0 -0
- janus/lib/python3.10/email/__pycache__/contentmanager.cpython-310.pyc +0 -0
- janus/lib/python3.10/email/__pycache__/feedparser.cpython-310.pyc +0 -0
- janus/lib/python3.10/email/__pycache__/generator.cpython-310.pyc +0 -0
- janus/lib/python3.10/email/__pycache__/header.cpython-310.pyc +0 -0
- janus/lib/python3.10/email/__pycache__/headerregistry.cpython-310.pyc +0 -0
- janus/lib/python3.10/email/__pycache__/parser.cpython-310.pyc +0 -0
- janus/lib/python3.10/email/__pycache__/policy.cpython-310.pyc +0 -0
- janus/lib/python3.10/email/__pycache__/quoprimime.cpython-310.pyc +0 -0
.gitattributes
CHANGED
|
@@ -520,3 +520,7 @@ janus/lib/python3.10/site-packages/numpy/_core/__pycache__/_add_newdocs.cpython-
|
|
| 520 |
janus/lib/python3.10/__pycache__/turtle.cpython-310.pyc filter=lfs diff=lfs merge=lfs -text
|
| 521 |
janus/lib/python3.10/site-packages/numpy/fft/_pocketfft_umath.cpython-310-x86_64-linux-gnu.so filter=lfs diff=lfs merge=lfs -text
|
| 522 |
janus/lib/python3.10/site-packages/numpy/ma/tests/__pycache__/test_core.cpython-310.pyc filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 520 |
janus/lib/python3.10/__pycache__/turtle.cpython-310.pyc filter=lfs diff=lfs merge=lfs -text
|
| 521 |
janus/lib/python3.10/site-packages/numpy/fft/_pocketfft_umath.cpython-310-x86_64-linux-gnu.so filter=lfs diff=lfs merge=lfs -text
|
| 522 |
janus/lib/python3.10/site-packages/numpy/ma/tests/__pycache__/test_core.cpython-310.pyc filter=lfs diff=lfs merge=lfs -text
|
| 523 |
+
janus/lib/python3.10/site-packages/numpy/_core/lib/libnpymath.a filter=lfs diff=lfs merge=lfs -text
|
| 524 |
+
janus/lib/python3.10/site-packages/numpy/random/bit_generator.cpython-310-x86_64-linux-gnu.so filter=lfs diff=lfs merge=lfs -text
|
| 525 |
+
janus/lib/python3.10/site-packages/numpy/random/_bounded_integers.cpython-310-x86_64-linux-gnu.so filter=lfs diff=lfs merge=lfs -text
|
| 526 |
+
janus/lib/python3.10/lib-dynload/_codecs_tw.cpython-310-x86_64-linux-gnu.so filter=lfs diff=lfs merge=lfs -text
|
janus/lib/python3.10/config-3.10-x86_64-linux-gnu/Makefile
ADDED
|
@@ -0,0 +1,2108 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Generated automatically from Makefile.pre by makesetup.
|
| 2 |
+
# Top-level Makefile for Python
|
| 3 |
+
#
|
| 4 |
+
# As distributed, this file is called Makefile.pre.in; it is processed
|
| 5 |
+
# into the real Makefile by running the script ./configure, which
|
| 6 |
+
# replaces things like @spam@ with values appropriate for your system.
|
| 7 |
+
# This means that if you edit Makefile, your changes get lost the next
|
| 8 |
+
# time you run the configure script. Ideally, you can do:
|
| 9 |
+
#
|
| 10 |
+
# ./configure
|
| 11 |
+
# make
|
| 12 |
+
# make test
|
| 13 |
+
# make install
|
| 14 |
+
#
|
| 15 |
+
# If you have a previous version of Python installed that you don't
|
| 16 |
+
# want to overwrite, you can use "make altinstall" instead of "make
|
| 17 |
+
# install". Refer to the "Installing" section in the README file for
|
| 18 |
+
# additional details.
|
| 19 |
+
#
|
| 20 |
+
# See also the section "Build instructions" in the README file.
|
| 21 |
+
|
| 22 |
+
# === Variables set by makesetup ===
|
| 23 |
+
|
| 24 |
+
MODBUILT_NAMES= posix errno pwd _sre _codecs _weakref _functools _operator _collections _abc itertools atexit _signal _stat time _thread _locale _io faulthandler _tracemalloc _symtable xxsubtype
|
| 25 |
+
MODDISABLED_NAMES=
|
| 26 |
+
MODOBJS= Modules/posixmodule.o Modules/errnomodule.o Modules/pwdmodule.o Modules/_sre.o Modules/_codecsmodule.o Modules/_weakref.o Modules/_functoolsmodule.o Modules/_operator.o Modules/_collectionsmodule.o Modules/_abc.o Modules/itertoolsmodule.o Modules/atexitmodule.o Modules/signalmodule.o Modules/_stat.o Modules/timemodule.o Modules/_threadmodule.o Modules/_localemodule.o Modules/_iomodule.o Modules/iobase.o Modules/fileio.o Modules/bytesio.o Modules/bufferedio.o Modules/textio.o Modules/stringio.o Modules/faulthandler.o Modules/_tracemalloc.o Modules/symtablemodule.o Modules/xxsubtype.o
|
| 27 |
+
MODLIBS= $(LOCALMODLIBS) $(BASEMODLIBS)
|
| 28 |
+
|
| 29 |
+
# === Variables set by configure
|
| 30 |
+
VERSION= 3.10
|
| 31 |
+
srcdir= /croot/python-split_1733933809325/work
|
| 32 |
+
VPATH= /croot/python-split_1733933809325/work
|
| 33 |
+
abs_srcdir= /croot/python-split_1733933809325/work
|
| 34 |
+
abs_builddir= /croot/python-split_1733933809325/work/build-static
|
| 35 |
+
|
| 36 |
+
|
| 37 |
+
CC= x86_64-conda-linux-gnu-gcc -pthread
|
| 38 |
+
CXX= x86_64-conda-linux-gnu-c++ -pthread
|
| 39 |
+
MAINCC= $(CC)
|
| 40 |
+
LINKCC= $(PURIFY) $(MAINCC)
|
| 41 |
+
AR= x86_64-conda-linux-gnu-ar
|
| 42 |
+
READELF= x86_64-conda-linux-gnu-readelf
|
| 43 |
+
SOABI= cpython-310-x86_64-linux-gnu
|
| 44 |
+
LDVERSION= $(VERSION)$(ABIFLAGS)
|
| 45 |
+
LIBPYTHON=
|
| 46 |
+
GITVERSION=
|
| 47 |
+
GITTAG=
|
| 48 |
+
GITBRANCH=
|
| 49 |
+
PGO_PROF_GEN_FLAG=-fprofile-generate
|
| 50 |
+
PGO_PROF_USE_FLAG=
|
| 51 |
+
LLVM_PROF_MERGER=true
|
| 52 |
+
LLVM_PROF_FILE=
|
| 53 |
+
LLVM_PROF_ERR=no
|
| 54 |
+
DTRACE=
|
| 55 |
+
DFLAGS=
|
| 56 |
+
DTRACE_HEADERS=
|
| 57 |
+
DTRACE_OBJS=
|
| 58 |
+
|
| 59 |
+
GNULD= yes
|
| 60 |
+
|
| 61 |
+
# Shell used by make (some versions default to the login shell, which is bad)
|
| 62 |
+
SHELL= /bin/sh
|
| 63 |
+
|
| 64 |
+
# Use this to make a link between python$(VERSION) and python in $(BINDIR)
|
| 65 |
+
LN= ln
|
| 66 |
+
|
| 67 |
+
# Portable install script (configure doesn't always guess right)
|
| 68 |
+
INSTALL= /usr/bin/install -c
|
| 69 |
+
INSTALL_PROGRAM=${INSTALL}
|
| 70 |
+
INSTALL_SCRIPT= ${INSTALL}
|
| 71 |
+
INSTALL_DATA= ${INSTALL} -m 644
|
| 72 |
+
# Shared libraries must be installed with executable mode on some systems;
|
| 73 |
+
# rather than figuring out exactly which, we always give them executable mode.
|
| 74 |
+
INSTALL_SHARED= ${INSTALL} -m 755
|
| 75 |
+
|
| 76 |
+
MKDIR_P= /usr/bin/mkdir -p
|
| 77 |
+
|
| 78 |
+
MAKESETUP= $(srcdir)/Modules/makesetup
|
| 79 |
+
|
| 80 |
+
# Compiler options
|
| 81 |
+
OPT= -DNDEBUG -fwrapv -O2 -Wall
|
| 82 |
+
BASECFLAGS= -Wno-unused-result -Wsign-compare
|
| 83 |
+
BASECPPFLAGS= -IObjects -IInclude -IPython
|
| 84 |
+
CONFIGURE_CFLAGS= -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -isystem /root/envs/janus/include -fdebug-prefix-map=/croot/python-split_1733933809325/work=/usr/local/src/conda/python-3.10.16 -fdebug-prefix-map=/root/envs/janus=/usr/local/src/conda-prefix
|
| 85 |
+
# CFLAGS_NODIST is used for building the interpreter and stdlib C extensions.
|
| 86 |
+
# Use it when a compiler flag should _not_ be part of the distutils CFLAGS
|
| 87 |
+
# once Python is installed (Issue #21121).
|
| 88 |
+
CONFIGURE_CFLAGS_NODIST= -fno-semantic-interposition -g -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -fvisibility=hidden
|
| 89 |
+
# LDFLAGS_NODIST is used in the same manner as CFLAGS_NODIST.
|
| 90 |
+
# Use it when a linker flag should _not_ be part of the distutils LDFLAGS
|
| 91 |
+
# once Python is installed (bpo-35257)
|
| 92 |
+
CONFIGURE_LDFLAGS_NODIST= -fno-semantic-interposition -g
|
| 93 |
+
CONFIGURE_CPPFLAGS= -DNDEBUG -D_FORTIFY_SOURCE=2 -O2 -isystem /root/envs/janus/include -I/root/envs/janus/include
|
| 94 |
+
CONFIGURE_LDFLAGS= -Wl,-O2 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,--disable-new-dtags -Wl,--gc-sections -Wl,-rpath,/root/envs/janus/lib -Wl,-rpath-link,/root/envs/janus/lib -L/root/envs/janus/lib
|
| 95 |
+
# Avoid assigning CFLAGS, LDFLAGS, etc. so users can use them on the
|
| 96 |
+
# command line to append to these values without stomping the pre-set
|
| 97 |
+
# values.
|
| 98 |
+
PY_CFLAGS= $(BASECFLAGS) $(OPT) $(CONFIGURE_CFLAGS) $(CFLAGS) $(EXTRA_CFLAGS)
|
| 99 |
+
PY_CFLAGS_NODIST=$(CONFIGURE_CFLAGS_NODIST) $(CFLAGS_NODIST) -I$(srcdir)/Include/internal
|
| 100 |
+
# Both CPPFLAGS and LDFLAGS need to contain the shell's value for setup.py to
|
| 101 |
+
# be able to build extension modules using the directories specified in the
|
| 102 |
+
# environment variables
|
| 103 |
+
PY_CPPFLAGS= $(BASECPPFLAGS) -I. -I$(srcdir)/Include $(CONFIGURE_CPPFLAGS) $(CPPFLAGS)
|
| 104 |
+
PY_LDFLAGS= $(CONFIGURE_LDFLAGS) $(LDFLAGS)
|
| 105 |
+
PY_LDFLAGS_NODIST=$(CONFIGURE_LDFLAGS_NODIST) $(LDFLAGS_NODIST)
|
| 106 |
+
NO_AS_NEEDED= -Wl,--no-as-needed
|
| 107 |
+
CCSHARED= -fPIC
|
| 108 |
+
# LINKFORSHARED are the flags passed to the $(CC) command that links
|
| 109 |
+
# the python executable -- this is only needed for a few systems
|
| 110 |
+
LINKFORSHARED= -Xlinker -export-dynamic
|
| 111 |
+
ARFLAGS= rcs
|
| 112 |
+
# Extra C flags added for building the interpreter object files.
|
| 113 |
+
CFLAGSFORSHARED=
|
| 114 |
+
# C flags used for building the interpreter object files
|
| 115 |
+
PY_STDMODULE_CFLAGS= $(PY_CFLAGS) $(PY_CFLAGS_NODIST) $(PY_CPPFLAGS) $(CFLAGSFORSHARED)
|
| 116 |
+
PY_BUILTIN_MODULE_CFLAGS= $(PY_STDMODULE_CFLAGS) -DPy_BUILD_CORE_BUILTIN
|
| 117 |
+
PY_CORE_CFLAGS= $(PY_STDMODULE_CFLAGS) -DPy_BUILD_CORE
|
| 118 |
+
# Linker flags used for building the interpreter object files
|
| 119 |
+
PY_CORE_LDFLAGS=$(PY_LDFLAGS) $(PY_LDFLAGS_NODIST)
|
| 120 |
+
# Strict or non-strict aliasing flags used to compile dtoa.c, see above
|
| 121 |
+
CFLAGS_ALIASING=
|
| 122 |
+
|
| 123 |
+
|
| 124 |
+
# Machine-dependent subdirectories
|
| 125 |
+
MACHDEP= linux
|
| 126 |
+
|
| 127 |
+
# Multiarch directory (may be empty)
|
| 128 |
+
MULTIARCH= x86_64-linux-gnu
|
| 129 |
+
MULTIARCH_CPPFLAGS = -DMULTIARCH=\"x86_64-linux-gnu\"
|
| 130 |
+
|
| 131 |
+
# Install prefix for architecture-independent files
|
| 132 |
+
prefix= /root/envs/janus
|
| 133 |
+
|
| 134 |
+
# Install prefix for architecture-dependent files
|
| 135 |
+
exec_prefix= ${prefix}
|
| 136 |
+
|
| 137 |
+
# Install prefix for data files
|
| 138 |
+
datarootdir= ${prefix}/share
|
| 139 |
+
|
| 140 |
+
# Expanded directories
|
| 141 |
+
BINDIR= ${exec_prefix}/bin
|
| 142 |
+
LIBDIR= ${exec_prefix}/lib
|
| 143 |
+
MANDIR= ${datarootdir}/man
|
| 144 |
+
INCLUDEDIR= ${prefix}/include
|
| 145 |
+
CONFINCLUDEDIR= $(exec_prefix)/include
|
| 146 |
+
PLATLIBDIR= lib
|
| 147 |
+
SCRIPTDIR= $(prefix)/$(PLATLIBDIR)
|
| 148 |
+
ABIFLAGS=
|
| 149 |
+
# Variable used by ensurepip
|
| 150 |
+
WHEEL_PKG_DIR=
|
| 151 |
+
|
| 152 |
+
# Detailed destination directories
|
| 153 |
+
BINLIBDEST= ${exec_prefix}/${PLATLIBDIR}/python$(VERSION)
|
| 154 |
+
LIBDEST= $(SCRIPTDIR)/python$(VERSION)
|
| 155 |
+
INCLUDEPY= $(INCLUDEDIR)/python$(LDVERSION)
|
| 156 |
+
CONFINCLUDEPY= $(CONFINCLUDEDIR)/python$(LDVERSION)
|
| 157 |
+
|
| 158 |
+
# Symbols used for using shared libraries
|
| 159 |
+
SHLIB_SUFFIX= .so
|
| 160 |
+
EXT_SUFFIX= .cpython-310-x86_64-linux-gnu.so
|
| 161 |
+
LDSHARED= $(CC) -shared $(PY_LDFLAGS)
|
| 162 |
+
BLDSHARED= $(CC) -shared $(PY_CORE_LDFLAGS)
|
| 163 |
+
LDCXXSHARED= $(CXX) -shared
|
| 164 |
+
DESTSHARED= $(BINLIBDEST)/lib-dynload
|
| 165 |
+
|
| 166 |
+
# List of exported symbols for AIX
|
| 167 |
+
EXPORTSYMS=
|
| 168 |
+
EXPORTSFROM=
|
| 169 |
+
|
| 170 |
+
# Executable suffix (.exe on Windows and Mac OS X)
|
| 171 |
+
EXE=
|
| 172 |
+
BUILDEXE=
|
| 173 |
+
|
| 174 |
+
# Short name and location for Mac OS X Python framework
|
| 175 |
+
UNIVERSALSDK=
|
| 176 |
+
PYTHONFRAMEWORK=
|
| 177 |
+
PYTHONFRAMEWORKDIR= no-framework
|
| 178 |
+
PYTHONFRAMEWORKPREFIX=
|
| 179 |
+
PYTHONFRAMEWORKINSTALLDIR=
|
| 180 |
+
# Deployment target selected during configure, to be checked
|
| 181 |
+
# by distutils. The export statement is needed to ensure that the
|
| 182 |
+
# deployment target is active during build.
|
| 183 |
+
MACOSX_DEPLOYMENT_TARGET=
|
| 184 |
+
#export MACOSX_DEPLOYMENT_TARGET
|
| 185 |
+
|
| 186 |
+
# Option to install to strip binaries
|
| 187 |
+
STRIPFLAG=-s
|
| 188 |
+
|
| 189 |
+
# Flags to lipo to produce a 32-bit-only universal executable
|
| 190 |
+
LIPO_32BIT_FLAGS=
|
| 191 |
+
|
| 192 |
+
# Flags to lipo to produce an intel-64-only universal executable
|
| 193 |
+
LIPO_INTEL64_FLAGS=
|
| 194 |
+
|
| 195 |
+
# Options to enable prebinding (for fast startup prior to Mac OS X 10.3)
|
| 196 |
+
OTHER_LIBTOOL_OPT=
|
| 197 |
+
|
| 198 |
+
# Environment to run shared python without installed libraries
|
| 199 |
+
RUNSHARED=
|
| 200 |
+
|
| 201 |
+
# ensurepip options
|
| 202 |
+
ENSUREPIP= no
|
| 203 |
+
|
| 204 |
+
# OpenSSL options for setup.py so sysconfig can pick up AC_SUBST() vars.
|
| 205 |
+
OPENSSL_INCLUDES=-I/root/envs/janus/include
|
| 206 |
+
OPENSSL_LIBS=-lssl -lcrypto
|
| 207 |
+
OPENSSL_LDFLAGS=-L/root/envs/janus/lib
|
| 208 |
+
OPENSSL_RPATH=
|
| 209 |
+
|
| 210 |
+
# Default zoneinfo.TZPATH. Added here to expose it in sysconfig.get_config_var
|
| 211 |
+
TZPATH=/root/envs/janus/share/zoneinfo
|
| 212 |
+
|
| 213 |
+
# Modes for directories, executables and data files created by the
|
| 214 |
+
# install process. Default to user-only-writable for all file types.
|
| 215 |
+
DIRMODE= 755
|
| 216 |
+
EXEMODE= 755
|
| 217 |
+
FILEMODE= 644
|
| 218 |
+
|
| 219 |
+
# configure script arguments
|
| 220 |
+
CONFIG_ARGS= '--prefix=/root/envs/janus' '--build=x86_64-conda-linux-gnu' '--host=x86_64-conda-linux-gnu' '--enable-ipv6' '--with-ensurepip=no' '--with-tzpath=/root/envs/janus/share/zoneinfo' '--with-computed-gotos' '--with-system-ffi' '--enable-loadable-sqlite-extensions' '--with-tcltk-includes=-I/root/envs/janus/include' '--with-tcltk-libs=-L/root/envs/janus/lib -ltcl8.6 -ltk8.6' '--with-platlibdir=lib' '--with-lto' '--enable-optimizations' '-oldincludedir=/croot/python-split_1733933809325/_build_env/x86_64-conda-linux-gnu/sysroot/usr/include' '--disable-shared' 'PROFILE_TASK=-m test --pgo' 'build_alias=x86_64-conda-linux-gnu' 'host_alias=x86_64-conda-linux-gnu' 'MACHDEP=linux' 'CC=x86_64-conda-linux-gnu-gcc' 'CFLAGS=-march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -isystem /root/envs/janus/include -fdebug-prefix-map=/croot/python-split_1733933809325/work=/usr/local/src/conda/python-3.10.16 -fdebug-prefix-map=/root/envs/janus=/usr/local/src/conda-prefix ' 'LDFLAGS=-Wl,-O2 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,--disable-new-dtags -Wl,--gc-sections -Wl,-rpath,/root/envs/janus/lib -Wl,-rpath-link,/root/envs/janus/lib -L/root/envs/janus/lib' 'CPPFLAGS=-DNDEBUG -D_FORTIFY_SOURCE=2 -O2 -isystem /root/envs/janus/include -I/root/envs/janus/include' 'CPP=/croot/python-split_1733933809325/_build_env/bin/x86_64-conda-linux-gnu-cpp' 'PKG_CONFIG_PATH=/root/envs/janus/lib/pkgconfig'
|
| 221 |
+
|
| 222 |
+
|
| 223 |
+
# Subdirectories with code
|
| 224 |
+
SRCDIRS= Parser Objects Python Modules Modules/_io Programs
|
| 225 |
+
|
| 226 |
+
# Other subdirectories
|
| 227 |
+
SUBDIRSTOO= Include Lib Misc
|
| 228 |
+
|
| 229 |
+
# Files and directories to be distributed
|
| 230 |
+
CONFIGFILES= configure configure.ac acconfig.h pyconfig.h.in Makefile.pre.in
|
| 231 |
+
DISTFILES= README.rst ChangeLog $(CONFIGFILES)
|
| 232 |
+
DISTDIRS= $(SUBDIRS) $(SUBDIRSTOO) Ext-dummy
|
| 233 |
+
DIST= $(DISTFILES) $(DISTDIRS)
|
| 234 |
+
|
| 235 |
+
|
| 236 |
+
LIBRARY= libpython$(VERSION)$(ABIFLAGS).a
|
| 237 |
+
LDLIBRARY= libpython$(VERSION)$(ABIFLAGS).a
|
| 238 |
+
BLDLIBRARY= $(LDLIBRARY)
|
| 239 |
+
PY3LIBRARY=
|
| 240 |
+
DLLLIBRARY=
|
| 241 |
+
LDLIBRARYDIR=
|
| 242 |
+
INSTSONAME= $(LDLIBRARY)
|
| 243 |
+
LIBRARY_DEPS= $(LIBRARY) $(PY3LIBRARY) $(EXPORTSYMS)
|
| 244 |
+
PY_ENABLE_SHARED= 0
|
| 245 |
+
STATIC_LIBPYTHON= 1
|
| 246 |
+
|
| 247 |
+
|
| 248 |
+
LIBS= -lcrypt -lpthread -ldl -lutil -lm
|
| 249 |
+
LIBM= -lm
|
| 250 |
+
LIBC=
|
| 251 |
+
SYSLIBS= $(LIBM) $(LIBC)
|
| 252 |
+
SHLIBS= $(LIBS)
|
| 253 |
+
|
| 254 |
+
DLINCLDIR= .
|
| 255 |
+
DYNLOADFILE= dynload_shlib.o
|
| 256 |
+
MACHDEP_OBJS=
|
| 257 |
+
LIBOBJDIR= Python/
|
| 258 |
+
LIBOBJS=
|
| 259 |
+
|
| 260 |
+
PYTHON= python$(EXE)
|
| 261 |
+
BUILDPYTHON= python$(BUILDEXE)
|
| 262 |
+
|
| 263 |
+
PYTHON_FOR_REGEN?=python3
|
| 264 |
+
UPDATE_FILE=$(PYTHON_FOR_REGEN) $(srcdir)/Tools/scripts/update_file.py
|
| 265 |
+
PY_BUILD_ENVIRON=
|
| 266 |
+
PYTHON_FOR_BUILD=./$(BUILDPYTHON) -E
|
| 267 |
+
_PYTHON_HOST_PLATFORM=linux-x86_64
|
| 268 |
+
BUILD_GNU_TYPE= x86_64-conda-linux-gnu
|
| 269 |
+
HOST_GNU_TYPE= x86_64-conda-linux-gnu
|
| 270 |
+
|
| 271 |
+
# Tcl and Tk config info from --with-tcltk-includes and -libs options
|
| 272 |
+
TCLTK_INCLUDES= -I/root/envs/janus/include
|
| 273 |
+
TCLTK_LIBS= -L/root/envs/janus/lib -ltcl8.6 -ltk8.6
|
| 274 |
+
|
| 275 |
+
# The task to run while instrumented when building the profile-opt target.
|
| 276 |
+
# To speed up profile generation, we don't run the full unit test suite
|
| 277 |
+
# by default. The default is "-m test --pgo". To run more tests, use
|
| 278 |
+
# PROFILE_TASK="-m test --pgo-extended"
|
| 279 |
+
PROFILE_TASK= -m test --pgo
|
| 280 |
+
|
| 281 |
+
# report files for gcov / lcov coverage report
|
| 282 |
+
COVERAGE_INFO= $(abs_builddir)/coverage.info
|
| 283 |
+
COVERAGE_REPORT=$(abs_builddir)/lcov-report
|
| 284 |
+
COVERAGE_REPORT_OPTIONS=--no-branch-coverage --title "CPython lcov report"
|
| 285 |
+
|
| 286 |
+
|
| 287 |
+
# === Definitions added by makesetup ===
|
| 288 |
+
|
| 289 |
+
LOCALMODLIBS=
|
| 290 |
+
BASEMODLIBS=
|
| 291 |
+
PYTHONPATH=$(COREPYTHONPATH)
|
| 292 |
+
COREPYTHONPATH=$(DESTPATH)$(SITEPATH)$(TESTPATH)
|
| 293 |
+
TESTPATH=
|
| 294 |
+
SITEPATH=
|
| 295 |
+
DESTPATH=
|
| 296 |
+
MACHDESTLIB=$(BINLIBDEST)
|
| 297 |
+
DESTLIB=$(LIBDEST)
|
| 298 |
+
|
| 299 |
+
|
| 300 |
+
|
| 301 |
+
##########################################################################
|
| 302 |
+
# Modules
|
| 303 |
+
MODULE_OBJS= \
|
| 304 |
+
Modules/config.o \
|
| 305 |
+
Modules/getpath.o \
|
| 306 |
+
Modules/main.o \
|
| 307 |
+
Modules/gcmodule.o
|
| 308 |
+
|
| 309 |
+
IO_H= Modules/_io/_iomodule.h
|
| 310 |
+
|
| 311 |
+
IO_OBJS= \
|
| 312 |
+
Modules/_io/_iomodule.o \
|
| 313 |
+
Modules/_io/iobase.o \
|
| 314 |
+
Modules/_io/fileio.o \
|
| 315 |
+
Modules/_io/bufferedio.o \
|
| 316 |
+
Modules/_io/textio.o \
|
| 317 |
+
Modules/_io/bytesio.o \
|
| 318 |
+
Modules/_io/stringio.o
|
| 319 |
+
|
| 320 |
+
##########################################################################
|
| 321 |
+
|
| 322 |
+
LIBFFI_INCLUDEDIR= /root/envs/janus/include
|
| 323 |
+
|
| 324 |
+
##########################################################################
|
| 325 |
+
# Parser
|
| 326 |
+
|
| 327 |
+
PEGEN_OBJS= \
|
| 328 |
+
Parser/pegen.o \
|
| 329 |
+
Parser/parser.o \
|
| 330 |
+
Parser/string_parser.o \
|
| 331 |
+
Parser/peg_api.o
|
| 332 |
+
|
| 333 |
+
|
| 334 |
+
PEGEN_HEADERS= \
|
| 335 |
+
$(srcdir)/Include/internal/pycore_parser.h \
|
| 336 |
+
$(srcdir)/Parser/pegen.h \
|
| 337 |
+
$(srcdir)/Parser/string_parser.h
|
| 338 |
+
|
| 339 |
+
POBJS= \
|
| 340 |
+
Parser/token.o \
|
| 341 |
+
|
| 342 |
+
PARSER_OBJS= $(POBJS) $(PEGEN_OBJS) Parser/myreadline.o Parser/tokenizer.o
|
| 343 |
+
|
| 344 |
+
PARSER_HEADERS= \
|
| 345 |
+
$(PEGEN_HEADERS) \
|
| 346 |
+
$(srcdir)/Parser/tokenizer.h
|
| 347 |
+
|
| 348 |
+
##########################################################################
|
| 349 |
+
# Python
|
| 350 |
+
|
| 351 |
+
PYTHON_OBJS= \
|
| 352 |
+
Python/_warnings.o \
|
| 353 |
+
Python/Python-ast.o \
|
| 354 |
+
Python/asdl.o \
|
| 355 |
+
Python/ast.o \
|
| 356 |
+
Python/ast_opt.o \
|
| 357 |
+
Python/ast_unparse.o \
|
| 358 |
+
Python/bltinmodule.o \
|
| 359 |
+
Python/ceval.o \
|
| 360 |
+
Python/codecs.o \
|
| 361 |
+
Python/compile.o \
|
| 362 |
+
Python/context.o \
|
| 363 |
+
Python/dynamic_annotations.o \
|
| 364 |
+
Python/errors.o \
|
| 365 |
+
Python/frozenmain.o \
|
| 366 |
+
Python/future.o \
|
| 367 |
+
Python/getargs.o \
|
| 368 |
+
Python/getcompiler.o \
|
| 369 |
+
Python/getcopyright.o \
|
| 370 |
+
Python/getplatform.o \
|
| 371 |
+
Python/getversion.o \
|
| 372 |
+
Python/hamt.o \
|
| 373 |
+
Python/hashtable.o \
|
| 374 |
+
Python/import.o \
|
| 375 |
+
Python/importdl.o \
|
| 376 |
+
Python/initconfig.o \
|
| 377 |
+
Python/marshal.o \
|
| 378 |
+
Python/modsupport.o \
|
| 379 |
+
Python/mysnprintf.o \
|
| 380 |
+
Python/mystrtoul.o \
|
| 381 |
+
Python/pathconfig.o \
|
| 382 |
+
Python/preconfig.o \
|
| 383 |
+
Python/pyarena.o \
|
| 384 |
+
Python/pyctype.o \
|
| 385 |
+
Python/pyfpe.o \
|
| 386 |
+
Python/pyhash.o \
|
| 387 |
+
Python/pylifecycle.o \
|
| 388 |
+
Python/pymath.o \
|
| 389 |
+
Python/pystate.o \
|
| 390 |
+
Python/pythonrun.o \
|
| 391 |
+
Python/pytime.o \
|
| 392 |
+
Python/bootstrap_hash.o \
|
| 393 |
+
Python/structmember.o \
|
| 394 |
+
Python/symtable.o \
|
| 395 |
+
Python/sysmodule.o \
|
| 396 |
+
Python/thread.o \
|
| 397 |
+
Python/traceback.o \
|
| 398 |
+
Python/getopt.o \
|
| 399 |
+
Python/pystrcmp.o \
|
| 400 |
+
Python/pystrtod.o \
|
| 401 |
+
Python/pystrhex.o \
|
| 402 |
+
Python/dtoa.o \
|
| 403 |
+
Python/formatter_unicode.o \
|
| 404 |
+
Python/fileutils.o \
|
| 405 |
+
Python/suggestions.o \
|
| 406 |
+
Python/$(DYNLOADFILE) \
|
| 407 |
+
$(LIBOBJS) \
|
| 408 |
+
$(MACHDEP_OBJS) \
|
| 409 |
+
$(DTRACE_OBJS)
|
| 410 |
+
|
| 411 |
+
|
| 412 |
+
##########################################################################
|
| 413 |
+
# Objects
|
| 414 |
+
OBJECT_OBJS= \
|
| 415 |
+
Objects/abstract.o \
|
| 416 |
+
Objects/accu.o \
|
| 417 |
+
Objects/boolobject.o \
|
| 418 |
+
Objects/bytes_methods.o \
|
| 419 |
+
Objects/bytearrayobject.o \
|
| 420 |
+
Objects/bytesobject.o \
|
| 421 |
+
Objects/call.o \
|
| 422 |
+
Objects/capsule.o \
|
| 423 |
+
Objects/cellobject.o \
|
| 424 |
+
Objects/classobject.o \
|
| 425 |
+
Objects/codeobject.o \
|
| 426 |
+
Objects/complexobject.o \
|
| 427 |
+
Objects/descrobject.o \
|
| 428 |
+
Objects/enumobject.o \
|
| 429 |
+
Objects/exceptions.o \
|
| 430 |
+
Objects/genericaliasobject.o \
|
| 431 |
+
Objects/genobject.o \
|
| 432 |
+
Objects/fileobject.o \
|
| 433 |
+
Objects/floatobject.o \
|
| 434 |
+
Objects/frameobject.o \
|
| 435 |
+
Objects/funcobject.o \
|
| 436 |
+
Objects/interpreteridobject.o \
|
| 437 |
+
Objects/iterobject.o \
|
| 438 |
+
Objects/listobject.o \
|
| 439 |
+
Objects/longobject.o \
|
| 440 |
+
Objects/dictobject.o \
|
| 441 |
+
Objects/odictobject.o \
|
| 442 |
+
Objects/memoryobject.o \
|
| 443 |
+
Objects/methodobject.o \
|
| 444 |
+
Objects/moduleobject.o \
|
| 445 |
+
Objects/namespaceobject.o \
|
| 446 |
+
Objects/object.o \
|
| 447 |
+
Objects/obmalloc.o \
|
| 448 |
+
Objects/picklebufobject.o \
|
| 449 |
+
Objects/rangeobject.o \
|
| 450 |
+
Objects/setobject.o \
|
| 451 |
+
Objects/sliceobject.o \
|
| 452 |
+
Objects/structseq.o \
|
| 453 |
+
Objects/tupleobject.o \
|
| 454 |
+
Objects/typeobject.o \
|
| 455 |
+
Objects/unicodeobject.o \
|
| 456 |
+
Objects/unicodectype.o \
|
| 457 |
+
Objects/unionobject.o \
|
| 458 |
+
Objects/weakrefobject.o
|
| 459 |
+
|
| 460 |
+
##########################################################################
|
| 461 |
+
# objects that get linked into the Python library
|
| 462 |
+
LIBRARY_OBJS_OMIT_FROZEN= \
|
| 463 |
+
Modules/getbuildinfo.o \
|
| 464 |
+
$(PARSER_OBJS) \
|
| 465 |
+
$(OBJECT_OBJS) \
|
| 466 |
+
$(PYTHON_OBJS) \
|
| 467 |
+
$(MODULE_OBJS) \
|
| 468 |
+
$(MODOBJS)
|
| 469 |
+
|
| 470 |
+
LIBRARY_OBJS= \
|
| 471 |
+
$(LIBRARY_OBJS_OMIT_FROZEN) \
|
| 472 |
+
Python/frozen.o
|
| 473 |
+
|
| 474 |
+
##########################################################################
|
| 475 |
+
# DTrace
|
| 476 |
+
|
| 477 |
+
# On some systems, object files that reference DTrace probes need to be modified
|
| 478 |
+
# in-place by dtrace(1).
|
| 479 |
+
DTRACE_DEPS = \
|
| 480 |
+
Python/ceval.o Python/import.o Python/sysmodule.o Modules/gcmodule.o
|
| 481 |
+
|
| 482 |
+
#########################################################################
|
| 483 |
+
# Rules
|
| 484 |
+
|
| 485 |
+
# Default target
|
| 486 |
+
all: profile-opt
|
| 487 |
+
build_all: check-clean-src $(BUILDPYTHON) oldsharedmods sharedmods gdbhooks \
|
| 488 |
+
Programs/_testembed python-config
|
| 489 |
+
|
| 490 |
+
# Check that the source is clean when building out of source.
|
| 491 |
+
check-clean-src:
|
| 492 |
+
@if test -n "$(VPATH)" -a -f "$(srcdir)/Programs/python.o"; then \
|
| 493 |
+
echo "Error: The source directory ($(srcdir)) is not clean" ; \
|
| 494 |
+
echo "Building Python out of the source tree (in $(abs_builddir)) requires a clean source tree ($(abs_srcdir))" ; \
|
| 495 |
+
echo "Try to run: make -C \"$(srcdir)\" clean" ; \
|
| 496 |
+
exit 1; \
|
| 497 |
+
fi
|
| 498 |
+
|
| 499 |
+
# Profile generation build must start from a clean tree.
|
| 500 |
+
profile-clean-stamp:
|
| 501 |
+
$(MAKE) clean
|
| 502 |
+
touch $@
|
| 503 |
+
|
| 504 |
+
# Compile with profile generation enabled.
|
| 505 |
+
profile-gen-stamp: profile-clean-stamp
|
| 506 |
+
@if [ $(LLVM_PROF_ERR) = yes ]; then \
|
| 507 |
+
echo "Error: Cannot perform PGO build because llvm-profdata was not found in PATH" ;\
|
| 508 |
+
echo "Please add it to PATH and run ./configure again" ;\
|
| 509 |
+
exit 1;\
|
| 510 |
+
fi
|
| 511 |
+
@echo "Building with support for profile generation:"
|
| 512 |
+
$(MAKE) build_all_generate_profile
|
| 513 |
+
touch $@
|
| 514 |
+
|
| 515 |
+
# Run task with profile generation build to create profile information.
|
| 516 |
+
profile-run-stamp:
|
| 517 |
+
@echo "Running code to generate profile data (this can take a while):"
|
| 518 |
+
# First, we need to create a clean build with profile generation
|
| 519 |
+
# enabled.
|
| 520 |
+
$(MAKE) profile-gen-stamp
|
| 521 |
+
# Next, run the profile task to generate the profile information.
|
| 522 |
+
$(MAKE) run_profile_task
|
| 523 |
+
$(MAKE) build_all_merge_profile
|
| 524 |
+
# Remove profile generation binary since we are done with it.
|
| 525 |
+
$(MAKE) clean-retain-profile
|
| 526 |
+
# This is an expensive target to build and it does not have proper
|
| 527 |
+
# makefile dependency information. So, we create a "stamp" file
|
| 528 |
+
# to record its completion and avoid re-running it.
|
| 529 |
+
touch $@
|
| 530 |
+
|
| 531 |
+
build_all_generate_profile:
|
| 532 |
+
$(MAKE) build_all CFLAGS_NODIST="$(CFLAGS_NODIST) $(PGO_PROF_GEN_FLAG)" LDFLAGS_NODIST="$(LDFLAGS_NODIST) $(PGO_PROF_GEN_FLAG)" LIBS="$(LIBS)"
|
| 533 |
+
|
| 534 |
+
run_profile_task:
|
| 535 |
+
@ # FIXME: can't run for a cross build
|
| 536 |
+
$(LLVM_PROF_FILE) $(RUNSHARED) ./$(BUILDPYTHON) $(PROFILE_TASK) || true
|
| 537 |
+
|
| 538 |
+
build_all_merge_profile:
|
| 539 |
+
$(LLVM_PROF_MERGER)
|
| 540 |
+
|
| 541 |
+
# Compile Python binary with profile guided optimization.
|
| 542 |
+
# To force re-running of the profile task, remove the profile-run-stamp file.
|
| 543 |
+
profile-opt: profile-run-stamp
|
| 544 |
+
@echo "Rebuilding with profile guided optimizations:"
|
| 545 |
+
-rm -f profile-clean-stamp
|
| 546 |
+
$(MAKE) build_all CFLAGS_NODIST="$(CFLAGS_NODIST) $(PGO_PROF_USE_FLAG)" LDFLAGS_NODIST="$(LDFLAGS_NODIST)"
|
| 547 |
+
|
| 548 |
+
# Compile and run with gcov
|
| 549 |
+
.PHONY=coverage coverage-lcov coverage-report
|
| 550 |
+
coverage:
|
| 551 |
+
@echo "Building with support for coverage checking:"
|
| 552 |
+
$(MAKE) clean
|
| 553 |
+
$(MAKE) build_all CFLAGS="$(CFLAGS) -O0 -pg --coverage" LIBS="$(LIBS) --coverage"
|
| 554 |
+
|
| 555 |
+
coverage-lcov:
|
| 556 |
+
@echo "Creating Coverage HTML report with LCOV:"
|
| 557 |
+
@rm -f $(COVERAGE_INFO)
|
| 558 |
+
@rm -rf $(COVERAGE_REPORT)
|
| 559 |
+
@lcov --capture --directory $(abs_builddir) \
|
| 560 |
+
--base-directory $(realpath $(abs_builddir)) \
|
| 561 |
+
--path $(realpath $(abs_srcdir)) \
|
| 562 |
+
--output-file $(COVERAGE_INFO)
|
| 563 |
+
@ # remove 3rd party modules, system headers and internal files with
|
| 564 |
+
@ # debug, test or dummy functions.
|
| 565 |
+
@lcov --remove $(COVERAGE_INFO) \
|
| 566 |
+
'*/Modules/_blake2/impl/*' \
|
| 567 |
+
'*/Modules/_ctypes/libffi*/*' \
|
| 568 |
+
'*/Modules/_decimal/libmpdec/*' \
|
| 569 |
+
'*/Modules/_sha3/kcp/*' \
|
| 570 |
+
'*/Modules/expat/*' \
|
| 571 |
+
'*/Modules/zlib/*' \
|
| 572 |
+
'*/Include/*' \
|
| 573 |
+
'*/Modules/xx*.c' \
|
| 574 |
+
'*/Python/pyfpe.c' \
|
| 575 |
+
'*/Python/pystrcmp.c' \
|
| 576 |
+
'/usr/include/*' \
|
| 577 |
+
'/usr/local/include/*' \
|
| 578 |
+
'/usr/lib/gcc/*' \
|
| 579 |
+
--output-file $(COVERAGE_INFO)
|
| 580 |
+
@genhtml $(COVERAGE_INFO) --output-directory $(COVERAGE_REPORT) \
|
| 581 |
+
$(COVERAGE_REPORT_OPTIONS)
|
| 582 |
+
@echo
|
| 583 |
+
@echo "lcov report at $(COVERAGE_REPORT)/index.html"
|
| 584 |
+
@echo
|
| 585 |
+
|
| 586 |
+
# Force regeneration of parser and importlib
|
| 587 |
+
coverage-report: regen-token regen-importlib
|
| 588 |
+
@ # build with coverage info
|
| 589 |
+
$(MAKE) coverage
|
| 590 |
+
@ # run tests, ignore failures
|
| 591 |
+
$(TESTRUNNER) $(TESTOPTS) || true
|
| 592 |
+
@ # build lcov report
|
| 593 |
+
$(MAKE) coverage-lcov
|
| 594 |
+
|
| 595 |
+
# Run "Argument Clinic" over all source files
|
| 596 |
+
.PHONY=clinic
|
| 597 |
+
clinic: check-clean-src $(srcdir)/Modules/_blake2/blake2s_impl.c
|
| 598 |
+
$(PYTHON_FOR_REGEN) $(srcdir)/Tools/clinic/clinic.py --make --srcdir $(srcdir)
|
| 599 |
+
|
| 600 |
+
# Build the interpreter
|
| 601 |
+
$(BUILDPYTHON): Programs/python.o $(LIBRARY_DEPS)
|
| 602 |
+
$(LINKCC) $(PY_CORE_LDFLAGS) $(LINKFORSHARED) -o $@ Programs/python.o $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS)
|
| 603 |
+
|
| 604 |
+
platform: $(BUILDPYTHON) pybuilddir.txt
|
| 605 |
+
$(RUNSHARED) $(PY_BUILD_ENVIRON) $(PYTHON_FOR_BUILD) -c 'import sys ; from sysconfig import get_platform ; print("%s-%d.%d" % (get_platform(), *sys.version_info[:2]))' >platform
|
| 606 |
+
|
| 607 |
+
# Create build directory and generate the sysconfig build-time data there.
|
| 608 |
+
# pybuilddir.txt contains the name of the build dir and is used for
|
| 609 |
+
# sys.path fixup -- see Modules/getpath.c.
|
| 610 |
+
# Since this step runs before shared modules are built, try to avoid bootstrap
|
| 611 |
+
# problems by creating a dummy pybuilddir.txt just to allow interpreter
|
| 612 |
+
# initialization to succeed. It will be overwritten by generate-posix-vars
|
| 613 |
+
# or removed in case of failure.
|
| 614 |
+
pybuilddir.txt: $(BUILDPYTHON)
|
| 615 |
+
@echo "none" > ./pybuilddir.txt
|
| 616 |
+
$(RUNSHARED) $(PY_BUILD_ENVIRON) $(PYTHON_FOR_BUILD) -S -m sysconfig --generate-posix-vars ;\
|
| 617 |
+
if test $$? -ne 0 ; then \
|
| 618 |
+
echo "generate-posix-vars failed" ; \
|
| 619 |
+
rm -f ./pybuilddir.txt ; \
|
| 620 |
+
exit 1 ; \
|
| 621 |
+
fi
|
| 622 |
+
|
| 623 |
+
# This is shared by the math and cmath modules
|
| 624 |
+
Modules/_math.o: Modules/_math.c Modules/_math.h
|
| 625 |
+
$(CC) -c $(CCSHARED) $(PY_CORE_CFLAGS) -o $@ $<
|
| 626 |
+
|
| 627 |
+
# blake2s is auto-generated from blake2b
|
| 628 |
+
$(srcdir)/Modules/_blake2/blake2s_impl.c: $(srcdir)/Modules/_blake2/blake2b_impl.c $(srcdir)/Modules/_blake2/blake2b2s.py
|
| 629 |
+
$(PYTHON_FOR_REGEN) $(srcdir)/Modules/_blake2/blake2b2s.py
|
| 630 |
+
$(PYTHON_FOR_REGEN) $(srcdir)/Tools/clinic/clinic.py -f $@
|
| 631 |
+
|
| 632 |
+
# Build the shared modules
|
| 633 |
+
# Under GNU make, MAKEFLAGS are sorted and normalized; the 's' for
|
| 634 |
+
# -s, --silent or --quiet is always the first char.
|
| 635 |
+
# Under BSD make, MAKEFLAGS might be " -s -v x=y".
|
| 636 |
+
# Ignore macros passed by GNU make, passed after --
|
| 637 |
+
sharedmods: $(BUILDPYTHON) pybuilddir.txt Modules/_math.o
|
| 638 |
+
@case "`echo X $$MAKEFLAGS | sed 's/^X //;s/ -- .*//'`" in \
|
| 639 |
+
*\ -s*|s*) quiet="-q";; \
|
| 640 |
+
*) quiet="";; \
|
| 641 |
+
esac; \
|
| 642 |
+
echo "$(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \
|
| 643 |
+
_TCLTK_INCLUDES='$(TCLTK_INCLUDES)' _TCLTK_LIBS='$(TCLTK_LIBS)' \
|
| 644 |
+
$(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build"; \
|
| 645 |
+
$(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \
|
| 646 |
+
_TCLTK_INCLUDES='$(TCLTK_INCLUDES)' _TCLTK_LIBS='$(TCLTK_LIBS)' \
|
| 647 |
+
$(PY_BUILD_ENVIRON) $(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build
|
| 648 |
+
|
| 649 |
+
|
| 650 |
+
# Build static library
|
| 651 |
+
$(LIBRARY): $(LIBRARY_OBJS)
|
| 652 |
+
-rm -f $@
|
| 653 |
+
$(AR) $(ARFLAGS) $@ $(LIBRARY_OBJS)
|
| 654 |
+
|
| 655 |
+
libpython$(LDVERSION).so: $(LIBRARY_OBJS) $(DTRACE_OBJS)
|
| 656 |
+
if test $(INSTSONAME) != $(LDLIBRARY); then \
|
| 657 |
+
$(BLDSHARED) -Wl,-h$(INSTSONAME) -o $(INSTSONAME) $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM); \
|
| 658 |
+
$(LN) -f $(INSTSONAME) $@; \
|
| 659 |
+
else \
|
| 660 |
+
$(BLDSHARED) -o $@ $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM); \
|
| 661 |
+
fi
|
| 662 |
+
|
| 663 |
+
libpython3.so: libpython$(LDVERSION).so
|
| 664 |
+
$(BLDSHARED) $(NO_AS_NEEDED) -o $@ -Wl,-h$@ $^
|
| 665 |
+
|
| 666 |
+
libpython$(LDVERSION).dylib: $(LIBRARY_OBJS)
|
| 667 |
+
$(CC) -dynamiclib -Wl,-single_module $(PY_CORE_LDFLAGS) -undefined dynamic_lookup -Wl,-install_name,$(prefix)/lib/libpython$(LDVERSION).dylib -Wl,-compatibility_version,$(VERSION) -Wl,-current_version,$(VERSION) -o $@ $(LIBRARY_OBJS) $(DTRACE_OBJS) $(SHLIBS) $(LIBC) $(LIBM); \
|
| 668 |
+
|
| 669 |
+
|
| 670 |
+
libpython$(VERSION).sl: $(LIBRARY_OBJS)
|
| 671 |
+
$(LDSHARED) -o $@ $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM)
|
| 672 |
+
|
| 673 |
+
# List of exported symbols for AIX
|
| 674 |
+
Modules/python.exp: $(LIBRARY)
|
| 675 |
+
$(srcdir)/Modules/makexp_aix $@ "$(EXPORTSFROM)" $?
|
| 676 |
+
|
| 677 |
+
# Copy up the gdb python hooks into a position where they can be automatically
|
| 678 |
+
# loaded by gdb during Lib/test/test_gdb.py
|
| 679 |
+
#
|
| 680 |
+
# Distributors are likely to want to install this somewhere else e.g. relative
|
| 681 |
+
# to the stripped DWARF data for the shared library.
|
| 682 |
+
gdbhooks: $(BUILDPYTHON)-gdb.py
|
| 683 |
+
|
| 684 |
+
SRC_GDB_HOOKS=$(srcdir)/Tools/gdb/libpython.py
|
| 685 |
+
$(BUILDPYTHON)-gdb.py: $(SRC_GDB_HOOKS)
|
| 686 |
+
$(INSTALL_DATA) $(SRC_GDB_HOOKS) $(BUILDPYTHON)-gdb.py
|
| 687 |
+
|
| 688 |
+
# This rule is here for OPENSTEP/Rhapsody/MacOSX. It builds a temporary
|
| 689 |
+
# minimal framework (not including the Lib directory and such) in the current
|
| 690 |
+
# directory.
|
| 691 |
+
RESSRCDIR=Mac/Resources/framework
|
| 692 |
+
$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK): \
|
| 693 |
+
$(LIBRARY) \
|
| 694 |
+
$(RESSRCDIR)/Info.plist
|
| 695 |
+
$(INSTALL) -d -m $(DIRMODE) $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)
|
| 696 |
+
$(CC) -o $(LDLIBRARY) $(PY_CORE_LDFLAGS) -dynamiclib \
|
| 697 |
+
-all_load $(LIBRARY) -Wl,-single_module \
|
| 698 |
+
-install_name $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK) \
|
| 699 |
+
-compatibility_version $(VERSION) \
|
| 700 |
+
-current_version $(VERSION) \
|
| 701 |
+
-framework CoreFoundation $(LIBS);
|
| 702 |
+
$(INSTALL) -d -m $(DIRMODE) \
|
| 703 |
+
$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/Resources/English.lproj
|
| 704 |
+
$(INSTALL_DATA) $(RESSRCDIR)/Info.plist \
|
| 705 |
+
$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/Resources/Info.plist
|
| 706 |
+
$(LN) -fsn $(VERSION) $(PYTHONFRAMEWORKDIR)/Versions/Current
|
| 707 |
+
$(LN) -fsn Versions/Current/$(PYTHONFRAMEWORK) $(PYTHONFRAMEWORKDIR)/$(PYTHONFRAMEWORK)
|
| 708 |
+
$(LN) -fsn Versions/Current/Resources $(PYTHONFRAMEWORKDIR)/Resources
|
| 709 |
+
|
| 710 |
+
# This rule builds the Cygwin Python DLL and import library if configured
|
| 711 |
+
# for a shared core library; otherwise, this rule is a noop.
|
| 712 |
+
$(DLLLIBRARY) libpython$(LDVERSION).dll.a: $(LIBRARY_OBJS)
|
| 713 |
+
if test -n "$(DLLLIBRARY)"; then \
|
| 714 |
+
$(LDSHARED) -Wl,--out-implib=$@ -o $(DLLLIBRARY) $^ \
|
| 715 |
+
$(LIBS) $(MODLIBS) $(SYSLIBS); \
|
| 716 |
+
else true; \
|
| 717 |
+
fi
|
| 718 |
+
|
| 719 |
+
|
| 720 |
+
oldsharedmods: $(SHAREDMODS)
|
| 721 |
+
|
| 722 |
+
|
| 723 |
+
Makefile Modules/config.c: Makefile.pre \
|
| 724 |
+
$(srcdir)/Modules/config.c.in \
|
| 725 |
+
$(MAKESETUP) \
|
| 726 |
+
$(srcdir)/Modules/Setup \
|
| 727 |
+
Modules/Setup.local
|
| 728 |
+
$(SHELL) $(MAKESETUP) -c $(srcdir)/Modules/config.c.in \
|
| 729 |
+
-s Modules \
|
| 730 |
+
Modules/Setup.local \
|
| 731 |
+
$(srcdir)/Modules/Setup
|
| 732 |
+
@mv config.c Modules
|
| 733 |
+
@echo "The Makefile was updated, you may need to re-run make."
|
| 734 |
+
|
| 735 |
+
|
| 736 |
+
Programs/_testembed: Programs/_testembed.o $(LIBRARY_DEPS)
|
| 737 |
+
$(LINKCC) $(PY_CORE_LDFLAGS) $(LINKFORSHARED) -o $@ Programs/_testembed.o $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS)
|
| 738 |
+
|
| 739 |
+
############################################################################
|
| 740 |
+
# Importlib
|
| 741 |
+
|
| 742 |
+
Programs/_freeze_importlib.o: Programs/_freeze_importlib.c Makefile
|
| 743 |
+
|
| 744 |
+
Programs/_freeze_importlib: Programs/_freeze_importlib.o $(LIBRARY_OBJS_OMIT_FROZEN)
|
| 745 |
+
$(LINKCC) $(PY_CORE_LDFLAGS) -o $@ Programs/_freeze_importlib.o $(LIBRARY_OBJS_OMIT_FROZEN) $(LIBS) $(MODLIBS) $(SYSLIBS)
|
| 746 |
+
|
| 747 |
+
.PHONY: regen-importlib
|
| 748 |
+
regen-importlib: Programs/_freeze_importlib
|
| 749 |
+
# Regenerate Python/importlib_external.h
|
| 750 |
+
# from Lib/importlib/_bootstrap_external.py using _freeze_importlib
|
| 751 |
+
./Programs/_freeze_importlib importlib._bootstrap_external \
|
| 752 |
+
$(srcdir)/Lib/importlib/_bootstrap_external.py \
|
| 753 |
+
$(srcdir)/Python/importlib_external.h.new
|
| 754 |
+
$(UPDATE_FILE) $(srcdir)/Python/importlib_external.h $(srcdir)/Python/importlib_external.h.new
|
| 755 |
+
# Regenerate Python/importlib.h from Lib/importlib/_bootstrap.py
|
| 756 |
+
# using _freeze_importlib
|
| 757 |
+
./Programs/_freeze_importlib importlib._bootstrap \
|
| 758 |
+
$(srcdir)/Lib/importlib/_bootstrap.py \
|
| 759 |
+
$(srcdir)/Python/importlib.h.new
|
| 760 |
+
$(UPDATE_FILE) $(srcdir)/Python/importlib.h $(srcdir)/Python/importlib.h.new
|
| 761 |
+
# Regenerate Python/importlib_zipimport.h from Lib/zipimport.py
|
| 762 |
+
# using _freeze_importlib
|
| 763 |
+
./Programs/_freeze_importlib zipimport \
|
| 764 |
+
$(srcdir)/Lib/zipimport.py \
|
| 765 |
+
$(srcdir)/Python/importlib_zipimport.h.new
|
| 766 |
+
$(UPDATE_FILE) $(srcdir)/Python/importlib_zipimport.h $(srcdir)/Python/importlib_zipimport.h.new
|
| 767 |
+
|
| 768 |
+
regen-abidump: all
|
| 769 |
+
@$(MKDIR_P) $(srcdir)/Doc/data/
|
| 770 |
+
abidw "libpython$(LDVERSION).so" --no-architecture --out-file $(srcdir)/Doc/data/python$(LDVERSION).abi.new
|
| 771 |
+
@$(UPDATE_FILE) $(srcdir)/Doc/data/python$(LDVERSION).abi $(srcdir)/Doc/data/python$(LDVERSION).abi.new
|
| 772 |
+
|
| 773 |
+
check-abidump: all
|
| 774 |
+
abidiff $(srcdir)/Doc/data/python$(LDVERSION).abi "libpython$(LDVERSION).so" --drop-private-types --no-architecture --no-added-syms
|
| 775 |
+
|
| 776 |
+
regen-limited-abi: all
|
| 777 |
+
$(RUNSHARED) ./$(BUILDPYTHON) $(srcdir)/Tools/scripts/stable_abi.py --generate-all $(srcdir)/Misc/stable_abi.txt
|
| 778 |
+
|
| 779 |
+
|
| 780 |
+
############################################################################
|
| 781 |
+
# Regenerate all generated files
|
| 782 |
+
|
| 783 |
+
regen-all: regen-opcode regen-opcode-targets regen-typeslots \
|
| 784 |
+
regen-token regen-ast regen-keyword regen-importlib clinic \
|
| 785 |
+
regen-pegen-metaparser regen-pegen regen-frozen
|
| 786 |
+
@echo
|
| 787 |
+
@echo "Note: make regen-stdlib-module-names and autoconf should be run manually"
|
| 788 |
+
|
| 789 |
+
############################################################################
|
| 790 |
+
# Special rules for object files
|
| 791 |
+
|
| 792 |
+
Modules/getbuildinfo.o: $(PARSER_OBJS) \
|
| 793 |
+
$(OBJECT_OBJS) \
|
| 794 |
+
$(PYTHON_OBJS) \
|
| 795 |
+
$(MODULE_OBJS) \
|
| 796 |
+
$(MODOBJS) \
|
| 797 |
+
$(DTRACE_OBJS) \
|
| 798 |
+
$(srcdir)/Modules/getbuildinfo.c
|
| 799 |
+
$(CC) -c $(PY_CORE_CFLAGS) \
|
| 800 |
+
-DGITVERSION="\"`LC_ALL=C $(GITVERSION)`\"" \
|
| 801 |
+
-DGITTAG="\"`LC_ALL=C $(GITTAG)`\"" \
|
| 802 |
+
-DGITBRANCH="\"`LC_ALL=C $(GITBRANCH)`\"" \
|
| 803 |
+
-o $@ $(srcdir)/Modules/getbuildinfo.c
|
| 804 |
+
|
| 805 |
+
Modules/getpath.o: $(srcdir)/Modules/getpath.c Makefile
|
| 806 |
+
$(CC) -c $(PY_CORE_CFLAGS) -DPYTHONPATH='"$(PYTHONPATH)"' \
|
| 807 |
+
-DPREFIX='"$(prefix)"' \
|
| 808 |
+
-DEXEC_PREFIX='"$(exec_prefix)"' \
|
| 809 |
+
-DVERSION='"$(VERSION)"' \
|
| 810 |
+
-DVPATH='"$(VPATH)"' \
|
| 811 |
+
-o $@ $(srcdir)/Modules/getpath.c
|
| 812 |
+
|
| 813 |
+
Programs/python.o: $(srcdir)/Programs/python.c
|
| 814 |
+
$(MAINCC) -c $(PY_CORE_CFLAGS) -o $@ $(srcdir)/Programs/python.c
|
| 815 |
+
|
| 816 |
+
Programs/_testembed.o: $(srcdir)/Programs/_testembed.c
|
| 817 |
+
$(MAINCC) -c $(PY_CORE_CFLAGS) -o $@ $(srcdir)/Programs/_testembed.c
|
| 818 |
+
|
| 819 |
+
Modules/_sre.o: $(srcdir)/Modules/_sre.c $(srcdir)/Modules/sre.h $(srcdir)/Modules/sre_constants.h $(srcdir)/Modules/sre_lib.h
|
| 820 |
+
|
| 821 |
+
Modules/posixmodule.o: $(srcdir)/Modules/posixmodule.c $(srcdir)/Modules/posixmodule.h
|
| 822 |
+
|
| 823 |
+
Modules/grpmodule.o: $(srcdir)/Modules/grpmodule.c $(srcdir)/Modules/posixmodule.h
|
| 824 |
+
|
| 825 |
+
Modules/pwdmodule.o: $(srcdir)/Modules/pwdmodule.c $(srcdir)/Modules/posixmodule.h
|
| 826 |
+
|
| 827 |
+
Modules/signalmodule.o: $(srcdir)/Modules/signalmodule.c $(srcdir)/Modules/posixmodule.h
|
| 828 |
+
|
| 829 |
+
Python/dynload_shlib.o: $(srcdir)/Python/dynload_shlib.c Makefile
|
| 830 |
+
$(CC) -c $(PY_CORE_CFLAGS) \
|
| 831 |
+
-DSOABI='"$(SOABI)"' \
|
| 832 |
+
-o $@ $(srcdir)/Python/dynload_shlib.c
|
| 833 |
+
|
| 834 |
+
Python/dynload_hpux.o: $(srcdir)/Python/dynload_hpux.c Makefile
|
| 835 |
+
$(CC) -c $(PY_CORE_CFLAGS) \
|
| 836 |
+
-DSHLIB_EXT='"$(EXT_SUFFIX)"' \
|
| 837 |
+
-o $@ $(srcdir)/Python/dynload_hpux.c
|
| 838 |
+
|
| 839 |
+
Python/sysmodule.o: $(srcdir)/Python/sysmodule.c Makefile $(srcdir)/Include/pydtrace.h
|
| 840 |
+
$(CC) -c $(PY_CORE_CFLAGS) \
|
| 841 |
+
-DABIFLAGS='"$(ABIFLAGS)"' \
|
| 842 |
+
$(MULTIARCH_CPPFLAGS) \
|
| 843 |
+
-o $@ $(srcdir)/Python/sysmodule.c
|
| 844 |
+
|
| 845 |
+
Python/initconfig.o: $(srcdir)/Python/initconfig.c
|
| 846 |
+
$(CC) -c $(PY_CORE_CFLAGS) \
|
| 847 |
+
-DPLATLIBDIR='"$(PLATLIBDIR)"' \
|
| 848 |
+
-o $@ $(srcdir)/Python/initconfig.c
|
| 849 |
+
|
| 850 |
+
$(IO_OBJS): $(IO_H)
|
| 851 |
+
|
| 852 |
+
.PHONY: regen-pegen-metaparser
|
| 853 |
+
regen-pegen-metaparser:
|
| 854 |
+
@$(MKDIR_P) $(srcdir)/Tools/peg_generator/pegen
|
| 855 |
+
PYTHONPATH=$(srcdir)/Tools/peg_generator $(PYTHON_FOR_REGEN) -m pegen -q python \
|
| 856 |
+
$(srcdir)/Tools/peg_generator/pegen/metagrammar.gram \
|
| 857 |
+
-o $(srcdir)/Tools/peg_generator/pegen/grammar_parser.py.new
|
| 858 |
+
$(UPDATE_FILE) $(srcdir)/Tools/peg_generator/pegen/grammar_parser.py \
|
| 859 |
+
$(srcdir)/Tools/peg_generator/pegen/grammar_parser.py.new
|
| 860 |
+
|
| 861 |
+
.PHONY: regen-pegen
|
| 862 |
+
regen-pegen:
|
| 863 |
+
@$(MKDIR_P) $(srcdir)/Parser
|
| 864 |
+
PYTHONPATH=$(srcdir)/Tools/peg_generator $(PYTHON_FOR_REGEN) -m pegen -q c \
|
| 865 |
+
$(srcdir)/Grammar/python.gram \
|
| 866 |
+
$(srcdir)/Grammar/Tokens \
|
| 867 |
+
-o $(srcdir)/Parser/parser.new.c
|
| 868 |
+
$(UPDATE_FILE) $(srcdir)/Parser/parser.c $(srcdir)/Parser/parser.new.c
|
| 869 |
+
|
| 870 |
+
.PHONY=regen-ast
|
| 871 |
+
regen-ast:
|
| 872 |
+
# Regenerate 3 files using using Parser/asdl_c.py:
|
| 873 |
+
# - Include/internal/pycore_ast.h
|
| 874 |
+
# - Include/internal/pycore_ast_state.h
|
| 875 |
+
# - Python/Python-ast.c
|
| 876 |
+
$(MKDIR_P) $(srcdir)/Include
|
| 877 |
+
$(MKDIR_P) $(srcdir)/Python
|
| 878 |
+
$(PYTHON_FOR_REGEN) $(srcdir)/Parser/asdl_c.py \
|
| 879 |
+
$(srcdir)/Parser/Python.asdl \
|
| 880 |
+
-H $(srcdir)/Include/internal/pycore_ast.h.new \
|
| 881 |
+
-I $(srcdir)/Include/internal/pycore_ast_state.h.new \
|
| 882 |
+
-C $(srcdir)/Python/Python-ast.c.new
|
| 883 |
+
|
| 884 |
+
$(UPDATE_FILE) $(srcdir)/Include/internal/pycore_ast.h $(srcdir)/Include/internal/pycore_ast.h.new
|
| 885 |
+
$(UPDATE_FILE) $(srcdir)/Include/internal/pycore_ast_state.h $(srcdir)/Include/internal/pycore_ast_state.h.new
|
| 886 |
+
$(UPDATE_FILE) $(srcdir)/Python/Python-ast.c $(srcdir)/Python/Python-ast.c.new
|
| 887 |
+
|
| 888 |
+
.PHONY: regen-opcode
|
| 889 |
+
regen-opcode:
|
| 890 |
+
# Regenerate Include/opcode.h from Lib/opcode.py
|
| 891 |
+
# using Tools/scripts/generate_opcode_h.py
|
| 892 |
+
$(PYTHON_FOR_REGEN) $(srcdir)/Tools/scripts/generate_opcode_h.py \
|
| 893 |
+
$(srcdir)/Lib/opcode.py \
|
| 894 |
+
$(srcdir)/Include/opcode.h.new
|
| 895 |
+
$(UPDATE_FILE) $(srcdir)/Include/opcode.h $(srcdir)/Include/opcode.h.new
|
| 896 |
+
|
| 897 |
+
.PHONY: regen-frozen
|
| 898 |
+
regen-frozen: Programs/_freeze_importlib
|
| 899 |
+
# Regenerate code for frozen module "__hello__".
|
| 900 |
+
./Programs/_freeze_importlib hello \
|
| 901 |
+
$(srcdir)/Tools/freeze/flag.py \
|
| 902 |
+
$(srcdir)/Python/frozen_hello.h.new
|
| 903 |
+
$(UPDATE_FILE) $(srcdir)/Python/frozen_hello.h \
|
| 904 |
+
$(srcdir)/Python/frozen_hello.h.new
|
| 905 |
+
|
| 906 |
+
.PHONY: regen-token
|
| 907 |
+
regen-token:
|
| 908 |
+
# Regenerate Doc/library/token-list.inc from Grammar/Tokens
|
| 909 |
+
# using Tools/scripts/generate_token.py
|
| 910 |
+
$(PYTHON_FOR_REGEN) $(srcdir)/Tools/scripts/generate_token.py rst \
|
| 911 |
+
$(srcdir)/Grammar/Tokens \
|
| 912 |
+
$(srcdir)/Doc/library/token-list.inc
|
| 913 |
+
# Regenerate Include/token.h from Grammar/Tokens
|
| 914 |
+
# using Tools/scripts/generate_token.py
|
| 915 |
+
$(PYTHON_FOR_REGEN) $(srcdir)/Tools/scripts/generate_token.py h \
|
| 916 |
+
$(srcdir)/Grammar/Tokens \
|
| 917 |
+
$(srcdir)/Include/token.h
|
| 918 |
+
# Regenerate Parser/token.c from Grammar/Tokens
|
| 919 |
+
# using Tools/scripts/generate_token.py
|
| 920 |
+
$(PYTHON_FOR_REGEN) $(srcdir)/Tools/scripts/generate_token.py c \
|
| 921 |
+
$(srcdir)/Grammar/Tokens \
|
| 922 |
+
$(srcdir)/Parser/token.c
|
| 923 |
+
# Regenerate Lib/token.py from Grammar/Tokens
|
| 924 |
+
# using Tools/scripts/generate_token.py
|
| 925 |
+
$(PYTHON_FOR_REGEN) $(srcdir)/Tools/scripts/generate_token.py py \
|
| 926 |
+
$(srcdir)/Grammar/Tokens \
|
| 927 |
+
$(srcdir)/Lib/token.py
|
| 928 |
+
|
| 929 |
+
.PHONY: regen-keyword
|
| 930 |
+
regen-keyword:
|
| 931 |
+
# Regenerate Lib/keyword.py from Grammar/python.gram and Grammar/Tokens
|
| 932 |
+
# using Tools/peg_generator/pegen
|
| 933 |
+
PYTHONPATH=$(srcdir)/Tools/peg_generator $(PYTHON_FOR_REGEN) -m pegen.keywordgen \
|
| 934 |
+
$(srcdir)/Grammar/python.gram \
|
| 935 |
+
$(srcdir)/Grammar/Tokens \
|
| 936 |
+
$(srcdir)/Lib/keyword.py.new
|
| 937 |
+
$(UPDATE_FILE) $(srcdir)/Lib/keyword.py $(srcdir)/Lib/keyword.py.new
|
| 938 |
+
|
| 939 |
+
.PHONY: regen-stdlib-module-names
|
| 940 |
+
regen-stdlib-module-names: build_all Programs/_testembed
|
| 941 |
+
# Regenerate Python/stdlib_module_names.h
|
| 942 |
+
# using Tools/scripts/generate_stdlib_module_names.py
|
| 943 |
+
$(RUNSHARED) ./$(BUILDPYTHON) \
|
| 944 |
+
$(srcdir)/Tools/scripts/generate_stdlib_module_names.py \
|
| 945 |
+
> $(srcdir)/Python/stdlib_module_names.h.new
|
| 946 |
+
$(UPDATE_FILE) $(srcdir)/Python/stdlib_module_names.h $(srcdir)/Python/stdlib_module_names.h.new
|
| 947 |
+
|
| 948 |
+
Python/compile.o Python/symtable.o Python/ast_unparse.o Python/ast.o Python/future.o: $(srcdir)/Include/internal/pycore_ast.h
|
| 949 |
+
|
| 950 |
+
Python/getplatform.o: $(srcdir)/Python/getplatform.c
|
| 951 |
+
$(CC) -c $(PY_CORE_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -o $@ $(srcdir)/Python/getplatform.c
|
| 952 |
+
|
| 953 |
+
Python/importdl.o: $(srcdir)/Python/importdl.c
|
| 954 |
+
$(CC) -c $(PY_CORE_CFLAGS) -I$(DLINCLDIR) -o $@ $(srcdir)/Python/importdl.c
|
| 955 |
+
|
| 956 |
+
Objects/unicodectype.o: $(srcdir)/Objects/unicodectype.c \
|
| 957 |
+
$(srcdir)/Objects/unicodetype_db.h
|
| 958 |
+
|
| 959 |
+
BYTESTR_DEPS = \
|
| 960 |
+
$(srcdir)/Objects/stringlib/count.h \
|
| 961 |
+
$(srcdir)/Objects/stringlib/ctype.h \
|
| 962 |
+
$(srcdir)/Objects/stringlib/fastsearch.h \
|
| 963 |
+
$(srcdir)/Objects/stringlib/find.h \
|
| 964 |
+
$(srcdir)/Objects/stringlib/join.h \
|
| 965 |
+
$(srcdir)/Objects/stringlib/partition.h \
|
| 966 |
+
$(srcdir)/Objects/stringlib/split.h \
|
| 967 |
+
$(srcdir)/Objects/stringlib/stringdefs.h \
|
| 968 |
+
$(srcdir)/Objects/stringlib/transmogrify.h
|
| 969 |
+
|
| 970 |
+
UNICODE_DEPS = \
|
| 971 |
+
$(srcdir)/Objects/stringlib/asciilib.h \
|
| 972 |
+
$(srcdir)/Objects/stringlib/codecs.h \
|
| 973 |
+
$(srcdir)/Objects/stringlib/count.h \
|
| 974 |
+
$(srcdir)/Objects/stringlib/fastsearch.h \
|
| 975 |
+
$(srcdir)/Objects/stringlib/find.h \
|
| 976 |
+
$(srcdir)/Objects/stringlib/find_max_char.h \
|
| 977 |
+
$(srcdir)/Objects/stringlib/localeutil.h \
|
| 978 |
+
$(srcdir)/Objects/stringlib/partition.h \
|
| 979 |
+
$(srcdir)/Objects/stringlib/replace.h \
|
| 980 |
+
$(srcdir)/Objects/stringlib/split.h \
|
| 981 |
+
$(srcdir)/Objects/stringlib/ucs1lib.h \
|
| 982 |
+
$(srcdir)/Objects/stringlib/ucs2lib.h \
|
| 983 |
+
$(srcdir)/Objects/stringlib/ucs4lib.h \
|
| 984 |
+
$(srcdir)/Objects/stringlib/undef.h \
|
| 985 |
+
$(srcdir)/Objects/stringlib/unicode_format.h \
|
| 986 |
+
$(srcdir)/Objects/stringlib/unicodedefs.h
|
| 987 |
+
|
| 988 |
+
Objects/bytes_methods.o: $(srcdir)/Objects/bytes_methods.c $(BYTESTR_DEPS)
|
| 989 |
+
Objects/bytesobject.o: $(srcdir)/Objects/bytesobject.c $(BYTESTR_DEPS)
|
| 990 |
+
Objects/bytearrayobject.o: $(srcdir)/Objects/bytearrayobject.c $(BYTESTR_DEPS)
|
| 991 |
+
|
| 992 |
+
Objects/unicodeobject.o: $(srcdir)/Objects/unicodeobject.c $(UNICODE_DEPS)
|
| 993 |
+
|
| 994 |
+
Objects/odictobject.o: $(srcdir)/Objects/dict-common.h
|
| 995 |
+
Objects/dictobject.o: $(srcdir)/Objects/stringlib/eq.h $(srcdir)/Objects/dict-common.h
|
| 996 |
+
Objects/setobject.o: $(srcdir)/Objects/stringlib/eq.h
|
| 997 |
+
|
| 998 |
+
.PHONY: regen-opcode-targets
|
| 999 |
+
regen-opcode-targets:
|
| 1000 |
+
# Regenerate Python/opcode_targets.h from Lib/opcode.py
|
| 1001 |
+
# using Python/makeopcodetargets.py
|
| 1002 |
+
$(PYTHON_FOR_REGEN) $(srcdir)/Python/makeopcodetargets.py \
|
| 1003 |
+
$(srcdir)/Python/opcode_targets.h.new
|
| 1004 |
+
$(UPDATE_FILE) $(srcdir)/Python/opcode_targets.h $(srcdir)/Python/opcode_targets.h.new
|
| 1005 |
+
|
| 1006 |
+
Python/ceval.o: $(srcdir)/Python/opcode_targets.h $(srcdir)/Python/ceval_gil.h \
|
| 1007 |
+
$(srcdir)/Python/condvar.h
|
| 1008 |
+
|
| 1009 |
+
Python/frozen.o: $(srcdir)/Python/importlib.h $(srcdir)/Python/importlib_external.h \
|
| 1010 |
+
$(srcdir)/Python/importlib_zipimport.h $(srcdir)/Python/frozen_hello.h
|
| 1011 |
+
|
| 1012 |
+
# Generate DTrace probe macros, then rename them (PYTHON_ -> PyDTrace_) to
|
| 1013 |
+
# follow our naming conventions. dtrace(1) uses the output filename to generate
|
| 1014 |
+
# an include guard, so we can't use a pipeline to transform its output.
|
| 1015 |
+
Include/pydtrace_probes.h: $(srcdir)/Include/pydtrace.d
|
| 1016 |
+
$(MKDIR_P) Include
|
| 1017 |
+
$(DTRACE) $(DFLAGS) -o $@ -h -s $<
|
| 1018 |
+
: sed in-place edit with POSIX-only tools
|
| 1019 |
+
sed 's/PYTHON_/PyDTrace_/' $@ > [email protected]
|
| 1020 |
+
mv [email protected] $@
|
| 1021 |
+
|
| 1022 |
+
Python/ceval.o: $(srcdir)/Include/pydtrace.h
|
| 1023 |
+
Python/import.o: $(srcdir)/Include/pydtrace.h
|
| 1024 |
+
Modules/gcmodule.o: $(srcdir)/Include/pydtrace.h
|
| 1025 |
+
|
| 1026 |
+
Python/pydtrace.o: $(srcdir)/Include/pydtrace.d $(DTRACE_DEPS)
|
| 1027 |
+
$(DTRACE) $(DFLAGS) -o $@ -G -s $< $(DTRACE_DEPS)
|
| 1028 |
+
|
| 1029 |
+
Objects/typeobject.o: Objects/typeslots.inc
|
| 1030 |
+
|
| 1031 |
+
.PHONY: regen-typeslots
|
| 1032 |
+
regen-typeslots:
|
| 1033 |
+
# Regenerate Objects/typeslots.inc from Include/typeslotsh
|
| 1034 |
+
# using Objects/typeslots.py
|
| 1035 |
+
$(PYTHON_FOR_REGEN) $(srcdir)/Objects/typeslots.py \
|
| 1036 |
+
< $(srcdir)/Include/typeslots.h \
|
| 1037 |
+
$(srcdir)/Objects/typeslots.inc.new
|
| 1038 |
+
$(UPDATE_FILE) $(srcdir)/Objects/typeslots.inc $(srcdir)/Objects/typeslots.inc.new
|
| 1039 |
+
|
| 1040 |
+
############################################################################
|
| 1041 |
+
# Header files
|
| 1042 |
+
|
| 1043 |
+
PYTHON_HEADERS= \
|
| 1044 |
+
$(srcdir)/Include/Python.h \
|
| 1045 |
+
$(srcdir)/Include/abstract.h \
|
| 1046 |
+
$(srcdir)/Include/bltinmodule.h \
|
| 1047 |
+
$(srcdir)/Include/boolobject.h \
|
| 1048 |
+
$(srcdir)/Include/bytearrayobject.h \
|
| 1049 |
+
$(srcdir)/Include/bytesobject.h \
|
| 1050 |
+
$(srcdir)/Include/cellobject.h \
|
| 1051 |
+
$(srcdir)/Include/ceval.h \
|
| 1052 |
+
$(srcdir)/Include/classobject.h \
|
| 1053 |
+
$(srcdir)/Include/code.h \
|
| 1054 |
+
$(srcdir)/Include/codecs.h \
|
| 1055 |
+
$(srcdir)/Include/compile.h \
|
| 1056 |
+
$(srcdir)/Include/complexobject.h \
|
| 1057 |
+
$(srcdir)/Include/context.h \
|
| 1058 |
+
$(srcdir)/Include/descrobject.h \
|
| 1059 |
+
$(srcdir)/Include/dictobject.h \
|
| 1060 |
+
$(srcdir)/Include/dynamic_annotations.h \
|
| 1061 |
+
$(srcdir)/Include/enumobject.h \
|
| 1062 |
+
$(srcdir)/Include/errcode.h \
|
| 1063 |
+
$(srcdir)/Include/eval.h \
|
| 1064 |
+
$(srcdir)/Include/fileobject.h \
|
| 1065 |
+
$(srcdir)/Include/fileutils.h \
|
| 1066 |
+
$(srcdir)/Include/floatobject.h \
|
| 1067 |
+
$(srcdir)/Include/frameobject.h \
|
| 1068 |
+
$(srcdir)/Include/funcobject.h \
|
| 1069 |
+
$(srcdir)/Include/genobject.h \
|
| 1070 |
+
$(srcdir)/Include/import.h \
|
| 1071 |
+
$(srcdir)/Include/interpreteridobject.h \
|
| 1072 |
+
$(srcdir)/Include/intrcheck.h \
|
| 1073 |
+
$(srcdir)/Include/iterobject.h \
|
| 1074 |
+
$(srcdir)/Include/listobject.h \
|
| 1075 |
+
$(srcdir)/Include/longintrepr.h \
|
| 1076 |
+
$(srcdir)/Include/longobject.h \
|
| 1077 |
+
$(srcdir)/Include/marshal.h \
|
| 1078 |
+
$(srcdir)/Include/memoryobject.h \
|
| 1079 |
+
$(srcdir)/Include/methodobject.h \
|
| 1080 |
+
$(srcdir)/Include/modsupport.h \
|
| 1081 |
+
$(srcdir)/Include/moduleobject.h \
|
| 1082 |
+
$(srcdir)/Include/namespaceobject.h \
|
| 1083 |
+
$(srcdir)/Include/object.h \
|
| 1084 |
+
$(srcdir)/Include/objimpl.h \
|
| 1085 |
+
$(srcdir)/Include/opcode.h \
|
| 1086 |
+
$(srcdir)/Include/osdefs.h \
|
| 1087 |
+
$(srcdir)/Include/osmodule.h \
|
| 1088 |
+
$(srcdir)/Include/patchlevel.h \
|
| 1089 |
+
$(srcdir)/Include/pycapsule.h \
|
| 1090 |
+
$(srcdir)/Include/pydtrace.h \
|
| 1091 |
+
$(srcdir)/Include/pyerrors.h \
|
| 1092 |
+
$(srcdir)/Include/pyframe.h \
|
| 1093 |
+
$(srcdir)/Include/pyhash.h \
|
| 1094 |
+
$(srcdir)/Include/pylifecycle.h \
|
| 1095 |
+
$(srcdir)/Include/pymacconfig.h \
|
| 1096 |
+
$(srcdir)/Include/pymacro.h \
|
| 1097 |
+
$(srcdir)/Include/pymath.h \
|
| 1098 |
+
$(srcdir)/Include/pymem.h \
|
| 1099 |
+
$(srcdir)/Include/pyport.h \
|
| 1100 |
+
$(srcdir)/Include/pystate.h \
|
| 1101 |
+
$(srcdir)/Include/pystrcmp.h \
|
| 1102 |
+
$(srcdir)/Include/pystrhex.h \
|
| 1103 |
+
$(srcdir)/Include/pystrtod.h \
|
| 1104 |
+
$(srcdir)/Include/pythonrun.h \
|
| 1105 |
+
$(srcdir)/Include/pythread.h \
|
| 1106 |
+
$(srcdir)/Include/rangeobject.h \
|
| 1107 |
+
$(srcdir)/Include/setobject.h \
|
| 1108 |
+
$(srcdir)/Include/sliceobject.h \
|
| 1109 |
+
$(srcdir)/Include/structmember.h \
|
| 1110 |
+
$(srcdir)/Include/structseq.h \
|
| 1111 |
+
$(srcdir)/Include/sysmodule.h \
|
| 1112 |
+
$(srcdir)/Include/token.h \
|
| 1113 |
+
$(srcdir)/Include/traceback.h \
|
| 1114 |
+
$(srcdir)/Include/tracemalloc.h \
|
| 1115 |
+
$(srcdir)/Include/tupleobject.h \
|
| 1116 |
+
$(srcdir)/Include/unicodeobject.h \
|
| 1117 |
+
$(srcdir)/Include/warnings.h \
|
| 1118 |
+
$(srcdir)/Include/weakrefobject.h \
|
| 1119 |
+
\
|
| 1120 |
+
pyconfig.h \
|
| 1121 |
+
$(PARSER_HEADERS) \
|
| 1122 |
+
\
|
| 1123 |
+
$(srcdir)/Include/cpython/abstract.h \
|
| 1124 |
+
$(srcdir)/Include/cpython/bytearrayobject.h \
|
| 1125 |
+
$(srcdir)/Include/cpython/bytesobject.h \
|
| 1126 |
+
$(srcdir)/Include/cpython/ceval.h \
|
| 1127 |
+
$(srcdir)/Include/cpython/code.h \
|
| 1128 |
+
$(srcdir)/Include/cpython/compile.h \
|
| 1129 |
+
$(srcdir)/Include/cpython/dictobject.h \
|
| 1130 |
+
$(srcdir)/Include/cpython/fileobject.h \
|
| 1131 |
+
$(srcdir)/Include/cpython/fileutils.h \
|
| 1132 |
+
$(srcdir)/Include/cpython/frameobject.h \
|
| 1133 |
+
$(srcdir)/Include/cpython/import.h \
|
| 1134 |
+
$(srcdir)/Include/cpython/initconfig.h \
|
| 1135 |
+
$(srcdir)/Include/cpython/interpreteridobject.h \
|
| 1136 |
+
$(srcdir)/Include/cpython/listobject.h \
|
| 1137 |
+
$(srcdir)/Include/cpython/methodobject.h \
|
| 1138 |
+
$(srcdir)/Include/cpython/object.h \
|
| 1139 |
+
$(srcdir)/Include/cpython/objimpl.h \
|
| 1140 |
+
$(srcdir)/Include/cpython/odictobject.h \
|
| 1141 |
+
$(srcdir)/Include/cpython/picklebufobject.h \
|
| 1142 |
+
$(srcdir)/Include/cpython/pyctype.h \
|
| 1143 |
+
$(srcdir)/Include/cpython/pydebug.h \
|
| 1144 |
+
$(srcdir)/Include/cpython/pyerrors.h \
|
| 1145 |
+
$(srcdir)/Include/cpython/pyfpe.h \
|
| 1146 |
+
$(srcdir)/Include/cpython/pylifecycle.h \
|
| 1147 |
+
$(srcdir)/Include/cpython/pymem.h \
|
| 1148 |
+
$(srcdir)/Include/cpython/pystate.h \
|
| 1149 |
+
$(srcdir)/Include/cpython/pythonrun.h \
|
| 1150 |
+
$(srcdir)/Include/cpython/pytime.h \
|
| 1151 |
+
$(srcdir)/Include/cpython/sysmodule.h \
|
| 1152 |
+
$(srcdir)/Include/cpython/traceback.h \
|
| 1153 |
+
$(srcdir)/Include/cpython/tupleobject.h \
|
| 1154 |
+
$(srcdir)/Include/cpython/unicodeobject.h \
|
| 1155 |
+
\
|
| 1156 |
+
$(srcdir)/Include/internal/pycore_abstract.h \
|
| 1157 |
+
$(srcdir)/Include/internal/pycore_accu.h \
|
| 1158 |
+
$(srcdir)/Include/internal/pycore_asdl.h \
|
| 1159 |
+
$(srcdir)/Include/internal/pycore_ast.h \
|
| 1160 |
+
$(srcdir)/Include/internal/pycore_ast_state.h \
|
| 1161 |
+
$(srcdir)/Include/internal/pycore_atomic.h \
|
| 1162 |
+
$(srcdir)/Include/internal/pycore_atomic_funcs.h \
|
| 1163 |
+
$(srcdir)/Include/internal/pycore_bitutils.h \
|
| 1164 |
+
$(srcdir)/Include/internal/pycore_bytes_methods.h \
|
| 1165 |
+
$(srcdir)/Include/internal/pycore_call.h \
|
| 1166 |
+
$(srcdir)/Include/internal/pycore_ceval.h \
|
| 1167 |
+
$(srcdir)/Include/internal/pycore_code.h \
|
| 1168 |
+
$(srcdir)/Include/internal/pycore_compile.h \
|
| 1169 |
+
$(srcdir)/Include/internal/pycore_condvar.h \
|
| 1170 |
+
$(srcdir)/Include/internal/pycore_context.h \
|
| 1171 |
+
$(srcdir)/Include/internal/pycore_dtoa.h \
|
| 1172 |
+
$(srcdir)/Include/internal/pycore_fileutils.h \
|
| 1173 |
+
$(srcdir)/Include/internal/pycore_format.h \
|
| 1174 |
+
$(srcdir)/Include/internal/pycore_getopt.h \
|
| 1175 |
+
$(srcdir)/Include/internal/pycore_gil.h \
|
| 1176 |
+
$(srcdir)/Include/internal/pycore_hamt.h \
|
| 1177 |
+
$(srcdir)/Include/internal/pycore_hashtable.h \
|
| 1178 |
+
$(srcdir)/Include/internal/pycore_import.h \
|
| 1179 |
+
$(srcdir)/Include/internal/pycore_initconfig.h \
|
| 1180 |
+
$(srcdir)/Include/internal/pycore_interp.h \
|
| 1181 |
+
$(srcdir)/Include/internal/pycore_list.h \
|
| 1182 |
+
$(srcdir)/Include/internal/pycore_long.h \
|
| 1183 |
+
$(srcdir)/Include/internal/pycore_moduleobject.h \
|
| 1184 |
+
$(srcdir)/Include/internal/pycore_object.h \
|
| 1185 |
+
$(srcdir)/Include/internal/pycore_pathconfig.h \
|
| 1186 |
+
$(srcdir)/Include/internal/pycore_pyarena.h \
|
| 1187 |
+
$(srcdir)/Include/internal/pycore_pyerrors.h \
|
| 1188 |
+
$(srcdir)/Include/internal/pycore_pyhash.h \
|
| 1189 |
+
$(srcdir)/Include/internal/pycore_pylifecycle.h \
|
| 1190 |
+
$(srcdir)/Include/internal/pycore_pymem.h \
|
| 1191 |
+
$(srcdir)/Include/internal/pycore_pystate.h \
|
| 1192 |
+
$(srcdir)/Include/internal/pycore_runtime.h \
|
| 1193 |
+
$(srcdir)/Include/internal/pycore_structseq.h \
|
| 1194 |
+
$(srcdir)/Include/internal/pycore_symtable.h \
|
| 1195 |
+
$(srcdir)/Include/internal/pycore_sysmodule.h \
|
| 1196 |
+
$(srcdir)/Include/internal/pycore_traceback.h \
|
| 1197 |
+
$(srcdir)/Include/internal/pycore_tuple.h \
|
| 1198 |
+
$(srcdir)/Include/internal/pycore_ucnhash.h \
|
| 1199 |
+
$(srcdir)/Include/internal/pycore_unionobject.h \
|
| 1200 |
+
$(srcdir)/Include/internal/pycore_warnings.h \
|
| 1201 |
+
$(DTRACE_HEADERS) \
|
| 1202 |
+
\
|
| 1203 |
+
$(srcdir)/Python/stdlib_module_names.h
|
| 1204 |
+
|
| 1205 |
+
$(LIBRARY_OBJS) $(MODOBJS) Programs/python.o: $(PYTHON_HEADERS)
|
| 1206 |
+
|
| 1207 |
+
|
| 1208 |
+
######################################################################
|
| 1209 |
+
|
| 1210 |
+
TESTOPTS= $(EXTRATESTOPTS)
|
| 1211 |
+
TESTPYTHON= $(RUNSHARED) ./$(BUILDPYTHON) $(TESTPYTHONOPTS)
|
| 1212 |
+
TESTRUNNER= $(TESTPYTHON) $(srcdir)/Tools/scripts/run_tests.py
|
| 1213 |
+
TESTTIMEOUT= 1200
|
| 1214 |
+
|
| 1215 |
+
.PHONY: test testall testuniversal buildbottest pythoninfo
|
| 1216 |
+
|
| 1217 |
+
# Remove "test_python_*" directories of previous failed test jobs.
|
| 1218 |
+
# Pass TESTOPTS options because it can contain --tempdir option.
|
| 1219 |
+
cleantest: build_all
|
| 1220 |
+
$(TESTRUNNER) $(TESTOPTS) --cleanup
|
| 1221 |
+
|
| 1222 |
+
# Run a basic set of regression tests.
|
| 1223 |
+
# This excludes some tests that are particularly resource-intensive.
|
| 1224 |
+
test: build_all platform
|
| 1225 |
+
$(TESTRUNNER) $(TESTOPTS)
|
| 1226 |
+
|
| 1227 |
+
# Run the full test suite twice - once without .pyc files, and once with.
|
| 1228 |
+
# In the past, we've had problems where bugs in the marshalling or
|
| 1229 |
+
# elsewhere caused bytecode read from .pyc files to behave differently
|
| 1230 |
+
# than bytecode generated directly from a .py source file. Sometimes
|
| 1231 |
+
# the bytecode read from a .pyc file had the bug, sometimes the directly
|
| 1232 |
+
# generated bytecode. This is sometimes a very shy bug needing a lot of
|
| 1233 |
+
# sample data.
|
| 1234 |
+
testall: build_all platform
|
| 1235 |
+
-find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
|
| 1236 |
+
$(TESTPYTHON) -E $(srcdir)/Lib/compileall.py
|
| 1237 |
+
-find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
|
| 1238 |
+
-$(TESTRUNNER) -u all $(TESTOPTS)
|
| 1239 |
+
$(TESTRUNNER) -u all $(TESTOPTS)
|
| 1240 |
+
|
| 1241 |
+
# Run the test suite for both architectures in a Universal build on OSX.
|
| 1242 |
+
# Must be run on an Intel box.
|
| 1243 |
+
testuniversal: build_all platform
|
| 1244 |
+
@if [ `arch` != 'i386' ]; then \
|
| 1245 |
+
echo "This can only be used on OSX/i386" ;\
|
| 1246 |
+
exit 1 ;\
|
| 1247 |
+
fi
|
| 1248 |
+
$(TESTRUNNER) -u all $(TESTOPTS)
|
| 1249 |
+
$(RUNSHARED) /usr/libexec/oah/translate \
|
| 1250 |
+
./$(BUILDPYTHON) -E -m test -j 0 -u all $(TESTOPTS)
|
| 1251 |
+
|
| 1252 |
+
# Like testall, but with only one pass and without multiple processes.
|
| 1253 |
+
# Run an optional script to include information about the build environment.
|
| 1254 |
+
buildbottest: build_all platform
|
| 1255 |
+
-@if which pybuildbot.identify >/dev/null 2>&1; then \
|
| 1256 |
+
pybuildbot.identify "CC='$(CC)'" "CXX='$(CXX)'"; \
|
| 1257 |
+
fi
|
| 1258 |
+
$(TESTRUNNER) -j 1 -u all -W --slowest --fail-env-changed --timeout=$(TESTTIMEOUT) $(TESTOPTS)
|
| 1259 |
+
|
| 1260 |
+
pythoninfo: build_all
|
| 1261 |
+
$(RUNSHARED) ./$(BUILDPYTHON) -m test.pythoninfo
|
| 1262 |
+
|
| 1263 |
+
QUICKTESTOPTS= $(TESTOPTS) -x test_subprocess test_io test_lib2to3 \
|
| 1264 |
+
test_multibytecodec test_urllib2_localnet test_itertools \
|
| 1265 |
+
test_multiprocessing_fork test_multiprocessing_spawn \
|
| 1266 |
+
test_multiprocessing_forkserver \
|
| 1267 |
+
test_mailbox test_socket test_poll \
|
| 1268 |
+
test_select test_zipfile test_concurrent_futures
|
| 1269 |
+
quicktest: build_all platform
|
| 1270 |
+
$(TESTRUNNER) $(QUICKTESTOPTS)
|
| 1271 |
+
|
| 1272 |
+
# SSL tests
|
| 1273 |
+
.PHONY: multisslcompile multissltest
|
| 1274 |
+
multisslcompile: build_all
|
| 1275 |
+
$(RUNSHARED) ./$(BUILDPYTHON) $(srcdir)/Tools/ssl/multissltests.py --steps=modules
|
| 1276 |
+
|
| 1277 |
+
multissltest: build_all
|
| 1278 |
+
$(RUNSHARED) ./$(BUILDPYTHON) $(srcdir)/Tools/ssl/multissltests.py
|
| 1279 |
+
|
| 1280 |
+
install: commoninstall bininstall maninstall
|
| 1281 |
+
if test "x$(ENSUREPIP)" != "xno" ; then \
|
| 1282 |
+
case $(ENSUREPIP) in \
|
| 1283 |
+
upgrade) ensurepip="--upgrade" ;; \
|
| 1284 |
+
install|*) ensurepip="" ;; \
|
| 1285 |
+
esac; \
|
| 1286 |
+
$(RUNSHARED) $(PY_BUILD_ENVIRON) $(PYTHON_FOR_BUILD) -m ensurepip \
|
| 1287 |
+
$$ensurepip --root=$(DESTDIR)/ ; \
|
| 1288 |
+
fi
|
| 1289 |
+
|
| 1290 |
+
altinstall: commoninstall
|
| 1291 |
+
if test "x$(ENSUREPIP)" != "xno" ; then \
|
| 1292 |
+
case $(ENSUREPIP) in \
|
| 1293 |
+
upgrade) ensurepip="--altinstall --upgrade" ;; \
|
| 1294 |
+
install|*) ensurepip="--altinstall" ;; \
|
| 1295 |
+
esac; \
|
| 1296 |
+
$(RUNSHARED) $(PY_BUILD_ENVIRON) $(PYTHON_FOR_BUILD) -m ensurepip \
|
| 1297 |
+
$$ensurepip --root=$(DESTDIR)/ ; \
|
| 1298 |
+
fi
|
| 1299 |
+
|
| 1300 |
+
commoninstall: check-clean-src \
|
| 1301 |
+
altbininstall libinstall inclinstall libainstall \
|
| 1302 |
+
sharedinstall oldsharedinstall altmaninstall \
|
| 1303 |
+
|
| 1304 |
+
|
| 1305 |
+
# Install shared libraries enabled by Setup
|
| 1306 |
+
DESTDIRS= $(exec_prefix) $(LIBDIR) $(BINLIBDEST) $(DESTSHARED)
|
| 1307 |
+
|
| 1308 |
+
oldsharedinstall: $(DESTSHARED) $(SHAREDMODS)
|
| 1309 |
+
@for i in X $(SHAREDMODS); do \
|
| 1310 |
+
if test $$i != X; then \
|
| 1311 |
+
echo $(INSTALL_SHARED) $$i $(DESTSHARED)/`basename $$i`; \
|
| 1312 |
+
$(INSTALL_SHARED) $$i $(DESTDIR)$(DESTSHARED)/`basename $$i`; \
|
| 1313 |
+
fi; \
|
| 1314 |
+
done
|
| 1315 |
+
|
| 1316 |
+
$(DESTSHARED):
|
| 1317 |
+
@for i in $(DESTDIRS); \
|
| 1318 |
+
do \
|
| 1319 |
+
if test ! -d $(DESTDIR)$$i; then \
|
| 1320 |
+
echo "Creating directory $$i"; \
|
| 1321 |
+
$(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
|
| 1322 |
+
else true; \
|
| 1323 |
+
fi; \
|
| 1324 |
+
done
|
| 1325 |
+
|
| 1326 |
+
# Install the interpreter with $(VERSION) affixed
|
| 1327 |
+
# This goes into $(exec_prefix)
|
| 1328 |
+
altbininstall: $(BUILDPYTHON)
|
| 1329 |
+
@for i in $(BINDIR) $(LIBDIR); \
|
| 1330 |
+
do \
|
| 1331 |
+
if test ! -d $(DESTDIR)$$i; then \
|
| 1332 |
+
echo "Creating directory $$i"; \
|
| 1333 |
+
$(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
|
| 1334 |
+
else true; \
|
| 1335 |
+
fi; \
|
| 1336 |
+
done
|
| 1337 |
+
if test "$(PYTHONFRAMEWORKDIR)" = "no-framework" ; then \
|
| 1338 |
+
$(INSTALL_PROGRAM) $(BUILDPYTHON) $(DESTDIR)$(BINDIR)/python$(LDVERSION)$(EXE); \
|
| 1339 |
+
else \
|
| 1340 |
+
$(INSTALL_PROGRAM) $(STRIPFLAG) Mac/pythonw $(DESTDIR)$(BINDIR)/python$(LDVERSION)$(EXE); \
|
| 1341 |
+
fi
|
| 1342 |
+
-if test "$(VERSION)" != "$(LDVERSION)"; then \
|
| 1343 |
+
if test -f $(DESTDIR)$(BINDIR)/python$(VERSION)$(EXE) -o -h $(DESTDIR)$(BINDIR)/python$(VERSION)$(EXE); \
|
| 1344 |
+
then rm -f $(DESTDIR)$(BINDIR)/python$(VERSION)$(EXE); \
|
| 1345 |
+
fi; \
|
| 1346 |
+
(cd $(DESTDIR)$(BINDIR); $(LN) python$(LDVERSION)$(EXE) python$(VERSION)$(EXE)); \
|
| 1347 |
+
fi
|
| 1348 |
+
@if test "$(PY_ENABLE_SHARED)" = 1 -o "$(STATIC_LIBPYTHON)" = 1; then \
|
| 1349 |
+
if test -f $(LDLIBRARY) && test "$(PYTHONFRAMEWORKDIR)" = "no-framework" ; then \
|
| 1350 |
+
if test -n "$(DLLLIBRARY)" ; then \
|
| 1351 |
+
$(INSTALL_SHARED) $(DLLLIBRARY) $(DESTDIR)$(BINDIR); \
|
| 1352 |
+
else \
|
| 1353 |
+
$(INSTALL_SHARED) $(LDLIBRARY) $(DESTDIR)$(LIBDIR)/$(INSTSONAME); \
|
| 1354 |
+
if test $(LDLIBRARY) != $(INSTSONAME); then \
|
| 1355 |
+
(cd $(DESTDIR)$(LIBDIR); $(LN) -sf $(INSTSONAME) $(LDLIBRARY)) \
|
| 1356 |
+
fi \
|
| 1357 |
+
fi; \
|
| 1358 |
+
if test -n "$(PY3LIBRARY)"; then \
|
| 1359 |
+
$(INSTALL_SHARED) $(PY3LIBRARY) $(DESTDIR)$(LIBDIR)/$(PY3LIBRARY); \
|
| 1360 |
+
fi; \
|
| 1361 |
+
else true; \
|
| 1362 |
+
fi; \
|
| 1363 |
+
fi
|
| 1364 |
+
if test "x$(LIPO_32BIT_FLAGS)" != "x" ; then \
|
| 1365 |
+
rm -f $(DESTDIR)$(BINDIR)python$(VERSION)-32$(EXE); \
|
| 1366 |
+
lipo $(LIPO_32BIT_FLAGS) \
|
| 1367 |
+
-output $(DESTDIR)$(BINDIR)/python$(VERSION)-32$(EXE) \
|
| 1368 |
+
$(DESTDIR)$(BINDIR)/python$(VERSION)$(EXE); \
|
| 1369 |
+
fi
|
| 1370 |
+
if test "x$(LIPO_INTEL64_FLAGS)" != "x" ; then \
|
| 1371 |
+
rm -f $(DESTDIR)$(BINDIR)python$(VERSION)-intel64$(EXE); \
|
| 1372 |
+
lipo $(LIPO_INTEL64_FLAGS) \
|
| 1373 |
+
-output $(DESTDIR)$(BINDIR)/python$(VERSION)-intel64$(EXE) \
|
| 1374 |
+
$(DESTDIR)$(BINDIR)/python$(VERSION)$(EXE); \
|
| 1375 |
+
fi
|
| 1376 |
+
|
| 1377 |
+
bininstall: altbininstall
|
| 1378 |
+
if test ! -d $(DESTDIR)$(LIBPC); then \
|
| 1379 |
+
echo "Creating directory $(LIBPC)"; \
|
| 1380 |
+
$(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$(LIBPC); \
|
| 1381 |
+
fi
|
| 1382 |
+
-if test -f $(DESTDIR)$(BINDIR)/python3$(EXE) -o -h $(DESTDIR)$(BINDIR)/python3$(EXE); \
|
| 1383 |
+
then rm -f $(DESTDIR)$(BINDIR)/python3$(EXE); \
|
| 1384 |
+
else true; \
|
| 1385 |
+
fi
|
| 1386 |
+
(cd $(DESTDIR)$(BINDIR); $(LN) -s python$(VERSION)$(EXE) python3$(EXE))
|
| 1387 |
+
-if test "$(VERSION)" != "$(LDVERSION)"; then \
|
| 1388 |
+
rm -f $(DESTDIR)$(BINDIR)/python$(VERSION)-config; \
|
| 1389 |
+
(cd $(DESTDIR)$(BINDIR); $(LN) -s python$(LDVERSION)-config python$(VERSION)-config); \
|
| 1390 |
+
rm -f $(DESTDIR)$(LIBPC)/python-$(LDVERSION).pc; \
|
| 1391 |
+
(cd $(DESTDIR)$(LIBPC); $(LN) -s python-$(VERSION).pc python-$(LDVERSION).pc); \
|
| 1392 |
+
rm -f $(DESTDIR)$(LIBPC)/python-$(LDVERSION)-embed.pc; \
|
| 1393 |
+
(cd $(DESTDIR)$(LIBPC); $(LN) -s python-$(VERSION)-embed.pc python-$(LDVERSION)-embed.pc); \
|
| 1394 |
+
fi
|
| 1395 |
+
-rm -f $(DESTDIR)$(BINDIR)/python3-config
|
| 1396 |
+
(cd $(DESTDIR)$(BINDIR); $(LN) -s python$(VERSION)-config python3-config)
|
| 1397 |
+
-rm -f $(DESTDIR)$(LIBPC)/python3.pc
|
| 1398 |
+
(cd $(DESTDIR)$(LIBPC); $(LN) -s python-$(VERSION).pc python3.pc)
|
| 1399 |
+
-rm -f $(DESTDIR)$(LIBPC)/python3-embed.pc
|
| 1400 |
+
(cd $(DESTDIR)$(LIBPC); $(LN) -s python-$(VERSION)-embed.pc python3-embed.pc)
|
| 1401 |
+
-rm -f $(DESTDIR)$(BINDIR)/idle3
|
| 1402 |
+
(cd $(DESTDIR)$(BINDIR); $(LN) -s idle$(VERSION) idle3)
|
| 1403 |
+
-rm -f $(DESTDIR)$(BINDIR)/pydoc3
|
| 1404 |
+
(cd $(DESTDIR)$(BINDIR); $(LN) -s pydoc$(VERSION) pydoc3)
|
| 1405 |
+
-rm -f $(DESTDIR)$(BINDIR)/2to3
|
| 1406 |
+
(cd $(DESTDIR)$(BINDIR); $(LN) -s 2to3-$(VERSION) 2to3)
|
| 1407 |
+
if test "x$(LIPO_32BIT_FLAGS)" != "x" ; then \
|
| 1408 |
+
rm -f $(DESTDIR)$(BINDIR)/python3-32$(EXE); \
|
| 1409 |
+
(cd $(DESTDIR)$(BINDIR); $(LN) -s python$(VERSION)-32$(EXE) python3-32$(EXE)) \
|
| 1410 |
+
fi
|
| 1411 |
+
if test "x$(LIPO_INTEL64_FLAGS)" != "x" ; then \
|
| 1412 |
+
rm -f $(DESTDIR)$(BINDIR)/python3-intel64$(EXE); \
|
| 1413 |
+
(cd $(DESTDIR)$(BINDIR); $(LN) -s python$(VERSION)-intel64$(EXE) python3-intel64$(EXE)) \
|
| 1414 |
+
fi
|
| 1415 |
+
|
| 1416 |
+
# Install the versioned manual page
|
| 1417 |
+
altmaninstall:
|
| 1418 |
+
@for i in $(MANDIR) $(MANDIR)/man1; \
|
| 1419 |
+
do \
|
| 1420 |
+
if test ! -d $(DESTDIR)$$i; then \
|
| 1421 |
+
echo "Creating directory $$i"; \
|
| 1422 |
+
$(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
|
| 1423 |
+
else true; \
|
| 1424 |
+
fi; \
|
| 1425 |
+
done
|
| 1426 |
+
$(INSTALL_DATA) $(srcdir)/Misc/python.man \
|
| 1427 |
+
$(DESTDIR)$(MANDIR)/man1/python$(VERSION).1
|
| 1428 |
+
|
| 1429 |
+
# Install the unversioned manual page
|
| 1430 |
+
maninstall: altmaninstall
|
| 1431 |
+
-rm -f $(DESTDIR)$(MANDIR)/man1/python3.1
|
| 1432 |
+
(cd $(DESTDIR)$(MANDIR)/man1; $(LN) -s python$(VERSION).1 python3.1)
|
| 1433 |
+
|
| 1434 |
+
# Install the library
|
| 1435 |
+
XMLLIBSUBDIRS= xml xml/dom xml/etree xml/parsers xml/sax
|
| 1436 |
+
LIBSUBDIRS= asyncio \
|
| 1437 |
+
collections \
|
| 1438 |
+
concurrent concurrent/futures \
|
| 1439 |
+
csv \
|
| 1440 |
+
ctypes ctypes/macholib \
|
| 1441 |
+
curses \
|
| 1442 |
+
dbm \
|
| 1443 |
+
distutils distutils/command \
|
| 1444 |
+
email email/mime \
|
| 1445 |
+
encodings \
|
| 1446 |
+
ensurepip ensurepip/_bundled \
|
| 1447 |
+
html \
|
| 1448 |
+
http \
|
| 1449 |
+
idlelib idlelib/Icons \
|
| 1450 |
+
importlib importlib/metadata \
|
| 1451 |
+
json \
|
| 1452 |
+
lib2to3 lib2to3/fixes lib2to3/pgen2 \
|
| 1453 |
+
logging \
|
| 1454 |
+
multiprocessing multiprocessing/dummy \
|
| 1455 |
+
pydoc_data \
|
| 1456 |
+
site-packages \
|
| 1457 |
+
sqlite3 \
|
| 1458 |
+
tkinter \
|
| 1459 |
+
turtledemo \
|
| 1460 |
+
unittest \
|
| 1461 |
+
urllib \
|
| 1462 |
+
venv venv/scripts venv/scripts/common venv/scripts/posix \
|
| 1463 |
+
wsgiref \
|
| 1464 |
+
$(XMLLIBSUBDIRS) \
|
| 1465 |
+
xmlrpc \
|
| 1466 |
+
zoneinfo
|
| 1467 |
+
TESTSUBDIRS= ctypes/test \
|
| 1468 |
+
distutils/tests \
|
| 1469 |
+
idlelib/idle_test \
|
| 1470 |
+
lib2to3/tests \
|
| 1471 |
+
lib2to3/tests/data \
|
| 1472 |
+
lib2to3/tests/data/fixers \
|
| 1473 |
+
lib2to3/tests/data/fixers/myfixes \
|
| 1474 |
+
sqlite3/test \
|
| 1475 |
+
test test/audiodata \
|
| 1476 |
+
test/capath test/cjkencodings \
|
| 1477 |
+
test/data test/decimaltestdata \
|
| 1478 |
+
test/dtracedata test/eintrdata \
|
| 1479 |
+
test/encoded_modules test/imghdrdata \
|
| 1480 |
+
test/libregrtest test/sndhdrdata \
|
| 1481 |
+
test/subprocessdata test/support \
|
| 1482 |
+
test/test_asyncio \
|
| 1483 |
+
test/test_email test/test_email/data \
|
| 1484 |
+
test/test_import \
|
| 1485 |
+
test/test_import/data \
|
| 1486 |
+
test/test_import/data/circular_imports \
|
| 1487 |
+
test/test_import/data/circular_imports/subpkg \
|
| 1488 |
+
test/test_import/data/package \
|
| 1489 |
+
test/test_import/data/package2 \
|
| 1490 |
+
test/test_import/data/unwritable \
|
| 1491 |
+
test/test_importlib \
|
| 1492 |
+
test/test_importlib/builtin \
|
| 1493 |
+
test/test_importlib/data \
|
| 1494 |
+
test/test_importlib/data01 \
|
| 1495 |
+
test/test_importlib/data01/subdirectory \
|
| 1496 |
+
test/test_importlib/data02 \
|
| 1497 |
+
test/test_importlib/data02/one \
|
| 1498 |
+
test/test_importlib/data02/two \
|
| 1499 |
+
test/test_importlib/data03 \
|
| 1500 |
+
test/test_importlib/data03/namespace \
|
| 1501 |
+
test/test_importlib/data03/namespace/portion1 \
|
| 1502 |
+
test/test_importlib/data03/namespace/portion2 \
|
| 1503 |
+
test/test_importlib/extension \
|
| 1504 |
+
test/test_importlib/frozen \
|
| 1505 |
+
test/test_importlib/import_ \
|
| 1506 |
+
test/test_importlib/namespace_pkgs \
|
| 1507 |
+
test/test_importlib/namespace_pkgs/both_portions \
|
| 1508 |
+
test/test_importlib/namespace_pkgs/both_portions/foo \
|
| 1509 |
+
test/test_importlib/namespace_pkgs/module_and_namespace_package \
|
| 1510 |
+
test/test_importlib/namespace_pkgs/module_and_namespace_package/a_test \
|
| 1511 |
+
test/test_importlib/namespace_pkgs/not_a_namespace_pkg \
|
| 1512 |
+
test/test_importlib/namespace_pkgs/not_a_namespace_pkg/foo \
|
| 1513 |
+
test/test_importlib/namespace_pkgs/portion1 \
|
| 1514 |
+
test/test_importlib/namespace_pkgs/portion1/foo \
|
| 1515 |
+
test/test_importlib/namespace_pkgs/portion2 \
|
| 1516 |
+
test/test_importlib/namespace_pkgs/portion2/foo \
|
| 1517 |
+
test/test_importlib/namespace_pkgs/project1 \
|
| 1518 |
+
test/test_importlib/namespace_pkgs/project1/parent \
|
| 1519 |
+
test/test_importlib/namespace_pkgs/project1/parent/child \
|
| 1520 |
+
test/test_importlib/namespace_pkgs/project2 \
|
| 1521 |
+
test/test_importlib/namespace_pkgs/project2/parent \
|
| 1522 |
+
test/test_importlib/namespace_pkgs/project2/parent/child \
|
| 1523 |
+
test/test_importlib/namespace_pkgs/project3 \
|
| 1524 |
+
test/test_importlib/namespace_pkgs/project3/parent \
|
| 1525 |
+
test/test_importlib/namespace_pkgs/project3/parent/child \
|
| 1526 |
+
test/test_importlib/namespacedata01 \
|
| 1527 |
+
test/test_importlib/partial \
|
| 1528 |
+
test/test_importlib/source \
|
| 1529 |
+
test/test_importlib/zipdata01 \
|
| 1530 |
+
test/test_importlib/zipdata02 \
|
| 1531 |
+
test/test_json \
|
| 1532 |
+
test/test_peg_generator \
|
| 1533 |
+
test/test_tools \
|
| 1534 |
+
test/test_warnings test/test_warnings/data \
|
| 1535 |
+
test/test_zoneinfo test/test_zoneinfo/data \
|
| 1536 |
+
test/tracedmodules \
|
| 1537 |
+
test/typinganndata \
|
| 1538 |
+
test/xmltestdata test/xmltestdata/c14n-20 \
|
| 1539 |
+
test/ziptestdata \
|
| 1540 |
+
tkinter/test tkinter/test/test_tkinter \
|
| 1541 |
+
tkinter/test/test_ttk \
|
| 1542 |
+
unittest/test unittest/test/testmock
|
| 1543 |
+
|
| 1544 |
+
TEST_MODULES=yes
|
| 1545 |
+
libinstall: build_all $(srcdir)/Modules/xxmodule.c
|
| 1546 |
+
@for i in $(SCRIPTDIR) $(LIBDEST); \
|
| 1547 |
+
do \
|
| 1548 |
+
if test ! -d $(DESTDIR)$$i; then \
|
| 1549 |
+
echo "Creating directory $$i"; \
|
| 1550 |
+
$(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
|
| 1551 |
+
else true; \
|
| 1552 |
+
fi; \
|
| 1553 |
+
done
|
| 1554 |
+
@if test "$(TEST_MODULES)" = yes; then \
|
| 1555 |
+
subdirs="$(LIBSUBDIRS) $(TESTSUBDIRS)"; \
|
| 1556 |
+
else \
|
| 1557 |
+
subdirs="$(LIBSUBDIRS)"; \
|
| 1558 |
+
fi; \
|
| 1559 |
+
for d in $$subdirs; \
|
| 1560 |
+
do \
|
| 1561 |
+
a=$(srcdir)/Lib/$$d; \
|
| 1562 |
+
if test ! -d $$a; then continue; else true; fi; \
|
| 1563 |
+
b=$(LIBDEST)/$$d; \
|
| 1564 |
+
if test ! -d $(DESTDIR)$$b; then \
|
| 1565 |
+
echo "Creating directory $$b"; \
|
| 1566 |
+
$(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$b; \
|
| 1567 |
+
else true; \
|
| 1568 |
+
fi; \
|
| 1569 |
+
done
|
| 1570 |
+
@for i in $(srcdir)/Lib/*.py; \
|
| 1571 |
+
do \
|
| 1572 |
+
if test -x $$i; then \
|
| 1573 |
+
$(INSTALL_SCRIPT) $$i $(DESTDIR)$(LIBDEST); \
|
| 1574 |
+
echo $(INSTALL_SCRIPT) $$i $(LIBDEST); \
|
| 1575 |
+
else \
|
| 1576 |
+
$(INSTALL_DATA) $$i $(DESTDIR)$(LIBDEST); \
|
| 1577 |
+
echo $(INSTALL_DATA) $$i $(LIBDEST); \
|
| 1578 |
+
fi; \
|
| 1579 |
+
done
|
| 1580 |
+
@if test "$(TEST_MODULES)" = yes; then \
|
| 1581 |
+
subdirs="$(LIBSUBDIRS) $(TESTSUBDIRS)"; \
|
| 1582 |
+
else \
|
| 1583 |
+
subdirs="$(LIBSUBDIRS)"; \
|
| 1584 |
+
fi; \
|
| 1585 |
+
for d in $$subdirs; \
|
| 1586 |
+
do \
|
| 1587 |
+
a=$(srcdir)/Lib/$$d; \
|
| 1588 |
+
if test ! -d $$a; then continue; else true; fi; \
|
| 1589 |
+
if test `ls $$a | wc -l` -lt 1; then continue; fi; \
|
| 1590 |
+
b=$(LIBDEST)/$$d; \
|
| 1591 |
+
for i in $$a/*; \
|
| 1592 |
+
do \
|
| 1593 |
+
case $$i in \
|
| 1594 |
+
*CVS) ;; \
|
| 1595 |
+
*.py[co]) ;; \
|
| 1596 |
+
*.orig) ;; \
|
| 1597 |
+
*~) ;; \
|
| 1598 |
+
*) \
|
| 1599 |
+
if test -d $$i; then continue; fi; \
|
| 1600 |
+
if test -x $$i; then \
|
| 1601 |
+
echo $(INSTALL_SCRIPT) $$i $$b; \
|
| 1602 |
+
$(INSTALL_SCRIPT) $$i $(DESTDIR)$$b; \
|
| 1603 |
+
else \
|
| 1604 |
+
echo $(INSTALL_DATA) $$i $$b; \
|
| 1605 |
+
$(INSTALL_DATA) $$i $(DESTDIR)$$b; \
|
| 1606 |
+
fi;; \
|
| 1607 |
+
esac; \
|
| 1608 |
+
done; \
|
| 1609 |
+
done
|
| 1610 |
+
$(INSTALL_DATA) `cat pybuilddir.txt`/_sysconfigdata_$(ABIFLAGS)_$(MACHDEP)_$(MULTIARCH).py \
|
| 1611 |
+
$(DESTDIR)$(LIBDEST); \
|
| 1612 |
+
$(INSTALL_DATA) $(srcdir)/LICENSE $(DESTDIR)$(LIBDEST)/LICENSE.txt
|
| 1613 |
+
if test -d $(DESTDIR)$(LIBDEST)/distutils/tests; then \
|
| 1614 |
+
$(INSTALL_DATA) $(srcdir)/Modules/xxmodule.c \
|
| 1615 |
+
$(DESTDIR)$(LIBDEST)/distutils/tests ; \
|
| 1616 |
+
fi
|
| 1617 |
+
-PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
|
| 1618 |
+
$(PYTHON_FOR_BUILD) -Wi $(DESTDIR)$(LIBDEST)/compileall.py \
|
| 1619 |
+
-j0 -d $(LIBDEST) -f \
|
| 1620 |
+
-x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
|
| 1621 |
+
$(DESTDIR)$(LIBDEST)
|
| 1622 |
+
-PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
|
| 1623 |
+
$(PYTHON_FOR_BUILD) -Wi -O $(DESTDIR)$(LIBDEST)/compileall.py \
|
| 1624 |
+
-j0 -d $(LIBDEST) -f \
|
| 1625 |
+
-x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
|
| 1626 |
+
$(DESTDIR)$(LIBDEST)
|
| 1627 |
+
-PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
|
| 1628 |
+
$(PYTHON_FOR_BUILD) -Wi -OO $(DESTDIR)$(LIBDEST)/compileall.py \
|
| 1629 |
+
-j0 -d $(LIBDEST) -f \
|
| 1630 |
+
-x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
|
| 1631 |
+
$(DESTDIR)$(LIBDEST)
|
| 1632 |
+
-PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
|
| 1633 |
+
$(PYTHON_FOR_BUILD) -Wi $(DESTDIR)$(LIBDEST)/compileall.py \
|
| 1634 |
+
-j0 -d $(LIBDEST)/site-packages -f \
|
| 1635 |
+
-x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
|
| 1636 |
+
-PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
|
| 1637 |
+
$(PYTHON_FOR_BUILD) -Wi -O $(DESTDIR)$(LIBDEST)/compileall.py \
|
| 1638 |
+
-j0 -d $(LIBDEST)/site-packages -f \
|
| 1639 |
+
-x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
|
| 1640 |
+
-PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
|
| 1641 |
+
$(PYTHON_FOR_BUILD) -Wi -OO $(DESTDIR)$(LIBDEST)/compileall.py \
|
| 1642 |
+
-j0 -d $(LIBDEST)/site-packages -f \
|
| 1643 |
+
-x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
|
| 1644 |
+
-PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
|
| 1645 |
+
$(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/Grammar.txt
|
| 1646 |
+
-PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
|
| 1647 |
+
$(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/PatternGrammar.txt
|
| 1648 |
+
|
| 1649 |
+
# bpo-21536: Misc/python-config.sh is generated in the build directory
|
| 1650 |
+
# from $(srcdir)Misc/python-config.sh.in.
|
| 1651 |
+
python-config: $(srcdir)/Misc/python-config.in Misc/python-config.sh
|
| 1652 |
+
@ # Substitution happens here, as the completely-expanded BINDIR
|
| 1653 |
+
@ # is not available in configure
|
| 1654 |
+
sed -e "s,@EXENAME@,$(BINDIR)/python$(LDVERSION)$(EXE)," < $(srcdir)/Misc/python-config.in >python-config.py
|
| 1655 |
+
@ # Replace makefile compat. variable references with shell script compat. ones; $(VAR) -> ${VAR}
|
| 1656 |
+
LC_ALL=C sed -e 's,\$$(\([A-Za-z0-9_]*\)),\$$\{\1\},g' < Misc/python-config.sh >python-config
|
| 1657 |
+
@ # On Darwin, always use the python version of the script, the shell
|
| 1658 |
+
@ # version doesn't use the compiler customizations that are provided
|
| 1659 |
+
@ # in python (_osx_support.py).
|
| 1660 |
+
@if test `uname -s` = Darwin; then \
|
| 1661 |
+
cp python-config.py python-config; \
|
| 1662 |
+
fi
|
| 1663 |
+
|
| 1664 |
+
|
| 1665 |
+
# Install the include files
|
| 1666 |
+
INCLDIRSTOMAKE=$(INCLUDEDIR) $(CONFINCLUDEDIR) $(INCLUDEPY) $(CONFINCLUDEPY)
|
| 1667 |
+
inclinstall:
|
| 1668 |
+
@for i in $(INCLDIRSTOMAKE); \
|
| 1669 |
+
do \
|
| 1670 |
+
if test ! -d $(DESTDIR)$$i; then \
|
| 1671 |
+
echo "Creating directory $$i"; \
|
| 1672 |
+
$(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
|
| 1673 |
+
else true; \
|
| 1674 |
+
fi; \
|
| 1675 |
+
done
|
| 1676 |
+
@if test ! -d $(DESTDIR)$(INCLUDEPY)/cpython; then \
|
| 1677 |
+
echo "Creating directory $(DESTDIR)$(INCLUDEPY)/cpython"; \
|
| 1678 |
+
$(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$(INCLUDEPY)/cpython; \
|
| 1679 |
+
else true; \
|
| 1680 |
+
fi
|
| 1681 |
+
@if test ! -d $(DESTDIR)$(INCLUDEPY)/internal; then \
|
| 1682 |
+
echo "Creating directory $(DESTDIR)$(INCLUDEPY)/internal"; \
|
| 1683 |
+
$(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$(INCLUDEPY)/internal; \
|
| 1684 |
+
else true; \
|
| 1685 |
+
fi
|
| 1686 |
+
@for i in $(srcdir)/Include/*.h; \
|
| 1687 |
+
do \
|
| 1688 |
+
echo $(INSTALL_DATA) $$i $(INCLUDEPY); \
|
| 1689 |
+
$(INSTALL_DATA) $$i $(DESTDIR)$(INCLUDEPY); \
|
| 1690 |
+
done
|
| 1691 |
+
@for i in $(srcdir)/Include/cpython/*.h; \
|
| 1692 |
+
do \
|
| 1693 |
+
echo $(INSTALL_DATA) $$i $(INCLUDEPY)/cpython; \
|
| 1694 |
+
$(INSTALL_DATA) $$i $(DESTDIR)$(INCLUDEPY)/cpython; \
|
| 1695 |
+
done
|
| 1696 |
+
@for i in $(srcdir)/Include/internal/*.h; \
|
| 1697 |
+
do \
|
| 1698 |
+
echo $(INSTALL_DATA) $$i $(INCLUDEPY)/internal; \
|
| 1699 |
+
$(INSTALL_DATA) $$i $(DESTDIR)$(INCLUDEPY)/internal; \
|
| 1700 |
+
done
|
| 1701 |
+
$(INSTALL_DATA) pyconfig.h $(DESTDIR)$(CONFINCLUDEPY)/pyconfig.h
|
| 1702 |
+
|
| 1703 |
+
# Install the library and miscellaneous stuff needed for extending/embedding
|
| 1704 |
+
# This goes into $(exec_prefix)
|
| 1705 |
+
LIBPL= $(prefix)/lib/python3.10/config-$(VERSION)$(ABIFLAGS)-x86_64-linux-gnu
|
| 1706 |
+
|
| 1707 |
+
# pkgconfig directory
|
| 1708 |
+
LIBPC= $(LIBDIR)/pkgconfig
|
| 1709 |
+
|
| 1710 |
+
libainstall: build_all python-config
|
| 1711 |
+
@for i in $(LIBDIR) $(LIBPL) $(LIBPC) $(BINDIR); \
|
| 1712 |
+
do \
|
| 1713 |
+
if test ! -d $(DESTDIR)$$i; then \
|
| 1714 |
+
echo "Creating directory $$i"; \
|
| 1715 |
+
$(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
|
| 1716 |
+
else true; \
|
| 1717 |
+
fi; \
|
| 1718 |
+
done
|
| 1719 |
+
@if test "$(STATIC_LIBPYTHON)" = 1; then \
|
| 1720 |
+
if test -d $(LIBRARY); then :; else \
|
| 1721 |
+
if test "$(PYTHONFRAMEWORKDIR)" = no-framework; then \
|
| 1722 |
+
if test "$(SHLIB_SUFFIX)" = .dll; then \
|
| 1723 |
+
$(INSTALL_DATA) $(LDLIBRARY) $(DESTDIR)$(LIBPL) ; \
|
| 1724 |
+
else \
|
| 1725 |
+
$(INSTALL_DATA) $(LIBRARY) $(DESTDIR)$(LIBPL)/$(LIBRARY) ; \
|
| 1726 |
+
fi; \
|
| 1727 |
+
else \
|
| 1728 |
+
echo Skip install of $(LIBRARY) - use make frameworkinstall; \
|
| 1729 |
+
fi; \
|
| 1730 |
+
fi; \
|
| 1731 |
+
$(INSTALL_DATA) Programs/python.o $(DESTDIR)$(LIBPL)/python.o; \
|
| 1732 |
+
fi
|
| 1733 |
+
$(INSTALL_DATA) Modules/config.c $(DESTDIR)$(LIBPL)/config.c
|
| 1734 |
+
$(INSTALL_DATA) $(srcdir)/Modules/config.c.in $(DESTDIR)$(LIBPL)/config.c.in
|
| 1735 |
+
$(INSTALL_DATA) Makefile $(DESTDIR)$(LIBPL)/Makefile
|
| 1736 |
+
$(INSTALL_DATA) $(srcdir)/Modules/Setup $(DESTDIR)$(LIBPL)/Setup
|
| 1737 |
+
$(INSTALL_DATA) Modules/Setup.local $(DESTDIR)$(LIBPL)/Setup.local
|
| 1738 |
+
$(INSTALL_DATA) Misc/python.pc $(DESTDIR)$(LIBPC)/python-$(VERSION).pc
|
| 1739 |
+
$(INSTALL_DATA) Misc/python-embed.pc $(DESTDIR)$(LIBPC)/python-$(VERSION)-embed.pc
|
| 1740 |
+
$(INSTALL_SCRIPT) $(srcdir)/Modules/makesetup $(DESTDIR)$(LIBPL)/makesetup
|
| 1741 |
+
$(INSTALL_SCRIPT) $(srcdir)/install-sh $(DESTDIR)$(LIBPL)/install-sh
|
| 1742 |
+
$(INSTALL_SCRIPT) python-config.py $(DESTDIR)$(LIBPL)/python-config.py
|
| 1743 |
+
$(INSTALL_SCRIPT) python-config $(DESTDIR)$(BINDIR)/python$(LDVERSION)-config
|
| 1744 |
+
@if [ -s Modules/python.exp -a \
|
| 1745 |
+
"`echo $(MACHDEP) | sed 's/^\(...\).*/\1/'`" = "aix" ]; then \
|
| 1746 |
+
echo; echo "Installing support files for building shared extension modules on AIX:"; \
|
| 1747 |
+
$(INSTALL_DATA) Modules/python.exp \
|
| 1748 |
+
$(DESTDIR)$(LIBPL)/python.exp; \
|
| 1749 |
+
echo; echo "$(LIBPL)/python.exp"; \
|
| 1750 |
+
$(INSTALL_SCRIPT) $(srcdir)/Modules/makexp_aix \
|
| 1751 |
+
$(DESTDIR)$(LIBPL)/makexp_aix; \
|
| 1752 |
+
echo "$(LIBPL)/makexp_aix"; \
|
| 1753 |
+
$(INSTALL_SCRIPT) Modules/ld_so_aix \
|
| 1754 |
+
$(DESTDIR)$(LIBPL)/ld_so_aix; \
|
| 1755 |
+
echo "$(LIBPL)/ld_so_aix"; \
|
| 1756 |
+
echo; echo "See Misc/README.AIX for details."; \
|
| 1757 |
+
else true; \
|
| 1758 |
+
fi
|
| 1759 |
+
|
| 1760 |
+
# Install the dynamically loadable modules
|
| 1761 |
+
# This goes into $(exec_prefix)
|
| 1762 |
+
sharedinstall: sharedmods
|
| 1763 |
+
$(RUNSHARED) $(PY_BUILD_ENVIRON) $(PYTHON_FOR_BUILD) $(srcdir)/setup.py install \
|
| 1764 |
+
--prefix=$(prefix) \
|
| 1765 |
+
--install-scripts=$(BINDIR) \
|
| 1766 |
+
--install-platlib=$(DESTSHARED) \
|
| 1767 |
+
--root=$(DESTDIR)/
|
| 1768 |
+
-rm $(DESTDIR)$(DESTSHARED)/_sysconfigdata_$(ABIFLAGS)_$(MACHDEP)_$(MULTIARCH).py
|
| 1769 |
+
-rm -r $(DESTDIR)$(DESTSHARED)/__pycache__
|
| 1770 |
+
|
| 1771 |
+
# Here are a couple of targets for MacOSX again, to install a full
|
| 1772 |
+
# framework-based Python. frameworkinstall installs everything, the
|
| 1773 |
+
# subtargets install specific parts. Much of the actual work is offloaded to
|
| 1774 |
+
# the Makefile in Mac
|
| 1775 |
+
#
|
| 1776 |
+
#
|
| 1777 |
+
# This target is here for backward compatibility, previous versions of Python
|
| 1778 |
+
# hadn't integrated framework installation in the normal install process.
|
| 1779 |
+
frameworkinstall: install
|
| 1780 |
+
|
| 1781 |
+
# On install, we re-make the framework
|
| 1782 |
+
# structure in the install location, /Library/Frameworks/ or the argument to
|
| 1783 |
+
# --enable-framework. If --enable-framework has been specified then we have
|
| 1784 |
+
# automatically set prefix to the location deep down in the framework, so we
|
| 1785 |
+
# only have to cater for the structural bits of the framework.
|
| 1786 |
+
|
| 1787 |
+
frameworkinstallframework: frameworkinstallstructure install frameworkinstallmaclib
|
| 1788 |
+
|
| 1789 |
+
frameworkinstallstructure: $(LDLIBRARY)
|
| 1790 |
+
@if test "$(PYTHONFRAMEWORKDIR)" = no-framework; then \
|
| 1791 |
+
echo Not configured with --enable-framework; \
|
| 1792 |
+
exit 1; \
|
| 1793 |
+
else true; \
|
| 1794 |
+
fi
|
| 1795 |
+
@for i in $(prefix)/Resources/English.lproj $(prefix)/lib; do\
|
| 1796 |
+
if test ! -d $(DESTDIR)$$i; then \
|
| 1797 |
+
echo "Creating directory $(DESTDIR)$$i"; \
|
| 1798 |
+
$(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
|
| 1799 |
+
else true; \
|
| 1800 |
+
fi; \
|
| 1801 |
+
done
|
| 1802 |
+
$(LN) -fsn include/python$(LDVERSION) $(DESTDIR)$(prefix)/Headers
|
| 1803 |
+
sed 's/%VERSION%/'"`$(RUNSHARED) ./$(BUILDPYTHON) -c 'import platform; print(platform.python_version())'`"'/g' < $(RESSRCDIR)/Info.plist > $(DESTDIR)$(prefix)/Resources/Info.plist
|
| 1804 |
+
$(LN) -fsn $(VERSION) $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Versions/Current
|
| 1805 |
+
$(LN) -fsn Versions/Current/$(PYTHONFRAMEWORK) $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/$(PYTHONFRAMEWORK)
|
| 1806 |
+
$(LN) -fsn Versions/Current/Headers $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Headers
|
| 1807 |
+
$(LN) -fsn Versions/Current/Resources $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Resources
|
| 1808 |
+
$(INSTALL_SHARED) $(LDLIBRARY) $(DESTDIR)$(PYTHONFRAMEWORKPREFIX)/$(LDLIBRARY)
|
| 1809 |
+
|
| 1810 |
+
# This installs Mac/Lib into the framework
|
| 1811 |
+
# Install a number of symlinks to keep software that expects a normal unix
|
| 1812 |
+
# install (which includes python-config) happy.
|
| 1813 |
+
frameworkinstallmaclib:
|
| 1814 |
+
$(LN) -fs "../../../$(PYTHONFRAMEWORK)" "$(DESTDIR)$(LIBPL)/libpython$(LDVERSION).a"
|
| 1815 |
+
$(LN) -fs "../../../$(PYTHONFRAMEWORK)" "$(DESTDIR)$(LIBPL)/libpython$(LDVERSION).dylib"
|
| 1816 |
+
$(LN) -fs "../../../$(PYTHONFRAMEWORK)" "$(DESTDIR)$(LIBPL)/libpython$(VERSION).a"
|
| 1817 |
+
$(LN) -fs "../../../$(PYTHONFRAMEWORK)" "$(DESTDIR)$(LIBPL)/libpython$(VERSION).dylib"
|
| 1818 |
+
$(LN) -fs "../$(PYTHONFRAMEWORK)" "$(DESTDIR)$(prefix)/lib/libpython$(LDVERSION).dylib"
|
| 1819 |
+
$(LN) -fs "../$(PYTHONFRAMEWORK)" "$(DESTDIR)$(prefix)/lib/libpython$(VERSION).dylib"
|
| 1820 |
+
|
| 1821 |
+
# This installs the IDE, the Launcher and other apps into /Applications
|
| 1822 |
+
frameworkinstallapps:
|
| 1823 |
+
cd Mac && $(MAKE) installapps DESTDIR="$(DESTDIR)"
|
| 1824 |
+
|
| 1825 |
+
# Build the bootstrap executable that will spawn the interpreter inside
|
| 1826 |
+
# an app bundle within the framework. This allows the interpreter to
|
| 1827 |
+
# run OS X GUI APIs.
|
| 1828 |
+
frameworkpythonw:
|
| 1829 |
+
cd Mac && $(MAKE) pythonw
|
| 1830 |
+
|
| 1831 |
+
# This installs the python* and other bin symlinks in $prefix/bin or in
|
| 1832 |
+
# a bin directory relative to the framework root
|
| 1833 |
+
frameworkinstallunixtools:
|
| 1834 |
+
cd Mac && $(MAKE) installunixtools DESTDIR="$(DESTDIR)"
|
| 1835 |
+
|
| 1836 |
+
frameworkaltinstallunixtools:
|
| 1837 |
+
cd Mac && $(MAKE) altinstallunixtools DESTDIR="$(DESTDIR)"
|
| 1838 |
+
|
| 1839 |
+
# This installs the Tools into the applications directory.
|
| 1840 |
+
# It is not part of a normal frameworkinstall
|
| 1841 |
+
frameworkinstallextras:
|
| 1842 |
+
cd Mac && $(MAKE) installextras DESTDIR="$(DESTDIR)"
|
| 1843 |
+
|
| 1844 |
+
# Build the toplevel Makefile
|
| 1845 |
+
Makefile.pre: $(srcdir)/Makefile.pre.in config.status
|
| 1846 |
+
CONFIG_FILES=Makefile.pre CONFIG_HEADERS= $(SHELL) config.status
|
| 1847 |
+
$(MAKE) -f Makefile.pre Makefile
|
| 1848 |
+
|
| 1849 |
+
# Run the configure script.
|
| 1850 |
+
config.status: $(srcdir)/configure
|
| 1851 |
+
$(SHELL) $(srcdir)/configure $(CONFIG_ARGS)
|
| 1852 |
+
|
| 1853 |
+
.PRECIOUS: config.status $(BUILDPYTHON) Makefile Makefile.pre
|
| 1854 |
+
|
| 1855 |
+
# Some make's put the object file in the current directory
|
| 1856 |
+
.c.o:
|
| 1857 |
+
$(CC) -c $(PY_CORE_CFLAGS) -o $@ $<
|
| 1858 |
+
|
| 1859 |
+
# bpo-30104: dtoa.c uses union to cast double to unsigned long[2]. clang 4.0
|
| 1860 |
+
# with -O2 or higher and strict aliasing miscompiles the ratio() function
|
| 1861 |
+
# causing rounding issues. Compile dtoa.c using -fno-strict-aliasing on clang.
|
| 1862 |
+
# https://bugs.llvm.org//show_bug.cgi?id=31928
|
| 1863 |
+
Python/dtoa.o: Python/dtoa.c
|
| 1864 |
+
$(CC) -c $(PY_CORE_CFLAGS) $(CFLAGS_ALIASING) -o $@ $<
|
| 1865 |
+
|
| 1866 |
+
# Run reindent on the library
|
| 1867 |
+
reindent:
|
| 1868 |
+
./$(BUILDPYTHON) $(srcdir)/Tools/scripts/reindent.py -r $(srcdir)/Lib
|
| 1869 |
+
|
| 1870 |
+
# Rerun configure with the same options as it was run last time,
|
| 1871 |
+
# provided the config.status script exists
|
| 1872 |
+
recheck:
|
| 1873 |
+
$(SHELL) config.status --recheck
|
| 1874 |
+
$(SHELL) config.status
|
| 1875 |
+
|
| 1876 |
+
# Regenerate configure and pyconfig.h.in
|
| 1877 |
+
.PHONY: autoconf
|
| 1878 |
+
autoconf:
|
| 1879 |
+
# Regenerate the configure script from configure.ac using autoconf
|
| 1880 |
+
(cd $(srcdir); autoconf -Wall)
|
| 1881 |
+
# Regenerate pyconfig.h.in from configure.ac using autoheader
|
| 1882 |
+
(cd $(srcdir); autoheader -Wall)
|
| 1883 |
+
|
| 1884 |
+
# See https://github.com/tiran/cpython_autoconf container
|
| 1885 |
+
.PHONY: regen-configure
|
| 1886 |
+
regen-configure:
|
| 1887 |
+
@if command -v podman >/dev/null; then RUNTIME="podman"; else RUNTIME="docker"; fi; \
|
| 1888 |
+
if ! command -v $$RUNTIME; then echo "$@ needs either Podman or Docker container runtime." >&2; exit 1; fi; \
|
| 1889 |
+
if command -v selinuxenabled >/dev/null && selinuxenabled; then OPT=":Z"; fi; \
|
| 1890 |
+
# Manifest corresponds with tag '269' \
|
| 1891 |
+
CPYTHON_AUTOCONF_MANIFEST="sha256:f370fee95eefa3d57b00488bce4911635411fa83e2d293ced8cf8a3674ead939" \
|
| 1892 |
+
CMD="$$RUNTIME run --rm --pull=missing -v $(abs_srcdir):/src$$OPT quay.io/tiran/cpython_autoconf@$$CPYTHON_AUTOCONF_MANIFEST"; \
|
| 1893 |
+
echo $$CMD; \
|
| 1894 |
+
$$CMD || exit $?
|
| 1895 |
+
|
| 1896 |
+
# Create a tags file for vi
|
| 1897 |
+
tags::
|
| 1898 |
+
ctags -w $(srcdir)/Include/*.h $(srcdir)/Include/cpython/*.h $(srcdir)/Include/internal/*.h
|
| 1899 |
+
for i in $(SRCDIRS); do ctags -f tags -w -a $(srcdir)/$$i/*.[ch]; done
|
| 1900 |
+
ctags -f tags -w -a $(srcdir)/Modules/_ctypes/*.[ch]
|
| 1901 |
+
find $(srcdir)/Lib -type f -name "*.py" -not -name "test_*.py" -not -path "*/test/*" -not -path "*/tests/*" -not -path "*/*_test/*" | ctags -f tags -w -a -L -
|
| 1902 |
+
LC_ALL=C sort -o tags tags
|
| 1903 |
+
|
| 1904 |
+
# Create a tags file for GNU Emacs
|
| 1905 |
+
TAGS::
|
| 1906 |
+
cd $(srcdir); \
|
| 1907 |
+
etags Include/*.h Include/cpython/*.h Include/internal/*.h; \
|
| 1908 |
+
for i in $(SRCDIRS); do etags -a $$i/*.[ch]; done
|
| 1909 |
+
etags -a $(srcdir)/Modules/_ctypes/*.[ch]
|
| 1910 |
+
find $(srcdir)/Lib -type f -name "*.py" -not -name "test_*.py" -not -path "*/test/*" -not -path "*/tests/*" -not -path "*/*_test/*" | etags - -a
|
| 1911 |
+
|
| 1912 |
+
# Sanitation targets -- clean leaves libraries, executables and tags
|
| 1913 |
+
# files, which clobber removes as well
|
| 1914 |
+
pycremoval:
|
| 1915 |
+
-find $(srcdir) -depth -name '__pycache__' -exec rm -rf {} ';'
|
| 1916 |
+
-find $(srcdir) -name '*.py[co]' -exec rm -f {} ';'
|
| 1917 |
+
|
| 1918 |
+
rmtestturds:
|
| 1919 |
+
-rm -f *BAD *GOOD *SKIPPED
|
| 1920 |
+
-rm -rf OUT
|
| 1921 |
+
-rm -f *.TXT
|
| 1922 |
+
-rm -f *.txt
|
| 1923 |
+
-rm -f gb-18030-2000.xml
|
| 1924 |
+
|
| 1925 |
+
docclean:
|
| 1926 |
+
$(MAKE) -C $(srcdir)/Doc clean
|
| 1927 |
+
|
| 1928 |
+
# like the 'clean' target but retain the profile guided optimization (PGO)
|
| 1929 |
+
# data. The PGO data is only valid if source code remains unchanged.
|
| 1930 |
+
clean-retain-profile: pycremoval
|
| 1931 |
+
find . -name '*.[oa]' -exec rm -f {} ';'
|
| 1932 |
+
find . -name '*.s[ol]' -exec rm -f {} ';'
|
| 1933 |
+
find . -name '*.so.[0-9]*.[0-9]*' -exec rm -f {} ';'
|
| 1934 |
+
find . -name '*.lst' -exec rm -f {} ';'
|
| 1935 |
+
find build -name 'fficonfig.h' -exec rm -f {} ';' || true
|
| 1936 |
+
find build -name '*.py' -exec rm -f {} ';' || true
|
| 1937 |
+
find build -name '*.py[co]' -exec rm -f {} ';' || true
|
| 1938 |
+
-rm -f pybuilddir.txt
|
| 1939 |
+
-rm -f Lib/lib2to3/*Grammar*.pickle
|
| 1940 |
+
-rm -f Programs/_testembed Programs/_freeze_importlib
|
| 1941 |
+
-find build -type f -a ! -name '*.gc??' -exec rm -f {} ';'
|
| 1942 |
+
-rm -f Include/pydtrace_probes.h
|
| 1943 |
+
-rm -f profile-gen-stamp
|
| 1944 |
+
|
| 1945 |
+
profile-removal:
|
| 1946 |
+
find . -name '*.gc??' -exec rm -f {} ';'
|
| 1947 |
+
find . -name '*.profclang?' -exec rm -f {} ';'
|
| 1948 |
+
find . -name '*.dyn' -exec rm -f {} ';'
|
| 1949 |
+
rm -f $(COVERAGE_INFO)
|
| 1950 |
+
rm -rf $(COVERAGE_REPORT)
|
| 1951 |
+
rm -f profile-run-stamp
|
| 1952 |
+
|
| 1953 |
+
clean: clean-retain-profile
|
| 1954 |
+
@if test profile-opt = profile-opt; then \
|
| 1955 |
+
rm -f profile-gen-stamp profile-clean-stamp; \
|
| 1956 |
+
$(MAKE) profile-removal; \
|
| 1957 |
+
fi
|
| 1958 |
+
|
| 1959 |
+
clobber: clean
|
| 1960 |
+
-rm -f $(BUILDPYTHON) $(LIBRARY) $(LDLIBRARY) $(DLLLIBRARY) \
|
| 1961 |
+
tags TAGS \
|
| 1962 |
+
config.cache config.log pyconfig.h Modules/config.c
|
| 1963 |
+
-rm -rf build platform
|
| 1964 |
+
-rm -rf $(PYTHONFRAMEWORKDIR)
|
| 1965 |
+
-rm -f python-config.py python-config
|
| 1966 |
+
|
| 1967 |
+
# Make things extra clean, before making a distribution:
|
| 1968 |
+
# remove all generated files, even Makefile[.pre]
|
| 1969 |
+
# Keep configure and Python-ast.[ch], it's possible they can't be generated
|
| 1970 |
+
distclean: clobber docclean
|
| 1971 |
+
for file in $(srcdir)/Lib/test/data/* ; do \
|
| 1972 |
+
if test "$$file" != "$(srcdir)/Lib/test/data/README"; then rm "$$file"; fi; \
|
| 1973 |
+
done
|
| 1974 |
+
-rm -f core Makefile Makefile.pre config.status Modules/Setup.local \
|
| 1975 |
+
Modules/ld_so_aix Modules/python.exp Misc/python.pc \
|
| 1976 |
+
Misc/python-embed.pc Misc/python-config.sh
|
| 1977 |
+
-rm -f python*-gdb.py
|
| 1978 |
+
# Issue #28258: set LC_ALL to avoid issues with Estonian locale.
|
| 1979 |
+
# Expansion is performed here by shell (spawned by make) itself before
|
| 1980 |
+
# arguments are passed to find. So LC_ALL=C must be set as a separate
|
| 1981 |
+
# command.
|
| 1982 |
+
LC_ALL=C; find $(srcdir)/[a-zA-Z]* '(' -name '*.fdc' -o -name '*~' \
|
| 1983 |
+
-o -name '[@,#]*' -o -name '*.old' \
|
| 1984 |
+
-o -name '*.orig' -o -name '*.rej' \
|
| 1985 |
+
-o -name '*.bak' ')' \
|
| 1986 |
+
-exec rm -f {} ';'
|
| 1987 |
+
|
| 1988 |
+
# Check that all symbols exported by libpython start with "Py" or "_Py"
|
| 1989 |
+
smelly: build_all
|
| 1990 |
+
$(RUNSHARED) ./$(BUILDPYTHON) $(srcdir)/Tools/scripts/smelly.py
|
| 1991 |
+
|
| 1992 |
+
# Find files with funny names
|
| 1993 |
+
funny:
|
| 1994 |
+
find $(SUBDIRS) $(SUBDIRSTOO) \
|
| 1995 |
+
-type d \
|
| 1996 |
+
-o -name '*.[chs]' \
|
| 1997 |
+
-o -name '*.py' \
|
| 1998 |
+
-o -name '*.pyw' \
|
| 1999 |
+
-o -name '*.dat' \
|
| 2000 |
+
-o -name '*.el' \
|
| 2001 |
+
-o -name '*.fd' \
|
| 2002 |
+
-o -name '*.in' \
|
| 2003 |
+
-o -name '*.gif' \
|
| 2004 |
+
-o -name '*.txt' \
|
| 2005 |
+
-o -name '*.xml' \
|
| 2006 |
+
-o -name '*.xbm' \
|
| 2007 |
+
-o -name '*.xpm' \
|
| 2008 |
+
-o -name '*.uue' \
|
| 2009 |
+
-o -name '*.decTest' \
|
| 2010 |
+
-o -name '*.tmCommand' \
|
| 2011 |
+
-o -name '*.tmSnippet' \
|
| 2012 |
+
-o -name 'Setup' \
|
| 2013 |
+
-o -name 'Setup.*' \
|
| 2014 |
+
-o -name README \
|
| 2015 |
+
-o -name NEWS \
|
| 2016 |
+
-o -name HISTORY \
|
| 2017 |
+
-o -name Makefile \
|
| 2018 |
+
-o -name ChangeLog \
|
| 2019 |
+
-o -name .hgignore \
|
| 2020 |
+
-o -name MANIFEST \
|
| 2021 |
+
-o -print
|
| 2022 |
+
|
| 2023 |
+
# Perform some verification checks on any modified files.
|
| 2024 |
+
patchcheck: build_all
|
| 2025 |
+
$(RUNSHARED) ./$(BUILDPYTHON) $(srcdir)/Tools/scripts/patchcheck.py
|
| 2026 |
+
|
| 2027 |
+
check-limited-abi: all
|
| 2028 |
+
$(RUNSHARED) ./$(BUILDPYTHON) $(srcdir)/Tools/scripts/stable_abi.py --all $(srcdir)/Misc/stable_abi.txt
|
| 2029 |
+
|
| 2030 |
+
.PHONY: update-config
|
| 2031 |
+
update-config:
|
| 2032 |
+
curl -sL -o config.guess 'https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD'
|
| 2033 |
+
curl -sL -o config.sub 'https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD'
|
| 2034 |
+
chmod +x config.guess config.sub
|
| 2035 |
+
|
| 2036 |
+
# Dependencies
|
| 2037 |
+
|
| 2038 |
+
Python/thread.o: $(srcdir)/Python/thread_nt.h $(srcdir)/Python/thread_pthread.h $(srcdir)/Python/condvar.h
|
| 2039 |
+
|
| 2040 |
+
# Declare targets that aren't real files
|
| 2041 |
+
.PHONY: all build_all sharedmods check-clean-src oldsharedmods test quicktest
|
| 2042 |
+
.PHONY: install altinstall oldsharedinstall bininstall altbininstall
|
| 2043 |
+
.PHONY: maninstall libinstall inclinstall libainstall sharedinstall
|
| 2044 |
+
.PHONY: frameworkinstall frameworkinstallframework frameworkinstallstructure
|
| 2045 |
+
.PHONY: frameworkinstallmaclib frameworkinstallapps frameworkinstallunixtools
|
| 2046 |
+
.PHONY: frameworkaltinstallunixtools recheck clean clobber distclean
|
| 2047 |
+
.PHONY: smelly funny patchcheck touch altmaninstall commoninstall
|
| 2048 |
+
.PHONY: clean-retain-profile profile-removal run_profile_task
|
| 2049 |
+
.PHONY: build_all_generate_profile build_all_merge_profile
|
| 2050 |
+
.PHONY: gdbhooks
|
| 2051 |
+
|
| 2052 |
+
# IF YOU PUT ANYTHING HERE IT WILL GO AWAY
|
| 2053 |
+
# Local Variables:
|
| 2054 |
+
# mode: makefile
|
| 2055 |
+
# End:
|
| 2056 |
+
|
| 2057 |
+
# Rules appended by makesetup
|
| 2058 |
+
|
| 2059 |
+
Modules/posixmodule.o: $(srcdir)/Modules/posixmodule.c; $(CC) $(PY_BUILTIN_MODULE_CFLAGS) -DPy_BUILD_CORE_BUILTIN -I$(srcdir)/Include/internal -c $(srcdir)/Modules/posixmodule.c -o Modules/posixmodule.o
|
| 2060 |
+
Modules/posix$(EXT_SUFFIX): Modules/posixmodule.o; $(BLDSHARED) Modules/posixmodule.o -o Modules/posix$(EXT_SUFFIX)
|
| 2061 |
+
Modules/errnomodule.o: $(srcdir)/Modules/errnomodule.c; $(CC) $(PY_BUILTIN_MODULE_CFLAGS) -c $(srcdir)/Modules/errnomodule.c -o Modules/errnomodule.o
|
| 2062 |
+
Modules/errno$(EXT_SUFFIX): Modules/errnomodule.o; $(BLDSHARED) Modules/errnomodule.o -o Modules/errno$(EXT_SUFFIX)
|
| 2063 |
+
Modules/pwdmodule.o: $(srcdir)/Modules/pwdmodule.c; $(CC) $(PY_BUILTIN_MODULE_CFLAGS) -c $(srcdir)/Modules/pwdmodule.c -o Modules/pwdmodule.o
|
| 2064 |
+
Modules/pwd$(EXT_SUFFIX): Modules/pwdmodule.o; $(BLDSHARED) Modules/pwdmodule.o -o Modules/pwd$(EXT_SUFFIX)
|
| 2065 |
+
Modules/_sre.o: $(srcdir)/Modules/_sre.c; $(CC) $(PY_BUILTIN_MODULE_CFLAGS) -DPy_BUILD_CORE_BUILTIN -c $(srcdir)/Modules/_sre.c -o Modules/_sre.o
|
| 2066 |
+
Modules/_sre$(EXT_SUFFIX): Modules/_sre.o; $(BLDSHARED) Modules/_sre.o -o Modules/_sre$(EXT_SUFFIX)
|
| 2067 |
+
Modules/_codecsmodule.o: $(srcdir)/Modules/_codecsmodule.c; $(CC) $(PY_BUILTIN_MODULE_CFLAGS) -c $(srcdir)/Modules/_codecsmodule.c -o Modules/_codecsmodule.o
|
| 2068 |
+
Modules/_codecs$(EXT_SUFFIX): Modules/_codecsmodule.o; $(BLDSHARED) Modules/_codecsmodule.o -o Modules/_codecs$(EXT_SUFFIX)
|
| 2069 |
+
Modules/_weakref.o: $(srcdir)/Modules/_weakref.c; $(CC) $(PY_BUILTIN_MODULE_CFLAGS) -c $(srcdir)/Modules/_weakref.c -o Modules/_weakref.o
|
| 2070 |
+
Modules/_weakref$(EXT_SUFFIX): Modules/_weakref.o; $(BLDSHARED) Modules/_weakref.o -o Modules/_weakref$(EXT_SUFFIX)
|
| 2071 |
+
Modules/_functoolsmodule.o: $(srcdir)/Modules/_functoolsmodule.c; $(CC) $(PY_BUILTIN_MODULE_CFLAGS) -DPy_BUILD_CORE_BUILTIN -I$(srcdir)/Include/internal -c $(srcdir)/Modules/_functoolsmodule.c -o Modules/_functoolsmodule.o
|
| 2072 |
+
Modules/_functools$(EXT_SUFFIX): Modules/_functoolsmodule.o; $(BLDSHARED) Modules/_functoolsmodule.o -o Modules/_functools$(EXT_SUFFIX)
|
| 2073 |
+
Modules/_operator.o: $(srcdir)/Modules/_operator.c; $(CC) $(PY_BUILTIN_MODULE_CFLAGS) -DPy_BUILD_CORE_BUILTIN -c $(srcdir)/Modules/_operator.c -o Modules/_operator.o
|
| 2074 |
+
Modules/_operator$(EXT_SUFFIX): Modules/_operator.o; $(BLDSHARED) Modules/_operator.o -o Modules/_operator$(EXT_SUFFIX)
|
| 2075 |
+
Modules/_collectionsmodule.o: $(srcdir)/Modules/_collectionsmodule.c; $(CC) $(PY_BUILTIN_MODULE_CFLAGS) -c $(srcdir)/Modules/_collectionsmodule.c -o Modules/_collectionsmodule.o
|
| 2076 |
+
Modules/_collections$(EXT_SUFFIX): Modules/_collectionsmodule.o; $(BLDSHARED) Modules/_collectionsmodule.o -o Modules/_collections$(EXT_SUFFIX)
|
| 2077 |
+
Modules/_abc.o: $(srcdir)/Modules/_abc.c; $(CC) $(PY_BUILTIN_MODULE_CFLAGS) -DPy_BUILD_CORE_BUILTIN -c $(srcdir)/Modules/_abc.c -o Modules/_abc.o
|
| 2078 |
+
Modules/_abc$(EXT_SUFFIX): Modules/_abc.o; $(BLDSHARED) Modules/_abc.o -o Modules/_abc$(EXT_SUFFIX)
|
| 2079 |
+
Modules/itertoolsmodule.o: $(srcdir)/Modules/itertoolsmodule.c; $(CC) $(PY_BUILTIN_MODULE_CFLAGS) -c $(srcdir)/Modules/itertoolsmodule.c -o Modules/itertoolsmodule.o
|
| 2080 |
+
Modules/itertools$(EXT_SUFFIX): Modules/itertoolsmodule.o; $(BLDSHARED) Modules/itertoolsmodule.o -o Modules/itertools$(EXT_SUFFIX)
|
| 2081 |
+
Modules/atexitmodule.o: $(srcdir)/Modules/atexitmodule.c; $(CC) $(PY_BUILTIN_MODULE_CFLAGS) -c $(srcdir)/Modules/atexitmodule.c -o Modules/atexitmodule.o
|
| 2082 |
+
Modules/atexit$(EXT_SUFFIX): Modules/atexitmodule.o; $(BLDSHARED) Modules/atexitmodule.o -o Modules/atexit$(EXT_SUFFIX)
|
| 2083 |
+
Modules/signalmodule.o: $(srcdir)/Modules/signalmodule.c; $(CC) $(PY_BUILTIN_MODULE_CFLAGS) -DPy_BUILD_CORE_BUILTIN -I$(srcdir)/Include/internal -c $(srcdir)/Modules/signalmodule.c -o Modules/signalmodule.o
|
| 2084 |
+
Modules/_signal$(EXT_SUFFIX): Modules/signalmodule.o; $(BLDSHARED) Modules/signalmodule.o -o Modules/_signal$(EXT_SUFFIX)
|
| 2085 |
+
Modules/_stat.o: $(srcdir)/Modules/_stat.c; $(CC) $(PY_BUILTIN_MODULE_CFLAGS) -c $(srcdir)/Modules/_stat.c -o Modules/_stat.o
|
| 2086 |
+
Modules/_stat$(EXT_SUFFIX): Modules/_stat.o; $(BLDSHARED) Modules/_stat.o -o Modules/_stat$(EXT_SUFFIX)
|
| 2087 |
+
Modules/timemodule.o: $(srcdir)/Modules/timemodule.c; $(CC) $(PY_BUILTIN_MODULE_CFLAGS) -DPy_BUILD_CORE_BUILTIN -I$(srcdir)/Include/internal -c $(srcdir)/Modules/timemodule.c -o Modules/timemodule.o
|
| 2088 |
+
Modules/time$(EXT_SUFFIX): Modules/timemodule.o; $(BLDSHARED) Modules/timemodule.o -o Modules/time$(EXT_SUFFIX)
|
| 2089 |
+
Modules/_threadmodule.o: $(srcdir)/Modules/_threadmodule.c; $(CC) $(PY_BUILTIN_MODULE_CFLAGS) -DPy_BUILD_CORE_BUILTIN -I$(srcdir)/Include/internal -c $(srcdir)/Modules/_threadmodule.c -o Modules/_threadmodule.o
|
| 2090 |
+
Modules/_thread$(EXT_SUFFIX): Modules/_threadmodule.o; $(BLDSHARED) Modules/_threadmodule.o -o Modules/_thread$(EXT_SUFFIX)
|
| 2091 |
+
Modules/_localemodule.o: $(srcdir)/Modules/_localemodule.c; $(CC) $(PY_BUILTIN_MODULE_CFLAGS) -DPy_BUILD_CORE_BUILTIN -c $(srcdir)/Modules/_localemodule.c -o Modules/_localemodule.o
|
| 2092 |
+
Modules/_locale$(EXT_SUFFIX): Modules/_localemodule.o; $(BLDSHARED) Modules/_localemodule.o -o Modules/_locale$(EXT_SUFFIX)
|
| 2093 |
+
Modules/_iomodule.o: $(srcdir)/Modules/_io/_iomodule.c; $(CC) $(PY_BUILTIN_MODULE_CFLAGS) -DPy_BUILD_CORE_BUILTIN -I$(srcdir)/Include/internal -I$(srcdir)/Modules/_io -c $(srcdir)/Modules/_io/_iomodule.c -o Modules/_iomodule.o
|
| 2094 |
+
Modules/iobase.o: $(srcdir)/Modules/_io/iobase.c; $(CC) $(PY_BUILTIN_MODULE_CFLAGS) -DPy_BUILD_CORE_BUILTIN -I$(srcdir)/Include/internal -I$(srcdir)/Modules/_io -c $(srcdir)/Modules/_io/iobase.c -o Modules/iobase.o
|
| 2095 |
+
Modules/fileio.o: $(srcdir)/Modules/_io/fileio.c; $(CC) $(PY_BUILTIN_MODULE_CFLAGS) -DPy_BUILD_CORE_BUILTIN -I$(srcdir)/Include/internal -I$(srcdir)/Modules/_io -c $(srcdir)/Modules/_io/fileio.c -o Modules/fileio.o
|
| 2096 |
+
Modules/bytesio.o: $(srcdir)/Modules/_io/bytesio.c; $(CC) $(PY_BUILTIN_MODULE_CFLAGS) -DPy_BUILD_CORE_BUILTIN -I$(srcdir)/Include/internal -I$(srcdir)/Modules/_io -c $(srcdir)/Modules/_io/bytesio.c -o Modules/bytesio.o
|
| 2097 |
+
Modules/bufferedio.o: $(srcdir)/Modules/_io/bufferedio.c; $(CC) $(PY_BUILTIN_MODULE_CFLAGS) -DPy_BUILD_CORE_BUILTIN -I$(srcdir)/Include/internal -I$(srcdir)/Modules/_io -c $(srcdir)/Modules/_io/bufferedio.c -o Modules/bufferedio.o
|
| 2098 |
+
Modules/textio.o: $(srcdir)/Modules/_io/textio.c; $(CC) $(PY_BUILTIN_MODULE_CFLAGS) -DPy_BUILD_CORE_BUILTIN -I$(srcdir)/Include/internal -I$(srcdir)/Modules/_io -c $(srcdir)/Modules/_io/textio.c -o Modules/textio.o
|
| 2099 |
+
Modules/stringio.o: $(srcdir)/Modules/_io/stringio.c; $(CC) $(PY_BUILTIN_MODULE_CFLAGS) -DPy_BUILD_CORE_BUILTIN -I$(srcdir)/Include/internal -I$(srcdir)/Modules/_io -c $(srcdir)/Modules/_io/stringio.c -o Modules/stringio.o
|
| 2100 |
+
Modules/_io$(EXT_SUFFIX): Modules/_iomodule.o Modules/iobase.o Modules/fileio.o Modules/bytesio.o Modules/bufferedio.o Modules/textio.o Modules/stringio.o; $(BLDSHARED) Modules/_iomodule.o Modules/iobase.o Modules/fileio.o Modules/bytesio.o Modules/bufferedio.o Modules/textio.o Modules/stringio.o -o Modules/_io$(EXT_SUFFIX)
|
| 2101 |
+
Modules/faulthandler.o: $(srcdir)/Modules/faulthandler.c; $(CC) $(PY_BUILTIN_MODULE_CFLAGS) -c $(srcdir)/Modules/faulthandler.c -o Modules/faulthandler.o
|
| 2102 |
+
Modules/faulthandler$(EXT_SUFFIX): Modules/faulthandler.o; $(BLDSHARED) Modules/faulthandler.o -o Modules/faulthandler$(EXT_SUFFIX)
|
| 2103 |
+
Modules/_tracemalloc.o: $(srcdir)/Modules/_tracemalloc.c; $(CC) $(PY_BUILTIN_MODULE_CFLAGS) -c $(srcdir)/Modules/_tracemalloc.c -o Modules/_tracemalloc.o
|
| 2104 |
+
Modules/_tracemalloc$(EXT_SUFFIX): Modules/_tracemalloc.o; $(BLDSHARED) Modules/_tracemalloc.o -o Modules/_tracemalloc$(EXT_SUFFIX)
|
| 2105 |
+
Modules/symtablemodule.o: $(srcdir)/Modules/symtablemodule.c; $(CC) $(PY_BUILTIN_MODULE_CFLAGS) -c $(srcdir)/Modules/symtablemodule.c -o Modules/symtablemodule.o
|
| 2106 |
+
Modules/_symtable$(EXT_SUFFIX): Modules/symtablemodule.o; $(BLDSHARED) Modules/symtablemodule.o -o Modules/_symtable$(EXT_SUFFIX)
|
| 2107 |
+
Modules/xxsubtype.o: $(srcdir)/Modules/xxsubtype.c; $(CC) $(PY_BUILTIN_MODULE_CFLAGS) -c $(srcdir)/Modules/xxsubtype.c -o Modules/xxsubtype.o
|
| 2108 |
+
Modules/xxsubtype$(EXT_SUFFIX): Modules/xxsubtype.o; $(BLDSHARED) Modules/xxsubtype.o -o Modules/xxsubtype$(EXT_SUFFIX)
|
janus/lib/python3.10/config-3.10-x86_64-linux-gnu/Setup
ADDED
|
@@ -0,0 +1,377 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# -*- makefile -*-
|
| 2 |
+
# The file Setup is used by the makesetup script to construct the files
|
| 3 |
+
# Makefile and config.c, from Makefile.pre and config.c.in,
|
| 4 |
+
# respectively. Note that Makefile.pre is created from Makefile.pre.in
|
| 5 |
+
# by the toplevel configure script.
|
| 6 |
+
|
| 7 |
+
# (VPATH notes: Setup and Makefile.pre are in the build directory, as
|
| 8 |
+
# are Makefile and config.c; the *.in files are in the source directory.)
|
| 9 |
+
|
| 10 |
+
# Each line in this file describes one or more optional modules.
|
| 11 |
+
# Modules configured here will not be compiled by the setup.py script,
|
| 12 |
+
# so the file can be used to override setup.py's behavior.
|
| 13 |
+
# Tag lines containing just the word "*static*", "*shared*" or "*disabled*"
|
| 14 |
+
# (without the quotes but with the stars) are used to tag the following module
|
| 15 |
+
# descriptions. Tag lines may alternate throughout this file. Modules are
|
| 16 |
+
# built statically when they are preceded by a "*static*" tag line or when
|
| 17 |
+
# there is no tag line between the start of the file and the module
|
| 18 |
+
# description. Modules are built as a shared library when they are preceded by
|
| 19 |
+
# a "*shared*" tag line. Modules are not built at all, not by the Makefile,
|
| 20 |
+
# nor by the setup.py script, when they are preceded by a "*disabled*" tag
|
| 21 |
+
# line.
|
| 22 |
+
|
| 23 |
+
# Lines have the following structure:
|
| 24 |
+
#
|
| 25 |
+
# <module> ... [<sourcefile> ...] [<cpparg> ...] [<library> ...]
|
| 26 |
+
#
|
| 27 |
+
# <sourcefile> is anything ending in .c (.C, .cc, .c++ are C++ files)
|
| 28 |
+
# <cpparg> is anything starting with -I, -D, -U or -C
|
| 29 |
+
# <library> is anything ending in .a or beginning with -l or -L
|
| 30 |
+
# <module> is anything else but should be a valid Python
|
| 31 |
+
# identifier (letters, digits, underscores, beginning with non-digit)
|
| 32 |
+
#
|
| 33 |
+
# (As the makesetup script changes, it may recognize some other
|
| 34 |
+
# arguments as well, e.g. *.so and *.sl as libraries. See the big
|
| 35 |
+
# case statement in the makesetup script.)
|
| 36 |
+
#
|
| 37 |
+
# Lines can also have the form
|
| 38 |
+
#
|
| 39 |
+
# <name> = <value>
|
| 40 |
+
#
|
| 41 |
+
# which defines a Make variable definition inserted into Makefile.in
|
| 42 |
+
#
|
| 43 |
+
# The build process works like this:
|
| 44 |
+
#
|
| 45 |
+
# 1. Build all modules that are declared as static in Modules/Setup,
|
| 46 |
+
# combine them into libpythonxy.a, combine that into python.
|
| 47 |
+
# 2. Build all modules that are listed as shared in Modules/Setup.
|
| 48 |
+
# 3. Invoke setup.py. That builds all modules that
|
| 49 |
+
# a) are not builtin, and
|
| 50 |
+
# b) are not listed in Modules/Setup, and
|
| 51 |
+
# c) can be build on the target
|
| 52 |
+
#
|
| 53 |
+
# Therefore, modules declared to be shared will not be
|
| 54 |
+
# included in the config.c file, nor in the list of objects to be
|
| 55 |
+
# added to the library archive, and their linker options won't be
|
| 56 |
+
# added to the linker options. Rules to create their .o files and
|
| 57 |
+
# their shared libraries will still be added to the Makefile, and
|
| 58 |
+
# their names will be collected in the Make variable SHAREDMODS. This
|
| 59 |
+
# is used to build modules as shared libraries. (They can be
|
| 60 |
+
# installed using "make sharedinstall", which is implied by the
|
| 61 |
+
# toplevel "make install" target.) (For compatibility,
|
| 62 |
+
# *noconfig* has the same effect as *shared*.)
|
| 63 |
+
#
|
| 64 |
+
# NOTE: As a standard policy, as many modules as can be supported by a
|
| 65 |
+
# platform should be present. The distribution comes with all modules
|
| 66 |
+
# enabled that are supported by most platforms and don't require you
|
| 67 |
+
# to ftp sources from elsewhere.
|
| 68 |
+
|
| 69 |
+
|
| 70 |
+
# Some special rules to define PYTHONPATH.
|
| 71 |
+
# Edit the definitions below to indicate which options you are using.
|
| 72 |
+
# Don't add any whitespace or comments!
|
| 73 |
+
|
| 74 |
+
# Directories where library files get installed.
|
| 75 |
+
# DESTLIB is for Python modules; MACHDESTLIB for shared libraries.
|
| 76 |
+
DESTLIB=$(LIBDEST)
|
| 77 |
+
MACHDESTLIB=$(BINLIBDEST)
|
| 78 |
+
|
| 79 |
+
# NOTE: all the paths are now relative to the prefix that is computed
|
| 80 |
+
# at run time!
|
| 81 |
+
|
| 82 |
+
# Standard path -- don't edit.
|
| 83 |
+
# No leading colon since this is the first entry.
|
| 84 |
+
# Empty since this is now just the runtime prefix.
|
| 85 |
+
DESTPATH=
|
| 86 |
+
|
| 87 |
+
# Site specific path components -- should begin with : if non-empty
|
| 88 |
+
SITEPATH=
|
| 89 |
+
|
| 90 |
+
# Standard path components for test modules
|
| 91 |
+
TESTPATH=
|
| 92 |
+
|
| 93 |
+
COREPYTHONPATH=$(DESTPATH)$(SITEPATH)$(TESTPATH)
|
| 94 |
+
PYTHONPATH=$(COREPYTHONPATH)
|
| 95 |
+
|
| 96 |
+
|
| 97 |
+
# The modules listed here can't be built as shared libraries for
|
| 98 |
+
# various reasons; therefore they are listed here instead of in the
|
| 99 |
+
# normal order.
|
| 100 |
+
|
| 101 |
+
# This only contains the minimal set of modules required to run the
|
| 102 |
+
# setup.py script in the root of the Python source tree.
|
| 103 |
+
|
| 104 |
+
posix -DPy_BUILD_CORE_BUILTIN -I$(srcdir)/Include/internal posixmodule.c # posix (UNIX) system calls
|
| 105 |
+
errno errnomodule.c # posix (UNIX) errno values
|
| 106 |
+
pwd pwdmodule.c # this is needed to find out the user's home dir
|
| 107 |
+
# if $HOME is not set
|
| 108 |
+
_sre -DPy_BUILD_CORE_BUILTIN _sre.c # Fredrik Lundh's new regular expressions
|
| 109 |
+
_codecs _codecsmodule.c # access to the builtin codecs and codec registry
|
| 110 |
+
_weakref _weakref.c # weak references
|
| 111 |
+
_functools -DPy_BUILD_CORE_BUILTIN -I$(srcdir)/Include/internal _functoolsmodule.c # Tools for working with functions and callable objects
|
| 112 |
+
_operator -DPy_BUILD_CORE_BUILTIN _operator.c # operator.add() and similar goodies
|
| 113 |
+
_collections _collectionsmodule.c # Container types
|
| 114 |
+
_abc -DPy_BUILD_CORE_BUILTIN _abc.c # Abstract base classes
|
| 115 |
+
itertools itertoolsmodule.c # Functions creating iterators for efficient looping
|
| 116 |
+
atexit atexitmodule.c # Register functions to be run at interpreter-shutdown
|
| 117 |
+
_signal -DPy_BUILD_CORE_BUILTIN -I$(srcdir)/Include/internal signalmodule.c
|
| 118 |
+
_stat _stat.c # stat.h interface
|
| 119 |
+
time -DPy_BUILD_CORE_BUILTIN -I$(srcdir)/Include/internal timemodule.c # -lm # time operations and variables
|
| 120 |
+
_thread -DPy_BUILD_CORE_BUILTIN -I$(srcdir)/Include/internal _threadmodule.c # low-level threading interface
|
| 121 |
+
|
| 122 |
+
# access to ISO C locale support
|
| 123 |
+
_locale -DPy_BUILD_CORE_BUILTIN _localemodule.c # -lintl
|
| 124 |
+
|
| 125 |
+
# Standard I/O baseline
|
| 126 |
+
_io -DPy_BUILD_CORE_BUILTIN -I$(srcdir)/Include/internal -I$(srcdir)/Modules/_io _io/_iomodule.c _io/iobase.c _io/fileio.c _io/bytesio.c _io/bufferedio.c _io/textio.c _io/stringio.c
|
| 127 |
+
|
| 128 |
+
# faulthandler module
|
| 129 |
+
faulthandler faulthandler.c
|
| 130 |
+
|
| 131 |
+
# debug tool to trace memory blocks allocated by Python
|
| 132 |
+
#
|
| 133 |
+
# bpo-35053: The module must be builtin since _Py_NewReference()
|
| 134 |
+
# can call _PyTraceMalloc_NewReference().
|
| 135 |
+
_tracemalloc _tracemalloc.c
|
| 136 |
+
|
| 137 |
+
# The rest of the modules listed in this file are all commented out by
|
| 138 |
+
# default. Usually they can be detected and built as dynamically
|
| 139 |
+
# loaded modules by the new setup.py script added in Python 2.1. If
|
| 140 |
+
# you're on a platform that doesn't support dynamic loading, want to
|
| 141 |
+
# compile modules statically into the Python binary, or need to
|
| 142 |
+
# specify some odd set of compiler switches, you can uncomment the
|
| 143 |
+
# appropriate lines below.
|
| 144 |
+
|
| 145 |
+
# ======================================================================
|
| 146 |
+
|
| 147 |
+
# The Python symtable module depends on .h files that setup.py doesn't track
|
| 148 |
+
_symtable symtablemodule.c
|
| 149 |
+
|
| 150 |
+
# Uncommenting the following line tells makesetup that all following
|
| 151 |
+
# modules are to be built as shared libraries (see above for more
|
| 152 |
+
# detail; also note that *static* or *disabled* cancels this effect):
|
| 153 |
+
|
| 154 |
+
#*shared*
|
| 155 |
+
|
| 156 |
+
# GNU readline. Unlike previous Python incarnations, GNU readline is
|
| 157 |
+
# now incorporated in an optional module, configured in the Setup file
|
| 158 |
+
# instead of by a configure script switch. You may have to insert a
|
| 159 |
+
# -L option pointing to the directory where libreadline.* lives,
|
| 160 |
+
# and you may have to change -ltermcap to -ltermlib or perhaps remove
|
| 161 |
+
# it, depending on your system -- see the GNU readline instructions.
|
| 162 |
+
# It's okay for this to be a shared library, too.
|
| 163 |
+
|
| 164 |
+
#readline readline.c -lreadline -ltermcap
|
| 165 |
+
|
| 166 |
+
|
| 167 |
+
# Modules that should always be present (non UNIX dependent):
|
| 168 |
+
|
| 169 |
+
#array -DPy_BUILD_CORE_MODULE arraymodule.c # array objects
|
| 170 |
+
#cmath cmathmodule.c _math.c -DPy_BUILD_CORE_MODULE # -lm # complex math library functions
|
| 171 |
+
#math mathmodule.c _math.c -DPy_BUILD_CORE_MODULE # -lm # math library functions, e.g. sin()
|
| 172 |
+
#_contextvars _contextvarsmodule.c # Context Variables
|
| 173 |
+
#_struct -DPy_BUILD_CORE_MODULE _struct.c # binary structure packing/unpacking
|
| 174 |
+
#_weakref _weakref.c # basic weak reference support
|
| 175 |
+
#_testcapi _testcapimodule.c # Python C API test module
|
| 176 |
+
#_testinternalcapi _testinternalcapi.c -I$(srcdir)/Include/internal -DPy_BUILD_CORE_MODULE # Python internal C API test module
|
| 177 |
+
#_random _randommodule.c -DPy_BUILD_CORE_MODULE # Random number generator
|
| 178 |
+
#_elementtree -I$(srcdir)/Modules/expat -DHAVE_EXPAT_CONFIG_H -DUSE_PYEXPAT_CAPI _elementtree.c # elementtree accelerator
|
| 179 |
+
#_pickle -DPy_BUILD_CORE_MODULE _pickle.c # pickle accelerator
|
| 180 |
+
#_datetime _datetimemodule.c # datetime accelerator
|
| 181 |
+
#_zoneinfo _zoneinfo.c -DPy_BUILD_CORE_MODULE # zoneinfo accelerator
|
| 182 |
+
#_bisect _bisectmodule.c # Bisection algorithms
|
| 183 |
+
#_heapq _heapqmodule.c -DPy_BUILD_CORE_MODULE # Heap queue algorithm
|
| 184 |
+
#_asyncio _asynciomodule.c # Fast asyncio Future
|
| 185 |
+
#_json -I$(srcdir)/Include/internal -DPy_BUILD_CORE_BUILTIN _json.c # _json speedups
|
| 186 |
+
#_statistics _statisticsmodule.c # statistics accelerator
|
| 187 |
+
|
| 188 |
+
#unicodedata unicodedata.c -DPy_BUILD_CORE_BUILTIN # static Unicode character database
|
| 189 |
+
|
| 190 |
+
|
| 191 |
+
# Modules with some UNIX dependencies -- on by default:
|
| 192 |
+
# (If you have a really backward UNIX, select and socket may not be
|
| 193 |
+
# supported...)
|
| 194 |
+
|
| 195 |
+
#fcntl fcntlmodule.c # fcntl(2) and ioctl(2)
|
| 196 |
+
#spwd spwdmodule.c # spwd(3)
|
| 197 |
+
#grp grpmodule.c # grp(3)
|
| 198 |
+
#select selectmodule.c # select(2); not on ancient System V
|
| 199 |
+
|
| 200 |
+
# Memory-mapped files (also works on Win32).
|
| 201 |
+
#mmap mmapmodule.c
|
| 202 |
+
|
| 203 |
+
# CSV file helper
|
| 204 |
+
#_csv _csv.c
|
| 205 |
+
|
| 206 |
+
# Socket module helper for socket(2)
|
| 207 |
+
#_socket socketmodule.c
|
| 208 |
+
|
| 209 |
+
# Socket module helper for SSL support; you must comment out the other
|
| 210 |
+
# socket line above, and edit the OPENSSL variable:
|
| 211 |
+
# OPENSSL=/path/to/openssl/directory
|
| 212 |
+
# _ssl _ssl.c \
|
| 213 |
+
# -I$(OPENSSL)/include -L$(OPENSSL)/lib \
|
| 214 |
+
# -lssl -lcrypto
|
| 215 |
+
#_hashlib _hashopenssl.c \
|
| 216 |
+
# -I$(OPENSSL)/include -L$(OPENSSL)/lib \
|
| 217 |
+
# -lcrypto
|
| 218 |
+
|
| 219 |
+
# To statically link OpenSSL:
|
| 220 |
+
# _ssl _ssl.c \
|
| 221 |
+
# -I$(OPENSSL)/include -L$(OPENSSL)/lib \
|
| 222 |
+
# -l:libssl.a -Wl,--exclude-libs,libssl.a \
|
| 223 |
+
# -l:libcrypto.a -Wl,--exclude-libs,libcrypto.a
|
| 224 |
+
#_hashlib _hashopenssl.c \
|
| 225 |
+
# -I$(OPENSSL)/include -L$(OPENSSL)/lib \
|
| 226 |
+
# -l:libcrypto.a -Wl,--exclude-libs,libcrypto.a
|
| 227 |
+
|
| 228 |
+
# The crypt module is now disabled by default because it breaks builds
|
| 229 |
+
# on many systems (where -lcrypt is needed), e.g. Linux (I believe).
|
| 230 |
+
|
| 231 |
+
#_crypt _cryptmodule.c # -lcrypt # crypt(3); needs -lcrypt on some systems
|
| 232 |
+
|
| 233 |
+
|
| 234 |
+
# Some more UNIX dependent modules -- off by default, since these
|
| 235 |
+
# are not supported by all UNIX systems:
|
| 236 |
+
|
| 237 |
+
#nis nismodule.c -lnsl # Sun yellow pages -- not everywhere
|
| 238 |
+
#termios termios.c # Steen Lumholt's termios module
|
| 239 |
+
#resource resource.c # Jeremy Hylton's rlimit interface
|
| 240 |
+
|
| 241 |
+
#_posixsubprocess -DPy_BUILD_CORE_BUILTIN _posixsubprocess.c # POSIX subprocess module helper
|
| 242 |
+
|
| 243 |
+
# Multimedia modules -- off by default.
|
| 244 |
+
# These don't work for 64-bit platforms!!!
|
| 245 |
+
# #993173 says audioop works on 64-bit platforms, though.
|
| 246 |
+
# These represent audio samples or images as strings:
|
| 247 |
+
|
| 248 |
+
#audioop audioop.c # Operations on audio samples
|
| 249 |
+
|
| 250 |
+
|
| 251 |
+
# Note that the _md5 and _sha modules are normally only built if the
|
| 252 |
+
# system does not have the OpenSSL libs containing an optimized version.
|
| 253 |
+
|
| 254 |
+
# The _md5 module implements the RSA Data Security, Inc. MD5
|
| 255 |
+
# Message-Digest Algorithm, described in RFC 1321.
|
| 256 |
+
|
| 257 |
+
#_md5 md5module.c
|
| 258 |
+
|
| 259 |
+
|
| 260 |
+
# The _sha module implements the SHA checksum algorithms.
|
| 261 |
+
# (NIST's Secure Hash Algorithms.)
|
| 262 |
+
#_sha1 sha1module.c
|
| 263 |
+
#_sha256 sha256module.c -DPy_BUILD_CORE_BUILTIN
|
| 264 |
+
#_sha512 sha512module.c -DPy_BUILD_CORE_BUILTIN
|
| 265 |
+
#_sha3 _sha3/sha3module.c
|
| 266 |
+
|
| 267 |
+
# _blake module
|
| 268 |
+
#_blake2 _blake2/blake2module.c _blake2/blake2b_impl.c _blake2/blake2s_impl.c
|
| 269 |
+
|
| 270 |
+
# The _tkinter module.
|
| 271 |
+
#
|
| 272 |
+
# The command for _tkinter is long and site specific. Please
|
| 273 |
+
# uncomment and/or edit those parts as indicated. If you don't have a
|
| 274 |
+
# specific extension (e.g. Tix or BLT), leave the corresponding line
|
| 275 |
+
# commented out. (Leave the trailing backslashes in! If you
|
| 276 |
+
# experience strange errors, you may want to join all uncommented
|
| 277 |
+
# lines and remove the backslashes -- the backslash interpretation is
|
| 278 |
+
# done by the shell's "read" command and it may not be implemented on
|
| 279 |
+
# every system.
|
| 280 |
+
|
| 281 |
+
# *** Always uncomment this (leave the leading underscore in!):
|
| 282 |
+
# _tkinter _tkinter.c tkappinit.c -DWITH_APPINIT \
|
| 283 |
+
# *** Uncomment and edit to reflect where your Tcl/Tk libraries are:
|
| 284 |
+
# -L/usr/local/lib \
|
| 285 |
+
# *** Uncomment and edit to reflect where your Tcl/Tk headers are:
|
| 286 |
+
# -I/usr/local/include \
|
| 287 |
+
# *** Uncomment and edit to reflect where your X11 header files are:
|
| 288 |
+
# -I/usr/X11R6/include \
|
| 289 |
+
# *** Or uncomment this for Solaris:
|
| 290 |
+
# -I/usr/openwin/include \
|
| 291 |
+
# *** Uncomment and edit for Tix extension only:
|
| 292 |
+
# -DWITH_TIX -ltix8.1.8.2 \
|
| 293 |
+
# *** Uncomment and edit for BLT extension only:
|
| 294 |
+
# -DWITH_BLT -I/usr/local/blt/blt8.0-unoff/include -lBLT8.0 \
|
| 295 |
+
# *** Uncomment and edit for PIL (TkImaging) extension only:
|
| 296 |
+
# (See http://www.pythonware.com/products/pil/ for more info)
|
| 297 |
+
# -DWITH_PIL -I../Extensions/Imaging/libImaging tkImaging.c \
|
| 298 |
+
# *** Uncomment and edit for TOGL extension only:
|
| 299 |
+
# -DWITH_TOGL togl.c \
|
| 300 |
+
# *** Uncomment and edit to reflect your Tcl/Tk versions:
|
| 301 |
+
# -ltk8.2 -ltcl8.2 \
|
| 302 |
+
# *** Uncomment and edit to reflect where your X11 libraries are:
|
| 303 |
+
# -L/usr/X11R6/lib \
|
| 304 |
+
# *** Or uncomment this for Solaris:
|
| 305 |
+
# -L/usr/openwin/lib \
|
| 306 |
+
# *** Uncomment these for TOGL extension only:
|
| 307 |
+
# -lGL -lGLU -lXext -lXmu \
|
| 308 |
+
# *** Uncomment for AIX:
|
| 309 |
+
# -lld \
|
| 310 |
+
# *** Always uncomment this; X11 libraries to link with:
|
| 311 |
+
# -lX11
|
| 312 |
+
|
| 313 |
+
# Lance Ellinghaus's syslog module
|
| 314 |
+
#syslog syslogmodule.c # syslog daemon interface
|
| 315 |
+
|
| 316 |
+
|
| 317 |
+
# Curses support, requiring the System V version of curses, often
|
| 318 |
+
# provided by the ncurses library. e.g. on Linux, link with -lncurses
|
| 319 |
+
# instead of -lcurses).
|
| 320 |
+
|
| 321 |
+
#_curses _cursesmodule.c -lcurses -ltermcap -DPy_BUILD_CORE_MODULE
|
| 322 |
+
# Wrapper for the panel library that's part of ncurses and SYSV curses.
|
| 323 |
+
#_curses_panel _curses_panel.c -lpanel -lncurses
|
| 324 |
+
|
| 325 |
+
|
| 326 |
+
# Modules that provide persistent dictionary-like semantics. You will
|
| 327 |
+
# probably want to arrange for at least one of them to be available on
|
| 328 |
+
# your machine, though none are defined by default because of library
|
| 329 |
+
# dependencies. The Python module dbm/__init__.py provides an
|
| 330 |
+
# implementation independent wrapper for these; dbm/dumb.py provides
|
| 331 |
+
# similar functionality (but slower of course) implemented in Python.
|
| 332 |
+
|
| 333 |
+
#_dbm _dbmmodule.c # dbm(3) may require -lndbm or similar
|
| 334 |
+
|
| 335 |
+
# Anthony Baxter's gdbm module. GNU dbm(3) will require -lgdbm:
|
| 336 |
+
|
| 337 |
+
#_gdbm _gdbmmodule.c -I/usr/local/include -L/usr/local/lib -lgdbm
|
| 338 |
+
|
| 339 |
+
|
| 340 |
+
# Helper module for various ascii-encoders
|
| 341 |
+
#binascii binascii.c
|
| 342 |
+
|
| 343 |
+
# Andrew Kuchling's zlib module.
|
| 344 |
+
# This require zlib 1.1.3 (or later).
|
| 345 |
+
# See http://www.gzip.org/zlib/
|
| 346 |
+
#zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib -lz
|
| 347 |
+
|
| 348 |
+
# Interface to the Expat XML parser
|
| 349 |
+
# More information on Expat can be found at www.libexpat.org.
|
| 350 |
+
#
|
| 351 |
+
#pyexpat expat/xmlparse.c expat/xmlrole.c expat/xmltok.c pyexpat.c -I$(srcdir)/Modules/expat -DHAVE_EXPAT_CONFIG_H -DXML_POOR_ENTROPY -DUSE_PYEXPAT_CAPI
|
| 352 |
+
|
| 353 |
+
# Hye-Shik Chang's CJKCodecs
|
| 354 |
+
|
| 355 |
+
# multibytecodec is required for all the other CJK codec modules
|
| 356 |
+
#_multibytecodec cjkcodecs/multibytecodec.c
|
| 357 |
+
|
| 358 |
+
#_codecs_cn cjkcodecs/_codecs_cn.c
|
| 359 |
+
#_codecs_hk cjkcodecs/_codecs_hk.c
|
| 360 |
+
#_codecs_iso2022 cjkcodecs/_codecs_iso2022.c
|
| 361 |
+
#_codecs_jp cjkcodecs/_codecs_jp.c
|
| 362 |
+
#_codecs_kr cjkcodecs/_codecs_kr.c
|
| 363 |
+
#_codecs_tw cjkcodecs/_codecs_tw.c
|
| 364 |
+
|
| 365 |
+
# Example -- included for reference only:
|
| 366 |
+
# xx xxmodule.c
|
| 367 |
+
|
| 368 |
+
# Another example -- the 'xxsubtype' module shows C-level subtyping in action
|
| 369 |
+
xxsubtype xxsubtype.c
|
| 370 |
+
|
| 371 |
+
# Uncommenting the following line tells makesetup that all following modules
|
| 372 |
+
# are not built (see above for more detail).
|
| 373 |
+
#
|
| 374 |
+
#*disabled*
|
| 375 |
+
#
|
| 376 |
+
#_sqlite3 _tkinter _curses pyexpat
|
| 377 |
+
#_codecs_jp _codecs_kr _codecs_tw unicodedata
|
janus/lib/python3.10/config-3.10-x86_64-linux-gnu/Setup.local
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
# Edit this file for local setup changes
|
janus/lib/python3.10/config-3.10-x86_64-linux-gnu/__pycache__/python-config.cpython-310.pyc
ADDED
|
Binary file (2.14 kB). View file
|
|
|
janus/lib/python3.10/config-3.10-x86_64-linux-gnu/config.c
ADDED
|
@@ -0,0 +1,114 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/* Generated automatically from /croot/python-split_1733933809325/work/Modules/config.c.in by makesetup. */
|
| 2 |
+
/* -*- C -*- ***********************************************
|
| 3 |
+
Copyright (c) 2000, BeOpen.com.
|
| 4 |
+
Copyright (c) 1995-2000, Corporation for National Research Initiatives.
|
| 5 |
+
Copyright (c) 1990-1995, Stichting Mathematisch Centrum.
|
| 6 |
+
All rights reserved.
|
| 7 |
+
|
| 8 |
+
See the file "Misc/COPYRIGHT" for information on usage and
|
| 9 |
+
redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
| 10 |
+
******************************************************************/
|
| 11 |
+
|
| 12 |
+
/* Module configuration */
|
| 13 |
+
|
| 14 |
+
/* !!! !!! !!! This file is edited by the makesetup script !!! !!! !!! */
|
| 15 |
+
|
| 16 |
+
/* This file contains the table of built-in modules.
|
| 17 |
+
See create_builtin() in import.c. */
|
| 18 |
+
|
| 19 |
+
#include "Python.h"
|
| 20 |
+
|
| 21 |
+
#ifdef __cplusplus
|
| 22 |
+
extern "C" {
|
| 23 |
+
#endif
|
| 24 |
+
|
| 25 |
+
|
| 26 |
+
extern PyObject* PyInit_posix(void);
|
| 27 |
+
extern PyObject* PyInit_errno(void);
|
| 28 |
+
extern PyObject* PyInit_pwd(void);
|
| 29 |
+
extern PyObject* PyInit__sre(void);
|
| 30 |
+
extern PyObject* PyInit__codecs(void);
|
| 31 |
+
extern PyObject* PyInit__weakref(void);
|
| 32 |
+
extern PyObject* PyInit__functools(void);
|
| 33 |
+
extern PyObject* PyInit__operator(void);
|
| 34 |
+
extern PyObject* PyInit__collections(void);
|
| 35 |
+
extern PyObject* PyInit__abc(void);
|
| 36 |
+
extern PyObject* PyInit_itertools(void);
|
| 37 |
+
extern PyObject* PyInit_atexit(void);
|
| 38 |
+
extern PyObject* PyInit__signal(void);
|
| 39 |
+
extern PyObject* PyInit__stat(void);
|
| 40 |
+
extern PyObject* PyInit_time(void);
|
| 41 |
+
extern PyObject* PyInit__thread(void);
|
| 42 |
+
extern PyObject* PyInit__locale(void);
|
| 43 |
+
extern PyObject* PyInit__io(void);
|
| 44 |
+
extern PyObject* PyInit_faulthandler(void);
|
| 45 |
+
extern PyObject* PyInit__tracemalloc(void);
|
| 46 |
+
extern PyObject* PyInit__symtable(void);
|
| 47 |
+
extern PyObject* PyInit_xxsubtype(void);
|
| 48 |
+
|
| 49 |
+
/* -- ADDMODULE MARKER 1 -- */
|
| 50 |
+
|
| 51 |
+
extern PyObject* PyMarshal_Init(void);
|
| 52 |
+
extern PyObject* PyInit__imp(void);
|
| 53 |
+
extern PyObject* PyInit_gc(void);
|
| 54 |
+
extern PyObject* PyInit__ast(void);
|
| 55 |
+
extern PyObject* _PyWarnings_Init(void);
|
| 56 |
+
extern PyObject* PyInit__string(void);
|
| 57 |
+
|
| 58 |
+
struct _inittab _PyImport_Inittab[] = {
|
| 59 |
+
|
| 60 |
+
{"posix", PyInit_posix},
|
| 61 |
+
{"errno", PyInit_errno},
|
| 62 |
+
{"pwd", PyInit_pwd},
|
| 63 |
+
{"_sre", PyInit__sre},
|
| 64 |
+
{"_codecs", PyInit__codecs},
|
| 65 |
+
{"_weakref", PyInit__weakref},
|
| 66 |
+
{"_functools", PyInit__functools},
|
| 67 |
+
{"_operator", PyInit__operator},
|
| 68 |
+
{"_collections", PyInit__collections},
|
| 69 |
+
{"_abc", PyInit__abc},
|
| 70 |
+
{"itertools", PyInit_itertools},
|
| 71 |
+
{"atexit", PyInit_atexit},
|
| 72 |
+
{"_signal", PyInit__signal},
|
| 73 |
+
{"_stat", PyInit__stat},
|
| 74 |
+
{"time", PyInit_time},
|
| 75 |
+
{"_thread", PyInit__thread},
|
| 76 |
+
{"_locale", PyInit__locale},
|
| 77 |
+
{"_io", PyInit__io},
|
| 78 |
+
{"faulthandler", PyInit_faulthandler},
|
| 79 |
+
{"_tracemalloc", PyInit__tracemalloc},
|
| 80 |
+
{"_symtable", PyInit__symtable},
|
| 81 |
+
{"xxsubtype", PyInit_xxsubtype},
|
| 82 |
+
|
| 83 |
+
/* -- ADDMODULE MARKER 2 -- */
|
| 84 |
+
|
| 85 |
+
/* This module lives in marshal.c */
|
| 86 |
+
{"marshal", PyMarshal_Init},
|
| 87 |
+
|
| 88 |
+
/* This lives in import.c */
|
| 89 |
+
{"_imp", PyInit__imp},
|
| 90 |
+
|
| 91 |
+
/* This lives in Python/Python-ast.c */
|
| 92 |
+
{"_ast", PyInit__ast},
|
| 93 |
+
|
| 94 |
+
/* These entries are here for sys.builtin_module_names */
|
| 95 |
+
{"builtins", NULL},
|
| 96 |
+
{"sys", NULL},
|
| 97 |
+
|
| 98 |
+
/* This lives in gcmodule.c */
|
| 99 |
+
{"gc", PyInit_gc},
|
| 100 |
+
|
| 101 |
+
/* This lives in _warnings.c */
|
| 102 |
+
{"_warnings", _PyWarnings_Init},
|
| 103 |
+
|
| 104 |
+
/* This lives in Objects/unicodeobject.c */
|
| 105 |
+
{"_string", PyInit__string},
|
| 106 |
+
|
| 107 |
+
/* Sentinel */
|
| 108 |
+
{0, 0}
|
| 109 |
+
};
|
| 110 |
+
|
| 111 |
+
|
| 112 |
+
#ifdef __cplusplus
|
| 113 |
+
}
|
| 114 |
+
#endif
|
janus/lib/python3.10/config-3.10-x86_64-linux-gnu/install-sh
ADDED
|
@@ -0,0 +1,518 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/sh
|
| 2 |
+
# install - install a program, script, or datafile
|
| 3 |
+
|
| 4 |
+
scriptversion=2018-03-11.20; # UTC
|
| 5 |
+
|
| 6 |
+
# This originates from X11R5 (mit/util/scripts/install.sh), which was
|
| 7 |
+
# later released in X11R6 (xc/config/util/install.sh) with the
|
| 8 |
+
# following copyright and license.
|
| 9 |
+
#
|
| 10 |
+
# Copyright (C) 1994 X Consortium
|
| 11 |
+
#
|
| 12 |
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
| 13 |
+
# of this software and associated documentation files (the "Software"), to
|
| 14 |
+
# deal in the Software without restriction, including without limitation the
|
| 15 |
+
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
| 16 |
+
# sell copies of the Software, and to permit persons to whom the Software is
|
| 17 |
+
# furnished to do so, subject to the following conditions:
|
| 18 |
+
#
|
| 19 |
+
# The above copyright notice and this permission notice shall be included in
|
| 20 |
+
# all copies or substantial portions of the Software.
|
| 21 |
+
#
|
| 22 |
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
| 23 |
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
| 24 |
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
| 25 |
+
# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
| 26 |
+
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
|
| 27 |
+
# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
| 28 |
+
#
|
| 29 |
+
# Except as contained in this notice, the name of the X Consortium shall not
|
| 30 |
+
# be used in advertising or otherwise to promote the sale, use or other deal-
|
| 31 |
+
# ings in this Software without prior written authorization from the X Consor-
|
| 32 |
+
# tium.
|
| 33 |
+
#
|
| 34 |
+
#
|
| 35 |
+
# FSF changes to this file are in the public domain.
|
| 36 |
+
#
|
| 37 |
+
# Calling this script install-sh is preferred over install.sh, to prevent
|
| 38 |
+
# 'make' implicit rules from creating a file called install from it
|
| 39 |
+
# when there is no Makefile.
|
| 40 |
+
#
|
| 41 |
+
# This script is compatible with the BSD install script, but was written
|
| 42 |
+
# from scratch.
|
| 43 |
+
|
| 44 |
+
tab=' '
|
| 45 |
+
nl='
|
| 46 |
+
'
|
| 47 |
+
IFS=" $tab$nl"
|
| 48 |
+
|
| 49 |
+
# Set DOITPROG to "echo" to test this script.
|
| 50 |
+
|
| 51 |
+
doit=${DOITPROG-}
|
| 52 |
+
doit_exec=${doit:-exec}
|
| 53 |
+
|
| 54 |
+
# Put in absolute file names if you don't have them in your path;
|
| 55 |
+
# or use environment vars.
|
| 56 |
+
|
| 57 |
+
chgrpprog=${CHGRPPROG-chgrp}
|
| 58 |
+
chmodprog=${CHMODPROG-chmod}
|
| 59 |
+
chownprog=${CHOWNPROG-chown}
|
| 60 |
+
cmpprog=${CMPPROG-cmp}
|
| 61 |
+
cpprog=${CPPROG-cp}
|
| 62 |
+
mkdirprog=${MKDIRPROG-mkdir}
|
| 63 |
+
mvprog=${MVPROG-mv}
|
| 64 |
+
rmprog=${RMPROG-rm}
|
| 65 |
+
stripprog=${STRIPPROG-strip}
|
| 66 |
+
|
| 67 |
+
posix_mkdir=
|
| 68 |
+
|
| 69 |
+
# Desired mode of installed file.
|
| 70 |
+
mode=0755
|
| 71 |
+
|
| 72 |
+
chgrpcmd=
|
| 73 |
+
chmodcmd=$chmodprog
|
| 74 |
+
chowncmd=
|
| 75 |
+
mvcmd=$mvprog
|
| 76 |
+
rmcmd="$rmprog -f"
|
| 77 |
+
stripcmd=
|
| 78 |
+
|
| 79 |
+
src=
|
| 80 |
+
dst=
|
| 81 |
+
dir_arg=
|
| 82 |
+
dst_arg=
|
| 83 |
+
|
| 84 |
+
copy_on_change=false
|
| 85 |
+
is_target_a_directory=possibly
|
| 86 |
+
|
| 87 |
+
usage="\
|
| 88 |
+
Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
|
| 89 |
+
or: $0 [OPTION]... SRCFILES... DIRECTORY
|
| 90 |
+
or: $0 [OPTION]... -t DIRECTORY SRCFILES...
|
| 91 |
+
or: $0 [OPTION]... -d DIRECTORIES...
|
| 92 |
+
|
| 93 |
+
In the 1st form, copy SRCFILE to DSTFILE.
|
| 94 |
+
In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
|
| 95 |
+
In the 4th, create DIRECTORIES.
|
| 96 |
+
|
| 97 |
+
Options:
|
| 98 |
+
--help display this help and exit.
|
| 99 |
+
--version display version info and exit.
|
| 100 |
+
|
| 101 |
+
-c (ignored)
|
| 102 |
+
-C install only if different (preserve the last data modification time)
|
| 103 |
+
-d create directories instead of installing files.
|
| 104 |
+
-g GROUP $chgrpprog installed files to GROUP.
|
| 105 |
+
-m MODE $chmodprog installed files to MODE.
|
| 106 |
+
-o USER $chownprog installed files to USER.
|
| 107 |
+
-s $stripprog installed files.
|
| 108 |
+
-t DIRECTORY install into DIRECTORY.
|
| 109 |
+
-T report an error if DSTFILE is a directory.
|
| 110 |
+
|
| 111 |
+
Environment variables override the default commands:
|
| 112 |
+
CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
|
| 113 |
+
RMPROG STRIPPROG
|
| 114 |
+
"
|
| 115 |
+
|
| 116 |
+
while test $# -ne 0; do
|
| 117 |
+
case $1 in
|
| 118 |
+
-c) ;;
|
| 119 |
+
|
| 120 |
+
-C) copy_on_change=true;;
|
| 121 |
+
|
| 122 |
+
-d) dir_arg=true;;
|
| 123 |
+
|
| 124 |
+
-g) chgrpcmd="$chgrpprog $2"
|
| 125 |
+
shift;;
|
| 126 |
+
|
| 127 |
+
--help) echo "$usage"; exit $?;;
|
| 128 |
+
|
| 129 |
+
-m) mode=$2
|
| 130 |
+
case $mode in
|
| 131 |
+
*' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*)
|
| 132 |
+
echo "$0: invalid mode: $mode" >&2
|
| 133 |
+
exit 1;;
|
| 134 |
+
esac
|
| 135 |
+
shift;;
|
| 136 |
+
|
| 137 |
+
-o) chowncmd="$chownprog $2"
|
| 138 |
+
shift;;
|
| 139 |
+
|
| 140 |
+
-s) stripcmd=$stripprog;;
|
| 141 |
+
|
| 142 |
+
-t)
|
| 143 |
+
is_target_a_directory=always
|
| 144 |
+
dst_arg=$2
|
| 145 |
+
# Protect names problematic for 'test' and other utilities.
|
| 146 |
+
case $dst_arg in
|
| 147 |
+
-* | [=\(\)!]) dst_arg=./$dst_arg;;
|
| 148 |
+
esac
|
| 149 |
+
shift;;
|
| 150 |
+
|
| 151 |
+
-T) is_target_a_directory=never;;
|
| 152 |
+
|
| 153 |
+
--version) echo "$0 $scriptversion"; exit $?;;
|
| 154 |
+
|
| 155 |
+
--) shift
|
| 156 |
+
break;;
|
| 157 |
+
|
| 158 |
+
-*) echo "$0: invalid option: $1" >&2
|
| 159 |
+
exit 1;;
|
| 160 |
+
|
| 161 |
+
*) break;;
|
| 162 |
+
esac
|
| 163 |
+
shift
|
| 164 |
+
done
|
| 165 |
+
|
| 166 |
+
# We allow the use of options -d and -T together, by making -d
|
| 167 |
+
# take the precedence; this is for compatibility with GNU install.
|
| 168 |
+
|
| 169 |
+
if test -n "$dir_arg"; then
|
| 170 |
+
if test -n "$dst_arg"; then
|
| 171 |
+
echo "$0: target directory not allowed when installing a directory." >&2
|
| 172 |
+
exit 1
|
| 173 |
+
fi
|
| 174 |
+
fi
|
| 175 |
+
|
| 176 |
+
if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
|
| 177 |
+
# When -d is used, all remaining arguments are directories to create.
|
| 178 |
+
# When -t is used, the destination is already specified.
|
| 179 |
+
# Otherwise, the last argument is the destination. Remove it from $@.
|
| 180 |
+
for arg
|
| 181 |
+
do
|
| 182 |
+
if test -n "$dst_arg"; then
|
| 183 |
+
# $@ is not empty: it contains at least $arg.
|
| 184 |
+
set fnord "$@" "$dst_arg"
|
| 185 |
+
shift # fnord
|
| 186 |
+
fi
|
| 187 |
+
shift # arg
|
| 188 |
+
dst_arg=$arg
|
| 189 |
+
# Protect names problematic for 'test' and other utilities.
|
| 190 |
+
case $dst_arg in
|
| 191 |
+
-* | [=\(\)!]) dst_arg=./$dst_arg;;
|
| 192 |
+
esac
|
| 193 |
+
done
|
| 194 |
+
fi
|
| 195 |
+
|
| 196 |
+
if test $# -eq 0; then
|
| 197 |
+
if test -z "$dir_arg"; then
|
| 198 |
+
echo "$0: no input file specified." >&2
|
| 199 |
+
exit 1
|
| 200 |
+
fi
|
| 201 |
+
# It's OK to call 'install-sh -d' without argument.
|
| 202 |
+
# This can happen when creating conditional directories.
|
| 203 |
+
exit 0
|
| 204 |
+
fi
|
| 205 |
+
|
| 206 |
+
if test -z "$dir_arg"; then
|
| 207 |
+
if test $# -gt 1 || test "$is_target_a_directory" = always; then
|
| 208 |
+
if test ! -d "$dst_arg"; then
|
| 209 |
+
echo "$0: $dst_arg: Is not a directory." >&2
|
| 210 |
+
exit 1
|
| 211 |
+
fi
|
| 212 |
+
fi
|
| 213 |
+
fi
|
| 214 |
+
|
| 215 |
+
if test -z "$dir_arg"; then
|
| 216 |
+
do_exit='(exit $ret); exit $ret'
|
| 217 |
+
trap "ret=129; $do_exit" 1
|
| 218 |
+
trap "ret=130; $do_exit" 2
|
| 219 |
+
trap "ret=141; $do_exit" 13
|
| 220 |
+
trap "ret=143; $do_exit" 15
|
| 221 |
+
|
| 222 |
+
# Set umask so as not to create temps with too-generous modes.
|
| 223 |
+
# However, 'strip' requires both read and write access to temps.
|
| 224 |
+
case $mode in
|
| 225 |
+
# Optimize common cases.
|
| 226 |
+
*644) cp_umask=133;;
|
| 227 |
+
*755) cp_umask=22;;
|
| 228 |
+
|
| 229 |
+
*[0-7])
|
| 230 |
+
if test -z "$stripcmd"; then
|
| 231 |
+
u_plus_rw=
|
| 232 |
+
else
|
| 233 |
+
u_plus_rw='% 200'
|
| 234 |
+
fi
|
| 235 |
+
cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
|
| 236 |
+
*)
|
| 237 |
+
if test -z "$stripcmd"; then
|
| 238 |
+
u_plus_rw=
|
| 239 |
+
else
|
| 240 |
+
u_plus_rw=,u+rw
|
| 241 |
+
fi
|
| 242 |
+
cp_umask=$mode$u_plus_rw;;
|
| 243 |
+
esac
|
| 244 |
+
fi
|
| 245 |
+
|
| 246 |
+
for src
|
| 247 |
+
do
|
| 248 |
+
# Protect names problematic for 'test' and other utilities.
|
| 249 |
+
case $src in
|
| 250 |
+
-* | [=\(\)!]) src=./$src;;
|
| 251 |
+
esac
|
| 252 |
+
|
| 253 |
+
if test -n "$dir_arg"; then
|
| 254 |
+
dst=$src
|
| 255 |
+
dstdir=$dst
|
| 256 |
+
test -d "$dstdir"
|
| 257 |
+
dstdir_status=$?
|
| 258 |
+
else
|
| 259 |
+
|
| 260 |
+
# Waiting for this to be detected by the "$cpprog $src $dsttmp" command
|
| 261 |
+
# might cause directories to be created, which would be especially bad
|
| 262 |
+
# if $src (and thus $dsttmp) contains '*'.
|
| 263 |
+
if test ! -f "$src" && test ! -d "$src"; then
|
| 264 |
+
echo "$0: $src does not exist." >&2
|
| 265 |
+
exit 1
|
| 266 |
+
fi
|
| 267 |
+
|
| 268 |
+
if test -z "$dst_arg"; then
|
| 269 |
+
echo "$0: no destination specified." >&2
|
| 270 |
+
exit 1
|
| 271 |
+
fi
|
| 272 |
+
dst=$dst_arg
|
| 273 |
+
|
| 274 |
+
# If destination is a directory, append the input filename.
|
| 275 |
+
if test -d "$dst"; then
|
| 276 |
+
if test "$is_target_a_directory" = never; then
|
| 277 |
+
echo "$0: $dst_arg: Is a directory" >&2
|
| 278 |
+
exit 1
|
| 279 |
+
fi
|
| 280 |
+
dstdir=$dst
|
| 281 |
+
dstbase=`basename "$src"`
|
| 282 |
+
case $dst in
|
| 283 |
+
*/) dst=$dst$dstbase;;
|
| 284 |
+
*) dst=$dst/$dstbase;;
|
| 285 |
+
esac
|
| 286 |
+
dstdir_status=0
|
| 287 |
+
else
|
| 288 |
+
dstdir=`dirname "$dst"`
|
| 289 |
+
test -d "$dstdir"
|
| 290 |
+
dstdir_status=$?
|
| 291 |
+
fi
|
| 292 |
+
fi
|
| 293 |
+
|
| 294 |
+
case $dstdir in
|
| 295 |
+
*/) dstdirslash=$dstdir;;
|
| 296 |
+
*) dstdirslash=$dstdir/;;
|
| 297 |
+
esac
|
| 298 |
+
|
| 299 |
+
obsolete_mkdir_used=false
|
| 300 |
+
|
| 301 |
+
if test $dstdir_status != 0; then
|
| 302 |
+
case $posix_mkdir in
|
| 303 |
+
'')
|
| 304 |
+
# Create intermediate dirs using mode 755 as modified by the umask.
|
| 305 |
+
# This is like FreeBSD 'install' as of 1997-10-28.
|
| 306 |
+
umask=`umask`
|
| 307 |
+
case $stripcmd.$umask in
|
| 308 |
+
# Optimize common cases.
|
| 309 |
+
*[2367][2367]) mkdir_umask=$umask;;
|
| 310 |
+
.*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
|
| 311 |
+
|
| 312 |
+
*[0-7])
|
| 313 |
+
mkdir_umask=`expr $umask + 22 \
|
| 314 |
+
- $umask % 100 % 40 + $umask % 20 \
|
| 315 |
+
- $umask % 10 % 4 + $umask % 2
|
| 316 |
+
`;;
|
| 317 |
+
*) mkdir_umask=$umask,go-w;;
|
| 318 |
+
esac
|
| 319 |
+
|
| 320 |
+
# With -d, create the new directory with the user-specified mode.
|
| 321 |
+
# Otherwise, rely on $mkdir_umask.
|
| 322 |
+
if test -n "$dir_arg"; then
|
| 323 |
+
mkdir_mode=-m$mode
|
| 324 |
+
else
|
| 325 |
+
mkdir_mode=
|
| 326 |
+
fi
|
| 327 |
+
|
| 328 |
+
posix_mkdir=false
|
| 329 |
+
case $umask in
|
| 330 |
+
*[123567][0-7][0-7])
|
| 331 |
+
# POSIX mkdir -p sets u+wx bits regardless of umask, which
|
| 332 |
+
# is incompatible with FreeBSD 'install' when (umask & 300) != 0.
|
| 333 |
+
;;
|
| 334 |
+
*)
|
| 335 |
+
# Note that $RANDOM variable is not portable (e.g. dash); Use it
|
| 336 |
+
# here however when possible just to lower collision chance.
|
| 337 |
+
tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
|
| 338 |
+
|
| 339 |
+
trap 'ret=$?; rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null; exit $ret' 0
|
| 340 |
+
|
| 341 |
+
# Because "mkdir -p" follows existing symlinks and we likely work
|
| 342 |
+
# directly in world-writeable /tmp, make sure that the '$tmpdir'
|
| 343 |
+
# directory is successfully created first before we actually test
|
| 344 |
+
# 'mkdir -p' feature.
|
| 345 |
+
if (umask $mkdir_umask &&
|
| 346 |
+
$mkdirprog $mkdir_mode "$tmpdir" &&
|
| 347 |
+
exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1
|
| 348 |
+
then
|
| 349 |
+
if test -z "$dir_arg" || {
|
| 350 |
+
# Check for POSIX incompatibilities with -m.
|
| 351 |
+
# HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
|
| 352 |
+
# other-writable bit of parent directory when it shouldn't.
|
| 353 |
+
# FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
|
| 354 |
+
test_tmpdir="$tmpdir/a"
|
| 355 |
+
ls_ld_tmpdir=`ls -ld "$test_tmpdir"`
|
| 356 |
+
case $ls_ld_tmpdir in
|
| 357 |
+
d????-?r-*) different_mode=700;;
|
| 358 |
+
d????-?--*) different_mode=755;;
|
| 359 |
+
*) false;;
|
| 360 |
+
esac &&
|
| 361 |
+
$mkdirprog -m$different_mode -p -- "$test_tmpdir" && {
|
| 362 |
+
ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"`
|
| 363 |
+
test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
|
| 364 |
+
}
|
| 365 |
+
}
|
| 366 |
+
then posix_mkdir=:
|
| 367 |
+
fi
|
| 368 |
+
rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir"
|
| 369 |
+
else
|
| 370 |
+
# Remove any dirs left behind by ancient mkdir implementations.
|
| 371 |
+
rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null
|
| 372 |
+
fi
|
| 373 |
+
trap '' 0;;
|
| 374 |
+
esac;;
|
| 375 |
+
esac
|
| 376 |
+
|
| 377 |
+
if
|
| 378 |
+
$posix_mkdir && (
|
| 379 |
+
umask $mkdir_umask &&
|
| 380 |
+
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
|
| 381 |
+
)
|
| 382 |
+
then :
|
| 383 |
+
else
|
| 384 |
+
|
| 385 |
+
# The umask is ridiculous, or mkdir does not conform to POSIX,
|
| 386 |
+
# or it failed possibly due to a race condition. Create the
|
| 387 |
+
# directory the slow way, step by step, checking for races as we go.
|
| 388 |
+
|
| 389 |
+
case $dstdir in
|
| 390 |
+
/*) prefix='/';;
|
| 391 |
+
[-=\(\)!]*) prefix='./';;
|
| 392 |
+
*) prefix='';;
|
| 393 |
+
esac
|
| 394 |
+
|
| 395 |
+
oIFS=$IFS
|
| 396 |
+
IFS=/
|
| 397 |
+
set -f
|
| 398 |
+
set fnord $dstdir
|
| 399 |
+
shift
|
| 400 |
+
set +f
|
| 401 |
+
IFS=$oIFS
|
| 402 |
+
|
| 403 |
+
prefixes=
|
| 404 |
+
|
| 405 |
+
for d
|
| 406 |
+
do
|
| 407 |
+
test X"$d" = X && continue
|
| 408 |
+
|
| 409 |
+
prefix=$prefix$d
|
| 410 |
+
if test -d "$prefix"; then
|
| 411 |
+
prefixes=
|
| 412 |
+
else
|
| 413 |
+
if $posix_mkdir; then
|
| 414 |
+
(umask=$mkdir_umask &&
|
| 415 |
+
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
|
| 416 |
+
# Don't fail if two instances are running concurrently.
|
| 417 |
+
test -d "$prefix" || exit 1
|
| 418 |
+
else
|
| 419 |
+
case $prefix in
|
| 420 |
+
*\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
|
| 421 |
+
*) qprefix=$prefix;;
|
| 422 |
+
esac
|
| 423 |
+
prefixes="$prefixes '$qprefix'"
|
| 424 |
+
fi
|
| 425 |
+
fi
|
| 426 |
+
prefix=$prefix/
|
| 427 |
+
done
|
| 428 |
+
|
| 429 |
+
if test -n "$prefixes"; then
|
| 430 |
+
# Don't fail if two instances are running concurrently.
|
| 431 |
+
(umask $mkdir_umask &&
|
| 432 |
+
eval "\$doit_exec \$mkdirprog $prefixes") ||
|
| 433 |
+
test -d "$dstdir" || exit 1
|
| 434 |
+
obsolete_mkdir_used=true
|
| 435 |
+
fi
|
| 436 |
+
fi
|
| 437 |
+
fi
|
| 438 |
+
|
| 439 |
+
if test -n "$dir_arg"; then
|
| 440 |
+
{ test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
|
| 441 |
+
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
|
| 442 |
+
{ test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
|
| 443 |
+
test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
|
| 444 |
+
else
|
| 445 |
+
|
| 446 |
+
# Make a couple of temp file names in the proper directory.
|
| 447 |
+
dsttmp=${dstdirslash}_inst.$$_
|
| 448 |
+
rmtmp=${dstdirslash}_rm.$$_
|
| 449 |
+
|
| 450 |
+
# Trap to clean up those temp files at exit.
|
| 451 |
+
trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
|
| 452 |
+
|
| 453 |
+
# Copy the file name to the temp name.
|
| 454 |
+
(umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
|
| 455 |
+
|
| 456 |
+
# and set any options; do chmod last to preserve setuid bits.
|
| 457 |
+
#
|
| 458 |
+
# If any of these fail, we abort the whole thing. If we want to
|
| 459 |
+
# ignore errors from any of these, just make sure not to ignore
|
| 460 |
+
# errors from the above "$doit $cpprog $src $dsttmp" command.
|
| 461 |
+
#
|
| 462 |
+
{ test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
|
| 463 |
+
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
|
| 464 |
+
{ test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
|
| 465 |
+
{ test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
|
| 466 |
+
|
| 467 |
+
# If -C, don't bother to copy if it wouldn't change the file.
|
| 468 |
+
if $copy_on_change &&
|
| 469 |
+
old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
|
| 470 |
+
new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
|
| 471 |
+
set -f &&
|
| 472 |
+
set X $old && old=:$2:$4:$5:$6 &&
|
| 473 |
+
set X $new && new=:$2:$4:$5:$6 &&
|
| 474 |
+
set +f &&
|
| 475 |
+
test "$old" = "$new" &&
|
| 476 |
+
$cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
|
| 477 |
+
then
|
| 478 |
+
rm -f "$dsttmp"
|
| 479 |
+
else
|
| 480 |
+
# Rename the file to the real destination.
|
| 481 |
+
$doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
|
| 482 |
+
|
| 483 |
+
# The rename failed, perhaps because mv can't rename something else
|
| 484 |
+
# to itself, or perhaps because mv is so ancient that it does not
|
| 485 |
+
# support -f.
|
| 486 |
+
{
|
| 487 |
+
# Now remove or move aside any old file at destination location.
|
| 488 |
+
# We try this two ways since rm can't unlink itself on some
|
| 489 |
+
# systems and the destination file might be busy for other
|
| 490 |
+
# reasons. In this case, the final cleanup might fail but the new
|
| 491 |
+
# file should still install successfully.
|
| 492 |
+
{
|
| 493 |
+
test ! -f "$dst" ||
|
| 494 |
+
$doit $rmcmd -f "$dst" 2>/dev/null ||
|
| 495 |
+
{ $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
|
| 496 |
+
{ $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
|
| 497 |
+
} ||
|
| 498 |
+
{ echo "$0: cannot unlink or rename $dst" >&2
|
| 499 |
+
(exit 1); exit 1
|
| 500 |
+
}
|
| 501 |
+
} &&
|
| 502 |
+
|
| 503 |
+
# Now rename the file to the real destination.
|
| 504 |
+
$doit $mvcmd "$dsttmp" "$dst"
|
| 505 |
+
}
|
| 506 |
+
fi || exit 1
|
| 507 |
+
|
| 508 |
+
trap '' 0
|
| 509 |
+
fi
|
| 510 |
+
done
|
| 511 |
+
|
| 512 |
+
# Local variables:
|
| 513 |
+
# eval: (add-hook 'before-save-hook 'time-stamp)
|
| 514 |
+
# time-stamp-start: "scriptversion="
|
| 515 |
+
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
| 516 |
+
# time-stamp-time-zone: "UTC0"
|
| 517 |
+
# time-stamp-end: "; # UTC"
|
| 518 |
+
# End:
|
janus/lib/python3.10/config-3.10-x86_64-linux-gnu/makesetup
ADDED
|
@@ -0,0 +1,309 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#! /bin/sh
|
| 2 |
+
|
| 3 |
+
# Convert templates into Makefile and config.c, based on the module
|
| 4 |
+
# definitions found in the file Setup.
|
| 5 |
+
#
|
| 6 |
+
# Usage: makesetup [-s dir] [-c file] [-m file] [Setup] ... [-n [Setup] ...]
|
| 7 |
+
#
|
| 8 |
+
# Options:
|
| 9 |
+
# -s directory: alternative source directory (default .)
|
| 10 |
+
# -l directory: library source directory (default derived from $0)
|
| 11 |
+
# -c file: alternative config.c template (default $libdir/config.c.in)
|
| 12 |
+
# -c -: don't write config.c
|
| 13 |
+
# -m file: alternative Makefile template (default ./Makefile.pre)
|
| 14 |
+
# -m -: don't write Makefile
|
| 15 |
+
#
|
| 16 |
+
# Remaining arguments are one or more Setup files (default ./Setup).
|
| 17 |
+
# Setup files after a -n option are used for their variables, modules
|
| 18 |
+
# and libraries but not for their .o files.
|
| 19 |
+
#
|
| 20 |
+
# See Setup for a description of the format of the Setup file.
|
| 21 |
+
#
|
| 22 |
+
# The following edits are made:
|
| 23 |
+
#
|
| 24 |
+
# Copying config.c.in to config.c:
|
| 25 |
+
# - insert an identifying comment at the start
|
| 26 |
+
# - for each <module> mentioned in Setup before *noconfig*:
|
| 27 |
+
# + insert 'extern PyObject* PyInit_<module>(void);' before MARKER 1
|
| 28 |
+
# + insert '{"<module>", PyInit_<module>},' before MARKER 2
|
| 29 |
+
#
|
| 30 |
+
# Copying Makefile.pre to Makefile:
|
| 31 |
+
# - insert an identifying comment at the start
|
| 32 |
+
# - replace _MODBUILT_NAMES_ by the list of *static* and *shared* modules
|
| 33 |
+
# from Setup
|
| 34 |
+
# - replace _MODDISABLED_NAMES_ by the list of *disabled* modules from Setup
|
| 35 |
+
# - replace _MODOBJS_ by the list of objects from Setup (except for
|
| 36 |
+
# Setup files after a -n option)
|
| 37 |
+
# - replace _MODLIBS_ by the list of libraries from Setup
|
| 38 |
+
# - for each object file mentioned in Setup, append a rule
|
| 39 |
+
# '<file>.o: <file>.c; <build commands>' to the end of the Makefile
|
| 40 |
+
# - for each module mentioned in Setup, append a rule
|
| 41 |
+
# which creates a shared library version to the end of the Makefile
|
| 42 |
+
# - for each variable definition found in Setup, insert the definition
|
| 43 |
+
# before the comment 'Definitions added by makesetup'
|
| 44 |
+
|
| 45 |
+
# Loop over command line options
|
| 46 |
+
usage='
|
| 47 |
+
usage: makesetup [-s srcdir] [-l libdir] [-c config.c.in] [-m Makefile.pre]
|
| 48 |
+
[Setup] ... [-n [Setup] ...]'
|
| 49 |
+
srcdir='.'
|
| 50 |
+
libdir=''
|
| 51 |
+
config=''
|
| 52 |
+
makepre=''
|
| 53 |
+
noobjects=''
|
| 54 |
+
doconfig=yes
|
| 55 |
+
while :
|
| 56 |
+
do
|
| 57 |
+
case $1 in
|
| 58 |
+
-s) shift; srcdir=$1; shift;;
|
| 59 |
+
-l) shift; libdir=$1; shift;;
|
| 60 |
+
-c) shift; config=$1; shift;;
|
| 61 |
+
-m) shift; makepre=$1; shift;;
|
| 62 |
+
--) shift; break;;
|
| 63 |
+
-n) noobjects=yes;;
|
| 64 |
+
-*) echo "$usage" 1>&2; exit 2;;
|
| 65 |
+
*) break;;
|
| 66 |
+
esac
|
| 67 |
+
done
|
| 68 |
+
|
| 69 |
+
# Set default libdir and config if not set by command line
|
| 70 |
+
# (Not all systems have dirname)
|
| 71 |
+
case $libdir in
|
| 72 |
+
'') case $0 in
|
| 73 |
+
*/*) libdir=`echo $0 | sed 's,/[^/]*$,,'`;;
|
| 74 |
+
*) libdir=.;;
|
| 75 |
+
esac;;
|
| 76 |
+
esac
|
| 77 |
+
case $config in
|
| 78 |
+
'') config=$libdir/config.c.in;;
|
| 79 |
+
esac
|
| 80 |
+
case $makepre in
|
| 81 |
+
'') makepre=Makefile.pre;;
|
| 82 |
+
esac
|
| 83 |
+
|
| 84 |
+
# Newline for sed i and a commands
|
| 85 |
+
NL='\
|
| 86 |
+
'
|
| 87 |
+
|
| 88 |
+
# Setup to link with extra libraries when making shared extensions.
|
| 89 |
+
# Currently, only Cygwin needs this baggage.
|
| 90 |
+
case `uname -s` in
|
| 91 |
+
CYGWIN*) if test $libdir = .
|
| 92 |
+
then
|
| 93 |
+
ExtraLibDir=.
|
| 94 |
+
else
|
| 95 |
+
ExtraLibDir='$(LIBPL)'
|
| 96 |
+
fi
|
| 97 |
+
ExtraLibs="-L$ExtraLibDir -lpython\$(LDVERSION)";;
|
| 98 |
+
esac
|
| 99 |
+
|
| 100 |
+
# Main loop
|
| 101 |
+
for i in ${*-Setup}
|
| 102 |
+
do
|
| 103 |
+
case $i in
|
| 104 |
+
-n) echo '*noobjects*';;
|
| 105 |
+
*) echo '*doconfig*'; cat "$i";;
|
| 106 |
+
esac
|
| 107 |
+
done |
|
| 108 |
+
sed -e 's/[ ]*#.*//' -e '/^[ ]*$/d' |
|
| 109 |
+
(
|
| 110 |
+
rulesf="@rules.$$"
|
| 111 |
+
trap 'rm -f $rulesf' 0 1 2 3
|
| 112 |
+
echo "
|
| 113 |
+
# Rules appended by makesetup
|
| 114 |
+
" >$rulesf
|
| 115 |
+
DEFS=
|
| 116 |
+
BUILT=
|
| 117 |
+
DISABLED=
|
| 118 |
+
MODS=
|
| 119 |
+
SHAREDMODS=
|
| 120 |
+
OBJS=
|
| 121 |
+
LIBS=
|
| 122 |
+
LOCALLIBS=
|
| 123 |
+
BASELIBS=
|
| 124 |
+
while read line
|
| 125 |
+
do
|
| 126 |
+
# to handle backslashes for sh's that don't automatically
|
| 127 |
+
# continue a read when the last char is a backslash
|
| 128 |
+
while echo $line | grep '\\$' > /dev/null
|
| 129 |
+
do
|
| 130 |
+
read extraline
|
| 131 |
+
line=`echo $line| sed s/.$//`$extraline
|
| 132 |
+
done
|
| 133 |
+
|
| 134 |
+
# Output DEFS in reverse order so first definition overrides
|
| 135 |
+
case $line in
|
| 136 |
+
*=*) DEFS="$line$NL$DEFS"; continue;;
|
| 137 |
+
'include '*) DEFS="$line$NL$DEFS"; continue;;
|
| 138 |
+
'*noobjects*')
|
| 139 |
+
case $noobjects in
|
| 140 |
+
yes) ;;
|
| 141 |
+
*) LOCALLIBS=$LIBS; LIBS=;;
|
| 142 |
+
esac
|
| 143 |
+
noobjects=yes;
|
| 144 |
+
continue;;
|
| 145 |
+
'*doconfig*') doconfig=yes; continue;;
|
| 146 |
+
'*static*') doconfig=yes; continue;;
|
| 147 |
+
'*noconfig*') doconfig=no; continue;;
|
| 148 |
+
'*shared*') doconfig=no; continue;;
|
| 149 |
+
'*disabled*') doconfig=disabled; continue;;
|
| 150 |
+
esac
|
| 151 |
+
srcs=
|
| 152 |
+
cpps=
|
| 153 |
+
libs=
|
| 154 |
+
mods=
|
| 155 |
+
skip=
|
| 156 |
+
for arg in $line
|
| 157 |
+
do
|
| 158 |
+
case $skip in
|
| 159 |
+
libs) libs="$libs $arg"; skip=; continue;;
|
| 160 |
+
cpps) cpps="$cpps $arg"; skip=; continue;;
|
| 161 |
+
srcs) srcs="$srcs $arg"; skip=; continue;;
|
| 162 |
+
esac
|
| 163 |
+
case $arg in
|
| 164 |
+
-framework) libs="$libs $arg"; skip=libs;
|
| 165 |
+
# OSX/OSXS/Darwin framework link cmd
|
| 166 |
+
;;
|
| 167 |
+
-[IDUCfF]*) cpps="$cpps $arg";;
|
| 168 |
+
-Xcompiler) skip=cpps;;
|
| 169 |
+
-Xlinker) libs="$libs $arg"; skip=libs;;
|
| 170 |
+
-rpath) libs="$libs $arg"; skip=libs;;
|
| 171 |
+
--rpath) libs="$libs $arg"; skip=libs;;
|
| 172 |
+
-[A-Zl]*) libs="$libs $arg";;
|
| 173 |
+
*.a) libs="$libs $arg";;
|
| 174 |
+
*.so) libs="$libs $arg";;
|
| 175 |
+
*.sl) libs="$libs $arg";;
|
| 176 |
+
/*.o) libs="$libs $arg";;
|
| 177 |
+
*.def) libs="$libs $arg";;
|
| 178 |
+
*.o) srcs="$srcs `basename $arg .o`.c";;
|
| 179 |
+
*.[cC]) srcs="$srcs $arg";;
|
| 180 |
+
*.m) srcs="$srcs $arg";; # Objective-C src
|
| 181 |
+
*.cc) srcs="$srcs $arg";;
|
| 182 |
+
*.c++) srcs="$srcs $arg";;
|
| 183 |
+
*.cxx) srcs="$srcs $arg";;
|
| 184 |
+
*.cpp) srcs="$srcs $arg";;
|
| 185 |
+
\$*) libs="$libs $arg"
|
| 186 |
+
cpps="$cpps $arg";;
|
| 187 |
+
*.*) echo 1>&2 "bad word $arg in $line"
|
| 188 |
+
exit 1;;
|
| 189 |
+
-u) skip=libs; libs="$libs -u";;
|
| 190 |
+
[a-zA-Z_]*) mods="$mods $arg";;
|
| 191 |
+
*) echo 1>&2 "bad word $arg in $line"
|
| 192 |
+
exit 1;;
|
| 193 |
+
esac
|
| 194 |
+
done
|
| 195 |
+
case $doconfig in
|
| 196 |
+
yes)
|
| 197 |
+
LIBS="$LIBS $libs"
|
| 198 |
+
MODS="$MODS $mods"
|
| 199 |
+
BUILT="$BUILT $mods"
|
| 200 |
+
;;
|
| 201 |
+
no)
|
| 202 |
+
BUILT="$BUILT $mods"
|
| 203 |
+
;;
|
| 204 |
+
disabled)
|
| 205 |
+
DISABLED="$DISABLED $mods"
|
| 206 |
+
continue
|
| 207 |
+
;;
|
| 208 |
+
esac
|
| 209 |
+
case $noobjects in
|
| 210 |
+
yes) continue;;
|
| 211 |
+
esac
|
| 212 |
+
objs=''
|
| 213 |
+
for src in $srcs
|
| 214 |
+
do
|
| 215 |
+
case $src in
|
| 216 |
+
*.c) obj=`basename $src .c`.o; cc='$(CC)';;
|
| 217 |
+
*.cc) obj=`basename $src .cc`.o; cc='$(CXX)';;
|
| 218 |
+
*.c++) obj=`basename $src .c++`.o; cc='$(CXX)';;
|
| 219 |
+
*.C) obj=`basename $src .C`.o; cc='$(CXX)';;
|
| 220 |
+
*.cxx) obj=`basename $src .cxx`.o; cc='$(CXX)';;
|
| 221 |
+
*.cpp) obj=`basename $src .cpp`.o; cc='$(CXX)';;
|
| 222 |
+
*.m) obj=`basename $src .m`.o; cc='$(CC)';; # Obj-C
|
| 223 |
+
*) continue;;
|
| 224 |
+
esac
|
| 225 |
+
obj="$srcdir/$obj"
|
| 226 |
+
objs="$objs $obj"
|
| 227 |
+
case $src in
|
| 228 |
+
glmodule.c) ;;
|
| 229 |
+
/*) ;;
|
| 230 |
+
\$*) ;;
|
| 231 |
+
*) src='$(srcdir)/'"$srcdir/$src";;
|
| 232 |
+
esac
|
| 233 |
+
case $doconfig in
|
| 234 |
+
no) cc="$cc \$(CCSHARED) \$(PY_CFLAGS_NODIST) \$(PY_CPPFLAGS)";;
|
| 235 |
+
*)
|
| 236 |
+
cc="$cc \$(PY_BUILTIN_MODULE_CFLAGS)";;
|
| 237 |
+
esac
|
| 238 |
+
rule="$obj: $src; $cc $cpps -c $src -o $obj"
|
| 239 |
+
echo "$rule" >>$rulesf
|
| 240 |
+
done
|
| 241 |
+
case $doconfig in
|
| 242 |
+
yes) OBJS="$OBJS $objs";;
|
| 243 |
+
esac
|
| 244 |
+
for mod in $mods
|
| 245 |
+
do
|
| 246 |
+
file="$srcdir/$mod\$(EXT_SUFFIX)"
|
| 247 |
+
case $doconfig in
|
| 248 |
+
no) SHAREDMODS="$SHAREDMODS $file";;
|
| 249 |
+
esac
|
| 250 |
+
rule="$file: $objs"
|
| 251 |
+
rule="$rule; \$(BLDSHARED) $objs $libs $ExtraLibs -o $file"
|
| 252 |
+
echo "$rule" >>$rulesf
|
| 253 |
+
done
|
| 254 |
+
done
|
| 255 |
+
|
| 256 |
+
case $SHAREDMODS in
|
| 257 |
+
'') ;;
|
| 258 |
+
*) DEFS="SHAREDMODS=$SHAREDMODS$NL$DEFS";;
|
| 259 |
+
esac
|
| 260 |
+
|
| 261 |
+
case $noobjects in
|
| 262 |
+
yes) BASELIBS=$LIBS;;
|
| 263 |
+
*) LOCALLIBS=$LIBS;;
|
| 264 |
+
esac
|
| 265 |
+
LIBS='$(LOCALMODLIBS) $(BASEMODLIBS)'
|
| 266 |
+
DEFS="BASEMODLIBS=$BASELIBS$NL$DEFS"
|
| 267 |
+
DEFS="LOCALMODLIBS=$LOCALLIBS$NL$DEFS"
|
| 268 |
+
|
| 269 |
+
EXTDECLS=
|
| 270 |
+
INITBITS=
|
| 271 |
+
for mod in $MODS
|
| 272 |
+
do
|
| 273 |
+
EXTDECLS="${EXTDECLS}extern PyObject* PyInit_$mod(void);$NL"
|
| 274 |
+
INITBITS="${INITBITS} {\"$mod\", PyInit_$mod},$NL"
|
| 275 |
+
done
|
| 276 |
+
|
| 277 |
+
|
| 278 |
+
case $config in
|
| 279 |
+
-) ;;
|
| 280 |
+
*) sed -e "
|
| 281 |
+
1i$NL/* Generated automatically from $config by makesetup. */
|
| 282 |
+
/MARKER 1/i$NL$EXTDECLS
|
| 283 |
+
|
| 284 |
+
/MARKER 2/i$NL$INITBITS
|
| 285 |
+
|
| 286 |
+
" $config >config.c
|
| 287 |
+
;;
|
| 288 |
+
esac
|
| 289 |
+
|
| 290 |
+
case $makepre in
|
| 291 |
+
-) ;;
|
| 292 |
+
*) sedf="@sed.in.$$"
|
| 293 |
+
trap 'rm -f $sedf' 0 1 2 3
|
| 294 |
+
echo "1i\\" >$sedf
|
| 295 |
+
str="# Generated automatically from $makepre by makesetup."
|
| 296 |
+
echo "$str" >>$sedf
|
| 297 |
+
echo "s%_MODBUILT_NAMES_%$BUILT%" >>$sedf
|
| 298 |
+
echo "s%_MODDISABLED_NAMES_%$DISABLED%" >>$sedf
|
| 299 |
+
echo "s%_MODOBJS_%$OBJS%" >>$sedf
|
| 300 |
+
echo "s%_MODLIBS_%$LIBS%" >>$sedf
|
| 301 |
+
echo "/Definitions added by makesetup/a$NL$NL$DEFS" >>$sedf
|
| 302 |
+
sed -f $sedf $makepre >Makefile
|
| 303 |
+
cat $rulesf >>Makefile
|
| 304 |
+
rm -f $sedf
|
| 305 |
+
;;
|
| 306 |
+
esac
|
| 307 |
+
|
| 308 |
+
rm -f $rulesf
|
| 309 |
+
)
|
janus/lib/python3.10/config-3.10-x86_64-linux-gnu/python-config.py
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/root/envs/janus/bin/python3.10
|
| 2 |
+
# -*- python -*-
|
| 3 |
+
|
| 4 |
+
# Keep this script in sync with python-config.sh.in
|
| 5 |
+
|
| 6 |
+
import getopt
|
| 7 |
+
import os
|
| 8 |
+
import sys
|
| 9 |
+
import sysconfig
|
| 10 |
+
|
| 11 |
+
valid_opts = ['prefix', 'exec-prefix', 'includes', 'libs', 'cflags',
|
| 12 |
+
'ldflags', 'extension-suffix', 'help', 'abiflags', 'configdir',
|
| 13 |
+
'embed']
|
| 14 |
+
|
| 15 |
+
def exit_with_usage(code=1):
|
| 16 |
+
print("Usage: {0} [{1}]".format(
|
| 17 |
+
sys.argv[0], '|'.join('--'+opt for opt in valid_opts)), file=sys.stderr)
|
| 18 |
+
sys.exit(code)
|
| 19 |
+
|
| 20 |
+
try:
|
| 21 |
+
opts, args = getopt.getopt(sys.argv[1:], '', valid_opts)
|
| 22 |
+
except getopt.error:
|
| 23 |
+
exit_with_usage()
|
| 24 |
+
|
| 25 |
+
if not opts:
|
| 26 |
+
exit_with_usage()
|
| 27 |
+
|
| 28 |
+
getvar = sysconfig.get_config_var
|
| 29 |
+
pyver = getvar('VERSION')
|
| 30 |
+
|
| 31 |
+
opt_flags = [flag for (flag, val) in opts]
|
| 32 |
+
|
| 33 |
+
if '--help' in opt_flags:
|
| 34 |
+
exit_with_usage(code=0)
|
| 35 |
+
|
| 36 |
+
for opt in opt_flags:
|
| 37 |
+
if opt == '--prefix':
|
| 38 |
+
print(getvar('prefix'))
|
| 39 |
+
|
| 40 |
+
elif opt == '--exec-prefix':
|
| 41 |
+
print(getvar('exec_prefix'))
|
| 42 |
+
|
| 43 |
+
elif opt in ('--includes', '--cflags'):
|
| 44 |
+
flags = ['-I' + sysconfig.get_path('include'),
|
| 45 |
+
'-I' + sysconfig.get_path('platinclude')]
|
| 46 |
+
if opt == '--cflags':
|
| 47 |
+
flags.extend(getvar('CFLAGS').split())
|
| 48 |
+
print(' '.join(flags))
|
| 49 |
+
|
| 50 |
+
elif opt in ('--libs', '--ldflags'):
|
| 51 |
+
libs = []
|
| 52 |
+
if '--embed' in opt_flags:
|
| 53 |
+
libs.append('-lpython' + pyver + sys.abiflags)
|
| 54 |
+
else:
|
| 55 |
+
libpython = getvar('LIBPYTHON')
|
| 56 |
+
if libpython:
|
| 57 |
+
libs.append(libpython)
|
| 58 |
+
libs.extend(getvar('LIBS').split() + getvar('SYSLIBS').split())
|
| 59 |
+
|
| 60 |
+
# add the prefix/lib/pythonX.Y/config dir, but only if there is no
|
| 61 |
+
# shared library in prefix/lib/.
|
| 62 |
+
if opt == '--ldflags':
|
| 63 |
+
if not getvar('Py_ENABLE_SHARED'):
|
| 64 |
+
libs.insert(0, '-L' + getvar('LIBPL'))
|
| 65 |
+
print(' '.join(libs))
|
| 66 |
+
|
| 67 |
+
elif opt == '--extension-suffix':
|
| 68 |
+
print(getvar('EXT_SUFFIX'))
|
| 69 |
+
|
| 70 |
+
elif opt == '--abiflags':
|
| 71 |
+
print(sys.abiflags)
|
| 72 |
+
|
| 73 |
+
elif opt == '--configdir':
|
| 74 |
+
print(getvar('LIBPL'))
|
janus/lib/python3.10/config-3.10-x86_64-linux-gnu/python.o
ADDED
|
Binary file (10.7 kB). View file
|
|
|
janus/lib/python3.10/ctypes/__init__.py
ADDED
|
@@ -0,0 +1,563 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""create and manipulate C data types in Python"""
|
| 2 |
+
|
| 3 |
+
import os as _os, sys as _sys
|
| 4 |
+
import types as _types
|
| 5 |
+
|
| 6 |
+
__version__ = "1.1.0"
|
| 7 |
+
|
| 8 |
+
from _ctypes import Union, Structure, Array
|
| 9 |
+
from _ctypes import _Pointer
|
| 10 |
+
from _ctypes import CFuncPtr as _CFuncPtr
|
| 11 |
+
from _ctypes import __version__ as _ctypes_version
|
| 12 |
+
from _ctypes import RTLD_LOCAL, RTLD_GLOBAL
|
| 13 |
+
from _ctypes import ArgumentError
|
| 14 |
+
|
| 15 |
+
from struct import calcsize as _calcsize
|
| 16 |
+
|
| 17 |
+
if __version__ != _ctypes_version:
|
| 18 |
+
raise Exception("Version number mismatch", __version__, _ctypes_version)
|
| 19 |
+
|
| 20 |
+
if _os.name == "nt":
|
| 21 |
+
from _ctypes import FormatError
|
| 22 |
+
|
| 23 |
+
DEFAULT_MODE = RTLD_LOCAL
|
| 24 |
+
if _os.name == "posix" and _sys.platform == "darwin":
|
| 25 |
+
# On OS X 10.3, we use RTLD_GLOBAL as default mode
|
| 26 |
+
# because RTLD_LOCAL does not work at least on some
|
| 27 |
+
# libraries. OS X 10.3 is Darwin 7, so we check for
|
| 28 |
+
# that.
|
| 29 |
+
|
| 30 |
+
if int(_os.uname().release.split('.')[0]) < 8:
|
| 31 |
+
DEFAULT_MODE = RTLD_GLOBAL
|
| 32 |
+
|
| 33 |
+
from _ctypes import FUNCFLAG_CDECL as _FUNCFLAG_CDECL, \
|
| 34 |
+
FUNCFLAG_PYTHONAPI as _FUNCFLAG_PYTHONAPI, \
|
| 35 |
+
FUNCFLAG_USE_ERRNO as _FUNCFLAG_USE_ERRNO, \
|
| 36 |
+
FUNCFLAG_USE_LASTERROR as _FUNCFLAG_USE_LASTERROR
|
| 37 |
+
|
| 38 |
+
# WINOLEAPI -> HRESULT
|
| 39 |
+
# WINOLEAPI_(type)
|
| 40 |
+
#
|
| 41 |
+
# STDMETHODCALLTYPE
|
| 42 |
+
#
|
| 43 |
+
# STDMETHOD(name)
|
| 44 |
+
# STDMETHOD_(type, name)
|
| 45 |
+
#
|
| 46 |
+
# STDAPICALLTYPE
|
| 47 |
+
|
| 48 |
+
def create_string_buffer(init, size=None):
|
| 49 |
+
"""create_string_buffer(aBytes) -> character array
|
| 50 |
+
create_string_buffer(anInteger) -> character array
|
| 51 |
+
create_string_buffer(aBytes, anInteger) -> character array
|
| 52 |
+
"""
|
| 53 |
+
if isinstance(init, bytes):
|
| 54 |
+
if size is None:
|
| 55 |
+
size = len(init)+1
|
| 56 |
+
_sys.audit("ctypes.create_string_buffer", init, size)
|
| 57 |
+
buftype = c_char * size
|
| 58 |
+
buf = buftype()
|
| 59 |
+
buf.value = init
|
| 60 |
+
return buf
|
| 61 |
+
elif isinstance(init, int):
|
| 62 |
+
_sys.audit("ctypes.create_string_buffer", None, init)
|
| 63 |
+
buftype = c_char * init
|
| 64 |
+
buf = buftype()
|
| 65 |
+
return buf
|
| 66 |
+
raise TypeError(init)
|
| 67 |
+
|
| 68 |
+
def c_buffer(init, size=None):
|
| 69 |
+
## "deprecated, use create_string_buffer instead"
|
| 70 |
+
## import warnings
|
| 71 |
+
## warnings.warn("c_buffer is deprecated, use create_string_buffer instead",
|
| 72 |
+
## DeprecationWarning, stacklevel=2)
|
| 73 |
+
return create_string_buffer(init, size)
|
| 74 |
+
|
| 75 |
+
_c_functype_cache = {}
|
| 76 |
+
def CFUNCTYPE(restype, *argtypes, **kw):
|
| 77 |
+
"""CFUNCTYPE(restype, *argtypes,
|
| 78 |
+
use_errno=False, use_last_error=False) -> function prototype.
|
| 79 |
+
|
| 80 |
+
restype: the result type
|
| 81 |
+
argtypes: a sequence specifying the argument types
|
| 82 |
+
|
| 83 |
+
The function prototype can be called in different ways to create a
|
| 84 |
+
callable object:
|
| 85 |
+
|
| 86 |
+
prototype(integer address) -> foreign function
|
| 87 |
+
prototype(callable) -> create and return a C callable function from callable
|
| 88 |
+
prototype(integer index, method name[, paramflags]) -> foreign function calling a COM method
|
| 89 |
+
prototype((ordinal number, dll object)[, paramflags]) -> foreign function exported by ordinal
|
| 90 |
+
prototype((function name, dll object)[, paramflags]) -> foreign function exported by name
|
| 91 |
+
"""
|
| 92 |
+
flags = _FUNCFLAG_CDECL
|
| 93 |
+
if kw.pop("use_errno", False):
|
| 94 |
+
flags |= _FUNCFLAG_USE_ERRNO
|
| 95 |
+
if kw.pop("use_last_error", False):
|
| 96 |
+
flags |= _FUNCFLAG_USE_LASTERROR
|
| 97 |
+
if kw:
|
| 98 |
+
raise ValueError("unexpected keyword argument(s) %s" % kw.keys())
|
| 99 |
+
try:
|
| 100 |
+
return _c_functype_cache[(restype, argtypes, flags)]
|
| 101 |
+
except KeyError:
|
| 102 |
+
class CFunctionType(_CFuncPtr):
|
| 103 |
+
_argtypes_ = argtypes
|
| 104 |
+
_restype_ = restype
|
| 105 |
+
_flags_ = flags
|
| 106 |
+
_c_functype_cache[(restype, argtypes, flags)] = CFunctionType
|
| 107 |
+
return CFunctionType
|
| 108 |
+
|
| 109 |
+
if _os.name == "nt":
|
| 110 |
+
from _ctypes import LoadLibrary as _dlopen
|
| 111 |
+
from _ctypes import FUNCFLAG_STDCALL as _FUNCFLAG_STDCALL
|
| 112 |
+
|
| 113 |
+
_win_functype_cache = {}
|
| 114 |
+
def WINFUNCTYPE(restype, *argtypes, **kw):
|
| 115 |
+
# docstring set later (very similar to CFUNCTYPE.__doc__)
|
| 116 |
+
flags = _FUNCFLAG_STDCALL
|
| 117 |
+
if kw.pop("use_errno", False):
|
| 118 |
+
flags |= _FUNCFLAG_USE_ERRNO
|
| 119 |
+
if kw.pop("use_last_error", False):
|
| 120 |
+
flags |= _FUNCFLAG_USE_LASTERROR
|
| 121 |
+
if kw:
|
| 122 |
+
raise ValueError("unexpected keyword argument(s) %s" % kw.keys())
|
| 123 |
+
try:
|
| 124 |
+
return _win_functype_cache[(restype, argtypes, flags)]
|
| 125 |
+
except KeyError:
|
| 126 |
+
class WinFunctionType(_CFuncPtr):
|
| 127 |
+
_argtypes_ = argtypes
|
| 128 |
+
_restype_ = restype
|
| 129 |
+
_flags_ = flags
|
| 130 |
+
_win_functype_cache[(restype, argtypes, flags)] = WinFunctionType
|
| 131 |
+
return WinFunctionType
|
| 132 |
+
if WINFUNCTYPE.__doc__:
|
| 133 |
+
WINFUNCTYPE.__doc__ = CFUNCTYPE.__doc__.replace("CFUNCTYPE", "WINFUNCTYPE")
|
| 134 |
+
|
| 135 |
+
elif _os.name == "posix":
|
| 136 |
+
from _ctypes import dlopen as _dlopen
|
| 137 |
+
|
| 138 |
+
from _ctypes import sizeof, byref, addressof, alignment, resize
|
| 139 |
+
from _ctypes import get_errno, set_errno
|
| 140 |
+
from _ctypes import _SimpleCData
|
| 141 |
+
|
| 142 |
+
def _check_size(typ, typecode=None):
|
| 143 |
+
# Check if sizeof(ctypes_type) against struct.calcsize. This
|
| 144 |
+
# should protect somewhat against a misconfigured libffi.
|
| 145 |
+
from struct import calcsize
|
| 146 |
+
if typecode is None:
|
| 147 |
+
# Most _type_ codes are the same as used in struct
|
| 148 |
+
typecode = typ._type_
|
| 149 |
+
actual, required = sizeof(typ), calcsize(typecode)
|
| 150 |
+
if actual != required:
|
| 151 |
+
raise SystemError("sizeof(%s) wrong: %d instead of %d" % \
|
| 152 |
+
(typ, actual, required))
|
| 153 |
+
|
| 154 |
+
class py_object(_SimpleCData):
|
| 155 |
+
_type_ = "O"
|
| 156 |
+
def __repr__(self):
|
| 157 |
+
try:
|
| 158 |
+
return super().__repr__()
|
| 159 |
+
except ValueError:
|
| 160 |
+
return "%s(<NULL>)" % type(self).__name__
|
| 161 |
+
_check_size(py_object, "P")
|
| 162 |
+
|
| 163 |
+
class c_short(_SimpleCData):
|
| 164 |
+
_type_ = "h"
|
| 165 |
+
_check_size(c_short)
|
| 166 |
+
|
| 167 |
+
class c_ushort(_SimpleCData):
|
| 168 |
+
_type_ = "H"
|
| 169 |
+
_check_size(c_ushort)
|
| 170 |
+
|
| 171 |
+
class c_long(_SimpleCData):
|
| 172 |
+
_type_ = "l"
|
| 173 |
+
_check_size(c_long)
|
| 174 |
+
|
| 175 |
+
class c_ulong(_SimpleCData):
|
| 176 |
+
_type_ = "L"
|
| 177 |
+
_check_size(c_ulong)
|
| 178 |
+
|
| 179 |
+
if _calcsize("i") == _calcsize("l"):
|
| 180 |
+
# if int and long have the same size, make c_int an alias for c_long
|
| 181 |
+
c_int = c_long
|
| 182 |
+
c_uint = c_ulong
|
| 183 |
+
else:
|
| 184 |
+
class c_int(_SimpleCData):
|
| 185 |
+
_type_ = "i"
|
| 186 |
+
_check_size(c_int)
|
| 187 |
+
|
| 188 |
+
class c_uint(_SimpleCData):
|
| 189 |
+
_type_ = "I"
|
| 190 |
+
_check_size(c_uint)
|
| 191 |
+
|
| 192 |
+
class c_float(_SimpleCData):
|
| 193 |
+
_type_ = "f"
|
| 194 |
+
_check_size(c_float)
|
| 195 |
+
|
| 196 |
+
class c_double(_SimpleCData):
|
| 197 |
+
_type_ = "d"
|
| 198 |
+
_check_size(c_double)
|
| 199 |
+
|
| 200 |
+
class c_longdouble(_SimpleCData):
|
| 201 |
+
_type_ = "g"
|
| 202 |
+
if sizeof(c_longdouble) == sizeof(c_double):
|
| 203 |
+
c_longdouble = c_double
|
| 204 |
+
|
| 205 |
+
if _calcsize("l") == _calcsize("q"):
|
| 206 |
+
# if long and long long have the same size, make c_longlong an alias for c_long
|
| 207 |
+
c_longlong = c_long
|
| 208 |
+
c_ulonglong = c_ulong
|
| 209 |
+
else:
|
| 210 |
+
class c_longlong(_SimpleCData):
|
| 211 |
+
_type_ = "q"
|
| 212 |
+
_check_size(c_longlong)
|
| 213 |
+
|
| 214 |
+
class c_ulonglong(_SimpleCData):
|
| 215 |
+
_type_ = "Q"
|
| 216 |
+
## def from_param(cls, val):
|
| 217 |
+
## return ('d', float(val), val)
|
| 218 |
+
## from_param = classmethod(from_param)
|
| 219 |
+
_check_size(c_ulonglong)
|
| 220 |
+
|
| 221 |
+
class c_ubyte(_SimpleCData):
|
| 222 |
+
_type_ = "B"
|
| 223 |
+
c_ubyte.__ctype_le__ = c_ubyte.__ctype_be__ = c_ubyte
|
| 224 |
+
# backward compatibility:
|
| 225 |
+
##c_uchar = c_ubyte
|
| 226 |
+
_check_size(c_ubyte)
|
| 227 |
+
|
| 228 |
+
class c_byte(_SimpleCData):
|
| 229 |
+
_type_ = "b"
|
| 230 |
+
c_byte.__ctype_le__ = c_byte.__ctype_be__ = c_byte
|
| 231 |
+
_check_size(c_byte)
|
| 232 |
+
|
| 233 |
+
class c_char(_SimpleCData):
|
| 234 |
+
_type_ = "c"
|
| 235 |
+
c_char.__ctype_le__ = c_char.__ctype_be__ = c_char
|
| 236 |
+
_check_size(c_char)
|
| 237 |
+
|
| 238 |
+
class c_char_p(_SimpleCData):
|
| 239 |
+
_type_ = "z"
|
| 240 |
+
def __repr__(self):
|
| 241 |
+
return "%s(%s)" % (self.__class__.__name__, c_void_p.from_buffer(self).value)
|
| 242 |
+
_check_size(c_char_p, "P")
|
| 243 |
+
|
| 244 |
+
class c_void_p(_SimpleCData):
|
| 245 |
+
_type_ = "P"
|
| 246 |
+
c_voidp = c_void_p # backwards compatibility (to a bug)
|
| 247 |
+
_check_size(c_void_p)
|
| 248 |
+
|
| 249 |
+
class c_bool(_SimpleCData):
|
| 250 |
+
_type_ = "?"
|
| 251 |
+
|
| 252 |
+
from _ctypes import POINTER, pointer, _pointer_type_cache
|
| 253 |
+
|
| 254 |
+
class c_wchar_p(_SimpleCData):
|
| 255 |
+
_type_ = "Z"
|
| 256 |
+
def __repr__(self):
|
| 257 |
+
return "%s(%s)" % (self.__class__.__name__, c_void_p.from_buffer(self).value)
|
| 258 |
+
|
| 259 |
+
class c_wchar(_SimpleCData):
|
| 260 |
+
_type_ = "u"
|
| 261 |
+
|
| 262 |
+
def _reset_cache():
|
| 263 |
+
_pointer_type_cache.clear()
|
| 264 |
+
_c_functype_cache.clear()
|
| 265 |
+
if _os.name == "nt":
|
| 266 |
+
_win_functype_cache.clear()
|
| 267 |
+
# _SimpleCData.c_wchar_p_from_param
|
| 268 |
+
POINTER(c_wchar).from_param = c_wchar_p.from_param
|
| 269 |
+
# _SimpleCData.c_char_p_from_param
|
| 270 |
+
POINTER(c_char).from_param = c_char_p.from_param
|
| 271 |
+
_pointer_type_cache[None] = c_void_p
|
| 272 |
+
|
| 273 |
+
def create_unicode_buffer(init, size=None):
|
| 274 |
+
"""create_unicode_buffer(aString) -> character array
|
| 275 |
+
create_unicode_buffer(anInteger) -> character array
|
| 276 |
+
create_unicode_buffer(aString, anInteger) -> character array
|
| 277 |
+
"""
|
| 278 |
+
if isinstance(init, str):
|
| 279 |
+
if size is None:
|
| 280 |
+
if sizeof(c_wchar) == 2:
|
| 281 |
+
# UTF-16 requires a surrogate pair (2 wchar_t) for non-BMP
|
| 282 |
+
# characters (outside [U+0000; U+FFFF] range). +1 for trailing
|
| 283 |
+
# NUL character.
|
| 284 |
+
size = sum(2 if ord(c) > 0xFFFF else 1 for c in init) + 1
|
| 285 |
+
else:
|
| 286 |
+
# 32-bit wchar_t (1 wchar_t per Unicode character). +1 for
|
| 287 |
+
# trailing NUL character.
|
| 288 |
+
size = len(init) + 1
|
| 289 |
+
_sys.audit("ctypes.create_unicode_buffer", init, size)
|
| 290 |
+
buftype = c_wchar * size
|
| 291 |
+
buf = buftype()
|
| 292 |
+
buf.value = init
|
| 293 |
+
return buf
|
| 294 |
+
elif isinstance(init, int):
|
| 295 |
+
_sys.audit("ctypes.create_unicode_buffer", None, init)
|
| 296 |
+
buftype = c_wchar * init
|
| 297 |
+
buf = buftype()
|
| 298 |
+
return buf
|
| 299 |
+
raise TypeError(init)
|
| 300 |
+
|
| 301 |
+
|
| 302 |
+
# XXX Deprecated
|
| 303 |
+
def SetPointerType(pointer, cls):
|
| 304 |
+
if _pointer_type_cache.get(cls, None) is not None:
|
| 305 |
+
raise RuntimeError("This type already exists in the cache")
|
| 306 |
+
if id(pointer) not in _pointer_type_cache:
|
| 307 |
+
raise RuntimeError("What's this???")
|
| 308 |
+
pointer.set_type(cls)
|
| 309 |
+
_pointer_type_cache[cls] = pointer
|
| 310 |
+
del _pointer_type_cache[id(pointer)]
|
| 311 |
+
|
| 312 |
+
# XXX Deprecated
|
| 313 |
+
def ARRAY(typ, len):
|
| 314 |
+
return typ * len
|
| 315 |
+
|
| 316 |
+
################################################################
|
| 317 |
+
|
| 318 |
+
|
| 319 |
+
class CDLL(object):
|
| 320 |
+
"""An instance of this class represents a loaded dll/shared
|
| 321 |
+
library, exporting functions using the standard C calling
|
| 322 |
+
convention (named 'cdecl' on Windows).
|
| 323 |
+
|
| 324 |
+
The exported functions can be accessed as attributes, or by
|
| 325 |
+
indexing with the function name. Examples:
|
| 326 |
+
|
| 327 |
+
<obj>.qsort -> callable object
|
| 328 |
+
<obj>['qsort'] -> callable object
|
| 329 |
+
|
| 330 |
+
Calling the functions releases the Python GIL during the call and
|
| 331 |
+
reacquires it afterwards.
|
| 332 |
+
"""
|
| 333 |
+
_func_flags_ = _FUNCFLAG_CDECL
|
| 334 |
+
_func_restype_ = c_int
|
| 335 |
+
# default values for repr
|
| 336 |
+
_name = '<uninitialized>'
|
| 337 |
+
_handle = 0
|
| 338 |
+
_FuncPtr = None
|
| 339 |
+
|
| 340 |
+
def __init__(self, name, mode=DEFAULT_MODE, handle=None,
|
| 341 |
+
use_errno=False,
|
| 342 |
+
use_last_error=False,
|
| 343 |
+
winmode=None):
|
| 344 |
+
self._name = name
|
| 345 |
+
flags = self._func_flags_
|
| 346 |
+
if use_errno:
|
| 347 |
+
flags |= _FUNCFLAG_USE_ERRNO
|
| 348 |
+
if use_last_error:
|
| 349 |
+
flags |= _FUNCFLAG_USE_LASTERROR
|
| 350 |
+
if _sys.platform.startswith("aix"):
|
| 351 |
+
"""When the name contains ".a(" and ends with ")",
|
| 352 |
+
e.g., "libFOO.a(libFOO.so)" - this is taken to be an
|
| 353 |
+
archive(member) syntax for dlopen(), and the mode is adjusted.
|
| 354 |
+
Otherwise, name is presented to dlopen() as a file argument.
|
| 355 |
+
"""
|
| 356 |
+
if name and name.endswith(")") and ".a(" in name:
|
| 357 |
+
mode |= ( _os.RTLD_MEMBER | _os.RTLD_NOW )
|
| 358 |
+
if _os.name == "nt":
|
| 359 |
+
if winmode is not None:
|
| 360 |
+
mode = winmode
|
| 361 |
+
else:
|
| 362 |
+
import nt
|
| 363 |
+
mode = nt._LOAD_LIBRARY_SEARCH_DEFAULT_DIRS
|
| 364 |
+
if '/' in name or '\\' in name:
|
| 365 |
+
self._name = nt._getfullpathname(self._name)
|
| 366 |
+
mode |= nt._LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR
|
| 367 |
+
|
| 368 |
+
class _FuncPtr(_CFuncPtr):
|
| 369 |
+
_flags_ = flags
|
| 370 |
+
_restype_ = self._func_restype_
|
| 371 |
+
self._FuncPtr = _FuncPtr
|
| 372 |
+
|
| 373 |
+
if handle is None:
|
| 374 |
+
self._handle = _dlopen(self._name, mode)
|
| 375 |
+
else:
|
| 376 |
+
self._handle = handle
|
| 377 |
+
|
| 378 |
+
def __repr__(self):
|
| 379 |
+
return "<%s '%s', handle %x at %#x>" % \
|
| 380 |
+
(self.__class__.__name__, self._name,
|
| 381 |
+
(self._handle & (_sys.maxsize*2 + 1)),
|
| 382 |
+
id(self) & (_sys.maxsize*2 + 1))
|
| 383 |
+
|
| 384 |
+
def __getattr__(self, name):
|
| 385 |
+
if name.startswith('__') and name.endswith('__'):
|
| 386 |
+
raise AttributeError(name)
|
| 387 |
+
func = self.__getitem__(name)
|
| 388 |
+
setattr(self, name, func)
|
| 389 |
+
return func
|
| 390 |
+
|
| 391 |
+
def __getitem__(self, name_or_ordinal):
|
| 392 |
+
func = self._FuncPtr((name_or_ordinal, self))
|
| 393 |
+
if not isinstance(name_or_ordinal, int):
|
| 394 |
+
func.__name__ = name_or_ordinal
|
| 395 |
+
return func
|
| 396 |
+
|
| 397 |
+
class PyDLL(CDLL):
|
| 398 |
+
"""This class represents the Python library itself. It allows
|
| 399 |
+
accessing Python API functions. The GIL is not released, and
|
| 400 |
+
Python exceptions are handled correctly.
|
| 401 |
+
"""
|
| 402 |
+
_func_flags_ = _FUNCFLAG_CDECL | _FUNCFLAG_PYTHONAPI
|
| 403 |
+
|
| 404 |
+
if _os.name == "nt":
|
| 405 |
+
|
| 406 |
+
class WinDLL(CDLL):
|
| 407 |
+
"""This class represents a dll exporting functions using the
|
| 408 |
+
Windows stdcall calling convention.
|
| 409 |
+
"""
|
| 410 |
+
_func_flags_ = _FUNCFLAG_STDCALL
|
| 411 |
+
|
| 412 |
+
# XXX Hm, what about HRESULT as normal parameter?
|
| 413 |
+
# Mustn't it derive from c_long then?
|
| 414 |
+
from _ctypes import _check_HRESULT, _SimpleCData
|
| 415 |
+
class HRESULT(_SimpleCData):
|
| 416 |
+
_type_ = "l"
|
| 417 |
+
# _check_retval_ is called with the function's result when it
|
| 418 |
+
# is used as restype. It checks for the FAILED bit, and
|
| 419 |
+
# raises an OSError if it is set.
|
| 420 |
+
#
|
| 421 |
+
# The _check_retval_ method is implemented in C, so that the
|
| 422 |
+
# method definition itself is not included in the traceback
|
| 423 |
+
# when it raises an error - that is what we want (and Python
|
| 424 |
+
# doesn't have a way to raise an exception in the caller's
|
| 425 |
+
# frame).
|
| 426 |
+
_check_retval_ = _check_HRESULT
|
| 427 |
+
|
| 428 |
+
class OleDLL(CDLL):
|
| 429 |
+
"""This class represents a dll exporting functions using the
|
| 430 |
+
Windows stdcall calling convention, and returning HRESULT.
|
| 431 |
+
HRESULT error values are automatically raised as OSError
|
| 432 |
+
exceptions.
|
| 433 |
+
"""
|
| 434 |
+
_func_flags_ = _FUNCFLAG_STDCALL
|
| 435 |
+
_func_restype_ = HRESULT
|
| 436 |
+
|
| 437 |
+
class LibraryLoader(object):
|
| 438 |
+
def __init__(self, dlltype):
|
| 439 |
+
self._dlltype = dlltype
|
| 440 |
+
|
| 441 |
+
def __getattr__(self, name):
|
| 442 |
+
if name[0] == '_':
|
| 443 |
+
raise AttributeError(name)
|
| 444 |
+
dll = self._dlltype(name)
|
| 445 |
+
setattr(self, name, dll)
|
| 446 |
+
return dll
|
| 447 |
+
|
| 448 |
+
def __getitem__(self, name):
|
| 449 |
+
return getattr(self, name)
|
| 450 |
+
|
| 451 |
+
def LoadLibrary(self, name):
|
| 452 |
+
return self._dlltype(name)
|
| 453 |
+
|
| 454 |
+
__class_getitem__ = classmethod(_types.GenericAlias)
|
| 455 |
+
|
| 456 |
+
cdll = LibraryLoader(CDLL)
|
| 457 |
+
pydll = LibraryLoader(PyDLL)
|
| 458 |
+
|
| 459 |
+
if _os.name == "nt":
|
| 460 |
+
pythonapi = PyDLL("python dll", None, _sys.dllhandle)
|
| 461 |
+
elif _sys.platform == "cygwin":
|
| 462 |
+
pythonapi = PyDLL("libpython%d.%d.dll" % _sys.version_info[:2])
|
| 463 |
+
else:
|
| 464 |
+
pythonapi = PyDLL(None)
|
| 465 |
+
|
| 466 |
+
|
| 467 |
+
if _os.name == "nt":
|
| 468 |
+
windll = LibraryLoader(WinDLL)
|
| 469 |
+
oledll = LibraryLoader(OleDLL)
|
| 470 |
+
|
| 471 |
+
GetLastError = windll.kernel32.GetLastError
|
| 472 |
+
from _ctypes import get_last_error, set_last_error
|
| 473 |
+
|
| 474 |
+
def WinError(code=None, descr=None):
|
| 475 |
+
if code is None:
|
| 476 |
+
code = GetLastError()
|
| 477 |
+
if descr is None:
|
| 478 |
+
descr = FormatError(code).strip()
|
| 479 |
+
return OSError(None, descr, None, code)
|
| 480 |
+
|
| 481 |
+
if sizeof(c_uint) == sizeof(c_void_p):
|
| 482 |
+
c_size_t = c_uint
|
| 483 |
+
c_ssize_t = c_int
|
| 484 |
+
elif sizeof(c_ulong) == sizeof(c_void_p):
|
| 485 |
+
c_size_t = c_ulong
|
| 486 |
+
c_ssize_t = c_long
|
| 487 |
+
elif sizeof(c_ulonglong) == sizeof(c_void_p):
|
| 488 |
+
c_size_t = c_ulonglong
|
| 489 |
+
c_ssize_t = c_longlong
|
| 490 |
+
|
| 491 |
+
# functions
|
| 492 |
+
|
| 493 |
+
from _ctypes import _memmove_addr, _memset_addr, _string_at_addr, _cast_addr
|
| 494 |
+
|
| 495 |
+
## void *memmove(void *, const void *, size_t);
|
| 496 |
+
memmove = CFUNCTYPE(c_void_p, c_void_p, c_void_p, c_size_t)(_memmove_addr)
|
| 497 |
+
|
| 498 |
+
## void *memset(void *, int, size_t)
|
| 499 |
+
memset = CFUNCTYPE(c_void_p, c_void_p, c_int, c_size_t)(_memset_addr)
|
| 500 |
+
|
| 501 |
+
def PYFUNCTYPE(restype, *argtypes):
|
| 502 |
+
class CFunctionType(_CFuncPtr):
|
| 503 |
+
_argtypes_ = argtypes
|
| 504 |
+
_restype_ = restype
|
| 505 |
+
_flags_ = _FUNCFLAG_CDECL | _FUNCFLAG_PYTHONAPI
|
| 506 |
+
return CFunctionType
|
| 507 |
+
|
| 508 |
+
_cast = PYFUNCTYPE(py_object, c_void_p, py_object, py_object)(_cast_addr)
|
| 509 |
+
def cast(obj, typ):
|
| 510 |
+
return _cast(obj, obj, typ)
|
| 511 |
+
|
| 512 |
+
_string_at = PYFUNCTYPE(py_object, c_void_p, c_int)(_string_at_addr)
|
| 513 |
+
def string_at(ptr, size=-1):
|
| 514 |
+
"""string_at(addr[, size]) -> string
|
| 515 |
+
|
| 516 |
+
Return the string at addr."""
|
| 517 |
+
return _string_at(ptr, size)
|
| 518 |
+
|
| 519 |
+
try:
|
| 520 |
+
from _ctypes import _wstring_at_addr
|
| 521 |
+
except ImportError:
|
| 522 |
+
pass
|
| 523 |
+
else:
|
| 524 |
+
_wstring_at = PYFUNCTYPE(py_object, c_void_p, c_int)(_wstring_at_addr)
|
| 525 |
+
def wstring_at(ptr, size=-1):
|
| 526 |
+
"""wstring_at(addr[, size]) -> string
|
| 527 |
+
|
| 528 |
+
Return the string at addr."""
|
| 529 |
+
return _wstring_at(ptr, size)
|
| 530 |
+
|
| 531 |
+
|
| 532 |
+
if _os.name == "nt": # COM stuff
|
| 533 |
+
def DllGetClassObject(rclsid, riid, ppv):
|
| 534 |
+
try:
|
| 535 |
+
ccom = __import__("comtypes.server.inprocserver", globals(), locals(), ['*'])
|
| 536 |
+
except ImportError:
|
| 537 |
+
return -2147221231 # CLASS_E_CLASSNOTAVAILABLE
|
| 538 |
+
else:
|
| 539 |
+
return ccom.DllGetClassObject(rclsid, riid, ppv)
|
| 540 |
+
|
| 541 |
+
def DllCanUnloadNow():
|
| 542 |
+
try:
|
| 543 |
+
ccom = __import__("comtypes.server.inprocserver", globals(), locals(), ['*'])
|
| 544 |
+
except ImportError:
|
| 545 |
+
return 0 # S_OK
|
| 546 |
+
return ccom.DllCanUnloadNow()
|
| 547 |
+
|
| 548 |
+
from ctypes._endian import BigEndianStructure, LittleEndianStructure
|
| 549 |
+
|
| 550 |
+
# Fill in specifically-sized types
|
| 551 |
+
c_int8 = c_byte
|
| 552 |
+
c_uint8 = c_ubyte
|
| 553 |
+
for kind in [c_short, c_int, c_long, c_longlong]:
|
| 554 |
+
if sizeof(kind) == 2: c_int16 = kind
|
| 555 |
+
elif sizeof(kind) == 4: c_int32 = kind
|
| 556 |
+
elif sizeof(kind) == 8: c_int64 = kind
|
| 557 |
+
for kind in [c_ushort, c_uint, c_ulong, c_ulonglong]:
|
| 558 |
+
if sizeof(kind) == 2: c_uint16 = kind
|
| 559 |
+
elif sizeof(kind) == 4: c_uint32 = kind
|
| 560 |
+
elif sizeof(kind) == 8: c_uint64 = kind
|
| 561 |
+
del(kind)
|
| 562 |
+
|
| 563 |
+
_reset_cache()
|
janus/lib/python3.10/ctypes/__pycache__/_aix.cpython-310.pyc
ADDED
|
Binary file (9.87 kB). View file
|
|
|
janus/lib/python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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
Lib/ctypes.util.find_library() support for AIX
|
| 3 |
+
Similar approach as done for Darwin support by using separate files
|
| 4 |
+
but unlike Darwin - no extension such as ctypes.macholib.*
|
| 5 |
+
|
| 6 |
+
dlopen() is an interface to AIX initAndLoad() - primary documentation at:
|
| 7 |
+
https://www.ibm.com/support/knowledgecenter/en/ssw_aix_61/com.ibm.aix.basetrf1/dlopen.htm
|
| 8 |
+
https://www.ibm.com/support/knowledgecenter/en/ssw_aix_61/com.ibm.aix.basetrf1/load.htm
|
| 9 |
+
|
| 10 |
+
AIX supports two styles for dlopen(): svr4 (System V Release 4) which is common on posix
|
| 11 |
+
platforms, but also a BSD style - aka SVR3.
|
| 12 |
+
|
| 13 |
+
From AIX 5.3 Difference Addendum (December 2004)
|
| 14 |
+
2.9 SVR4 linking affinity
|
| 15 |
+
Nowadays, there are two major object file formats used by the operating systems:
|
| 16 |
+
XCOFF: The COFF enhanced by IBM and others. The original COFF (Common
|
| 17 |
+
Object File Format) was the base of SVR3 and BSD 4.2 systems.
|
| 18 |
+
ELF: Executable and Linking Format that was developed by AT&T and is a
|
| 19 |
+
base for SVR4 UNIX.
|
| 20 |
+
|
| 21 |
+
While the shared library content is identical on AIX - one is located as a filepath name
|
| 22 |
+
(svr4 style) and the other is located as a member of an archive (and the archive
|
| 23 |
+
is located as a filepath name).
|
| 24 |
+
|
| 25 |
+
The key difference arises when supporting multiple abi formats (i.e., 32 and 64 bit).
|
| 26 |
+
For svr4 either only one ABI is supported, or there are two directories, or there
|
| 27 |
+
are different file names. The most common solution for multiple ABI is multiple
|
| 28 |
+
directories.
|
| 29 |
+
|
| 30 |
+
For the XCOFF (aka AIX) style - one directory (one archive file) is sufficient
|
| 31 |
+
as multiple shared libraries can be in the archive - even sharing the same name.
|
| 32 |
+
In documentation the archive is also referred to as the "base" and the shared
|
| 33 |
+
library object is referred to as the "member".
|
| 34 |
+
|
| 35 |
+
For dlopen() on AIX (read initAndLoad()) the calls are similar.
|
| 36 |
+
Default activity occurs when no path information is provided. When path
|
| 37 |
+
information is provided dlopen() does not search any other directories.
|
| 38 |
+
|
| 39 |
+
For SVR4 - the shared library name is the name of the file expected: libFOO.so
|
| 40 |
+
For AIX - the shared library is expressed as base(member). The search is for the
|
| 41 |
+
base (e.g., libFOO.a) and once the base is found the shared library - identified by
|
| 42 |
+
member (e.g., libFOO.so, or shr.o) is located and loaded.
|
| 43 |
+
|
| 44 |
+
The mode bit RTLD_MEMBER tells initAndLoad() that it needs to use the AIX (SVR3)
|
| 45 |
+
naming style.
|
| 46 |
+
"""
|
| 47 |
+
__author__ = "Michael Felt <[email protected]>"
|
| 48 |
+
|
| 49 |
+
import re
|
| 50 |
+
from os import environ, path
|
| 51 |
+
from sys import executable
|
| 52 |
+
from ctypes import c_void_p, sizeof
|
| 53 |
+
from subprocess import Popen, PIPE, DEVNULL
|
| 54 |
+
|
| 55 |
+
# Executable bit size - 32 or 64
|
| 56 |
+
# Used to filter the search in an archive by size, e.g., -X64
|
| 57 |
+
AIX_ABI = sizeof(c_void_p) * 8
|
| 58 |
+
|
| 59 |
+
|
| 60 |
+
from sys import maxsize
|
| 61 |
+
def _last_version(libnames, sep):
|
| 62 |
+
def _num_version(libname):
|
| 63 |
+
# "libxyz.so.MAJOR.MINOR" => [MAJOR, MINOR]
|
| 64 |
+
parts = libname.split(sep)
|
| 65 |
+
nums = []
|
| 66 |
+
try:
|
| 67 |
+
while parts:
|
| 68 |
+
nums.insert(0, int(parts.pop()))
|
| 69 |
+
except ValueError:
|
| 70 |
+
pass
|
| 71 |
+
return nums or [maxsize]
|
| 72 |
+
return max(reversed(libnames), key=_num_version)
|
| 73 |
+
|
| 74 |
+
def get_ld_header(p):
|
| 75 |
+
# "nested-function, but placed at module level
|
| 76 |
+
ld_header = None
|
| 77 |
+
for line in p.stdout:
|
| 78 |
+
if line.startswith(('/', './', '../')):
|
| 79 |
+
ld_header = line
|
| 80 |
+
elif "INDEX" in line:
|
| 81 |
+
return ld_header.rstrip('\n')
|
| 82 |
+
return None
|
| 83 |
+
|
| 84 |
+
def get_ld_header_info(p):
|
| 85 |
+
# "nested-function, but placed at module level
|
| 86 |
+
# as an ld_header was found, return known paths, archives and members
|
| 87 |
+
# these lines start with a digit
|
| 88 |
+
info = []
|
| 89 |
+
for line in p.stdout:
|
| 90 |
+
if re.match("[0-9]", line):
|
| 91 |
+
info.append(line)
|
| 92 |
+
else:
|
| 93 |
+
# blank line (separator), consume line and end for loop
|
| 94 |
+
break
|
| 95 |
+
return info
|
| 96 |
+
|
| 97 |
+
def get_ld_headers(file):
|
| 98 |
+
"""
|
| 99 |
+
Parse the header of the loader section of executable and archives
|
| 100 |
+
This function calls /usr/bin/dump -H as a subprocess
|
| 101 |
+
and returns a list of (ld_header, ld_header_info) tuples.
|
| 102 |
+
"""
|
| 103 |
+
# get_ld_headers parsing:
|
| 104 |
+
# 1. Find a line that starts with /, ./, or ../ - set as ld_header
|
| 105 |
+
# 2. If "INDEX" in occurs in a following line - return ld_header
|
| 106 |
+
# 3. get info (lines starting with [0-9])
|
| 107 |
+
ldr_headers = []
|
| 108 |
+
p = Popen(["/usr/bin/dump", f"-X{AIX_ABI}", "-H", file],
|
| 109 |
+
universal_newlines=True, stdout=PIPE, stderr=DEVNULL)
|
| 110 |
+
# be sure to read to the end-of-file - getting all entries
|
| 111 |
+
while True:
|
| 112 |
+
ld_header = get_ld_header(p)
|
| 113 |
+
if ld_header:
|
| 114 |
+
ldr_headers.append((ld_header, get_ld_header_info(p)))
|
| 115 |
+
else:
|
| 116 |
+
break
|
| 117 |
+
p.stdout.close()
|
| 118 |
+
p.wait()
|
| 119 |
+
return ldr_headers
|
| 120 |
+
|
| 121 |
+
def get_shared(ld_headers):
|
| 122 |
+
"""
|
| 123 |
+
extract the shareable objects from ld_headers
|
| 124 |
+
character "[" is used to strip off the path information.
|
| 125 |
+
Note: the "[" and "]" characters that are part of dump -H output
|
| 126 |
+
are not removed here.
|
| 127 |
+
"""
|
| 128 |
+
shared = []
|
| 129 |
+
for (line, _) in ld_headers:
|
| 130 |
+
# potential member lines contain "["
|
| 131 |
+
# otherwise, no processing needed
|
| 132 |
+
if "[" in line:
|
| 133 |
+
# Strip off trailing colon (:)
|
| 134 |
+
shared.append(line[line.index("["):-1])
|
| 135 |
+
return shared
|
| 136 |
+
|
| 137 |
+
def get_one_match(expr, lines):
|
| 138 |
+
"""
|
| 139 |
+
Must be only one match, otherwise result is None.
|
| 140 |
+
When there is a match, strip leading "[" and trailing "]"
|
| 141 |
+
"""
|
| 142 |
+
# member names in the ld_headers output are between square brackets
|
| 143 |
+
expr = rf'\[({expr})\]'
|
| 144 |
+
matches = list(filter(None, (re.search(expr, line) for line in lines)))
|
| 145 |
+
if len(matches) == 1:
|
| 146 |
+
return matches[0].group(1)
|
| 147 |
+
else:
|
| 148 |
+
return None
|
| 149 |
+
|
| 150 |
+
# additional processing to deal with AIX legacy names for 64-bit members
|
| 151 |
+
def get_legacy(members):
|
| 152 |
+
"""
|
| 153 |
+
This routine provides historical aka legacy naming schemes started
|
| 154 |
+
in AIX4 shared library support for library members names.
|
| 155 |
+
e.g., in /usr/lib/libc.a the member name shr.o for 32-bit binary and
|
| 156 |
+
shr_64.o for 64-bit binary.
|
| 157 |
+
"""
|
| 158 |
+
if AIX_ABI == 64:
|
| 159 |
+
# AIX 64-bit member is one of shr64.o, shr_64.o, or shr4_64.o
|
| 160 |
+
expr = r'shr4?_?64\.o'
|
| 161 |
+
member = get_one_match(expr, members)
|
| 162 |
+
if member:
|
| 163 |
+
return member
|
| 164 |
+
else:
|
| 165 |
+
# 32-bit legacy names - both shr.o and shr4.o exist.
|
| 166 |
+
# shr.o is the preferred name so we look for shr.o first
|
| 167 |
+
# i.e., shr4.o is returned only when shr.o does not exist
|
| 168 |
+
for name in ['shr.o', 'shr4.o']:
|
| 169 |
+
member = get_one_match(re.escape(name), members)
|
| 170 |
+
if member:
|
| 171 |
+
return member
|
| 172 |
+
return None
|
| 173 |
+
|
| 174 |
+
def get_version(name, members):
|
| 175 |
+
"""
|
| 176 |
+
Sort list of members and return highest numbered version - if it exists.
|
| 177 |
+
This function is called when an unversioned libFOO.a(libFOO.so) has
|
| 178 |
+
not been found.
|
| 179 |
+
|
| 180 |
+
Versioning for the member name is expected to follow
|
| 181 |
+
GNU LIBTOOL conventions: the highest version (x, then X.y, then X.Y.z)
|
| 182 |
+
* find [libFoo.so.X]
|
| 183 |
+
* find [libFoo.so.X.Y]
|
| 184 |
+
* find [libFoo.so.X.Y.Z]
|
| 185 |
+
|
| 186 |
+
Before the GNU convention became the standard scheme regardless of
|
| 187 |
+
binary size AIX packagers used GNU convention "as-is" for 32-bit
|
| 188 |
+
archive members but used an "distinguishing" name for 64-bit members.
|
| 189 |
+
This scheme inserted either 64 or _64 between libFOO and .so
|
| 190 |
+
- generally libFOO_64.so, but occasionally libFOO64.so
|
| 191 |
+
"""
|
| 192 |
+
# the expression ending for versions must start as
|
| 193 |
+
# '.so.[0-9]', i.e., *.so.[at least one digit]
|
| 194 |
+
# while multiple, more specific expressions could be specified
|
| 195 |
+
# to search for .so.X, .so.X.Y and .so.X.Y.Z
|
| 196 |
+
# after the first required 'dot' digit
|
| 197 |
+
# any combination of additional 'dot' digits pairs are accepted
|
| 198 |
+
# anything more than libFOO.so.digits.digits.digits
|
| 199 |
+
# should be seen as a member name outside normal expectations
|
| 200 |
+
exprs = [rf'lib{name}\.so\.[0-9]+[0-9.]*',
|
| 201 |
+
rf'lib{name}_?64\.so\.[0-9]+[0-9.]*']
|
| 202 |
+
for expr in exprs:
|
| 203 |
+
versions = []
|
| 204 |
+
for line in members:
|
| 205 |
+
m = re.search(expr, line)
|
| 206 |
+
if m:
|
| 207 |
+
versions.append(m.group(0))
|
| 208 |
+
if versions:
|
| 209 |
+
return _last_version(versions, '.')
|
| 210 |
+
return None
|
| 211 |
+
|
| 212 |
+
def get_member(name, members):
|
| 213 |
+
"""
|
| 214 |
+
Return an archive member matching the request in name.
|
| 215 |
+
Name is the library name without any prefix like lib, suffix like .so,
|
| 216 |
+
or version number.
|
| 217 |
+
Given a list of members find and return the most appropriate result
|
| 218 |
+
Priority is given to generic libXXX.so, then a versioned libXXX.so.a.b.c
|
| 219 |
+
and finally, legacy AIX naming scheme.
|
| 220 |
+
"""
|
| 221 |
+
# look first for a generic match - prepend lib and append .so
|
| 222 |
+
expr = rf'lib{name}\.so'
|
| 223 |
+
member = get_one_match(expr, members)
|
| 224 |
+
if member:
|
| 225 |
+
return member
|
| 226 |
+
elif AIX_ABI == 64:
|
| 227 |
+
expr = rf'lib{name}64\.so'
|
| 228 |
+
member = get_one_match(expr, members)
|
| 229 |
+
if member:
|
| 230 |
+
return member
|
| 231 |
+
# since an exact match with .so as suffix was not found
|
| 232 |
+
# look for a versioned name
|
| 233 |
+
# If a versioned name is not found, look for AIX legacy member name
|
| 234 |
+
member = get_version(name, members)
|
| 235 |
+
if member:
|
| 236 |
+
return member
|
| 237 |
+
else:
|
| 238 |
+
return get_legacy(members)
|
| 239 |
+
|
| 240 |
+
def get_libpaths():
|
| 241 |
+
"""
|
| 242 |
+
On AIX, the buildtime searchpath is stored in the executable.
|
| 243 |
+
as "loader header information".
|
| 244 |
+
The command /usr/bin/dump -H extracts this info.
|
| 245 |
+
Prefix searched libraries with LD_LIBRARY_PATH (preferred),
|
| 246 |
+
or LIBPATH if defined. These paths are appended to the paths
|
| 247 |
+
to libraries the python executable is linked with.
|
| 248 |
+
This mimics AIX dlopen() behavior.
|
| 249 |
+
"""
|
| 250 |
+
libpaths = environ.get("LD_LIBRARY_PATH")
|
| 251 |
+
if libpaths is None:
|
| 252 |
+
libpaths = environ.get("LIBPATH")
|
| 253 |
+
if libpaths is None:
|
| 254 |
+
libpaths = []
|
| 255 |
+
else:
|
| 256 |
+
libpaths = libpaths.split(":")
|
| 257 |
+
objects = get_ld_headers(executable)
|
| 258 |
+
for (_, lines) in objects:
|
| 259 |
+
for line in lines:
|
| 260 |
+
# the second (optional) argument is PATH if it includes a /
|
| 261 |
+
path = line.split()[1]
|
| 262 |
+
if "/" in path:
|
| 263 |
+
libpaths.extend(path.split(":"))
|
| 264 |
+
return libpaths
|
| 265 |
+
|
| 266 |
+
def find_shared(paths, name):
|
| 267 |
+
"""
|
| 268 |
+
paths is a list of directories to search for an archive.
|
| 269 |
+
name is the abbreviated name given to find_library().
|
| 270 |
+
Process: search "paths" for archive, and if an archive is found
|
| 271 |
+
return the result of get_member().
|
| 272 |
+
If an archive is not found then return None
|
| 273 |
+
"""
|
| 274 |
+
for dir in paths:
|
| 275 |
+
# /lib is a symbolic link to /usr/lib, skip it
|
| 276 |
+
if dir == "/lib":
|
| 277 |
+
continue
|
| 278 |
+
# "lib" is prefixed to emulate compiler name resolution,
|
| 279 |
+
# e.g., -lc to libc
|
| 280 |
+
base = f'lib{name}.a'
|
| 281 |
+
archive = path.join(dir, base)
|
| 282 |
+
if path.exists(archive):
|
| 283 |
+
members = get_shared(get_ld_headers(archive))
|
| 284 |
+
member = get_member(re.escape(name), members)
|
| 285 |
+
if member is not None:
|
| 286 |
+
return (base, member)
|
| 287 |
+
else:
|
| 288 |
+
return (None, None)
|
| 289 |
+
return (None, None)
|
| 290 |
+
|
| 291 |
+
def find_library(name):
|
| 292 |
+
"""AIX implementation of ctypes.util.find_library()
|
| 293 |
+
Find an archive member that will dlopen(). If not available,
|
| 294 |
+
also search for a file (or link) with a .so suffix.
|
| 295 |
+
|
| 296 |
+
AIX supports two types of schemes that can be used with dlopen().
|
| 297 |
+
The so-called SystemV Release4 (svr4) format is commonly suffixed
|
| 298 |
+
with .so while the (default) AIX scheme has the library (archive)
|
| 299 |
+
ending with the suffix .a
|
| 300 |
+
As an archive has multiple members (e.g., 32-bit and 64-bit) in one file
|
| 301 |
+
the argument passed to dlopen must include both the library and
|
| 302 |
+
the member names in a single string.
|
| 303 |
+
|
| 304 |
+
find_library() looks first for an archive (.a) with a suitable member.
|
| 305 |
+
If no archive+member pair is found, look for a .so file.
|
| 306 |
+
"""
|
| 307 |
+
|
| 308 |
+
libpaths = get_libpaths()
|
| 309 |
+
(base, member) = find_shared(libpaths, name)
|
| 310 |
+
if base is not None:
|
| 311 |
+
return f"{base}({member})"
|
| 312 |
+
|
| 313 |
+
# To get here, a member in an archive has not been found
|
| 314 |
+
# In other words, either:
|
| 315 |
+
# a) a .a file was not found
|
| 316 |
+
# b) a .a file did not have a suitable member
|
| 317 |
+
# So, look for a .so file
|
| 318 |
+
# Check libpaths for .so file
|
| 319 |
+
# Note, the installation must prepare a link from a .so
|
| 320 |
+
# to a versioned file
|
| 321 |
+
# This is common practice by GNU libtool on other platforms
|
| 322 |
+
soname = f"lib{name}.so"
|
| 323 |
+
for dir in libpaths:
|
| 324 |
+
# /lib is a symbolic link to /usr/lib, skip it
|
| 325 |
+
if dir == "/lib":
|
| 326 |
+
continue
|
| 327 |
+
shlib = path.join(dir, soname)
|
| 328 |
+
if path.exists(shlib):
|
| 329 |
+
return soname
|
| 330 |
+
# if we are here, we have not found anything plausible
|
| 331 |
+
return None
|
janus/lib/python3.10/ctypes/_endian.py
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import sys
|
| 2 |
+
from ctypes import *
|
| 3 |
+
|
| 4 |
+
_array_type = type(Array)
|
| 5 |
+
|
| 6 |
+
def _other_endian(typ):
|
| 7 |
+
"""Return the type with the 'other' byte order. Simple types like
|
| 8 |
+
c_int and so on already have __ctype_be__ and __ctype_le__
|
| 9 |
+
attributes which contain the types, for more complicated types
|
| 10 |
+
arrays and structures are supported.
|
| 11 |
+
"""
|
| 12 |
+
# check _OTHER_ENDIAN attribute (present if typ is primitive type)
|
| 13 |
+
if hasattr(typ, _OTHER_ENDIAN):
|
| 14 |
+
return getattr(typ, _OTHER_ENDIAN)
|
| 15 |
+
# if typ is array
|
| 16 |
+
if isinstance(typ, _array_type):
|
| 17 |
+
return _other_endian(typ._type_) * typ._length_
|
| 18 |
+
# if typ is structure
|
| 19 |
+
if issubclass(typ, Structure):
|
| 20 |
+
return typ
|
| 21 |
+
raise TypeError("This type does not support other endian: %s" % typ)
|
| 22 |
+
|
| 23 |
+
class _swapped_meta(type(Structure)):
|
| 24 |
+
def __setattr__(self, attrname, value):
|
| 25 |
+
if attrname == "_fields_":
|
| 26 |
+
fields = []
|
| 27 |
+
for desc in value:
|
| 28 |
+
name = desc[0]
|
| 29 |
+
typ = desc[1]
|
| 30 |
+
rest = desc[2:]
|
| 31 |
+
fields.append((name, _other_endian(typ)) + rest)
|
| 32 |
+
value = fields
|
| 33 |
+
super().__setattr__(attrname, value)
|
| 34 |
+
|
| 35 |
+
################################################################
|
| 36 |
+
|
| 37 |
+
# Note: The Structure metaclass checks for the *presence* (not the
|
| 38 |
+
# value!) of a _swapped_bytes_ attribute to determine the bit order in
|
| 39 |
+
# structures containing bit fields.
|
| 40 |
+
|
| 41 |
+
if sys.byteorder == "little":
|
| 42 |
+
_OTHER_ENDIAN = "__ctype_be__"
|
| 43 |
+
|
| 44 |
+
LittleEndianStructure = Structure
|
| 45 |
+
|
| 46 |
+
class BigEndianStructure(Structure, metaclass=_swapped_meta):
|
| 47 |
+
"""Structure with big endian byte order"""
|
| 48 |
+
__slots__ = ()
|
| 49 |
+
_swappedbytes_ = None
|
| 50 |
+
|
| 51 |
+
elif sys.byteorder == "big":
|
| 52 |
+
_OTHER_ENDIAN = "__ctype_le__"
|
| 53 |
+
|
| 54 |
+
BigEndianStructure = Structure
|
| 55 |
+
class LittleEndianStructure(Structure, metaclass=_swapped_meta):
|
| 56 |
+
"""Structure with little endian byte order"""
|
| 57 |
+
__slots__ = ()
|
| 58 |
+
_swappedbytes_ = None
|
| 59 |
+
|
| 60 |
+
else:
|
| 61 |
+
raise RuntimeError("Invalid byteorder")
|
janus/lib/python3.10/ctypes/macholib/README.ctypes
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Files in this directory come from Bob Ippolito's py2app.
|
| 2 |
+
|
| 3 |
+
License: Any components of the py2app suite may be distributed under
|
| 4 |
+
the MIT or PSF open source licenses.
|
| 5 |
+
|
| 6 |
+
This is version 1.0, SVN revision 789, from 2006/01/25.
|
| 7 |
+
The main repository is http://svn.red-bean.com/bob/macholib/trunk/macholib/
|
janus/lib/python3.10/ctypes/macholib/__init__.py
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
Enough Mach-O to make your head spin.
|
| 3 |
+
|
| 4 |
+
See the relevant header files in /usr/include/mach-o
|
| 5 |
+
|
| 6 |
+
And also Apple's documentation.
|
| 7 |
+
"""
|
| 8 |
+
|
| 9 |
+
__version__ = '1.0'
|
janus/lib/python3.10/ctypes/macholib/__pycache__/__init__.cpython-310.pyc
ADDED
|
Binary file (297 Bytes). View file
|
|
|
janus/lib/python3.10/ctypes/macholib/__pycache__/dyld.cpython-310.pyc
ADDED
|
Binary file (4.69 kB). View file
|
|
|
janus/lib/python3.10/ctypes/macholib/__pycache__/dylib.cpython-310.pyc
ADDED
|
Binary file (2.16 kB). View file
|
|
|
janus/lib/python3.10/ctypes/macholib/__pycache__/framework.cpython-310.pyc
ADDED
|
Binary file (2.44 kB). View file
|
|
|
janus/lib/python3.10/ctypes/macholib/dyld.py
ADDED
|
@@ -0,0 +1,177 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
dyld emulation
|
| 3 |
+
"""
|
| 4 |
+
|
| 5 |
+
import os
|
| 6 |
+
from ctypes.macholib.framework import framework_info
|
| 7 |
+
from ctypes.macholib.dylib import dylib_info
|
| 8 |
+
from itertools import *
|
| 9 |
+
try:
|
| 10 |
+
from _ctypes import _dyld_shared_cache_contains_path
|
| 11 |
+
except ImportError:
|
| 12 |
+
def _dyld_shared_cache_contains_path(*args):
|
| 13 |
+
raise NotImplementedError
|
| 14 |
+
|
| 15 |
+
__all__ = [
|
| 16 |
+
'dyld_find', 'framework_find',
|
| 17 |
+
'framework_info', 'dylib_info',
|
| 18 |
+
]
|
| 19 |
+
|
| 20 |
+
# These are the defaults as per man dyld(1)
|
| 21 |
+
#
|
| 22 |
+
DEFAULT_FRAMEWORK_FALLBACK = [
|
| 23 |
+
os.path.expanduser("~/Library/Frameworks"),
|
| 24 |
+
"/Library/Frameworks",
|
| 25 |
+
"/Network/Library/Frameworks",
|
| 26 |
+
"/System/Library/Frameworks",
|
| 27 |
+
]
|
| 28 |
+
|
| 29 |
+
DEFAULT_LIBRARY_FALLBACK = [
|
| 30 |
+
os.path.expanduser("~/lib"),
|
| 31 |
+
"/usr/local/lib",
|
| 32 |
+
"/lib",
|
| 33 |
+
"/usr/lib",
|
| 34 |
+
]
|
| 35 |
+
|
| 36 |
+
def dyld_env(env, var):
|
| 37 |
+
if env is None:
|
| 38 |
+
env = os.environ
|
| 39 |
+
rval = env.get(var)
|
| 40 |
+
if rval is None:
|
| 41 |
+
return []
|
| 42 |
+
return rval.split(':')
|
| 43 |
+
|
| 44 |
+
def dyld_image_suffix(env=None):
|
| 45 |
+
if env is None:
|
| 46 |
+
env = os.environ
|
| 47 |
+
return env.get('DYLD_IMAGE_SUFFIX')
|
| 48 |
+
|
| 49 |
+
def dyld_framework_path(env=None):
|
| 50 |
+
return dyld_env(env, 'DYLD_FRAMEWORK_PATH')
|
| 51 |
+
|
| 52 |
+
def dyld_library_path(env=None):
|
| 53 |
+
return dyld_env(env, 'DYLD_LIBRARY_PATH')
|
| 54 |
+
|
| 55 |
+
def dyld_fallback_framework_path(env=None):
|
| 56 |
+
return dyld_env(env, 'DYLD_FALLBACK_FRAMEWORK_PATH')
|
| 57 |
+
|
| 58 |
+
def dyld_fallback_library_path(env=None):
|
| 59 |
+
return dyld_env(env, 'DYLD_FALLBACK_LIBRARY_PATH')
|
| 60 |
+
|
| 61 |
+
def dyld_image_suffix_search(iterator, env=None):
|
| 62 |
+
"""For a potential path iterator, add DYLD_IMAGE_SUFFIX semantics"""
|
| 63 |
+
suffix = dyld_image_suffix(env)
|
| 64 |
+
if suffix is None:
|
| 65 |
+
return iterator
|
| 66 |
+
def _inject(iterator=iterator, suffix=suffix):
|
| 67 |
+
for path in iterator:
|
| 68 |
+
if path.endswith('.dylib'):
|
| 69 |
+
yield path[:-len('.dylib')] + suffix + '.dylib'
|
| 70 |
+
else:
|
| 71 |
+
yield path + suffix
|
| 72 |
+
yield path
|
| 73 |
+
return _inject()
|
| 74 |
+
|
| 75 |
+
def dyld_override_search(name, env=None):
|
| 76 |
+
# If DYLD_FRAMEWORK_PATH is set and this dylib_name is a
|
| 77 |
+
# framework name, use the first file that exists in the framework
|
| 78 |
+
# path if any. If there is none go on to search the DYLD_LIBRARY_PATH
|
| 79 |
+
# if any.
|
| 80 |
+
|
| 81 |
+
framework = framework_info(name)
|
| 82 |
+
|
| 83 |
+
if framework is not None:
|
| 84 |
+
for path in dyld_framework_path(env):
|
| 85 |
+
yield os.path.join(path, framework['name'])
|
| 86 |
+
|
| 87 |
+
# If DYLD_LIBRARY_PATH is set then use the first file that exists
|
| 88 |
+
# in the path. If none use the original name.
|
| 89 |
+
for path in dyld_library_path(env):
|
| 90 |
+
yield os.path.join(path, os.path.basename(name))
|
| 91 |
+
|
| 92 |
+
def dyld_executable_path_search(name, executable_path=None):
|
| 93 |
+
# If we haven't done any searching and found a library and the
|
| 94 |
+
# dylib_name starts with "@executable_path/" then construct the
|
| 95 |
+
# library name.
|
| 96 |
+
if not executable_path:
|
| 97 |
+
import sys
|
| 98 |
+
if sys.prefix:
|
| 99 |
+
executable_path = os.path.join(sys.prefix, 'bin')
|
| 100 |
+
if name.startswith('@executable_path/') and executable_path is not None:
|
| 101 |
+
yield os.path.join(executable_path, name[len('@executable_path/'):])
|
| 102 |
+
|
| 103 |
+
def dyld_default_search(name, env=None):
|
| 104 |
+
yield name
|
| 105 |
+
|
| 106 |
+
framework = framework_info(name)
|
| 107 |
+
|
| 108 |
+
if framework is not None:
|
| 109 |
+
fallback_framework_path = dyld_fallback_framework_path(env)
|
| 110 |
+
for path in fallback_framework_path:
|
| 111 |
+
yield os.path.join(path, framework['name'])
|
| 112 |
+
|
| 113 |
+
fallback_library_path = dyld_fallback_library_path(env)
|
| 114 |
+
for path in fallback_library_path:
|
| 115 |
+
yield os.path.join(path, os.path.basename(name))
|
| 116 |
+
|
| 117 |
+
if framework is not None and not fallback_framework_path:
|
| 118 |
+
for path in DEFAULT_FRAMEWORK_FALLBACK:
|
| 119 |
+
yield os.path.join(path, framework['name'])
|
| 120 |
+
|
| 121 |
+
if not fallback_library_path:
|
| 122 |
+
for path in DEFAULT_LIBRARY_FALLBACK:
|
| 123 |
+
yield os.path.join(path, os.path.basename(name))
|
| 124 |
+
|
| 125 |
+
def dyld_find(name, executable_path=None, env=None):
|
| 126 |
+
"""
|
| 127 |
+
Find a library or framework using dyld semantics
|
| 128 |
+
"""
|
| 129 |
+
for path in dyld_image_suffix_search(chain(
|
| 130 |
+
dyld_override_search(name, env),
|
| 131 |
+
dyld_executable_path_search(name, executable_path),
|
| 132 |
+
dyld_default_search(name, env),
|
| 133 |
+
), env):
|
| 134 |
+
|
| 135 |
+
if os.path.isfile(path):
|
| 136 |
+
return path
|
| 137 |
+
try:
|
| 138 |
+
if _dyld_shared_cache_contains_path(path):
|
| 139 |
+
return path
|
| 140 |
+
except NotImplementedError:
|
| 141 |
+
pass
|
| 142 |
+
|
| 143 |
+
raise ValueError("dylib %s could not be found" % (name,))
|
| 144 |
+
|
| 145 |
+
def framework_find(fn, executable_path=None, env=None):
|
| 146 |
+
"""
|
| 147 |
+
Find a framework using dyld semantics in a very loose manner.
|
| 148 |
+
|
| 149 |
+
Will take input such as:
|
| 150 |
+
Python
|
| 151 |
+
Python.framework
|
| 152 |
+
Python.framework/Versions/Current
|
| 153 |
+
"""
|
| 154 |
+
error = None
|
| 155 |
+
try:
|
| 156 |
+
return dyld_find(fn, executable_path=executable_path, env=env)
|
| 157 |
+
except ValueError as e:
|
| 158 |
+
error = e
|
| 159 |
+
fmwk_index = fn.rfind('.framework')
|
| 160 |
+
if fmwk_index == -1:
|
| 161 |
+
fmwk_index = len(fn)
|
| 162 |
+
fn += '.framework'
|
| 163 |
+
fn = os.path.join(fn, os.path.basename(fn[:fmwk_index]))
|
| 164 |
+
try:
|
| 165 |
+
return dyld_find(fn, executable_path=executable_path, env=env)
|
| 166 |
+
except ValueError:
|
| 167 |
+
raise error
|
| 168 |
+
finally:
|
| 169 |
+
error = None
|
| 170 |
+
|
| 171 |
+
def test_dyld_find():
|
| 172 |
+
env = {}
|
| 173 |
+
assert dyld_find('libSystem.dylib') == '/usr/lib/libSystem.dylib'
|
| 174 |
+
assert dyld_find('System.framework/System') == '/System/Library/Frameworks/System.framework/System'
|
| 175 |
+
|
| 176 |
+
if __name__ == '__main__':
|
| 177 |
+
test_dyld_find()
|
janus/lib/python3.10/ctypes/macholib/dylib.py
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
Generic dylib path manipulation
|
| 3 |
+
"""
|
| 4 |
+
|
| 5 |
+
import re
|
| 6 |
+
|
| 7 |
+
__all__ = ['dylib_info']
|
| 8 |
+
|
| 9 |
+
DYLIB_RE = re.compile(r"""(?x)
|
| 10 |
+
(?P<location>^.*)(?:^|/)
|
| 11 |
+
(?P<name>
|
| 12 |
+
(?P<shortname>\w+?)
|
| 13 |
+
(?:\.(?P<version>[^._]+))?
|
| 14 |
+
(?:_(?P<suffix>[^._]+))?
|
| 15 |
+
\.dylib$
|
| 16 |
+
)
|
| 17 |
+
""")
|
| 18 |
+
|
| 19 |
+
def dylib_info(filename):
|
| 20 |
+
"""
|
| 21 |
+
A dylib name can take one of the following four forms:
|
| 22 |
+
Location/Name.SomeVersion_Suffix.dylib
|
| 23 |
+
Location/Name.SomeVersion.dylib
|
| 24 |
+
Location/Name_Suffix.dylib
|
| 25 |
+
Location/Name.dylib
|
| 26 |
+
|
| 27 |
+
returns None if not found or a mapping equivalent to:
|
| 28 |
+
dict(
|
| 29 |
+
location='Location',
|
| 30 |
+
name='Name.SomeVersion_Suffix.dylib',
|
| 31 |
+
shortname='Name',
|
| 32 |
+
version='SomeVersion',
|
| 33 |
+
suffix='Suffix',
|
| 34 |
+
)
|
| 35 |
+
|
| 36 |
+
Note that SomeVersion and Suffix are optional and may be None
|
| 37 |
+
if not present.
|
| 38 |
+
"""
|
| 39 |
+
is_dylib = DYLIB_RE.match(filename)
|
| 40 |
+
if not is_dylib:
|
| 41 |
+
return None
|
| 42 |
+
return is_dylib.groupdict()
|
| 43 |
+
|
| 44 |
+
|
| 45 |
+
def test_dylib_info():
|
| 46 |
+
def d(location=None, name=None, shortname=None, version=None, suffix=None):
|
| 47 |
+
return dict(
|
| 48 |
+
location=location,
|
| 49 |
+
name=name,
|
| 50 |
+
shortname=shortname,
|
| 51 |
+
version=version,
|
| 52 |
+
suffix=suffix
|
| 53 |
+
)
|
| 54 |
+
assert dylib_info('completely/invalid') is None
|
| 55 |
+
assert dylib_info('completely/invalide_debug') is None
|
| 56 |
+
assert dylib_info('P/Foo.dylib') == d('P', 'Foo.dylib', 'Foo')
|
| 57 |
+
assert dylib_info('P/Foo_debug.dylib') == d('P', 'Foo_debug.dylib', 'Foo', suffix='debug')
|
| 58 |
+
assert dylib_info('P/Foo.A.dylib') == d('P', 'Foo.A.dylib', 'Foo', 'A')
|
| 59 |
+
assert dylib_info('P/Foo_debug.A.dylib') == d('P', 'Foo_debug.A.dylib', 'Foo_debug', 'A')
|
| 60 |
+
assert dylib_info('P/Foo.A_debug.dylib') == d('P', 'Foo.A_debug.dylib', 'Foo', 'A', 'debug')
|
| 61 |
+
|
| 62 |
+
if __name__ == '__main__':
|
| 63 |
+
test_dylib_info()
|
janus/lib/python3.10/ctypes/macholib/fetch_macholib
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/sh
|
| 2 |
+
svn export --force http://svn.red-bean.com/bob/macholib/trunk/macholib/ .
|
janus/lib/python3.10/ctypes/macholib/framework.py
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
Generic framework path manipulation
|
| 3 |
+
"""
|
| 4 |
+
|
| 5 |
+
import re
|
| 6 |
+
|
| 7 |
+
__all__ = ['framework_info']
|
| 8 |
+
|
| 9 |
+
STRICT_FRAMEWORK_RE = re.compile(r"""(?x)
|
| 10 |
+
(?P<location>^.*)(?:^|/)
|
| 11 |
+
(?P<name>
|
| 12 |
+
(?P<shortname>\w+).framework/
|
| 13 |
+
(?:Versions/(?P<version>[^/]+)/)?
|
| 14 |
+
(?P=shortname)
|
| 15 |
+
(?:_(?P<suffix>[^_]+))?
|
| 16 |
+
)$
|
| 17 |
+
""")
|
| 18 |
+
|
| 19 |
+
def framework_info(filename):
|
| 20 |
+
"""
|
| 21 |
+
A framework name can take one of the following four forms:
|
| 22 |
+
Location/Name.framework/Versions/SomeVersion/Name_Suffix
|
| 23 |
+
Location/Name.framework/Versions/SomeVersion/Name
|
| 24 |
+
Location/Name.framework/Name_Suffix
|
| 25 |
+
Location/Name.framework/Name
|
| 26 |
+
|
| 27 |
+
returns None if not found, or a mapping equivalent to:
|
| 28 |
+
dict(
|
| 29 |
+
location='Location',
|
| 30 |
+
name='Name.framework/Versions/SomeVersion/Name_Suffix',
|
| 31 |
+
shortname='Name',
|
| 32 |
+
version='SomeVersion',
|
| 33 |
+
suffix='Suffix',
|
| 34 |
+
)
|
| 35 |
+
|
| 36 |
+
Note that SomeVersion and Suffix are optional and may be None
|
| 37 |
+
if not present
|
| 38 |
+
"""
|
| 39 |
+
is_framework = STRICT_FRAMEWORK_RE.match(filename)
|
| 40 |
+
if not is_framework:
|
| 41 |
+
return None
|
| 42 |
+
return is_framework.groupdict()
|
| 43 |
+
|
| 44 |
+
def test_framework_info():
|
| 45 |
+
def d(location=None, name=None, shortname=None, version=None, suffix=None):
|
| 46 |
+
return dict(
|
| 47 |
+
location=location,
|
| 48 |
+
name=name,
|
| 49 |
+
shortname=shortname,
|
| 50 |
+
version=version,
|
| 51 |
+
suffix=suffix
|
| 52 |
+
)
|
| 53 |
+
assert framework_info('completely/invalid') is None
|
| 54 |
+
assert framework_info('completely/invalid/_debug') is None
|
| 55 |
+
assert framework_info('P/F.framework') is None
|
| 56 |
+
assert framework_info('P/F.framework/_debug') is None
|
| 57 |
+
assert framework_info('P/F.framework/F') == d('P', 'F.framework/F', 'F')
|
| 58 |
+
assert framework_info('P/F.framework/F_debug') == d('P', 'F.framework/F_debug', 'F', suffix='debug')
|
| 59 |
+
assert framework_info('P/F.framework/Versions') is None
|
| 60 |
+
assert framework_info('P/F.framework/Versions/A') is None
|
| 61 |
+
assert framework_info('P/F.framework/Versions/A/F') == d('P', 'F.framework/Versions/A/F', 'F', 'A')
|
| 62 |
+
assert framework_info('P/F.framework/Versions/A/F_debug') == d('P', 'F.framework/Versions/A/F_debug', 'F', 'A', 'debug')
|
| 63 |
+
|
| 64 |
+
if __name__ == '__main__':
|
| 65 |
+
test_framework_info()
|
janus/lib/python3.10/ctypes/util.py
ADDED
|
@@ -0,0 +1,397 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import os
|
| 2 |
+
import shutil
|
| 3 |
+
import subprocess
|
| 4 |
+
import sys
|
| 5 |
+
|
| 6 |
+
# find_library(name) returns the pathname of a library, or None.
|
| 7 |
+
if os.name == "nt":
|
| 8 |
+
|
| 9 |
+
def _get_build_version():
|
| 10 |
+
"""Return the version of MSVC that was used to build Python.
|
| 11 |
+
|
| 12 |
+
For Python 2.3 and up, the version number is included in
|
| 13 |
+
sys.version. For earlier versions, assume the compiler is MSVC 6.
|
| 14 |
+
"""
|
| 15 |
+
# This function was copied from Lib/distutils/msvccompiler.py
|
| 16 |
+
prefix = "MSC v."
|
| 17 |
+
i = sys.version.find(prefix)
|
| 18 |
+
if i == -1:
|
| 19 |
+
return 6
|
| 20 |
+
i = i + len(prefix)
|
| 21 |
+
s, rest = sys.version[i:].split(" ", 1)
|
| 22 |
+
majorVersion = int(s[:-2]) - 6
|
| 23 |
+
if majorVersion >= 13:
|
| 24 |
+
majorVersion += 1
|
| 25 |
+
minorVersion = int(s[2:3]) / 10.0
|
| 26 |
+
# I don't think paths are affected by minor version in version 6
|
| 27 |
+
if majorVersion == 6:
|
| 28 |
+
minorVersion = 0
|
| 29 |
+
if majorVersion >= 6:
|
| 30 |
+
return majorVersion + minorVersion
|
| 31 |
+
# else we don't know what version of the compiler this is
|
| 32 |
+
return None
|
| 33 |
+
|
| 34 |
+
def find_msvcrt():
|
| 35 |
+
"""Return the name of the VC runtime dll"""
|
| 36 |
+
version = _get_build_version()
|
| 37 |
+
if version is None:
|
| 38 |
+
# better be safe than sorry
|
| 39 |
+
return None
|
| 40 |
+
if version <= 6:
|
| 41 |
+
clibname = 'msvcrt'
|
| 42 |
+
elif version <= 13:
|
| 43 |
+
clibname = 'msvcr%d' % (version * 10)
|
| 44 |
+
else:
|
| 45 |
+
# CRT is no longer directly loadable. See issue23606 for the
|
| 46 |
+
# discussion about alternative approaches.
|
| 47 |
+
return None
|
| 48 |
+
|
| 49 |
+
# If python was built with in debug mode
|
| 50 |
+
import importlib.machinery
|
| 51 |
+
if '_d.pyd' in importlib.machinery.EXTENSION_SUFFIXES:
|
| 52 |
+
clibname += 'd'
|
| 53 |
+
return clibname+'.dll'
|
| 54 |
+
|
| 55 |
+
def find_library(name):
|
| 56 |
+
if name in ('c', 'm'):
|
| 57 |
+
return find_msvcrt()
|
| 58 |
+
# See MSDN for the REAL search order.
|
| 59 |
+
for directory in os.environ['PATH'].split(os.pathsep):
|
| 60 |
+
fname = os.path.join(directory, name)
|
| 61 |
+
if os.path.isfile(fname):
|
| 62 |
+
return fname
|
| 63 |
+
if fname.lower().endswith(".dll"):
|
| 64 |
+
continue
|
| 65 |
+
fname = fname + ".dll"
|
| 66 |
+
if os.path.isfile(fname):
|
| 67 |
+
return fname
|
| 68 |
+
return None
|
| 69 |
+
|
| 70 |
+
elif os.name == "posix" and sys.platform == "darwin":
|
| 71 |
+
from ctypes.macholib.dyld import dyld_find as _dyld_find
|
| 72 |
+
def find_library(name):
|
| 73 |
+
possible = ['@executable_path/../lib/lib%s.dylib' % name,
|
| 74 |
+
'lib%s.dylib' % name,
|
| 75 |
+
'%s.dylib' % name,
|
| 76 |
+
'%s.framework/%s' % (name, name)]
|
| 77 |
+
for name in possible:
|
| 78 |
+
try:
|
| 79 |
+
return _dyld_find(name)
|
| 80 |
+
except ValueError:
|
| 81 |
+
continue
|
| 82 |
+
return None
|
| 83 |
+
|
| 84 |
+
elif sys.platform.startswith("aix"):
|
| 85 |
+
# AIX has two styles of storing shared libraries
|
| 86 |
+
# GNU auto_tools refer to these as svr4 and aix
|
| 87 |
+
# svr4 (System V Release 4) is a regular file, often with .so as suffix
|
| 88 |
+
# AIX style uses an archive (suffix .a) with members (e.g., shr.o, libssl.so)
|
| 89 |
+
# see issue#26439 and _aix.py for more details
|
| 90 |
+
|
| 91 |
+
from ctypes._aix import find_library
|
| 92 |
+
|
| 93 |
+
elif os.name == "posix":
|
| 94 |
+
# Andreas Degert's find functions, using gcc, /sbin/ldconfig, objdump
|
| 95 |
+
import re, tempfile
|
| 96 |
+
|
| 97 |
+
def _is_elf(filename):
|
| 98 |
+
"Return True if the given file is an ELF file"
|
| 99 |
+
elf_header = b'\x7fELF'
|
| 100 |
+
with open(filename, 'br') as thefile:
|
| 101 |
+
return thefile.read(4) == elf_header
|
| 102 |
+
|
| 103 |
+
def _findLib_gcc(name):
|
| 104 |
+
# Run GCC's linker with the -t (aka --trace) option and examine the
|
| 105 |
+
# library name it prints out. The GCC command will fail because we
|
| 106 |
+
# haven't supplied a proper program with main(), but that does not
|
| 107 |
+
# matter.
|
| 108 |
+
expr = os.fsencode(r'[^\(\)\s]*lib%s\.[^\(\)\s]*' % re.escape(name))
|
| 109 |
+
|
| 110 |
+
c_compiler = shutil.which('gcc')
|
| 111 |
+
if not c_compiler:
|
| 112 |
+
c_compiler = shutil.which('cc')
|
| 113 |
+
if not c_compiler:
|
| 114 |
+
# No C compiler available, give up
|
| 115 |
+
return None
|
| 116 |
+
|
| 117 |
+
temp = tempfile.NamedTemporaryFile()
|
| 118 |
+
try:
|
| 119 |
+
args = [c_compiler, '-Wl,-t', '-o', temp.name, '-l' + name]
|
| 120 |
+
|
| 121 |
+
env = dict(os.environ)
|
| 122 |
+
env['LC_ALL'] = 'C'
|
| 123 |
+
env['LANG'] = 'C'
|
| 124 |
+
try:
|
| 125 |
+
proc = subprocess.Popen(args,
|
| 126 |
+
stdout=subprocess.PIPE,
|
| 127 |
+
stderr=subprocess.STDOUT,
|
| 128 |
+
env=env)
|
| 129 |
+
except OSError: # E.g. bad executable
|
| 130 |
+
return None
|
| 131 |
+
with proc:
|
| 132 |
+
trace = proc.stdout.read()
|
| 133 |
+
finally:
|
| 134 |
+
try:
|
| 135 |
+
temp.close()
|
| 136 |
+
except FileNotFoundError:
|
| 137 |
+
# Raised if the file was already removed, which is the normal
|
| 138 |
+
# behaviour of GCC if linking fails
|
| 139 |
+
pass
|
| 140 |
+
res = re.findall(expr, trace)
|
| 141 |
+
if not res:
|
| 142 |
+
return None
|
| 143 |
+
|
| 144 |
+
for file in res:
|
| 145 |
+
# Check if the given file is an elf file: gcc can report
|
| 146 |
+
# some files that are linker scripts and not actual
|
| 147 |
+
# shared objects. See bpo-41976 for more details
|
| 148 |
+
if not _is_elf(file):
|
| 149 |
+
continue
|
| 150 |
+
return os.fsdecode(file)
|
| 151 |
+
|
| 152 |
+
|
| 153 |
+
if sys.platform == "sunos5":
|
| 154 |
+
# use /usr/ccs/bin/dump on solaris
|
| 155 |
+
def _get_soname(f):
|
| 156 |
+
if not f:
|
| 157 |
+
return None
|
| 158 |
+
|
| 159 |
+
try:
|
| 160 |
+
proc = subprocess.Popen(("/usr/ccs/bin/dump", "-Lpv", f),
|
| 161 |
+
stdout=subprocess.PIPE,
|
| 162 |
+
stderr=subprocess.DEVNULL)
|
| 163 |
+
except OSError: # E.g. command not found
|
| 164 |
+
return None
|
| 165 |
+
with proc:
|
| 166 |
+
data = proc.stdout.read()
|
| 167 |
+
res = re.search(br'\[.*\]\sSONAME\s+([^\s]+)', data)
|
| 168 |
+
if not res:
|
| 169 |
+
return None
|
| 170 |
+
return os.fsdecode(res.group(1))
|
| 171 |
+
else:
|
| 172 |
+
def _get_soname(f):
|
| 173 |
+
# assuming GNU binutils / ELF
|
| 174 |
+
if not f:
|
| 175 |
+
return None
|
| 176 |
+
objdump = shutil.which('objdump')
|
| 177 |
+
if not objdump:
|
| 178 |
+
# objdump is not available, give up
|
| 179 |
+
return None
|
| 180 |
+
|
| 181 |
+
try:
|
| 182 |
+
proc = subprocess.Popen((objdump, '-p', '-j', '.dynamic', f),
|
| 183 |
+
stdout=subprocess.PIPE,
|
| 184 |
+
stderr=subprocess.DEVNULL)
|
| 185 |
+
except OSError: # E.g. bad executable
|
| 186 |
+
return None
|
| 187 |
+
with proc:
|
| 188 |
+
dump = proc.stdout.read()
|
| 189 |
+
res = re.search(br'\sSONAME\s+([^\s]+)', dump)
|
| 190 |
+
if not res:
|
| 191 |
+
return None
|
| 192 |
+
return os.fsdecode(res.group(1))
|
| 193 |
+
|
| 194 |
+
if sys.platform.startswith(("freebsd", "openbsd", "dragonfly")):
|
| 195 |
+
|
| 196 |
+
def _num_version(libname):
|
| 197 |
+
# "libxyz.so.MAJOR.MINOR" => [ MAJOR, MINOR ]
|
| 198 |
+
parts = libname.split(b".")
|
| 199 |
+
nums = []
|
| 200 |
+
try:
|
| 201 |
+
while parts:
|
| 202 |
+
nums.insert(0, int(parts.pop()))
|
| 203 |
+
except ValueError:
|
| 204 |
+
pass
|
| 205 |
+
return nums or [sys.maxsize]
|
| 206 |
+
|
| 207 |
+
def find_library(name):
|
| 208 |
+
ename = re.escape(name)
|
| 209 |
+
expr = r':-l%s\.\S+ => \S*/(lib%s\.\S+)' % (ename, ename)
|
| 210 |
+
expr = os.fsencode(expr)
|
| 211 |
+
|
| 212 |
+
try:
|
| 213 |
+
proc = subprocess.Popen(('/sbin/ldconfig', '-r'),
|
| 214 |
+
stdout=subprocess.PIPE,
|
| 215 |
+
stderr=subprocess.DEVNULL)
|
| 216 |
+
except OSError: # E.g. command not found
|
| 217 |
+
data = b''
|
| 218 |
+
else:
|
| 219 |
+
with proc:
|
| 220 |
+
data = proc.stdout.read()
|
| 221 |
+
|
| 222 |
+
res = re.findall(expr, data)
|
| 223 |
+
if not res:
|
| 224 |
+
return _get_soname(_findLib_gcc(name))
|
| 225 |
+
res.sort(key=_num_version)
|
| 226 |
+
return os.fsdecode(res[-1])
|
| 227 |
+
|
| 228 |
+
elif sys.platform == "sunos5":
|
| 229 |
+
|
| 230 |
+
def _findLib_crle(name, is64):
|
| 231 |
+
if not os.path.exists('/usr/bin/crle'):
|
| 232 |
+
return None
|
| 233 |
+
|
| 234 |
+
env = dict(os.environ)
|
| 235 |
+
env['LC_ALL'] = 'C'
|
| 236 |
+
|
| 237 |
+
if is64:
|
| 238 |
+
args = ('/usr/bin/crle', '-64')
|
| 239 |
+
else:
|
| 240 |
+
args = ('/usr/bin/crle',)
|
| 241 |
+
|
| 242 |
+
paths = None
|
| 243 |
+
try:
|
| 244 |
+
proc = subprocess.Popen(args,
|
| 245 |
+
stdout=subprocess.PIPE,
|
| 246 |
+
stderr=subprocess.DEVNULL,
|
| 247 |
+
env=env)
|
| 248 |
+
except OSError: # E.g. bad executable
|
| 249 |
+
return None
|
| 250 |
+
with proc:
|
| 251 |
+
for line in proc.stdout:
|
| 252 |
+
line = line.strip()
|
| 253 |
+
if line.startswith(b'Default Library Path (ELF):'):
|
| 254 |
+
paths = os.fsdecode(line).split()[4]
|
| 255 |
+
|
| 256 |
+
if not paths:
|
| 257 |
+
return None
|
| 258 |
+
|
| 259 |
+
for dir in paths.split(":"):
|
| 260 |
+
libfile = os.path.join(dir, "lib%s.so" % name)
|
| 261 |
+
if os.path.exists(libfile):
|
| 262 |
+
return libfile
|
| 263 |
+
|
| 264 |
+
return None
|
| 265 |
+
|
| 266 |
+
def find_library(name, is64 = False):
|
| 267 |
+
return _get_soname(_findLib_crle(name, is64) or _findLib_gcc(name))
|
| 268 |
+
|
| 269 |
+
else:
|
| 270 |
+
|
| 271 |
+
def _findSoname_ldconfig(name):
|
| 272 |
+
import struct
|
| 273 |
+
if struct.calcsize('l') == 4:
|
| 274 |
+
machine = os.uname().machine + '-32'
|
| 275 |
+
else:
|
| 276 |
+
machine = os.uname().machine + '-64'
|
| 277 |
+
mach_map = {
|
| 278 |
+
'x86_64-64': 'libc6,x86-64',
|
| 279 |
+
'ppc64-64': 'libc6,64bit',
|
| 280 |
+
'sparc64-64': 'libc6,64bit',
|
| 281 |
+
's390x-64': 'libc6,64bit',
|
| 282 |
+
'ia64-64': 'libc6,IA-64',
|
| 283 |
+
}
|
| 284 |
+
abi_type = mach_map.get(machine, 'libc6')
|
| 285 |
+
|
| 286 |
+
# XXX assuming GLIBC's ldconfig (with option -p)
|
| 287 |
+
regex = r'\s+(lib%s\.[^\s]+)\s+\(%s'
|
| 288 |
+
regex = os.fsencode(regex % (re.escape(name), abi_type))
|
| 289 |
+
try:
|
| 290 |
+
with subprocess.Popen(['/sbin/ldconfig', '-p'],
|
| 291 |
+
stdin=subprocess.DEVNULL,
|
| 292 |
+
stderr=subprocess.DEVNULL,
|
| 293 |
+
stdout=subprocess.PIPE,
|
| 294 |
+
env={'LC_ALL': 'C', 'LANG': 'C'}) as p:
|
| 295 |
+
res = re.search(regex, p.stdout.read())
|
| 296 |
+
if res:
|
| 297 |
+
return os.fsdecode(res.group(1))
|
| 298 |
+
except OSError:
|
| 299 |
+
pass
|
| 300 |
+
|
| 301 |
+
def _findLib_ld(name):
|
| 302 |
+
# See issue #9998 for why this is needed
|
| 303 |
+
expr = r'[^\(\)\s]*lib%s\.[^\(\)\s]*' % re.escape(name)
|
| 304 |
+
cmd = ['ld', '-t']
|
| 305 |
+
libpath = os.environ.get('LD_LIBRARY_PATH')
|
| 306 |
+
if libpath:
|
| 307 |
+
for d in libpath.split(':'):
|
| 308 |
+
cmd.extend(['-L', d])
|
| 309 |
+
cmd.extend(['-o', os.devnull, '-l%s' % name])
|
| 310 |
+
result = None
|
| 311 |
+
try:
|
| 312 |
+
p = subprocess.Popen(cmd, stdout=subprocess.PIPE,
|
| 313 |
+
stderr=subprocess.PIPE,
|
| 314 |
+
universal_newlines=True)
|
| 315 |
+
out, _ = p.communicate()
|
| 316 |
+
res = re.findall(expr, os.fsdecode(out))
|
| 317 |
+
for file in res:
|
| 318 |
+
# Check if the given file is an elf file: gcc can report
|
| 319 |
+
# some files that are linker scripts and not actual
|
| 320 |
+
# shared objects. See bpo-41976 for more details
|
| 321 |
+
if not _is_elf(file):
|
| 322 |
+
continue
|
| 323 |
+
return os.fsdecode(file)
|
| 324 |
+
except Exception:
|
| 325 |
+
pass # result will be None
|
| 326 |
+
return result
|
| 327 |
+
|
| 328 |
+
def _findLib_prefix(name):
|
| 329 |
+
if not name:
|
| 330 |
+
return None
|
| 331 |
+
for fullname in (name, "lib%s.so" % (name)):
|
| 332 |
+
path = os.path.join(sys.prefix, 'lib', fullname)
|
| 333 |
+
if os.path.exists(path):
|
| 334 |
+
return path
|
| 335 |
+
return None
|
| 336 |
+
|
| 337 |
+
def find_library(name):
|
| 338 |
+
# See issue #9998
|
| 339 |
+
# Yes calling _findLib_prefix twice is deliberate, because _get_soname ditches
|
| 340 |
+
# the full path.
|
| 341 |
+
# When objdump is unavailable this returns None
|
| 342 |
+
so_name = _get_soname(_findLib_prefix(name)) or name
|
| 343 |
+
if so_name != name:
|
| 344 |
+
return _findLib_prefix(so_name) or \
|
| 345 |
+
_findLib_prefix(name) or \
|
| 346 |
+
_findSoname_ldconfig(name) or \
|
| 347 |
+
_get_soname(_findLib_gcc(name)) or _get_soname(_findLib_ld(name))
|
| 348 |
+
else:
|
| 349 |
+
return _findLib_prefix(name) or \
|
| 350 |
+
_findSoname_ldconfig(name) or \
|
| 351 |
+
_get_soname(_findLib_gcc(name)) or _get_soname(_findLib_ld(name))
|
| 352 |
+
|
| 353 |
+
################################################################
|
| 354 |
+
# test code
|
| 355 |
+
|
| 356 |
+
def test():
|
| 357 |
+
from ctypes import cdll
|
| 358 |
+
if os.name == "nt":
|
| 359 |
+
print(cdll.msvcrt)
|
| 360 |
+
print(cdll.load("msvcrt"))
|
| 361 |
+
print(find_library("msvcrt"))
|
| 362 |
+
|
| 363 |
+
if os.name == "posix":
|
| 364 |
+
# find and load_version
|
| 365 |
+
print(find_library("m"))
|
| 366 |
+
print(find_library("c"))
|
| 367 |
+
print(find_library("bz2"))
|
| 368 |
+
|
| 369 |
+
# load
|
| 370 |
+
if sys.platform == "darwin":
|
| 371 |
+
print(cdll.LoadLibrary("libm.dylib"))
|
| 372 |
+
print(cdll.LoadLibrary("libcrypto.dylib"))
|
| 373 |
+
print(cdll.LoadLibrary("libSystem.dylib"))
|
| 374 |
+
print(cdll.LoadLibrary("System.framework/System"))
|
| 375 |
+
# issue-26439 - fix broken test call for AIX
|
| 376 |
+
elif sys.platform.startswith("aix"):
|
| 377 |
+
from ctypes import CDLL
|
| 378 |
+
if sys.maxsize < 2**32:
|
| 379 |
+
print(f"Using CDLL(name, os.RTLD_MEMBER): {CDLL('libc.a(shr.o)', os.RTLD_MEMBER)}")
|
| 380 |
+
print(f"Using cdll.LoadLibrary(): {cdll.LoadLibrary('libc.a(shr.o)')}")
|
| 381 |
+
# librpm.so is only available as 32-bit shared library
|
| 382 |
+
print(find_library("rpm"))
|
| 383 |
+
print(cdll.LoadLibrary("librpm.so"))
|
| 384 |
+
else:
|
| 385 |
+
print(f"Using CDLL(name, os.RTLD_MEMBER): {CDLL('libc.a(shr_64.o)', os.RTLD_MEMBER)}")
|
| 386 |
+
print(f"Using cdll.LoadLibrary(): {cdll.LoadLibrary('libc.a(shr_64.o)')}")
|
| 387 |
+
print(f"crypt\t:: {find_library('crypt')}")
|
| 388 |
+
print(f"crypt\t:: {cdll.LoadLibrary(find_library('crypt'))}")
|
| 389 |
+
print(f"crypto\t:: {find_library('crypto')}")
|
| 390 |
+
print(f"crypto\t:: {cdll.LoadLibrary(find_library('crypto'))}")
|
| 391 |
+
else:
|
| 392 |
+
print(cdll.LoadLibrary("libm.so"))
|
| 393 |
+
print(cdll.LoadLibrary("libcrypt.so"))
|
| 394 |
+
print(find_library("crypt"))
|
| 395 |
+
|
| 396 |
+
if __name__ == "__main__":
|
| 397 |
+
test()
|
janus/lib/python3.10/ctypes/wintypes.py
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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+
# The most useful windows datatypes
|
| 2 |
+
import ctypes
|
| 3 |
+
|
| 4 |
+
BYTE = ctypes.c_byte
|
| 5 |
+
WORD = ctypes.c_ushort
|
| 6 |
+
DWORD = ctypes.c_ulong
|
| 7 |
+
|
| 8 |
+
#UCHAR = ctypes.c_uchar
|
| 9 |
+
CHAR = ctypes.c_char
|
| 10 |
+
WCHAR = ctypes.c_wchar
|
| 11 |
+
UINT = ctypes.c_uint
|
| 12 |
+
INT = ctypes.c_int
|
| 13 |
+
|
| 14 |
+
DOUBLE = ctypes.c_double
|
| 15 |
+
FLOAT = ctypes.c_float
|
| 16 |
+
|
| 17 |
+
BOOLEAN = BYTE
|
| 18 |
+
BOOL = ctypes.c_long
|
| 19 |
+
|
| 20 |
+
class VARIANT_BOOL(ctypes._SimpleCData):
|
| 21 |
+
_type_ = "v"
|
| 22 |
+
def __repr__(self):
|
| 23 |
+
return "%s(%r)" % (self.__class__.__name__, self.value)
|
| 24 |
+
|
| 25 |
+
ULONG = ctypes.c_ulong
|
| 26 |
+
LONG = ctypes.c_long
|
| 27 |
+
|
| 28 |
+
USHORT = ctypes.c_ushort
|
| 29 |
+
SHORT = ctypes.c_short
|
| 30 |
+
|
| 31 |
+
# in the windows header files, these are structures.
|
| 32 |
+
_LARGE_INTEGER = LARGE_INTEGER = ctypes.c_longlong
|
| 33 |
+
_ULARGE_INTEGER = ULARGE_INTEGER = ctypes.c_ulonglong
|
| 34 |
+
|
| 35 |
+
LPCOLESTR = LPOLESTR = OLESTR = ctypes.c_wchar_p
|
| 36 |
+
LPCWSTR = LPWSTR = ctypes.c_wchar_p
|
| 37 |
+
LPCSTR = LPSTR = ctypes.c_char_p
|
| 38 |
+
LPCVOID = LPVOID = ctypes.c_void_p
|
| 39 |
+
|
| 40 |
+
# WPARAM is defined as UINT_PTR (unsigned type)
|
| 41 |
+
# LPARAM is defined as LONG_PTR (signed type)
|
| 42 |
+
if ctypes.sizeof(ctypes.c_long) == ctypes.sizeof(ctypes.c_void_p):
|
| 43 |
+
WPARAM = ctypes.c_ulong
|
| 44 |
+
LPARAM = ctypes.c_long
|
| 45 |
+
elif ctypes.sizeof(ctypes.c_longlong) == ctypes.sizeof(ctypes.c_void_p):
|
| 46 |
+
WPARAM = ctypes.c_ulonglong
|
| 47 |
+
LPARAM = ctypes.c_longlong
|
| 48 |
+
|
| 49 |
+
ATOM = WORD
|
| 50 |
+
LANGID = WORD
|
| 51 |
+
|
| 52 |
+
COLORREF = DWORD
|
| 53 |
+
LGRPID = DWORD
|
| 54 |
+
LCTYPE = DWORD
|
| 55 |
+
|
| 56 |
+
LCID = DWORD
|
| 57 |
+
|
| 58 |
+
################################################################
|
| 59 |
+
# HANDLE types
|
| 60 |
+
HANDLE = ctypes.c_void_p # in the header files: void *
|
| 61 |
+
|
| 62 |
+
HACCEL = HANDLE
|
| 63 |
+
HBITMAP = HANDLE
|
| 64 |
+
HBRUSH = HANDLE
|
| 65 |
+
HCOLORSPACE = HANDLE
|
| 66 |
+
HDC = HANDLE
|
| 67 |
+
HDESK = HANDLE
|
| 68 |
+
HDWP = HANDLE
|
| 69 |
+
HENHMETAFILE = HANDLE
|
| 70 |
+
HFONT = HANDLE
|
| 71 |
+
HGDIOBJ = HANDLE
|
| 72 |
+
HGLOBAL = HANDLE
|
| 73 |
+
HHOOK = HANDLE
|
| 74 |
+
HICON = HANDLE
|
| 75 |
+
HINSTANCE = HANDLE
|
| 76 |
+
HKEY = HANDLE
|
| 77 |
+
HKL = HANDLE
|
| 78 |
+
HLOCAL = HANDLE
|
| 79 |
+
HMENU = HANDLE
|
| 80 |
+
HMETAFILE = HANDLE
|
| 81 |
+
HMODULE = HANDLE
|
| 82 |
+
HMONITOR = HANDLE
|
| 83 |
+
HPALETTE = HANDLE
|
| 84 |
+
HPEN = HANDLE
|
| 85 |
+
HRGN = HANDLE
|
| 86 |
+
HRSRC = HANDLE
|
| 87 |
+
HSTR = HANDLE
|
| 88 |
+
HTASK = HANDLE
|
| 89 |
+
HWINSTA = HANDLE
|
| 90 |
+
HWND = HANDLE
|
| 91 |
+
SC_HANDLE = HANDLE
|
| 92 |
+
SERVICE_STATUS_HANDLE = HANDLE
|
| 93 |
+
|
| 94 |
+
################################################################
|
| 95 |
+
# Some important structure definitions
|
| 96 |
+
|
| 97 |
+
class RECT(ctypes.Structure):
|
| 98 |
+
_fields_ = [("left", LONG),
|
| 99 |
+
("top", LONG),
|
| 100 |
+
("right", LONG),
|
| 101 |
+
("bottom", LONG)]
|
| 102 |
+
tagRECT = _RECTL = RECTL = RECT
|
| 103 |
+
|
| 104 |
+
class _SMALL_RECT(ctypes.Structure):
|
| 105 |
+
_fields_ = [('Left', SHORT),
|
| 106 |
+
('Top', SHORT),
|
| 107 |
+
('Right', SHORT),
|
| 108 |
+
('Bottom', SHORT)]
|
| 109 |
+
SMALL_RECT = _SMALL_RECT
|
| 110 |
+
|
| 111 |
+
class _COORD(ctypes.Structure):
|
| 112 |
+
_fields_ = [('X', SHORT),
|
| 113 |
+
('Y', SHORT)]
|
| 114 |
+
|
| 115 |
+
class POINT(ctypes.Structure):
|
| 116 |
+
_fields_ = [("x", LONG),
|
| 117 |
+
("y", LONG)]
|
| 118 |
+
tagPOINT = _POINTL = POINTL = POINT
|
| 119 |
+
|
| 120 |
+
class SIZE(ctypes.Structure):
|
| 121 |
+
_fields_ = [("cx", LONG),
|
| 122 |
+
("cy", LONG)]
|
| 123 |
+
tagSIZE = SIZEL = SIZE
|
| 124 |
+
|
| 125 |
+
def RGB(red, green, blue):
|
| 126 |
+
return red + (green << 8) + (blue << 16)
|
| 127 |
+
|
| 128 |
+
class FILETIME(ctypes.Structure):
|
| 129 |
+
_fields_ = [("dwLowDateTime", DWORD),
|
| 130 |
+
("dwHighDateTime", DWORD)]
|
| 131 |
+
_FILETIME = FILETIME
|
| 132 |
+
|
| 133 |
+
class MSG(ctypes.Structure):
|
| 134 |
+
_fields_ = [("hWnd", HWND),
|
| 135 |
+
("message", UINT),
|
| 136 |
+
("wParam", WPARAM),
|
| 137 |
+
("lParam", LPARAM),
|
| 138 |
+
("time", DWORD),
|
| 139 |
+
("pt", POINT)]
|
| 140 |
+
tagMSG = MSG
|
| 141 |
+
MAX_PATH = 260
|
| 142 |
+
|
| 143 |
+
class WIN32_FIND_DATAA(ctypes.Structure):
|
| 144 |
+
_fields_ = [("dwFileAttributes", DWORD),
|
| 145 |
+
("ftCreationTime", FILETIME),
|
| 146 |
+
("ftLastAccessTime", FILETIME),
|
| 147 |
+
("ftLastWriteTime", FILETIME),
|
| 148 |
+
("nFileSizeHigh", DWORD),
|
| 149 |
+
("nFileSizeLow", DWORD),
|
| 150 |
+
("dwReserved0", DWORD),
|
| 151 |
+
("dwReserved1", DWORD),
|
| 152 |
+
("cFileName", CHAR * MAX_PATH),
|
| 153 |
+
("cAlternateFileName", CHAR * 14)]
|
| 154 |
+
|
| 155 |
+
class WIN32_FIND_DATAW(ctypes.Structure):
|
| 156 |
+
_fields_ = [("dwFileAttributes", DWORD),
|
| 157 |
+
("ftCreationTime", FILETIME),
|
| 158 |
+
("ftLastAccessTime", FILETIME),
|
| 159 |
+
("ftLastWriteTime", FILETIME),
|
| 160 |
+
("nFileSizeHigh", DWORD),
|
| 161 |
+
("nFileSizeLow", DWORD),
|
| 162 |
+
("dwReserved0", DWORD),
|
| 163 |
+
("dwReserved1", DWORD),
|
| 164 |
+
("cFileName", WCHAR * MAX_PATH),
|
| 165 |
+
("cAlternateFileName", WCHAR * 14)]
|
| 166 |
+
|
| 167 |
+
################################################################
|
| 168 |
+
# Pointer types
|
| 169 |
+
|
| 170 |
+
LPBOOL = PBOOL = ctypes.POINTER(BOOL)
|
| 171 |
+
PBOOLEAN = ctypes.POINTER(BOOLEAN)
|
| 172 |
+
LPBYTE = PBYTE = ctypes.POINTER(BYTE)
|
| 173 |
+
PCHAR = ctypes.POINTER(CHAR)
|
| 174 |
+
LPCOLORREF = ctypes.POINTER(COLORREF)
|
| 175 |
+
LPDWORD = PDWORD = ctypes.POINTER(DWORD)
|
| 176 |
+
LPFILETIME = PFILETIME = ctypes.POINTER(FILETIME)
|
| 177 |
+
PFLOAT = ctypes.POINTER(FLOAT)
|
| 178 |
+
LPHANDLE = PHANDLE = ctypes.POINTER(HANDLE)
|
| 179 |
+
PHKEY = ctypes.POINTER(HKEY)
|
| 180 |
+
LPHKL = ctypes.POINTER(HKL)
|
| 181 |
+
LPINT = PINT = ctypes.POINTER(INT)
|
| 182 |
+
PLARGE_INTEGER = ctypes.POINTER(LARGE_INTEGER)
|
| 183 |
+
PLCID = ctypes.POINTER(LCID)
|
| 184 |
+
LPLONG = PLONG = ctypes.POINTER(LONG)
|
| 185 |
+
LPMSG = PMSG = ctypes.POINTER(MSG)
|
| 186 |
+
LPPOINT = PPOINT = ctypes.POINTER(POINT)
|
| 187 |
+
PPOINTL = ctypes.POINTER(POINTL)
|
| 188 |
+
LPRECT = PRECT = ctypes.POINTER(RECT)
|
| 189 |
+
LPRECTL = PRECTL = ctypes.POINTER(RECTL)
|
| 190 |
+
LPSC_HANDLE = ctypes.POINTER(SC_HANDLE)
|
| 191 |
+
PSHORT = ctypes.POINTER(SHORT)
|
| 192 |
+
LPSIZE = PSIZE = ctypes.POINTER(SIZE)
|
| 193 |
+
LPSIZEL = PSIZEL = ctypes.POINTER(SIZEL)
|
| 194 |
+
PSMALL_RECT = ctypes.POINTER(SMALL_RECT)
|
| 195 |
+
LPUINT = PUINT = ctypes.POINTER(UINT)
|
| 196 |
+
PULARGE_INTEGER = ctypes.POINTER(ULARGE_INTEGER)
|
| 197 |
+
PULONG = ctypes.POINTER(ULONG)
|
| 198 |
+
PUSHORT = ctypes.POINTER(USHORT)
|
| 199 |
+
PWCHAR = ctypes.POINTER(WCHAR)
|
| 200 |
+
LPWIN32_FIND_DATAA = PWIN32_FIND_DATAA = ctypes.POINTER(WIN32_FIND_DATAA)
|
| 201 |
+
LPWIN32_FIND_DATAW = PWIN32_FIND_DATAW = ctypes.POINTER(WIN32_FIND_DATAW)
|
| 202 |
+
LPWORD = PWORD = ctypes.POINTER(WORD)
|
janus/lib/python3.10/curses/__init__.py
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""curses
|
| 2 |
+
|
| 3 |
+
The main package for curses support for Python. Normally used by importing
|
| 4 |
+
the package, and perhaps a particular module inside it.
|
| 5 |
+
|
| 6 |
+
import curses
|
| 7 |
+
from curses import textpad
|
| 8 |
+
curses.initscr()
|
| 9 |
+
...
|
| 10 |
+
|
| 11 |
+
"""
|
| 12 |
+
|
| 13 |
+
from _curses import *
|
| 14 |
+
import os as _os
|
| 15 |
+
import sys as _sys
|
| 16 |
+
|
| 17 |
+
# Some constants, most notably the ACS_* ones, are only added to the C
|
| 18 |
+
# _curses module's dictionary after initscr() is called. (Some
|
| 19 |
+
# versions of SGI's curses don't define values for those constants
|
| 20 |
+
# until initscr() has been called.) This wrapper function calls the
|
| 21 |
+
# underlying C initscr(), and then copies the constants from the
|
| 22 |
+
# _curses module to the curses package's dictionary. Don't do 'from
|
| 23 |
+
# curses import *' if you'll be needing the ACS_* constants.
|
| 24 |
+
|
| 25 |
+
def initscr():
|
| 26 |
+
import _curses, curses
|
| 27 |
+
# we call setupterm() here because it raises an error
|
| 28 |
+
# instead of calling exit() in error cases.
|
| 29 |
+
setupterm(term=_os.environ.get("TERM", "unknown"),
|
| 30 |
+
fd=_sys.__stdout__.fileno())
|
| 31 |
+
stdscr = _curses.initscr()
|
| 32 |
+
for key, value in _curses.__dict__.items():
|
| 33 |
+
if key[0:4] == 'ACS_' or key in ('LINES', 'COLS'):
|
| 34 |
+
setattr(curses, key, value)
|
| 35 |
+
|
| 36 |
+
return stdscr
|
| 37 |
+
|
| 38 |
+
# This is a similar wrapper for start_color(), which adds the COLORS and
|
| 39 |
+
# COLOR_PAIRS variables which are only available after start_color() is
|
| 40 |
+
# called.
|
| 41 |
+
|
| 42 |
+
def start_color():
|
| 43 |
+
import _curses, curses
|
| 44 |
+
retval = _curses.start_color()
|
| 45 |
+
if hasattr(_curses, 'COLORS'):
|
| 46 |
+
curses.COLORS = _curses.COLORS
|
| 47 |
+
if hasattr(_curses, 'COLOR_PAIRS'):
|
| 48 |
+
curses.COLOR_PAIRS = _curses.COLOR_PAIRS
|
| 49 |
+
return retval
|
| 50 |
+
|
| 51 |
+
# Import Python has_key() implementation if _curses doesn't contain has_key()
|
| 52 |
+
|
| 53 |
+
try:
|
| 54 |
+
has_key
|
| 55 |
+
except NameError:
|
| 56 |
+
from .has_key import has_key
|
| 57 |
+
|
| 58 |
+
# Wrapper for the entire curses-based application. Runs a function which
|
| 59 |
+
# should be the rest of your curses-based application. If the application
|
| 60 |
+
# raises an exception, wrapper() will restore the terminal to a sane state so
|
| 61 |
+
# you can read the resulting traceback.
|
| 62 |
+
|
| 63 |
+
def wrapper(func, /, *args, **kwds):
|
| 64 |
+
"""Wrapper function that initializes curses and calls another function,
|
| 65 |
+
restoring normal keyboard/screen behavior on error.
|
| 66 |
+
The callable object 'func' is then passed the main window 'stdscr'
|
| 67 |
+
as its first argument, followed by any other arguments passed to
|
| 68 |
+
wrapper().
|
| 69 |
+
"""
|
| 70 |
+
|
| 71 |
+
try:
|
| 72 |
+
# Initialize curses
|
| 73 |
+
stdscr = initscr()
|
| 74 |
+
|
| 75 |
+
# Turn off echoing of keys, and enter cbreak mode,
|
| 76 |
+
# where no buffering is performed on keyboard input
|
| 77 |
+
noecho()
|
| 78 |
+
cbreak()
|
| 79 |
+
|
| 80 |
+
# In keypad mode, escape sequences for special keys
|
| 81 |
+
# (like the cursor keys) will be interpreted and
|
| 82 |
+
# a special value like curses.KEY_LEFT will be returned
|
| 83 |
+
stdscr.keypad(1)
|
| 84 |
+
|
| 85 |
+
# Start color, too. Harmless if the terminal doesn't have
|
| 86 |
+
# color; user can test with has_color() later on. The try/catch
|
| 87 |
+
# works around a minor bit of over-conscientiousness in the curses
|
| 88 |
+
# module -- the error return from C start_color() is ignorable.
|
| 89 |
+
try:
|
| 90 |
+
start_color()
|
| 91 |
+
except:
|
| 92 |
+
pass
|
| 93 |
+
|
| 94 |
+
return func(stdscr, *args, **kwds)
|
| 95 |
+
finally:
|
| 96 |
+
# Set everything back to normal
|
| 97 |
+
if 'stdscr' in locals():
|
| 98 |
+
stdscr.keypad(0)
|
| 99 |
+
echo()
|
| 100 |
+
nocbreak()
|
| 101 |
+
endwin()
|
janus/lib/python3.10/curses/__pycache__/__init__.cpython-310.pyc
ADDED
|
Binary file (1.84 kB). View file
|
|
|
janus/lib/python3.10/curses/__pycache__/ascii.cpython-310.pyc
ADDED
|
Binary file (3.61 kB). View file
|
|
|
janus/lib/python3.10/curses/__pycache__/has_key.cpython-310.pyc
ADDED
|
Binary file (5.16 kB). View file
|
|
|
janus/lib/python3.10/curses/__pycache__/panel.cpython-310.pyc
ADDED
|
Binary file (480 Bytes). View file
|
|
|
janus/lib/python3.10/curses/__pycache__/textpad.cpython-310.pyc
ADDED
|
Binary file (5.98 kB). View file
|
|
|
janus/lib/python3.10/curses/ascii.py
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Constants and membership tests for ASCII characters"""
|
| 2 |
+
|
| 3 |
+
NUL = 0x00 # ^@
|
| 4 |
+
SOH = 0x01 # ^A
|
| 5 |
+
STX = 0x02 # ^B
|
| 6 |
+
ETX = 0x03 # ^C
|
| 7 |
+
EOT = 0x04 # ^D
|
| 8 |
+
ENQ = 0x05 # ^E
|
| 9 |
+
ACK = 0x06 # ^F
|
| 10 |
+
BEL = 0x07 # ^G
|
| 11 |
+
BS = 0x08 # ^H
|
| 12 |
+
TAB = 0x09 # ^I
|
| 13 |
+
HT = 0x09 # ^I
|
| 14 |
+
LF = 0x0a # ^J
|
| 15 |
+
NL = 0x0a # ^J
|
| 16 |
+
VT = 0x0b # ^K
|
| 17 |
+
FF = 0x0c # ^L
|
| 18 |
+
CR = 0x0d # ^M
|
| 19 |
+
SO = 0x0e # ^N
|
| 20 |
+
SI = 0x0f # ^O
|
| 21 |
+
DLE = 0x10 # ^P
|
| 22 |
+
DC1 = 0x11 # ^Q
|
| 23 |
+
DC2 = 0x12 # ^R
|
| 24 |
+
DC3 = 0x13 # ^S
|
| 25 |
+
DC4 = 0x14 # ^T
|
| 26 |
+
NAK = 0x15 # ^U
|
| 27 |
+
SYN = 0x16 # ^V
|
| 28 |
+
ETB = 0x17 # ^W
|
| 29 |
+
CAN = 0x18 # ^X
|
| 30 |
+
EM = 0x19 # ^Y
|
| 31 |
+
SUB = 0x1a # ^Z
|
| 32 |
+
ESC = 0x1b # ^[
|
| 33 |
+
FS = 0x1c # ^\
|
| 34 |
+
GS = 0x1d # ^]
|
| 35 |
+
RS = 0x1e # ^^
|
| 36 |
+
US = 0x1f # ^_
|
| 37 |
+
SP = 0x20 # space
|
| 38 |
+
DEL = 0x7f # delete
|
| 39 |
+
|
| 40 |
+
controlnames = [
|
| 41 |
+
"NUL", "SOH", "STX", "ETX", "EOT", "ENQ", "ACK", "BEL",
|
| 42 |
+
"BS", "HT", "LF", "VT", "FF", "CR", "SO", "SI",
|
| 43 |
+
"DLE", "DC1", "DC2", "DC3", "DC4", "NAK", "SYN", "ETB",
|
| 44 |
+
"CAN", "EM", "SUB", "ESC", "FS", "GS", "RS", "US",
|
| 45 |
+
"SP"
|
| 46 |
+
]
|
| 47 |
+
|
| 48 |
+
def _ctoi(c):
|
| 49 |
+
if type(c) == type(""):
|
| 50 |
+
return ord(c)
|
| 51 |
+
else:
|
| 52 |
+
return c
|
| 53 |
+
|
| 54 |
+
def isalnum(c): return isalpha(c) or isdigit(c)
|
| 55 |
+
def isalpha(c): return isupper(c) or islower(c)
|
| 56 |
+
def isascii(c): return 0 <= _ctoi(c) <= 127 # ?
|
| 57 |
+
def isblank(c): return _ctoi(c) in (9, 32)
|
| 58 |
+
def iscntrl(c): return 0 <= _ctoi(c) <= 31 or _ctoi(c) == 127
|
| 59 |
+
def isdigit(c): return 48 <= _ctoi(c) <= 57
|
| 60 |
+
def isgraph(c): return 33 <= _ctoi(c) <= 126
|
| 61 |
+
def islower(c): return 97 <= _ctoi(c) <= 122
|
| 62 |
+
def isprint(c): return 32 <= _ctoi(c) <= 126
|
| 63 |
+
def ispunct(c): return isgraph(c) and not isalnum(c)
|
| 64 |
+
def isspace(c): return _ctoi(c) in (9, 10, 11, 12, 13, 32)
|
| 65 |
+
def isupper(c): return 65 <= _ctoi(c) <= 90
|
| 66 |
+
def isxdigit(c): return isdigit(c) or \
|
| 67 |
+
(65 <= _ctoi(c) <= 70) or (97 <= _ctoi(c) <= 102)
|
| 68 |
+
def isctrl(c): return 0 <= _ctoi(c) < 32
|
| 69 |
+
def ismeta(c): return _ctoi(c) > 127
|
| 70 |
+
|
| 71 |
+
def ascii(c):
|
| 72 |
+
if type(c) == type(""):
|
| 73 |
+
return chr(_ctoi(c) & 0x7f)
|
| 74 |
+
else:
|
| 75 |
+
return _ctoi(c) & 0x7f
|
| 76 |
+
|
| 77 |
+
def ctrl(c):
|
| 78 |
+
if type(c) == type(""):
|
| 79 |
+
return chr(_ctoi(c) & 0x1f)
|
| 80 |
+
else:
|
| 81 |
+
return _ctoi(c) & 0x1f
|
| 82 |
+
|
| 83 |
+
def alt(c):
|
| 84 |
+
if type(c) == type(""):
|
| 85 |
+
return chr(_ctoi(c) | 0x80)
|
| 86 |
+
else:
|
| 87 |
+
return _ctoi(c) | 0x80
|
| 88 |
+
|
| 89 |
+
def unctrl(c):
|
| 90 |
+
bits = _ctoi(c)
|
| 91 |
+
if bits == 0x7f:
|
| 92 |
+
rep = "^?"
|
| 93 |
+
elif isprint(bits & 0x7f):
|
| 94 |
+
rep = chr(bits & 0x7f)
|
| 95 |
+
else:
|
| 96 |
+
rep = "^" + chr(((b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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
#
|
| 3 |
+
# Emulation of has_key() function for platforms that don't use ncurses
|
| 4 |
+
#
|
| 5 |
+
|
| 6 |
+
import _curses
|
| 7 |
+
|
| 8 |
+
# Table mapping curses keys to the terminfo capability name
|
| 9 |
+
|
| 10 |
+
_capability_names = {
|
| 11 |
+
_curses.KEY_A1: 'ka1',
|
| 12 |
+
_curses.KEY_A3: 'ka3',
|
| 13 |
+
_curses.KEY_B2: 'kb2',
|
| 14 |
+
_curses.KEY_BACKSPACE: 'kbs',
|
| 15 |
+
_curses.KEY_BEG: 'kbeg',
|
| 16 |
+
_curses.KEY_BTAB: 'kcbt',
|
| 17 |
+
_curses.KEY_C1: 'kc1',
|
| 18 |
+
_curses.KEY_C3: 'kc3',
|
| 19 |
+
_curses.KEY_CANCEL: 'kcan',
|
| 20 |
+
_curses.KEY_CATAB: 'ktbc',
|
| 21 |
+
_curses.KEY_CLEAR: 'kclr',
|
| 22 |
+
_curses.KEY_CLOSE: 'kclo',
|
| 23 |
+
_curses.KEY_COMMAND: 'kcmd',
|
| 24 |
+
_curses.KEY_COPY: 'kcpy',
|
| 25 |
+
_curses.KEY_CREATE: 'kcrt',
|
| 26 |
+
_curses.KEY_CTAB: 'kctab',
|
| 27 |
+
_curses.KEY_DC: 'kdch1',
|
| 28 |
+
_curses.KEY_DL: 'kdl1',
|
| 29 |
+
_curses.KEY_DOWN: 'kcud1',
|
| 30 |
+
_curses.KEY_EIC: 'krmir',
|
| 31 |
+
_curses.KEY_END: 'kend',
|
| 32 |
+
_curses.KEY_ENTER: 'kent',
|
| 33 |
+
_curses.KEY_EOL: 'kel',
|
| 34 |
+
_curses.KEY_EOS: 'ked',
|
| 35 |
+
_curses.KEY_EXIT: 'kext',
|
| 36 |
+
_curses.KEY_F0: 'kf0',
|
| 37 |
+
_curses.KEY_F1: 'kf1',
|
| 38 |
+
_curses.KEY_F10: 'kf10',
|
| 39 |
+
_curses.KEY_F11: 'kf11',
|
| 40 |
+
_curses.KEY_F12: 'kf12',
|
| 41 |
+
_curses.KEY_F13: 'kf13',
|
| 42 |
+
_curses.KEY_F14: 'kf14',
|
| 43 |
+
_curses.KEY_F15: 'kf15',
|
| 44 |
+
_curses.KEY_F16: 'kf16',
|
| 45 |
+
_curses.KEY_F17: 'kf17',
|
| 46 |
+
_curses.KEY_F18: 'kf18',
|
| 47 |
+
_curses.KEY_F19: 'kf19',
|
| 48 |
+
_curses.KEY_F2: 'kf2',
|
| 49 |
+
_curses.KEY_F20: 'kf20',
|
| 50 |
+
_curses.KEY_F21: 'kf21',
|
| 51 |
+
_curses.KEY_F22: 'kf22',
|
| 52 |
+
_curses.KEY_F23: 'kf23',
|
| 53 |
+
_curses.KEY_F24: 'kf24',
|
| 54 |
+
_curses.KEY_F25: 'kf25',
|
| 55 |
+
_curses.KEY_F26: 'kf26',
|
| 56 |
+
_curses.KEY_F27: 'kf27',
|
| 57 |
+
_curses.KEY_F28: 'kf28',
|
| 58 |
+
_curses.KEY_F29: 'kf29',
|
| 59 |
+
_curses.KEY_F3: 'kf3',
|
| 60 |
+
_curses.KEY_F30: 'kf30',
|
| 61 |
+
_curses.KEY_F31: 'kf31',
|
| 62 |
+
_curses.KEY_F32: 'kf32',
|
| 63 |
+
_curses.KEY_F33: 'kf33',
|
| 64 |
+
_curses.KEY_F34: 'kf34',
|
| 65 |
+
_curses.KEY_F35: 'kf35',
|
| 66 |
+
_curses.KEY_F36: 'kf36',
|
| 67 |
+
_curses.KEY_F37: 'kf37',
|
| 68 |
+
_curses.KEY_F38: 'kf38',
|
| 69 |
+
_curses.KEY_F39: 'kf39',
|
| 70 |
+
_curses.KEY_F4: 'kf4',
|
| 71 |
+
_curses.KEY_F40: 'kf40',
|
| 72 |
+
_curses.KEY_F41: 'kf41',
|
| 73 |
+
_curses.KEY_F42: 'kf42',
|
| 74 |
+
_curses.KEY_F43: 'kf43',
|
| 75 |
+
_curses.KEY_F44: 'kf44',
|
| 76 |
+
_curses.KEY_F45: 'kf45',
|
| 77 |
+
_curses.KEY_F46: 'kf46',
|
| 78 |
+
_curses.KEY_F47: 'kf47',
|
| 79 |
+
_curses.KEY_F48: 'kf48',
|
| 80 |
+
_curses.KEY_F49: 'kf49',
|
| 81 |
+
_curses.KEY_F5: 'kf5',
|
| 82 |
+
_curses.KEY_F50: 'kf50',
|
| 83 |
+
_curses.KEY_F51: 'kf51',
|
| 84 |
+
_curses.KEY_F52: 'kf52',
|
| 85 |
+
_curses.KEY_F53: 'kf53',
|
| 86 |
+
_curses.KEY_F54: 'kf54',
|
| 87 |
+
_curses.KEY_F55: 'kf55',
|
| 88 |
+
_curses.KEY_F56: 'kf56',
|
| 89 |
+
_curses.KEY_F57: 'kf57',
|
| 90 |
+
_curses.KEY_F58: 'kf58',
|
| 91 |
+
_curses.KEY_F59: 'kf59',
|
| 92 |
+
_curses.KEY_F6: 'kf6',
|
| 93 |
+
_curses.KEY_F60: 'kf60',
|
| 94 |
+
_curses.KEY_F61: 'kf61',
|
| 95 |
+
_curses.KEY_F62: 'kf62',
|
| 96 |
+
_curses.KEY_F63: 'kf63',
|
| 97 |
+
_curses.KEY_F7: 'kf7',
|
| 98 |
+
_curses.KEY_F8: 'kf8',
|
| 99 |
+
_curses.KEY_F9: 'kf9',
|
| 100 |
+
_curses.KEY_FIND: 'kfnd',
|
| 101 |
+
_curses.KEY_HELP: 'khlp',
|
| 102 |
+
_curses.KEY_HOME: 'khome',
|
| 103 |
+
_curses.KEY_IC: 'kich1',
|
| 104 |
+
_curses.KEY_IL: 'kil1',
|
| 105 |
+
_curses.KEY_LEFT: 'kcub1',
|
| 106 |
+
_curses.KEY_LL: 'kll',
|
| 107 |
+
_curses.KEY_MARK: 'kmrk',
|
| 108 |
+
_curses.KEY_MESSAGE: 'kmsg',
|
| 109 |
+
_curses.KEY_MOVE: 'kmov',
|
| 110 |
+
_curses.KEY_NEXT: 'knxt',
|
| 111 |
+
_curses.KEY_NPAGE: 'knp',
|
| 112 |
+
_curses.KEY_OPEN: 'kopn',
|
| 113 |
+
_curses.KEY_OPTIONS: 'kopt',
|
| 114 |
+
_curses.KEY_PPAGE: 'kpp',
|
| 115 |
+
_curses.KEY_PREVIOUS: 'kprv',
|
| 116 |
+
_curses.KEY_PRINT: 'kprt',
|
| 117 |
+
_curses.KEY_REDO: 'krdo',
|
| 118 |
+
_curses.KEY_REFERENCE: 'kref',
|
| 119 |
+
_curses.KEY_REFRESH: 'krfr',
|
| 120 |
+
_curses.KEY_REPLACE: 'krpl',
|
| 121 |
+
_curses.KEY_RESTART: 'krst',
|
| 122 |
+
_curses.KEY_RESUME: 'kres',
|
| 123 |
+
_curses.KEY_RIGHT: 'kcuf1',
|
| 124 |
+
_curses.KEY_SAVE: 'ksav',
|
| 125 |
+
_curses.KEY_SBEG: 'kBEG',
|
| 126 |
+
_curses.KEY_SCANCEL: 'kCAN',
|
| 127 |
+
_curses.KEY_SCOMMAND: 'kCMD',
|
| 128 |
+
_curses.KEY_SCOPY: 'kCPY',
|
| 129 |
+
_curses.KEY_SCREATE: 'kCRT',
|
| 130 |
+
_curses.KEY_SDC: 'kDC',
|
| 131 |
+
_curses.KEY_SDL: 'kDL',
|
| 132 |
+
_curses.KEY_SELECT: 'kslt',
|
| 133 |
+
_curses.KEY_SEND: 'kEND',
|
| 134 |
+
_curses.KEY_SEOL: 'kEOL',
|
| 135 |
+
_curses.KEY_SEXIT: 'kEXT',
|
| 136 |
+
_curses.KEY_SF: 'kind',
|
| 137 |
+
_curses.KEY_SFIND: 'kFND',
|
| 138 |
+
_curses.KEY_SHELP: 'kHLP',
|
| 139 |
+
_curses.KEY_SHOME: 'kHOM',
|
| 140 |
+
_curses.KEY_SIC: 'kIC',
|
| 141 |
+
_curses.KEY_SLEFT: 'kLFT',
|
| 142 |
+
_curses.KEY_SMESSAGE: 'kMSG',
|
| 143 |
+
_curses.KEY_SMOVE: 'kMOV',
|
| 144 |
+
_curses.KEY_SNEXT: 'kNXT',
|
| 145 |
+
_curses.KEY_SOPTIONS: 'kOPT',
|
| 146 |
+
_curses.KEY_SPREVIOUS: 'kPRV',
|
| 147 |
+
_curses.KEY_SPRINT: 'kPRT',
|
| 148 |
+
_curses.KEY_SR: 'kri',
|
| 149 |
+
_curses.KEY_SREDO: 'kRDO',
|
| 150 |
+
_curses.KEY_SREPLACE: 'kRPL',
|
| 151 |
+
_curses.KEY_SRIGHT: 'kRIT',
|
| 152 |
+
_curses.KEY_SRSUME: 'kRES',
|
| 153 |
+
_curses.KEY_SSAVE: 'kSAV',
|
| 154 |
+
_curses.KEY_SSUSPEND: 'kSPD',
|
| 155 |
+
_curses.KEY_STAB: 'khts',
|
| 156 |
+
_curses.KEY_SUNDO: 'kUND',
|
| 157 |
+
_curses.KEY_SUSPEND: 'kspd',
|
| 158 |
+
_curses.KEY_UNDO: 'kund',
|
| 159 |
+
_curses.KEY_UP: 'kcuu1'
|
| 160 |
+
}
|
| 161 |
+
|
| 162 |
+
def has_key(ch):
|
| 163 |
+
if isinstance(ch, str):
|
| 164 |
+
ch = ord(ch)
|
| 165 |
+
|
| 166 |
+
# Figure out the correct capability name for the keycode.
|
| 167 |
+
capability_name = _capability_names.get(ch)
|
| 168 |
+
if capability_name is None:
|
| 169 |
+
return False
|
| 170 |
+
|
| 171 |
+
#Check the current terminal description for that capability;
|
| 172 |
+
#if present, return true, else return false.
|
| 173 |
+
if _curses.tigetstr( capability_name ):
|
| 174 |
+
return True
|
| 175 |
+
else:
|
| 176 |
+
return False
|
| 177 |
+
|
| 178 |
+
if __name__ == '__main__':
|
| 179 |
+
# Compare the output of this implementation and the ncurses has_key,
|
| 180 |
+
# on platforms where has_key is already available
|
| 181 |
+
try:
|
| 182 |
+
L = []
|
| 183 |
+
_curses.initscr()
|
| 184 |
+
for key in _capability_names.keys():
|
| 185 |
+
system = _curses.has_key(key)
|
| 186 |
+
python = has_key(key)
|
| 187 |
+
if system != python:
|
| 188 |
+
L.append( 'Mismatch for key %s, system=%i, Python=%i'
|
| 189 |
+
% (_curses.keyname( key ), system, python) )
|
| 190 |
+
finally:
|
| 191 |
+
_curses.endwin()
|
| 192 |
+
for i in L: print(i)
|
janus/lib/python3.10/curses/panel.py
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""curses.panel
|
| 2 |
+
|
| 3 |
+
Module for using panels with curses.
|
| 4 |
+
"""
|
| 5 |
+
|
| 6 |
+
from _curses_panel import *
|
janus/lib/python3.10/curses/textpad.py
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Simple textbox editing widget with Emacs-like keybindings."""
|
| 2 |
+
|
| 3 |
+
import curses
|
| 4 |
+
import curses.ascii
|
| 5 |
+
|
| 6 |
+
def rectangle(win, uly, ulx, lry, lrx):
|
| 7 |
+
"""Draw a rectangle with corners at the provided upper-left
|
| 8 |
+
and lower-right coordinates.
|
| 9 |
+
"""
|
| 10 |
+
win.vline(uly+1, ulx, curses.ACS_VLINE, lry - uly - 1)
|
| 11 |
+
win.hline(uly, ulx+1, curses.ACS_HLINE, lrx - ulx - 1)
|
| 12 |
+
win.hline(lry, ulx+1, curses.ACS_HLINE, lrx - ulx - 1)
|
| 13 |
+
win.vline(uly+1, lrx, curses.ACS_VLINE, lry - uly - 1)
|
| 14 |
+
win.addch(uly, ulx, curses.ACS_ULCORNER)
|
| 15 |
+
win.addch(uly, lrx, curses.ACS_URCORNER)
|
| 16 |
+
win.addch(lry, lrx, curses.ACS_LRCORNER)
|
| 17 |
+
win.addch(lry, ulx, curses.ACS_LLCORNER)
|
| 18 |
+
|
| 19 |
+
class Textbox:
|
| 20 |
+
"""Editing widget using the interior of a window object.
|
| 21 |
+
Supports the following Emacs-like key bindings:
|
| 22 |
+
|
| 23 |
+
Ctrl-A Go to left edge of window.
|
| 24 |
+
Ctrl-B Cursor left, wrapping to previous line if appropriate.
|
| 25 |
+
Ctrl-D Delete character under cursor.
|
| 26 |
+
Ctrl-E Go to right edge (stripspaces off) or end of line (stripspaces on).
|
| 27 |
+
Ctrl-F Cursor right, wrapping to next line when appropriate.
|
| 28 |
+
Ctrl-G Terminate, returning the window contents.
|
| 29 |
+
Ctrl-H Delete character backward.
|
| 30 |
+
Ctrl-J Terminate if the window is 1 line, otherwise insert newline.
|
| 31 |
+
Ctrl-K If line is blank, delete it, otherwise clear to end of line.
|
| 32 |
+
Ctrl-L Refresh screen.
|
| 33 |
+
Ctrl-N Cursor down; move down one line.
|
| 34 |
+
Ctrl-O Insert a blank line at cursor location.
|
| 35 |
+
Ctrl-P Cursor up; move up one line.
|
| 36 |
+
|
| 37 |
+
Move operations do nothing if the cursor is at an edge where the movement
|
| 38 |
+
is not possible. The following synonyms are supported where possible:
|
| 39 |
+
|
| 40 |
+
KEY_LEFT = Ctrl-B, KEY_RIGHT = Ctrl-F, KEY_UP = Ctrl-P, KEY_DOWN = Ctrl-N
|
| 41 |
+
KEY_BACKSPACE = Ctrl-h
|
| 42 |
+
"""
|
| 43 |
+
def __init__(self, win, insert_mode=False):
|
| 44 |
+
self.win = win
|
| 45 |
+
self.insert_mode = insert_mode
|
| 46 |
+
self._update_max_yx()
|
| 47 |
+
self.stripspaces = 1
|
| 48 |
+
self.lastcmd = None
|
| 49 |
+
win.keypad(1)
|
| 50 |
+
|
| 51 |
+
def _update_max_yx(self):
|
| 52 |
+
maxy, maxx = self.win.getmaxyx()
|
| 53 |
+
self.maxy = maxy - 1
|
| 54 |
+
self.maxx = maxx - 1
|
| 55 |
+
|
| 56 |
+
def _end_of_line(self, y):
|
| 57 |
+
"""Go to the location of the first blank on the given line,
|
| 58 |
+
returning the index of the last non-blank character."""
|
| 59 |
+
self._update_max_yx()
|
| 60 |
+
last = self.maxx
|
| 61 |
+
while True:
|
| 62 |
+
if curses.ascii.ascii(self.win.inch(y, last)) != curses.ascii.SP:
|
| 63 |
+
last = min(self.maxx, last+1)
|
| 64 |
+
break
|
| 65 |
+
elif last == 0:
|
| 66 |
+
break
|
| 67 |
+
last = last - 1
|
| 68 |
+
return last
|
| 69 |
+
|
| 70 |
+
def _insert_printable_char(self, ch):
|
| 71 |
+
self._update_max_yx()
|
| 72 |
+
(y, x) = self.win.getyx()
|
| 73 |
+
backyx = None
|
| 74 |
+
while y < self.maxy or x < self.maxx:
|
| 75 |
+
if self.insert_mode:
|
| 76 |
+
oldch = self.win.inch()
|
| 77 |
+
# The try-catch ignores the error we trigger from some curses
|
| 78 |
+
# versions by trying to write into the lowest-rightmost spot
|
| 79 |
+
# in the window.
|
| 80 |
+
try:
|
| 81 |
+
self.win.addch(ch)
|
| 82 |
+
except curses.error:
|
| 83 |
+
pass
|
| 84 |
+
if not self.insert_mode or not curses.ascii.isprint(oldch):
|
| 85 |
+
break
|
| 86 |
+
ch = oldch
|
| 87 |
+
(y, x) = self.win.getyx()
|
| 88 |
+
# Remember where to put the cursor back since we are in insert_mode
|
| 89 |
+
if backyx is None:
|
| 90 |
+
backyx = y, x
|
| 91 |
+
|
| 92 |
+
if backyx is not None:
|
| 93 |
+
self.win.move(*backyx)
|
| 94 |
+
|
| 95 |
+
def do_command(self, ch):
|
| 96 |
+
"Process a single editing command."
|
| 97 |
+
self._update_max_yx()
|
| 98 |
+
(y, x) = self.win.getyx()
|
| 99 |
+
self.lastcmd = ch
|
| 100 |
+
if curses.ascii.isprint(ch):
|
| 101 |
+
if y < self.maxy or x < self.maxx:
|
| 102 |
+
self._insert_printable_char(ch)
|
| 103 |
+
elif ch == curses.ascii.SOH: # ^a
|
| 104 |
+
self.win.move(y, 0)
|
| 105 |
+
elif ch in (curses.ascii.STX,curses.KEY_LEFT, curses.ascii.BS,curses.KEY_BACKSPACE):
|
| 106 |
+
if x > 0:
|
| 107 |
+
self.win.move(y, x-1)
|
| 108 |
+
elif y == 0:
|
| 109 |
+
pass
|
| 110 |
+
elif self.stripspaces:
|
| 111 |
+
self.win.move(y-1, self._end_of_line(y-1))
|
| 112 |
+
else:
|
| 113 |
+
self.win.move(y-1, self.maxx)
|
| 114 |
+
if ch in (curses.ascii.BS, curses.KEY_BACKSPACE):
|
| 115 |
+
self.win.delch()
|
| 116 |
+
elif ch == curses.ascii.EOT: # ^d
|
| 117 |
+
self.win.delch()
|
| 118 |
+
elif ch == curses.ascii.ENQ: # ^e
|
| 119 |
+
if self.stripspaces:
|
| 120 |
+
self.win.move(y, self._end_of_line(y))
|
| 121 |
+
else:
|
| 122 |
+
self.win.move(y, self.maxx)
|
| 123 |
+
elif ch in (curses.ascii.ACK, curses.KEY_RIGHT): # ^f
|
| 124 |
+
if x < self.maxx:
|
| 125 |
+
self.win.move(y, x+1)
|
| 126 |
+
elif y == self.maxy:
|
| 127 |
+
pass
|
| 128 |
+
else:
|
| 129 |
+
self.win.move(y+1, 0)
|
| 130 |
+
elif ch == curses.ascii.BEL: # ^g
|
| 131 |
+
return 0
|
| 132 |
+
elif ch == curses.ascii.NL: # ^j
|
| 133 |
+
if self.maxy == 0:
|
| 134 |
+
return 0
|
| 135 |
+
elif y < self.maxy:
|
| 136 |
+
self.win.move(y+1, 0)
|
| 137 |
+
elif ch == curses.ascii.VT: # ^k
|
| 138 |
+
if x == 0 and self._end_of_line(y) == 0:
|
| 139 |
+
self.win.deleteln()
|
| 140 |
+
else:
|
| 141 |
+
# first undo the effect of self._end_of_line
|
| 142 |
+
self.win.move(y, x)
|
| 143 |
+
self.win.clrtoeol()
|
| 144 |
+
elif ch == curses.ascii.FF: # ^l
|
| 145 |
+
self.win.refresh()
|
| 146 |
+
elif ch in (curses.ascii.SO, curses.KEY_DOWN): # ^n
|
| 147 |
+
if y < self.maxy:
|
| 148 |
+
self.win.move(y+1, x)
|
| 149 |
+
if x > self._end_of_line(y+1):
|
| 150 |
+
self.win.move(y+1, self._end_of_line(y+1))
|
| 151 |
+
elif ch == curses.ascii.SI: # ^o
|
| 152 |
+
self.win.insertln()
|
| 153 |
+
elif ch in (curses.ascii.DLE, curses.KEY_UP): # ^p
|
| 154 |
+
if y > 0:
|
| 155 |
+
self.win.move(y-1, x)
|
| 156 |
+
if x > self._end_of_line(y-1):
|
| 157 |
+
self.win.move(y-1, self._end_of_line(y-1))
|
| 158 |
+
return 1
|
| 159 |
+
|
| 160 |
+
def gather(self):
|
| 161 |
+
"Collect and return the contents of the window."
|
| 162 |
+
result = ""
|
| 163 |
+
self._update_max_yx()
|
| 164 |
+
for y in range(self.maxy+1):
|
| 165 |
+
self.win.move(y, 0)
|
| 166 |
+
stop = self._end_of_line(y)
|
| 167 |
+
if stop == 0 and self.stripspaces:
|
| 168 |
+
continue
|
| 169 |
+
for x in range(self.maxx+1):
|
| 170 |
+
if self.stripspaces and x > stop:
|
| 171 |
+
break
|
| 172 |
+
result = result + chr(curses.ascii.ascii(self.win.inch(y, x)))
|
| 173 |
+
if self.maxy > 0:
|
| 174 |
+
result = result + "\n"
|
| 175 |
+
return result
|
| 176 |
+
|
| 177 |
+
def edit(self, validate=None):
|
| 178 |
+
"Edit in the widget window and collect the results."
|
| 179 |
+
while 1:
|
| 180 |
+
ch = self.win.getch()
|
| 181 |
+
if validate:
|
| 182 |
+
ch = validate(ch)
|
| 183 |
+
if not ch:
|
| 184 |
+
continue
|
| 185 |
+
if not self.do_command(ch):
|
| 186 |
+
break
|
| 187 |
+
self.win.refresh()
|
| 188 |
+
return self.gather()
|
| 189 |
+
|
| 190 |
+
if __name__ == '__main__':
|
| 191 |
+
def test_editbox(stdscr):
|
| 192 |
+
ncols, nlines = 9, 4
|
| 193 |
+
uly, ulx = 15, 20
|
| 194 |
+
stdscr.addstr(uly-2, ulx, "Use Ctrl-G to end editing.")
|
| 195 |
+
win = curses.newwin(nlines, ncols, uly, ulx)
|
| 196 |
+
rectangle(stdscr, uly-1, ulx-1, uly + nlines, ulx + ncols)
|
| 197 |
+
stdscr.refresh()
|
| 198 |
+
return Textbox(win).edit()
|
| 199 |
+
|
| 200 |
+
str = curses.wrapper(test_editbox)
|
| 201 |
+
print('Contents of text box:', repr(str))
|
janus/lib/python3.10/email/__pycache__/__init__.cpython-310.pyc
ADDED
|
Binary file (1.81 kB). View file
|
|
|
janus/lib/python3.10/email/__pycache__/_encoded_words.cpython-310.pyc
ADDED
|
Binary file (5.99 kB). View file
|
|
|
janus/lib/python3.10/email/__pycache__/_policybase.cpython-310.pyc
ADDED
|
Binary file (15.5 kB). View file
|
|
|
janus/lib/python3.10/email/__pycache__/base64mime.cpython-310.pyc
ADDED
|
Binary file (3.49 kB). View file
|
|
|
janus/lib/python3.10/email/__pycache__/contentmanager.cpython-310.pyc
ADDED
|
Binary file (7.64 kB). View file
|
|
|
janus/lib/python3.10/email/__pycache__/feedparser.cpython-310.pyc
ADDED
|
Binary file (10.8 kB). View file
|
|
|
janus/lib/python3.10/email/__pycache__/generator.cpython-310.pyc
ADDED
|
Binary file (13 kB). View file
|
|
|
janus/lib/python3.10/email/__pycache__/header.cpython-310.pyc
ADDED
|
Binary file (16.7 kB). View file
|
|
|
janus/lib/python3.10/email/__pycache__/headerregistry.cpython-310.pyc
ADDED
|
Binary file (22.2 kB). View file
|
|
|
janus/lib/python3.10/email/__pycache__/parser.cpython-310.pyc
ADDED
|
Binary file (5.67 kB). View file
|
|
|
janus/lib/python3.10/email/__pycache__/policy.cpython-310.pyc
ADDED
|
Binary file (9.91 kB). View file
|
|
|
janus/lib/python3.10/email/__pycache__/quoprimime.cpython-310.pyc
ADDED
|
Binary file (7.88 kB). View file
|
|
|