def print_envs(options, info): ufid = optionsutil.make_ufid_from_cmdline_options(options) os_type, os_name, cpu_type, os_ver = get_os_info() uplid = optiontypes.Uplid(os_type, os_name, cpu_type, os_ver, info.type_, info.version) print('Using compiler: %s' % info.description(), file=sys.stderr) print('Using ufid: %s' % ufid, file=sys.stderr) print('export BDE_WAF_UPLID=%s' % uplid) print('export BDE_WAF_UFID=%s' % ufid) id_str = '%s-%s' % (uplid, ufid) print('export BDE_WAF_BUILD_DIR="_build/%s"' % id_str) print('export WAFLOCK=".lock-waf-%s"' % id_str) if os_type != 'windows': print('export CXX=%s' % info.cxx_path) print('export CC=%s' % info.c_path) if info.flags: print('export BDE_WAF_COMP_FLAGS="%s"' % info.flags) else: print('unset BDE_WAF_COMP_FLAGS') if options.install_dir: install_dir = options.install_dir else: install_dir = _determine_installation_location( os.environ.get('PREFIX'), uplid) if install_dir: print('Using install directory: %s' % install_dir, file=sys.stderr) PREFIX = os.path.join(install_dir, id_str) if sysutil.unversioned_platform() == 'cygwin': PREFIX = sysutil.shell_command('cygpath -m "%s"' % PREFIX).rstrip() print('export PREFIX="%s"' % PREFIX) pkg_path = '%s/lib/pkgconfig' % PREFIX extra_pkg_path = os.environ.get('BDE_WAF_EXTRA_PKG_CONFIG_PATH') if extra_pkg_path: pkg_path += ':' + extra_pkg_path print('export PKG_CONFIG_PATH="%s"' % pkg_path)
def print_envs(options, info): ufid = optionsutil.make_ufid_from_cmdline_options(options) os_type, os_name, cpu_type, os_ver = get_os_info() uplid = optiontypes.Uplid(os_type, os_name, cpu_type, os_ver, info.type_, info.version) print('Using compiler: %s' % info.description(), file=sys.stderr) print('Using ufid: %s' % ufid, file=sys.stderr) print('export BDE_WAF_UPLID=%s' % uplid) print('export BDE_WAF_UFID=%s' % ufid) id_str = '%s-%s' % (uplid, ufid) print('export BDE_WAF_BUILD_DIR="_build/%s"' % id_str) print('export WAFLOCK=".lock-waf-%s"' % id_str) if os_type != 'windows': print('export CXX=%s' % info.cxx_path) print('export CC=%s' % info.c_path) if info.flags: print('export BDE_WAF_COMP_FLAGS="%s"' % info.flags) else: print('unset BDE_WAF_COMP_FLAGS') if options.install_dir: install_dir = options.install_dir else: install_dir = _determine_installation_location( os.environ.get('PREFIX'), uplid) if install_dir: print('Using install directory: %s' % install_dir, file=sys.stderr) PREFIX = os.path.join(install_dir, id_str) if sysutil.unversioned_platform() == 'cygwin': PREFIX = sysutil.shell_command('cygpath -m "%s"' % PREFIX).rstrip() print('export PREFIX="%s"' % PREFIX) pkg_path = '%s/lib/pkgconfig' % PREFIX extra_pkg_path = os.environ.get('BDE_WAF_EXTRA_PKG_CONFIG_PATH') if extra_pkg_path: pkg_path += ':' + extra_pkg_path print('export PKG_CONFIG_PATH="%s"' % pkg_path)
def print_envs(options, info): ufid = optionsutil.make_ufid_from_cmdline_options(options) os_type, os_name, cpu_type, os_ver = get_os_info() uplid = optiontypes.Uplid(os_type, os_name, cpu_type, os_ver, info.type_, info.version) print("Using compiler: %s" % info.description(), file=sys.stderr) print("Using ufid: %s" % ufid, file=sys.stderr) print("export BDE_CMAKE_UPLID=%s" % uplid) print("export BDE_CMAKE_UFID=%s" % ufid) id_str = "%s-%s" % (uplid, ufid) if options.build_dir: print('export BDE_CMAKE_BUILD_DIR="%s"' % options.build_dir) else: print('export BDE_CMAKE_BUILD_DIR="_build/%s"' % id_str) if os_type != "windows": print("export CXX=%s" % info.cxx_path) print("export CC=%s" % info.c_path) else: print("export CXX=cl") print("export CC=cl") if info.toolchain: print("export BDE_CMAKE_TOOLCHAIN=toolchains/%s/%s" % (sysutil.unversioned_platform(), info.toolchain)) else: print("export BDE_CMAKE_TOOLCHAIN=toolchains/%s/default" % sysutil.unversioned_platform()) install_dir = options.install_dir if options.install_dir else "_install" print( "Using install directory: %s" % os.path.abspath(install_dir), file=sys.stderr, ) print('export BDE_CMAKE_INSTALL_DIR="%s"' % os.path.abspath(install_dir))
def make_ufid(ctx): """Create the Ufid representing the current build configuration. Args: ctx (ConfigurationContext): The waf configuration context. Returns: Ufid """ opts = ctx.options env_ufid = os.getenv('BDE_WAF_UFID') ufid_str = None if env_ufid: if opts.ufid and opts.ufid != env_ufid: Logs.warn( 'The specified UFID, "%s", is different from ' 'the value of the environment variable BDE_WAF_UFID ' ', "%s". The value of BDE_WAF_UFID will take precedence.' % (opts.ufid, env_ufid)) ufid_str = env_ufid elif opts.ufid: ufid_str = opts.ufid if ufid_str: ufid = optiontypes.Ufid.from_str(ufid_str) if not optiontypes.Ufid.is_valid(ufid.flags): ctx.fatal( 'The UFID, "%s", is invalid. Each part of a UFID must be ' 'in the following list of valid flags: %s.' % (ufid_str, ", ".join(sorted( optiontypes.Ufid.VALID_FLAGS.keys())))) return ufid return optionsutil.make_ufid_from_cmdline_options(opts)
def make_ufid(ctx): """Create the Ufid representing the current build configuration. Args: ctx (ConfigurationContext): The waf configuration context. Returns: Ufid """ opts = ctx.options env_ufid = os.getenv('BDE_WAF_UFID') ufid_str = None if env_ufid: if opts.ufid and opts.ufid != env_ufid: Logs.warn( 'The specified UFID, "%s", is different from ' 'the value of the environment variable BDE_WAF_UFID ' ', "%s". The value of BDE_WAF_UFID will take precedence.' % (opts.ufid, env_ufid)) ufid_str = env_ufid elif opts.ufid: ufid_str = opts.ufid if ufid_str: ufid = optiontypes.Ufid.from_str(ufid_str) if not optiontypes.Ufid.is_valid(ufid.flags): ctx.fatal( 'The UFID, "%s", is invalid. Each part of a UFID must be ' 'in the following list of valid flags: %s.' % (ufid_str, ", ".join( sorted(optiontypes.Ufid.VALID_FLAGS.keys())))) return ufid return optionsutil.make_ufid_from_cmdline_options(opts)