README 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. This is the distribution of Log4C (last updated 13 Nov 2006)
  2. * What is Log4C
  3. Log4C is a C library for flexible logging to files, syslog and other
  4. destinations. It is modeled after the Log for Java library
  5. (http://jakarta.apache.org/log4j/), staying as close to their API as is
  6. reasonable.
  7. As well as the "doc" directory in the Log4C repository, see also here for
  8. more documentation on Log4c:
  9. http://log4c.sourceforge.net/
  10. http://sourceforge.net/docman/?group_id=38627
  11. http://en.wikipedia.org/wiki/Log4C
  12. * Licensing
  13. Log4C libraries are released under the terms of the GNU Lesser
  14. General Public License (GNU LGPL).
  15. You can find copies of the license in the file COPYING
  16. * What you will need to compile Log4C on Unix systems
  17. perl 5.8+ (used by the automake tools)
  18. GNU make tools: automake 1.7+, autoconf 2.57+, m4 1.4+ and libtool 1.4+
  19. A Compiler, among those tested are:
  20. . gcc3 (on Red Hat Enterprise Linux 3 and 4)
  21. . gcc4 (on HP-UX 11.11i, on Fedora Core 5)
  22. . Sun cc (versions 5.3 and 5.7 on Solaris 8 and higher, sparc and i386)
  23. . HPUX ansi C compiler (on HPUX v11.11i, pa-risc)
  24. . AIX xlc compiler
  25. If you request at compile time that the expat library be used to help parse
  26. the configuration file, then you will need the expat library available
  27. on the system. If you do not use expat then pre-generated files from
  28. obsolete versions of flex and bison are used to do the parsing--this code
  29. is still supported for the moment but it is recommended to use expat.
  30. For information on compiling on Microsoft Windows see the README in the msvc6
  31. directory.
  32. * Where to find ...
  33. GNU automake tools:
  34. http://gcc.gnu.org
  35. http://www.sunfreeware.com/ for pre-built Solaris packages
  36. http://hpux.connect.org.uk/ for re-built HP-UX depots
  37. gcc3 or gcc4
  38. http://gcc.gnu.org
  39. http://www.sunfreeware.com for pre-built Solaris packages
  40. http://hpux.connect.org.uk/ for re-built HP-UX depots
  41. Log4C
  42. http://log4c.sf.net/ This SourceForge site is now the main log4c site.
  43. expat
  44. http://expat.sourceforge.net/
  45. * How to for library users who download a released tarball (eg.
  46. log4c-1.2.0.tar.gz):
  47. The Log4C package uses the GNU autotools compilation and installation
  48. framework.
  49. We recommend that you do not build in the source directories themselves;
  50. rather make a build directory into which the configure script will generate
  51. the Makefiles and build the library and binaries in there. This is better
  52. because it allows you to separate the source from the binaries and also to
  53. maintain a compiled version of Log4C for different platforms--make a build
  54. directory for each of the platforms you support and run configure on each of
  55. your build machines.
  56. So, for example, you might create directories called build-fc5, build-rh3,
  57. build-Solaris10x86, build-hpuxi11 and so on for your various builds. These
  58. example commands below should compile Log4C on each of the supported
  59. platforms:
  60. $ tar -zxvf log4c-1.2.0.tar.gz
  61. $ mkdir build; cd build
  62. $ ../log4c-1.2.0/configure --prefix=/path/of/installation
  63. $ make
  64. $ make install
  65. To build the binary, source, developer and debuginfo RPMs for Linux:
  66. $ make rpm
  67. To enable compilation of the test programs for the library you would do this:
  68. $ ../log4c-1.2.0/configure --prefix=/path/of/installation --enable-test
  69. To enable the dcumentation generation
  70. $ ../log4c-1.2.0/configure --prefix=/path/of/installation --enable-doc
  71. To specify a compiler other than gcc at configure time you would do something
  72. like this:
  73. $ ../log4c-1.2.0/configure --prefix=/path/of/installation --enable-test \
  74. CC=/usr/SUNWspro/bin/cc
  75. To cross-compile using MinGW:
  76. $ ../log4c/configure \
  77. --enable-test --enable-doc \
  78. --host=i686-pc-mingw32 --build=x86_64-pc-linux-gnu
  79. To get started with the examples see the README in the examples source code
  80. directory and run them from the build directory as follows:
  81. $ cd examples
  82. $ ./application_1
  83. $ ./application_2
  84. * How to for library developers ...
  85. When you check out Log4C from CVS (as opposed to downloading a released
  86. tarball) you will need to generate the configure script and so on. To do this
  87. run the bootstrap script. This script must be run in the source directories
  88. themselves:
  89. $ cvs -d:pserver:anonymous@log4c.cvs.sourceforge.net:/cvsroot/log4c login
  90. $ cvs -z3 -d:pserver:anonymous@log4c.cvs.sourceforge.net:/cvsroot/log4c co -P log4c
  91. $ cd log4c
  92. $ ./bootstrap
  93. To compile in extra tracing and messages and compile the doc you would do
  94. this from your build directory:
  95. $ ../log4c/configure --prefix=/path/of/installation --enable-test \
  96. --enable-debug --enable-doc
  97. This will define the __SD_DEBUG__ variable at compile time. Note that you
  98. still need to define the SD_ERROR and SD_DEBUG environment variables at run
  99. time to actually see the error/debug output.
  100. Type '../log4c/configure --help' for a list of all the configure
  101. options. Some of the options are generic autoconf options, while the Log4C
  102. specific options are prefixed with "LOG4C" in the help text.
  103. Have Fun !!