1practcl(Tnh)e The Proper Rational API for C to Tool Command Language Modpurlaectcl(n)
2
3
4
5______________________________________________________________________________
6

NAME

8       practcl - The Practcl Module
9

SYNOPSIS

11       package require TclOO  1.0
12
13       proc practcl::cat fname
14
15       proc practcl::docstrip text
16
17       proc putb ?map? text
18
19       proc Proc name arglist body
20
21       proc noop ?args?
22
23       proc practcl::debug ?args?
24
25       proc practcl::doexec ?args?
26
27       proc practcl::doexec_in path ?args?
28
29       proc practcl::dotclexec ?args?
30
31       proc practcl::domake path ?args?
32
33       proc practcl::domake.tcl path ?args?
34
35       proc practcl::fossil path ?args?
36
37       proc practcl::fossil_status dir
38
39       proc practcl::os
40
41       proc practcl::mkzip exename barekit vfspath
42
43       proc practcl::sort_dict list
44
45       proc practcl::local_os
46
47       proc practcl::config.tcl path
48
49       proc practcl::read_configuration path
50
51       proc practcl::tcllib_require pkg ?args?
52
53       proc practcl::platform::tcl_core_options os
54
55       proc practcl::platform::tk_core_options os
56
57       proc practcl::read_rc_file filename ?localdat ?
58
59       proc practcl::read_sh_subst line info
60
61       proc practcl::read_sh_file filename ?localdat ?
62
63       proc practcl::read_Config.sh filename
64
65       proc practcl::read_Makefile filename
66
67       proc practcl::cputs varname ?args?
68
69       proc practcl::tcl_to_c body
70
71       proc practcl::_tagblock text ?style tcl? ?note ?
72
73       proc practcl::de_shell data
74
75       proc practcl::grep pattern ?files ?
76
77       proc practcl::file_lexnormalize sp
78
79       proc practcl::file_relative base dst
80
81       proc practcl::findByPattern basedir patterns
82
83       proc practcl::log fname comment
84
85       proc practcl::_pkgindex_simpleIndex path
86
87       proc practcl::_pkgindex_directory path
88
89       proc practcl::_pkgindex_path_subdir path
90
91       proc practcl::pkgindex_path ?args?
92
93       proc practcl::installDir d1 d2
94
95       proc practcl::copyDir d1 d2 ?toplevel 1?
96
97       proc practcl::buildModule modpath
98
99       proc practcl::installModule modpath DEST
100
101       proc practcl::trigger ?args?
102
103       proc practcl::depends ?args?
104
105       proc practcl::target name info ?action ?
106
107       method constructor
108
109       method argspec argspec
110
111       method comment block
112
113       method keyword.Annotation resultvar commentblock type name body
114
115       method keyword.Class resultvar commentblock name body
116
117       method keyword.class resultvar commentblock name body
118
119       method keyword.Class_Method resultvar commentblock name ?args?
120
121       method keyword.method resultvar commentblock name ?args?
122
123       method keyword.proc commentblock name argspec
124
125       method reset
126
127       method Main
128
129       method section.method keyword method minfo
130
131       method section.annotation type name iinfo
132
133       method section.class class_name class_info
134
135       method section.command procinfo
136
137       method manpage ?header value? ?footer value? ?authors list?
138
139       method scan_text text
140
141       method scan_file filename
142
143       method _MorphPatterns
144
145       method define submethod ?args?
146
147       method graft ?args?
148
149       method initialize
150
151       method link command ?args?
152
153       method morph classname
154
155       method script script
156
157       method select
158
159       method source filename
160
161       classmethod select object
162
163       method config.sh
164
165       method BuildDir PWD
166
167       method MakeDir srcdir
168
169       method read_configuration
170
171       method build-cflags PROJECT DEFS namevar versionvar defsvar
172
173       method critcl ?args?
174
175       method Autoconf
176
177       method BuildDir PWD
178
179       method ConfigureOpts
180
181       method MakeDir srcdir
182
183       method make {} autodetect
184
185       method make {} clean
186
187       method make {} compile
188
189       method make {} install DEST
190
191       method build-compile-sources PROJECT COMPILE CPPCOMPILE INCLUDES
192
193       method build-Makefile path PROJECT
194
195       method build-library outfile PROJECT
196
197       method build-tclsh outfile PROJECT ?path auto?
198
199       method BuildDir PWD
200
201       method make {} autodetect
202
203       method make {} clean
204
205       method make {} compile
206
207       method make {} install DEST
208
209       method MakeDir srcdir
210
211       method NmakeOpts
212
213       method constructor module_object name info ?action_body ?
214
215       method do
216
217       method check
218
219       method output
220
221       method reset
222
223       method triggers
224
225       method constructor parent ?args?
226
227       method child method
228
229       method go
230
231       method cstructure name definition ?argdat ?
232
233       method include header
234
235       method include_dir ?args?
236
237       method include_directory ?args?
238
239       method c_header body
240
241       method c_code body
242
243       method c_function header body ?info ?
244
245       method c_tcloomethod name body ?arginfo ?
246
247       method cmethod name body ?arginfo ?
248
249       method c_tclproc_nspace nspace
250
251       method c_tclcmd name body ?arginfo ?
252
253       method c_tclproc_raw name body ?arginfo ?
254
255       method tcltype name argdat
256
257       method project-compile-products
258
259       method implement path
260
261       method initialize
262
263       method linktype
264
265       method generate-cfile-constant
266
267       method generate-cfile-header
268
269       method generate-cfile-tclapi
270
271       method generate-loader-module
272
273       method Collate_Source CWD
274
275       method select
276
277       classmethod select object
278
279       method code section body
280
281       method Collate_Source CWD
282
283       method project-compile-products
284
285       method generate-debug ?spaces ?
286
287       method generate-cfile-constant
288
289       method generate-cfile-public-structure
290
291       method generate-cfile-header
292
293       method generate-cfile-global
294
295       method generate-cfile-private-typedef
296
297       method generate-cfile-private-structure
298
299       method generate-cfile-functions
300
301       method generate-cfile-tclapi
302
303       method generate-hfile-public-define
304
305       method generate-hfile-public-macro
306
307       method generate-hfile-public-typedef
308
309       method generate-hfile-public-structure
310
311       method generate-hfile-public-headers
312
313       method generate-hfile-public-function
314
315       method generate-hfile-public-includes
316
317       method generate-hfile-public-verbatim
318
319       method generate-loader-external
320
321       method generate-loader-module
322
323       method generate-stub-function
324
325       method IncludeAdd headervar ?args?
326
327       method generate-tcl-loader
328
329       method generate-tcl-pre
330
331       method generate-tcl-post
332
333       method linktype
334
335       method Ofile filename
336
337       method project-static-packages
338
339       method toolset-include-directory
340
341       method target method ?args?
342
343       method project-compile-products
344
345       method generate-loader-module
346
347       method project-compile-products
348
349       method linker-products configdict
350
351       method initialize
352
353       variable make_object
354
355       method _MorphPatterns
356
357       method add ?args?
358
359       method install-headers ?args?
360
361       method make {} _preamble
362
363       method make {} pkginfo
364
365       method make {} objects
366
367       method make {} object name
368
369       method make {} reset
370
371       method make {} trigger ?args?
372
373       method make {} depends ?args?
374
375       method make {} filename name
376
377       method make {} target name Info body
378
379       method make {} todo
380
381       method make {} do
382
383       method child which
384
385       method generate-c
386
387       method generate-h
388
389       method generate-loader
390
391       method initialize
392
393       method implement path
394
395       method linktype
396
397       method _MorphPatterns
398
399       method constructor ?args?
400
401       method add_object object
402
403       method add_project pkg info ?oodefine ?
404
405       method add_tool pkg info ?oodefine ?
406
407       method build-tclcore
408
409       method child which
410
411       method linktype
412
413       method project pkg ?args?
414
415       method tclcore
416
417       method tkcore
418
419       method tool pkg ?args?
420
421       method clean PATH
422
423       method project-compile-products
424
425       method go
426
427       method generate-decls pkgname path
428
429       method implement path
430
431       method generate-make path
432
433       method linktype
434
435       method package-ifneeded ?args?
436
437       method shared_library ?filename ?
438
439       method static_library ?filename ?
440
441       method build-tclkit_main PROJECT PKG_OBJS
442
443       method Collate_Source CWD
444
445       method wrap PWD exename vfspath ?args?
446
447       classmethod Sandbox object
448
449       classmethod select object
450
451       classmethod claim_option
452
453       classmethod claim_object object
454
455       classmethod claim_path path
456
457       method scm_info
458
459       method DistroMixIn
460
461       method Sandbox
462
463       method SrcDir
464
465       method ScmTag
466
467       method ScmClone
468
469       method ScmUnpack
470
471       method ScmUpdate
472
473       method Unpack
474
475       classmethod claim_object object
476
477       classmethod claim_option
478
479       classmethod claim_path path
480
481       method ScmUnpack
482
483       classmethod claim_object obj
484
485       classmethod claim_option
486
487       classmethod claim_path path
488
489       method scm_info
490
491       method ScmClone
492
493       method ScmTag
494
495       method ScmUnpack
496
497       method ScmUpdate
498
499       classmethod claim_object obj
500
501       classmethod claim_option
502
503       classmethod claim_path path
504
505       method ScmTag
506
507       method ScmUnpack
508
509       method ScmUpdate
510
511       method _MorphPatterns
512
513       method BuildDir PWD
514
515       method child which
516
517       method compile
518
519       method go
520
521       method install ?args?
522
523       method linktype
524
525       method linker-products configdict
526
527       method linker-external configdict
528
529       method linker-extra configdict
530
531       method env-bootstrap
532
533       method env-exec
534
535       method env-install
536
537       method env-load
538
539       method env-present
540
541       method sources
542
543       method update
544
545       method unpack
546
547       method env-bootstrap
548
549       method env-present
550
551       method linktype
552
553       method env-bootstrap
554
555       method env-install
556
557       method env-present
558
559       method install DEST
560
561       method kettle path ?args?
562
563       method install DEST
564
565       method install DEST
566
567       method env-bootstrap
568
569       method env-install
570
571       method env-present
572
573       method install DEST
574
575       method install-module DEST ?args?
576
577       method env-bootstrap
578
579       method env-install
580
581       method install DEST
582
583       method install-module DEST ?args?
584
585       method clean
586
587       method env-install
588
589       method project-compile-products
590
591       method ComputeInstall
592
593       method go
594
595       method linker-products configdict
596
597       method project-static-packages
598
599       method BuildDir PWD
600
601       method compile
602
603       method Configure
604
605       method install DEST
606
607       method install DEST
608
609       method install DEST
610
611       method env-bootstrap
612
613       method env-present
614
615       method env-install
616
617       method go
618
619       method linktype
620
621______________________________________________________________________________
622

