summaryrefslogtreecommitdiff
path: root/debian/patches/0060-cross.patch
blob: a810929d2f7bce73818db643a846aced6dacedca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
Description: Make gphoto2 detection use the host architecture pkg-config
Author: Helmut Grohne <helmut@subdivi.de>
Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=948711
Forwarded: not-needed
Last-Update: 2020-08-30
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
Index: trunk/acinclude.m4
===================================================================
--- trunk.orig/acinclude.m4
+++ trunk/acinclude.m4
@@ -436,15 +436,19 @@ AC_DEFUN([SANE_CHECK_GPHOTO2],
   # a program.   And, if that works, then add the -l flags to
   # GPHOTO2_LIBS and any other flags to GPHOTO2_LDFLAGS to pass to
   # sane-config.
-  if test "$with_gphoto2" != "no" ; then
-    AC_CHECK_TOOL(HAVE_GPHOTO2, pkg-config, false)
+  AS_IF([test "$with_gphoto2" != "no"],[
+    AC_REQUIRE([PKG_PROG_PKG_CONFIG])
+    if test "x$PKG_CONFIG" = x; then
+      HAVE_GPHOTO2=false
+    else
+      HAVE_GPHOTO2=$PKG_CONFIG
+    fi
 
     if test ${HAVE_GPHOTO2} != "false" ; then
-      if pkg-config --exists libgphoto2 ; then
-        with_gphoto2="`pkg-config --modversion libgphoto2`"
-	GPHOTO2_CPPFLAGS="`pkg-config --cflags libgphoto2`"
-        GPHOTO2_LIBS="`pkg-config --libs libgphoto2`"
-
+      if $PKG_CONFIG --exists libgphoto2 ; then
+        with_gphoto2="`$PKG_CONFIG --modversion libgphoto2`"
+	GPHOTO2_CPPFLAGS="`$PKG_CONFIG --cflags libgphoto2`"
+        GPHOTO2_LIBS="`$PKG_CONFIG --libs libgphoto2`"
         saved_CPPFLAGS="${CPPFLAGS}"
         CPPFLAGS="${GPHOTO2_CPPFLAGS}"
 	saved_LIBS="${LIBS}"
@@ -464,13 +468,13 @@ AC_DEFUN([SANE_CHECK_GPHOTO2],
         GPHOTO2_LIBS=""
       else
         SANE_EXTRACT_LDFLAGS(GPHOTO2_LIBS, GPHOTO2_LDFLAGS)
-        if pkg-config --atleast-version=2.5.0 libgphoto2; then
+        if $PKG_CONFIG --atleast-version=2.5.0 libgphoto2; then
           AC_DEFINE([GPLOGFUNC_NO_VARGS], [1],
                     [Define if GPLogFunc does not take a va_list.])
         fi
       fi
     fi
-  fi
+  ])
   AC_SUBST(GPHOTO2_CPPFLAGS)
   AC_SUBST(GPHOTO2_LIBS)
   AC_SUBST(GPHOTO2_LDFLAGS)