将 ncurses headers 安装到 <prefix>/include 而不是 <prefix>/include/ncurses
Installing ncurses headers to <prefix>/include instead of <prefix>/include/ncurses
我正在尝试将 ncurses 安装到非 system-wide 前缀(用于交叉编译)。
一切正常,我能够将 ncurses 安装到指定的前缀,header 文件位于 <prefix>/include/ncurses
.
我正在尝试编译的程序(特别是 GHC)找不到 header,因为它试图 #include <ncurses.h>
,但这不起作用。 (include <ncurses/ncurses.h>
虽然可以,但 GHC 不会尝试这个。)
所以我认为将 header 直接安装到 <prefix>/include
就可以解决问题,但我无法做到这一点。将 --includedir=<prefix>/include
传递给 ncurses 的配置脚本没有给出预期的结果,因为安装的 ncurses.h 然后尝试 #include <include/ncurses_dll.h>
,这是行不通的。
<prefix>/include
当然在使用的CPP的搜索路径中
通常,基于 autoconf 的配置脚本的 --includedir
用于告诉 makefile 在哪里 安装 头文件,而不是 在编译期间包含它们。
相反,您可能想要设置的选项将在 CPPFLAGS
变量中。例如,由于 GHC 期望 ncurses 头文件仅位于标准位置,因此您可以通过将两个目录都指定为 CPPFLAGS
.
中的 -I
选项来解决该问题。
这里有一些讨论可以提供帮助:
- 4.8.1 Preset Output Variables (autoconf manual)
- how to set include paths with autotools
- With autoconf/automake, how do I specify include file paths?
- What is the difference between DEFS and CPPFLAGS in autoconf and automake
顺便说一句,prefix/lib 看起来很奇怪...
关于--disable-overwrite
的评论,Linux和一些其他平台默认启用此功能。 OSX 一个人没有。在配置结束时,配置脚本运行一个 makefile 规则来显示生成的配置。如果禁用覆盖,您会看到这样的消息:
** Include-directory is not in a standard location
我正在尝试将 ncurses 安装到非 system-wide 前缀(用于交叉编译)。
一切正常,我能够将 ncurses 安装到指定的前缀,header 文件位于 <prefix>/include/ncurses
.
我正在尝试编译的程序(特别是 GHC)找不到 header,因为它试图 #include <ncurses.h>
,但这不起作用。 (include <ncurses/ncurses.h>
虽然可以,但 GHC 不会尝试这个。)
所以我认为将 header 直接安装到 <prefix>/include
就可以解决问题,但我无法做到这一点。将 --includedir=<prefix>/include
传递给 ncurses 的配置脚本没有给出预期的结果,因为安装的 ncurses.h 然后尝试 #include <include/ncurses_dll.h>
,这是行不通的。
<prefix>/include
当然在使用的CPP的搜索路径中
通常,基于 autoconf 的配置脚本的 --includedir
用于告诉 makefile 在哪里 安装 头文件,而不是 在编译期间包含它们。
相反,您可能想要设置的选项将在 CPPFLAGS
变量中。例如,由于 GHC 期望 ncurses 头文件仅位于标准位置,因此您可以通过将两个目录都指定为 CPPFLAGS
.
-I
选项来解决该问题。
这里有一些讨论可以提供帮助:
- 4.8.1 Preset Output Variables (autoconf manual)
- how to set include paths with autotools
- With autoconf/automake, how do I specify include file paths?
- What is the difference between DEFS and CPPFLAGS in autoconf and automake
顺便说一句,prefix/lib 看起来很奇怪...
关于--disable-overwrite
的评论,Linux和一些其他平台默认启用此功能。 OSX 一个人没有。在配置结束时,配置脚本运行一个 makefile 规则来显示生成的配置。如果禁用覆盖,您会看到这样的消息:
** Include-directory is not in a standard location