=============== Mini-HowTo ============== ======= Building xCHM on Mac OS X ======= ========================================= Date: October 29th, 2003 Author: Martin Use Note: Only tested on Mac OS X 10.2.6 and 10.2.8 Because 10.3 Panther comes with gcc 3.3 the required adaptations might be different. Thanks: Razvan Cojocaru for writing xCHM Vadim Zeitlin for his help getting xCHM to work on OS X ========================================= 1. Required packages ----------------- Download the latest version of xCHM, chmlib and wxWidgets (wxMac). Versions used in this HowTo: - xCHM 0.8.6 - chmlib 0.31 - wxMac 2.5.0 2. Building wxMac -------------- See installation instructions in INSTALL-MAC.txt that comes with the wxMac source distribution. 3. Building chmlib --------------- To build a functioning version of chmlib on MacOS X I had to change the following files and parameters: file: chm_lib.c --------------- Add the PPC platform to the architecture specific defines #elif __i386__ || __sun || __sgi changed to #elif __i386__ || __sun || __sgi || __ppc__ file: Makefile --------------- I had weird problems when using the OSX standard libtool. So I installed the libtool that is provided by the Fink project (GNU libtool 1.3.5) In the Makefile I had to set LIBTOOL to the GNU libtool - normally LIBTOOL=glibtool should do it. CC and LD should be changed from "gcc-3.2" to "gcc". Compiling with the default CFLAGS worked, but the build chmlib is not usable. I figuered out that the problem comes from these cflags: -DCHM_USE_PREAD -DCHM_USE_IO64 Removing them worked for me, but I think its better to add the following CFLAGS instead: -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES This should ensure large file support for the i/o functions. You can try this adjusted version of the chmlib source: If you have installed glibtool, building chmlib with this source should work just out of the box. 4. Building xCHM ------------- After successfully building and installing wxMac and chmlib building and installing xCHM should work as described in the INSTALL file without any problems. BUT: I encountered another problem after I had successfully build and installed xchm: After starting the application the GUI of xchm was displayed, but no interaction using mouse or keyboard was possible! I asked Vadim Zeitlin from the wxWidgets team about this issue and he told me the following: | This means that the resources haven't been linked in. I think this is | because you used 2.5.0 which has a bug with wx-config --rezflags (what does | this return?). The simplest solution is to run Rez manually. You can see | the command you should execute by doing into wxWidgets/samples/minimal, for | example, and doing "make -n" -- this will show the correct Rez command. | Then simply execute it manually on the xchm binary to link the resources to | it. | With wxWidgets 2.5.1 it should work out of the box (when it's released)... For running Rez manually the following command worked for me: (it should be one long line - no line breaks!) /Developer/Tools/Rez -d __DARWIN__ -t APPL -d __WXMAC__ -i /Users/mu/src/wxMac-2.5.0/include -i /usr/local/bin/xchm -d WXUSINGDLL -i /usr/local/bin/xchm -o /usr/local/bin/xchm Carbon.r /Users/mu/src/wxMac-2.5.0/build/lib/libwx_mac-2.5.0.r /Users/mu/src/wxMac-2.5.0/samples/sample.r You will have to adjust the path to your wxWidgets build dir. 5. GOOD LUCK! ----------