Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243
  1. Developer notes for the SNF4CGP developer distribution
  2. 27 October 2009
  3. Scope
  4. -----
  5. This file contains information for software developers. Ths
  6. information includes the prerequisite software for building, a
  7. description of the build system, and procedures for creating the CGP
  8. module tarball.
  9. Software prerequisites
  10. ----------------------
  11. The build system uses GNU software development system. The following
  12. software is needed for building:
  13. 1) automake
  14. 2) autoconf
  15. 3) libtool
  16. 4) make
  17. 5) g++
  18. 6) tar
  19. 7) curl
  20. 8) pthread development.
  21. These tools are normally available on a Linux system that is
  22. configured as a software development system. The Linux system
  23. installation process usually gives the user a choice of installing a
  24. workstation, server, or software development system. However, not all
  25. Linux distributions give these choices.
  26. If these tools are not installed, they may be installed (or upgraded)
  27. at any time. The commands vary from distribution to distribution.
  28. For Ubuntu, the apt-get command can be used:
  29. 1) 'apt-get install automake'.
  30. 2) 'apt-get install autoconf'.
  31. 3) 'apt-get install libtool'.
  32. 4) 'apt-get install make'.
  33. 5) 'apt-get install g++'.
  34. 6) 'apt-get install tar'.
  35. 7) 'apt-get install curl'.
  36. 8) 'apt-get install libc6-dev' (to install the pthread library).
  37. For creating packages, additional tools are needed. These are listed
  38. in each section for developing packages below.
  39. Structure of the build system
  40. -----------------------------
  41. The following files comprise the build system:
  42. 1) configure.ac. This is the main configuration file. It specifies
  43. the distribution name, version, which libraries are needed, etc.
  44. 2) Makefile.am. This is used to create the top-level Makefile. It
  45. lists which directories are part of the build system
  46. (e.g. SNFMilter), and which extra files are to be part of the
  47. distribution (e.g. BUGS, README, etc).
  48. 3) Makefile.am in each directory: SNFMilter, SNFClient, SNF2Check,
  49. CodeDweller, SNFMulti, Scripts, Tests, and config_files. These are
  50. used to create the Makefile files for building, configuring and
  51. installing the software. These Makefile.am files contain lists
  52. which source files are to be used for building, and directions to
  53. generate the configuration files.
  54. In addition, the distribution includes the source files and
  55. configuration files for each of the applications.
  56. During the build process, the files in SNFMulti and CodeDweller are
  57. compiled into a static library. The applications SNF4CGP, SNFClient,
  58. and SNF2Check link with these libraries. These libraries are not
  59. installed. The system checks the dates of the files, and recompiles
  60. and relinks as necessary.
  61. To add an additional source file , edit the appropriate Makefile.am.
  62. Add the source file to the appropriate variable. For example, in
  63. SNFMilter/Makefile.am:
  64. 1) SNFMilter_SOURCES for the cpp files for SNFMilter.
  65. 2) noinst_HEADERS for the header files for SNFMilter. These are
  66. part of the user tarball, but aren't installed into the user system.
  67. Note that files that are not listed will not be included in the
  68. distribution tarball. This allows you to have additional files in
  69. directories (used, for example, for other projects) without
  70. unnecessarily increasing the size of the SNFMilter application or
  71. tarball.
  72. NOTE: If files are added or removed from the build system, the package
  73. configuration files must also be modified. Please see the section on
  74. building packages below for instructions.
  75. Using the build system
  76. ----------------------
  77. Issue the following command to prepare system newly checked out for
  78. building:
  79. 1) autoreconf --install
  80. On some OSes, running this results in warning messages:
  81. 1) libtoolize: Consider adding `AC_CONFIG_MACRO_DIR([m4])' to
  82. configure.ac
  83. 2) libtoolize: Consider adding `-I m4' to ACLOCAL_AMFLAGS in
  84. Makefile.am.
  85. 3) `CXXFLAGS' is a user variable, you should not override it.
  86. 4) shell uname -s: non-POSIX variable name
  87. These can be safely ignored.
  88. Issue the following commands for creating a CommuniGate Pro module
  89. tarball (please see the Doc/default.html file for how to install the
  90. module):
  91. 1) './configure'
  92. 2) 'make'
  93. You can pass flags to the compiler with the following command:
  94. make OTHER_CXXFLAGS=flags
  95. where 'flags' contains the flags. For example, to enable all warnings:
  96. make OTHER_CXXFLAGS='-Wall'
  97. See the compiler documentation for other options.
  98. You can alter any other variable make uses. For example, to build a
  99. static executable, specify LDFLAGS as follows:
  100. make LDFLAGS="-all-static"
  101. See the documentation make and libtool for other options.
  102. 3) 'make module' (as root). This creates a tarball named
  103. SNF4CGP-$(VERSION)-MODULE.tar.gz that contains the binary
  104. CommuniGate Pro module.
  105. Please note that the "make install" is not needed. If you accidently
  106. run "make install", you can run "make uninstall" to remove the files
  107. that were installed by "make install".
  108. Other commands:
  109. "make dist" creates a tarball of the form snf-milter-X.Y.Z.tar.gz.
  110. X, Y, and Z, as well as SNFMilter, are specified by the following
  111. line in configure.ac:
  112. AC_INIT(snf4cgp, X.Y.Z)
  113. "make clean", "make distclean", "make maintainer-clean" remove files
  114. that can be recreated. After running "make clean", you'd need to
  115. run "make" to rebuild the system. After running "make distclean" or
  116. "make maintainer-clean", you'd need to run ./configure to build the
  117. system.
  118. Note: The script 'cleanForDist' cleans the developer distribution. It
  119. removes any packages and user tarballs that might have been created,
  120. files created by 'autoreconf --install', and files ending in "~".
  121. After running this command, the directory tree can be imported into a
  122. version control system, or tarred and gzipped.
  123. Changing the version number or package name
  124. -------------------------------------------
  125. To change the version number or package name, do the following:
  126. 1) Update configure.ac:
  127. a) Change the version number and/or package name for the build
  128. system. Do this by modifying the argument to the AC_INIT line in
  129. configure.ac. For example, to change the package name to FOO and
  130. the version to 8.0.2, modify the line to be:
  131. AC_INIT(FOO, 8.0.2)
  132. Changing the contents of the Doc directory in the module tarball
  133. ----------------------------------------------------------------
  134. The contents of the Doc directory of the module tarball are specified
  135. in the Makefile.am file in the top-level directory. Edit the lines
  136. after the line beginning with "EXTRA_DIST =" to change which files are
  137. stored in the Doc directory.
  138. Changing the CGP module tarball name or content
  139. -----------------------------------------------
  140. The CGP module tarball is created by commands in Makefile.am. Look
  141. for a line beginning with "module:". The following line defines the
  142. name of the module tarball:
  143. MOD_TARBALL=SNF4CGP-$(VERSION)-$(shell uname -s).tar.gz
  144. The following line defines the name of the module directory:
  145. MOD_DIR=SNF4CGP
  146. The commands after the line beginning with "module:" create the module
  147. tarball. Modify those commands to alter the content of the module
  148. tarball.
  149. The Doc/default.html file might need to be updated to reflect any
  150. changes.
  151. Generation of sample configuration files and scripts
  152. ----------------------------------------------------
  153. The build system generates sample configuration files and scripts that
  154. take into account where the SNF4CGP distribution is installed. These
  155. sample configuration files are part of the module tarball, and are
  156. installed. The Doc/default.html file contains user instructions for
  157. creating the configuration files from the sample configuration files.
  158. Debugging
  159. ---------
  160. Enable debugging by having the path of the executable contain "debug"
  161. or "Debug". This causes debugging messages to be written to the
  162. SNF4GCP log file.