@@ -1517,6 +1517,90 @@ AC_MSG_NOTICE([checking package dependencies])
1517
1517
1518
1518
AC_PATH_PROG ( [ PKG_CONFIG] ,[ pkg-config] )
1519
1519
1520
+ #
1521
+ # Chip over Ble over Bluez Peripheral support
1522
+ #
1523
+
1524
+ # Only a concern when the BLE layer is enabled.
1525
+
1526
+ CONFIG_BLE_PLATFORM_BLUEZ=0
1527
+ enable_woble_bluez="no"
1528
+
1529
+ NL_WITH_OPTIONAL_INTERNAL_PACKAGE(
1530
+ [ BlueZ] ,
1531
+ [ BLUEZ] ,
1532
+ [ bluez] ,
1533
+ [ -lgdbus-internal -lshared-glib] ,
1534
+ [
1535
+ # actions if not external
1536
+ # At this time, enable this only for linux, and only if the tests are enabled
1537
+ if test "${nl_cv_build_tests}" = "yes" && test "${CONFIG_NETWORK_LAYER_BLE}" = 1 && test "${with_device_layer}" = "linux"; then
1538
+ case "${target}" in
1539
+
1540
+ *linux*)
1541
+ if test "x${HAVE_CXX11}" == "0"; then
1542
+ AC_MSG_ERROR ( [ BlueZ support requires C++11 compiler] )
1543
+ fi
1544
+ CONFIG_BLE_PLATFORM_BLUEZ=1
1545
+ enable_woble_bluez="yes"
1546
+ ;;
1547
+
1548
+ *)
1549
+ CONFIG_BLE_PLATFORM_BLUEZ=0
1550
+ enable_woble_bluez="no"
1551
+ ;;
1552
+
1553
+ esac
1554
+ fi
1555
+ ]
1556
+ )
1557
+
1558
+ # Depending on whether bluez has been configured for an internal
1559
+ # location, its directory stem within this package needs to be set
1560
+ # accordingly. In addition, if the location is internal, then we need
1561
+ # to attempt to pull it down using the bootstrap makefile.
1562
+
1563
+ if test "${nl_with_bluez}" = "internal" && test "${enable_woble_bluez}" = "yes"; then
1564
+ maybe_bluez_dirstem="bluez/repo"
1565
+ bluez_dirstem="third_party/${maybe_bluez_dirstem}"
1566
+
1567
+ AC_MSG_NOTICE ( [ attempting to create internal ${bluez_dirstem}] )
1568
+
1569
+ ${MAKE-make} --no-print-directory -C ${srcdir} -f Makefile-bootstrap ${bluez_dirstem}
1570
+
1571
+ if test $? -ne 0; then
1572
+ AC_MSG_ERROR ( [ failed to create ${bluez_dirstem}. Please check your network connection or the correctness of 'repos.conf'] )
1573
+ fi
1574
+
1575
+ echo " BOOTSTRAP ${bluez_dirstem}"
1576
+
1577
+ (cd ${srcdir}/${bluez_dirstem} && ./bootstrap)
1578
+
1579
+ else
1580
+ maybe_bluez_dirstem=""
1581
+ fi
1582
+
1583
+ AC_SUBST ( BLUEZ_SUBDIRS , [ ${maybe_bluez_dirstem}] )
1584
+ AM_CONDITIONAL([ CHIP_WITH_BLUEZ_INTERNAL] , [ test "${nl_with_bluez}" = "internal"] )
1585
+
1586
+ AM_CONDITIONAL([ CONFIG_BLE_PLATFORM_BLUEZ] , [ test "${enable_woble_bluez}" = "yes"] )
1587
+ AC_DEFINE_UNQUOTED ( [ CONFIG_BLE_PLATFORM_BLUEZ] ,[ ${CONFIG_BLE_PLATFORM_BLUEZ}] ,[ Define to 1 if you want to enable Chip over Ble over bluez.] )
1588
+
1589
+ if test "${enable_woble_bluez}" = "yes"; then
1590
+ PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.28, dummy=yes,
1591
+ AC_MSG_ERROR ( GLib >= 2.28 is required ) )
1592
+ AC_SUBST ( GLIB_CFLAGS )
1593
+ AC_SUBST ( GLIB_LIBS )
1594
+
1595
+ PKG_CHECK_MODULES(DBUS, dbus-1 >= 1.6, dummy=yes,
1596
+ AC_MSG_ERROR ( D-Bus >= 1.6 is required ) )
1597
+ AC_SUBST ( DBUS_CFLAGS )
1598
+ AC_SUBST ( DBUS_LIBS )
1599
+
1600
+ AX_CHECK_COMPILER_OPTIONS([ C] , ${GLIB_CFLAGS} ${DBUS_CFLAGS})
1601
+ AX_CHECK_COMPILER_OPTIONS([ C++] , ${GLIB_CFLAGS} ${DBUS_CFLAGS})
1602
+ fi
1603
+
1520
1604
#
1521
1605
# OpenSSL
1522
1606
#
@@ -2190,6 +2274,10 @@ AC_CONFIG_SUBDIRS([third_party/nlfaultinjection/repo])
2190
2274
AC_SUBST ( NLFAULTINJECTION_FOREIGN_SUBDIR_DEPENDENCY ,[ "${ac_pwd}/third_party/nlfaultinjection/repo/src"] )
2191
2275
fi
2192
2276
2277
+ if test "${nl_with_bluez}" = "internal" && test "${enable_woble_bluez}" = "yes"; then
2278
+ AC_CONFIG_SUBDIRS ( [ third_party/bluez/repo] )
2279
+ fi
2280
+
2193
2281
if test "${nl_with_mbedtls}" = "internal"; then
2194
2282
AC_CONFIG_SUBDIRS ( [ third_party/mbedtls/repo] )
2195
2283
fi
@@ -2309,6 +2397,8 @@ AC_MSG_NOTICE([
2309
2397
Doxygen : ${DOXYGEN:--}
2310
2398
GraphViz dot : ${DOT:--}
2311
2399
PERL : ${PERL:--}
2400
+ BlueZ peripheral support : ${enable_woble_bluez:--}
2401
+ BlueZ source : ${nl_with_bluez:--}
2312
2402
Valgrind : ${VALGRIND:--}
2313
2403
LwIP source : ${nl_with_lwip:--}
2314
2404
LwIP compile flags : ${LWIP_CPPFLAGS:--}
0 commit comments