[MEncoder-users] ./configure ignores --extra-libs= while checking for features
Moritz Barsnick
barsnick at gmx.net
Tue Aug 7 10:04:33 CEST 2007
Hi Giacomo,
On Mon, Aug 06, 2007 at 12:58:05 -0400, Giacomo Comes wrote:
> I suspect the problem you are having is related to a bug I found about 9 months
> ago and that never got fixed.
> Please try the attached patch and tell me if it solves your problem too.
No, the attached patch does not do the trick. It may very well be valid
(and looks so), but does not affect my problem.
The problem is this result (sorry for the long lines), achieved with your patch:
##########################################
============ Checking for PNG support ============
#include <png.h>
#include <string.h>
int main(void) {
printf("png.h : %s\n", PNG_LIBPNG_VER_STRING);
printf("libpng: %s\n", png_libpng_ver);
return (strcmp(PNG_LIBPNG_VER_STRING, png_libpng_ver));
}
gcc-4.1 -Wall -Wno-switch -Wpointer-arith -Wredundant-decls -O4 -march=nocona -mtune=nocona -pipe -ffast-math -fomit-frame-pointer -I/home/mb/include -I/usr/corp/pkgs/X11/R7.2-64/include -I/usr/corp/pkgs/zlib/1.2.x-64/include -I/usr/corp/pkgs/libpng/1.2.8-1/include -I/usr/corp/pkgs/jpeg/6b-64/include -I/usr/corp/pkgs/libexpat/2.0.0-64/include -I/usr/corp/pkgs/ncurses/5.6-64/include -I/usr/X11/include -L/home/mb/sys/linux_x86-64/lib -L/home/mb/lib -L/usr/corp/pkgs/X11/R7.2-64/lib -L/usr/corp/pkgs/zlib/1.2.x-64/lib64 -L/usr/corp/pkgs/libpng/1.2.8-1/lib -L/usr/corp/pkgs/jpeg/6b-64/lib -L/usr/corp/pkgs/libexpat/2.0.0-64/lib -L/usr/corp/pkgs/ncurses/5.6-64/lib64 -lncurses -lXext -lX11 -lpthread -lXv -lXinerama -lXxf86vm -lXxf86dga -lGL -ldl -o /tmp/mplayer-conf-12643-14554.o /tmp/mplayer-conf-2680-14554.c -lpng -lz -lm
/tmp/mplayer-conf-12643-14554.o: error while loading shared libraries: libXv.so.1: cannot open shared object file: No such file or directory
Result is: no (mismatch of library and header versions)
##########################################
The desired result (achieved with my patch) is this:
##########################################
============ Checking for PNG support ============
#include <png.h>
#include <string.h>
int main(void) {
printf("png.h : %s\n", PNG_LIBPNG_VER_STRING);
printf("libpng: %s\n", png_libpng_ver);
return (strcmp(PNG_LIBPNG_VER_STRING, png_libpng_ver));
}
gcc-4.1 -Wall -Wno-switch -Wpointer-arith -Wredundant-decls -O4 -march=nocona -mtune=nocona -pipe -ffast-math -fomit-frame-pointer -I/home/mb/include -I/usr/corp/pkgs/X11/R7.2-64/include -I/usr/corp/pkgs/zlib/1.2.x-64/include -I/usr/corp/pkgs/libpng/1.2.8-1/include -I/usr/corp/pkgs/jpeg/6b-64/include -I/usr/corp/pkgs/libexpat/2.0.0-64/include -I/usr/corp/pkgs/ncurses/5.6-64/include -I/usr/X11/include -L/home/mb/sys/linux_x86-64/lib -L/home/mb/lib -L/usr/corp/pkgs/X11/R7.2-64/lib -L/usr/corp/pkgs/zlib/1.2.x-64/lib64 -L/usr/corp/pkgs/libpng/1.2.8-1/lib -L/usr/corp/pkgs/jpeg/6b-64/lib -L/usr/corp/pkgs/libexpat/2.0.0-64/lib -L/usr/corp/pkgs/ncurses/5.6-64/lib64 -lncurses -Wl,-rpath,/home/mb/sys/linux_x86-64/lib:/home/mb/lib:/usr/corp/pkgs/X11/R7.2-64/lib:/usr/corp/pkgs/zlib/1.2.x-64/lib64:/usr/corp/pkgs/libpng/1.2.8-1/lib:/usr/corp/pkgs/jpeg/6b-64/lib:/usr/corp/pkgs/libexpat/2.0.0-64/lib:/usr/corp/pkgs/ncurses/5.6-64/lib64 -lXext -lX11 -lpthread -lXv -lXinerama -lXxf86vm -lXxf86dga -lGL -ldl -o /tmp/mplayer-conf-13853-18235.o /tmp/mplayer-conf-24023-18235.c -lpng -lz -lm
png.h : 1.2.8
libpng: 1.2.8
Result is: yes
##########################################
Note that I am trying to get X11 - incidentally the version where
libXv.so.1 resides - from /usr/corp/pkgs/X11/R7.2-64/. My ld.so.conf
does not know this directory, so I am using --extra-libs= to let the
linker add an RPATH to the binary. (Yes, I am aware I could and should
use the mplayer-specific flag for this, but I am trying to point out a
generic problem.) The function check_compile() is adding the proper -L
(therefore, libXv is picked up while linking), but it is not adding my
RPATh directive, so the binary it tries to execute in order to figure
out libpng support does not work. In other cases, library versions may
conflict (header vs. found lib).
(This is also a generic autoconf problem - only I can know for which
library paths I need to add an RPATH, so it's up to me to add
'-Wl,-rpath,/path/to/lib' to autoconf's LDFLAGS. Or
pkgconfig/toolname-config needs to be set up correctly, where
available.)
I hope this helps in understanding the problem. I basically think it's
pretty obvious: three flags are offered
--extra-libs=FLAGS extra linker flags
--extra-libs-mplayer=FLAGS extra linker flags for MPlayer
--extra-libs-mencoder=FLAGS extra linker flags for MEncoder
but only two are used in check_compile().
Thanks,
Moritz
More information about the MEncoder-users
mailing list