From 8bccd092fc7c242b3a1a71c1ad7ce3c136189ade Mon Sep 17 00:00:00 2001 From: Benjamin Gilbert Date: Mon, 6 Jan 2014 22:35:42 -0500 Subject: [PATCH] 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. --- configure.ac | 15 --------------- openslide.pc.in | 2 -- 2 files changed, 17 deletions(-) diff --git a/configure.ac b/configure.ac index 1a461c54..6dc0dfa1 100644 --- a/configure.ac +++ b/configure.ac @@ -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],, diff --git a/openslide.pc.in b/openslide.pc.in index ca8f4eca..0f180b99 100644 --- a/openslide.pc.in +++ b/openslide.pc.in @@ -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