Exemplo n.º 1
0
def generate(env):
	if not env['HELP'] and (env['_CONFIGURE_'] or not env.has_key('CACHED_OPENSSL')):
		from SCons.Tool import Tool
		import os
		pkgs = Tool('pkgconfig', ['./bksys'])
		pkgs.generate(env)

		# TODO this will not work on opensuse 10 (ita) openssl-devel not installed
		have_openssl = env.pkgConfig_findPackage('OPENSSL', 'openssl', '0.9.6')

		dest=open(env.join(env['_BUILDDIR_'], 'ksslconfig.h'), 'w')
		dest.write('/* openssl configuration created by bksys */\n')
		if have_openssl: dest.write('#define KSSL_HAVE_SSL 1\n');
		dest.close()
Exemplo n.º 2
0
def generate(env):
	if not env['HELP'] and (env['_CONFIGURE_'] or not env.has_key('CACHED_LIBIDN')):
		from SCons.Tool import Tool
		import os
		pkgs = Tool('pkgconfig', ['./bksys'])
		pkgs.generate(env)

		have_idn  = env.pkgConfig_findPackage('LIBIDN', 'libidn', '0.5.0')

    		dest=open(env.join(env['_BUILDDIR_'], 'config-libidn.h'), 'w')
    		dest.write('/* libidn configuration created by bksys */\n')
		if have_idn:
			dest.write('#define HAVE_IDNA_H 1\n');
			dest.write('#define HAVE_PUNYCODE_H 1\n');
			dest.write('#define HAVE_STRINGPREP_H 1\n');
		dest.close()
		env['_CONFIG_H_'].append('libidn')
Exemplo n.º 3
0
def customize_pyext(env):
    from SCons.Tool import Tool
    from SCons.Tool.FortranCommon import CreateDialectActions, ShFortranEmitter

    if sys.platform == 'win32' and is_debug(env):
        env['PYEXTSUFFIX'] = "_d%s" % get_config_var('SO')
    else:
        env['PYEXTSUFFIX'] = get_config_var('SO')


    t = Tool('pyext', toolpath = get_numscons_toolpaths(env))
    t(env)

    #-----------------------------------------------
    # Extending pyext to handle fortran source code.
    #-----------------------------------------------
    # XXX: This is ugly: I don't see any way to do this cleanly.
    pyext_obj = t._tool_module().createPythonObjectBuilder(env)

    if env.has_key('F77') and env['F77']:
        shcompaction = CreateDialectActions('F77')[2]
        for suffix in env['F77FILESUFFIXES']:
            pyext_obj.add_action(suffix, shcompaction)
            pyext_obj.add_emitter(suffix, ShFortranEmitter)

    # Customizing pyext to handle windows platform (msvc runtime, etc...)
    # We don't do this in pyext because scons has no infrastructure to know
    # whether we are using mingw or ms
    if sys.platform == 'win32':
        _customize_pyext_win32(env, t)

    # XXX: Add numpy header path (will be used by NumpyExtension builder).
    if is_bootstrapping(env):
        env['NUMPYCPPPATH'] = scons_get_paths(env['include_bootstrap'])
    else:
        from numpy.distutils.misc_util import get_numpy_include_dirs
        env['NUMPYCPPPATH'] = get_numpy_include_dirs()
Exemplo n.º 4
0
    def update(self, env):
        """ Update the environment with specific flags """

        t = Tool('qt')
        t(env)

        if isinstance(platform, Win32):
            qt_lib = 'qt-mtnc321'
        else:
            qt_lib = 'qt-mt'

        libpath = str(env.subst(env['QT_LIBPATH']))
        multithread = exist(qt_lib, libpath)
        if multithread:
            env.AppendUnique(CPPDEFINES=['QT_THREAD_SUPPORT'])
            env.Replace(QT_LIB=qt_lib)

        if isinstance(platform, Win32):
            env.AppendUnique(CPPDEFINES=['QT_DLL'])