Skip to content

Commit

Permalink
Update configure checks for libcap-ng and libnl
Browse files Browse the repository at this point in the history
  • Loading branch information
holtmann committed Feb 3, 2010
1 parent d1f115e commit 69c1b49
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 29 deletions.
27 changes: 0 additions & 27 deletions acinclude.m4
Expand Up @@ -146,18 +146,6 @@ AC_DEFUN([AC_PATH_USB], [
[Define to 1 if you need the usb_interrupt_read() function.]))
])

AC_DEFUN([AC_PATH_NETLINK], [
PKG_CHECK_MODULES(NETLINK, libnl-1, netlink_found=yes, netlink_found=no)
AC_SUBST(NETLINK_CFLAGS)
AC_SUBST(NETLINK_LIBS)
])

AC_DEFUN([AC_PATH_CAPNG], [
PKG_CHECK_MODULES(CAPNG, libcap-ng, capng_found=yes, capng_found=no)
AC_SUBST(CAPNG_CFLAGS)
AC_SUBST(CAPNG_LIBS)
])

AC_DEFUN([AC_PATH_SNDFILE], [
PKG_CHECK_MODULES(SNDFILE, sndfile, sndfile_found=yes, sndfile_found=no)
AC_SUBST(SNDFILE_CFLAGS)
Expand All @@ -169,9 +157,7 @@ AC_DEFUN([AC_ARG_BLUEZ], [
optimization_enable=yes
fortify_enable=yes
pie_enable=yes
capng_enable=${capng_found}
sndfile_enable=${sndfile_found}
netlink_enable=no
hal_enable=${hal_found}
usb_enable=${usb_found}
alsa_enable=${alsa_found}
Expand Down Expand Up @@ -209,10 +195,6 @@ AC_DEFUN([AC_ARG_BLUEZ], [
pie_enable=${enableval}
])
AC_ARG_ENABLE(capng, AC_HELP_STRING([--disable-capng], [disable capabilities dropping]), [
capng_enable=${enableval}
])
AC_ARG_ENABLE(network, AC_HELP_STRING([--disable-network], [disable network plugin]), [
network_enable=${enableval}
])
Expand Down Expand Up @@ -249,10 +231,6 @@ AC_DEFUN([AC_ARG_BLUEZ], [
usb_enable=${enableval}
])
AC_ARG_ENABLE(netlink, AC_HELP_STRING([--enable-netlink], [enable NETLINK support]), [
netlink_enable=${enableval}
])
AC_ARG_ENABLE(tracer, AC_HELP_STRING([--enable-tracer], [install Tracing daemon]), [
tracer_enable=${enableval}
])
Expand Down Expand Up @@ -336,12 +314,7 @@ AC_DEFUN([AC_ARG_BLUEZ], [
AC_DEFINE(HAVE_LIBUSB, 1, [Define to 1 if you have USB library.])
fi
if (test "${capng_enable}" = "yes" && test "${capng_found}" = "yes"); then
AC_DEFINE(HAVE_CAPNG, 1, [Define to 1 if you have capabilities library.])
fi
AM_CONDITIONAL(SNDFILE, test "${sndfile_enable}" = "yes" && test "${sndfile_found}" = "yes")
AM_CONDITIONAL(NETLINK, test "${netlink_enable}" = "yes" && test "${netlink_found}" = "yes")
AM_CONDITIONAL(USB, test "${usb_enable}" = "yes" && test "${usb_found}" = "yes")
AM_CONDITIONAL(SBC, test "${alsa_enable}" = "yes" || test "${gstreamer_enable}" = "yes")
AM_CONDITIONAL(ALSA, test "${alsa_enable}" = "yes" && test "${alsa_found}" = "yes")
Expand Down
1 change: 1 addition & 0 deletions bootstrap-configure
Expand Up @@ -17,6 +17,7 @@ fi
--localstatedir=/var \
--libexecdir=/lib \
--enable-netlink \
--enable-capng \
--enable-tracer \
--enable-tools \
--enable-bccmd \
Expand Down
22 changes: 20 additions & 2 deletions configure.ac
Expand Up @@ -40,11 +40,29 @@ AC_PATH_GLIB
AC_PATH_ALSA
AC_PATH_GSTREAMER
AC_PATH_USB
AC_PATH_NETLINK
AC_PATH_SNDFILE
AC_PATH_CAPNG

AC_ARG_BLUEZ

AC_ARG_ENABLE(capng, AC_HELP_STRING([--enable-capng],
[enable capabilities support]), [enable_capng=${enableval}])
if (test "${enable_capng}" = "yes"); then
PKG_CHECK_MODULES(CAPNG, libcap-ng, dummy=yes,
AC_MSG_ERROR(Capabilities library is required))
AC_SUBST(CAPNG_CFLAGS)
AC_SUBST(CAPNG_LIBS)
AC_DEFINE(HAVE_CAPNG, 1, [Define to 1 if you have capabilities library.])
fi

AC_ARG_ENABLE(netlink, AC_HELP_STRING([--enable-netlink],
[enable netlink support]), [enable_netlink=${enableval}])
if (test "${enable_netlink}" = "yes"); then
PKG_CHECK_MODULES(NETLINK, libnl-1, dummy=yes,
AC_MSG_ERROR(Netlink library is required))
AC_SUBST(NETLINK_CFLAGS)
AC_SUBST(NETLINK_LIBS)
fi
AM_CONDITIONAL(NETLINK, test "${enable_netlink}" = "yes")

AC_OUTPUT(Makefile scripts/bluetooth.rules doc/version.xml
src/bluetoothd.8 bluez.pc)

0 comments on commit 69c1b49

Please sign in to comment.