mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
configure: check for udev_device_get_is_initialized is available
The udev_device_get_is_initialized is available since libudev version 165. Older versions are still used somewhere (e.g. RHEL6). So better check for this fn and use it only if it's available.
This commit is contained in:
parent
f82e0210b7
commit
b8779e706e
2
aclocal.m4
vendored
2
aclocal.m4
vendored
@ -15,7 +15,7 @@ m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun
|
|||||||
# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
|
# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
|
||||||
# serial 1 (pkg-config-0.24)
|
# serial 1 (pkg-config-0.24)
|
||||||
#
|
#
|
||||||
# Copyright (c) 2004 Scott James Remnant <scott@netsplit.com>.
|
# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# This program is free software; you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
44
configure
vendored
44
configure
vendored
@ -12007,6 +12007,50 @@ fi
|
|||||||
|
|
||||||
$as_echo "#define UDEV_SYNC_SUPPORT 1" >>confdefs.h
|
$as_echo "#define UDEV_SYNC_SUPPORT 1" >>confdefs.h
|
||||||
|
|
||||||
|
|
||||||
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for udev_device_get_is_initialized in -ludev" >&5
|
||||||
|
$as_echo_n "checking for udev_device_get_is_initialized in -ludev... " >&6; }
|
||||||
|
if ${ac_cv_lib_udev_udev_device_get_is_initialized+:} false; then :
|
||||||
|
$as_echo_n "(cached) " >&6
|
||||||
|
else
|
||||||
|
ac_check_lib_save_LIBS=$LIBS
|
||||||
|
LIBS="-ludev $LIBS"
|
||||||
|
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||||
|
/* end confdefs.h. */
|
||||||
|
|
||||||
|
/* Override any GCC internal prototype to avoid an error.
|
||||||
|
Use char because int might match the return type of a GCC
|
||||||
|
builtin and then its argument prototype would still apply. */
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C"
|
||||||
|
#endif
|
||||||
|
char udev_device_get_is_initialized ();
|
||||||
|
int
|
||||||
|
main ()
|
||||||
|
{
|
||||||
|
return udev_device_get_is_initialized ();
|
||||||
|
;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
_ACEOF
|
||||||
|
if ac_fn_c_try_link "$LINENO"; then :
|
||||||
|
ac_cv_lib_udev_udev_device_get_is_initialized=yes
|
||||||
|
else
|
||||||
|
ac_cv_lib_udev_udev_device_get_is_initialized=no
|
||||||
|
fi
|
||||||
|
rm -f core conftest.err conftest.$ac_objext \
|
||||||
|
conftest$ac_exeext conftest.$ac_ext
|
||||||
|
LIBS=$ac_check_lib_save_LIBS
|
||||||
|
fi
|
||||||
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_udev_udev_device_get_is_initialized" >&5
|
||||||
|
$as_echo "$ac_cv_lib_udev_udev_device_get_is_initialized" >&6; }
|
||||||
|
if test "x$ac_cv_lib_udev_udev_device_get_is_initialized" = xyes; then :
|
||||||
|
|
||||||
|
$as_echo "#define HAVE_LIBUDEV_UDEV_DEVICE_GET_IS_INITIALIZED 1" >>confdefs.h
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
|
LIBS=$ac_check_lib_save_LIBS
|
||||||
fi
|
fi
|
||||||
|
|
||||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable installation of udev rules required for synchronisation" >&5
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable installation of udev rules required for synchronisation" >&5
|
||||||
|
@ -1334,6 +1334,10 @@ if test "$UDEV_SYNC" = yes; then
|
|||||||
pkg_config_init
|
pkg_config_init
|
||||||
PKG_CHECK_MODULES(UDEV, libudev >= 143, [UDEV_PC="libudev"])
|
PKG_CHECK_MODULES(UDEV, libudev >= 143, [UDEV_PC="libudev"])
|
||||||
AC_DEFINE([UDEV_SYNC_SUPPORT], 1, [Define to 1 to enable synchronisation with udev processing.])
|
AC_DEFINE([UDEV_SYNC_SUPPORT], 1, [Define to 1 to enable synchronisation with udev processing.])
|
||||||
|
|
||||||
|
AC_CHECK_LIB(udev, udev_device_get_is_initialized, AC_DEFINE([HAVE_LIBUDEV_UDEV_DEVICE_GET_IS_INITIALIZED], 1,
|
||||||
|
[Define to 1 if udev_device_get_is_initialized is available.]))
|
||||||
|
LIBS=$ac_check_lib_save_LIBS
|
||||||
fi
|
fi
|
||||||
|
|
||||||
dnl -- Enable udev rules
|
dnl -- Enable udev rules
|
||||||
|
@ -258,6 +258,9 @@
|
|||||||
/* Define to 1 if you have the <libintl.h> header file. */
|
/* Define to 1 if you have the <libintl.h> header file. */
|
||||||
#undef HAVE_LIBINTL_H
|
#undef HAVE_LIBINTL_H
|
||||||
|
|
||||||
|
/* Define to 1 if udev_device_get_is_initialized is available. */
|
||||||
|
#undef HAVE_LIBUDEV_UDEV_DEVICE_GET_IS_INITIALIZED
|
||||||
|
|
||||||
/* Define to 1 if you have the <limits.h> header file. */
|
/* Define to 1 if you have the <limits.h> header file. */
|
||||||
#undef HAVE_LIMITS_H
|
#undef HAVE_LIMITS_H
|
||||||
|
|
||||||
|
@ -60,11 +60,13 @@ static struct dev_ext *_dev_ext_get_udev(struct device *dev)
|
|||||||
if (!(udev_device = udev_device_new_from_devnum(udev, 'b', dev->dev)))
|
if (!(udev_device = udev_device_new_from_devnum(udev, 'b', dev->dev)))
|
||||||
return_NULL;
|
return_NULL;
|
||||||
|
|
||||||
|
#ifdef HAVE_LIBUDEV_UDEV_DEVICE_GET_IS_INITIALIZED
|
||||||
if (!udev_device_get_is_initialized(udev_device)) {
|
if (!udev_device_get_is_initialized(udev_device)) {
|
||||||
/* Timeout or some other udev db inconsistency! */
|
/* Timeout or some other udev db inconsistency! */
|
||||||
log_error("Udev database has incomplete information about device %s.", dev_name(dev));
|
log_error("Udev database has incomplete information about device %s.", dev_name(dev));
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
dev->ext.handle = (void *) udev_device;
|
dev->ext.handle = (void *) udev_device;
|
||||||
return &dev->ext;
|
return &dev->ext;
|
||||||
|
Loading…
Reference in New Issue
Block a user