use OR PKG_CONFIG scheme for libgcrypt

Upstream-Status: Inappropriate OE specific

Signed-off-by: Armin Kuster <akuster808@gmail.com>

Index: wireshark-2.4.4/m4/libgcrypt.m4
===================================================================
--- wireshark-2.4.4.orig/m4/libgcrypt.m4
+++ wireshark-2.4.4/m4/libgcrypt.m4
@@ -27,11 +27,11 @@ AC_DEFUN([AM_PATH_LIBGCRYPT],
      libgcrypt_config_prefix="$withval", libgcrypt_config_prefix="")
   if test x$libgcrypt_config_prefix != x ; then
      if test x${LIBGCRYPT_CONFIG+set} != xset ; then
-        LIBGCRYPT_CONFIG=$libgcrypt_config_prefix/bin/libgcrypt-config
+        LIBGCRYPT_CONFIG=$libgcrypt_config_prefix/libgcrypt.pc
      fi
   fi
 
-  AC_PATH_PROG(LIBGCRYPT_CONFIG, libgcrypt-config, no)
+  AC_PATH_PROG(LIBGCRYPT_CONFIG, libgcrypt.pc, no)
   tmp=ifelse([$1], ,1:1.2.0,$1)
   if echo "$tmp" | grep ':' >/dev/null 2>/dev/null ; then
      req_libgcrypt_api=`echo "$tmp"     | sed 's/\(.*\):\(.*\)/\1/'`
@@ -50,7 +50,7 @@ AC_DEFUN([AM_PATH_LIBGCRYPT],
                sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\2/'`
     req_micro=`echo $min_libgcrypt_version | \
                sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'`
-    libgcrypt_config_version=`$LIBGCRYPT_CONFIG --version`
+    libgcrypt_config_version=`$PKG_CONFIG --modversion libgcrypt`
     major=`echo $libgcrypt_config_version | \
                sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'`
     minor=`echo $libgcrypt_config_version | \
@@ -82,7 +82,7 @@ AC_DEFUN([AM_PATH_LIBGCRYPT],
      # If we have a recent libgcrypt, we should also check that the
      # API is compatible
      if test "$req_libgcrypt_api" -gt 0 ; then
-        tmp=`$LIBGCRYPT_CONFIG --api-version 2>/dev/null || echo 0`
+        tmp=`$PKG_CONFIG --api-version libgcrypt 2>/dev/null || echo 0`
         if test "$tmp" -gt 0 ; then
            AC_MSG_CHECKING([LIBGCRYPT API version])
            if test "$req_libgcrypt_api" -eq "$tmp" ; then
@@ -95,8 +95,8 @@ AC_DEFUN([AM_PATH_LIBGCRYPT],
      fi
   fi
   if test $ok = yes; then
-    LIBGCRYPT_CFLAGS=`$LIBGCRYPT_CONFIG --cflags`
-    LIBGCRYPT_LIBS=`$LIBGCRYPT_CONFIG --libs`
+    LIBGCRYPT_CFLAGS=`$PKG_CONFIG --cflags libgcrypt`
+    LIBGCRYPT_LIBS=`$PKG_CONFIG --libs libgcrypt`
     ifelse([$2], , :, [$2])
   else
     LIBGCRYPT_CFLAGS=""
