I have a project written mainly in C ++, which includes several helper scripts written in python. Currently scripts contain variables replaced by autotools:
...
try:
datapath = os.environ['DATA_PATH']
except KeyError:
datapath = '@pkgdatadir@'
And here is an excerpt from Makefile.am:
BUILT_SOURCES = script.py
nodist_python_PYTHON = script.py
CLEANFILES = $(python_PYTHON)
EXTRA_DIST = script.py.in
do_subst = sed -e 's,[@]PYTHON[@],$(PYTHON),g'\
-e 's,[@]pkgdatadir[@],$(pkgdatadir),g'
script.py: script.py.in
$(do_subst) < $< > $@
chmod +x $@
There are also several module dependencies in these scripts that are likely to be handled better with the setup.py script.
So what is the best way to mix autotools and python distutils tools? Should I completely rely on vending machines? Otherwise, how can I integrate setup.py startup into Makefile.am?
source
share