Fix GCC 4.2.1 to honor --sysroot for includes.
- Change the C++ directory entries to honor --sysroot if it is set. - Don't define CROSS_INCLUDE_DIR for the cross compiler. Instead, set TARGET_SYSTEM_ROOT to point to WORLDTMP and always define STANDARD_INCLUDE_DIR. - Change STANDARD_INCLUDE_DIR and the C++ include directories to just start with "/usr" always. The compiler will prepend the sysroot when doing cross-builds. GCC_INCLUDE_DIR (which contains headers that ship with the compiler such as intrinsincs rather than OS-supplied headers) remains hardcoded to look in TOOLS_PREFIX. Reviewed by: bdrewery (older version) Sponsored by: DARPA / AFRL Differential Revision: https://reviews.freebsd.org/D15127
This commit is contained in:
parent
65c3d0c931
commit
18ddcb43eb
@ -48,7 +48,7 @@ const struct default_include cpp_include_defaults[]
|
|||||||
= {
|
= {
|
||||||
#ifdef GPLUSPLUS_INCLUDE_DIR
|
#ifdef GPLUSPLUS_INCLUDE_DIR
|
||||||
/* Pick up GNU C++ generic include files. */
|
/* Pick up GNU C++ generic include files. */
|
||||||
{ GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1, 0, 0 },
|
{ GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1, 1, 0 },
|
||||||
#endif
|
#endif
|
||||||
#ifdef GPLUSPLUS_TOOL_INCLUDE_DIR
|
#ifdef GPLUSPLUS_TOOL_INCLUDE_DIR
|
||||||
/* Pick up GNU C++ target-dependent include files. */
|
/* Pick up GNU C++ target-dependent include files. */
|
||||||
@ -56,7 +56,7 @@ const struct default_include cpp_include_defaults[]
|
|||||||
#endif
|
#endif
|
||||||
#ifdef GPLUSPLUS_BACKWARD_INCLUDE_DIR
|
#ifdef GPLUSPLUS_BACKWARD_INCLUDE_DIR
|
||||||
/* Pick up GNU C++ backward and deprecated include files. */
|
/* Pick up GNU C++ backward and deprecated include files. */
|
||||||
{ GPLUSPLUS_BACKWARD_INCLUDE_DIR, "G++", 1, 1, 0, 0 },
|
{ GPLUSPLUS_BACKWARD_INCLUDE_DIR, "G++", 1, 1, 1, 0 },
|
||||||
#endif
|
#endif
|
||||||
#ifdef LOCAL_INCLUDE_DIR
|
#ifdef LOCAL_INCLUDE_DIR
|
||||||
/* /usr/local/include comes before the fixincluded header files. */
|
/* /usr/local/include comes before the fixincluded header files. */
|
||||||
|
@ -25,6 +25,7 @@ CSTD?= gnu89
|
|||||||
|
|
||||||
.if ${TARGET_ARCH} != ${MACHINE_ARCH}
|
.if ${TARGET_ARCH} != ${MACHINE_ARCH}
|
||||||
CFLAGS+= -DCROSS_DIRECTORY_STRUCTURE
|
CFLAGS+= -DCROSS_DIRECTORY_STRUCTURE
|
||||||
|
CFLAGS+= -DTARGET_SYSTEM_ROOT=\"${TOOLS_PREFIX}\"
|
||||||
.endif
|
.endif
|
||||||
|
|
||||||
.if ${TARGET_CPUARCH} == "arm"
|
.if ${TARGET_CPUARCH} == "arm"
|
||||||
|
@ -15,14 +15,10 @@
|
|||||||
#undef LOCAL_INCLUDE_DIR /* We don't wish to support one. */
|
#undef LOCAL_INCLUDE_DIR /* We don't wish to support one. */
|
||||||
|
|
||||||
/* Look for the include files in the system-defined places. */
|
/* Look for the include files in the system-defined places. */
|
||||||
#define GPLUSPLUS_INCLUDE_DIR PREFIX"/include/c++/"GCCVER
|
#define GPLUSPLUS_INCLUDE_DIR "/usr/include/c++/"GCCVER
|
||||||
#define GPLUSPLUS_BACKWARD_INCLUDE_DIR PREFIX"/include/c++/"GCCVER"/backward"
|
#define GPLUSPLUS_BACKWARD_INCLUDE_DIR "/usr/include/c++/"GCCVER"/backward"
|
||||||
#define GCC_INCLUDE_DIR PREFIX"/include/gcc/"GCCVER
|
#define GCC_INCLUDE_DIR PREFIX"/include/gcc/"GCCVER
|
||||||
#ifdef CROSS_DIRECTORY_STRUCTURE
|
#define STANDARD_INCLUDE_DIR "/usr/include"
|
||||||
#define CROSS_INCLUDE_DIR PREFIX"/include"
|
|
||||||
#else
|
|
||||||
#define STANDARD_INCLUDE_DIR PREFIX"/include"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Under FreeBSD, the normal location of the compiler back ends is the
|
/* Under FreeBSD, the normal location of the compiler back ends is the
|
||||||
/usr/libexec directory.
|
/usr/libexec directory.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user