aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter O'Gorman <peter@pogma.com>2005-08-07 02:39:12 +0000
committerJim Wilson <wilson@gcc.gnu.org>2005-08-06 19:39:12 -0700
commit3300bf07379ac6aaa8367313eae8234f273c4ea8 (patch)
tree0f8a13dcac8da97a70836a45d7a5b75832fe3342
parente2ba06d66dfa00f390cb4d8199352853db7ba1bd (diff)
downloadgcc-3300bf07379ac6aaa8367313eae8234f273c4ea8.zip
gcc-3300bf07379ac6aaa8367313eae8234f273c4ea8.tar.gz
gcc-3300bf07379ac6aaa8367313eae8234f273c4ea8.tar.bz2
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. From-SVN: r102829
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/doc/invoke.texi8
-rw-r--r--gcc/gcc.c11
3 files changed, 19 insertions, 6 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index abf5670..be5749b 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2005-08-06 Peter O'Gorman <peter@pogma.com>
+
+ PR 21366
+ * gcc.c (process_command): Check the argument to -b has a dash.
+ * doc/invoke.texi: Update -b and -V docs.
+
2005-08-06 James E Wilson <wilson@specifix.com>
* config/mips/cross64.h, config/mips/t-cross64: Delete.
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index c4dcd88..cdedd81 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -6943,14 +6943,16 @@ The argument @var{machine} specifies the target machine for compilation.
The value to use for @var{machine} is the same as was specified as the
machine type when configuring GCC as a cross-compiler. For
example, if a cross-compiler was configured with @samp{configure
-i386v}, meaning to compile for an 80386 running System V, then you
-would specify @option{-b i386v} to run that cross compiler.
+arm-elf}, meaning to compile for an arm processor with elf binaries,
+then you would specify @option{-b arm-elf} to run that cross compiler.
+Because there are other options beginning with @option{-b}, the
+configuration must contain a hyphen.
@item -V @var{version}
@opindex V
The argument @var{version} specifies which version of GCC to run.
This is useful when multiple versions are installed. For example,
-@var{version} might be @samp{2.0}, meaning to run GCC version 2.0.
+@var{version} might be @samp{4.0}, meaning to run GCC version 4.0.
@end table
The @option{-V} and @option{-b} options work by running the
diff --git a/gcc/gcc.c b/gcc/gcc.c
index 7263b5f..a3a8402 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;