Source: sip-tester
Version: 1:3.5.2-1
Tags: patch upstream
User: helm...@debian.org
Usertags: rebootstrap

sip-tester fails to cross build from source, because configure.ac hard
codes the build architecture pkg-config. Switching it to
PKG_CHECK_MODULES fixes the problem, but one has to ensure that the
macro is conditionalized with AS_IF rather than plain if, because it
uses AC_REQUIRE. The attached patch implements that and makes sip-tester
cross buildable. Please consider applying it.

Helmut
--- sip-tester-3.5.2.orig/configure.ac
+++ sip-tester-3.5.2/configure.ac
@@ -88,9 +88,7 @@
 
 # ==================== checks for libraries =============================
 
-if test "$have_pkgconfig" = "yes"; then
-    # Use pkg-config when available
-    PKG_PROG_PKG_CONFIG()
+AS_IF([test "$have_pkgconfig" = "yes"],[
     PKG_CHECK_MODULES([ncurses], [ncurses],
         LIBS="$LIBS $ncurses_LIBS",
         [PKG_CHECK_MODULES([curses], [curses],
@@ -100,11 +98,11 @@
                 AC_ERROR([Missing (n)curses library]))]
         )]
     )
-else
+],[
     # Olden ways
     AC_SEARCH_LIBS([initscr], [ncurses curses],,AC_ERROR([Missing (n)curses library]))
     AC_SEARCH_LIBS([stdscr], [tinfo ncurses curses],,AC_ERROR([Missing (n)curses/tinfo library]))
-fi
+])
 
 AC_CHECK_LIB(pthread, pthread_mutex_init, THREAD_LIBS="-lpthread",
     AC_MSG_ERROR(pthread library needed!))
@@ -194,7 +192,7 @@
 AM_CONDITIONAL(HAVE_RTP, test "$rtp" = "yes")
 
 # Conditional build with gsl
-if test "$gsl" = "yes"; then
+AS_IF([test "$gsl" = "yes"],[
     if test "$have_pkgconfig" != "yes" ; then
         AC_MSG_ERROR([Please install pkg-config to use the gsl libraries])
     fi
@@ -205,15 +203,12 @@
     AC_CHECK_LIB([gslcblas], [cblas_dgemm])
     AC_CHECK_LIB([gsl], [gsl_rng_alloc],
                  [
-                  GSL_CFLAGS=`pkg-config gsl --cflags`
-                  GSL_CXXFLAGS=`pkg-config gsl --cflags`
-                  GSL_LIBS=`pkg-config gsl --libs`
-                  AC_SUBST([GSL_CFLAGS])
+		  PKG_CHECK_MODULES([GSL],[gsl])
+		  GSL_CXXFLAGS=$GSL_CFLAGS
                   AC_SUBST([GSL_CXXFLAGS])
-                  AC_SUBST([GSL_LIBS])
                   ]
                  ,[AC_MSG_ERROR([gsl library missing])])
-fi
+])
 # For Makefile.am
 AM_CONDITIONAL(HAVE_GSL, test "$gsl" = "yes")
 

Reply via email to