aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4>2006-01-06 13:22:19 +0000
committerjsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4>2006-01-06 13:22:19 +0000
commita83574bc37cf6ad91e5987f04188e3a740fd5128 (patch)
treea453a1d6ba72eb75e3ffb5a5908ec659f43edf8f
parente733445280534509160cae5aa183acfee973bbf2 (diff)
* gcc/cppdefault.h (struct default_include): Add multilib flag.
* gcc/cppdefault.c (cpp_include_defaults): Set it. * gcc/c.opt (-imultilib): New option. * gcc/c-opts.c (imultilib): New. (c_common_handle_option): Handle -imultilib. (c_common_post_options): Likewise. * gcc/c-incpath.c (add_standard_paths, register_include_chains): Likewise. * gcc/c-incpath.h (register_include_chains): Add extra parameter. * gcc/gcc.c (do_spec_1): Generate -imultilib option. * libstdc++-v3/include/Makefile.am: Install host-specific headers in multilib subdirectory. * libstdc++-v3/include/Makefile.in: Regenerate. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/csl-3_4_3-linux-branch@109418 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--ChangeLog.csl16
-rw-r--r--gcc/c-incpath.c16
-rw-r--r--gcc/c-incpath.h3
-rw-r--r--gcc/c-opts.c9
-rw-r--r--gcc/c.opt4
-rw-r--r--gcc/cppdefault.c22
-rw-r--r--gcc/cppdefault.h3
-rw-r--r--gcc/gcc.c9
-rw-r--r--libstdc++-v3/include/Makefile.am14
-rw-r--r--libstdc++-v3/include/Makefile.in14
10 files changed, 80 insertions, 30 deletions
diff --git a/ChangeLog.csl b/ChangeLog.csl
index 51c6d9f9979..2338029fd64 100644
--- a/ChangeLog.csl
+++ b/ChangeLog.csl
@@ -1,3 +1,19 @@
+2006-01-06 Joseph Myers <joseph@codesourcery.com>
+
+ * gcc/cppdefault.h (struct default_include): Add multilib flag.
+ * gcc/cppdefault.c (cpp_include_defaults): Set it.
+ * gcc/c.opt (-imultilib): New option.
+ * gcc/c-opts.c (imultilib): New.
+ (c_common_handle_option): Handle -imultilib.
+ (c_common_post_options): Likewise.
+ * gcc/c-incpath.c (add_standard_paths, register_include_chains):
+ Likewise.
+ * gcc/c-incpath.h (register_include_chains): Add extra parameter.
+ * gcc/gcc.c (do_spec_1): Generate -imultilib option.
+ * libstdc++-v3/include/Makefile.am: Install host-specific headers
+ in multilib subdirectory.
+ * libstdc++-v3/include/Makefile.in: Regenerate.
+
2006-01-04 Joseph Myers <joseph@codesourcery.com>
* gcc/testsuite/gcc.dg/builtins-config.h (HAVE_C99_RUNTIME): Don't
diff --git a/gcc/c-incpath.c b/gcc/c-incpath.c
index b90bb7fde5d..cd6c1db918b 100644
--- a/gcc/c-incpath.c
+++ b/gcc/c-incpath.c
@@ -44,7 +44,7 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#endif
static void add_env_var_paths (const char *, int);
-static void add_standard_paths (const char *, const char *, int);
+static void add_standard_paths (const char *, const char *, const char *, int);
static void free_path (struct cpp_dir *, int);
static void merge_include_chains (cpp_reader *, int);
static struct cpp_dir *remove_duplicates (cpp_reader *, struct cpp_dir *,
@@ -118,7 +118,8 @@ add_env_var_paths (const char *env_var, int chain)
/* Append the standard include chain defined in cppdefault.c. */
static void
-add_standard_paths (const char *sysroot, const char *iprefix, int cxx_stdinc)
+add_standard_paths (const char *sysroot, const char *iprefix,
+ const char *imultilib, int cxx_stdinc)
{
const struct default_include *p;
size_t len;
@@ -140,6 +141,8 @@ add_standard_paths (const char *sysroot, const char *iprefix, int cxx_stdinc)
if (!strncmp (p->fname, cpp_GCC_INCLUDE_DIR, len))
{
char *str = concat (iprefix, p->fname + len, NULL);
+ if (p->multilib && imultilib)
+ str = concat (str, "/", imultilib, NULL);
add_path (str, SYSTEM, p->cxx_aware);
}
}
@@ -158,6 +161,9 @@ add_standard_paths (const char *sysroot, const char *iprefix, int cxx_stdinc)
else
str = update_path (p->fname, p->component);
+ if (p->multilib && imultilib)
+ str = concat (str, "/", imultilib, NULL);
+
add_path (str, SYSTEM, p->cxx_aware);
}
}
@@ -334,8 +340,8 @@ add_path (char *path, int chain, int cxx_aware)
removal, and registration with cpplib. */
void
register_include_chains (cpp_reader *pfile, const char *sysroot,
- const char *iprefix, int stdinc, int cxx_stdinc,
- int verbose)
+ const char *iprefix, const char *imultilib,
+ int stdinc, int cxx_stdinc, int verbose)
{
static const char *const lang_env_vars[] =
{ "C_INCLUDE_PATH", "CPLUS_INCLUDE_PATH",
@@ -355,7 +361,7 @@ register_include_chains (cpp_reader *pfile, const char *sysroot,
/* Finally chain on the standard directories. */
if (stdinc)
- add_standard_paths (sysroot, iprefix, cxx_stdinc);
+ add_standard_paths (sysroot, iprefix, imultilib, cxx_stdinc);
merge_include_chains (pfile, verbose);
diff --git a/gcc/c-incpath.h b/gcc/c-incpath.h
index 31ed657da2a..b15063ea803 100644
--- a/gcc/c-incpath.h
+++ b/gcc/c-incpath.h
@@ -18,6 +18,7 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
extern void split_quote_chain (void);
extern void add_path (char *, int, int);
extern void register_include_chains (cpp_reader *, const char *,
- const char *, int, int, int);
+ const char *, const char *,
+ int, int, int);
enum { QUOTE = 0, BRACKET, SYSTEM, AFTER };
diff --git a/gcc/c-opts.c b/gcc/c-opts.c
index acb55c5c60a..0517ca3bcee 100644
--- a/gcc/c-opts.c
+++ b/gcc/c-opts.c
@@ -73,6 +73,9 @@ static const char *deps_file;
/* The prefix given by -iprefix, if any. */
static const char *iprefix;
+/* The multilib directory given by -imultilib, if any. */
+static const char *imultilib;
+
/* The system root, if any. Overridden by -isysroot. */
static const char *sysroot = TARGET_SYSTEM_ROOT;
@@ -946,6 +949,10 @@ c_common_handle_option (size_t scode, const char *arg, int value)
defer_opt (code, arg);
break;
+ case OPT_imultilib:
+ imultilib = arg;
+ break;
+
case OPT_iprefix:
iprefix = arg;
break;
@@ -1085,7 +1092,7 @@ c_common_post_options (const char **pfilename)
sanitize_cpp_opts ();
- register_include_chains (parse_in, sysroot, iprefix,
+ register_include_chains (parse_in, sysroot, iprefix, imultilib,
std_inc, std_cxx_inc && c_dialect_cxx (), verbose);
flag_inline_trees = 1;
diff --git a/gcc/c.opt b/gcc/c.opt
index 36a405663d2..f6ca1ab1bff 100644
--- a/gcc/c.opt
+++ b/gcc/c.opt
@@ -700,6 +700,10 @@ imacros
C ObjC C++ ObjC++ Joined Separate
-imacros <file> Accept definition of macros in <file>
+imultilib
+C ObjC C++ ObjC++ Joined Separate
+-imultilib <dir> Set <dir> to be the multilib include subdirectory
+
include
C ObjC C++ ObjC++ Joined Separate
-include <file> Include the contents of <file> before other files
diff --git a/gcc/cppdefault.c b/gcc/cppdefault.c
index cc96da7f6db..bf6bdedd692 100644
--- a/gcc/cppdefault.c
+++ b/gcc/cppdefault.c
@@ -48,44 +48,44 @@ const struct default_include cpp_include_defaults[]
= {
#ifdef GPLUSPLUS_INCLUDE_DIR
/* Pick up GNU C++ generic include files. */
- { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1, 0 },
+ { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1, 0, 0 },
#endif
#ifdef GPLUSPLUS_TOOL_INCLUDE_DIR
/* Pick up GNU C++ target-dependent include files. */
- { GPLUSPLUS_TOOL_INCLUDE_DIR, "G++", 1, 1, 0 },
+ { GPLUSPLUS_TOOL_INCLUDE_DIR, "G++", 1, 1, 0, 1 },
#endif
#ifdef GPLUSPLUS_BACKWARD_INCLUDE_DIR
/* Pick up GNU C++ backward and deprecated include files. */
- { GPLUSPLUS_BACKWARD_INCLUDE_DIR, "G++", 1, 1, 0 },
+ { GPLUSPLUS_BACKWARD_INCLUDE_DIR, "G++", 1, 1, 0, 0 },
#endif
#ifdef LOCAL_INCLUDE_DIR
/* /usr/local/include comes before the fixincluded header files. */
- { LOCAL_INCLUDE_DIR, 0, 0, 1, 1 },
+ { LOCAL_INCLUDE_DIR, 0, 0, 1, 1, 0 },
#endif
#ifdef PREFIX_INCLUDE_DIR
- { PREFIX_INCLUDE_DIR, 0, 0, 1, 0 },
+ { PREFIX_INCLUDE_DIR, 0, 0, 1, 0, 0 },
#endif
#ifdef GCC_INCLUDE_DIR
/* This is the dir for fixincludes and for gcc's private headers. */
- { GCC_INCLUDE_DIR, "GCC", 0, 0, 0 },
+ { GCC_INCLUDE_DIR, "GCC", 0, 0, 0, 0 },
#endif
#ifdef CROSS_INCLUDE_DIR
/* One place the target system's headers might be. */
- { CROSS_INCLUDE_DIR, "GCC", 0, 0, 0 },
+ { CROSS_INCLUDE_DIR, "GCC", 0, 0, 0, 0 },
#endif
#ifdef TOOL_INCLUDE_DIR
/* Another place the target system's headers might be. */
- { TOOL_INCLUDE_DIR, "BINUTILS", 0, 1, 0 },
+ { TOOL_INCLUDE_DIR, "BINUTILS", 0, 1, 0, 0 },
#endif
#ifdef SYSTEM_INCLUDE_DIR
/* Some systems have an extra dir of include files. */
- { SYSTEM_INCLUDE_DIR, 0, 0, 0, 1 },
+ { SYSTEM_INCLUDE_DIR, 0, 0, 0, 1, 0 },
#endif
#ifdef STANDARD_INCLUDE_DIR
/* /usr/include comes dead last. */
- { STANDARD_INCLUDE_DIR, STANDARD_INCLUDE_COMPONENT, 0, 0, 1 },
+ { STANDARD_INCLUDE_DIR, STANDARD_INCLUDE_COMPONENT, 0, 0, 1, 0 },
#endif
- { 0, 0, 0, 0, 0 }
+ { 0, 0, 0, 0, 0, 0 }
};
#endif /* no INCLUDE_DEFAULTS */
diff --git a/gcc/cppdefault.h b/gcc/cppdefault.h
index 368e082c79d..ec457662737 100644
--- a/gcc/cppdefault.h
+++ b/gcc/cppdefault.h
@@ -43,6 +43,9 @@ struct default_include
C++. */
const char add_sysroot; /* FNAME should be prefixed by
cpp_SYSROOT. */
+ const char multilib; /* FNAME should have the multilib path
+ specified with -imultilib
+ appended. */
};
extern const struct default_include cpp_include_defaults[];
diff --git a/gcc/gcc.c b/gcc/gcc.c
index 69576296c51..63a2418f2d1 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -4825,6 +4825,15 @@ do_spec_1 (const char *spec, int inswitch, const char *soft_matched_part)
{
struct prefix_list *pl = include_prefixes.plist;
+ if (multilib_dir)
+ {
+ do_spec_1 ("-imultilib", 1, NULL);
+ /* Make this a separate argument. */
+ do_spec_1 (" ", 0, NULL);
+ do_spec_1 (multilib_dir, 1, NULL);
+ do_spec_1 (" ", 0, NULL);
+ }
+
if (gcc_exec_prefix)
{
do_spec_1 ("-iprefix", 1, NULL);
diff --git a/libstdc++-v3/include/Makefile.am b/libstdc++-v3/include/Makefile.am
index 1ad63097504..cf5e95dd917 100644
--- a/libstdc++-v3/include/Makefile.am
+++ b/libstdc++-v3/include/Makefile.am
@@ -335,6 +335,7 @@ endif
host_srcdir = ${glibcxx_srcdir}/$(OS_INC_SRCDIR)
host_builddir = ./${host_alias}/bits
+host_installdir = ${gxx_include_dir}/${host_alias}$(MULTISUBDIR)/bits
host_headers = \
${host_srcdir}/ctype_base.h \
${host_srcdir}/ctype_inline.h \
@@ -366,6 +367,7 @@ thread_host_headers = \
pch_input = ${host_builddir}/stdc++.h
pch_output_builddir = ${host_builddir}/stdc++.h.gch
+pch_output_installdir = ${host_installdir}/stdc++.h.gch
pch_source = ${glibcxx_srcdir}/include/stdc++.h
PCHFLAGS=-Winvalid-pch -Wno-deprecated -x c++-header $(CXXFLAGS)
if GLIBCXX_BUILD_PCH
@@ -566,9 +568,9 @@ endif
# are copied here.
install-freestanding-headers:
$(mkinstalldirs) $(DESTDIR)${gxx_include_dir}
- $(mkinstalldirs) $(DESTDIR)${gxx_include_dir}/${host_builddir}
+ $(mkinstalldirs) $(DESTDIR)${host_installdir}
for file in ${host_srcdir}/os_defines.h ${host_builddir}/c++config.h; do \
- $(INSTALL_DATA) $${file} $(DESTDIR)${gxx_include_dir}/${host_builddir}; done
+ $(INSTALL_DATA) $${file} $(DESTDIR)${host_installdir}; done
$(mkinstalldirs) $(DESTDIR)${gxx_include_dir}/${std_builddir}
$(INSTALL_DATA) ${std_builddir}/limits $(DESTDIR)${gxx_include_dir}/${std_builddir}
$(mkinstalldirs) $(DESTDIR)${gxx_include_dir}/${c_base_builddir}
@@ -602,15 +604,15 @@ install-headers:
$(mkinstalldirs) $(DESTDIR)${gxx_include_dir}/${debug_builddir}
for file in ${debug_headers}; do \
$(INSTALL_DATA) $${file} $(DESTDIR)${gxx_include_dir}/${debug_builddir}; done
- $(mkinstalldirs) $(DESTDIR)${gxx_include_dir}/${host_builddir}
+ $(mkinstalldirs) $(DESTDIR)${host_installdir}
for file in ${host_headers} ${host_headers_extra} \
${thread_host_headers}; do \
- $(INSTALL_DATA) $${file} $(DESTDIR)${gxx_include_dir}/${host_builddir}; done
+ $(INSTALL_DATA) $${file} $(DESTDIR)${host_installdir}; done
install-pch:
- $(mkinstalldirs) $(DESTDIR)${gxx_include_dir}/${pch_output_builddir}
+ $(mkinstalldirs) $(DESTDIR)${pch_output_installdir}
for file in ${pch_output_builddir}/*; do \
- $(INSTALL_DATA) $$file $(DESTDIR)${gxx_include_dir}/${pch_output_builddir}; done
+ $(INSTALL_DATA) $$file $(DESTDIR)${pch_output_installdir}; done
# By adding these files here, automake will remove them for 'make clean'
CLEANFILES = ${pch_input} ${pch_output_builddir}/*
diff --git a/libstdc++-v3/include/Makefile.in b/libstdc++-v3/include/Makefile.in
index 9de2d75c40e..24225c6d8b8 100644
--- a/libstdc++-v3/include/Makefile.in
+++ b/libstdc++-v3/include/Makefile.in
@@ -535,6 +535,7 @@ debug_headers = \
host_srcdir = ${glibcxx_srcdir}/$(OS_INC_SRCDIR)
host_builddir = ./${host_alias}/bits
+host_installdir = ${gxx_include_dir}/${host_alias}$(MULTISUBDIR)/bits
host_headers = \
${host_srcdir}/ctype_base.h \
${host_srcdir}/ctype_inline.h \
@@ -570,6 +571,7 @@ thread_host_headers = \
pch_input = ${host_builddir}/stdc++.h
pch_output_builddir = ${host_builddir}/stdc++.h.gch
+pch_output_installdir = ${host_installdir}/stdc++.h.gch
pch_source = ${glibcxx_srcdir}/include/stdc++.h
PCHFLAGS = -Winvalid-pch -Wno-deprecated -x c++-header $(CXXFLAGS)
@GLIBCXX_BUILD_PCH_TRUE@pch_build = ${pch_input}
@@ -919,9 +921,9 @@ ${pch_input}: ${allstamped} ${host_builddir}/c++config.h ${pch_source}
# are copied here.
install-freestanding-headers:
$(mkinstalldirs) $(DESTDIR)${gxx_include_dir}
- $(mkinstalldirs) $(DESTDIR)${gxx_include_dir}/${host_builddir}
+ $(mkinstalldirs) $(DESTDIR)${host_installdir}
for file in ${host_srcdir}/os_defines.h ${host_builddir}/c++config.h; do \
- $(INSTALL_DATA) $${file} $(DESTDIR)${gxx_include_dir}/${host_builddir}; done
+ $(INSTALL_DATA) $${file} $(DESTDIR)${host_installdir}; done
$(mkinstalldirs) $(DESTDIR)${gxx_include_dir}/${std_builddir}
$(INSTALL_DATA) ${std_builddir}/limits $(DESTDIR)${gxx_include_dir}/${std_builddir}
$(mkinstalldirs) $(DESTDIR)${gxx_include_dir}/${c_base_builddir}
@@ -955,15 +957,15 @@ install-headers:
$(mkinstalldirs) $(DESTDIR)${gxx_include_dir}/${debug_builddir}
for file in ${debug_headers}; do \
$(INSTALL_DATA) $${file} $(DESTDIR)${gxx_include_dir}/${debug_builddir}; done
- $(mkinstalldirs) $(DESTDIR)${gxx_include_dir}/${host_builddir}
+ $(mkinstalldirs) $(DESTDIR)${host_installdir}
for file in ${host_headers} ${host_headers_extra} \
${thread_host_headers}; do \
- $(INSTALL_DATA) $${file} $(DESTDIR)${gxx_include_dir}/${host_builddir}; done
+ $(INSTALL_DATA) $${file} $(DESTDIR)${host_installdir}; done
install-pch:
- $(mkinstalldirs) $(DESTDIR)${gxx_include_dir}/${pch_output_builddir}
+ $(mkinstalldirs) $(DESTDIR)${pch_output_installdir}
for file in ${pch_output_builddir}/*; do \
- $(INSTALL_DATA) $$file $(DESTDIR)${gxx_include_dir}/${pch_output_builddir}; done
+ $(INSTALL_DATA) $$file $(DESTDIR)${pch_output_installdir}; done
# Stop implicit '.o' make rules from ever stomping on extensionless
# headers, in the improbable case where some foolish, crack-addled