I have a Makefile.am
for compiling Ocaml source code with ocamlbuild
. However, even
though I have
AM_INIT_AUTOMAKE([foreign no-dependencies])
in my configure.ac
, automake thinks that a C compiler must be present to install exectuables. That is, if I put in Makefile.am
a target executable under bin_PROGRAMS
that is to be built with ocamlbuild, autoreconf (version 1.11.3) tells me:
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
I do not want to include AC_PROG_CC
because my source code includes no C. It is pure Ocaml. What can I do? (I have the same problem with libexec_PROGRAMS
.)
It may be unneeded, but will it hurt anything to simply add AC_PROG_CC to Makefile.am? Path of least resistance and all.
Working off this decade-old mailing list message:
http://lists.gnu.org/archive/html/automake/2003-01/msg00057.html
It sounds like you might need to define progname_SOURCES as empty. If I understand the post correctly, if you omit an explicit declaraction, progname_SOURCES will implicitly be defined as progname.c.
If you add AC_SUBST([CC])
to configure.ac
, that will be enough to define the variable as far as Automake is concerned.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With