project-navigation
Personal tools

Author Topic: Can't create PPC application bundle.  (Read 1368 times)

Offline virag0

  • Rookie
  • ***
  • Posts: 48
    • View Profile
Can't create PPC application bundle.
« on: August 11, 2011, 03:22:28 pm »
OK, I am really out of my depth now.
I have got the game 100% working on my G5 PPC 2.3DP (PCIe) with 10.5.8 as you all know by now.
I can probably leave it up to you guys to figure out the best logic for the save game byteswap on PPC
systems. 

My problem is now more annoying and a showstopper for a release of a finished binary.
As mentioned, game is running great - sound, GL graphics (within limitations of the device) and so on.
But only from the command line, sourcing the shared objects in /opt/local/lib.

I want to create an application bundle so I can share this now, but I have a suspicious problem.
When I run the following make, you can see that the SDL_mixer shared object is not being
correctly imported into the bundle:

Code: [Select]
[eros:~/ufoai/ufoai-2.3.1-source] root# make create-dmg-ufoai
find: base/maps: No such file or directory
find: base/models: No such file or directory
find: base/models: No such file or directory
find: base/models: No such file or directory
find: base/models: No such file or directory
Installing contrib/installer/mac/UFOAI.app/Contents/Libraries/libFLAC.8.dylib...done
Installing contrib/installer/mac/UFOAI.app/Contents/Libraries/libtiff.3.dylib...done
Installing contrib/installer/mac/UFOAI.app/Contents/Libraries/libcrypto.1.0.0.dylib...done
Installing contrib/installer/mac/UFOAI.app/Contents/Libraries/libogg.0.dylib...done
Installing contrib/installer/mac/UFOAI.app/Contents/Libraries/libsmpeg-0.4.0.dylib...done
Installing contrib/installer/mac/UFOAI.app/Contents/Libraries/libjpeg.8.dylib...done
Installing contrib/installer/mac/UFOAI.app/Contents/Libraries/libcurl.4.dylib...done
Installing contrib/installer/mac/UFOAI.app/Contents/Libraries/libfreetype.6.dylib...done
Installing contrib/installer/mac/UFOAI.app/Contents/Libraries/libSDL_ttf-2.0.0.dylib...done
Installing contrib/installer/mac/UFOAI.app/Contents/Libraries/libz.1.dylib...done
Installing contrib/installer/mac/UFOAI.app/Contents/Libraries/libbz2.1.0.dylib...done
Installing contrib/installer/mac/UFOAI.app/Contents/Libraries/libSDL_image-1.2.0.dylib...done
Installing contrib/installer/mac/UFOAI.app/Contents/Libraries/libtheora.0.dylib...done
Installing contrib/installer/mac/UFOAI.app/Contents/Libraries/libpng14.14.dylib...done
Installing contrib/installer/mac/UFOAI.app/Contents/Libraries/libidn.11.dylib...done
Installing contrib/installer/mac/UFOAI.app/Contents/Libraries/libSDL_mixer-1.2.0.dylib...install_name_tool: changing install names can't be redone for: contrib/installer/mac/UFOAI.app/Contents/Libraries/libSDL_mixer-1.2.0.dylib (for architecture ppc7400) because larger updated load commands do not fit (the program must be relinked)
done
Installing contrib/installer/mac/UFOAI.app/Contents/Libraries/libSDL-1.2.0.dylib...done
Installing contrib/installer/mac/UFOAI.app/Contents/Libraries/libiconv.2.dylib...done
Installing contrib/installer/mac/UFOAI.app/Contents/Libraries/libvorbisfile.3.dylib...done
Installing contrib/installer/mac/UFOAI.app/Contents/Libraries/libvorbis.0.dylib...done
Installing contrib/installer/mac/UFOAI.app/Contents/Libraries/libintl.8.dylib...done
Installing contrib/installer/mac/UFOAI.app/Contents/Libraries/libmikmod.3.dylib...done
Installing contrib/installer/mac/UFOAI.app/Contents/Libraries/libssl.1.0.0.dylib...done
Finalizing ufo...
Finalizing ufoded...
Finalizing ufo2map...
done
sed: contrib/installer/mac/UFOAI.app/Contents/Info.plist.in: No such file or directory
make: *** [updateversion-ufoai] Error 1

