diff options
author | Luis Ontanon <luis.ontanon@gmail.com> | 2007-08-25 20:27:58 +0000 |
---|---|---|
committer | Luis Ontanon <luis.ontanon@gmail.com> | 2007-08-25 20:27:58 +0000 |
commit | 782c19a0c5d553445803fcbe6ba88bd86c7bf0bb (patch) | |
tree | 7b0a724f5af02559801332f4140cb361baeb796e /aclocal-fallback/libsmi.m4 | |
parent | b089f0001362dcb81735afff9aff50dcc100e9d0 (diff) |
get libsmi into the picture
svn path=/trunk/; revision=22661
Diffstat (limited to 'aclocal-fallback/libsmi.m4')
-rw-r--r-- | aclocal-fallback/libsmi.m4 | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/aclocal-fallback/libsmi.m4 b/aclocal-fallback/libsmi.m4 new file mode 100644 index 0000000000..29ce719352 --- /dev/null +++ b/aclocal-fallback/libsmi.m4 @@ -0,0 +1,38 @@ +# Configure paths for libsmi. + +dnl AM_PATH_LIBSMI() +dnl Test for libsmi and defines the symbol LIBSMI if the test is +dnl successful. Also defines HAVE_LIBSMI_H and adds -llibsmi to the +dnl LIBS variable. +dnl +AC_DEFUN([AM_PATH_LIBSMI], +[ + AC_CHECK_HEADERS(smi.h) + AC_CHECK_LIB(smi, smiInit) + AC_MSG_CHECKING([whether to enable libsmi]) + AC_TRY_RUN([ /* libsmi available check */ +#include <smi.h> +main() +{ + int current, revision, age, n; + const int required = 2; + if (smiInit("")) + exit(1); + if (strcmp(SMI_LIBRARY_VERSION, smi_library_version)) + exit(2); + n = sscanf(smi_library_version, "%d:%d:%d", ¤t, &revision, &age); + if (n != 3) + exit(3); + if (required < current - age || required > current) + exit(4); + exit(0); +} +], + [ AC_MSG_RESULT(yes) + libsmi=yes], + [ AC_MSG_RESULT(no) + libsmi=no], + [ AC_MSG_RESULT(not when cross-compiling) + libsmi=no] + ) +]) |