aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPer Bothner <bothner@gcc.gnu.org>1992-03-31 14:12:10 -0800
committerPer Bothner <bothner@gcc.gnu.org>1992-03-31 14:12:10 -0800
commit2378088aa6f765f0da07cc7b9408cdcb09e4264e (patch)
tree3ea4752a98e7e910ed799d320005b5c7cb72240f
parentc733e0743670fb3041fc15395baa38e9f44908e7 (diff)
downloadgcc-2378088aa6f765f0da07cc7b9408cdcb09e4264e.zip
gcc-2378088aa6f765f0da07cc7b9408cdcb09e4264e.tar.gz
gcc-2378088aa6f765f0da07cc7b9408cdcb09e4264e.tar.bz2
*** empty log message ***
From-SVN: r649
-rw-r--r--gcc/cccp.c9
-rw-r--r--gcc/gcc.c20
2 files changed, 16 insertions, 13 deletions
diff --git a/gcc/cccp.c b/gcc/cccp.c
index 54a95d2..979ad89 100644
--- a/gcc/cccp.c
+++ b/gcc/cccp.c
@@ -65,7 +65,6 @@ typedef unsigned char U_CHAR;
#include <signal.h>
#ifndef VMS
-#include <sys/file.h>
#ifndef USG
#include <sys/time.h> /* for __DATE__ and __TIME__ */
#include <sys/resource.h>
@@ -886,6 +885,7 @@ main (argc, argv)
char **pend_assertion_options = (char **) xmalloc (argc * sizeof (char *));
int inhibit_predefs = 0;
int no_standard_includes = 0;
+ int no_standard_cplusplus_includes = 0;
int missing_newline = 0;
/* Non-0 means don't output the preprocessed program. */
@@ -1266,6 +1266,9 @@ main (argc, argv)
/* -nostdinc causes no default include directories.
You must specify all include-file directories with -I. */
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"))
no_precomp = 1;
break;
@@ -1501,7 +1504,7 @@ main (argc, argv)
if (specd_prefix != 0 && default_len != 0)
for (p = include_defaults; p->fname; p++) {
/* 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? */
if (!strncmp (p->fname, default_prefix, default_len)) {
/* Yes; change prefix and add to search list. */
@@ -1533,7 +1536,7 @@ main (argc, argv)
/* Search ordinary names for GNU include directories. */
for (p = include_defaults; p->fname; p++) {
/* 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 *) xmalloc (sizeof (struct file_name_list));
new->control_macro = 0;
diff --git a/gcc/gcc.c b/gcc/gcc.c
index 16eda22..c67fcb4 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -34,20 +34,19 @@ compilation is specified by a string called a "spec". */
#include <sys/types.h>
#include <ctype.h>
#include <signal.h>
-#include <sys/file.h>
#include <sys/stat.h>
#include "config.h"
#include "obstack.h"
#include "gvarargs.h"
-#ifdef USG
#ifndef R_OK
#define R_OK 4
#define W_OK 2
#define X_OK 1
#endif
+#ifdef USG
#define vfork fork
#endif /* USG */
@@ -395,7 +394,7 @@ static struct compiler default_compilers[] =
{
{".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}}\
%{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d}\
-undef -D__GNUC__=2 %{ansi:-trigraphs -$ -D__STRICT_ANSI__}\
@@ -415,7 +414,7 @@ static struct compiler default_compilers[] =
%{c:%W{o*}%{!o*:-o %w%b.o}}%{!c:-o %d%w%b.o}\
%{!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}}\
%{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d}\
-undef -D__GNUC__=2 %{ansi:-trigraphs -$ -D__STRICT_ANSI__}\
@@ -427,7 +426,7 @@ static struct compiler default_compilers[] =
%{!E:%e-E required when input is from standard input}"},
{".m", "@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}}\
%{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d}\
-undef -D__OBJC__ -D__GNUC__=2 %{ansi:-trigraphs -$ -D__STRICT_ANSI__}\
@@ -450,7 +449,7 @@ static struct compiler default_compilers[] =
{".h", "@c-header"},
{"@c-header",
"%{!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}}\
%{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d} \
-undef -D__GNUC__=2 %{ansi:-trigraphs -$ -D__STRICT_ANSI__}\
@@ -463,7 +462,7 @@ static struct compiler default_compilers[] =
{".cxx", "@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}}\
%{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d} \
-undef -D__GNUC__=2 -D__GNUG__=2 -D__cplusplus \
@@ -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 }"},
{".S", "@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}}\
%{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d} %{trigraphs} \
-undef -$ %{!undef:%p %P} -D__ASSEMBLER__ \
@@ -533,16 +532,17 @@ static int n_default_compilers
#ifdef LINK_LIBGCC_SPECIAL
/* Have gcc do the search. */
+/* -u* was put back because both BSD and SysV seem to support it. */
static char *link_command_spec = "\
%{!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}} \
%{L*} %D %o %{!nostdlib:libgcc.a%s %L libgcc.a%s %{!A:%E}}\n }}}}}";
#else
/* Use -l and have the linker do the search. */
static char *link_command_spec = "\
%{!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}} \
%{L*} %D %o %{!nostdlib:-lgcc %L -lgcc %{!A:%E}}\n }}}}}";
#endif