+2006-01-20 Joseph S. Myers <joseph@codesourcery.com>
+
+ PR libstdc++/25524
+ * cppdefault.h (struct default_include): Add multilib flag.
+ * cppdefault.c (cpp_include_defaults): Set it.
+ * c.opt (-imultilib): New option.
+ * c-opts.c (imultilib): New.
+ (c_common_handle_option): Handle -imultilib.
+ (c_common_post_options): Likewise.
+ * c-incpath.c (add_standard_paths, register_include_chains):
+ Likewise.
+ * c-incpath.h (register_include_chains): Add extra parameter.
+ * gcc.c (do_spec_1): Generate -imultilib option.
+ (The Specs Language): Update %I description.
+ (process_command): Update copyright notice.
+ * doc/cppopts.texi (-imultilib): Document.
+ * doc/invoke.texi (-imultilib): Include in option summary.
+ (%I): Update specs documentation.
+
2006-01-20 Zdenek Dvorak <dvorakz@suse.cz>
* loop-iv.c (iv_analysis_loop_init): Use df in more conservative way.
/* Set up combined include path chain for the preprocessor.
Copyright (C) 1986, 1987, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
- 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+ 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
+ Free Software Foundation, Inc.
Broken out of cppinit.c and cppfiles.c and rewritten Mar 2003.
# define INO_T_COPY(DEST, SRC) (DEST) = (SRC)
#endif
+static const char dir_separator_str[] = { DIR_SEPARATOR, 0 };
+
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 *,
/* 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;
if (!strncmp (p->fname, cpp_GCC_INCLUDE_DIR, len))
{
char *str = concat (iprefix, p->fname + len, NULL);
+ if (p->multilib && imultilib)
+ str = concat (str, dir_separator_str, imultilib, NULL);
add_path (str, SYSTEM, p->cxx_aware, false);
}
}
else
str = update_path (p->fname, p->component);
+ if (p->multilib && imultilib)
+ str = concat (str, dir_separator_str, imultilib, NULL);
+
add_path (str, SYSTEM, p->cxx_aware, false);
}
}
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",
/* Finally chain on the standard directories. */
if (stdinc)
- add_standard_paths (sysroot, iprefix, cxx_stdinc);
+ add_standard_paths (sysroot, iprefix, imultilib, cxx_stdinc);
target_c_incpath.extra_includes (sysroot, iprefix, stdinc);
/* Set up combined include path for the preprocessor.
- Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
extern void split_quote_chain (void);
extern void add_path (char *, int, int, bool);
extern void register_include_chains (cpp_reader *, const char *,
- const char *, int, int, int);
+ const char *, const char *,
+ int, int, int);
extern void add_cpp_dir_path (struct cpp_dir *, int);
struct target_c_incpath_s {
/* C/ObjC/C++ command line option handling.
- Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
Contributed by Neil Booth.
This file is part of GCC.
/* 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;
defer_opt (code, arg);
break;
+ case OPT_imultilib:
+ imultilib = arg;
+ break;
+
case OPT_iprefix:
iprefix = arg;
break;
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;
; Options for the C, ObjC, C++ and ObjC++ front ends.
-; Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
+; Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
;
; This file is part of GCC.
;
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
/* CPP Library.
Copyright (C) 1986, 1987, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
- 1999, 2000, 2003, 2004 Free Software Foundation, Inc.
+ 1999, 2000, 2003, 2004, 2006 Free Software Foundation, Inc.
Contributed by Per Bothner, 1994-95.
Based on CCCP program by Paul Rubin, June 1986
Adapted to ANSI C, Richard Stallman, Jan 1987
= {
#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 */
/* CPP Library.
Copyright (C) 1986, 1987, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
- 1999, 2000, 2003, 2004 Free Software Foundation, Inc.
+ 1999, 2000, 2003, 2004, 2006 Free Software Foundation, Inc.
Contributed by Per Bothner, 1994-95.
Based on CCCP program by Paul Rubin, June 1986
Adapted to ANSI C, Richard Stallman, Jan 1987
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[];
-@c Copyright (c) 1999, 2000, 2001, 2002, 2003, 2004, 2005
+@c Copyright (c) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
@c Free Software Foundation, Inc.
@c This is part of the CPP and GCC manuals.
@c For copying conditions, see the file gcc.texi.
This option is like the @option{--sysroot} option, but applies only to
header files. See the @option{--sysroot} option for more information.
+@item -imultilib @var{dir}
+@opindex imultilib
+Use @var{dir} as a subdirectory of the directory containing
+target-specific C++ headers.
+
@item -isystem @var{dir}
@opindex isystem
Search @var{dir} for header files, after all directories specified by
@c man end
@c man begin COPYRIGHT
-Copyright @copyright{} 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997,
-1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+Copyright @copyright{} 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
+1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.2 or
-include @var{file} -imacros @var{file} @gol
-iprefix @var{file} -iwithprefix @var{dir} @gol
-iwithprefixbefore @var{dir} -isystem @var{dir} @gol
--isysroot @var{dir} @gol
+-imultilib @var{dir} -isysroot @var{dir} @gol
-M -MM -MF -MG -MP -MQ -MT -nostdinc @gol
-P -fworking-directory -remap @gol
-trigraphs -undef -U@var{macro} -Wp,@var{option} @gol
@item %I
Substitute any of @option{-iprefix} (made from @env{GCC_EXEC_PREFIX}),
-@option{-isysroot} (made from @env{TARGET_SYSTEM_ROOT}), and
+@option{-isysroot} (made from @env{TARGET_SYSTEM_ROOT}),
@option{-isystem} (made from @env{COMPILER_PATH} and @option{-B} options)
-as necessary.
+and @option{-imultilib} as necessary.
@item %s
Current argument is the name of a library or startup file of some sort.
/* Compiler driver program that can handle many languages.
Copyright (C) 1987, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
- 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation,
+ 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation,
Inc.
This file is part of GCC.
SUFFIX characters following %O as they would following, for
example, `.o'.
%I Substitute any of -iprefix (made from GCC_EXEC_PREFIX), -isysroot
- (made from TARGET_SYSTEM_ROOT), and -isystem (made from COMPILER_PATH
- and -B options) as necessary.
+ (made from TARGET_SYSTEM_ROOT), -isystem (made from COMPILER_PATH
+ and -B options) and -imultilib as necessary.
%s current argument is the name of a library or startup file of some sort.
Search for that file in a standard list of directories
and substitute the full name found.
{
/* translate_options () has turned --version into -fversion. */
printf (_("%s (GCC) %s\n"), programname, version_string);
- printf ("Copyright %s 2005 Free Software Foundation, Inc.\n",
+ printf ("Copyright %s 2006 Free Software Foundation, Inc.\n",
_("(C)"));
fputs (_("This is free software; see the source for copying conditions. There is NO\n\
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n"),
{
struct spec_path_info info;
+ 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);
+2006-01-20 Joseph S. Myers <joseph@codesourcery.com>
+
+ PR libstdc++/25524
+ * include/Makefile.am: Install host-specific headers in multilib
+ subdirectory.
+ * include/Makefile.in: Regenerate.
+
2006-01-19 Paolo Carlini <pcarlini@suse.de>
Implement list::splice (and merge) bits of N1599
## Makefile for the include subdirectory of the GNU C++ Standard library.
##
-## Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+## Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006
+## Free Software Foundation, Inc.
##
## This file is part of the libstdc++ version 3 distribution.
## Process this file with automake to produce Makefile.in.
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 \
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
# 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}
$(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}/*
@GLIBCXX_C_HEADERS_COMPATIBILITY_TRUE@c_compatibility_headers_extra = ${c_compatibility_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 \
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_FALSE@pch_build =
# 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}
$(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