$ ninja -C build update-constants -v
ninja: Entering directory `build'
[1/1] /home/zbyszek/src/python-systemd/update-constants.py /home/zbyszek/src/python-systemd/src/systemd/id128-constants.h /home/zbyszek/src/python-systemd/docs/id128.rst /home/zbyszek/src/python-systemd/src/systemd/id128-defines.h /usr/include/systemd/sd-messages.h
Writing /home/zbyszek/src/python-systemd/src/systemd/id128-constants.h…
Writing /home/zbyszek/src/python-systemd/src/systemd/id128-defines.h…
Writing /home/zbyszek/src/python-systemd/docs/id128.rst…
The helper is updated to do the everything in the python script. The wrapper in
Makefile is dropped. It wasn't working properly anyway, and I think the version
in meson is enough.
python insists on adding . to python.path, so we always import the systemd
in the top-level directory instead of the one in build/ that we want. Let's
cd into docs/ first, so that we get the right module imported.
Also, replace sphinx-build calls with $(PYTHON) -m sphinx. This has the
advantage that once $(PYTHON) is set, the appropriate sphinx executable is
chosen.
In systemd-233 the format of the constants file changed to use
SD_ID128_MAKE_STR macro and long lines are broken with '\'.
Doing this in sed is too anyoing — add a simple python script to
do the processing.
gcc warns about an include directive that shadows the system include
directory at high verbosity levels. Let's filter it out (pkgconfig
implements that) to reduce noise and also to make the command line
shorter.
This way we can compile against unreleased systemd:
make PYTHON=python3 INCLUDE_DIR=/home/zbyszek/src/systemd/src
(cd build/lib.linux-x86_64-3.5; systemd-socket-activate -E LD_LIBRARY_PATH=/home/zbyszek/src/systemd-master/.libs -l2000 -l127.0.0.1:2001 python3)
Instead of generating the list of message ids anew during every build,
the file is generated manually and committed into the
repository. Also, the list of defines is stored in id128-defines.h,
also kept in the repository. Both files should only grow.
This should make build easier. But it also fixes a problem with
systemd, which occasionally drops message definitions. We will keep
them forever, so it should be safe to rely on the presence of message
definitions which systemd does not use anymore.
Fixes#23.