InitHeaderSearch.cpp (207619) | InitHeaderSearch.cpp (208600) |
---|---|
1//===--- InitHeaderSearch.cpp - Initialize header search paths ----------*-===// 2// 3// The LLVM Compiler Infrastructure 4// 5// This file is distributed under the University of Illinois Open Source 6// License. See LICENSE.TXT for details. 7// 8//===----------------------------------------------------------------------===// --- 40 unchanged lines hidden (view full) --- 49 bool verbose = false, const std::string &iSysroot = "") 50 : Headers(HS), Verbose(verbose), isysroot(iSysroot) {} 51 52 /// AddPath - Add the specified path to the specified group list. 53 void AddPath(const llvm::Twine &Path, IncludeDirGroup Group, 54 bool isCXXAware, bool isUserSupplied, 55 bool isFramework, bool IgnoreSysRoot = false); 56 | 1//===--- InitHeaderSearch.cpp - Initialize header search paths ----------*-===// 2// 3// The LLVM Compiler Infrastructure 4// 5// This file is distributed under the University of Illinois Open Source 6// License. See LICENSE.TXT for details. 7// 8//===----------------------------------------------------------------------===// --- 40 unchanged lines hidden (view full) --- 49 bool verbose = false, const std::string &iSysroot = "") 50 : Headers(HS), Verbose(verbose), isysroot(iSysroot) {} 51 52 /// AddPath - Add the specified path to the specified group list. 53 void AddPath(const llvm::Twine &Path, IncludeDirGroup Group, 54 bool isCXXAware, bool isUserSupplied, 55 bool isFramework, bool IgnoreSysRoot = false); 56 |
57 /// AddGnuCPlusPlusIncludePaths - Add the necessary paths to suport a gnu | 57 /// AddGnuCPlusPlusIncludePaths - Add the necessary paths to support a gnu |
58 /// libstdc++. 59 void AddGnuCPlusPlusIncludePaths(llvm::StringRef Base, 60 llvm::StringRef ArchDir, 61 llvm::StringRef Dir32, 62 llvm::StringRef Dir64, 63 const llvm::Triple &triple); 64 65 /// AddMinGWCPlusPlusIncludePaths - Add the necessary paths to suport a MinGW 66 /// libstdc++. 67 void AddMinGWCPlusPlusIncludePaths(llvm::StringRef Base, 68 llvm::StringRef Arch, 69 llvm::StringRef Version); 70 71 /// AddDelimitedPaths - Add a list of paths delimited by the system PATH 72 /// separator. The processing follows that of the CPATH variable for gcc. 73 void AddDelimitedPaths(llvm::StringRef String); 74 75 // AddDefaultCIncludePaths - Add paths that should always be searched. | 58 /// libstdc++. 59 void AddGnuCPlusPlusIncludePaths(llvm::StringRef Base, 60 llvm::StringRef ArchDir, 61 llvm::StringRef Dir32, 62 llvm::StringRef Dir64, 63 const llvm::Triple &triple); 64 65 /// AddMinGWCPlusPlusIncludePaths - Add the necessary paths to suport a MinGW 66 /// libstdc++. 67 void AddMinGWCPlusPlusIncludePaths(llvm::StringRef Base, 68 llvm::StringRef Arch, 69 llvm::StringRef Version); 70 71 /// AddDelimitedPaths - Add a list of paths delimited by the system PATH 72 /// separator. The processing follows that of the CPATH variable for gcc. 73 void AddDelimitedPaths(llvm::StringRef String); 74 75 // AddDefaultCIncludePaths - Add paths that should always be searched. |
76 void AddDefaultCIncludePaths(const llvm::Triple &triple); | 76 void AddDefaultCIncludePaths(const llvm::Triple &triple, 77 const HeaderSearchOptions &HSOpts); |
77 78 // AddDefaultCPlusPlusIncludePaths - Add paths that should be searched when 79 // compiling c++. 80 void AddDefaultCPlusPlusIncludePaths(const llvm::Triple &triple); 81 82 /// AddDefaultSystemIncludePaths - Adds the default system include paths so 83 /// that e.g. stdio.h is found. 84 void AddDefaultSystemIncludePaths(const LangOptions &Lang, 85 const llvm::Triple &triple, | 78 79 // AddDefaultCPlusPlusIncludePaths - Add paths that should be searched when 80 // compiling c++. 81 void AddDefaultCPlusPlusIncludePaths(const llvm::Triple &triple); 82 83 /// AddDefaultSystemIncludePaths - Adds the default system include paths so 84 /// that e.g. stdio.h is found. 85 void AddDefaultSystemIncludePaths(const LangOptions &Lang, 86 const llvm::Triple &triple, |
86 bool UseStandardCXXIncludes); | 87 const HeaderSearchOptions &HSOpts); |
87 88 /// Realize - Merges all search path lists into one list and send it to 89 /// HeaderSearch. 90 void Realize(); 91}; 92 93} 94 --- 223 unchanged lines hidden (view full) --- 318static bool getSystemRegistryString(const char*, const char*, char*, size_t) { 319 return(false); 320} 321#endif // _MSC_VER 322 323 // Get Visual Studio installation directory. 324static bool getVisualStudioDir(std::string &path) { 325 char vsIDEInstallDir[256]; | 88 89 /// Realize - Merges all search path lists into one list and send it to 90 /// HeaderSearch. 91 void Realize(); 92}; 93 94} 95 --- 223 unchanged lines hidden (view full) --- 319static bool getSystemRegistryString(const char*, const char*, char*, size_t) { 320 return(false); 321} 322#endif // _MSC_VER 323 324 // Get Visual Studio installation directory. 325static bool getVisualStudioDir(std::string &path) { 326 char vsIDEInstallDir[256]; |
327 char vsExpressIDEInstallDir[256]; |
|
326 // Try the Windows registry first. 327 bool hasVCDir = getSystemRegistryString( 328 "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\$VERSION", 329 "InstallDir", vsIDEInstallDir, sizeof(vsIDEInstallDir) - 1); | 328 // Try the Windows registry first. 329 bool hasVCDir = getSystemRegistryString( 330 "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\$VERSION", 331 "InstallDir", vsIDEInstallDir, sizeof(vsIDEInstallDir) - 1); |
332 bool hasVCExpressDir = getSystemRegistryString( 333 "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VCExpress\\$VERSION", 334 "InstallDir", vsExpressIDEInstallDir, sizeof(vsExpressIDEInstallDir) - 1); |
|
330 // If we have both vc80 and vc90, pick version we were compiled with. 331 if (hasVCDir && vsIDEInstallDir[0]) { 332 char *p = (char*)strstr(vsIDEInstallDir, "\\Common7\\IDE"); 333 if (p) 334 *p = '\0'; 335 path = vsIDEInstallDir; 336 return(true); 337 } | 335 // If we have both vc80 and vc90, pick version we were compiled with. 336 if (hasVCDir && vsIDEInstallDir[0]) { 337 char *p = (char*)strstr(vsIDEInstallDir, "\\Common7\\IDE"); 338 if (p) 339 *p = '\0'; 340 path = vsIDEInstallDir; 341 return(true); 342 } |
343 else if (hasVCExpressDir && vsExpressIDEInstallDir[0]) { 344 char *p = (char*)strstr(vsExpressIDEInstallDir, "\\Common7\\IDE"); 345 if (p) 346 *p = '\0'; 347 path = vsExpressIDEInstallDir; 348 return(true); 349 } |
|
338 else { 339 // Try the environment. | 350 else { 351 // Try the environment. |
352 const char* vs100comntools = getenv("VS100COMNTOOLS"); |
|
340 const char* vs90comntools = getenv("VS90COMNTOOLS"); 341 const char* vs80comntools = getenv("VS80COMNTOOLS"); 342 const char* vscomntools = NULL; | 353 const char* vs90comntools = getenv("VS90COMNTOOLS"); 354 const char* vs80comntools = getenv("VS80COMNTOOLS"); 355 const char* vscomntools = NULL; |
343 // If we have both vc80 and vc90, pick version we were compiled with. 344 if (vs90comntools && vs80comntools) { 345 #if (_MSC_VER >= 1500) // VC90 346 vscomntools = vs90comntools; 347 #elif (_MSC_VER == 1400) // VC80 348 vscomntools = vs80comntools; 349 #else 350 vscomntools = vs90comntools; 351 #endif | 356 357 // Try to find the version that we were compiled with 358 if(false) {} 359 #if (_MSC_VER >= 1600) // VC100 360 else if(vs100comntools) { 361 vscomntools = vs100comntools; |
352 } | 362 } |
363 #elif (_MSC_VER == 1500) // VC80 364 else if(vs90comntools) { 365 vscomntools = vs90comntools; 366 } 367 #elif (_MSC_VER == 1400) // VC80 368 else if(vs80comntools) { 369 vscomntools = vs80comntools; 370 } 371 #endif 372 // Otherwise find any version we can 373 else if (vs100comntools) 374 vscomntools = vs100comntools; |
|
353 else if (vs90comntools) 354 vscomntools = vs90comntools; 355 else if (vs80comntools) 356 vscomntools = vs80comntools; | 375 else if (vs90comntools) 376 vscomntools = vs90comntools; 377 else if (vs80comntools) 378 vscomntools = vs80comntools; |
379 |
|
357 if (vscomntools && *vscomntools) { 358 char *p = const_cast<char *>(strstr(vscomntools, "\\Common7\\Tools")); 359 if (p) 360 *p = '\0'; 361 path = vscomntools; 362 return(true); 363 } 364 else --- 12 unchanged lines hidden (view full) --- 377 // If we have both vc80 and vc90, pick version we were compiled with. 378 if (hasSDKDir && windowsSDKInstallDir[0]) { 379 path = windowsSDKInstallDir; 380 return(true); 381 } 382 return(false); 383} 384 | 380 if (vscomntools && *vscomntools) { 381 char *p = const_cast<char *>(strstr(vscomntools, "\\Common7\\Tools")); 382 if (p) 383 *p = '\0'; 384 path = vscomntools; 385 return(true); 386 } 387 else --- 12 unchanged lines hidden (view full) --- 400 // If we have both vc80 and vc90, pick version we were compiled with. 401 if (hasSDKDir && windowsSDKInstallDir[0]) { 402 path = windowsSDKInstallDir; 403 return(true); 404 } 405 return(false); 406} 407 |
385void InitHeaderSearch::AddDefaultCIncludePaths(const llvm::Triple &triple) { | 408void InitHeaderSearch::AddDefaultCIncludePaths(const llvm::Triple &triple, 409 const HeaderSearchOptions &HSOpts) { |
386 // FIXME: temporary hack: hard-coded paths. | 410 // FIXME: temporary hack: hard-coded paths. |
411 AddPath("/usr/local/include", System, true, false, false); 412 413 // Builtin includes use #include_next directives and should be positioned 414 // just prior C include dirs. 415 if (HSOpts.UseBuiltinIncludes) { 416 // Ignore the sys root, we *always* look for clang headers relative to 417 // supplied path. 418 llvm::sys::Path P(HSOpts.ResourceDir); 419 P.appendComponent("include"); 420 AddPath(P.str(), System, false, false, false, /*IgnoreSysRoot=*/ true); 421 } 422 423 // Add dirs specified via 'configure --with-c-include-dirs'. |
|
387 llvm::StringRef CIncludeDirs(C_INCLUDE_DIRS); 388 if (CIncludeDirs != "") { 389 llvm::SmallVector<llvm::StringRef, 5> dirs; 390 CIncludeDirs.split(dirs, ":"); 391 for (llvm::SmallVectorImpl<llvm::StringRef>::iterator i = dirs.begin(); 392 i != dirs.end(); 393 ++i) 394 AddPath(*i, System, false, false, false); --- 10 unchanged lines hidden (view full) --- 405 if (getWindowsSDKDir(WindowsSDKDir)) 406 AddPath(WindowsSDKDir, System, false, false, false); 407 else 408 AddPath(VSDir + "\\VC\\PlatformSDK\\Include", 409 System, false, false, false); 410 } 411 else { 412 // Default install paths. | 424 llvm::StringRef CIncludeDirs(C_INCLUDE_DIRS); 425 if (CIncludeDirs != "") { 426 llvm::SmallVector<llvm::StringRef, 5> dirs; 427 CIncludeDirs.split(dirs, ":"); 428 for (llvm::SmallVectorImpl<llvm::StringRef>::iterator i = dirs.begin(); 429 i != dirs.end(); 430 ++i) 431 AddPath(*i, System, false, false, false); --- 10 unchanged lines hidden (view full) --- 442 if (getWindowsSDKDir(WindowsSDKDir)) 443 AddPath(WindowsSDKDir, System, false, false, false); 444 else 445 AddPath(VSDir + "\\VC\\PlatformSDK\\Include", 446 System, false, false, false); 447 } 448 else { 449 // Default install paths. |
450 AddPath("C:/Program Files/Microsoft Visual Studio 10.0/VC/include", 451 System, false, false, false); |
|
413 AddPath("C:/Program Files/Microsoft Visual Studio 9.0/VC/include", 414 System, false, false, false); 415 AddPath( 416 "C:/Program Files/Microsoft Visual Studio 9.0/VC/PlatformSDK/Include", 417 System, false, false, false); 418 AddPath("C:/Program Files/Microsoft Visual Studio 8/VC/include", 419 System, false, false, false); 420 AddPath( --- 54 unchanged lines hidden (view full) --- 475 case llvm::Triple::MinGW64: 476 case llvm::Triple::MinGW32: 477 AddPath("c:/mingw/include", System, true, false, false); 478 break; 479 default: 480 break; 481 } 482 | 452 AddPath("C:/Program Files/Microsoft Visual Studio 9.0/VC/include", 453 System, false, false, false); 454 AddPath( 455 "C:/Program Files/Microsoft Visual Studio 9.0/VC/PlatformSDK/Include", 456 System, false, false, false); 457 AddPath("C:/Program Files/Microsoft Visual Studio 8/VC/include", 458 System, false, false, false); 459 AddPath( --- 54 unchanged lines hidden (view full) --- 514 case llvm::Triple::MinGW64: 515 case llvm::Triple::MinGW32: 516 AddPath("c:/mingw/include", System, true, false, false); 517 break; 518 default: 519 break; 520 } 521 |
483 AddPath("/usr/local/include", System, true, false, false); | |
484 AddPath("/usr/include", System, false, false, false); 485} 486 | 522 AddPath("/usr/include", System, false, false, false); 523} 524 |
487void InitHeaderSearch::AddDefaultCPlusPlusIncludePaths(const llvm::Triple &triple) { | 525void InitHeaderSearch:: 526AddDefaultCPlusPlusIncludePaths(const llvm::Triple &triple) { |
488 llvm::Triple::OSType os = triple.getOS(); 489 llvm::StringRef CxxIncludeRoot(CXX_INCLUDE_ROOT); 490 if (CxxIncludeRoot != "") { 491 llvm::StringRef CxxIncludeArch(CXX_INCLUDE_ARCH); 492 if (CxxIncludeArch == "") 493 AddGnuCPlusPlusIncludePaths(CxxIncludeRoot, triple.str().c_str(), | 527 llvm::Triple::OSType os = triple.getOS(); 528 llvm::StringRef CxxIncludeRoot(CXX_INCLUDE_ROOT); 529 if (CxxIncludeRoot != "") { 530 llvm::StringRef CxxIncludeArch(CXX_INCLUDE_ARCH); 531 if (CxxIncludeArch == "") 532 AddGnuCPlusPlusIncludePaths(CxxIncludeRoot, triple.str().c_str(), |
494 CXX_INCLUDE_32BIT_DIR, CXX_INCLUDE_64BIT_DIR, triple); | 533 CXX_INCLUDE_32BIT_DIR, CXX_INCLUDE_64BIT_DIR, 534 triple); |
495 else 496 AddGnuCPlusPlusIncludePaths(CxxIncludeRoot, CXX_INCLUDE_ARCH, | 535 else 536 AddGnuCPlusPlusIncludePaths(CxxIncludeRoot, CXX_INCLUDE_ARCH, |
497 CXX_INCLUDE_32BIT_DIR, CXX_INCLUDE_64BIT_DIR, triple); | 537 CXX_INCLUDE_32BIT_DIR, CXX_INCLUDE_64BIT_DIR, 538 triple); |
498 return; 499 } 500 // FIXME: temporary hack: hard-coded paths. 501 switch (os) { 502 case llvm::Triple::Cygwin: 503 AddPath("/lib/gcc/i686-pc-cygwin/3.4.4/include", 504 System, true, false, false); 505 AddPath("/lib/gcc/i686-pc-cygwin/3.4.4/include/c++", --- 16 unchanged lines hidden (view full) --- 522 "i686-apple-darwin10", "", "x86_64", triple); 523 AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.0.0", 524 "i686-apple-darwin8", "", "", triple); 525 break; 526 case llvm::Triple::DragonFly: 527 AddPath("/usr/include/c++/4.1", System, true, false, false); 528 break; 529 case llvm::Triple::Linux: | 539 return; 540 } 541 // FIXME: temporary hack: hard-coded paths. 542 switch (os) { 543 case llvm::Triple::Cygwin: 544 AddPath("/lib/gcc/i686-pc-cygwin/3.4.4/include", 545 System, true, false, false); 546 AddPath("/lib/gcc/i686-pc-cygwin/3.4.4/include/c++", --- 16 unchanged lines hidden (view full) --- 563 "i686-apple-darwin10", "", "x86_64", triple); 564 AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.0.0", 565 "i686-apple-darwin8", "", "", triple); 566 break; 567 case llvm::Triple::DragonFly: 568 AddPath("/usr/include/c++/4.1", System, true, false, false); 569 break; 570 case llvm::Triple::Linux: |
530 // Exherbo (2010-01-25) 531 AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.4.3", 532 "x86_64-pc-linux-gnu", "32", "", triple); 533 AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.4.3", 534 "i686-pc-linux-gnu", "", "", triple); 535 // Debian sid | 571 //===------------------------------------------------------------------===// 572 // Debian based distros. 573 // Note: these distros symlink /usr/include/c++/X.Y.Z -> X.Y 574 //===------------------------------------------------------------------===// 575 // Ubuntu 10.04 LTS "Lucid Lynx" -- gcc-4.4.3 576 // Ubuntu 9.10 "Karmic Koala" -- gcc-4.4.1 577 // Debian 6.0 "squeeze" -- gcc-4.4.2 |
536 AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.4", 537 "x86_64-linux-gnu", "32", "", triple); 538 AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.4", | 578 AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.4", 579 "x86_64-linux-gnu", "32", "", triple); 580 AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.4", |
539 "i486-linux-gnu", "64", "", triple); 540 // Ubuntu 7.10 - Gutsy Gibbon 541 AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.1.3", 542 "i486-linux-gnu", "", "", triple); 543 // Ubuntu 9.04 544 AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.3.3", 545 "x86_64-linux-gnu","32", "", triple); 546 // Ubuntu 9.10 547 AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.4.1", | 581 "i486-linux-gnu", "", "64", triple); 582 // Ubuntu 9.04 "Jaunty Jackalope" -- gcc-4.3.3 583 // Ubuntu 8.10 "Intrepid Ibex" -- gcc-4.3.2 584 // Debian 5.0 "lenny" -- gcc-4.3.2 585 AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.3", |
548 "x86_64-linux-gnu", "32", "", triple); | 586 "x86_64-linux-gnu", "32", "", triple); |
549 // Fedora 8 550 AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.1.2", 551 "i386-redhat-linux", "", "", triple); 552 // Fedora 9 553 AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.3.0", 554 "i386-redhat-linux", "", "", triple); 555 // Fedora 10 556 AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.3.2", 557 "i386-redhat-linux","", "", triple); | 587 AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.3", 588 "i486-linux-gnu", "", "64", triple); 589 // Ubuntu 8.04.4 LTS "Hardy Heron" -- gcc-4.2.4 590 // Ubuntu 8.04.[0-3] LTS "Hardy Heron" -- gcc-4.2.3 591 AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.2", 592 "x86_64-linux-gnu", "32", "", triple); 593 AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.2", 594 "i486-linux-gnu", "", "64", triple); 595 // Ubuntu 7.10 "Gutsy Gibbon" -- gcc-4.1.3 596 AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.1", 597 "x86_64-linux-gnu", "32", "", triple); 598 AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.1", 599 "i486-linux-gnu", "", "64", triple); |
558 | 600 |
559 // Fedora 10 x86_64 560 AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.3.2", | 601 //===------------------------------------------------------------------===// 602 // Redhat based distros. 603 //===------------------------------------------------------------------===// 604 // Fedora 13 605 // Fedora 12 606 AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.4.3", |
561 "x86_64-redhat-linux", "32", "", triple); | 607 "x86_64-redhat-linux", "32", "", triple); |
562 | 608 AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.4.3", 609 "i686-redhat-linux","", "", triple); 610 // Fedora 12 (pre-FEB-2010) 611 AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.4.2", 612 "x86_64-redhat-linux", "32", "", triple); 613 AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.4.2", 614 "i686-redhat-linux","", "", triple); |
563 // Fedora 11 564 AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.4.1", | 615 // Fedora 11 616 AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.4.1", |
565 "i586-redhat-linux","", "", triple); 566 567 // Fedora 11 x86_64 | 617 "x86_64-redhat-linux", "32", "", triple); |
568 AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.4.1", | 618 AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.4.1", |
619 "i586-redhat-linux","", "", triple); 620 // Fedora 10 621 AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.3.2", |
|
569 "x86_64-redhat-linux", "32", "", triple); | 622 "x86_64-redhat-linux", "32", "", triple); |
570 571 // Fedora 12 572 AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.4.2", 573 "i686-redhat-linux","", "", triple); 574 575 // Fedora 12 x86_64 576 AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.4.2", | 623 AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.3.2", 624 "i386-redhat-linux","", "", triple); 625 // Fedora 9 626 AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.3.0", |
577 "x86_64-redhat-linux", "32", "", triple); | 627 "x86_64-redhat-linux", "32", "", triple); |
628 AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.3.0", 629 "i386-redhat-linux", "", "", triple); 630 // Fedora 8 631 AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.1.2", 632 "x86_64-redhat-linux", "", "", triple); 633 AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.1.2", 634 "i386-redhat-linux", "", "", triple); |
|
578 | 635 |
579 // Fedora 12 (February-2010+) 580 AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.4.3", 581 "i686-redhat-linux","", "", triple); | 636 //===------------------------------------------------------------------===// |
582 | 637 |
583 // Fedora 12 (February-2010+) x86_64 | 638 // Exherbo (2010-01-25) |
584 AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.4.3", | 639 AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.4.3", |
585 "x86_64-redhat-linux", "32", "", triple); | 640 "x86_64-pc-linux-gnu", "32", "", triple); 641 AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.4.3", 642 "i686-pc-linux-gnu", "", "", triple); |
586 587 // openSUSE 11.1 32 bit 588 AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.3", 589 "i586-suse-linux", "", "", triple); 590 // openSUSE 11.1 64 bit 591 AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.3", 592 "x86_64-suse-linux", "32", "", triple); 593 // openSUSE 11.2 --- 13 unchanged lines hidden (view full) --- 607 // Gentoo x86 2009.0 stable 608 AddGnuCPlusPlusIncludePaths( 609 "/usr/lib/gcc/i686-pc-linux-gnu/4.3.2/include/g++-v4", 610 "i686-pc-linux-gnu", "", "", triple); 611 // Gentoo x86 2008.0 stable 612 AddGnuCPlusPlusIncludePaths( 613 "/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include/g++-v4", 614 "i686-pc-linux-gnu", "", "", triple); | 643 644 // openSUSE 11.1 32 bit 645 AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.3", 646 "i586-suse-linux", "", "", triple); 647 // openSUSE 11.1 64 bit 648 AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.3", 649 "x86_64-suse-linux", "32", "", triple); 650 // openSUSE 11.2 --- 13 unchanged lines hidden (view full) --- 664 // Gentoo x86 2009.0 stable 665 AddGnuCPlusPlusIncludePaths( 666 "/usr/lib/gcc/i686-pc-linux-gnu/4.3.2/include/g++-v4", 667 "i686-pc-linux-gnu", "", "", triple); 668 // Gentoo x86 2008.0 stable 669 AddGnuCPlusPlusIncludePaths( 670 "/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include/g++-v4", 671 "i686-pc-linux-gnu", "", "", triple); |
615 // Ubuntu 8.10 616 AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.3", 617 "i486-pc-linux-gnu", "", "", triple); 618 // Ubuntu 9.04 619 AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.3", 620 "i486-linux-gnu","", "", triple); | |
621 // Gentoo amd64 stable 622 AddGnuCPlusPlusIncludePaths( 623 "/usr/lib/gcc/x86_64-pc-linux-gnu/4.1.2/include/g++-v4", 624 "i686-pc-linux-gnu", "", "", triple); 625 626 // Gentoo amd64 gcc 4.3.2 627 AddGnuCPlusPlusIncludePaths( 628 "/usr/lib/gcc/x86_64-pc-linux-gnu/4.3.2/include/g++-v4", 629 "x86_64-pc-linux-gnu", "", "", triple); 630 631 // Gentoo amd64 gcc 4.4.3 632 AddGnuCPlusPlusIncludePaths( 633 "/usr/lib/gcc/x86_64-pc-linux-gnu/4.4.3/include/g++-v4", 634 "x86_64-pc-linux-gnu", "32", "", triple); 635 636 break; 637 case llvm::Triple::FreeBSD: | 672 // Gentoo amd64 stable 673 AddGnuCPlusPlusIncludePaths( 674 "/usr/lib/gcc/x86_64-pc-linux-gnu/4.1.2/include/g++-v4", 675 "i686-pc-linux-gnu", "", "", triple); 676 677 // Gentoo amd64 gcc 4.3.2 678 AddGnuCPlusPlusIncludePaths( 679 "/usr/lib/gcc/x86_64-pc-linux-gnu/4.3.2/include/g++-v4", 680 "x86_64-pc-linux-gnu", "", "", triple); 681 682 // Gentoo amd64 gcc 4.4.3 683 AddGnuCPlusPlusIncludePaths( 684 "/usr/lib/gcc/x86_64-pc-linux-gnu/4.4.3/include/g++-v4", 685 "x86_64-pc-linux-gnu", "32", "", triple); 686 687 break; 688 case llvm::Triple::FreeBSD: |
689 // FreeBSD 8.0 690 // FreeBSD 7.3 |
|
638 AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.2", "", "", "", triple); 639 break; 640 case llvm::Triple::Solaris: 641 // Solaris - Fall though.. 642 case llvm::Triple::AuroraUX: 643 // AuroraUX 644 AddGnuCPlusPlusIncludePaths("/opt/gcc4/include/c++/4.2.4", 645 "i386-pc-solaris2.11", "", "", triple); 646 break; 647 default: 648 break; 649 } 650} 651 652void InitHeaderSearch::AddDefaultSystemIncludePaths(const LangOptions &Lang, 653 const llvm::Triple &triple, | 691 AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.2", "", "", "", triple); 692 break; 693 case llvm::Triple::Solaris: 694 // Solaris - Fall though.. 695 case llvm::Triple::AuroraUX: 696 // AuroraUX 697 AddGnuCPlusPlusIncludePaths("/opt/gcc4/include/c++/4.2.4", 698 "i386-pc-solaris2.11", "", "", triple); 699 break; 700 default: 701 break; 702 } 703} 704 705void InitHeaderSearch::AddDefaultSystemIncludePaths(const LangOptions &Lang, 706 const llvm::Triple &triple, |
654 bool UseStandardCXXIncludes) { 655 if (Lang.CPlusPlus && UseStandardCXXIncludes) | 707 const HeaderSearchOptions &HSOpts) { 708 if (Lang.CPlusPlus && HSOpts.UseStandardCXXIncludes) |
656 AddDefaultCPlusPlusIncludePaths(triple); 657 | 709 AddDefaultCPlusPlusIncludePaths(triple); 710 |
658 AddDefaultCIncludePaths(triple); | 711 AddDefaultCIncludePaths(triple, HSOpts); |
659 660 // Add the default framework include paths on Darwin. 661 if (triple.getOS() == llvm::Triple::Darwin) { 662 AddPath("/System/Library/Frameworks", System, true, false, true); 663 AddPath("/Library/Frameworks", System, true, false, true); 664 } 665} 666 --- 141 unchanged lines hidden (view full) --- 808 Init.AddDelimitedPaths(HSOpts.ObjCXXEnvIncPath); 809 else if (Lang.CPlusPlus) 810 Init.AddDelimitedPaths(HSOpts.CXXEnvIncPath); 811 else if (Lang.ObjC1) 812 Init.AddDelimitedPaths(HSOpts.ObjCEnvIncPath); 813 else 814 Init.AddDelimitedPaths(HSOpts.CEnvIncPath); 815 | 712 713 // Add the default framework include paths on Darwin. 714 if (triple.getOS() == llvm::Triple::Darwin) { 715 AddPath("/System/Library/Frameworks", System, true, false, true); 716 AddPath("/Library/Frameworks", System, true, false, true); 717 } 718} 719 --- 141 unchanged lines hidden (view full) --- 861 Init.AddDelimitedPaths(HSOpts.ObjCXXEnvIncPath); 862 else if (Lang.CPlusPlus) 863 Init.AddDelimitedPaths(HSOpts.CXXEnvIncPath); 864 else if (Lang.ObjC1) 865 Init.AddDelimitedPaths(HSOpts.ObjCEnvIncPath); 866 else 867 Init.AddDelimitedPaths(HSOpts.CEnvIncPath); 868 |
816 if (HSOpts.UseBuiltinIncludes) { 817 // Ignore the sys root, we *always* look for clang headers relative to 818 // supplied path. 819 llvm::sys::Path P(HSOpts.ResourceDir); 820 P.appendComponent("include"); 821 Init.AddPath(P.str(), System, false, false, false, /*IgnoreSysRoot=*/ true); 822 } 823 | |
824 if (HSOpts.UseStandardIncludes) | 869 if (HSOpts.UseStandardIncludes) |
825 Init.AddDefaultSystemIncludePaths(Lang, Triple, 826 HSOpts.UseStandardCXXIncludes); | 870 Init.AddDefaultSystemIncludePaths(Lang, Triple, HSOpts); |
827 828 Init.Realize(); 829} | 871 872 Init.Realize(); 873} |