Exemple #1
0
def configure(conf):
    conf.find_pgi_compiler('CXX', 'pgCC')
    conf.find_ar()
    conf.gxx_common_flags()
    conf.cxx_load_tools()
    conf.cxx_add_flags()
    conf.link_add_flags()
def mkspec_gxx_configure(conf, major, minor, prefix=None, minimum=False):
    """
    :param major:   The major version number of the compiler, e.g. 4
    :param minor:   The minor version number of the compiler, e.g. 6
    :param prefix:  Prefix to the compiler name, e.g. 'arm-linux-androideabi'
    :param minimum: Only check for a minimum compiler version, if true
    """
    # Where to look for the compiler
    paths = conf.mkspec_get_toolchain_paths()

    # Find g++ first
    gxx_names = conf.mkspec_get_gnu_binary_name('g++', major, minor, prefix)
    if minimum:
        gxx_names = 'g++'
    cxx = conf.find_program(gxx_names, path_list=paths)
    cxx = conf.cmd_to_list(cxx)
    conf.env['CXX'] = cxx
    conf.env['CXX_NAME'] = os.path.basename(conf.env.get_flat('CXX'))
    if minimum:
        conf.mkspec_check_minimum_cc_version(cxx, major, minor)
    else:
        conf.mkspec_check_cc_version(cxx, major, minor)

    # Also find gcc
    gcc_names = conf.mkspec_get_gnu_binary_name('gcc', major, minor, prefix)
    if minimum:
        gcc_names = 'gcc'
    cc = conf.find_program(gcc_names, path_list=paths)
    cc = conf.cmd_to_list(cc)
    conf.env['CC'] = cc
    conf.env['CC_NAME'] = os.path.basename(conf.env.get_flat('CC'))
    if minimum:
        conf.mkspec_check_minimum_cc_version(cc, major, minor)
    else:
        conf.mkspec_check_cc_version(cc, major, minor)

    # Find the archiver
    ar = conf.mkspec_get_ar_binary_name(prefix)
    conf.find_program(ar, path_list=paths, var='AR')
    conf.env.ARFLAGS = 'rcs'

    # Set up C++ tools and flags
    conf.gxx_common_flags()
    conf.gxx_modifier_platform()
    conf.cxx_load_tools()
    conf.cxx_add_flags()

    # Also set up C tools and flags
    conf.gcc_common_flags()
    conf.gcc_modifier_platform()
    conf.cc_load_tools()
    conf.cc_add_flags()

    # Add linker flags
    conf.link_add_flags()

    # Add our own cxx flags
    conf.mkspec_set_gxx_cxxflags()
    # Add our own cc flags
    conf.mkspec_set_gcc_ccflags()
def configure(conf):
	conf.find_pgi_compiler('CXX', 'pgCC')
	conf.find_ar()
	conf.gxx_common_flags()
	conf.cxx_load_tools()
	conf.cxx_add_flags()
	conf.link_add_flags()
Exemple #4
0
def configure(conf):
    conf.find_sxx()
    conf.find_ar()
    conf.sxx_common_flags()
    conf.cxx_load_tools()
    conf.cxx_add_flags()
    conf.link_add_flags()
Exemple #5
0
def configure(conf):
	conf.find_xlcxx()
	conf.find_ar()
	conf.xlcxx_common_flags()
	conf.cxx_load_tools()
	conf.cxx_add_flags()
	conf.link_add_flags()
Exemple #6
0
def configure(conf):
    conf.find_pgi_compiler("CXX", "pgCC")
    conf.find_ar()
    conf.gxx_common_flags()
    conf.cxx_load_tools()
    conf.cxx_add_flags()
    conf.link_add_flags()
