diff mbox

[FFmpeg-devel,3.4] configure: add LIBDRM to Libs.private instead of Libs

Message ID 20181021204339.44375-1-giulio.benetti@micronovasrl.com
State New
Headers show

Commit Message

Giulio Benetti Oct. 21, 2018, 8:43 p.m. UTC
Currently LIBDRM is appended to Libs: in libavutil.pc. This causes
every program linking with avutil to link with -ldrm in both shared and
static linking cases. In shared linking case it makes no sense, since
-ldrm is a dependency of libavutil and is transparent while linking with
libavutil

- Add privatelibs_avutil variable for explicit private libraries to be
  appended to Libs.private:
- Add $LIBDRM to privatelibs_avutil.

Signed-off-by: Giulio Benetti <giulio.benetti@micronovasrl.com>
---
 configure                     | 3 ++-
 ffbuild/pkgconfig_generate.sh | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

Comments

Giulio Benetti Jan. 29, 2019, 4:59 p.m. UTC | #1
Hello,

Il 21/10/2018 22:43, Giulio Benetti ha scritto:
> Currently LIBDRM is appended to Libs: in libavutil.pc. This causes
> every program linking with avutil to link with -ldrm in both shared and
> static linking cases. In shared linking case it makes no sense, since
> -ldrm is a dependency of libavutil and is transparent while linking with
> libavutil
> 
> - Add privatelibs_avutil variable for explicit private libraries to be
>    appended to Libs.private:
> - Add $LIBDRM to privatelibs_avutil.
> 
> Signed-off-by: Giulio Benetti <giulio.benetti@micronovasrl.com>
> ---
>   configure                     | 3 ++-
>   ffbuild/pkgconfig_generate.sh | 3 ++-
>   2 files changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/configure b/configure
> index 9fe7760822..0996d8a85d 100755
> --- a/configure
> +++ b/configure
> @@ -7096,7 +7096,8 @@ source_path=${source_path}
>   LIBPREF=${LIBPREF}
>   LIBSUF=${LIBSUF}
>   
> -extralibs_avutil="$LIBRT $LIBDRM $LIBM"
> +extralibs_avutil="$LIBRT $LIBM"
> +privatelibs_avutil="$LIBDRM"
>   extralibs_avcodec="$extralibs"
>   extralibs_avformat="$extralibs"
>   extralibs_avdevice="$extralibs"
> diff --git a/ffbuild/pkgconfig_generate.sh b/ffbuild/pkgconfig_generate.sh
> index e5de6716d2..b86486a107 100755
> --- a/ffbuild/pkgconfig_generate.sh
> +++ b/ffbuild/pkgconfig_generate.sh
> @@ -13,6 +13,7 @@ name=lib${shortname}
>   fullname=${name}${build_suffix}
>   comment=$2
>   libs=$(eval echo \$extralibs_${shortname})
> +privatelibs=$(eval echo \$privatelibs_${shortname})
>   deps=$(eval echo \$${shortname}_deps)
>   
>   for dep in $deps; do
> @@ -39,7 +40,7 @@ Requires: $($shared || echo $requires)
>   Requires.private: $($shared && echo $requires)
>   Conflicts:
>   Libs: -L\${libdir} $rpath -l${fullname#lib} $($shared || echo $libs)
> -Libs.private: $($shared && echo $libs)
> +Libs.private: $($shared && echo $libs) ${privatelibs}
>   Cflags: -I\${includedir}
>   EOF
>   
> 

any news about this patch?
Is there something wrong with it?

On Buildroot there's still the problem during static linking where -ldrm 
is appended when linking with -lavutil.

Best Regards
diff mbox

Patch

diff --git a/configure b/configure
index 9fe7760822..0996d8a85d 100755
--- a/configure
+++ b/configure
@@ -7096,7 +7096,8 @@  source_path=${source_path}
 LIBPREF=${LIBPREF}
 LIBSUF=${LIBSUF}
 
-extralibs_avutil="$LIBRT $LIBDRM $LIBM"
+extralibs_avutil="$LIBRT $LIBM"
+privatelibs_avutil="$LIBDRM"
 extralibs_avcodec="$extralibs"
 extralibs_avformat="$extralibs"
 extralibs_avdevice="$extralibs"
diff --git a/ffbuild/pkgconfig_generate.sh b/ffbuild/pkgconfig_generate.sh
index e5de6716d2..b86486a107 100755
--- a/ffbuild/pkgconfig_generate.sh
+++ b/ffbuild/pkgconfig_generate.sh
@@ -13,6 +13,7 @@  name=lib${shortname}
 fullname=${name}${build_suffix}
 comment=$2
 libs=$(eval echo \$extralibs_${shortname})
+privatelibs=$(eval echo \$privatelibs_${shortname})
 deps=$(eval echo \$${shortname}_deps)
 
 for dep in $deps; do
@@ -39,7 +40,7 @@  Requires: $($shared || echo $requires)
 Requires.private: $($shared && echo $requires)
 Conflicts:
 Libs: -L\${libdir} $rpath -l${fullname#lib} $($shared || echo $libs)
-Libs.private: $($shared && echo $libs)
+Libs.private: $($shared && echo $libs) ${privatelibs}
 Cflags: -I\${includedir}
 EOF