Re: How to find supporting program files
- From: BGB <cr88192@xxxxxxxxxxx>
- Date: Thu, 16 Dec 2010 01:59:10 -0700
On 12/15/2010 11:54 PM, Mike Austin wrote:
I've silently been watching the "barrier to entry" related messages -
for example, being able to download a seed7 binary without compiling it.
I see each step that a person needs to take to get to the end result as
a barrier to entry. Logically, it's a linear path - step 1, step 2, ...
but emotionally it's more like exponential (oh jeez, one more thing to
do??)
It's unfortunate there's no portable way to get the executable's path,
then use a relative path from there to find supporting files. I haven't
tackled this myself, as my install script only copies to /usr/local/bin.
Once I need supporting files they will need somewhere to live like
/usr/local/lib.
What's everybody's experience on this? I'm thinking:
1) In your binary distribution, provide all files as usual, minus the
source. That means "make install" (with install location options) is
available. Download file, and "sudo make install".
2a) Install a short script (via the installer) that contains the full
path to the executable into /usr/local/bin. Your full executable would
live in /usr/local/lib/language/bin. The compiler/parser would then know
where it lives.
2b) Reference (possibly overriding 2a) an environment variable to find
where it lives. This usually requires the user set the env, since
modifying a user's .profile is not as portable and probably not the best
thing to do (could corrupt it).
I guess as a fallback, the compiler/parser could check a default path. So:
Check argv[0],
Check env["IMPULSE_HOME"],
Use /usr/local/lib/impulse/lib as last resort.
Are there other ways? Possibly a portable library that lets us find
where the app was launched?
checked into RPATH?...
example, gcc commandline option like:
-Wl,rpath="$ORIGIN"
or:
-Wl,rpath="$ORIGIN/../lib"
or similar...
note: it is $$ in makefiles.
OTOH, in Windows, everything in the PATH is searched for DLLs (including also the current directory and image base directory IIRC).
IMO, this is more nifty as then there is no need to jerk off with the RPATH-related compiler options or worrying about having to make a mess installing stuff into system directories...
or such...
.
- References:
- How to find supporting program files
- From: Mike Austin
- How to find supporting program files
- Prev by Date: Upcoming languages
- Next by Date: Re: A website or wiki on language design
- Previous by thread: How to find supporting program files
- Next by thread: Technology
- Index(es):
Relevant Pages
|