def mkspec_gxx_configure(conf, major, minor, prefix=None, minimum=False):
    """
    :param major:   The major version number of the compiler, e.g. 4
    :param minor:   The minor version number of the compiler, e.g. 6
    :param prefix:  Prefix to the compiler name, e.g. 'arm-linux-androideabi'
    :param minimum: Only check for a minimum compiler version, if true
    """
    # Where to look for the compiler
    paths = conf.mkspec_get_toolchain_paths()

    # Find g++ first
    gxx_names = conf.mkspec_get_gnu_binary_name('g++', major, minor, prefix)
    if minimum:
        gxx_names = 'g++'
    cxx = conf.find_program(gxx_names, path_list=paths)
    cxx = conf.cmd_to_list(cxx)
    conf.env['CXX'] = cxx
    conf.env['CXX_NAME'] = os.path.basename(conf.env.get_flat('CXX'))
    if minimum:
        conf.mkspec_check_minimum_cc_version(cxx, major, minor)
    else:
        conf.mkspec_check_cc_version(cxx, major, minor)

    # Also find gcc
    gcc_names = conf.mkspec_get_gnu_binary_name('gcc', major, minor, prefix)
    if minimum:
        gcc_names = 'gcc'
    cc = conf.find_program(gcc_names, path_list=paths)
    cc = conf.cmd_to_list(cc)
    conf.env['CC'] = cc
    conf.env['CC_NAME'] = os.path.basename(conf.env.get_flat('CC'))
    if minimum:
        conf.mkspec_check_minimum_cc_version(cc, major, minor)
    else:
        conf.mkspec_check_cc_version(cc, major, minor)

    # Find the archiver
    ar = conf.mkspec_get_ar_binary_name(prefix)
    conf.find_program(ar, path_list=paths, var='AR')
    conf.env.ARFLAGS = 'rcs'

    # Set up C++ tools and flags
    conf.gxx_common_flags()
    conf.gxx_modifier_platform()
    conf.cxx_load_tools()
    conf.cxx_add_flags()

    # Also set up C tools and flags
    conf.gcc_common_flags()
    conf.gcc_modifier_platform()
    conf.cc_load_tools()
    conf.cc_add_flags()

    # Add linker flags
    conf.link_add_flags()

    # Add our own cxx flags
    conf.mkspec_set_gxx_cxxflags()
    # Add our own cc flags
    conf.mkspec_set_gcc_ccflags()
Exemple #8
0
def configure(conf):
	conf.find_clangxx()
	conf.find_ar()
	conf.clangxx_common_flags()
	conf.clangxx_modifier_platform()
	conf.cxx_load_tools()
	conf.cxx_add_flags()
	conf.link_add_flags()
def configure(conf):
    conf.find_arm_none_eabi_gxx()
    conf.load('arm-none-eabi-ar', tooldir=os.path.dirname(os.path.realpath(__file__)))
    conf.gcc_common_flags()
    conf.gcc_modifier_platform()
    conf.cxx_load_tools()
    conf.cxx_add_flags()
    conf.link_add_flags()
Exemple #10
0
def configure(conf):
	conf.find_icpc()
	conf.find_ar()
	conf.gxx_common_flags()
	conf.gxx_modifier_platform()
	conf.cxx_load_tools()
	conf.cxx_add_flags()
	conf.link_add_flags()
Exemple #11
0
def configure(conf):
    conf.find_clangxx()
    conf.find_program(["llvm-ar", "ar"], var="AR")
    conf.find_ar()
    conf.gxx_common_flags()
    conf.gxx_modifier_platform()
    conf.cxx_load_tools()
    conf.cxx_add_flags()
    conf.link_add_flags()
Exemple #12
0
def configure(conf):
	conf.autodetect()
	conf.find_msvc()
	conf.msvc_common_flags()
	conf.cc_load_tools()
	conf.cxx_load_tools()
	conf.cc_add_flags()
	conf.cxx_add_flags()
	conf.link_add_flags()
Exemple #13
0
def configure(conf):
	conf.find_clangxx()
	conf.find_program(['llvm-ar', 'ar'], var='AR')
	conf.find_ar()
	conf.gxx_common_flags()
	conf.gxx_modifier_platform()
	conf.cxx_load_tools()
	conf.cxx_add_flags()
	conf.link_add_flags()
Exemple #14
0
def configure(conf):
	conf.find_emxx()
	conf.load('emcc', tooldir="waf-tools")
	conf.load('emar', tooldir="waf-tools")
	conf.emxx_common_flags()
	conf.emxx_modifier_platform()
	conf.cxx_load_tools()
	conf.cxx_add_flags()
	conf.link_add_flags()
Exemple #15
0
def configure(conf):
    conf.find_emxx()
    conf.load('emcc', tooldir="waf-tools")
    conf.load('emar', tooldir="waf-tools")
    conf.emxx_common_flags()
    conf.emxx_modifier_platform()
    conf.cxx_load_tools()
    conf.cxx_add_flags()
    conf.link_add_flags()
Exemple #16
0
def configure(conf):
	conf.find_gxx()
	conf.find_ar()
	conf.gxx_common_flags()
	conf.gxx_modifier_platform()
	conf.cxx_load_tools()
	conf.cxx_add_flags()
	conf.link_add_flags()
	conf.check_gcc_o_space('cxx')
def configure(conf):
    conf.find_clangxx()
    conf.find_program(['llvm-ar', 'ar'], var='AR')
    conf.find_ar()
    conf.gxx_common_flags()
    conf.gxx_modifier_platform()
    conf.cxx_load_tools()
    conf.cxx_add_flags()
    conf.link_add_flags()
