Compiling CircleMUD Version 3.0 under MacOS 7.x by Dean Takemori To compile CircleMUD 3.0 under MacOS 7.x, you must have the following: * A Macintosh (68040 or PowerMac recommended) running MacOS 7.5 or later. * Metrowerks CodeWarrior C/C++ compiler, version 9 or later. * the CodeWarrior version of the GUSI library, by Matthias Neeracher. See GUSI section below. * The CircleMUD 3.0bp11 sources and macpatches.tar.gz file, availible from ftp://www.circlemud.org/pub/CircleMUD/ [CircleMUD 3.0bp12 is expected to include the source changes without patching] * Program(s) to uncompress and unarchive the source files. Stuffit Expander is the defacto standard, and is availible practically everywhere. Installation and Compilation The following instructions assume the reader has basic knowledge of C and a familiarity with the CodeWarrior C/C++ version 9 environment. Other compilers/versions may work, but I have made no such attempt. 1) Uncompress and unarchive the sources and prepare them for compiling If necessary, patch or replace the source files. (The only changed ones are comm.c, db.h, db.c, sysdep.h and utils.c) rename conf.h.mac to conf.h 2) Install the GUSI library. The 'official' web and ftp sites for GUSI are http://err.ethz.ch/members/neeri/macintosh.html ftp://sunsite.cnlab-switch.ch/software/platform/macos/src/mw_c/ ftp://err.ethz.ch/pub/neeri/GUSI/ But a relatively recent version should also be available at ftp.circlemud.org. The Stuffit archive contains CodeWarrior project files for PPC and 68k Macs and instructions. Optionally run the included test programs, and then move the library and includes files to an appropriate directory for your system. 3) Create a new project file for either a 68k or PPC application or use the included CodeWarrior 9 project file. Add all the *.c files from the CircleMUD's src directory to the project sources. Add the GUSI library file to the library section of your project file. *NOTE* GUSI works its magic by replacing certain system calls with its own code, so it MUST be first on the libraries list. Add CodeWarrior's SIOUX library to the libraries. Add the GUSI resources file to your project resources list. 4) Modify the project preferences. Depending on where you installed GUSI, you may have to modify the compiler's search path and/or check 'treat <> as ""' for the preprocessor. You should change the memory requirements for the application (3.5 Megs is enough to load the entire stock world). You may want to turn off compiler warnings and requiring function prototypes to avoid lots of warnings due to the way GUSI works. You should also remove the automagic inclusion of Macheaders.h You may want to turn on ANSI C, and various code optimizations. 5) Make and install the application. You will need a properly installed set of CircleMUD world files in MacOS-terminated format for the MUD to run. The 'stock' worlds provided with CircleMUD 3.0bp11 work fine. (see the Troubleshooting section below) Running the MUD 1) In addition to the application, you will need a set of world files for the MUD to run. A set of world files is provided with the base circle 3.0bp11 distribution. (see troubleshooting) 2) The application needs to be in the base directory of the circle source distribution. Namely, if you are using stock CircleMUD 3.0pb11 you should move it to the folder that contains the lib folder. Double click on the application icon to run. A simple dialog box pops up and gives you a chance to enter command line options and/or redirect the log output to a file. "No connections. Going to sleep." will appear in the log window/file when the MUD is ready for players. 3) The MUD application can be stopped either by a god character giving the appropriate shutdown command or by typing Cmd-. and Cmd-Q in the MUD's window. (see troubleshooting section) Troubleshooting See the CircleMUD FAQs, documentation and web pages. General questions about CircleMUD that ARE NOT ANSWERED IN THE FAQ OR DOCUMENTATION can be addressed to the CircleMUD mailing list (circle@cspo.queensu.ca) or the author, Jeremy Elson (jelson@circlemud.org). All questions which specifically deal with the Mac port of Circle should go to my address, listed at the end of this document. The more COMPLETE and RELEVANT information you provide increases the chance of a useful reply. * Symptom: My mac is not on a network, so I can't connect to bugtest etc. * Solution: You need to enable networking. If you have OpenTransport 1.1 this can be done by turning on AppleTalk in the Chooser. Set the TCP/IP control panel to connect via AppleTalk, and configure manually. Then you can give your mac an ip address which can be connected to via the usual tools. Also note that your mac doesn't have a name server, so connecting to it will be very slow. Use the godcommand slowns to toggle name resolution. * Symptom: When connecting to the MUD with NCSA Telnet 2.7 The first attempt at entering a username returns an invalid name error. Cause: I believe (meaning I don't know for sure) that this is a NCSA Telnet problem. Solution: ?? * Symptom: I patched the CircleMUD code with , but it's not working. Note: I have personally ported my imp's code (base Circle + + Macpatches + OLC + Mobprogs + custom changes to everything) to the Mac by only applying my Macpatches and the filesystem differences below. Cause: IF the code is ANSI, doesn't touch the sockets stuff in comm.c, AND reads files, then the problem is probably the differences in the Mac filesystem, which uses ':' as a delimiter instead of '/'. (also see the CR-LF discussion below) Solution: You will have to add some #ifdef CIRCLE_MAC lines like I added to db.c and db.h #ifdef CIRCLE_MAC sprintf(buf2, "%s:%s", prefix, index_filename); #else sprintf(buf2, "%s/%s", prefix, index_filename); #endif if (!(index = fopen(buf2, "r"))) { also note the confusing subtlety that :directory:file is a relative path directory:file is an absolute path, but file is relative. Share your changes with the patch's author and the CircleMUD community. * Symptom: When the MUD is loading a world file it freezes/dies. * Symptom: Non empty .zon files are reported as empty. * Symptom: When the MUD is loading the world files, it fails with SYSREAD errors. The files look fine. Cause: The Mac uses LineFeed as it's end-of-line delimeter. Unix uses CarriageReturn, and DOS/Windows uses CR+LF. Many Mac text editors (including the CodeWarrior editor) are smart enough to handle this difference transparently to the user. The MUD currently isn't. Solution: Convert your world files into Mac format. Some editors and word processors can do this for you, and there are shareware batch utilities as well. * Symptom: The programs in src/util don't compile/run. Cause: ?? I have made exactly ZERO attempts to compile them myself. Solution: ?? But see the filesystem differences above. Share your changes with the CircleMUD community. * Symptom: I don't get all the nifty log files in the log directory and the MUD doesn't autorestart. Cause: These features of the unix version of CircleMUD are provided by the autorun shell script, not the MUD itself. Solution: In principle, some of these features could be implimented trivially in MacPerl/AppleScript/MacTcl scripts or a custom C app. AppleEvents code would make such a script/app *very* powerful, but would require lots of non-portable code. * Symptom: I don't understand why things are #ifdef'ed in and out of comm.c. * Symptom: Cmd-. and Cmd-Q to quit the MUD don't work well. Cause: Me. Solution: I am not an expert at signals nor berkely sockets (unix or GUSI implimentation). I also make no claim of being an expert Macintosh programmer. The code patches provided were largely developed by trial and error, using the 1.7.2 version of GUSI. Any improvements, additions, updates, changes, or fixes WITH explanations are welcome. Dean Takemori dean@uhheph.phys.hawaii.edu DeanDean of CWMud (cw.mud.circlemud.org 9687)