dnl dnl $Id$ dnl AC_DEFUN([AC_PREFIX_BLUEZ], [ AC_PREFIX_DEFAULT(/usr) if test "${prefix}" = "NONE"; then dnl no prefix and no sysconfdir, so default to /etc if test "$sysconfdir" = '${prefix}/etc'; then AC_SUBST([sysconfdir], ['/etc']) fi dnl no prefix and no mandir, so use ${prefix}/share/man as default if test "$mandir" = '${prefix}/man'; then AC_SUBST([mandir], ['${prefix}/share/man']) fi prefix="${ac_default_prefix}" fi ]) AC_DEFUN([AC_PATH_BLUEZ], [ AC_ARG_WITH(bluez, [ --with-bluez=DIR BlueZ library is installed in DIR], [ if (test "${withval}" = "yes"); then bluez_prefix=${prefix} else bluez_prefix=${withval} fi ]) ac_save_CPPFLAGS=$CPPFLAGS ac_save_LDFLAGS=$LDFLAGS BLUEZ_CFLAGS="" test -d "${bluez_prefix}/include" && BLUEZ_CFLAGS="$BLUEZ_CFLAGS -I${bluez_prefix}/include" CPPFLAGS="$CPPFLAGS $BLUEZ_CFLAGS" AC_CHECK_HEADER(bluetooth/bluetooth.h,, AC_MSG_ERROR(Bluetooth header files not found)) BLUEZ_LIBS="" test -d "${bluez_prefix}/lib" && BLUEZ_LIBS="$BLUEZ_LIBS -L${bluez_prefix}/lib" test -d "${bluez_prefix}/lib64" && BLUEZ_LIBS="$BLUEZ_LIBS -L${bluez_prefix}/lib64" test -d "${libdir}" && BLUEZ_LIBS="$BLUEZ_LIBS -L${libdir}" LDFLAGS="$LDFLAGS $BLUEZ_LIBS" AC_CHECK_LIB(bluetooth, hci_open_dev, BLUEZ_LIBS="$BLUEZ_LIBS -lbluetooth", AC_MSG_ERROR(Bluetooth library not found)) AC_CHECK_LIB(sdp, sdp_connect, BLUEZ_LIBS="$BLUEZ_LIBS -lsdp") CPPFLAGS=$ac_save_CPPFLAGS LDFLAGS=$ac_save_LDFLAGS AC_SUBST(BLUEZ_CFLAGS) AC_SUBST(BLUEZ_LIBS) ]) AC_DEFUN([AC_PATH_USB], [ AC_ARG_WITH(usb, [ --with-usb=DIR USB library is installed in DIR], [ if (test "$withval" = "yes"); then usb_prefix=${prefix} else usb_prefix=${withval} fi ]) ac_save_CPPFLAGS=$CPPFLAGS ac_save_LDFLAGS=$LDFLAGS USB_CFLAGS="" test -d "${usb_prefix}/include" && USB_CFLAGS="$USB_CFLAGS -I${usb_prefix}/include" CPPFLAGS="$CPPFLAGS $USB_CFLAGS" AC_CHECK_HEADER(usb.h,, AC_MSG_ERROR(USB header files not found)) USB_LIBS="" test -d "${usb_prefix}/lib" && USB_LIBS="$USB_LIBS -L${usb_prefix}/lib" test -d "${usb_prefix}/lib64" && USB_LIBS="$USB_LIBS -L${usb_prefix}/lib64" test -d "${libdir}" && USB_LIBS="$USB_LIBS -L${libdir}" LDFLAGS="$LDFLAGS $USB_LIBS" AC_CHECK_LIB(usb, usb_open, USB_LIBS="$USB_LIBS -lusb", AC_MSG_ERROR(USB library not found)) CPPFLAGS=$ac_save_CPPFLAGS LDFLAGS=$ac_save_LDFLAGS AC_SUBST(USB_CFLAGS) AC_SUBST(USB_LIBS) ]) AC_DEFUN([AC_PATH_DBUS], [ AC_ARG_ENABLE(dbus, [ --enable-dbus enable D-BUS support], [ dbus_enable=${enableval} dbus_prefix=${prefix} ]) AC_ARG_WITH(dbus, [ --with-dbus=DIR D-BUS library is installed in DIR], [ if (test "${withval}" = "yes"); then dbus_prefix=${prefix} else dbus_prefix=${withval} fi dbus_enable=yes ]) ac_save_CPPFLAGS=$CPPFLAGS ac_save_LDFLAGS=$LDFLAGS DBUS_CFLAGS="-DDBUS_API_SUBJECT_TO_CHANGE" test -d "${dbus_prefix}/include/dbus-1.0" && DBUS_CFLAGS="$DBUS_CFLAGS -I${dbus_prefix}/include/dbus-1.0" test -d "${dbus_prefix}/lib/dbus-1.0/include" && DBUS_CFLAGS="$DBUS_CFLAGS -I${dbus_prefix}/lib/dbus-1.0/include" test -d "${dbus_prefix}/lib64/dbus-1.0/include" && DBUS_CFLAGS="$DBUS_CFLAGS -I${dbus_prefix}/lib64/dbus-1.0/include" test -d "${libdir}/dbus-1.0/include" && DBUS_CFLAGS="$DBUS_CFLAGS -I${libdir}/dbus-1.0/include" CPPFLAGS="$CPPFLAGS $DBUS_CFLAGS" AC_CHECK_HEADER(dbus/dbus.h,, dbus_enable=no) DBUS_LIBS="" test -d "${dbus_prefix}/lib" && DBUS_LIBS="$DBUS_LIBS -L${dbus_prefix}/lib" test -d "${dbus_prefix}/lib64" && DBUS_LIBS="$DBUS_LIBS -L${dbus_prefix}/lib64" test -d "${libdir}" && DBUS_LIBS="$DBUS_LIBS -L${libdir}" LDFLAGS="$LDFLAGS $DBUS_LIBS" AC_CHECK_LIB(dbus-1, dbus_error_init, DBUS_LIBS="$DBUS_LIBS -ldbus-1", dbus_enable=no) CPPFLAGS=$ac_save_CPPFLAGS LDFLAGS=$ac_save_LDFLAGS AC_SUBST(DBUS_CFLAGS) AC_SUBST(DBUS_LIBS) AM_CONDITIONAL(DBUS, test "${dbus_enable}" = "yes") ]) AC_DEFUN([AC_PATH_CUPS], [ AC_ARG_ENABLE(cups, [ --enable-cups enable CUPS support], [ cups_enable=${enableval} cups_prefix=${prefix} ]) AC_ARG_WITH(cups, [ --with-cups=DIR CUPS is installed in DIR], [ if (test "${withval}" = "yes"); then cups_prefix=${prefix} else cups_prefix=${withval} fi cups_enable=yes ]) CUPS_BACKEND_DIR="" AC_MSG_CHECKING(for CUPS backend directory) if (test -d "${cups_prefix}/lib/cups/backend"); then CUPS_BACKEND_DIR="${cups_prefix}/lib/cups/backend" elif (test -d "${cups_prefix}/lib64/cups/backend"); then CUPS_BACKEND_DIR="${cups_prefix}/lib64/cups/backend" elif (test -d "${libdir}/cups/backend"); then CUPS_BACKEND_DIR="${libdir}/cups/backend" else cups_enable=no fi if test "${cups_enable}" = "yes"; then AC_MSG_RESULT($CUPS_BACKEND_DIR) else AC_MSG_RESULT($cups_enable) fi AC_SUBST(CUPS_BACKEND_DIR) AM_CONDITIONAL(CUPS, test "${cups_enable}" = "yes") ])