Пример #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 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()
Пример #3
0
def configure(conf):
    v = conf.env
    v.TI_CGT_DIR = getattr(Options.options, "ti-cgt-dir", "")
    v.TI_DSPLINK_DIR = getattr(Options.options, "ti-dsplink-dir", "")
    v.TI_BIOSUTILS_DIR = getattr(Options.options, "ti-biosutils-dir", "")
    v.TI_DSPBIOS_DIR = getattr(Options.options, "ti-dspbios-dir", "")
    v.TI_XDCTOOLS_DIR = getattr(Options.options, "ti-xdctools-dir", "")
    conf.find_ticc()
    conf.find_tiar()
    conf.find_tild()
    conf.ticc_common_flags()
    conf.cc_load_tools()
    conf.cc_add_flags()
    conf.link_add_flags()
    conf.find_program(["tconf"], var="TCONF", path_list=v.TI_XDCTOOLS_DIR)

    conf.env.TCONF_INCLUDES += [opj(conf.env.TI_DSPBIOS_DIR, "packages")]

    conf.env.INCLUDES += [opj(conf.env.TI_CGT_DIR, "include")]

    conf.env.LIBPATH += [opj(conf.env.TI_CGT_DIR, "lib")]

    conf.env.INCLUDES_DSPBIOS += [opj(conf.env.TI_DSPBIOS_DIR, "packages", "ti", "bios", "include")]

    conf.env.LIBPATH_DSPBIOS += [opj(conf.env.TI_DSPBIOS_DIR, "packages", "ti", "bios", "lib")]

    conf.env.INCLUDES_DSPLINK += [opj(conf.env.TI_DSPLINK_DIR, "dsplink", "dsp", "inc")]
Пример #4
0
def configure(conf):
	conf.find_scc()
	conf.find_ar()
	conf.scc_common_flags()
	conf.cc_load_tools()
	conf.cc_add_flags()
	conf.link_add_flags()
Пример #5
0
def configure(conf):
	conf.find_pgi_compiler('CC', 'pgcc')
	conf.find_ar()
	conf.gcc_common_flags()
	conf.cc_load_tools()
	conf.cc_add_flags()
	conf.link_add_flags()
Пример #6
0
def configure(conf):
	conf.find_sxc()
	conf.find_program('sxar',VAR='AR')
	conf.sxc_common_flags()
	conf.cc_load_tools()
	conf.cc_add_flags()
	conf.link_add_flags()
Пример #7
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()
Пример #8
0
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()
Пример #9
0
Файл: emcc.py Проект: pixpil/gii
def configure(conf):
	conf.find_emcc()
	conf.load('emar', tooldir="waf-tools")
	conf.emcc_common_flags()
	conf.emcc_modifier_platform()
	conf.cc_load_tools()
	conf.cc_add_flags()
	conf.link_add_flags()
Пример #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()
Пример #11
0
def configure(conf):
	conf.find_gcc()
	conf.find_ar()
	conf.gcc_common_flags()
	conf.gcc_modifier_platform()
	conf.cc_load_tools()
	conf.cc_add_flags()
	conf.link_add_flags()
Пример #12
0
def configure(conf):
	conf.find_android_gcc()
	conf.load('android-ar', tooldir="waf-tools")
	conf.gcc_common_flags()
	conf.android_gcc_modifier_platform()
	conf.cc_load_tools()
	conf.cc_add_flags()
	conf.link_add_flags()
Пример #13
0
def configure(conf):
	conf.find_irixcc()
	conf.find_cpp()
	conf.find_ar()
	conf.irixcc_common_flags()
	conf.cc_load_tools()
	conf.cc_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()
Пример #15
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()
Пример #16
0
def configure(conf):
	conf.find_clang()
	conf.find_program(['ar'], var='AR')
	conf.find_ar()
	conf.gcc_common_flags()
	conf.gcc_modifier_platform()
	conf.cc_load_tools()
	conf.cc_add_flags()
	conf.link_add_flags()
Пример #17
0
def configure(conf):
	conf.find_dcc()
	conf.find_dar()
	conf.find_dld()
	conf.find_ddump()
	conf.dcc_common_flags()
	conf.cc_load_tools()
	conf.cc_add_flags()
	conf.link_add_flags()
Пример #18
0
def configure(conf):
	conf.find_bgxlc()
	conf.find_ar()
	conf.xlc_common_flags()
	conf.env.LINKFLAGS_cshlib = ['-G','-Wl,-bexpfull']
	conf.env.LINKFLAGS_cprogram = []
	conf.cc_load_tools()
	conf.cc_add_flags()
	conf.link_add_flags()
Пример #19
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()
Пример #20
0
def configure(conf):
	"""
	Configuration for arm-linux-gnueabi-gcc
	"""
	conf.find_arm_gcc()
        conf.find_arm_ar()
	conf.gcc_common_flags()
	conf.gcc_modifier_platform()
	conf.cc_load_tools()
	conf.cc_add_flags()
	conf.link_add_flags()
