summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiego Biurrun <diego@biurrun.de>2017-05-26 19:04:51 +0200
committerDiego Biurrun <diego@biurrun.de>2017-06-13 12:34:35 +0200
commite2edf1529cb35eaf043e3f8e5cba498ed06e2563 (patch)
treeb9b26b49b58e6d273f28f08442fa379306eea84e
parentd76479c5020ca43e67d47ba3767146b192dc4782 (diff)
configure: Simplify AltiVec/VSX check with a helper function
-rwxr-xr-xconfigure24
1 files changed, 7 insertions, 17 deletions
diff --git a/configure b/configure
index b0be55a66e..7e38f0d92b 100755
--- a/configure
+++ b/configure
@@ -4445,29 +4445,19 @@ elif enabled ppc; then
check_cflags -maltivec -mabi=altivec
# check if our compiler supports Motorola AltiVec C API
- check_cc <<EOF || disable altivec
-#include <altivec.h>
-int main(void) {
- vector signed int v1 = (vector signed int) { 0 };
- vector signed int v2 = (vector signed int) { 1 };
- v1 = vec_add(v1, v2);
- return 0;
-}
-EOF
+ check_code cc altivec.h "vector signed int v1 = (vector signed int) { 0 };
+ vector signed int v2 = (vector signed int) { 1 };
+ v1 = vec_add(v1, v2);" ||
+ disable altivec
enabled altivec || warn "Altivec disabled, possibly missing --cpu flag"
fi
if enabled vsx; then
check_cflags -mvsx &&
- check_cc <<EOF || disable vsx
-#include <altivec.h>
-int main(void) {
- int v[4] = { 0 };
- vector signed int v1 = vec_vsx_ld(0, v);
- return 0;
-}
-EOF
+ check_code cc altivec.h "int v[4] = { 0 };
+ vector signed int v1 = vec_vsx_ld(0, v);" ||
+ disable vsx
fi
if enabled power8; then