Hard Light Productions Forums
Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: penguin on February 19, 2003, 04:04:18 pm
-
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 ;)- http://www.gnu.org/software/autoconf/
- http://www.gnu.org/software/gcc/
- http://www.mingw.org/
-
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.
-
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
-
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.
-
OK, I'll try to merge and commit this weekend.
-
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.- MinGW Version 2.0.0 (http://prdownloads.sourceforge.net/mingw/MinGW-2.0.0-3.exe)
- MSYS Version 1.0.8 (http://prdownloads.sourceforge.net/mingw/MSYS-1.0.8.exe)
- Binutils 2.13.90 (http://prdownloads.sf.net/mingw/binutils-2.13.90-20021006-2.tar.gz)
- W32api 2.2 (http://prdownloads.sf.net/mingw/w32api-2.2.tar.gz)
- MinGW Runtime: mingw-runtime-2.4.tar.gz (http://prdownloads.sf.net/mingw/mingw-runtime-2.4.tar.gz)
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:$ 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:
-
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.
-
Compiling with MSVC now.
-
[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]
-
required DX8 libs are in CVS, so, if he did his job right, we're golden ;)
It compiles and runs, btw.
-
[color=66ff00]
Smashin' :)
[/color]
-
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 (http://www.hard-light.net/forums/index.php/topic,13607.0.html)
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.
-
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.
-
I just tried compiling this with RH8, GCC 3.2...it didn't work:
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:
-
just try automake --version.
If I am not mistaken RH* comes qith automake 1.6.3
You will need to upgrade it.
-
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 (ftp://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?
-
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:
-
OldMan will be joining the project as soon as I set him up in CVS, maybe he can help?
-
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.
-
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)
-
I love solaris :)
Anywho, OldMan is setup. penguin can walk you thru the prep work he did for the linux port a while back, mostly things like renaming files lower case, etc, but, he's the man who started it.
And hopefully, he's got us some new spiffy cross platform movie code :)
-
Just to post my opinion.. I HATE Solaris.. the only two worse things are AIX and Sun OS.. oughh!!!! Specially when running in a 200 Kg Sun Station that makes more noise than a train (and is placed only 3 meters from your work desk)
Already talked to penguim... and someday we will have our ascii text only console version of FS2 !!! With PC speaker sound .. and serial RS232 communication system for multiplayer.
-
Originally posted by OldMan
Already talked to penguim... and someday we will have our ascii text only console version of FS2 !!! With PC speaker sound .. and serial RS232 communication system for multiplayer.
Err did I say that? :nervous: I must be more tired than I thought...
-
Hehe
-
I have tried it also because I haven't the MSVC.
It hasn't worked ::( :
wojta@AMZ /c/fs2_open/fs2_open
$ ./configure
configure: loading site script /etc/config.site
checking for a BSD-compatible install... /bin/install -c
checking whether build environment is sane... yes
checking for gawk... gawk
checking whether make sets $(MAKE)... ./configure: ac_maketemp="make": command ot found
no
checking build system type... i686-pc-mingw32
checking host system type... i686-pc-mingw32
using Win32 defines (for mingw32)
checking for g++... g++
checking for C++ compiler default output... configure: error: C++ compiler cannt create executables
See `config.log' for more details.
and part of config.log where the error is described :
configure:1964: checking for C++ compiler version
configure:1967: g++ --version &5
g++.exe: no input files
configure:1970: $? = 1
configure:1972: g++ -v &5
g++.exe: no input files
configure:1975: $? = 1
configure:1977: g++ -V &5
g++.exe: no input files
configure:1980: $? = 1
configure:2004: checking for C++ compiler default output
configure:2007: g++ -O2 conftest.cc >&5
g++.exe: no input files
configure:2010: $? = 1
configure: failed program was:
| #line 1983 "configure"
| /* confdefs.h. */
|
| #define PACKAGE_NAME "fs2_open"
| #define PACKAGE_TARNAME "fs2_open"
| #define PACKAGE_VERSION "3.5"
| #define PACKAGE_STRING "fs2_open 3.5"
| #define PACKAGE_BUGREPORT ""
| #define NO_CD_CHECK 1
| #define NO_SOFTWARE_RENDERING 1
| #define NDEBUG 1
| /* end confdefs.h. */
|
| int
| main ()
| {
|
| ;
| return 0;
| }
configure:2049: error: C++ compiler cannot create executables :mad:
See `config.log' for more details.
Should I disable a certain part of the code ?
-
OK, I finally got the autoconf to work with DX8, so we can have the movie code included.
Because I'm sick of fighting with Autoconf :mad: I required the dx8 include files and libs to be in a fixed place. When I catch my breath, I'll make it more flexible. But for now:- DX8 include files must be in C:\dx8\include
- DX8 lib files must be in C:\dx8\lib
Also see the note earlier in this thread regarding the libdxguid.a library in /mingw/lib -- rename it to old-libdxguid.a or something so that the DX8 version will be linked instead.
It works for me now... anxiously awaiting feedback :)