summaryrefslogtreecommitdiff
path: root/binutils/windres.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2011-04-13 07:50:13 +0000
committerNick Clifton <nickc@redhat.com>2011-04-13 07:50:13 +0000
commit9cbc9c998c5f8b86431623606ebeb182a10b22c6 (patch)
tree845e860bf1ff5e5607e4e3e4d6d1517827a58304 /binutils/windres.c
parent17f432732582e69c92288e90ce3238eea1978083 (diff)
downloadbinutils-redhat-9cbc9c998c5f8b86431623606ebeb182a10b22c6.tar.gz
* windres.c (usage): Add new --preprocessor-arg option.
(option_values): Add new OPTION_PREPROCESSOR_ARG enumerator. (option long_options): Add preprocessor-arg option. (main): Handle it. * doc/binutils.texi: Add documentation for --preprocessor-arg option. * NEWS: Add line about new --preprocessor-arg option for windres. * binutils-all/windres/windres.exp: Add '// cpparg <option>' command to rc file interpretation to specify addition pre-processor commands as script option. * binutils-all/windres/strtab3.rc: New. * binutils-all/windres/strtab3.rsd: New. * binutils-all/windres/README: Add note about cpparg script option. argument
Diffstat (limited to 'binutils/windres.c')
-rw-r--r--binutils/windres.c25
1 files changed, 23 insertions, 2 deletions
diff --git a/binutils/windres.c b/binutils/windres.c
index 05b7559f74..4b40c97183 100644
--- a/binutils/windres.c
+++ b/binutils/windres.c
@@ -1,6 +1,6 @@
/* windres.c -- a program to manipulate Windows resources
Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008,
- 2009 Free Software Foundation, Inc.
+ 2009, 2011 Free Software Foundation, Inc.
Written by Ian Lance Taylor, Cygnus Support.
Rewritten by Kai Tietz, Onevision.
@@ -665,6 +665,7 @@ usage (FILE *stream, int status)
-O --output-format=<format> Specify output format\n\
-F --target=<target> Specify COFF target\n\
--preprocessor=<program> Program to use to preprocess rc file\n\
+ --preprocessor-arg=<arg> Additional preprocessor argument\n\
-I --include-dir=<dir> Include directory when preprocessing rc file\n\
-D --define <sym>[=<val>] Define SYM when preprocessing rc file\n\
-U --undefine <sym> Undefine SYM when preprocessing rc file\n\
@@ -734,7 +735,8 @@ enum option_values
OPTION_USE_TEMP_FILE,
OPTION_NO_USE_TEMP_FILE,
OPTION_YYDEBUG,
- OPTION_INCLUDE_DIR
+ OPTION_INCLUDE_DIR,
+ OPTION_PREPROCESSOR_ARG
};
static const struct option long_options[] =
@@ -745,6 +747,7 @@ static const struct option long_options[] =
{"output-format", required_argument, 0, 'O'},
{"target", required_argument, 0, 'F'},
{"preprocessor", required_argument, 0, OPTION_PREPROCESSOR},
+ {"preprocessor-arg", required_argument, 0, OPTION_PREPROCESSOR_ARG},
{"include-dir", required_argument, 0, OPTION_INCLUDE_DIR},
{"define", required_argument, 0, 'D'},
{"undefine", required_argument, 0, 'U'},
@@ -889,6 +892,24 @@ main (int argc, char **argv)
preprocessor = optarg;
break;
+ case OPTION_PREPROCESSOR_ARG:
+ if (preprocargs == NULL)
+ {
+ quotedarg = quot (optarg);
+ preprocargs = xstrdup (quotedarg);
+ }
+ else
+ {
+ char *n;
+
+ quotedarg = quot (optarg);
+ n = xmalloc (strlen (preprocargs) + strlen (quotedarg) + 2);
+ sprintf (n, "%s %s", preprocargs, quotedarg);
+ free (preprocargs);
+ preprocargs = n;
+ }
+ break;
+
case 'D':
case 'U':
if (preprocargs == NULL)