2014-03-07 41 views
-1

我创造学习自动工具玩具的例子。我创建了以下文件。 configure.ac`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

所有这些文件是一个名为'文件夹中hello' – AbKDs

+0

Crossposted:http://unix.stackexchange.com/questions/118556/configure-ac-file-giving-errors – delicateLatticeworkFever

回答

1
AM_INIT_AUTOMAKE([1.11 -Wall -Werror] 

缺少)。不知道这是否是typo