autoconf 与 automake

来源:互联网 发布:淘宝介入卖家不举证 编辑:程序博客网 时间:2024/05/22 16:50
 当我们在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
这里写图片描述

搞定!

0 0
原创粉丝点击