changeset 23835:6ae0292aaa5c stable

configure: ensure empty pkg-config results are actually empty (bug #51680) * configure.ac (MAGICK_CPPFLAGS, MAGICK_LDFLAGS, MAGICK_LIBS): Trim pkg-config results to eliminate strings that are entirely spaces. This is a workaround for versions of pkg-config older than 0.28 that may emit an answer that looks empty but actually contains space characters. * acinclude.m4 (OCTAVE_CHECK_LIB, OCTAVE_CHECK_QT_VERSION): Likewise.
author Mike Miller <mtmiller@octave.org>
date Mon, 07 Aug 2017 08:19:28 -0700
parents 5b5b021b1476
children 2a9c617bbaaa 437ba51e8bcf
files configure.ac m4/acinclude.m4
diffstat 2 files changed, 9 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/configure.ac	Tue Aug 01 17:04:52 2017 -0700
+++ b/configure.ac	Mon Aug 07 08:19:28 2017 -0700
@@ -1564,9 +1564,9 @@
     ## packages add extra flags that are useful when building
     ## Graphics/ImageMagick++ extentions.  These extra flags break the
     ## Octave build.
-    MAGICK_CPPFLAGS=`$PKG_CONFIG --cflags-only-I $magick++`
-    MAGICK_LDFLAGS=`$PKG_CONFIG --libs-only-L $magick++`
-    MAGICK_LIBS=`$PKG_CONFIG --libs-only-l $magick++`
+    MAGICK_CPPFLAGS="$($PKG_CONFIG --cflags-only-I $magick++ | $SED -e 's/^ *$//')"
+    MAGICK_LDFLAGS="$($PKG_CONFIG --libs-only-L $magick++ | $SED -e 's/^ *$//')"
+    MAGICK_LIBS="$($PKG_CONFIG --libs-only-l $magick++ | $SED -e 's/^ *$//')"
 
     warn_magick="$magick++ library fails tests.  The imread, imwrite, and imfinfo functions for reading and writing image files will not be fully functional."
 
--- a/m4/acinclude.m4	Tue Aug 01 17:04:52 2017 -0700
+++ b/m4/acinclude.m4	Mon Aug 07 08:19:28 2017 -0700
@@ -691,12 +691,12 @@
   if test $ac_octave_$1_pkg_check = yes; then
     PKG_CHECK_EXISTS(m4_default([$9], [$1]), [
       if test -z "$m4_toupper([$1])_CPPFLAGS"; then
-        m4_toupper([$1])_CPPFLAGS="$($PKG_CONFIG --cflags-only-I m4_default([$9], [$1]))"
+        m4_toupper([$1])_CPPFLAGS="$($PKG_CONFIG --cflags-only-I m4_default([$9], [$1]) | $SED -e 's/^ *$//')"
       fi
       if test -z "$m4_toupper([$1])_LDFLAGS"; then
-        m4_toupper([$1])_LDFLAGS="$($PKG_CONFIG --libs-only-L m4_default([$9], [$1]))"
+        m4_toupper([$1])_LDFLAGS="$($PKG_CONFIG --libs-only-L m4_default([$9], [$1]) | $SED -e 's/^ *$//')"
       fi
-      m4_toupper([$1])_LIBS="$($PKG_CONFIG --libs-only-l m4_default([$9], [$1]))"
+      m4_toupper([$1])_LIBS="$($PKG_CONFIG --libs-only-l m4_default([$9], [$1]) | $SED -e 's/^ *$//')"
     ])
   fi
 
@@ -1360,9 +1360,9 @@
 
   if test $build_qt_gui = yes; then
     ## Retrieve Qt compilation and linker flags
-    QT_CPPFLAGS="`$PKG_CONFIG --cflags-only-I $QT_MODULES`"
-    QT_LDFLAGS="`$PKG_CONFIG --libs-only-L $QT_MODULES`"
-    QT_LIBS="`$PKG_CONFIG --libs-only-l $QT_MODULES`"
+    QT_CPPFLAGS="$($PKG_CONFIG --cflags-only-I $QT_MODULES | $SED -e 's/^ *$//')"
+    QT_LDFLAGS="$($PKG_CONFIG --libs-only-L $QT_MODULES | $SED -e 's/^ *$//')"
+    QT_LIBS="$($PKG_CONFIG --libs-only-l $QT_MODULES | $SED -e 's/^ *$//')"
 
     case $host_os in
       *darwin*)