xref: /6.0.3/tlm/deps/packages/erlang/erlang_unix.sh (revision 1c87a21d)
1#!/bin/bash -ex
2
3INSTALL_DIR=$1
4PLATFORM=$2
5CBDEPS_OPENSSL_DIR=$3
6
7case "$PLATFORM" in
8    debian9|fedora26)
9        # We need to do a private build of OpenSSL as the version
10        # on debian 9 is too new for Erlang R16B03-1. Use our
11        # vendored 1.0.2k source.
12        echo .........................
13        echo BUILDING OPENSSL 1.0.2k
14        echo .........................
15        OPENSSL_DIR=`pwd`/openssl-1.0.2k/install
16        mkdir -p $OPENSSL_DIR
17        (
18            cd openssl-1.0.2k
19            git clone -b OpenSSL_1_0_2k --depth 1 git://github.com/couchbasedeps/openssl
20            cd openssl
21            # OpenSSL's config script uses RELEASE to override the value
22            # of uname -r, which breaks things when this script runs as
23            # part of the cbdeps-platform-build Jenkins job. So, unset it.
24            unset RELEASE
25            ./config --prefix=$OPENSSL_DIR \
26                shared no-comp no-ssl2 no-ssl3
27            make depend
28            make # parallel build might fail
29            make install
30        )
31        OPENSSL_FLAGS="--disable-dynamic-ssl-lib --with-ssl=$OPENSSL_DIR"
32        ;;
33    macosx)
34        OPENSSL_FLAGS="--disable-dynamic-ssl-lib --with-ssl=$CBDEPS_OPENSSL_DIR"
35        ;;
36    *)
37        OPENSSL_FLAGS="--with-ssl"
38        ;;
39esac
40
41./otp_build autoconf
42touch ./lib/debugger/SKIP \
43      ./lib/megaco/SKIP \
44      ./lib/observer/SKIP \
45      ./lib/wx/SKIP
46./configure --prefix="$INSTALL_DIR" \
47      --enable-smp-support \
48      --disable-hipe \
49      --disable-fp-exceptions \
50      $OPENSSL_FLAGS \
51      CFLAGS="-fno-strict-aliasing -O3 -ggdb3 -DOPENSSL_NO_EC=1"
52
53make -j4
54
55make install
56