Skip to content

Commit

Permalink
Merge pull request #2452 from rbenv/openssl-lib64
Browse files Browse the repository at this point in the history
Fix linking to vendored OpenSSL on 64-bit systems
  • Loading branch information
mislav authored Oct 17, 2024
2 parents 572dd65 + 14d3185 commit a230995
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions bin/ruby-build
Original file line number Diff line number Diff line change
Expand Up @@ -1209,21 +1209,21 @@ build_package_openssl() {
# Tell Ruby to use this openssl for its extension.
package_option ruby configure --with-openssl-dir="$OPENSSL_PREFIX_PATH"

# Make sure pkg-config finds our build first.
export PKG_CONFIG_PATH="${OPENSSL_PREFIX_PATH}/lib/pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}"

local nokerberos
[[ "$1" != openssl-1.0.* ]] || nokerberos=1

# Compile a shared lib with zlib dynamically linked.
package_option openssl configure --openssldir="$OPENSSLDIR" zlib-dynamic no-ssl3 shared ${nokerberos:+no-ssl2 no-krb5}
package_option openssl configure --openssldir="$OPENSSLDIR" --libdir="lib" zlib-dynamic no-ssl3 shared ${nokerberos:+no-ssl2 no-krb5}

# Skip building OpenSSL docs, which is slow.
local make_target="install_sw install_ssldirs"
[[ "$1" != openssl-1.0.* ]] || make_target="install_sw" # OpenSSL 1.0 does not have `install_ssldirs`

OPENSSL_CONFIGURE="${OPENSSL_CONFIGURE:-./config}" MAKE_INSTALL_TARGET="$make_target" build_package_standard "$@"

# Make sure pkg-config finds the new OpenSSL installation.
export PKG_CONFIG_PATH="${OPENSSL_PREFIX_PATH}/lib/pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}"

local pem_file="$OPENSSLDIR/cert.pem"
if is_mac; then
# Extract root certs from the system keychain in .pem format.
Expand Down
4 changes: 2 additions & 2 deletions test/build.bats
Original file line number Diff line number Diff line change
Expand Up @@ -397,8 +397,8 @@ DEF
unstub make

assert_build_log <<OUT
openssl-1.1.1w: [--prefix=${INSTALL_ROOT}/openssl,--openssldir=${INSTALL_ROOT}/openssl/ssl,zlib-dynamic,no-ssl3,shared] PKG_CONFIG_PATH=${TMP}/install/openssl/lib/pkgconfig
PKG_CONFIG_PATH=${TMP}/install/openssl/lib/pkgconfig make -j 2
openssl-1.1.1w: [--prefix=${INSTALL_ROOT}/openssl,--openssldir=${INSTALL_ROOT}/openssl/ssl,--libdir=lib,zlib-dynamic,no-ssl3,shared]
make -j 2
make install_sw install_ssldirs
ruby-3.2.0: [--prefix=$INSTALL_ROOT,--with-openssl-dir=$INSTALL_ROOT/openssl,--with-ext=openssl,psych,+] PKG_CONFIG_PATH=${TMP}/install/openssl/lib/pkgconfig
PKG_CONFIG_PATH=${TMP}/install/openssl/lib/pkgconfig make -j 2
Expand Down

0 comments on commit a230995

Please sign in to comment.