Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Linux Compiling  (Read 1294 times)

Demon

  • Bay Watcher
  • From a time before a time before time
    • View Profile
Linux Compiling
« on: February 25, 2008, 01:00:00 am »

Hey guys.  I was editing LCS this weekend before I remembered that there was a massive project dedicated to just such a thing!  I've got the latest SVN version of the source, but I can't get the makefiles to cooperate (old or am).  Any quick fixes or words of wisdom?  (Less importantly, I can't get it to run the Windows version using Wine, which is sad.)

-Demon

Logged

Wisq

  • Bay Watcher
    • View Profile
Re: Linux Compiling
« Reply #1 on: February 25, 2008, 03:23:00 pm »

The Makefile.am and Makefile.old aren't actually meant to be used directly by 'make'.  Instead, they're used by 'autoconf' and 'automake' to make the real makefiles.

What you want is to run the 'bootstrap' script, which is set executable by default, so you should be able to just run "./bootstrap".  This will generate some stuff you need, and look like this:

code:
% ./bootstrap
autoreconf: Entering directory `.'
autoreconf: configure.ac: not using Gettext
autoreconf: running: aclocal --force
autoreconf: configure.ac: tracing
autoreconf: configure.ac: not using Libtool
autoreconf: running: /usr/bin/autoconf --force
autoreconf: running: /usr/bin/autoheader --force
autoreconf: running: automake --add-missing --copy --force-missing
configure.ac: installing `./install-sh'
configure.ac: installing `./missing'
src/Makefile.am: installing `./depcomp'
autoreconf: Leaving directory `.'

Then you run "./configure", which will scan your system for how the C++ compiler works, where it can find certain libraries, etc.

code:
% ./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
   . . . and so on . . .
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating config.h
config.status: executing depfiles commands

You'll also need the development headers for the "ncurses" library; otherwise, it'll fail and tell you that.

Assuming that went well, then you run "make", and watch it do its magic.  When it's done, you'll have a "crimesquad" file in the "src" directory that you can run, and that's the game.

Installing the files somewhere else is a little more complex, but it's completely unnecessary if you just want to run it for yourself.

Logged

Demon

  • Bay Watcher
  • From a time before a time before time
    • View Profile
Re: Linux Compiling
« Reply #2 on: February 25, 2008, 10:57:00 pm »

Thanks for the help!  I had tried to run bootstrap but I didn't have autoconf at the time and I didn't realize it was a package as opposed to a missing file.  The new LCS is interesting!  I already have a (minor) improvement in mind...

How about changing line ~643 of activate.cpp to this:

code:

...
        case 'd':
           switch(choice)
           {
           case '1':break;
           case '2':cr->activity.type=ACTIVITY_REPAIR_ARMOR;choice='2';break;
           default:cr->activity.type=ACTIVITY_REPAIR_ARMOR;choice='2';break;
           }
           break;
        case 'e':
...

Since repair clothing requires no more button pressing (after 'd'), it should be made the default.  If someone wants to bring up the clothing menu they can still push 1, but this makes repairing clothing take one fewer keystroke.

[ February 25, 2008: Message edited by: Demon ]

Logged