Heikki Toivonen wrote:
> John Nagle wrote:
> 
>>Back in March, I posted this:
>>
>>
>>>    Hit that with OpenSSL.  Red Hat took elliptical curve cryptography
>>>out of Fedora 6 for patent reasons.  With that missing, M2Crypto won't
>>>build.  It ought to; the implementor of M2Crypto thought of that, because
>>>it's an optional feature.  But M2Crypto uses SWIG.  SWIG doesn't normally
>>>process nested include files.  OpenSSL had changed their configuration
>>>approach to use nested include files.  So SWIG didn't see the #define
>>>that
>>>said to turn off elliptical curve crypto support.  This resulted in
>>>compile errors in the 24,000 lines of code that come out of SWIG. 
>>
>>   That was for M2Crypto 0.17.
>>
>>   It's still broken in M2Crypto 0.18.
> 
> 
> This was reported as
> https://bugzilla.osafoundation.org/show_bug.cgi?id=9404 and fixed, at
> least according to the person who reported the bug. I'd be curious to
> know why the fix does not work for you...
> 
> As an alternative, does it work if you add line 130 to setup.py:
> 
> '-DOPENSSL_NO_EC', # Uncomment if you have
> trouble compiling without EC support

OK, here's the build failing:

python setup.py build
running build
running build_py
running build_ext
building 'M2Crypto.__m2crypto' extension
swigging SWIG/_m2crypto.i to SWIG/_m2crypto_wrap.c
swig -python -I/usr/local/include/python2.5 -I/usr/include -o 
SWIG/_m2crypto_wrap.c SWIG/_m2crypto.i
/usr/include/openssl/opensslconf.h:27: Error: CPP #error ""This openssl-devel 
package does not work your architecture?"". Use the -cpperraswarn option to 
continue swig processing.
error: command 'swig' failed with exit status 1

OK, let's check the requirements, from
http://chandlerproject.org/bin/view/Projects/MeTooCrypto
M2Crypto 0.18:
     * Python 2.3 or newer
          o m2urllib2 requires Python 2.4 or newer
     * OpenSSL 0.9.7 or newer
           o Some optional new features will require OpenSSL 0.9.8 or newer
     * SWIG 1.3.24 or newer

python --version
  Python 2.5 [OK here, 2.5 >= 2.4]

swig -version
  SWIG Version 1.3.31  [OK here; 1.3.31 >= 1.3.24]
  Compiled with i386-redhat-linux-g++ [i386-redhat-linux-gnu]

openssl
OpenSSL> version
OpenSSL 0.9.8a 11 Oct 2005  [OK here; 0.9.8a => 0.9.7.]

Tried the suggested patch to "setup.py":
diff setup.py.orig setup.py
130c130
<                                   #'-D__i386__', # Uncomment for early 
OpenSSL 
0.9.7 versions
---
 >                                   '-D__i386__', # Uncomment for early 
 > OpenSSL 
0.9.7 versions

No change in error message.  That gets us

-bash-3.1$ python setup.py build
running build
running build_py
running build_ext
building 'M2Crypto.__m2crypto' extension
swigging SWIG/_m2crypto.i to SWIG/_m2crypto_wrap.c
swig -python -I/usr/local/include/python2.5 -I/usr/include -o 
SWIG/_m2crypto_wrap.c SWIG/_m2crypto.i
/usr/include/openssl/opensslconf.h:27: Error: CPP #error ""This openssl-devel 
package does not work your architecture?"". Use the -cpperraswarn option to 
continue swig processing.
error: command 'swig' failed with exit status 1

But notice that the -D entry didn't appear on the SWIG command line.
Neither did the "-includeall".  The "swig_opts" values around line
129 aren't actually being used.  I think that's left over from the code intended
to allow builds with Python 2.3 and earlier.  The "self.swig_opts" up at
line 53 of "setup.py" seems to be controlling.  The patch was to
the obsolete code.

This is on Fedora Core 5, x86, 32 bit.

                                        John Nagle

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to