forked from enlightenment/efl
should work with old udev now I think?
SVN revision: 48850
This commit is contained in:
parent
90b028d63c
commit
0cccb61516
|
@ -60,6 +60,12 @@ AS_IF(
|
||||||
[PKG_CHECK_MODULES(UDEV, libudev, [], [enable_eeze_udev="no"])]
|
[PKG_CHECK_MODULES(UDEV, libudev, [], [enable_eeze_udev="no"])]
|
||||||
)
|
)
|
||||||
|
|
||||||
|
udev_version=$(pkg-config udev --version | cut -d. -f2)
|
||||||
|
if test $udev_version -lt 23;then
|
||||||
|
EEZE_UDEV_CFLAGS="-DOLD_UDEV_RRRRRRRRRRRRRR"
|
||||||
|
AC_SUBST(EEZE_UDEV_CFLAGS)
|
||||||
|
fi
|
||||||
|
|
||||||
AM_CONDITIONAL([BUILD_EEZE_UDEV], [test "x${enable_eeze_udev}" = "xyes"])
|
AM_CONDITIONAL([BUILD_EEZE_UDEV], [test "x${enable_eeze_udev}" = "xyes"])
|
||||||
|
|
||||||
EFL_EDBUS_BUILD=""
|
EFL_EDBUS_BUILD=""
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
MAINTAINERCLEANFILES = Makefile.in
|
MAINTAINERCLEANFILES = Makefile.in
|
||||||
|
|
||||||
AM_CPPFLAGS = @ECORE_CFLAGS@
|
AM_CPPFLAGS = @ECORE_CFLAGS@ @EEZE_UDEV_CFLAGS@
|
||||||
|
|
||||||
if BUILD_EEZE_UDEV
|
if BUILD_EEZE_UDEV
|
||||||
|
|
||||||
|
|
|
@ -41,18 +41,34 @@ _get_syspath_from_watch(void *data, Ecore_Fd_Handler *fd_handler)
|
||||||
switch (store->type)
|
switch (store->type)
|
||||||
{
|
{
|
||||||
case EUDEV_TYPE_KEYBOARD:
|
case EUDEV_TYPE_KEYBOARD:
|
||||||
|
#ifdef OLD_UDEV_RRRRRRRRRRRRRR
|
||||||
|
if ((!(test = udev_device_get_subsystem(device))) || (strcmp(test, "input")))
|
||||||
|
goto error;
|
||||||
|
#endif
|
||||||
if (!udev_device_get_property_value(device, "ID_INPUT_KEYBOARD"))
|
if (!udev_device_get_property_value(device, "ID_INPUT_KEYBOARD"))
|
||||||
goto error;
|
goto error;
|
||||||
break;
|
break;
|
||||||
case EUDEV_TYPE_MOUSE:
|
case EUDEV_TYPE_MOUSE:
|
||||||
|
#ifdef OLD_UDEV_RRRRRRRRRRRRRR
|
||||||
|
if ((!(test = udev_device_get_subsystem(device))) || (strcmp(test, "input")))
|
||||||
|
goto error;
|
||||||
|
#endif
|
||||||
if (!udev_device_get_property_value(device, "ID_INPUT_MOUSE"))
|
if (!udev_device_get_property_value(device, "ID_INPUT_MOUSE"))
|
||||||
goto error;
|
goto error;
|
||||||
break;
|
break;
|
||||||
case EUDEV_TYPE_TOUCHPAD:
|
case EUDEV_TYPE_TOUCHPAD:
|
||||||
|
#ifdef OLD_UDEV_RRRRRRRRRRRRRR
|
||||||
|
if ((!(test = udev_device_get_subsystem(device))) || (strcmp(test, "input")))
|
||||||
|
goto error;
|
||||||
|
#endif
|
||||||
if (!udev_device_get_property_value(device, "ID_INPUT_TOUCHPAD"))
|
if (!udev_device_get_property_value(device, "ID_INPUT_TOUCHPAD"))
|
||||||
goto error;
|
goto error;
|
||||||
break;
|
break;
|
||||||
case EUDEV_TYPE_DRIVE_MOUNTABLE:
|
case EUDEV_TYPE_DRIVE_MOUNTABLE:
|
||||||
|
#ifdef OLD_UDEV_RRRRRRRRRRRRRR
|
||||||
|
if ((!(test = udev_device_get_subsystem(device))) || (strcmp(test, "block")))
|
||||||
|
goto error;
|
||||||
|
#endif
|
||||||
test = udev_device_get_sysattr_value(device, "capability");
|
test = udev_device_get_sysattr_value(device, "capability");
|
||||||
if (test) cap = atoi(test);
|
if (test) cap = atoi(test);
|
||||||
if (!(test = (udev_device_get_property_value(device, "ID_FS_USAGE"))) ||
|
if (!(test = (udev_device_get_property_value(device, "ID_FS_USAGE"))) ||
|
||||||
|
@ -60,24 +76,44 @@ _get_syspath_from_watch(void *data, Ecore_Fd_Handler *fd_handler)
|
||||||
goto error;
|
goto error;
|
||||||
break;
|
break;
|
||||||
case EUDEV_TYPE_DRIVE_INTERNAL:
|
case EUDEV_TYPE_DRIVE_INTERNAL:
|
||||||
|
#ifdef OLD_UDEV_RRRRRRRRRRRRRR
|
||||||
|
if ((!(test = udev_device_get_subsystem(device))) || (strcmp(test, "block")))
|
||||||
|
goto error;
|
||||||
|
#endif
|
||||||
if (!(test = udev_device_get_property_value(device, "ID_BUS")) || (strcmp("ata", test)) ||
|
if (!(test = udev_device_get_property_value(device, "ID_BUS")) || (strcmp("ata", test)) ||
|
||||||
!(test = udev_device_get_sysattr_value(device, "removable")) || (atoi(test)))
|
!(test = udev_device_get_sysattr_value(device, "removable")) || (atoi(test)))
|
||||||
goto error;
|
goto error;
|
||||||
break;
|
break;
|
||||||
case EUDEV_TYPE_DRIVE_REMOVABLE:
|
case EUDEV_TYPE_DRIVE_REMOVABLE:
|
||||||
|
#ifdef OLD_UDEV_RRRRRRRRRRRRRR
|
||||||
|
if ((!(test = udev_device_get_subsystem(device))) || (strcmp(test, "block")))
|
||||||
|
goto error;
|
||||||
|
#endif
|
||||||
if ((!(test = udev_device_get_sysattr_value(device, "removable")) || (!atoi(test))) &&
|
if ((!(test = udev_device_get_sysattr_value(device, "removable")) || (!atoi(test))) &&
|
||||||
(!(test = udev_device_get_sysattr_value(device, "capability")) || (atoi(test) != 10)))
|
(!(test = udev_device_get_sysattr_value(device, "capability")) || (atoi(test) != 10)))
|
||||||
goto error;
|
goto error;
|
||||||
break;
|
break;
|
||||||
case EUDEV_TYPE_DRIVE_CDROM:
|
case EUDEV_TYPE_DRIVE_CDROM:
|
||||||
|
#ifdef OLD_UDEV_RRRRRRRRRRRRRR
|
||||||
|
if ((!(test = udev_device_get_subsystem(device))) || (strcmp(test, "block")))
|
||||||
|
goto error;
|
||||||
|
#endif
|
||||||
if (!udev_device_get_property_value(device, "ID_CDROM"))
|
if (!udev_device_get_property_value(device, "ID_CDROM"))
|
||||||
goto error;
|
goto error;
|
||||||
break;
|
break;
|
||||||
case EUDEV_TYPE_POWER_AC:
|
case EUDEV_TYPE_POWER_AC:
|
||||||
|
#ifdef OLD_UDEV_RRRRRRRRRRRRRR
|
||||||
|
if ((!(test = udev_device_get_subsystem(device))) || (strcmp(test, "power_supply")))
|
||||||
|
goto error;
|
||||||
|
#endif
|
||||||
if (!(test = (udev_device_get_property_value(device, "POWER_SUPPLY_TYPE"))) ||
|
if (!(test = (udev_device_get_property_value(device, "POWER_SUPPLY_TYPE"))) ||
|
||||||
(strcmp("Mains", test)))
|
(strcmp("Mains", test)))
|
||||||
break;
|
break;
|
||||||
case EUDEV_TYPE_POWER_BAT:
|
case EUDEV_TYPE_POWER_BAT:
|
||||||
|
#ifdef OLD_UDEV_RRRRRRRRRRRRRR
|
||||||
|
if ((!(test = udev_device_get_subsystem(device))) || (strcmp(test, "power_supply")))
|
||||||
|
goto error;
|
||||||
|
#endif
|
||||||
if (!(test = (udev_device_get_property_value(device, "POWER_SUPPLY_TYPE"))) ||
|
if (!(test = (udev_device_get_property_value(device, "POWER_SUPPLY_TYPE"))) ||
|
||||||
(strcmp("Battery", test)))
|
(strcmp("Battery", test)))
|
||||||
break;
|
break;
|
||||||
|
@ -146,6 +182,7 @@ eeze_udev_watch_add(Eudev_Type type, void(*func)(const char *, const char *, voi
|
||||||
goto error;
|
goto error;
|
||||||
if (!(mon = udev_monitor_new_from_netlink(udev, "udev")))
|
if (!(mon = udev_monitor_new_from_netlink(udev, "udev")))
|
||||||
goto error;
|
goto error;
|
||||||
|
#ifndef OLD_UDEV_RRRRRRRRRRRRRR
|
||||||
switch (type)
|
switch (type)
|
||||||
{
|
{
|
||||||
case EUDEV_TYPE_KEYBOARD:
|
case EUDEV_TYPE_KEYBOARD:
|
||||||
|
@ -183,6 +220,7 @@ eeze_udev_watch_add(Eudev_Type type, void(*func)(const char *, const char *, voi
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
if (udev_monitor_enable_receiving(mon))
|
if (udev_monitor_enable_receiving(mon))
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue