This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH v2] Handle AR_NM_RANLIB_DEFAULT_PLUGIN environment variable


This one is a simpler.

2012-09-16  Markus Trippelsdorf  <markus@trippelsdorf.de>

binutils/
	* ar.c (main): Handle AR_NM_RANLIB_DEFAULT_PLUGIN
	environment variable.
	* nm.c (main): Likewise.

diff --git a/binutils/ar.c b/binutils/ar.c
index aceb9d1..062c08c 100644
--- a/binutils/ar.c
+++ b/binutils/ar.c
@@ -61,7 +61,7 @@ static void write_archive (bfd *);
 static int  ranlib_only (const char *archname);
 static int  ranlib_touch (const char *archname);
 static void usage (int);
-
+
 /** Globals and flags.  */
 
 static int mri_mode;
@@ -675,6 +675,13 @@ main (int argc, char **argv)
   xmalloc_set_program_name (program_name);
 #if BFD_SUPPORTS_PLUGINS
   bfd_plugin_set_program_name (program_name);
+  char *plugin_path = getenv ("AR_NM_RANLIB_DEFAULT_PLUGIN");
+
+  if (plugin_path)
+    {
+      plugin_target = "plugin";
+      bfd_plugin_set_plugin (plugin_path);
+    }
 #endif
 
   expandargv (&argc, &argv);
diff --git a/binutils/nm.c b/binutils/nm.c
index ad38e27..f1d2aab 100644
--- a/binutils/nm.c
+++ b/binutils/nm.c
@@ -1536,6 +1536,13 @@ main (int argc, char **argv)
   xmalloc_set_program_name (program_name);
 #if BFD_SUPPORTS_PLUGINS
   bfd_plugin_set_program_name (program_name);
+  char *plugin_path = getenv ("AR_NM_RANLIB_DEFAULT_PLUGIN");
+
+  if (plugin_path)
+    {
+      plugin_target = "plugin";
+      bfd_plugin_set_plugin (plugin_path);
+    }
 #endif
 
   START_PROGRESS (program_name, 0);
-- 
Markus


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]