DESCRIPTION

624       The  Practcl  module  is a tool for integrating large modules for C API
625       Tcl code that requires custom Tcl types and TclOO objects.
626
627       The concept with Practcl is that is a single file package that can  as‐
628       sist any tcl based project with distribution, compilation, linking, VFS
629       preparation, executable assembly, and installation. Practcl also allows
630       one  project  to invoke the build system from another project, allowing
631       complex projects such as a statically linked basekit  to  be  assembled
632       with relative ease.
633
634       Practcl  ships  as a single file, and aside from a Tcl 8.6 interpreter,
635       has no external dependencies.
636
637       Making a practcl project
638

COMMANDS

640       proc practcl::cat fname
641              Concatenate a file
642
643       proc practcl::docstrip text
644              Strip the global comments from tcl code.  Used  to  prevent  the
645              documentation  markup  comments  from clogging up files intended
646              for distribution in machine readable format.
647
648       proc putb ?map? text
649              Append a line of text to a variable. Optionally apply  a  string
650              mapping.
651
652       proc Proc name arglist body
653              Generate a proc if no command already exists by that name
654
655       proc noop ?args?
656              A  command to do nothing. A handy way of negating an instruction
657              without having to comment it completely out.  It's also a  handy
658              attachment point for an object to be named later
659
660       proc practcl::debug ?args?
661
662       proc practcl::doexec ?args?
663              Drop in a static copy of Tcl
664
665       proc practcl::doexec_in path ?args?
666
667       proc practcl::dotclexec ?args?
668
669       proc practcl::domake path ?args?
670
671       proc practcl::domake.tcl path ?args?
672
673       proc practcl::fossil path ?args?
674
675       proc practcl::fossil_status dir
676
677       proc practcl::os
678
679       proc practcl::mkzip exename barekit vfspath
680              Build a zipfile. On tcl8.6 this invokes the native Zip implemen‐
681              tation on older interpreters this invokes zip via exec
682
683       proc practcl::sort_dict list
684              Dictionary sort a key/value list. Needed because pre tcl8.6 does
685              not have lsort -stride 2
686
687       proc practcl::local_os
688              Returns  a  dictionary  describing  the  local operating system.
689              Fields return include:
690
691              •      download - Filesystem path where fossil repositories  and
692                     source tarballs are downloaded for the current user
693
694              •      EXEEXT - The extension to give to executables. (i.e. .exe
695                     on windows)
696
697              •      fossil_mirror - A URI for a local network web server  who
698                     acts as a fossil repository mirror
699
700              •      local_install  - Filesystem path where packages for local
701                     consumption by the current user are installed
702
703              •      prefix - The prefix as given to the Tcl core/TEA for  in‐
704                     stallation to local_install in ./configure
705
706              •      sandbox  -  The  file location where this project unpacks
707                     external projects
708
709              •      TEACUP_PROFILE - The  ActiveState/Teacup  canonical  name
710                     for     this     platform     (i.e.     win32-ix86    ma‐
711                     cosx10.5-i386-x86_84)
712
713              •      TEACUP_OS - The local operating system (windows,  macosx,
714                     openbsd,  etc).  Gives  the same answer as tcl.m4, except
715                     that macosx is given as macosx instead of Darwin.
716
717              •      TEA_PLATFORM - The platform returned by uname -s-uname -r
718                     (on Unix), or "windows" on Windows
719
720              •      TEACUP_ARCH - The processor architecture for the local os
721                     (i.e. ix86, x86_64)
722
723              •      TEACUP_ARCH - The processor architecture for the local os
724                     (i.e. ix86, x86_64)
725
726              •      teapot  -  Filesystem path where teapot package files are
727                     downloaded for the current user
728
729              •      userhome - File  path  to  store  localized  preferences,
730                     cache download files, etc for the current user
731
732              This  command  uses a combination of local checks with Exec, any
733              tclConfig.sh file that is resident, autoconf data where  already
734              computed, and data gleaned from a file named practcl.rc in user‐
735              home. The location for userhome varies by platform and operating
736              system:
737
738              •      Windows: ::env(LOCALAPPDATA)/Tcl
739
740              •      Macos: ~/Library/Application Support/Tcl
741
742              •      Other: ~/tcl
743
744       proc practcl::config.tcl path
745              A  transparent call to ::practcl::read_configuration to preserve
746              backward compadibility with older copies of Practcl
747
748       proc practcl::read_configuration path
749              Detect local platform. This command looks for  data  gleaned  by
750              autoconf  or autosetup in the path specified, or perform its own
751              logic tests if neither has been run.  A file  named  config.site
752              present  in  the  location  indicates that this project is cross
753              compiling, and the data stored in that file is used for the com‐
754              piler and linker.
755
756              This  command looks for information from the following files, in
757              the following order:
758
759              •      config.tcl - A file generated  by  autoconf/configure  in
760                     newer editions of TEA, encoded as a Tcl script.
761
762              •      config.site  -  A file containing cross compiler informa‐
763                     tion, encoded as a SH script
764
765              •      ::env(VisualStudioVersion) - On Windows, and  environmen‐
766                     tal value that indicates MS Visual Studio is installed
767
768       This  command  returns  a dictionary containing all of the data cleaned
769       from the sources above.  In the absence of any  guidance  this  command
770       returns  the  same output as ::practcl::local_os.  In this mode, if the
771       environmental variable VisualStudioVersion exists,  this  command  will
772       provide a template of fields that are appropriate for compiling on Win‐
773       dows under Microsoft Visual Studio. The USEMSVC flag in the  dictionary
774       is a boolean flag to indicate if this is indeed the case.
775
776       proc practcl::tcllib_require pkg ?args?
777              Try to load  a package, and failing that retrieve tcllib
778
779       proc practcl::platform::tcl_core_options os
780              Return the string to pass to ./configure to compile the Tcl core
781              for the given OS.
782
783              •      windows: --with-tzdata --with-encoding utf-8
784
785              •      macosx:   --enable-corefoundation=yes     --enable-frame‐
786                     work=no --with-tzdata --with-encoding utf-8
787
788              •      other: --with-tzdata --with-encoding utf-8
789
790       proc practcl::platform::tk_core_options os
791
792       proc practcl::read_rc_file filename ?localdat ?
793              Read a stylized key/value list stored in a file
794
795       proc practcl::read_sh_subst line info
796              Converts a XXX.sh file into a series of Tcl variables
797
798       proc practcl::read_sh_file filename ?localdat ?
799
800       proc practcl::read_Config.sh filename
801              A  simpler  form  of  read_sh_file tailored to pulling data from
802              (tcl|tk)Config.sh
803
804       proc practcl::read_Makefile filename
805              A simpler form of read_sh_file tailored to pulling data  from  a
806              Makefile
807
808       proc practcl::cputs varname ?args?
809              Append arguments to a buffer The command works like puts in that
810              each call will also insert a line feed. Unlike puts, blank links
811              in the interstitial are suppressed
812
813       proc practcl::tcl_to_c body
814
815       proc practcl::_tagblock text ?style tcl? ?note ?
816
817       proc practcl::de_shell data
818
819       proc practcl::grep pattern ?files ?
820              Search for the pattern pattern amongst $files
821
822       proc practcl::file_lexnormalize sp
823
824       proc practcl::file_relative base dst
825              Calculate a relative path between base and dst
826
827              Example:
828
829                ::practcl::file_relative ~/build/tcl/unix ~/build/tcl/library
830                > ../library
831
832
833
834
835       proc practcl::findByPattern basedir patterns
836
837       proc practcl::log fname comment
838              Record an event in the practcl log
839
840       proc practcl::_pkgindex_simpleIndex path
841
842       proc practcl::_pkgindex_directory path
843              Return  true  if  the pkgindex file contains any statement other
844              than "package ifneeded" and/or if any package ifneeded  loads  a
845              DLL
846
847       proc practcl::_pkgindex_path_subdir path
848              Helper function for ::practcl::pkgindex_path
849
850       proc practcl::pkgindex_path ?args?
851              Index  all  paths  given  as though they will end up in the same
852              virtual file system
853
854       proc practcl::installDir d1 d2
855              Delete the contents of d2, and then recusively  Ccopy  the  con‐
856              tents of d1 to d2.
857
858       proc practcl::copyDir d1 d2 ?toplevel 1?
859              Recursively copy the contents of d1 to d2
860
861       proc practcl::buildModule modpath
862
863       proc practcl::installModule modpath DEST
864              Install a module from MODPATH to the directory specified.  dpath
865              is assumed to be the fully qualified path where module is to  be
866              placed.   Any  existing  files will be deleted at that path.  If
867              the path is symlink the process will return with no error and no
868              action.  If the module has contents in the build/ directory that
869              are newer than the .tcl files in the  module  source  directory,
870              and  a  build/build.tcl file exists, the build/build.tcl file is
871              run.  If the source directory includes a file  named  index.tcl,
872              the  directory is assumed to be in the tao style of modules, and
873              the entire directory (and all subdirectories) are copied  verba‐
874              tim.  If no index.tcl file is present, all .tcl files are copied
875              from the module source directory, and  a  pkgIndex.tcl  file  is
876              generated  if non yet exists.  I a folder named htdocs exists in
877              the source directory, that directory is copied verbatim  to  the
878              destination.
879
880       proc practcl::trigger ?args?
881              Trigger build targets, and recompute dependencies
882
883              Internals:
884
885
886                ::practcl::LOCAL make trigger {*}$args
887                foreach {name obj} [::practcl::LOCAL make objects] {
888                  set ::make($name) [$obj do]
889                }
890
891
892       proc practcl::depends ?args?
893              Calculate  if  a dependency for any of the arguments needs to be
894              fulfilled or rebuilt.
895
896              Internals:
897
898
899                ::practcl::LOCAL make depends {*}$args
900
901
902       proc practcl::target name info ?action ?
903              Declare a build product. This  proc  is  just  a  shorthand  for
904              ::practcl::LOCAL make task $name $info $action
905
906              Registering a build product with this command will create an en‐
907              try in the global  array, and populate a  value  in  the  global
908              array.
909
910              Internals:
911
912
913                set obj [::practcl::LOCAL make task $name $info $action]
914                set ::make($name) 0
915                set filename [$obj define get filename]
916                if {$filename ne {}} {
917                  set ::target($name) $filename
918                }
919
920

