[vlc-devel] [PATCH] configure.ac: handle faad pkgconfig

Francois Cartegnie fcvlcdev at free.fr
Thu May 14 16:34:33 CEST 2020


Since 2.9.2 provides pkgconfig file

---
 configure.ac              | 36 ++++++++++++++++++------------------
 modules/codec/Makefile.am |  2 +-
 2 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/configure.ac b/configure.ac
index cc682e94c3..2f0a2f559f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2832,25 +2832,25 @@ fi
 dnl
 dnl  faad decoder plugin
 dnl
-AC_ARG_ENABLE([faad],
-AS_HELP_STRING([--enable-faad], [faad codec (default auto)]))
-have_faad="no"
-AS_IF([test "${enable_faad}" != "no"], [
-  AC_CHECK_HEADERS([neaacdec.h], [
-    AC_CHECK_LIB([faad], [NeAACDecOpen], [have_faad="yes"],, [$LIBM])
-
-    AS_IF([test "${have_faad}" = "yes"], [
-      VLC_ADD_PLUGIN([faad])
-      VLC_ADD_LIBS([faad],[-lfaad])
-    ], [
-      AS_IF([test "${enable_faad}" = "yes"], [
-        AC_MSG_ERROR([cannot find FAAD library])
-      ], [
-        AC_MSG_WARN([cannot find FAAD library])
-      ])
+PKG_WITH_MODULES([FAAD],[faad2],
+  VLC_ADD_PLUGIN(faad)
+  VLC_ADD_CFLAGS(faad, [$FAAD_CFLAGS])
+  VLC_ADD_LIBS(faad,[$FAAD_LIBS]),
+  AS_IF([test "x${enable_faad}" != "xno"],[
+    AC_CHECK_HEADERS([neaacdec.h], [
+      AC_CHECK_LIB([faad], [NeAACDecOpen],[
+                      VLC_ADD_PLUGIN([faad])
+                      VLC_ADD_LIBS([faad],[-lfaad])
+                      found_faad="yes"
+                   ],[], [$LIBM])
     ])
-  ])
-])
+    AS_IF([test "x${found_faad}" != "xyes"],
+        AS_IF([test "x${enable_faad}" == "xyes"],
+            AC_MSG_ERROR([${FAAD_PKG_ERRORS}.]),
+            AC_MSG_WARN([${FAAD_PKG_ERRORS}.]))
+    )
+  ]),
+[faad AAC audio decoder])
 
 dnl
 dnl  AOM decoder plugin
diff --git a/modules/codec/Makefile.am b/modules/codec/Makefile.am
index 947b68ee33..01e17499e8 100644
--- a/modules/codec/Makefile.am
+++ b/modules/codec/Makefile.am
@@ -41,7 +41,7 @@ libaraw_plugin_la_LIBADD = $(LIBM)
 codec_LTLIBRARIES += libaraw_plugin.la
 
 libfaad_plugin_la_SOURCES = codec/faad.c packetizer/mpeg4audio.h
-libfaad_plugin_la_CPPFLAGS = $(AM_CPPFLAGS) $(CPPFLAGS_faad)
+libfaad_plugin_la_CPPFLAGS = $(AM_CPPFLAGS) $(CFLAGS_faad)
 libfaad_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(codecdir)'
 libfaad_plugin_la_LIBADD = $(LIBS_faad) $(LIBM)
 EXTRA_LTLIBRARIES += libfaad_plugin.la
-- 
2.25.4



More information about the vlc-devel mailing list