Mercurial > public > mercurial-scm > hg
comparison setup.py @ 31560:5a0460219649
setup: add a function to test header files
author | Jun Wu <quark@fb.com> |
---|---|
date | Mon, 20 Mar 2017 15:31:21 -0700 |
parents | 9639ff4a93ae |
children | 312e62640798 |
comparison
equal
deleted
inserted
replaced
31559:9639ff4a93ae | 31560:5a0460219649 |
---|---|
123 | 123 |
124 # simplified version of distutils.ccompiler.CCompiler.has_function | 124 # simplified version of distutils.ccompiler.CCompiler.has_function |
125 # that actually removes its temporary files. | 125 # that actually removes its temporary files. |
126 def hasfunction(cc, funcname): | 126 def hasfunction(cc, funcname): |
127 code = 'int main(void) { %s(); }\n' % funcname | 127 code = 'int main(void) { %s(); }\n' % funcname |
128 return cancompile(cc, code) | |
129 | |
130 def hasheader(cc, headername): | |
131 code = '#include <%s>\nint main(void) { return 0; }\n' % headername | |
128 return cancompile(cc, code) | 132 return cancompile(cc, code) |
129 | 133 |
130 # py2exe needs to be installed to work | 134 # py2exe needs to be installed to work |
131 try: | 135 try: |
132 import py2exe | 136 import py2exe |