Libtsctl modular build system

From embeddedTS Manuals

The libtsctl build system is modular, containing a make file to eliminate the need to re-build parts that have already been compiled. This is in contrast to previous (beta) versions which embedded the entire libtsctl project into a single source file (using #include on .c files).

The build process has three layers. First, there are all the architecture specific files. These get compiled first into object files, and then all the object files for each architecture is assembled into a single library (.a) file. There is also a library file for all the libtsctl utility functionality, which in turn gets combined with the desired Thread object to produce libtsctl.a. This library file is then linked against the libtsctl application to produce the final executable. The final link stage also includes linking against libbz2, which is used to decompress the dioctl.config files embedded in the binary, and libpthread if the PThread.o Thread object was chosen to support pthreads in libtsctl. The tsctl app also links against libreadline and libcurses (used by libreadline) to support command history in the tsctl shell.

In some cases it may be difficult due to versioning or other issues to install the required libraries. To accomodate this, you can build without support for bzip2 compression by defining "BZ2=no". You can also build without support for command history and editing by defining "READLINE=no".

The build system supports implementing of custom architectures outside the libtsctl build proper. see: Implementing_Custom_libtsctl_Architectures.

In addition, it is possible to build a libtsctl app outside of the libtsctl proper simply by including libtsctl.h (TO DO: separate libtsctl.h for this purpose which is self-contained) and then linking against a libtsctl.a compiled for the desired platform.