summaryrefslogtreecommitdiff
path: root/meson.build
diff options
context:
space:
mode:
authorTim-Philipp Müller <tim@centricular.com>2021-02-23 11:36:24 +0000
committerTim-Philipp Müller <tim@centricular.com>2021-02-23 12:29:58 +0000
commite30259f6237571c61992433c110bc6e1ef900244 (patch)
treefe0cb239f38091c71be79822d675297bbadb6b6e /meson.build
parentd6c1787ac1a705f129f3d56b6058f02129535796 (diff)
downloadcairo-e30259f6237571c61992433c110bc6e1ef900244.tar.gz
cairo-trace: fix build with newer versions of bfd
And update configure/meson checks to check for the new function. Drop libiberty.h check since it's only needed by backtrace-symbols.c which we're about to remove. Closes #391, #460
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build11
1 files changed, 6 insertions, 5 deletions
diff --git a/meson.build b/meson.build
index 5cbeda913..52945db52 100644
--- a/meson.build
+++ b/meson.build
@@ -673,15 +673,16 @@ if zlib_dep.found() and png_dep.found()
}]
endif
-# Untested, libiberty.h is in a libiberty subfolder for me
-# Also, the bfd API seems to have changed at some point
-bfd_dep = cc.find_library('bfd', has_headers: ['bfd.h', 'libiberty.h'], required: get_option('symbol-lookup'))
-if bfd_dep.found() and cc.has_function('bfd_openr', dependencies: [bfd_dep])
+bfd_dep = cc.find_library('bfd', has_headers: ['bfd.h'], required: get_option('symbol-lookup'))
+if bfd_dep.found() and \
+ cc.has_function('bfd_openr', dependencies: [bfd_dep]) and \
+ cc.links(files('meson-cc-tests/bfd-section-flags.c'), name: 'bfd_section_flags', dependencies: bfd_dep)
conf.set('HAVE_BFD', 1)
deps += [bfd_dep]
+elif get_option('symbol-lookup').enabled()
+ error('symbol lookup via bfd was enabled via options but is not available (bfd might be too old)')
endif
-# Untested, see above
if conf.get('HAVE_BFD', 0) == 1
conf.set('CAIRO_HAS_SYMBOL_LOOKUP', 1)
endif