Пример #1
0
def _prepare_catalog(catalog):
    if catalog == None:
        catalog = os.path.join(elocation.eweasel(), "control", "catalog")
    catalog = os.path.expandvars(catalog)
    if not os.path.exists(catalog):
        catalog = os.path.join(elocation.build(), catalog + ".eweasel_catalog")

    return os.path.realpath(catalog)
Пример #2
0
def test_location():
	elocation.move ("eve", "eve2")
	elocation.copy ("eve2", "eve3")
	elocation.delete ("eve3")
	elocation.move ("eve2", "eve")
	print (elocation.base_directory())
	print (elocation.trunk_source())
	print (elocation.eve_source())
	print (elocation.eweasel())
	print (elocation.nightly())
	print (elocation.build())
	print (elocation.eweasel_build())
Пример #3
0
def generate(a_filter, name="autogen"):
    l_parser = boolean.Parser(a_filter)
    l_filter = l_parser.parse()
    l_target_path = os.path.join(elocation.build(), name + ".eweasel_catalog")
    SystemLogger.info("Creating catalog " + l_target_path + " with filter: " + l_filter.to_string())
    with open(_prepare_catalog(None), "r") as source:
        with open(l_target_path, "w") as target:
            target.write("source_path $BUGS\n")
            for line in source:
                if l_filter.evaluate(line):
                    print(line.rstrip())
                    target.write(line)
Пример #4
0
def compile_runtime():
	builddir = os.path.join (elocation.build(), "runtime")
	build_libdir = None
	sourcedir = os.path.join (elocation.trunk_source(), "C")
	scriptdir = os.path.join (elocation.base_directory(),  "scripts")
	shell_command = os.path.expandvars (d_shell_command_raw)
	
		# TODO: Incremental compilation.
	
	copy_files (os.path.join (scriptdir, "*lua*"), sourcedir)
	elocation.delete (os.path.join (sourcedir, "config.sh"))
	
	config_sh = os.environ ["ISE_PLATFORM"]
	old_path = os.environ ["PATH"]
	
	if config_sh == 'win64':
		os.environ ["PATH"] = os.path.dirname (shell_command) + ':' + old_path
		config_sh = 'windows-x86-64-' + os.environ ['ISE_C_COMPILER']
	if config_sh == 'win32':
		os.environ ["PATH"] = dirname (shell_command) + ':' + old_path
		config_sh = 'windows-x86-' + os.environ ['ISE_C_COMPILER']
	
	elocation.copy (os.path.expandvars (os.path.join (sourcedir, "CONFIGS", config_sh)), os.path.join (sourcedir, "config.sh"))
	run_command ([shell_command, "config_lua.SH"], sourcedir)
	run_command ([shell_command, "eif_config_h.SH"], sourcedir)
	run_command ([shell_command, "eif_size_h.SH"], os.path.join (sourcedir, "run-time"))
	copy_files (os.path.join (sourcedir, "*.h"), os.path.join (sourcedir, "run-time"))
	
	os.environ ['PATH'] = old_path
	
	if platform.system() == 'Windows':
		# Shell and Nmake based build system:
		run_command ([os.path.join(sourcedir, "Configure.bat"), "clean"], sourcedir)
		run_command ([os.path.join(sourcedir, "Configure.bat"), d_windows_runtime_flag, 'm'], sourcedir)
		l_config_location = os.path.expandvars (os.path.join("$ISE_EIFFEL", "studio", "config", "$ISE_PLATFORM", "$ISE_C_COMPILER"))
		copy_files (os.path.join (sourcedir, "config.sh"), l_config_location)
		build_libdir = os.path.join (sourcedir, 'run-time', 'LIB')
		
		# Premake based build system:
		# run_command ([os.path.join (sourcedir, 'premake4.exe'), "vs2010"], sourcedir)
		# run_command (['msbuild.exe', 'EiffelRunTime.sln', '/upgrade'], builddir)
		# run_command (["msbuild.exe", "EiffelRunTime.sln"], builddir)
		# build_libdir = os.path.join (builddir, 'spec', 'lib')
	else:
		# Shell and make based build system:
#		run_command (["make", "clobber"], sourcedir)
#		run_command (["./quick_configure"], sourcedir)
#		build_libdir = os.path.join (sourcedir, 'run-time')
		
		
		# Premake based build system:
		
		# NOTE: This is a workaround for a current problem:
		# Two files are called stack.c
		# We therefore create a symlink between these files.
		l_stack_ipc = os.path.join (sourcedir, "ipc", "shared", "stack_ipc.c")
		if not os.path.exists (l_stack_ipc):
			os.symlink (os.path.join (os.path.dirname (l_stack_ipc), "stack.c"), l_stack_ipc)
		
		if os.path.exists (os.path.join (builddir, "Makefile")):
			run_command (["make", "clean"], builddir)
		run_command (["premake4", "gmake"], sourcedir)
		 #TODO: Get the correct link_command from config.sh (sharedlink Bash variable)
		fix_makefiles (os.path.join (builddir, "*_shared.make"), 'ld')
		make_command = ["make"]
		#make_command = make_command + ["config=release"] # Release
		#make_command = make_command + ["verbose=y"] # Verbose output
		run_command (make_command, builddir)

		copy_files (os.path.join (sourcedir, "config.sh"), d_target_includedir_raw)
		build_libdir = os.path.join (builddir, "spec", "lib")

		# Copy public header files and all run-times.
	copy_files (os.path.join (sourcedir, "run-time", "*.h"), d_target_includedir_raw)
	copy_files (os.path.join (sourcedir, "run-time", "eif_stack.decl"), d_target_includedir_raw)
	copy_files (os.path.join (sourcedir, "run-time", "eif_stack.interface"), d_target_includedir_raw)
	copy_files (os.path.join (build_libdir, "*finalized.*"), d_target_libdir_raw)
	copy_files (os.path.join (build_libdir, "*wkbench.*"), d_target_libdir_raw)
	

		# Compile the various C support libraries needed by Eiffel libraries.
	compile_libraries (d_platform_libs)
	compile_libraries (d_shared_libs)