Arg! [Long]

Magnus L. Hetland mlh at vier.idi.ntnu.no
Tue Dec 21 15:50:53 EST 1999


"Fred L. Drake, Jr." <fdrake at acm.org> writes:

> Magnus L. Hetland writes:
>  > Setup.in contains:
>  > 
>  > *shared*
>  > spam spamodule.c
> 
>   Should that be spammodule.c?  (Note the second "m".)

Yup. Sorry about that... But that didn't work either.

>   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.

OK.

>  > gcc -g -O2 -I/store/include/python1.5 -I/store/include/python1.5
>  >  -DHAVE_CONFIG_H    spammodule.c   -o spammodule

>   The gcc command line is not good.

Well - I didn't write it ;)

> There should be a "-c" on there
> somewhere;

Sounds reasonable indeed...

> 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!).

Ah... I see.

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

Yes - that's how it looked to me to (hence the subject :)

>   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".  ;)

Hm. OK - this posting is getting long-winded anyway... :)

vier:~/python/extension$ ls
Makefile.pre.in  Setup.in
vier:~/python/extension$ make -f Makefile.pre.in boot
rm -f *.o *~
rm -f *.a tags TAGS config.c Makefile.pre python sedscript
rm -f *.so *.sl so_locations
VERSION=`python -c "import sys; print sys.version[:3]"`; \
installdir=`python -c "import sys; print sys.prefix"`; \
exec_installdir=`python -c "import sys; print sys.exec_prefix"`; \
make -f ./Makefile.pre.in VPATH=. srcdir=. \
        VERSION=$VERSION \
        installdir=$installdir \
        exec_installdir=$exec_installdir \
        Makefile
make[1]: Entering directory `/home/stud/f/mlh/python/extension'
sed -n \
 -e '1s/.*/1i\\/p' \
 -e '2s%.*%# Generated automatically from Makefile.pre.in by sedscript.%p' \
 -e '/^VERSION=/s/^VERSION=[    ]*\(.*\)/s%@VERSION[@]%\1%/p' \
 -e '/^CC=/s/^CC=[      ]*\(.*\)/s%@CC[@]%\1%/p' \
 -e '/^CCC=/s/^CCC=[    ]*\(.*\)/s%#@SET_CCC[@]%CCC=\1%/p' \
 -e '/^LINKCC=/s/^LINKCC=[      ]*\(.*\)/s%@LINKCC[@]%\1%/p' \
 -e '/^OPT=/s/^OPT=[    ]*\(.*\)/s%@OPT[@]%\1%/p' \
 -e '/^LDFLAGS=/s/^LDFLAGS=[    ]*\(.*\)/s%@LDFLAGS[@]%\1%/p' \
 -e '/^LDLAST=/s/^LDLAST=[      ]*\(.*\)/s%@LDLAST[@]%\1%/p' \
 -e '/^DEFS=/s/^DEFS=[  ]*\(.*\)/s%@DEFS[@]%\1%/p' \
 -e '/^LIBS=/s/^LIBS=[  ]*\(.*\)/s%@LIBS[@]%\1%/p' \
 -e '/^LIBM=/s/^LIBM=[  ]*\(.*\)/s%@LIBM[@]%\1%/p' \
 -e '/^LIBC=/s/^LIBC=[  ]*\(.*\)/s%@LIBC[@]%\1%/p' \
 -e '/^RANLIB=/s/^RANLIB=[      ]*\(.*\)/s%@RANLIB[@]%\1%/p' \
 -e '/^MACHDEP=/s/^MACHDEP=[    ]*\(.*\)/s%@MACHDEP[@]%\1%/p' \
 -e '/^SO=/s/^SO=[      ]*\(.*\)/s%@SO[@]%\1%/p' \
 -e '/^LDSHARED=/s/^LDSHARED=[  ]*\(.*\)/s%@LDSHARED[@]%\1%/p' \
 -e '/^CCSHARED=/s/^CCSHARED=[  ]*\(.*\)/s%@CCSHARED[@]%\1%/p' \
 -e '/^SGI_ABI=/s/^SGI_ABI=[    ]*\(.*\)/s%@SGI_ABI[@]%\1%/p' \
 -e '/^LINKFORSHARED=/s/^LINKFORSHARED=[        ]*\(.*\)/s%@LINKFORSHARED[@]%\1%/p' \
 -e '/^prefix=/s/^prefix=\(.*\)/s%^prefix=.*%prefix=\1%/p' \
 -e '/^exec_prefix=/s/^exec_prefix=\(.*\)/s%^exec_prefix=.*%exec_prefix=\1%/p' \
 /store/lib/python1.5/config/Makefile >sedscript
echo "/^#@SET_CCC@/d" >>sedscript
echo "/^installdir=/s%=.*%=     /store%" >>sedscript
echo "/^exec_installdir=/s%=.*%=/store%" >>sedscript
echo "/^srcdir=/s%=.*%=         .%" >>sedscript
echo "/^VPATH=/s%=.*%=          .%" >>sedscript
echo "/^LINKPATH=/s%=.*%=       %" >>sedscript
echo "/^BASELIB=/s%=.*%=        %" >>sedscript
echo "/^BASESETUP=/s%=.*%=      %" >>sedscript
sed -f sedscript ./Makefile.pre.in >Makefile.pre
cp ./Setup.in Setup
/store/lib/python1.5/config/makesetup \
         -m Makefile.pre -c /store/lib/python1.5/config/config.c.in
Setup -n  /store/lib/python1.5/config/Setup.thread /store/lib/python1.5/config/Setup.local /store/lib/python1.5/config/Setup
make -f Makefile do-it-again
make[2]: Entering directory `/home/stud/f/mlh/python/extension'
/store/lib/python1.5/config/makesetup \
         -m Makefile.pre -c /store/lib/python1.5/config/config.c.in Setup -n  /store/lib/python1.5/config/Setup.thread /store/lib/python1.5/config/Setup.local /store/lib/python1.5/config/Setup
make[2]: Leaving directory `/home/stud/f/mlh/python/extension'
make[1]: Leaving directory `/home/stud/f/mlh/python/extension'
vier:~/python/extension$ make
make: *** No rule to make target `spammodule.c', needed by `spammodule.o'.  Stop.


<sigh>

After poring over this dump I think I suspect something (which *might*
be construed as a weakness in the make-control ;)... It guesses the
wrong location for my installation... The /store/lib/python1.5 stuff
isn't mine... I have used an alias for python to point to my own
installation.

But even so, I'm to tired to figure out the connections...

> 
>  > 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

--

  Magnus
  Lie
  Hetland



More information about the Python-list mailing list