[llvm-commits] [llvm-gcc-4.2] r53455 - /llvm-gcc-4.2/trunk/gcc/cppdefault.c

Rafael Espindola rafael.espindola at gmail.com
Fri Jul 11 05:33:06 PDT 2008


Author: rafael
Date: Fri Jul 11 07:33:04 2008
New Revision: 53455

URL: http://llvm.org/viewvc/llvm-project?rev=53455&view=rev
Log:
get --with-sysroot to work  on non-darwin systems.

Modified:
    llvm-gcc-4.2/trunk/gcc/cppdefault.c

Modified: llvm-gcc-4.2/trunk/gcc/cppdefault.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/cppdefault.c?rev=53455&r1=53454&r2=53455&view=diff

==============================================================================
--- llvm-gcc-4.2/trunk/gcc/cppdefault.c (original)
+++ llvm-gcc-4.2/trunk/gcc/cppdefault.c Fri Jul 11 07:33:04 2008
@@ -46,6 +46,11 @@
 /* APPLE LOCAL begin SDK 3886137.  */
 /* Allow -isysroot to override ALL  include patchs. This is done by
    setting add_sysroot for all default inclue paths.  */
+#ifdef CONFIG_DARWIN_H
+#define ADD_SYSROOT 1
+#else
+#define ADD_SYSROOT 0
+#endif
 const struct default_include cpp_include_defaults[]
 #ifdef INCLUDE_DEFAULTS
 = INCLUDE_DEFAULTS;
@@ -53,34 +58,34 @@
 = {
 #ifdef GPLUSPLUS_INCLUDE_DIR
     /* Pick up GNU C++ generic include files.  */
-    { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1, 1, 0 },
+    { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1, ADD_SYSROOT, 0 },
 #endif
 #ifdef GPLUSPLUS_TOOL_INCLUDE_DIR
     /* Pick up GNU C++ target-dependent include files.  */
-    { GPLUSPLUS_TOOL_INCLUDE_DIR, "G++", 1, 1, 1, 1 },
+    { GPLUSPLUS_TOOL_INCLUDE_DIR, "G++", 1, 1, ADD_SYSROOT, 1 },
 #endif
 #ifdef GPLUSPLUS_BACKWARD_INCLUDE_DIR
     /* Pick up GNU C++ backward and deprecated include files.  */
-    { GPLUSPLUS_BACKWARD_INCLUDE_DIR, "G++", 1, 1, 1, 0 },
+    { GPLUSPLUS_BACKWARD_INCLUDE_DIR, "G++", 1, 1, ADD_SYSROOT, 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, 1, 0 },
+    { PREFIX_INCLUDE_DIR, 0, 0, 1, ADD_SYSROOT, 0 },
 #endif
 #ifdef GCC_INCLUDE_DIR
     /* This is the dir for fixincludes and for gcc's private headers.  */
-    { GCC_INCLUDE_DIR, "GCC", 0, 0, 1, 0 },
+    { GCC_INCLUDE_DIR, "GCC", 0, 0, ADD_SYSROOT, 0 },
 #endif
 #ifdef CROSS_INCLUDE_DIR
     /* One place the target system's headers might be.  */
-    { CROSS_INCLUDE_DIR, "GCC", 0, 0, 1, 0 },
+    { CROSS_INCLUDE_DIR, "GCC", 0, 0, ADD_SYSROOT, 0 },
 #endif
 #ifdef TOOL_INCLUDE_DIR
     /* Another place the target system's headers might be.  */
-    { TOOL_INCLUDE_DIR, "BINUTILS", 0, 1, 1, 0 },
+    { TOOL_INCLUDE_DIR, "BINUTILS", 0, 1, ADD_SYSROOT, 0 },
 #endif
 #ifdef SYSTEM_INCLUDE_DIR
     /* Some systems have an extra dir of include files.  */
@@ -94,6 +99,7 @@
   };
 #endif /* no INCLUDE_DEFAULTS */
 
+#undef ADD_SYSROOT
 /* APPLE LOCAL end SDK 3886137.  */
 
 #ifdef GCC_INCLUDE_DIR





More information about the llvm-commits mailing list