2000-06-15 H.J. Lu <hjl@gnu.org>
[deliverable/binutils-gdb.git] / binutils / windres.c
index 0ccd909404c45ee5802ad15c9560d8021bc1fabc..89f0ac2ecc2617513aeceb241981251942e8ff32 100644 (file)
@@ -1,5 +1,5 @@
 /* windres.c -- a program to manipulate Windows resources
-   Copyright 1997, 1998, 1999 Free Software Foundation, Inc.
+   Copyright 1997, 98, 99, 2000 Free Software Foundation, Inc.
    Written by Ian Lance Taylor, Cygnus Support.
 
    This file is part of GNU Binutils.
@@ -113,7 +113,9 @@ static struct include_dir *include_dirs;
 #define OPTION_INCLUDE_DIR (OPTION_HELP + 1)
 #define OPTION_LANGUAGE (OPTION_INCLUDE_DIR + 1)
 #define OPTION_PREPROCESSOR (OPTION_LANGUAGE + 1)
-#define OPTION_VERSION (OPTION_PREPROCESSOR + 1)
+#define OPTION_USE_TEMP_FILE (OPTION_PREPROCESSOR + 1)
+#define OPTION_NO_USE_TEMP_FILE (OPTION_USE_TEMP_FILE + 1)
+#define OPTION_VERSION (OPTION_NO_USE_TEMP_FILE + 1)
 #define OPTION_YYDEBUG (OPTION_VERSION + 1)
 
 static const struct option long_options[] =
@@ -126,6 +128,8 @@ static const struct option long_options[] =
   {"output-format", required_argument, 0, 'O'},
   {"preprocessor", required_argument, 0, OPTION_PREPROCESSOR},
   {"target", required_argument, 0, 'F'},
+  {"use-temp-file", no_argument, 0, OPTION_USE_TEMP_FILE},
+  {"no-use-temp-file", no_argument, 0, OPTION_NO_USE_TEMP_FILE},
   {"verbose", no_argument, 0, 'v'},
   {"version", no_argument, 0, OPTION_VERSION},
   {"yydebug", no_argument, 0, OPTION_YYDEBUG},
@@ -595,7 +599,7 @@ format_from_name (name)
 
   if (m->name == NULL)
     {
-      fprintf (stderr, _("%s: unknown format type `%s'\n"), program_name, name);
+      non_fatal (_("unknown format type `%s'"), name);
       fprintf (stderr, _("%s: supported formats:"), program_name);
       for (m = format_names; m->name != NULL; m++)
        fprintf (stderr, " %s", m->name);
@@ -713,7 +717,10 @@ Options:\n\
   -DSYM[=VAL], --define SYM[=VAL]\n\
                               Define SYM when preprocessing rc file\n\
   -v                          Verbose - tells you what it's doing\n\
-  --language VAL              Set language when reading rc file\n"));
+  --language VAL              Set language when reading rc file\n\
+  --use-temp-file             Use a temporary file instead of popen to read\n\
+                              the preprocessor output\n\
+  --no-use-temp-file          Use popen (default)\n"));
 #ifdef YYDEBUG
   fprintf (stream, _("\
   --yydebug                   Turn on parser debugging\n"));
@@ -727,7 +734,7 @@ extension if not specified.  A single file name is an input file.\n\
 No input-file is stdin, default rc.  No output-file is stdout, default rc.\n"));
   list_supported_targets (program_name, stream);
   if (status == 0)
-    fprintf (stream, _("Report bugs to bug-gnu-utils@gnu.org\n"));
+    fprintf (stream, _("Report bugs to %s\n"), REPORT_BUGS_TO);
   exit (status);
 }
 
@@ -777,6 +784,7 @@ main (argc, argv)
   const char *quotedarg;
   int language;
   struct res_directory *resources;
+  int use_temp_file;
 
 #if defined (HAVE_SETLOCALE) && defined (HAVE_LC_MESSAGES)
   setlocale (LC_MESSAGES, "");
@@ -800,6 +808,7 @@ main (argc, argv)
   preprocessor = NULL;
   preprocargs = NULL;
   language = -1;
+  use_temp_file = 0;
 
   while ((c = getopt_long (argc, argv, "i:o:I:O:F:D:v", long_options,
                           (int *) 0)) != EOF)
@@ -890,6 +899,14 @@ main (argc, argv)
          language = strtol (optarg, (char **) NULL, 16);
          break;
 
+       case OPTION_USE_TEMP_FILE:
+         use_temp_file = 1;
+         break;
+
+       case OPTION_NO_USE_TEMP_FILE:
+         use_temp_file = 0;
+         break;
+
 #ifdef YYDEBUG
        case OPTION_YYDEBUG:
          yydebug = 1;
@@ -949,7 +966,7 @@ main (argc, argv)
       abort ();
     case RES_FORMAT_RC:
       resources = read_rc_file (input_filename, preprocessor, preprocargs,
-                               language);
+                               language, use_temp_file);
       break;
     case RES_FORMAT_RES:
       resources = read_res_file (input_filename);
This page took 0.035454 seconds and 4 git commands to generate.