From d6e80deb32a3578dc333e2f1d2594a969777dcad Mon Sep 17 00:00:00 2001 From: Johann Date: Tue, 12 Jun 2012 08:58:11 -0700 Subject: [PATCH] Clean Android build defaults Disable unit-tests. The logging in GTest would need to be adjusted. Restructure ARM cpu detection. Flatten if-else logic. Change #if defined(HAVE_*) to #if HAVE_* because we only need to check for features that the library was actually built with. This should have been harmless, as disabled feature sets wouldn't have any features to call. Change-Id: Iea21aa42ce5f049c53ca0376d25bcd0f36f38284 --- configure | 11 +++++-- vpx_ports/arm_cpudetect.c | 66 ++++++++++++++++++++------------------- 2 files changed, 42 insertions(+), 35 deletions(-) diff --git a/configure b/configure index eed6f970b..b1b389e15 100755 --- a/configure +++ b/configure @@ -588,13 +588,18 @@ process_toolchain() { fi # Enable unit tests if we have a working C++ compiler - case "$tgt_cc" in - vs*) - soft_enable unit_tests;; + case "$toolchain" in + *-vs*) + soft_enable unit_tests + ;; + *-android-*) + # GTestLog must be modified to use Android logging utilities. + ;; *) check_cxx "$@" < int arm_cpu_caps(void) @@ -137,19 +139,20 @@ int arm_cpu_caps(void) mask = arm_cpu_env_mask(); features = android_getCpuFeatures(); -#if defined(HAVE_EDSP) +#if HAVE_EDSP flags |= HAS_EDSP; -#endif -#if defined(HAVE_MEDIA) +#endif /* HAVE_EDSP */ +#if HAVE_MEDIA flags |= HAS_MEDIA; -#endif -#if defined(HAVE_NEON) +#endif /* HAVE_MEDIA */ +#if HAVE_NEON if (features & ANDROID_CPU_ARM_FEATURE_NEON) flags |= HAS_NEON; -#endif +#endif /* HAVE_NEON */ return flags & mask; } -#else // !defined(__ANDROID__) + +#elif defined(__linux__) /* end __ANDROID__ */ #include int arm_cpu_caps(void) @@ -175,27 +178,27 @@ int arm_cpu_caps(void) char buf[512]; while (fgets(buf, 511, fin) != NULL) { -#if defined(HAVE_EDSP) || defined(HAVE_NEON) +#if HAVE_EDSP || HAVE_NEON if (memcmp(buf, "Features", 8) == 0) { char *p; -#if defined(HAVE_EDSP) +#if HAVE_EDSP p=strstr(buf, " edsp"); if (p != NULL && (p[5] == ' ' || p[5] == '\n')) { flags |= HAS_EDSP; } -#if defined(HAVE_NEON) +#if HAVE_NEON p = strstr(buf, " neon"); if (p != NULL && (p[5] == ' ' || p[5] == '\n')) { flags |= HAS_NEON; } -#endif -#endif +#endif /* HAVE_NEON */ +#endif /* HAVE_EDSP */ } -#endif -#if defined(HAVE_MEDIA) +#endif /* HAVE_EDSP || HAVE_NEON */ +#if HAVE_MEDIA if (memcmp(buf, "CPU architecture:",17) == 0){ int version; version = atoi(buf+17); @@ -204,14 +207,13 @@ int arm_cpu_caps(void) flags |= HAS_MEDIA; } } -#endif +#endif /* HAVE_MEDIA */ } fclose(fin); } return flags & mask; } -#endif // defined(__linux__) -#else +#else /* end __linux__ */ #error "--enable-runtime-cpu-detect selected, but no CPU detection method " \ "available for your platform. Reconfigure with --disable-runtime-cpu-detect." #endif -- 2.40.0