WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: What does "configure --prefix ..." set in elf exec.?  (Read 3439 times)

Offline SunBurnt

  • Full Member
  • ***
  • Posts: 102
What does "configure --prefix ..." set in elf exec.?
« on: September 05, 2011, 05:11:08 PM »
I`ve read docs. describing the configure options, but nothing tells what "--prefix" does.
I know it relocates the root path that the compiled exec. uses to find it`s "other files".
# But what does it do to the exec.? I can`t find any info as to exactly what it changes.

I`ve been looking at RPATH docs., and playing with patchelf seeing what can be done.
patchelf patches the RPATH in execs. to dep. libs., and RPATH in libs. to dep. libs.
I`m not sure if it will set an exec`s. path to dep. execs., but I kinda doubt it...

So with no compiling patchelf sets an exec. or lib. path to a dep. lib.

# Can this be done for the exec`s. path to other deps.?

Like "--prefix" does but working with binaries, so no compiling the whole package.

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11049
Re: What does "configure --prefix ..." set in elf exec.?
« Reply #1 on: September 06, 2011, 07:45:02 AM »
It does nothing to the binaries by default. Only in packages where the creators have explicitly made it so does it have an effect.

If the package uses it, you can't likely change it afterwards, as the method of embedding is not standard. Usually it's a define, where to change it you'd need to go hex-editing in per-binary locations, which could break the app.
The only barriers that can stop you are the ones you create yourself.

Offline SunBurnt

  • Full Member
  • ***
  • Posts: 102
Re: What does "configure --prefix ..." set in elf exec.?
« Reply #2 on: September 06, 2011, 05:46:03 PM »
Thank you so much for responding curaga; If possible I`d like to clarify this a bit.

prepath embeds code into the exec., IF the author has written the app. that way.

# Is it common practice to write apps. this way? # Are most apps. configurable?

( I`m sure a clever coder like the author of patchelf could make a utility to do this...)
« Last Edit: September 06, 2011, 05:47:47 PM by SunBurnt »

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11049
Re: What does "configure --prefix ..." set in elf exec.?
« Reply #3 on: September 07, 2011, 10:41:50 AM »
Yes, you got it.

I think it's about 50-50 on which apps embed paths.
The only barriers that can stop you are the ones you create yourself.