On Tue, Sep 16, 2008 at 08:36:03PM +1000, Greg Schafer wrote: > Karel Zak wrote: > I just hit this too. My scenario is different to Robert's but quite > non-standard nonetheless. To cut a long story short: > > - native build > - only static libs from e2fsprogs > - non-standard --prefix > > util-linux-ng-2.13.1 works fine ie: -lblkid -luuid is passed on the link > line and everything is sweet. Yes, but I don't want to add unnecessary (indirect) dependences: $ objdump -x ./mount | grep NEEDED NEEDED libblkid.so.1 NEEDED libc.so.6 this mount(8) binary does not care about selop, selinux, uuid, devmapper. This is very important for distributions where you maintain dependencies between package. Unfortunately, pkg-config does not help: $ pkg-config blkid --libs -L/lib64 -lblkid -luuid -ldevmapper $ pkg-config blkid --libs --static -L/lib64 -lblkid -luuid -ldevmapper -lselinux -lsepol Solution is to fix blkid.pc and define Requires.private (since pkg-config-0.22): $ pkg-config blkid --libs -lblkid $ pkg-config blkid --libs --static -L/lib64 -lblkid -luuid -ldevmapper -lselinux -lsepol Patch: --- /usr/lib64/pkgconfig/blkid.pc.org 2008-09-17 13:24:37.000000000 +0200 +++ /usr/lib64/pkgconfig/blkid.pc 2008-09-17 13:25:24.000000000 +0200 @@ -6,6 +6,7 @@ Name: blkid Description: Block device id library Version: 1.40.8 -Requires: uuid devmapper +Requires: +Requires.private: uuid devmapper Cflags: -I${includedir} -Libs: -L${libdir} -lblkid -ldevmapper +Libs: -L${libdir} -lblkid Note, our previous discussion about so-dep-hell: http://article.gmane.org/gmane.linux.utilities.util-linux-ng/953 and {Require,Library}.private: http://article.gmane.org/gmane.linux.utilities.util-linux-ng/958 > > You needn't to specify all possible dependencies on gcc command > > line... see my previous e-mail. It works. The -lblkid is enough if > > your linker is able to evaluate dependencies and found all .so libs. > > True. But it feels kinda wrong relying on the linker like this. As has been > proven, it doesn't work in all scenarios eg: non-standard prefix. Well, I'm going to add -luuid to BLKID_LIBS, because the blkid library is (probably) always compiled with uuid support. You can: - fix your environment (e.g LD_LIBRARY_PATH=, ...) - or use BLKID_LIBS=... ./configure I have no problem to support non-standard scenarios (see klibc or hurd:-) when the result does not impact to standard scenarios. > I'm happy to work around the issue by using the provided env vars. But I That's correct solution. The env vars are exactly for this purpose. Karel -- Karel Zak <kzak@xxxxxxxxxx> -- To unsubscribe from this list: send the line "unsubscribe util-linux-ng" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html