[vlc-commits] configure.ac: handle faad pkgconfig

Francois Cartegnie git at videolan.org
Mon May 18 21:09:40 CEST 2020


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Thu Apr 30 14:26:14 2020 +0200| [eea2b42638cd5d6e1a5b0b78f41f71f325160b51] | committer: Francois Cartegnie

configure.ac: handle faad pkgconfig

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=eea2b42638cd5d6e1a5b0b78f41f71f325160b51
---

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

diff --git a/configure.ac b/configure.ac
index 17c776e383..aa140c941d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2803,25 +2803,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 e490173d24..e3e1316602 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



More information about the vlc-commits mailing list