def main(dependencies, msvcr71_preparation, msys_preparation): """Build the dependencies according to the command line options.""" options, args = command_line() if options.arg_help: print_("These are the Pygame library dependencies:") for dep in dependencies: print_(" ", dep.name) return 0 try: chosen_deps = choose_dependencies(dependencies, options, args) except ChooseError: print_(geterror()) return 1 if not chosen_deps: if not args: print_("No libraries specified.") elif options.build_all: print_("All libraries excluded") if options.msvcr71: chosen_deps.insert(0, msvcr71_preparation) if chosen_deps: chosen_deps.insert(0, msys_preparation) try: m = msys.Msys(options.msys_directory) except msys.MsysException: print_(geterror()) return 1 start_time = None return_code = 1 set_environment_variables(m, options) try: configure(chosen_deps) except BuildError: print_("Build aborted:", geterror()) else: print_("\n=== Starting build ===") start_time = time.time() # For file timestamp checks. try: build(chosen_deps, m) except BuildError: print_("Build aborted:", geterror()) else: # A successful build! return_code = 0 summary(dependencies, m, start_time, chosen_deps) # MinGW configure file for setup.py (optional). try: import mingwcfg except ImportError: pass else: mingwcfg.write(m.mingw_root) return return_code
def main(dependencies, msys_preparation): """Build the dependencies according to the command line options.""" options, args = command_line() if options.arg_help: print_("These are the Pygame library dependencies:") for dep in dependencies: print_(" ", dep.name) return 0 # Only building against msvcrt.dll for now. options.msvcrt_version = 60 try: chosen_deps = choose_dependencies(dependencies, options, args) except ChooseError: print_(geterror()) return 1 if not chosen_deps: if not args: print_("No libraries specified.") elif options.build_all: print_("All libraries excluded") print_("Linking to C runtime library msvcrt.dll.") if chosen_deps and not options.clean_only: chosen_deps.insert(0, msys_preparation) try: m = msys.Msys(options.msys_directory) except msys.MsysException: print_(geterror()) return 1 print_("Using MSYS in directory:", m.msys_root) print_("MinGW directory:", m.mingw_root) start_time = None return_code = 1 set_environment_variables(m, options) if not options.clean_only: print_("Destination directory:", m.msys_to_windows(m.environ['PREFIX']).replace('/', os.sep)) print_("common CPPFLAGS:", m.environ.get('CPPFLAGS', '')) print_("common CFLAGS:", m.environ.get('CFLAGS', '')) print_("common LDFLAGS:", m.environ.get('LDFLAGS', '')) sources = hunt_paths if options.sources: sources = options.sources.split(';') print_("library source directories search paths: %s" % (';'.join(sources),)) try: configure(chosen_deps, sources) except BuildError: print_("Build aborted:", geterror()) else: if options.clean_only: print_("\n=== Performing clean ===") else: print_("\n=== Starting build ===") start_time = time.time() # For file timestamp checks. try: build(chosen_deps, m) except BuildError: print_("Build aborted:", geterror()) else: # A successful build! return_code = 0 if not options.clean_only: summary(dependencies, m, start_time, chosen_deps) # MinGW configure file for setup.py (optional). try: import mingwcfg except ImportError: pass else: mingwcfg.write(m.mingw_root) if options.finish_alert or options.finish_alert_ntimes > 0: if options.finish_alert_ntimes > 0: m.environ['BDNTIMES'] = "%i" % (options.finish_alert_ntimes,) alert.build(m) return return_code