blob: e2cd0546c1e4733dec8818f59baee9278a249e0e [file] [log] [blame]
José Fonsecab04aa712008-06-06 14:48:57 +09001"""gallium
2
3Frontend-tool for Gallium3D architecture.
4
5"""
6
José Fonseca381e3482008-07-17 11:23:43 +09007#
José Fonsecab04aa712008-06-06 14:48:57 +09008# Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
9# All Rights Reserved.
José Fonseca381e3482008-07-17 11:23:43 +090010#
José Fonsecab04aa712008-06-06 14:48:57 +090011# Permission is hereby granted, free of charge, to any person obtaining a
12# copy of this software and associated documentation files (the
13# "Software"), to deal in the Software without restriction, including
14# without limitation the rights to use, copy, modify, merge, publish,
15# distribute, sub license, and/or sell copies of the Software, and to
16# permit persons to whom the Software is furnished to do so, subject to
17# the following conditions:
José Fonseca381e3482008-07-17 11:23:43 +090018#
José Fonsecab04aa712008-06-06 14:48:57 +090019# The above copyright notice and this permission notice (including the
20# next paragraph) shall be included in all copies or substantial portions
21# of the Software.
José Fonseca381e3482008-07-17 11:23:43 +090022#
José Fonsecab04aa712008-06-06 14:48:57 +090023# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
24# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
25# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
26# IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
27# ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
28# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
29# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
José Fonseca381e3482008-07-17 11:23:43 +090030#
José Fonsecab04aa712008-06-06 14:48:57 +090031
32
José Fonseca27d8d6f2008-07-03 12:42:23 +090033import os
José Fonsecab04aa712008-06-06 14:48:57 +090034import os.path
José Fonseca27d8d6f2008-07-03 12:42:23 +090035import re
José Fonsecab04aa712008-06-06 14:48:57 +090036
37import SCons.Action
38import SCons.Builder
José Fonseca27d8d6f2008-07-03 12:42:23 +090039import SCons.Scanner
José Fonsecab04aa712008-06-06 14:48:57 +090040
41
42def quietCommandLines(env):
José Fonseca381e3482008-07-17 11:23:43 +090043 # Quiet command lines
44 # See also http://www.scons.org/wiki/HidingCommandLinesInOutput
45 env['CCCOMSTR'] = "Compiling $SOURCE ..."
46 env['CXXCOMSTR'] = "Compiling $SOURCE ..."
47 env['ARCOMSTR'] = "Archiving $TARGET ..."
48 env['RANLIBCOMSTR'] = ""
49 env['LINKCOMSTR'] = "Linking $TARGET ..."
José Fonsecab04aa712008-06-06 14:48:57 +090050
51
52def createConvenienceLibBuilder(env):
53 """This is a utility function that creates the ConvenienceLibrary
54 Builder in an Environment if it is not there already.
55
56 If it is already there, we return the existing one.
José Fonseca381e3482008-07-17 11:23:43 +090057
José Fonsecab04aa712008-06-06 14:48:57 +090058 Based on the stock StaticLibrary and SharedLibrary builders.
59 """
60
61 try:
62 convenience_lib = env['BUILDERS']['ConvenienceLibrary']
63 except KeyError:
64 action_list = [ SCons.Action.Action("$ARCOM", "$ARCOMSTR") ]
65 if env.Detect('ranlib'):
66 ranlib_action = SCons.Action.Action("$RANLIBCOM", "$RANLIBCOMSTR")
67 action_list.append(ranlib_action)
68
69 convenience_lib = SCons.Builder.Builder(action = action_list,
70 emitter = '$LIBEMITTER',
71 prefix = '$LIBPREFIX',
72 suffix = '$LIBSUFFIX',
73 src_suffix = '$SHOBJSUFFIX',
74 src_builder = 'SharedObject')
75 env['BUILDERS']['ConvenienceLibrary'] = convenience_lib
José Fonsecab04aa712008-06-06 14:48:57 +090076
77 return convenience_lib
78
79
José Fonseca27d8d6f2008-07-03 12:42:23 +090080# TODO: handle import statements with multiple modules
81# TODO: handle from import statements
82import_re = re.compile(r'^import\s+(\S+)$', re.M)
83
84def python_scan(node, env, path):
José Fonseca381e3482008-07-17 11:23:43 +090085 # http://www.scons.org/doc/0.98.5/HTML/scons-user/c2781.html#AEN2789
86 contents = node.get_contents()
87 source_dir = node.get_dir()
88 imports = import_re.findall(contents)
89 results = []
90 for imp in imports:
91 for dir in path:
92 file = os.path.join(str(dir), imp.replace('.', os.sep) + '.py')
93 if os.path.exists(file):
94 results.append(env.File(file))
95 break
96 file = os.path.join(str(dir), imp.replace('.', os.sep), '__init__.py')
97 if os.path.exists(file):
98 results.append(env.File(file))
99 break
100 return results
José Fonseca27d8d6f2008-07-03 12:42:23 +0900101
102python_scanner = SCons.Scanner.Scanner(function = python_scan, skeys = ['.py'])
103
104
105def code_generate(env, script, target, source, command):
José Fonseca381e3482008-07-17 11:23:43 +0900106 """Method to simplify code generation via python scripts.
José Fonseca27d8d6f2008-07-03 12:42:23 +0900107
José Fonseca381e3482008-07-17 11:23:43 +0900108 http://www.scons.org/wiki/UsingCodeGenerators
109 http://www.scons.org/doc/0.98.5/HTML/scons-user/c2768.html
110 """
111
112 # We're generating code using Python scripts, so we have to be
113 # careful with our scons elements. This entry represents
114 # the generator file *in the source directory*.
115 script_src = env.File(script).srcnode()
116
117 # This command creates generated code *in the build directory*.
118 command = command.replace('$SCRIPT', script_src.path)
119 code = env.Command(target, source, command)
120
121 # Explicitly mark that the generated code depends on the generator,
122 # and on implicitly imported python modules
123 path = (script_src.get_dir(),)
124 deps = [script_src]
125 deps += script_src.get_implicit_deps(env, python_scanner, path)
126 env.Depends(code, deps)
127
128 # Running the Python script causes .pyc files to be generated in the
129 # source directory. When we clean up, they should go too. So add side
130 # effects for .pyc files
131 for dep in deps:
132 pyc = env.File(str(dep) + 'c')
133 env.SideEffect(pyc, code)
134
135 return code
José Fonseca27d8d6f2008-07-03 12:42:23 +0900136
137
138def createCodeGenerateMethod(env):
José Fonseca381e3482008-07-17 11:23:43 +0900139 env.Append(SCANNERS = python_scanner)
140 env.AddMethod(code_generate, 'CodeGenerate')
José Fonseca27d8d6f2008-07-03 12:42:23 +0900141
142
José Fonseca52c2dd12008-09-08 07:54:15 +0900143def symlink(target, source, env):
144 target = str(target[0])
145 source = str(source[0])
146 if os.path.islink(target) or os.path.exists(target):
147 os.remove(target)
148 os.symlink(os.path.basename(source), target)
149
150def install_shared_library(env, source, version = ()):
151 source = str(source[0])
152 version = tuple(map(str, version))
José Fonseca7cfc2942008-09-08 21:50:50 +0900153 target_dir = os.path.join(env.Dir('#.').srcnode().abspath, env['build'], 'lib')
José Fonseca52c2dd12008-09-08 07:54:15 +0900154 target_name = '.'.join((str(source),) + version)
155 last = env.InstallAs(os.path.join(target_dir, target_name), source)
156 while len(version):
157 version = version[:-1]
158 target_name = '.'.join((str(source),) + version)
159 action = SCons.Action.Action(symlink, "$TARGET -> $SOURCE")
José Fonseca52c2dd12008-09-08 07:54:15 +0900160 last = env.Command(os.path.join(target_dir, target_name), last, action)
161
162def createInstallMethods(env):
163 env.AddMethod(install_shared_library, 'InstallSharedLibrary')
164
165
José Fonseca1e8177e2009-02-10 18:11:56 +0000166def num_jobs():
167 try:
168 return int(os.environ['NUMBER_OF_PROCESSORS'])
169 except (ValueError, KeyError):
170 pass
171
172 try:
173 return os.sysconf('SC_NPROCESSORS_ONLN')
174 except (ValueError, OSError, AttributeError):
175 pass
176
177 try:
178 return int(os.popen2("sysctl -n hw.ncpu")[1].read())
179 except ValueError:
180 pass
181
182 return 1
183
184
José Fonsecab04aa712008-06-06 14:48:57 +0900185def generate(env):
José Fonseca381e3482008-07-17 11:23:43 +0900186 """Common environment generation code"""
José Fonsecab04aa712008-06-06 14:48:57 +0900187
José Fonseca381e3482008-07-17 11:23:43 +0900188 # FIXME: this is already too late
189 #if env.get('quiet', False):
190 # quietCommandLines(env)
José Fonsecab04aa712008-06-06 14:48:57 +0900191
José Fonseca6cf59e12008-11-18 19:13:32 +0900192 # Toolchain
193 platform = env['platform']
194 if env['toolchain'] == 'default':
195 if platform == 'winddk':
Michal Krol4f3dcf32008-11-19 20:31:38 +0100196 env['toolchain'] = 'winddk'
José Fonseca6cf59e12008-11-18 19:13:32 +0900197 elif platform == 'wince':
Michal Krol4f3dcf32008-11-19 20:31:38 +0100198 env['toolchain'] = 'wcesdk'
José Fonseca6cf59e12008-11-18 19:13:32 +0900199 env.Tool(env['toolchain'])
200
José Fonseca26e27ba2009-03-25 19:24:16 +0000201 env['gcc'] = 'gcc' in os.path.basename(env['CC']).split('-')
202 env['msvc'] = env['CC'] == 'cl'
203
José Fonseca381e3482008-07-17 11:23:43 +0900204 # shortcuts
205 debug = env['debug']
206 machine = env['machine']
207 platform = env['platform']
208 x86 = env['machine'] == 'x86'
Michel Dänzer6b69e3c2008-10-23 10:28:48 +0200209 ppc = env['machine'] == 'ppc'
José Fonseca26e27ba2009-03-25 19:24:16 +0000210 gcc = env['gcc']
211 msvc = env['msvc']
José Fonsecab04aa712008-06-06 14:48:57 +0900212
José Fonseca381e3482008-07-17 11:23:43 +0900213 # Put build output in a separate dir, which depends on the current
214 # configuration. See also http://www.scons.org/wiki/AdvancedBuildExample
215 build_topdir = 'build'
216 build_subdir = env['platform']
José Fonseca381e3482008-07-17 11:23:43 +0900217 if env['llvm']:
218 build_subdir += "-llvm"
219 if env['machine'] != 'generic':
220 build_subdir += '-' + env['machine']
221 if env['debug']:
222 build_subdir += "-debug"
223 if env['profile']:
224 build_subdir += "-profile"
225 build_dir = os.path.join(build_topdir, build_subdir)
226 # Place the .sconsign file in the build dir too, to avoid issues with
227 # different scons versions building the same source file
228 env['build'] = build_dir
229 env.SConsignFile(os.path.join(build_dir, '.sconsign'))
José Fonseca18170bb2009-01-23 21:01:16 +0000230 env.CacheDir('build/cache')
José Fonsecab04aa712008-06-06 14:48:57 +0900231
José Fonseca1e8177e2009-02-10 18:11:56 +0000232 # Parallel build
233 if env.GetOption('num_jobs') <= 1:
234 env.SetOption('num_jobs', num_jobs())
235
José Fonseca381e3482008-07-17 11:23:43 +0900236 # C preprocessor options
237 cppdefines = []
238 if debug:
239 cppdefines += ['DEBUG']
240 else:
241 cppdefines += ['NDEBUG']
242 if env['profile']:
243 cppdefines += ['PROFILE']
244 if platform == 'windows':
245 cppdefines += [
246 'WIN32',
247 '_WINDOWS',
José Fonseca42be0102009-01-22 14:26:30 +0000248 #'_UNICODE',
249 #'UNICODE',
José Fonseca129c6ed2008-12-01 11:53:26 -0800250 ('_WIN32_WINNT', '0x0501'), # minimum required OS version
251 ('WINVER', '0x0501'),
José Fonseca381e3482008-07-17 11:23:43 +0900252 # http://msdn2.microsoft.com/en-us/library/6dwk3a1z.aspx,
253 'WIN32_LEAN_AND_MEAN',
José Fonseca381e3482008-07-17 11:23:43 +0900254 ]
José Fonsecab3e03ed2009-03-25 19:32:54 +0000255 if msvc:
256 cppdefines += [
257 'VC_EXTRALEAN',
258 '_CRT_SECURE_NO_DEPRECATE',
259 ]
José Fonseca381e3482008-07-17 11:23:43 +0900260 if debug:
261 cppdefines += ['_DEBUG']
262 if platform == 'winddk':
263 # Mimic WINDDK's builtin flags. See also:
264 # - WINDDK's bin/makefile.new i386mk.inc for more info.
265 # - buildchk_wxp_x86.log files, generated by the WINDDK's build
266 # - http://alter.org.ua/docs/nt_kernel/vc8_proj/
267 cppdefines += [
268 ('_X86_', '1'),
269 ('i386', '1'),
270 'STD_CALL',
271 ('CONDITION_HANDLING', '1'),
272 ('NT_INST', '0'),
273 ('WIN32', '100'),
274 ('_NT1X_', '100'),
275 ('WINNT', '1'),
276 ('_WIN32_WINNT', '0x0501'), # minimum required OS version
277 ('WINVER', '0x0501'),
278 ('_WIN32_IE', '0x0603'),
279 ('WIN32_LEAN_AND_MEAN', '1'),
280 ('DEVL', '1'),
281 ('__BUILDMACHINE__', 'WinDDK'),
282 ('FPO', '0'),
283 ]
284 if debug:
285 cppdefines += [('DBG', 1)]
286 if platform == 'wince':
287 cppdefines += [
288 '_CRT_SECURE_NO_DEPRECATE',
289 '_USE_32BIT_TIME_T',
290 'UNICODE',
291 '_UNICODE',
292 ('UNDER_CE', '600'),
293 ('_WIN32_WCE', '0x600'),
294 'WINCEOEM',
295 'WINCEINTERNAL',
296 'WIN32',
297 'STRICT',
298 'x86',
299 '_X86_',
300 'INTERNATIONAL',
301 ('INTLMSG_CODEPAGE', '1252'),
302 ]
303 if platform == 'windows':
304 cppdefines += ['PIPE_SUBSYSTEM_WINDOWS_USER']
305 if platform == 'winddk':
306 cppdefines += ['PIPE_SUBSYSTEM_WINDOWS_DISPLAY']
307 if platform == 'wince':
308 cppdefines += ['PIPE_SUBSYSTEM_WINDOWS_CE']
José Fonseca40b3bb02008-11-04 10:53:02 +0900309 cppdefines += ['PIPE_SUBSYSTEM_WINDOWS_CE_OGL']
José Fonseca381e3482008-07-17 11:23:43 +0900310 env.Append(CPPDEFINES = cppdefines)
José Fonsecab04aa712008-06-06 14:48:57 +0900311
José Fonseca381e3482008-07-17 11:23:43 +0900312 # C preprocessor includes
313 if platform == 'winddk':
314 env.Append(CPPPATH = [
315 env['SDK_INC_PATH'],
316 env['DDK_INC_PATH'],
317 env['WDM_INC_PATH'],
318 env['CRT_INC_PATH'],
319 ])
José Fonseca05cfb4c2008-06-27 13:41:23 +0900320
José Fonseca381e3482008-07-17 11:23:43 +0900321 # C compiler options
322 cflags = []
323 if gcc:
324 if debug:
325 cflags += ['-O0', '-g3']
326 else:
327 cflags += ['-O3', '-g3']
328 if env['profile']:
329 cflags += ['-pg']
330 if env['machine'] == 'x86':
331 cflags += [
332 '-m32',
333 #'-march=pentium4',
334 '-mmmx', '-msse', '-msse2', # enable SIMD intrinsics
335 #'-mfpmath=sse',
336 ]
337 if env['machine'] == 'x86_64':
338 cflags += ['-m64']
José Fonseca102cb5c2009-03-13 16:21:30 +0000339 # See also:
340 # - http://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
José Fonseca381e3482008-07-17 11:23:43 +0900341 cflags += [
José Fonseca102cb5c2009-03-13 16:21:30 +0000342 '-Werror=declaration-after-statement',
José Fonseca381e3482008-07-17 11:23:43 +0900343 '-Wall',
344 '-Wmissing-prototypes',
José Fonseca102cb5c2009-03-13 16:21:30 +0000345 '-Wmissing-field-initializers',
346 '-Wpointer-arith',
José Fonseca381e3482008-07-17 11:23:43 +0900347 '-Wno-long-long',
348 '-ffast-math',
José Fonseca47ca0232009-01-14 13:03:09 +0000349 '-std=gnu99',
José Fonseca381e3482008-07-17 11:23:43 +0900350 '-fmessage-length=0', # be nice to Eclipse
351 ]
352 if msvc:
353 # See also:
José Fonsecaa6c72582008-09-01 09:47:40 +0900354 # - http://msdn.microsoft.com/en-us/library/19z1t1wy.aspx
José Fonseca381e3482008-07-17 11:23:43 +0900355 # - cl /?
356 if debug:
357 cflags += [
358 '/Od', # disable optimizations
359 '/Oi', # enable intrinsic functions
360 '/Oy-', # disable frame pointer omission
José Fonseca73ccabc2009-02-12 11:57:45 +0000361 '/GL-', # disable whole program optimization
José Fonseca381e3482008-07-17 11:23:43 +0900362 ]
363 else:
364 cflags += [
365 '/Ox', # maximum optimizations
366 '/Oi', # enable intrinsic functions
José Fonsecaa6c72582008-09-01 09:47:40 +0900367 '/Ot', # favor code speed
368 #'/fp:fast', # fast floating point
José Fonseca381e3482008-07-17 11:23:43 +0900369 ]
370 if env['profile']:
371 cflags += [
372 '/Gh', # enable _penter hook function
373 '/GH', # enable _pexit hook function
374 ]
375 cflags += [
376 '/W3', # warning level
377 #'/Wp64', # enable 64 bit porting warnings
378 ]
José Fonsecaa6c72582008-09-01 09:47:40 +0900379 if env['machine'] == 'x86':
380 cflags += [
381 #'/QIfist', # Suppress _ftol
382 #'/arch:SSE2', # use the SSE2 instructions
383 ]
José Fonseca381e3482008-07-17 11:23:43 +0900384 if platform == 'windows':
385 cflags += [
386 # TODO
387 ]
388 if platform == 'winddk':
389 cflags += [
390 '/Zl', # omit default library name in .OBJ
391 '/Zp8', # 8bytes struct member alignment
392 '/Gy', # separate functions for linker
393 '/Gm-', # disable minimal rebuild
394 '/WX', # treat warnings as errors
395 '/Gz', # __stdcall Calling convention
396 '/GX-', # disable C++ EH
397 '/GR-', # disable C++ RTTI
398 '/GF', # enable read-only string pooling
399 '/G6', # optimize for PPro, P-II, P-III
400 '/Ze', # enable extensions
401 '/Gi-', # disable incremental compilation
402 '/QIfdiv-', # disable Pentium FDIV fix
403 '/hotpatch', # prepares an image for hotpatching.
404 #'/Z7', #enable old-style debug info
405 ]
406 if platform == 'wince':
407 # See also C:\WINCE600\public\common\oak\misc\makefile.def
408 cflags += [
409 '/Zl', # omit default library name in .OBJ
410 '/GF', # enable read-only string pooling
411 '/GR-', # disable C++ RTTI
412 '/GS', # enable security checks
413 # Allow disabling language conformance to maintain backward compat
414 #'/Zc:wchar_t-', # don't force wchar_t as native type, instead of typedef
415 #'/Zc:forScope-', # don't enforce Standard C++ for scoping rules
416 #'/wd4867',
417 #'/wd4430',
418 #'/MT',
419 #'/U_MT',
420 ]
421 # Automatic pdb generation
422 # See http://scons.tigris.org/issues/show_bug.cgi?id=1656
423 env.EnsureSConsVersion(0, 98, 0)
424 env['PDB'] = '${TARGET.base}.pdb'
425 env.Append(CFLAGS = cflags)
426 env.Append(CXXFLAGS = cflags)
José Fonsecab04aa712008-06-06 14:48:57 +0900427
José Fonseca1781d7f2009-01-06 16:16:38 +0000428 if env['platform'] == 'windows' and msvc:
429 # Choose the appropriate MSVC CRT
430 # http://msdn.microsoft.com/en-us/library/2kzt1wy3.aspx
431 if env['debug']:
432 env.Append(CCFLAGS = ['/MTd'])
433 env.Append(SHCCFLAGS = ['/LDd'])
434 else:
435 env.Append(CCFLAGS = ['/MT'])
436 env.Append(SHCCFLAGS = ['/LD'])
437
José Fonseca381e3482008-07-17 11:23:43 +0900438 # Assembler options
439 if gcc:
440 if env['machine'] == 'x86':
441 env.Append(ASFLAGS = ['-m32'])
442 if env['machine'] == 'x86_64':
443 env.Append(ASFLAGS = ['-m64'])
José Fonseca27d8d6f2008-07-03 12:42:23 +0900444
José Fonseca381e3482008-07-17 11:23:43 +0900445 # Linker options
446 linkflags = []
447 if gcc:
448 if env['machine'] == 'x86':
449 linkflags += ['-m32']
450 if env['machine'] == 'x86_64':
451 linkflags += ['-m64']
José Fonseca6fe421c2009-02-12 12:59:58 +0000452 if platform == 'windows' and msvc:
José Fonseca381e3482008-07-17 11:23:43 +0900453 # See also:
454 # - http://msdn2.microsoft.com/en-us/library/y0zzbyt4.aspx
455 linkflags += [
José Fonseca73ccabc2009-02-12 11:57:45 +0000456 '/fixed:no',
457 '/incremental:no',
458 ]
459 if platform == 'winddk':
460 linkflags += [
José Fonseca381e3482008-07-17 11:23:43 +0900461 '/merge:_PAGE=PAGE',
462 '/merge:_TEXT=.text',
463 '/section:INIT,d',
464 '/opt:ref',
465 '/opt:icf',
466 '/ignore:4198,4010,4037,4039,4065,4070,4078,4087,4089,4221',
467 '/incremental:no',
468 '/fullbuild',
469 '/release',
470 '/nodefaultlib',
471 '/wx',
472 '/debug',
473 '/debugtype:cv',
474 '/version:5.1',
475 '/osversion:5.1',
476 '/functionpadmin:5',
477 '/safeseh',
478 '/pdbcompress',
479 '/stack:0x40000,0x1000',
480 '/driver',
481 '/align:0x80',
482 '/subsystem:native,5.01',
483 '/base:0x10000',
484
485 '/entry:DrvEnableDriver',
486 ]
José Fonseca46728032009-02-18 15:05:23 +0000487 if env['debug'] or env['profile']:
José Fonseca381e3482008-07-17 11:23:43 +0900488 linkflags += [
489 '/MAP', # http://msdn.microsoft.com/en-us/library/k7xkk3e2.aspx
490 ]
491 if platform == 'wince':
492 linkflags += [
493 '/nodefaultlib',
494 #'/incremental:no',
495 #'/fullbuild',
496 '/entry:_DllMainCRTStartup',
497 ]
498 env.Append(LINKFLAGS = linkflags)
499
José Fonsecac76787a2008-07-17 11:25:20 +0900500 # Default libs
501 env.Append(LIBS = [])
502
José Fonseca381e3482008-07-17 11:23:43 +0900503 # Custom builders and methods
504 createConvenienceLibBuilder(env)
505 createCodeGenerateMethod(env)
José Fonseca52c2dd12008-09-08 07:54:15 +0900506 createInstallMethods(env)
José Fonseca381e3482008-07-17 11:23:43 +0900507
508 # for debugging
509 #print env.Dump()
José Fonsecab04aa712008-06-06 14:48:57 +0900510
511
512def exists(env):
José Fonseca381e3482008-07-17 11:23:43 +0900513 return 1