Klammertext runs natively on Windows; a Windows source-install guide; the bundled sh for @eval :shell
Assembled from klammertext-dev f344a37d772c. 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
830b19394d
55 files changed
+1182
-153
No files matched your search
+21
-4
@@ -1,3 +1,7 @@
|
||||
#ifdef _WIN32
|
||||
#include <fcntl.h>
|
||||
#include <io.h>
|
||||
#endif
|
||||
#include <tuple>
|
||||
|
||||
#include "argv.h"
|
||||
@@ -21,11 +25,24 @@ fs::path construct_command_pathname(char* command)
|
||||
return fs::current_path() / fs::path(command).filename();
|
||||
}
|
||||
|
||||
void set_command_identity(const std::string& name, const std::string& pathname)
|
||||
{
|
||||
command_name = name;
|
||||
command_pathname = pathname;
|
||||
}
|
||||
|
||||
void set_verbose_level(int argc, char* argv[])
|
||||
{
|
||||
#ifdef _WIN32
|
||||
// Klammertext writes LF on every system: a document a Windows user pipes
|
||||
// or redirects must not gain CR, and the suites read the streams byte for
|
||||
// byte. The C runtime's text mode would append it to every line.
|
||||
_setmode(_fileno(stdout), _O_BINARY);
|
||||
_setmode(_fileno(stderr), _O_BINARY);
|
||||
#endif
|
||||
//command_name = absolute_pathname(argv[0]);
|
||||
command_name = std::string(argv[0]);
|
||||
command_pathname = construct_command_pathname(argv[0]);
|
||||
command_name = fs::path(argv[0]).generic_string();
|
||||
command_pathname = construct_command_pathname(argv[0]).generic_string();
|
||||
//std::cout << "set_verbose_level: " << command_pathname << "\n";
|
||||
|
||||
Argv args {};
|
||||
@@ -140,7 +157,7 @@ void set_command_state(
|
||||
if (!input_filenames.empty()) {
|
||||
S.set("K_input_dir", absolute_pathname(file_directory(input_filenames[0])));
|
||||
} else {
|
||||
S.set("K_input_dir", fs::current_path().string());
|
||||
S.set("K_input_dir", fs::current_path().generic_string());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -178,7 +195,7 @@ void load_klammersets(Machine& machine, const strings_t& symbols)
|
||||
continue;
|
||||
}
|
||||
std::string klammerset_filename = resolve_klammerset_symbol(
|
||||
symbol, machine.m_state.value("K_input_dir"), Locator::none()).string();
|
||||
symbol, machine.m_state.value("K_input_dir"), Locator::none()).generic_string();
|
||||
// Symbol -> file is the search path's answer, and the search
|
||||
// path has three stages with shadowing: the file it landed on is
|
||||
// exactly what a user cannot read off "--klammersets x".
|
||||
|
||||
Reference in new issue
Block a user