错误:可能是未定义的宏:AC_PREFIX_CONFIG_H

时间:2016-10-06 12:07:27

标签: makefile autoconf automake

这是我的整个configure.ac(由autoscan生成),我在这个脚本中添加一行AC_PREIX_CONFIG_H(hotplugin)

AC_PREREQ([2.63])
AC_INIT([hotplugin], [0.1])
AC_CONFIG_SRCDIR([loader.c])
AC_CONFIG_HEADERS([config.h])

# Checks for programs.
AC_PROG_CXX
AC_PROG_CC

# Checks for libraries.
# FIXME: Replace `main' with a function in `-ldl':
AC_CHECK_LIB([dl], [main])
# FIXME: Replace `main' with a function in `-lhotp':
AC_CHECK_LIB([hotp], [main])

# Checks for header files.
AC_CHECK_HEADERS([fcntl.h limits.h stddef.h stdint.h stdlib.h string.h sys/time.h unistd.h])

# Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_STDBOOL
AC_TYPE_OFF_T
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_TYPE_SSIZE_T

# Checks for library functions.
AC_FUNC_MALLOC
AC_FUNC_REALLOC
AC_CHECK_FUNCS([memset strchr strdup strerror strstr strtol strtoul])

AC_CONFIG_FILES([makefile])
AC_PREIX_CONFIG_H(hotplugin)
AC_OUTPUT

在该项目中运行autoconf时,出现错误:

configure.ac:35: error: possibly undefined macro: AC_PREIX_CONFIG_H
  If this token and others are legitimate, please use m4_pattern_allow.
  See the Autoconf documentation.

我的工具列出:

autoconf (GNU Autoconf) 2.63
autoscan (GNU Autoconf) 2.63
autoheader (GNU Autoconf) 2.63
m4 (GNU M4) 1.4.13
libtoolize (GNU libtool) 2.2.6b

1 个答案:

答案 0 :(得分:1)

您输入了宏:AC_PREIX_CONFIG_H不存在; AC_PREFIX_CONFIG_H曾经过时,但已经过时了,正确的是AX_PREFIX_CONFIG_H

此外,如果你想使用这个宏,你应该看看如何使用external macro files(完全披露:我写了那个文档。)