autotool

autotool能够自动生成Makefile文件,

㈠如果你是root用户登陆,在/root目录下建立项目,用autoscal后生成的configure.scan内容如下:

#                                               -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.

AC_PREREQ(2.57)
#AC_INIT(FULL-PACKAGE-NAME, VERSION, BUG-REPORT-ADDRESS)

AC_INIT(name,1.0)

AM_INIT_AUTOMAKE(name,1.0)
AC_CONFIG_SRCDIR([k.c])
AM_CONFIG_HEADER([config.h])

# Checks for programs.
AC_PROG_CC
AC_PROG_AWK
AC_PROG_INSTALL

# Checks for libraries.

# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([stdlib.h string.h])

# Checks for typedefs, structures, and compiler characteristics.

# Checks for library functions.
AC_CHECK_FUNCS([atexit])

AC_CONFIG_FILES([.Trash/makefile
                 makefile])
AC_OUTPUT
其中黑体字为要修改和添加的内容,让后可以依次执行aclocal,autoconf,autoheader,用vim编辑Makefile.am文件,automake--add-missing,automake,./configure就可生成Makefile文件。

㈡如果你是非root用户登陆,在其他目录下,autoscan后生成的文件如下:

#                                               -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.

AC_PREREQ(2.57)
#AC_INIT(FULL-PACKAGE-NAME, VERSION, BUG-REPORT-ADDRESS)

AC_INIT(name,1.0)

AM_INIT_AUTOMAKE(name,1.0)
AC_CONFIG_SRCDIR([he.c])
AM_CONFIG_HEADER([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(Makefile)

文件中会少AC_CHECK_FUNCS([atexit])

AC_CONFIG_FILES([.Trash/makefile
                 makefile])

这两行,需要把末尾一行改为AC_OUTPUT(Makefile)否则不会生成Makefile文件,其他操作相同。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

王小蓝

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值