Skip to content

Commit

Permalink
Link with apt-X/apt-X HD library by pali.rohar
Browse files Browse the repository at this point in the history
Closes #356
  • Loading branch information
arkq committed Jan 24, 2021
1 parent b11cff0 commit d075cee
Show file tree
Hide file tree
Showing 21 changed files with 597 additions and 180 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ Dependencies:
- [fdk-aac](https://github.com/mstorsjo/fdk-aac) (when AAC support is enabled with `--enable-aac`)
- [openaptx](https://github.com/Arkq/openaptx) (when apt-X support is enabled with
`--enable-aptx` and/or `--enable-aptx-hd`)
- [libopenaptx](https://github.com/pali/libopenaptx) (when apt-X support is enabled and
`--with-libopenaptx` is used)
- [libldac](https://github.com/EHfive/ldacBT) (when LDAC support is enabled with `--enable-ldac`)
- [docutils](https://docutils.sourceforge.io) (when man pages build is enabled with `--enable-manpages`)

Expand Down
30 changes: 27 additions & 3 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ AC_ARG_WITH([libunwind],
AM_CONDITIONAL([WITH_LIBUNWIND], [test "x$with_libunwind" = "xyes"])
AM_COND_IF([WITH_LIBUNWIND], [
PKG_CHECK_MODULES([LIBUNWIND], [libunwind >= 1.1])
AC_DEFINE([ENABLE_LIBUNWIND], [1], [Define to 1 if libunwind shall be used.])
AC_DEFINE([WITH_LIBUNWIND], [1], [Define to 1 if libunwind shall be used.])
], [
AC_CHECK_HEADERS([execinfo.h])
])
Expand Down Expand Up @@ -95,22 +95,46 @@ AM_COND_IF([ENABLE_AAC], [
AC_DEFINE([ENABLE_AAC], [1], [Define to 1 if AAC is enabled.])
])

AC_ARG_WITH([libopenaptx],
[AS_HELP_STRING([--with-libopenaptx], [use libopenaptx by pali.rohar for apt-X (HD)])])
AM_CONDITIONAL([WITH_LIBOPENAPTX], [test "x$with_libopenaptx" = "xyes"])
AM_COND_IF([WITH_LIBOPENAPTX], [
PKG_CHECK_MODULES([APTX], [libopenaptx >= 0.2.0])
AC_DEFINE([HAVE_APTX_DECODE], [1], [Define to 1 if you have apt-X decode library.])
AC_DEFINE([HAVE_APTX_HD_DECODE], [1], [Define to 1 if you have apt-X HD decode library.])
AC_DEFINE([WITH_LIBOPENAPTX], [1], [Define to 1 if libopenaptx shall be used.])
])

AC_ARG_ENABLE([aptx],
[AS_HELP_STRING([--enable-aptx], [enable apt-X support])])
AM_CONDITIONAL([ENABLE_APTX], [test "x$enable_aptx" = "xyes"])
AM_COND_IF([ENABLE_APTX], [
PKG_CHECK_MODULES([APTX], [openaptx >= 1.2.0])
AM_COND_IF([WITH_LIBOPENAPTX], [], [
PKG_CHECK_MODULES([APTX], [openaptx >= 1.2.0])
if test "$($PKG_CONFIG --variable=aptxdecoder openaptx)" = "true"; then
AC_DEFINE([HAVE_APTX_DECODE], [1], [Define to 1 if you have apt-X decode library.])
fi
])
AC_DEFINE([ENABLE_APTX], [1], [Define to 1 if apt-X is enabled.])
])

AC_ARG_ENABLE([aptx_hd],
[AS_HELP_STRING([--enable-aptx-hd], [enable apt-X HD support])])
AM_CONDITIONAL([ENABLE_APTX_HD], [test "x$enable_aptx_hd" = "xyes"])
AM_COND_IF([ENABLE_APTX_HD], [
PKG_CHECK_MODULES([APTX_HD], [openaptxhd >= 1.2.0])
AM_COND_IF([WITH_LIBOPENAPTX], [], [
PKG_CHECK_MODULES([APTX_HD], [openaptxhd >= 1.2.0])
if test "$($PKG_CONFIG --variable=aptxdecoder openaptxhd)" = "true"; then
AC_DEFINE([HAVE_APTX_HD_DECODE], [1], [Define to 1 if you have apt-X HD decode library.])
fi
])
AC_DEFINE([ENABLE_APTX_HD], [1], [Define to 1 if apt-X HD is enabled.])
])

# OR-ed conditional which can be used in the Makefile.am
AM_CONDITIONAL([ENABLE_APTX_OR_APTX_HD], [
test "x$enable_aptx" = "xyes" -o "x$enable_aptx_hd" = "xyes"])

AC_ARG_ENABLE([ldac],
[AS_HELP_STRING([--enable-ldac], [enable LDAC support])])
AM_CONDITIONAL([ENABLE_LDAC], [test "x$enable_ldac" = "xyes"])
Expand Down
11 changes: 8 additions & 3 deletions src/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# BlueALSA - Makefile.am
# Copyright (c) 2016-2020 Arkadiusz Bokowy
# Copyright (c) 2016-2021 Arkadiusz Bokowy

bin_PROGRAMS = bluealsa
SUBDIRS = asound
Expand All @@ -24,16 +24,21 @@ bluealsa_SOURCES = \
bluealsa-iface.c \
bluez.c \
bluez-iface.c \
codec-sbc.c \
dbus.c \
hci.c \
sbc.c \
sco.c \
utils.c \
main.c

if ENABLE_APTX_OR_APTX_HD
bluealsa_SOURCES += \
codec-aptx.c
endif

if ENABLE_MSBC
bluealsa_SOURCES += \
msbc.c
codec-msbc.c
endif

if ENABLE_OFONO
Expand Down
Loading

0 comments on commit d075cee

Please sign in to comment.