def setup_gnu_gcc_toolchain(conf, prefix, compiler = None, cxxcompiler = None, path_list=None):
    env = conf.env

    env.stash()
    try:
        env['GNU_GCC_PREFIX']      = prefix
        env['GNU_BINUTILS_PREFIX'] = prefix

        conf.setup_gnu_binutils(path_list)

        compiler    = compiler or (env['GNU_GCC_PREFIX'] + 'gcc')
        cxxcompiler = cxxcompiler or (env['GNU_GCC_PREFIX'] + 'g++')

        cc = conf.find_program(compiler, var='CC', path_list=path_list)
        cc = conf.cmd_to_list(cc)

        cxx = conf.find_program(cxxcompiler, var='CXX', mandatory=False, path_list=path_list)
        cxx = conf.cmd_to_list(cxx)

        conf.env.CC  = cc
        conf.env.AS  = cc

        env['CC_NAME']    = 'gcc'
        env['CC_VERSION'] = conf.cmd_and_log(env.CC + ["-dumpversion"]).strip().split('.')
        env['MACHINE']    = env['MACHINE'] or conf.cmd_and_log(env.CC +["-dumpmachine"]).strip()
        env['DEST_OS']    = 'Unknown'

        # backwards compat. Since we support clang now as well,
        # there is no common CC_PREFIX anymore. (CLANG is not prefixed)
        # please use 'MACHINE' for future developments
        env['CC_PREFIX']  = prefix.strip('-')

        conf.cc_load_tools()
        conf.gcc_common_flags()
        conf.cc_add_flags()

        conf.env.AS_TGT_F = '-o'

        if(cxx):
            env['CXX_NAME'] = 'gcc'
            env['CXX'] = cxx

            conf.cxx_load_tools()
            conf.gxx_common_flags()
            conf.cxx_add_flags()

        conf.link_add_flags()

        # we have to use gnu99 because we use some non standard gnu extensions conditionally
        # when __GNUC__ is defined
        env.append_value('CFLAGS_standard_c99', [ "-std=gnu99" ])

    except conf.errors.ConfigurationError:
        env.revert()
        raise
Exemple #19
0
def configure(conf):
    conf.find_owcc()
    conf.owcc_common_flags()
    conf.cc_load_tools()
    conf.cc_add_flags()
    conf.env.append_unique('CFLAGS', '-Wc,-xx')
    conf.cxx_load_tools()
    conf.cxx_add_flags()
    conf.env.append_unique('CXXFLAGS', '-Wc,-xx')
    conf.link_add_flags()
    conf.owcc_detect_platform()
def configure(conf):
	"""
	Configuration for g++
	"""
	conf.find_gxx()
	conf.find_ar()
	conf.gxx_common_flags()
	conf.gxx_modifier_platform()
	conf.cxx_load_tools()
	conf.cxx_add_flags()
	conf.link_add_flags()
Exemple #21
0
def configure(conf):
    """
	Configuration for g++
	"""
    conf.find_gxx()
    conf.find_ar()
    conf.gxx_common_flags()
    conf.gxx_modifier_platform()
    conf.cxx_load_tools()
    conf.cxx_add_flags()
    conf.link_add_flags()
Exemple #22
0
def configure(conf):
	"""
	Configuration methods to call for detecting msvc
	"""
	conf.autodetect()
	conf.find_msvc()
	conf.msvc_common_flags()
	conf.cc_load_tools()
	conf.cxx_load_tools()
	conf.cc_add_flags()
	conf.cxx_add_flags()
	conf.link_add_flags()
Exemple #23
0
def configure(conf):
	conf.find_clangxx()
	conf.find_program(['llvm-ar', 'ar'], var='AR')
	conf.find_ar()
	conf.gxx_common_flags()
	# Allow the user to provide flags for the target platform.
	conf.gxx_modifier_platform()
	# And allow more fine grained control based on the compiler's triplet.
	conf.clang_modifier_target_triple(cpp=True)
	conf.cxx_load_tools()
	conf.cxx_add_flags()
	conf.link_add_flags()
Exemple #24
0
def configure(conf):
    """
	Configuration methods to call for detecting msvc
	"""
    conf.autodetect(True)
    conf.find_msvc()
    conf.msvc_common_flags()
    conf.cc_load_tools()
    conf.cxx_load_tools()
    conf.cc_add_flags()
    conf.cxx_add_flags()
    conf.link_add_flags()
    conf.visual_studio_add_flags()
Exemple #25
0
def configure(conf):
    # Check that the NDK path was given on the command-line
    conf.msg("NDK path configured with --ndk", conf.options.ndk != None)
    if not conf.options.ndk:
        raise "no NDK path"

    conf.load('android-gcc', tooldir="waf-tools")
    conf.find_android_gxx()
    conf.load('android-ar', tooldir="waf-tools")
    conf.android_gxx_common_flags()
    conf.android_gxx_modifier_platform()
    conf.cxx_load_tools()
    conf.cxx_add_flags()
    conf.link_add_flags()
