
Okay, here is a new version of the bdist_rpm patch, it adds the following options: --spec-only - This option just generates a spec file and then stops --tar-only - This option just generates a tarball and stops. The command `rpm -ta program_name.tar.gz` will then build an RPM --no-remove - bdist_rpm now by default will remove MANIFEST, redhat/, and program_name.tar.gz when run as root. This option will disable this behavior --arch - This option will build the RPM for the specified architecture. One important consideration for --arch : Unless ./setup.py can be made to recognize the rpm's CFLAGS it will generate the same object code no matter what architecture you specify. In this case --arch will only effect what rpm THINKS the package is. I looked through the ccompiler and unixccompiler modules and didn't find any way to pass any CFLAGS in either through the command line or through an environment variable, am I missing it or has this feature not been added yet? -- Harry Henry Gebel, Senior Developer, Landon House SBS West Dover Hundred, Delaware PyNcurses ncurses binding for Python: http://pyncurses.sourceforge.net

On 27 April 2000, Harry Henry Gebel said:
That's a feature. No way do I plan to support cross-compiling in the Distutils. Quick, when was the last time anybody cared about cross-compiling? ;-) My original reasoning for wanting the --arch option to "bdist_rpm" was to set the "build arch" string for binary RPMs. My thinking was that "bdist_rpm" wouldn't have anything better than the value returned by 'distutils.util.get_platform()' to go by, meaning it would use (eg.) "linux2-i586" when it should really use "i386". (At least, those are the values returned by 'get_platform()' and used by RPM on my system.) However, I may have been wrong -- ie. it looks as though RPM is smart enough to put in the "right" build arch string itself. The only thing Distutils would have to do, then, is set it to "noarch" if there are no extensions -- ie. if this is a pure Python module distribution. Greg -- Greg Ward - Linux geek gward@python.net http://starship.python.net/~gward/ "I came, I saw, she conquered." (The original Latin seems to have been garbled.)

On Thu, May 04, 2000 at 09:46:22PM -0400, Greg Ward wrote:
I wasn't looking at --arch and CFLAGS to support cross-compiling, rather it is to support different versions of the same processor family. If I compile 'module-1.0-1.src.rpm' on an i386 or with '--target=i386' it will generate 'module-1.0-1.i386.rpm' but if I compile the same source RPM on a Pentium II or with '--target=i686' it will generate 'module-1.0-1.i686.rpm' even though it is really an i386 binary because ./setup.py does not pass any '--mcpu' or '--march' options to gcc. RPM sets a variable containing the appropriate '--mcpu' and '--march' (and other) options, but in does not appear that there is any way to use this variable in ./setup.py at this time. -- Harry Henry Gebel, Senior Developer, Landon House SBS West Dover Hundred, Delaware PyNcurses ncurses binding for Python: http://pyncurses.sourceforge.ne

