首页 > 学院 > 开发设计 > 正文

autoconf 与 automake

2019-11-06 09:08:27
字体:
来源:转载
供稿:网友
当我们在linux下利用源码安装开源软件时,通常采用 ./configure -> make -> make install 的方式。打开其中的makefile,组件相当复杂,有些还是多目录结构。 在网上搜索了相关的方法,发现了几个好用的开源工具:autoconf 与 automake。 确保已安装如下命令: autoscan, aclocal, autoconf, automake 否则sudo apt-get install之。 执行如下命令即可完成配置:aclocal; autoconf; automake --add-missing; ./configure; make; ./helloworld

一切还是从HelloWorld开始: 1. 新建helloworld目录以及三个文件 helloworld.c, configure.in, Makefile.am

这里写图片描述

2. 编写简单的hello world示例程序:

这里写图片描述

3. 执行autoscan

这里写图片描述

4. 执行mv configure.in configure.ac 5. 执行aclocal; autoconf

这里写图片描述 6. touch NEWS README AUTHORS ChangeLog 7. automake –add-missing 这里写图片描述 8. ./configure; make; ./helloworld 这里写图片描述

搞定!


发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表