On 05 September 2001, Martin von Loewis said: > Even if it works, we may find that this approach causes the module not > to be build on systems which would support it. The problem is that > curses.h may include other header files which contain the definition > we are looking for. The only real test is the one that autoconf uses, > i.e. AC_TRY_COMPILE. Supporting that in distutils is probably > something that needs careful planning. The distutils "config" command was precisely that: a start at reimplementing Autoconf in Python. I didn't get very far, but I got far enough to convince myself that it's very much worth doing. For example, here's my analog to AC_TRY_COMPILE, the try_compile() method of the distutils.command.config.config class: def try_compile (self, body, headers=None, include_dirs=None, lang="c"): """Try to compile a source file built from 'body' and 'headers'. Return true on success, false otherwise. """ from distutils.ccompiler import CompileError self._check_compiler() try: self._compile(body, headers, lang) ok = 1 except CompileError: ok = 0 self.announce(ok and "success!" or "failure.") self._clean() return ok I'd much rather write Autoconf (and Autoconf scripts) in Python than in Bourne shell! I ran out of steam on the "config" command about the same time I ran out of steam on the Distutils in general, ie. right around when Python 2.0 was released. Sigh. The idea is sound, the implementation is started, it just needs to be carried through. The main problem when I left off is what to do with config info between runs of the setup script; if it's treated just like any other Distutils command, you'd end up doing the equivalent of re-running "configure" every time your run "make", which would be mind-blowingly bogus. I suspect the answer is to drop a pickle of the configuration state somewhere. There's also a lot of grunt-work coding required to implement a usable subset of Autoconf. Greg -- Greg Ward - Unix weenie gward@python.net http://starship.python.net/~gward/ Jesus Saves -- but Moses gets the rebound, he shoots, he SCORES!
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4