Exemple #26
0
def configure(conf):
	# Check that the NDK path was given on the command-line
	conf.msg("NDK path configured with --ndk", conf.options.ndk != None)
	if not conf.options.ndk:
		raise "no NDK path"
	
	conf.load('android-gcc', tooldir="waf-tools")
	conf.find_android_gxx()
	conf.load('android-ar', tooldir="waf-tools")
	conf.android_gxx_common_flags()
	conf.android_gxx_modifier_platform()
	conf.cxx_load_tools()
	conf.cxx_add_flags()
	conf.link_add_flags()
Exemple #27
0
def configure(conf):
	"""
	Configuration for g++
	"""
	try:
		conf.find_gxx()
	except Exception as e:
		print 'ERROR:', e
		pass
	conf.find_ar()
	conf.gxx_common_flags()
	conf.gxx_modifier_platform()
	conf.cxx_load_tools()
	conf.cxx_add_flags()
	conf.link_add_flags()
Exemple #28
0
def configure(conf):
    """
	Configuration for g++
	"""
    try:
        conf.find_gxx()
    except Exception as e:
        print 'ERROR:', e
        pass
    conf.find_ar()
    conf.gxx_common_flags()
    conf.gxx_modifier_platform()
    conf.cxx_load_tools()
    conf.cxx_add_flags()
    conf.link_add_flags()
Exemple #29
0
def configure(conf):
    conf.find_emscripten()
    conf.find_ar()
    conf.gcc_common_flags()
    conf.gxx_common_flags()
    conf.cc_load_tools()
    conf.cc_add_flags()
    conf.cxx_load_tools()
    conf.cxx_add_flags()
    conf.link_add_flags()
    conf.env.ARFLAGS = ['rcs']
    conf.env.cshlib_PATTERN = '%s.js'
    conf.env.cxxshlib_PATTERN = '%s.js'
    conf.env.cstlib_PATTERN = '%s.bc'
    conf.env.cxxstlib_PATTERN = '%s.bc'
    conf.env.cprogram_PATTERN = '%s.html'
    conf.env.cxxprogram_PATTERN = '%s.html'
    conf.env.append_value('LINKFLAGS', ['-Wl,--enable-auto-import'])
Exemple #30
0
def configure(conf):
    """
	Configuration for gcc
	"""
    conf.find_gcc()
    conf.find_ar()
    conf.gcc_common_flags()
    conf.cc_load_tools()
    conf.cc_add_flags()
    #conf.link_add_flags()

    conf.find_gxx()
    #conf.find_ar()
    conf.gxx_common_flags()
    conf.cxx_load_tools()
    conf.cxx_add_flags()
    conf.link_add_flags()
    conf.find_gas()
def configure(conf):
	conf.find_emscripten()
	conf.find_ar()
	conf.gcc_common_flags()
	conf.gxx_common_flags()
	conf.cc_load_tools()
	conf.cc_add_flags()
	conf.cxx_load_tools()
	conf.cxx_add_flags()
	conf.link_add_flags()
	conf.env.ARFLAGS = ['rcs']
	conf.env.cshlib_PATTERN = '%s.js'
	conf.env.cxxshlib_PATTERN = '%s.js'
	conf.env.cstlib_PATTERN = '%s.bc'
	conf.env.cxxstlib_PATTERN = '%s.bc'
	conf.env.cprogram_PATTERN = '%s.html'
	conf.env.cxxprogram_PATTERN = '%s.html'
	conf.env.append_value('LINKFLAGS',['-Wl,--enable-auto-import'])
Exemple #32
0
def configure(conf):
    conf.find_emscripten()
    conf.find_ar()
    conf.gcc_common_flags()
    conf.gxx_common_flags()
    conf.cc_load_tools()
    conf.cc_add_flags()
    conf.cxx_load_tools()
    conf.cxx_add_flags()
    conf.link_add_flags()
    conf.env.ARFLAGS = ["rcs"]
    conf.env.cshlib_PATTERN = "%s.js"
    conf.env.cxxshlib_PATTERN = "%s.js"
    conf.env.cstlib_PATTERN = "%s.a"
    conf.env.cxxstlib_PATTERN = "%s.a"
    conf.env.cprogram_PATTERN = "%s.html"
    conf.env.cxxprogram_PATTERN = "%s.html"
    conf.env.CXX_TGT_F = ["-c", "-o", ""]
    conf.env.CC_TGT_F = ["-c", "-o", ""]
    conf.env.CXXLNK_TGT_F = ["-o", ""]
    conf.env.CCLNK_TGT_F = ["-o", ""]
    conf.env.append_value("LINKFLAGS", ["-Wl,--enable-auto-import"])
