automake --add-missing:错误:未找到AM_INIT_AUTOMAKE的正确调用

时间:2017-01-26 11:53:04

标签: c autotools automake

我使用autotools编译我的源代码,

    $:~/Temp/cproject$ autoscan
    $:~/Temp/cproject$ ls
    autoscan.log  configure.scan  main.cpp
    $:~/Temp/cproject$ mv configure.scan configure.ac
    $:~/Temp/cproject$ aclocal
    $:~/Temp/cproject$ automake --add-missing
    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)
    automake: error: no 'Makefile.am' found for any configure output

configure.ac文件内容如下:

    #                                               -*- Autoconf -*-
    # Process this file with autoconf to produce a configure script.

    AC_PREREQ([2.69])
    AC_INIT([FULL-PACKAGE-NAME], [VERSION], [BUG-REPORT-ADDRESS])
    AC_CONFIG_SRCDIR([main.cpp])
    AC_CONFIG_HEADERS([config.h])

    # Checks for programs.
    AC_PROG_CXX

    # Checks for libraries.

    # Checks for header files.

    # Checks for typedefs, structures, and compiler characteristics.

    # Checks for library functions.

    AC_OUTPUT

我的手术有什么问题?为什么我会收到这些错误?谢谢!

1 个答案:

答案 0 :(得分:1)

您没有使用automake宏,因此当然automake失败了。这里的问题是autoscan is buggy and not useful

我可以推荐您使用basic tutorial来获取autotools的默认基本支持,如果这是您正在寻找的内容。