Re: Build OpenSSH w/ static Lib

From: Darren Tucker (dtucker_at_zip.com.au)
Date: 10/28/04


Date: Thu, 28 Oct 2004 18:12:29 +1000
To: Asif Iqbal <iqbala-secureshell@qwestip.net>

Asif Iqbal wrote:
> I am in the process of building OpenSSH 3.9p1 on Solaris 9. [...]
> How do I surely make OpenSSH with static SSL,Zlib and other required
> libraries?

It you want to build the entire thing statically, it's just a matter of
adding the "static" flag for your compiler (for gcc that's "-static",
other compilers will vary). This is probably not a good idea since it's
not a supported ABI on Solaris and is pretty much guaranteed to break at
some point.

If you just want to statically link OpenSSL and zlib then basically you
just need to make sure that the linker finds static libraries first.

One way to do this would be to create a directory containing only the
static libraries and tell the linker to look there first. Something
like this ought to work (untested):

mkdir /usr/local/staticlib
ln -s /usr/local/ssl/lib/libcrypto.a /usr/local/staticlib/libcrypto.a
ln -s /usr/local/lib/libz.a /usr/local/static/lib/libz.a

cd openssh-3.9p1
./configure --with-ldflags=-L/usr/local/staticlib \
    --with-cppflags="-I/usr/local/include -I/usr/local/ssl/include"
make

-- 
Darren Tucker (dtucker at zip.com.au)
GPG key 8FF4FA69 / D9A3 86E9 7EEE AF4B B2D4  37C9 C982 80C7 8FF4 FA69
     Good judgement comes with experience. Unfortunately, the experience
usually comes from bad judgement.


Relevant Pages

  • Re: Mergemaster issues in 5.4
    ... Please note that i dont remember if something was set for OpenSSH. ... NO_ACPI= true # do not build acpiconfand related programs ... Based on your error message in your first e-mail I think it's ...
    (freebsd-current)
  • Re: Package Managers
    ... try to update packages and thinigs get moved and libraries get left behind, ... libraries with identical names. ... Hey, speaking of OpenSSH: you build it on one box, copy the built tarball ... over to another box, and install it there. ...
    (linux.redhat.install)
  • Re: Package Managers
    ... try to update packages and thinigs get moved and libraries get left behind, ... libraries with identical names. ... Hey, speaking of OpenSSH: you build it on one box, copy the built tarball ... over to another box, and install it there. ...
    (comp.os.linux.misc)
  • Re: Unable to build HEAD
    ... Slightly revised and augmented patch is in: ... OpenSSH from Ports. ... some hooks to link to the needed libraries in $. ...
    (freebsd-current)
  • Re: Bug in Kerberos support for openssh.
    ... The OpenSSH code has been tested with GSSAPI ... Kerberos GSSAPI library at all (the Kerberos GSSAPI library from the ... allowing multiple different GSSAPI libraries to be used by the one ...
    (comp.protocols.kerberos)