Exemple #33
0
def mkspec_emscripten_configure(conf, major, minor, minimum=False,
                                force_debug=False):
    """
    :param force_debug: Always compile with debugging flags, if true
    """
    # The path to the emscripten compiler
    paths = conf.get_tool_option('emscripten_path')

    # The node.js binary can be "nodejs" or simply "node"
    conf.find_program(['nodejs', 'node'], var='NODEJS')

    # Find the clang++ compiler
    cxx = conf.find_program(['em++'], path_list=paths)
    cxx = conf.cmd_to_list(cxx)
    conf.env['CXX'] = cxx
    conf.env['CXX_NAME'] = os.path.basename(conf.env.get_flat('CXX'))

    conf.check_emscripten_version(cxx, major, minor, minimum)

    # Find clang as the C compiler
    cc = conf.find_program(['emcc'], path_list=paths)
    cc = conf.cmd_to_list(cc)
    conf.env['CC'] = cc
    conf.env['CC_NAME'] = os.path.basename(conf.env.get_flat('CC'))

    conf.check_emscripten_version(cc, major, minor, minimum)

    # Find the archiver
    conf.find_program('emar', path_list=paths, var='AR')
    conf.env.ARFLAGS = 'rcs'

    # Set up C++ tools and flags
    conf.gxx_common_flags()
    #conf.gxx_modifier_platform()
    conf.cxx_load_tools()
    conf.cxx_add_flags()

    # Also set up C tools and flags
    conf.gcc_common_flags()
    #conf.gcc_modifier_platform()
    conf.cc_load_tools()
    conf.cc_add_flags()

    # Add linker flags
    conf.link_add_flags()

    # Add our own cxx flags
    conf.env['CXXFLAGS'] += ['-O2', '-Wextra', '-Wall']

    if conf.has_tool_option('cxx_debug') or force_debug:
        conf.env['CXXFLAGS'] += ['-g']
        conf.env['LINKFLAGS'] += ['-s']

    if conf.has_tool_option('cxx_nodebug'):
        conf.env['DEFINES'] += ['NDEBUG']

    conf.env['CXXFLAGS'] += ['-std=c++0x']

    # Add our own cc flags
    conf.env['CFLAGS'] += ['-O2', '-Wextra', '-Wall']

    if conf.has_tool_option('cxx_debug') or force_debug:
        conf.env['CFLAGS'] += ['-g']

    if conf.has_tool_option('cxx_nodebug'):
        conf.env['DEFINES'] += ['NDEBUG']

    conf.env['cprogram_PATTERN'] = conf.env['cxxprogram_PATTERN'] = '%s.js'

    conf.set_mkspec_platform('emscripten')
Exemple #34
0
def mkspec_clang_configure(conf, major, minor, prefix=None, minimum=False,
                           force_debug=False):
    """
    :param major:       The major version number of the compiler, e.g. 3
    :param minor:       The minor version number of the compiler, e.g. 4
    :param prefix:      Prefix to compiler name, e.g. 'arm-linux-androideabi'
    :param minimum:     Only check for a minimum compiler version, if true
    :param force_debug: Always compile with debugging flags, if true
    """
    # Where to look
    paths = conf.mkspec_get_toolchain_paths()

    # Find the clang++ compiler
    clangxx_names = conf.mkspec_get_clangxx_binary_name(major, minor)
    if minimum:
        clangxx_names = 'clang++'
    cxx = conf.find_program(clangxx_names, path_list=paths)
    cxx = conf.cmd_to_list(cxx)
    conf.env['CXX'] = cxx
    conf.env['CXX_NAME'] = os.path.basename(conf.env.get_flat('CXX'))

    if minimum:
        conf.mkspec_check_minimum_cc_version(cxx, major, minor)
    else:
        conf.mkspec_check_cc_version(cxx, major, minor)

    # Find clang as the C compiler
    clang_names = conf.mkspec_get_clang_binary_name(major, minor)
    if minimum:
        clang_names = 'clang'
    cc = conf.find_program(clang_names, path_list=paths)
    cc = conf.cmd_to_list(cc)
    conf.env['CC'] = cc
    conf.env['CC_NAME'] = os.path.basename(conf.env.get_flat('CC'))

    if minimum:
        conf.mkspec_check_minimum_cc_version(cc, major, minor)
    else:
        conf.mkspec_check_cc_version(cc, major, minor)

    # Find the archiver
    ar = conf.mkspec_get_ar_binary_name(prefix)
    conf.find_program(ar, path_list=paths, var='AR')
    conf.env.ARFLAGS = 'rcs'

    # Set up C++ tools and flags
    conf.gxx_common_flags()
    conf.gxx_modifier_platform()
    conf.cxx_load_tools()
    conf.cxx_add_flags()

    # Also set up C tools and flags
    conf.gcc_common_flags()
    conf.gcc_modifier_platform()
    conf.cc_load_tools()
    conf.cc_add_flags()

    # Add linker flags
    conf.link_add_flags()

    # Add our own cxx flags
    conf.mkspec_set_clang_cxxflags(force_debug)
    # Add our own cc flags
    conf.mkspec_set_clang_ccflags(force_debug)