To fix this, I did some googling about and came across a reference to "-headerpad_max_install_names".
So I added this to the linker directives, sprinkling it about in an attempt to get the linker to pick up on my wishes:

Code: [Select]
* [MOD] ... linking -rdynamic (-headerpad_max_install_names -lz  -ljpeg  -L/opt/local/lib -lpng14    -framework SDL  -framework SDL_image -framework SDL)
CFLAGS
-----------------------
-I/opt/local/include -F/opt/local/Library/Frameworks -D_BSD_SOURCE -D_XOPEN_SOURCE -DSHARED_EXT="dylib" -DHAVE_CONFIG_H -DUSE_SIGNALS=0 -Wall -pipe -Winline -Wcast-qual -Wcast-align -Wdeclaration-after-statement -Wmissing-prototypes -Wmissing-declarations -std=c99 -ggdb -DNDEBUG -ffast-math -funroll-loops -D_FORTIFY_SOURCE=2 -O2 -fomit-frame-pointer -fexpensive-optimizations -O2
-I/opt/local/include/libpng14 -I/opt/local/Library/Frameworks/SDL.framework/Headers -I/opt/local/Library/Frameworks/SDL_image.framework/Headers -I/opt/local/Library/Frameworks/SDL_mixer.framework/Headers -I/opt/local/Library/Frameworks/SDL_ttf.framework/Headers -I/opt/local/include -I/opt/local/include -DCOMPILE_UFO -I/opt/local/Library/Frameworks/SDL.framework/Headers
-Isrc/tools/radiant/libs -Isrc/tools/radiant/include

LDFLAGS
-----------------------
-headerpad_max_install_names -L/opt/local/lib -F/opt/local/Library/Frameworks -framework IOKit -framework Foundation -framework Cocoa -headerpad_max_install_names
-headerpad_max_install_names -L/opt/local/lib -lvorbis -lm -logg -lz -L/opt/local/lib -lcurl -L/opt/local/lib -L/opt/local/lib -L/opt/local/lib -lidn -lssl -lcrypto -lssl -lcrypto -lz -lz -ljpeg -L/opt/local/lib -lpng14 -framework SDL -framework SDL_image -framework OpenGL -framework SDL_mixer -framework SDL_ttf -logg -lxvidcore -L/opt/local/lib -ltheora -logg -lintl -framework SDL
-headerpad_max_install_names -lgthread-2.0 -lvorbisfile -lvorbis -logg


But repackaging still throws the same error.

So I recompiled SDL_mixer, with (I think) the the same flag invoked in the Portfile for it:

Code: [Select]
configure.env LDFLAGS="-headerpad_max_install_names"

and adding the same to the supplied Makefile fragment.

So, that didn't work, either.

Please tell me what I should do next, to complete what is ostensibly a very simple step. 

If I try to run the UFOAI.app bundle that is generated, it does not work, but hangs.  If I run the unbundled app from the
shell, it works fine, so it is something to do with this step. 


As mentioned I am a Solaris admin, so I know a lot about packaging, but am a total newbie on OSX ;)


rachel



Offline virag0

  • Rookie
  • ***
  • Posts: 48
    • View Profile
Re: Can't create PPC application bundle.
« Reply #1 on: August 11, 2011, 05:09:58 pm »
Ok, after a bit of hacking of the libsdl_mixer makefile, I was able to produce a set of binaries
that are entirely relocatable, therefore I now have a packaged PPC bundle to upload somewhere.

Last time, I used google docs, but that appears flawed now for some reason.
I have also deleted the 2.3.0 dmg I released up there.

Please tell me a good place (free) to upload this package?

I am certain it will work at least on NVIDIA G5 systems with no problems and
provide a stable, running game within its existing limitations!

It looks like it is slowly uploading, so I will post the URL when it is available.....


rachel