我有一个Makefile.am
用ocamlbuild
编译Ocaml源代码。但是,即使
虽然我有
AM_INIT_AUTOMAKE([foreign no-dependencies])
在我的
configure.ac
中,automake认为必须存在C编译器才能安装可执行文件。也就是说,如果我将Makefile.am
下的目标可执行文件放入bin_PROGRAMS
中,该目标可执行文件将使用ocamlbuild构建,则autoreconf(版本1.11.3)会告诉我:Makefile.am: C source seen but `CC' is undefined
Makefile.am: The usual way to define `CC' is to add `AC_PROG_CC'
Makefile.am: to `configure.ac' and run `autoconf' again.
autoreconf: automake failed with exit status: 1
我不想包含
AC_PROG_CC
,因为我的源代码不包含C。它是纯Ocaml。我能做什么? (libexec_PROGRAMS
也有同样的问题。)
最佳答案
可能不需要它,但是将AC_PROG_CC添加到Makefile.am会不会有任何伤害?阻力最小的路径。
解决这个已有十年历史的邮件列表消息:
http://lists.gnu.org/archive/html/automake/2003-01/msg00057.html
听起来您可能需要将progname_SOURCES定义为空。如果我正确理解该帖子,则如果您省略显式声明,则progname_SOURCES将隐式定义为progname.c。
关于ocaml - 在自动制作中抑制 "C source seen but ` CC` undefined”?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9653374/