# HG changeset patch # User Rik # Date 1430541549 25200 # Node ID 3b3579ad7e46b269e99eff7ca9c9aa921b995e80 # Parent 8187a66039e4792a62803af8181f190e6baafae2 Check for a modern version of sndfile in configure scripts (bug #44976). * configure.ac: Call OCTAVE_CHECK_LIB_SNDFILE_OK after first determining that sndfile library exists. * m4/acinclude.m4 (OCTAVE_CHECK_LIB_SNDFILE_OK): New macro to check for a modern version of lib sndfile with Ogg support. diff -r 8187a66039e4 -r 3b3579ad7e46 configure.ac --- a/configure.ac Fri May 01 13:37:26 2015 -0700 +++ b/configure.ac Fri May 01 21:39:09 2015 -0700 @@ -1020,7 +1020,7 @@ SNDFILE_CPPFLAGS=`$PKG_CONFIG --cflags-only-I sndfile` SNDFILE_LDFLAGS=`$PKG_CONFIG --libs-only-L sndfile` SNDFILE_LIBS=`$PKG_CONFIG --libs-only-l sndfile` - warn_sndfile= + OCTAVE_CHECK_LIB_SNDFILE_OK([warn_sndfile=]) ]) fi @@ -1031,6 +1031,7 @@ SNDFILE_LDFLAGS= SNDFILE_LIBS= fi + AC_SUBST(SNDFILE_CPPFLAGS) AC_SUBST(SNDFILE_LDFLAGS) AC_SUBST(SNDFILE_LIBS) diff -r 8187a66039e4 -r 3b3579ad7e46 m4/acinclude.m4 --- a/m4/acinclude.m4 Fri May 01 13:37:26 2015 -0700 +++ b/m4/acinclude.m4 Fri May 01 21:39:09 2015 -0700 @@ -1059,6 +1059,28 @@ : fi ]) +dnl +dnl Check whether sndfile library is modern enough to include things like Ogg +dnl +AC_DEFUN([OCTAVE_CHECK_LIB_SNDFILE_OK], [ + AC_CACHE_CHECK([whether sndfile library is modern enough], + [octave_cv_lib_sndfile_ok], + [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ + #include + ]], [[ + int x = SF_FORMAT_OGG; + ]])], + octave_cv_lib_sndfile_ok=yes, + octave_cv_lib_sndfile_ok=no) + ]) + if test $octave_cv_lib_sndfile_ok = yes; then + $1 + : + else + $2 + : + fi +]) dnl dnl Find a suitable termlib to use. dnl