[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Accepted sdl-image1.2 1.2.2-1 (i386 source)

>> Jérôme Marant <marant.logatique@fr.thalesgroup.com> writes:

 > On Thu, Jul 25, 2002 at 01:26:23PM +0200, Marcelo E. Magallon wrote:
 > >  For the maintainers of the above mentioned packages, it'd be
 > >  worthwhile figuring out why these packages depend on libpng2.  They
 > >  shouldn't.
 >   Speaking about libsdl-ocaml, should it build-depend on libpng-dev
 >   or libpng3-dev?

 It should build depend on libsdl-image1.2-dev and let that package
 state what it wants to have.

 In general it looks like this:

 Package: libfoo-dev
 Build-Depends: libpng-dev
 Depends: libpng-dev

 Package: libbar-dev
 Build-Depends: libfoo-dev
 Depends: libfoo-dev

 Package: myprogram
 Build-Depends: libbar-dev

 Programs linking against libbar, should do it like this:

 $ cc -o myprogram myprogram.o -lbar

 and *not* like either of:

 $ cc -o myprogram myprogram.o -lbar -lfoo
 $ cc -o myprogram myprogram.o -lbar -lfoo -lpng

 the library libbar has a dependency on libfoo which in turn has a
 dependency on libpng.  Your program only cares about libbar, not libfoo
 and libpng.

 Now, *if* your program *does* care about libfoo, that is, it uses
 functions from libfoo directly (and not via libbar), *then* it should
 include libfoo in the link line.  (This is the reason why I said
 "figure out why your library depends on libpng2", there might be a
 valid reason for that)

 This, of course, depends on libfoo declaring its depencencies.  If
 libfoo is linked like this:

 $ cc -o libfoo.so -Wl,-soname,libfoo.so -shared foo.o

 instead of:

 $ cc -o libfoo.so -Wl,-soname,libfoo.so -shared foo.o -lpng

 then /of course/ you are going to get an error from either the dynamic
 linker or the linker stating that png_* is undefined.

 On Debian we tend to get this right, for example, on Debian it's
 possible to write:

 $ cc -o myglutprogram myglutprogram.o -lglut -lGL

 and have it work without having to specify -lX11 -lXext -lXi -lXmu -lm
 and something else I forget right now.  glut is called a wrapper for a

 Last but not least, this is /extremely/ Linux specific behaviour (and
 is valid in the context of dynamic linking).  A lot of other linkers
 are amazingly brain dead in this respect.  Out of memory, the Solaris
 linker gets things right, too.


To UNSUBSCRIBE, email to debian-devel-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

Reply to: