Clone of mesa.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

gallium.py 20KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564
  1. """gallium
  2. Frontend-tool for Gallium3D architecture.
  3. """
  4. #
  5. # Copyright 2008 VMware, Inc.
  6. # All Rights Reserved.
  7. #
  8. # Permission is hereby granted, free of charge, to any person obtaining a
  9. # copy of this software and associated documentation files (the
  10. # "Software"), to deal in the Software without restriction, including
  11. # without limitation the rights to use, copy, modify, merge, publish,
  12. # distribute, sub license, and/or sell copies of the Software, and to
  13. # permit persons to whom the Software is furnished to do so, subject to
  14. # the following conditions:
  15. #
  16. # The above copyright notice and this permission notice (including the
  17. # next paragraph) shall be included in all copies or substantial portions
  18. # of the Software.
  19. #
  20. # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  21. # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  22. # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
  23. # IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR
  24. # ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
  25. # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
  26. # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  27. #
  28. import distutils.version
  29. import os
  30. import os.path
  31. import re
  32. import subprocess
  33. import platform as _platform
  34. import SCons.Action
  35. import SCons.Builder
  36. import SCons.Scanner
  37. def symlink(target, source, env):
  38. target = str(target[0])
  39. source = str(source[0])
  40. if os.path.islink(target) or os.path.exists(target):
  41. os.remove(target)
  42. os.symlink(os.path.basename(source), target)
  43. def install(env, source, subdir):
  44. target_dir = os.path.join(env.Dir('#.').srcnode().abspath, env['build_dir'], subdir)
  45. return env.Install(target_dir, source)
  46. def install_program(env, source):
  47. return install(env, source, 'bin')
  48. def install_shared_library(env, sources, version = ()):
  49. targets = []
  50. install_dir = os.path.join(env.Dir('#.').srcnode().abspath, env['build_dir'])
  51. version = tuple(map(str, version))
  52. if env['SHLIBSUFFIX'] == '.dll':
  53. dlls = env.FindIxes(sources, 'SHLIBPREFIX', 'SHLIBSUFFIX')
  54. targets += install(env, dlls, 'bin')
  55. libs = env.FindIxes(sources, 'LIBPREFIX', 'LIBSUFFIX')
  56. targets += install(env, libs, 'lib')
  57. else:
  58. for source in sources:
  59. target_dir = os.path.join(install_dir, 'lib')
  60. target_name = '.'.join((str(source),) + version)
  61. last = env.InstallAs(os.path.join(target_dir, target_name), source)
  62. targets += last
  63. while len(version):
  64. version = version[:-1]
  65. target_name = '.'.join((str(source),) + version)
  66. action = SCons.Action.Action(symlink, " Symlinking $TARGET ...")
  67. last = env.Command(os.path.join(target_dir, target_name), last, action)
  68. targets += last
  69. return targets
  70. def createInstallMethods(env):
  71. env.AddMethod(install_program, 'InstallProgram')
  72. env.AddMethod(install_shared_library, 'InstallSharedLibrary')
  73. def num_jobs():
  74. try:
  75. return int(os.environ['NUMBER_OF_PROCESSORS'])
  76. except (ValueError, KeyError):
  77. pass
  78. try:
  79. return os.sysconf('SC_NPROCESSORS_ONLN')
  80. except (ValueError, OSError, AttributeError):
  81. pass
  82. try:
  83. return int(os.popen2("sysctl -n hw.ncpu")[1].read())
  84. except ValueError:
  85. pass
  86. return 1
  87. def generate(env):
  88. """Common environment generation code"""
  89. # Tell tools which machine to compile for
  90. env['TARGET_ARCH'] = env['machine']
  91. env['MSVS_ARCH'] = env['machine']
  92. # Toolchain
  93. platform = env['platform']
  94. env.Tool(env['toolchain'])
  95. # Allow override compiler and specify additional flags from environment
  96. if os.environ.has_key('CC'):
  97. env['CC'] = os.environ['CC']
  98. # Update CCVERSION to match
  99. pipe = SCons.Action._subproc(env, [env['CC'], '--version'],
  100. stdin = 'devnull',
  101. stderr = 'devnull',
  102. stdout = subprocess.PIPE)
  103. if pipe.wait() == 0:
  104. line = pipe.stdout.readline()
  105. match = re.search(r'[0-9]+(\.[0-9]+)+', line)
  106. if match:
  107. env['CCVERSION'] = match.group(0)
  108. if os.environ.has_key('CFLAGS'):
  109. env['CCFLAGS'] += SCons.Util.CLVar(os.environ['CFLAGS'])
  110. if os.environ.has_key('CXX'):
  111. env['CXX'] = os.environ['CXX']
  112. if os.environ.has_key('CXXFLAGS'):
  113. env['CXXFLAGS'] += SCons.Util.CLVar(os.environ['CXXFLAGS'])
  114. if os.environ.has_key('LDFLAGS'):
  115. env['LINKFLAGS'] += SCons.Util.CLVar(os.environ['LDFLAGS'])
  116. env['gcc'] = 'gcc' in os.path.basename(env['CC']).split('-')
  117. env['msvc'] = env['CC'] == 'cl'
  118. env['suncc'] = env['platform'] == 'sunos' and os.path.basename(env['CC']) == 'cc'
  119. env['clang'] = env['CC'] == 'clang'
  120. env['icc'] = 'icc' == os.path.basename(env['CC'])
  121. if env['msvc'] and env['toolchain'] == 'default' and env['machine'] == 'x86_64':
  122. # MSVC x64 support is broken in earlier versions of scons
  123. env.EnsurePythonVersion(2, 0)
  124. # shortcuts
  125. machine = env['machine']
  126. platform = env['platform']
  127. x86 = env['machine'] == 'x86'
  128. ppc = env['machine'] == 'ppc'
  129. gcc_compat = env['gcc'] or env['clang']
  130. msvc = env['msvc']
  131. suncc = env['suncc']
  132. icc = env['icc']
  133. # Determine whether we are cross compiling; in particular, whether we need
  134. # to compile code generators with a different compiler as the target code.
  135. host_platform = _platform.system().lower()
  136. if host_platform.startswith('cygwin'):
  137. host_platform = 'cygwin'
  138. host_machine = os.environ.get('PROCESSOR_ARCHITEW6432', os.environ.get('PROCESSOR_ARCHITECTURE', _platform.machine()))
  139. host_machine = {
  140. 'x86': 'x86',
  141. 'i386': 'x86',
  142. 'i486': 'x86',
  143. 'i586': 'x86',
  144. 'i686': 'x86',
  145. 'ppc' : 'ppc',
  146. 'AMD64': 'x86_64',
  147. 'x86_64': 'x86_64',
  148. }.get(host_machine, 'generic')
  149. env['crosscompile'] = platform != host_platform
  150. if machine == 'x86_64' and host_machine != 'x86_64':
  151. env['crosscompile'] = True
  152. env['hostonly'] = False
  153. # Backwards compatability with the debug= profile= options
  154. if env['build'] == 'debug':
  155. if not env['debug']:
  156. print 'scons: warning: debug option is deprecated and will be removed eventually; use instead'
  157. print
  158. print ' scons build=release'
  159. print
  160. env['build'] = 'release'
  161. if env['profile']:
  162. print 'scons: warning: profile option is deprecated and will be removed eventually; use instead'
  163. print
  164. print ' scons build=profile'
  165. print
  166. env['build'] = 'profile'
  167. if False:
  168. # Enforce SConscripts to use the new build variable
  169. env.popitem('debug')
  170. env.popitem('profile')
  171. else:
  172. # Backwards portability with older sconscripts
  173. if env['build'] in ('debug', 'checked'):
  174. env['debug'] = True
  175. env['profile'] = False
  176. if env['build'] == 'profile':
  177. env['debug'] = False
  178. env['profile'] = True
  179. if env['build'] == 'release':
  180. env['debug'] = False
  181. env['profile'] = False
  182. # Put build output in a separate dir, which depends on the current
  183. # configuration. See also http://www.scons.org/wiki/AdvancedBuildExample
  184. build_topdir = 'build'
  185. build_subdir = env['platform']
  186. if env['embedded']:
  187. build_subdir = 'embedded-' + build_subdir
  188. if env['machine'] != 'generic':
  189. build_subdir += '-' + env['machine']
  190. if env['build'] != 'release':
  191. build_subdir += '-' + env['build']
  192. build_dir = os.path.join(build_topdir, build_subdir)
  193. # Place the .sconsign file in the build dir too, to avoid issues with
  194. # different scons versions building the same source file
  195. env['build_dir'] = build_dir
  196. env.SConsignFile(os.path.join(build_dir, '.sconsign'))
  197. if 'SCONS_CACHE_DIR' in os.environ:
  198. print 'scons: Using build cache in %s.' % (os.environ['SCONS_CACHE_DIR'],)
  199. env.CacheDir(os.environ['SCONS_CACHE_DIR'])
  200. env['CONFIGUREDIR'] = os.path.join(build_dir, 'conf')
  201. env['CONFIGURELOG'] = os.path.join(os.path.abspath(build_dir), 'config.log')
  202. # Parallel build
  203. if env.GetOption('num_jobs') <= 1:
  204. env.SetOption('num_jobs', num_jobs())
  205. env.Decider('MD5-timestamp')
  206. env.SetOption('max_drift', 60)
  207. # C preprocessor options
  208. cppdefines = []
  209. if env['build'] in ('debug', 'checked'):
  210. cppdefines += ['DEBUG']
  211. else:
  212. cppdefines += ['NDEBUG']
  213. if env['build'] == 'profile':
  214. cppdefines += ['PROFILE']
  215. if env['platform'] in ('posix', 'linux', 'freebsd', 'darwin'):
  216. cppdefines += [
  217. '_POSIX_SOURCE',
  218. ('_POSIX_C_SOURCE', '199309L'),
  219. '_SVID_SOURCE',
  220. '_BSD_SOURCE',
  221. '_GNU_SOURCE',
  222. 'HAVE_PTHREAD',
  223. 'HAVE_POSIX_MEMALIGN',
  224. ]
  225. if env['platform'] == 'darwin':
  226. cppdefines += [
  227. '_DARWIN_C_SOURCE',
  228. 'GLX_USE_APPLEGL',
  229. 'GLX_DIRECT_RENDERING',
  230. ]
  231. else:
  232. cppdefines += [
  233. 'GLX_DIRECT_RENDERING',
  234. 'GLX_INDIRECT_RENDERING',
  235. ]
  236. if env['platform'] in ('linux', 'freebsd'):
  237. cppdefines += ['HAVE_ALIAS']
  238. else:
  239. cppdefines += ['GLX_ALIAS_UNSUPPORTED']
  240. if env['platform'] == 'haiku':
  241. cppdefines += [
  242. 'HAVE_PTHREAD',
  243. 'HAVE_POSIX_MEMALIGN'
  244. ]
  245. if platform == 'windows':
  246. cppdefines += [
  247. 'WIN32',
  248. '_WINDOWS',
  249. #'_UNICODE',
  250. #'UNICODE',
  251. # http://msdn.microsoft.com/en-us/library/aa383745.aspx
  252. ('_WIN32_WINNT', '0x0601'),
  253. ('WINVER', '0x0601'),
  254. ]
  255. if gcc_compat:
  256. cppdefines += [('__MSVCRT_VERSION__', '0x0700')]
  257. if msvc:
  258. cppdefines += [
  259. 'VC_EXTRALEAN',
  260. '_USE_MATH_DEFINES',
  261. '_CRT_SECURE_NO_WARNINGS',
  262. '_CRT_SECURE_NO_DEPRECATE',
  263. '_SCL_SECURE_NO_WARNINGS',
  264. '_SCL_SECURE_NO_DEPRECATE',
  265. '_ALLOW_KEYWORD_MACROS',
  266. ]
  267. if env['build'] in ('debug', 'checked'):
  268. cppdefines += ['_DEBUG']
  269. if platform == 'windows':
  270. cppdefines += ['PIPE_SUBSYSTEM_WINDOWS_USER']
  271. if env['embedded']:
  272. cppdefines += ['PIPE_SUBSYSTEM_EMBEDDED']
  273. if env['texture_float']:
  274. print 'warning: Floating-point textures enabled.'
  275. print 'warning: Please consult docs/patents.txt with your lawyer before building Mesa.'
  276. cppdefines += ['TEXTURE_FLOAT_ENABLED']
  277. env.Append(CPPDEFINES = cppdefines)
  278. # C compiler options
  279. cflags = [] # C
  280. cxxflags = [] # C++
  281. ccflags = [] # C & C++
  282. if gcc_compat:
  283. ccversion = env['CCVERSION']
  284. if env['build'] == 'debug':
  285. ccflags += ['-O0']
  286. elif env['gcc'] and ccversion.startswith('4.2.'):
  287. # gcc 4.2.x optimizer is broken
  288. print "warning: gcc 4.2.x optimizer is broken -- disabling optimizations"
  289. ccflags += ['-O0']
  290. else:
  291. ccflags += ['-O3']
  292. if env['gcc']:
  293. # gcc's builtin memcmp is slower than glibc's
  294. # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43052
  295. ccflags += ['-fno-builtin-memcmp']
  296. # Work around aliasing bugs - developers should comment this out
  297. ccflags += ['-fno-strict-aliasing']
  298. ccflags += ['-g']
  299. if env['build'] in ('checked', 'profile'):
  300. # See http://code.google.com/p/jrfonseca/wiki/Gprof2Dot#Which_options_should_I_pass_to_gcc_when_compiling_for_profiling?
  301. ccflags += [
  302. '-fno-omit-frame-pointer',
  303. ]
  304. if env['gcc']:
  305. ccflags += ['-fno-optimize-sibling-calls']
  306. if env['machine'] == 'x86':
  307. ccflags += [
  308. '-m32',
  309. #'-march=pentium4',
  310. ]
  311. if distutils.version.LooseVersion(ccversion) >= distutils.version.LooseVersion('4.2') \
  312. and (platform != 'windows' or env['build'] == 'debug' or True) \
  313. and platform != 'haiku':
  314. # NOTE: We need to ensure stack is realigned given that we
  315. # produce shared objects, and have no control over the stack
  316. # alignment policy of the application. Therefore we need
  317. # -mstackrealign ore -mincoming-stack-boundary=2.
  318. #
  319. # XXX: -O and -mstackrealign causes stack corruption on MinGW
  320. #
  321. # XXX: We could have SSE without -mstackrealign if we always used
  322. # __attribute__((force_align_arg_pointer)), but that's not
  323. # always the case.
  324. ccflags += [
  325. '-mstackrealign', # ensure stack is aligned
  326. '-mmmx', '-msse', '-msse2', # enable SIMD intrinsics
  327. #'-mfpmath=sse',
  328. ]
  329. if platform in ['windows', 'darwin']:
  330. # Workaround http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37216
  331. ccflags += ['-fno-common']
  332. if platform in ['haiku']:
  333. # Make optimizations compatible with Pentium or higher on Haiku
  334. ccflags += [
  335. '-mstackrealign', # ensure stack is aligned
  336. '-march=i586', # Haiku target is Pentium
  337. '-mtune=i686' # use i686 where we can
  338. ]
  339. if env['machine'] == 'x86_64':
  340. ccflags += ['-m64']
  341. if platform == 'darwin':
  342. ccflags += ['-fno-common']
  343. if env['platform'] not in ('cygwin', 'haiku', 'windows'):
  344. ccflags += ['-fvisibility=hidden']
  345. # See also:
  346. # - http://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
  347. ccflags += [
  348. '-Wall',
  349. '-Wno-long-long',
  350. '-fmessage-length=0', # be nice to Eclipse
  351. ]
  352. cflags += [
  353. '-Wmissing-prototypes',
  354. '-std=gnu99',
  355. ]
  356. if distutils.version.LooseVersion(ccversion) >= distutils.version.LooseVersion('4.2'):
  357. ccflags += [
  358. '-Wpointer-arith',
  359. ]
  360. cflags += [
  361. '-Wdeclaration-after-statement',
  362. ]
  363. if icc:
  364. cflags += [
  365. '-std=gnu99',
  366. ]
  367. if msvc:
  368. # See also:
  369. # - http://msdn.microsoft.com/en-us/library/19z1t1wy.aspx
  370. # - cl /?
  371. if env['build'] == 'debug':
  372. ccflags += [
  373. '/Od', # disable optimizations
  374. '/Oi', # enable intrinsic functions
  375. ]
  376. else:
  377. if 'MSVC_VERSION' in env and distutils.version.LooseVersion(env['MSVC_VERSION']) < distutils.version.LooseVersion('11.0'):
  378. print 'scons: warning: Visual Studio versions prior to 2012 are known to produce incorrect code when optimizations are enabled ( https://bugs.freedesktop.org/show_bug.cgi?id=58718 )'
  379. ccflags += [
  380. '/O2', # optimize for speed
  381. ]
  382. if env['build'] == 'release':
  383. ccflags += [
  384. '/GL', # enable whole program optimization
  385. ]
  386. else:
  387. ccflags += [
  388. '/Oy-', # disable frame pointer omission
  389. '/GL-', # disable whole program optimization
  390. ]
  391. ccflags += [
  392. '/W3', # warning level
  393. #'/Wp64', # enable 64 bit porting warnings
  394. '/wd4996', # disable deprecated POSIX name warnings
  395. ]
  396. if env['machine'] == 'x86':
  397. ccflags += [
  398. #'/arch:SSE2', # use the SSE2 instructions
  399. ]
  400. if platform == 'windows':
  401. ccflags += [
  402. # TODO
  403. ]
  404. # Automatic pdb generation
  405. # See http://scons.tigris.org/issues/show_bug.cgi?id=1656
  406. env.EnsureSConsVersion(0, 98, 0)
  407. env['PDB'] = '${TARGET.base}.pdb'
  408. env.Append(CCFLAGS = ccflags)
  409. env.Append(CFLAGS = cflags)
  410. env.Append(CXXFLAGS = cxxflags)
  411. if env['platform'] == 'windows' and msvc:
  412. # Choose the appropriate MSVC CRT
  413. # http://msdn.microsoft.com/en-us/library/2kzt1wy3.aspx
  414. if env['build'] in ('debug', 'checked'):
  415. env.Append(CCFLAGS = ['/MTd'])
  416. env.Append(SHCCFLAGS = ['/LDd'])
  417. else:
  418. env.Append(CCFLAGS = ['/MT'])
  419. env.Append(SHCCFLAGS = ['/LD'])
  420. # Static code analysis
  421. if env['analyze']:
  422. if env['msvc']:
  423. # http://msdn.microsoft.com/en-us/library/ms173498.aspx
  424. env.Append(CCFLAGS = [
  425. '/analyze',
  426. #'/analyze:log', '${TARGET.base}.xml',
  427. ])
  428. if env['clang']:
  429. # scan-build will produce more comprehensive output
  430. env.Append(CCFLAGS = ['--analyze'])
  431. # Assembler options
  432. if gcc_compat:
  433. if env['machine'] == 'x86':
  434. env.Append(ASFLAGS = ['-m32'])
  435. if env['machine'] == 'x86_64':
  436. env.Append(ASFLAGS = ['-m64'])
  437. # Linker options
  438. linkflags = []
  439. shlinkflags = []
  440. if gcc_compat:
  441. if env['machine'] == 'x86':
  442. linkflags += ['-m32']
  443. if env['machine'] == 'x86_64':
  444. linkflags += ['-m64']
  445. if env['platform'] not in ('darwin'):
  446. shlinkflags += [
  447. '-Wl,-Bsymbolic',
  448. ]
  449. # Handle circular dependencies in the libraries
  450. if env['platform'] in ('darwin'):
  451. pass
  452. else:
  453. env['_LIBFLAGS'] = '-Wl,--start-group ' + env['_LIBFLAGS'] + ' -Wl,--end-group'
  454. if env['platform'] == 'windows':
  455. # Avoid depending on gcc runtime DLLs
  456. linkflags += ['-static-libgcc']
  457. if 'w64' in env['CC'].split('-'):
  458. linkflags += ['-static-libstdc++']
  459. # Handle the @xx symbol munging of DLL exports
  460. shlinkflags += ['-Wl,--enable-stdcall-fixup']
  461. #shlinkflags += ['-Wl,--kill-at']
  462. if msvc:
  463. if env['build'] == 'release':
  464. # enable Link-time Code Generation
  465. linkflags += ['/LTCG']
  466. env.Append(ARFLAGS = ['/LTCG'])
  467. if platform == 'windows' and msvc:
  468. # See also:
  469. # - http://msdn2.microsoft.com/en-us/library/y0zzbyt4.aspx
  470. linkflags += [
  471. '/fixed:no',
  472. '/incremental:no',
  473. ]
  474. env.Append(LINKFLAGS = linkflags)
  475. env.Append(SHLINKFLAGS = shlinkflags)
  476. # We have C++ in several libraries, so always link with the C++ compiler
  477. if gcc_compat:
  478. env['LINK'] = env['CXX']
  479. # Default libs
  480. libs = []
  481. if env['platform'] in ('darwin', 'freebsd', 'linux', 'posix', 'sunos'):
  482. libs += ['m', 'pthread', 'dl']
  483. if env['platform'] in ('linux',):
  484. libs += ['rt']
  485. if env['platform'] in ('haiku'):
  486. libs += ['root', 'be', 'network', 'translation']
  487. env.Append(LIBS = libs)
  488. # OpenMP
  489. if env['openmp']:
  490. if env['msvc']:
  491. env.Append(CCFLAGS = ['/openmp'])
  492. # When building openmp release VS2008 link.exe crashes with LNK1103 error.
  493. # Workaround: overwrite PDB flags with empty value as it isn't required anyways
  494. if env['build'] == 'release':
  495. env['PDB'] = ''
  496. if env['gcc']:
  497. env.Append(CCFLAGS = ['-fopenmp'])
  498. env.Append(LIBS = ['gomp'])
  499. # Load tools
  500. env.Tool('lex')
  501. env.Tool('yacc')
  502. if env['llvm']:
  503. env.Tool('llvm')
  504. # Custom builders and methods
  505. env.Tool('custom')
  506. createInstallMethods(env)
  507. env.PkgCheckModules('X11', ['x11', 'xext', 'xdamage', 'xfixes'])
  508. env.PkgCheckModules('XCB', ['x11-xcb', 'xcb-glx >= 1.8.1'])
  509. env.PkgCheckModules('XF86VIDMODE', ['xxf86vm'])
  510. env.PkgCheckModules('DRM', ['libdrm >= 2.4.38'])
  511. env.PkgCheckModules('DRM_INTEL', ['libdrm_intel >= 2.4.52'])
  512. env.PkgCheckModules('UDEV', ['libudev >= 151'])
  513. env['dri'] = env['x11'] and env['drm']
  514. # for debugging
  515. #print env.Dump()
  516. def exists(env):
  517. return 1