[gimp] configure: AC_CHECK_FILE() does not work when cross-compiling.



commit 0b4fa971b39f46f4b12ae3b71e0400bf34c1f291
Author: Jehan <jehan girinstud io>
Date:   Sun Jun 12 02:09:29 2016 +0200

    configure: AC_CHECK_FILE() does not work when cross-compiling.
    
    As autoconf docs say: "like most Autoconf macros, they test a feature
    of the host machine, and therefore, they die when cross-compiling."
    Therefore use shell-type file existence instead which works for all
    cases. This fixes configure failing with:
    "error: cannot check for file existence when cross compiling"

 configure.ac |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index e3cfc88..fcb9416 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2060,9 +2060,16 @@ if test "x$enable_vector_icons" = "xyes"; then
   else
     # Check if librsvg was built with --disable-pixbuf-loader.
     gdk_pixbuf_moduledir=`$PKG_CONFIG --variable=gdk_pixbuf_moduledir gdk-pixbuf-2.0`
-    AC_CHECK_FILE(["$gdk_pixbuf_moduledir/libpixbufloader-svg.*"],
-                  [enable_vector_icons="yes"],
-                  [enable_vector_icons="no (librsvg GdkPixbuf loader missing)"])
+    # AC_CHECK_FILE macro does not work when cross-compiling and exits with:
+    # error: cannot check for file existence when cross compiling
+    # So let's test files the shell way.
+    if (test "x$platform_win32" = "xyes" &&
+        test -f "$gdk_pixbuf_moduledir/libpixbufloader-svg.dll") ||
+       test -f "$gdk_pixbuf_moduledir/libpixbufloader-svg.so"; then
+      enable_vector_icons="yes"
+    else
+      enable_vector_icons="no (librsvg GdkPixbuf loader missing)"
+    fi
   fi
 fi
 AM_CONDITIONAL(ENABLE_VECTOR_ICONS, test "x$enable_vector_icons" = "xyes")


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]