Commit 2378088a by Per Bothner

*** empty log message ***

From-SVN: r649
parent c733e074
...@@ -65,7 +65,6 @@ typedef unsigned char U_CHAR; ...@@ -65,7 +65,6 @@ typedef unsigned char U_CHAR;
#include <signal.h> #include <signal.h>
#ifndef VMS #ifndef VMS
#include <sys/file.h>
#ifndef USG #ifndef USG
#include <sys/time.h> /* for __DATE__ and __TIME__ */ #include <sys/time.h> /* for __DATE__ and __TIME__ */
#include <sys/resource.h> #include <sys/resource.h>
...@@ -886,6 +885,7 @@ main (argc, argv) ...@@ -886,6 +885,7 @@ main (argc, argv)
char **pend_assertion_options = (char **) xmalloc (argc * sizeof (char *)); char **pend_assertion_options = (char **) xmalloc (argc * sizeof (char *));
int inhibit_predefs = 0; int inhibit_predefs = 0;
int no_standard_includes = 0; int no_standard_includes = 0;
int no_standard_cplusplus_includes = 0;
int missing_newline = 0; int missing_newline = 0;
/* Non-0 means don't output the preprocessed program. */ /* Non-0 means don't output the preprocessed program. */
...@@ -1266,6 +1266,9 @@ main (argc, argv) ...@@ -1266,6 +1266,9 @@ main (argc, argv)
/* -nostdinc causes no default include directories. /* -nostdinc causes no default include directories.
You must specify all include-file directories with -I. */ You must specify all include-file directories with -I. */
no_standard_includes = 1; no_standard_includes = 1;
else if (!strcmp (argv[i], "-nostdinc++"))
/* -nostdinc++ causes no default C++-specific include directories. */
no_standard_cplusplus_includes = 1;
else if (!strcmp (argv[i], "-noprecomp")) else if (!strcmp (argv[i], "-noprecomp"))
no_precomp = 1; no_precomp = 1;
break; break;
...@@ -1501,7 +1504,7 @@ main (argc, argv) ...@@ -1501,7 +1504,7 @@ main (argc, argv)
if (specd_prefix != 0 && default_len != 0) if (specd_prefix != 0 && default_len != 0)
for (p = include_defaults; p->fname; p++) { for (p = include_defaults; p->fname; p++) {
/* Some standard dirs are only for C++. */ /* Some standard dirs are only for C++. */
if (!p->cplusplus || cplusplus) { if (!p->cplusplus || (cplusplus && !no_standard_cplusplus_includes)) {
/* Does this dir start with the prefix? */ /* Does this dir start with the prefix? */
if (!strncmp (p->fname, default_prefix, default_len)) { if (!strncmp (p->fname, default_prefix, default_len)) {
/* Yes; change prefix and add to search list. */ /* Yes; change prefix and add to search list. */
...@@ -1533,7 +1536,7 @@ main (argc, argv) ...@@ -1533,7 +1536,7 @@ main (argc, argv)
/* Search ordinary names for GNU include directories. */ /* Search ordinary names for GNU include directories. */
for (p = include_defaults; p->fname; p++) { for (p = include_defaults; p->fname; p++) {
/* Some standard dirs are only for C++. */ /* Some standard dirs are only for C++. */
if (!p->cplusplus || cplusplus) { if (!p->cplusplus || (cplusplus && !no_standard_cplusplus_includes)) {
struct file_name_list *new struct file_name_list *new
= (struct file_name_list *) xmalloc (sizeof (struct file_name_list)); = (struct file_name_list *) xmalloc (sizeof (struct file_name_list));
new->control_macro = 0; new->control_macro = 0;
......
...@@ -34,20 +34,19 @@ compilation is specified by a string called a "spec". */ ...@@ -34,20 +34,19 @@ compilation is specified by a string called a "spec". */
#include <sys/types.h> #include <sys/types.h>
#include <ctype.h> #include <ctype.h>
#include <signal.h> #include <signal.h>
#include <sys/file.h>
#include <sys/stat.h> #include <sys/stat.h>
#include "config.h" #include "config.h"
#include "obstack.h" #include "obstack.h"
#include "gvarargs.h" #include "gvarargs.h"
#ifdef USG
#ifndef R_OK #ifndef R_OK
#define R_OK 4 #define R_OK 4
#define W_OK 2 #define W_OK 2
#define X_OK 1 #define X_OK 1
#endif #endif
#ifdef USG
#define vfork fork #define vfork fork
#endif /* USG */ #endif /* USG */
...@@ -395,7 +394,7 @@ static struct compiler default_compilers[] = ...@@ -395,7 +394,7 @@ static struct compiler default_compilers[] =
{ {
{".c", "@c"}, {".c", "@c"},
{"@c", {"@c",
"cpp -lang-c %{nostdinc} %{C} %{v} %{A*} %{D*} %{U*} %{I*} %{i*} %{P}\ "cpp -lang-c %{nostdinc*} %{C} %{v} %{A*} %{D*} %{U*} %{I*} %{i*} %{P}\
%{C:%{!E:%eGNU C does not support -C without using -E}}\ %{C:%{!E:%eGNU C does not support -C without using -E}}\
%{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d}\ %{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d}\
-undef -D__GNUC__=2 %{ansi:-trigraphs -$ -D__STRICT_ANSI__}\ -undef -D__GNUC__=2 %{ansi:-trigraphs -$ -D__STRICT_ANSI__}\
...@@ -415,7 +414,7 @@ static struct compiler default_compilers[] = ...@@ -415,7 +414,7 @@ static struct compiler default_compilers[] =
%{c:%W{o*}%{!o*:-o %w%b.o}}%{!c:-o %d%w%b.o}\ %{c:%W{o*}%{!o*:-o %w%b.o}}%{!c:-o %d%w%b.o}\
%{!pipe:%g.s} %A\n }}}}"}, %{!pipe:%g.s} %A\n }}}}"},
{"-", {"-",
"%{E:cpp -lang-c %{nostdinc} %{C} %{v} %{A*} %{D*} %{U*} %{I*} %{i*} %{P}\ "%{E:cpp -lang-c %{nostdinc*} %{C} %{v} %{A*} %{D*} %{U*} %{I*} %{i*} %{P}\
%{C:%{!E:%eGNU C does not support -C without using -E}}\ %{C:%{!E:%eGNU C does not support -C without using -E}}\
%{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d}\ %{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d}\
-undef -D__GNUC__=2 %{ansi:-trigraphs -$ -D__STRICT_ANSI__}\ -undef -D__GNUC__=2 %{ansi:-trigraphs -$ -D__STRICT_ANSI__}\
...@@ -427,7 +426,7 @@ static struct compiler default_compilers[] = ...@@ -427,7 +426,7 @@ static struct compiler default_compilers[] =
%{!E:%e-E required when input is from standard input}"}, %{!E:%e-E required when input is from standard input}"},
{".m", "@objective-c"}, {".m", "@objective-c"},
{"@objective-c", {"@objective-c",
"cpp -lang-objc %{nostdinc} %{C} %{v} %{A*} %{D*} %{U*} %{I*} %{i*} %{P}\ "cpp -lang-objc %{nostdinc*} %{C} %{v} %{A*} %{D*} %{U*} %{I*} %{i*} %{P}\
%{C:%{!E:%eGNU C does not support -C without using -E}}\ %{C:%{!E:%eGNU C does not support -C without using -E}}\
%{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d}\ %{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d}\
-undef -D__OBJC__ -D__GNUC__=2 %{ansi:-trigraphs -$ -D__STRICT_ANSI__}\ -undef -D__OBJC__ -D__GNUC__=2 %{ansi:-trigraphs -$ -D__STRICT_ANSI__}\
...@@ -450,7 +449,7 @@ static struct compiler default_compilers[] = ...@@ -450,7 +449,7 @@ static struct compiler default_compilers[] =
{".h", "@c-header"}, {".h", "@c-header"},
{"@c-header", {"@c-header",
"%{!E:%eCompilation of header file requested} \ "%{!E:%eCompilation of header file requested} \
cpp %{nostdinc} %{C} %{v} %{A*} %{D*} %{U*} %{I*} %{i*} %{P}\ cpp %{nostdinc*} %{C} %{v} %{A*} %{D*} %{U*} %{I*} %{i*} %{P}\
%{C:%{!E:%eGNU C does not support -C without using -E}}\ %{C:%{!E:%eGNU C does not support -C without using -E}}\
%{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d} \ %{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d} \
-undef -D__GNUC__=2 %{ansi:-trigraphs -$ -D__STRICT_ANSI__}\ -undef -D__GNUC__=2 %{ansi:-trigraphs -$ -D__STRICT_ANSI__}\
...@@ -463,7 +462,7 @@ static struct compiler default_compilers[] = ...@@ -463,7 +462,7 @@ static struct compiler default_compilers[] =
{".cxx", "@c++"}, {".cxx", "@c++"},
{".C", "@c++"}, {".C", "@c++"},
{"@c++", {"@c++",
"cpp -lang-c++ %{nostdinc} %{C} %{v} %{A*} %{D*} %{U*} %{I*} %{i*} %{P}\ "cpp -lang-c++ %{nostdinc*} %{C} %{v} %{A*} %{D*} %{U*} %{I*} %{i*} %{P}\
%{C:%{!E:%eGNU C++ does not support -C without using -E}}\ %{C:%{!E:%eGNU C++ does not support -C without using -E}}\
%{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d} \ %{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d} \
-undef -D__GNUC__=2 -D__GNUG__=2 -D__cplusplus \ -undef -D__GNUC__=2 -D__GNUG__=2 -D__cplusplus \
...@@ -509,7 +508,7 @@ static struct compiler default_compilers[] = ...@@ -509,7 +508,7 @@ static struct compiler default_compilers[] =
%{c:%W{o*}%{!o*:-o %w%b.o}}%{!c:-o %d%w%b.o} %i %A\n }"}, %{c:%W{o*}%{!o*:-o %w%b.o}}%{!c:-o %d%w%b.o} %i %A\n }"},
{".S", "@assembler-with-cpp"}, {".S", "@assembler-with-cpp"},
{"@assembler-with-cpp", {"@assembler-with-cpp",
"cpp -lang-asm %{nostdinc} %{C} %{v} %{A*} %{D*} %{U*} %{I*} %{i*} %{P}\ "cpp -lang-asm %{nostdinc*} %{C} %{v} %{A*} %{D*} %{U*} %{I*} %{i*} %{P}\
%{C:%{!E:%eGNU C does not support -C without using -E}}\ %{C:%{!E:%eGNU C does not support -C without using -E}}\
%{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d} %{trigraphs} \ %{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d} %{trigraphs} \
-undef -$ %{!undef:%p %P} -D__ASSEMBLER__ \ -undef -$ %{!undef:%p %P} -D__ASSEMBLER__ \
...@@ -533,16 +532,17 @@ static int n_default_compilers ...@@ -533,16 +532,17 @@ static int n_default_compilers
#ifdef LINK_LIBGCC_SPECIAL #ifdef LINK_LIBGCC_SPECIAL
/* Have gcc do the search. */ /* Have gcc do the search. */
/* -u* was put back because both BSD and SysV seem to support it. */
static char *link_command_spec = "\ static char *link_command_spec = "\
%{!c:%{!M:%{!MM:%{!E:%{!S:ld %X %l %{o*} %{A} %{d} %{e*} %{m} %{N} %{n} \ %{!c:%{!M:%{!MM:%{!E:%{!S:ld %X %l %{o*} %{A} %{d} %{e*} %{m} %{N} %{n} \
%{r} %{s} %{T*} %{t} %{x} %{z}\ %{r} %{s} %{T*} %{t} %{u*} %{x} %{z}\
%{!A:%{!nostdlib:%S}} \ %{!A:%{!nostdlib:%S}} \
%{L*} %D %o %{!nostdlib:libgcc.a%s %L libgcc.a%s %{!A:%E}}\n }}}}}"; %{L*} %D %o %{!nostdlib:libgcc.a%s %L libgcc.a%s %{!A:%E}}\n }}}}}";
#else #else
/* Use -l and have the linker do the search. */ /* Use -l and have the linker do the search. */
static char *link_command_spec = "\ static char *link_command_spec = "\
%{!c:%{!M:%{!MM:%{!E:%{!S:ld %X %l %{o*} %{A} %{d} %{e*} %{m} %{N} %{n} \ %{!c:%{!M:%{!MM:%{!E:%{!S:ld %X %l %{o*} %{A} %{d} %{e*} %{m} %{N} %{n} \
%{r} %{s} %{T*} %{t} %{x} %{z}\ %{r} %{s} %{T*} %{t} %{u*} %{x} %{z}\
%{!A:%{!nostdlib:%S}} \ %{!A:%{!nostdlib:%S}} \
%{L*} %D %o %{!nostdlib:-lgcc %L -lgcc %{!A:%E}}\n }}}}}"; %{L*} %D %o %{!nostdlib:-lgcc %L -lgcc %{!A:%E}}\n }}}}}";
#endif #endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment