mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-01-07 09:55:45 +00:00
147 lines
6.0 KiB
Plaintext
147 lines
6.0 KiB
Plaintext
# -*- Autoconf -*-
|
|
# Process this file with autoconf to produce a configure script.
|
|
|
|
AC_PREREQ(2.60)
|
|
AC_INIT(BTstack, 0.1)
|
|
AC_CONFIG_AUX_DIR(config)
|
|
AM_INIT_AUTOMAKE(BTstack,0.1)
|
|
|
|
AC_ARG_WITH(hci-transport, [AS_HELP_STRING([--with-hci-transport=transportType], [Specify BT type to use: h4, usb (not supported yet])], HCI_TRANSPORT=$withval, HCI_TRANSPORT="h4")
|
|
AC_ARG_WITH(uart-device, [AS_HELP_STRING([--with-uart-device=uartDevice], [Specify BT UART device to use])], UART_DEVICE=$withval, UART_DEVICE="DEFAULT")
|
|
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="")
|
|
|
|
|
|
# BUILD/HOST/TARGET
|
|
AC_CANONICAL_HOST
|
|
|
|
|
|
# Checks for programs.
|
|
AC_PROG_CC
|
|
AC_PROG_CPP
|
|
AC_PROG_OBJC
|
|
AC_PROG_INSTALL
|
|
AC_PROG_LN_S
|
|
AC_PROG_MAKE_SET
|
|
|
|
# use capitals for transport type
|
|
if test "x$HCI_TRANSPORT" = xusb; then
|
|
HCI_TRANSPORT="USB"
|
|
fi
|
|
if test "x$HCI_TRANSPORT" = xh4; then
|
|
HCI_TRANSPORT="H4"
|
|
fi
|
|
|
|
|
|
# validate USB support
|
|
if test "x$HCI_TRANSPORT" = xUSB; then
|
|
# pkg-config needed
|
|
PKG_PROG_PKG_CONFIG
|
|
# libusb installed?
|
|
PKG_CHECK_MODULES([LIBUSB], [libusb-1.0], HAVE_LIBUSB="yes", HAVE_LIBUSB="no")
|
|
if test "$HAVE_LIBUSB" == "no" ; then
|
|
AC_MSG_ERROR(USB Transport requested but libusb-1.0 not found using pkg-config. Please set PKG_CONFIG_PATH correctly and/or install libusb-1.0 from your distribution or from http://libusb.sourceforge.net/api-1.0/)
|
|
fi
|
|
if test -z "$USB_VENDOR_ID" ; then
|
|
AC_MSG_ERROR(USB Transport requested but USB_VENDOR_ID not set. Please specify vendor ID of your USB dongle using --with-vendor-id=0x1234)
|
|
fi
|
|
if test -z "$USB_PRODUCT_ID" ; then
|
|
AC_MSG_ERROR(USB Transport requested but USB_PRODUCT_ID not set. Please specify product ID of your USB dongle using --with-product-id=0x1234)
|
|
fi
|
|
CFLAGS="$CFLAGS $LIBUSB_CFLAGS"
|
|
LDFLAGS="$LDFLAGS $LIBUSB_LIBS"
|
|
fi
|
|
AM_CONDITIONAL(HAVE_LIBUSB, [test "x$HAVE_LIBUSB" == "xyes"])
|
|
|
|
|
|
echo
|
|
echo "BTstack configured for HCI $HCI_TRANSPORT Transport"
|
|
|
|
# iPhone/iPod touch cross-compilation for darwin
|
|
DEVELOPER_PATH="/Developer/Platforms/iPhoneOS.platform/Developer"
|
|
SDK_VERSION="2.0"
|
|
SDK_PATH="$DEVELOPER_PATH/SDKs/iPhoneOS$SDK_VERSION.sdk"
|
|
GCC_VERSION="4.0.1"
|
|
if test "x$target" = xiphone; then
|
|
case "$host_os" in
|
|
darwin*)
|
|
echo "Cross-compiling for iPhone/iPod touch using Apple's iPhone SDK"
|
|
echo "iPhone IP for install-iphone target: $IPHONE_IP"
|
|
CC="$DEVELOPER_PATH/usr/bin/arm-apple-darwin9-gcc-$GCC_VERSION"
|
|
OBJC="$DEVELOPER_PATH/usr/bin/arm-apple-darwin9-g++-$GCC_VERSION"
|
|
CFLAGS="$CFLAGS -g"
|
|
CPPFLAGS="$CPPFLAGS -I$SDK_PATH/usr/include"
|
|
CPPFLAGS="$CPPFLAGS -I$SDK_PATH/usr/lib/gcc/arm-apple-darwin9/$GCC_VERSION/include"
|
|
CPPFLAGS="$CPPFLAGS -F$SDK_PATH/System/Library/Frameworks"
|
|
LDFLAGS="$LDFLAGS -F$SDK_PATH/System/Library/Frameworks"
|
|
LDFLAGS="$LDFLAGS -L$SDK_PATH/usr/lib -framework CoreFoundation -framework UIKit"
|
|
LDFLAGS="$LDFLAGS -L$SDK_PATH/System/Library/Frameworks/IOKit.framework/Versions/A"
|
|
LDFLAGS="$LDFLAGS -lIOkit -lobjc"
|
|
;;
|
|
*)
|
|
AC_MSG_ERROR(Don't know how to compile without Apple's iPhone SDK, sorry.)
|
|
;;
|
|
esac
|
|
|
|
if test "x$UART_DEVICE" = xDEFAULT ; then
|
|
UART_DEVICE=/dev/tty.bluetooth
|
|
fi
|
|
if test "x$USE_BLUETOOL" = xDEFAULT ; then
|
|
USE_BLUETOOL="yes"
|
|
echo "USE_BLUETOOL: $USE_BLUETOOL"
|
|
fi
|
|
if test "x$USE_SPRINGBOARD" = xDEFAULT ; then
|
|
USE_SPRINGBOARD="yes"
|
|
echo "USE_SPRINGBOARD: $USE_SPRINGBOARD"
|
|
fi
|
|
echo "USE_LAUNCHD: $USE_LAUNCHD"
|
|
|
|
else
|
|
if test "x$UART_DEVICE" = xDEFAULT ; then
|
|
UART_DEVICE=/dev/ttyS0
|
|
fi
|
|
fi
|
|
AM_CONDITIONAL(USE_SPRINGBOARD, [test "x$USE_SPRINGBOARD" == "xyes"])
|
|
|
|
# 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"
|
|
else
|
|
echo "UART_DEVICE=$UART_DEVICE"
|
|
echo "UART_SPEED=$UART_SPEED"
|
|
fi
|
|
echo
|
|
|
|
# create config.h
|
|
echo "// config.h created by configure for BTstack " `date`> config.h
|
|
if test "x$HCI_TRANSPORT" = xUSB; then
|
|
echo "#define HAVE_TRANSPORT_USB" >> config.h
|
|
echo "#define USB_PRODUCT_ID $USB_PRODUCT_ID" >> config.h
|
|
echo "#define USB_VENDOR_ID $USB_VENDOR_ID" >> config.h
|
|
else
|
|
echo "#define HAVE_TRANSPORT_H4" >> config.h
|
|
echo "#define UART_DEVICE \"$UART_DEVICE\"" >> config.h
|
|
echo "#define UART_SPEED $UART_SPEED" >> config.h
|
|
if test "x$USE_BLUETOOL" = xyes; then
|
|
echo "#define USE_BLUETOOL" >> config.h
|
|
fi
|
|
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)
|
|
AC_SUBST(HAVE_LIBUSB)
|
|
AC_OUTPUT(Makefile src/Makefile example/Makefile SpringBoardAccess/Makefile)
|