如何获取 Ada 规范的 gcc 搜索路径
基本问题:
如何让 gcc
告诉我它搜索 Ada
的位置?
具体问题:
我刚刚完成将 C
库的头文件转换为 Ada
规范,以便我可以使用 Ada 与该库交互
。我现在想在我的系统上安装这些规格。我还希望在某种程度上使安装可移植,以便我可以在任何计算机上 make install
(从而在 Github 或类似的)。我只是不确定将规格安装到哪里。
Basic Question:
How can I get gcc
to tell me where it searches for Ada
includes?
Specific Problem:
I have just finished converting a C
library's header files to Ada
specs so that I can interface with the library using Ada
. I now want to install the specs on my system. I also want to make the installation portable to some extent so that I can make install
on any machine (and thus host the specs and Makefile
on Github or similar). I'm just not sure where exactly to install the specs to.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
gnat ls -v
将为您提供默认搜索路径。如果你想安装自己的Ada库,你应该在“项目搜索路径”中放置一个项目文件(.gpr),它会告诉gnat在哪里可以找到ada和ali文件以及库。
通常,您会将 ada 文件放在
/usr/[local/]include/myadalib
中,将 ali 文件放在/usr/[local/]lib/myadalib
中,也许将 .so 文件链接到/usr/[local/]lib
,但您可以将它们放在任何您想要的位置。重要的是将项目文件(myadalib.gpr)放在项目搜索路径中。您甚至可以通过设置 ADA_PROJECT_PATH 环境变量来调整项目搜索路径。
gnat ls -v
will give you the default search paths.If you want to install your own Ada library, you should place a project file (.gpr) in the "Project Search Path", which will tell gnat where to find the ada and ali files and the library.
Normally, you will place the ada files in
/usr/[local/]include/myadalib
and the ali files in/usr/[local/]lib/myadalib
and maybe link the .so file into/usr/[local/]lib
, but you can put them anywhere you want. The important thing is to place the project file (myadalib.gpr) in the project search path.You can even adjust the project search path by setting the ADA_PROJECT_PATH environment variable.