automake autoconf学习笔记

来源:互联网 发布:夜神模拟器mac版问题 编辑:程序博客网 时间:2024/05/17 00:54
1建目录
mkdir hello
cd hello


2建hello.c
#include <stdio.h>
int main(int argc, char** argv){
     printf("%s", 'Hello, Linux World!\n");
     return 0;
}


3autoscan


4将autoscan生成的configure.scan改成configure.in


5修改configure.in
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_INIT(helloworld.c)
AM_INIT_AUTOMAKE(helloworld, 1.0)
# 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)


6aclocal


7autoconf


8建Makefile.am
内容如下:
AUTOMAKE_OPTIONS=foreign
bin_PROGRAMS=hello
hello_SOURCES=hello.c


9automake --add-missing


10./configure


11make


12./hello


学习自网页:http://www.laruence.com/2009/11/18/1154.html
0 0
原创粉丝点击