Project

General

Profile

Bug #3834

ext/openssl fails to build in certain scenarios due to misordered pkg-config check

Added by erikh (Erik Hollensbe) about 10 years ago. Updated over 9 years ago.

Status:
Closed
Priority:
Normal
Target version:
ruby -v:
HEAD
Backport:
[ruby-core:32406]

Description

=begin
If mkmf via ext/openssl/extconf.rb is allowed to search for both headers and libs before consulting pkg-config, multiple installations of openssl will cause trouble during build time.

This is evident on my OS X 10.6 system with macports, gcc 4.2.1 from macports, openssl 1.0.0a from macports, and openssl 0.9.x provided by OS X. The problem appears at a glance is that it will locate the 1.0 headers first, the 0.9 libs first, and then prepare the conftest programs with improper ldflags based on its findings.

It's entirely probable there's a deeper autoconf, rbconfig, mkmf, or compiler issue that I am missing, but the solution I found is in the attached patch, which is to run pkg_config first, and in the event it fails, fall back to the default header / lib search that was previously in place. I think this will work for situations where pkg-config isn't available for openssl, but I was unable to test that case.
=end


Files

ssl_compile_fix.patch.gz (426 Bytes) ssl_compile_fix.patch.gz erikh (Erik Hollensbe), 09/16/2010 05:22 AM

Also available in: Atom PDF