Chinaunix首页 | 论坛 | 博客
  • 博客访问: 69165
  • 博文数量: 15
  • 博客积分: 602
  • 博客等级:
  • 技术积分: 172
  • 用 户 组: 普通用户
  • 注册时间: 2009-09-07 13:35
文章分类

全部博文(15)

文章存档

2011年(8)

2010年(2)

2009年(5)

分类: LINUX

2009-10-15 16:09:38

kernel:2.6.27.30-170.2.82_ND5_1.i686.PAE


1.you should create your source code by hand.
e.g. you can write a simple code, like main.c"main(void) {}";

2.use the command autoscan, this command will generate two files:autoscan.log, configure.scan;

3.next step is the most important, you should change the name of the configure.scan instead of configure.in;

and then edit the file configure.in, you should place the FULL-PACKAGE-NAME, VERSION, BUG-REPORT-ADDRESS in your own definations, and the most important step is to add a sentence "AM_INIT_MAKE(PACKAGE-NAME, VERSION)" into configure.in, and replace the AC_OUTPUT to AC_OUTPUT([Makefile])

4.use aclocal to generate the "aclocal.m4" and "autom4te.cache", these files are used to deine the local marco

5.use autoconf to generate the configure file

6.use autoheader to generate the config.h.in.This tool is used to copy the additional symbols from user usually, if you do not add the additional symbols, then you needn't execute this command.

7.Before automake.
  Create a new file Makefile.am, this file will be used by automake command. It's the configuration files, and we need create it by self.
  The content like the following:
  -----------------------------
  AUTOMAKE_OPTIONS=foreign
  bin_PROGRAMS=bin-name
  bin-name_SOURCES=sourcecode
  -----------------------------
==========================================================================
  Tip:
  1).the AUTOMAKE_OPTION can used to configure the automake, the 'foreign' means only check the requires file. another is 'gnits', the default is 'gnu'. If default, you should create these files 'COPYING,NEWS,INSTALL,README' and so on;
  2).bin_PROGRAMS used to define the execute filename, if you have a lot, you should use space to split them. for example: bin_PROGRAMS=a b c
  3).exec-name_SOURCES to define the source code that can be used to generate the exec-name. If the target exec-name needs 1.c 1.h, then you should write like this: exec-name_SOURCES=1.c 1.h
==========================================================================
  Caution: if you define a lot exe-names, you should write the exe-name_SOURCES for each.

  for a instance, bin_PROGRAMS=a b c
                  a_SOURCES=a.c
                  b_SOURCES=b.c
                  c_SOURCES=c.c

8.use automake to generate the Makefile.in
  #automake --add-missing
  option '--add-missing' let automake add the requires scripts when running.

9.Verify, use ./configure to generate the Makefile.

10.test it. #make && make install

阅读(1425) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~