chiark / gitweb /
configure.ac: `Better' broken attempt to find Wireshark plugin dir.
authorMark Wooding <mdw@distorted.org.uk>
Fri, 14 Jun 2013 19:43:15 +0000 (20:43 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Wed, 19 Jun 2013 18:58:46 +0000 (19:58 +0100)
In that it actually succeeds on at least one system.

configure.ac
debian/rules

index a394bb591a2a5e29a9ce22373513e05e53233bb7..46ecd234e1cef1b59ffe8d35aee4749a7f7057f2 100644 (file)
@@ -211,28 +211,32 @@ AC_ARG_WITH([wireshark],
            esac],
            [haveshark=yes needshark=no])
 
-dnl Try to find the Wireshark installation directory the hard way.
+dnl Try to find the Wireshark installation directory the hard way.  This is
+dnl remarkably annoying.  This is, unfortunately, very likely to guess wrong,
+dnl but there doesn't seem to be a better way.
 case "$haveshark,$wireshark_plugindir" in
   yes,unknown)
     AC_CACHE_CHECK([where to put Wireshark plugins],
       [mdw_cv_wireshark_plugin_dir], [
-      mdw_cv_wireshark_plugin_dir="failed"
-      wsprefix=none
-      for i in "${prefix}" /usr/local /usr `echo $PATH | tr : " "`; do
-       if test -x "$i/bin/tshark"; then
-          wsprefix=$i
-          break
-       fi
-      done
-      if test "$wsprefix" != none; then
-       wsbin=$wsprefix/bin/tshark
-       wsver=`$wsbin -v | sed ['s/^[^ ]* \([0-9A-Za-z.]*\).*$/\1/;q']`
-       dir=$wsprefix/lib/wireshark/plugins
-       test -d "$dir/$wsver" && dir="$dir/$wsver"
-       if test -d "$dir"; then
-         mdw_cv_wireshark_plugin_dir=$dir
-       fi
-      fi
+      mdw_cv_wireshark_plugin_dir=$(
+       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 ;;
index 04bc8ca01dc05842b275c795c1bf0f19dd8debf0..b9a095f8fbc1fd1a8e21b5ee108703c35c7d88d8 100755 (executable)
@@ -24,8 +24,7 @@ DEB_CONFIGURE_EXTRA_FLAGS = \
        --with-socketdir="/var/run" \
        --with-logfile="/var/log/tripe/tripe.log" \
        --with-pidfile="/var/run/tripectl.pid" \
-       --with-initconfig="/etc/default/tripe" \
-       --with-wireshark="/usr/lib/wireshark/libwireshark0/plugins"
+       --with-initconfig="/etc/default/tripe"
 
 ###--------------------------------------------------------------------------
 ### Python.