- for i in \
- $libexecdir $libdir $exec_prefix/lib $prefix/lib \
- /usr/local/lib /usr/lib
- do
- for j in \
- wireshark/plugins/* wireshark/*/plugins \
- */wireshark/plugins/* */wireshark/*/plugins
- do
- for k in $i/$j/*.so; do
- if test -f "$k"; then
- echo $(AS_DIRNAME(["$k"]))
- exit
- fi
- done
- done
- done
- echo "failed"
- )
- ])
- case $mdw_cv_wireshark_plugin_dir in
- failed) haveshark=no ;;
- *) wireshark_plugindir=$mdw_cv_wireshark_plugin_dir ;;
- esac
-esac
-
-dnl If we're still interested, find Glib.
-case "$haveshark" in
- yes) AM_PATH_GLIB_2_0([2.4.0], [], [haveshark=false], [gmodule]) ;;
-esac
-
-dnl Find the include directory. This would be much easier if they just
-dnl provided a pkg-config file.
-case "$haveshark" in
- yes)
- bad=yes
- mdw_CFLAGS=$CFLAGS
- wsprefix=`echo $wireshark_plugindir | sed 's:/lib/.*$::'`
- AC_CACHE_CHECK([how to find the Wireshark headers],
- [mdw_cv_wireshark_includes], [
- mdw_cv_wireshark_includes=failed
- for i in \
- "" \
- "-I${wsprefix}/include/wireshark" \
- "-I${wsprefix}/include" \
- "-I${prefix}/include/wireshark" \
- "-I${prefix}/include" \
- "-I/usr/include/wireshark" \
- "-I/usr/local/include/wireshark" \
- "-I/usr/local/include"; do
- CFLAGS="$GLIB_CFLAGS $i"
- AC_TRY_COMPILE([
-#include <netinet/in.h>
-#include <glib.h>
-#include <wireshark/config.h>
-#include <wireshark/epan/packet.h>],
- [dissector_handle_t dh; dh = create_dissector_handle(0, 0);],
- [bad=no; break])
- done
- case "$bad" in
- no) mdw_cv_wireshark_includes=$i ;;
- esac
- CFLAGS=$mdw_CFLAGS
- ])
- case "$mdw_cv_wireshark_includes" in
- failed) haveshark=no ;;
+ $PKG_CONFIG --variable=plugindir "wireshark >= 1.12.1")
+ dnl It seems that the Debian package has a habit of bungling the
+ dnl plugin path (#779788, #857729, ...).
+ case "$mdw_cv_wireshark_plugin_dir" in
+ /usr//usr/*)
+ mdw_cv_wireshark_plugin_dir=${mdw_cv_wireshark_plugin_dir#/usr/}
+ ;;
+ esac])
+ case "$mdw_cv_wireshark_plugin_dir" in
+ /*)
+ if test ! -d "$mdw_cv_wireshark_plugin_dir"; then
+ AC_MSG_WARN([alleged Wireshark plugin directory $mdw_cv_wireshark_plugin_dir doesn't exist])
+ haveshark=no
+ else
+ wireshark_plugindir=$mdw_cv_wireshark_plugin_dir
+ haveshark=yes
+ fi
+ ;;
+ *)
+ AC_MSG_WARN([failed to read Wireshark plugin directory])
+ haveshark=no
+ ;;