-
Notifications
You must be signed in to change notification settings - Fork 162
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Autodetect appropriate toolchain #560
base: master
Are you sure you want to change the base?
Autodetect appropriate toolchain #560
Conversation
Fixes a bug where PATH variables were not quoted.
The Unix-based build script assumes GCC to build Open Watcom. However, some operating systems (notably FreeBSD and Darwin/macOS) do not ship with GCC anymore, resulting in the build failing. This commit adds a rudimentary form of auto-detection based on the host's `uname` value to determine a suitable default toolchain.
I'm not sure I agree with just arbitrarily autodetecting the toolchain. If I wanted to use GCC on macOS (if I'm using a separate GCC install or I'm running on an older release), I'd need to comment out this entire block. Additionally, I use Open Watcom on Linux to build Open Watcom, and this autodetection will force GCC without commenting it out. I think the current, well-commented line where you simply choose which toolchain manually is better. Perhaps if the autodetection was only triggered if nothing was selected, this change might be better. Or possibly a quick check to see if the toolchain is available before launching the build, producing an explicit error, might be okay. |
I understand your efort to improve OW build system. |
Anyway build system was improved to use only OW and POSIX tools on all preffered platforms. |
I agree with the 'nothing is selected approach', and if you're okay with that, I'll implement that? Both macOS and FreeBSD do not have GCC installed by default if you install the development tools (they ship with clang/llvm), so just running the script without editing it would result in a hard fail. |
Yes it will fail because it is not preffered platform. |
Generaly we are able to build OW on any POSIX system, but created OW is not usable on such system until OW port will be done for appropriate system. |
# Automatically try to determine appropriate toolchain | ||
|
||
case `uname` in | ||
FreeBSD) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about NetBSD and OpenBSD?
Why not just set CLANG as default, who even uses GCC anymore, stallman? Btw, the build process on macOS seem to work surprisingly well - only issues I had before the build actually got started was some realpath cmd missing, but simply |
Thanks for your notes. Take into account, OW is cross-compiled on macOS, but can not be used to create macOS native application. |
By the way, you can setup SourceHut CI jobs that supports FreeBSD and OpenBSD (and hopefully NetBSD in the future): |
I believe for almost all Linux distros, cc will be a symlink or hardlink to gcc on Linux, and c++ a link to g++. On modern versions of FreeBSD, cc hardlinks to clang and c++ to clang++. I assume it's the same for MacOS. So unless I'm mistaken it should be safe to just use cc and c++ on *nix systems instead of trying to detect what to use. |
Good point. |
The Unix-based build script assumes GCC to build Open Watcom. However,
some operating systems (notably FreeBSD and Darwin/macOS) do not ship
with GCC anymore, resulting in the build failing.
This commit adds a rudimentary form of auto-detection based on the
host's
uname
value to determine a suitable default toolchain.