From: Andreas K. <aku...@sh...> - 2001-11-20 05:51:33
|
The current master makefile is a maintenance hotspot. Every speciality in any module has to be reflected in that makefile, in several locations: 'install' and 'dist' targets, plus changes in 'mkInstallScripts'. As such it does serve as deterence for module writers to not to deviate from the prescribed path (to much). Still, there are modules which will require the installation of more files outside of the existing set (*.n, *.tcl, and tclIndex). Example: The foundations of the memchan manpage system are the expand macro processor and a set of rules for the conversion of a manpage marked up in tcl into nroff, HTML and TMML. The heart of the expand processor is now part of the 'textutil' module of tcllib and can be installed in a regular manner. The rules files driving the conversion however, and a mini-expand using them, are outside of the regular installation procedures provided by the master maskefile and the script generating the install scripts. Other problems: There are essentially three different directory layouts present in the system: a) The sourcecode from the CVS b) The sourcecode distribution as generated by 'make dist' c) and the installed tcllib. This makes maintenance unduly complex as different code has to be written and kept in sync for the various transitions: (a -> c) make install (a -> b) make dist (b -> c) script generated by mkInstallScripts.tcl in (a -> b) Note aside: The generated sourcecode distribution (b) does not contain the examples! This is a major deficiency for users of the tcllib distribution as they do not have any demos. Possibilites: 1) The tcllib configure is extended to generate not only the master makefile but also module makefiles. This is added on a case by case basis. The master makefile is extended to look out for and use module makefiles if present. This essentially means that targets like 'install' and 'dist' do their regular work and also call upon the module makefile (same target) for any specialities. The generator script 'mkInstallScripts' is extended to look out for and use module makefiles to generate any special code required by a module. Or alternatively they look for plugin code in the module which is then used to genrate the installation commands. ** This way of doing things should allow us to extend tcllib ** with modules requiring special things for quite some ** time. In the end however this approach does not scale as ** there is still the central 'configure.in' script to maintain, ** i.e. it is a central location containing module information. 2) Instead of extending the configure(.in) file we write small tool which can extract the configuration information out of a 'config.status' file and apply this to any file we desire. The master makefile uses this to automtically generate all module makefiles out of their .in counterparts, if present. Together with the rest of (1) we now have unchanging master configure(.in), Makefile(.in) and mkInstallScripts.tcl while still preserving the extensibility we desire. The tool mentioned above can be implemented using the expand functionality from the textutil module. Regarding the other problems I propose to make the source distribution structurally identical to the raw cvs layout, with just the development files stripped (Makefile*, configure*, CVS directories). This alone would make the layouts (a) and (b) similar enough to allow us to rewrite the 'install' target of the master makefile in terms of the script generated by 'mkInstallScripts.tcl', thus reducing the size of the code to maintain. A side benefit would be that the examples would now be part of the source distribution. They would not get installed, but they would at least be available. Comments, opinions ? -- So long, Andreas Kupries <aku...@sh...> <http://www.purl.org/NET/akupries/> Developer @ <http://www.activestate.com/> ------------------------------------------------------------------------------- |