$OpenBSD: patch-configure,v 1.16 2015/07/17 23:11:52 jasper Exp $

- last hunk: use ',' as separator, otherwise the paths in $pa_libs get
  interpreted as part of the regex.

--- configure.orig	Mon Aug 31 04:45:37 2009
+++ configure	Fri Jul 17 16:07:12 2015
@@ -822,7 +822,6 @@ JACK_CFLAGS
 JACK_LIBS'
 ac_subdirs_all='"lib-src/FileDialog"
 $CONFIG_SUBDIRS
-lib-src/portaudio-v19
 lib-src/portmixer'
 
 # Initialize some variables set by options.
@@ -6933,7 +6932,7 @@ if test "${ac_cv_lib_FLAC_FLAC__stream_decoder_new+set
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lFLAC -lFLAC++ -lFLAC $LIBS"
+LIBS="-lFLAC -lFLAC++ -lFLAC -logg $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -7136,7 +7135,7 @@ fi
 
    if test "x$lib_found" = "xyes" && test "x$header_found" = "xyes" ; then
       LIBFLAC_SYSTEM_AVAILABLE="yes"
-      LIBFLAC_SYSTEM_LIBS="-lFLAC++ -lFLAC"
+      LIBFLAC_SYSTEM_LIBS="-lFLAC++ -lFLAC -logg"
       LIBFLAC_SYSTEM_CPPSYMBOLS="USE_LIBFLAC"
       { $as_echo "$as_me:$LINENO: FLAC libraries are available as system libraries" >&5
 $as_echo "$as_me: FLAC libraries are available as system libraries" >&6;}
@@ -7684,12 +7683,12 @@ if test -n "$SOUNDTOUCH_CFLAGS"; then
     pkg_cv_SOUNDTOUCH_CFLAGS="$SOUNDTOUCH_CFLAGS"
  elif test -n "$PKG_CONFIG"; then
     if test -n "$PKG_CONFIG" && \
