I am following https://robots.thoughtbot.com/the-magic-behind-configure-make-make-install to learn how to use autoconf
and automake
to create the configure
script and Makefile
.
Below is the content of configure.ac
file:
AC_INIT ([helloworld], [0.1], [[email protected]])
AM_INIT_AUTOMAKE
AC_PROG_CC
AC_CONFIG_FILES([Makefile])
AC_OUTPUT
However, when I run aclocal
command, I get the following error.
user $ aclocal
configure.ac:2: error: AC_INIT should be called with package and version arguments
/usr/share/aclocal-1.14/init.m4:29: AM_INIT_AUTOMAKE is expanded from...
configure.ac:2: the top level
autom4te: /usr/bin/m4 failed with exit status: 1
aclocal: error: echo failed with exit status: 1
user $
I did google search to see if line AC_INIT ([helloworld], [0.1], [[email protected]])
was incorrect. But it looks like it is correct way to use AC_INIT
.
How do I fix this ?
Also, below is the content of Makefile.am
file (if this is related to the error):
AUTOMAKE_OPTIONS = foreign
bin_PROGRAMS = helloworld
helloworld_SOURCES = hello.c
It appears to be just a matter of whitespace: according to 3.1.2 The Autoconf Language from the Autoconf Manual:
So you need to change
to