summaryrefslogtreecommitdiffstats
path: root/acinclude.m4
diff options
context:
space:
mode:
Diffstat (limited to 'acinclude.m4')
-rw-r--r--acinclude.m4117
1 files changed, 26 insertions, 91 deletions
diff --git a/acinclude.m4 b/acinclude.m4
index a2fa7784..ea030ae2 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -1,101 +1,36 @@
-dnl Test file
-AC_DEFUN([AC_TEST_FILE],
-[
- if test -f $1; then
- ifelse([$2], , :,[$2])
- else
- ifelse([$3], , :,[$3])
- fi
-])
+dnl
+dnl $Id$
+dnl
-dnl Test dir
-AC_DEFUN([AC_TEST_DIR],
-[
- if test -d $1; then
- ifelse([$2], , :,[$2])
- else
- ifelse([$3], , :,[$3])
- fi
-])
+AC_DEFUN(AC_PATH_BLUEZ, [
+ BLUEZ_INCLUDES=""
+ BLUEZ_LDFLAGS=""
+ BLUEZ_LIBS=""
-dnl Test files
-AC_DEFUN([AC_TEST_FILES],
-[
- ac_file_found=yes
- for f in $1; do
- if test ! -f $2/$f; then
- ac_file_found=no
- break;
- fi
- done
+ ac_save_CFLAGS=$CFLAGS
+ test -n "$bluez_includes" && CFLAGS="$CFLAGS -I$bluez_includes"
- if test "$ac_file_found" = "yes" ; then
- ifelse([$3], , :,[$3])
- else
- ifelse([$4], , :,[$4])
- fi
-])
+ ac_save_LDFLAGS=$LDFLAGS
+ test -n "$bluez_libraries" && LDFLAGS="$LDFLAGS -L$bluez_libraries"
-dnl Search for headers, add path to CPPFLAGS if found
-AC_DEFUN([AC_SEARCH_HEADERS],
-[
- AC_MSG_CHECKING("for $1")
- ac_hdr_found=no
- for p in $2; do
- test -d $p || continue;
- p=`cd $p && pwd`
- AC_TEST_FILES($1, $p,
- [
- ac_hdr_found=yes
- break
- ]
- )
- done
- if test "$ac_hdr_found" = "yes" ; then
- CPPFLAGS="$CPPFLAGS -I$p"
- AC_MSG_RESULT( [($p) yes] )
- ifelse([$3], , :,[$3])
- else
- AC_MSG_RESULT("no")
- ifelse([$4], , :,[$4])
- fi
-])
+ AC_CHECK_HEADER(bluetooth/bluetooth.h,,
+ AC_MSG_ERROR(Bluetooth header files not found))
-dnl Search for library, add path to LIBS if found
-AC_DEFUN([AC_SEARCH_LIB],
-[
- AC_MSG_CHECKING("for lib$1")
+ AC_CHECK_LIB(bluetooth, hci_open_dev,
+ BLUEZ_LIBS="$BLUEZ_LIBS -lbluetooth",
+ AC_MSG_ERROR(Bluetooth library not found))
- ac_save_LDFLAGS=$LDFLAGS
+ AC_CHECK_LIB(sdp, sdp_connect,
+ BLUEZ_LIBS="$BLUEZ_LIBS -lsdp")
- ac_lib_found=no
- for p in $3; do
- test -d $p || continue;
- p=`cd $p && pwd`
+ CFLAGS=$ac_save_CFLAGS
+ test -n "$bluez_includes" && BLUEZ_INCLUDES="-I$bluez_includes"
- # Check for libtool library
- if test -f $p/lib$1.la; then
- path=$p/.libs
- else
- path=$p
- fi
-
- LDFLAGS="-L$path -l$1"
- AC_TRY_LINK_FUNC($2,
- [
- LIBS="$LIBS -L$p -l$1"
- ac_lib_found=yes
- break
- ]
- )
- done
- if test "$ac_lib_found" = "yes" ; then
- AC_MSG_RESULT( [($p) yes] )
- ifelse([$4], , :,[$4])
- else
- AC_MSG_RESULT("no")
- ifelse([$5], , :,[$5])
- fi
+ LDFLAGS=$ac_save_LDFLAGS
+ test -n "$bluez_libraries" && BLUEZ_LDFLAGS="-L$bluez_libraries"
+ test -n "$bluez_libraries" && BLUEZ_LIBS="-L$bluez_libraries $BLUEZ_LIBS"
- LDFLAGS=$ac_save_LDFLAGS
+ AC_SUBST(BLUEZ_INCLUDES)
+ AC_SUBST(BLUEZ_LDFLAGS)
+ AC_SUBST(BLUEZ_LIBS)
])