<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=UTF-8" http-equiv="Content-Type">
  <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Greetings,<br>
<br>
I am re-implementing my PostgreSQL interface (pyPgSQL) using Pyrex to
implement an extension for the libpq C-API.  When using the supplied
build_ext, I notices that I had to have the .pxd files in the same
directory as the source .pyx file.  Also, the generated c source file
was placed in the same directory as the Pyrex source.  I also could not
specify Pyrex options to create a listing file, etc.  I wanted to have
the .pxd files in an separate include directory and I also did not want
to clean up the generated files from the Pyrex source directory.  To
correct these (minor) annoyances, I've implesmentd a new version of
buld_ext.py and created a version of core.py and extension.py.<br>
<br>
This implementation of Pyrex.Distutils will:<br>
<ol>
  <li>put the generated files (*.c, *.h, *.pxi) into the
[build_temp]/pyrex directory (unless the --inplace option is used).</li>
  <li>add the following Pyrex specific command-line options:<br>
  </li>
  <ul>
    <li>pyrex-include-dirs: a list of directories that Pyrex will
search for include files (the -I option of pyrexc)</li>
    <li>pyrex-cplus: tells Pyrex to use the C++ compiler to compile the
generated file.</li>
    <li>pyrex-create-listing: tells Pyrex to place error messages in a
listing (.lis) file.</li>
  </ul>
  <li>add the following Pyrex specific Extension parameters:</li>
  <ul>
    <li>pyrex_include_dirs: a python list of include directories to
search.</li>
    <li>pyrex_cplus: a boolean parameter - =1 tells Pyrex to use the
C++ compiler (i.e. generates .cpp files instead of .c files)</li>
    <li>pyres_create_listing: a boolean parameter - =1 tells Pyres to 
generate a listing (.lis) file.</li>
  </ul>
</ol>
These parameters can also be used in a distutils configuration file
(i.e. setup.cfg).<br>
<br>
I am also supplying a patch to Pyrex's Main.py that will place the
listing file in the same directory as the output file, instead of in
the same directory as the source file.<br>
<br>
Thanks for a very useful product Greg.<br>
<br>
Billy G. Allie.<br>
</body>
</html>