| 158 | PACKAGE_MANAGER[detectOS.result], COMPILING[detectOS.result]) |
| 159 | |
| 160 | def testCompiler(): |
| 161 | if not HAVE_SETUPTOOLS: |
| 162 | # silent, we can't test without setuptools |
| 163 | return True |
| 164 | |
| 165 | bitmsghash = Extension( |
| 166 | 'bitmsghash', |
| 167 | sources=['src/bitmsghash/bitmsghash.cpp'], |
| 168 | libraries=['pthread', 'crypto'], |
| 169 | ) |
| 170 | |
| 171 | dist = Distribution() |
| 172 | dist.ext_modules = [bitmsghash] |
| 173 | cmd = build_ext(dist) |
| 174 | cmd.initialize_options() |
| 175 | cmd.finalize_options() |
| 176 | cmd.force = True |
| 177 | try: |
| 178 | cmd.run() |
| 179 | except CompileError: |
| 180 | return False |
| 181 | else: |
| 182 | fullPath = os.path.join(cmd.build_lib, cmd.get_ext_filename("bitmsghash")) |
| 183 | return os.path.isfile(fullPath) |
| 184 | |
| 185 | detectOS.result = None |
| 186 | prereqs = detectPrereqs() |