[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Compiling Coreutils with LibreSSL (instead of OpenSSL)
From: |
Assaf Gordon |
Subject: |
Compiling Coreutils with LibreSSL (instead of OpenSSL) |
Date: |
Tue, 14 Nov 2017 16:12:52 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 |
Hi,
Just a quick note (to myself and others who try this):
Using "./configure --with-openssl=yes" uses the system's default
libcrypto library.
If one wants to use a non-default library (e.g. LibreSSL installed
in a non-default location), these are possible steps:
Download/Build/Install libreSSL:
git clone https://github.com/libressl-portable/portable.git \
libressl-portable
cd libressl-portable/
./autogen.sh
./configure --prefix /opt/libressl/
make
sudo make install
Build coreutils with the custom library:
export LD_LIBRARY_PATH=/opt/libressl/lib/
cd coreutils-8.28
./configure --with-openssl=yes \
CPPFLAGS=-I/opt/libressl/include/ \
LDFLAGS=-L/opt/libressl/lib
make
An alternative to LD_LIBRARY_PATH on GNU/Linux
is adding /opt/libressl/lib to /etc/ld.so.conf
and rerun 'ldconfig'.
Compiling the 'coreutils' binaries does not actually need to access
to the shared object (LD_LIBRARY_PATH), but as part
of the 'make' process the man pages are generated by running 'md5sum
--help' which will fail if the shared library isn't found.
====
To the best of my understanding, CPPFLAGS/LDFLAGS are needed because
gnulib's gl-openssl.m4 [1] does not accept any external envvars or
checks pkg-config for the location of the library.
It assumes <openssl/md5.h> is available in the default header path,
and libcrypto is available on the default library path.
[1] https://opengrok.housegordon.com/source/xref/gnulib/m4/gl-openssl.m4
====
On systems which use LibreSSL by default using
"./configure --with-openssl=yes" just works.
E.g. On Alpine Linux:
sudo apk add libressl libressl-dev
cd coreutils-8.28
./configure --with-openssl=yes
make
====
regards,
- assaf
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Compiling Coreutils with LibreSSL (instead of OpenSSL),
Assaf Gordon <=