Index: tools/llvm-config/llvm-config.cpp =================================================================== --- tools/llvm-config/llvm-config.cpp +++ tools/llvm-config/llvm-config.cpp @@ -333,11 +333,16 @@ ("-I" + ActiveIncludeDir + " " + "-I" + ActiveObjRoot + "/include"); } else { ActivePrefix = CurrentExecPrefix; +#ifdef __HAIKU__ + ActiveIncludeDir = ActivePrefix + "/develop/headers"; + ActiveLibDir = ActivePrefix + "/develop/lib" + LLVM_LIBDIR_SUFFIX; +#else ActiveIncludeDir = ActivePrefix + "/include"; + ActiveLibDir = ActivePrefix + "/lib" + LLVM_LIBDIR_SUFFIX; +#endif SmallString<256> path(StringRef(LLVM_TOOLS_INSTALL_DIR)); sys::fs::make_absolute(ActivePrefix, path); ActiveBinDir = path.str(); - ActiveLibDir = ActivePrefix + "/lib" + LLVM_LIBDIR_SUFFIX; ActiveCMakeDir = ActiveLibDir + "/cmake/llvm"; ActiveIncludeOption = "-I" + ActiveIncludeDir; } @@ -557,10 +562,16 @@ OS << (LLVM_HAS_GLOBAL_ISEL ? "ON" : "OFF") << '\n'; } else if (Arg == "--shared-mode") { PrintSharedMode = true; - } else if (Arg == "--obj-root") { - OS << ActivePrefix << '\n'; - } else if (Arg == "--src-root") { - OS << LLVM_SRC_ROOT << '\n'; + } else if (Arg == "--obj-root" || Arg == "--src-root") { + if (IsInDevelopmentTree) { + if (Arg == "--obj-root") + OS << ActivePrefix << '\n'; + else + OS << LLVM_SRC_ROOT << '\n'; + } else { + llvm::errs() << "llvm-config: sources not installed\n"; + exit(1); + } } else if (Arg == "--ignore-libllvm") { LinkDyLib = false; LinkMode = BuiltSharedLibs ? LinkModeShared : LinkModeAuto;