Import('env')
import os
sources = Split("""
    md5.c
    sha.c
    sha256.c
    aes.c
    hexdigest.c
""")


env.StaticLibrary(target = 'ucipher', source = sources)
if not os.path.exists("mucipher.i"):
    open(str("mucipher.i"), "w").write(open(os.path.abspath("../../Mucipher/mucipher.i")).read())
if not os.path.exists("wraphelp.c"):
    open(str("wraphelp.c"), "w").write(open(os.path.abspath("../../Mucipher/wraphelp.c")).read())

if 'swig' in env['TOOLS']:
    import os
    SConscript(os.path.join('python', 'SConscript'))
    print "SWIG found, building Python bindings for mucipher."
else:
    print "WARNING: SWIG not found, NOT building Python bindings for mucipher."
#    SConscript(os.path.join('perl', 'SConscript')) 
#    can't use perl, cstring not implemented in swig-perl
