diff options
| author | serpilliere <devnull@localhost> | 2012-01-17 11:29:07 +0100 |
|---|---|---|
| committer | serpilliere <devnull@localhost> | 2012-01-17 11:29:07 +0100 |
| commit | c653fb8faaee795e017dd88191ab0c19ce02d8a0 (patch) | |
| tree | 427913af58f1ccb32320642c7bfdac655b0b5558 /setup.py | |
| parent | 590fb5590f85a7de443904d95a7625f2ca4854e5 (diff) | |
| download | miasm-c653fb8faaee795e017dd88191ab0c19ce02d8a0.tar.gz miasm-c653fb8faaee795e017dd88191ab0c19ce02d8a0.zip | |
enable miasm installation without tcc
Diffstat (limited to 'setup.py')
| -rwxr-xr-x | setup.py | 83 |
1 files changed, 58 insertions, 25 deletions
diff --git a/setup.py b/setup.py index f3a2be16..03adc925 100755 --- a/setup.py +++ b/setup.py @@ -2,28 +2,61 @@ from distutils.core import setup,Extension -setup( - name = 'Miasm', - version = '0.1', - packages=['miasm', 'miasm/tools', - 'miasm/expression', 'miasm/graph', 'miasm/arch', - 'miasm/core', 'miasm/tools/emul_lib' ], - package_data = {'miasm':['tools/emul_lib/*.h']}, -# data_files = [('toto', ['miasm/tools/emul_lib/queue.h'])], - ext_modules = [ - Extension("miasm.tools.emul_lib.libcodenat_interface", - ["miasm/tools/emul_lib/libcodenat_interface.c", - "miasm/tools/emul_lib/libcodenat.c"]), - Extension("miasm.tools.emul_lib.libcodenat_tcc", - ["miasm/tools/emul_lib/libcodenat_tcc.c"], - libraries=["tcc"]) - ], - - # Metadata - author = 'Fabrice Desclaux', - author_email = 'serpilliere@droid-corp.org', - description = 'Machine code manipulation library', - license = 'GPLv2', - # keywords = '', - # url = '', -) +def buil_all(): + setup( + name = 'Miasm', + version = '0.1', + packages=['miasm', 'miasm/tools', + 'miasm/expression', 'miasm/graph', 'miasm/arch', + 'miasm/core', 'miasm/tools/emul_lib' ], + package_data = {'miasm':['tools/emul_lib/*.h']}, + # data_files = [('toto', ['miasm/tools/emul_lib/queue.h'])], + ext_modules = [ + Extension("miasm.tools.emul_lib.libcodenat_interface", + ["miasm/tools/emul_lib/libcodenat_interface.c", + "miasm/tools/emul_lib/libcodenat.c"]), + Extension("miasm.tools.emul_lib.libcodenat_tcc", + ["miasm/tools/emul_lib/libcodenat_tcc.c"], + libraries=["tcc"]) + ], + # Metadata + author = 'Fabrice Desclaux', + author_email = 'serpilliere@droid-corp.org', + description = 'Machine code manipulation library', + license = 'GPLv2', + # keywords = '', + # url = '', + ) + + + +def buil_no_tcc(): + setup( + name = 'Miasm', + version = '0.1', + packages=['miasm', 'miasm/tools', + 'miasm/expression', 'miasm/graph', 'miasm/arch', + 'miasm/core', 'miasm/tools/emul_lib' ], + package_data = {'miasm':['tools/emul_lib/*.h']}, + # data_files = [('toto', ['miasm/tools/emul_lib/queue.h'])], + # Metadata + author = 'Fabrice Desclaux', + author_email = 'serpilliere@droid-corp.org', + description = 'Machine code manipulation library', + license = 'GPLv2', + # keywords = '', + # url = '', + ) + + +def try_build(): + try: + buil_all() + return + except: + print "WARNING cannot build with libtcc!, trying without it" + print "Miasm will not be able to emulate code" + buil_no_tcc() + + +try_build() |