【发布时间】: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