autoconf/automake学习笔记
来源:互联网 发布:c语言 sockettcp编程 编辑:程序博客网 时间:2024/04/29 23:00
autoconf/automake学习笔记
v0.1 2013.12.12 *** 明白流程
1. 写hello.c程序
2. autoscan 生成:autoscan.log configure.scan hello.c
cat configure.scan:
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.68])
AC_INIT([FULL-PACKAGE-NAME], [VERSION], [BUG-REPORT-ADDRESS])
AC_CONFIG_SRCDIR([hello.c])
AC_CONFIG_HEADERS([config.h])
# Checks for programs.
AC_PROG_CC
# Checks for libraries.
# Checks for header files.
# Checks for typedefs, structures, and compiler characteristics.
# Checks for library functions.
AC_OUTPUT
修改成:
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.68])
AC_INIT([autoconf_test, [0.1]) # change this line!
AC_CONFIG_SRCDIR([hello.c])
AC_CONFIG_HEADERS([config.h])
AM_INIT_AUTOMAKE([autoconf], [0.1]) # add this line!
# Checks for programs.
AC_PROG_CC
# Checks for libraries.
# Checks for header files.
# Checks for typedefs, structures, and compiler characteristics.
# Checks for library functions.
AC_OUTPUT(Makefile) # change this line!
把文件名改成: configure.in
3. aclocal 生成:
aclocal.m4 autom4te.cache configure.in hello.c
(主要是生成aclocal.m4)
4. autoconf 生成:
aclocal.m4 autom4te.cache configure configure.in hello.c
5. autoheader 生成:
aclocal.m4 autom4te.cache config.h.in configure configure.in hello.c
5. 创建Makefile.am:
AUTOMAKE_OPTIONS=foreign
bin_PROGRAMS=hello
hello_SOURCES=hello.c
6. automake --add-missing
过程信息为:
configure.in:8: installing `./install-sh'
configure.in:8: installing `./missing'
Makefile.am: installing `./depcomp'
生成文件:
aclocal.m4 autom4te.cache config.h.in configure configure.in depcomp
hello.c install-sh Makefile.am Makefile.in missing
(makefile.in是这步生成的关键文件)
7. ./configure 生成最终的Makefile文件(该步骤中可能需要指定编译器:export CC=gcc)
8. make 生成最终的可执行的程序:hello, ./hello运行输出:test autoconf!
/* hello.c */
#include<stdio.h>
int main()
{
printf("test autoconf!\n");
#ifdef CONFIG_H_TEST
printf("test autoconf: test config.h\n");
#endif
return 0;
}
v0.1 2013.12.12 *** 明白流程
1. 写hello.c程序
2. autoscan 生成:autoscan.log configure.scan hello.c
cat configure.scan:
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.68])
AC_INIT([FULL-PACKAGE-NAME], [VERSION], [BUG-REPORT-ADDRESS])
AC_CONFIG_SRCDIR([hello.c])
AC_CONFIG_HEADERS([config.h])
# Checks for programs.
AC_PROG_CC
# Checks for libraries.
# Checks for header files.
# Checks for typedefs, structures, and compiler characteristics.
# Checks for library functions.
AC_OUTPUT
修改成:
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.68])
AC_INIT([autoconf_test, [0.1]) # change this line!
AC_CONFIG_SRCDIR([hello.c])
AC_CONFIG_HEADERS([config.h])
AM_INIT_AUTOMAKE([autoconf], [0.1]) # add this line!
# Checks for programs.
AC_PROG_CC
# Checks for libraries.
# Checks for header files.
# Checks for typedefs, structures, and compiler characteristics.
# Checks for library functions.
AC_OUTPUT(Makefile) # change this line!
把文件名改成: configure.in
3. aclocal 生成:
aclocal.m4 autom4te.cache configure.in hello.c
(主要是生成aclocal.m4)
4. autoconf 生成:
aclocal.m4 autom4te.cache configure configure.in hello.c
5. autoheader 生成:
aclocal.m4 autom4te.cache config.h.in configure configure.in hello.c
5. 创建Makefile.am:
AUTOMAKE_OPTIONS=foreign
bin_PROGRAMS=hello
hello_SOURCES=hello.c
6. automake --add-missing
过程信息为:
configure.in:8: installing `./install-sh'
configure.in:8: installing `./missing'
Makefile.am: installing `./depcomp'
生成文件:
aclocal.m4 autom4te.cache config.h.in configure configure.in depcomp
hello.c install-sh Makefile.am Makefile.in missing
(makefile.in是这步生成的关键文件)
7. ./configure 生成最终的Makefile文件(该步骤中可能需要指定编译器:export CC=gcc)
8. make 生成最终的可执行的程序:hello, ./hello运行输出:test autoconf!
/* hello.c */
#include<stdio.h>
int main()
{
printf("test autoconf!\n");
#ifdef CONFIG_H_TEST
printf("test autoconf: test config.h\n");
#endif
return 0;
}
0 0
- automake autoconf 学习笔记
- autoconf/automake学习笔记
- automake autoconf学习笔记
- automake / autoconf 学习笔记
- Linux Autoconf/AutoMake学习笔记
- Linux Autoconf/AutoMake学习笔记
- autoconf和automake学习笔记
- autoconf/automake 使用笔记
- GNU hello学习笔记(1)——autoconf和automake
- GNU hello学习笔记(1)——autoconf和automake
- autotools automake autoconf libtool 笔记
- autotools automake autoconf libtool 笔记
- automake和autoconf学习小结
- Automake/Autoconf
- automake & autoconf
- Autoconf/Automake
- autoconf & automake
- automake autoconf
- 学习Java中遇到的几个基本知识
- erlang 错误日志
- Magento - GRID FILTER FOR COLUMNS WITH COMPLEX VALUES
- HPC解决方案
- dom0的cpu hotplug【续】
- autoconf/automake学习笔记
- 【mysql】常用的时间类型
- 设计模式之组合模式
- C陷阱与缺陷中的一个问题——signal函数声明的剖析
- 创建用于自定义SharePoint解决方案部署的Visual Studio项目
- Socket/TCP粘包、多包和少包, 断包 问题
- 使用BSD socket编写Windows版的网络程序
- C++ int 左移运算符
- xen credit scheduler and policy