Add support for "--with-plugindir=<plugin install dir>" to configure.
authorGerald Combs <gerald@wireshark.org>
Tue, 28 Dec 1999 04:40:24 +0000 (04:40 -0000)
committerGerald Combs <gerald@wireshark.org>
Tue, 28 Dec 1999 04:40:24 +0000 (04:40 -0000)
Make the default plugindir $(libdir)/ethereal/plugins/0.8.  Ethereal now
looks for plugins in the following directories:
  /usr/lib/ethereal/plugins/0.8
  /usr/local/lib/ethereal/plugins/0.8
  $plugindir (if different from above)
  $HOME/.ethereal/plugins

svn path=/trunk/; revision=1382

acconfig.h
configure.in
gtk/plugins_dlg.c
plugins/gryphon/Makefile.am

index ad6c942f83a6f007901fd73b0a74fda83d0ff315..da48106a98096f132691b29b9167116738bb1278 100644 (file)
@@ -1,7 +1,7 @@
 /* acconfig.h
  * #ifdefs to be controlled by "configure"
  *
- * $Id: acconfig.h,v 1.12 1999/10/14 06:55:11 guy Exp $
+ * $Id: acconfig.h,v 1.13 1999/12/28 04:40:05 gerald Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@zing.org>
@@ -36,3 +36,5 @@
 #undef NEED_SNPRINTF_H
 
 #undef NEED_STRERROR_H
+
+#undef PLUGIN_DIR
index fd0af0b4bff93a5911dc5e059af05bea0eb88d9e..f2a55dbf5b54ac210935cf846b29f157215a1d86 100644 (file)
@@ -1,4 +1,4 @@
-# $Id: configure.in,v 1.67 1999/12/26 22:37:19 gerald Exp $
+# $Id: configure.in,v 1.68 1999/12/28 04:40:06 gerald Exp $
 dnl
 dnl Process this file with autoconf 2.13 or later to produce a
 dnl configure script; 2.12 doesn't generate a "configure" script that
@@ -273,6 +273,28 @@ AC_CHECK_FUNCS(getprotobynumber gethostbyname2)
 dnl blank for now, but will be used in future
 AC_SUBST(ethereal_SUBDIRS)
 
+dnl check for plugins directory - stolen from Amanda's configure.in
+AC_ARG_WITH(plugindir,
+  [  --with-plugindir=DIR   install plugins in DIR],
+  [
+  case "$withval" in
+  "" | y | ye | yes | n | no)
+    AC_MSG_ERROR([*** You must supply an argument to the --with-plugindir option.])
+  ;;
+  *) PLUGIN_DIR="$withval"
+  esac
+  ],
+  : ${PLUGIN_DIR=$libdir/ethereal/0.8}
+)
+
+PLUGIN_DIR=`(
+  test "x$prefix" = xNONE && prefix=$ac_default_prefix
+  test "x$exec_prefix" = xNONE && exec_prefix=${prefix}
+  eval echo "$PLUGIN_DIR"
+)`
+AC_DEFINE_UNQUOTED(PLUGIN_DIR,"$PLUGIN_DIR", [Plugin installation directory])
+AC_SUBST(PLUGIN_DIR)
+
 dnl libtool defs
 AC_LIBLTDL_CONVENIENCE(libltdl)
 AC_LIBTOOL_DLOPEN
index cc11fa8642837703a601c5bb7b8971104e392cb2..f3f635215f8e5eca54f2bb11f22d7cd0f6c71baa 100644 (file)
@@ -1,7 +1,7 @@
 /* plugins_dlg.c
  * Dialog boxes for plugins
  *
- * $Id: plugins_dlg.c,v 1.4 1999/12/26 22:37:28 gerald Exp $
+ * $Id: plugins_dlg.c,v 1.5 1999/12/28 04:40:13 gerald Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@zing.org>
@@ -46,8 +46,8 @@ static gint selected_row;
 static gchar *selected_name;
 static gchar *selected_version;
 static gchar *selected_enabled;
-static gchar std_plug_dir[] = "/usr/share/ethereal/plugins";
-static gchar local_plug_dir[] = "/usr/local/share/ethereal/plugins";
+static gchar std_plug_dir[] = "/usr/lib/ethereal/plugins/0.8";
+static gchar local_plug_dir[] = "/usr/local/lib/ethereal/plugins/0.8";
 static gchar *user_plug_dir = NULL;
 
 static void plugins_close_cb(GtkWidget *, gpointer);
@@ -173,6 +173,11 @@ plugins_scan(GtkWidget *clist)
     {
        plugins_scan_dir(std_plug_dir);
        plugins_scan_dir(local_plug_dir);
+        if ((strcmp(std_plug_dir, PLUGIN_DIR) != 0) &&
+            (strcmp(local_plug_dir, PLUGIN_DIR) != 0))
+        {
+          plugins_scan_dir(PLUGIN_DIR);
+        }
        if (!user_plug_dir)
        {
            user_plug_dir = (gchar *)g_malloc(strlen(getenv("HOME")) + 19);
index 9a20ed3c718ea226b03d51c75b9ed4a27d83d1f0..ec7aea9a37879cc67e1032d938d1cd20624c2351 100644 (file)
@@ -1,7 +1,7 @@
 # Makefile.am
 # Automake file for Ethereal/Gryphon
 #
-# $Id: Makefile.am,v 1.2 1999/12/26 22:37:39 gerald Exp $
+# $Id: Makefile.am,v 1.3 1999/12/28 04:40:24 gerald Exp $
 #
 # Ethereal - Network traffic analyzer
 # By Steve Limkemann <stevelim@dgtech.com>
@@ -25,9 +25,9 @@
 
 INCLUDES = -I$(top_srcdir) -I$(includedir)
 
-libdir = $(prefix)/share/@PACKAGE@/plugins/0.8
+plugindir = @PLUGIN_DIR@
 
-lib_LTLIBRARIES = gryphon.la
+plugin_LTLIBRARIES = gryphon.la
 gryphon_la_SOURCES = packet-gryphon.c packet-gryphon.h
 gryphon_la_LDFLAGS = -module -avoid-version