]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
auth: allow building in separate build directory 13642/head
authorChris Hofstaedtler <chris.hofstaedtler@deduktiva.com>
Fri, 15 Dec 2023 20:21:36 +0000 (21:21 +0100)
committerChris Hofstaedtler <chris.hofstaedtler@deduktiva.com>
Fri, 15 Dec 2023 20:29:34 +0000 (21:29 +0100)
This allows building at least the auth in a mostly default configuration like
this:

```
mkdir build && cd build && \
autoreconf --install --force --verbose .. && \
../configure ...
```

docs/Makefile.am
pdns/Makefile.am

index 9db391243ca6cbd7b470bfd01d36ba45c570f5fb..f9dab778a603a61f8ae7c540adcced6be5813ecf 100644 (file)
@@ -62,14 +62,14 @@ endif # if !HAVE_MANPAGES
 mans/.complete: manpages := $(addprefix manpages/,$(addsuffix .rst,$(MANPAGES_DIST)))
 mans/.complete: .venv
        rm -rf "$(@D).tmp"
-       .venv/bin/python -msphinx -b man . "$(@D).tmp" $(manpages) && rm -rf "$(@D)" && mv "$(@D).tmp" "$(@D)"
+       (cd "${srcdir}" && $(CURDIR)/.venv/bin/python -msphinx -b man . "$(CURDIR)/$(@D).tmp" $(manpages)) && rm -rf "$(@D)" && mv "$(@D).tmp" "$(@D)"
        touch "$@"
        rm -rf "$(@D).tmp"
 
 .venv: requirements.txt
        $(PYTHON) -m venv .venv
        .venv/bin/pip install -U pip setuptools setuptools-git wheel
-       .venv/bin/pip install -r requirements.txt
+       .venv/bin/pip install -r ${srcdir}/requirements.txt
 
 .NOTPARALLEL: \
        all-docs \
index 870588bce04f6ed57a9ccf89c7c411118ef73e69..e93a0fd7eef4b190675f3ce160c646ff70bbbd90 100644 (file)
@@ -96,15 +96,15 @@ endif
 
 # use a $(wildcard) wrapper here to allow build to proceed if output
 # file is present but input file is not (e.g. in a dist tarball)
-api-swagger.yaml: $(wildcard ../docs/http-api/swagger/authoritative-api-swagger.yaml)
+api-swagger.yaml: $(wildcard ${srcdir}/../docs/http-api/swagger/authoritative-api-swagger.yaml)
        cp $< $@
 
 if HAVE_VENV
 api-swagger.json: api-swagger.yaml requirements.txt
        $(PYTHON) -m venv .venv
        .venv/bin/pip install -U pip setuptools setuptools-git wheel
-       .venv/bin/pip install -r requirements.txt
-       .venv/bin/python convert-yaml-to-json.py $< $@
+       .venv/bin/pip install -r ${srcdir}/requirements.txt
+       .venv/bin/python ${srcdir}/convert-yaml-to-json.py $< $@
 else # if HAVE_VENV
 if !HAVE_API_SWAGGER_JSON
 api-swagger.json:
@@ -114,7 +114,8 @@ endif
 endif
 
 apidocfiles.h: api-swagger.yaml api-swagger.json
-       ./incfiles $^ > $@
+       $(AM_V_GEN)$(srcdir)/incfiles $^ > $@.tmp
+       @mv $@.tmp $@
 
 sysconf_DATA = pdns.conf-dist