我是 windows xp (SP3) 用户和 linux 实用程序的新手。 我需要使用 autoconf 和 linux 中的其他自动工具。我的系统中安装了以下工具。
-Msys 版本 1.0.11 -msysDTK-1.0.1 -msysgit -wget-1.11.4-1 -autoconf-2.68 -automake-1.11.1 -libtool-2.4.1 -libcrypt-1.1 -perl-5.8.8 -m4-1.4.14 -gettext-runtime_0.18.1.1-2_win32 -glib_2.28.1-1_win32 -glib_2.28.8-1_win32 -pkg-config_0.23-3_win32 -pkg-config-dev_0.23-3_win32
我尝试了 http://www.dwheeler.com/autotools 中的“自动工具简介”教程 Configure.ac 是使用以下行创建的,
AC_INIT([hello], [0.01])
AC_OUTPUT
从 Msys shell 运行命令
$ autoreconf -i
我得到了以下日志,
/usr/share/aclocal/autoopts.m4:22: warning: underquoted definition of AG_PATH_AU
TOOPTS
/usr/share/aclocal/autoopts.m4:22: run info '(automake)Extending aclocal'
/usr/share/aclocal/autoopts.m4:22: or see http://sources.redhat.com/automake/a
utomake.html#Extending-aclocal
我之前尝试过另一个来自网络的存档教程,即 有一个名为 hello-initial 的目录。 'hello-initial' 有一个包含 hello.c 和 hello.h 的 src 目录。 我使用以下行创建了 Makefile.am:
SUBDIRS=src.
在 src 目录中,使用以下行创建 Makefile.am,
helloprgdir=../
helloprg_PROGRAMS=hello
hello_SOURCES=hello.c
我cd到msys shell中的hello-initial目录,按照教程操作,产生了如下日志,即
Raji@COMPUTER_1 ~
$ cd /gold/hello-initial
Raji@COMPUTER_1 /gold/hello-initial
$ autoscan
Raji@COMPUTER_1 /gold/hello-initial
$ aclocal
/usr/share/aclocal/autoopts.m4:22: warning: underquoted definition of AG_PATH_AU
TOOPTS
/usr/share/aclocal/autoopts.m4:22: run info '(automake)Extending aclocal'
/usr/share/aclocal/autoopts.m4:22: or see http://sources.redhat.com/automake/a
utomake.html#Extending-aclocal
configure.ac:8: warning: macro `AM_CONFIG_HEADERS' not found in library
Raji@COMPUTER_1 /gold/hello-initial
$ automake -ac
configure.ac:7: installing `./install-sh'
configure.ac:7: installing `./missing'
automake: no `Makefile.am' found for any configure output.
求助。 研发,
最佳答案
配置文件
AC_INIT([project name], [major.minor.revision], [bugreport@bar.xx])
AM_INIT_AUTOMAKE([foreign])dnl foreign means that its not standard gnu project or not strict
AC_PROG_CC
AC_CONFIG_FILES([
Makefile
])
AC_OUTPUT
Autoconf 语言是“m4”,请在 autoconf 信息页面中检查。
automake 的信息页面是开始的好地方。
http://www.gnu.org/software/autoconf/用于获取文档和 autoconf 本身
要安装 autotools 使用
'autoreconf --install'
并更新 autoconf
'autoreconf' 或 'autoconf'
关于c++ - 使用 linux 自动工具,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10172977/