meson: Build libdrm.so as an unversioned lib on Android.

Android vendor libraries don't have sonames, and libdrm.so shouldn't
either.  This lets a Mesa built against a libdrm.so built for Android
be copied directly to a Chrome OS ARC installation.

Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
diff --git a/meson.build b/meson.build
index 288106b..8124200 100644
--- a/meson.build
+++ b/meson.build
@@ -44,6 +44,8 @@
 
 cc = meson.get_compiler('c')
 
+android = cc.compiles('''int func() { return __ANDROID__; }''')
+
 symbols_check = find_program('symbols-check.py')
 prog_nm = find_program('nm')
 
@@ -299,20 +301,29 @@
 inc_root = include_directories('.')
 inc_drm = include_directories('include/drm')
 
-libdrm = library(
-  'drm',
-  [files(
-     'xf86drm.c', 'xf86drmHash.c', 'xf86drmRandom.c', 'xf86drmSL.c',
-     'xf86drmMode.c'
-   ),
-   config_file, format_mod_static_table
-  ],
-  c_args : libdrm_c_args,
-  dependencies : [dep_valgrind, dep_rt, dep_m],
-  include_directories : inc_drm,
-  version : '2.4.0',
-  install : true,
-)
+libdrm_files = [files(
+   'xf86drm.c', 'xf86drmHash.c', 'xf86drmRandom.c', 'xf86drmSL.c',
+   'xf86drmMode.c'
+  ),
+  config_file, format_mod_static_table
+]
+
+if android
+  libdrm = library('drm', libdrm_files,
+    c_args : libdrm_c_args,
+    dependencies : [dep_valgrind, dep_rt, dep_m],
+    include_directories : inc_drm,
+    install : true,
+  )
+else
+  libdrm = library('drm', libdrm_files,
+    c_args : libdrm_c_args,
+    dependencies : [dep_valgrind, dep_rt, dep_m],
+    include_directories : inc_drm,
+    install : true,
+    version: '2.4.0'
+  )
+endif
 
 test(
   'core-symbols-check',