CLASSES

922   CLASS  PRACTCL::DOCTOOL
923              { set authors {
924                 {John Doe} {jdoe@illustrious.edu}
925                 {Tom RichardHarry} {tomdickharry@illustrius.edu}
926               }
927               # Create the object
928               ::practcl::doctool create AutoDoc
929               set fout [open [file join $moddir module.tcl] w]
930               foreach file [glob [file join $srcdir *.tcl]] {
931                 set content [::practcl::cat [file join $srcdir $file]]
932                  # Scan the file
933                  AutoDoc scan_text $content
934                  # Strip the comments from the distribution
935                  puts $fout [::practcl::docstrip $content]
936               }
937               # Write out the manual page
938               set manout [open [file join $moddir module.man] w]
939               dict set args header [string map $modmap [::practcl::cat [file join $srcdir manual.txt]]]
940               dict set args footer [string map $modmap [::practcl::cat [file join $srcdir footer.txt]]]
941               dict set args authors $authors
942               puts $manout [AutoDoc manpage {*}$args]
943               close $manout
944
945
946              }
947
948       Tool  for  build scripts to dynamically generate manual files from com‐
949       ments in source code files
950
951       Methods
952
953       method constructor
954
955       method argspec argspec
956              Process an argument  list  into  an  informational  dict.   This
957              method  also  understands  non-positional arguments expressed in
958              the     notation     of      Tip      471      https://core.tcl-
959              lang.org/tips/doc/trunk/tip/479.md.
960
961              The output will be a dictionary of all of the fields and whether
962              the fields are positional, mandatory, and whether  they  have  a
963              default value.
964
965
966              Example:
967
968                 my argspec {a b {c 10}}
969
970                 > a {positional 1 mandatory 1} b {positional 1 mandatory 1} c {positional 1 mandatory 0 default 10}
971
972
973
974
975       method comment block
976              Convert  a  block  of comments into an informational dictionary.
977              If lines in the comment start with a single  word  ending  in  a
978              colon,  all  subsequent lines are appended to a dictionary field
979              of that name.  If no fields are given, all of the  text  is  ap‐
980              pended to the description field.
981
982              Example:
983
984               my comment {Does something cool}
985               > description {Does something cool}
986
987               my comment {
988               title : Something really cool
989               author : Sean Woods
990               author : John Doe
991               description :
992               This does something really cool!
993               }
994               > description {This does something really cool!}
995                 title {Something really cool}
996                 author {Sean Woods
997                 John Doe}
998
999
1000
1001
1002       method keyword.Annotation resultvar commentblock type name body
1003
1004       method keyword.Class resultvar commentblock name body
1005              Process an oo::objdefine call that modifies the class object it‐
1006              self
1007
1008       method keyword.class resultvar commentblock name body
1009              Process an oo::define, clay::define, etc statement.
1010
1011       method keyword.Class_Method resultvar commentblock name ?args?
1012              Process a statement for a clay style class method
1013
1014       method keyword.method resultvar commentblock name ?args?
1015              Process a statement for a tcloo style object method
1016
1017       method keyword.proc commentblock name argspec
1018              Process a proc statement
1019
1020       method reset
1021              Reset the state of the object and its embedded coroutine
1022
1023       method Main
1024              Main body of the embedded coroutine for the object
1025
1026       method section.method keyword method minfo
1027              Generate the manual page text for a method or proc
1028
1029       method section.annotation type name iinfo
1030
1031       method section.class class_name class_info
1032              Generate the manual page text for a class
1033
1034       method section.command procinfo
1035              Generate the manual page text for the commands section
1036
1037       method manpage ?header value? ?footer value? ?authors list?
1038              Generate the manual page. Returns the  completed  text  suitable
1039              for saving in .man file.  The header argument is a block of doc‐
1040              tools text to go in before the machine generated section. footer
1041              is a block of doctools text to go in after the machine generated
1042              section. authors is a list of individual authors and  emails  in
1043              the form of AUTHOR EMAIL ?AUTHOR EMAIL?...
1044
1045       method scan_text text
1046              Scan a block of text
1047
1048       method scan_file filename
1049              Scan a file of text
1050
1051   CLASS  PRACTCL::METACLASS
1052       The metaclass for all practcl objects
1053
1054       Methods
1055
1056       method _MorphPatterns
1057
1058       method define submethod ?args?
1059
1060       method graft ?args?
1061
1062       method initialize
1063
1064       method link command ?args?
1065
1066       method morph classname
1067
1068       method script script
1069
1070       method select
1071
1072       method source filename
1073
1074   CLASS  PRACTCL::TOOLSET
1075       Ancestor-less  class  intended  to be a mixin which defines a family of
1076       build related behaviors that are modified when targetting either gcc or
1077       msvc
1078
1079       Class Methods
1080
1081       classmethod select object
1082              Perform the selection for the toolset mixin
1083
1084       Methods
1085
1086       method config.sh
1087              find or fake a key/value list describing this project
1088
1089       method BuildDir PWD
1090              Compute the location where the product will be built
1091
1092       method MakeDir srcdir
1093              Return  where  the  Makefile is located relative to srcdir.  For
1094              this implementation the MakeDir is always srcdir.
1095
1096       method read_configuration
1097              Read information about the build process for this package.   For
1098              this  implementation,  data is sought in the following locations
1099              in the following order: config.tcl (generated by practcl.)  PKG‐
1100              Config.sh. The Makefile
1101
1102              If  the  Makefile needs to be consulted, but does not exist, the
1103              Configure method is invoked
1104
1105       method build-cflags PROJECT DEFS namevar versionvar defsvar
1106              method DEFS This method populates 4 variables: name -  The  name
1107              of  the  package  version  - The version of the package defs - C
1108              flags passed to the compiler includedir - A  list  of  paths  to
1109              feed to the compiler for finding headers
1110
1111       method critcl ?args?
1112              Invoke critcl in an external process
1113
1114   CLASS  PRACTCL::TOOLSET.GCC
1115       ancestors: practcl::toolset
1116
1117       Methods
1118
1119       method Autoconf
1120
1121       method BuildDir PWD
1122
1123       method ConfigureOpts
1124
1125       method MakeDir srcdir
1126              Detect what directory contains the Makefile template
1127
1128       method make {} autodetect
1129
1130       method make {} clean
1131
1132       method make {} compile
1133
1134       method make {} install DEST
1135
1136       method build-compile-sources PROJECT COMPILE CPPCOMPILE INCLUDES
1137
1138       method build-Makefile path PROJECT
1139
1140       method build-library outfile PROJECT
1141              Produce a static or dynamic library
1142
1143       method build-tclsh outfile PROJECT ?path auto?
1144              Produce a static executable
1145
1146   CLASS  PRACTCL::TOOLSET.MSVC
1147       ancestors: practcl::toolset
1148
1149       Methods
1150
1151       method BuildDir PWD
1152              MSVC always builds in the source directory
1153
1154       method make {} autodetect
1155              Do nothing
1156
1157       method make {} clean
1158
1159       method make {} compile
1160
1161       method make {} install DEST
1162
1163       method MakeDir srcdir
1164              Detect what directory contains the Makefile template
1165
1166       method NmakeOpts
1167
1168   CLASS  PRACTCL::MAKE_OBJ
1169       ancestors: practcl::metaclass
1170
1171       A  build  deliverable  object.  Normally an object file, header, or tcl
1172       script which must be compiled or generated in some way
1173
1174       Methods
1175
1176       method constructor module_object name info ?action_body ?
1177
1178       method do
1179
1180       method check
1181
1182       method output
1183
1184       method reset
1185
1186       method triggers
1187
1188   CLASS  PRACTCL::OBJECT
1189       ancestors: practcl::metaclass
1190
1191       A generic Practcl object
1192
1193       Methods
1194
1195       method constructor parent ?args?
1196
1197       method child method
1198
1199       method go
1200
1201   CLASS  PRACTCL::DYNAMIC
1202       Dynamic blocks do not generate their own .c files, instead the contrib‐
1203       ute to the amalgamation of the main library file
1204
1205       Methods
1206
1207       method cstructure name definition ?argdat ?
1208              Parser functions
1209
1210       method include header
1211
1212       method include_dir ?args?
1213
1214       method include_directory ?args?
1215
1216       method c_header body
1217
1218       method c_code body
1219
1220       method c_function header body ?info ?
1221
1222       method c_tcloomethod name body ?arginfo ?
1223
1224       method cmethod name body ?arginfo ?
1225              Alias to classic name
1226
1227       method c_tclproc_nspace nspace
1228
1229       method c_tclcmd name body ?arginfo ?
1230
1231       method c_tclproc_raw name body ?arginfo ?
1232              Alias to classic name
1233
1234       method tcltype name argdat
1235
1236       method project-compile-products
1237              Module interactions
1238
1239       method implement path
1240
1241       method initialize
1242              Practcl internals
1243
1244       method linktype
1245
1246       method generate-cfile-constant
1247
1248       method generate-cfile-header
1249
1250       method generate-cfile-tclapi
1251              Generate code that provides implements Tcl API calls
1252
1253       method generate-loader-module
1254              Generate  code  that runs when the package/module is initialized
1255              into the interpreter
1256
1257       method Collate_Source CWD
1258
1259       method select
1260              Once an object marks itself as some flavor of dynamic, stop try‐
1261              ing to morph it into something else
1262
1263   CLASS  PRACTCL::PRODUCT
1264       A deliverable for the build system
1265
1266       Class Methods
1267
1268       classmethod select object
1269
1270       Methods
1271
1272       method code section body
1273
1274       method Collate_Source CWD
1275
1276       method project-compile-products
1277
1278       method generate-debug ?spaces ?
1279
1280       method generate-cfile-constant
1281
1282       method generate-cfile-public-structure
1283              Populate const static data structures
1284
1285       method generate-cfile-header
1286
1287       method generate-cfile-global
1288
1289       method generate-cfile-private-typedef
1290
1291       method generate-cfile-private-structure
1292
1293       method generate-cfile-functions
1294              Generate  code that provides subroutines called by Tcl API meth‐
1295              ods
1296
1297       method generate-cfile-tclapi
1298              Generate code that provides implements Tcl API calls
1299
1300       method generate-hfile-public-define
1301
1302       method generate-hfile-public-macro
1303
1304       method generate-hfile-public-typedef
1305
1306       method generate-hfile-public-structure
1307
1308       method generate-hfile-public-headers
1309
1310       method generate-hfile-public-function
1311
1312       method generate-hfile-public-includes
1313
1314       method generate-hfile-public-verbatim
1315
1316       method generate-loader-external
1317
1318       method generate-loader-module
1319
1320       method generate-stub-function
1321
1322       method IncludeAdd headervar ?args?
1323
1324       method generate-tcl-loader
1325
1326       method generate-tcl-pre
1327              This methods generates any Tcl script file which is required  to
1328              pre-initialize the C library
1329
1330       method generate-tcl-post
1331
1332       method linktype
1333
1334       method Ofile filename
1335
1336       method project-static-packages
1337              Methods called by the master project
1338
1339       method toolset-include-directory
1340              Methods called by the toolset
1341
1342       method target method ?args?
1343
1344   CLASS  PRACTCL::PRODUCT.CHEADER
1345       ancestors: practcl::product
1346
1347       A  product which generated from a C header file. Which is to say, noth‐
1348       ing.
1349
1350       Methods
1351
1352       method project-compile-products
1353
1354       method generate-loader-module
1355
1356   CLASS  PRACTCL::PRODUCT.CSOURCE
1357       ancestors: practcl::product
1358
1359       A product which generated from a C source file. Normally an object (.o)
1360       file.
1361
1362       Methods
1363
1364       method project-compile-products
1365
1366   CLASS  PRACTCL::PRODUCT.CLIBRARY
1367       ancestors: practcl::product
1368
1369       A  product  which is generated from a compiled C library.  Usually a .a
1370       or a .dylib file, but in complex cases may actually just be  a  conduit
1371       for one project to integrate the source code of another
1372
1373       Methods
1374
1375       method linker-products configdict
1376
1377   CLASS  PRACTCL::PRODUCT.DYNAMIC
1378       ancestors: practcl::dynamic practcl::product
1379
1380       A  product  which  is generated from C code that itself is generated by
1381       practcl or some other means. This C file may or may not produce its own
1382       .o file, depending on whether it is eligible to become part of an amal‐
1383       gamation
1384
1385       Methods
1386
1387       method initialize
1388
1389   CLASS  PRACTCL::PRODUCT.CRITCL
1390       ancestors: practcl::dynamic practcl::product
1391
1392       A binary product produced by critcl. Note: The  implementation  is  not
1393       written yet, this class does nothing.
1394
1395   CLASS  PRACTCL::MODULE
1396       ancestors: practcl::object practcl::product.dynamic
1397
1398       In the end, all C code must be loaded into a module This will either be
1399       a dynamically loaded library implementing a tcl extension,  or  a  com‐
1400       piled in segment of a custom shell/app
1401
1402       Variable
1403
1404       variable make_object
1405
1406       Methods
1407
1408       method _MorphPatterns
1409
1410       method add ?args?
1411
1412       method install-headers ?args?
1413
1414       method make {} _preamble
1415
1416       method make {} pkginfo
1417
1418       method make {} objects
1419              Return a dictionary of all handles and associated objects
1420
1421       method make {} object name
1422              Return the object associated with handle name
1423
1424       method make {} reset
1425              Reset all deputy objects
1426
1427       method make {} trigger ?args?
1428              Exercise the triggers method for all handles listed
1429
1430       method make {} depends ?args?
1431              Exercise the check method for all handles listed
1432
1433       method make {} filename name
1434              Return the file name of the build product for the listed handle
1435
1436       method make {} target name Info body
1437
1438       method make {} todo
1439              Return a list of handles for object which return true for the do
1440              method
1441
1442       method make {} do
1443              For each target exercise the action specified in the action def‐
1444              inition if the do method returns true
1445
1446       method child which
1447
1448       method generate-c
1449              This  methods  generates  the contents of an amalgamated .c file
1450              which implements the loader for a batch of tools
1451
1452       method generate-h
1453              This methods generates the contents of an  amalgamated  .h  file
1454              which describes the public API of this module
1455
1456       method generate-loader
1457
1458       method initialize
1459
1460       method implement path
1461
1462       method linktype
1463
1464   CLASS  PRACTCL::PROJECT
1465       ancestors: practcl::module
1466
1467       A toplevel project that is a collection of other projects
1468
1469       Methods
1470
1471       method _MorphPatterns
1472
1473       method constructor ?args?
1474
1475       method add_object object
1476
1477       method add_project pkg info ?oodefine ?
1478
1479       method add_tool pkg info ?oodefine ?
1480
1481       method build-tclcore
1482              Compile  the  Tcl core. If the define tk is true, compile the Tk
1483              core as well
1484
1485       method child which
1486
1487       method linktype
1488
1489       method project pkg ?args?
1490              Exercise the methods of a sub-object
1491
1492       method tclcore
1493
1494       method tkcore
1495
1496       method tool pkg ?args?
1497
1498   CLASS  PRACTCL::LIBRARY
1499       ancestors: practcl::project
1500
1501       A toplevel project that produces a library
1502
1503       Methods
1504
1505       method clean PATH
1506
1507       method project-compile-products
1508
1509       method go
1510
1511       method generate-decls pkgname path
1512
1513       method implement path
1514
1515       method generate-make path
1516              Backward compadible call
1517
1518       method linktype
1519
1520       method package-ifneeded ?args?
1521              Create a "package ifneeded" Args are a list of aliases for which
1522              this package will answer to
1523
1524       method shared_library ?filename ?
1525
1526       method static_library ?filename ?
1527
1528   CLASS  PRACTCL::TCLKIT
1529       ancestors: practcl::library
1530
1531       A toplevel project that produces a self-contained executable
1532
1533       Methods
1534
1535       method build-tclkit_main PROJECT PKG_OBJS
1536
1537       method Collate_Source CWD
1538
1539       method wrap PWD exename vfspath ?args?
1540              Wrap an executable
1541
1542   CLASS  PRACTCL::DISTRIBUTION
1543       Standalone  class to manage code distribution This class is intended to
1544       be mixed into another class (Thus the lack of ancestors)
1545
1546       Class Methods
1547
1548       classmethod Sandbox object
1549
1550       classmethod select object
1551
1552       classmethod claim_option
1553
1554       classmethod claim_object object
1555
1556       classmethod claim_path path
1557
1558       Methods
1559
1560       method scm_info
1561
1562       method DistroMixIn
1563
1564       method Sandbox
1565
1566       method SrcDir
1567
1568       method ScmTag
1569
1570       method ScmClone
1571
1572       method ScmUnpack
1573
1574       method ScmUpdate
1575
1576       method Unpack
1577
1578   CLASS  PRACTCL::DISTRIBUTION.SNAPSHOT
1579       ancestors: practcl::distribution
1580
1581       A file distribution from zip, tarball, or other non-scm archive format
1582
1583       Class Methods
1584
1585       classmethod claim_object object
1586
1587       classmethod claim_option
1588
1589       classmethod claim_path path
1590
1591       Methods
1592
1593       method ScmUnpack
1594
1595   CLASS  PRACTCL::DISTRIBUTION.FOSSIL
1596       ancestors: practcl::distribution
1597
1598       A file distribution based on fossil
1599
1600       Class Methods
1601
1602       classmethod claim_object obj
1603              Check for markers in the metadata
1604
1605       classmethod claim_option
1606
1607       classmethod claim_path path
1608              Check for markers in the source root
1609
1610       Methods
1611
1612       method scm_info
1613
1614       method ScmClone
1615              Clone the source
1616
1617       method ScmTag
1618
1619       method ScmUnpack
1620
1621       method ScmUpdate
1622
1623   CLASS  PRACTCL::DISTRIBUTION.GIT
1624       ancestors: practcl::distribution
1625
1626       A file distribution based on git
1627
1628       Class Methods
1629
1630       classmethod claim_object obj
1631
1632       classmethod claim_option
1633
1634       classmethod claim_path path
1635
1636       Methods
1637
1638       method ScmTag
1639
1640       method ScmUnpack
1641
1642       method ScmUpdate
1643
1644   CLASS  PRACTCL::SUBPROJECT
1645       ancestors: practcl::module
1646
1647       A subordinate project
1648
1649       Methods
1650
1651       method _MorphPatterns
1652
1653       method BuildDir PWD
1654
1655       method child which
1656
1657       method compile
1658
1659       method go
1660
1661       method install ?args?
1662              Install project into the local build system
1663
1664       method linktype
1665
1666       method linker-products configdict
1667
1668       method linker-external configdict
1669
1670       method linker-extra configdict
1671
1672       method env-bootstrap
1673              Methods for packages/tools that can be downloaded possibly built
1674              and  used  internally  by this Practcl process Load the facility
1675              into the interpreter
1676
1677       method env-exec
1678              Return a file path that exec can call
1679
1680       method env-install
1681              Install the tool into the local environment
1682
1683       method env-load
1684              Do whatever is necessary to get the tool into the local environ‐
1685              ment
1686
1687       method env-present
1688              Check if tool is available for load/already loaded
1689
1690       method sources
1691
1692       method update
1693
1694       method unpack
1695
1696   CLASS  PRACTCL::SUBPROJECT.SOURCE
1697       ancestors: practcl::subproject practcl::library
1698
1699       A project which the kit compiles and integrates the source for itself
1700
1701       Methods
1702
1703       method env-bootstrap
1704
1705       method env-present
1706
1707       method linktype
1708
1709   CLASS  PRACTCL::SUBPROJECT.TEAPOT
1710       ancestors: practcl::subproject
1711
1712       a copy from the teapot
1713
1714       Methods
1715
1716       method env-bootstrap
1717
1718       method env-install
1719
1720       method env-present
1721
1722       method install DEST
1723
1724   CLASS  PRACTCL::SUBPROJECT.KETTLE
1725       ancestors: practcl::subproject
1726
1727       Methods
1728
1729       method kettle path ?args?
1730
1731       method install DEST
1732
1733   CLASS  PRACTCL::SUBPROJECT.CRITCL
1734       ancestors: practcl::subproject
1735
1736       Methods
1737
1738       method install DEST
1739
1740   CLASS  PRACTCL::SUBPROJECT.SAK
1741       ancestors: practcl::subproject
1742
1743       Methods
1744
1745       method env-bootstrap
1746
1747       method env-install
1748
1749       method env-present
1750
1751       method install DEST
1752
1753       method install-module DEST ?args?
1754
1755   CLASS  PRACTCL::SUBPROJECT.PRACTCL
1756       ancestors: practcl::subproject
1757
1758       Methods
1759
1760       method env-bootstrap
1761
1762       method env-install
1763
1764       method install DEST
1765
1766       method install-module DEST ?args?
1767
1768   CLASS  PRACTCL::SUBPROJECT.BINARY
1769       ancestors: practcl::subproject
1770
1771       A subordinate binary package
1772
1773       Methods
1774
1775       method clean
1776
1777       method env-install
1778
1779       method project-compile-products
1780
1781       method ComputeInstall
1782
1783       method go
1784
1785       method linker-products configdict
1786
1787       method project-static-packages
1788
1789       method BuildDir PWD
1790
1791       method compile
1792
1793       method Configure
1794
1795       method install DEST
1796
1797   CLASS  PRACTCL::SUBPROJECT.TEA
1798       ancestors: practcl::subproject.binary
1799
1800       A subordinate TEA based binary package
1801
1802   CLASS  PRACTCL::SUBPROJECT.LIBRARY
1803       ancestors: practcl::subproject.binary practcl::library
1804
1805       A subordinate C library built by this project
1806
1807       Methods
1808
1809       method install DEST
1810
1811   CLASS  PRACTCL::SUBPROJECT.EXTERNAL
1812       ancestors: practcl::subproject.binary
1813
1814       A subordinate external C library
1815
1816       Methods
1817
1818       method install DEST
1819
1820   CLASS  PRACTCL::SUBPROJECT.CORE
1821       ancestors: practcl::subproject.binary
1822
1823       Methods
1824
1825       method env-bootstrap
1826
1827       method env-present
1828
1829       method env-install
1830
1831       method go
1832
1833       method linktype
1834

BUGS, IDEAS, FEEDBACK

1836       This  document,  and the package it describes, will undoubtedly contain
1837       bugs and other problems.  Please report such in the category practcl of
1838       the  Tcllib  Trackers  [http://core.tcl.tk/tcllib/reportlist].   Please
1839       also report any ideas for enhancements you may have for either  package
1840       and/or documentation.
1841
1842       When proposing code changes, please provide unified diffs, i.e the out‐
1843       put of diff -u.
1844
1845       Note further that  attachments  are  strongly  preferred  over  inlined
1846       patches.  Attachments  can  be  made  by  going to the Edit form of the
1847       ticket immediately after its creation, and  then  using  the  left-most
1848       button in the secondary navigation bar.
1849

KEYWORDS

1851       practcl
1852

CATEGORY

1854       TclOO
1855
1857       Copyright (c) 2016-2018 Sean Woods <yoda@etoyoc.com>
1858
1859
1860
1861
1862tcllib                              0.16.4                          practcl(n)
Impressum