|
@@ -1657,6 +1657,19 @@ if capstone_opt in ['enabled', 'auto', 'system']
|
|
|
kwargs: static_kwargs, method: 'pkg-config',
|
|
|
required: capstone_opt == 'system' or
|
|
|
capstone_opt == 'enabled' and not have_internal)
|
|
|
+
|
|
|
+ # Some versions of capstone have broken pkg-config file
|
|
|
+ # that reports a wrong -I path, causing the #include to
|
|
|
+ # fail later. If the system has such a broken version
|
|
|
+ # do not use it.
|
|
|
+ if capstone.found() and not cc.compiles('#include <capstone.h>',
|
|
|
+ dependencies: [capstone])
|
|
|
+ capstone = not_found
|
|
|
+ if capstone_opt == 'system'
|
|
|
+ error('system capstone requested, it does not appear to work')
|
|
|
+ endif
|
|
|
+ endif
|
|
|
+
|
|
|
if capstone.found()
|
|
|
capstone_opt = 'system'
|
|
|
elif have_internal
|