The Ur-Quan Masters Home Page Welcome, Guest. Please login or register.
Did you miss your activation email?
October 13, 2024, 07:44:24 pm
Home Help Search Login Register
News: Celebrating 30 years of Star Control 2 - The Ur-Quan Masters

+  The Ur-Quan Masters Discussion Forum
|-+  The Ur-Quan Masters Re-Release
| |-+  Technical Issues (Moderator: Death 999)
| | |-+  Compiling uqm tools
« previous next »
Pages: [1] Print
Author Topic: Compiling uqm tools  (Read 2226 times)
Death 22
Zebranky food
*
Offline Offline

Posts: 9



View Profile
Compiling uqm tools
« on: December 02, 2007, 11:44:21 pm »

Hi, I'm trying to compile some of the tools in the uqm tree, specifically, the unpkg tool in tools/pkg. I'm not having much luck, however...
I followed the instructions to the book. Installed MinGW, then MSYS (on a virgin Windows, just to be sure). But "make unpkg" first gives me an error about a missing mman.h. OK, I copied that header to my include directory (where is it usually supposed to come from, by the way?)
But then I get the next error message:

unpkg.c:838: error: too many arguments to function 'mkdir'

Line 838 does indeed contain a call to mkdir with 2 arguments.
Now I'm not quite sure what's happening. Tried with gcc 3.4.5 and 4.2.1, but the error persists.

Does anyone know what I'm missing?

Thanks in advance...
Logged
meep-eep
Forum Admin
Enlightened
*****
Offline Offline

Posts: 2847



View Profile
Re: Compiling uqm tools
« Reply #1 on: December 02, 2007, 11:59:01 pm »

Hmm... I don't think anyone ever tried to compile that on Windows.

Anyhow, Windows mkdir() is not POSIX-compatible. Just remove the extra argument, the mode doesn't mean anything to Windows anyhow.

mmap() is going to be a bigger problem. Windows doesn't have it at all (which explains your missing mman.h). You could use Cygwin, which provides a POSIX environment for Windows. Or you could rewrite this code a bit; instead of mapping the file to memory, you allocate a large enough buffer and read the file into it. A more structural solution would be to read the file into memory in parts, but the files this program is intended to work on are small enough to fit into memory entirely.
Logged

“When Juffo-Wup is complete
when at last there is no Void, no Non
when the Creators return
then we can finally rest.”
Novus
Enlightened
*****
Offline Offline

Gender: Male
Posts: 1938


Fot or not?


View Profile
Re: Compiling uqm tools
« Reply #2 on: December 03, 2007, 01:05:21 pm »

You could use Cygwin, which provides a POSIX environment for Windows.
Seems to work correctly under Cygwin.
Logged

RTFM = Read the fine manual.
RTTFAQ = Read the Ur-Quan Masters Technical FAQ.
Death 22
Zebranky food
*
Offline Offline

Posts: 9



View Profile
Re: Compiling uqm tools
« Reply #3 on: December 03, 2007, 06:00:00 pm »

You're right - the compile does work under cygwin! Sadly the extraction doesn't seem to work properly, I just get a bunch of 1K files with hex names. And yes, I did specify "-t pc"....
Oh what the hell. Think I'll see if this is any easier under Linux! Smiley

Thanks.
Logged
Novus
Enlightened
*****
Offline Offline

Gender: Male
Posts: 1938


Fot or not?


View Profile
Re: Compiling uqm tools
« Reply #4 on: December 03, 2007, 06:14:41 pm »

Well, it works the same for me on Cygwin and openSUSE. SC2 resources apparently don't have names, just numbers, so the files are going to be named in hex (working out what the contents are is left as an exercise for the student). Many of them are going to be very small (snippets of text, palettes, that sort of thing).
Logged

RTFM = Read the fine manual.
RTTFAQ = Read the Ur-Quan Masters Technical FAQ.
meep-eep
Forum Admin
Enlightened
*****
Offline Offline

Posts: 2847



View Profile
Re: Compiling uqm tools
« Reply #5 on: December 03, 2007, 08:29:13 pm »

These numbers are the resource identifiers. In the number itself is encoded which type a file is and to what "package" it belongs. See doc/devel/resources for a description.
Logged

“When Juffo-Wup is complete
when at last there is no Void, no Non
when the Creators return
then we can finally rest.”
Pages: [1] Print 
« previous next »
Jump to:  


Login with username, password and session length

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!