mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-11-08 07:50:09 +01:00
Libc (FreeBSD): uses base objdump to detect libc version
The FBSD version was only detected when binutils' /usr/local/bin/objdump was installed. Supported FreeBSD releases ship llvm-objdump as /usr/bin/objdump in base, which gives the same result, so try it first like MidnightBSD already does and keep /usr/local/bin/objdump as a fallback. DragonFly sets FreeBSD too, so exclude it from both branches. Until now the FreeBSD branch caught DragonFly first and the DF version was never detected.
This commit is contained in:
@@ -1,3 +1,8 @@
|
||||
# Unreleased
|
||||
|
||||
Bugfixes:
|
||||
* Fixed libc version detection on FreeBSD without binutils installed, and on DragonFly BSD. (Libc, FreeBSD / DragonFly)
|
||||
|
||||
# 2.71.0
|
||||
|
||||
Features:
|
||||
|
||||
+2
-2
@@ -1610,14 +1610,14 @@ if(APPLE AND EXISTS "/usr/bin/otool")
|
||||
target_compile_definitions(libfastfetch PUBLIC FF_LIBSYSTEM_VERSION="${CMAKE_MATCH_1}")
|
||||
endif()
|
||||
endif()
|
||||
if(MidnightBSD AND EXISTS "/usr/bin/objdump")
|
||||
if(FreeBSD AND NOT DragonFly AND EXISTS "/usr/bin/objdump")
|
||||
execute_process(COMMAND /bin/sh -c "/usr/bin/objdump -T /lib/libc.so.* | grep 'FBSD_[0-9][0-9]*\\.[0-9][0-9]*' -o | sort -Vru | head -1"
|
||||
OUTPUT_VARIABLE OBJDUMP_T_RESULT)
|
||||
if("${OBJDUMP_T_RESULT}" MATCHES "FBSD_([0-9]+\\.[0-9]+)")
|
||||
message(STATUS "Found FBSD ${CMAKE_MATCH_1}")
|
||||
target_compile_definitions(libfastfetch PUBLIC FF_FBSD_VERSION="${CMAKE_MATCH_1}")
|
||||
endif()
|
||||
elseif(FreeBSD AND EXISTS "/usr/local/bin/objdump")
|
||||
elseif(FreeBSD AND NOT DragonFly AND EXISTS "/usr/local/bin/objdump")
|
||||
execute_process(COMMAND /bin/sh -c "/usr/local/bin/objdump -T /lib/libc.so.* | grep 'FBSD_[0-9][0-9]*\\.[0-9][0-9]*' -o | sort -Vru | head -1"
|
||||
OUTPUT_VARIABLE OBJDUMP_T_RESULT)
|
||||
if("${OBJDUMP_T_RESULT}" MATCHES "FBSD_([0-9]+\\.[0-9]+)")
|
||||
|
||||
Reference in New Issue
Block a user