Ticket #24: setup.py.diff

File setup.py.diff, 1.3 KB (added by midnightmagic, at 2009-07-03T22:07:49Z)

will ALMOST CERTAINLY not work for bdew's machine but I don't have access to python there.

  • setup.py

    old new  
    126126    cryptopp_src = [ os.path.join('cryptopp', x) for x in os.listdir('cryptopp') if x.endswith('.cpp') ]
    127127    extra_srcs.extend(cryptopp_src)
    128128
     129# So it would appear that SSE2 support is somewhat undefined on many
     130# AMD-based CPU chipsets. They officially don't support some of the
     131# instructions that crypto++ tries to use--which implies that crypto++ CPU
     132# capability detection is currently incorrect. So, while that remains true,
     133# all we can do is detect those platforms that exhibit the issue, and
     134# disable the crypto++ assembly on them.
     135#
     136# Additionally, it's not portably possible to determine the actual CPU name
     137# via platform.processor() on NetBSD (and even some Linux) because it just
     138# returns the same thing as platform.machine(): i386 or x86_64 or ...
     139
     140arch = platform.architecture()
     141syst = platform.system()
     142if '32bit' in arch:
     143    if 'NetBSD' in syst:
     144        print "You are on 32-bit NetBSD. Disabling assembly optimisations."
     145        define_macros.append(('CRYPTOPP_DISABLE_ASM', 1))
     146
    129147# In either case, we must provide a value for CRYPTOPP_DISABLE_ASM that
    130148# matches the one used when Crypto++ was originally compiled. The Crypto++
    131149# GNUMakefile tests the assembler version and only enables assembly for