aboutsummaryrefslogtreecommitdiffstats
path: root/aclocal-fallback
diff options
context:
space:
mode:
authorlego <lego@f5534014-38df-0310-8fa8-9805f1628bb7>2007-08-25 20:27:58 +0000
committerlego <lego@f5534014-38df-0310-8fa8-9805f1628bb7>2007-08-25 20:27:58 +0000
commit3d3151d0b6799c152d3ab73cea5023e7fd8d37fd (patch)
tree7b0a724f5af02559801332f4140cb361baeb796e /aclocal-fallback
parent5feddcca1610cf3c27c9e7d0247ca7d66d799b2d (diff)
get libsmi into the picture
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@22661 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'aclocal-fallback')
-rw-r--r--aclocal-fallback/libsmi.m438
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", &current, &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]
+ )
+])