-    { ($as_echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"soundtouch-1.0 >= 1.3.0\"") >&5
-  ($PKG_CONFIG --exists --print-errors "soundtouch-1.0 >= 1.3.0") 2>&5
+    { ($as_echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"soundtouch >= 1.3.0\"") >&5
+  ($PKG_CONFIG --exists --print-errors "soundtouch >= 1.3.0") 2>&5
   ac_status=$?
   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; then
-  pkg_cv_SOUNDTOUCH_CFLAGS=`$PKG_CONFIG --cflags "soundtouch-1.0 >= 1.3.0" 2>/dev/null`
+  pkg_cv_SOUNDTOUCH_CFLAGS=`$PKG_CONFIG --cflags "soundtouch >= 1.3.0" 2>/dev/null`
 else
   pkg_failed=yes
 fi
@@ -7700,12 +7699,12 @@ if test -n "$SOUNDTOUCH_LIBS"; then
     pkg_cv_SOUNDTOUCH_LIBS="$SOUNDTOUCH_LIBS"
  elif test -n "$PKG_CONFIG"; then
     if test -n "$PKG_CONFIG" && \
-    { ($as_echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"soundtouch-1.0 >= 1.3.0\"") >&5
-  ($PKG_CONFIG --exists --print-errors "soundtouch-1.0 >= 1.3.0") 2>&5
+    { ($as_echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"soundtouch >= 1.3.0\"") >&5
+  ($PKG_CONFIG --exists --print-errors "soundtouch >= 1.3.0") 2>&5
   ac_status=$?
   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; then
-  pkg_cv_SOUNDTOUCH_LIBS=`$PKG_CONFIG --libs "soundtouch-1.0 >= 1.3.0" 2>/dev/null`
+  pkg_cv_SOUNDTOUCH_LIBS=`$PKG_CONFIG --libs "soundtouch >= 1.3.0" 2>/dev/null`
 else
   pkg_failed=yes
 fi
@@ -7723,9 +7722,9 @@ else
         _pkg_short_errors_supported=no
 fi
         if test $_pkg_short_errors_supported = yes; then
-	        SOUNDTOUCH_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "soundtouch-1.0 >= 1.3.0" 2>&1`
+	        SOUNDTOUCH_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "soundtouch >= 1.3.0" 2>&1`
         else
-	        SOUNDTOUCH_PKG_ERRORS=`$PKG_CONFIG --print-errors "soundtouch-1.0 >= 1.3.0" 2>&1`
+	        SOUNDTOUCH_PKG_ERRORS=`$PKG_CONFIG --print-errors "soundtouch >= 1.3.0" 2>&1`
         fi
 	# Put the nasty error message in config.log where it belongs
 	echo "$SOUNDTOUCH_PKG_ERRORS" >&5
@@ -9215,13 +9214,8 @@ _ACEOF
 esac
 
 
-LOCAL_LIBS="$LOCAL_LIBS portaudio-v19/lib/libportaudio.a"
-EXTRAOBJS="$EXTRAOBJS ../lib-src/portaudio-v19/lib/libportaudio.a"
-CXXFLAGS="-I\$(top_srcdir)/lib-src/portaudio-v19/include $CXXFLAGS"
 
-subdirs="$subdirs lib-src/portaudio-v19"
 
-
 case "${host_os}" in
    darwin* | rhapsody*)
       LIBS="-framework AudioUnit -framework AudioToolbox $LIBS"
@@ -9371,9 +9365,7 @@ else
 $as_echo "yes" >&6; }
 	have_jack=yes
 fi
-      if [ $have_jack = "yes" ] ; then
-         LIBS="$LIBS $JACK_LIBS"
-      fi
+
       { $as_echo "$as_me:$LINENO: checking for HPI_SubSysCreate in -lhpi" >&5
 $as_echo_n "checking for HPI_SubSysCreate in -lhpi... " >&6; }
 if test "${ac_cv_lib_hpi_HPI_SubSysCreate+set}" = set; then
@@ -9637,7 +9629,6 @@ _ACEOF
 
    subdirs="$subdirs lib-src/portmixer"
 
-   ac_configure_args="$ac_configure_args --with-pa-include=../portaudio-v19/include"
 fi
 
 { $as_echo "$as_me:$LINENO: checking for lrint" >&5
@@ -11255,7 +11246,7 @@ $as_echo "$as_me: WARNING: no configuration informatio
       { $as_echo "$as_me:$LINENO: running $SHELL $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir" >&5
 $as_echo "$as_me: running $SHELL $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir" >&6;}
       # The eval makes quoting arguments work.
-      eval "\$SHELL \"\$ac_sub_configure\" $ac_sub_configure_args \
+      eval "\$SHELL \"\$ac_sub_configure\" $ac_sub_configure_args CFLAGS='"$CFLAGS"' CXXFLAGS='"$CXXFLAGS"' LDFLAGS='"$LDFLAGS"' \
 	   --cache-file=\"\$ac_sub_cache_file\" --srcdir=\"\$ac_srcdir\"" ||
 	{ { $as_echo "$as_me:$LINENO: error: $ac_sub_configure failed for $ac_dir" >&5
 $as_echo "$as_me: error: $ac_sub_configure failed for $ac_dir" >&2;}
@@ -11271,9 +11262,8 @@ $as_echo "$as_me: WARNING: unrecognized options: $ac_u
 fi
 
 
-pa_libs=
-pa_libs=`grep 'Libs:' lib-src/portaudio-v19/portaudio-2.0.pc | sed -e 's/Libs://;s/-L${libdir}//;s/-lportaudio//'`
-sed -i -e "s/@PA_LIBS@/$pa_libs/" src/Makefile
+pa_libs=`pkg-config --libs portaudio-2.0`
+sed -i -e "s,@PA_LIBS@,$pa_libs," src/Makefile
 
 echo ""
 echo "Finished configure:"