Exemple #35
0
def mkspec_clang_configure(conf,
                           major,
                           minor,
                           prefix=None,
                           minimum=False,
                           force_debug=False):
    """
    :param major:       The major version number of the compiler, e.g. 3
    :param minor:       The minor version number of the compiler, e.g. 4
    :param prefix:      Prefix to compiler name, e.g. 'arm-linux-androideabi'
    :param minimum:     Only check for a minimum compiler version, if true
    :param force_debug: Always compile with debugging flags, if true
    """
    # Where to look
    paths = conf.mkspec_get_toolchain_paths()

    # If the user-defined CXX variable is set, then use that compiler
    if "CXX" in os.environ:
        cxx = waflib.Utils.to_list(os.environ["CXX"])
        conf.to_log("Using user defined environment variable CXX=%r" % cxx)
    else:
        # Find the clang++ compiler
        clangxx_names = conf.mkspec_get_compiler_binary_name(
            "clang++", major, minor, prefix)
        if minimum:
            clangxx_names = "clang++"
        cxx = conf.find_program(clangxx_names, path_list=paths)
        cxx = conf.cmd_to_list(cxx)

    conf.env["CXX"] = cxx
    conf.env["CXX_NAME"] = os.path.basename(conf.env.get_flat("CXX"))

    conf.mkspec_check_clang_version(cxx, major, minor, minimum)

    # If the user-defined CC variable is set, then use that compiler
    if "CC" in os.environ:
        cc = waflib.Utils.to_list(os.environ["CC"])
        conf.to_log("Using user defined environment variable CC=%r" % cc)
    else:
        # Find clang as the C compiler
        clang_names = conf.mkspec_get_compiler_binary_name(
            "clang", major, minor, prefix)
        if minimum:
            clang_names = "clang"
        cc = conf.find_program(clang_names, path_list=paths)
        cc = conf.cmd_to_list(cc)

    conf.env["CC"] = cc
    conf.env["CC_NAME"] = os.path.basename(conf.env.get_flat("CC"))

    conf.mkspec_check_clang_version(cc, major, minor, minimum)

    # Find the archiver
    ar = conf.mkspec_get_ar_binary_name(prefix)
    conf.find_program(ar, path_list=paths, var="AR")
    conf.env.ARFLAGS = "rcs"

    # Set up C++ tools and flags
    conf.gxx_common_flags()
    conf.gxx_modifier_platform()
    conf.cxx_load_tools()
    conf.cxx_add_flags()

    # Also set up C tools and flags
    conf.gcc_common_flags()
    conf.gcc_modifier_platform()
    conf.cc_load_tools()
    conf.cc_add_flags()

    # Add linker flags
    conf.link_add_flags()

    # Add our own cxx flags
    conf.mkspec_set_clang_cxxflags(force_debug)
    # Add our own cc flags
    conf.mkspec_set_clang_ccflags(force_debug)
