1.5.0-RC build issues on FreeBSD

Discussion in 'OpenLiteSpeed Bug Reports' started by bluewombat, Jun 25, 2018.

  1. bluewombat

    bluewombat New Member

    I thought I'd give 1.5.0 a go on my new FreeBSD system.
    The build from source instructions for FreeBSD in the Wiki are out of date.
    The package management system is pkg, not pkg_add

    So, I had to do:
    # pkg install security/openssl-devel devel/pcre devel/rcs net/GeoIP dns/udns textproc/expat2

    configure would not find pcre, so (in tcsh) I did
    # setenv LDFLAGS -L/usr/local/lib
    and then configure worked.

    Now, I seem to be stuck, with SSL build issues I don't have a deep enough understanding of.

    Code:
    Making all in http
    c++ -DHAVE_CONFIG_H -I. -I../../src   -I../../openssl/include/ -I../../include -I../../src -I../../ssl/include -I../../src -I../../include -I/usr/local/include -I/usr/local -I/usr -I/usr/pkg  -I/usr/include -I/usr/local/include  -g -O2 -D_GLIBCXX_USE_CXX11_ABI=0 -fstack-protector -MT ntwkiolink.o -MD -MP -MF .deps/ntwkiolink.Tpo -c -o ntwkiolink.o ntwkiolink.cpp
    ntwkiolink.cpp:1526:10: fatal error: 'openssl/ssl_local.h' file not found
    #include <openssl/ssl_local.h>
             ^~~~~~~~~~~~~~~~~~~~~
    1 error generated.
    
    /usr/local/include/openssl/ssl_local.h does not exist, but /usr/local/include/openssl/ssl.h does.
    I tried changing the #include to that, and got:
    Code:
    c++ -DHAVE_CONFIG_H -I. -I../../src   -I../../openssl/include/ -I../../include -I../../src -I../../ssl/include -I../../src -I../../include -I/usr/local/include -I/usr/local -I/usr -I/usr/pkg  -I/usr/include -I/usr/local/include  -g -O2 -D_GLIBCXX_USE_CXX11_ABI=0 -fstack-protector -MT ntwkiolink.o -MD -MP -MF .deps/ntwkiolink.Tpo -c -o ntwkiolink.o ntwkiolink.cpp
    ntwkiolink.cpp:1547:45: error: member access into incomplete type 'SSL' (aka 'ssl_st')
        length = BIO_get_mem_data(m_ssl.getSSL()->s3->handshake_buffer, &p)
                                                ^
    ../../src/sslpp/sslconnection.h:26:16: note: forward declaration of 'ssl_st'
    typedef struct ssl_st SSL;
                   ^
    1 error generated.
    
    # pkg info openssl-devel
    openssl-devel-1.1.0h_2
    Name : openssl-devel
    Version : 1.1.0h_2
    Installed on : Mon Jun 25 02:59:38 2018 UTC

    Ideas?
     
  2. bluewombat

    bluewombat New Member

    SOLVED!

    The key was that in FreeBSD 11.x security/openssl-devel installs OpenSSL v 1.1.x, while security/openssl installs OpenSSL v1.0.2

    OLSWS only builds currently against OpenSSL v1.0.2 so installing the security/openssl-devel simply won't work.

    So, assuming you are starting with a completely fresh FreeBSD installation, here is what to do.

    # pkg install perl5 dialog4ports devel/pcre devel/rcs net/GeoIP dns/udns textproc/expat2
    # /usr/local/bin/geoipupdate.sh
    # cd /usr/ports/security/openssl
    # make install

    By building the standard security/openssl from ports collection, you get libssl.a etc installed in /usr/lib and appropriate things in /usr/include

    # setenv LDFLAGS -L/usr/local/lib
    # ./configure
    Now, you are able to build openlitespeed-1.5.0 except for a small Makefile issue which I could not be bothered fixing properly.

    My workaround was to comment out lines 140-142 of openlitespeed-1.5.0/src/Makefile and to cp libssl.a and libcrypto.a to where the Makefile expected them to be.
    #am__DEPENDENCIES_2 = \
    # ../ssl/libssl.a \
    # ../ssl/libcrypto.a

    ~/openlitespeed-1.5.0 # mkdir ssl
    ~/openlitespeed-1.5.0 # cp /usr/lib/libcrypto.a ssl
    ~/openlitespeed-1.5.0 # cp /usr/lib/libssl.a ssl

    After that you should be able to do:
    ~/openlitespeed-1.5.0 # make && make install
    [....snip....]
    Installation finished, Enjoy!
     
  3. Rob

    Rob New Member

    @bluewombat Thanks for that. The same thing makes it work for version 1.4, too. You should make a port. Or I'll steal this and I'll make a port.
     
  4. bluewombat

    bluewombat New Member

    @Rob No worries.

    Please have my suggestions as a gift (no need to steal) and go forth and make a port.
    I and future generations will thank you!

    regards,

    Danny
     

Share This Page