33 lines
1.1 KiB
Plaintext
33 lines
1.1 KiB
Plaintext
import os
|
|
import sipconfig
|
|
|
|
script_dir = os.path.dirname(os.path.realpath(Dir("#/Sconstruct").abspath))
|
|
build_dir = os.path.join(script_dir, "build")
|
|
src_dir = os.path.join(script_dir, "src")
|
|
sip_dir = os.path.join(script_dir, "sip")
|
|
#generate install dir
|
|
install_dir = os.path.join(script_dir, "..", "rdpy", "fast")
|
|
|
|
def build_sip(target, source, env):
|
|
# Get the SIP configuration information.
|
|
config = sipconfig.Configuration()
|
|
|
|
# Run SIP to generate the code.
|
|
os.system(" ".join([config.sip_bin, "-c", "src", str(source[0])]))
|
|
|
|
#building library
|
|
env = Environment()
|
|
env.Append(BUILDERS = {'Sip' : Builder(action = build_sip)})
|
|
env.Append(CPPPATH = ["/usr/include/python2.7"]);
|
|
env.VariantDir('build', 'src', duplicate=0)
|
|
|
|
targetName = os.path.join(build_dir, "rle.so")
|
|
|
|
sources = [Glob(os.path.join(build_dir, '*.c')), os.path.join(build_dir, "siprlecmodule.c")]
|
|
|
|
sip = env.Sip([os.path.join(src_dir, "sipAPIrle.h"), os.path.join(src_dir, "siprlecmodule.c")], [os.path.join(sip_dir, "rle.sip")])
|
|
|
|
lib = env.SharedLibrary(target = targetName, source = sources, SHLIBPREFIX='')
|
|
|
|
env.Requires(lib, sip)
|