<commit_before>#! /usr/bin/env python
"""Setup file for distutils

__author__ = "http://www.gemalto.com"

Copyright 2001-2009 gemalto
Author: <NAME>, mailto:<EMAIL>

This file is part of pyscard.

pyscard is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.

pyscard is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License
along with pyscard; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
"""

from distutils import core, dir_util, file_util
from distutils.core import Extension
from distutils.util import get_platform
from distutils.command.build_ext import build_ext
import glob
import os
import sys

if sys.version[0:1] == '1':
    raise RuntimeError("pyscard requires Python 2.x to build.")

if 'win32' == get_platform():
    platform__cc_defines = [('WIN32', '100')]
    platform_swig_opts = ['-DWIN32']
    platform_sources = ['smartcard/scard/scard.rc']
    platform_libraries = ['winscard']
    platform_include_dirs = []
    platform_extra_compile_args = []
    platform_extra_link_args = []

#
# Mac OS X Tiger has python 2.3 preinstalled
# get_platform() returns a string similar to 'darwin-8.11.1-i386' with
# python 2.3
# if python 2.5 is installed, get_platform() returns a string similar to
# 'macosx-10.3-fat'
elif 'darwin' in get_platform() or 'macosx-10.3' in get_platform() or 'macosx-10.4' in get_platform():
    platform__cc_defines = [('PCSCLITE', '1'), ('__APPLE__', '1'), ('__TIGER__', '1')]
    platform_swig_opts = ['-DPCSCLITE', '-D__APPLE__', '-D__TIGER__']
    platform_sources = []
    platform_libraries = []
    platform_include_dirs = []
    platform_extra_compile_args = ['-v', '-framework', 'PCSC', '-arch', 'i386', '-arch', 'ppc', '-ggdb', '-O0']
    platform_extra_link_args = ['-arch', 'i386', '-arch', 'ppc', '-ggdb']

#
# Mac OS X Snow Leopard, python 2.6
# PowerPC is no more supported, x86_64 is new
#
elif 'macosx-10.6' in get_platform():
    platform__cc_defines = [('PCSCLITE', '1'), ('__APPLE__', '1'), ('__LEOPARD__', '1')]
    platform_swig_opts = ['-DPCSCLITE', '-D__APPLE__', '-D__LEOPARD__']
    platform_sources = []
    platform_libraries = []
    platform_include_dirs = []
    platform_extra_compile_args = ['-v', '-arch', 'i386', '-arch', 'x86_64', '-ggdb', '-O0']
    platform_extra_link_args = ['-arch', 'i386', '-arch', 'x86_64', '-ggdb']

#
# Mac OS X Leopard has python 2.5 preinstalled
# get_platform() returns a string similar to 'macosx-10.5-i386'
#
elif 'macosx-10.' in get_platform():
    platform__cc_defines = [('PCSCLITE', '1'), ('__APPLE__', '1'), ('__LEOPARD__', '1')]
    platform_swig_opts = ['-DPCSCLITE', '-D__APPLE__', '-D__LEOPARD__']
    platform_sources = []
    platform_libraries = []
    platform_include_dirs = []
    platform_extra_compile_args = ['-v', '-framework', 'PCSC', '-arch', 'i386', '-arch', 'ppc', '-ggdb', '-O0']
    platform_extra_link_args = ['-arch', 'i386', '-arch', 'ppc', '-ggdb']
else:
    platform__cc_defines = [('PCSCLITE', '1')]
    platform_swig_opts = ['-DPCSCLITE']
    platform_sources = []
    platform_libraries = ["python%d.%d" % sys.version_info[:2]]<commit_msg>Snow Leopard: do not force no optimisation with -O0 but let the user decide<commit_after>#! /usr/bin/env python
"""Setup file for distutils

__author__ = "http://www.gemalto.com"

Copyright 2001-2009 gemalto
Author: <NAME>, mailto:<EMAIL>

This file is part of pyscard.

pyscard is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.

pyscard is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License
along with pyscard; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
"""

from distutils import core, dir_util, file_util
from distutils.core import Extension
from distutils.util import get_platform
from distutils.command.build_ext import build_ext
import glob
import os
import sys

if sys.version[0:1] == '1':
    raise RuntimeError("pyscard requires Python 2.x to build.")

if 'win32' == get_platform():
    platform__cc_defines = [('WIN32', '100')]
    platform_swig_opts = ['-DWIN32']
    platform_sources = ['smartcard/scard/scard.rc']
    platform_libraries = ['winscard']
    platform_include_dirs = []
    platform_extra_compile_args = []
    platform_extra_link_args = []

#
# Mac OS X Tiger has python 2.3 preinstalled
# get_platform() returns a string similar to 'darwin-8.11.1-i386' with
# python 2.3
# if python 2.5 is installed, get_platform() returns a string similar to
# 'macosx-10.3-fat'
elif 'darwin' in get_platform() or 'macosx-10.3' in get_platform() or 'macosx-10.4' in get_platform():
    platform__cc_defines = [('PCSCLITE', '1'), ('__APPLE__', '1'), ('__TIGER__', '1')]
    platform_swig_opts = ['-DPCSCLITE', '-D__APPLE__', '-D__TIGER__']
    platform_sources = []
    platform_libraries = []
    platform_include_dirs = []
    platform_extra_compile_args = ['-v', '-framework', 'PCSC', '-arch', 'i386', '-arch', 'ppc', '-ggdb', '-O0']
    platform_extra_link_args = ['-arch', 'i386', '-arch', 'ppc', '-ggdb']

#
# Mac OS X Snow Leopard, python 2.6
# PowerPC is no more supported, x86_64 is new
#
elif 'macosx-10.6' in get_platform():
    platform__cc_defines = [('PCSCLITE', '1'), ('__APPLE__', '1'), ('__LEOPARD__', '1')]
    platform_swig_opts = ['-DPCSCLITE', '-D__APPLE__', '-D__LEOPARD__']
    platform_sources = []
    platform_libraries = []
    platform_include_dirs = []
    platform_extra_compile_args = ['-v', '-arch', 'i386', '-arch', 'x86_64', '-ggdb']
    platform_extra_link_args = ['-arch', 'i386', '-arch', 'x86_64', '-ggdb']

#
# Mac OS X Leopard has python 2.5 preinstalled
# get_platform() returns a string similar to 'macosx-10.5-i386'
#
elif 'macosx-10.' in get_platform():
    platform__cc_defines = [('PCSCLITE', '1'), ('__APPLE__', '1'), ('__LEOPARD__', '1')]
    platform_swig_opts = ['-DPCSCLITE', '-D__APPLE__', '-D__LEOPARD__']
    platform_sources = []
    platform_libraries = []
    platform_include_dirs = []
    platform_extra_compile_args = ['-v', '-framework', 'PCSC', '-arch', 'i386', '-arch', 'ppc', '-ggdb', '-O0']
    platform_extra_link_args = ['-arch', 'i386', '-arch', 'ppc', '-ggdb']
else:
    platform__cc_defines = [('PCSCLITE', '1')]
    platform_swig_opts = ['-DPCSCLITE']
    platform_sources = []
    platform_libraries = ["python%d.%d" % sys.version_info[:2]]
{'fraction_non_alphanumeric': 0.14732453092425296, 'fraction_numerical': 0.031966643502432245, 'mean_word_length': 4.406461307287754, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1803221', 'n_tokens_mistral': 2598, 'n_tokens_neox': 2470, 'n_words': 733}