pkgsrc-Users archive

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

pkgsrc vs built-in openssl when using pkg-config to build 3rd party software


I ran into a small issue where 'pkg-config --libs-only-L libssl' was
used to set linking/runtime options for a source-package linking
against libssl, resulting in a binary unable to find

(The package in question was Fossil; I am aware fossil is in pkgsrc,
but I want to use the version from upstream instead.)

Resulting binary can find its .so fine in case openssl from pkgsrc is
not installed, i.e. the .so is in /usr/lib instead of /usr/pkg/lib

After building the binary:

  michai@main:/tmp/ftest/f$ ./fossil
  Shared object "" not found
  michai@main:/tmp/ftest/f$ ldd fossil
         -lssl.1.0.0 => not found
         -lcrypto.1.0.0 => not found
         -lz.1 => /usr/lib/
         -lgcc_s.1 => /usr/lib/
         -lc.12 => /usr/lib/
  michai@main:/tmp/ftest/f$ ls -l /usr/pkg/lib/libssl.*
  -rw-r--r--  1 root  wheel  524452 Apr 10 18:00 /usr/pkg/lib/libssl.a
  lrwxr-xr-x  1 root  wheel      15 Apr 10 18:00
/usr/pkg/lib/ ->
  -r-xr-xr-x  1 root  wheel  403437 Apr 10 18:00 /usr/pkg/lib/
  michai@main:/tmp/ftest/f$ LD_LIBRARY_PATH=/usr/pkg/lib ./fossil
  Usage: ./fossil COMMAND ...

The LDFLAGS for the link are result of 'pkg-config --libs-only-L':

  michai@main:/tmp/ftest/f$ pkg-config --libs-only-L libssl

My question: what is the prefered way to make sure a binary finds its
.so libs? Manpage for 'pkg-config' hints at '--libs-only-L' providing
-R/-rpath options, which it does not in the case of libssl. Should I
use LD_LIBRARY_PATH,, hack the libssl.pc pkg-config file,

Thanks in advance,
Michai Ramakers

Home | Main Index | Thread Index | Old Index