Пример #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()
Пример #22
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()
Пример #24
0
def configure(conf):
    """
	Configuration for gcc
	"""
    conf.find_gcc()
    conf.find_ar()
    conf.gcc_common_flags()
    conf.gcc_modifier_platform()
    conf.cc_load_tools()
    conf.cc_add_flags()
    conf.link_add_flags()
def configure(conf):
    conf.find_arm_none_eabi_gcc()
    conf.load("arm-none-eabi-ar", tooldir=os.path.dirname(os.path.realpath(__file__)))
    conf.gcc_common_flags()
    conf.gcc_modifier_platform()
    conf.cc_load_tools()
    conf.cc_add_flags()
    conf.link_add_flags()
    v = conf.env
    v["SHLIB_MARKER"] = []
    v["STLIB_MARKER"] = []
Пример #26
0
def configure(conf):
    """
    Configuration for clang
    """
    conf.find_clang()
    conf.find_ar()
    conf.clang_common_flags()
    conf.clang_modifier_platform()
    conf.cc_load_tools()
    conf.cc_add_flags()
    conf.link_add_flags()
Пример #27
0
def configure(conf):
	"""
	Configuration for gcc
	"""
	conf.find_gcc()
	conf.find_ar()
	conf.gcc_common_flags()
	conf.gcc_modifier_platform()
	conf.cc_load_tools()
	conf.cc_add_flags()
	conf.link_add_flags()
	conf.check_gcc_o_space()
Пример #28
0
def configure(conf):
    conf.find_clang()
    conf.find_program(['llvm-ar', 'ar'], var='AR')
    conf.find_ar()
    conf.gcc_common_flags()
    # Allow the user to provide flags for the target platform.
    conf.gcc_modifier_platform()
    # And allow more fine grained control based on the compiler's triplet.
    conf.clang_modifier_target_triple()
    conf.cc_load_tools()
    conf.cc_add_flags()
    conf.link_add_flags()
Пример #29
0
Файл: msvc.py Проект: jrossi/waf
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()
Пример #30
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()
Пример #31
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()
Пример #32
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()
Пример #33
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()
Пример #34
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()
Пример #35
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'])
Пример #37
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'])
Пример #38
0
def configure(conf):
	v = conf.env
	v.TI_CGT_DIR = getattr(Options.options, 'ti-cgt-dir', "")
	v.TI_DSPLINK_DIR = getattr(Options.options, 'ti-dsplink-dir', "")
	v.TI_BIOSUTILS_DIR = getattr(Options.options, 'ti-biosutils-dir', "")
	v.TI_DSPBIOS_DIR = getattr(Options.options, 'ti-dspbios-dir', "")
	v.TI_XDCTOOLS_DIR = getattr(Options.options, 'ti-xdctools-dir', "")
	conf.find_ticc()
	conf.find_tiar()
	conf.find_tild()
	conf.ticc_common_flags()
	conf.cc_load_tools()
	conf.cc_add_flags()
	conf.link_add_flags()
	conf.find_program(['tconf'], var='TCONF', path_list=v.TI_XDCTOOLS_DIR)

	conf.env.TCONF_INCLUDES += [
	 opj(conf.env.TI_DSPBIOS_DIR, 'packages'),
	]

	conf.env.INCLUDES += [
	 opj(conf.env.TI_CGT_DIR, 'include'),
	]

	conf.env.LIBPATH += [
	 opj(conf.env.TI_CGT_DIR, "lib"),
	]

	conf.env.INCLUDES_DSPBIOS += [
	 opj(conf.env.TI_DSPBIOS_DIR, 'packages', 'ti', 'bios', 'include'),
	]

	conf.env.LIBPATH_DSPBIOS += [
	 opj(conf.env.TI_DSPBIOS_DIR, 'packages', 'ti', 'bios', 'lib'),
	]

	conf.env.INCLUDES_DSPLINK += [
	 opj(conf.env.TI_DSPLINK_DIR, 'dsplink', 'dsp', 'inc'),
	]
Пример #39
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"])
Пример #40
0
def configure(conf):
    v = conf.env
    v.TI_CGT_DIR = getattr(Options.options, "ti-cgt-dir", "")
    v.TI_DSPLINK_DIR = getattr(Options.options, "ti-dsplink-dir", "")
    v.TI_BIOSUTILS_DIR = getattr(Options.options, "ti-biosutils-dir", "")
    v.TI_DSPBIOS_DIR = getattr(Options.options, "ti-dspbios-dir", "")
    v.TI_XDCTOOLS_DIR = getattr(Options.options, "ti-xdctools-dir", "")
    conf.find_ticc()
    conf.find_tiar()
    conf.find_tild()
    conf.ticc_common_flags()
    conf.cc_load_tools()
    conf.cc_add_flags()
    conf.link_add_flags()
    conf.find_program(["tconf"], var="TCONF", path_list=v.TI_XDCTOOLS_DIR)

    conf.env.TCONF_INCLUDES += [
        opj(conf.env.TI_DSPBIOS_DIR, "packages"),
    ]

    conf.env.INCLUDES += [
        opj(conf.env.TI_CGT_DIR, "include"),
    ]

    conf.env.LIBPATH += [
        opj(conf.env.TI_CGT_DIR, "lib"),
    ]

    conf.env.INCLUDES_DSPBIOS += [
        opj(conf.env.TI_DSPBIOS_DIR, "packages", "ti", "bios", "include"),
    ]

    conf.env.LIBPATH_DSPBIOS += [
        opj(conf.env.TI_DSPBIOS_DIR, "packages", "ti", "bios", "lib"),
    ]

    conf.env.INCLUDES_DSPLINK += [
        opj(conf.env.TI_DSPLINK_DIR, "dsplink", "dsp", "inc"),
    ]
