]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-8779: [mod_shout] properly detect lame/lame.h
authorCorey Smith <corsmith@gmail.com>
Thu, 4 Feb 2016 01:45:39 +0000 (20:45 -0500)
committerCorey Smith <corsmith@gmail.com>
Thu, 4 Feb 2016 01:45:39 +0000 (20:45 -0500)
* Add correct mp3lame configure check since it does not use pkg-config
* Update mod_shout Makefile to log failure message if mp3lame not available
* Rewrite #include for lame.h to lame/lame.h in mod_shout.c

configure.ac
src/mod/formats/mod_shout/Makefile.am
src/mod/formats/mod_shout/mod_shout.c

index 2ac890a386568b3c83b921541344d17974017fe1..1085d7cb9cbaa58a3552fc818d453df353541139 100644 (file)
@@ -1291,9 +1291,13 @@ PKG_CHECK_MODULES([SHOUT], [shout >= 2.2.2],[
   AM_CONDITIONAL([HAVE_SHOUT],[true])],[
   AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_SHOUT],[false])])
 
-PKG_CHECK_MODULES([MP3LAME], [mp3lame],[
-  AM_CONDITIONAL([HAVE_MP3LAME],[true])],[
-  AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_MP3LAME],[false])])
+mp3lame=false
+AC_CHECK_LIB([mp3lame], [lame_init],[
+  AC_CHECK_HEADER([lame/lame.h],[
+    mp3lame=true
+    AC_SUBST([MP3LAME_LIBS], [-lmp3lame])
+    AC_SUBST([MP3LAME_CFLAGS], [$CPPFLAGS])])])
+AM_CONDITIONAL([HAVE_MP3LAME],[$mp3lame])
 
 PKG_CHECK_MODULES([AVCODEC], [libavcodec >= 53.35.0],[
   AM_CONDITIONAL([HAVE_AVCODEC],[true])],[
index 362561d3b764b56012ea38ff2f036b680f081d32..7fd8e01ab351dd50712f88e5561384f5840534cb 100644 (file)
@@ -3,6 +3,7 @@ MODNAME=mod_shout
 
 if HAVE_SHOUT
 if HAVE_MPG123
+if HAVE_MP3LAME
 
 mod_LTLIBRARIES = mod_shout.la
 mod_shout_la_SOURCES  = mod_shout.c
@@ -11,10 +12,11 @@ mod_shout_la_CPPFLAGS = $(CURL_CFLAGS) $(AM_CPPFLAGS) $(SHOUT_CFLAGS) $(MP3LAME_
 mod_shout_la_LIBADD   = $(switch_builddir)/libfreeswitch.la
 mod_shout_la_LDFLAGS  = $(CURL_LIBS) -avoid-version -module -no-undefined -shared $(SHOUT_LIBS) $(MP3LAME_LIBS) $(MPG123_LIBS)
 
-
-if !HAVE_MP3LAME
-mod_shout_la_LDFLAGS += -lmp3lame
-mod_shout_la_CFLAGS += -I/usr/include/lame
+else
+install: error
+all: error
+error:
+       $(error You must install libmp3lame-dev to build mod_shout)
 endif
 
 else
index 7e5cc2fef5e05db1795ebbfd3e51b50a3b63ab88..60275ff3e700fd7759eaecc65e3767f6e6488ecc 100644 (file)
@@ -35,7 +35,7 @@
 #include <switch.h>
 #include "mpg123.h"
 #include <shout/shout.h>
-#include <lame.h>
+#include <lame/lame.h>
 #include <switch_curl.h>
 
 #define OUTSCALE 8192 * 2