使用 Linux 自动工具

using linux auto tools

本文关键字:工具 Linux 使用      更新时间:2023-10-16

我是Windows xp(SP3)用户,并且是linux实用程序的新手。我需要使用 autoconf 和 linux 中的其他自动工具。我的系统中安装了以下内容。

-MSYS 版本 1.0.11 -msysDTK-1.0.1 -msysgit -wget-1.11.4-1 -自动会议-2.68 -自动制造-1.11.1 -libtool-2.4.1 -libcrypt-1.1 -perl-5.8.8 -m4-1.4.14 -获取文本-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 外壳中,运行命令

$ 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:

子目录=源。

在 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. 

请帮忙。Rgds,

configure.ac

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 info pages 中检查它.
Automake的信息页面是开始的好地方.
获取文档和自动确认本身 http://www.gnu.org/software/autoconf/
要安装自动工具,请使用
'autoreconf --install'
以及用于更新自动会议"自动重新确认"或"自动重新确认"