On 05 May 2000, Harry Henry Gebel said:
Aahhh! I get it now, thanks. Anyways, I've just checked in a change that should enable this. It was already possible to sneak extra arguments into the link command line; now it can be done with the compile command line to boot. Start in the 'build_extensions()' method of distutils/command/build_ext.py; you'll note that it now looks for an 'extra_compile_args' element in the 'build_info' dictionary. FYI: 'build_info' is the dictionary of info that's included with each extension and contains all the information required to build the extension on "any" platform. For example, here's a snippet from the NumPy setup script: ext_modules = [('_numpy', { 'sources' : ['Src/_numpymodule.c', 'Src/arrayobject.c', 'Src/ufuncobject.c'], } ), If I want to sneak, say, "-m486", onto the compiler command line for each of the three source files in *this* extensions, I would change the build_info dict shown here to: { 'sources' : ['Src/_numpymodule.c', 'Src/arrayobject.c', 'Src/ufuncobject.c'], 'extra_compile_afgs' : ['-m486'] } Of course, you'll be invoking "build_ext" programmatically, rather than through the command line and setup script, so it'll be slightly different for you. This should give you the idea, though; just read through the 'build_extensions()' method and you should see what's going on. Greg -- Greg Ward - Unix geek gward@python.net http://starship.python.net/~gward/ Speak softly and carry a +6 two-handed sword.

On Sat, May 06, 2000 at 09:17:20AM -0400, Greg Ward wrote:
Thanks, I have a post on rpm-list asking about the '--target' problem, as soon as that is figured out I will put this in. -- Harry Henry Gebel, Senior Developer, Landon House SBS West Dover Hundred, Delaware PyNcurses ncurses binding for Python http://pyncurses.sourceforge.ne

On 27 April 2000, Harry Henry Gebel said:
That's a feature. No way do I plan to support cross-compiling in the Distutils. Quick, when was the last time anybody cared about cross-compiling? ;-) My original reasoning for wanting the --arch option to "bdist_rpm" was to set the "build arch" string for binary RPMs. My thinking was that "bdist_rpm" wouldn't have anything better than the value returned by 'distutils.util.get_platform()' to go by, meaning it would use (eg.) "linux2-i586" when it should really use "i386". (At least, those are the values returned by 'get_platform()' and used by RPM on my system.) However, I may have been wrong -- ie. it looks as though RPM is smart enough to put in the "right" build arch string itself. The only thing Distutils would have to do, then, is set it to "noarch" if there are no extensions -- ie. if this is a pure Python module distribution. Greg -- Greg Ward - Linux geek gward@python.net http://starship.python.net/~gward/ "I came, I saw, she conquered." (The original Latin seems to have been garbled.)

On Thu, May 04, 2000 at 09:46:22PM -0400, Greg Ward wrote:
I wasn't looking at --arch and CFLAGS to support cross-compiling, rather it is to support different versions of the same processor family. If I compile 'module-1.0-1.src.rpm' on an i386 or with '--target=i386' it will generate 'module-1.0-1.i386.rpm' but if I compile the same source RPM on a Pentium II or with '--target=i686' it will generate 'module-1.0-1.i686.rpm' even though it is really an i386 binary because ./setup.py does not pass any '--mcpu' or '--march' options to gcc. RPM sets a variable containing the appropriate '--mcpu' and '--march' (and other) options, but in does not appear that there is any way to use this variable in ./setup.py at this time. -- Harry Henry Gebel, Senior Developer, Landon House SBS West Dover Hundred, Delaware PyNcurses ncurses binding for Python: http://pyncurses.sourceforge.ne

On 05 May 2000, Harry Henry Gebel said:
Aahhh! I get it now, thanks. Anyways, I've just checked in a change that should enable this. It was already possible to sneak extra arguments into the link command line; now it can be done with the compile command line to boot. Start in the 'build_extensions()' method of distutils/command/build_ext.py; you'll note that it now looks for an 'extra_compile_args' element in the 'build_info' dictionary. FYI: 'build_info' is the dictionary of info that's included with each extension and contains all the information required to build the extension on "any" platform. For example, here's a snippet from the NumPy setup script: ext_modules = [('_numpy', { 'sources' : ['Src/_numpymodule.c', 'Src/arrayobject.c', 'Src/ufuncobject.c'], } ), If I want to sneak, say, "-m486", onto the compiler command line for each of the three source files in *this* extensions, I would change the build_info dict shown here to: { 'sources' : ['Src/_numpymodule.c', 'Src/arrayobject.c', 'Src/ufuncobject.c'], 'extra_compile_afgs' : ['-m486'] } Of course, you'll be invoking "build_ext" programmatically, rather than through the command line and setup script, so it'll be slightly different for you. This should give you the idea, though; just read through the 'build_extensions()' method and you should see what's going on. Greg -- Greg Ward - Unix geek gward@python.net http://starship.python.net/~gward/ Speak softly and carry a +6 two-handed sword.

On Sat, May 06, 2000 at 09:17:20AM -0400, Greg Ward wrote:
Thanks, I have a post on rpm-list asking about the '--target' problem, as soon as that is figured out I will put this in. -- Harry Henry Gebel, Senior Developer, Landon House SBS West Dover Hundred, Delaware PyNcurses ncurses binding for Python http://pyncurses.sourceforge.ne
participants (2)
-
Greg Ward
-
Harry Henry Gebel