diff options
author | Danny Kukawka <danny.kukawka@web.de> | 2008-08-27 20:51:11 +0200 |
---|---|---|
committer | Danny Kukawka <danny.kukawka@web.de> | 2008-08-27 20:51:11 +0200 |
commit | 2d5fcc4c2362457d814bd96d7ecb709361c68b15 (patch) | |
tree | e3aaeac47f46f7600368ba06c35b1ab447bdc7e9 /configure.in | |
parent | fdd00ce0015d6d38865c531128f0455b984a291d (diff) |
added configure check for libsmbios >= 2.0.3
Added configure check for libsmbios >= 2.0.3 needed for usage
of smi::getPasswordStatus(). We check for the libsmbios version
because you can't use AC_CHECK_LIB to check the function.
Diffstat (limited to 'configure.in')
-rw-r--r-- | configure.in | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/configure.in b/configure.in index 5cc6e5d3..87cd2852 100644 --- a/configure.in +++ b/configure.in @@ -430,6 +430,29 @@ if test "x$use_smbios" = "xyes" ; then USE_SMBIOS=no AM_CONDITIONAL(HAVE_SMBIOS, [false]) fi + # yes this is ugly, but there is AFAIK no other way to check for getPasswordStatus() + if test "x$USE_SMBIOS" = "xyes" ; then + AC_MSG_CHECKING([for libsmbios >= 2.0.3]) + AC_RUN_IFELSE([AC_LANG_SOURCE([[ + #include <smbios/version.h> + int main () + { + int major ; + int minor ; + int micro ; + + if ( sscanf( LIBSMBIOS_RELEASE_VERSION , "%d.%d.%d", &major, &minor, µ ) == 3 ) { + if ((major == 2 && minor == 0 && micro >= 3) || + (major == 2 && minor > 0) || + (major >= 2)) { + return 0; + } + } + return 1; + }]])], [AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SMBIOS_2_0_3, 1 , [Set to 1 if we have libsmbios >= v2.0.3])], + [AC_MSG_RESULT(failed)]) + fi + else USE_SMBIOS=no AM_CONDITIONAL(HAVE_SMBIOS, [false]) |