Esempio n. 1
0
import sys
import py4a

if __name__ == "__main__":
    py4a.patch_distutils()
    sys.argv = sys.argv[1:]  # remove py4a

    # PyCrypto
    import setup

# vi: ft=python:et:ts=4:nowrap:fdm=marker
Esempio n. 2
0
       _macros = ss_opt 
    miracl_lib = "/usr/local/lib/miracl-ss.a"
    miracl_inc = "/usr/local/include/miracl"
else:
    sys.exit("Need to select which module to build for pairing.")

_charm_version = opt.get('VERSION')
lib_config_file = 'charm/config.py'

lang="c"  
linkargs=[]
libdirs=[]

if opt.get('BUILD_ANDROID')=='yes':
    from py4a import patch_distutils
    patch_distutils()
    
    linkargs=["--sysroot="+os.environ.get("SYSROOT")]
    libdirs=[os.environ.get("NDK")+"/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi"]

if opt.get('PAIR_MOD') == 'yes':
    if opt.get('USE_PBC') == 'yes':
        replaceString(lib_config_file, "pairing_lib=libs ", "pairing_lib=libs.pbc")
        pairing_module = Extension(math_prefix+'.pairing', 
                            include_dirs = [utils_path,
                                            benchmark_path], 
                            sources = [math_path+'pairing/pairingmodule.c', 
                                        utils_path+'base64.c'],
                            extra_link_args=linkargs,
                            library_dirs=libdirs,
                            language=lang,