diff --git a/meta-oe/recipes-graphics/xdotool/xdotool/pc.sh b/meta-oe/recipes-graphics/xdotool/xdotool/pc.sh
new file mode 100644
index 0000000000..da7c81d75d
--- /dev/null
+++ b/meta-oe/recipes-graphics/xdotool/xdotool/pc.sh
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+VERSION=$1
+LIBDIR=$2
+INCLUDEDIR=$3
+
+cat <<ENDPC
+libdir=${LIBDIR}
+includedir=${INCLUDEDIR}
+
+Name: libxdo
+Description: fake keyboard/mouse input, window management, and more
+Version: ${VERSION}
+Requires: x11
+Libs: -L\${libdir} -lxdo
+Cflags: -I\${includedir}
+ENDPC
diff --git a/meta-oe/recipes-graphics/xdotool/xdotool_4.20251130.1.bb b/meta-oe/recipes-graphics/xdotool/xdotool_4.20251130.1.bb
index e2792ed0b0..a1a792f45d 100644
--- a/meta-oe/recipes-graphics/xdotool/xdotool_4.20251130.1.bb
+++ b/meta-oe/recipes-graphics/xdotool/xdotool_4.20251130.1.bb
@@ -9,7 +9,13 @@ inherit features_check pkgconfig perlnative
 # depends on virtual/libx11
 REQUIRED_DISTRO_FEATURES = "x11"
 
-SRC_URI = "https://github.com/jordansissel/${BPN}/releases/download/v${PV}/${BP}.tar.gz"
+# The release tarball ships a prebuilt (and wrongly pathed) libxdo.pc but omits
+# pc.sh, which the Makefile's installpc rule needs to (re)generate libxdo.pc.
+# Depending on the unpack mtime ordering of VERSION vs libxdo.pc, make tries to
+# rebuild libxdo.pc and fails with "sh: 0: cannot open pc.sh". Supply the
+# upstream pc.sh so regeneration works with the correct libdir/includedir.
+SRC_URI = "https://github.com/jordansissel/${BPN}/releases/download/v${PV}/${BP}.tar.gz \
+           file://pc.sh"
 SRC_URI[sha256sum] = "eee789b00d6a13d47b31bbc139727e6408c21b5f6ba5e804fdf6ecfb8c781356"
 
 EXTRA_OEMAKE = "PREFIX=${prefix} INSTALLLIB=${libdir} INSTALLMAN=${mandir} WITHOUT_RPATH_FIX=1"
@@ -17,6 +23,10 @@ EXTRA_OEMAKE = "PREFIX=${prefix} INSTALLLIB=${libdir} INSTALLMAN=${mandir} WITHO
 UPSTREAM_CHECK_URI = "https://github.com/jordansissel/xdotool/tags"
 UPSTREAM_CHECK_REGEX = "v(?P<pver>\d+\.\d{8}\.\d+)"
 
+do_configure:append() {
+    install -m 0755 ${UNPACKDIR}/pc.sh ${S}/pc.sh
+}
+
 do_install() {
     oe_runmake install DESTDIR=${D} PREFIX=${prefix} LDCONFIG=true
 }
