简体   繁体   English

包括用于多个平台/版本的libc目录

[英]Including libc directory for multiple platforms/versions

These directories on my platform (Ubuntu) is required to be passed to clang so it can parse code that includes libc headers properly: 我平台(Ubuntu)上的这些目录需要传递给clang,以便它可以正确解析包含libc标头的代码:

/usr/include/x86_64-linux-gnu

/usr/lib/gcc/x86_64-linux-gnu/4.6/include

/usr/lib/gcc/x86_64-linux-gnu/4.6/include-fixed

What is the simplest way to find the location of this directory on other platforms and versions of gnu libc? 在其他平台和gnu libc版本上查找此目录位置的最简单方法是什么? I need this to make a portable build script. 我需要这个来制作一个可移植的构建脚本。

Please tell me this is standardized in some way or form. 请告诉我这是以某种方式或形式标准化的。 Pkg-config? PKG配置?

llvm/tools/clang/lib/Driver/ToolChains.cpp searches for GCC installations, with various hard-coded paths for different platforms. llvm/tools/clang/lib/Driver/ToolChains.cpp搜索GCC安装,其中包含用于不同平台的各种硬编码路径。

On Gentoo, Debian, and Ubuntu, the distribution-provided clang source patches this file to look in distribution-specific locations (eg gentoo/sys-devel/clang/files/clang-3.1-gentoo-runtime-gcc-detection-v3.patch , debian/clang_3.1-8/debian/patches/21-searchPathHeaders.diff , etc.). 在Gentoo,Debian和Ubuntu上,发行版提供的clang源会对该文件进行修补,以查找发行版中的特定位置(例如gentoo / sys-devel / clang / files / clang-3.1-gentoo-runtime-gcc-detection-v3。补丁程序debian / clang_3.1-8 / debian / patches / 21-searchPathHeaders.diff等)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM