autotools: Add possibility to build without optional codec SBC
authorMichal Labedzki <michal.labedzki@tieto.com>
Tue, 30 Dec 2014 10:18:35 +0000 (11:18 +0100)
committerMichal Labedzki <michal.labedzki@tieto.com>
Thu, 8 Jan 2015 14:07:37 +0000 (14:07 +0000)
SBC is optional but build any time if configure script detect it,
so let user choose if it really want it. Default to build with SBC.

Bug: 10794

Change-Id: I1b936c628c9de0179aa3d5da5ac547bd910af8ba
Reviewed-on: https://code.wireshark.org/review/6399
Petri-Dish: Michal Labedzki <michal.labedzki@tieto.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Tested-by: Michal Labedzki <michal.labedzki@tieto.com>
Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com>
configure.ac

index 13ac6beb18a3fe833542aefca0cf3885839f58b8..a13c9de831630c54ff5f21c1c8c89ad534ebb11d 100644 (file)
@@ -2793,11 +2793,20 @@ AC_SUBST(wireshark_SUBDIRS)
 
 # Check Bluetooth SBC codec for RTP Player
 # git://git.kernel.org/pub/scm/bluetooth/sbc.git
+AC_ARG_WITH([sbc],
+  AC_HELP_STRING( [--with-sbc=@<:@yes/no@:>@],
+                  [use SBC codec to play Bluetooth A2DP stream @<:@default=yes@:>@]),
+  with_sbc="$withval", with_sbc="yes")
+
 PKG_CHECK_MODULES(SBC, sbc >= 1.0, [have_sbc=yes], [have_sbc=no])
-if (test "${have_sbc}" = "yes"); then
-    AC_DEFINE(HAVE_SBC, 1, [Define to support playing SBC by standalone BlueZ SBC library])
-    CFLAGS="$CFLAGS $(pkg-config sbc --cflags)"
-    LIBS="$LIBS $(pkg-config sbc --libs)"
+if test "x$with_sbc" = "xyes"; then
+    if (test "${have_sbc}" = "yes"); then
+        AC_DEFINE(HAVE_SBC, 1, [Define to support playing SBC by standalone BlueZ SBC library])
+        CFLAGS="$CFLAGS $(pkg-config sbc --cflags)"
+        LIBS="$LIBS $(pkg-config sbc --libs)"
+    fi
+else
+    have_sbc=no
 fi
 
 dnl