dbus_validate_path() was introduced in D-Bus 1.6 and it is no longer
possible to build with 1.4.
CCLD tools/bluetooth-player
tools/bluetooth-player.o: In function `cmd_change_folder':
tools/bluetooth-player.c:741: undefined reference to `dbus_validate_path'
collect2: ld returned 1 exit status
This patch adds initial support for storing adapter configuration.
Currently stored data is address, name and discoverable timeout.
Since Android daemon storage format is to be simpler than Linux check
if correct adapter is used before going operational. This is
a precaution to avoid e.g. using linkkeys generated for different
controller.
Bring AC_SUBST(*_CFLAGS) and AC_SUBST(*_LIBS) in the same block of the
corresponding PKG_CHECK_MODULES() call.
Having these variables defined outside of the if tests is more than what
is needed as the corresponding PKG_CHECK_MODULES() might not have been
called at all there.
This is the same logic already used for USB_CFLAGS and USB_LIBS.
Call AC_SUBST unconditionally when specifying --with-* options,
otherwise options like --with-dbusconfdir=DIR or --with-udevdir=DIR have
no effect.
Before this change, configuring with:
$ mkdir build
$ ./configure --disable-systemd \
--prefix=$(pwd)/build \
--with-dbusconfdir=$(pwd)/build/etc
resulted in the option value to be ignored at "make install" time, with
this error:
/bin/mkdir: cannot create directory '/dbus-1/system.d': Permission denied
This is what was going on in configure.ac:
# define the option
AC_ARG_WITH([dbusconfdir] ... [path_dbusconfdir=${withval}])
# when --with-dbusconfdir is NOT used
if (test -z "${path_dbusconfdir}"); then
...
# define the config dir automatically
path_dbusconfdir="`$PKG_CONFIG --variable=sysconfdir dbus-1`"
...
# set DBUS_CONFDIR
AC_SUBST(DBUS_CONFDIR, [${path_dbusconfdir}])
endif
when --with-dbusconfdir=SOMEDIR was used the test above failed, and the
result was that ${path_dbusconfdir} was indeed defined as manually
specified, but DBUS_CONFDIR was not, and the latter was going to be used
in Makefile.am:
dbusdir = @DBUS_CONFDIR@/dbus-1/system.d
The failure in mkdir can be exposed by the use of the "--prefix" option
and by running "make install" as a normal user; when running "make
install" with the root user /dbus-1/system.d would be happily (and
wrongly) created.
By always setting variables relative to --with-* options (like
DBUS_CONFDIR) the cases when --with-someoption=SOMEDIR are used get
covered.