Subject: pkg/28915: ffmpeg on Linux needs -ldl
To: None <pkg-manager@netbsd.org, gnats-admin@netbsd.org,>
From: None <reed@reedmedia.net>
List: pkgsrc-bugs
Date: 01/09/2005 05:45:00
>Number:         28915
>Category:       pkg
>Synopsis:       ffmpeg build fails because of missing -ldl
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Jan 09 05:45:00 +0000 2005
>Originator:     reed@reedmedia.net
>Release:        NetBSD 1.6.2_STABLE
>Organization:
http://bsd.reedmedia.net/
>Environment:
	
	
System: NetBSD rainier.reedmedia.net 1.6.2_STABLE NetBSD 1.6.2_STABLE (MYKERNEL) #1: Tue Jun 1 12:16:43 PDT 2004 reed@rainier.reedmedia.net:/usr/src/sys/arch/i386/compile/MYKERNEL i386
Architecture: i386
Machine: i386
>Description:
Under Linux, ffmpeg fails to build. I get errors like:

gcc -Wl,--warn-common -rdynamic -Wl,-E -o .libs/ffserver ffserver.o  libavformat/.libs/libavformat.so -L/scratch/pkgsrc/multimedia/ffmpeg/work.puget/.buildlink/lib libavcodec/.libs/libavcodec.so -lm /usr/lib/libz.so
ffserver.o(.text+0x48c0): In function `load_module':
/scratch/pkgsrc/multimedia/ffmpeg/work.puget/ffmpeg-0.4.8/ffserver.c:3820: undefined reference to `dlopen'
ffserver.o(.text+0x48d7):/scratch/pkgsrc/multimedia/ffmpeg/work.puget/ffmpeg-0.4.8/ffserver.c:3827: undefined reference to `dlsym'
ffserver.o(.text+0x4904):/scratch/pkgsrc/multimedia/ffmpeg/work.puget/ffmpeg-0.4.8/ffserver.c:3832: undefined reference to `dlclose'
ffserver.o(.text+0x4911):/scratch/pkgsrc/multimedia/ffmpeg/work.puget/ffmpeg-0.4.8/ffserver.c:3822: undefined reference to `dlerror'

>How-To-Repeat:
	
>Fix:
Maybe utilize mk/dlopen.builtin.mk? (I am not sure yet how that is used.)

Also, the configure script (not autoconf) for ffmpeg may need adjusting.
Maybe FFSLDFLAGS='-ldl -Wl,-E'.
I defined LIBDL in my CONFIGURE_ENV and patched patch-aa to have that added to
FFSLDFLAGS. (But this needs to be done correct for the operating system
that really need this.)

>Unformatted: