我正在创建一个学习autotools的玩具示例。我创建了以下文件。
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
和Makefile.am
:
bin_PROGRAMS = hello
hello_SOURCES = hello.c
和hello.c
:
#include <stdio.h>
int main()
{
printf("hello world!\n") ;
return 0 ;
}
然后我在终端中做了autoreconf -i
,但我得到以下内容:
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
这些错误是什么,我该如何解决?
答案 0 :(得分:1)
AM_INIT_AUTOMAKE([1.11 -Wall -Werror]
缺少)
。不确定这是typo
。