Description: Make gphoto2 detection use the host architecture pkg-config Author: Helmut Grohne 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)