From: Piotr Kubaj Date: Tue, 27 Sep 2022 22:57:46 +0000 (+0200) Subject: Add FreeBSD/powerpc* support to cmake/detect-intrinsics.cmake X-Git-Tag: 2.1.0-beta1~110 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0a59b4e7454b39c20a4eca88716e18d93431f96f;p=thirdparty%2Fzlib-ng.git Add FreeBSD/powerpc* support to cmake/detect-intrinsics.cmake --- diff --git a/cmake/detect-intrinsics.cmake b/cmake/detect-intrinsics.cmake index 20164c5bc..3fa74b483 100644 --- a/cmake/detect-intrinsics.cmake +++ b/cmake/detect-intrinsics.cmake @@ -297,8 +297,17 @@ macro(check_ppc_intrinsics) set(CMAKE_REQUIRED_FLAGS "${PPCFLAGS} ${NATIVEFLAG}") check_c_source_compiles( "#include + #ifdef __FreeBSD__ + #include + #endif int main() { + #ifdef __FreeBSD__ + unsigned long hwcap; + elf_aux_info(AT_HWCAP, &hwcap, sizeof(hwcap)); + return (hwcap & PPC_FEATURE_HAS_ALTIVEC); + #else return (getauxval(AT_HWCAP) & PPC_FEATURE_HAS_ALTIVEC); + #endif }" HAVE_VMX ) @@ -315,8 +324,17 @@ macro(check_power8_intrinsics) set(CMAKE_REQUIRED_FLAGS "${POWER8FLAG} ${NATIVEFLAG}") check_c_source_compiles( "#include + #ifdef __FreeBSD__ + #include + #endif int main() { + #ifdef __FreeBSD__ + unsigned long hwcap; + elf_aux_info(AT_HWCAP2, &hwcap, sizeof(hwcap)); + return (hwcap & PPC_FEATURE2_ARCH_2_07); + #else return (getauxval(AT_HWCAP2) & PPC_FEATURE2_ARCH_2_07); + #endif }" HAVE_POWER8_INTRIN )