Re: Compiling troubles on linux
Date: 02/16/05

  • Next message: Darren Tucker: "Re: Compiling troubles on linux"
    Date: Wed, 16 Feb 2005 17:03:10 -0500 (EST)

    On Tue, 15 Feb 2005 wrote:

    > Hello,
    > Trying to compile openssh-3.9p1 on Linux with OpenSSL 0.9.7f-dev, built
    > with shared libs.

    Aha. Apparently, the configure script is somewhat broken in that it can't
    seem to use openssl libs if they're not already known to ld. I got
    configure to run by adding a LD_LIBRARY_PATH=/path/to/openssl/lib
    ./configure ... . Then, I had troubles installing since the ssh tools
    didn't have the paths to the openssl libs saved, leading to 'can't find
    this lib and that lib" type errors.


    I fudged around with LD_RUN_PATH=/path/to/openssl/lib make, which worked,
    but I needed a simpler cross-platform option capable of fixing this in the
    configure step.

    My solution?

    # Configure OpenSSH
        echo "Configure OpenSSH"
        cd ${BUILD}/${SD_OPENSSH}
        ${MAKE} distclean > /dev/null 2>&1

        options="--prefix=${PFX_OPENSSH} \
                 --with-ssl-dir=${PFX_OPENSSL} \
                 --without-pam \
                 --without-zlib-version-check \
                 --without-privsep-user \

        # HP-UX automagically includes the runtime link path into shared libs.
        if [ "$1" != "hpux64" -a "$1" != "hpux" ]; then
           options="$options --with-ldflags=\"-Wl,-rpath ${PFX_OPENSSL}/lib\""

        # For some reason, this configure won't expand the $options var if it
        # has --with-ldflags appended, but it does with 'eval'B.
        eval ./configure $options > ${LOG}/config_openssh.log 2>&1

    I also kill the privsep stuff in servconf.c and touch the sshd_config file
    to reflect that. Result.. a simple ssh implementation, that is able to
    utilize openssl shared libs in non-standard locations, without the need
    for LD_LIBRARY_PATH or /etc/ entries.


    Jon Earle
    Software Developer / Network Manager
    Specialising in Open Source Software Solutions

  • Next message: Darren Tucker: "Re: Compiling troubles on linux"