I am creating a toy example for learning autotools . I created the following files .
configure.ac
AC_INIT([hello], [0.01])
# safety check -list a source file that wouldn't be in other directories :
AC_CONFIG_SRCDIR([hello.c])
# Put configuration results here so that we can easily #include them
AC_CONFIG_HEADERS([config.h])
# Put autotools aux files in a subdir . so they don't clutter top dir :
AC_CONFIG_AUX_DIR([build-aux])
# Enable "automake" to simplify creating makefiles :
AM_INIT_AUTOMAKE([1.11 -Wall -Werror]
AC_CONFIG_FILES([Makefile])
#look for a C compiler :
AC_PROG_CC
# Do final output
AC_OUTPUT
and a Makefile.am
:
bin_PROGRAMS = hello
hello_SOURCES = hello.c
and hello.c
:
#include <stdio.h>
int main()
{
printf("hello world!\n") ;
return 0 ;
}
Then I did a autoreconf -i
in the terminal but I am getting the following :
configure.ac:1: error: m4_init: unbalanced m4_divert_push:
configure.ac:17: m4_divert_push: GROW
configure.ac:1: m4_divert: BODY
../../lib/autoconf/c.m4:448: AC_PROG_CC is expanded from...
configure.ac:1: the top level
autom4te: /usr/bin/m4 failed with exit status: 1
aclocal: autom4te failed with exit status: 1
autoreconf: aclocal failed with exit status: 1
What are these errors , how can I fix them ?