All compiler options should be specified one after another (separated by spaces) and preceded with a '-' character. For example:
TCL -u -f -s120,2048 MyProg
Some compiler options are specified on their own without additional arguments or values (such as the -u and -f options above), whereas others require one or more additional arguments/values to complete the option specification (such as the -s120,2048 option shown above).
Below is a description of all of the command line options that can be specified with the Telecom Engine Compiler (TCL.EXE):
|
Option |
Additional Arguments |
Description. |
|
-u |
None |
Prevent 'Variable not used' Warnings. |
|
-f |
None |
Prevent Debug information being written to TEX file. |
|
-v |
<level> |
Specify verbose mode (<level>=0..9). |
|
-L |
<Libname[.TEL]> |
Specify a TE libary file to search for functions to compile and link to. |
|
-r |
<DLL1[;DLL2[;DLL3...]]]> |
Specify one or more TE DLL or DEF files to load. |
|
-s |
<Stack Depth,Stack Size> |
Specify the stack depth and stack size for the program |
|
-d |
<name> |
Define a constant and set its value to 1 |
|
-d |
<name=value> |
Define a constant and set its value to <value> |
|
-e |
None |
Output all errors to TCL.ERR file. |
|
-n |
None |
Don't load the default TCL.DEF file. |
|
-c |
<flag> |
Set flag to 0 to disallow 'C' style operators (&&,||,==,!,!=), set to 1 to allow these |
|
-z |
<definition file name> |
Create library definition file from loaded DLLs and DEF files. |
Each of these options is described below in more detail:
-u Prevent 'Variable not used' Warnings.
Under normal operation the compiler will issue warnings when a variable has been declared but not used in the application. However in a large application (particularly when using 'include' files to define constants and global variables) it might be desirable to switch these warnings off if too many are being generated.
-f Prevent Debug information being written to TEX file.
By default the compiler will write various debugging information to the excecutable binary output file (.TEX file). This information includes the source code file names and the line numbers within the source code for each statement. By specifying the -f option then the compiler will not include this information into the .TEX executable file (making the .TEX file smaller).
-v<level> Specify verbose mode (<level>=0..9).
This allows the compiler to be run in verbose mode which is usually used for debugging. Setting verbose level 1 or above will increase the amount of output from the compiler for each increasing level. Verbose more 0 turns off the verbose mode for the compiler.
-L<libname.[TEL]> Specify a TE libary file to search for functions to compile and link to.
A number of function source code files can be combined into a singel TE library file (.TEL extension) using the Telecom Engine Utility Program: MKTEL.EXE. This option allows these library files to be searched for functions that will then be compiled and linked into the program in the same way as normal functions found in .FUN files. Note that .FUN files wlil always override any files defined in a .TEL library file.
-r<DLL1[;DDL2[;DLL3...]]] Specify one or more TE DLL or DEF files to load.
In order to link to the TE DLL libary functions then the compiler must load these DLLs to obtain the function definitions (or the .DEF file that represents the function definitions for the DLL). The -r option allows for a semi-colon separated list of DLLs (or .DEF files) to be loaded at compile time so that the function definitions can be accessed by the compiler. For example:
TCL -rCXTERMX;CXSYS;CXTASK.DEF MyProg
The above statement would attempt to load the TE Standard library DLLs: CXTERMX.DLL, CXSYS.DLL and CXTASK.DEF in order to resolve all the function names defined in these libaries. Note that if no extension is specified then it is assumed that it is a DLL that is to be loaded. See Loading DLLs and .DEF files for more information about this.
-s<Stack depth,Stack Size> Specify the stack depth and stack size for the program.
The header of the .TEX executable file contains two fields that defines the stack depth and stack size to allocate at run-time for the application. By default these are set to Stack Depth=256 and Stack Size=4096 which should be sufficient for nearly all but the largest and most complex applications, however this option provides the means to increase or decrease these values if required.
The Stack is a special area of memory which is used by the program at run-time to evaluate the results of expressions and to store the values of any arguments that are passed to functions and to hold the return value.
The Stack Depth defines the number of items that can be pushed onto the stack at any one time. The main thing that uses up stack space is when a function is called since being passed to the function are pushed onto the stack before calling the function (plus the return address and number of arguments is also puched onto the stack) and these are not removed until a return statement is encountered. Therefore if your application calls functions with a large number of arguments and/or if you have functions nested deeply in your application (functions that call functions that call functions etc for many nested levels), or if you call functions recursively (i.e functions that call themselves), then an analysis might need to be carried out to see if the stack depth needs to be increased. As a rule of thumb, find the part of you program that makes the most nest function calls (or calls functions with a large number of arguments) and then add up the number of arguments and add two for each function called (the extra two are for the return address and the number of arguments which are also pushed onto the stack). If this could exceed the stack depth you have specifed then you should increase this.
The other thing the stack is used for is for holding intermediate values when evaluating expressions. This might become significant if you have very long and complicated expressions and you are already deep into nested or recursive functions, but usually and expression will not need more the four or five entries on the stack before the expression is resolved to a single value and removed from the stack.
The Stack Size is the physical number of bytes that the stack contains. Usually variables pushed onto the stack will range in length from only a few characters (E.g. when a number is being used) or several hundred characters for long strings. If your application passes alot of long string values as arguments to functions then you might want to consider increasing the size of the stack to ensure that the stack space does not run out.
As mentioned previously, the default stack size should be suffient for nearly all applications (I've yet to write an application that required the stack to be increased).
-d<name> Define a constant and set its value to "1".
This option causes the constant to be defined with the name <name> and its value will be set to "1". For example:
-dISDN
The above will define a constant called ISDN and set its value to "1". This is equivalent to the compiler encountering the following statement within the global declaration block of the main source file:
const ISDN="1";
-d<name=value> Define a constant and set its value to <value>
This is a variation of the previous option and allows for a constant to be defined and its value to be set to some <value> string. For example:
-dISDN_SUPPORT=OFF
The above will define a constant called ISDN_SUPPORT and set its value to "OFF". This is equivalent to the compiler encountering the following statement within the global declaration block of the main source file:
const ISDN_SUPPORT="OFF";
The -d option is often used in conjuction with the $if...$else...$endif compiler directives which allow condition compilation of portions of the source code (see Compiler Directives).
-e Output all errors to TCL.ERR file.
If this option is specified then all compiler errors are written to the TCL.ERR file in the currect working directory (they are still also written to the console window).
-n Don't load the default TCL.DEF file.
By default the TE Standard Libary Set Definition file (TCL.DEF) is loaded by the compiler so that the names of the TE standard library functions can be resolved without havihng to load the actuall DLLs. This function prevents the TCL.DEF file from being loaded by the compiler by default (See Loading DLLs and .DEF files).
-c<flag> Allow or disallow the use of 'C' style operators.
Set <flag> to 1 to allow 'C' style operators to be used in the program (or 0 to disallow 'C' style operators (this is the default)). The 'C' stlye operators being referred to here are &&, ||, ==, ! and != which are equivalent to the TE operators and, or, eq, not and <> respectively.
-z<definition file> Create library definition file from loaded DLLs and DEF files.
When this option is used it is not required that a program source file be specified since it causes the compiler to output a definition file and it will not compile the source. The definition file that is output will be created from all of the other .DEF and DLL files that have been previously loaded (including the default TCL.DEF and any files specified in the -r option).
This is the easiest way to create .DEF definition files from the actually TE DLL. If you don't want the functions in the default TCL.DEF file to be included in the output .DEF file then -n option should be specifed. See Loading DLLs and .DEF files for more information about this.