The Ur-Quan Masters Home Page Welcome, Guest. Please login or register.
Did you miss your activation email?
October 10, 2024, 04:27:28 am
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 on a Mac
« previous next »
Pages: [1] Print
Author Topic: Compiling on a Mac  (Read 2668 times)
iamnothere900
Zebranky food
*
Offline Offline

Posts: 6



View Profile
Compiling on a Mac
« on: February 03, 2009, 06:07:44 am »

I haven't had any luck with compiling UQM on my G4 Powerbook (OS X 10.4.11) and was hoping someone had some tips.

I downloaded 0.6.2 source from this link ( http://prdownloads.sourceforge.net/sc2/uqm-0.6.2-source.tgz?download ).
I downloaded 0.6.4 source from this page ( http://www.submedia.net/uqm/ ).

I downloaded macosx.zip from here ( https://bugs.uqm.stack.nl/show_bug.cgi?id=1042 ) which is an XCode project file.

Using just the build.sh from the source code file (either one) results in:
Code:
$ ./build.sh uqm                 
'echo -n' capable echo found.
Sed stream editor found.
tr found.
Make found.
build/unix/build.sh: line 1: libmikmod-config: command not found
build/unix/build.sh: line 1: libmikmod-config: command not found
build/unix/build.sh: line 1: libmikmod-config: command not found
GNU C compiler found.
We have a C preprocessor.
We have a C dependency generator.
We have a C compiler.
We have a linker.
We have a Objective-C preprocessor.
We have a Objective-C dependency generator.
We have a Objective-C compiler.
Rez resource compiler (Apple Developer Tools) found.
We have a MacOS X resource compiler (Rez).
Little-endian machine detected.
Simple DirectMedia Layer not found.
$

The first time I used the XCode project file, I got this:
Code:
Building target “The Ur-Quan Masters” of project “uqm” with configuration “Debug - symlink content” — (4 errors)
    cd ~/Desktop/uqm-0.6.4-nic
    /usr/bin/gcc-4.0 -x c -arch ppc -pipe -Wno-trigraphs -fpascal-strings -fasm-blocks -g -O0 -Wno-pointer-sign -DDEBUG -D__MACOSX__ -DHAVE_OPENGL -DGFXMODULE_SDL -DSOUNDMODULE_SDL -DTHREADLIB_SDL -DUSE_INTERNAL_MIKMOD -DNETPLAY=NETPLAY_FULL -DHAVE_JOYSTICK -DHAVE_ZIP=1 -fmessage-length=0 -mtune=G4 -fvisibility=hidden -F~/Desktop/uqm-0.6.4-nic/build/Debug\ -\ symlink\ content -I. -I../.. -I../../src -I../../src/sc2code -I../../src/sc2code/libs -I~/Desktop/uqm-0.6.4-nic/build/Debug\ -\ symlink\ content/include -I~/Desktop/uqm-0.6.4-nic/build/uqm.build/Debug\ -\ symlink\ content/The\ Ur-Quan\ Masters.build/DerivedSources -W -Wall -c ~/Desktop/uqm-0.6.4-nic/../../src/sc2code/libs/graphics/sdl/triscan2x.c -o ~/Desktop/uqm-0.6.4-nic/build/uqm.build/Debug\ -\ symlink\ content/The\ Ur-Quan\ Masters.build/Objects-normal/ppc/triscan2x.o
In file included from ../../src/sc2code/libs/graphics/sdl/sdl_common.h:25,
                 from ~/Desktop/uqm-0.6.4-nic/../../src/sc2code/libs/graphics/sdl/triscan2x.c:25:
/Library/Frameworks/SDL_image.framework/Headers/SDL_image.h:30:17: error: SDL.h: No such file or directory
/Library/Frameworks/SDL_image.framework/Headers/SDL_image.h:31:25: error: SDL_version.h: No such file or directory
/Library/Frameworks/SDL_image.framework/Headers/SDL_image.h:32:24: error: begin_code.h: No such file or directory
/Library/Frameworks/SDL_image.framework/Headers/SDL_image.h:114:24: error: close_code.h: No such file or directory
                 from ~/Desktop/uqm-0.6.4-nic/../../src/sc2code/libs/graphics/sdl/triscan2x.c:25:
In file included from ../../src/sc2code/libs/graphics/sdl/sdl_common.h:25,
/Library/Frameworks/SDL_image.framework/Headers/SDL_image.h:30:17: error: SDL.h: No such file or directory
/Library/Frameworks/SDL_image.framework/Headers/SDL_image.h:31:25: error: SDL_version.h: No such file or directory
/Library/Frameworks/SDL_image.framework/Headers/SDL_image.h:32:24: error: begin_code.h: No such file or directory
/Library/Frameworks/SDL_image.framework/Headers/SDL_image.h:114:24: error: close_code.h: No such file or directory
Build failed (4 errors)

I commented out the 4 lines of code causing errors in SDL_image.h, and files started to compile but then I got this:
Code:
Building target “The Ur-Quan Masters” of project “uqm” with configuration “Debug - symlink content” — (1 error, 12 warnings)
    cd ~/Desktop/uqm-0.6.4-nic
    /usr/bin/gcc-4.0 -x c -arch ppc -pipe -Wno-trigraphs -fpascal-strings -fasm-blocks -g -O0 -Wno-pointer-sign -DDEBUG -D__MACOSX__ -DHAVE_OPENGL -DGFXMODULE_SDL -DSOUNDMODULE_SDL -DTHREADLIB_SDL -DUSE_INTERNAL_MIKMOD -DNETPLAY=NETPLAY_FULL -DHAVE_JOYSTICK -DHAVE_ZIP=1 -fmessage-length=0 -mtune=G4 -fvisibility=hidden -F~/Desktop/uqm-0.6.4-nic/build/Debug\ -\ symlink\ content -I. -I../.. -I../../src -I../../src/sc2code -I../../src/sc2code/libs -I~/Desktop/uqm-0.6.4-nic/build/Debug\ -\ symlink\ content/include -I~/Desktop/uqm-0.6.4-nic/build/uqm.build/Debug\ -\ symlink\ content/The\ Ur-Quan\ Masters.build/DerivedSources -W -Wall -c ~/Desktop/uqm-0.6.4-nic/../../src/sc2code/libs/input/sdl/vcontrol.c -o ~/Desktop/uqm-0.6.4-nic/build/uqm.build/Debug\ -\ symlink\ content/The\ Ur-Quan\ Masters.build/Objects-normal/ppc/vcontrol.o
~/Desktop/uqm-0.6.4-nic/../../src/sc2code/libs/input/sdl/vcontrol.c: In function 'VControl_AddKeyBinding':
~/Desktop/uqm-0.6.4-nic/../../src/sc2code/libs/input/sdl/vcontrol.c:490: warning: comparison of unsigned expression < 0 is always false
~/Desktop/uqm-0.6.4-nic/../../src/sc2code/libs/input/sdl/vcontrol.c:490: warning: comparison between signed and unsigned
~/Desktop/uqm-0.6.4-nic/../../src/sc2code/libs/input/sdl/vcontrol.c: In function 'VControl_RemoveKeyBinding':
~/Desktop/uqm-0.6.4-nic/../../src/sc2code/libs/input/sdl/vcontrol.c:501: warning: comparison of unsigned expression < 0 is always false
~/Desktop/uqm-0.6.4-nic/../../src/sc2code/libs/input/sdl/vcontrol.c:501: warning: comparison between signed and unsigned
~/Desktop/uqm-0.6.4-nic/../../src/sc2code/libs/input/sdl/vcontrol.c: In function 'VControl_ProcessKeyDown':
~/Desktop/uqm-0.6.4-nic/../../src/sc2code/libs/input/sdl/vcontrol.c:739: warning: comparison of unsigned expression < 0 is always false
~/Desktop/uqm-0.6.4-nic/../../src/sc2code/libs/input/sdl/vcontrol.c:739: warning: comparison between signed and unsigned
~/Desktop/uqm-0.6.4-nic/../../src/sc2code/libs/input/sdl/vcontrol.c: In function 'VControl_ProcessKeyUp':
~/Desktop/uqm-0.6.4-nic/../../src/sc2code/libs/input/sdl/vcontrol.c:750: warning: comparison of unsigned expression < 0 is always false
~/Desktop/uqm-0.6.4-nic/../../src/sc2code/libs/input/sdl/vcontrol.c:750: warning: comparison between signed and unsigned
~/Desktop/uqm-0.6.4-nic/../../src/sc2code/libs/input/sdl/vcontrol.c:490: warning: comparison of unsigned expression < 0 is always false
~/Desktop/uqm-0.6.4-nic/../../src/sc2code/libs/input/sdl/vcontrol.c:490: warning: comparison between signed and unsigned
~/Desktop/uqm-0.6.4-nic/../../src/sc2code/libs/input/sdl/vcontrol.c:501: warning: comparison of unsigned expression < 0 is always false
~/Desktop/uqm-0.6.4-nic/../../src/sc2code/libs/input/sdl/vcontrol.c:501: warning: comparison between signed and unsigned
~/Desktop/uqm-0.6.4-nic/../../src/sc2code/libs/input/sdl/vcontrol.c:739: warning: comparison of unsigned expression < 0 is always false
~/Desktop/uqm-0.6.4-nic/../../src/sc2code/libs/input/sdl/vcontrol.c:739: warning: comparison between signed and unsigned
~/Desktop/uqm-0.6.4-nic/../../src/sc2code/libs/input/sdl/vcontrol.c:750: warning: comparison of unsigned expression < 0 is always false
~/Desktop/uqm-0.6.4-nic/../../src/sc2code/libs/input/sdl/vcontrol.c:750: warning: comparison between signed and unsigned
    cd ~/Desktop/uqm-0.6.4-nic
    /usr/bin/gcc-4.0 -x c -arch ppc -pipe -Wno-trigraphs -fpascal-strings -fasm-blocks -g -O0 -Wno-pointer-sign -DDEBUG -D__MACOSX__ -DHAVE_OPENGL -DGFXMODULE_SDL -DSOUNDMODULE_SDL -DTHREADLIB_SDL -DUSE_INTERNAL_MIKMOD -DNETPLAY=NETPLAY_FULL -DHAVE_JOYSTICK -DHAVE_ZIP=1 -fmessage-length=0 -mtune=G4 -fvisibility=hidden -F~/Desktop/uqm-0.6.4-nic/build/Debug\ -\ symlink\ content -I. -I../.. -I../../src -I../../src/sc2code -I../../src/sc2code/libs -I~/Desktop/uqm-0.6.4-nic/build/Debug\ -\ symlink\ content/include -I~/Desktop/uqm-0.6.4-nic/build/uqm.build/Debug\ -\ symlink\ content/The\ Ur-Quan\ Masters.build/DerivedSources -W -Wall -c ~/Desktop/uqm-0.6.4-nic/../../src/sc2code/save.c -o ~/Desktop/uqm-0.6.4-nic/build/uqm.build/Debug\ -\ symlink\ content/The\ Ur-Quan\ Masters.build/Objects-normal/ppc/save.o
~/Desktop/uqm-0.6.4-nic/../../src/sc2code/save.c: In function 'SaveGame':
~/Desktop/uqm-0.6.4-nic/../../src/sc2code/save.c:814: warning: format '%u' expects type 'unsigned int', but argument 4 has type 'long unsigned int'
~/Desktop/uqm-0.6.4-nic/../../src/sc2code/save.c:814: warning: format '%u' expects type 'unsigned int', but argument 4 has type 'long unsigned int'
    cd ~/Desktop/uqm-0.6.4-nic
    /usr/bin/gcc-4.0 -x c -arch ppc -pipe -Wno-trigraphs -fpascal-strings -fasm-blocks -g -O0 -Wno-pointer-sign -DDEBUG -D__MACOSX__ -DHAVE_OPENGL -DGFXMODULE_SDL -DSOUNDMODULE_SDL -DTHREADLIB_SDL -DUSE_INTERNAL_MIKMOD -DNETPLAY=NETPLAY_FULL -DHAVE_JOYSTICK -DHAVE_ZIP=1 -fmessage-length=0 -mtune=G4 -fvisibility=hidden -F~/Desktop/uqm-0.6.4-nic/build/Debug\ -\ symlink\ content -I. -I../.. -I../../src -I../../src/sc2code -I../../src/sc2code/libs -I~/Desktop/uqm-0.6.4-nic/build/Debug\ -\ symlink\ content/include -I~/Desktop/uqm-0.6.4-nic/build/uqm.build/Debug\ -\ symlink\ content/The\ Ur-Quan\ Masters.build/DerivedSources -W -Wall -c ~/Desktop/uqm-0.6.4-nic/../../src/sc2code/libs/log/uqmlog.c -o ~/Desktop/uqm-0.6.4-nic/build/uqm.build/Debug\ -\ symlink\ content/The\ Ur-Quan\ Masters.build/Objects-normal/ppc/uqmlog.o
~/Desktop/uqm-0.6.4-nic/../../src/sc2code/libs/log/uqmlog.c:349: warning: unused parameter 'title'
~/Desktop/uqm-0.6.4-nic/../../src/sc2code/libs/log/uqmlog.c:349: warning: unused parameter 'isError'
~/Desktop/uqm-0.6.4-nic/../../src/sc2code/libs/log/uqmlog.c:349: warning: unused parameter 'msg'
~/Desktop/uqm-0.6.4-nic/../../src/sc2code/libs/log/uqmlog.c:349: warning: unused parameter 'title'
~/Desktop/uqm-0.6.4-nic/../../src/sc2code/libs/log/uqmlog.c:349: warning: unused parameter 'isError'
~/Desktop/uqm-0.6.4-nic/../../src/sc2code/libs/log/uqmlog.c:349: warning: unused parameter 'msg'
    cd ~/Desktop/uqm-0.6.4-nic
    /usr/bin/gcc-4.0 -x c -arch ppc -pipe -Wno-trigraphs -fpascal-strings -fasm-blocks -g -O0 -Wno-pointer-sign -DDEBUG -D__MACOSX__ -DHAVE_OPENGL -DGFXMODULE_SDL -DSOUNDMODULE_SDL -DTHREADLIB_SDL -DUSE_INTERNAL_MIKMOD -DNETPLAY=NETPLAY_FULL -DHAVE_JOYSTICK -DHAVE_ZIP=1 -fmessage-length=0 -mtune=G4 -fvisibility=hidden -F~/Desktop/uqm-0.6.4-nic/build/Debug\ -\ symlink\ content -I. -I../.. -I../../src -I../../src/sc2code -I../../src/sc2code/libs -I~/Desktop/uqm-0.6.4-nic/build/Debug\ -\ symlink\ content/include -I~/Desktop/uqm-0.6.4-nic/build/uqm.build/Debug\ -\ symlink\ content/The\ Ur-Quan\ Masters.build/DerivedSources -W -Wall -c ~/Desktop/uqm-0.6.4-nic/../../src/sc2code/cons_res.c -o ~/Desktop/uqm-0.6.4-nic/build/uqm.build/Debug\ -\ symlink\ content/The\ Ur-Quan\ Masters.build/Objects-normal/ppc/cons_res.o
powerpc-apple-darwin8-gcc-4.0.1: ~/Desktop/uqm-0.6.4-nic/../../src/sc2code/cons_res.c: No such file or directory
powerpc-apple-darwin8-gcc-4.0.1: warning: '-x c' after last input file has no effect
powerpc-apple-darwin8-gcc-4.0.1: no input files
powerpc-apple-darwin8-gcc-4.0.1: no input files
powerpc-apple-darwin8-gcc-4.0.1: no input files
powerpc-apple-darwin8-gcc-4.0.1: no input files
powerpc-apple-darwin8-gcc-4.0.1: no input files
Build failed (1 error, 12 warnings)

So now I'm hoping somebody can point me in the right direction.
Logged
0xDEC0DE
*Many bubbles*
***
Offline Offline

Posts: 175



View Profile WWW
Re: Compiling on a Mac
« Reply #1 on: February 03, 2009, 06:12:52 pm »

Oh dear.

The Xcode project was made against the current mainline tree (SVN), not the last stable release, or my old "unofficial" tree.  This was done in the hopes that they'd commit something that worked against hat they had.  There's been some files added and removed since those old version shipped, which is what Xcode is complaining about.  To fix that, you'll need to find all the red files in Xcode and remove them, as well as adding any "missing" files that the project thinks it needs.

I find Xcode near-useless for the latter task, I usually open the sources in cscope, find what I'm looking for, then go back into Xcode and add the files.  But unless you're familiar with all of those tools, you should probably stick with the old Unix-style build scripts when dealing with the old source trees.

But it also seems to be complaining about your SDL and SDL_image frameworks.  I think the README.macosx file provided with the 0.6.2 sources might steer you in the right direction here (namely, override CFLAGS when building)
Logged

"I’m not a robot like you. I don’t like having disks crammed into me… unless they’re Oreos, and then only in the mouth."  --Fry
iamnothere900
Zebranky food
*
Offline Offline

Posts: 6



View Profile
Re: Compiling on a Mac
« Reply #2 on: February 04, 2009, 06:21:28 am »

First, thank you. I've done some useful things at work in visual basic and windows batch files but I never got beyond hello world type stuff in anything else.

I successfully made it through to linking by adding /Library/Frameworks/SDL.framework/Headers to the project and now it compiles but linking fails:

Code:
Building target “The Ur-Quan Masters” of project “uqm” with configuration “Debug - symlink content” — (1 error)
    cd /Users/ericjohnson/Desktop/UQM/macosx
    /usr/bin/gcc-4.0 -o ~/Desktop/UQM/macosx/build/uqm.build/Debug\ -\ symlink\ content/The\ Ur-Quan\ Masters.build/Objects-normal/ppc/The\ Ur-Quan\ Masters -L~/Desktop/UQM/macosx/build/Debug\ -\ symlink\ content -F~/Desktop/UQM/macosx/build/Debug\ -\ symlink\ content -filelist ~/Desktop/UQM/macosx/build/uqm.build/Debug\ -\ symlink\ content/The\ Ur-Quan\ Masters.build/Objects-normal/ppc/The\ Ur-Quan\ Masters.LinkFileList -framework Cocoa -framework Ogg -framework SDL_image -framework SDL -framework Vorbis -framework OpenGL -arch ppc -Wl,-Y,1455 -lz -lobjc
/usr/bin/ld: Undefined symbols:
_DestroyLegacyVideo
_LoadLegacyVideoInstance
_PlayLegacyVideo
_InstallVideoResType
~/Desktop/UQM/macosx/build/uqm.build/Debug - symlink content/The Ur-Quan Masters.build/Objects-normal/ppc/intro.o reference to undefined _DestroyLegacyVideo
~/Desktop/UQM/macosx/build/uqm.build/Debug - symlink content/The Ur-Quan Masters.build/Objects-normal/ppc/intro.o reference to undefined _LoadLegacyVideoInstance
~/Desktop/UQM/macosx/build/uqm.build/Debug - symlink content/The Ur-Quan Masters.build/Objects-normal/ppc/intro.o reference to undefined _PlayLegacyVideo
~/Desktop/UQM/macosx/build/uqm.build/Debug - symlink content/The Ur-Quan Masters.build/Objects-normal/ppc/resinit.o reference to undefined _InstallVideoResType
collect2: ld returned 1 exit status
/usr/bin/ld: Undefined symbols:
_DestroyLegacyVideo
_LoadLegacyVideoInstance
_PlayLegacyVideo
_InstallVideoResType
~/Desktop/UQM/macosx/build/uqm.build/Debug - symlink content/The Ur-Quan Masters.build/Objects-normal/ppc/intro.o reference to undefined _DestroyLegacyVideo
~/Desktop/UQM/macosx/build/uqm.build/Debug - symlink content/The Ur-Quan Masters.build/Objects-normal/ppc/intro.o reference to undefined _LoadLegacyVideoInstance
~/Desktop/UQM/macosx/build/uqm.build/Debug - symlink content/The Ur-Quan Masters.build/Objects-normal/ppc/intro.o reference to undefined _PlayLegacyVideo
~/Desktop/UQM/macosx/build/uqm.build/Debug - symlink content/The Ur-Quan Masters.build/Objects-normal/ppc/resinit.o reference to undefined _InstallVideoResType
collect2: ld returned 1 exit status
Build failed (1 error)

The four symbols are (defined?) in src/sc2code/libs/vidlib.h and the functions are only called once, by src/sc2code/intro.c.

A little googling got me some beginner-type questions in web forums, usually with confused and contradictory replies. I understand it's some kind of scope problem, but beyond that I'm lost. I did a  clean all then rebuild with no change. I tried commenting out the related lines in vidlib.h and intro.c but kept getting errors.
Logged
iamnothere900
Zebranky food
*
Offline Offline

Posts: 6



View Profile
Re: Compiling on a Mac
« Reply #3 on: February 05, 2009, 03:58:08 am »

I forgot to mention that I started from the latest subversion snapshot, dated 20090104.
Logged
0xDEC0DE
*Many bubbles*
***
Offline Offline

Posts: 175



View Profile WWW
Re: Compiling on a Mac
« Reply #4 on: February 05, 2009, 04:29:45 am »

The project is missing a file.  Add src/sc2code/libs/video/vresins.c to the project and rebuild.
Logged

"I’m not a robot like you. I don’t like having disks crammed into me… unless they’re Oreos, and then only in the mouth."  --Fry
iamnothere900
Zebranky food
*
Offline Offline

Posts: 6



View Profile
Re: Compiling on a Mac
« Reply #5 on: February 06, 2009, 05:10:17 am »

Thank you so much! I got it to work!   Cheesy

I had to add these files:

src/sc2code/libs/video/vresins.c
src/sc2code/libs/video/legacyplayer.c
src/sc2code/libs/video/vidintrn.c

to the XCode project, which then threw an incredible amount of linker errors undefined symbols; apparently I don't have the necessary files to build Universal Binary (x86 and PowerPC) applications. I had to remove the i386 build target and now it finishes building!

(Of course the app immidately fails with an error about copying the default key config, but I'm reading through starcon2.c at the moment. It's kind of exciting to see the log messages in the window then look over and see them in code.)

Yay!
Logged
0xDEC0DE
*Many bubbles*
***
Offline Offline

Posts: 175



View Profile WWW
Re: Compiling on a Mac
« Reply #6 on: February 09, 2009, 10:11:10 pm »

Strange, you should be able to build Universal apps; If I had to guess, I'd venture that one or more of your frameworks (SDL, SDL_image, etc.) is PPC-only, so you can't link.

But that doesn't matter much, since you have a PPC machine.  Not a lot of point in buildin for target platforms you don't have if you're not planning on distributing your results to others.

I think the error with the key config is an older one.  Delete and/or move your ~/.uqm directory aside, it should fix itself.
Logged

"I’m not a robot like you. I don’t like having disks crammed into me… unless they’re Oreos, and then only in the mouth."  --Fry
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!