[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Differences between environments in the shell and in make



Hi there,

I'm trying to build a new package for despotify[1], which includes
python and ruby bindings for the library "libdespotify", as well as a
couple of console clients. The difficulty is that the python and ruby
bindings are not build by the main Makefile, and though they do
provide their own, these assume that libdespotify and its pkg-config
file are already installed on the system. I've managed to patch the
build system so that it all works fine when I build it with
dpkg-buildpackage on my Ubuntu precise box, but when using a Debian
unstable chroot, I get behaviour that I don't understand: I have
produced a modified pkg-config file that tells the build systems to
look in the package build directories for the built library and header
files, and this causes the correct "-L" and "-I" and "-l" options to
be passed to gcc. However, on running `pbuilder', `dpkg-buildpackage',
or even just `make' in the python binding directory, the build fails:

building 'spytify' extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall
-Wstrict-prototypes -fPIC
-I/tmp/buildd/despotify-0.1\~svn520/debian/../lib -I../../lib/
-I/usr/include/python2.7 -c src/audio_thread.c -o
build/temp.linux-x86_64-2.7/src/audio_thread.o
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall
-Wstrict-prototypes -fPIC
-I/tmp/buildd/despotify-0.1\~svn520/debian/../lib -I../../lib/
-I/usr/include/python2.7 -c src/spytify.c -o
build/temp.linux-x86_64-2.7/src/spytify.o
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall
-Wstrict-prototypes -fPIC
-I/tmp/buildd/despotify-0.1\~svn520/debian/../lib -I../../lib/
-I/usr/include/python2.7 -c src/libao.c -o
build/temp.linux-x86_64-2.7/src/libao.o
gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-z,relro
build/temp.linux-x86_64-2.7/src/audio_thread.o
build/temp.linux-x86_64-2.7/src/spytify.o
build/temp.linux-x86_64-2.7/src/libao.o
-L/tmp/buildd/despotify-0.1\~svn520/debian/../lib/.libs -ldespotify
-lpthread -lao -o build/lib.linux-x86_64-2.7/spytify.so
/usr/bin/ld: cannot find -ldespotify
collect2: ld returned 1 exit status
error: command 'gcc' failed with exit status 1
make: *** [build] Error 1

Strangely, if I run the final gcc command from the make process
directly, it works fine:

root@leopard:/tmp/buildd/despotify-0.1~svn520/bindings/python# gcc
-pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-z,relro
build/temp.linux-x86_64-2.7/src/audio_thread.o
build/temp.linux-x86_64-2.7/src/spytify.o
build/temp.linux-x86_64-2.7/src/libao.o
-L/tmp/buildd/despotify-0.1\~svn520/debian/../lib/.libs -ldespotify
-lpthread -lao -o build/lib.linux-x86_64-2.7/spytify.so
root@leopard:/tmp/buildd/despotify-0.1~svn520/bindings/python# echo $?
0

As I said, this doesn't seem to happen in Ubuntu precise, only my
Debian unstable chroots.

Finally, some (fairly obvious) information:
"/tmp/buildd/despotify-0.1\~svn520/debian/../lib/.libs" is where
libdespotify is built and found before it is installed.

Can anyone shed any light on this problem?

[1] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=670786
    (This ITP is slightly out of date; as you can gather, I have now
almost succeeded in building the python and ruby bindings, except for
this one difficulty.)

Many thanks,

Toby


Reply to: