autotools 中的 automake 错误消息
automake error message in autotools
我是第一次尝试使用 Autotools。我设法用手写 Makefile.in 编译了我的代码。并使用 autoconf(./configure make)。
但是现在,我决定使用 Automake
使用 Makefile.am
生成 Makefile.in
我的Makefile.am:
bin_PROGRAMS=hello_portable
hello_portable_SOURCES=hello_portable.c
我的 configure.ac 由自动扫描自动生成:
AC_PREREQ([2.69])
AC_INIT([FULL-PACKAGE-NAME], [VERSION], [BUG-REPORT-ADDRESS])
AM_INIT_AUTOMAKE(summary, 1.0.0)
AC_CONFIG_SRCDIR([hello_portable.c])
AC_CONFIG_HEADERS([config.h])
# Checks for programs.
AC_PROG_CC
# Checks for libraries.
# Checks for header files.
AC_CHECK_HEADERS([sys/time.h])
# Checks for typedefs, structures, and compiler characteristics.
# Checks for library functions.
AC_CHECK_FUNCS([gettimeofday])
AC_OUTPUT
当我为了生成 Makefile.in
而执行 automake
# 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)
Makefile.am: error: required file './NEWS' not found
Makefile.am: error: required file './README' not found
Makefile.am: error: required file './AUTHORS' not found
Makefile.am: error: required file './ChangeLog' not found
/usr/share/automake-1.14/am/depend2.am: error: am__fastdepCC does not appear in AM_CONDITIONAL
/usr/share/automake-1.14/am/depend2.am: The usual way to define 'am__fastdepCC' is to add 'AC_PROG_CC'
/usr/share/automake-1.14/am/depend2.am: to 'configure.ac' and run 'aclocal' and 'autoconf' again
/usr/share/automake-1.14/am/depend2.am: error: AMDEP does not appear in AM_CONDITIONAL
/usr/share/automake-1.14/am/depend2.am: The usual way to define 'AMDEP' is to add one of the compiler tests
/usr/share/automake-1.14/am/depend2.am: AC_PROG_CC, AC_PROG_CXX, AC_PROG_OBJC, AC_PROG_OBJCXX,
/usr/share/automake-1.14/am/depend2.am: AM_PROG_AS, AM_PROG_GCJ, AM_PROG_UPC
/usr/share/automake-1.14/am/depend2.am: to 'configure.ac' and run 'aclocal' and 'autoconf' again
我做错了什么。
您需要在 configure.ac 中添加几行:
AC_PREREQ([2.69])
AC_INIT([FULL-PACKAGE-NAME], [VERSION], [BUG-REPORT-ADDRESS])
AM_INIT_AUTOMAKE(summary, 1.0.0)
AC_CONFIG_SRCDIR([hello_portable.c])
AC_CONFIG_HEADERS([config.h])
#LINE1!!!!!!!!!!
AM_INIT_AUTOMAKE([1.9])
# Checks for programs.
AC_PROG_CC
# Checks for libraries.
# Checks for header files.
AC_CHECK_HEADERS([sys/time.h])
# Checks for typedefs, structures, and compiler characteristics.
# Checks for library functions.
AC_CHECK_FUNCS([gettimeofday])
#LINE2!!!!!!!!!!!
AC_CONFIG_FILES([Makefile])
AC_OUTPUT
这样修改后你可以运行:
touch NEWS README AUTHORS ChangeLog && autoreconfig -i && ./configure
顺便说一下GNU hello world,你可以用它来举例:
https://www.gnu.org/software/hello/
你必须逐行修复它。
首先,创建Makefile.am
所需的所有新文件。(此步骤您也可以运行 'automake --add-missing'
以便自动添加缺少的文件)
$ touch NEWS README AUTHORS ChangeLog
其次,您必须在 automake 之前 运行 aclocal。
$ aclocal
最后,你可以 运行 automake。
$ automake
我是第一次尝试使用 Autotools。我设法用手写 Makefile.in 编译了我的代码。并使用 autoconf(./configure make)。
但是现在,我决定使用 Automake
使用 Makefile.am
Makefile.in
我的Makefile.am:
bin_PROGRAMS=hello_portable
hello_portable_SOURCES=hello_portable.c
我的 configure.ac 由自动扫描自动生成:
AC_PREREQ([2.69])
AC_INIT([FULL-PACKAGE-NAME], [VERSION], [BUG-REPORT-ADDRESS])
AM_INIT_AUTOMAKE(summary, 1.0.0)
AC_CONFIG_SRCDIR([hello_portable.c])
AC_CONFIG_HEADERS([config.h])
# Checks for programs.
AC_PROG_CC
# Checks for libraries.
# Checks for header files.
AC_CHECK_HEADERS([sys/time.h])
# Checks for typedefs, structures, and compiler characteristics.
# Checks for library functions.
AC_CHECK_FUNCS([gettimeofday])
AC_OUTPUT
当我为了生成 Makefile.in
而执行 automake# 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)
Makefile.am: error: required file './NEWS' not found
Makefile.am: error: required file './README' not found
Makefile.am: error: required file './AUTHORS' not found
Makefile.am: error: required file './ChangeLog' not found
/usr/share/automake-1.14/am/depend2.am: error: am__fastdepCC does not appear in AM_CONDITIONAL
/usr/share/automake-1.14/am/depend2.am: The usual way to define 'am__fastdepCC' is to add 'AC_PROG_CC'
/usr/share/automake-1.14/am/depend2.am: to 'configure.ac' and run 'aclocal' and 'autoconf' again
/usr/share/automake-1.14/am/depend2.am: error: AMDEP does not appear in AM_CONDITIONAL
/usr/share/automake-1.14/am/depend2.am: The usual way to define 'AMDEP' is to add one of the compiler tests
/usr/share/automake-1.14/am/depend2.am: AC_PROG_CC, AC_PROG_CXX, AC_PROG_OBJC, AC_PROG_OBJCXX,
/usr/share/automake-1.14/am/depend2.am: AM_PROG_AS, AM_PROG_GCJ, AM_PROG_UPC
/usr/share/automake-1.14/am/depend2.am: to 'configure.ac' and run 'aclocal' and 'autoconf' again
我做错了什么。
您需要在 configure.ac 中添加几行:
AC_PREREQ([2.69])
AC_INIT([FULL-PACKAGE-NAME], [VERSION], [BUG-REPORT-ADDRESS])
AM_INIT_AUTOMAKE(summary, 1.0.0)
AC_CONFIG_SRCDIR([hello_portable.c])
AC_CONFIG_HEADERS([config.h])
#LINE1!!!!!!!!!!
AM_INIT_AUTOMAKE([1.9])
# Checks for programs.
AC_PROG_CC
# Checks for libraries.
# Checks for header files.
AC_CHECK_HEADERS([sys/time.h])
# Checks for typedefs, structures, and compiler characteristics.
# Checks for library functions.
AC_CHECK_FUNCS([gettimeofday])
#LINE2!!!!!!!!!!!
AC_CONFIG_FILES([Makefile])
AC_OUTPUT
这样修改后你可以运行:
touch NEWS README AUTHORS ChangeLog && autoreconfig -i && ./configure
顺便说一下GNU hello world,你可以用它来举例: https://www.gnu.org/software/hello/
你必须逐行修复它。
首先,创建Makefile.am
所需的所有新文件。(此步骤您也可以运行 'automake --add-missing'
以便自动添加缺少的文件)
$ touch NEWS README AUTHORS ChangeLog
其次,您必须在 automake 之前 运行 aclocal。
$ aclocal
最后,你可以 运行 automake。
$ automake