20070912 tslib aclocal autogen
http://www.yippeesoft.com

[ www.yippeesoft.com  sf]$ export CVSROOT=:pserver:anoncvs@cvs.handhelds.org:/cvs
[ www.yippeesoft.com  sf]$ cvs login
Logging in to :pserver:anoncvs@cvs.handhelds.org:2401/cvs
CVS password:
[ www.yippeesoft.com  sf]$ cd tslib/
[ www.yippeesoft.com  tslib]$ cvs co apps/tslib

./autogen.sh
Libtoolize…You should add the contents of `/usr/share/aclocal/libtool.m4\’ to `aclocal.m4\’.
Done.
Aclocal…Done.
Autoheader…Done.
Automake…configure.ac: installing `./install-sh\’
configure.ac: installing `./mkinstalldirs\’
configure.ac: installing `./missing\’
plugins/Makefile.am:99: Libtool library used but `LIBTOOL\’ is undefined
plugins/Makefile.am:99:
plugins/Makefile.am:99: The usual way to define `LIBTOOL\’ is to add `AC_PROG_LIBTOOL\’
plugins/Makefile.am:99: to `configure.ac\’ and run `aclocal\’ and `autoconf\’ again.
plugins/Makefile.am: installing `./depcomp\’
src/Makefile.am:17: Libtool library used but `LIBTOOL\’ is undefined
src/Makefile.am:17:
src/Makefile.am:17: The usual way to define `LIBTOOL\’ is to add `AC_PROG_LIBTOOL\’
src/Makefile.am:17: to `configure.ac\’ and run `aclocal\’ and `autoconf\’ again.
Done.
Autoconf…configure.ac:18: error: possibly undefined macro: AC_DISABLE_STATIC
     If this token and others are legitimate, please use m4_pattern_allow.
     See the Autoconf documentation.
configure.ac:19: error: possibly undefined macro: AC_ENABLE_SHARED
configure.ac:20: error: possibly undefined macro: AC_LIBTOOL_DLOPEN
configure.ac:21: error: possibly undefined macro: AC_PROG_LIBTOOL
Done.
Now you can do ./configure, make, make install.

Q: 我在运行 autogen.sh 时,遇到 aclocal 的错误,如下:

+ running aclocal -I m4 -I common/m4 …
aclocal: configure.ac: 8: macro `AM_DISABLE_STATIC\’ not found in library
aclocal: configure.ac: 17: macro `AM_PROG_LIBTOOL\’ not found in library
aclocal failed

这是怎么回事 ?

A: 这个错误指 aclocal 无法从 由libtool 安装产生 libtool.m4 文件中找到相那两个宠命令。通常这说明你没有安装 libtool ,到少表明 autogen.sh 无法找到 libtool。

这很有可能是你安装 automake (由aclocal所提供的) 时用的前缀(prefix) 和libtool不同。你可以检查一下aclocal 和 libtool 安装的前缀(prefix)是什么

Y你选择以下三种方法来解决前缀(prefix)不同的问题 :

  1.

     安装 automake 前缀(prefix) 和 libtool 一样
  2.

     force use of the automake installed in the same prefix as libtool by using the –with-automake option
  3.

     figure out what prefix libtool has been installed to and point aclocal to the right location by running

     export ACLOCAL_FLAGS="-I $(prefix)/share/aclocal"

     where you replace prefix with the prefix where libtool was installed.

Autoconf version 2.60 or higher is required
Autoconf是一个用于生成可以自动地配置软件源代码包以适应多种Unix类系统的 shell脚本的工具。由Autoconf生成的配置脚本在运行的时候与Autoconf是无关的,就是说配置脚本的用户并不需要拥有Autoconf。

由Autoconf生成的配置脚本在运行的时候不需要用户的手工干预;通常它们甚至不需要通过给出参数以确定系统的类型。相反,它们对软件包可能需要的各种特征进行独立的测试。(在每个测试之前,它们打印一个单行的消息以说明它们正在进行的检测,以使得用户不会因为等待脚本执行完毕而焦躁。)因此,它们在混合系统或者从各种常见Unix变种定制而成的系统中工作的很好。没有必要维护文件以储存由各个Unix变种、各个发行版本所支持的特征的列表。

