Skip to content

Instantly share code, notes, and snippets.

@nebulak
Last active May 23, 2017 09:39
Show Gist options
  • Save nebulak/2a9f9183b326533d1d41529a5e49dae7 to your computer and use it in GitHub Desktop.
Save nebulak/2a9f9183b326533d1d41529a5e49dae7 to your computer and use it in GitHub Desktop.
Cross compile libunbound & ldns

Cross compiling libunbound & ldns

libunbound

cross compile dependencies

wget https://www.openssl.org/source/openssl-1.0.2k.tar.gz
tar xzvf openssl-1.0.2k.tar.gz
cd openssl-1.0.2k/

sudo mkdir /opt/ssl-1.0.2k-win32
./Configure --prefix=/opt/ssl-1.0.2k-win32 no-asm --cross-compile-prefix=i686-w64-mingw32- -DOPENSSL_NO_CAPIENG mingw
make
sudo make install_sw

Build libExpat

wget https://github.com/libexpat/libexpat/archive/R_2_2_0.tar.gz
tar xzvf R_2_2_0.tar.gz
cd libexpat-R_2_2_0
cd expat
mkdir build
./buildconf.sh
cd ./build
../configure --prefix=/opt/expat-win32 --target=i686-pc-mingw32
make
sudo mkdir /opt/expat-win32
sudo make install

Install tools for unbound compilation

sudo apt-get install byacc flex

Compile Unbound & libUnbound

wget https://unbound.net/downloads/unbound-1.6.2.tar.gz
tar xzvf unbound-1.6.2.tar.gz
cd unbound-1.6.2/
mkdir build/
cd build/
../configure --target=i686-pc-mingw32 --with-ssl=/opt/ssl-1.0.2k-win32 --with-libexpat=/opt/expat-win32
make
sudo mkdir /opt/unbound-win32
make install DESTDIR=/opt/unbound-win32

ldns

wget https://www.nlnetlabs.nl/downloads/ldns/ldns-1.7.0.tar.gz
tar xzvf ldns-1.7.0.tar.gz
cd ldns-1.7.0/
sudo mkdir /opt/ldns-win32
mkdir ./build
cd ./build/
./configure --prefix=/opt/ldns-win32 --with-drill --with-ssl=/opt/ssl-1.0.2k-win32 --target=i686-pc-mingw32 --disable-dane-verify --disable-dane-ta-usage

make
sudo make install
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment