From e4894574874089cfa37a7a5089791f4643ecd5d1 Mon Sep 17 00:00:00 2001 From: Kienan Stewart Date: Wed, 6 Dec 2023 13:37:47 -0500 Subject: [PATCH] fix: invoke MKDIR_P before changing directories In autoconf < 2.72d `AC_PROG_MKDIR_P` may fall back to using `install-sh` and that may be referenced as a relative path. To avoid issues with relative paths causing the command to not be found, the build directories are created before changing the working directory. One way to to test the behaviour prior to this commit is to configure the build similar to the following: ./configure MKDIR_P="$(realpath --relative-to="$(pwd)" \ $(command -v mkdir))" BUILD_EXAMPLES_FROM_TREE=1 Fixes https://bugs.lttng.org/issues/1404 Change-Id: I2d66254cd8c208f9236d55c6ef1b83c580560c7c Signed-off-by: Kienan Stewart Signed-off-by: Mathieu Desnoyers --- doc/examples/Makefile.am | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/doc/examples/Makefile.am b/doc/examples/Makefile.am index 727aa7ce..57782cce 100644 --- a/doc/examples/Makefile.am +++ b/doc/examples/Makefile.am @@ -213,9 +213,8 @@ all-local: if [ x"$(SUBDIRS_CMAKE)" != x"" ]; then \ for subdir in $(SUBDIRS_CMAKE); do \ ( \ - cd $$subdir && \ - $(MKDIR_P) build && \ - cd build && \ + $(MKDIR_P) $$subdir/build && \ + cd $$subdir/build && \ AR="$(AR)" \ CC="$(CC)" \ CXX="$(CXX)" \ -- 2.34.1