D'Arcy J.M. Cain writes:
> I have a change I would like to discuss. It doesn't change the code
> base, only the build system. The patches I would like to commit follow
> this text. The only thing it does is create a config option to bytecode
> compile the Python modules.
We've seen such a patch before, but I'm still not convinced it works.
According to my knowledge, the pre-compiled bytecode files need to be
created after the source files have been installed in their final
location, because the file name and timestamp is encoded in the compiled
file (it's sort of used as a cache file). While this can be accomplished
with a different patch, it wouldn't really work when DESTDIR is used
because you'd create a "dead" cache file. In a sense, this operation is
like running ldconfig -- it's outside the scope of the build system.
Package managers typically put it in the "post install" section.
> +# If python is enabled (above), then optionally byte-compile the modules.
> +AC_MSG_CHECKING([whether to byte-compile Python modules])
> +if test "$with_python" = yes; then
> + PGAC_ARG_BOOL(with, python_compile, no,
> + [ --with-python-compile byte-compile modules if Python is enabled])
--enable
> +else
> + with_python_compile=no
> +fi
> +AC_MSG_RESULT([$with_python_compile])
> +AC_SUBST([with_python_compile])
> +%.pyc: %.py
> + python -c "import py_compile; py_compile.compile(\"$<\")"
> +
> +%.pyo: %.py
> + python -O -c "import py_compile; py_compile.compile(\"$<\")"
> +
$(PYTHON)
--
Peter Eisentraut peter_e@gmx.net