python: make hashlib and readline modules really optional
[buildroot-gz.git] / package / libmpeg2 / 0003-fix-arm-detection.patch
blob69ec4547de9cdbc07f5f5b93436df4a302391218
1 Improve the ARM detection to work on Thumb-only architecture
3 The ARM-specific assembly code doesn't build on Thumb-only
4 architectures such as ARMv7-M, but the configure script assumes that
5 if the host tuple is arm*, then it can build and use the ARM optimized
6 code.
8 This patch improves the configure.ac detection logic, by building one
9 of the instruction of the optimized assembly code, and using this to
10 decide whether or not the optimizations should be enabled.
12 Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
14 Index: b/configure.ac
15 ===================================================================
16 --- a/configure.ac
17 +++ b/configure.ac
18 @@ -101,8 +101,10 @@
19 alpha*)
20 AC_DEFINE([ARCH_ALPHA],,[alpha architecture]);;
21 arm*)
22 - arm_conditional=:
23 - AC_DEFINE([ARCH_ARM],,[ARM architecture]);;
24 + AC_TRY_LINK([], [asm(".syntax divided\nstmfd sp!,{r4-r11,lr}")],
25 + [AC_DEFINE([ARCH_ARM],,[ARM architecture])
26 + use_arm_optimization=yes],
27 + [use_arm_optimization=no])
28 esac
29 elif test x"$CC" = x"tendracc"; then
30 dnl TenDRA portability checking compiler
31 @@ -122,7 +124,7 @@
32 esac
35 -AM_CONDITIONAL(ARCH_ARM, ${arm_conditional})
36 +AM_CONDITIONAL(ARCH_ARM, test "${use_arm_optimization}" = "yes")
38 dnl Checks for libtool - this must be done after we set cflags
39 AC_LIBTOOL_WIN32_DLL