Re: How to find supporting program files



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...

.



Relevant Pages

  • Re: Downloading SuSE: i586? i686? noarch? which?
    ... > download via FTP to a hard drive so that you can then install OFF the hard ... I know compiling the kernal can be a bit of a job so I'm willing to just ...
    (alt.os.linux.suse)
  • Re: Error compiling ruby under AIX 5.3 with GCC during the make phase
    ... Gerardo, ... to download it and install it. ... hundreds of hits but no URL to download, as far as I can see. ... compiling Win32API ...
    (comp.lang.ruby)
  • How to find supporting program files
    ... I've silently been watching the "barrier to entry" related messages - for example, being able to download a seed7 binary without compiling it. ... 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. ... as my install script only copies to /usr/local/bin. ...
    (comp.lang.misc)
  • Re: how to install gcc
    ... >have downloaded samba from the website but while compiling i got an ... >donno how to install it. ... Go to www.sunfreeware.com and download gcc there, ...
    (comp.unix.solaris)
  • Re: WindowsUpdate_80240016 error
    ... They guy has just directed you to download malicious or crapware. ... Update will not install and shows Error Code 80240016 - computer runs forever but nothing happens. ... - but Vista will not allow me to rename the folder even tho I am an Admin ... Stop the Windows Update service ...
    (microsoft.public.windows.vista.general)