With more complicated extensions - especially Tk extensions - it is often necessary to check for platform specific features.
For example, the busy widget has been extracted from George Howlett's BLT library [10] and built as a separate stubs-enabled package using CriTcl. Here is a code fragment from busy.tcl:
if {[critcl::check "#include <limits.h>"]}{ critcl::cheaders -DHAVE_LIMITS_H }
The critcl::check procedure invokes the C compiler on the supplied C code, and returns true if the code compiles without errors. In this case, we are just testing for the existence of the limits.h header file.
Using the C compiler in this way is perhaps less efficient that the more traditional approaches (such as autoconf). But it does have some key advantages - primarily simplicity and familiarity. Knowing C does not imply a knowledge of any particular compiler tool chain, especially as more people come to Tcl from the Windows and Mac worlds.