+mdw_MLIB(2.0.0)
+mdw_CATACOMB(2.0.1, [CFLAGS="$CFLAGS $CATACOMB_CFLAGS"])
+
+if test "$ethereal" != false; then
+ AM_PATH_GLIB([1.2.0], [], AC_MSG_ERROR([failed to find GLib]), [gmodule])
+ bad=true
+ mdw_CFLAGS=$CFLAGS
+ AC_CACHE_CHECK([how to find the Ethereal headers],
+ [mdw_cv_ethereal_includes], [
+ for i in "" "-I/usr/include/ethereal"; do
+ CFLAGS="$GLIB_CFLAGS $i"
+ AC_TRY_COMPILE([
+#include <netinet/in.h>
+#include <glib.h>
+#include <epan/packet.h>
+], [
+ dissector_handle_t dh;
+ dh = creat_dissector_handle(0, 0);
+ ], [bad=false; break])
+ done
+ if $bad; then
+ AC_MSG_ERROR([failed to find Ethereal headers])
+ fi
+ mdw_cv_ethereal_includes=$i
+ CFLAGS=$mdw_CFLAGS
+ ])
+ AC_CACHE_CHECK([whether the Ethereal headers are broken],
+ [mdw_cv_ethereal_buggered], [
+ CFLAGS="$GLIB_CFLAGS $i"
+ AC_TRY_COMPILE([
+#include <netinet/in.h>
+#include <glib.h>
+#include <epan/packet.h>
+#include <plugins/plugin_api.h>
+], [
+ G_MODULE_EXPORT void plugin_init(plugin_address_table_t *pat)
+ {
+ plugin_address_table_init(pat);
+ }
+ ], [mdw_cv_ethereal_buggered=no], [mdw_cv_ethereal_buggered=yes])
+ CFLAGS=$mdw_CFLAGS
+ ])
+ if test $mdw_cv_ethereal_buggered = yes; then
+ AC_DEFINE(ETHEREAL_BUGGERED)
+ fi
+
+ ETHEREAL_CFLAGS="$CFLAGS $GLIB_CFLAGS $mdw_cv_ethereal_includes"
+ ETHEREAL_PLUGIN_DIR=$ethereal
+ AC_SUBST(ETHEREAL_CFLAGS)
+ AC_SUBST(ETHEREAL_PLUGIN_DIR)
+ DIRS="$DIRS ethereal"
+fi