Skip to content

Latest commit

 

History

History
executable file
·
101 lines (78 loc) · 4.34 KB

README.md

File metadata and controls

executable file
·
101 lines (78 loc) · 4.34 KB

Libtcc Extension

This is a extension for libtcc, which builds libtcc1.a at runtime.

The name of libtcc1.a is defined by LIBTCC1_NAME.

How to enable the extension?

The extension is enabled by default and you can disable it by setting LIBTCC_ENABLE_EXTENSION to FALSE.

How does the extension work?

The extension looks every atcc_new() call, if libtcc1-*.a exists in LIBTCC1_DEST_PATH and compiles it if this is not the case.

Methods

The extension provides additional methods which can be included with libtcc_ext.h.


Sets the include and lib paths and the error function for the passed state.


Compiles libtcc1.a if required (and possible) and creates a new TCCState* configured with atcc_configure_state.
Returns the created TCCState* or NULL if creation was not possible.


Creates an *.a archive with the given file name, from the passed file names from files. fileCount must contain the number of Elements contained in files.
Returns -1 on failure.

The full path including the file extension must be passed!


Builds libtcc1.a from source located in LIBTCC1_SRC_PATH with LIBTCC1_NAME as name in LIBTCC1_DEST_PATH. The object files get compiled in LIBTCC1_OBJ_PATH.
Returns -1 on failure.


Sets the error/warning callback for every TCCState which will be configured by atcc_configure_state.


Sets LIBTCC_INCLUDE_PATH at runtime.
The string will not be copied so make sure it is not deallocated during its use in libtcc!


Sets LIBTCC1_NAME at runtime.
The string will not be copied so make sure it is not deallocated during its use in libtcc!


Sets LIBTCC1_SRC_PATH at runtime.
The string will not be copied so make sure it is not deallocated during its use in libtcc!


Sets LIBTCC1_OBJ_PATH at runtime.
The string will not be copied so make sure it is not deallocated during its use in libtcc!


Sets LIBTCC1_DEST_PATH at runtime.
The string will not be copied so make sure it is not deallocated during its use in libtcc!


CMake Variables

Specifies the name of libtcc1.
By default this is "libtcc1-*.a" where "*" is target specific (e.g. on x86_64 the library is called libtcc1-x86_64.a).


Specifies the include path of libtcc for every TCCState which will be configured by atcc_configure_state.
By default this is "LIBTCC_RUNTIME_PATH/include/".


Specifies the path to the source files for libtcc1.a.
By default this is "LIBTCC_RUNTIME_PATH/libtcc1_src/"
(This should not be changed if you have no good reason!).


Specifies the destination folder in which the object files for the compilation of libtcc1.a are placed. These are deleted after compilation and packing.
By default this is "LIBTCC_RUNTIME_PATH/lib/"


Specifies the destination folder in which libtcc1.a is placed.
By default this is "LIBTCC_RUNTIME_PATH/lib/"