Exemple #36
0
def mkspec_emscripten_configure(conf, major, minor, minimum=False, force_debug=False):
    """
    :param force_debug: Always compile with debugging flags, if true
    """
    conf.set_mkspec_platform("emscripten")

    # The path to the emscripten compiler
    paths = conf.get_tool_option("emscripten_path")

    # The node.js binary can be "nodejs" or simply "node"
    conf.find_program(["nodejs", "node"], var="NODEJS")

    # Find the clang++ compiler
    cxx = conf.find_program(["em++"], path_list=paths)
    cxx = conf.cmd_to_list(cxx)
    conf.env["CXX"] = cxx
    conf.env["CXX_NAME"] = os.path.basename(conf.env.get_flat("CXX"))

    conf.check_emscripten_version(cxx, major, minor, minimum)

    # Find clang as the C compiler
    cc = conf.find_program(["emcc"], path_list=paths)
    cc = conf.cmd_to_list(cc)
    conf.env["CC"] = cc
    conf.env["CC_NAME"] = os.path.basename(conf.env.get_flat("CC"))

    conf.check_emscripten_version(cc, major, minor, minimum)

    # Find the archiver
    conf.find_program("emar", path_list=paths, var="AR")
    conf.env.ARFLAGS = ["rcs"]

    # Set up C++ tools and flags
    conf.gxx_common_flags()
    conf.cxx_load_tools()
    conf.cxx_add_flags()

    # Also set up C tools and flags
    conf.gcc_common_flags()
    conf.cc_load_tools()
    conf.cc_add_flags()

    # Add linker flags
    conf.link_add_flags()

    # Add the special flags required for emscripten
    conf.env.cshlib_PATTERN = "%s.js"
    conf.env.cxxshlib_PATTERN = "%s.js"
    conf.env.cstlib_PATTERN = "%s.a"
    conf.env.cxxstlib_PATTERN = "%s.a"
    conf.env.cprogram_PATTERN = conf.env.cxxprogram_PATTERN = "%s.js"
    conf.env.CXX_TGT_F = ["-c", "-o", ""]
    conf.env.CC_TGT_F = ["-c", "-o", ""]
    conf.env.CXXLNK_TGT_F = ["-o", ""]
    conf.env.CCLNK_TGT_F = ["-o", ""]
    conf.env.append_value("LINKFLAGS", ["-Wl,--enable-auto-import"])

    # Add our own cxx flags
    conf.env["CXXFLAGS"] += ["-Wextra", "-Wall", "-Wno-warn-absolute-paths"]

    if conf.has_tool_option("cxx_debug") or force_debug:
        conf.env["CXXFLAGS"] += ["-g"]
        conf.env["LINKFLAGS"] += ["-s"]

        # Don't add any optimization flags
        conf.env["MKSPEC_DISABLE_OPTIMIZATION"] = True

    cxxoptflags = ["-O2"]

    if not conf.env["MKSPEC_DISABLE_OPTIMIZATION"]:
        conf.env["CXXFLAGS"] += cxxoptflags

    if conf.has_tool_option("cxx_nodebug"):
        conf.env["DEFINES"] += ["NDEBUG"]

    conf.env["CXXFLAGS"] += ["-std=c++11"]

    if conf.has_tool_option("cxx_debug") or force_debug:
        conf.env["CFLAGS"] += ["-g"]
        # Don't add any optimization flags
        conf.env["MKSPEC_DISABLE_OPTIMIZATION"] = True

    coptflags = ["-O2"]

    if not conf.env["MKSPEC_DISABLE_OPTIMIZATION"]:
        conf.env["CFLAGS"] += coptflags

    # Add our own cc flags
    conf.env["CFLAGS"] += ["-Wextra", "-Wall", "-Wno-warn-absolute-paths"]

    if conf.has_tool_option("cxx_nodebug"):
        conf.env["DEFINES"] += ["NDEBUG"]
Exemple #37
0
def configure(conf):
    conf.find_clang()
    conf.clang_common_flags()
    conf.cxx_load_tools()
    conf.cxx_add_flags()
Exemple #38
0
def mkspec_emscripten_configure(conf, major, minor, minimum=False,
                                force_debug=False):

    print('***emscripten_common.py::mkspec_emscripten_configure')
    """
    :param force_debug: Always compile with debugging flags, if true
    """
    conf.set_mkspec_platform('emscripten')

    # The path to the emscripten compiler
    paths = conf.get_tool_option('emscripten_path')

    # The node.js binary can be "nodejs" or simply "node"
    conf.find_program(['nodejs', 'node'], var='NODEJS')

    # Find the clang++ compiler
    cxx = conf.find_program(['em++'], path_list=paths)
    cxx = conf.cmd_to_list(cxx)
    conf.env['CXX'] = cxx
    conf.env['CXX_NAME'] = os.path.basename(conf.env.get_flat('CXX'))

    conf.check_emscripten_version(cxx, major, minor, minimum)

    # Find clang as the C compiler
    cc = conf.find_program(['emcc'], path_list=paths)
    cc = conf.cmd_to_list(cc)
    conf.env['CC'] = cc
    conf.env['CC_NAME'] = os.path.basename(conf.env.get_flat('CC'))

    conf.check_emscripten_version(cc, major, minor, minimum)

    # Find the archiver
    conf.find_program('emar', path_list=paths, var='AR')
    conf.env.ARFLAGS = ['rcs']

    # Set up C++ tools and flags
    conf.gxx_common_flags()
    conf.cxx_load_tools()
    conf.cxx_add_flags()

    # Also set up C tools and flags
    conf.gcc_common_flags()
    conf.cc_load_tools()
    conf.cc_add_flags()

    # Add linker flags
    conf.link_add_flags()

    # Add the special flags required for emscripten
    conf.env.cshlib_PATTERN = '%s.js'
    conf.env.cxxshlib_PATTERN = '%s.js'
    conf.env.cstlib_PATTERN = '%s.a'
    conf.env.cxxstlib_PATTERN = '%s.a'
    conf.env.cprogram_PATTERN = conf.env.cxxprogram_PATTERN = '%s.js'
    conf.env.CXX_TGT_F = ['-c', '-o', '']
    conf.env.CC_TGT_F = ['-c', '-o', '']
    conf.env.CXXLNK_TGT_F = ['-o', '']
    conf.env.CCLNK_TGT_F = ['-o', '']
    conf.env.append_value('LINKFLAGS',['-Wl,--enable-auto-import'])

    # Add our own cxx flags
    conf.env['CXXFLAGS'] += \
        ['-O2', '-Wextra', '-Wall', '-Wno-warn-absolute-paths']

    if conf.has_tool_option('cxx_debug') or force_debug:
        conf.env['CXXFLAGS'] += ['-g']
        conf.env['LINKFLAGS'] += ['-s']

    if conf.has_tool_option('cxx_nodebug'):
        conf.env['DEFINES'] += ['NDEBUG']

    conf.env['CXXFLAGS'] += ['-std=c++11']

    # Add our own cc flags
    conf.env['CFLAGS'] += \
        ['-O2', '-Wextra', '-Wall', '-Wno-warn-absolute-paths']

    if conf.has_tool_option('cxx_debug') or force_debug:
        conf.env['CFLAGS'] += ['-g']

    if conf.has_tool_option('cxx_nodebug'):
        conf.env['DEFINES'] += ['NDEBUG']
