autoconf 与 automake

 当我们在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
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值