Search code examples
makefileautoconfautomake

error: possibly undefined macro: AC_PREFIX_CONFIG_H


This is my whole configure.ac(generated by autoscan),and i add a line AC_PREIX_CONFIG_H(hotplugin) in this script:

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

When running autoconf in that project, I get the error:

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.

And my tool lists:

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

Solution

  • You typoed the macro: AC_PREIX_CONFIG_H does not exist; AC_PREFIX_CONFIG_H used to, but it's obsolete, the correct one is AX_PREFIX_CONFIG_H.

    Also if you want to use this macro you should look at how to use external macro files (full disclosure: I wrote that documentation.)