installation problems on osx with custom openssl

47 views
Skip to first unread message

jona...@findmeon.com

unread,
Nov 28, 2016, 6:06:07 PM11/28/16
to openresty-en
I have a machine running osx 10.6 and I can't get openresty to compile against a custom OpenSSL version via source.  it keeps generating issues over undefined ssl symbols  in the various modules.  vanilla nginx will compile against openssl source.  I was able to install homebrew openssl and compile against that too, but I can't get it to compile against a "user installed" openssl.

what didn't work:

* installing a versioned openssl

    ./config --prefix=/usr/local/openssl/openssl-1.0.2j --openssldir=/usr/local/openssl/openssl-1.0.2j/config 
    make depend && make && sudo make install

* installing a versioned openssl with the openresty patch applied

    patch -p1 < ~/build/openresty-1.11.2.2/patches/openssl-1.0.2h-sess_set_get_cb_yield.patch
    ./config --prefix=/usr/local/openssl/openssl-1.0.2j --openssldir=/usr/local/openssl/openssl-1.0.2j/config 
    make depend && make && sudo make install

* configuring openresty with openssl source

./configure --with-openssl=../openssl-1.0.2j

* configuring openresty with openssl libraries

./configure --with-cc-opt="-I/usr/local/openssl/openssl-1.0.2j/include" --with-ld-opt="-L/usr/local/openssl/openssl-1.0.2j/lib"

* configuring openresty with source and openssl libraries

./configure --with-openssl=../openssl-1.0.2j --with-cc-opt="-I/usr/local/openssl/openssl-1.0.2j/include" --with-ld-opt="-L/usr/local/openssl/openssl-1.0.2j/lib"

I tried a few other variations, and everything against openssl-1.0.2h too.  nothing seems to work. 

has anyone recently been able to do this from scratch?

i need to avoid using homebrew, as this machine needs versioned installations of openssl and openresty for testing and deployment concerns

jona...@findmeon.com

unread,
Nov 29, 2016, 12:57:00 PM11/29/16
to openresty-en
I finally got this to work, after noticing there was a "wrong architecture" line nestled in 150+ lines of undefined symbol reporting.  There were a few more issues too, but this is how to build if anyone else has problems:

# PCRE
    # grab the newest version of pcre, some modules may not like older ones

cd ~/build
# grab pcre
tar -zxf pcre-8.39.tar.bz2
cd pcre-8.39
./configure --prefix=/usr/local/pcre/pcre-8.39
make
make check
sudo make install

# OPENSSL
    # the trick is this line: `export KERNEL_BITS=64` ; needs to be set in openssl build environment AND for openresty build
    # no other method seems to persist the right build info
cd ~/build
tar -xzvf openssl-1.0.2j.tar.gz
cd ~/build/openssl-1.0.2j
export KERNEL_BITS=64
./config --prefix=/usr/local/openssl/openssl-1.0.2j --openssldir=/usr/local/openssl/openssl-1.0.2j/config 
make depend && make
make test
sudo make install

# OPENRESTY
cd ~/build
tar xzvf openresty-1.11.2.2.tar.gz
cd ~/build/openresty-1.11.2.2
./configure \
--conf-path=/etc/nginx/nginx.conf \
--error-log-path=/var/log/nginx/error.log \
--http-log-path=/var/log/nginx/access.log \
--lock-path=/var/lock/nginx.lock \
--pid-path=/var/run/nginx.pid \
--with-openssl=../openssl-1.0.2j \
--with-pcre=../pcre-8.39
make
make test
sudo make install



Reply all
Reply to author
Forward
0 new messages