public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
* [Bluez-devel] configure.in question
@ 2004-09-19  9:42 Armin Bauer
  2004-09-19 10:31 ` Marcel Holtmann
  0 siblings, 1 reply; 2+ messages in thread
From: Armin Bauer @ 2004-09-19  9:42 UTC (permalink / raw)
  To: bluez-devel

Hi,

im one of the multisync devs. as you probably know, we are using your
bluetooth libraries in our application.

Up until now we used this in a configure.in to detect the bluetooth
libraries:

AC_CHECK_LIB(bluetooth,baswap,BLUETOOTH=1,BLUETOOTH=0)
SDP=0
AC_CHECK_LIB(sdp,sdp_list_free,SDP=1,BLUETOOTH=0)
AC_MSG_CHECKING(for correct SDP lib version)
AC_TRY_COMPILE([
#include <bluetooth/sdp.h>
#include <bluetooth/sdp_lib.h>
],[sdp_record_t t;],AC_MSG_RESULT(yes),BLUETOOTH=0;AC_MSG_RESULT(no))
AM_CONDITIONAL(BLUETOOTH,test "${BLUETOOTH}" = "1")
if test "x${BLUETOOTH}" = "x0"; then
  echo "Bluetooth is DISABLED. You must have bluez-libs and bluez-kernel
>= 2.3 and bluez-sdp >= 1.0-pre1."
fi
AC_DEFINE_UNQUOTED(HAVE_BLUETOOTH, ${BLUETOOTH},Defined if Bluetooth is
enabled.)

and src/Makefile.am

libirmc_bluetooth_la_LIBADD = -lbluetooth -lsdp -lpthread

some time ago, the sdp library merged into the libbluetooth. Therefore
this check will not detect this correctly anymore.

So i was wondering what would be the correct approach to detect if the
-lsdp is needed? Which version was the first version of libbluetooth
that got rid of the libsdp?

Armin



-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Bluez-devel] configure.in question
  2004-09-19  9:42 [Bluez-devel] configure.in question Armin Bauer
@ 2004-09-19 10:31 ` Marcel Holtmann
  0 siblings, 0 replies; 2+ messages in thread
From: Marcel Holtmann @ 2004-09-19 10:31 UTC (permalink / raw)
  To: Armin Bauer; +Cc: BlueZ Mailing List

Hi Armin,

> im one of the multisync devs. as you probably know, we are using your
> bluetooth libraries in our application.
> 
> Up until now we used this in a configure.in to detect the bluetooth
> libraries:
> 
> AC_CHECK_LIB(bluetooth,baswap,BLUETOOTH=1,BLUETOOTH=0)
> SDP=0
> AC_CHECK_LIB(sdp,sdp_list_free,SDP=1,BLUETOOTH=0)
> AC_MSG_CHECKING(for correct SDP lib version)
> AC_TRY_COMPILE([
> #include <bluetooth/sdp.h>
> #include <bluetooth/sdp_lib.h>
> ],[sdp_record_t t;],AC_MSG_RESULT(yes),BLUETOOTH=0;AC_MSG_RESULT(no))
> AM_CONDITIONAL(BLUETOOTH,test "${BLUETOOTH}" = "1")
> if test "x${BLUETOOTH}" = "x0"; then
>   echo "Bluetooth is DISABLED. You must have bluez-libs and bluez-kernel
> >= 2.3 and bluez-sdp >= 1.0-pre1."
> fi
> AC_DEFINE_UNQUOTED(HAVE_BLUETOOTH, ${BLUETOOTH},Defined if Bluetooth is
> enabled.)
> 
> and src/Makefile.am
> 
> libirmc_bluetooth_la_LIBADD = -lbluetooth -lsdp -lpthread
> 
> some time ago, the sdp library merged into the libbluetooth. Therefore
> this check will not detect this correctly anymore.
> 
> So i was wondering what would be the correct approach to detect if the
> -lsdp is needed? Which version was the first version of libbluetooth
> that got rid of the libsdp?

from the ChangeLog file of bluez-libs you will see that the SDP library
was merged into the Bluetooth library with version 2.6. I kept a dummy
(empty) libsdp until 2.8, so that using -lsdp was still working. For
version 2.9 and 2.10 you must only link against -lbluetooth.

The bluez-utils contains a simple test in acinclude.m4 that will do this
right if needed. Testing only for a structure is wrong. You must check
in which library the SDP function are included if you want support older
versions where the Bluetooth library and SDP library were seperated. Our
test works like this:

	AC_CHECK_HEADER(bluetooth/bluetooth.h, ...)
		==> pass: activate Bluetooth
		==> fail: no Bluetooth
	AC_CHECK_LIB(bluetooth, hci_open_dev, ...)
		==> pass: add -lbluetooth
		==> fail: deactivate Bluetooth
	AC_CHECK_LIB(sdp, sdp_connect, ...)
		==> pass: add -lsdp
		==> fail: do nothing

I already wrote this on the MultiSync mailing list. Please correct the
help text, because you don't need a bluez-kernel package. You only need
a kernel with RFCOMM support and even this is not needed for compilation
of the source. It is a runtime requirement. Even the requirement of the
bluez-sdp package will confuse the people, because I deprecated it over
5 month ago.

Regards

Marcel




-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-09-19 10:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-09-19  9:42 [Bluez-devel] configure.in question Armin Bauer
2004-09-19 10:31 ` Marcel Holtmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox