[glib/objcpy-version] Enable test about objcopy if it supports the --add-symbol parameter



commit 5fe61e8c46da610cb2a0b7eaa8064e1103f11031
Author: Ignacio Casal Quinteiro <qignacio amazon com>
Date:   Wed Nov 20 21:32:33 2019 +0100

    Enable test about objcopy if it supports the --add-symbol parameter
    
    This fixes building in old systems like centos 6.
    
    (With tweaks by Philip Withnall.)
    
    Fixes: https://gitlab.gnome.org/GNOME/glib/issues/1895

 gio/tests/meson.build | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
---
diff --git a/gio/tests/meson.build b/gio/tests/meson.build
index 8b5d105f5..a623f7881 100644
--- a/gio/tests/meson.build
+++ b/gio/tests/meson.build
@@ -585,10 +585,15 @@ if not meson.is_cross_build() or meson.has_exe_wrapper()
   # Support for --add-symbol was added to LLVM objcopy in 2019
   # (https://reviews.llvm.org/D58234). FIXME: This test could be enabled for
   # LLVM once that support is in a stable release.
+  objcopy_supports_add_symbol = false
   objcopy = find_program('objcopy', required : false)
+  if objcopy.found()
+    objcopy_supports_add_symbol = run_command(objcopy, '--help').stdout().contains('--add-symbol')
+  endif
+
   ld = find_program('ld', required : false)
 
-  if build_machine.system() == 'linux' and cc.get_id() == 'gcc' and objcopy.found() and ld.found()
+  if build_machine.system() == 'linux' and cc.get_id() == 'gcc' and objcopy.found() and 
objcopy_supports_add_symbol and ld.found()
     test_gresource_binary = custom_target('test5.gresource',
       input : 'test5.gresource.xml',
       output : 'test5.gresource',


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]