Several macros are required in configure.ac to use pyconfigure. These are:
m4_include([m4/python.m4])
This macro imports all of the Python Autoconf macros. If you choose to write your own macros for other purposes, you would also include them in this manner.
AC_INIT(project_name, project_version)
This initializes Autoconf and also substitutes your project name and version in any output that it generates.
AC_CONFIG_MACRO_DIR([m4])
Now that Autoconf is initialized, we inform it of the location of our macros.
AC_PROG_PYTHON
This is the key macro. It finds the highest-version Python interpreter
available on the system and saves its path in the PYTHON
variable.
PC_PYTHON_SITE_PACKAGE_DIR
PC_PYTHON_EXEC_PACKAGE_DIR
These two macros figure out where Python expects packages to be
installed (i.e. /usr/lib/python2.7/site-packages/) and saves
them in the variables pkgpythondir and pkgpyexecdir,
respectively, for use in Makefile.in