aboutsummaryrefslogtreecommitdiff
path: root/gcc/gcc.c
diff options
context:
space:
mode:
authorPeter O'Gorman <peter@pogma.com>2005-08-07 02:39:12 +0000
committerJames E. Wilson <wilson@specifixinc.com>2005-08-07 02:39:12 +0000
commitf6160a10b05f0394e0fb96636dade23b2c48af5a (patch)
tree0f8a13dcac8da97a70836a45d7a5b75832fe3342 /gcc/gcc.c
parentd3febd3b1d780fdedeb94a46f4199f2de48dd7c2 (diff)
Make Darwin -bundle option work. Patch from Peter O'Gorman.
PR 21366 * gcc.c (process_command): Check the argument to -b has a dash. * doc/invoke.texi: Update -b and -V docs. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@102829 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/gcc.c')
-rw-r--r--gcc/gcc.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/gcc/gcc.c b/gcc/gcc.c
index 7263b5f5309..a3a8402337e 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -3175,9 +3175,12 @@ process_command (int argc, const char **argv)
}
/* If there is a -V or -b option (or both), process it now, before
- trying to interpret the rest of the command line. */
+ trying to interpret the rest of the command line.
+ Use heuristic that all configuration names must have at least
+ one dash '-'. This allows us to pass options starting with -b. */
if (argc > 1 && argv[1][0] == '-'
- && (argv[1][1] == 'V' || argv[1][1] == 'b'))
+ && (argv[1][1] == 'V' ||
+ ((argv[1][1] == 'b') && (NULL != strchr(argv[1] + 2,'-')))))
{
const char *new_version = DEFAULT_TARGET_VERSION;
const char *new_machine = DEFAULT_TARGET_MACHINE;
@@ -3187,7 +3190,8 @@ process_command (int argc, const char **argv)
int baselen;
while (argc > 1 && argv[1][0] == '-'
- && (argv[1][1] == 'V' || argv[1][1] == 'b'))
+ && (argv[1][1] == 'V' ||
+ ((argv[1][1] == 'b') && ( NULL != strchr(argv[1] + 2,'-')))))
{
char opt = argv[1][1];
const char *arg;
@@ -3608,6 +3612,7 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n"
switch (c)
{
case 'b':
+ if (NULL == strchr(argv[i] + 2, '-')) break;
case 'V':
fatal ("'-%c' must come at the start of the command line", c);
break;