Author Topic: autoconf / gcc  (Read 5450 times)

0 Members and 1 Guest are viewing this topic.

Offline penguin

  • Eudyptes codus
  • 28
  • Still alive.
Just a progress update on the autoconf/automake and MinGW/gcc support, since I haven't posted anything about it in a few days.

Note: this doesn't affect folks using Microsoft Visual Studio... you can ignore this thread if all you're using is MSVC.  The MSVC project will be separately maintained unless someone comes up with a better idea.

I am using GNU autoconf/automake which generates the makefiles needed to build fs2_open.  Presumably any OS or build environment can be supported -- I am initially targetting the MinGW system for Win32 (which includes gcc) and (incidentally) Linux/gcc.  

The idea is that these "meta-makefiles" are easier to maintain than a slew of individual makefiles.  It will also make it easier to enable/disable certain blocks of code at configuration time (e.g., "configure --disable-networking")  The downside is that the generated makefiles are enormous and difficult to read, but that's a fair trade IMHO.

As far as status goes, I have all of the cpp modules compiling now with gcc on Win32, although I'm still dealing with numerous linker errors (so I may be missing one or two).  Some blocks of code that contain in-line assembly have been stubbed out, as the gcc assembly syntax is completely different from Microsoft's :(  Another project for a later time, depending on the urgency of the commented-out code...

I have not needed to make very many changes to any of the source modules -- a few more #ifdef lines, mostly.  I haven't committed any changes or new files yet, as this is still a work-in-progress, and a partial commit wouldn't help anyone at this point.

More news will be posted as it becomes available.

Some links for your edification and/or amusement while you wait for me to finish ;)
your source code slave

 

Offline penguin

  • Eudyptes codus
  • 28
  • Still alive.
whee... got a semi-working version :)

Now I gotta take out all the debug stuff I put in.  For some reason, it's dog-slow, but that may be because it's a debug build; I'll try a "release build" tonight.

There are still rough spots -- it seems to freak out if it can't find files, or if there's a parse error in one of the tables.  There seem to be some issue with the "exception handling" using setjmp/longjmp to jump out of the tbl parser.

I converted the "easy" assembly (ones that were 10 lines or less) to the format that gcc uses.  The big chunks of asm code in the software renderer (only used by FRED2, I think) will have to wait.

I'll try a clean build tonight and see how it goes... then a CVS update to bring my changes into sync with anything that may have changed since I started work on it.  I'm still unsure if I should check it into CVS before the 3.5 release or not... I haven't done any regression testing to make sure I didn't break anything with MSVC.
your source code slave

 

Offline penguin

  • Eudyptes codus
  • 28
  • Still alive.
Well, this thing is about ready to go.  I saved Iota wing, and watched the Belasarius get zapped.

There are still timing issues: the slowness I mentioned in the previous post was because of bad assembly code (my fault) in the io/timer.cpp module.  I fixed it, and now have the opposite problem: it seems to be running too fast -- it's like playing at 2x speed.  It's definitely timing-related, because the elapsed time is ticking away at 2-3x realtime.

I've gone over the timer code I converted, and I didn't see any problems with my groggy eyes.  I'm gonna wait until the 3.5 release is out, and then I'll commit my changes; maybe a few more sets of eyeballs can find my mistake :D
your source code slave

 

Offline Inquisitor

3.5 is tagged, so go ahead and commit, I'll manually update the initial status bug that goober was talking about when he committs it.
No signature.

 

Offline penguin

  • Eudyptes codus
  • 28
  • Still alive.
OK, I'll try to merge and commit this weekend.
your source code slave

  

Offline penguin

  • Eudyptes codus
  • 28
  • Still alive.
OK, all the stuff you need to build with gcc under MinGW are now in CVS.

I needed to make minor changes to about a dozen modules; almost all of these were trivial or bracketed by #ifdef __GNUC__ so they should be fairly well insulated.  However: someone with MSVC, please verify that I haven't broken anything.  If I have, post to this thread and I'll fix it ASAP.

Here's what you need to build the source code under MinGW:

You will need the MSYS package as well as MinGW.  Both of these can be downloaded from http://www.mingw.org/download.shtml  You will also need the "package upgrades" on the download page.Here are the build steps, once you have MinGW/MSYS installed:

1. Get the latest version of the fs2_open sources from CVS.
2. Click on the MSYS icon -- this will open up a shell prompt window.  You're now in Unix-land :)
3. Change to the directory where you have the fs2_open source.  Note that MSYS modifies the path a little, and you use proper slashes (not the evil backslash) as directory separators.
4. Run the "configure" script.
5. Run "make" to compile the project
6. Copy the generated fs2.exe to wherever your FS2 data files live.
7. Go kick some Shivan tail (or whatever it is they have).

For example:
Code: [Select]
$ cd /c/Projects/fs2_open
$ ./configure
$ make


And that should be it.  Now anyone with a connection to the internet can build fs2_open :nod:
your source code slave

 

Offline penguin

  • Eudyptes codus
  • 28
  • Still alive.
There are still a few issues w/ the gcc port, some minor, so not so:

1. There is still a bug in the timer code.  The game seems to play at about 2x speed, then occasionally it will switch to about half-speed.

2. No icon or other "resource" stuff is attached to the .EXE

3. A console window opens up briefly at startup.


