mirror of https://github.com/xiph/flac
fix build under Mac OS X with PowerPC CPU
revert 44036c9a9b
because auxv.h is only
available under Linux and FreeBSD.
This commit is contained in:
parent
e0b62a61a7
commit
4fbb6d4f2e
|
@ -144,7 +144,7 @@ case "$host_cpu" in
|
||||||
powerpc64|powerpc64le)
|
powerpc64|powerpc64le)
|
||||||
cpu_ppc64=true
|
cpu_ppc64=true
|
||||||
cpu_ppc=true
|
cpu_ppc=true
|
||||||
AC_CHECK_HEADER(sys/auxv.h, AC_DEFINE(FLAC__CPU_PPC))
|
AC_DEFINE(FLAC__CPU_PPC)
|
||||||
AH_TEMPLATE(FLAC__CPU_PPC, [define if building for PowerPC])
|
AH_TEMPLATE(FLAC__CPU_PPC, [define if building for PowerPC])
|
||||||
AC_DEFINE(FLAC__CPU_PPC64)
|
AC_DEFINE(FLAC__CPU_PPC64)
|
||||||
AH_TEMPLATE(FLAC__CPU_PPC64, [define if building for PowerPC64])
|
AH_TEMPLATE(FLAC__CPU_PPC64, [define if building for PowerPC64])
|
||||||
|
@ -152,7 +152,7 @@ case "$host_cpu" in
|
||||||
;;
|
;;
|
||||||
powerpc|powerpcle)
|
powerpc|powerpcle)
|
||||||
cpu_ppc=true
|
cpu_ppc=true
|
||||||
AC_CHECK_HEADER(sys/auxv.h, AC_DEFINE(FLAC__CPU_PPC))
|
AC_DEFINE(FLAC__CPU_PPC)
|
||||||
AH_TEMPLATE(FLAC__CPU_PPC, [define if building for PowerPC])
|
AH_TEMPLATE(FLAC__CPU_PPC, [define if building for PowerPC])
|
||||||
asm_optimisation=$asm_opt
|
asm_optimisation=$asm_opt
|
||||||
;;
|
;;
|
||||||
|
|
|
@ -54,8 +54,10 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined FLAC__CPU_PPC
|
#if defined FLAC__CPU_PPC
|
||||||
|
#if defined(__linux__) || (defined(__FreeBSD__) && (__FreeBSD__ >= 12))
|
||||||
#include <sys/auxv.h>
|
#include <sys/auxv.h>
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#if (defined FLAC__CPU_IA32 || defined FLAC__CPU_X86_64) && (defined FLAC__HAS_NASM || FLAC__HAS_X86INTRIN) && !defined FLAC__NO_ASM
|
#if (defined FLAC__CPU_IA32 || defined FLAC__CPU_X86_64) && (defined FLAC__HAS_NASM || FLAC__HAS_X86INTRIN) && !defined FLAC__NO_ASM
|
||||||
|
|
||||||
|
@ -251,18 +253,23 @@ ppc_cpu_info (FLAC__CPUInfo *info)
|
||||||
} else if (getauxval(AT_HWCAP2) & PPC_FEATURE2_ARCH_2_07) {
|
} else if (getauxval(AT_HWCAP2) & PPC_FEATURE2_ARCH_2_07) {
|
||||||
info->ppc.arch_2_07 = true;
|
info->ppc.arch_2_07 = true;
|
||||||
}
|
}
|
||||||
#elif defined(__FreeBSD__)
|
#elif defined(__FreeBSD__) && (__FreeBSD__ >= 12)
|
||||||
long hwcaps;
|
long hwcaps;
|
||||||
|
/* elf_aux_info() appeared in FreeBSD 12.0 */
|
||||||
elf_aux_info(AT_HWCAP2, &hwcaps, sizeof(hwcaps));
|
elf_aux_info(AT_HWCAP2, &hwcaps, sizeof(hwcaps));
|
||||||
#else
|
|
||||||
#error Unsupported platform! Please add support for reading ppc hwcaps.
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (hwcaps & PPC_FEATURE2_ARCH_3_00) {
|
if (hwcaps & PPC_FEATURE2_ARCH_3_00) {
|
||||||
info->ppc.arch_3_00 = true;
|
info->ppc.arch_3_00 = true;
|
||||||
} else if (hwcaps & PPC_FEATURE2_ARCH_2_07) {
|
} else if (hwcaps & PPC_FEATURE2_ARCH_2_07) {
|
||||||
info->ppc.arch_2_07 = true;
|
info->ppc.arch_2_07 = true;
|
||||||
}
|
}
|
||||||
|
#elif defined(__APPLE__)
|
||||||
|
/* no Mac OS X version supports CPU with Power AVI v2.07 or better */
|
||||||
|
info->ppc.arch_2_07 = false;
|
||||||
|
info->ppc.arch_3_00 = false;
|
||||||
|
#else
|
||||||
|
#error Unsupported platform! Please add support for reading ppc hwcaps.
|
||||||
|
#endif
|
||||||
|
|
||||||
#else
|
#else
|
||||||
info->ppc.arch_2_07 = false;
|
info->ppc.arch_2_07 = false;
|
||||||
info->ppc.arch_3_00 = false;
|
info->ppc.arch_3_00 = false;
|
||||||
|
|
Loading…
Reference in New Issue