I'm trying to compile ruby-1.8.5 on a rather old Linux box,
and it's failing in ext/openssl,
gcc -I. -I../.. -I../../. -I../.././ext/openssl -DRUBY_EXTCONF_H=\"extconf.h\" -I/users/kleb/local/openssl/include -fPIC -g -O2 -c ossl_bio.c
ossl_bio.c: In function `ossl_obj2bio':
ossl_bio.c:23: called object is not a function
make: *** [ossl_bio.o] Error 1
In ext/openssl/ossl.h:
/*
* OpenSSL has defined RFILE and Ruby has defined RFILE - so undef it!
*/ #if defined(RFILE) /*&& !defined(OSSL_DEBUG)*/
# undef RFILE #endif #include <ruby.h> #include <rubyio.h>
In ext/openssl/ossl.h:
/*
* OpenSSL has defined RFILE and Ruby has defined RFILE - so undef it!
*/ #if defined(RFILE) /*&& !defined(OSSL_DEBUG)*/
# undef RFILE #endif #include <ruby.h> #include <rubyio.h>
I have this in my ossl.h too:
20 /*
21 * OpenSSL has defined RFILE and Ruby has defined RFILE - so undef it!
22 */
23 #if defined(RFILE) /*&& !defined(OSSL_DEBUG)*/
24 # undef RFILE
25 #endif
26 #include <ruby.h>
27 #include <rubyio.h>
RFILE seems redefined somewhere after here.
But I can't find another RFILE in /ext/openssl or below...
$ cd /ext/openssl && grep -nr RFILE *
ossl.h:21:* OpenSSL has defined RFILE and Ruby has defined RFILE - so undef it!
ossl.h:23:#if defined(RFILE) /*&& !defined(OSSL_DEBUG)*/
ossl.h:24:# undef RFILE
Suggestions?
I tried removing the comment from the "#if defined" line
and just putting "#undef RFILE' with no apparent effect.
At Mon, 18 Sep 2006 01:06:07 +0900,
Bil Kleb wrote in [ruby-talk:214856]:
> RFILE seems redefined somewhere after here.
But I can't find another RFILE in /ext/openssl or below...
`Somewhere' inside <openssl/*.h> below it.
$ cd /ext/openssl && grep -nr RFILE *
ossl.h:21:* OpenSSL has defined RFILE and Ruby has defined RFILE - so undef it!
ossl.h:23:#if defined(RFILE) /*&& !defined(OSSL_DEBUG)*/
ossl.h:24:# undef RFILE
Suggestions?
Moving the code block after #include lines of openssl. Try
this patch.
/*
-* OpenSSL has defined RFILE and Ruby has defined RFILE - so undef it!
-*/
-#if defined(RFILE) /*&& !defined(OSSL_DEBUG)*/
-# undef RFILE
-#endif
-#include <ruby.h>
-#include <rubyio.h>
+ *_FILE_OFFSET_BITS needs to be defined before some system headers on
+ * Solaris.
+ */
+#include "config.h"
/*
@@ -70,4 +69,13 @@ extern "C" {
/*
+* OpenSSL has defined RFILE and Ruby has defined RFILE - so undef it!
+*/
+#if defined(RFILE) /*&& !defined(OSSL_DEBUG)*/
+# undef RFILE
+#endif
+#include <ruby.h>
+#include <rubyio.h>
+
+/*
* Common Module
*/
@@ -212,5 +220,7 @@ void ossl_debug(const char *, ...);
void Init_openssl(void);