new file mode 100644
@@ -0,0 +1,39 @@
+Fix the build to do out-of-tree properly.
+
+The patches are in progress but are being submitted upstream.
+
+Upstream-Status: Submitted [https://bugs.ghostscript.com/show_bug.cgi?id=709289]
+Signed-off-by: Ross Burton <ross.burton@arm.com>
+
+diff -rU3 a/configure.ac b/configure.ac
+--- a/configure.ac 2025-09-09 10:36:39.000000000 +0100
++++ b/configure.ac 2026-03-31 15:35:08.988262612 +0100
+@@ -400,7 +400,7 @@
+ *)
+ ARCH_CONF_HEADER=
+ if test x"$host" != x"$build"; then
+- ARCH_CONF_HEADER="\$(GLSRCDIR)/../$ARCH_AUTOCONF_HEADER"
++ ARCH_CONF_HEADER="./$ARCH_AUTOCONF_HEADER"
+ else
+ ARCH_CONF_HEADER=
+ fi
+@@ -869,8 +869,8 @@
+ AC_SUBST(RECURSIVE_MUTEXATTR)
+
+ dnl Tesseract/Leptonica detection
+-TESSERACTDIR=tesseract
+-LEPTONICADIR=leptonica
++TESSERACTDIR=$srcdir/tesseract
++LEPTONICADIR=$srcdir/leptonica
+ OCR_VERSION=0
+ OCR_SHARED=0
+ LEPTONICAINCLUDE=
+@@ -886,7 +886,7 @@
+
+ if test x$with_tesseract != xno; then
+ AC_MSG_CHECKING([for local Tesseract library source])
+- if test -d $srcdir/tesseract && test -d $srcdir/leptonica; then
++ if test -d $TESSERACTDIR && test -d $LEPTONICADIR; then
+ AC_MSG_RESULT([yes])
+
+ if test x$with_tesseract != xno; then
@@ -25,6 +25,7 @@ SRC_URI = "https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/downlo
file://ghostscript-9.16-Werror-return-type.patch \
file://avoid-host-contamination.patch \
file://0001-Fix-32-bit-build.patch \
+ file://out-of-tree.patch \
"
SRC_URI[sha256sum] = "5bd6da34794928cc7e616f288e32bd0be7f9a5ca2d3c206a0af2c19a4e3a318f"
@@ -48,8 +49,7 @@ EXTRA_OECONF:append:armv7ve = "${@bb.utils.contains('TUNE_FEATURES','neon','','
TARGET_CFLAGS += "-std=gnu17 -Wno-error=declaration-after-statement -fPIC"
-# Uses autoconf but not automake, can't do out-of-tree
-inherit autotools-brokensep pkgconfig
+inherit autotools pkgconfig
# Prune the source tree of libraries that we're using our packaging of, so that
# ghostscript can't link to them. Can't prune zlib as that's needed for the
Upstream said that out-of-tree builds were meant to work, so I found the few instances where path assumptions were incorrect and enabled it. This gives us more reliable builds as we can always throw away the build tree when reconfiguring. Signed-off-by: Ross Burton <ross.burton@arm.com> --- .../ghostscript/ghostscript/out-of-tree.patch | 39 +++++++++++++++++++ .../ghostscript/ghostscript_10.06.0.bb | 4 +- 2 files changed, 41 insertions(+), 2 deletions(-) create mode 100644 meta/recipes-extended/ghostscript/ghostscript/out-of-tree.patch