Issue #10099 has been reported by Iain Barnett.

----------------------------------------
Bug #10099: Compiling Ruby 2.1.2 with OpenSSL "recipe for target 'openssl_missing.o' failed"
https://bugs.ruby-lang.org/issues/10099

* Author: Iain Barnett
* Status: Open
* Priority: Normal
* Assignee: Iain Barnett
* Category: ext/openssl
* Target version: 
* ruby -v: 2.1.2
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN
----------------------------------------
Hi,

I compile Ruby 2.1.2 from source but "get recipe for target 'openssl_missing.o' failed". I don't understand why it's using openssl_missing as my copy of OpenSSL works and is passed to `configure`. Any help with this would be much appreciated. More info below.

Ruby downloaded from http://cache.ruby-lang.org/pub/ruby/2.1/ruby-2.1.2.tar.gz

Configure line: (I've got things in non standard places, but that's why I'mpassing them as options in variables)

    ../ruby-2.1.2/configure --prefix=$MY_RUBY_INSTALL_DIR --with-openssl-dir=$MY_OPENSSL --with-gcc=$(which gcc) --with-readline-dir=$MY_READLINE

I added in the Readline option after reading somewhere that it helped, but it didn't, so you can probably ignore it.

The error that comes up on `make`:

    make[2]: Entering directory '/Users/iainuser/Downloads/build-ruby/ext/openssl'
    compiling ../../../ruby-2.1.2/ext/openssl/openssl_missing.c
    In file included from ../../../ruby-2.1.2/ext/openssl/openssl_missing.c:22:0:
    ../../../ruby-2.1.2/ext/openssl/openssl_missing.h:71:6: error: conflicting types for °∆HMAC_CTX_copy°«
     void HMAC_CTX_copy(HMAC_CTX *out, HMAC_CTX *in);
          ^
    In file included from ../../../ruby-2.1.2/ext/openssl/openssl_missing.c:20:0:
    /Library/Frameworks/Openssl.framework/Versions/1.0.1g/include/openssl/hmac.h:102:5: note: previous declaration of °∆HMAC_CTX_copy°« was here
     int HMAC_CTX_copy(HMAC_CTX *dctx, HMAC_CTX *sctx);
         ^
    In file included from ../../../ruby-2.1.2/ext/openssl/openssl_missing.c:22:0:
    ../../../ruby-2.1.2/ext/openssl/openssl_missing.h:95:5: error: conflicting types for °∆EVP_CIPHER_CTX_copy°«
     int EVP_CIPHER_CTX_copy(EVP_CIPHER_CTX *out, EVP_CIPHER_CTX *in);
         ^
    In file included from /Library/Frameworks/Openssl.framework/Versions/1.0.1g/include/openssl/x509.h:73:0,
                     from /Library/Frameworks/Openssl.framework/Versions/1.0.1g/include/openssl/engine.h:98,
                     from ../../../ruby-2.1.2/ext/openssl/openssl_missing.c:14:
    /Library/Frameworks/Openssl.framework/Versions/1.0.1g/include/openssl/evp.h:502:5: note: previous declaration of °∆EVP_CIPHER_CTX_copy°« was here
     int EVP_CIPHER_CTX_copy(EVP_CIPHER_CTX *out, const EVP_CIPHER_CTX *in);
         ^
    ../../../ruby-2.1.2/ext/openssl/openssl_missing.c:26:1: error: conflicting types for °∆HMAC_CTX_copy°«
     HMAC_CTX_copy(HMAC_CTX *out, HMAC_CTX *in)
     ^
    In file included from ../../../ruby-2.1.2/ext/openssl/openssl_missing.c:20:0:
    /Library/Frameworks/Openssl.framework/Versions/1.0.1g/include/openssl/hmac.h:102:5: note: previous declaration of °∆HMAC_CTX_copy°« was here
     int HMAC_CTX_copy(HMAC_CTX *dctx, HMAC_CTX *sctx);
         ^
    ../../../ruby-2.1.2/ext/openssl/openssl_missing.c:121:1: error: conflicting types for °∆EVP_CIPHER_CTX_copy°«
     EVP_CIPHER_CTX_copy(EVP_CIPHER_CTX *out, EVP_CIPHER_CTX *in)
     ^
    In file included from /Library/Frameworks/Openssl.framework/Versions/1.0.1g/include/openssl/x509.h:73:0,
                     from /Library/Frameworks/Openssl.framework/Versions/1.0.1g/include/openssl/engine.h:98,
                     from ../../../ruby-2.1.2/ext/openssl/openssl_missing.c:14:
    /Library/Frameworks/Openssl.framework/Versions/1.0.1g/include/openssl/evp.h:502:5: note: previous declaration of °∆EVP_CIPHER_CTX_copy°« was here
     int EVP_CIPHER_CTX_copy(EVP_CIPHER_CTX *out, const EVP_CIPHER_CTX *in);
         ^
    Makefile:280: recipe for target 'openssl_missing.o' failed
    make[2]: *** [openssl_missing.o] Error 1
    make[2]: Leaving directory '/Users/iainuser/Downloads/build-ruby/ext/openssl'
    exts.mk:186: recipe for target 'ext/openssl/all' failed
    make[1]: *** [ext/openssl/all] Error 2
    make[1]: Leaving directory '/Users/iainuser/Downloads/build-ruby'
    uncommon.mk:180: recipe for target 'build-ext' failed
    make: *** [build-ext] Error 2

My version of OpenSSL:

    $ openssl version
    OpenSSL 1.0.1g 7 Apr 2014

GCC:

    $ gcc --version
    gcc (GCC) 4.9.0

System:

It's an OSX 10.6.8 system. (Yes, that's old, don't hold it against me! :)

    $ uname -a
    Darwin iainb-2.lan 10.8.0 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386 i386


If you need any other info or need me to try anything, just let me know.

Regards,
Iain



-- 
https://bugs.ruby-lang.org/