]> git.ipfire.org Git - thirdparty/curl.git/commit
autotools: fix/improve gcc and Apple clang version detection
authorViktor Szakats <commit@vsz.me>
Sun, 19 Nov 2023 23:31:40 +0000 (23:31 +0000)
committerViktor Szakats <commit@vsz.me>
Mon, 20 Nov 2023 22:28:17 +0000 (22:28 +0000)
commit95231921b2ca25af24e059a1f37a07971acedbde
treeee5649f7e6a18974ff09f6ddcf5002b23ab5b919
parent3215a7916e0d06d3c9585c28bcf9616922d5e5c7
autotools: fix/improve gcc and Apple clang version detection

- 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 and handling a dotless (major-only)
  version number by assuming `.0` in that case.

  `9.3-posix`, `9.3-win32`, `6`, `9.3.0`, `11`, `11.2`, `11.2.0`
  Ref: https://github.com/mamedev/mame/pull/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:
- https://github.com/libssh2/libssh2/commit/00a3b88c51cdb407fbbb347a2e38c5c7d89875ad
  https://github.com/libssh2/libssh2/pull/1187
- https://github.com/libssh2/libssh2/commit/89ccc83c7da73e7ca3a112e350008131942b592e
  https://github.com/libssh2/libssh2/pull/1232

Closes #12362
m4/curl-compilers.m4