Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411468 Posts in 69368 Topics- by 58422 Members - Latest Member: daffodil_dev

April 23, 2024, 01:29:38 AM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperTechnical (Moderator: ThemsAllTook)Allegro and OSX and packages and blah blah blah
Pages: [1]
Print
Author Topic: Allegro and OSX and packages and blah blah blah  (Read 2374 times)
increpare
Guest
« on: August 14, 2008, 11:11:56 AM »

I've given up trying to get Allegro working in X-Code.  Does anyone here know about how to manually go about making an application package so that I'll be able to distribute it? (in that, I'm doing all of my coding and testing on mac, but I compile using a home-made make-file, which gives a binary executable, which isn't distributable because it doesn't include any of the necessary libraries, so I end up only ever distributing windows versions of my apps, which is just stupid).  I imagine it involves copying some library binaries to some subdirectory of the .app file, but I don't really know...

(I've tried getting Allegro to work with XCode many, many times, and always fail Cry  )
Logged
Ivan
Owl Country
Level 10
*


alright, let's see what we can see


View Profile
« Reply #1 on: August 14, 2008, 11:57:12 AM »

I've never done this with a Makefile, but even in Xcode I have to manually link stuff alot of the time. Basically you put your dylibs or whatever into a subfolder of the .app and then make sure that the link paths in your app point to that relative folder and not an absolute path on your drive. There are a couple of tools you can try using. one is "otool", which will show you the paths for the linked stuff in your app. I think it's like
Code:
otool -L appfile
Then you can use "install_name_tool" to change the paths to relative ones. The syntax for that is
Code:
install_name_tool -change oldAbsolutePath newRelativePath appfile


You dont need to do that for any of the system Frameworks because they will be present on the target machine.

Now, this might not help you cause im not sure if manually running gcc does things differently from teh way Xcode calls it, but maybe it will help.
« Last Edit: August 14, 2008, 12:01:26 PM by toastie » Logged

http://polycode.org/ - Free, cross-platform, open-source engine.
increpare
Guest
« Reply #2 on: August 15, 2008, 05:34:10 AM »

Thanks for that toastie.  Not a very appealing prospect to me, but I'll give it a go with my next release. 

Also: I finally got the allegro template working with xcode.   This is good, though maybe not earth-shattering.

A further question, toastie: do you automate this linking usually with script files, or something in xcode, or do you do everything by hand for every compile?
Logged
Ivan
Owl Country
Level 10
*


alright, let's see what we can see


View Profile
« Reply #3 on: August 15, 2008, 06:08:00 AM »

Yeah in Xcode, you can setup a script to be part of the build process.
Logged

http://polycode.org/ - Free, cross-platform, open-source engine.
increpare
Guest
« Reply #4 on: August 15, 2008, 07:30:56 AM »

Yeah in Xcode, you can setup a script to be part of the build process.
Might I ask what one of your scripts would like?

Also, do you add a copy build phase as well to copy in various dynamic libraries?

(I'm really trying to get a handle on this and get it out of the way, so I can stop worrying about distribution and get back to programming Smiley ).
Logged
Ivan
Owl Country
Level 10
*


alright, let's see what we can see


View Profile
« Reply #5 on: August 15, 2008, 10:22:57 AM »

Usually, I add a Run Script Build Phase call install_name_tool there. To copy frameworks into the .app package, you add the stuff into "Copy frameworks into .app bundle" under the build target dropdown.

There are some predefined variables you can use, so an example line in my script, to copy in Box2D (which gets linked as being in the same path as the executable by default) is.

Gaaahh... The forums wont let me post some part of this line cause of some weird spam filter I imagine. I put it in a text file here:

http://www.ivansafrin.com/stupidforums.txt
« Last Edit: August 15, 2008, 10:26:09 AM by toastie » Logged

http://polycode.org/ - Free, cross-platform, open-source engine.
increpare
Guest
« Reply #6 on: August 16, 2008, 01:49:20 PM »

Oh gosh.  I think...I think I've done it.  I think I've gotten it working (hard to check given that it works anyway, but I might hop on IRC and ask somebody to check it out some time).  I just had to add the copy build phase.  Wheeeeeeeeeee

edit: it seems to work  Grin Grin Grin Grin Grin Grin Grin Grin Grin Grin Grin Grin Grin

Thanks toastie!
« Last Edit: August 16, 2008, 06:26:24 PM by increpare » Logged
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic