README.txt 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. Using a Borland compiler product
  2. The files in this directory support using both the free Borland command-line
  3. compiler tools and the Borland C++ Builder IDE. The project files have been
  4. tested with both versions 5 and 6 of the C++ Builder product.
  5. Using the free BCC32 command line compiler
  6. After downloading and installing the free C++ Builder commandline version,
  7. perform the following steps (assuming it was installed under C:\Borland\BCC55):
  8. 1) Add "C:\Borland\BCC55\BIN" to your path
  9. 2) Set the environment variable BCB to "C:\Borland\BCC55".
  10. 3) edit makefile.mak: enable or comment out the appropriate commands under
  11. clean & distclean, depending on whether your OS can use deltree /y or
  12. del /s/f/q.
  13. After that, you should simply cd to the bcb5 directory in your Expat directory
  14. tree (same structure as CVS) and run "make all" or just "make".
  15. Naming
  16. The libraries have the base name "libexpat" followed optionally by an "s"
  17. (static) or a "w" (unicode version), then an underscore and optionally
  18. "mt" (multi-threaded) and "d" (dynamic RTL).
  19. To change the name of the library a project file produces, edit the project
  20. option source (see step 1 under Unicode below) and change the name contained in
  21. the PROJECT tag. In a make file, change the value assigned to the PROJECT
  22. variable. Also, the LIBRARY entry in the .def file has to be changed to
  23. correspond to the new executable name.
  24. Unicode Considerations
  25. There are no facilities in the BCB 5 GUI to create a unicode-enabled
  26. application. Fortunately, it is not hard to do by hand.
  27. 1. The startup .obj system file must be changed to the unicode version.
  28. Go to Project|Edit Option Source, and scroll down to the ALLOBJ tag. Change
  29. c0x32.obj to c0x32w.obj. Editing this file can be quirky, but usually the
  30. following kludge will make the change stick. Close and save the file
  31. (CTRL-F4) then open the options dialog (CTRL-Shift-F11), then click OK on
  32. the dialog immediately without changing anything in it. If this doesn't work,
  33. you will have to close the project completely and edit the .bpr file by hand.
  34. If you are using a make file, just change the startup .obj file assigned
  35. to the ALLOBJ variable.
  36. 2. Add the macro define XML_UNICODE_WCHAR_T. In the GUI that goes in the options
  37. dialog, Directories/Conditionals tab, in the Conditional define box. In a
  38. make file, put it in the USERDEFINES variable.
  39. 3. Of course, your code has to be written for unicode. As a start, the "main"
  40. function is called "wmain". The tchar macros are an interesting way to
  41. write code that can easily switch between unicode and utf-8. If these macros
  42. are used, then simply adding the conditional define _UNICODE as well as
  43. XML_UNICODE_WCHAR_T will bring in the unicode versions of the tchar macros.
  44. Otherwise the utf-8 versions are used. xmlwf uses its own versions of the
  45. tchar macros which are switched on and off by the XML_UNICODE macro, which
  46. itself is set by the XML_UNICODE_WCHAR_T define.
  47. Threading
  48. The libexpat libraries are all built to link with the multi-threaded dynamic RTL's.
  49. That means they require CC32xxMT.DLL present on the installation target.
  50. To create single-threaded libs, do the following:
  51. 1. The compiler option for multi-threading must be turned off. Following the
  52. instructions above to edit the option source, remove the -tWM option from
  53. the CFLAG1 tag. In a make file, remove it from the CFLAG1 variable.
  54. 2. The single threaded RTL must be called. change the RTL in the ALLLIB tag or
  55. variable (GUI or makefile repectively) to the version without the "mt" in the
  56. name. For example, change cw32mti.lib to cw32i.lib.
  57. Static RTL's
  58. To build the libs with static RTL's do the following,
  59. 1. For the static expatlibs, in the Tlib tab on the options dialog, uncheck the
  60. "Use dynamic RTL" box. For the dynamic expatlibs, in the Linker tab on the
  61. options dialog, uncheck "Use dynamic RTL". If you are using a make file,
  62. remove the _RTLDLL assignment to the SYSDEFINES variable, and change the RTL
  63. to the version without an "i" in the ALLLIB variable. For example,
  64. cw32mti.lib would become cw32mt.lib.