AC_PROG_CXX
AC_PROG_LIBTOOL
+has_libudev="yes"
case "${host}" in
*-*-linux*)
- AC_SEARCH_LIBS([udev_new], [udev],, AC_MSG_ERROR("required library 'udev' is missing"))
- REQUIRES="udev"
+ PKG_CHECK_MODULES([UDEV],[libudev],,[has_libudev="no";AC_MSG_WARN("library 'udev' is missing - adapter detection will not be available")])
;;
*-apple-darwin*)
+ has_libudev="no";
LIBS+="-framework CoreVideo -framework IOKit"
;;
esac
+if test "x$has_libudev" != "xno"; then
+ INCLUDES="$INCLUDES $UDEV_CFLAGS";LIBS="$LIBS $UDEV_LIBS"
+ AC_DEFINE([HAVE_LIBUDEV],[1],["Define to 1 if libudev is installed"])
+ REQUIRES="udev"
+fi
+
AC_SEARCH_LIBS([pthread_create],[pthread],, AC_MSG_ERROR("required library 'pthread' is missing"))
libs_pre_dl=$LIBS
#include <IOKit/usb/IOUSBLib.h>
#include <IOKit/serial/IOSerialKeys.h>
#include <CoreFoundation/CoreFoundation.h>
-
-#elif !defined(__WINDOWS__)
-#include <dirent.h>
-#include <libudev.h>
-#include <poll.h>
-#else
+#elif defined(__WINDOWS__)
#include <setupapi.h>
// the virtual COM port only shows up when requesting devices with the raw device guid!
static GUID USB_RAW_GUID = { 0xA5DCBF10, 0x6530, 0x11D2, { 0x90, 0x1F, 0x00, 0xC0, 0x4F, 0xB9, 0x51, 0xED } };
+#elif defined(HAVE_LIBUDEV)
+#include <dirent.h>
+#include <libudev.h>
+#include <poll.h>
#endif
#define CEC_VID 0x2548
using namespace CEC;
using namespace std;
-#if !defined(__WINDOWS__)
+#if defined(HAVE_LIBUDEV)
bool TranslateComPort(CStdString &strString)
{
CStdString strTmp(strString);
}
IOObjectRelease(serialPortIterator);
}
-
-#elif !defined(__WINDOWS__)
+#elif defined(HAVE_LIBUDEV)
struct udev *udev;
if (!(udev = udev_new()))
return -1;
udev_enumerate_unref(enumerate);
udev_unref(udev);
-#else
+#elif defined(__WINDOWS__)
HDEVINFO hDevHandle;
DWORD required = 0, iMemberIndex = 0;
int nBufferSize = 0;