-
Notifications
You must be signed in to change notification settings - Fork 516
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
Display Linux variant at ./configure time #1928
Conversation
Sample output: CenOS Stream 9
Debian Trixie
Ubuntu Noble
Gentoo
MacOS
|
* In Autoconf, _cv_ "Indicates that this shell variable is a cache value". * /etc/os-release may be Linux-specific, but our code is not. * This is `build` info (as opposed to `host` or `target`). * Match os-release source instead of introducing "distro name". * Removed excessive empty lines.
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.
Thank you for this addition! I am sure this code can be enhanced to cover other OSes, but we do not have to do that in this PR.
While those grep
commands can be merged into one and sed commands can be removed using unportable grep features like grep -P
(available on Linux), keeping that part of code more portable might help in future enhancements.
I adjusted PR title to reduce "configuration" ambiguity and committed minor polishing touches. Please adjust further as needed -- I only insist on _cv_
removal.
I thought about it, but that wouldn't work:
There really is no standardisation on the contents of /etc/os-release, it seems. We really need a logic like "try PRETTY_NAME, and if not available fall back on NAME"
I don't think coverin gother OSes will be necessary, they should be already covered by the "simplified host os" line above. |
This is not my area of expertise. I am happy to assume that you are right. Do you want to try to remove those |
Nah, I'd leave as-is. We still want to adhere to best autoconf practices and make least assumptions possible on the host system. |
Linux standards offer an /etc/os-release file containing information about the operating system. Parse that file and print an identifier of the Linux version at configure time.
Linux standards offer an /etc/os-release file containing information about the operating system. Parse that file and print an identifier of the Linux version at configure time.
Linux standards offer an /etc/os-release file containing information about the operating system. Parse that file and print an identifier of the Linux version at configure time.
Backported for 6.12 |
Linux standards offer an /etc/os-release file containing information about the operating system. Parse that file and print an identifier of the Linux version at configure time.
Linux standards offer an /etc/os-release file containing
information about the operating system.
Parse that file and print an identifier of the Linux version at
configure time.