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
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