Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame^] | 1 | From 73049e5a9e3698cc6d51471d70ac5e06bed803cc Mon Sep 17 00:00:00 2001 |
| 2 | From: Khem Raj <raj.khem@gmail.com> |
| 3 | Date: Sat, 17 Dec 2022 10:24:48 -0800 |
| 4 | Subject: [PATCH] configure: Add --with-cpu |
| 5 | |
| 6 | Some cross build systems e.g. yocto may use architectures different from cross compiler target tuple |
| 7 | arm-yoe-gnueabi but build for armv7a, AC_CANONICAL_HOST will fail in |
| 8 | this case even though target will be armv7a it will detect it as arm and |
| 9 | disable armv7a specific optimization paths. This option provides the |
| 10 | needed knob so it can be set explicitly e.g. --with-cpu=armv7a etc. if needed. |
| 11 | |
| 12 | Upstream-Status: Submitted [https://github.com/stressapptest/stressapptest/pull/100] |
| 13 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
| 14 | --- |
| 15 | configure.ac | 9 ++++++++- |
| 16 | 1 file changed, 8 insertions(+), 1 deletion(-) |
| 17 | |
| 18 | diff --git a/configure.ac b/configure.ac |
| 19 | index c839c87..403728c 100644 |
| 20 | --- a/configure.ac |
| 21 | +++ b/configure.ac |
| 22 | @@ -11,7 +11,14 @@ else |
| 23 | AC_MSG_NOTICE([Compiling with dynamically linked libraries.]) |
| 24 | fi |
| 25 | |
| 26 | -AC_CANONICAL_HOST |
| 27 | +AC_ARG_WITH(cpu, [ --with-cpu define host cpu]) |
| 28 | + |
| 29 | +if test -z "$with_cpu" |
| 30 | +then |
| 31 | + AC_CANONICAL_HOST |
| 32 | +else |
| 33 | + host_cpu=$with_cpu |
| 34 | +fi |
| 35 | # Checking for target cpu and setting custom configuration |
| 36 | # for the different platforms |
| 37 | AS_CASE(["$host_cpu"], |