linux下autoscan, aclocal, autoconf, automake以及Makefile.am, Configure.in等文件和工具的使用
2015-10-22 23:05
751 查看
本文转自:http://blog.chinaunix.net/uid-26575352-id-3411843.html
本文章简单介绍了linux下autoscan, aclocal, autoconf, automake以及Makefile.am, Configure.in等文件和工具的使用。
autoscan # 根据路径下生成configure.scan 和 autoscan.log
aclocal # 产生 aclocal.m4
autoconf # 根据 configure.in 生成configure
automake --add-missing # 根据 Makefile.am生成Makefile.in
例子:在/hello/目录下创建一个hello.c文件,并编译运行它:
#cd /hello/
(1) 编写源文件hello.c:
#include <stdio.h>
int main(int argc, char** argv)
{
printf("Hello, GNU!n");
return 0;
}
(2) #autoscan
->生成 configure.scan 和 autoscan.log
(3) 将configure.scan 修改为 configure.in:
并修改configure.in内容如下
# Process this file with autoconf to produce a configure script.
AC_INIT(hello.c)
AM_INIT_AUTOMAKE(hello, 1.0)
# Checks for programs.
AC_PROG_CC
# Checks for library functions.
AC_OUTPUT(Makefile)
(4) #aclocal
->生成 aclocal.m4 和 autom4te.cache (生成aclocal.m4的过程中涉及到configure.in)
(5) #autoconf
->生成 configure (根据 configure.in, 和 aclocal.m4)
(6) 编写Makefile.am:
AUTOMAKE_OPTIONS= foreign
bin_PROGRAMS= hello
hello_SOURCES= hello.c
(7) #automake --add-missing
->生成 Makefile.in, depcomp, install-sh, 和 missing (根据 Makefile.am, 和 aclocal.m4)
(8) #./configure
->生成 Makefile, config.log, 和 config.status
(9) 在configure时指定需要链接的外部头文件和库
注意export
---------------------------------------------------------------------------------------------------------------------------------------------------------------------
本文转自 http://blog.chinaunix.net/uid-26575352-id-3411843.html
其他相关资料:
《automake连载---关于两个文件configure.in和Makefile.am的编写》
《图解autoscan、aclocal、autoheader、automake、autoconf、configure、make 》
本文章简单介绍了linux下autoscan, aclocal, autoconf, automake以及Makefile.am, Configure.in等文件和工具的使用。
autoscan # 根据路径下生成configure.scan 和 autoscan.log
aclocal # 产生 aclocal.m4
autoconf # 根据 configure.in 生成configure
automake --add-missing # 根据 Makefile.am生成Makefile.in
例子:在/hello/目录下创建一个hello.c文件,并编译运行它:
#cd /hello/
(1) 编写源文件hello.c:
#include <stdio.h>
int main(int argc, char** argv)
{
printf("Hello, GNU!n");
return 0;
}
(2) #autoscan
->生成 configure.scan 和 autoscan.log
(3) 将configure.scan 修改为 configure.in:
并修改configure.in内容如下
# Process this file with autoconf to produce a configure script.
AC_INIT(hello.c)
AM_INIT_AUTOMAKE(hello, 1.0)
# Checks for programs.
AC_PROG_CC
# Checks for library functions.
AC_OUTPUT(Makefile)
(4) #aclocal
->生成 aclocal.m4 和 autom4te.cache (生成aclocal.m4的过程中涉及到configure.in)
(5) #autoconf
->生成 configure (根据 configure.in, 和 aclocal.m4)
(6) 编写Makefile.am:
AUTOMAKE_OPTIONS= foreign
bin_PROGRAMS= hello
hello_SOURCES= hello.c
(7) #automake --add-missing
->生成 Makefile.in, depcomp, install-sh, 和 missing (根据 Makefile.am, 和 aclocal.m4)
(8) #./configure
->生成 Makefile, config.log, 和 config.status
(9) 在configure时指定需要链接的外部头文件和库
注意export
export LDFLAGS="-L/home/songwei/double-conversion/" CPPFLAGS="-I/home/songwei/double-conversion/src/" CFLAGS="-I/home/songwei/double-conversion/src/" LIBS="-ldouble_conversion -ldouble_conversion_pic" ./configure --prefix=/usr/local/folly
---------------------------------------------------------------------------------------------------------------------------------------------------------------------
本文转自 http://blog.chinaunix.net/uid-26575352-id-3411843.html
其他相关资料:
《automake连载---关于两个文件configure.in和Makefile.am的编写》
《图解autoscan、aclocal、autoheader、automake、autoconf、configure、make 》
相关文章推荐
- CentOS下MYSQL数据库的安装
- CentOS6 Python CGI程序示例
- Linux/Ubuntu下的PPPoE拨号上网方法
- linux 下载安装 Scientific Toolworks Understand
- CentOS 6.5下JIRA安装部署
- Wolfram Mathematica 10.3 Windows / Linux / MacOsx
- 第 三 十 八 天:Linux 的 LVM 逻 辑 卷 管 理
- linux下lsof实现对误删文件的恢复
- linux中.config,makefile,kconfig
- 64位Linux编译cximage手记
- Linux安装mysql——源码安装
- Linux 循环遍历文件目录
- linux下使用yum安装mysql详解
- linux 批量修改文件后缀名
- 第三十八天:分区 -- Parte
- Linux下fork()函数
- Linux监控软件之 Zabbix
- Centos6.6安装简易桌面环境
- linux编辑网口地址
- Linux命令行删除文件恢复