From 1e1d4866f0aee6be8ae906dc2a082ba494d40b6c Mon Sep 17 00:00:00 2001
From: Mike Jerris <mike@signalwire.com>
Date: Tue, 4 Aug 2020 13:16:50 -0400
Subject: [PATCH] [build] detect system installed sofia-sip using
 PKG_CONFIG_PATH

---
 libs/unimrcp/build/acmacros/sofia-sip.m4 | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/libs/unimrcp/build/acmacros/sofia-sip.m4 b/libs/unimrcp/build/acmacros/sofia-sip.m4
index 1d83eacf79..ef1dfcb8d9 100644
--- a/libs/unimrcp/build/acmacros/sofia-sip.m4
+++ b/libs/unimrcp/build/acmacros/sofia-sip.m4
@@ -29,6 +29,12 @@ AC_DEFUN([UNIMRCP_CHECK_SOFIA],
             fi
         done
 
+	dnl Check for installed Sofia-SIP in PKG_CONFIG_PATH
+	if test "$found_sofia" != "yes" && $PKG_CONFIG sofia-sip-ua > /dev/null 2>&1 ; then
+	   found_sofia="yes"
+	   sofia_config_path="sofia-sip-ua"
+	fi
+
         dnl Check for full path to Sofia-SIP pkg-config file
         if test "$found_sofia" != "yes" && test -f "$sofia_path" && $PKG_CONFIG $sofia_path > /dev/null 2>&1 ; then
             found_sofia="yes"