From: Michal 'hramrach' Suchanek Date: 2004-10-07T17:32:37+09:00 Subject: Re: compiling/installing ruby in a nonstandard directory On Thu, Oct 07, 2004 at 02:00:36PM +0900, Mark Hubbart wrote: > Hi all, > > I've been intermittently working on a build/packaging script that will > make Mac Installer packages of the ruby distribution. I need to > include, at minimum, readline support, and distribute the readline > binaries along with it. I'm not a C programmer; I've compiled a lot of > software, but I still don't claim to know what I'm doing :) > > To make this project easier, and so I don't have to back up my > /usr/local dir while I'm building, I've been trying to build it and > install ruby (and readline) in non-standard directories; then I can > package up the directories for installation (I think). But it isn't > that easy... It seems impossible to get ruby extensions to compile > using the libraries that are installed in the non-standard locations. Ruby currently (as of 1.8.2preview2) does not support this, see my patch to add LDFLAGS support. This should enable installing ruby and the libraries it depends in into an arbitrary directory. But you could not move it elswhere because it would break. > > Since I'm not convinced I'm going about this the right way, I'll just > ask: What is the best way to compile several dependent software > projects, without having to install them in their final destination? On OS X there is linker support for bundling software in a directory (like Ruby.app) with its libraries. I beleive it has something to do with the @executable_path stuff because mozilla uses that too but I did not really try to use that myself. Looking at my Firefox installation it seems @executable_path expands to the directory where the binary is installed. I am not sure this is what you want. This makes your package "relocatable" in the sense that you can put the directory in which it resides anywhere on the disk, but you would have to install all binary extensions and programs using libruby in there too. I also looked at the linker man page but it does not seem very helpful Perhaps the Apple's developer documentation would be better. Thanks Michal Suchanek