From cc6abc3278d042595439d8dc5d74bdb56eb6fa86 Mon Sep 17 00:00:00 2001 From: "matthias.ringwald" Date: Fri, 28 Aug 2009 20:37:48 +0000 Subject: [PATCH] added --enable-launchd configure flag --- TODO.txt | 2 ++ aclocal.m4 | 35 ++++++++++++++++++++++------------- configure.in | 18 ++++++++++++------ src/socket_connection.c | 3 ++- 4 files changed, 38 insertions(+), 20 deletions(-) diff --git a/TODO.txt b/TODO.txt index e90dbe2d1..8d0948e36 100644 --- a/TODO.txt +++ b/TODO.txt @@ -36,6 +36,8 @@ NEXT: - error notification - flow control - reassembly/segmentation +- autostart of BTdaemon (inetd? launchd?) +- automatic disable of alternative Bluetooth Stack (e.g., BTServer on iPhone) - DEMOS: - BTstack-cmd - info diff --git a/aclocal.m4 b/aclocal.m4 index 1306e82d9..6cccc51f2 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -1,4 +1,4 @@ -# generated automatically by aclocal 1.10.1 -*- Autoconf -*- +# generated automatically by aclocal 1.10.2 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006, 2007, 2008 Free Software Foundation, Inc. @@ -13,7 +13,7 @@ m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl -m4_if(AC_AUTOCONF_VERSION, [2.63],, +m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.63],, [m4_warning([this file was generated for autoconf 2.63. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. @@ -175,7 +175,7 @@ else fi[]dnl ])# PKG_CHECK_MODULES -# Copyright (C) 2002, 2003, 2005, 2006, 2007 Free Software Foundation, Inc. +# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -190,7 +190,7 @@ AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.10' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. -m4_if([$1], [1.10.1], [], +m4_if([$1], [1.10.2], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) @@ -204,12 +204,12 @@ m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. -# This function is AC_REQUIREd by AC_INIT_AUTOMAKE. +# This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], -[AM_AUTOMAKE_VERSION([1.10.1])dnl +[AM_AUTOMAKE_VERSION([1.10.2])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl -_AM_AUTOCONF_VERSION(AC_AUTOCONF_VERSION)]) +_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- @@ -459,19 +459,28 @@ _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl # Generate code to set up dependency tracking. -*- Autoconf -*- -# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -#serial 3 +#serial 4 # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], -[for mf in $CONFIG_FILES; do +[# Autoconf 2.62 quotes --file arguments for eval, but not when files +# are listed without --file. Let's play safe and only enable the eval +# if we detect the quoting. +case $CONFIG_FILES in +*\'*) eval set x "$CONFIG_FILES" ;; +*) set x $CONFIG_FILES ;; +esac +shift +for mf +do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. @@ -803,13 +812,13 @@ esac # Helper functions for option handling. -*- Autoconf -*- -# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. +# Copyright (C) 2001, 2002, 2003, 2005, 2008 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 3 +# serial 4 # _AM_MANGLE_OPTION(NAME) # ----------------------- @@ -826,7 +835,7 @@ AC_DEFUN([_AM_SET_OPTION], # ---------------------------------- # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], -[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) +[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- diff --git a/configure.in b/configure.in index 78231beb5..e2ec1e536 100644 --- a/configure.in +++ b/configure.in @@ -10,6 +10,7 @@ AC_ARG_WITH(uart-device, [AS_HELP_STRING([--with-uart-device=uartDevice], [Speci AC_ARG_WITH(uart-speed, [AS_HELP_STRING([--with-uart-speed=uartSpeed], [Specify BT UART speed to use])], UART_SPEED=$withval, UART_SPEED="115200") AC_ARG_ENABLE(bluetool, [AS_HELP_STRING([--disable-bluetool],[Disable init of Bluetooth module by BlueTool])], USE_BLUETOOL=$enableval, USE_BLUETOOL="DEFAULT") AC_ARG_ENABLE(springboard, [AS_HELP_STRING([--disable-springboard],[Disable display of BTstack status in SpringBoard])], USE_SPRINGBOARD=$enableval, USE_SPRINGBOARD="DEFAULT") +AC_ARG_ENABLE(launchd, [AS_HELP_STRING([--enable-launchd],[Compiles BTdaemon for use by launchd])], USE_LAUNCHD=$enableval, USE_LAUNCHD="NO") AC_ARG_WITH(iphone-ip, [AS_HELP_STRING([--with-iphone-ip=192.168.1.5], [Specify IP address used by iPhone for installation (not supported yet)])], IPHONE_IP=$withval, IPHONE_IP="") AC_ARG_WITH(vendor-id, [AS_HELP_STRING([--with-vendor-id=vendorID], [Specify USB BT Dongle vendorID])], USB_VENDOR_ID=$withval, USB_VENDOR_ID="") AC_ARG_WITH(product-id, [AS_HELP_STRING([--with-product-id=productID], [Specify USB BT Dongle productID])], USB_PRODUCT_ID=$withval, USB_PRODUCT_ID="") @@ -92,12 +93,14 @@ if test "x$target" = xiphone; then fi if test "x$USE_BLUETOOL" = xDEFAULT ; then USE_BLUETOOL="yes" - echo "USE_BLUETOOL=$USE_BLUETOOL" + echo "USE_BLUETOOL: $USE_BLUETOOL" fi if test "x$USE_SPRINGBOARD" = xDEFAULT ; then USE_SPRINGBOARD="yes" - echo "USE_SPRINGBOARD=$USE_SPRINGBOARD" + echo "USE_SPRINGBOARD: $USE_SPRINGBOARD" fi + echo "USE_LAUNCHD: $USE_LAUNCHD" + else if test "x$UART_DEVICE" = xDEFAULT ; then UART_DEVICE=/dev/ttyS0 @@ -106,10 +109,10 @@ fi # summary if test "x$HCI_TRANSPORT" = xUSB; then - echo "USB_PRODUCT_ID=$USB_PRODUCT_ID" - echo "USB_VENDOR_ID=$USB_VENDOR_ID" - echo "LIBUSB_CFLAGS=$LIBUSB_CFLAGS" - echo "LIBUSB_LIBS=$LIBUSB_LIBS" + echo "USB_PRODUCT_ID: $USB_PRODUCT_ID" + echo "USB_VENDOR_ID: $USB_VENDOR_ID" + echo "LIBUSB_CFLAGS: $LIBUSB_CFLAGS" + echo "LIBUSB_LIBS: $LIBUSB_LIBS" else echo "UART_DEVICE=$UART_DEVICE" echo "UART_SPEED=$UART_SPEED" @@ -132,6 +135,9 @@ else if test "x$USE_SPRINGBOARD" = xyes; then echo "#define USE_SPRINGBOARD" >> config.h fi + if test "x$USE_LAUNCHD" = xyes; then + echo "#define USE_LAUNCHD" >> config.h + fi fi AC_SUBST(IPHONE_IP) diff --git a/src/socket_connection.c b/src/socket_connection.c index b345bf07d..67e617a3a 100644 --- a/src/socket_connection.c +++ b/src/socket_connection.c @@ -11,6 +11,8 @@ #include "hci.h" +#include "../config.h" + #include #include #include @@ -23,7 +25,6 @@ #include #define MAX_PENDING_CONNECTIONS 10 -#define DATA_BUF_SIZE 80 /** prototypes */ static int socket_connection_hci_process(struct data_source *ds);