Klammertext runs natively on Windows; a Windows source-install guide; the bundled sh for @eval :shell
Assembled from klammertext-dev f344a37d0f6e. The commands, the library,
the Standard Klammer Set, the reflection klammerset and the Python
binding build and run natively on Windows (MSYS2 UCRT64 gcc, python.org
Python), and both test tiers pass there. doc/install/windows_source_install.md
is the fifth install guide: a source install parallel to the Linux and
macOS ones, verified by following it on a pristine Windows 11.
Behaviour on every system: paths Klammertext prints use forward slashes;
output is LF; the command line is UTF-8 on Windows; @eval :shell is a
POSIX shell command everywhere -- on Windows it runs the sh Klammertext
ships, BusyBox for Windows (win/busybox/, GPLv2, with its licence and the
source pointer). KLAMMERTEXT_FONTS and KLAMMERTEXT_KLAMMERSETS are lists in
the system's PATH convention (';' on Windows). On Linux and macOS nothing
observable changes.
This commit is contained in:
1 parent
f9af1ff869
commit
fe475e774a
55 files changed
+1182
-153
No files matched your search
Vendored
+37
-1
@@ -27,9 +27,20 @@ else
|
||||
COMPILER ?= gcc # gcc | clang
|
||||
endif
|
||||
|
||||
# Python: version- and platform-agnostic, no hardcoded paths.
|
||||
# Python: version- and platform-agnostic, no hardcoded paths. On Windows the
|
||||
# interpreter is python.org's (the one PyPI wheels -- OpenImageIO -- are built
|
||||
# for); it ships no python3-config, so its prefix is asked of the interpreter
|
||||
# itself and its import library named by version (libs/python312.lib).
|
||||
ifneq (,$(filter MINGW% MSYS%,$(UNAME_S)))
|
||||
PYTHON := python
|
||||
PYTHON_PREFIX := $(shell cygpath -m "$$($(PYTHON) -c 'import sys; print(sys.base_prefix)')")
|
||||
PYTHON_INC := -I"$(PYTHON_PREFIX)/Include"
|
||||
PYTHON_LIB := -L"$(PYTHON_PREFIX)/libs" -l$(shell $(PYTHON) -c 'import sys; print("python%d%d" % sys.version_info[:2])')
|
||||
else
|
||||
PYTHON := python3
|
||||
PYTHON_INC := $(shell python3-config --includes)
|
||||
PYTHON_LIB := $(shell python3-config --ldflags --embed)
|
||||
endif
|
||||
|
||||
# Flags common to all platforms.
|
||||
CPPFLAGS = -I$(KLAMMERTEXT_HOME)/mac $(PYTHON_INC)
|
||||
@@ -52,6 +63,29 @@ SHARED = -dynamiclib
|
||||
SONAME = -install_name @rpath/$(notdir $@)
|
||||
ORIGIN := @loader_path
|
||||
EXPORT_DYNAMIC = -Wl,-export_dynamic
|
||||
else ifneq (,$(filter MINGW% MSYS%,$(UNAME_S)))
|
||||
# ---------- Windows (MSYS2, UCRT64 environment; native PE binaries) ----------
|
||||
# uname says MINGW64_NT-... under UCRT64 too. The compilers come from the
|
||||
# environment's PATH (/ucrt64/bin). libdl.a is the mingw-w64-dlfcn shim over
|
||||
# LoadLibrary, linked statically so no libdl.dll travels with the products.
|
||||
# PE has no soname and no rpath; a DLL is found through PATH or
|
||||
# the executable's own directory, and GNU ld's -l search list on PE does not
|
||||
# include ".so", hence the exact-name form below.
|
||||
GCC := g++
|
||||
CLANG := clang++
|
||||
LDFLAGS =
|
||||
LDLIBS = -l:libdl.a $(if $(NOPYTHON),,$(PYTHON_LIB))
|
||||
SHARED = -shared
|
||||
SONAME =
|
||||
ORIGIN := $$ORIGIN
|
||||
EXPORT_DYNAMIC = -Wl,--export-all-symbols
|
||||
KLAMMERTEXT_LIB = -l:libklammertext.so
|
||||
# A Windows program finds a DLL through PATH or its own directory, never an
|
||||
# rpath. So every directory that holds a program or a Python extension also
|
||||
# holds the DLLs it needs: libklammertext.so and the three gcc runtime DLLs
|
||||
# the toolchain links (from the compiler's own bin/). com/ and kpy/ copy them.
|
||||
GCC_BIN := $(dir $(shell cygpath -m "$$(command -v g++)"))
|
||||
GCC_RUNTIME_DLLS := libstdc++-6.dll libgcc_s_seh-1.dll libwinpthread-1.dll
|
||||
else
|
||||
# ---------- Linux ----------
|
||||
GCC := /usr/bin/g++
|
||||
@@ -63,6 +97,8 @@ SONAME = -Wl,-soname,$(notdir $@)
|
||||
ORIGIN := $$ORIGIN
|
||||
EXPORT_DYNAMIC = -rdynamic
|
||||
endif
|
||||
# How a link line names libklammertext (set above for Windows).
|
||||
KLAMMERTEXT_LIB ?= -lklammertext
|
||||
|
||||
# Resolve the compiler choice (gcc by default; clang with COMPILER=clang).
|
||||
CXX := $(if $(filter clang,$(COMPILER)),$(CLANG),$(GCC))
|
||||
Reference in new issue
Block a user