Fix build system for Android by disabling tests since its x-compiled
authorHans-Christoph Steiner <hans@eds.org>
Fri, 17 Aug 2012 02:43:15 +0000 (22:43 -0400)
committerWerner Koch <wk@gnupg.org>
Fri, 24 Aug 2012 07:37:23 +0000 (09:37 +0200)
* configure.ac (HAVE_ANDROID_SYSTEM, RUN_TESTS): New.
(AH_BOTTOM) [__ANDROID__]: Do not re-define ttyname.
* Makefile.am: Depend tests on new RUN_TESTS conditional.

Makefile.am
configure.ac

index 6207d7b..c5ac11c 100644 (file)
@@ -82,10 +82,10 @@ else
 doc =
 endif
 
-if HAVE_W32_SYSTEM
-tests =
-else
+if RUN_TESTS
 tests = tests
+else
+tests =
 endif
 
 SUBDIRS = m4 gl include common ${kbx} \
index d46a838..0241a9d 100644 (file)
@@ -494,13 +494,6 @@ AH_BOTTOM([
 # endif
 #endif
 
-/* Hacks required for Android.  */
-#ifdef __ANDROID__
-  /* ttyname is a stub in BIONIC, printing a FIXME warning.  */
-# define ttyname broken_native_ttyname
-# undef HAVE_TTYNAME
-#endif /*__ANDROID__*/
-
 
 /* Tell libgcrypt not to use its own libgpg-error implementation. */
 #define USE_LIBGPG_ERROR 1
@@ -585,6 +578,8 @@ try_gettext=yes
 have_dosish_system=no
 have_w32_system=no
 have_w32ce_system=no
+have_android_system=no
+run_tests=yes
 use_simple_gettext=no
 use_ldapwrapper=yes
 mmap_needed=yes
@@ -601,6 +596,7 @@ case "${host}" in
         disable_keyserver_path=yes
         have_dosish_system=yes
         have_w32_system=yes
+        run_tests=no
         use_ldapwrapper=no  # Fixme: Do this only for CE.
         case "${host}" in
           *-mingw32ce*)
@@ -660,6 +656,10 @@ case "${host}" in
         ;;
     m68k-atari-mint)
         ;;
+    *-linux-androideabi)
+        have_android_system=yes
+        run_tests=no
+        ;;
     *)
        ;;
 esac
@@ -684,6 +684,16 @@ fi
 AM_CONDITIONAL(HAVE_W32_SYSTEM, test "$have_w32_system" = yes)
 AM_CONDITIONAL(HAVE_W32CE_SYSTEM, test "$have_w32ce_system" = yes)
 
+if test "$have_android_system" = yes; then
+   AC_DEFINE(HAVE_ANDROID_SYSTEM,1, [Defined if we build for an Android system])
+fi
+AM_CONDITIONAL(HAVE_ANDROID_SYSTEM, test "$have_android_system" = yes)
+
+if test "$run_tests" = yes; then
+   AC_DEFINE(RUN_TESTS,1, [Defined if we should run the tests])
+fi
+AM_CONDITIONAL(RUN_TESTS, test "$run_tests" = yes)
+
 if test "$use_ldapwrapper" = yes; then
    AC_DEFINE(USE_LDAPWRAPPER,1, [Build dirmngr with LDAP wrapper process])
 fi