Пример #41
0
def configure(conf):
	v = conf.env
	v.TI_CGT_DIR = getattr(Options.options, 'ti-cgt-dir', "")
	v.TI_DSPLINK_DIR = getattr(Options.options, 'ti-dsplink-dir', "")
	v.TI_BIOSUTILS_DIR = getattr(Options.options, 'ti-biosutils-dir', "")
	v.TI_DSPBIOS_DIR = getattr(Options.options, 'ti-dspbios-dir', "")
	v.TI_XDCTOOLS_DIR = getattr(Options.options, 'ti-xdctools-dir', "")
	conf.find_ticc()
	conf.find_tiar()
	conf.find_tild()
	conf.ticc_common_flags()
	conf.cc_load_tools()
	conf.cc_add_flags()
	conf.link_add_flags()
	conf.find_program(['tconf'], var='TCONF', path_list=v.TI_XDCTOOLS_DIR)
	
	conf.env.TCONF_INCLUDES += [
	 opj(conf.env.TI_DSPBIOS_DIR, 'packages'),
	]
	
	conf.env.INCLUDES += [
	 opj(conf.env.TI_CGT_DIR, 'include'),
	]
	
	conf.env.LIBPATH += [
	 opj(conf.env.TI_CGT_DIR, "lib"),
	]

	conf.env.INCLUDES_DSPBIOS += [
	 opj(conf.env.TI_DSPBIOS_DIR, 'packages', 'ti', 'bios', 'include'),
	]
	
	conf.env.LIBPATH_DSPBIOS += [
	 opj(conf.env.TI_DSPBIOS_DIR, 'packages', 'ti', 'bios', 'lib'),
	]

	conf.env.INCLUDES_DSPLINK += [
	 opj(conf.env.TI_DSPLINK_DIR, 'dsplink', 'dsp', 'inc'),
	]
Пример #42
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)
Пример #43
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 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
def setup_llvm_toolchain(conf, target, path_list=None):
    env = conf.env

    compiler = 'clang'

    env.stash()
    try:
        env['MACHINE'] = target

        if target:
            env['GNU_BINUTILS_PREFIX'] = "%s-" % target
        else:
            env['GNU_BINUTILS_PREFIX'] = ""

        conf.setup_gnu_binutils(path_list)

        config = conf.find_program('llvm-config',
                                   var='LLVM_CONFIG',
                                   path_list=path_list)
        env['LLVM_CONFIG'] = conf.cmd_to_list(config)

        cc = conf.find_program(compiler, var='CC', path_list=path_list)
        cc = conf.cmd_to_list(cc) + ['-target', target]

        env['CC_NAME'] = compiler
        env['CXX_NAME'] = compiler

        env['CC_VERSION'] = conf.cmd_and_log(env.LLVM_CONFIG +
                                             ["--version"]).strip().split('.')

        env.CC = cc
        env['CXX'] = cc
        env.AS = cc
        env.ARFLAGS = 'rcs'

        env['LINK_CC'] = env['CC']
        env['LINK_CXX'] = env['CC']

        conf.clang_common_flags()

        f = env.append_value
        f('INCLUDES',
          conf.cmd_and_log(env.LLVM_CONFIG + ["--includedir"]).splitlines())
        f('LIBPATH',
          conf.cmd_and_log(env.LLVM_CONFIG + ["--libdir"]).splitlines())

        conf.env.AS_TGT_F = ['-c', '-o']
        conf.cc_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"])

        #env.stash()
        #try:
        #    conf.env.prepend_value('LINKFLAGS', ['-v'])
        #    conf.env.prepend_value('CFLAGS', ['-v'])
        #    conf.check_cc(lib='c', msg = 'Checking if clang supports target %s' % target, okmsg='Yes', errmsg='No')
        #finally:
        #    env.revert()

    except conf.errors.ConfigurationError:
        env.revert()
        raise
Пример #46
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)
Пример #47
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"]
Пример #48
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')
Пример #49
0
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()

    # 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 g++ first
        gxx_names = conf.mkspec_get_compiler_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'))

    conf.mkspec_check_gcc_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:
        # Also find gcc
        gcc_names = conf.mkspec_get_compiler_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'))

    conf.mkspec_check_gcc_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_gxx_cxxflags()
    # Add our own cc flags
    conf.mkspec_set_gcc_ccflags()