From 1cf72863d18e95e1bf2fd440c9e9c7203d26d09a Mon Sep 17 00:00:00 2001
From: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com>
Date: Thu, 19 Mar 2009 12:45:24 -0400
Subject: [PATCH] Fix hardcoded linking path in libiax2

---
 configure.ac                | 10 +++++-----
 libs/libiax2/iax2-config.in |  6 +++---
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/configure.ac b/configure.ac
index 988fc35e53..8d6672d488 100644
--- a/configure.ac
+++ b/configure.ac
@@ -270,14 +270,14 @@ AC_ARG_WITH([iax2],
 
 LIBIAX2=
 AS_IF([test "x$with_iax2" != xno],
-  [AC_CHECK_LIB([iax2], [iax_init],
+    [AC_CHECK_HEADER([iax2/iax.h], , AC_MSG_FAILURE([Unable to find the libiax2 headers. You may need to install sflphone-iax2-dev package. You may use --without-iax2 to compile without iax2 protocol support.]))]
+    [AC_CHECK_LIB([iax2], [iax_init],
     [],
     [AC_MSG_FAILURE(
-       [libiax2 link test failed. You need the sflphone-iax2 package.  You may use --without-iax2 to compile without iax2 protocol support.])]
+       [libiax2 link test failed. You may use --without-iax2 to compile without iax2 protocol support.])]
        )
-   ]
-  [AC_CHECK_HEADER([iax2/iax.h], , AC_MSG_FAILURE([Unable to find the libiax2 headers. You may need to install sflphone-iax2-dev package. You may use --without-iax2 to compile without iax2 protocol support.]))]
-   )
+    ]
+)
     
 AC_DEFINE([HAVE_IAX], test "x$with_iax2" = "xyes", [Define if you have libiax2])
 AM_CONDITIONAL(USE_IAX, test "x$with_iax2" = "xyes" )
diff --git a/libs/libiax2/iax2-config.in b/libs/libiax2/iax2-config.in
index 360b79f6d7..295e69a97b 100644
--- a/libs/libiax2/iax2-config.in
+++ b/libs/libiax2/iax2-config.in
@@ -1,11 +1,11 @@
 #!/bin/sh
-iax_libs="-L/usr/lib -liax2"
-iax_cflags=""
-
 prefix=@prefix@
 exec_prefix=@exec_prefix@
 exec_prefix_set=no
 
+iax_libs="-L$prefix -liax2"
+iax_cflags=""
+
 usage="\
 Usage: iax2-config [--prefix[=DIR]] [--exec-prefix[=DIR]] [--version] [--libs] [--cflags]"
 
-- 
GitLab