Arg! (Makefile.pre.in)

Fred L. Drake, Jr. fdrake at acm.org
Tue Dec 21 15:36:02 EST 1999


Magnus L. Hetland writes:
 > Setup.in contains:
 > 
 > *shared*
 > spam spamodule.c

  Should that be spammodule.c?  (Note the second "m".)

 > make: *** No rule to make target `spamodule.c', needed by `spamodule.o'.  Stop

  This sounds like what appears to the typo I noted above.

 > Browsing the Makefile.pre.in it seems that it has the wrong value for,
 > among other things, the installdir. So, I try:

  That's OK; it detects that from the python on your $PATH as part of
the boot phase.  Your final Makefile should have the right value, the
rest is temporary.

 > make spammodule
 > 
 > I get all kinds of errors about undefined symbols (suggesting some
 > linking problem):
 > 
 > gcc -g -O2 -I/store/include/python1.5 -I/store/include/python1.5
 >  -DHAVE_CONFIG_H    spammodule.c   -o spammodule
 > Undefined                       first referenced
 >  symbol                             in file
 > Py_InitModule4                      /var/tmp/cczDaaxu1.o
 > Py_BuildValue                       /var/tmp/cczDaaxu1.o
 > PyArg_ParseTuple                    /var/tmp/cczDaaxu1.o
 > main                                /store/lib/gcc-lib/sparc-sun-solaris2/2.8.1/crt1.o
 > ld: fatal: Symbol referencing errors. No output written to spammodule

  The gcc command line is not good.  There should be a "-c" on there
somewhere; I don't see it here.  Without that, gcc tries to link it as 
an executable, which doesn't work because the libraries aren't passed
in via -l... (they shouldn't be if you're trying to build a
dynamically loadable module!).

 > I *do* include Python.h...

  The doesn't seem to have any relation to the source code; it's all
build control.

 > Well - it is always difficult to provide information when one has no
 > clue as to what the problem might be, as one does not know what is
 > relevant...

  True.  After checking for the typo I mention above, if it still
doesn't work, try including a complete capture of your session,
starting with "make -f Makefile.pre.in boot".  ;)

 > Yes... There is no ./Makefile.pre.in that I can see... :)

  Ah!  You can tell I haven't set up a new extension module in months!
(This is a good thing! ;)


  -Fred

--
Fred L. Drake, Jr.	  <fdrake at acm.org>
Corporation for National Research Initiatives




More information about the Python-list mailing list