Building TinyMUSH 2.2 on Linux

Introduction

This page will tell you how to fix a glitch in the build process that occurs with TinyMUSH 2.2's configure script, and RedHat Linux. I've considered making a patch file, but the fix is so minimal (one-time manual edits to two files) and it's so time-consuming to build and test a patch file, that I just took the lazy way out and wrote this page for it instead.

If you're building on RedHat5, go see my Red Hat 5 patch, because there are more problems with building 2.2 on Red Hat 5.0 than just this. That patch fixes this problem and the other problems, too.

If you're building on RedHat 4.1 or 4.2, or on Slakware 3.0, you can keep reading. It's been two years since I built 2.2 on Slakware 3.0, so your mileage may vary, but I recall having to make the same basic tweak there as well. I just can't test it again because I'm now on Red Hat.

The Symptom

The symptoms you see might vary. You might get dbm error messages from dbconvert when you try to db_load a flat file into the newly built mush. You might see dbm error messages in your netmush.log file. You might dump core, though I haven't seen this caused by this particular error on Red Hat 4.x.

In any event, trying to access your database doesn't work.

The Problem

The basic cause of the problem is that the configure script that comes with TinyMUSH 2.2 does not know much about Linux, and isn't looking for the gdbm library when it should be. The configure tests find ndbm okay, but the ndbm library on linux isn't what the code expects to see. (I don't know enough about ndbm to know why Linux is different here, but it is.)

However, Linux's gdbm (the Gnu stuff) does have gdbm subroutines, plus it also has a set of ndbm compatibility subroutines. So, you can compile a C program making ndbm calls, link to the gdbm library, and it all works.

Thus, configure builds autoconf.h with NDBM enabled, but is linking with the ndbm library. It should be linking with the gdbm library.

The Solution

Assuming you've already unpacked TinyMUSH and are ready to start building, modify the README instructions as follows. This is from the README file included with TinyMUSH 2.2.3. The directions start on line 93 of that file. The additions are in bold below. If your browser isn't rendering bold properly, look for the sublist under item 2.

  1. Go to the top-level directory (the directory where this README file is normally located).
  2. Run 'configure' (by typing './configure'). This will customize autoconf.h and the Makefile for your system. If you have gcc (the GNU C compiler) installed on your system, it will automatically be selected as the compiler of choice.
    1. vi autoconf.h (or use whatever editor you choose to use.)
    2. look for HAVE_NDBM. Set this to 1.
    3. look for HAVE_GDBM. Set this to 0.
    4. Save the file.
    5. vi Makefile (or use whatever editor you choose to use.)
    6. Find the line that starts with LIBS and contains -lndbm.
    7. Change the -lndbm to read -lgdbm.
    8. (If you can't find ndbm or gdbm or dbm anywhere on any LIBs line, just append it to the end of the first one you found, near the top of the Makefile.)
    9. Save the file.
  3. TinyMUSH 2.2 is set up to use some features only found in GNU make and other newer versions of make, such as VPATH. If you do not have GNU make, you have two options.
  4. ...

Linux Red Hat's make is Gnu make, so you won't need to go building make itself, or using the 'make patrules' workaround. There also aren't any special C flags needed, the defaults work just fine.


An Alternative Solution

If you prefer, you can follow the instructions for building on BSD/386 instead. This jettisons the whole library issue by providing a replacement IO library, myndbm. I haven't tried this myself but I'm told it works. Myndbm's sources are included with the standard distribution but aren't compiled or linked in by default. Follow what the README says about it.
Frames Homepage Non-Frames Homepage

Say no to monopolies, BOYCOTT MICROSOFT!
KMFMS, one of the Angry Penguins.
[U.S. Flag] In memory of those who died Sept. 11, 2001 at the World Trade Center, the Pentagon, and on American Airlines Flight 11, United Airlines Flight 175, American Airlines Flight 77, and United Airlines Flight 93
Honoring Marsh & McLennan professionals I've worked with, including:
Jack Aron, Valerie Hanna, Joe Sisolak, Greg Reda, and Cathy Fagan.
Shattered Photoessay by James Nachtewy

Comments may be sent to gyles19@nospam.visi.com

Last updated: Sunday, 17-May-1998 22:21:23 CDT