вторник, 5 января 2016 г.

Building GnuTLS on OS X

How to build GnuTLS on OS X 10.9+

    In my job I was need to build GnuTLS for OS X. But this task to complicated by the fact that I was need to build package on clean machine without any packets manager system like MacPorts. I thought that this task will be easy for my because during my experience I have build a lot of libraries. But I was wrong because GnuTLS have few non-obvious dependencies. And  I spend whole day or maybe bit more for solving.
    In this article I will try to explain how to build step by step but in pseudocode, so you will need to correct steps for themselves.

From the GnuTLS site you can know that GnuTLS requires 2 libraries libnettle and gmplib. But don't hurry to download them. First you need check availability pkg-config utility. If you don't have you will need to install it. Easiest was to do that - it’s download pkg file from the website: macpkg.sourceforge.net
Then you need check PKG_CONFIG_PATH env variable. Something like that will help you:
    echo $PKG_CONFIG_PATH
    Output of this command should have valid paths. In my case they are not! So I was need next:
    EXPORT pkg_config_path=/usr/lib/pkgconfig:/usr/local/lib/pkgconfig:/usr/X11/lib/pkgconfig
1. Download and build gmp lib before libnettle - first.
2. For some reasons configure of libnettle could found headers and binaries of gmplib. So I was need to export this env’s too:
export CPPFLAGS=“-I/usr/local/include”
export LDFLAGS=“-L/usr/local/lib”
3. download and build libnettle
4. download and build libtasn1 - yes I know that this library marked as optional but in my case I couldn't found how disable it in configure and I was needed to build it first.
5. download and build libhogweed - same as previous
6. download and build GnuTLS! Don't forget to turn off p11-kit. Sure if you don't need it
./configure —without-p11-kit

Enjoy!

Комментариев нет:

Отправить комментарий