From owner-freebsd-multimedia@FreeBSD.ORG Fri Aug 8 13:46:09 2008 Return-Path: Delivered-To: freebsd-multimedia@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 90FA0106567A for ; Fri, 8 Aug 2008 13:46:09 +0000 (UTC) (envelope-from henry.hu.sh@gmail.com) Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.153]) by mx1.freebsd.org (Postfix) with ESMTP id 0E56B8FC18 for ; Fri, 8 Aug 2008 13:46:08 +0000 (UTC) (envelope-from henry.hu.sh@gmail.com) Received: by fg-out-1718.google.com with SMTP id l26so1186239fgb.35 for ; Fri, 08 Aug 2008 06:46:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=j69Bhei/+q3p2LSzUKq372LYZDpSCB2RImNbf001MMc=; b=mEvidI/CeeIfskxxLyrGGg/7BpYdwQwvvtrBTui1o/T467n4x3P9XtMHx+Tvw7+CPG i4sk4soPP5p87oFtb+YduTf/OSwVDxZfl63r9SK90uJNKKAHFDxNmneJzJnHcP1ir7vG b6AbhBi0PUfTIPXASemt8D4jwSaegwM06+fco= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=J7SkUHjnraOG+pl51c829MbhilGoXDWQgFnQw+BcGh6NqLjHJsPp7tnNSaqtrCVDwh BsaYI43QVjGzaQ8wxDiWroejoH2S1F7NcHtbMjhTQUdGS5Jann7yXzZAbT7CWJhExqVP wnhw9GtBDv5EANl2J2E5rRKMjJvdthHSmkuw4= Received: by 10.86.59.2 with SMTP id h2mr3085748fga.40.1218203166960; Fri, 08 Aug 2008 06:46:06 -0700 (PDT) Received: by 10.86.63.1 with HTTP; Fri, 8 Aug 2008 06:46:06 -0700 (PDT) Message-ID: <53a1e0710808080646y22b93d4eu12cdf4b4eeea619e@mail.gmail.com> Date: Fri, 8 Aug 2008 21:46:06 +0800 From: "Henry Hu" To: "Andriy Gapon" In-Reply-To: <489C402B.3000909@icyb.net.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <53a1e0710808080529g1d63e79ej4130f6104914f9f0@mail.gmail.com> <489C402B.3000909@icyb.net.ua> Cc: freebsd-multimedia@freebsd.org Subject: Re: transcode: 1.0.5_3 => 1.0.6_1 fails at configure(Libs.private) X-BeenThere: freebsd-multimedia@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Multimedia discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Aug 2008 13:46:09 -0000 from pkg-config manpage: Libs: This line should give the link flags specific to your package. Don't add any flags for required packages; pkg-config will add those automatically. Libs.private: This line should list any private libraries in use. Private libraries are libraries which are not exposed through your library, but are needed in the case of static linking. Since we are doing dynamic linking, I think the problem is that libavcodec.so should depends on the library that provides pthread_* functions, and the compiling command does not need -pthread. $ ldd /usr/local/lib/libavcodec.so /usr/local/lib/libavcodec.so: liba52.so.0 => /usr/local/lib/liba52.so.0 (0x28621000) libavutil.so.1 => /usr/local/lib/libavutil.so.1 (0x2862c000) libz.so.4 => /lib/libz.so.4 (0x28637000) libm.so.5 => /lib/libm.so.5 (0x28649000) libfaac.so.0 => /usr/local/lib/libfaac.so.0 (0x2865e000) libfaad.so.0 => /usr/local/lib/libfaad.so.0 (0x2866e000) libmp3lame.so.0 => /usr/local/lib/libmp3lame.so.0 (0x286ac000) libogg.so.5 => /usr/local/lib/libogg.so.5 (0x2871d000) libtheora.so.0 => /usr/local/lib/libtheora.so.0 (0x28722000) libvorbis.so.4 => /usr/local/lib/libvorbis.so.4 (0x2876d000) libvorbisenc.so.2 => /usr/local/lib/libvorbisenc.so.2 (0x28795000) libx264.so.50 => /usr/local/lib/libx264.so.50 (0x2888e000) libxvidcore.so.4 => /usr/local/lib/libxvidcore.so.4 (0x2894c000) libthr.so.3 => /lib/libthr.so.3 (0x28a62000) libc.so.7 => /lib/libc.so.7 (0x28089000) libmp4v2.so.0 => /usr/local/lib/libmp4v2.so.0 (0x28a75000) libX11.so.6 => /usr/local/lib/libX11.so.6 (0x28b34000) libgpac.so.1 => /usr/local/lib/libgpac.so.1 (0x28c1c000) libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x28e7e000) libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x28f73000) libxcb-xlib.so.0 => /usr/local/lib/libxcb-xlib.so.0 (0x28f7e000) libxcb.so.1 => /usr/local/lib/libxcb.so.1 (0x28f80000) librpcsvc.so.4 => /usr/lib/librpcsvc.so.4 (0x28f97000) libssl.so.5 => /usr/lib/libssl.so.5 (0x28f9f000) libcrypto.so.5 => /lib/libcrypto.so.5 (0x28fe0000) libXau.so.6 => /usr/local/lib/libXau.so.6 (0x29139000) libXdmcp.so.6 => /usr/local/lib/libXdmcp.so.6 (0x2913c000) You see libthr.so besides other libraries, which provides pthread_* functions. In fact, I've written a small program just containing a call to avcodec_thread_init, and compiled it successfully without -pthread, just -lavcodec. So the problem is that your libavcodec does not depends on libthr. I've tried static linking and it needs -pthread. Libs.private is outputed when adding -static to `pkg-config --libs libavcodec` 2008/8/8 Andriy Gapon > > on 08/08/2008 15:29 Henry Hu said the following: > > In my config.log, I found that there is -pthread in the arguments. > > It comes from $LIBAVCODEC_EXTRA_LIBS, which comes from `pkg-config > > --libs libavcodec` > > > > $ pkg-config --libs libavcodec > > -pthread -L/usr/local/lib -lavcodec -lz -la52 -lfaac -lfaad -lmp3lame > > -lx264 -lxvidcore -ltheora -lvorbisenc -lavutil -lvorbis -lm -logg > > > > So it is present when libavcodec(ffmpeg) is installed. > > So why is it missing in your libavcodec's pkgconfig file? > > Hmm, your analysis is correct but I am not quite sure what is wrong in > my env. > > What I have here is: > $ pkg-config --libs libavcodec > -L/usr/local/lib -lavcodec > > $ pkg_info -W /usr/local/libdata/pkgconfig/libavcodec.pc > /usr/local/libdata/pkgconfig/libavcodec.pc was installed by package > ffmpeg-2008.07.27_2 > > $ fgrep -A1 libavcodec.pc /var/db/pkg/ffmpeg-2008.07.27_2/+CONTENTS > libdata/pkgconfig/libavcodec.pc > @comment MD5:2d54dcacfc8826101f1ba6163da27797 > > $ md5 /usr/local/libdata/pkgconfig/libavcodec.pc > MD5 (/usr/local/libdata/pkgconfig/libavcodec.pc) = > 2d54dcacfc8826101f1ba6163da27797 > > $ cat /usr/local/libdata/pkgconfig/libavcodec.pc > prefix=/usr/local > exec_prefix=${prefix} > libdir=${prefix}/lib > includedir=${prefix}/include > > Name: libavcodec > Description: FFmpeg codec library > Version: 51.61.0 > Requires: > Requires.private: theora vorbisenc libavutil = 49.7.0 > Conflicts: > Libs: -L${libdir} -lavcodec > Libs.private: -pthread -lz -lbz2 -lm -la52 -lfaad -ltheora -logg > -lvorbisenc -lvorbis -logg -lx264 -lm > Cflags: -I${includedir} > > > Not sure about Libs vs Libs.private in the .pc file. > Is this ffmpeg issue or transcode issue or pkg-config issue? > Perhaps -pthread should be listed in Libs? > > -- > Andriy Gapon