diff options
author | Oneric <oneric@oneric.stub> | 2020-11-21 21:06:48 +0100 |
---|---|---|
committer | Oneric <oneric@oneric.stub> | 2021-02-22 15:18:49 +0100 |
commit | c9c4fed39339ffde45123013a117e06d0bb9c488 (patch) | |
tree | f03c61fbc6f584f7f5fe2a2fd654fc60582f4ad0 | |
parent | c19929a28b596becef303808b3f81e4a81860de7 (diff) | |
download | libass-c9c4fed39339ffde45123013a117e06d0bb9c488.tar.bz2 libass-c9c4fed39339ffde45123013a117e06d0bb9c488.tar.xz |
pc: use private and public fileds according to spec
Libs.* are to be used for libraries not supplying a pc-file, eg system
libs, while Requires.* is meant for libraries which do supply a
*.pc-file.
The public version of those fields is only to be used for libs whose
symbols end up being exposed by our lib, by eg including one of their
headers in our own headers. Those libs must be linked to both for
dynamic and static builds.
The private versions are not directly exposed to users of our lib and
will only be linked to if an static build is requested. Those libs don't
need to be linked for dynamic builds, but _will_ be linked in static
builds. This also has implications for package maintainers, see eg
https://lists.debian.org/debian-devel-announce/2005/11/msg00016.html .
The intent in 7393996cfe0136f130a6a23bb9fb6f4ddce82d87, seems to have
been making this static/dynamic build distinction ourselves. However
this is both a needless complication in our config script as pkg-config
already handles this, and prone to fail as requesting a static build is
required anyway to get the *.private link flags of our dependencies as
well.
The correct way to handle a static build is to request one, eg one way
to do this for an executable built with autotools and pkg-config is:
LDFLAGS="-static" PKG_CONFIG="/usr/bin/pkg-config --static" ./configure
-rw-r--r-- | configure.ac | 8 | ||||
-rw-r--r-- | libass.pc.in | 4 |
2 files changed, 5 insertions, 7 deletions
diff --git a/configure.ac b/configure.ac index b663d84..9639112 100644 --- a/configure.ac +++ b/configure.ac @@ -272,11 +272,9 @@ AS_IF([test "x$enable_asm" != xno], [ AC_SUBST([ASFLAGS], ["$ASFLAGS"]) AC_SUBST([AS], ["$AS"]) -## Relay package configuration to Makefiles -AC_SUBST([PKG_LIBS_DEFAULT], [$(test "x$enable_shared" = xno && echo "${pkg_libs}")]) -AC_SUBST([PKG_REQUIRES_DEFAULT], [$(test "x$enable_shared" = xno && echo "${pkg_requires}")]) -AC_SUBST([PKG_LIBS_PRIVATE], [$(test "x$enable_shared" = xno || echo "${pkg_libs}")]) -AC_SUBST([PKG_REQUIRES_PRIVATE], [$(test "x$enable_shared" = xno || echo "${pkg_requires}")]) +## Relay package configuration to libass.pc.in +AC_SUBST([PKG_LIBS_PRIVATE], [${pkg_libs}]) +AC_SUBST([PKG_REQUIRES_PRIVATE], [${pkg_requires}]) ## Setup conditionals for use in Makefiles AM_CONDITIONAL([ASM], [test "x$enable_asm" != xno]) diff --git a/libass.pc.in b/libass.pc.in index e087835..222cc25 100644 --- a/libass.pc.in +++ b/libass.pc.in @@ -6,8 +6,8 @@ includedir=@includedir@ Name: libass Description: LibASS is an SSA/ASS subtitles rendering library Version: @PACKAGE_VERSION@ -Requires: @PKG_REQUIRES_DEFAULT@ +Requires: Requires.private: @PKG_REQUIRES_PRIVATE@ -Libs: -L${libdir} -lass @PKG_LIBS_DEFAULT@ +Libs: -L${libdir} -lass Libs.private: @PKG_LIBS_PRIVATE@ Cflags: -I${includedir} |