From dbc404ed66602671423c004a892bfd88e77e85e3 Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Sat, 29 Nov 2014 14:32:08 +0000 Subject: [PATCH] fix nip2 build on win we have to statically link on win if we are using cfitsio ... make sure -ljpeg gets into the link line, it doesn't have a .pc https://github.com/jcupitt/libvips/issues/196 --- configure.ac | 9 ++++++++- vips.pc.in | 4 +--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index e51c7467..b05a98f0 100644 --- a/configure.ac +++ b/configure.ac @@ -359,6 +359,11 @@ AM_GLIB_GNU_GETTEXT # build list of pkg-config packages we used here PACKAGES_USED="" +# build list of extra libs we need here +# the main one is jpeg: it does not have a .pc file, so when we make vips.pc +# we need to put -ljpeg into libs ourselves +EXTRA_LIBS_USED="" + # Checks for header files. AC_HEADER_DIRENT AC_HEADER_STDC @@ -708,7 +713,8 @@ if test x"$with_png" != "xno"; then fi FIND_JPEG( - [with_jpeg=yes], + [with_jpeg=yes + EXTRA_LIBS_USED="$EXTRA_LIBS_USED -ljpeg"], [AC_MSG_WARN([libjpeg not found; disabling JPEG support]) with_jpeg=no ]) @@ -790,6 +796,7 @@ AC_SUBST(VIPS_INCLUDES) AC_SUBST(VIPS_LIBS) AC_SUBST(VIPS_CXX_LIBS) AC_SUBST(PACKAGES_USED) +AC_SUBST(EXTRA_LIBS_USED) # needed by test/variables.sh.in # :( what's a better way to do this, argh diff --git a/vips.pc.in b/vips.pc.in index 595a7bc6..872933ca 100644 --- a/vips.pc.in +++ b/vips.pc.in @@ -7,7 +7,5 @@ Name: vips Description: Image processing library Version: @VERSION@ Requires: @PACKAGES_USED@ -Libs: -L${libdir} -lvips -# necessary for static linking with mingw -Libs.private: @VIPS_LIBS@ @VIPS_CXX_LIBS@ +Libs: -L${libdir} -lvips @EXTRA_LIBS_USED@ Cflags: -I${includedir}