diff --git a/CMakeLists.txt b/CMakeLists.txt index 3d93c4ab9..b8cbc1d18 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -69,7 +69,7 @@ cmake_dependent_option(ENABLE_FREETYPE "Enable freetype" ON "ANDROID" OFF) cmake_dependent_option(ENABLE_PULSE "Enable pulse" ON "LINUX OR SunOS" OFF) cmake_dependent_option(ENABLE_DDCUTIL "Enable ddcutil" ON "LINUX" OFF) cmake_dependent_option(ENABLE_DIRECTX_HEADERS "Enable DirectX headers for WSL" ON "LINUX" OFF) -cmake_dependent_option(ENABLE_ELF "Enable libelf" ON "LINUX OR FreeBSD OR ANDROID" OFF) +cmake_dependent_option(ENABLE_ELF "Enable libelf" ON "LINUX OR ANDROID" OFF) cmake_dependent_option(ENABLE_THREADS "Enable multithreading" ON "Threads_FOUND" OFF) cmake_dependent_option(ENABLE_LIBZFS "Enable libzfs" ON "LINUX OR FreeBSD OR SunOS" OFF) diff --git a/src/common/init.c b/src/common/init.c index 1f8af0b48..8bf6f60e1 100644 --- a/src/common/init.c +++ b/src/common/init.c @@ -242,7 +242,7 @@ void ffListFeatures(void) #if FF_HAVE_DDCUTIL "libddcutil\n" #endif - #if FF_HAVE_ELF + #if FF_HAVE_ELF || __sun || __FreeBSD__ "libelf\n" #endif #if FF_HAVE_LIBZFS diff --git a/src/util/binary_linux.c b/src/util/binary_linux.c index 1a2e8b25d..67498f3e5 100644 --- a/src/util/binary_linux.c +++ b/src/util/binary_linux.c @@ -1,11 +1,12 @@ #include "binary.h" -#if defined(FF_HAVE_ELF) || defined(__sun) +#if defined(FF_HAVE_ELF) || defined(__sun) || defined(__FreeBSD__) #include "common/io/io.h" #include "common/library.h" #include "util/stringUtils.h" +// WARNING: On FreeBSD, there are system `/usr/include/libelf.h` and pkg elfutils `/usr/local/include/libelf.h`; they are not compatible. #include #include