EDIT:  Grr, it won't link because of the movie player code.  I'm too tired to fix it now (it's 3am) so it will have to wait til tomorrow.
« Last Edit: March 02, 2003, 01:53:58 am by 334 »
your source code slave

 

Offline Inquisitor

Compiling with MSVC now.
No signature.

 

Offline Martinus

  • Aka Maeglamor
  • 210
    • Hard Light Productions
[color=66ff00]
After a bit of messing around I got Dev C++ working. It's an IDE for mingw and it's pretty powerful as well as being friendly. Using CVS with it is also straightforward. If you're downloading Dev get version 4 and NOT version 5 which is a beta and doesn't have good documentation.

You will have to download the CVS executable but I think if you take a look at Dev C++ you'll probably like it.


Penguin: Other than the code is there anything I need to get (DX8 SDK for example) to build the exe?

[/color]

 

Offline Inquisitor

required DX8 libs are in CVS, so, if he did his job right, we're golden ;)

It compiles and runs, btw.
No signature.

 

Offline Martinus

  • Aka Maeglamor
  • 210
    • Hard Light Productions
[color=66ff00]
Smashin' :)
[/color]

 

Offline penguin

  • Eudyptes codus
  • 28
  • Still alive.
OK, I got everything working (sorta) with the current 3.5 baseline.  My "clean build" failed because of the added movie code.  

The issues I mentioned earlier still apply -- the main issue being the erratic timing of the game.

In any event, the DirectShow requirement means you need to install DirectX 8 (or 9 I guess -- haven't tried that).  You will also need to rename the DirectX GUID library file that comes with MinGW (I renamed libdxguid.a to old-libdxguid.a) so that the Makefile uses the dxguid.lib that comes with the DX8 SDK.  Zipfiles of the DX8 headers and libs are available at the warpcore site; PhReAk posted a link to them in this thread

I need to update the makefiles and configure.in (and the README), but that's the quick and dirty.  I will commit my changes tonight, barring any major catastrophe.
your source code slave

 

Offline OldMan

  • 24
    • http://www.lisha.ufsc.br/~tiago
I don't know if windows gcc has the same problem, but in linux, using the newest GCC we must be careful of using the newest autoconf too. Autoconf for gcc 2.96 does make some mistakes when creating the configure file for a gcc 3.2. In special it detects g++ as a cross compiler and makes some strange things at linking.
If brute force does not solve your problem.... you are not using enough!!!

 

Offline WMCoolmon

  • Purveyor of space crack
  • 213
I just tried compiling this with RH8, GCC 3.2...it didn't work:
Quote
cd . && /bin/sh /home/steven/fs2_open/missing --run aclocal-1.7
/home/steven/fs2_open/missing: line 46: aclocal-1.7: command not found
WARNING: `aclocal-1.7' is missing on your system.  You should only need it if
         you modified `acinclude.m4' or `configure.in'.  You might want
         to install the `Automake' and `Perl' packages.  Grab them from
         any GNU archive site.
cd . && \
  /bin/sh /home/steven/fs2_open/missing --run automake-1.7 --gnu  Makefile
/home/steven/fs2_open/missing: line 46: automake-1.7: command not found
WARNING: `automake-1.7' is missing on your system.  You should only need it if
         you modified `Makefile.am', `acinclude.m4' or `configure.in'.
         You might want to install the `Automake' and `Perl' packages.
         Grab them from any GNU archive site.
cd . && /bin/sh /home/steven/fs2_open/missing --run autoconf
configure.in:7: error: possibly undefined macro: AM_INIT_AUTOMAKE
configure.in:111: error: possibly undefined macro: AM_CONDITIONAL
make: *** [configure] Error 1

:confused:
-C

 

Offline OldMan

  • 24
    • http://www.lisha.ufsc.br/~tiago
just try automake --version.

If I am not mistaken RH* comes qith automake 1.6.3

You will need to upgrade it.
If brute force does not solve your problem.... you are not using enough!!!

 

Offline penguin

  • Eudyptes codus
  • 28
  • Still alive.
Linux is still unsupported... there are a lot of hooks that aren't completed.  The only supported gcc platform at the moment is Win32/MinGW.

Although I've tried to make the automake scripts handle ix86-Linux (and theoretically create a usable Makefile), it hasn't been completed.  And I'm running RH 6.2 (gcc 2.95.3), so we're gonna get different results.  You should upgrade your autoconf, automake, and aclocal though... ftp.gnu.org

Any porting help would be appreciated :nod:


WM -- did you try 'make' in the code subdirectory (not the top-level)?  Or was it dying at the ./configure step?
your source code slave

 

Offline WMCoolmon

  • Purveyor of space crack
  • 213
Ah, alrigh. Upgrades are (mostly) good. ;)

I tried to make in the top-level directory. Will that cause problems? I'm still just a relative newbie with Linux. :nervous:

I'm willing to learn, though. :nod:
-C

 

Offline Inquisitor

OldMan will be joining the project as soon as I set him up in CVS, maybe he can help?
No signature.

 

Offline penguin

  • Eudyptes codus
  • 28
  • Still alive.
Well, I suck... haven't gotten around to committing the changes for the movie code, sorry.  Stupid RL.  

Not gonna get a chance tonight either, looks like...  BTW: I HATE SOLARIS :mad: :mad: it's ruining my life.  And don't get me started about Oracle... I'm on call 24/7 and we've been having some, er, "issues" at work; this is what's been holding me back.

And WM - theoretically you should be able to 'make' from the top level dir, but Automake thinks it's smarter than you are, so it tries to do a bunch of other crap... I find it faster and simpler to go to the 'code' subdir and make there.  This is true for both Linux and MinGW.
your source code slave

 

Offline OldMan

  • 24
    • http://www.lisha.ufsc.br/~tiago
Sure.. that is the ideia.. since I wanna finally blow up my windows partition I MUST HELP  make this work on linux :) . Wanna know if there is any work done in linux (not Innuclus ..or something like that.. port).

Must determinate exactly the interface of independent of plataform code with dependent code (still trying to do it.. since I personaly think original FS2 code is a mess at some points)
If brute force does not solve your problem.... you are not using enough!!!