]> granicus.if.org Git - clang/commitdiff
Add support for centos.
authorRafael Espindola <rafael.espindola@gmail.com>
Fri, 3 Jun 2011 15:23:24 +0000 (15:23 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Fri, 3 Jun 2011 15:23:24 +0000 (15:23 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132550 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Driver/ToolChains.cpp

index 9452c1fb34b3fc228f559a7c3696a8e7477ca25d..87703ddffc688b0ffc21625cf01597a4ee64705c 100644 (file)
@@ -1201,7 +1201,8 @@ enum LinuxDistro {
 
 static bool IsRedhat(enum LinuxDistro Distro) {
   return Distro == Fedora13 || Distro == Fedora14 ||
-         Distro == Fedora15 || Distro == FedoraRawhide;
+         Distro == Fedora15 || Distro == FedoraRawhide ||
+         Distro == RHEL4 || Distro == RHEL5 || Distro == RHEL6;
 }
 
 static bool IsOpenSuse(enum LinuxDistro Distro) {
@@ -1281,10 +1282,12 @@ static LinuxDistro DetectLinuxDistro(llvm::Triple::ArchType Arch) {
     else if (Data.startswith("Red Hat Enterprise Linux") &&
              Data.find("release 6") != llvm::StringRef::npos)
       return RHEL6;
-    else if (Data.startswith("Red Hat Enterprise Linux") &&
+    else if ((Data.startswith("Red Hat Enterprise Linux") ||
+             Data.startswith("CentOS")) &&
              Data.find("release 5") != llvm::StringRef::npos)
       return RHEL5;
-    else if (Data.startswith("Red Hat Enterprise Linux") &&
+    else if ((Data.startswith("Red Hat Enterprise Linux") ||
+             Data.startswith("CentOS")) &&
              Data.find("release 4") != llvm::StringRef::npos)
       return RHEL4;
     return UnknownDistro;
@@ -1500,7 +1503,9 @@ Linux::Linux(const HostInfo &Host, const llvm::Triple &Triple)
     ExtraOpts.push_back("--no-add-needed");
 
   if (Distro == DebianSqueeze || Distro == DebianWheezy ||
-      IsOpenSuse(Distro) || IsRedhat(Distro) || Distro == UbuntuLucid ||
+      IsOpenSuse(Distro) ||
+      (IsRedhat(Distro) && Distro != RHEL4 && Distro != RHEL5) ||
+      Distro == UbuntuLucid ||
       Distro == UbuntuMaverick || Distro == UbuntuKarmic ||
       Distro == UbuntuNatty)
     ExtraOpts.push_back("--build-id");