LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux From Scratch (https://www.linuxquestions.org/questions/linux-from-scratch-13/)
-   -   Compiling and linking question (https://www.linuxquestions.org/questions/linux-from-scratch-13/compiling-and-linking-question-4175543165/)

GameCodingNinja 05-20-2015 04:09 PM

Compiling and linking question
 
To my understanding, when you compile a package, it may link to other packages already installed. I'm not sure what this linking means other then the package being compiled knows this other package is there and now expects it to be there when it runs.

The main question is, say I compile packageB. PackageB sees packageA that's already installed. Now I need to recompile packageA. Do I also need to recompile pacageB because packageA has changed?

Thanks!

Keith Hedger 05-20-2015 05:11 PM

it depends on the changes to the package you are linked against, usually a minor revision change will not cause a problem, if there is a major version change then you may have to recompile packages that are linked against the one you are updating, if you need to do this it will be in the README or CHANGELOG files, you may be lucky that the part of the library you need to use has not changed or if it has changed too much or gone away altogether the app linked sgainst the library may just segfault with no warning.

The moral of this is read the documentation and if in doubt 'suck it and see'.

hendrickxm 05-21-2015 01:47 AM

Quote:

Originally Posted by GameCodingNinja (Post 5365206)
The main question is, say I compile packageB. PackageB sees packageA that's already installed. Now I need to recompile packageA. Do I also need to recompile pacageB because packageA has changed?

Thanks!

In that case it is best to first upgrade A before recompiling/upgrading package B.

GameCodingNinja 05-21-2015 02:12 PM

Is there a simple way to know what packages are linked to the package you want to replace with a newer version? I can see how this can get out of hand quickly because these other packages may be linked into other packages as well.

Keith Hedger 05-21-2015 02:37 PM

Quote:

Originally Posted by GameCodingNinja (Post 5365676)
Is there a simple way to know what packages are linked to the package you want to replace with a newer version? I can see how this can get out of hand quickly because these other packages may be linked into other packages as well.

If you want simple and for the OS to do it all for you use ubuntu ;)

Seriously one of the main drawbacks of LFS is no dependency checking, but then again the system can't update anything by itself ( unlike the aforementioned 'Linux for dummies' distro ), so if you are going to update a library etc its up to you to make sure it doesn't break anything and to update anything that you need to, with (B)LFS you are the boss!

hendrickxm 05-21-2015 04:22 PM

What you could do is use a dependency tree.
Check for each package what it requires according to the book and what you installed of the recommended stuff.
A lot of work and sometimes some packages get new dependencies or new packages arise.

GameCodingNinja 05-22-2015 04:06 PM

Thanks for all the info guys! I really appreciate it.


All times are GMT -5. The time now is 03:56 PM.