Metadata-Version: 1.1
Name: tinycc
Version: 1.0.2
Summary: TinyCC compiler bundle for windows
Home-page: https://github.com/SasView/tinycc
Author: SasView Collaboration
Author-email: management@sasview.org
License: UNKNOWN
Description: TinyCC compiler bundle
        ======================
        
        TinyCC (or tcc) is a small, fast C compiler capable of producing DLLs that can
        be loaded via ctypes.  This version includes compilers for 32-bit and
        64-bit Windows.
        
        Compiler version: 0.9.26 (amd64) 2013-02-16
        
        Installation of the compiler and the python interface is simply::
        
            pip install tinycc
        
        Full documentation for the compiler is available at `<http://bellard.org/tcc>`_.
        Source and binaries are available from `<https://savannah.nongnu.org/projects/tinycc/>`_.
        
        *TCC* is the full path to the tcc.exe executable. Note that the executable
        path may contain spaces so it must be wrapped in quotes when used as part
        of an os.system command.
        
        *TCC_VERSION* is the compiler version.
        
        Usage example::
        
            from tinycc import compile
            dll_path = compile("hello.c")
        
        This creates "hello.dll" in the same directory as "hello.c".  Use
        *compile(source, target)* to control the path to the dll.
        
        For more flexibility, you can call the compiler directly::
        
            import os
            import subprocess
            from tinycc import TCC
        
            source = "hello.c"
            dll_path = os.path.splitext(source)[0] + ".dll"  # replace .c with .dll
            command = [TCC, "-shared", "-rdynamic", "-Wall", source, "-o", dll_path]
            try:
                # need shell=True on windows to keep console box from popping up
                shell = os.name == "nt"
                subprocess.check_output(command, shell=shell, stderr=subprocess.STDOUT)
            except subprocess.CalledProcessError as exc:
                raise RuntimeError("compile failed.\n%s\n%s"%(command_str, exc.output))
            if not os.path.exists(dll_path):
                raise RuntimeError("compile failed.  File is in %r"%source)
        
        Use *data_files* to gather the data files required for bundling tinycc
        in a py2exe package.  This places the compiler in the tinycc-data directory
        beside the library.zip generated by py2exe.  The following should appear in
        the setup.py for the py2exe build::
        
            import tinycc
        
            data_files = []
            ...
            data_files.extend(tinycc.data_files())
            ...
            setup(
                ...
                data_files = data_files,
                ...
                )
        
        Note: if you have put tcc.exe somewhere unusual (i.e., not in the tinycc
        package and not in tinycc-data next to the py2exe generated library or exe),
        then you can set the environment variable TCC_ROOT to the directory
        containing tcc.exe.
        
Keywords: ctypes compiler
Platform: UNKNOWN
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Win32 (MS Windows)
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: GNU Lesser General Public License v2 (LGPLv2)
Classifier: Operating System :: Microsoft :: Windows
Classifier: Programming Language :: C
Classifier: Programming Language :: Python
Classifier: Topic :: Software Development :: Compilers
