Permalink
Browse files

openslide.pc: Drop static linking support

If we list a dependency in Requires.private, pkg-config requires its
.pc file to be installed, even when linking dynamically:

    https://bugs.freedesktop.org/show_bug.cgi?id=4738

This causes our -devel binary package to depend on many other -devel
packages which would not otherwise be needed.  (In fact, since Linux
distributions don't and won't ship static versions of OpenSlide, they
will never be needed -- but always required.)

Or it *would* cause this, except that Requires.private is woefully out of
date.  Fixing it is not completely trivial, since zlib, libtiff, and
OpenJPEG may be detected either by pkg-config or by hand, depending on
the versions of those libraries.  We would need to dynamically generate
Requires.private and Libs.private based on which detection method works
in each case.

I doubt anyone is linking OpenSlide statically and I also doubt that they
should.  If they are, they're probably building the entire dependency
stack themselves, so if we add a dependency, updating the linker command
line is going to be the least of their problems.  So, since the use case
is probably mythical, we're not going to carry configure.ac code to
support it.  Instead, we will drop Requires.private and Libs.private.

Note that you can still statically link against OpenSlide (why??), you
just have to spell out all of its dependencies on *your* linker command
line.
  • Loading branch information...
1 parent e37f67c commit 8bccd092fc7c242b3a1a71c1ad7ce3c136189ade @bgilbert bgilbert committed Jan 7, 2014
Showing with 0 additions and 17 deletions.
  1. +0 −15 configure.ac
  2. +0 −2 openslide.pc.in
View
@@ -45,21 +45,6 @@ AC_DEFINE_UNQUOTED([SUFFIXED_VERSION], ["$SUFFIXED_VERSION"],
AC_SUBST([SUFFIXED_VERSION])
-# Check for recent pkg-config which supports Requires.private
-# (snippet taken from cairo configure.in)
-PKG_PROG_PKG_CONFIG()
-if test "x$PKG_CONFIG" = x; then
- AC_MSG_ERROR([pkg-config >= $PKGCONFIG_REQUIRED required but not found (http://pkgconfig.freedesktop.org/)])
-fi
-
-case `$PKG_CONFIG --version` in
-[0.?|0.?.?|0.1[0-7]|0.1[0-7].?]) PKGCONFIG_REQUIRES="Requires"; ;;
-*) PKGCONFIG_REQUIRES="Requires.private"; ;;
-esac
-
-AC_SUBST(PKGCONFIG_REQUIRES)
-
-
# libraries
AC_SEARCH_LIBS([floor], [m],, AC_MSG_FAILURE([cannot find math library]))
AC_SEARCH_LIBS([jpeg_CreateDecompress], [jpeg],,
View
@@ -6,8 +6,6 @@ includedir=@includedir@
Name: openslide
Description: A library for reading whole slide images.
-@PKGCONFIG_REQUIRES@: glib-2.0 gthread-2.0
Version: @VERSION@
Libs: -L${libdir} -lopenslide
-Libs.private: @LIBS@
Cflags: -I${includedir}/openslide

0 comments on commit 8bccd09

Please sign in to comment.