Revert changes to serverTypecheck
[hiphop-php.git] / hphp / DEFS
blobd2ec849fbe285258aecba84ee2099665295c7da7
2 with allow_unsafe_import():
3     import subprocess
5 def get_fbcode_platform():
6     return read_config('cxx', 'default_platform')
8 def get_compiler_type(platform):
9     if read_config('cxx#{}'.format(platform), 'cc_type') == 'clang':
10         return 'clang'
11     else:
12         return 'gcc'
14 def is_opt_hhvm_build():
15     buck_out = read_config('project', 'buck_out')
16     return '/opt' in buck_out
18 def is_dev_hhvm_build():
19     return '/dev' in read_config('project', 'buck_out')
21 def is_lto_build(platform):
22     flags = read_config('cxx#{}'.format(platform), 'cxxflags')
23     return " -flto " in flags
25 def find_systemlib_files(dir, skip):
26     find_cmd = [ 'find', dir, '-type', 'f', '-name', 'ext_*.php' ]
27     proc = subprocess.Popen(find_cmd, stdout=subprocess.PIPE)
28     files = str(proc.stdout.read().decode('ascii')).split('\n')
29     return sorted(map(lambda x: x[len(dir) if skip else 0:],
30                       filter(lambda x: x[:len(dir)] == dir, files)))