]> git.ipfire.org Git - thirdparty/shairport-sync.git/commitdiff
Sometimes libsoxr is built to rely on libavutil. If libavutil is detected, link to...
authorMike Brady <mikebrady@eircom.net>
Sat, 25 Aug 2018 12:08:37 +0000 (13:08 +0100)
committerMike Brady <mikebrady@eircom.net>
Sat, 25 Aug 2018 12:08:37 +0000 (13:08 +0100)
configure.ac

index 0c917a43f18dba3201840941f8af0368c5b3f752..2b6fddb34c5f7dd4566c3e69b3dc6d1d95b952c5 100644 (file)
@@ -176,7 +176,20 @@ AC_ARG_WITH(ssl, [ choose --with-ssl=openssl, --with-ssl=mbedtls or --with-ssl=p
 # Look for soxr flag
 AC_ARG_WITH(soxr, [  --with-soxr = choose libsoxr for high-quality interpolation], [
   AC_MSG_RESULT(>>Including support for soxr-based interpolation)
-  AC_CHECK_LIB([soxr],[soxr_create], , AC_MSG_ERROR(soxr support requested but libsoxr not found!))], )
+  if  test "x${with_pkg_config}" = xyes ; then
+    PKG_CHECK_MODULES(
+        [SOXR], [soxr],
+        [LIBS="${SOXR_LIBS} ${LIBS}"])
+  else
+    AC_CHECK_LIB([avutil],[av_get_cpu_flags])
+    if  test "x${ac_cv_lib_avutil_av_get_cpu_flags}" = xyes ; then
+      # soxr may link against libavutil, depending on the architecture, but for the sake of simplicity link with it if it is found
+      AC_CHECK_LIB([soxr],[soxr_create], , AC_MSG_ERROR(soxr support requested but libsoxr not found!), [-lavutil])
+    else
+      AC_CHECK_LIB([soxr],[soxr_create], , AC_MSG_ERROR(soxr support requested but libsoxr not found!))
+    fi
+  fi
+], )
 
 # Look for metadata flag -- set flag for conditional compilation
 AC_ARG_WITH(metadata, [  --with-metadata = include support for a metadata feed], [