summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Reiter <reiter.christoph@gmail.com>2018-08-03 10:15:46 +0200
committerChristoph Reiter <creiter@src.gnome.org>2018-08-17 18:43:05 +0200
commit81539a4cdf9294a197915700515c71138092be3e (patch)
treef33a1e38f12e5d4b6c3c0caba9ab04c4ab4c2f45
parentd4b60396c79c7294ab69a2c591518e76ab17b603 (diff)
downloadglib-test-ip_mreq_source-android-only-2-56.tar.gz
build: only test for broken ip_mreq_source on Android. Fixes #1472test-ip_mreq_source-android-only-2-56
7efd76dd6796f8 added these configure time tests to work around a bug with older Android. Since the test didn't take Windows into account it wrongfully applied the workaround on Windows too, breaking the build. With meson this wasn't an issue since the check is skipped on Windows there and our CI didn't catch this issue. Change the test to run on Android only for meson and autotools. This also makes it clear that the test+code can be dropped again if we stop supporting older Android versions at some point.
-rw-r--r--configure.ac30
-rw-r--r--gio/meson.build6
2 files changed, 21 insertions, 15 deletions
diff --git a/configure.ac b/configure.ac
index fb0724914..04e9ca7a5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -961,20 +961,22 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
AC_MSG_RESULT(no)
])
-AC_MSG_CHECKING([if ip_mreq_source.imr_interface has s_addr member])
-AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
- [[
- #include <netinet/in.h>
- ]],
- [[
- struct ip_mreq_source mc_req_src;
- mc_req_src.imr_interface.s_addr = 0;
- ]])], [
- AC_MSG_RESULT(yes)
- ], [
- AC_MSG_RESULT(no)
- AC_DEFINE(BROKEN_IP_MREQ_SOURCE_STRUCT, 1, [struct ip_mreq_source definition is broken on Android NDK <= r16])
-])
+# See https://bugzilla.gnome.org/show_bug.cgi?id=740791
+AS_IF([test $glib_native_android = yes], [
+ AC_MSG_CHECKING([if ip_mreq_source.imr_interface has s_addr member])
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
+ [[
+ #include <netinet/in.h>
+ ]],
+ [[
+ struct ip_mreq_source mc_req_src;
+ mc_req_src.imr_interface.s_addr = 0;
+ ]])], [
+ AC_MSG_RESULT(yes)
+ ], [
+ AC_MSG_RESULT(no)
+ AC_DEFINE(BROKEN_IP_MREQ_SOURCE_STRUCT, 1, [struct ip_mreq_source definition is broken on Android NDK <= r16])
+ ])])
AS_IF([test $glib_native_win32 = yes], [
# <wspiapi.h> in the Windows SDK and in mingw-w64 has wrappers for
diff --git a/gio/meson.build b/gio/meson.build
index c83d8405f..7393f374d 100644
--- a/gio/meson.build
+++ b/gio/meson.build
@@ -154,6 +154,11 @@ if host_system != 'windows'
glib_conf.set('HAVE_SIOCGIFADDR', '/**/')
endif
+endif
+
+if host_system.contains('android')
+ # struct ip_mreq_source definition is broken on Android NDK <= r16
+ # See https://bugzilla.gnome.org/show_bug.cgi?id=740791
if not cc.compiles('''#include <netinet/in.h>
int main(int argc, char ** argv) {
struct ip_mreq_source mc_req_src;
@@ -163,7 +168,6 @@ if host_system != 'windows'
name : 'ip_mreq_source.imr_interface has s_addr member')
glib_conf.set('BROKEN_IP_MREQ_SOURCE_STRUCT', 1)
endif
-
endif
network_args_string = ''