5

我正在使用最新的 automake (v1.12)跟踪文档,但构建仍然失败。

这是我的configure.ac

AC_PREREQ([2.69])
AC_INIT([helloworld], [0.1], [bugs@hw.com])
AC_INIT_AUTOMAKE([1.12 foreign no-define])
AC_CONFIG_SRCDIR([src/hello.c])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_FILES([Makefile])

# Checks for programs.
AC_PROG_CC([gcc cc])

# Checks for libraries.

# Checks for header files.

# Checks for typedefs, structures, and compiler characteristics.

# Checks for library functions.

AC_OUTPUT(src/Makefile)

执行:

$ autoreconf
configure.ac:3: error: possibly undefined macro: AC_INIT_AUTOMAKE
      If this token and others are legitimate, please use m4_pattern_allow.
      See the Autoconf documentation.
autoreconf: /usr/bin/autoconf failed with exit status: 1

$ automake
configure.ac: error: no proper invocation of AM_INIT_AUTOMAKE was found.
configure.ac: You should verify that configure.ac invokes AM_INIT_AUTOMAKE,
configure.ac: that aclocal.m4 is present in the top-level directory,
configure.ac: and that aclocal.m4 was recently regenerated (using aclocal)
configure.ac:5: error: required file 'config.h.in' not found
/usr/share/automake-1.12/am/depend2.am: error: am__fastdepCC does not appear in AM_CONDITIONAL
/usr/share/automake-1.12/am/depend2.am:   The usual way to define 'am__fastdepCC' is to add 'AC_PROG_CC'
/usr/share/automake-1.12/am/depend2.am:   to 'configure.ac' and run 'aclocal' and 'autoconf' again
/usr/share/automake-1.12/am/depend2.am: error: AMDEP does not appear in AM_CONDITIONAL
/usr/share/automake-1.12/am/depend2.am:   The usual way to define 'AMDEP' is to add one of the compiler tests
/usr/share/automake-1.12/am/depend2.am:     AC_PROG_CC, AC_PROG_CXX, AC_PROG_OBJC, AC_PROG_OBJCXX,
/usr/share/automake-1.12/am/depend2.am:     AM_PROG_AS, AM_PROG_GCJ, AM_PROG_UPC
/usr/share/automake-1.12/am/depend2.am:   to 'configure.ac' and run 'aclocal' and 'autoconf' again
4

1 回答 1

10

第 3 行应为

AM_INIT_AUTOMAKE([1.12 foreign no-define])

请注意,它以AM_not开头AC_

一般来说,所有的 automake 宏都以AM_.

于 2012-07-02T02:03:20.430 回答