The 'tool' build script previously required bash. This commit changes it
to need only POSIX sh, which removes a dependency from the project. bash
is a bit easier to work with than POSIX sh, but the trade-off seems
worth it in this case. We already require POSIX, so we're guaranteed to
have access to POSIX sh. Some systems may not have bash.
As an added bonus, the startup time of the script will probably be
slightly faster by a few milliseconds, because some implementations like
dash start up faster than bash.
One downside is that POSIX sh doesn't have a built-in for 'time', and
one of my testing environments, a stripped-down Ubuntu image, didn't
have 'time' installed by default. I believe 'time' is mandatory in
POSIX, so that's a bit strange. I think this might be a common thing, so
I added a case to handle it in the 'tool' script, instead of having the
script fail.
I had believed this case was working correctly, but an edit to reduce
the number of used local variables had introduced a mistake that caused
it to fail. This commit fixes the problem by overwriting the variable
where the captured output of a failed pkg-config attempt was stored with
0, so that the subsequent if branch works correctly.
Depending on the Linux distro, ncurses may be built with tinfo as a
separate library that needs to be explicitly linked, or it may not.
Trying to pass -ltinfo when you don't need to might cause a linking
error. Failing to pass -ltinfo when you need to might cause a linking
error. And you might need to pass -ltinfow instead of -ltinfo, or you
might not. And if you get that wrong, you might cause a linking error.
This commit adds use pkg-config to the tool build script, attempting to
discover what args to use. This is only done on Linux. On other
platforms, or if pkg-config returns an error, we use the same hard-coded
options as before: -lncursesw -lformw
This probably adds about 5 or 10 milliseconds to the execution time of
the tool script.
This commit implements the Qnav/Qmenu system directly in ncurses,
replacing the old implementation which relied on the 'menu' library.
The new code is shorter, easier to read, and doesn't need the 'menu'
library to be linked.
For users, the behavior of the menus should be the same.
We still rely on the 'form' library for text field input in the menus.
*mingw32*.exe will not build the orca TUI correctly, though it may build
the CLI. If the compiler name isn't specified, like with `-c gcc`, then
it may default to the CC environment variable, which may be set to mingw
gcc instead of 'regular' cygwin gcc. This patch to `tool` fixes this
issue by guarding against the two known names of the mingw compiler .exe
when the detected OS is cygwin, and ignoring them, and instead
specifying `gcc` directly (unless overridden by the user with the `-c`
option.)
`sdd` was the first attempt at making one of these
individually-allocated string management/utility things. I didn't end up
liking the design, so I tried again from scratch, and called the new one
`oso`. Let's see how that one turns out. The name might change again in
the future, though I feel better about the design of this one.