error: possibly undefined macro: AC_PREFIX_CONFIG_H

error: possibly undefined macro: AC_PREFIX_CONFIG_H

这是我的全部configure.ac(由自动扫描生成),我在这个脚本中添加了一行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

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

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