Hello,

Quote from "Richard Levitte via RT":
} > > * When linking the libraries, make sure that libssl finds libcrypto
} > > and that they both find all their external dependencies at run time.
} > > This is accomplished by the -R, -rpath or --rpath flags which behave
} > > just like the -L flag. It is not necessary when all libraries can be
} > > found using the default paths. To recap: giving --prefix to config
} > > should automatically add -R${prefix}/lib and giving -L... to config
} > > should automatically generate the same -R...
} > > (Which flag to use depends on which compiler one is using.)

} Isn't there a case when the -L and the -R arguments have different
} arguments?

Yes, in hind sight I see I made a generalization. Normally one tries to
link against libraries that are already installed, in which case the -L
and -R match, but in your case you are linking against libraries that
haven't been installed yet.

} For example, the openssl program is linked against libssl and libcrypto
} in the parent directory, so the linking command includes -L.. .
} However, the -R switch would indicate where the libraries are found by
} default, so adding such a switch should look like this, roughly:
} -R${prefix}/lib, even when we have a -L.. .  Right?

Yes, that is correct.

-L tells the linker where to find the libraries when linking and
-R tells the dynamic run-time linker where to find the libraries when
running the program.

This is also true when trying to dynamically link a library that wants
to dynamically link another library. (E.g. libssl uses libcrypto, so
when creating libssl.so the linker should be told where libcrypto.so
will finally reside when installed.)

To check that everything works the way it should, try installing
openssl in /some/weird/directory and then compiling some other piece
of software, like openssh, against it.

To debug the link paths, use ldd -v [library | executable]. On
Solaris you should also give the flag -s to ldd to see the verbose
search path. I couldn't find a similar flag in the Linux Debian
Unstable ldd. I couldn't find a linker debugger on the OSF1 (Tru64)
machine I have access to and the HP-UX machine I have access to is
down at the moment.

--
        Aleksi Suhonen

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to