1From 15668161c351aee5f29152db2972b1648da11210 Mon Sep 17 00:00:00 2001
2From: Saul Wold <sgw@linux.intel.com>
3Date: Wed, 16 Aug 2017 11:16:30 +0800
4Subject: [PATCH] use pkgconfig instead of npth config
5
6Upstream-Status: Inappropriate [openembedded specific]
7
8Signed-off-by: Saul Wold <sgw@linux.intel.com>
9
10Rebase to 2.1.23
11Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
12
13---
14 m4/npth.m4 | 53 ++++++++---------------------------------------------
15 1 file changed, 8 insertions(+), 45 deletions(-)
16
17diff --git a/m4/npth.m4 b/m4/npth.m4
18index 06cdaee..4adda01 100644
19--- a/m4/npth.m4
20+++ b/m4/npth.m4
21@@ -19,25 +19,10 @@ AC_DEFUN([_AM_PATH_NPTH_CONFIG],
22   if test "x$npth_config_prefix" != x ; then
23       NPTH_CONFIG="$npth_config_prefix/bin/npth-config"
24   fi
25+  AC_PATH_PROG(PKGCONFIG, pkg-config, no)
26
27-  use_gpgrt_config=""
28-  if test x"$NPTH_CONFIG" = x -a x"$GPGRT_CONFIG" != x -a "$GPGRT_CONFIG" != "no"; then
29-    if $GPGRT_CONFIG npth --exists; then
30-      NPTH_CONFIG="$GPGRT_CONFIG npth"
31-      AC_MSG_NOTICE([Use gpgrt-config as npth-config])
32-      use_gpgrt_config=yes
33-    fi
34-  fi
35-  if test -z "$use_gpgrt_config"; then
36-    AC_PATH_PROG(NPTH_CONFIG, npth-config, no)
37-  fi
38-
39-  if test "$NPTH_CONFIG" != "no" ; then
40-    if test -z "$use_gpgrt_config"; then
41-      npth_version=`$NPTH_CONFIG --version`
42-    else
43-      npth_version=`$NPTH_CONFIG --modversion`
44-    fi
45+  if test "$PKGCONFIG" != "no" ; then
46+    npth_version=`$PKGCONFIG --modversion npth`
47   fi
48   npth_version_major=`echo $npth_version | \
49                sed 's/\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'`
50@@ -62,7 +47,7 @@ AC_DEFUN([AM_PATH_NPTH],
51
52   AC_MSG_CHECKING(for NPTH - version >= $min_npth_version)
53   ok=no
54-  if test "$NPTH_CONFIG" != "no" ; then
55+  if test "$PKGCONFIG" != "no" ; then
56     req_major=`echo $min_npth_version | \
57                sed 's/\([[0-9]]*\)\.\([[0-9]]*\)/\1/'`
58     req_minor=`echo $min_npth_version | \
59@@ -83,32 +68,9 @@ AC_DEFUN([AM_PATH_NPTH],
60   fi
61   if test $ok = yes; then
62     AC_MSG_RESULT([yes ($npth_version)])
63-  else
64-    AC_MSG_RESULT(no)
65-  fi
66-  if test $ok = yes; then
67-    # If we have a recent NPTH, we should also check that the
68-    # API is compatible.
69-    if test "$req_npth_api" -gt 0 ; then
70-      if test -z "$use_gpgrt_config"; then
71-        tmp=`$NPTH_CONFIG --api-version 2>/dev/null || echo 0`
72-      else
73-        tmp=`$NPTH_CONFIG --variable=api_version 2>/dev/null || echo 0`
74-      fi
75-      if test "$tmp" -gt 0 ; then
76-        AC_MSG_CHECKING([NPTH API version])
77-        if test "$req_npth_api" -eq "$tmp" ; then
78-          AC_MSG_RESULT([okay])
79-        else
80-          ok=no
81-          AC_MSG_RESULT([does not match. want=$req_npth_api got=$tmp])
82-        fi
83-      fi
84-    fi
85-  fi
86-  if test $ok = yes; then
87-    NPTH_CFLAGS=`$NPTH_CONFIG --cflags`
88-    NPTH_LIBS=`$NPTH_CONFIG --libs`
89+    NPTH_CFLAGS=`$PKGCONFIG --cflags npth`
90+    NPTH_LIBS=`$PKGCONFIG --libs npth`
91+    AC_MSG_WARN([[GOT HERE - $NPTH_LIBS ]])
92     ifelse([$2], , :, [$2])
93     if test -z "$use_gpgrt_config"; then
94       npth_config_host=`$NPTH_CONFIG --host 2>/dev/null || echo none`
95@@ -128,6 +90,7 @@ AC_DEFUN([AM_PATH_NPTH],
96       fi
97     fi
98   else
99+    AC_MSG_RESULT(no)
100     NPTH_CFLAGS=""
101     NPTH_LIBS=""
102     ifelse([$3], , :, [$3])
103