[Python-bugs-list] [ python-Bugs-497697 ] building shared modules

noreply@sourceforge.net noreply@sourceforge.net
Sat, 29 Dec 2001 13:43:19 -0800


Bugs item #497697, was opened at 2001-12-29 13:43
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=497697&group_id=5470

Category: None
Group: Python 2.1.2
Status: Open
Resolution: None
Priority: 5
Submitted By: Matthias Klose (doko)
Assigned to: Nobody/Anonymous (nobody)
Summary: building shared modules

Initial Comment:
[ report from http://bugs.debian.org/121759, submitted 
by Jochen Voss <jvoss2@web.de> ]

I tried to follow the description in
/usr/share/doc/python2.1/html/ext/dnt-type-
methods.html and the
following manual sections in order to build a C 
extension module for
Python 2.1.  The mechanism does not work as advertised 
in the manual.

To reproduce the problem try the following

    mkdir bugdir
    cd bugdir
    touch testx1module.c
    touch testx2module.c

Now create a file named "Setup" with the following 
three lines in it:

    == Setup starts at next line 
=======================
    *shared*
    testx1 testx1module.c
    testx2 testx2module.c -DFISCH=Barsch
    == Setup ends at previous line 
=====================

The third line will cause the problem later.  I think 
it is valid
syntax, because .../ext/module-defn-example.html states

    Several compiler options are supported:
    [...]
     -Dname=value           Define a macro

Now we try whether it works: type

    cp /usr/lib/python2.1/config/Makefile.pre.in .
    make -f Makefile.pre.in boot
    make

For me this gives the output

    gcc -fPIC -g -O2 -Wall -Wstrict-prototypes -
I/usr/include/python2.1 -I/usr/include/python2.1 -
DHAVE_CONFIG_H  -c ././testx1module.c -
o ./testx1module.o
    gcc -shared  ./testx1module.o   -
o ./testx1module.so

The bug is the following: file "testx2module.so" is 
not created.
And in fact "grep testx Makefile" emits

    SHAREDMODS= ./testx1module$(SO)
    testx2 testx2module.c -DFISCH=Barsch
    ./testx1module.o: $(srcdir)/./testx1module.c; 
$(CC) $(CCSHARED) $(CFLAGS)  -c 
$(srcdir)/./testx1module.c -o ./testx1module.o
    ./testx1module$(SO):  ./testx1module.o; 
$(LDSHARED)  ./testx1module.o   -o ./testx1module$(SO)

The second line looks suspicious.

I can work around this by putting the defines in a 
variable,
but I think this should be fixed nevertheless.


----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=497697&group_id=5470