[Distutils] _spawn_posix fails, command line works??

John J. Lee jjl@pobox.com
Sat Jan 26 17:34:01 2002


On 24 Jan 2002, Michael Hudson wrote:

> "John J. Lee" <jjl@pobox.com> writes:
[...]
> > internals in my setup.py: it's just a perfectly standard set of
> > Extension() instances, and a couple of static libs, and the only
> > distutils function I call is setup itself.
>
> Can we see it anyway?

The relevant bit:


from distutils.core import setup, Extension

ext_modules = []
c_libraries = []

...

if os.name == "nt":
    fmt = '\\"%s\\"'
elif os.name == "posix":
    fmt = '\"%s\"'
macros = [
    ("HAVE_CONFIG_H", 1),
    ("LOCALEDIR", fmt % (os.environ.get("localedir", ""),)),
    ("GNULOCALEDIR", fmt % (os.environ.get("gnulocaledir", ""),)),
    ("LOCALE_ALIAS_PATH", fmt % (os.environ.get("aliaspath", ""),))
    ]

# libintl (gettext) static lib
srcs = glob(join("win", "intl", "*.c"))
srcs.remove(join("win", "intl", "cat-compat.c"))
intlsrcs = srcs

# recode static lib
srcs = glob(join("win", "src", "*.c"))
srcs.remove(join("win", "src", "ansi2knr.c"))
srcs.extend(intlsrcs)
lib = "recode", {"sources": srcs,
                 "include_dirs": include_dirs,
                 "macros": macros}
c_libraries.append(lib)

...


As for a fix for for windows implementation, I don't have the knowledge to
say how this should be done in the general case.


John