Create a new library called plplottcltk_Main whose source code is
bindings/tcl/tclMain.c and bindings/tk/tkMain.c. Both of those files
contain code that should not be part of plplottcltk since such code
destroys the possibility of treating plplottcktk as a pure Tcl/Tk
extension which can depend on the stub versions of the Tcl/Tk
libraries. This new library is helpful when starting C applications
(pltcl, plserver, xtk01, xtk02, and xtk04) which depend on the
plplottcltk library so use it to link those applications.
Tested by Alan W. Irwin <firstname.lastname@example.org> on Linux using
the -DENABLE_tcl=ON, -DENABLE_itcl=ON, -DENABLE_tk=ON,
-DENABLE_itk=ON, and -DUSE_TCL_TK_STUBS=ON CMake options using the
test_noninteractive, test_interactive, and test_wish_standard_examples
target in the build tree. All was well other than the known issue that the
latter target still has a segfault at the end that occurs on execution
of the Tcl exit command.
These good test results mean there is only one more thing that needs
to be done before we can make -DUSE_TCL_TK_STUBS=ON the default; make
build-system changes so the tkwin "device" (the shared object that
needs to be built so that "package require Plplotter" will work) will
build and work properly for the -DUSE_TCL_TK_STUBS=ON case.