【问题标题】:error: possibly undefined macro: AC_PREFIX_CONFIG_H错误:可能未定义宏:AC_PREFIX_CONFIG_H
【发布时间】:2016-10-06 12:07:26
【问题描述】:

这是我的整个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 做什么?
  • @ztik,对不起,宏 AC_PREIX_CONFIG_H 错误,应该是 AC_PREFIX_CONFIG_H。我想生成一个可安装的 config.h,它以 PACKAGE-NAME 为前缀,如 libhot_config.h。并且此 config.h 中的宏名称将以相应的 PACKAGE-NAME 为前缀。

标签: makefile autoconf automake


【解决方案1】:

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

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

【讨论】:

  • 谢谢,我用AX_PREFIX_CONFIG_H 代替AC_PREFIX_CONFIG_Hautoconfautoheader woks.but 在运行 ./configure 时,出现新错误,如下所示:config.status: error: no prefix for _PREFIX_PKG_CONFIG_H ,@Diego
  • 这似乎是因为宏希望您定义PACKAGE(如果您调用AM_INIT_AUTOMAKE,则会发生这种情况)或传递第二个参数。
猜你喜欢
  • 1970-01-01
  • 2014-04-19
  • 2015-04-18
  • 1970-01-01
  • 1970-01-01
  • 2019-05-07
  • 2012-02-07
  • 1970-01-01
相关资源
最近更新 更多