]> granicus.if.org Git - clang/commitdiff
Fixup pathnames.
authorMike Stump <mrs@apple.com>
Wed, 7 Oct 2009 01:11:54 +0000 (01:11 +0000)
committerMike Stump <mrs@apple.com>
Wed, 7 Oct 2009 01:11:54 +0000 (01:11 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83443 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Driver/HostInfo.cpp
lib/Driver/Makefile
lib/Driver/ToolChains.cpp
lib/Driver/ToolChains.h

index 08c4ef490017c3ecfb37873070b6ac9f6e3dfe37..22fe11d661a27e1ec0fe9ec31483d7b370499724 100644 (file)
@@ -42,7 +42,7 @@ class DarwinHostInfo : public HostInfo {
   unsigned DarwinVersion[3];
 
   /// GCC version to use on this host.
-  unsigned GCCVersion[3];
+  unsigned GCCVersion[4];
 
   /// Cache of tool chains we have created.
   mutable llvm::DenseMap<unsigned, ToolChain*> ToolChains;
@@ -84,6 +84,12 @@ DarwinHostInfo::DarwinHostInfo(const Driver &D, const llvm::Triple& Triple)
   GCCVersion[0] = 4;
   GCCVersion[1] = 2;
   GCCVersion[2] = 1;
+  // And we need to select the OS gcc was configured for, darwin10
+#ifdef OS_MAJOR
+  GCCVersion[3] = OS_MAJOR;
+#else
+  GCCVersion[3] = 10;
+#endif
 }
 
 DarwinHostInfo::~DarwinHostInfo() {
index 6a31e5fb886fea45a5b8bacec7d54be96fd897d4..ef7bc60aeb09941d948423a5cf1cbd8e941655aa 100644 (file)
@@ -11,10 +11,10 @@ LEVEL = ../../../..
 LIBRARYNAME := clangDriver
 BUILD_ARCHIVE = 1
 CXXFLAGS = -fno-rtti
-
+OS_MAJOR := -DOS_MAJOR=$(shell uname -r | sed 's/\..*//')
 # Don't install Clang libraries
 NO_INSTALL = 1
 
-CPPFLAGS += -I$(PROJ_SRC_DIR)/../../include -I$(PROJ_OBJ_DIR)/../../include
+CPPFLAGS += -I$(PROJ_SRC_DIR)/../../include -I$(PROJ_OBJ_DIR)/../../include $(OS_MAJOR)
 
 include $(LEVEL)/Makefile.common
index a5a48adcf0285b41d342543cf023b4ba8c3209f3..443ce80ae8f5f5666e851769b6dc77a8ea102a87 100644 (file)
@@ -46,17 +46,18 @@ Darwin::Darwin(const HostInfo &Host, const llvm::Triple& Triple,
 
 DarwinGCC::DarwinGCC(const HostInfo &Host, const llvm::Triple& Triple,
                      const unsigned (&DarwinVersion)[3],
-                     const unsigned (&_GCCVersion)[3], bool IsIPhoneOS)
+                     const unsigned (&_GCCVersion)[4], bool IsIPhoneOS)
   : Darwin(Host, Triple, DarwinVersion, IsIPhoneOS)
 {
   GCCVersion[0] = _GCCVersion[0];
   GCCVersion[1] = _GCCVersion[1];
   GCCVersion[2] = _GCCVersion[2];
+  GCCVersion[3] = _GCCVersion[3];
 
   // Set up the tool chain paths to match gcc.
 
   ToolChainDir = "i686-apple-darwin";
-  ToolChainDir += llvm::utostr(DarwinVersion[0]);
+  ToolChainDir += llvm::utostr(GCCVersion[3]);
   ToolChainDir += "/";
   ToolChainDir += llvm::utostr(GCCVersion[0]);
   ToolChainDir += '.';
index 6088d9617cf0453fb89fa08a4383e7f2527f4a7b..5934be47881ede4538fadf1db9e44289fd78d050 100644 (file)
@@ -165,14 +165,14 @@ public:
 /// DarwinGCC - The Darwin toolchain used by GCC.
 class VISIBILITY_HIDDEN DarwinGCC : public Darwin {
   /// GCC version to use.
-  unsigned GCCVersion[3];
+  unsigned GCCVersion[4];
 
   /// The directory suffix for this tool chain.
   std::string ToolChainDir;
 
 public:
   DarwinGCC(const HostInfo &Host, const llvm::Triple& Triple,
-            const unsigned (&DarwinVersion)[3], const unsigned (&GCCVersion)[3],
+            const unsigned (&DarwinVersion)[3], const unsigned (&GCCVersion)[4],
             bool IsIPhoneOS);
 
   /// @name Darwin ToolChain Implementation