对于每个使用了Autoconf的软件包,Autoconf从一个列举了该软件包需要的,或者可以使用的系统特征的列表的模板文件中生成配置脚本。在shell代码识别并响应了一个被列出的系统特征之后,Autoconf允许多个可能使用(或者需要)该特征的软件包共享该特征。如果后来因为某些原因需要调整shell代码,就只要在一个地方进行修改;所有的配置脚本都将被自动地重新生成以使用更新了的代码。

Metaconfig包在目的上与Autoconf很相似,但它生成的脚本需要用户的手工干预,在配置一个大的源代码树的时候这是十分不方便的。不象Metaconfig脚本,如果在编写脚本时小心谨慎, Autoconf可以支持交叉编译(cross-compiling)。

Autoconf目前还不能完成几项使软件包可移植的工作。其中包括为所有标准的目标自动创建`Makefile\’文件,包括在缺少标准库函数和头文件的系统上提供替代品。目前正在为在将来添加这些特征而工作。

对于在C程序中的#ifdef中使用的宏的名字,Autoconf施加了一些限制(参见预处理器符号索引)。

Autoconf需要GNU m4以便于生成脚本。它使用了某些UNIX版本的m4 所不支持的特征。它还会超出包括GNU m4 1.0在内的某些m4版本的内部限制。你必须使用GNU m4的1.1版或者更新的版本。使用1.3版或者更新的版本将比1.1 或1.2版快许多。

关于从版本1中升级的详情,参见从版本1中升级。关于Autoconf的开发历史,参见Autoconf的历史。对与Autoconf有关的常见问题的回答,参见关于Autoconf的问题。

把关于Autoconf的建议和bug报告发送到bug-gnu-utils@prep.ai.mit.edu。请把你通过运行`autoconf –version\’而获得的Autoconf的版本号包括在内。

6.4 利用 GNU autotools
6.4.1 入门

众多 GNU autotools 提供了一种在多重操作系统和机器架构之上构建软件的抽象机制。 在 Ports Collection 中, port 可以通过简单的方法来使用这些工具:

USE_AUTOTOOLS= 工具:版本[:操作] …

撰写本书时, 工具 可以设置为 libtool、 libltdl、 autoconf、 autoheader、 automake 或 aclocal 之一。

版本 用来指定希望使用的工具的特定版本 (参见 devel/&leftsign;automake,autoconf,libtool&rightsign;[0-9]+ 以了解有效的版本号)。

操作 是一个可选的扩展选项,用于修改如何使用工具。

可以同时指定多个不同的工具, 可以在一行中指定, 也可以用 Makefile 的 += 结构。

在开始介绍其它工具之前, 需要强调的是, 这些结构只能用于构建 port。如果希望进行跨平台的开发, 例如在 IDE 中, 则应使用 devel/gnu-&leftsign;automake,autoconf,libtool&rightsign; 这些 port。 devel/anjuta 以及 devel/kdevelop (分别对应于 GNOME 和 KDE) 是关于如何做到这一点的良好范例。
6.4.2 libtool

使用 GNU 构建框架的共享库通常会使用 libtool 来调整共享库的编译和安装, 以便与所运行的操作系统相匹配。 Ports Collection 提供了一系列经过修改以适应 FreeBSD 的不同版本的 libtool。

USE_AUTOTOOLS= libtool:版本[:inc&line;:env]

如果不使用额外的操作符, libtool:版本 将告诉构建框架 port 希望使用 libtool, 这也暗含地定义了 GNU_CONFIGURE。 configure 脚本将使用系统安装的 libtool 版本进行修补。 更进一步,还将设置一系列 make 和 shell 变量, 以便 port 使用。 请参见 bsd.autotools.mk 了解进一步的详情。

如果使用 :inc 操作符, 则会设置环境,但使用一些略微不同的补丁。

如果使用 :env 操作符, 则只设置环境。
先前的写法     新的 USE_AUTOTOOLS 结构
USE_LIBTOOL_VER=13     libtool:13
USE_INC_LIBTOOL_VER=15     libtool:15:inc
WANT_LIBTOOL_VER=15     libtool:15:env

最后, LIBTOOLFLAGS 和 LIBTOOLFILES 可以用来替换最常修改的参数, 以及将被 libtool 修补的文件。 多数 port 不需要这样做。 请参见 bsd.autotools.mk 以了解进一步的细节。

历史博文

标签:,
六月 8, 2008 at 3:56 下午 by yippee 1,135 次
Category: RAN乱
Tags: ,