autotools: fix/improve gcc and Apple clang version detection#12362
Closed
vszakats wants to merge 4 commits into
Closed
autotools: fix/improve gcc and Apple clang version detection#12362vszakats wants to merge 4 commits into
vszakats wants to merge 4 commits into
Conversation
Member
Is cut's |
Member
Author
|
But, we need to fill the blank with a zero, so this is what I was experiment with instead: --- a/m4/curl-compilers.m4
+++ b/m4/curl-compilers.m4
@@ -160,7 +160,11 @@ AC_DEFUN([CURL_CHECK_COMPILER_GNU_C], [
compiler_id="GNU_C"
gccver=`$CC -dumpversion`
gccvhi=`echo $gccver | cut -d . -f1`
- gccvlo=`echo $gccver | cut -d . -f2`
+ if echo $gccver | grep -F "." >/dev/null; then
+ gccvlo=`echo $gccver | cut -d . -f2`
+ else
+ gccvlo="0"
+ fi
compiler_num=`(expr $gccvhi "*" 100 + $gccvlo) 2>/dev/null`
flags_dbg_yes="-g"
flags_opt_all="-O -O0 -O1 -O2 -O3 -Os -Og -Ofast" |
Before this patch we expected `n.n` `-dumpversion` output, but Ubuntu may return `n-win32` (also with `-dumpfullversion`). Causing these errors and failing to enable picky warnings: ``` ../configure: line 23845: test: : integer expression expected ``` Ref: https://github.com/libssh2/libssh2/actions/runs/6263453828/job/17007893718#step:5:143 Fix that by stripping any dash-suffix. gcc version detection is still half broken because we translate '10' to '10.10' because `cut -d. -f2` returns the first word if the delimiter missing. More possible `-dumpversion` output: `10-posix`, `10-win32`, `9.3-posix`, `9.3-win32`, `6`, `9.3.0`, `11`, `11.2`, `11.2.0` Ref: mamedev/mame#9767 Copied from project libssh2: libssh2/libssh2@00a3b88 libssh2/libssh2#1187 Closes #xxxxx
4db23ba to
862a1a7
Compare
This comment was marked as resolved.
This comment was marked as resolved.
Member
Author
|
Merged #12358 into this PR, and also applied the Xcode version fixes from libssh2/libssh2#1232. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Before this patch we expected
n.n-dumpversionoutput, but Ubuntumay return
n-win32(also with-dumpfullversion). Causing theseerrors and failing to enable picky warnings:
Ref: https://github.com/libssh2/libssh2/actions/runs/6263453828/job/17007893718#step:5:143
Fix that by stripping any dash-suffix and handling a dotless (major-only)
version number by assuming
.0in that case.9.3-posix,9.3-win32,6,9.3.0,11,11.2,11.2.0Ref: fix version detection in str_to_version for versions formatted as (n).(n)-suffix mamedev/mame#9767
fix Apple clang version detection for releases between
'Apple LLVM version 7.3.0' and 'Apple LLVM version 10.0.1' where the
version was under-detected as 3.7 llvm/clang equivalent.
fix Apple clang version detection for 'Apple clang version 11.0.0'
and newer where the Apple clang version was detected, instead of its
llvm/clang equivalent.
display detected clang/gcc/icc compiler version.
Via libssh2:
autotools: fix selecting wincng in cross-builds libssh2/libssh2#1187
autotools: fix dotless gcc and Apple clang version detections libssh2/libssh2#1232
Closes #12362