autoconf问题

http://hi.baidu.com/vivo01/item/6094af117ded9eed9913d65c

http://hi.baidu.com/o92iwe0ija9j0/item/36e189908be1994bf14215d1

If you get the following error when compiling GD 2.0.34 or higher:

Trying to make gd...
cd . && /bin/sh
/usr/local/directadmin/customapache/gd-2.0.34/config/missing --run autoheader
configure.ac:28: error: Autoconf version 2.58 or higher is required
aclocal.m4:7856: AM_INIT_AUTOMAKE is expanded from...
configure.ac:28: the top level
autom4te: /usr/bin/m4 failed with exit status: 1
autoheader: /usr/bin/autom4te failed with exit status: 1

Run the following to fix it:

cd /usr/src
wget http://files.directadmin.com/services/custombuild/autoconf-2.61.tar.gz
tar xzf autoconf-2.61.tar.gz
cd autoconf-2.61
./configure --prefix=/usr
make
make install

 

### Autoconf 配置工具介绍 Autoconf 是一种用于生成可移植的 `configure` 脚本的工具,这些脚本可以自动检测目标系统的特性并相应地调整软件构建过程。以下是关于 Autoconf 的详细介绍以及其基本使用方法: #### 什么是 AutoconfAutoconf 是 GNU 构建系统的一部分,它通过处理输入文件(通常是名为 `configure.ac` 或 `aclocal.m4` 的文件),生成一个名为 `configure` 的 Shell 脚本[^2]。这个脚本可以在不同的平台上运行,以检查编译环境中的各种依赖项和功能。 #### 基本工作流程 1. **编写 configure.ac 文件** 用户需要创建一个描述项目需求的宏文件,通常命名为 `configure.ac`。此文件包含了定义项目的元数据、所需库和其他特定条件的一系列宏调用。 2. **执行 aclocal** 使用 `aclocal` 程序扫描 `configure.ac` 中使用的宏,并生成辅助文件 `aclocal.m4`,其中包含所有必要的自定义宏定义。 3. **运行 autoconf** 执行命令 `autoconf` 将会读取 `configure.ac` 和其他支持文件,最终生成适合分发给用户的 `configure` 脚本。 4. **生成 Makefile.in 文件** 如果还需要自动化生成 Makefiles,则需配合 Automake 工具一起使用。Automake 可以基于模板文件(如 `Makefile.am`)生成标准格式的 `Makefile.in` 文件。 5. **完成配置阶段** 当用户下载源码包后,在本地环境中只需简单运行以下几条指令即可完成安装准备: ```bash ./configure make sudo make install ``` #### 示例代码展示 下面是一个简单的例子演示如何设置最小化的 Autoconf 项目结构: ##### 创建 configure.ac 文件 ```bash AC_INIT([hello], [1.0], [bug-report@example.com]) AM_INIT_AUTOMAKE([-Wall -Werror foreign]) AC_PROG_CC AC_CONFIG_FILES([Makefile]) AC_OUTPUT ``` ##### 编写 Makefile.am 文件 (如果适用) ```makefile bin_PROGRAMS = hello hello_SOURCES = main.c ``` ##### 主 C 源文件 main.c ```c #include <stdio.h> int main() { printf("Hello, world!\n"); return 0; } ``` ##### 自动生成 configure 脚本及相关文件 依次执行如下命令初始化整个构建体系: ```bash aclocal autoconf automake --add-missing ./configure make ./hello ``` 以上步骤展示了从零开始建立一套完整的 GNU 自动化构建框架的过程[^1]。 ---
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值