if not env.Detect('pkg-config'):
return
+ if subprocess.call(["pkg-config", "--exists", ' '.join(modules)]) != 0:
+ return
+
# Put -I and -L flags directly into the environment, as these don't affect
# the compilation of targets that do not use them
try:
env.Append(LINKFLAGS = linkflags)
env.Append(SHLINKFLAGS = shlinkflags)
+ # We have C++ in several libraries, so always link with the C++ compiler
+ if env['gcc']:
+ env['LINK'] = env['CXX']
+
# Default libs
env.Append(LIBS = [])
env.Tool('udis86')
pkg_config_modules(env, 'x11', ['x11', 'xext'])
- pkg_config_modules(env, 'dri', ['libdrm'])
+ pkg_config_modules(env, 'drm', ['libdrm'])
+ pkg_config_modules(env, 'drm_intel', ['libdrm_intel'])
+ pkg_config_modules(env, 'drm_radeon', ['libdrm_radeon'])
pkg_config_modules(env, 'xorg', ['xorg-server'])
+ pkg_config_modules(env, 'kms', ['libkms'])
+
+ env['dri'] = env['x11'] and env['drm']
# Custom builders and methods
env.Tool('custom')