def posix_test_cc(): utils.goto_build() f = open('cpptest.cc', 'w') f.write('int main(void) {}') f.close() ret = os.system('c++ -o cpptest cpptest.cc') # True if successful return bool(ret == 0)
def posix_deps_test_c(): utils.goto_build() f = open('dtest.c', 'w') f.write(posix_deps_test_c_file) f.close() ret = os.system( 'cc -I/usr/include/gtk-2.0 -I/usr/include/freetype2 -o dtest dtest.c') # True if successful return bool(ret == 0)
if not posix_deps_test_c(): print """ JOHANNES ##### cc (compiler) or necessary headers not found. See error above. Please fix and try again. * See the johannes README.txt for more details on which packages to install, and also for correct apt-get invocation to install them all on for example Debian / Ubuntu. """ return if not posix_test_cc(): utils.output('c++ compiler not found.') return utils.goto_build() tbfn = os.path.join(config.archive_dir, python_fname) pybasename = 'Python-%s' % (PYVER_STR,) build_dir = os.path.join(config.build_dir, pybasename) if not os.path.exists(build_dir): utils.unpack(tbfn) os.chdir(build_dir) ret = os.system( './configure --enable-shared --prefix=%s/python' % (config.inst_dir,)) if ret != 0: utils.error('Python configure error.')