Skip to content

Commit

Permalink
pkg-config: tailor libass.pc for static-only builds
Browse files Browse the repository at this point in the history
Add library and package dependencies to the default (non-private)
pkg-config fields for static-only builds. This makes sure the packages
and libraries are always picked up and used, even if the --static option
is not supplied to the pkg-config commandline.
  • Loading branch information
grigorig committed Sep 25, 2011
1 parent af2b0f7 commit 7393996
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
9 changes: 7 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@ fi

AM_CONDITIONAL([HAVE_LIBPNG], [test x$libpng = xtrue])

# Add dependent libraries to pkg-config for static linking
# add libraries/packages to pkg-config for static linking
PKG_LIBS="-lm"
PKG_REQUIRES="freetype2 >= 9.6.3"
PKG_REQUIRES="fribidi >= 0.19.0, ${PKG_REQUIRES}"
if test x$enca = xtrue; then
Expand All @@ -105,7 +106,11 @@ fi
if test x$harfbuzz = xtrue; then
PKG_REQUIRES="harfbuzz >= 0.7.0, ${PKG_REQUIRES}"
fi
AC_SUBST([PKG_REQUIRES])

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)])

# Setup output beautifier.
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
Expand Down
7 changes: 4 additions & 3 deletions libass.pc.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ includedir=@includedir@
Name: libass
Description: LibASS is an SSA/ASS subtitles rendering library
Version: @PACKAGE_VERSION@
Requires.private: @PKG_REQUIRES@
Libs: -L${libdir} -lass
Libs.private: -lm
Requires: @PKG_REQUIRES_DEFAULT@
Requires.private: @PKG_REQUIRES_PRIVATE@
Libs: -L${libdir} -lass @PKG_LIBS_DEFAULT@
Libs.private: @PKG_LIBS_PRIVATE@
Cflags: -I${includedir}

0 comments on commit 7393996

Please sign in to comment.