def mkspec_emscripten_configure(conf, major, minor, minimum=False,
                                force_debug=False):
    """
    :param force_debug: Always compile with debugging flags, if true
    """
    conf.set_mkspec_platform('emscripten')

    # The path to the emscripten compiler
    paths = conf.get_tool_option('emscripten_path')

    # The node.js binary can be "nodejs" or simply "node"
    conf.find_program(['nodejs', 'node'], var='NODEJS')

    # Find the clang++ compiler
    cxx = conf.find_program(['em++'], path_list=paths)
    cxx = conf.cmd_to_list(cxx)
    conf.env['CXX'] = cxx
    conf.env['CXX_NAME'] = os.path.basename(conf.env.get_flat('CXX'))

    conf.check_emscripten_version(cxx, major, minor, minimum)

    # Find clang as the C compiler
    cc = conf.find_program(['emcc'], path_list=paths)
    cc = conf.cmd_to_list(cc)
    conf.env['CC'] = cc
    conf.env['CC_NAME'] = os.path.basename(conf.env.get_flat('CC'))

    conf.check_emscripten_version(cc, major, minor, minimum)

    # Find the archiver
    conf.find_program('emar', path_list=paths, var='AR')
    conf.env.ARFLAGS = ['rcs']

    # Set up C++ tools and flags
    conf.gxx_common_flags()
    conf.cxx_load_tools()
    conf.cxx_add_flags()

    # Also set up C tools and flags
    conf.gcc_common_flags()
    conf.cc_load_tools()
    conf.cc_add_flags()

    # Add linker flags
    conf.link_add_flags()

    # Add the special flags required for emscripten
    conf.env.cshlib_PATTERN = '%s.js'
    conf.env.cxxshlib_PATTERN = '%s.js'
    conf.env.cstlib_PATTERN = '%s.a'
    conf.env.cxxstlib_PATTERN = '%s.a'
    conf.env.cprogram_PATTERN = conf.env.cxxprogram_PATTERN = '%s.js'
    conf.env.CXX_TGT_F = ['-c', '-o', '']
    conf.env.CC_TGT_F = ['-c', '-o', '']
    conf.env.CXXLNK_TGT_F = ['-o', '']
    conf.env.CCLNK_TGT_F = ['-o', '']
    conf.env.append_value('LINKFLAGS',['-Wl,--enable-auto-import'])

    # Add our own cxx flags
    conf.env['CXXFLAGS'] += \
        ['-O2', '-Wextra', '-Wall', '-Wno-warn-absolute-paths']

    if conf.has_tool_option('cxx_debug') or force_debug:
        conf.env['CXXFLAGS'] += ['-g']
        conf.env['LINKFLAGS'] += ['-s']

    if conf.has_tool_option('cxx_nodebug'):
        conf.env['DEFINES'] += ['NDEBUG']

    conf.env['CXXFLAGS'] += ['-std=c++11']

    # Add our own cc flags
    conf.env['CFLAGS'] += \
        ['-O2', '-Wextra', '-Wall', '-Wno-warn-absolute-paths']

    if conf.has_tool_option('cxx_debug') or force_debug:
        conf.env['CFLAGS'] += ['-g']

    if conf.has_tool_option('cxx_nodebug'):
        conf.env['DEFINES'] += ['NDEBUG']