Index: head/contrib/gcc/cppdefault.c =================================================================== --- head/contrib/gcc/cppdefault.c (revision 335716) +++ head/contrib/gcc/cppdefault.c (revision 335717) @@ -1,98 +1,98 @@ /* CPP Library. Copyright (C) 1986, 1987, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 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 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 Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "config.h" #include "system.h" #include "coretypes.h" #include "tm.h" #include "cppdefault.h" #ifndef STANDARD_INCLUDE_DIR #define STANDARD_INCLUDE_DIR "/usr/include" #endif #ifndef STANDARD_INCLUDE_COMPONENT #define STANDARD_INCLUDE_COMPONENT 0 #endif #if defined (CROSS_DIRECTORY_STRUCTURE) && !defined (TARGET_SYSTEM_ROOT) # undef LOCAL_INCLUDE_DIR # undef SYSTEM_INCLUDE_DIR # undef STANDARD_INCLUDE_DIR #else # undef CROSS_INCLUDE_DIR #endif const struct default_include cpp_include_defaults[] #ifdef INCLUDE_DEFAULTS = INCLUDE_DEFAULTS; #else = { #ifdef GPLUSPLUS_INCLUDE_DIR /* Pick up GNU C++ generic include files. */ - { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1, 0, 0 }, + { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1, 1, 0 }, #endif #ifdef GPLUSPLUS_TOOL_INCLUDE_DIR /* Pick up GNU C++ target-dependent include files. */ { 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, 0 }, + { GPLUSPLUS_BACKWARD_INCLUDE_DIR, "G++", 1, 1, 1, 0 }, #endif #ifdef LOCAL_INCLUDE_DIR /* /usr/local/include comes before the fixincluded header files. */ { LOCAL_INCLUDE_DIR, 0, 0, 1, 1, 0 }, #endif #ifdef PREFIX_INCLUDE_DIR { 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, 0 }, #endif #ifdef CROSS_INCLUDE_DIR /* One place the target system's headers might be. */ { 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, 0 }, #endif #ifdef SYSTEM_INCLUDE_DIR /* Some systems have an extra dir of include files. */ { 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, 0 }, #endif { 0, 0, 0, 0, 0, 0 } }; #endif /* no INCLUDE_DEFAULTS */ #ifdef GCC_INCLUDE_DIR const char cpp_GCC_INCLUDE_DIR[] = GCC_INCLUDE_DIR; const size_t cpp_GCC_INCLUDE_DIR_len = sizeof GCC_INCLUDE_DIR - 8; #else const char cpp_GCC_INCLUDE_DIR[] = ""; const size_t cpp_GCC_INCLUDE_DIR_len = 0; #endif Index: head/gnu/usr.bin/cc/Makefile.inc =================================================================== --- head/gnu/usr.bin/cc/Makefile.inc (revision 335716) +++ head/gnu/usr.bin/cc/Makefile.inc (revision 335717) @@ -1,114 +1,115 @@ # $FreeBSD$ .include .include "../Makefile.inc" # Sometimes this is .include'd several times... .if !defined(__CC_MAKEFILE_INC__) __CC_MAKEFILE_INC__= ${MFILE} GCCVER= 4.2 GCCDIR= ${SRCTOP}/contrib/gcc GCCLIB= ${SRCTOP}/contrib/gcclibs .include "Makefile.tgt" # Machine description. MD_FILE= ${GCCDIR}/config/${GCC_CPU}/${GCC_CPU}.md GCC_TARGET= ${TARGET_ARCH}-undermydesk-freebsd CFLAGS+= -DGCCVER=\"${GCCVER}\" CFLAGS+= -DIN_GCC -DHAVE_CONFIG_H CFLAGS+= -DPREFIX=\"${TOOLS_PREFIX}/usr\" #CFLAGS+= -DWANT_COMPILER_INVARIANTS CSTD?= gnu89 .if ${TARGET_ARCH} != ${MACHINE_ARCH} CFLAGS+= -DCROSS_DIRECTORY_STRUCTURE +CFLAGS+= -DTARGET_SYSTEM_ROOT=\"${TOOLS_PREFIX}\" .endif .if ${TARGET_CPUARCH} == "arm" CFLAGS+= -DTARGET_ARM_EABI .endif .if ${TARGET_ARCH:Marm*eb} != "" CFLAGS += -DTARGET_ENDIAN_DEFAULT=MASK_BIG_END .endif .if ${TARGET_ARCH:Marmv6*} != "" CFLAGS += -DFREEBSD_ARCH_armv6 .endif .if ${TARGET_ARCH:Marmv7*} != "" CFLAGS += -DFREEBSD_ARCH_armv7 .endif .if ${TARGET_CPUARCH} == "mips" .if ${TARGET_ARCH:Mmips*el*} != "" CFLAGS += -DTARGET_ENDIAN_DEFAULT=0 .endif .if ${TARGET_ARCH:Mmips64*} != "" MIPS_ABI_DEFAULT=ABI_64 .elif ${TARGET_ARCH:Mmipsn32*} != "" MIPS_ABI_DEFAULT=ABI_N32 .else MIPS_ABI_DEFAULT=ABI_32 .endif CFLAGS += -DMIPS_ABI_DEFAULT=${MIPS_ABI_DEFAULT} # If we are compiling for the O32 ABI, we need to default to MIPS-III rather # than taking the ISA from the ABI requirements, since FreeBSD is built with # a number of MIPS-III features/instructions and that is the minimum ISA we # support, not the O32 default MIPS-I. .if ${MIPS_ABI_DEFAULT} == "ABI_32" TARGET_CPUTYPE?=mips3 .endif # GCC by default takes the ISA from the ABI's requirements. If world is built # with a superior ISA, since we lack multilib, we have to set the right # default ISA to be able to link against what's in /usr/lib. Terrible stuff. .if defined(TARGET_CPUTYPE) CFLAGS += -DMIPS_CPU_STRING_DEFAULT=\"${TARGET_CPUTYPE}\" .endif .endif .if defined(WANT_FORCE_OPTIMIZATION_DOWNGRADE) CFLAGS+= -DFORCE_OPTIMIZATION_DOWNGRADE=${WANT_FORCE_OPTIMIZATION_DOWNGRADE} .endif .if exists(${.OBJDIR}/../cc_tools) CFLAGS+= -I${.OBJDIR}/../cc_tools .endif CFLAGS+= -I${.CURDIR}/../cc_tools # This must go after the -I for cc_tools to resolve ambiguities for hash.h # correctly. CFLAGS+= -I${GCCDIR} -I${GCCDIR}/config CFLAGS+= -I${GCCLIB}/include CFLAGS+= -I${GCCLIB}/libcpp/include CFLAGS+= -I${GCCLIB}/libdecnumber .if exists(${.OBJDIR}/../cc_int) LIBBACKEND= ${.OBJDIR}/../cc_int/libbackend.a .else LIBBACKEND= ${.CURDIR}/../cc_int/libbackend.a .endif .if exists(${.OBJDIR}/../libiberty) LIBIBERTY= ${.OBJDIR}/../libiberty/libiberty.a .else LIBIBERTY= ${.CURDIR}/../libiberty/libiberty.a .endif .if exists(${.OBJDIR}/../libcpp) LIBCPP= ${.OBJDIR}/../libcpp/libcpp.a .else LIBCPP= ${.CURDIR}/../libcpp/libcpp.a .endif .if exists(${.OBJDIR}/../libdecnumber) LIBDECNUMBER= ${.OBJDIR}/../libdecnumber/libdecnumber.a .else LIBDECNUMBER= ${.CURDIR}/../libdecnumber/libdecnumber.a .endif .endif # !__CC_MAKEFILE_INC__ Index: head/gnu/usr.bin/cc/cc_tools/freebsd-native.h =================================================================== --- head/gnu/usr.bin/cc/cc_tools/freebsd-native.h (revision 335716) +++ head/gnu/usr.bin/cc/cc_tools/freebsd-native.h (revision 335717) @@ -1,64 +1,60 @@ /* $FreeBSD$ */ /* FREEBSD_NATIVE is defined when gcc is integrated into the FreeBSD source tree so it can be configured appropriately without using the GNU configure/build mechanism. */ #define FREEBSD_NATIVE 1 /* Fake out gcc/config/freebsd.h. */ #define FBSD_MAJOR 12 #define FBSD_CC_VER 1200001 /* form like __FreeBSD_version */ #undef SYSTEM_INCLUDE_DIR /* We don't need one for now. */ #undef TOOL_INCLUDE_DIR /* We don't need one for now. */ #undef LOCAL_INCLUDE_DIR /* We don't wish to support one. */ /* Look for the include files in the system-defined places. */ -#define GPLUSPLUS_INCLUDE_DIR PREFIX"/include/c++/"GCCVER -#define GPLUSPLUS_BACKWARD_INCLUDE_DIR PREFIX"/include/c++/"GCCVER"/backward" +#define GPLUSPLUS_INCLUDE_DIR "/usr/include/c++/"GCCVER +#define GPLUSPLUS_BACKWARD_INCLUDE_DIR "/usr/include/c++/"GCCVER"/backward" #define GCC_INCLUDE_DIR PREFIX"/include/gcc/"GCCVER -#ifdef CROSS_DIRECTORY_STRUCTURE -#define CROSS_INCLUDE_DIR PREFIX"/include" -#else -#define STANDARD_INCLUDE_DIR PREFIX"/include" -#endif +#define STANDARD_INCLUDE_DIR "/usr/include" /* Under FreeBSD, the normal location of the compiler back ends is the /usr/libexec directory. ``cc --print-search-dirs'' gives: install: STANDARD_EXEC_PREFIX/ programs: STANDARD_EXEC_PREFIX:MD_EXEC_PREFIX libraries: STANDARD_STARTFILE_PREFIX */ #undef STANDARD_BINDIR_PREFIX /* We don't need one for now. */ #define STANDARD_EXEC_PREFIX PREFIX"/libexec/" #define STANDARD_LIBEXEC_PREFIX PREFIX"/libexec/" #define TOOLDIR_BASE_PREFIX PREFIX #undef MD_EXEC_PREFIX /* We don't want one. */ #define FBSD_DATA_PREFIX PREFIX"/libdata/gcc/" /* Under FreeBSD, the normal location of the various *crt*.o files is the /usr/lib directory. */ #undef MD_STARTFILE_PREFIX /* We don't need one for now. */ #define STANDARD_STARTFILE_PREFIX "/usr/lib/" #define STARTFILE_PREFIX_SPEC "/usr/lib/" #if 0 #define LIBGCC_SPEC "%{shared: -lgcc_pic} \ %{!shared: %{!pg: -lgcc} %{pg: -lgcc_p}}" #endif #define LIBSTDCXX_PROFILE "-lstdc++_p" #define MATH_LIBRARY_PROFILE "-lm_p" #define FORTRAN_LIBRARY_PROFILE "-lg2c_p" #define LIBGCC_SPEC "-lgcc" /* For the native system compiler, we actually build libgcc in a profiled version. So we should use it with -pg. */ #define LIBGCC_STATIC_LIB_SPEC "%{pg: -lgcc_p;:-lgcc}" #define LIBGCC_EH_STATIC_LIB_SPEC "%{pg: -lgcc_eh_p;:-lgcc_eh}" /* FreeBSD is 4.4BSD derived */ #define bsd4_4